Files
StudyDiary-20261009/.obsidian/plugins/obsidian-raindrop-highlights/main.js

704 lines
1.6 MiB
JavaScript
Raw Normal View History

2026-10-09 22:06:40 +08:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __typeError=msg=>{throw TypeError(msg)};var __defNormalProp=(obj,key2,value)=>key2 in obj?__defProp(obj,key2,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key2]=value;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __export=(target,all3)=>{for(var name in all3)__defProp(target,name,{get:all3[name],enumerable:!0})},__copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key2 of __getOwnPropNames(from))!__hasOwnProp.call(to,key2)&&key2!==except&&__defProp(to,key2,{get:()=>from[key2],enumerable:!(desc=__getOwnPropDesc(from,key2))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod)),__toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:!0}),mod);var __publicField=(obj,key2,value)=>__defNormalProp(obj,typeof key2!="symbol"?key2+"":key2,value),__accessCheck=(obj,member,msg)=>member.has(obj)||__typeError("Cannot "+msg);var __privateGet=(obj,member,getter)=>(__accessCheck(obj,member,"read from private field"),getter?getter.call(obj):member.get(obj)),__privateAdd=(obj,member,value)=>member.has(obj)?__typeError("Cannot add the same private member more than once"):member instanceof WeakSet?member.add(obj):member.set(obj,value),__privateSet=(obj,member,value,setter)=>(__accessCheck(obj,member,"write to private field"),setter?setter.call(obj,value):member.set(obj,value),value),__privateMethod=(obj,member,method)=>(__accessCheck(obj,member,"access private method"),method);var require_nunjucks=__commonJS({"node_modules/.pnpm/nunjucks@3.2.4/node_modules/nunjucks/browser/nunjucks.js"(exports,module2){(function(root2,factory2){typeof exports=="object"&&typeof module2=="object"?module2.exports=factory2():typeof define=="function"&&define.amd?define([],factory2):typeof exports=="object"?exports.nunjucks=factory2():root2.nunjucks=factory2()})(typeof self!="undefined"?self:exports,function(){return(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module3=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module3.exports,module3,module3.exports,__webpack_require__),module3.l=!0,module3.exports}return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.d=function(exports2,name,getter){__webpack_require__.o(exports2,name)||Object.defineProperty(exports2,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module3){var getter=module3&&module3.__esModule?function(){return module3.default}:function(){return module3};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object2,property){return Object.prototype.hasOwnProperty.call(object2,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=11)})([(function(module3,exports2,__webpack_require__){"use strict";var ArrayProto=Array.prototype,ObjProto=Object.prototype,escapeMap={"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","\\":"&#92;"},escapeRegex2=/[&"'<>\\]/g,exports2=module3.exports={};function hasOwnProp(obj,k){return ObjProto.hasOwnProperty.call(obj,k)}exports2.hasOwnProp=hasOwnProp;function lookupEscape(ch){return escapeMap[ch]}function _prettifyError(path,withInternals,err){if(err.Update||(err=new exports2.TemplateError(err)),err.Update(path),!withInternals){var old=err;err=new Error(old.message),err.name=old.name}return err}exports2._prettifyError=_prettifyError;function TemplateError(message,lineno,colno){var err,cause;message instanceof Error&
`,this.firstUpdate&&(msg+=" "),this.message=msg+(this.message||""),this.firstUpdate=!1,this},err}Object.setPrototypeOf?Object.setPrototypeOf(TemplateError.prototype,Error.prototype):TemplateError.prototype=Object.create(Error.prototype,{constructor:{value:TemplateError}}),exports2.TemplateError=TemplateError;function escape(val){return val.replace(escapeRegex2,lookupEscape)}exports2.escape=escape;function isFunction3(obj){return ObjProto.toString.call(obj)==="[object Function]"}exports2.isFunction=isFunction3;function isArray2(obj){return ObjProto.toString.call(obj)==="[object Array]"}exports2.isArray=isArray2;function isString2(obj){return ObjProto.toString.call(obj)==="[object String]"}exports2.isString=isString2;function isObject3(obj){return ObjProto.toString.call(obj)==="[object Object]"}exports2.isObject=isObject3;function _prepareAttributeParts(attr2){return attr2?typeof attr2=="string"?attr2.split("."):[attr2]:[]}function getAttrGetter(attribute){var parts=_prepareAttributeParts(attribute);return function(item){for(var _item=item,i=0;i<parts.length;i++){var part=parts[i];if(hasOwnProp(_item,part))_item=_item[part];else return}return _item}}exports2.getAttrGetter=getAttrGetter;function groupBy(obj,val,throwOnUndefined){for(var result={},iterator2=isFunction3(val)?val:getAttrGetter(val),i=0;i<obj.length;i++){var value=obj[i],key2=iterator2(value,i);if(key2===void 0&&throwOnUndefined===!0)throw new TypeError('groupby: attribute "'+val+'" resolved to undefined');(result[key2]||(result[key2]=[])).push(value)}return result}exports2.groupBy=groupBy;function toArray2(obj){return Array.prototype.slice.call(obj)}exports2.toArray=toArray2;function without(array2){var result=[];if(!array2)return result;for(var length=array2.length,contains=toArray2(arguments).slice(1),index2=-1;++index2<length;)indexOf(contains,array2[index2])===-1&&result.push(array2[index2]);return result}exports2.without=without;function repeat(char_,n){for(var str="",i=0;i<n;i++)str+=char_;return str}exports2.repeat=repeat;function each2(obj,func,context){if(obj!=null){if(ArrayProto.forEach&&obj.forEach===ArrayProto.forEach)obj.forEach(func,context);else if(obj.length===+obj.length)for(var i=0,l=obj.length;i<l;i++)func.call(context,obj[i],i,obj)}}exports2.each=each2;function map2(obj,func){var results=[];if(obj==null)return results;if(ArrayProto.map&&obj.map===ArrayProto.map)return obj.map(func);for(var i=0;i<obj.length;i++)results[results.length]=func(obj[i],i);return obj.length===+obj.length&&(results.length=obj.length),results}exports2.map=map2;function asyncIter(arr,iter,cb){var i=-1;function next2(){i++,i<arr.length?iter(arr[i],i,next2,cb):cb()}next2()}exports2.asyncIter=asyncIter;function asyncFor(obj,iter,cb){var keys=keys_(obj||{}),len=keys.length,i=-1;function next2(){i++;var k=keys[i];i<len?iter(k,obj[k],i,len,next2):cb()}next2()}exports2.asyncFor=asyncFor;function indexOf(arr,searchElement,fromIndex){return Array.prototype.indexOf.call(arr||[],searchElement,fromIndex)}exports2.indexOf=indexOf;function keys_(obj){var arr=[];for(var k in obj)hasOwnProp(obj,k)&&arr.push(k);return arr}exports2.keys=keys_;function _entries(obj){return keys_(obj).map(function(k){return[k,obj[k]]})}exports2._entries=_entries;function _values(obj){return keys_(obj).map(function(k){return obj[k]})}exports2._values=_values;function extend3(obj1,obj2){return obj1=obj1||{},keys_(obj2).forEach(function(k){obj1[k]=obj2[k]}),obj1}exports2._assign=exports2.extend=extend3;function inOperator(key2,val){if(isArray2(val)||isString2(val))return val.indexOf(key2)!==-1;if(isObject3(val))return key2 in val;throw new Error('Cannot use "in" operator to search for "'+key2+'" in unexpected types.')}exports2.inOperator=inOperator}),(function(module3,exports2,__webpack_require__){"use strict";function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,_toPropertyKey(descriptor.key),descriptor)}}function
`);lines.forEach(function(line,i){line&&(inline&&i>0||!inline)&&process.stdout.write(" ".repeat(indent));var nl=i===lines.length-1?"":`
`;process.stdout.write(""+line+nl)})}function printNodes(node,indent){if(indent=indent||0,print(node.typename+": ",indent),node instanceof NodeList)print(`
`),node.children.forEach(function(n){printNodes(n,indent+2)});else if(node instanceof CallExtension)print(node.extName+"."+node.prop+`
`),node.args&&printNodes(node.args,indent+2),node.contentArgs&&node.contentArgs.forEach(function(n){printNodes(n,indent+2)});else{var nodes=[],props=null;node.iterFields(function(val,fieldName){val instanceof Node2?nodes.push([fieldName,val]):(props=props||{},props[fieldName]=val)}),props?print(JSON.stringify(props,null,2)+`
`,null,!0):print(`
`),nodes.forEach(function(_ref){var fieldName=_ref[0],n=_ref[1];print("["+fieldName+"] =>",indent+2),printNodes(n,indent+4)})}}module3.exports={Node:Node2,Root,NodeList,Value,Literal,Symbol:_Symbol,Group,Array:ArrayNode,Pair,Dict,Output,Capture,TemplateData,If,IfAsync,InlineIf,For,AsyncEach,AsyncAll,Macro,Caller,Import,FromImport,FunCall,Filter,FilterAsync,KeywordArgs,Block,Super,Extends,Include,Set:Set2,Switch,Case,LookupVal,BinOp,In,Is,Or,And,Not,Add,Concat,Sub,Mul,Div,FloorDiv,Mod,Pow,Neg,Pos,Compare,CompareOperand,CallExtension,CallExtensionAsync,printNodes}}),(function(module3,exports2){}),(function(module3,exports2,__webpack_require__){"use strict";function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}var parser=__webpack_require__(8),transformer=__webpack_require__(17),nodes=__webpack_require__(3),_require=__webpack_require__(0),TemplateError=_require.TemplateError,_require2=__webpack_require__(2),Frame=_require2.Frame,_require3=__webpack_require__(1),Obj=_require3.Obj,compareOps={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},Compiler=(function(_Obj){_inheritsLoose(Compiler2,_Obj);function Compiler2(){return _Obj.apply(this,arguments)||this}var _proto=Compiler2.prototype;return _proto.init=function(templateName,throwOnUndefined){this.templateName=templateName,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=throwOnUndefined},_proto.fail=function(msg,lineno,colno){throw lineno!==void 0&&(lineno+=1),colno!==void 0&&(colno+=1),new TemplateError(msg,lineno,colno)},_proto._pushBuffer=function(){var id=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=id,this._emit("var "+this.buffer+' = "";'),id},_proto._popBuffer=function(){this.buffer=this.bufferStack.pop()},_proto._emit=function(code){this.codebuf.push(code)},_proto._emitLine=function(code){this._emit(code+`
`)},_proto._emitLines=function(){for(var _this=this,_len=arguments.length,lines=new Array(_len),_key=0;_key<_len;_key++)lines[_key]=arguments[_key];lines.forEach(function(line){return _this._emitLine(line)})},_proto._emitFuncBegin=function(node,name){this.buffer="output",this._scopeClosers="",this._emitLine("function "+name+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+node.lineno+";"),this._emitLine("var colno = "+node.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},_proto._emitFuncEnd=function(noReturn){noReturn||this._emitLine("cb(null, "+this.buffer+");"),this._closeScopeLevels(),this._emitLine("} catch (e) {"),this._emitLine(" cb(runtime.handleError(e, lineno, colno));"),this._emitLine("}"),this._emitLine("}"),this.buffer=null},_proto._addScopeLevel=function(){this._scopeClosers+="})"},_proto._closeScopeLevels=function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},_proto._withScopedSyntax=function(func){var _scopeClosers=this._scopeClosers;this._scopeClosers="",func.call(this),this._closeScopeLevels(),this._scopeClosers=_scopeClosers},_proto._makeCallback=function(res){var err=this._tmpid();return"function("+err+(res?","+res:"")+`) {
if(`+err+") { cb("+err+"); return; }"},_proto._tmpid=function(){return this.lastId++,"t_"+this.lastId},_proto._templateName=function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},_proto._compileChildren=function(node,frame){var _this2=this;node.children.forEach(function(child2){_this2.compile(child2,frame)})},_proto._compileAggregate=function(node,frame,startChar,endChar){var _this3=this;startChar&&this._emit(startChar),node.children.forEach(function(child2,i){i>0&&_this3._emit(","),_this3.compile(child2,frame)}),endChar&&this._emit(endChar)},_proto._compileExpression=function(node,frame){this.assertType(node,nodes.Literal,nodes.Symbol,nodes.Group,nodes.Array,nodes.Dict,nodes.FunCall,nodes.Caller,nodes.Filter,nodes.LookupVal,nodes.Compare,nodes.InlineIf,nodes.In,nodes.Is,nodes.And,nodes.Or,nodes.Not,nodes.Add,nodes.Concat,nodes.Sub,nodes.Mul,nodes.Div,nodes.FloorDiv,nodes.Mod,nodes.Pow,nodes.Neg,nodes.Pos,nodes.Compare,nodes.NodeList),this.compile(node,frame)},_proto.assertType=function(node){for(var _len2=arguments.length,types3=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)types3[_key2-1]=arguments[_key2];types3.some(function(t){return node instanceof t})||this.fail("assertType: invalid type: "+node.typename,node.lineno,node.colno)},_proto.compileCallExtension=function(node,frame,async2){var _this4=this,args=node.args,contentArgs=node.contentArgs,autoescape=typeof node.autoescape=="boolean"?node.autoescape:!0;if(async2||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+node.extName+'")["'+node.prop+'"]('),this._emit("context"),(args||contentArgs)&&this._emit(","),args&&(args instanceof nodes.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),args.children.forEach(function(arg,i){_this4._compileExpression(arg,frame),(i!==args.children.length-1||contentArgs.length)&&_this4._emit(",")})),contentArgs.length&&contentArgs.forEach(function(arg,i){if(i>0&&_this4._emit(","),arg){_this4._emitLine("function(cb) {"),_this4._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var id=_this4._pushBuffer();_this4._withScopedSyntax(function(){_this4.compile(arg,frame),_this4._emitLine("cb(null, "+id+");")}),_this4._popBuffer(),_this4._emitLine("return "+id+";"),_this4._emitLine("}")}else _this4._emit("null")}),async2){var res=this._tmpid();this._emitLine(", "+this._makeCallback(res)),this._emitLine(this.buffer+" += runtime.suppressValue("+res+", "+autoescape+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+autoescape+` && env.opts.autoescape);
`)},_proto.compileCallExtensionAsync=function(node,frame){this.compileCallExtension(node,frame,!0)},_proto.compileNodeList=function(node,frame){this._compileChildren(node,frame)},_proto.compileLiteral=function(node){if(typeof node.value=="string"){var val=node.value.replace(/\\/g,"\\\\");val=val.replace(/"/g,'\\"'),val=val.replace(/\n/g,"\\n"),val=val.replace(/\r/g,"\\r"),val=val.replace(/\t/g,"\\t"),val=val.replace(/\u2028/g,"\\u2028"),this._emit('"'+val+'"')}else node.value===null?this._emit("null"):this._emit(node.value.toString())},_proto.compileSymbol=function(node,frame){var name=node.value,v=frame.lookup(name);v?this._emit(v):this._emit('runtime.contextOrFrameLookup(context, frame, "'+name+'")')},_proto.compileGroup=function(node,frame){this._compileAggregate(node,frame,"(",")")},_proto.compileArray=function(node,frame){this._compileAggregate(node,frame,"[","]")},_proto.compileDict=function(node,frame){this._compileAggregate(node,frame,"{","}")},_proto.compilePair=function(node,frame){var key2=node.key,val=node.value;key2 instanceof nodes.Symbol?key2=new nodes.Literal(key2.lineno,key2.colno,key2.value):key2 instanceof nodes.Literal&&typeof key2.value=="string"||this.fail("compilePair: Dict keys must be strings or names",key2.lineno,key2.colno),this.compile(key2,frame),this._emit(": "),this._compileExpression(val,frame)},_proto.compileInlineIf=function(node,frame){this._emit("("),this.compile(node.cond,frame),this._emit("?"),this.compile(node.body,frame),this._emit(":"),node.else_!==null?this.compile(node.else_,frame):this._emit('""'),this._emit(")")},_proto.compileIn=function(node,frame){this._emit("runtime.inOperator("),this.compile(node.left,frame),this._emit(","),this.compile(node.right,frame),this._emit(")")},_proto.compileIs=function(node,frame){var right=node.right.name?node.right.name.value:node.right.value;this._emit('env.getTest("'+right+'").call(context, '),this.compile(node.left,frame),node.right.args&&(this._emit(","),this.compile(node.right.args,frame)),this._emit(") === true")},_proto._binOpEmitter=function(node,frame,str){this.compile(node.left,frame),this._emit(str),this.compile(node.right,frame)},_proto.compileOr=function(node,frame){return this._binOpEmitter(node,frame," || ")},_proto.compileAnd=function(node,frame){return this._binOpEmitter(node,frame," && ")},_proto.compileAdd=function(node,frame){return this._binOpEmitter(node,frame," + ")},_proto.compileConcat=function(node,frame){return this._binOpEmitter(node,frame,' + "" + ')},_proto.compileSub=function(node,frame){return this._binOpEmitter(node,frame," - ")},_proto.compileMul=function(node,frame){return this._binOpEmitter(node,frame," * ")},_proto.compileDiv=function(node,frame){return this._binOpEmitter(node,frame," / ")},_proto.compileMod=function(node,frame){return this._binOpEmitter(node,frame," % ")},_proto.compileNot=function(node,frame){this._emit("!"),this.compile(node.target,frame)},_proto.compileFloorDiv=function(node,frame){this._emit("Math.floor("),this.compile(node.left,frame),this._emit(" / "),this.compile(node.right,frame),this._emit(")")},_proto.compilePow=function(node,frame){this._emit("Math.pow("),this.compile(node.left,frame),this._emit(", "),this.compile(node.right,frame),this._emit(")")},_proto.compileNeg=function(node,frame){this._emit("-"),this.compile(node.target,frame)},_proto.compilePos=function(node,frame){this._emit("+"),this.compile(node.target,frame)},_proto.compileCompare=function(node,frame){var _this5=this;this.compile(node.expr,frame),node.ops.forEach(function(op){_this5._emit(" "+compareOps[op.type]+" "),_this5.compile(op.expr,frame)})},_proto.compileLookupVal=function(node,frame){this._emit("runtime.memberLookup(("),this._compileExpression(node.target,frame),this._emit("),"),this._compileExpression(node.val,frame),this._emit(")")},_proto._getNodeName=function(node){switch(node.typename){case"Symbol":return node.value;case"FunCall":return"the return value of ("+this._getNodeName(node.name)+")";case"LookupVal":return this._getNodeName(node.target)+'["'+this._getNodeName(node.val)+'"]';case"Literal":retu
else {`),this._withScopedSyntax(function(){_this8.compile(node.else_,frame),async2&&_this8._emit("cb()")})):async2&&(this._emitLine(`}
else {`),this._emit("cb()")),this._emitLine("}")},_proto.compileIfAsync=function(node,frame){this._emit("(function(cb) {"),this.compileIf(node,frame,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},_proto._emitLoopBindings=function(node,arr,i,len){var _this9=this,bindings=[{name:"index",val:i+" + 1"},{name:"index0",val:i},{name:"revindex",val:len+" - "+i},{name:"revindex0",val:len+" - "+i+" - 1"},{name:"first",val:i+" === 0"},{name:"last",val:i+" === "+len+" - 1"},{name:"length",val:len}];bindings.forEach(function(b){_this9._emitLine('frame.set("loop.'+b.name+'", '+b.val+");")})},_proto.compileFor=function(node,frame){var _this10=this,i=this._tmpid(),len=this._tmpid(),arr=this._tmpid();if(frame=frame.push(),this._emitLine("frame = frame.push();"),this._emit("var "+arr+" = "),this._compileExpression(node.arr,frame),this._emitLine(";"),this._emit("if("+arr+") {"),this._emitLine(arr+" = runtime.fromIterator("+arr+");"),node.name instanceof nodes.Array){this._emitLine("var "+i+";"),this._emitLine("if(runtime.isArray("+arr+")) {"),this._emitLine("var "+len+" = "+arr+".length;"),this._emitLine("for("+i+"=0; "+i+" < "+arr+".length; "+i+"++) {"),node.name.children.forEach(function(child2,u){var tid=_this10._tmpid();_this10._emitLine("var "+tid+" = "+arr+"["+i+"]["+u+"];"),_this10._emitLine('frame.set("'+child2+'", '+arr+"["+i+"]["+u+"]);"),frame.set(node.name.children[u].value,tid)}),this._emitLoopBindings(node,arr,i,len),this._withScopedSyntax(function(){_this10.compile(node.body,frame)}),this._emitLine("}"),this._emitLine("} else {");var _node$name$children=node.name.children,key2=_node$name$children[0],val=_node$name$children[1],k=this._tmpid(),v=this._tmpid();frame.set(key2.value,k),frame.set(val.value,v),this._emitLine(i+" = -1;"),this._emitLine("var "+len+" = runtime.keys("+arr+").length;"),this._emitLine("for(var "+k+" in "+arr+") {"),this._emitLine(i+"++;"),this._emitLine("var "+v+" = "+arr+"["+k+"];"),this._emitLine('frame.set("'+key2.value+'", '+k+");"),this._emitLine('frame.set("'+val.value+'", '+v+");"),this._emitLoopBindings(node,arr,i,len),this._withScopedSyntax(function(){_this10.compile(node.body,frame)}),this._emitLine("}"),this._emitLine("}")}else{var _v=this._tmpid();frame.set(node.name.value,_v),this._emitLine("var "+len+" = "+arr+".length;"),this._emitLine("for(var "+i+"=0; "+i+" < "+arr+".length; "+i+"++) {"),this._emitLine("var "+_v+" = "+arr+"["+i+"];"),this._emitLine('frame.set("'+node.name.value+'", '+_v+");"),this._emitLoopBindings(node,arr,i,len),this._withScopedSyntax(function(){_this10.compile(node.body,frame)}),this._emitLine("}")}this._emitLine("}"),node.else_&&(this._emitLine("if (!"+len+") {"),this.compile(node.else_,frame),this._emitLine("}")),this._emitLine("frame = frame.pop();")},_proto._compileAsyncLoop=function(node,frame,parallel){var _this11=this,i=this._tmpid(),len=this._tmpid(),arr=this._tmpid(),asyncMethod=parallel?"asyncAll":"asyncEach";if(frame=frame.push(),this._emitLine("frame = frame.push();"),this._emit("var "+arr+" = runtime.fromIterator("),this._compileExpression(node.arr,frame),this._emitLine(");"),node.name instanceof nodes.Array){var arrayLen=node.name.children.length;this._emit("runtime."+asyncMethod+"("+arr+", "+arrayLen+", function("),node.name.children.forEach(function(name){_this11._emit(name.value+",")}),this._emit(i+","+len+",next) {"),node.name.children.forEach(function(name){var id2=name.value;frame.set(id2,id2),_this11._emitLine('frame.set("'+id2+'", '+id2+");")})}else{var id=node.name.value;this._emitLine("runtime."+asyncMethod+"("+arr+", 1, function("+id+", "+i+", "+len+",next) {"),this._emitLine('frame.set("'+id+'", '+id+");"),frame.set(id,id)}this._emitLoopBindings(node,arr,i,len),this._withScopedSyntax(function(){var buf;parallel&&(buf=_this11._pushBuffer()),_this11.compile(node.body,frame),_this11._emitLine("next("+i+(buf?","+buf:"")+");"),parallel&&_this11._popBuffer()});var output=this._tmpid();this._emitLine("}, "+this._makeCallback(output)),this._addScopeLevel(),parallel&&this._emitLine(this.buffer+" += "+output+";"),node.else_&&(this._
`))})},_proto.compileRoot=function(node,frame){var _this16=this;frame&&this.fail("compileRoot: root node can't have frame"),frame=new Frame,this._emitFuncBegin(node,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(node,frame),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var blockNames=[],blocks=node.findAll(nodes.Block);blocks.forEach(function(block2,i){var name=block2.name.value;if(blockNames.indexOf(name)!==-1)throw new Error('Block "'+name+'" defined more than once.');blockNames.push(name),_this16._emitFuncBegin(block2,"b_"+name);var tmpFrame=new Frame;_this16._emitLine("var frame = frame.push(true);"),_this16.compile(block2.body,tmpFrame),_this16._emitFuncEnd()}),this._emitLine("return {"),blocks.forEach(function(block2,i){var blockName="b_"+block2.name.value;_this16._emitLine(blockName+": "+blockName+",")}),this._emitLine(`root: root
};`)},_proto.compile=function(node,frame){var _compile=this["compile"+node.typename];_compile?_compile.call(this,node,frame):this.fail("compile: Cannot compile node: "+node.typename,node.lineno,node.colno)},_proto.getCode=function(){return this.codebuf.join("")},Compiler2})(Obj);module3.exports={compile:function(src,asyncFilters,extensions,name,opts){opts===void 0&&(opts={});var c2=new Compiler(name,opts.throwOnUndefined),preprocessors=(extensions||[]).map(function(ext){return ext.preprocess}).filter(function(f){return!!f}),processedSrc=preprocessors.reduce(function(s,processor){return processor(s)},src);return c2.compile(transformer.transform(parser.parse(processedSrc,extensions,opts),asyncFilters,name)),c2.getCode()},Compiler}}),(function(module3,exports2,__webpack_require__){"use strict";function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}var path=__webpack_require__(4),_require=__webpack_require__(1),EmitterObj=_require.EmitterObj;module3.exports=(function(_EmitterObj){_inheritsLoose(Loader,_EmitterObj);function Loader(){return _EmitterObj.apply(this,arguments)||this}var _proto=Loader.prototype;return _proto.resolve=function(from,to){return path.resolve(path.dirname(from),to)},_proto.isRelative=function(filename){return filename.indexOf("./")===0||filename.indexOf("../")===0},Loader})(EmitterObj)}),(function(module3,exports2,__webpack_require__){"use strict";function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}var asap2=__webpack_require__(12),_waterfall=__webpack_require__(15),lib=__webpack_require__(0),compiler=__webpack_require__(5),filters=__webpack_require__(18),_require=__webpack_require__(10),FileSystemLoader=_require.FileSystemLoader,WebLoader=_require.WebLoader,PrecompiledLoader=_require.PrecompiledLoader,tests=__webpack_require__(20),globals=__webpack_require__(21),_require2=__webpack_require__(1),Obj=_require2.Obj,EmitterObj=_require2.EmitterObj,globalRuntime=__webpack_require__(2),handleError=globalRuntime.handleError,Frame=globalRuntime.Frame,expressApp=__webpack_require__(22);function callbackAsap(cb,err,res){asap2(function(){cb(err,res)})}var noopTmplSrc={type:"code",obj:{root:function(env,context,frame,runtime,cb){try{cb(null,"")}catch(e){cb(handleError(e,null,null))}}}},Environment=(function(_EmitterObj){_inheritsLoose(Environment2,_EmitterObj);function Environment2(){return _EmitterObj.apply(this,arguments)||this}var _proto=Environment2.prototype;return _proto.init=function(loaders,opts){var _this=this;opts=this.opts=opts||{},this.opts.dev=!!opts.dev,this.opts.autoescape=opts.autoescape!=null?opts.autoescape:!0,this.opts.throwOnUndefined=!!opts.throwOnUndefined,this.opts.trimBlocks=!!opts.trimBlocks,this.opts.lstripBlocks=!!opts.lstripBlocks,this.loaders=[],loaders?this.loaders=lib.isArray(loaders)?loaders:[loaders]:FileSystemLoader?this.loaders=[new FileSystemLoader("views")]:WebLoader&&(this.loaders=[new WebLoader("/views")]),typeof window!="undefined"&&window.nunjucksPrecompiled&&this.loaders.unshift(new PrecompiledLoader(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=globals(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],lib._entries(filters).forEach(function(_ref){var name=_ref[0],filter2=_ref[1];return _this.addFilter(name,filter2)}),lib._entries(tests).forEach(function(_ref2){var name=_ref2[0],test2=_ref2[1];return _this.addTest(name,test2)})},_proto._initLoaders=function(){var _this2=this;this.loaders.forEach(function(loader){loader.cache={},typeof loader
\r\xA0`,delimChars="()[]{}%*-+~/#,:|.<>=!",intChars="0123456789",BLOCK_START="{%",BLOCK_END="%}",VARIABLE_START="{{",VARIABLE_END="}}",COMMENT_START="{#",COMMENT_END="#}",TOKEN_STRING="string",TOKEN_WHITESPACE="whitespace",TOKEN_DATA="data",TOKEN_BLOCK_START="block-start",TOKEN_BLOCK_END="block-end",TOKEN_VARIABLE_START="variable-start",TOKEN_VARIABLE_END="variable-end",TOKEN_COMMENT="comment",TOKEN_LEFT_PAREN="left-paren",TOKEN_RIGHT_PAREN="right-paren",TOKEN_LEFT_BRACKET="left-bracket",TOKEN_RIGHT_BRACKET="right-bracket",TOKEN_LEFT_CURLY="left-curly",TOKEN_RIGHT_CURLY="right-curly",TOKEN_OPERATOR="operator",TOKEN_COMMA="comma",TOKEN_COLON="colon",TOKEN_TILDE="tilde",TOKEN_PIPE="pipe",TOKEN_INT="int",TOKEN_FLOAT="float",TOKEN_BOOLEAN="boolean",TOKEN_NONE="none",TOKEN_SYMBOL="symbol",TOKEN_SPECIAL="special",TOKEN_REGEX="regex";function token(type,value,lineno,colno){return{type,value,lineno,colno}}var Tokenizer=(function(){function Tokenizer2(str,opts){this.str=str,this.index=0,this.len=str.length,this.lineno=0,this.colno=0,this.in_code=!1,opts=opts||{};var tags=opts.tags||{};this.tags={BLOCK_START:tags.blockStart||BLOCK_START,BLOCK_END:tags.blockEnd||BLOCK_END,VARIABLE_START:tags.variableStart||VARIABLE_START,VARIABLE_END:tags.variableEnd||VARIABLE_END,COMMENT_START:tags.commentStart||COMMENT_START,COMMENT_END:tags.commentEnd||COMMENT_END},this.trimBlocks=!!opts.trimBlocks,this.lstripBlocks=!!opts.lstripBlocks}var _proto=Tokenizer2.prototype;return _proto.nextToken=function(){var lineno=this.lineno,colno=this.colno,tok;if(this.in_code){var cur=this.current();if(this.isFinished())return null;if(cur==='"'||cur==="'")return token(TOKEN_STRING,this._parseString(cur),lineno,colno);if(tok=this._extract(whitespaceChars))return token(TOKEN_WHITESPACE,tok,lineno,colno);if((tok=this._extractString(this.tags.BLOCK_END))||(tok=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(cur=this.current(),cur===`
`?this.forward():cur==="\r"&&(this.forward(),cur=this.current(),cur===`
`?this.forward():this.back())),token(TOKEN_BLOCK_END,tok,lineno,colno);if((tok=this._extractString(this.tags.VARIABLE_END))||(tok=this._extractString("-"+this.tags.VARIABLE_END)))return this.in_code=!1,token(TOKEN_VARIABLE_END,tok,lineno,colno);if(cur==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var regexBody="";!this.isFinished();)if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}else regexBody+=this.current(),this.forward();for(var POSSIBLE_FLAGS=["g","i","m","y"],regexFlags="";!this.isFinished();){var isCurrentAFlag=POSSIBLE_FLAGS.indexOf(this.current())!==-1;if(isCurrentAFlag)regexFlags+=this.current(),this.forward();else break}return token(TOKEN_REGEX,{body:regexBody,flags:regexFlags},lineno,colno)}else if(delimChars.indexOf(cur)!==-1){this.forward();var complexOps=["==","===","!=","!==","<=",">=","//","**"],curComplex=cur+this.current(),type;switch(lib.indexOf(complexOps,curComplex)!==-1&&(this.forward(),cur=curComplex,lib.indexOf(complexOps,curComplex+this.current())!==-1&&(cur=curComplex+this.current(),this.forward())),cur){case"(":type=TOKEN_LEFT_PAREN;break;case")":type=TOKEN_RIGHT_PAREN;break;case"[":type=TOKEN_LEFT_BRACKET;break;case"]":type=TOKEN_RIGHT_BRACKET;break;case"{":type=TOKEN_LEFT_CURLY;break;case"}":type=TOKEN_RIGHT_CURLY;break;case",":type=TOKEN_COMMA;break;case":":type=TOKEN_COLON;break;case"~":type=TOKEN_TILDE;break;case"|":type=TOKEN_PIPE;break;default:type=TOKEN_OPERATOR}return token(type,cur,lineno,colno)}else if(tok=this._extractUntil(whitespaceChars+delimChars),tok.match(/^[-+]?[0-9]+$/))if(this.current()==="."){this.forward();var dec=this._extract(intChars);return token(TOKEN_FLOAT,tok+"."+dec,lineno,colno)}else return token(TOKEN_INT,tok,lineno,colno);else{if(tok.match(/^(true|false)$/))return token(TOKEN_BOOLEAN,tok,lineno,colno);if(tok==="none")return token(TOKEN_NONE,tok,lineno,colno);if(tok==="null")return token(TOKEN_NONE,tok,lineno,colno);if(tok)return token(TOKEN_SYMBOL,tok,lineno,colno);throw new Error("Unexpected value while parsing: "+tok)}}else{var beginChars=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((tok=this._extractString(this.tags.BLOCK_START+"-"))||(tok=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,token(TOKEN_BLOCK_START,tok,lineno,colno);if((tok=this._extractString(this.tags.VARIABLE_START+"-"))||(tok=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,token(TOKEN_VARIABLE_START,tok,lineno,colno);tok="";var data,inComment=!1;for(this._matches(this.tags.COMMENT_START)&&(inComment=!0,tok=this._extractString(this.tags.COMMENT_START));(data=this._extractUntil(beginChars))!==null;)if(tok+=data,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!inComment){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=tok.length){var lastLine=tok.slice(-this.colno);if(/^\s+$/.test(lastLine)&&(tok=tok.slice(0,-this.colno),!tok.length))return this.nextToken()}break}else if(this._matches(this.tags.COMMENT_END)){if(!inComment)throw new Error("unexpected end of comment");tok+=this._extractString(this.tags.COMMENT_END);break}else tok+=this.current(),this.forward();if(data===null&&inComment)throw new Error("expected end of comment, got end of file");return token(inComment?TOKEN_COMMENT:TOKEN_DATA,tok,lineno,colno)}},_proto._parseString=function(delimiter){this.forward();for(var str="";!this.isFinished()&&this.current()!==delimiter;){var cur=this.current();if(cur==="\\"){switch(this.forward(),this.current()){case"n":str+=`
`;break;case"t":str+=" ";break;case"r":str+="\r";break;default:str+=this.current()}this.forward()}else str+=cur,this.forward()}return this.forward(),str},_proto._matches=function(str){if(this.index+str.length>this.len)return null;var m=this.str.slice(this.index,this.index+str.length);return m===str},_proto._extractString=function(str){return this._matches(str)?(this.forwardN(str.length),str):null},_proto._extractUntil=function(charString){return this._extractMatching(!0,charString||"")},_proto._extract=function(charString){return this._extractMatching(!1,charString)},_proto._extractMatching=function(breakOnMatch,charString){if(this.isFinished())return null;var first=charString.indexOf(this.current());if(breakOnMatch&&first===-1||!breakOnMatch&&first!==-1){var t=this.current();this.forward();for(var idx=charString.indexOf(this.current());(breakOnMatch&&idx===-1||!breakOnMatch&&idx!==-1)&&!this.isFinished();)t+=this.current(),this.forward(),idx=charString.indexOf(this.current());return t}return""},_proto._extractRegex=function(regex){var matches=this.currentStr().match(regex);return matches?(this.forwardN(matches[0].length),matches):null},_proto.isFinished=function(){return this.index>=this.len},_proto.forwardN=function(n){for(var i=0;i<n;i++)this.forward()},_proto.forward=function(){this.index++,this.previous()===`
`?(this.lineno++,this.colno=0):this.colno++},_proto.backN=function(n){for(var i=0;i<n;i++)this.back()},_proto.back=function(){if(this.index--,this.current()===`
`){this.lineno--;var idx=this.src.lastIndexOf(`
`,this.index-1);idx===-1?this.colno=this.index:this.colno=this.index-idx}else this.colno--},_proto.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},_proto.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},_proto.previous=function(){return this.str.charAt(this.index-1)},Tokenizer2})();module3.exports={lex:function(src,opts){return new Tokenizer(src,opts)},TOKEN_STRING,TOKEN_WHITESPACE,TOKEN_DATA,TOKEN_BLOCK_START,TOKEN_BLOCK_END,TOKEN_VARIABLE_START,TOKEN_VARIABLE_END,TOKEN_COMMENT,TOKEN_LEFT_PAREN,TOKEN_RIGHT_PAREN,TOKEN_LEFT_BRACKET,TOKEN_RIGHT_BRACKET,TOKEN_LEFT_CURLY,TOKEN_RIGHT_CURLY,TOKEN_OPERATOR,TOKEN_COMMA,TOKEN_COLON,TOKEN_TILDE,TOKEN_PIPE,TOKEN_INT,TOKEN_FLOAT,TOKEN_BOOLEAN,TOKEN_NONE,TOKEN_SYMBOL,TOKEN_SPECIAL,TOKEN_REGEX}}),(function(module3,exports2,__webpack_require__){"use strict";function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}var Loader=__webpack_require__(6),_require=__webpack_require__(19),PrecompiledLoader=_require.PrecompiledLoader,WebLoader=(function(_Loader){_inheritsLoose(WebLoader2,_Loader);function WebLoader2(baseURL,opts){var _this;return _this=_Loader.call(this)||this,_this.baseURL=baseURL||".",opts=opts||{},_this.useCache=!!opts.useCache,_this.async=!!opts.async,_this}var _proto=WebLoader2.prototype;return _proto.resolve=function(from,to){throw new Error("relative templates not support in the browser yet")},_proto.getSource=function(name,cb){var _this2=this,useCache=this.useCache,result;return this.fetch(this.baseURL+"/"+name,function(err,src){if(err)if(cb)cb(err.content);else if(err.status===404)result=null;else throw err.content;else result={src,path:name,noCache:!useCache},_this2.emit("load",name,result),cb&&cb(null,result)}),result},_proto.fetch=function(url2,cb){if(typeof window=="undefined")throw new Error("WebLoader can only by used in a browser");var ajax=new XMLHttpRequest,loading=!0;ajax.onreadystatechange=function(){ajax.readyState===4&&loading&&(loading=!1,ajax.status===0||ajax.status===200?cb(null,ajax.responseText):cb({status:ajax.status,content:ajax.responseText}))},url2+=(url2.indexOf("?")===-1?"?":"&")+"s="+new Date().getTime(),ajax.open("GET",url2,this.async),ajax.send()},WebLoader2})(Loader);module3.exports={WebLoader,PrecompiledLoader}}),(function(module3,exports2,__webpack_require__){"use strict";var lib=__webpack_require__(0),_require=__webpack_require__(7),Environment=_require.Environment,Template=_require.Template,Loader=__webpack_require__(6),loaders=__webpack_require__(10),precompile=__webpack_require__(23),compiler=__webpack_require__(5),parser=__webpack_require__(8),lexer=__webpack_require__(9),runtime=__webpack_require__(2),nodes=__webpack_require__(3),installJinjaCompat=__webpack_require__(25),e;function configure(templatesPath,opts){opts=opts||{},lib.isObject(templatesPath)&&(opts=templatesPath,templatesPath=null);var TemplateLoader;return loaders.FileSystemLoader?TemplateLoader=new loaders.FileSystemLoader(templatesPath,{watch:opts.watch,noCache:opts.noCache}):loaders.WebLoader&&(TemplateLoader=new loaders.WebLoader(templatesPath,{useCache:opts.web&&opts.web.useCache,async:opts.web&&opts.web.async})),e=new Environment(TemplateLoader,opts),opts&&opts.express&&e.express(opts.express),e}module3.exports={Environment,Template,Loader,FileSystemLoader:loaders.FileSystemLoader,NodeResolveLoader:loaders.NodeResolveLoader,PrecompiledLoader:loaders.PrecompiledLoader,WebLoader:loaders.WebLoader,compiler,parser,lexer,runtime,lib,nodes,installJinjaCompat,configure,reset:function(){e=void 0},compile:function(src,env,path,eagerCompile){return e||configure(),new Template(src,env,path,eagerCompile)},render:function(name,ctx,cb){return e||configure(),e.render(name,ctx,cb)},renderString:function(src,ctx,cb){return e||configure(),e.re
`),sp=lib.repeat(" ",width),res=lines.map(function(l,i){return i===0&&!indentfirst?l:""+sp+l}).join(`
`);return r.copySafeness(str,res)}exports2.indent=indent;function join(arr,del,attr2){return del=del||"",attr2&&(arr=lib.map(arr,function(v){return v[attr2]})),arr.join(del)}exports2.join=join;function last(arr){return arr[arr.length-1]}exports2.last=last;function lengthFilter(val){var value=normalize(val,"");return value!==void 0?typeof Map=="function"&&value instanceof Map||typeof Set=="function"&&value instanceof Set?value.size:lib.isObject(value)&&!(value instanceof r.SafeString)?lib.keys(value).length:value.length:0}exports2.length=lengthFilter;function list(val){if(lib.isString(val))return val.split("");if(lib.isObject(val))return lib._entries(val||{}).map(function(_ref){var key2=_ref[0],value=_ref[1];return{key:key2,value}});if(lib.isArray(val))return val;throw new lib.TemplateError("list filter: type not iterable")}exports2.list=list;function lower(str){return str=normalize(str,""),str.toLowerCase()}exports2.lower=lower;function nl2br(str){return str==null?"":r.copySafeness(str,str.replace(/\r\n|\n/g,`<br />
`))}exports2.nl2br=nl2br;function random(arr){return arr[Math.floor(Math.random()*arr.length)]}exports2.random=random;function getSelectOrReject(expectedTestResult){function filter2(arr,testName,secondArg){testName===void 0&&(testName="truthy");var context=this,test2=context.env.getTest(testName);return lib.toArray(arr).filter(function(item){return test2.call(context,item,secondArg)===expectedTestResult})}return filter2}exports2.reject=getSelectOrReject(!1);function rejectattr(arr,attr2){return arr.filter(function(item){return!item[attr2]})}exports2.rejectattr=rejectattr,exports2.select=getSelectOrReject(!0);function selectattr(arr,attr2){return arr.filter(function(item){return!!item[attr2]})}exports2.selectattr=selectattr;function replace(str,old,new_,maxCount){var originalStr=str;if(old instanceof RegExp)return str.replace(old,new_);typeof maxCount=="undefined"&&(maxCount=-1);var res="";if(typeof old=="number")old=""+old;else if(typeof old!="string")return str;if(typeof str=="number"&&(str=""+str),typeof str!="string"&&!(str instanceof r.SafeString))return str;if(old==="")return res=new_+str.split("").join(new_)+new_,r.copySafeness(str,res);var nextIndex=str.indexOf(old);if(maxCount===0||nextIndex===-1)return str;for(var pos=0,count=0;nextIndex>-1&&(maxCount===-1||count<maxCount);)res+=str.substring(pos,nextIndex)+new_,pos=nextIndex+old.length,count++,nextIndex=str.indexOf(old,pos);return pos<str.length&&(res+=str.substring(pos)),r.copySafeness(originalStr,res)}exports2.replace=replace;function reverse(val){var arr;return lib.isString(val)?arr=list(val):arr=lib.map(val,function(v){return v}),arr.reverse(),lib.isString(val)?r.copySafeness(val,arr.join("")):arr}exports2.reverse=reverse;function round(val,precision,method){precision=precision||0;var factor=Math.pow(10,precision),rounder;return method==="ceil"?rounder=Math.ceil:method==="floor"?rounder=Math.floor:rounder=Math.round,rounder(val*factor)/factor}exports2.round=round;function slice(arr,slices,fillWith){for(var sliceLength=Math.floor(arr.length/slices),extra=arr.length%slices,res=[],offset=0,i=0;i<slices;i++){var start=offset+i*sliceLength;i<extra&&offset++;var end=offset+(i+1)*sliceLength,currSlice=arr.slice(start,end);fillWith&&i>=extra&&currSlice.push(fillWith),res.push(currSlice)}return res}exports2.slice=slice;function sum(arr,attr2,start){return start===void 0&&(start=0),attr2&&(arr=lib.map(arr,function(v){return v[attr2]})),start+arr.reduce(function(a,b){return a+b},0)}exports2.sum=sum,exports2.sort=r.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(arr,reversed,caseSens,attr2){var _this=this,array2=lib.map(arr,function(v){return v}),getAttribute=lib.getAttrGetter(attr2);return array2.sort(function(a,b){var x=attr2?getAttribute(a):a,y=attr2?getAttribute(b):b;if(_this.env.opts.throwOnUndefined&&attr2&&(x===void 0||y===void 0))throw new TypeError('sort: attribute "'+attr2+'" resolved to undefined');return!caseSens&&lib.isString(x)&&lib.isString(y)&&(x=x.toLowerCase(),y=y.toLowerCase()),x<y?reversed?1:-1:x>y?reversed?-1:1:0}),array2});function string4(obj){return r.copySafeness(obj,obj)}exports2.string=string4;function striptags(input,preserveLinebreaks){input=normalize(input,"");var tags=/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,trimmedInput=trim2(input.replace(tags,"")),res="";return preserveLinebreaks?res=trimmedInput.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
`).replace(/\n\n\n+/g,`
`):res=trimmedInput.replace(/\s+/gi," "),r.copySafeness(input,res)}exports2.striptags=striptags;function title(str){str=normalize(str,"");var words=str.split(" ").map(function(word){return capitalize(word)});return r.copySafeness(str,words.join(" "))}exports2.title=title;function trim2(str){return r.copySafeness(str,str.replace(/^\s*|\s*$/g,""))}exports2.trim=trim2;function truncate2(input,length,killwords,end){var orig=input;if(input=normalize(input,""),length=length||255,input.length<=length)return input;if(killwords)input=input.substring(0,length);else{var idx=input.lastIndexOf(" ",length);idx===-1&&(idx=length),input=input.substring(0,idx)}return input+=end!=null?end:"...",r.copySafeness(orig,input)}exports2.truncate=truncate2;function upper(str){return str=normalize(str,""),str.toUpperCase()}exports2.upper=upper;function urlencode(obj){var enc=encodeURIComponent;if(lib.isString(obj))return enc(obj);var keyvals=lib.isArray(obj)?obj:lib._entries(obj);return keyvals.map(function(_ref2){var k=_ref2[0],v=_ref2[1];return enc(k)+"="+enc(v)}).join("&")}exports2.urlencode=urlencode;var puncRe=/^(?:\(|<|&lt;)?(.*?)(?:\.|,|\)|\n|&gt;)?$/,emailRe=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,httpHttpsRe=/^https?:\/\/.*$/,wwwRe=/^www\./,tldRe=/\.(?:org|net|com)(?:\:|\/|$)/;function urlize(str,length,nofollow){isNaN2(length)&&(length=1/0);var noFollowAttr=nofollow===!0?' rel="nofollow"':"",words=str.split(/(\s+)/).filter(function(word){return word&&word.length}).map(function(word){var matches=word.match(puncRe),possibleUrl=matches?matches[1]:word,shortUrl=possibleUrl.substr(0,length);return httpHttpsRe.test(possibleUrl)?'<a href="'+possibleUrl+'"'+noFollowAttr+">"+shortUrl+"</a>":wwwRe.test(possibleUrl)?'<a href="http://'+possibleUrl+'"'+noFollowAttr+">"+shortUrl+"</a>":emailRe.test(possibleUrl)?'<a href="mailto:'+possibleUrl+'">'+possibleUrl+"</a>":tldRe.test(possibleUrl)?'<a href="http://'+possibleUrl+'"'+noFollowAttr+">"+shortUrl+"</a>":word});return words.join("")}exports2.urlize=urlize;function wordcount(str){str=normalize(str,"");var words=str?str.match(/\w+/g):null;return words?words.length:null}exports2.wordcount=wordcount;function float(val,def){var res=parseFloat(val);return isNaN2(res)?def:res}exports2.float=float;var intFilter=r.makeMacro(["value","default","base"],[],function(value,defaultValue,base){base===void 0&&(base=10);var res=parseInt(value,base);return isNaN2(res)?defaultValue:res});exports2.int=intFilter,exports2.d=exports2.default,exports2.e=exports2.escape}),(function(module3,exports2,__webpack_require__){"use strict";function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype),subClass.prototype.constructor=subClass,_setPrototypeOf(subClass,superClass)}function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}var Loader=__webpack_require__(6),PrecompiledLoader=(function(_Loader){_inheritsLoose(PrecompiledLoader2,_Loader);function PrecompiledLoader2(compiledTemplates){var _this;return _this=_Loader.call(this)||this,_this.precompiled=compiledTemplates||{},_this}var _proto=PrecompiledLoader2.prototype;return _proto.getSource=function(name){return this.precompiled[name]?{src:{type:"code",obj:this.precompiled[name]},path:name}:null},PrecompiledLoader2})(Loader);module3.exports={PrecompiledLoader}}),(function(module3,exports2,__webpack_require__){"use strict";var SafeString=__webpack_require__(2).SafeString;function callable(value){return typeof value=="function"}exports2.callable=callable;function defined(value){return value!==void 0}exports2.defined=defined;function divisibleby(one,two){return one%two===0}exports2.divisibleby=divisibleby;function escaped(value){return value instanceof SafeString}exports2.escaped=escaped;function equalto(one,two){return one===two}exports2.equalto=equalto,exports2.eq=exports2.equalto,exports2.sameas=exports2.equalto;function even(value){return value%2===0}exports2.even=even;function falsy(value){return!value}exports2.
`+template+`
})();
`,opts.asFunction&&(out+="return function(ctx, cb) { return nunjucks.render("+name+`, ctx, cb); }
`),out+=`})();
`}return out}module3.exports=precompileGlobal}),(function(module3,exports2,__webpack_require__){function installCompat(){"use strict";var runtime=this.runtime,lib=this.lib,Compiler=this.compiler.Compiler,Parser=this.parser.Parser,nodes=this.nodes,lexer=this.lexer,orig_contextOrFrameLookup=runtime.contextOrFrameLookup,orig_memberLookup=runtime.memberLookup,orig_Compiler_assertType,orig_Parser_parseAggregate;Compiler&&(orig_Compiler_assertType=Compiler.prototype.assertType),Parser&&(orig_Parser_parseAggregate=Parser.prototype.parseAggregate);function uninstall(){runtime.contextOrFrameLookup=orig_contextOrFrameLookup,runtime.memberLookup=orig_memberLookup,Compiler&&(Compiler.prototype.assertType=orig_Compiler_assertType),Parser&&(Parser.prototype.parseAggregate=orig_Parser_parseAggregate)}runtime.contextOrFrameLookup=function(context,frame,key2){var val=orig_contextOrFrameLookup.apply(this,arguments);if(val!==void 0)return val;switch(key2){case"True":return!0;case"False":return!1;case"None":return null;default:return}};function getTokensState(tokens){return{index:tokens.index,lineno:tokens.lineno,colno:tokens.colno}}if(nodes&&Compiler&&Parser){var Slice=nodes.Node.extend("Slice",{fields:["start","stop","step"],init:function(lineno,colno,start,stop,step){start=start||new nodes.Literal(lineno,colno,null),stop=stop||new nodes.Literal(lineno,colno,null),step=step||new nodes.Literal(lineno,colno,1),this.parent(lineno,colno,start,stop,step)}});Compiler.prototype.assertType=function(node){node instanceof Slice||orig_Compiler_assertType.apply(this,arguments)},Compiler.prototype.compileSlice=function(node,frame){this._emit("("),this._compileExpression(node.start,frame),this._emit("),("),this._compileExpression(node.stop,frame),this._emit("),("),this._compileExpression(node.step,frame),this._emit(")")},Parser.prototype.parseAggregate=function(){var _this=this,origState=getTokensState(this.tokens);origState.colno--,origState.index--;try{return orig_Parser_parseAggregate.apply(this)}catch(e){var errState=getTokensState(this.tokens),rethrow=function(){return lib._assign(_this.tokens,errState),e};lib._assign(this.tokens,origState),this.peeked=!1;var tok=this.peekToken();if(tok.type!==lexer.TOKEN_LEFT_BRACKET)throw rethrow();this.nextToken();for(var node=new Slice(tok.lineno,tok.colno),isSlice=!1,i=0;i<=node.fields.length&&!this.skip(lexer.TOKEN_RIGHT_BRACKET);i++){if(i===node.fields.length)if(isSlice)this.fail("parseSlice: too many slice components",tok.lineno,tok.colno);else break;if(this.skip(lexer.TOKEN_COLON))isSlice=!0;else{var field=node.fields[i];node[field]=this.parseExpression(),isSlice=this.skip(lexer.TOKEN_COLON)||isSlice}}if(!isSlice)throw rethrow();return new nodes.Array(tok.lineno,tok.colno,[node])}}}function sliceLookup(obj,start,stop,step){obj=obj||[],start===null&&(start=step<0?obj.length-1:0),stop===null?stop=step<0?-1:obj.length:stop<0&&(stop+=obj.length),start<0&&(start+=obj.length);for(var results=[],i=start;!(i<0||i>obj.length||step>0&&i>=stop||step<0&&i<=stop);i+=step)results.push(runtime.memberLookup(obj,i));return results}function hasOwnProp(obj,key2){return Object.prototype.hasOwnProperty.call(obj,key2)}var ARRAY_MEMBERS={pop:function(index2){if(index2===void 0)return this.pop();if(index2>=this.length||index2<0)throw new Error("KeyError");return this.splice(index2,1)},append:function(element2){return this.push(element2)},remove:function(element2){for(var i=0;i<this.length;i++)if(this[i]===element2)return this.splice(i,1);throw new Error("ValueError")},count:function(element2){for(var count2=0,i=0;i<this.length;i++)this[i]===element2&&count2++;return count2},index:function(element2){var i;if((i=this.indexOf(element2))===-1)throw new Error("ValueError");return i},find:function(element2){return this.indexOf(element2)},insert:function(index2,elem){return this.splice(index2,0,elem)}},OBJECT_MEMBERS={items:function(){return lib._entries(this)},values:function(){return lib._values(this)},keys:function(){return lib.keys(this)},get:function(key2,def){var output=this[key2];return output===void 0&&(output=def),output},has
[`+i+"] ";for(key2 in arguments[0])hasOwnProp(arguments[0],key2)&&(arg+=key2+": "+arguments[0][key2]+", ");arg=arg.slice(0,-2)}else arg=arguments[i];args.push(arg)}warn(msg+`
Arguments: `+Array.prototype.slice.call(args).join("")+`
`+new Error().stack),firstTime=!1}return fn.apply(this,arguments)},fn)}var deprecations={};function deprecateSimple(name,msg){hooks.deprecationHandler!=null&&hooks.deprecationHandler(name,msg),deprecations[name]||(warn(msg),deprecations[name]=!0)}hooks.suppressDeprecationWarnings=!1,hooks.deprecationHandler=null;function isFunction3(input){return typeof Function!="undefined"&&input instanceof Function||Object.prototype.toString.call(input)==="[object Function]"}function set3(config2){var prop2,i;for(i in config2)hasOwnProp(config2,i)&&(prop2=config2[i],isFunction3(prop2)?this[i]=prop2:this["_"+i]=prop2);this._config=config2,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function mergeConfigs(parentConfig,childConfig){var res=extend3({},parentConfig),prop2;for(prop2 in childConfig)hasOwnProp(childConfig,prop2)&&(isObject3(parentConfig[prop2])&&isObject3(childConfig[prop2])?(res[prop2]={},extend3(res[prop2],parentConfig[prop2]),extend3(res[prop2],childConfig[prop2])):childConfig[prop2]!=null?res[prop2]=childConfig[prop2]:delete res[prop2]);for(prop2 in parentConfig)hasOwnProp(parentConfig,prop2)&&!hasOwnProp(childConfig,prop2)&&isObject3(parentConfig[prop2])&&(res[prop2]=extend3({},res[prop2]));return res}function Locale(config2){config2!=null&&this.set(config2)}var keys;Object.keys?keys=Object.keys:keys=function(obj){var i,res=[];for(i in obj)hasOwnProp(obj,i)&&res.push(i);return res};var defaultCalendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function calendar(key2,mom,now2){var output=this._calendar[key2]||this._calendar.sameElse;return isFunction3(output)?output.call(mom,now2):output}function zeroFill(number4,targetLength,forceSign){var absNumber=""+Math.abs(number4),zerosToFill=targetLength-absNumber.length,sign2=number4>=0;return(sign2?forceSign?"+":"":"-")+Math.pow(10,Math.max(0,zerosToFill)).toString().substr(1)+absNumber}var formattingTokens=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,localFormattingTokens=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,formatFunctions={},formatTokenFunctions={};function addFormatToken(token2,padded,ordinal2,callback){var func=callback;typeof callback=="string"&&(func=function(){return this[callback]()}),token2&&(formatTokenFunctions[token2]=func),padded&&(formatTokenFunctions[padded[0]]=function(){return zeroFill(func.apply(this,arguments),padded[1],padded[2])}),ordinal2&&(formatTokenFunctions[ordinal2]=function(){return this.localeData().ordinal(func.apply(this,arguments),token2)})}function removeFormattingTokens(input){return input.match(/\[[\s\S]/)?input.replace(/^\[|\]$/g,""):input.replace(/\\/g,"")}function makeFormatFunction(format2){var array2=format2.match(formattingTokens),i,length;for(i=0,length=array2.length;i<length;i++)formatTokenFunctions[array2[i]]?array2[i]=formatTokenFunctions[array2[i]]:array2[i]=removeFormattingTokens(array2[i]);return function(mom){var output="",i2;for(i2=0;i2<length;i2++)output+=isFunction3(array2[i2])?array2[i2].call(mom,format2):array2[i2];return output}}function formatMoment(m,format2){return m.isValid()?(format2=expandFormat(format2,m.localeData()),formatFunctions[format2]=formatFunctions[format2]||makeFormatFunction(format2),formatFunctions[format2](m)):m.localeData().invalidDate()}function expandFormat(format2,locale2){var i=5;function replaceLongDateFormatTokens(input){return locale2.longDateFormat(input)||input}for(localFormattingTokens.lastIndex=0;i>=0&&localFormattingTokens.test(format2);)format2=format2.replace(localFormattingTokens,replaceLongDateFormatTokens),localFormattingTokens.lastIndex=0,i-=1;return format2}var defaultLongDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function longDateFormat(key2
`).replace(/[\r\u0085\u2028]/g,`
`)}function h2(e5){this.options=e5||{locator:{}}}function m(){this.cdata=!1}function p(e5,t5){t5.lineNumber=e5.lineNumber,t5.columnNumber=e5.columnNumber}function f(e5){if(e5)return`
@`+(e5.systemId||"")+"#[line:"+e5.lineNumber+",col:"+e5.columnNumber+"]"}function g(e5,t5,r4){return typeof e5=="string"?e5.substr(t5,r4):e5.length>=t5+r4||t5?new java.lang.String(e5,t5,r4)+"":e5}function b(e5,t5){e5.currentElement?e5.currentElement.appendChild(t5):e5.doc.appendChild(t5)}h2.prototype.parseFromString=function(e5,t5){var r4=this.options,n4=new u,o2=r4.domBuilder||new m,a2=r4.errorHandler,s2=r4.locator,c3=r4.xmlns||{},h3=/\/x?html?$/.test(t5),p2=h3?i.HTML_ENTITIES:i.XML_ENTITIES;s2&&o2.setDocumentLocator(s2),n4.errorHandler=(function(e6,t6,r5){if(!e6){if(t6 instanceof m)return t6;e6=t6}var n5={},o3=e6 instanceof Function;function i2(t7){var i3=e6[t7];!i3&&o3&&(i3=e6.length==2?function(r6){e6(t7,r6)}:e6),n5[t7]=i3&&function(e7){i3("[xmldom "+t7+"] "+e7+f(r5))}||function(){}}return r5=r5||{},i2("warning"),i2("error"),i2("fatalError"),n5})(a2,o2,s2),n4.domBuilder=r4.domBuilder||o2,h3&&(c3[""]=l.HTML),c3.xml=c3.xml||l.XML;var g2=r4.normalizeLineEndings||d;return e5&&typeof e5=="string"?n4.parse(g2(e5),c3,p2):n4.errorHandler.error("invalid doc source"),o2.doc},m.prototype={startDocument:function(){this.doc=new s().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e5,t5,r4,n4){var o2=this.doc,i2=o2.createElementNS(e5,r4||t5),a2=n4.length;b(this,i2),this.currentElement=i2,this.locator&&p(this.locator,i2);for(var s2=0;s2<a2;s2++){e5=n4.getURI(s2);var l2=n4.getValue(s2),c3=(r4=n4.getQName(s2),o2.createAttributeNS(e5,r4));this.locator&&p(n4.getLocator(s2),c3),c3.value=c3.nodeValue=l2,i2.setAttributeNode(c3)}},endElement:function(e5,t5,r4){var n4=this.currentElement;n4.tagName,this.currentElement=n4.parentNode},startPrefixMapping:function(e5,t5){},endPrefixMapping:function(e5){},processingInstruction:function(e5,t5){var r4=this.doc.createProcessingInstruction(e5,t5);this.locator&&p(this.locator,r4),b(this,r4)},ignorableWhitespace:function(e5,t5,r4){},characters:function(e5,t5,r4){if(e5=g.apply(this,arguments)){if(this.cdata)var n4=this.doc.createCDATASection(e5);else n4=this.doc.createTextNode(e5);this.currentElement?this.currentElement.appendChild(n4):/^\s*$/.test(e5)&&this.doc.appendChild(n4),this.locator&&p(this.locator,n4)}},skippedEntity:function(e5){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e5){(this.locator=e5)&&(e5.lineNumber=0)},comment:function(e5,t5,r4){e5=g.apply(this,arguments);var n4=this.doc.createComment(e5);this.locator&&p(this.locator,n4),b(this,n4)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e5,t5,r4){var n4=this.doc.implementation;if(n4&&n4.createDocumentType){var o2=n4.createDocumentType(e5,t5,r4);this.locator&&p(this.locator,o2),b(this,o2),this.doc.doctype=o2}},warning:function(e5){console.warn("[xmldom warning] "+e5,f(this.locator))},error:function(e5){console.error("[xmldom error] "+e5,f(this.locator))},fatalError:function(e5){throw new c2(e5,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(e5){m.prototype[e5]=function(){return null}})),t4.DOMParser=h2},4722:(e4,t4,r3)=>{var n3=r3(4582),o=n3.find,i=n3.NAMESPACE;function a(e5){return e5!==""}function s(e5,t5){return e5.hasOwnProperty(t5)||(e5[t5]=!0),e5}function l(e5){if(!e5)return[];var t5=(function(e6){return e6?e6.split(/[\t\n\f\r ]+/).filter(a):[]})(e5);return Object.keys(t5.reduce(s,{}))}function c2(e5,t5){for(var r4 in e5)Object.prototype.hasOwnProperty.call(e5,r4)&&(t5[r4]=e5[r4])}function u(e5,t5){var r4=e5.prototype;if(!(r4 instanceof t5)){let n5=function(){};var n4=n5;n5.prototype=t5.prototype,c2(r4,n5=new n5),e5.prototype=r4=n5}r4.constructor!=e5&&(typeof e5!="function"&&console.error("unknown Class:"+e5),r4.constructor=e5)}var d={},h2=d.ELEMENT_NODE=1,m=d.ATTRIBUTE_NODE=2,p=d.TEXT_NODE=3,f=d.CDATA_SECTION_NODE=4,g=d.ENTITY_REFERENCE_NODE=5,b=d.ENTITY_NODE=6,x=d.PROCESSING_INSTRUCTION_NODE=7,v=d.COMMENT_NODE=8,y=d.DOCUMENT_NODE=9,w=d.DOCUMENT_TY
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u01
${e5.join("")}
\\end{${t5}}`;return t5===this._genericCommand?this.separators.wrap(r4):r4}get _command(){return this.separators.areParentheses()?"pmatrix":this.separators.areSquareBrackets()?"bmatrix":this.separators.areBrackets()?"Bmatrix":this.separators.areDivides()?"vmatrix":this.separators.areParallels()?"Vmatrix":this.separators.areNotEqual()?this._genericCommand:"bmatrix"}}class s{constructor(e5,t5){this.open=e5,this.close=t5}wrap(e5){return new o.GenericWrapper(this.open,this.close).wrap(e5)}areParentheses(){return this._compare("(",")")}areSquareBrackets(){return this._compare("[","]")}areBrackets(){return this._compare("{","}")}areDivides(){return this._compare("|","|")}areParallels(){return this._compare("||","||")}areNotEqual(){return this.open!==this.close}_compare(e5,t5){return this.open===e5&&this.close===t5}}},6440:(e4,t4,r3)=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0}),t4.MFrac=void 0;let n3=r3(8917),o=r3(4279);t4.MFrac=class{constructor(e5){this._mathmlElement=e5}convert(){let{children:e5,name:t5}=this._mathmlElement,r4=e5.length;if(r4!==2)throw new n3.InvalidNumberOfChildrenError(t5,2,r4);let i=(0,o.mathMLElementToLaTeXConverter)(e5[0]).convert(),a=(0,o.mathMLElementToLaTeXConverter)(e5[1]).convert();return this._isBevelled()?`${this._wrapIfMoreThanOneChar(i)}/${this._wrapIfMoreThanOneChar(a)}`:`\\frac{${i}}{${a}}`}_wrapIfMoreThanOneChar(e5){return new o.ParenthesisWrapper().wrapIfMoreThanOneChar(e5)}_isBevelled(){return!!this._mathmlElement.attributes.bevelled}}},7037:(e4,t4,r3)=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0}),t4.MI=void 0;let n3=r3(4279),o=r3(5406),i=r3(6122);t4.MI=class{constructor(e5){this.utf8Converter=new i.HashUTF8ToLtXConverter,this._mathmlElement=e5}convert(){let e5=(0,n3.normalizeWhiteSpaces)(this._mathmlElement.value);if(e5===" ")return a.apply(e5);let t5=e5.trim(),r4=a.apply(t5),o2=this.utf8Converter.convert(r4);return o2!==r4?o2:this.wrapInMathVariant(r4,this.getMathVariant(this._mathmlElement.attributes))}getMathVariant(e5){if(e5&&e5.mathvariant)return e5.mathvariant}wrapInMathVariant(e5,t5){switch(t5){case"bold":return`\\mathbf{${e5}}`;case"italic":return`\\mathit{${e5}}`;case"bold-italic":return`\\mathbf{\\mathit{${e5}}}`;case"double-struck":return`\\mathbb{${e5}}`;case"bold-fraktur":return`\\mathbf{\\mathfrak{${e5}}}`;case"script":return`\\mathcal{${e5}}`;case"bold-script":return`\\mathbf{\\mathcal{${e5}}}`;case"fraktur":return`\\mathfrak{${e5}}`;case"sans-serif":return`\\mathsf{${e5}}`;case"bold-sans-serif":return`\\mathbf{\\mathsf{${e5}}}`;case"sans-serif-italic":return`\\mathsf{\\mathit{${e5}}}`;case"sans-serif-bold-italic":return`\\mathbf{\\mathsf{\\mathit{${e5}}}}`;case"monospace":return`\\mathtt{${e5}}`;default:return e5}}};class a{constructor(e5){this._value=e5}static apply(e5){return new a(e5)._apply()}_apply(){return this._findByCharacter()||this._findByGlyph()||this._findByNumber()||new i.HashUTF8ToLtXConverter().convert(this._value)}_findByCharacter(){return o.allMathSymbolsByChar[this._value]}_findByGlyph(){return o.allMathSymbolsByGlyph[this._value]}_findByNumber(){return o.mathNumberByGlyph[this._value]}}},8303:(e4,t4,r3)=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0}),t4.MMultiscripts=void 0;let n3=r3(4279),o=r3(8917);t4.MMultiscripts=class{constructor(e5){this._mathmlElement=e5}convert(){let{name:e5,children:t5}=this._mathmlElement,r4=t5.length;if(r4<3)throw new o.InvalidNumberOfChildrenError(e5,3,r4,"at least");let i=(0,n3.mathMLElementToLaTeXConverter)(t5[0]).convert();return this._prescriptLatex()+this._wrapInParenthesisIfThereIsSpace(i)+this._postscriptLatex()}_prescriptLatex(){let{children:e5}=this._mathmlElement,t5,r4;if(this._isPrescripts(e5[1]))t5=e5[2],r4=e5[3];else{if(!this._isPrescripts(e5[3]))return"";t5=e5[4],r4=e5[5]}return`\\_{${(0,n3.mathMLElementToLaTeXConverter)(t5).convert()}}^{${(0,n3.mathMLElementToLaTeXConverter)(r4).convert()}}`}_postscriptLatex(){let{children:e5}=this._mathmlElement;if(this._isPrescripts(e5[1]))return"";let t5=e5[1],r4=e5[2];return`_{${(0,n3.mathMLElementToLaTeXConverter)(t5
`);return this._hasFlag("innerTable")?this._wrap(e5):e5}_wrap(e5){return`\\begin{matrix}${e5}\\end{matrix}`}_addFlagRecursiveIfName(e5,t5,r4){e5.forEach((e6=>{e6.name===t5&&(e6.attributes[r4]=r4),this._addFlagRecursiveIfName(e6.children,t5,r4)}))}_hasFlag(e5){return!!this._mathmlElement.attributes[e5]}}},3951:(e4,t4,r3)=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0}),t4.MText=void 0;let n3=r3(7037);t4.MText=class{constructor(e5){this._mathmlElement=e5}convert(){let{attributes:e5,value:t5}=this._mathmlElement;return[...t5].map((e6=>/^[a-zA-Z0-9]$/.test(e6)||e6===" "?{value:e6,isAlphanumeric:!0}:{value:e6,isAlphanumeric:!1})).reduce(((e6,t6)=>{if(t6.isAlphanumeric){let r4=e6[e6.length-1];if(r4&&r4.isAlphanumeric)return r4.value+=t6.value,e6}return[...e6,t6]}),[]).map((t6=>t6.isAlphanumeric?new o(e5.mathvariant).apply(t6.value):new n3.MI({name:"mi",attributes:{},children:[],value:t6.value}).convert())).join("")}};class o{constructor(e5){this._mathvariant=e5||"normal"}apply(e5){return this._commands.reduce(((t5,r4,n4)=>n4===0?`${r4}{${e5}}`:`${r4}{${t5}}`),"")}get _commands(){switch(this._mathvariant){case"bold":return["\\textbf"];case"italic":return["\\textit"];case"bold-italic":return["\\textit","\\textbf"];case"double-struck":return["\\mathbb"];case"monospace":return["\\mathtt"];case"bold-fraktur":case"fraktur":return["\\mathfrak"];default:return["\\text"]}}}},1586:(e4,t4,r3)=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0}),t4.MTr=void 0;let n3=r3(4279);t4.MTr=class{constructor(e5){this._mathmlElement=e5}convert(){return this._mathmlElement.children.map((e5=>(0,n3.mathMLElementToLaTeXConverter)(e5))).map((e5=>e5.convert())).join(" & ")}}},1222:(e4,t4,r3)=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0}),t4.MUnderover=void 0;let n3=r3(4279),o=r3(8917);t4.MUnderover=class{constructor(e5){this._mathmlElement=e5}convert(){let{name:e5,children:t5}=this._mathmlElement,r4=t5.length;if(r4!==3)throw new o.InvalidNumberOfChildrenError(e5,3,r4);return`${(0,n3.mathMLElementToLaTeXConverter)(t5[0]).convert()}_{${(0,n3.mathMLElementToLaTeXConverter)(t5[1]).convert()}}^{${(0,n3.mathMLElementToLaTeXConverter)(t5[2]).convert()}}`}}},9165:(e4,t4)=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0}),t4.Void=void 0,t4.Void=class{constructor(e5){this._mathmlElement=e5}convert(){return""}}},5443:function(e4,t4,r3){"use strict";var n3=this&&this.__createBinding||(Object.create?function(e5,t5,r4,n4){n4===void 0&&(n4=r4);var o2=Object.getOwnPropertyDescriptor(t5,r4);o2&&!("get"in o2?!t5.__esModule:o2.writable||o2.configurable)||(o2={enumerable:!0,get:function(){return t5[r4]}}),Object.defineProperty(e5,n4,o2)}:function(e5,t5,r4,n4){n4===void 0&&(n4=r4),e5[n4]=t5[r4]}),o=this&&this.__setModuleDefault||(Object.create?function(e5,t5){Object.defineProperty(e5,"default",{enumerable:!0,value:t5})}:function(e5,t5){e5.default=t5}),i=this&&this.__importStar||function(e5){if(e5&&e5.__esModule)return e5;var t5={};if(e5!=null)for(var r4 in e5)r4!=="default"&&Object.prototype.hasOwnProperty.call(e5,r4)&&n3(t5,e5,r4);return o(t5,e5),t5};Object.defineProperty(t4,"__esModule",{value:!0}),t4.MathMLElementToLatexConverterAdapter=void 0;let a=i(r3(6959)),s=r3(2697);t4.MathMLElementToLatexConverterAdapter=class{constructor(e5){this._mathMLElement=e5!=null?e5:new s.VoidMathMLElement}toLatexConverter(){let{name:e5}=this._mathMLElement;return new(l[e5]||a.GenericSpacingWrapper)(this._mathMLElement)}};let l={math:a.Math,mi:a.MI,mo:a.MO,mn:a.MN,msqrt:a.MSqrt,mfenced:a.MFenced,mfrac:a.MFrac,mroot:a.MRoot,maction:a.MAction,menclose:a.MEnclose,merror:a.MError,mphantom:a.MPhantom,msup:a.MSup,msub:a.MSub,msubsup:a.MSubsup,mmultiscripts:a.MMultiscripts,mtext:a.MText,munderover:a.MUnderover,mtable:a.MTable,mtr:a.MTr,mover:a.GenericUnderOver,munder:a.GenericUnderOver,mrow:a.MRow,mspace:a.MSpace,mpadded:a.GenericSpacingWrapper,void:a.Void}},5243:(e4,t4)=>{"use strict";Object.defineProperty(t4,"__esModule",{value:!0}),t4.ErrorHandler=void 0,t4.ErrorHandler=class{constructor(){this._errors=[],this.errorLocator={}}fixError
`}if(e4.matches("span.lnt")||e4.matches("span.lineno")||e4.matches(".react-syntax-highlighter-line-number")||e4.matches(".rouge-gutter"))return"";if((e4.tagName==="DIV"||e4.tagName==="SPAN")&&e4.children.length===2){let t5=(e4.children[0].textContent||"").trim();if(/^\d+$/.test(t5))return u(e4.children[1]).replace(/\n$/,"")+`
`}if(e4.matches('div[class*="line"], span[class*="line"], .ec-line, [data-line-number], [data-line]')){let t5=e4.querySelector('.code:not(.token), .content:not(.token), [class*="code-"], [class*="content-"]');if(t5)return(t5.textContent||"").replace(/\n$/,"")+`
`;let r5=e4.querySelector('.line-number, .gutter, [class*="line-number"], [class*="gutter"]');return r5?Array.from(e4.childNodes).filter((e5=>!r5.contains(e5))).map((e5=>u(e5))).join("").replace(/\n$/,"")+`
`:(e4.textContent||"").replace(/\n$/,"")+`
`}e4.childNodes.forEach((e5=>{r4+=u(e5)}))}return r4},d="";if(e3.matches(".syntaxhighlighter, .wp-block-syntaxhighlighter-code")&&(d=(e4=>{let t4=e4.querySelector(".syntaxhighlighter table .code .container");if(t4)return Array.from(t4.children).map((e5=>Array.from(e5.querySelectorAll("code")).map((e6=>{var t6;let r5=e6.textContent||"";return!((t6=e6.classList)===null||t6===void 0)&&t6.contains("spaces")&&(r5=" ".repeat(r5.length)),r5})).join("")||e5.textContent||"")).join(`
`);let r4=e4.querySelectorAll(".code .line");return r4.length>0?Array.from(r4).map((e5=>Array.from(e5.querySelectorAll("code")).map((e6=>e6.textContent||"")).join("")||e5.textContent||"")).join(`
`):""})(e3)),!d&&c2)d=u(c2);else if(!d){let t4=e3;if(e3.tagName!=="PRE"&&e3.tagName!=="CODE"){let r4=Array.from(e3.querySelectorAll("pre")),n3=r4.find((e4=>e4.querySelector('code[data-lang], code[class*="language-"], .line, [data-line]')))||r4.find((e4=>e4.querySelector("span[class]")&&!e4.classList.contains("lineno")));n3&&(t4=n3)}d=u(t4)}if(e3.matches("code.hl.block"))d=d.replace(/^[ \t]+|[ \t]+$/g,"").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/^\n+/,"");else{d=d.replace(/\t/g," ").replace(/\u00a0/g," ");let e4=d.split(`
`),t4=1/0;for(let r4 of e4){let e5=r4.search(/\S/);e5>-1&&(t4=Math.min(t4,e5))}t4===1/0&&(t4=0),t4>0&&(d=e4.map((e5=>e5.slice(t4))).join(`
`)),d=d.replace(/^\s+|\s+$/g,"").replace(/\n{3,}/g,`
`).replace(/^\n+/,"").replace(/\n+$/,"")}let h2=e3;for(let t4=0;t4<3&&h2;t4++){let t5=h2.parentElement;if(!t5||t5.tagName==="BODY"||t5.children.length>5||!((r3=t5.closest)===null||r3===void 0)&&r3.call(t5,"[data-callout]"))break;let o2=Array.from(t5.children);for(let t6 of o2){if(t6.contains(e3))continue;let r4=t6.tagName;if(r4!=="DIV"&&r4!=="SPAN")continue;let o3=(t6.textContent||"").trim();(0,n2.countWords)(o3)<=5&&!t6.querySelector("pre, code, img, svg, table, h1, h2, h3, h4, h5, h6, p, blockquote, ul, ol, hr")&&t6.remove()}h2=t5}let m=t3.createElement("pre");e3.matches("code.hl.block, pre.hl.lean.lean-output")&&m.setAttribute("data-verso-code","true");let p=t3.createElement("code");return s&&(p.setAttribute("data-lang",s),p.setAttribute("class",`language-${s}`)),p.textContent=d,m.appendChild(p),m}}]},3610(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.FOOTNOTE_SECTION_RE=void 0,t2.standardizeFootnotes=function(e3){let t3=e3.ownerDocument;t3&&new h2(t3).standardizeFootnotes(e3)};let n2=r2(2640),o=r2(639),i=r2(2552),a=r2(4840);t2.FOOTNOTE_SECTION_RE=/^(foot\s*notes?|end\s*notes?|notes?|references?)$/i;let s=/^[\^\u21A9\u21A5\u2191\u21B5\u2934\u2935\u23CE]+$/,l=/^#cite_ref-/,c2=/^\[?\(?(\d{1,4})\)?\]?$/;function u(e3){var t3;return((t3=((e3==null?void 0:e3.getAttribute("href"))||"").split("#").pop())===null||t3===void 0?void 0:t3.toLowerCase())||""}let d=[{selector:"sup.footnoteref",extract:e3=>{var t3;let r3=e3.querySelector('a[id^="footnoteref-"]');return((t3=r3==null?void 0:r3.id.match(/^footnoteref-(\d+)$/))===null||t3===void 0?void 0:t3[1])||""}},{selector:'a[id^="ref-link"]',extract:e3=>{var t3;return((t3=e3.textContent)===null||t3===void 0?void 0:t3.trim())||""}},{selector:'a[role="doc-biblioref"]',extract:e3=>{let t3=e3.getAttribute("data-xml-rid");if(t3)return t3;let r3=e3.getAttribute("href")||"";return r3.startsWith("#core-R")?r3.replace("#core-",""):""}},{selector:"a.footnote-anchor, span.footnote-hovercard-target a",extract:e3=>{var t3;return(((t3=e3.id)===null||t3===void 0?void 0:t3.replace("footnote-anchor-",""))||"").toLowerCase()}},{selector:"sup.reference",extract:e3=>{let t3="";return e3.querySelectorAll("a").forEach((e4=>{var r3;let n3=(r3=(e4.getAttribute("href")||"").split("/").pop())===null||r3===void 0?void 0:r3.match(/(?:cite_note|cite_ref)-(.+)/);n3&&(t3=n3[1].toLowerCase())})),t3}},{selector:'sup[id^="fnref:"], span[id^="fnref:"]',extract:e3=>e3.id.replace("fnref:","").toLowerCase()},{selector:'sup[id^="fnr"]',extract:e3=>e3.id.replace("fnr","").toLowerCase()},{selector:"sup.footnote-reference",extract:e3=>u(e3.querySelector('a[href^="#"]'))},{selector:"span.footnote-reference",extract:e3=>{var t3;return e3.getAttribute("data-footnote-id")||""||(!((t3=e3.id)===null||t3===void 0)&&t3.startsWith("fnref")?e3.id.replace("fnref","").toLowerCase():"")}},{selector:"span.footnote-link",extract:e3=>e3.getAttribute("data-footnote-id")||""},{selector:"a.citation",extract:e3=>{var t3;return((t3=e3.textContent)===null||t3===void 0?void 0:t3.trim())||""}},{selector:'a[id^="fnref"]',extract:e3=>e3.id.replace("fnref","").toLowerCase()}];class h2{constructor(e3){this.pendingRemovals=[],this.doc=e3}makeRefId(e3,t3){return t3>0?`fnref:${e3}-${t3+1}`:`fnref:${e3}`}mergeFootnotes(e3,t3){for(let[r3,n3]of Object.entries(t3)){let t4=parseInt(r3);e3[t4]||(e3[t4]=n3)}}addFootnote(e3,t3,r3,n3){if(!t3||e3.processedIds.has(t3))return!1;let o2=n3!=null?n3:e3.count;return e3.footnotes[o2]={content:r3,originalId:t3,refs:[]},e3.processedIds.add(t3),n3===void 0?e3.count++:n3>=e3.count&&(e3.count=n3+1),!0}createFootnoteItem(e3,t3,r3){let i2=typeof t3=="string"?this.doc:t3.ownerDocument,a2=i2.createElement("li");if(a2.className="footnote",a2.id=`fn:${e3}`,typeof t3=="string"){let e4=i2.createElement("p");e4.appendChild((0,o.parseHTML)(i2,t3)),a2.appendChild(e4)}else{let e4=Array.from(t3.children),r4=e4.some((e5=>e5.tagName.toLowerCase()==="p")),s3=e4.some((e5=>n2.BLOCK_LEVEL_ELEMENTS.has(e5.tagName.toLowerCase())));if(r4||s3)!r4&&s3?e4.forEach((e5=>{if(this.isBackrefLink(e5))return;let t4=e5.cloneNo
<div class="message message-${t4.author.toLowerCase()}" ${i2}>
<div class="message-header">
<p class="message-author"><strong>${t4.author}</strong></p>
${n3}
</div>
<div class="message-content">
${o2}
</div>
</div>${r3<e3.length-1?`
<hr>`:""}`})).join(`
`).trim()}
${t3.length>0?`
<div id="footnotes">
<ol>
${t3.map(((e4,t4)=>`
<li class="footnote" id="fn:${t4+1}">
<p>
<a href="${e4.url}" target="_blank">${e4.text}</a>&nbsp;<a href="#fnref:${t4+1}" class="footnote-backref">\u21A9</a>
</p>
</li>
`)).join("")}
</ol>
</div>`:""}`.trim()}}t2.ConversationExtractor=a},3055(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.BbcodeDataExtractor=void 0;let n2=r2(2279),o=r2(6618);class i extends n2.BaseExtractor{constructor(){super(...arguments),this.eventData=void 0}canExtract(){var e3,t3;return!!(!((t3=(e3=this.getEventData())===null||e3===void 0?void 0:e3.announcement_body)===null||t3===void 0)&&t3.body)}extract(){let e3=this.getEventData(),t3=e3.announcement_body,r3=(0,o.bbcodeToHtml)(t3.body||""),n3=t3.headline||e3.event_name||"",i2=t3.posttime?new Date(1e3*t3.posttime).toISOString():"";return{content:r3,contentHtml:r3,extractedContent:{},variables:{title:n3,author:this.getGroupName(),published:i2}}}getEventData(){var e3;return this.eventData===void 0&&(this.eventData=(e3=this.parseConfigAttr("data-partnereventstore"))!==null&&e3!==void 0?e3:null),this.eventData}getGroupName(){let e3=this.parseConfigAttr("data-groupvanityinfo");return(e3==null?void 0:e3.group_name)||""}parseConfigAttr(e3){let t3=this.document.querySelector("#application_config"),r3=t3==null?void 0:t3.getAttribute(e3);if(!r3)return null;try{let e4=JSON.parse(r3);return Array.isArray(e4)?e4[0]:e4}catch(e4){return null}}}t2.BbcodeDataExtractor=i},5654(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.BlueskyExtractor=void 0;let n2=r2(2279),o=r2(639),i=r2(6077);class a extends n2.BaseExtractor{constructor(e3,t3,r3,n3){super(e3,t3,r3,n3),this.postItems=[],this.threadScreen=e3.querySelector('[data-testid="postThreadScreen"]'),this.threadScreen&&(this.postItems=Array.from(this.threadScreen.querySelectorAll('[data-testid^="postThreadItem-by-"]')))}canExtract(){return this.postItems.length>0}extract(){let e3=this.getHandle(this.postItems[0]),t3=[],r3=[],n3=!1;for(let o3 of this.postItems){let i2=this.getHandle(o3);n3||i2!==e3?(n3=!0,r3.push(o3)):t3.push(o3)}let o2=t3.map((e4=>this.extractPostContent(e4))).join(`
<hr>
`),a2=this.options.includeReplies!==!1?this.extractComments(r3):"",s=(0,i.buildContentHtml)("bluesky",o2,a2),l=`@${e3}`,c2=this.getDisplayName(this.postItems[0]),u=this.createDescription(this.postItems[0]),d=this.getPublishedDate(),h2=this.postTitle(c2||l,"Bluesky");return{content:s,contentHtml:s,extractedContent:{postAuthor:e3},variables:Object.assign({title:h2,author:c2||l,site:"Bluesky",description:u},d&&{published:d})}}extractComments(e3){if(e3.length===0)return"";let t3=0,r3=e3.map((e4=>{let r4=this.getHandle(e4),n3=this.getDisplayName(e4),o2=this.extractPostContent(e4),i2=this.getReplyDate(e4),a2=this.getPermalink(e4);return this.hasTopConnector(e4)?t3++:t3=0,{author:n3?`${n3} @${r4}`:`@${r4}`,date:i2,content:o2,depth:t3,url:a2||void 0}}));return(0,i.buildCommentTree)(r3)}hasTopConnector(e3){let t3=e3.children[0];if(!t3)return!1;let r3=t3.querySelectorAll("div");for(let e4 of Array.from(r3)){let t4=e4.getAttribute("style")||"";if(t4.includes("width: 2px")&&t4.includes("background-color"))return!0}return!1}getHandle(e3){let t3=(e3.getAttribute("data-testid")||"").match(/^postThreadItem-by-(.+)$/);return t3?t3[1]:""}getDisplayName(e3){var t3;let r3=e3.querySelector('a[aria-label*="avatar"]');if(r3){let e4=(r3.getAttribute("aria-label")||"").match(/^(.+)'s avatar$/);if(e4)return e4[1]}let n3=e3.querySelectorAll('a[href^="/profile/"]');for(let e4 of Array.from(n3)){let r4=((t3=e4.textContent)===null||t3===void 0?void 0:t3.trim())||"";if(r4&&!r4.startsWith("@")&&!r4.includes("avatar")&&!r4.includes("\xB7"))return r4}return""}getPublishedDate(){let e3=this.document.querySelector('meta[name="twitter:value1"]');if(e3){let t3=e3.getAttribute("content")||"";try{return new Date(t3).toISOString().split("T")[0]}catch(e4){}}return""}getReplyDate(e3){let t3=e3.querySelector('a[href*="/post/"]');if(!t3)return"";let r3=t3.getAttribute("aria-label")||"";if(!r3)return"";try{let e4=new Date(r3.replace(" at "," "));if(!isNaN(e4.getTime()))return e4.toISOString().split("T")[0]}catch(e4){}return""}getPermalink(e3){let t3=e3.querySelector('a[href*="/post/"]');if(!t3)return"";let r3=t3.getAttribute("href")||"";return r3.startsWith("http")?r3:`https://bsky.app${r3}`}extractPostContent(e3){let t3=[],r3=e3.querySelector('div[data-word-wrap="1"]');if(r3){let e4=this.cleanText(r3);e4&&t3.push(e4)}let n3=this.extractImages(e3);n3&&t3.push(n3);let o2=this.extractLinkCard(e3);o2&&t3.push(o2);let i2=this.extractQuotedPost(e3);return i2&&t3.push(i2),t3.join(`
`)}cleanText(e3){let t3=e3.cloneNode(!0);t3.querySelectorAll('a[href*="/profile/"]').forEach((e4=>{var r4;let n3=((r4=e4.textContent)===null||r4===void 0?void 0:r4.trim())||"",o2=e4.getAttribute("href")||"";if(n3.startsWith("@")){let r5=n3.slice(1),o3=t3.ownerDocument.createElement("a");o3.setAttribute("href",`https://bsky.app/profile/${r5}`),o3.textContent=n3,e4.replaceWith(o3)}else o2.startsWith("/profile/")&&e4.setAttribute("href",`https://bsky.app${o2}`)})),t3.querySelectorAll('a[href^="http"]').forEach((e4=>{var r4;let n3=e4.getAttribute("href")||"",o2=((r4=e4.textContent)===null||r4===void 0?void 0:r4.trim())||"",i2=t3.ownerDocument.createElement("a");i2.setAttribute("href",n3),i2.textContent=o2,e4.replaceWith(i2)})),t3.querySelectorAll("span, div").forEach((e4=>{e4.replaceWith(...Array.from(e4.childNodes))}));let r3=(t3.innerHTML||t3.textContent||"").trim();return r3=r3.replace(/[\u200E\u200F\u200B]/g,""),r3=r3.replace(/[^\S\n]+/g," ").trim(),r3?r3.split(/\n+/).map((e4=>e4.trim())).filter((e4=>e4)).map((e4=>`<p>${e4}</p>`)).join(`
`):""}extractImages(e3){let t3=[];return e3.querySelectorAll('img[src*="/feed_thumbnail/"], img[src*="/feed_fullsize/"]').forEach((e4=>{let r3=e4.getAttribute("src")||"";if(!r3)return;let n3=r3.replace("/feed_thumbnail/","/feed_fullsize/");t3.push(`<img src="${(0,o.escapeHtml)(n3)}" alt="" />`)})),t3.join(`
`)}extractLinkCard(e3){let t3=e3.querySelectorAll('a[aria-label][href^="http"]');for(let e4 of Array.from(t3)){if(!e4.querySelector('div[style*="border"]'))continue;let t4=e4.getAttribute("href")||"",r3=e4.getAttribute("aria-label")||"",n3=e4.querySelector("img");if(r3){let e5="";if(n3){let i2=n3.getAttribute("src")||"";e5+=`<a href="${(0,o.escapeHtml)(t4)}"><img src="${(0,o.escapeHtml)(i2)}" alt="${(0,o.escapeHtml)(r3)}" /></a>
`}return e5+=`<p><a href="${(0,o.escapeHtml)(t4)}">${(0,o.escapeHtml)(r3)}</a></p>`,e5}}return""}extractQuotedPost(e3){let t3=e3.querySelectorAll('[data-testid^="postThreadItem-by-"]');for(let r3 of Array.from(t3)){if(r3===e3)continue;let t4=this.getHandle(r3),n3=this.getDisplayName(r3),o2=r3.querySelector('div[data-word-wrap="1"]'),a2=o2?this.cleanText(o2):"";return(0,i.buildQuotedPost)({author:n3?`${n3} @${t4}`:`@${t4}`,content:a2})}return""}createDescription(e3){let t3=e3.querySelector('div[data-word-wrap="1"]');return t3?(t3.textContent||"").replace(/[\u200E\u200F\u200B]/g,"").trim().slice(0,140).replace(/\s+/g," "):""}}t2.BlueskyExtractor=a},27(e2,t2,r2){"use strict";var n2=this&&this.__awaiter||function(e3,t3,r3,n3){return new(r3||(r3=Promise))((function(o2,i2){function a2(e4){try{l(n3.next(e4))}catch(e5){i2(e5)}}function s2(e4){try{l(n3.throw(e4))}catch(e5){i2(e5)}}function l(e4){var t4;e4.done?o2(e4.value):(t4=e4.value,t4 instanceof r3?t4:new r3((function(e5){e5(t4)}))).then(a2,s2)}l((n3=n3.apply(e3,t3||[])).next())}))};Object.defineProperty(t2,"__esModule",{value:!0}),t2.C2WikiExtractor=void 0;let o=r2(2279),i=r2(639);class a extends o.BaseExtractor{canExtract(){return!1}canExtractAsync(){return this.getPageTitle()!==null}prefersAsync(){return!0}extract(){return{content:"",contentHtml:""}}extractAsync(){return n2(this,void 0,void 0,(function*(){let e3=this.getPageTitle();if(!e3)return{content:"",contentHtml:""};let t3=yield this.fetch("https://c2.com/wiki/remodel/pages/"+e3).then((e4=>e4.json()));if(!t3||!t3.text)return{content:"",contentHtml:""};let r3=e3.replace(/([a-z])([A-Z])/g,"$1 $2"),n3=this.renderPage(t3);return{content:n3,contentHtml:n3,variables:Object.assign({title:r3,site:"C2 Wiki"},t3.date?{published:t3.date}:{})}}))}getPageTitle(){if(this.pageTitle!==void 0)return this.pageTitle;try{let e3=new URL(this.url).search.match(/[?&]([A-Za-z]\w*)/);this.pageTitle=e3?e3[1]:"WelcomeVisitors"}catch(e3){this.pageTitle=null}return this.pageTitle}renderPage(e3){return`${this.markup(e3.text)}${e3.date?`<hr><p>Last edit ${(0,i.escapeHtml)(e3.date)}</p>`:""}`}markup(e3){let t3=e3.replace(/\\\n/g," ").split(/\r?\n/),r3=[],n3=[];for(let e4 of t3){let{html:t4,openTags:o2}=this.applyBullets(e4,n3);r3.push(this.applyInline(t4)),n3=o2}for(;n3.length>0;)r3.push(`</${n3.pop()}>`);return r3.join(`
`)}applyBullets(e3,t3){let r3=[...t3],n3="",o2=(e4,t4)=>{for(;r3.length>e4;)n3+=`</${r3.pop()}>`;t4&&r3.length<e4?(n3+=`<${t4}>`,r3.push(t4)):t4&&r3.length===e4&&r3[e4-1]!==t4&&(n3+=`</${r3.pop()}><${t4}>`,r3.push(t4))};if(/^\s*$/.test(e3))return r3.some((e4=>e4==="ul"||e4==="ol"||e4==="dl"))?{html:"",openTags:r3}:(o2(0),{html:n3+"<p></p>",openTags:r3});if(/^-----*/.test(e3))return o2(0),{html:n3+"<hr>",openTags:r3};let i2=e3.match(/^(\t+)(.+):\t/);if(i2)return o2(i2[1].length,"dl"),{html:n3+`<dt>${i2[2]}<dd>`+e3.slice(i2[0].length),openTags:r3};let a2=e3.match(/^(\t+)\*/);if(a2)return o2(a2[1].length,"ul"),{html:n3+"<li>"+e3.slice(a2[0].length),openTags:r3};let s2=e3.match(/^(\*+)/);if(s2)return o2(s2[1].length,"ul"),{html:n3+"<li>"+e3.slice(s2[0].length),openTags:r3};let l=e3.match(/^(\t+)\d+\.?/);return l?(o2(l[1].length,"ol"),{html:n3+"<li>"+e3.slice(l[0].length),openTags:r3}):/^\s/.test(e3)?(o2(1,"pre"),{html:n3+e3,openTags:r3}):(o2(0),{html:n3+e3,openTags:r3})}applyInline(e3){return e3.replace(/'''(.*?)'''/g,"<strong>$1</strong>").replace(/''(.*?)''/g,"<em>$1</em>").replace(/\b(https?|ftp|mailto|file|telnet|news):[^\s<>[\]"'()]*[^\s<>[\]"'(),.?]/g,(e4=>(0,i.isDangerousUrl)(e4)?(0,i.escapeHtml)(e4):/\.(gif|jpg|jpeg|png)$/i.test(e4)?`<img src="${s(e4)}">`:`<a href="${s(e4)}" rel="nofollow" target="_blank">${(0,i.escapeHtml)(e4)}</a>`))}}function s(e3){return e3.replace(/"/g,"&quot;").replace(/'/g,"&#39;")}t2.C2WikiExtractor=a},8632(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.ChatGPTExtractor=void 0;let n2=r2(5181),o=r2(639);class i extends n2.ConversationExtractor{constructor(e3,t3){super(e3,t3),this.cachedMessages=null,this.turns=e3.querySelectorAll('[data-testid^="conversation-turn-"]'),this.footnotes=[],this.footnoteCounter=0}canExtract(){return!!this.turns&&this.turns.length>0}extractMessages(){if(this.cachedMessages)return this.cachedMessages;let e3=[];return this.footnotes=[],this.footnoteCounter=0,this.turns&&(this.turns.forEach((t3=>{var r3,n3;let i2=t3.querySelector("h4.sr-only, h5.sr-only, h6.sr-only"),a=((n3=(r3=i2==null?void 0:i2.textContent)===null||r3===void 0?void 0:r3.trim())===null||n3===void 0?void 0:n3.replace(/:\s*$/,""))||"",s=t3.querySelector("[data-message-author-role]"),l=(s==null?void 0:s.getAttribute("data-message-author-role"))||"",c2=(s==null?void 0:s.querySelector(".markdown, .whitespace-pre-wrap"))||s||t3,u=(0,o.serializeHTML)(c2);u=u.replace(/\u200B/g,"");let d=this.document.createElement("div");d.appendChild((0,o.parseHTML)(this.document,u)),d.querySelectorAll('h4.sr-only, h5.sr-only, h6.sr-only, span[data-state="closed"]').forEach((e4=>e4.remove())),u=(0,o.serializeHTML)(d),u=u.replace(/(&ZeroWidthSpace;)?(<span[^>]*?>\s*<a(?=[^>]*?href="([^"]+)")(?=[^>]*?target="_blank")(?=[^>]*?rel="noopener")[^>]*?>[\s\S]*?<\/a>\s*<\/span>)/gi,((e4,t4,r4,n4)=>{let o2="",i3="";try{o2=new URL(n4).hostname.replace(/^www\./,"");let e5=n4.split("#:~:text=");if(e5.length>1){i3=decodeURIComponent(e5[1]),i3=i3.replace(/%2C/g,",");let t5=i3.split(",");i3=t5.length>1&&t5[0].trim()?` \u2014 ${t5[0].trim()}...`:t5[0].trim()?` \u2014 ${i3.trim()}`:""}}catch(e5){console.error(`Failed to parse URL: ${n4}`,e5),o2=n4}let a2,s2=this.footnotes.findIndex((e5=>e5.url===n4));return s2===-1?(this.footnoteCounter++,a2=this.footnoteCounter,this.footnotes.push({url:n4,text:`<a href="${n4}">${o2}</a>${i3}`})):a2=s2+1,`<sup id="fnref:${a2}"><a href="#fn:${a2}">${a2}</a></sup>`})),u=u.replace(/<p[^>]*>\s*<\/p>/g,""),e3.push({author:a,content:u.trim(),metadata:{role:l||"unknown"}})})),this.cachedMessages=e3),e3}getFootnotes(){return this.footnotes}getMetadata(){let e3=this.getTitle(),t3=this.extractMessages();return{title:e3,site:"ChatGPT",url:this.url,messageCount:t3.length,description:`ChatGPT conversation with ${t3.length} messages`}}getTitle(){var e3,t3,r3;let n3=(e3=this.document.title)===null||e3===void 0?void 0:e3.trim();if(n3&&n3!=="ChatGPT")return n3;let o2=(r3=(t3=this.turns)===null||t3===void 0?void 0:t3.item(0))===null||r3===void 0?void 0:r3.querySelector(".text-message");if(o2){let
${n3}`),o2&&(a2+=`
${o2}`),i2&&(a2+=`
${i2}`),a2}getVisibleText(e3,t3){var r3;let n3=e3.cloneNode(!0),o2=t3?`.visually-hidden, ${t3}`:".visually-hidden";return n3.querySelectorAll(o2).forEach((e4=>e4.remove())),((r3=n3.textContent)===null||r3===void 0?void 0:r3.trim())||""}cleanTextContent(e3){let t3=e3.cloneNode(!0);t3.querySelectorAll(".visually-hidden, .feed-shared-inline-show-more-text__see-more-less-toggle").forEach((e4=>e4.remove())),t3.querySelectorAll("a").forEach((e4=>{var t4;let r4=e4.getAttribute("href")||"",n3=((t4=e4.textContent)===null||t4===void 0?void 0:t4.trim())||"";if(r4&&n3){let t5=this.document.createElement("a");t5.setAttribute("href",r4),t5.textContent=n3,e4.replaceWith(t5)}else e4.replaceWith(e4.textContent||"")})),t3.querySelectorAll("span, div").forEach((e4=>{e4.replaceWith(...Array.from(e4.childNodes))}));let r3=(0,o.serializeHTML)(t3).trim();return r3=r3.replace(/<!--.*?-->/g,""),r3.split(/(?:<br\s*\/?>\s*){2,}|\n{2,}/).map((e4=>e4.replace(/<br\s*\/?>/g," ").replace(/\s+/g," ").trim())).filter((e4=>e4)).map((e4=>`<p>${e4}</p>`)).join(`
`)}extractQuotedPost(e3){var t3;if(!e3)return"";let r3=e3.querySelector(".update-components-actor__title"),n3=r3?this.getVisibleText(r3,".update-components-actor__supplementary-actor-info, .text-view-model__verified-icon"):"",o2=e3.querySelector(".update-components-actor__sub-description"),a2="";if(o2){let e4=(((t3=(o2.querySelector('[aria-hidden="true"]')||o2).textContent)===null||t3===void 0?void 0:t3.trim())||"").match(/^(\d+\w+)/);a2=e4?e4[1]:""}let s=e3.querySelector(".update-components-text.update-components-update-v2__commentary"),l=s?this.cleanTextContent(s):"",c2=e3.querySelector("a.update-components-mini-update-v2__link-to-details-page"),u=(c2==null?void 0:c2.getAttribute("href"))||"",d=u?(u.startsWith("http")?u:`https://www.linkedin.com${u}`).split("?")[0]:"";return(0,i.buildQuotedPost)({author:n3||void 0,date:a2||void 0,content:l,url:d||void 0})}extractImages(){if(!this.postArticle)return"";let e3=[];return this.postArticle.querySelectorAll(".update-components-image img, .feed-shared-image img").forEach((t3=>{let r3=t3.getAttribute("src")||"",n3=t3.getAttribute("alt")||"";!r3||r3.includes("profile-displayphoto")||r3.includes("avm-avatar")||e3.push(`<img src="${(0,o.escapeHtml)(r3)}" alt="${(0,o.escapeHtml)(n3)}" />`)})),e3.join(`
`)}extractVideo(){if(!this.postArticle)return"";let e3=this.postArticle.querySelector(".update-components-linkedin-video video[poster]");if(!e3)return"";let t3=e3.getAttribute("poster")||"";return`<img src="${(0,o.escapeHtml)(t3)}" alt="Video thumbnail" />`}extractComments(){if(!this.postArticle)return"";let e3=[],t3=this.postArticle.querySelectorAll("article.comments-comment-entity:not(.comments-comment-entity--reply)");for(let r3 of Array.from(t3)){let t4=this.extractCommentData(r3,0);t4&&e3.push(t4);let n3=r3.querySelectorAll(".comments-replies-list article.comments-comment-entity--reply");for(let t5 of Array.from(n3)){let r4=this.extractCommentData(t5,1);r4&&e3.push(r4)}}return e3.length>0?(0,i.buildCommentTree)(e3):""}extractCommentData(e3,t3){var r3,n3,o2,i2,a2;let s=((n3=(r3=e3.querySelector(".comments-comment-meta__description-title"))===null||r3===void 0?void 0:r3.textContent)===null||n3===void 0?void 0:n3.trim())||"";if(!s)return null;let l=e3.querySelector(".comments-comment-entity__content .update-components-text"),c2=l?this.cleanTextContent(l):"",u=e3.querySelector("time.comments-comment-meta__data"),d=((o2=u==null?void 0:u.textContent)===null||o2===void 0?void 0:o2.trim())||"",h2=e3.querySelector("a.comments-comment-meta__description-container"),m=((i2=h2==null?void 0:h2.getAttribute("href"))===null||i2===void 0?void 0:i2.split("?")[0])||"",p="";m&&(p=m.startsWith("http")?m:`https://www.linkedin.com${m}`);let f=e3.querySelector(".comments-comment-social-bar__reactions-count--cr span.v-align-middle"),g=((a2=f==null?void 0:f.textContent)===null||a2===void 0?void 0:a2.trim())||"";return{author:s,date:d,content:c2,depth:t3,score:g?`${g} reactions`:void 0,url:p||void 0}}getAuthorName(){if(!this.postArticle)return"";let e3=this.postArticle.querySelector(".update-components-actor__title");return e3?this.getVisibleText(e3,".text-view-model__verified-icon, .update-components-actor__supplementary-actor-info"):""}createDescription(){if(!this.postArticle)return"";let e3=this.postArticle.querySelector(".feed-shared-update-v2__update-content-wrapper"),t3=this.postArticle.querySelector(".update-components-text.update-components-update-v2__commentary");return!t3||e3&&e3.contains(t3)?"":this.getVisibleText(t3).slice(0,140).replace(/\s+/g," ")}}t2.LinkedInExtractor=a},1756(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.MediumExtractor=void 0;let n2=r2(2279);class o extends n2.BaseExtractor{constructor(e3,t3,r3,n3){super(e3,t3,r3,n3),this.article=e3.querySelector("article.meteredContent")||e3.querySelector("article")}canExtract(){var e3,t3,r3;if(!this.article)return!1;if(!((e3=this.article.classList)===null||e3===void 0)&&e3.contains("meteredContent"))return!0;let n3=((t3=this.document.querySelector('meta[property="og:site_name"]'))===null||t3===void 0?void 0:t3.getAttribute("content"))||"",o2=((r3=this.document.querySelector('meta[property="al:android:app_name"]'))===null||r3===void 0?void 0:r3.getAttribute("content"))||"";return n3==="Medium"||o2==="Medium"}extract(){let e3=this.getTitle(),t3=this.getSubtitle(),r3=this.getAuthor(),n3=this.getPublication();return this.cleanArticle(),{content:"",contentHtml:"",contentSelector:"article",extractedContent:{publication:n3},variables:{title:e3,author:r3,site:n3||"Medium",description:t3||this.getDescription()}}}cleanArticle(){if(!this.article)return;this.article.querySelectorAll('figure [role="button"]').forEach((e4=>{e4.replaceWith(...Array.from(e4.childNodes))})),this.article.querySelectorAll('[role="tooltip"]').forEach((e4=>{e4.removeAttribute("role")})),this.article.querySelectorAll('a[href*="medium.com/plans"]').forEach((e4=>{let t3=e4.closest("div");t3&&t3!==this.article?t3.remove():e4.remove()})),this.article.querySelectorAll('[data-testid="post-preview"]').forEach((e4=>e4.remove())),this.article.querySelectorAll('[data-testid*="Clap"], [data-testid*="Bookmark"], [data-testid*="Share"], [data-testid*="Response"]').forEach((e4=>e4.remove())),this.article.querySelectorAll('[data-testid="authorPhoto"], [data-testid="authorName"], [data-testid="stor
`)}renderInlines(e3){return e3?e3.map((e4=>{var t3;let r3=this.escapeHtml(e4.text||"");if(!(!((t3=e4.formats)===null||t3===void 0)&&t3.length))return r3;for(let t4 of e4.formats)switch(t4.__typename){case"BoldFormat":r3=`<strong>${r3}</strong>`;break;case"ItalicFormat":r3=`<em>${r3}</em>`;break;case"LinkFormat":t4.url&&(r3=`<a href="${this.escapeAttr(t4.url)}">${r3}</a>`)}return r3})).join(""):""}getBestImageUrl(e3){var t3,r3;let n3=e3==null?void 0:e3.crops;if(!(n3!=null&&n3.length))return null;let o2=["superJumbo","jumbo","articleLarge"];for(let e4 of o2)for(let r4 of n3){let n4=(t3=r4.renditions)===null||t3===void 0?void 0:t3.find((t4=>t4.name===e4));if(n4!=null&&n4.url)return n4.url}for(let e4 of n3)if(!((r3=e4.renditions)===null||r3===void 0)&&r3.length&&e4.renditions[0].url)return e4.renditions[0].url;return null}escapeHtml(e3){return e3.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}escapeAttr(e3){return e3.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}}t2.NytimesExtractor=a},5959(e2,t2,r2){"use strict";var n2=this&&this.__awaiter||function(e3,t3,r3,n3){return new(r3||(r3=Promise))((function(o2,i2){function a2(e4){try{l(n3.next(e4))}catch(e5){i2(e5)}}function s2(e4){try{l(n3.throw(e4))}catch(e5){i2(e5)}}function l(e4){var t4;e4.done?o2(e4.value):(t4=e4.value,t4 instanceof r3?t4:new r3((function(e5){e5(t4)}))).then(a2,s2)}l((n3=n3.apply(e3,t3||[])).next())}))};Object.defineProperty(t2,"__esModule",{value:!0}),t2.RedditExtractor=void 0;let o=r2(2279),i=r2(639),a=r2(6077);class s extends o.BaseExtractor{constructor(e3,t3){super(e3,t3),this.shredditPost=e3.querySelector("shreddit-post"),this.isOldReddit=!!e3.querySelector(".thing.link")}canExtract(){return!!this.shredditPost||this.isOldReddit}canExtractAsync(){return this.isCommentsPage()&&!this.isOldReddit}prefersAsync(){let e3=typeof window!="undefined"&&this.document.defaultView===window;return this.isCommentsPage()&&!this.isOldReddit&&!e3}isCommentsPage(){return/\/r\/.+\/comments\//.test(this.url)}extractAsync(){return n2(this,void 0,void 0,(function*(){var e3,t3;let r3=new URL(this.url);r3.hostname="old.reddit.com";let n3=yield this.fetch(r3.toString(),{headers:{"User-Agent":"Mozilla/5.0 (compatible; Defuddle/1.0)"}});if(!n3.ok)throw new Error(`Failed to fetch old.reddit.com: ${n3.status}`);let o2=yield n3.text(),i2=(t3=(e3=this.document.defaultView)===null||e3===void 0?void 0:e3.DOMParser)!==null&&t3!==void 0?t3:typeof DOMParser!="undefined"?DOMParser:null;if(!i2)throw new Error("DOMParser is not available in this environment");let a2=new i2().parseFromString(o2,"text/html");return this.extractOldReddit(a2)}))}extract(){var e3,t3;if(this.isOldReddit)return this.extractOldReddit(this.document);let r3=((t3=(e3=this.document.querySelector("h1"))===null||e3===void 0?void 0:e3.textContent)===null||t3===void 0?void 0:t3.trim())||"",n3=this.getSubreddit(),o2=this.getPostAuthor(),i2=this.getPostContent(),a2=this.createDescription(i2),s2=this.options.includeReplies!==!1?this.extractComments():"",l=this.createContentHtml(i2,s2);return{content:l,contentHtml:l,extractedContent:{postId:this.getPostId(),subreddit:n3,postAuthor:o2},variables:{title:r3,author:o2,site:`r/${n3}`,description:a2}}}extractOldReddit(e3){var t3,r3;let n3=e3.querySelector(".thing.link"),o2=((r3=(t3=n3==null?void 0:n3.querySelector("a.title"))===null||t3===void 0?void 0:t3.textContent)===null||r3===void 0?void 0:r3.trim())||"",s2=(n3==null?void 0:n3.getAttribute("data-author"))||"",l=(n3==null?void 0:n3.getAttribute("data-subreddit"))||"",c2=n3==null?void 0:n3.querySelector(".usertext-body .md"),u=c2?(0,i.serializeHTML)(c2):"",d="";if(this.options.includeReplies!==!1){let t4=e3.querySelector(".commentarea .sitetable"),r4=t4?this.collectOldRedditComments(t4):[];d=r4.length>0?(0,a.buildCommentTree)(r4):""}let h2=this.createContentHtml(u,d),m=this.createDescription(u);return{content:h2,contentHtml:h2,extractedContent:{postId:this.getPostId(),subreddit:l,postAuthor:s2},variables:{title:o2,author:s2,site:`r/${l}`,description:m}}}getPostContent(){var e
${n3}`:r3,i2=((e3=this.document.querySelector('meta[property="og:title"]'))===null||e3===void 0?void 0:e3.getAttribute("content"))||"",a2=((t3=this.document.querySelector('meta[property="og:description"]'))===null||t3===void 0?void 0:t3.getAttribute("content"))||"",s=i2.replace(/\s*\(@[^)]+\)\s*$/,"").trim();return{content:o2,contentHtml:o2,variables:{title:i2,author:s,site:"Substack",description:a2}}}parseDateFromByline(){let e3=this.document.querySelector('[class*="byline-wrapper"]');if(!e3)return"";let t3={Jan:"01",Feb:"02",Mar:"03",Apr:"04",May:"05",Jun:"06",Jul:"07",Aug:"08",Sep:"09",Oct:"10",Nov:"11",Dec:"12"},r3=(e3.textContent||"").trim().replace(/([a-z])([A-Z])/g,"$1 $2").match(new RegExp("\\b(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s+(\\d{1,2}),?\\s+(\\d{4})\\b"));if(r3){let e4=t3[r3[1]],n3=r3[2].padStart(2,"0");return`${r3[3]}-${e4}-${n3}T00:00:00+00:00`}return""}extractPreloadData(){var e3,t3;let r3=Array.from(this.document.querySelectorAll("script"));for(let n3 of r3){let r4=n3.textContent||"";if(!r4.includes("window._preloads")||!r4.includes("body_html"))continue;let o2=r4.indexOf('JSON.parse("');if(o2===-1)continue;let i2=o2+12,a2=i2;for(;a2<r4.length;)if(r4[a2]==="\\")a2+=2;else{if(r4[a2]==='"')break;a2++}try{let n4=r4.slice(i2,a2),o3=JSON.parse('"'+n4+'"'),s=JSON.parse(o3),l=(t3=(e3=s==null?void 0:s.feedData)===null||e3===void 0?void 0:e3.initialPost)===null||t3===void 0?void 0:t3.post;if(l!=null&&l.body_html)return l}catch(e4){}}return null}buildImageHtml(){var e3;if(!this.noteImage)return"";let t3=(e3=this.document.querySelector('meta[property="og:image"]'))===null||e3===void 0?void 0:e3.getAttribute("content");if(t3)return`<img src="${t3}" alt="" />`;let r3=this.noteImage.querySelector("img");if(!r3)return"";let n3=this.getLargestSrc(r3);return n3?`<img src="${n3}" alt="" />`:""}getLargestSrc(e3){let t3=e3.getAttribute("srcset")||"";if(t3){let e4=/(.+?)\s+(\d+(?:\.\d+)?)w/g,r3,n3="",o2=0,i2=0;for(;(r3=e4.exec(t3))!==null;){let t4=r3[1].trim();i2>0&&(t4=t4.replace(/^,\s*/,"")),i2=e4.lastIndex;let a2=parseFloat(r3[2]);t4&&a2>o2&&(o2=a2,n3=t4)}if(n3)return n3.replace(/,w_\d+/g,"").replace(/,c_\w+/g,"")}return e3.getAttribute("src")||""}}t2.SubstackExtractor=a},9970(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.ThreadsExtractor=void 0;let n2=r2(2279),o=r2(639),i=r2(6077);class a extends n2.BaseExtractor{constructor(e3,t3,r3,n3){super(e3,t3,r3,n3),this.pagelets=[],this.regionContainer=null;let o2=Array.from(e3.querySelectorAll('[data-pagelet^="threads_post_page_"]'));if(this.pagelets=o2.filter((e4=>e4.querySelector('a[href^="/@"], time[datetime]'))),this.pagelets.length===0){let t4=e3.querySelector('div[role="region"]');t4!=null&&t4.querySelector('a[href^="/@"]')&&(this.regionContainer=t4)}}canExtract(){return this.pagelets.length>0||!!this.regionContainer}extract(){var e3,t3;if(this.pagelets.length===0&&this.regionContainer)return this.extractFromRegion(this.regionContainer);let r3=this.getUsername(this.pagelets[0]),n3=[],o2=[],a2=!1;for(let e4 of this.pagelets){let t4=this.getPostsFromPagelet(e4);t4.length!==0&&(a2||t4[0].username!==r3||t4.length!==1?(a2=!0,o2.push(t4)):n3.push(t4[0]))}let s=n3.map((e4=>e4.content)).join(`
<hr>
`),l=this.options.includeReplies!==!1?this.extractComments(o2):"",c2=(0,i.buildContentHtml)("threads",s,l),u=`@${r3}`,d=this.createDescription((e3=n3[0])===null||e3===void 0?void 0:e3.element),h2=this.postTitle(u,"Threads"),m=((t3=n3[0])===null||t3===void 0?void 0:t3.date)||"";return{content:c2,contentHtml:c2,extractedContent:{postAuthor:r3},variables:Object.assign({title:h2,author:u,site:"Threads",description:d},m&&{published:m})}}extractFromRegion(e3){let t3=this.getUsername(e3);if(!t3)return{content:"",contentHtml:""};let r3=`@${t3}`,n3=this.extractPostContent(e3),o2=this.options.includeReplies!==!1?this.extractCommentsFromJson(t3):"",a2=(0,i.buildContentHtml)("threads",n3,o2),s=this.createDescription(e3),l=this.getDate(e3);return{content:a2,contentHtml:a2,extractedContent:{postAuthor:t3},variables:Object.assign({title:this.postTitle(r3,"Threads"),author:r3,site:"Threads",description:s},l&&{published:l})}}extractCommentsFromJson(e3){let t3=this.document.querySelectorAll('script[type="application/json"]'),r3=[],n3=new Set;for(let e4 of Array.from(t3)){let t4=e4.textContent||"";if(!((t4.match(/"text_fragments"/g)||[]).length<2)&&t4.includes('"username"'))try{let e5=JSON.parse(t4);for(let t5 of this.findPostsInJson(e5,0)){let e6=t5.username+":"+t5.text.slice(0,80);n3.has(e6)||(n3.add(e6),r3.push(t5))}}catch(e5){}}if(r3.length<2)return"";let a2=[],s=!0;for(let t4 of r3)s&&t4.username===e3?s=!1:a2.push({author:`@${t4.username}`,date:"",content:`<p>${(0,o.escapeHtml)(t4.text)}</p>`,depth:0});return a2.length>0?(0,i.buildCommentTree)(a2):""}findPostsInJson(e3,t3,r3=[]){var n3;if(t3>35||e3==null||typeof e3!="object")return r3;if(!((n3=e3.user)===null||n3===void 0)&&n3.username&&typeof e3.user.username=="string"){let t4=this.extractTextFromJson(e3,0);t4&&r3.push({username:e3.user.username,text:t4})}for(let n4 of Object.keys(e3))n4!=="quoted_post"&&this.findPostsInJson(e3[n4],t3+1,r3);return r3}extractTextFromJson(e3,t3){var r3;if(t3>10||e3==null||typeof e3!="object")return null;if(!((r3=e3.text_fragments)===null||r3===void 0)&&r3.fragments)return e3.text_fragments.fragments.map((e4=>{var t4;return e4.plaintext?e4.plaintext:!((t4=e4.mention_fragment)===null||t4===void 0)&&t4.username?`@${e4.mention_fragment.username}`:e4.linkified_web_url?e4.linkified_web_url:""})).join("");for(let r4 of Object.keys(e3)){if(r4==="quoted_post")continue;let n3=this.extractTextFromJson(e3[r4],t3+1);if(n3)return n3}return null}getPostsFromPagelet(e3){var t3;let r3=e3.querySelectorAll("[data-pressable-container]"),n3=[];for(let e4 of Array.from(r3)){if(!((t3=e4.parentElement)===null||t3===void 0)&&t3.closest("[data-pressable-container]"))continue;let r4=this.getUsername(e4);r4&&n3.push({username:r4,date:this.getDate(e4),permalink:this.getPermalink(e4),content:this.extractPostContent(e4),element:e4})}return n3}extractComments(e3){let t3=[];for(let r3 of e3)for(let e4=0;e4<r3.length;e4++)t3.push(this.toCommentData(r3[e4],r3.length===1?0:e4));return t3.length>0?(0,i.buildCommentTree)(t3):""}toCommentData(e3,t3){return{author:`@${e3.username}`,date:e3.date,content:e3.content,depth:t3,url:e3.permalink||void 0}}getUsername(e3){var t3,r3;let n3=e3.querySelectorAll('a[href^="/@"][role="link"]');for(let e4 of Array.from(n3)){let r4=(t3=e4.textContent)===null||t3===void 0?void 0:t3.trim();if(r4&&!r4.includes("profile picture"))return r4}let o2=e3.querySelector('a[href^="/@"]');if(o2){let e4=(r3=o2.getAttribute("href"))===null||r3===void 0?void 0:r3.match(/\/@([^/]+)/);return e4?e4[1]:""}return""}getDate(e3){let t3=e3.querySelector("time[datetime]");if(!t3)return"";let r3=t3.getAttribute("datetime")||"";try{return new Date(r3).toISOString().split("T")[0]}catch(e4){return""}}getPermalink(e3){let t3=e3.querySelector('a[href*="/post/"]');if(!t3)return"";let r3=t3.getAttribute("href")||"";return r3.startsWith("http")?r3:`https://www.threads.com${r3}`}extractPostContent(e3){var t3;let r3=[],n3=Array.from(e3.querySelectorAll('span[dir="auto"]'));for(let e4 of n3){if(e4.closest('a[href^="/@"], a[href*="/post/"], a[href*="l.threads.com"], time')||e4.closest('[role="b
`)}cleanText(e3){let t3=e3.cloneNode(!0);this.removeThreadNumbers(t3),t3.querySelectorAll("a").forEach((e4=>{var r4;let n3=e4.getAttribute("href")||"",o2=((r4=e4.textContent)===null||r4===void 0?void 0:r4.trim())||"";if(n3.match(/\/@[\w.]+\/post\//))return void e4.remove();let i2=t3.ownerDocument.createElement("a");if(n3.includes("l.threads.com"))i2.setAttribute("href",this.unwrapRedirectUrl(n3));else{if(n3.startsWith("/@")){let t4=n3.replace(/^\/@/,"");return i2.setAttribute("href",`https://www.threads.com/@${t4}`),i2.textContent=`@${t4}`,void e4.replaceWith(i2)}i2.setAttribute("href",n3.startsWith("http")?n3:`https://www.threads.com${n3}`)}i2.textContent=o2,e4.replaceWith(i2)})),t3.querySelectorAll("span, div").forEach((e4=>{e4.replaceWith(...Array.from(e4.childNodes))}));let r3=(t3.innerHTML||t3.textContent||"").trim();return r3=r3.replace(/<!--.*?-->/g,""),r3=r3.replace(/\s+/g," ").trim(),r3||""}stripThreadNumber(e3){return e3.replace(/\s*\d+\s*\/\s*\d+\s*$/,"").trim()}removeThreadNumbers(e3){var t3;let r3=Array.from(e3.querySelectorAll("div"));for(let e4 of r3){let r4=((t3=e4.textContent)===null||t3===void 0?void 0:t3.trim())||"";/^\d+\/\d+$/.test(r4)&&e4.querySelectorAll("span").length>=2&&e4.remove()}}unwrapRedirectUrl(e3){try{let t3=new URL(e3).searchParams.get("u");return t3?decodeURIComponent(t3):e3}catch(t3){return e3}}extractImages(e3){let t3=[];return e3.querySelectorAll("img").forEach((e4=>{let r3=e4.getAttribute("alt")||"",n3=e4.getAttribute("src")||"";if(r3.includes("profile picture")||!n3||e4.closest('a[href*="l.threads.com"]'))return;let i2=parseInt(e4.getAttribute("width")||"0");i2>0&&i2<=48||t3.push(`<img src="${(0,o.escapeHtml)(n3)}" alt="${(0,o.escapeHtml)(r3)}" />`)})),t3.join(`
`)}extractLinkCard(e3){let t3=e3.querySelectorAll('a[href*="l.threads.com"]');for(let e4 of Array.from(t3)){let t4=e4.querySelector("img");if(!t4)continue;let r3=e4.getAttribute("href")||"",n3=this.unwrapRedirectUrl(r3),i2=t4.getAttribute("src")||"",a2=t4.getAttribute("alt")||"";if(i2)return`<a href="${(0,o.escapeHtml)(n3)}"><img src="${(0,o.escapeHtml)(i2)}" alt="${(0,o.escapeHtml)(a2)}" /></a>`}return""}extractQuotedPost(e3){var t3;let r3=e3.querySelector("[data-pressable-container]");if(r3)return this.extractQuotedPostFrom(r3);let n3=e3.querySelectorAll('a[href*="/post/"]');for(let e4 of Array.from(n3)){let r4=((t3=e4.textContent)===null||t3===void 0?void 0:t3.trim())||"";if(/^\d{2}\/\d{2}\/\d{2}$/.test(r4))continue;let n4=e4.getAttribute("href")||"",a2=n4.match(/\/@([^/]+)\/post\//);if(!a2)continue;let s=a2[1],l=`<p>${(0,o.escapeHtml)(r4)}</p>`,c2=n4.startsWith("http")?n4:`https://www.threads.com${n4}`;return(0,i.buildQuotedPost)({author:`@${s}`,content:l,url:c2})}return""}extractQuotedPostFrom(e3){var t3,r3;let n3=this.getUsername(e3),a2=this.getDate(e3),s=Array.from(e3.querySelectorAll('span[dir="auto"]')),l="";for(let e4 of s){if(e4.closest('[role="button"], time'))continue;let n4=e4.closest('a[href^="/@"]');if(n4&&!(!((t3=n4.getAttribute("href"))===null||t3===void 0)&&t3.includes("/post/")))continue;let i2=(r3=e4.textContent)===null||r3===void 0?void 0:r3.trim();if(!i2||i2==="\xB7"||i2==="Author"||/^\d{2}\/\d{2}\/\d{2}$/.test(i2))continue;let a3=this.stripThreadNumber(i2);a3&&(l+=`<p>${(0,o.escapeHtml)(a3)}</p>
`)}return(0,i.buildQuotedPost)({author:n3?`@${n3}`:void 0,date:a2||void 0,content:l.trim()})}createDescription(e3){var t3;if(!e3)return"";let r3=e3.querySelectorAll('span[dir="auto"]');for(let e4 of Array.from(r3)){if(e4.closest('a[href^="/@"], [role="button"], a[href*="/post/"], time'))continue;let r4=((t3=e4.textContent)===null||t3===void 0?void 0:t3.trim())||"";if(!r4||r4==="Author"||r4==="\xB7"||r4==="Top"||r4==="View activity"||/^\d{2}\/\d{2}\/\d{2}$/.test(r4))continue;let n3=this.stripThreadNumber(r4);if(n3)return n3.slice(0,140).replace(/\s+/g," ")}return""}}t2.ThreadsExtractor=a},2248(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.TwitterExtractor=void 0;let n2=r2(2279),o=r2(639),i=r2(6077);class a extends n2.BaseExtractor{constructor(e3,t3){var r3;super(e3,t3),this.mainTweet=null,this.threadTweets=[],this.replyTweets=[],this.replyDepths=[];let n3=e3.querySelector('[aria-label="Timeline: Conversation"]');if(!n3){let t4=e3.querySelector('article[data-testid="tweet"]');return void(t4&&(this.mainTweet=t4))}let o2=Array.from(n3.querySelectorAll('[data-testid="cellInnerDiv"]')),i2=(r3=n3.querySelector("section, h2"))===null||r3===void 0?void 0:r3.parentElement,a2="",s=!0,l=!1,c2=!1,u=0;for(let e4 of o2){if(i2&&i2.compareDocumentPosition(e4)&Node.DOCUMENT_POSITION_FOLLOWING)break;let t4=e4.querySelector('article[data-testid="tweet"]');if(t4){if(s){this.mainTweet=t4,a2=this.getHandle(t4),s=!1,c2=!0;continue}let e5=this.getHandle(t4);if(!l&&e5===a2){this.threadTweets.push(t4),c2=!0;continue}l||(l=!0),c2?u++:u=0,this.replyTweets.push(t4),this.replyDepths.push(u),c2=!0}else c2=!1}}canExtract(){return!!this.mainTweet}extract(){let e3=[this.extractTweetContent(this.mainTweet)];for(let t4 of this.threadTweets)e3.push(this.extractTweetContent(t4));let t3=e3.join(`
<hr>
`),r3=this.options.includeReplies!==!1?this.extractComments():"",n3=(0,i.buildContentHtml)("twitter",t3,r3),o2=this.getTweetId(),a2=this.getTweetAuthor(),s=this.createDescription(this.mainTweet);return{content:n3,contentHtml:n3,extractedContent:{tweetId:o2,tweetAuthor:a2},variables:{title:this.postTitle(a2,"X"),author:a2,site:"X (Twitter)",description:s}}}extractComments(){if(this.replyTweets.length===0)return"";let e3=this.replyTweets.map(((e4,t3)=>{let r3=this.extractUserInfo(e4),n3=this.extractTweetContent(e4);return{author:r3.fullName?`${r3.fullName} ${r3.handle}`:r3.handle,date:r3.date,content:n3,depth:this.replyDepths[t3],url:r3.permalink}}));return(0,i.buildCommentTree)(e3)}getHandle(e3){var t3,r3;let n3=e3.querySelector('[data-testid="User-Name"]'),o2=n3==null?void 0:n3.querySelectorAll("a");return((r3=(t3=o2==null?void 0:o2[1])===null||t3===void 0?void 0:t3.textContent)===null||r3===void 0?void 0:r3.trim())||""}formatTweetText(e3){if(!e3)return"";let t3=this.document.createElement("div");return t3.appendChild((0,o.parseHTML)(this.document,e3)),t3.querySelectorAll("a").forEach((e4=>{var t4;let r3=((t4=e4.textContent)===null||t4===void 0?void 0:t4.trim())||"";e4.replaceWith(r3)})),t3.querySelectorAll("span, div").forEach((e4=>{e4.replaceWith(...Array.from(e4.childNodes))})),(0,o.serializeHTML)(t3).split(`
`).map((e4=>e4.trim())).filter((e4=>e4)).map((e4=>`<p>${e4}</p>`)).join(`
`)}replaceEmojiImages(e3){e3.querySelectorAll('img[src*="/emoji/"]').forEach((e4=>{let t3=e4.getAttribute("alt");t3&&e4.replaceWith(t3)}))}findQuotedTweet(e3){var t3,r3;return((r3=(t3=e3.querySelector('[aria-labelledby*="id__"]'))===null||t3===void 0?void 0:t3.querySelector('[data-testid="User-Name"]'))===null||r3===void 0?void 0:r3.closest('[aria-labelledby*="id__"]'))||null}extractTweetContent(e3){if(!e3)return"";let t3=e3.cloneNode(!0);this.replaceEmojiImages(t3);let r3=t3.querySelector('[data-testid="tweetText"]'),n3=r3?(0,o.serializeHTML)(r3):"",i2=this.formatTweetText(n3),a2=this.findQuotedTweet(e3),s=this.extractImages(e3,a2),l=a2?this.extractQuotedTweet(a2):"",c2=this.extractCard(e3),u="";return i2&&(u+=i2),s.length&&(u+=`
${s.join(`
`)}`),c2&&(u+=`
${c2}`),l&&(u+=`
${l}`),u}extractQuotedTweet(e3){let t3=e3.cloneNode(!0);this.replaceEmojiImages(t3);let r3=t3.querySelector('[data-testid="tweetText"]'),n3=r3?(0,o.serializeHTML)(r3):"",a2=this.formatTweetText(n3),s=this.extractUserInfo(e3),l=this.extractImages(e3,null),c2="";a2&&(c2+=a2),l.length&&(c2+=`
${l.join(`
`)}`);let u=s.fullName?`${s.fullName} ${s.handle}`:s.handle;return(0,i.buildQuotedPost)({author:u||void 0,date:s.date||void 0,content:c2})}extractUserInfo(e3){var t3,r3,n3,o2,i2,a2,s,l,c2;let u=e3.querySelector('[data-testid="User-Name"]');if(!u)return{fullName:"",handle:"",date:"",permalink:""};let d=u.querySelectorAll("a"),h2=((r3=(t3=d==null?void 0:d[0])===null||t3===void 0?void 0:t3.textContent)===null||r3===void 0?void 0:r3.trim())||"",m=((o2=(n3=d==null?void 0:d[1])===null||n3===void 0?void 0:n3.textContent)===null||o2===void 0?void 0:o2.trim())||"";if(!h2||!m){let e4=Array.from(u.children);if(e4.length>=2){h2=((a2=(i2=e4[0])===null||i2===void 0?void 0:i2.textContent)===null||a2===void 0?void 0:a2.trim())||"";let t4=(((l=(s=e4[1])===null||s===void 0?void 0:s.textContent)===null||l===void 0?void 0:l.trim())||"").match(/(@\w+)/);m=t4?t4[1]:""}}let p=e3.querySelector("time"),f=(p==null?void 0:p.getAttribute("datetime"))||"";return{fullName:h2,handle:m,date:f?new Date(f).toISOString().split("T")[0]:"",permalink:((c2=p==null?void 0:p.closest("a"))===null||c2===void 0?void 0:c2.href)||""}}extractImages(e3,t3){let r3=['[data-testid="tweetPhoto"]','[data-testid="tweet-image"]','img[src*="media"]'],n3=[];for(let i2 of r3)e3.querySelectorAll(i2).forEach((e4=>{var r4,i3;if(!(t3!=null&&t3.contains(e4))&&e4.tagName.toLowerCase()==="img"&&e4.getAttribute("alt")){let t4=((r4=e4.getAttribute("src"))===null||r4===void 0?void 0:r4.replace(/&name=\w+$/,"&name=large"))||"",a2=((i3=e4.getAttribute("alt"))===null||i3===void 0?void 0:i3.replace(/\s+/g," ").trim())||"";n3.push(`<img src="${(0,o.escapeHtml)(t4)}" alt="${(0,o.escapeHtml)(a2)}" />`)}}));return n3}extractCard(e3){var t3;let r3=e3.querySelector('[data-testid="card.wrapper"]');if(!r3)return"";let n3=r3.querySelector("a[href]");if(!n3)return"";let i2=n3.getAttribute("href")||"",a2=((t3=(n3.getAttribute("aria-label")||"").split(/\n/)[0])===null||t3===void 0?void 0:t3.trim())||i2;return`<p><a href="${(0,o.escapeHtml)(i2)}">${(0,o.escapeHtml)(a2)}</a></p>`}getTweetId(){let e3=this.url.match(/status\/(\d+)/);return(e3==null?void 0:e3[1])||""}getTweetAuthor(){let e3=this.getHandle(this.mainTweet);return e3.startsWith("@")?e3:`@${e3}`}createDescription(e3){var t3;return e3?(((t3=e3.querySelector('[data-testid="tweetText"]'))===null||t3===void 0?void 0:t3.textContent)||"").trim().slice(0,140).replace(/\s+/g," "):""}}t2.TwitterExtractor=a},2144(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.WikipediaExtractor=void 0;let n2=r2(2279);class o extends n2.BaseExtractor{canExtract(){return this.document.querySelector("#mw-content-text")!==null}extract(){var e3;let t3=((e3=this.document.querySelector('meta[property="og:title"]'))===null||e3===void 0?void 0:e3.getAttribute("content"))||"";return{content:"",contentHtml:"",contentSelector:"#mw-content-text",variables:{title:t3.replace(/\s*[-\u2013\u2014]\s*Wikipedia\s*$/,"")||t3,author:"Wikipedia",site:"Wikipedia"}}}}t2.WikipediaExtractor=o},1064(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.XArticleExtractor=void 0;let n2=r2(2279),o=r2(639),i='[data-testid="twitterArticleReadView"]',a='[data-testid="twitterArticleRichTextView"]',s='[data-testid="twitter-article-title"]',l='[itemprop="author"]',c2='meta[itemprop="name"]',u='meta[itemprop="additionalName"]',d='[data-testid="tweetPhoto"] img',h2=".longform-unstyled, .public-DraftStyleDefault-block",m='span[style*="font-weight: bold"]',p="[data-offset-key]",f='[data-testid="simpleTweet"]',g='[data-testid="tweetText"]',b='[data-testid="User-Name"]',x='[data-testid="markdown-code-block"]';class v extends n2.BaseExtractor{constructor(e3,t3,r3){super(e3,t3,r3),this.articleContainer=e3.querySelector(a)}canExtract(){return!!this.articleContainer}extract(){let e3=this.extractTitle(),t3=this.extractAuthor(),r3=this.extractContent(),n3=this.createDescription();return{content:r3,contentHtml:r3,extractedContent:{articleId:this.getArticleId()},variables:{title:e3,author:t3,site:"X (Twitter)",description:n3}}}extractTitle(){var e3;let t3=this.document.q
`),c2=r3.author_url?`@${r3.author_url.split("/").pop()}`:"",u=(0,a.buildContentHtml)("twitter",l,""),d=c2||r3.author_name,h2=l.replace(/<[^>]*>/g,"").trim().slice(0,140).replace(/\s+/g," ");return{content:u,contentHtml:u,variables:{title:this.postTitle(d,"X"),author:d,site:"X (Twitter)",description:h2}}}))}tryExtractFxTwitter(){return n2(this,void 0,void 0,(function*(){var e3,t3;let r3=this.url.match(/\/([a-zA-Z0-9_][a-zA-Z0-9_]{0,14})\/(status|article)\/(\d+)/);if(!r3)return null;try{let n3=yield this.fetchFxTwitter(r3[1],r3[3]);return!((e3=n3.tweet)===null||e3===void 0)&&e3.article?this.buildArticleResult(n3):!((t3=n3.tweet)===null||t3===void 0)&&t3.text?this.buildTweetResult(n3):null}catch(e4){return null}}))}fetchFxTwitter(e3,t3){return n2(this,void 0,void 0,(function*(){let r3=`https://api.fxtwitter.com/${e3}/status/${t3}`,n3=yield this.fetch(r3,{headers:{"User-Agent":"Mozilla/5.0 (compatible; Defuddle/1.0; +https://defuddle.md)"}});if(!n3.ok)throw new Error(`FxTwitter API request failed: ${n3.status}`);return n3.json()}))}toDateString(e3){if(e3)try{return new Date(e3).toISOString().split("T")[0]}catch(e4){return}}buildArticleResult(e3){var t3;let r3=e3.tweet.article,{blocks:n3,entityMap:o2}=r3.content,i2=r3.media_entities||[],a2=this.renderArticle(n3,o2,r3.cover_media,i2),s2=`@${e3.tweet.author.screen_name}`,l=(t3=this.toDateString(r3.created_at))!==null&&t3!==void 0?t3:this.toDateString(e3.tweet.created_at);return{content:a2,contentHtml:a2,variables:Object.assign({title:r3.title,author:s2,site:"X (Twitter)",description:r3.preview_text},l&&{published:l})}}buildTweetResult(e3){let t3=e3.tweet,r3=`@${t3.author.screen_name}`,n3=this.renderTweet(t3),o2=(0,a.buildContentHtml)("twitter",n3,""),i2=this.toDateString(t3.created_at),s2=(t3.text||"").trim().slice(0,140).replace(/\s+/g," ");return{content:o2,contentHtml:o2,variables:Object.assign({title:this.postTitle(r3,"X"),author:r3,site:"X (Twitter)",description:s2},i2&&{published:i2})}}renderTweet(e3){var t3,r3,n3;let o2=((t3=e3.raw_text)===null||t3===void 0?void 0:t3.text)||e3.text,a2=(((r3=e3.raw_text)===null||r3===void 0?void 0:r3.facets)||[]).filter((e4=>e4.type!=="media")),s2=o2.split(/\n\n+/),l=0,c2=[];for(let e4 of s2){let t4=o2.indexOf(e4,l),r4=t4+e4.length;l=r4;let n4=e4.trimStart().startsWith(">"),i2=n4?e4.trimStart().slice(1).trimStart():e4,s3=n4?t4+(e4.length-e4.trimStart().length)+1+(e4.trimStart().slice(1).length-e4.trimStart().slice(1).trimStart().length):t4,u=this.applyFacets(i2,s3,r4,a2).replace(/\n/g,"<br>");n4?c2.push(`<blockquote><p>${u}</p></blockquote>`):u.trim()&&c2.push(`<p>${u}</p>`)}if(!((n3=e3.media)===null||n3===void 0)&&n3.photos)for(let t4 of e3.media.photos)c2.push(`<img src="${(0,i.escapeHtml)(t4.url)}" alt="">`);return c2.join(`
`)}applyMarkers(e3,t3){if(t3.length===0)return(0,i.escapeHtml)(e3);t3.sort(((e4,t4)=>e4.offset!==t4.offset?e4.offset-t4.offset:e4.type==="close"&&t4.type==="open"?-1:e4.type==="open"&&t4.type==="close"?1:0));let r3="",n3=0;for(let o2 of t3)o2.offset>n3&&(r3+=(0,i.escapeHtml)(e3.slice(n3,o2.offset))),r3+=o2.tag,n3=o2.offset;return n3<e3.length&&(r3+=(0,i.escapeHtml)(e3.slice(n3))),r3}applyFacets(e3,t3,r3,n3){let o2=[];for(let a2 of n3){let[n4,s2]=a2.indices;if(s2<=t3||n4>=r3)continue;let l=Math.max(0,n4-t3),c2=Math.min(e3.length,s2-t3);if(a2.type==="italic")o2.push({offset:l,type:"open",tag:"<em>"}),o2.push({offset:c2,type:"close",tag:"</em>"});else if(a2.type==="mention"&&a2.text){let e4=`https://x.com/${(0,i.escapeHtml)(a2.text)}`;o2.push({offset:l,type:"open",tag:`<a href="${e4}">`}),o2.push({offset:c2,type:"close",tag:"</a>"})}else if(a2.type==="url"&&a2.original){let e4=(0,i.escapeHtml)(a2.original);o2.push({offset:l,type:"open",tag:`<a href="${e4}">`}),o2.push({offset:c2,type:"close",tag:"</a>"})}}return this.applyMarkers(e3,o2)}renderArticle(e3,t3,r3,n3){var o2;let a2=[];!((o2=r3==null?void 0:r3.media_info)===null||o2===void 0)&&o2.original_img_url&&a2.push(`<img src="${(0,i.escapeHtml)(r3.media_info.original_img_url)}" alt="Cover image">`);let s2=0;for(;s2<e3.length;){let r4=e3[s2];if(r4.type==="unordered-list-item"){let r5=[];for(;s2<e3.length&&e3[s2].type==="unordered-list-item";)r5.push(`<li>${this.renderInlineContent(e3[s2],t3)}</li>`),s2++;a2.push(`<ul>${r5.join("")}</ul>`);continue}let o3=this.renderBlock(r4,t3,n3);o3&&a2.push(o3),s2++}return`<article class="x-article">${a2.join(`
`)}</article>`}renderBlock(e3,t3,r3){switch(e3.type){case"unstyled":default:return e3.text.trim()?`<p>${this.renderInlineContent(e3,t3)}</p>`:"";case"header-two":return`<h2>${this.renderInlineContent(e3,t3)}</h2>`;case"header-three":return`<h3>${this.renderInlineContent(e3,t3)}</h3>`;case"atomic":return this.renderAtomicBlock(e3,t3,r3)}}renderAtomicBlock(e3,t3,r3){var n3,o2;if(e3.entityRanges.length===0)return"";let a2=t3.find((t4=>t4.key===String(e3.entityRanges[0].key)));if(!a2)return"";let s2=a2.value;switch(s2.type){case"MEDIA":{let e4=s2.data.mediaItems||[],t4=s2.data.caption,a3=[];for(let s3 of e4){let e5=r3==null?void 0:r3.find((e6=>String(e6.media_id)===String(s3.mediaId)));if(!e5)continue;let l=e5.media_info;if(l.__typename==="ApiImage"&&l.original_img_url)a3.push(`<img src="${(0,i.escapeHtml)(l.original_img_url)}" alt="${t4?(0,i.escapeHtml)(t4):""}">`);else if(l.__typename==="ApiVideo"&&(!((n3=l.preview_image)===null||n3===void 0)&&n3.original_img_url)){let e6=(o2=(l.variants||[]).filter((e7=>e7.content_type==="video/mp4"&&e7.bit_rate)).sort(((e7,t5)=>(t5.bit_rate||0)-(e7.bit_rate||0)))[0])===null||o2===void 0?void 0:o2.url,r4=l.preview_image.original_img_url;e6?a3.push(`<video src="${(0,i.escapeHtml)(e6)}" poster="${(0,i.escapeHtml)(r4)}" controls></video>`):a3.push(`<img src="${(0,i.escapeHtml)(r4)}" alt="${t4?(0,i.escapeHtml)(t4):""}">`)}}return a3.length>0&&t4?`<figure>${a3.join(`
`)}<figcaption>${(0,i.escapeHtml)(t4)}</figcaption></figure>`:a3.length>0?a3.map((e5=>`<figure>${e5}</figure>`)).join(`
`):t4?`<figure><figcaption>${(0,i.escapeHtml)(t4)}</figcaption></figure>`:""}case"MARKDOWN":{let e4=s2.data.markdown||"",t4=e4.match(/^```(\w*)\n([\s\S]*?)\n?```$/);if(t4){let e5=t4[1],r4=t4[2];return`<pre><code${e5?` class="language-${(0,i.escapeHtml)(e5)}" data-lang="${(0,i.escapeHtml)(e5)}"`:""}>${(0,i.escapeHtml)(r4)}</code></pre>`}return`<pre><code>${(0,i.escapeHtml)(e4)}</code></pre>`}default:return""}}renderInlineContent(e3,t3){var r3,n3;let o2=e3.text;if(!o2)return"";let a2=[];for(let t4 of e3.inlineStyleRanges)t4.style==="Bold"&&(a2.push({offset:t4.offset,type:"open",tag:"<strong>"}),a2.push({offset:t4.offset+t4.length,type:"close",tag:"</strong>"}));for(let r4 of e3.entityRanges){let e4=t3.find((e5=>e5.key===String(r4.key)));if((e4==null?void 0:e4.value.type)==="LINK"&&e4.value.data.url){let t4=(0,i.escapeHtml)(e4.value.data.url);a2.push({offset:r4.offset,type:"open",tag:`<a href="${t4}">`}),a2.push({offset:r4.offset+r4.length,type:"close",tag:"</a>"})}}if(!((r3=e3.data)===null||r3===void 0)&&r3.mentions)for(let t4 of e3.data.mentions){let e4=`https://x.com/${(0,i.escapeHtml)(t4.text)}`;a2.push({offset:t4.fromIndex,type:"open",tag:`<a href="${e4}">`}),a2.push({offset:t4.toIndex,type:"close",tag:"</a>"})}if(!((n3=e3.data)===null||n3===void 0)&&n3.urls)for(let t4 of e3.data.urls){let e4=(0,i.escapeHtml)(t4.text);a2.push({offset:t4.fromIndex,type:"open",tag:`<a href="${e4}">`}),a2.push({offset:t4.toIndex,type:"close",tag:"</a>"})}return this.applyMarkers(o2,a2)}}t2.XOembedExtractor=s},3258(e2,t2,r2){"use strict";var n2=this&&this.__awaiter||function(e3,t3,r3,n3){return new(r3||(r3=Promise))((function(o2,i2){function a2(e4){try{l2(n3.next(e4))}catch(e5){i2(e5)}}function s2(e4){try{l2(n3.throw(e4))}catch(e5){i2(e5)}}function l2(e4){var t4;e4.done?o2(e4.value):(t4=e4.value,t4 instanceof r3?t4:new r3((function(e5){e5(t4)}))).then(a2,s2)}l2((n3=n3.apply(e3,t3||[])).next())}))};Object.defineProperty(t2,"__esModule",{value:!0}),t2.YoutubeExtractor=void 0;let o=r2(2279),i=r2(2552),a=r2(1497),s="\u300D\u300F\uFF09",l=new RegExp(`[.!?\u3002\uFF01\uFF1F]["'\\u2019\\u201D)${s}]*\\s*$`),c2=new RegExp(`[?\\uFF1F]["'\\u2019\\u201D)${s}]*\\s*$`),u=/^(>>|-\s)/,d=/^(>>\s*|-\s+)/,h2=/,\s*$/,m=new RegExp(`^(.*[.!?]["'\\u2019\\u201D)]*)\\s+([A-Z].*)$|^(.*[\u3002\uFF01\uFF1F][${s}]*)([${i.CJK_CHAR_RANGES}].*)$`),p=4e3,f="https://www.youtube.com/youtubei/v1/player?prettyPrint=false",g="20.10.38",b={client:{clientName:"ANDROID",clientVersion:g}},x=`com.google.android.youtube/${g} (Linux; U; Android 14)`,v={client:{clientName:"IOS",clientVersion:"20.10.3"}},y={client:{clientName:"WEB",clientVersion:"2.20240101.00.00"}},w={segments:"ytd-transcript-segment-renderer",timestamp:".segment-timestamp",text:".segment-text"},A={segments:"transcript-segment-view-model",timestamp:".ytwTranscriptSegmentViewModelTimestamp",text:"span.yt-core-attributed-string",chapters:"timeline-chapter-view-model h3"};class C extends o.BaseExtractor{constructor(e3,t3,r3,n3){super(e3,t3,r3,n3),this.inlineJsonCache=new Map,this.videoElement=e3.querySelector("video"),this.schemaOrgData=r3}canExtract(){return!0}canExtractAsync(){return!0}prefersAsync(){return!0}extract(){return this.buildResult(this.extractTranscriptFromExistingDom())}extractAsync(){return n2(this,void 0,void 0,(function*(){let e3=this.extractTranscriptFromExistingDom();if(this.shouldUseExistingDomTranscript(e3))return this.buildResult(e3);let t3=(yield this.fetchTranscript())||e3||(yield this.extractTranscriptFromOpenedDom());return this.buildResult(t3)}))}normalizeLanguageCode(e3){return(e3||"").trim().replace(/_/g,"-").toLocaleLowerCase()}languageCodeMatchesPreference(e3,t3){let r3=this.normalizeLanguageCode(e3),n3=this.normalizeLanguageCode(t3);if(!r3||!n3)return!1;if(r3===n3)return!0;let o2=r3.split("-")[0],i2=n3.split("-")[0];return o2===i2&&(r3===o2||n3===i2)}shouldUseExistingDomTranscript(e3){return!!e3&&(!this.options.language||this.languageCodeMatchesPreference(e3.languageCode,this.options.language))}getCaptionTracks(e3){var t3,r3;let n3=(r3=(t3=e3==null?void 0:e3.captions)===null||t3===void 0
$$
${o3}
$$`:""})).join(`
`)})(t4);let c4=t4.querySelector("table")!==null,u2=Array.from(t4.querySelectorAll("td, th")).filter((e5=>(0,a.isDirectTableChild)(e5,t4)));if(c4||u2.length<=1){let e5=Array.from(t4.querySelectorAll("tr")).filter((e6=>(0,a.isDirectTableChild)(e6,t4))),r4=e5.map((e6=>u2.filter((t5=>t5.parentNode===e6)).length));if(e5.length>0&&new Set(r4).size===1&&r4[0]<=1)return`
`+l2.turndown(u2.map((e6=>(0,a.serializeHTML)(e6))).join(""))+`
`}if(Array.from(t4.querySelectorAll("td, th")).some((e5=>s(e5)&&(e5.hasAttribute("colspan")||e5.hasAttribute("rowspan")))))return`
`+(function(e5){let t5=["src","href","style","align","width","height","rowspan","colspan","bgcolor","scope","valign","headers"],r4=e6=>{Array.from(e6.attributes).forEach((r5=>{t5.includes(r5.name)||e6.removeAttribute(r5.name)})),e6.childNodes.forEach((e7=>{(0,i.isElement)(e7)&&r4(e7)}))},n5=e5.cloneNode(!0);return r4(n5),n5.outerHTML.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")})(t4)+`
`;let d2=t4,h3=(d2.rows&&d2.rows.length>0?Array.from(d2.rows):Array.from(t4.querySelectorAll("tr")).filter((e5=>(0,a.isDirectTableChild)(e5,t4)))).map((e5=>`| ${(e5.cells&&e5.cells.length>0?Array.from(e5.cells):Array.from(e5.querySelectorAll("td, th")).filter((t5=>t5.parentNode===e5))).map((e6=>{let t5=l2.turndown((0,a.serializeHTML)(e6)).replace(/\n/g," ").trim();return t5=t5.replace(/\|/g,"\\|"),t5})).join(" | ")} |`));if(!h3.length)return e4;let m=`| ${Array(h3[0].split("|").length-2).fill("---").join(" | ")} |`;return`
${[h3[0],m,...h3.slice(1)].join(`
`)}
`}}),l2.remove(["style","script"]),l2.keep(["iframe","video","audio","sup","sub","svg","math"]),l2.remove(["button"]),l2.addRule("list",{filter:["ul","ol"],replacement:function(e4,t4){e4=e4.trim();let r3=t4;return(r3.parentNode&&(r3.parentNode.nodeName==="UL"||r3.parentNode.nodeName==="OL")?"":`
`)+e4+`
`}}),l2.addRule("listItem",{filter:"li",replacement:function(e4,t4,r3){var n4;if(!s(t4))return e4;let o2=(n4=t4.classList)===null||n4===void 0?void 0:n4.contains("task-list-item"),i2=t4.querySelector('input[type="checkbox"]'),a2="";o2&&i2&&s(i2)&&(e4=e4.replace(/<input[^>]*>/,""),a2=i2.getAttribute("checked")?"[x] ":"[ ] "),e4=e4.replace(/\n+$/,"").split(`
`).filter((e5=>e5.length>0)).join(`
`);let l3=r3.bulletListMarker+" ",c4=t4.parentNode,u2=0,d2=t4.parentNode;for(;d2&&s(d2);){if(d2.nodeName==="UL"||d2.nodeName==="OL")u2++;else if(d2.nodeName!=="LI")break;d2=d2.parentNode}let h3=Math.max(0,u2-1);if(l3=" ".repeat(h3)+l3,c4&&s(c4)&&c4.nodeName==="OL"){let e5=c4.getAttribute("start"),r4=1,n5=Array.from(c4.children||[]);for(let e6=0;e6<n5.length;e6++)if(n5[e6]===t4){r4=e6+1;break}l3=" ".repeat(u2-1)+(e5?Number(e5)+r4-1:r4)+". "}return l3+a2+e4.trim()+(t4.nextSibling&&!/\n$/.test(e4)?`
`:"")}}),l2.addRule("figure",{filter:"figure",replacement:function(e4,t4){var r3;if(!s(t4))return e4;let n4=t4.querySelector("img"),o2=t4.querySelector("figcaption");if(!n4||!s(n4)||Array.from(t4.querySelectorAll("p")).some((e5=>{let r4=e5.parentNode;for(;r4&&r4!==t4;){if(r4.nodeName==="FIGCAPTION")return!1;r4=r4.parentNode}return!0})))return e4;let i2=n4.getAttribute("alt")||"",u2=d(n4),h3="";if(o2&&s(o2)){let e5=o2.querySelector(".ltx_tag_figure"),n5=e5&&s(e5)?(r3=e5.textContent)===null||r3===void 0?void 0:r3.trim():"",i3=(0,a.serializeHTML)(o2),u3=t4.ownerDocument;i3=i3.replace(/<math.*?>(.*?)<\/math>/g,((e6,t5,r4,n6)=>{let o3="";if(u3){let t6=(0,a.parseHTML)(u3,e6).querySelector("math");o3=t6&&s(t6)?c3(t6):""}let i4=n6[r4-1]||"",l3=n6[r4+e6.length]||"",d2=r4===0||/\s/.test(i4),h4=r4+e6.length===n6.length||/\s/.test(l3);return`${d2||/[\s$]/.test(i4)?"":" "}$${o3}$${h4||/[\s$]/.test(l3)?"":" "}`})),h3=`${n5} ${l2.turndown(i3)}`.trim()}return h3=h3.replace(/\[([^\]]+)\]\(([^)]+)\)/g,((e5,t5,r4)=>`[${t5}](${r4})`)),`![${i2}](${u2})
${h3}
`}}),l2.addRule("image",{filter:"img",replacement:function(e4,t4){if(!s(t4))return e4;let r3=t4.getAttribute("alt")||"",n4=d(t4),o2=t4.getAttribute("title")||"";return n4?`![${r3}](${n4}${o2?` "${o2}"`:""})`:""}}),l2.addRule("embedToMarkdown",{filter:function(e4){if(!s(e4))return!1;let t4=e4.getAttribute("src");return!(!t4||!t4.match(/(?:youtube\.com|youtube-nocookie\.com|youtu\.be)/)&&!t4.match(/(?:twitter\.com|x\.com)/))},replacement:function(e4,t4){if(!s(t4))return e4;let r3=t4.getAttribute("src");if(r3){let e5=r3.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtube-nocookie\.com|youtu\.be)\/(?:embed\/|watch\?v=)?([a-zA-Z0-9_-]+)/);if(e5&&e5[1])return`
![](https://www.youtube.com/watch?v=${e5[1]})
`;let t5=r3.match(/(?:https?:\/\/)?(?:www\.)?(?:twitter\.com|x\.com)\/([^/]+)\/status\/([0-9]+)/);if(t5)return`
![](https://x.com/${t5[1]}/status/${t5[2]})
`;let n4=r3.match(/(?:https?:\/\/)?(?:platform\.)?twitter\.com\/embed\/Tweet\.html\?.*?id=([0-9]+)/);if(n4)return`
![](https://x.com/i/status/${n4[1]})
`}return e4}}),l2.addRule("highlight",{filter:"mark",replacement:function(e4){return"=="+e4+"=="}}),l2.addRule("strikethrough",{filter:e4=>e4.nodeName==="DEL"||e4.nodeName==="S"||e4.nodeName==="STRIKE",replacement:function(e4){return"~~"+e4+"~~"}}),l2.addRule("complexLinkStructure",{filter:function(e4,t4){return e4.nodeName==="A"&&e4.childNodes.length>1&&Array.from(e4.childNodes).some((e5=>["H1","H2","H3","H4","H5","H6"].includes(e5.nodeName)))},replacement:function(e4,t4,r3){if(!s(t4))return e4;let n4=t4.getAttribute("href"),o2=t4.getAttribute("title"),i2=t4.querySelector("h1, h2, h3, h4, h5, h6"),c4=i2?l2.turndown(i2.outerHTML):"";i2&&i2.remove();let u2=`${c4}
${l2.turndown((0,a.serializeHTML)(t4))}
`;return n4&&(u2+=`[View original](${n4})`,o2&&(u2+=` "${o2}"`)),u2}}),l2.addRule("arXivEnumerate",{filter:e4=>{var t4,r3;return e4.nodeName==="OL"&&s(e4)&&(r3=(t4=e4.classList)===null||t4===void 0?void 0:t4.contains("ltx_enumerate"))!==null&&r3!==void 0&&r3},replacement:function(e4,t4){return s(t4)?`
`+Array.from(t4.children||[]).map(((e5,t5)=>{if(s(e5)){let r3=((0,a.serializeHTML)(e5)||"").replace(/^<span class="ltx_tag ltx_tag_item">\d+\.<\/span>\s*/,"");return`${t5+1}. ${l2.turndown(r3)}`}return""})).join(`
`)+`
`:e4}}),l2.addRule("citations",{filter:e4=>{if(s(e4)){let t4=e4.getAttribute("id");return e4.nodeName==="SUP"&&t4!==null&&t4.startsWith("fnref:")}return!1},replacement:(e4,t4)=>{if(s(t4)){let e5=t4.getAttribute("id");if(t4.nodeName==="SUP"&&e5!==null&&e5.startsWith("fnref:"))return`[^${e5.replace("fnref:","").split("-")[0]}]`}return e4}}),l2.addRule("footnotesList",{filter:e4=>{if(s(e4)){let t4=e4.parentNode;return e4.nodeName==="OL"&&t4!==null&&s(t4)&&t4.getAttribute("id")==="footnotes"}return!1},replacement:(e4,t4)=>s(t4)?`
`+Array.from(t4.children||[]).map((e5=>{var t5,r3;let n4;if(s(e5)){let o2=e5.getAttribute("id");if(o2!==null)if(o2.startsWith("fn:"))n4=o2.replace("fn:","");else{let e6=(t5=o2.split("/").pop())===null||t5===void 0?void 0:t5.match(/cite_note-(.+)/);n4=e6?e6[1]:o2}let i2=e5.querySelector("sup");i2&&s(i2)&&((r3=i2.textContent)===null||r3===void 0?void 0:r3.trim())===n4&&i2.remove();let c4=l2.turndown((0,a.serializeHTML)(e5)).replace(/\s*\u21a9\ufe0e$/,"").trim();return`[^${n4==null?void 0:n4.toLowerCase()}]: ${c4}`}return""})).join(`
`)+`
`:e4}),l2.addRule("removals",{filter:function(e4){var t4,r3;return!!s(e4)&&(!!(!((t4=e4.getAttribute("href"))===null||t4===void 0)&&t4.includes("#fnref"))||!!(!((r3=e4.classList)===null||r3===void 0)&&r3.contains("footnote-backref")))},replacement:function(e4,t4){return""}}),l2.addRule("handleTextNodesInTables",{filter:function(e4){return(0,i.isTextNode)(e4)&&e4.parentNode!==null&&e4.parentNode.nodeName==="TD"},replacement:function(e4){return e4}}),l2.addRule("preformattedCode",{filter:e4=>e4.nodeName==="PRE",replacement:(e4,t4)=>{var r3,n4;if(!s(t4))return e4;let o2=t4.querySelector("code");return!o2||!s(o2)?e4:`
\`\`\`${o2.getAttribute("data-lang")||o2.getAttribute("data-language")||((n4=(r3=o2.getAttribute("class"))===null||r3===void 0?void 0:r3.match(/language-(\w+)/))===null||n4===void 0?void 0:n4[1])||t4.getAttribute("data-language")||""}
${(o2.textContent||"").trim().replace(/`/g,"\\`")}
\`\`\`
`}}),l2.addRule("math",{filter:e4=>{var t4,r3,n4;return e4.nodeName.toLowerCase()==="math"||s(e4)&&(((t4=e4.classList)===null||t4===void 0?void 0:t4.contains("mwe-math-element"))||((r3=e4.classList)===null||r3===void 0?void 0:r3.contains("mwe-math-fallback-image-inline"))||((n4=e4.classList)===null||n4===void 0?void 0:n4.contains("mwe-math-fallback-image-display")))},replacement:(e4,t4)=>{var r3,n4,o2,a2,l3,u2;if(!s(t4))return e4;let d2=c3(t4);if(d2=d2.trim(),!(typeof t4.closest=="function"&&t4.closest("table")!==null)&&(t4.getAttribute("display")==="block"||!((r3=t4.classList)===null||r3===void 0)&&r3.contains("mwe-math-fallback-image-display")||t4.parentNode&&s(t4.parentNode)&&(!((n4=t4.parentNode.classList)===null||n4===void 0)&&n4.contains("mwe-math-element"))&&t4.parentNode.previousSibling&&s(t4.parentNode.previousSibling)&&t4.parentNode.previousSibling.nodeName.toLowerCase()==="p"))return`
$$
${d2}
$$
`;{let e5=t4.previousSibling,r4=t4.nextSibling,n5=e5&&s(e5)&&((o2=e5.textContent)===null||o2===void 0?void 0:o2.slice(-1))||"",c4=r4&&s(r4)&&((a2=r4.textContent)===null||a2===void 0?void 0:a2[0])||"",h3=!e5||(0,i.isTextNode)(e5)&&((l3=e5.textContent)===null||l3===void 0?void 0:l3.trim())==="",m=!r4||(0,i.isTextNode)(r4)&&((u2=r4.textContent)===null||u2===void 0?void 0:u2.trim())==="";return`${h3||!n5||/[\s$]/.test(n5)?"":" "}$${d2}$${m||!c4||/[\s$]/.test(c4)?"":" "}`}}}),l2.addRule("katex",{filter:e4=>{var t4,r3;return s(e4)&&(((t4=e4.classList)===null||t4===void 0?void 0:t4.contains("math"))||((r3=e4.classList)===null||r3===void 0?void 0:r3.contains("katex")))},replacement:(e4,t4)=>{var r3,n4;if(!s(t4))return e4;let o2=t4.getAttribute("data-latex");if(!o2){let e5=t4.querySelector('.katex-mathml annotation[encoding="application/x-tex"]');o2=e5&&s(e5)&&e5.textContent||""}o2||(o2=((r3=t4.textContent)===null||r3===void 0?void 0:r3.trim())||"");let i2=t4.querySelector(".katex-mathml math");return!((n4=t4.classList)===null||n4===void 0)&&n4.contains("math-inline")||i2&&s(i2)&&i2.getAttribute("display")!=="block"?`$${o2}$`:`
$$
${o2}
$$
`}}),l2.addRule("callout",{filter:e4=>{var t4;return s(e4)&&!!e4.getAttribute("data-callout")&&((t4=e4.classList)===null||t4===void 0?void 0:t4.contains("callout"))},replacement:(e4,t4)=>{var r3;if(!s(t4))return e4;let n4=t4.getAttribute("data-callout")||"note",o2=t4.getAttribute("data-callout-fold"),i2=o2==="-"||o2==="+"?o2:"",a2=t4.querySelector(".callout-title-inner"),c4=((r3=a2==null?void 0:a2.textContent)===null||r3===void 0?void 0:r3.trim())||n4.charAt(0).toUpperCase()+n4.slice(1),u2=t4.querySelector(".callout-title");u2&&u2.remove();let d2=t4.querySelector(".callout-content");return`
> [!${n4}]${i2} ${c4}
${(d2?l2.turndown(d2.innerHTML):l2.turndown(t4.innerHTML)).trim().split(`
`).map((e5=>`> ${e5}`)).join(`
`)}
`}});try{e3=e3.replace(/<wbr\s*\/?>/gi,"");let t4=l2.turndown(e3),r3=t4.match(/^# .+\n+/);if(r3&&(t4=t4.slice(r3[0].length)),t4=t4.replace(/\n*(?<!!)\[]\([^)]+\)\n*/g,""),t4=t4.replace(/!(?=!\[|\[!\[)/g,"! "),t4=t4.replace(/\n{3,}/g,`
`),Object.keys(n3).length>0){t4+=`
---
`;for(let[e4,r4]of Object.entries(n3))t4+=`[^${e4}]: ${r4}
`}return t4.trim()}catch(t4){return console.error("Error converting HTML to Markdown:",t4),console.log("Problematic content:",e3.substring(0,1e3)+"..."),`Partial conversion completed with errors. Original HTML:
${e3}`}}},1608(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.MetadataExtractor=void 0;let n2=r2(2552);class o{static extract(e3,t3,r3){var n3,o2;let i="",a="";try{if(a=((n3=e3.location)===null||n3===void 0?void 0:n3.href)||"",a||(a=this.getMetaContent(r3,"property","og:url")||this.getMetaContent(r3,"property","twitter:url")||this.getSchemaProperty(t3,"url")||this.getSchemaProperty(t3,"mainEntityOfPage.url")||this.getSchemaProperty(t3,"mainEntity.url")||this.getSchemaProperty(t3,"WebSite.url")||((o2=e3.querySelector('link[rel="canonical"]'))===null||o2===void 0?void 0:o2.getAttribute("href"))||""),a)try{i=new URL(a).hostname.replace(/^www\./,"")}catch(e4){console.warn("Failed to parse URL:",e4)}}catch(t4){let r4=e3.querySelector("base[href]");if(r4)try{a=r4.getAttribute("href")||"",i=new URL(a).hostname.replace(/^www\./,"")}catch(e4){console.warn("Failed to parse base URL:",e4)}}let s=this.getSiteName(t3,r3),{title:l,detectedSiteName:c2}=this.cleanTitle(this.getBestTitle(e3,t3,r3,i,s),s),u=this.getAuthor(e3,t3,r3),d=u&&!u.includes(",")?u:"",h2=s||c2||d||i||"";return{title:l,description:this.getDescription(e3,t3,r3),domain:i,favicon:this.getFavicon(e3,a,r3),image:this.getImage(e3,t3,r3),language:this.getLanguage(e3,t3,r3),published:this.getPublished(e3,t3,r3),author:u,site:h2,schemaOrgData:t3,wordCount:0,parseTime:0}}static isPlaceholderValue(e3){return!(!/[{}]/.test(e3)&&!/^#[a-zA-Z]/.test(e3))||!/[\p{L}\p{N}]/u.test(e3)}static firstValid(e3){for(let t3 of e3){let e4=t3();if(e4&&!this.isPlaceholderValue(e4))return e4}return""}static getAuthor(e3,t3,r3){var n3,o2,i;let a;if(a=this.getMetaContent(r3,"name","sailthru.author")||this.getMetaContent(r3,"property","author")||this.getMetaContent(r3,"name","author")||this.getMetaContent(r3,"name","byl")||this.getMetaContent(r3,"name","authorList"),a&&!this.isPlaceholderValue(a))return this.cleanAuthorString(a);let s=this.getMetaContents(r3,"name","citation_author").filter((e4=>!this.isPlaceholderValue(e4)));if(s.length===0&&(s=this.getMetaContents(r3,"property","dc.creator").filter((e4=>!this.isPlaceholderValue(e4)))),s.length>0)return a=s.map((e4=>{if(!e4.includes(","))return e4.trim();let t4=/(.*),\s(.*)/.exec(e4);return t4&&t4.length===3?`${t4[2]} ${t4[1]}`:e4.trim()})).join(", "),a;let l=this.getSchemaProperty(t3,"author.name")||this.getSchemaProperty(t3,"author.[].name");if(l){let e4=l.split(",").map((e5=>e5.trim().replace(/,$/,"").trim())).filter((e5=>e5&&!this.isPlaceholderValue(e5)));if(e4.length>0){let t4=[...new Set(e4)];return t4.length>10&&(t4=t4.slice(0,10)),t4.join(", ")}}let c2=e3.querySelectorAll('a[rel~="author"], address[rel~="author"]');if(c2.length>0&&c2.length<=3){let e4=[];c2.forEach((t5=>{let r4=(t5.textContent||"").replace(/\s+/g," ").trim(),n4=r4.toLowerCase();r4&&r4.length<100&&n4!=="author"&&n4!=="authors"&&!this.isPlaceholderValue(r4)&&e4.push(r4)}));let t4=[...new Set(e4)];if(t4.length>0)return t4.join(", ")}let u=[],d=e4=>{e4&&e4.split(",").forEach((e5=>{let t4=e5.replace(/\s+/g," ").trim().replace(/,$/,"").trim(),r4=t4.toLowerCase();t4&&r4!=="author"&&r4!=="authors"&&!this.isPlaceholderValue(t4)&&u.push(t4)}))},h2=[{selector:'[itemprop="author"]'},{selector:".author",maxMatches:3},{selector:'[href*="/author/"]',maxMatches:3},{selector:".authors a",maxMatches:3}];for(let{selector:t4,maxMatches:r4}of h2){let n4=e3.querySelectorAll(t4);r4&&n4.length>r4||n4.forEach((e4=>d(e4.textContent)))}if(u.length>0){let e4=[...new Set(u.map((e5=>e5.trim())).filter(Boolean))];if(e4.length>1&&(e4=e4.filter((t4=>!e4.some((e5=>e5!==t4&&t4.includes(e5)))))),e4.length>0)return e4.length>10&&(e4=e4.slice(0,10)),e4.join(", ")}let m=e3.querySelector("h1");if(m){let e4=m.nextElementSibling;for(let t5=0;t5<3&&e4;t5++){let t6=((n3=e4.textContent)===null||n3===void 0?void 0:n3.trim())||"",r4=Array.from(e4.querySelectorAll("p, time")),a2=r4.some((e5=>{var t7;return!!this.parseDateText(((t7=e5.textContent)===null||t7===void 0?void 0:t7.trim())||"")}));if(this.parseDateText(t6)||a2){let n4=e4.querySelectorAll("a");if(n4.length===1){let e5=(((o2=n4[0].
`).replace(/\n{3,}/g,`
`).replace(/^\n+|\n+$/g,"");a4.textContent=h3;for(let e8=1;e8<l4.length;e8++)l4[e8].pre.remove();for(let e8 of u2)(t5=e8.parentNode)===null||t5===void 0||t5.removeChild(e8);e7=d2-1}}})(e4)})(e3,r3,l2))),C2("resolveSvgColors",(()=>(function(e4,t4){let r4=e4.querySelectorAll("svg");if(r4.length===0)return;let o2=t4.defaultView,i2=typeof window!="undefined"&&o2===window,a3=new Map,s2=(e5,r5)=>{var s3,l3;if(!(e5=e5.replace(y,((e6,t5)=>t5.trim()))).includes("var("))return e5;if(i2){let n3=a3.get(e5);if(n3)return n3;let i3=r5||t4.documentElement;try{let r6=t4.createElement("div");r6.style.color=e5,i3.appendChild(r6);let n4=o2.getComputedStyle(r6).color;if(r6.remove(),n4&&!n4.includes("var("))return a3.set(e5,n4),n4}catch(e6){}}let c3=e5.match(w);if(c3){let e6=(s3=c3[2])===null||s3===void 0?void 0:s3.trim();if(e6&&!e6.includes("var("))return e6;let t5=c3[1].toLowerCase(),r6=t5.match(/(?:^|-)([a-z]+)-(\d{2,3})$/);if(r6){let e7=(l3=n2.TAILWIND_COLORS[r6[1]])===null||l3===void 0?void 0:l3[r6[2]];if(e7)return e7}if(t5.endsWith("-black"))return"#000";if(t5.endsWith("-white"))return"#fff";if(t5.includes("background")||t5.includes("card")||t5.includes("surface")||t5.includes("bg"))return"Canvas";if(t5.includes("border")||t5.includes("divider")||t5.includes("separator"))return"#ccc";if(t5.includes("muted")||t5.includes("subtle")||t5.includes("secondary")||t5.includes("placeholder"))return"#888"}return"currentColor"};for(let e5 of Array.from(r4)){let t5=e5.parentElement,r5=[e5,...Array.from(e5.querySelectorAll("*"))];for(let e6 of r5){for(let r7 of A){let n3=e6.getAttribute(r7);n3&&(n3.includes("var(")||n3.includes("light-dark("))&&e6.setAttribute(r7,s2(n3,t5))}let r6=e6.getAttribute("style");if(r6&&(r6.includes("var(")||r6.includes("light-dark("))){let n3=r6.replace(y,((e7,t6)=>t6.trim()));n3=n3.replace(/var\(--[^,)]+(?:,\s*[^)]+)?\)/g,(e7=>s2(e7,t5))),e6.setAttribute("style",n3)}k(e6)}q(e5)}})(e3,r3))),a2?(C2("stripUnwantedAttributes",(()=>f(e3,a2))),C2("removeTrailingHeadings",(()=>m(e3))),C2("stripExtraBrElements",(()=>N(e3))),(0,c2.logDebug)(d,"Debug mode: Skipping div flattening to preserve structure")):(C2("replaceCustomElements",(()=>(function(e4,t4){let r4=Array.from(e4.querySelectorAll("*")).filter((e5=>e5.tagName.includes("-")&&!n2.INLINE_ELEMENTS.has(e5.tagName.toLowerCase())&&!(0,c2.isSVGElement)(e5))).reverse(),o2=0;for(let e5 of r4){if(!e5.parentNode)continue;let r5=t4.createElement("div");for(;e5.firstChild;)r5.appendChild(e5.firstChild);e5.replaceWith(r5),o2++}(0,c2.logDebug)(d,"Replaced custom elements with divs:",o2)})(e3,r3))),C2("convertDataAsSpans",(()=>(function(e4,t4){let r4=0,n3=Array.from(e4.querySelectorAll("span[data-as]"));for(let e5 of n3){if(!e5.parentNode)continue;let n4=e5.getAttribute("data-as").toLowerCase();if(!v.has(n4))continue;let o2=t4.createElement(n4);(0,u.transferContent)(e5,o2),e5.replaceWith(o2),r4++}(0,c2.logDebug)(d,"Converted data-as spans:",r4)})(e3,r3))),C2("convertBlockSpans",(()=>(function(e4,t4){var r4;let n3=0,o2=Array.from(e4.querySelectorAll('span[class*="block"], span[style*="block"]'));for(let e5 of o2){if(!e5.parentNode||!(b.test((0,u.getClassName)(e5))||x.test(e5.getAttribute("style")||""))||!(!((r4=e5.textContent)===null||r4===void 0)&&r4.trim()))continue;let o3=t4.createElement("p");(0,u.transferContent)(e5,o3),e5.replaceWith(o3),n3++}(0,c2.logDebug)(d,"Converted block spans to paragraphs:",n3)})(e3,r3))),C2("unwrapLayoutTables",(()=>(function(e4){let t4=Array.from(e4.querySelectorAll("table")),r4=0;for(let e5 of t4){if(!e5.parentNode||e5.querySelector("thead, tfoot, th, caption"))continue;let t5=Array.from(e5.querySelectorAll(":scope > tbody > tr > td, :scope > tr > td")).filter((e6=>{var t6;return(t6=e6.textContent)===null||t6===void 0?void 0:t6.trim()}));if(t5.length!==1)continue;let o2=t5[0],i2=Array.from(o2.children).filter((e6=>{var t6;return(t6=e6.textContent)===null||t6===void 0?void 0:t6.trim()}));i2.length===1&&n2.BLOCK_LEVEL_ELEMENTS.has(i2[0].tagName.toLowerCase())&&(e5.replaceWith(i2[0]),r4++)}(0,c2.logDebug)(d,"Unwrapped layout tables:",r4)})(e3))),C2("flattenW
<article data-defuddle>
<div class="${e3} post">
<div class="post-content">
${t3}
</div>
</div>
${r3?`
<hr>
<div class="${e3} comments">
<h2>Comments</h2>
${r3}
</div>
`:""}
</article>
`.trim()},t2.buildCommentTree=function(e3){var t3,r3,n3;let i=[],a=[];for(let s of e3){let e4=(t3=s.depth)!==null&&t3!==void 0?t3:0;if(e4===0){for(;a.length>0;)i.push("</blockquote>"),a.pop();i.push("<blockquote>"),a.push(0)}else{if(e4<((r3=a[a.length-1])!==null&&r3!==void 0?r3:-1))for(;a.length>0&&a[a.length-1]>=e4;)i.push("</blockquote>"),a.pop();e4>((n3=a[a.length-1])!==null&&n3!==void 0?n3:-1)&&(i.push("<blockquote>"),a.push(e4))}i.push(o(s))}for(;a.length>0;)i.push("</blockquote>"),a.pop();return i.join("")},t2.buildComment=o,t2.buildQuotedPost=function(e3){let t3="";e3.author&&(t3+=`<p><strong>${(0,n2.escapeHtml)(e3.author)}</strong>`,e3.date&&(t3+=` \xB7 ${(0,n2.escapeHtml)(e3.date)}`),t3+="</p>");let r3="";if(e3.url){let t4=(0,n2.isDangerousUrl)(e3.url)?"":e3.url;t4&&(r3=`
<p><a href="${(0,n2.escapeHtml)(t4)}">${(0,n2.escapeHtml)(t4)}</a></p>`)}return`<blockquote class="quoted-post">${t3}${e3.content}${r3}</blockquote>`};let n2=r2(639);function o(e3){let t3=`<span class="comment-author"><strong>${(0,n2.escapeHtml)(e3.author)}</strong></span>`,r3=e3.url&&!(0,n2.isDangerousUrl)(e3.url)?e3.url:"";return`<div class="comment">
<div class="comment-metadata">
${t3} \xB7 ${r3?`<a href="${(0,n2.escapeHtml)(r3)}" class="comment-link">${(0,n2.escapeHtml)(e3.date)}</a>`:`<span class="comment-date">${(0,n2.escapeHtml)(e3.date)}</span>`}${e3.score?` \xB7 <span class="comment-points">${(0,n2.escapeHtml)(e3.score)}</span>`:""}
</div>
<div class="comment-content">${e3.content}</div>
</div>`}},639(e2,t2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.transferContent=function(e3,t3){if("replaceChildren"in t3)t3.replaceChildren();else for(;t3.firstChild;)t3.removeChild(t3.firstChild);for(;e3.firstChild;)t3.appendChild(e3.firstChild)},t2.serializeHTML=function(e3){return e3.innerHTML},t2.decodeHTMLEntities=function(e3,t3){let r3=e3.createElement("textarea");return r3.innerHTML=t3,r3.value},t2.escapeHtml=function(e3){return e3.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},t2.getClassName=function(e3){return typeof e3.className=="string"?e3.className:e3.getAttribute("class")||""},t2.hasResponsiveShowClass=function(e3){return e3.split(/\s+/).some((e4=>r2.test(e4)))},t2.isDangerousUrl=function(e3){let t3=e3.replace(/[\s\u0000-\u001F]+/g,"").toLowerCase();return t3.startsWith("javascript:")||t3.startsWith("data:text/html")},t2.isDirectTableChild=function(e3,t3){let r3=e3.parentNode;for(;r3&&r3!==t3;){if(r3.nodeName==="TABLE")return!1;r3=r3.parentNode}return r3===t3},t2.parseHTML=function(e3,t3){if(!t3)return e3.createDocumentFragment();let r3=e3.createElement("template");if(r3.innerHTML=t3,r3.content)return r3.content;let n2=e3.createElement("div");n2.innerHTML=t3;let o=e3.createDocumentFragment();for(;n2.firstChild;)o.appendChild(n2.firstChild);return o};let r2=/^(sm|md|lg|xl|2xl|min-\[|max-\[):(?:block|flex|grid|inline|table|contents)/},1497(e2,t2,r2){"use strict";Object.defineProperty(t2,"__esModule",{value:!0}),t2.formatTimestamp=o,t2.buildTranscript=function(e3,t3,r3=[]){let i=[...r3].sort(((e4,t4)=>e4.start-t4.start)),a=0,s=[],l=[];for(let e4 of t3){for(;a<i.length&&i[a].start<=e4.start;){let e5=i[a].title;s.push(`<h3>${(0,n2.escapeHtml)(e5)}</h3>`),l.length>0&&l.push(""),l.push(`### ${e5}`),l.push(""),a++}let t4=o(e4.start),r4=e4.speaker!==void 0?` speaker-${e4.speaker}`:"",c2=`<strong><span class="timestamp" data-timestamp="${e4.start}">${t4}</span></strong>`;s.push(`<p class="transcript-segment${r4}">${c2} \xB7 ${(0,n2.escapeHtml)(e4.text)}</p>`),e4.speakerChange&&l.length>0&&l.push(""),l.push(`**${t4}** \xB7 ${e4.text}`)}return{html:`<div class="${e3} transcript">
<h2>Transcript</h2>
${s.join(`
`)}
</div>`,text:l.join(`
`)}};let n2=r2(639);function o(e3){let t3=Math.floor(e3/3600),r3=Math.floor(e3%3600/60),n3=Math.floor(e3%60);return t3>0?`${t3}:${String(r3).padStart(2,"0")}:${String(n3).padStart(2,"0")}`:`${r3}:${String(n3).padStart(2,"0")}`}},8431(e2,t2,r2){"use strict";function n2(e3,t3){return Array(t3+1).join(e3)}r2.r(t2),r2.d(t2,{default:()=>D});var o=["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 i(e3){return c2(e3,o)}var a=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function s(e3){return c2(e3,a)}var l=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function c2(e3,t3){return t3.indexOf(e3.nodeName)>=0}function u(e3,t3){return e3.getElementsByTagName&&t3.some((function(t4){return e3.getElementsByTagName(t4).length}))}var d={};function h2(e3){return e3?e3.replace(/(\n+\s*)+/g,`
`):""}function m(e3){for(var t3 in this.options=e3,this._keep=[],this._remove=[],this.blankRule={replacement:e3.blankReplacement},this.keepReplacement=e3.keepReplacement,this.defaultRule={replacement:e3.defaultReplacement},this.array=[],e3.rules)this.array.push(e3.rules[t3])}function p(e3,t3,r3){for(var n3=0;n3<e3.length;n3++){var o2=e3[n3];if(f(o2,t3,r3))return o2}}function f(e3,t3,r3){var n3=e3.filter;if(typeof n3=="string"){if(n3===t3.nodeName.toLowerCase())return!0}else if(Array.isArray(n3)){if(n3.indexOf(t3.nodeName.toLowerCase())>-1)return!0}else{if(typeof n3!="function")throw new TypeError("`filter` needs to be a string, array, or function");if(n3.call(e3,t3,r3))return!0}}function g(e3){var t3=e3.nextSibling||e3.parentNode;return e3.parentNode.removeChild(e3),t3}function b(e3,t3,r3){return e3&&e3.parentNode===t3||r3(t3)?t3.nextSibling||t3.parentNode:t3.firstChild||t3.nextSibling||t3.parentNode}d.paragraph={filter:"p",replacement:function(e3){return`
`+e3+`
`}},d.lineBreak={filter:"br",replacement:function(e3,t3,r3){return r3.br+`
`}},d.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e3,t3,r3){var o2=Number(t3.nodeName.charAt(1));return r3.headingStyle==="setext"&&o2<3?`
`+e3+`
`+n2(o2===1?"=":"-",e3.length)+`
`:`
`+n2("#",o2)+" "+e3+`
`}},d.blockquote={filter:"blockquote",replacement:function(e3){return`
`+(e3=(e3=e3.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+`
`}},d.list={filter:["ul","ol"],replacement:function(e3,t3){var r3=t3.parentNode;return r3.nodeName==="LI"&&r3.lastElementChild===t3?`
`+e3:`
`+e3+`
`}},d.listItem={filter:"li",replacement:function(e3,t3,r3){e3=e3.replace(/^\n+/,"").replace(/\n+$/,`
`).replace(/\n/gm,`
`);var n3=r3.bulletListMarker+" ",o2=t3.parentNode;if(o2.nodeName==="OL"){var i2=o2.getAttribute("start"),a2=Array.prototype.indexOf.call(o2.children,t3);n3=(i2?Number(i2)+a2:a2+1)+". "}return n3+e3+(t3.nextSibling&&!/\n$/.test(e3)?`
`:"")}},d.indentedCodeBlock={filter:function(e3,t3){return t3.codeBlockStyle==="indented"&&e3.nodeName==="PRE"&&e3.firstChild&&e3.firstChild.nodeName==="CODE"},replacement:function(e3,t3,r3){return`
`+t3.firstChild.textContent.replace(/\n/g,`
`)+`
`}},d.fencedCodeBlock={filter:function(e3,t3){return t3.codeBlockStyle==="fenced"&&e3.nodeName==="PRE"&&e3.firstChild&&e3.firstChild.nodeName==="CODE"},replacement:function(e3,t3,r3){for(var o2,i2=((t3.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],a2=t3.firstChild.textContent,s2=r3.fence.charAt(0),l2=3,c3=new RegExp("^"+s2+"{3,}","gm");o2=c3.exec(a2);)o2[0].length>=l2&&(l2=o2[0].length+1);var u2=n2(s2,l2);return`
`+u2+i2+`
`+a2.replace(/\n$/,"")+`
`+u2+`
`}},d.horizontalRule={filter:"hr",replacement:function(e3,t3,r3){return`
`+r3.hr+`
`}},d.inlineLink={filter:function(e3,t3){return t3.linkStyle==="inlined"&&e3.nodeName==="A"&&e3.getAttribute("href")},replacement:function(e3,t3){var r3=t3.getAttribute("href");r3&&(r3=r3.replace(/([()])/g,"\\$1"));var n3=h2(t3.getAttribute("title"));return n3&&(n3=' "'+n3.replace(/"/g,'\\"')+'"'),"["+e3+"]("+r3+n3+")"}},d.referenceLink={filter:function(e3,t3){return t3.linkStyle==="referenced"&&e3.nodeName==="A"&&e3.getAttribute("href")},replacement:function(e3,t3,r3){var n3,o2,i2=t3.getAttribute("href"),a2=h2(t3.getAttribute("title"));switch(a2&&(a2=' "'+a2+'"'),r3.linkReferenceStyle){case"collapsed":n3="["+e3+"][]",o2="["+e3+"]: "+i2+a2;break;case"shortcut":n3="["+e3+"]",o2="["+e3+"]: "+i2+a2;break;default:var s2=this.references.length+1;n3="["+e3+"]["+s2+"]",o2="["+s2+"]: "+i2+a2}return this.references.push(o2),n3},references:[],append:function(e3){var t3="";return this.references.length&&(t3=`
`+this.references.join(`
`)+`
`,this.references=[]),t3}},d.emphasis={filter:["em","i"],replacement:function(e3,t3,r3){return e3.trim()?r3.emDelimiter+e3+r3.emDelimiter:""}},d.strong={filter:["strong","b"],replacement:function(e3,t3,r3){return e3.trim()?r3.strongDelimiter+e3+r3.strongDelimiter:""}},d.code={filter:function(e3){var t3=e3.previousSibling||e3.nextSibling,r3=e3.parentNode.nodeName==="PRE"&&!t3;return e3.nodeName==="CODE"&&!r3},replacement:function(e3){if(!e3)return"";e3=e3.replace(/\r?\n|\r/g," ");for(var t3=/^`|^ .*?[^ ].* $|`$/.test(e3)?" ":"",r3="`",n3=e3.match(/`+/gm)||[];n3.indexOf(r3)!==-1;)r3+="`";return r3+t3+e3+t3+r3}},d.image={filter:"img",replacement:function(e3,t3){var r3=h2(t3.getAttribute("alt")),n3=t3.getAttribute("src")||"",o2=h2(t3.getAttribute("title"));return n3?"!["+r3+"]("+n3+(o2?' "'+o2+'"':"")+")":""}},m.prototype={add:function(e3,t3){this.array.unshift(t3)},keep:function(e3){this._keep.unshift({filter:e3,replacement:this.keepReplacement})},remove:function(e3){this._remove.unshift({filter:e3,replacement:function(){return""}})},forNode:function(e3){return e3.isBlank?this.blankRule:(t3=p(this.array,e3,this.options))||(t3=p(this._keep,e3,this.options))||(t3=p(this._remove,e3,this.options))?t3:this.defaultRule;var t3},forEach:function(e3){for(var t3=0;t3<this.array.length;t3++)e3(this.array[t3],t3)}};var x=typeof window!="undefined"?window:{},v,y,w=(function(){var e3=x.DOMParser,t3=!1;try{new e3().parseFromString("","text/html")&&(t3=!0)}catch(e4){}return t3})()?x.DOMParser:(v=function(){},(function(){var e3=!1;try{document.implementation.createHTMLDocument("").open()}catch(t3){x.ActiveXObject&&(e3=!0)}return e3})()?v.prototype.parseFromString=function(e3){var t3=new window.ActiveXObject("htmlfile");return t3.designMode="on",t3.open(),t3.write(e3),t3.close(),t3}:v.prototype.parseFromString=function(e3){var t3=document.implementation.createHTMLDocument("");return t3.open(),t3.write(e3),t3.close(),t3},v);function A(e3,t3){var r3;return typeof e3=="string"?r3=(y=y||new w).parseFromString('<x-turndown id="turndown-root">'+e3+"</x-turndown>","text/html").getElementById("turndown-root"):r3=e3.cloneNode(!0),(function(e4){var t4=e4.element,r4=e4.isBlock,n3=e4.isVoid,o2=e4.isPre||function(e5){return e5.nodeName==="PRE"};if(t4.firstChild&&!o2(t4)){for(var i2=null,a2=!1,s2=null,l2=b(s2,t4,o2);l2!==t4;){if(l2.nodeType===3||l2.nodeType===4){var c3=l2.data.replace(/[ \r\n\t]+/g," ");if(i2&&!/ $/.test(i2.data)||a2||c3[0]!==" "||(c3=c3.substr(1)),!c3){l2=g(l2);continue}l2.data=c3,i2=l2}else{if(l2.nodeType!==1){l2=g(l2);continue}r4(l2)||l2.nodeName==="BR"?(i2&&(i2.data=i2.data.replace(/ $/,"")),i2=null,a2=!1):n3(l2)||o2(l2)?(i2=null,a2=!0):i2&&(a2=!1)}var u2=b(s2,l2,o2);s2=l2,l2=u2}i2&&(i2.data=i2.data.replace(/ $/,""),i2.data||g(i2))}})({element:r3,isBlock:i,isVoid:s,isPre:t3.preformattedCode?C:null}),r3}function C(e3){return e3.nodeName==="PRE"||e3.nodeName==="CODE"}function E(e3,t3){return e3.isBlock=i(e3),e3.isCode=e3.nodeName==="CODE"||e3.parentNode.isCode,e3.isBlank=(function(e4){return!s(e4)&&!(function(e5){return c2(e5,l)})(e4)&&/^\s*$/i.test(e4.textContent)&&!(function(e5){return u(e5,a)})(e4)&&!(function(e5){return u(e5,l)})(e4)})(e3),e3.flankingWhitespace=(function(e4,t4){if(e4.isBlock||t4.preformattedCode&&e4.isCode)return{leading:"",trailing:""};var r3=(n3=e4.textContent,o2=n3.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/),{leading:o2[1],leadingAscii:o2[2],leadingNonAscii:o2[3],trailing:o2[4],trailingNonAscii:o2[5],trailingAscii:o2[6]}),n3,o2;return r3.leadingAscii&&S("left",e4,t4)&&(r3.leading=r3.leadingNonAscii),r3.trailingAscii&&S("right",e4,t4)&&(r3.trailing=r3.trailingNonAscii),{leading:r3.leading,trailing:r3.trailing}})(e3,t3),e3}function S(e3,t3,r3){var n3,o2,a2;return e3==="left"?(n3=t3.previousSibling,o2=/ $/):(n3=t3.nextSibling,o2=/^ /),n3&&(n3.nodeType===3?a2=o2.test(n3.nodeValue):r3.preformattedCode&&n3.nodeName==="CODE"?a2=!1:n3.nodeType!==1||i(n3)||(a2=o2.test(n3.textContent))),a2}var _=Array.prototype.reduce,T=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1
`:""},keepReplacement:function(e4,t4){return t4.isBlock?`
`+t4.outerHTML+`
`:t4.outerHTML},defaultReplacement:function(e4,t4){return t4.isBlock?`
`+e4+`
`:e4}};this.options=(function(e4){for(var t4=1;t4<arguments.length;t4++){var r3=arguments[t4];for(var n3 in r3)r3.hasOwnProperty(n3)&&(e4[n3]=r3[n3])}return e4})({},t3,e3),this.rules=new m(this.options)}function k(e3){var t3=this;return _.call(e3.childNodes,(function(e4,r3){var n3="";return(r3=new E(r3,t3.options)).nodeType===3?n3=r3.isCode?r3.nodeValue:t3.escape(r3.nodeValue):r3.nodeType===1&&(n3=L.call(t3,r3)),O(e4,n3)}),"")}function N(e3){var t3=this;return this.rules.forEach((function(r3){typeof r3.append=="function"&&(e3=O(e3,r3.append(t3.options)))})),e3.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function L(e3){var t3=this.rules.forNode(e3),r3=k.call(this,e3),n3=e3.flankingWhitespace;return(n3.leading||n3.trailing)&&(r3=r3.trim()),n3.leading+t3.replacement(r3,e3,this.options)+n3.trailing}function O(e3,t3){var r3=(function(e4){for(var t4=e4.length;t4>0&&e4[t4-1]===`
`;)t4--;return e4.substring(0,t4)})(e3),n3=t3.replace(/^\n*/,""),o2=Math.max(e3.length-r3.length,t3.length-n3.length);return r3+`
`.substring(0,o2)+n3}q.prototype={turndown:function(e3){if(!(function(e4){return e4!=null&&(typeof e4=="string"||e4.nodeType&&(e4.nodeType===1||e4.nodeType===9||e4.nodeType===11))})(e3))throw new TypeError(e3+" is not a string, or an element/document/fragment node.");if(e3==="")return"";var t3=k.call(this,new A(e3,this.options));return N.call(this,t3)},use:function(e3){if(Array.isArray(e3))for(var t3=0;t3<e3.length;t3++)this.use(e3[t3]);else{if(typeof e3!="function")throw new TypeError("plugin must be a Function or an Array of Functions");e3(this)}return this},addRule:function(e3,t3){return this.rules.add(e3,t3),this},keep:function(e3){return this.rules.keep(e3),this},remove:function(e3){return this.rules.remove(e3),this},escape:function(e3){return T.reduce((function(e4,t3){return e4.replace(t3[0],t3[1])}),e3)}};let D=q},5914(e2){"use strict";class t2{constructor(e3,r3){let n3,o2=" "+e3,i2=r3&&r3.loc;if(i2&&i2.start<=i2.end){let e4=i2.lexer.input;n3=i2.start;let t3=i2.end;n3===e4.length?o2+=" at end of input: ":o2+=" at position "+(n3+1)+`:
`;let r4=e4.slice(n3,t3).replace(/[^]/g,"$&\u0332"),a3,s2;a3=n3>15?"\u2026"+e4.slice(n3-15,n3):e4.slice(0,n3),s2=t3+15<e4.length?e4.slice(t3,t3+15)+"\u2026":e4.slice(t3),o2+=a3+r4+s2}let a2=new Error(o2);return a2.name="ParseError",a2.__proto__=t2.prototype,a2.position=n3,a2}}t2.prototype.__proto__=Error.prototype;let r2=function(e3,t3){return e3===void 0?t3:e3},n2=/([A-Z])/g,o=function(e3){return e3.replace(n2,"-$1").toLowerCase()},i={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},a=/[&><"']/g;function s(e3){return String(e3).replace(a,(e4=>i[e4]))}let l=function(e3){return e3.type==="ordgroup"||e3.type==="color"?e3.body.length===1?l(e3.body[0]):e3:e3.type==="font"?l(e3.body):e3},c2=function(e3){let t3=l(e3);return t3.type==="mathord"||t3.type==="textord"||t3.type==="atom"},u=function(e3){return+e3.toFixed(4)},d="aceg\u0131\u0237mnopqrsuvwxyz\u03B1\u03B3\u03B5\u03B7\u03B9\u03BA\u03BC\u03BD\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C7\u03C9\u03D5\u{1D41A}\u{1D41C}\u{1D41E}\u{1D420}\u{1D426}\u{1D427}\u{1D428}\u{1D429}\u{1D42A}\u{1D42B}\u{1D42C}\u{1D42E}\u{1D42F}\u{1D430}\u{1D431}\u{1D432}\u{1D433}";class h2{constructor(e3){e3=e3||{},this.displayMode=r2(e3.displayMode,!1),this.annotate=r2(e3.annotate,!1),this.leqno=r2(e3.leqno,!1),this.throwOnError=r2(e3.throwOnError,!1),this.errorColor=r2(e3.errorColor,"#b22222"),this.macros=e3.macros||{},this.wrap=r2(e3.wrap,"none"),this.xml=r2(e3.xml,!1),this.colorIsTextColor=r2(e3.colorIsTextColor,!1),this.strict=r2(e3.strict,!1),this.trust=r2(e3.trust,!1),this.maxSize=e3.maxSize===void 0?[1/0,1/0]:Array.isArray(e3.maxSize)?e3.maxSize:[1/0,1/0],this.maxExpand=Math.max(0,r2(e3.maxExpand,1e3))}isTrusted(e3){if(e3.url&&!e3.protocol){let t4=(function(e4){let t5=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e4);return t5?t5[2]!==":"?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t5[1])?t5[1].toLowerCase():null:"_relative"})(e3.url);if(t4==null)return!1;e3.protocol=t4}return!!(typeof this.trust=="function"?this.trust(e3):this.trust)}}let m={},p={};function f({type:e3,names:t3,props:r3,handler:n3,mathmlBuilder:o2}){let i2={type:e3,numArgs:r3.numArgs,argTypes:r3.argTypes,allowedInArgument:!!r3.allowedInArgument,allowedInText:!!r3.allowedInText,allowedInMath:r3.allowedInMath===void 0||r3.allowedInMath,numOptionalArgs:r3.numOptionalArgs||0,infix:!!r3.infix,primitive:!!r3.primitive,handler:n3};for(let e4=0;e4<t3.length;++e4)m[t3[e4]]=i2;e3&&o2&&(p[e3]=o2)}function g({type:e3,mathmlBuilder:t3}){f({type:e3,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},mathmlBuilder:t3})}let b=function(e3){return e3.type==="ordgroup"&&e3.body.length===1?e3.body[0]:e3},x=function(e3){return e3.type==="ordgroup"?e3.body:[e3]};class v{constructor(e3){this.children=e3,this.classes=[],this.style={}}hasClass(e3){return this.classes.includes(e3)}toNode(){let e3=document.createDocumentFragment();for(let t3=0;t3<this.children.length;t3++)e3.appendChild(this.children[t3].toNode());return e3}toMarkup(){let e3="";for(let t3=0;t3<this.children.length;t3++)e3+=this.children[t3].toMarkup();return e3}toText(){return this.children.map((e3=>e3.toText())).join("")}}let y=function(e3){return e3.filter((e4=>e4)).join(" ")},w=function(e3,t3){this.classes=e3||[],this.attributes={},this.style=t3||{}},A=function(e3){let t3=document.createElement(e3);t3.className=y(this.classes);for(let e4 in this.style)Object.prototype.hasOwnProperty.call(this.style,e4)&&(t3.style[e4]=this.style[e4]);for(let e4 in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e4)&&t3.setAttribute(e4,this.attributes[e4]);for(let e4=0;e4<this.children.length;e4++)t3.appendChild(this.children[e4].toNode());return t3},C=function(e3){let t3=`<${e3}`;this.classes.length&&(t3+=` class="${s(y(this.classes))}"`);let r3="";for(let e4 in this.style)Object.prototype.hasOwnProperty.call(this.style,e4)&&(r3+=`${o(e4)}:${this.style[e4]};`);r3&&(t3+=` style="${r3}"`);for(let e4 in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,e4)&&(t3+=` ${e4}="${s(this.attributes[e4])}"`);t3+=">";for(le
{\\smash{\\lower4mu{\\char"2323}}}\\mkern5mu}`),Ke("\\incoh",`{\\mkern5mu\\rule{}{0.7em}\\mathrlap{\\smash{\\raise2mu{\\char"2323}}}
{\\smash{\\lower4mu{\\char"2322}}}\\mkern5mu}`),Ke("\\standardstate","\\text{\\tiny\\char`\u29B5}"),Ke("\\ce",(function(e3){return lt(e3.consumeArgs(1)[0],"ce")})),Ke("\\pu",(function(e3){return lt(e3.consumeArgs(1)[0],"pu")})),Ke("\\uniDash","{\\rule{0.672em}{0.06em}}"),Ke("\\triDash","{\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}}"),Ke("\\tripleDash","\\kern0.075em\\raise0.25em{\\triDash}\\kern0.075em"),Ke("\\tripleDashOverLine","\\kern0.075em\\mathrlap{\\raise0.125em{\\uniDash}}\\raise0.34em{\\triDash}\\kern0.075em"),Ke("\\tripleDashOverDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\triDash}}\\raise0.27em{\\uniDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em"),Ke("\\tripleDashBetweenDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\uniDash}}\\raise0.27em{\\triDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em");var lt=function(e3,t3){for(var r3="",n3=e3.length&&e3[e3.length-1].loc.start,o2=e3.length-1;o2>=0;o2--)e3[o2].loc.start>n3&&(r3+=" ",n3=e3[o2].loc.start),r3+=e3[o2].text,n3+=e3[o2].text.length;return ut.go(ct.go(r3,t3))},ct={go:function(e3,t3){if(!e3)return[];t3===void 0&&(t3="ce");var r3,n3="0",o2={};o2.parenthesisLevel=0,e3=(e3=(e3=e3.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var i2=10,a2=[];;){r3!==e3?(i2=10,r3=e3):i2--;var s2=ct.stateMachines[t3],l2=s2.transitions[n3]||s2.transitions["*"];e:for(var c3=0;c3<l2.length;c3++){var u2=ct.patterns.match_(l2[c3].pattern,e3);if(u2){for(var d2=l2[c3].task,h3=0;h3<d2.action_.length;h3++){var m2;if(s2.actions[d2.action_[h3].type_])m2=s2.actions[d2.action_[h3].type_](o2,u2.match_,d2.action_[h3].option);else{if(!ct.actions[d2.action_[h3].type_])throw["MhchemBugA","mhchem bug A. Please report. ("+d2.action_[h3].type_+")"];m2=ct.actions[d2.action_[h3].type_](o2,u2.match_,d2.action_[h3].option)}ct.concatArray(a2,m2)}if(n3=d2.nextState||n3,!(e3.length>0))return a2;if(d2.revisit||(e3=u2.remainder),!d2.toContinue)break e}}if(i2<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(e3,t3){if(t3)if(Array.isArray(t3))for(var r3=0;r3<t3.length;r3++)e3.push(t3[r3]);else e3.push(t3)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(e3){var t3=e3.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return t3&&t3[0]?{match_:t3.splice(1),remainder:e3.substr(t3[0].length)}:null},"(-)(9)^(-9)":function(e3){var t3=e3.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return t3&&t3[0]?{match_:t3.splice(1),remainder:e3.substr(t3[0].length)}:null},"state of aggregation $":function(e3){var t3=ct.patterns.findObserveGroups(e3,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(t3&&t3.remainder.match(/^($|[\s,;\)\]\}])/))return t3;var r3=e3.match(/^(?:\((?:\\ca\s?)?\$[
"Apricot": "#ffb484",
"Aquamarine": "#08b4bc",
"Bittersweet": "#c84c14",
"blue": "#0000FF",
"Blue": "#303494",
"BlueGreen": "#08b4bc",
"BlueViolet": "#503c94",
"BrickRed": "#b8341c",
"brown": "#BF8040",
"Brown": "#802404",
"BurntOrange": "#f8941c",
"CadetBlue": "#78749c",
"CarnationPink": "#f884b4",
"Cerulean": "#08a4e4",
"CornflowerBlue": "#40ace4",
"cyan": "#00FFFF",
"Cyan": "#08acec",
"Dandelion": "#ffbc44",
"darkgray": "#404040",
"DarkOrchid": "#a8548c",
"Emerald": "#08ac9c",
"ForestGreen": "#089c54",
"Fuchsia": "#90348c",
"Goldenrod": "#ffdc44",
"gray": "#808080",
"Gray": "#98949c",
"green": "#00FF00",
"Green": "#08a44c",
"GreenYellow": "#e0e474",
"JungleGreen": "#08ac9c",
"Lavender": "#f89cc4",
"lightgray": "#c0c0c0",
"lime": "#BFFF00",
"LimeGreen": "#90c43c",
"magenta": "#FF00FF",
"Magenta": "#f0048c",
"Mahogany": "#b0341c",
"Maroon": "#b03434",
"Melon": "#f89c7c",
"MidnightBlue": "#086494",
"Mulberry": "#b03c94",
"NavyBlue": "#086cbc",
"olive": "#7F7F00",
"OliveGreen": "#407c34",
"orange": "#FF8000",
"Orange": "#f8843c",
"OrangeRed": "#f0145c",
"Orchid": "#b074ac",
"Peach": "#f8945c",
"Periwinkle": "#8074bc",
"PineGreen": "#088c74",
"pink": "#ff7f7f",
"Plum": "#98248c",
"ProcessBlue": "#08b4ec",
"purple": "#BF0040",
"Purple": "#a0449c",
"RawSienna": "#983c04",
"red": "#ff0000",
"Red": "#f01c24",
"RedOrange": "#f86434",
"RedViolet": "#a0246c",
"Rhodamine": "#f0549c",
"Royallue": "#0874bc",
"RoyalPurple": "#683c9c",
"RubineRed": "#f0047c",
"Salmon": "#f8948c",
"SeaGreen": "#30bc9c",
"Sepia": "#701404",
"SkyBlue": "#48c4dc",
"SpringGreen": "#c8dc64",
"Tan": "#e09c74",
"teal": "#007F7F",
"TealBlue": "#08acb4",
"Thistle": "#d884b4",
"Turquoise": "#08b4cc",
"violet": "#800080",
"Violet": "#60449c",
"VioletRed": "#f054a4",
"WildStrawberry": "#f0246c",
"yellow": "#FFFF00",
"Yellow": "#fff404",
"YellowGreen": "#98cc6c",
"YellowOrange": "#ffa41c"
}`),Lt=(e3,r3)=>{let n3="";if(e3==="HTML"){if(!Et.test(r3))throw new t2("Invalid HTML input.");n3=r3}else if(e3==="RGB"){if(!_t.test(r3))throw new t2("Invalid RGB input.");r3.split(",").map((e4=>{n3+=kt(Number(e4.trim()))}))}else{if(!Tt.test(r3))throw new t2("Invalid rbg input.");r3.split(",").map((e4=>{let r4=Number(e4.trim());if(r4>1)throw new t2("Color rgb input must be < 1.");n3+=kt(Number((255*r4).toFixed(0)))}))}return n3.charAt(0)!=="#"&&(n3="#"+n3),n3},Ot=(e3,r3,n3)=>{let o2=`\\\\color@${e3}`;if(!St.exec(e3))throw new t2("Invalid color: '"+e3+"'",n3);return qt.test(e3)?"#"+e3:(e3.charAt(0)==="#"||(r3.has(o2)?e3=r3.get(o2).tokens[0].text:Nt[e3]&&(e3=Nt[e3])),e3)},Dt=(e3,t3)=>{let r3=me(e3.body,t3.withColor(e3.color));return r3.length===0&&r3.push(new k("mrow")),r3=r3.map((t4=>(t4.style.color=e3.color,t4))),q(r3)};f({type:"color",names:["\\textcolor"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw","original"]},handler({parser:e3,token:t3},r3,n3){let o2=n3[0]&&Be(n3[0],"raw").string,i2="";if(o2){let e4=Be(r3[0],"raw").string;i2=Lt(o2,e4)}else i2=Ot(Be(r3[0],"raw").string,e3.gullet.macros,t3);let a2=r3[1];return{type:"color",mode:e3.mode,color:i2,isTextColor:!0,body:x(a2)}},mathmlBuilder:Dt}),f({type:"color",names:["\\color"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0,argTypes:["raw","raw"]},handler({parser:e3,breakOnTokenText:t3,token:r3},n3,o2){let i2=o2[0]&&Be(o2[0],"raw").string,a2="";if(i2){let e4=Be(n3[0],"raw").string;a2=Lt(i2,e4)}else a2=Ot(Be(n3[0],"raw").string,e3.gullet.macros,r3);let s2=e3.parseExpression(!0,t3,!0);return{type:"color",mode:e3.mode,color:a2,isTextColor:!1,body:s2}},mathmlBuilder:Dt}),f({type:"color",names:["\\definecolor"],props:{numArgs:3,allowedInText:!0,argTypes:["raw","raw","raw"]},handler({parser:e3,funcName:r3,token:n3},o2){let i2=Be(o2[0],"raw").string;if(!/^[A-Za-z]+$/.test(i2))throw new t2("Color name must be latin letters.",n3);let a2=Be(o2[1],"raw").string;if(!["HTML","RGB","rgb"].includes(a2))throw new t2("Color model must be HTML, RGB, or rgb.",n3);let s2=Be(o2[2],"raw").string,l2=Lt(a2,s2);return e3.gullet.macros.set(`\\\\color@${i2}`,{tokens:[{text:l2}],numArgs:0}),{type:"internal",mode:e3.mode}}}),f({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler({parser:e3},t3,r3){let n3=e3.gullet.future().text==="["?e3.parseSizeGroup(!0):null,o2=!e3.settings.displayMode;return{type:"cr",mode:e3.mode,newLine:o2,size:n3&&Be(n3,"size").value}},mathmlBuilder(e3,t3){let r3=new k("mo");if(e3.newLine&&(r3.setAttribute("linebreak","newline"),e3.size)){let n3=qe(e3.size,t3);r3.setAttribute("height",n3.number+n3.unit)}return r3}});let Mt={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},$t=e3=>{let r3=e3.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(r3))throw new t2("Expected a control sequence",e3);return r3},Bt=(e3,t3,r3,n3)=>{let o2=e3.gullet.macros.get(r3.text);o2==null&&(r3.noexpand=!0,o2={tokens:[r3],numArgs:0,unexpandable:!e3.gullet.isExpandable(r3.text)}),e3.gullet.macros.set(t3,o2,n3)};f({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler({parser:e3,funcName:r3}){e3.consumeSpaces();let n3=e3.fetch();if(Mt[n3.text])return r3!=="\\global"&&r3!=="\\\\globallong"||(n3.text=Mt[n3.text]),Be(e3.parseFunction(),"internal");throw new t2("Invalid token after macro prefix",n3)}}),f({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler({parser:e3,funcName:r3}){let n3=e3.gullet.popToken(),o2=n3.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o2))throw new t2("Expected a control sequence",n3);let i2,a2=0,s2=[[]];for(;e3.gullet.future().text!=="{";)if(n3=e3.gullet.popToken(),n3.text==="#"){if(e3.gullet.future().text==="{"){i2=e3.gullet.future(),s2[a2].push("{");break}if(n3=e3.gullet.popToken(),!/^[1-9]$/.test(n3.text))throw new t2(`Invalid argument number "${n3.text}"`);if(pars
Try \\math${r3.slice(1)}`,n3);r3=r3.slice(1)}else r3=r3.slice(5);let i2=o2[0];return{type:"lap",mode:e3.mode,alignment:r3,body:i2}},mathmlBuilder:(e3,t3)=>{let r3;if(e3.alignment==="llap"){let n4=me(x(e3.body),t3),o3=new k("mphantom",n4);r3=new k("mpadded",[o3]),r3.setAttribute("width","0.1px")}let n3=fe(e3.body,t3),o2;if(e3.alignment==="llap"?(n3.style.position="absolute",n3.style.right="0",n3.style.bottom="0",o2=new k("mpadded",[r3,n3])):o2=new k("mpadded",[n3]),e3.alignment==="rlap")e3.body.body.length>0&&e3.body.body[0].type==="genfrac"&&o2.setAttribute("lspace","0.16667em");else{let t4=e3.alignment==="llap"?"-1":"-0.5";o2.setAttribute("lspace",t4+"width"),e3.alignment==="llap"?o2.style.position="relative":(o2.style.display="flex",o2.style.justifyContent="center")}return o2.setAttribute("width","0.1px"),o2}}),f({type:"ordgroup",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler({funcName:e3,parser:t3},r3){let n3=t3.mode;t3.switchMode("math");let o2=e3==="\\("?"\\)":"$",i2=t3.parseExpression(!1,o2);return t3.expect(o2),t3.switchMode(n3),{type:"ordgroup",mode:t3.mode,body:i2}}}),f({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e3,r3){throw new t2(`Mismatched ${e3.funcName}`,r3)}}),f({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:({parser:e3},t3)=>({type:"mathchoice",mode:e3.mode,display:x(t3[0]),text:x(t3[1]),script:x(t3[2]),scriptscript:x(t3[3])}),mathmlBuilder:(e3,t3)=>{let r3=((e4,t4)=>{switch(t4.level){case Ge:return e4.display;case Ve:return e4.text;case Xe:return e4.script;case Je:return e4.scriptscript;default:return e4.text}})(e3,t3);return pe(r3,t3)}});let rr=["text","textord","mathord","atom"];function nr(e3,t3){let r3,n3=me(e3.body,t3);if(e3.mclass==="minner")r3=new k("mpadded",n3);else if(e3.mclass==="mord")e3.isCharacterBox||n3[0].type==="mathord"?(r3=n3[0],r3.type="mi",r3.children.length===1&&r3.children[0].text&&r3.children[0].text==="\u2207"&&r3.setAttribute("mathvariant","normal")):r3=new k("mi",n3);else{r3=new k("mrow",n3),e3.mustPromote?(r3=n3[0],r3.type="mo",e3.isCharacterBox&&e3.body[0].text&&/[A-Za-z]/.test(e3.body[0].text)&&r3.setAttribute("mathvariant","italic")):r3=new k("mrow",n3);let o2=t3.level<2;r3.type==="mrow"?o2&&(e3.mclass==="mbin"?(r3.children.unshift(ke(.2222)),r3.children.push(ke(.2222))):e3.mclass==="mrel"?(r3.children.unshift(ke(.2778)),r3.children.push(ke(.2778))):e3.mclass==="mpunct"?r3.children.push(ke(.1667)):e3.mclass==="minner"&&(r3.children.unshift(ke(.0556)),r3.children.push(ke(.0556)))):e3.mclass==="mbin"?(r3.attributes.lspace=o2?"0.2222em":"0",r3.attributes.rspace=o2?"0.2222em":"0"):e3.mclass==="mrel"?(r3.attributes.lspace=o2?"0.2778em":"0",r3.attributes.rspace=o2?"0.2778em":"0"):e3.mclass==="mpunct"?(r3.attributes.lspace="0em",r3.attributes.rspace=o2?"0.1667em":"0"):e3.mclass==="mopen"||e3.mclass==="mclose"?(r3.attributes.lspace="0em",r3.attributes.rspace="0em"):e3.mclass==="minner"&&o2&&(r3.attributes.lspace="0.0556em",r3.attributes.width="+0.1111em"),e3.mclass!=="mopen"&&e3.mclass!=="mclose"&&(delete r3.attributes.stretchy,delete r3.attributes.form)}return r3}f({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler({parser:e3,funcName:t3},r3){let n3=r3[0],o2=c2(n3),i2=!0,a2={type:"mathord",text:"",mode:e3.mode},s2=n3.body?n3.body:[n3];for(let t4 of s2){if(!rr.includes(t4.type)){i2=!1;break}R[e3.mode][t4.text]?a2.text+=R[e3.mode][t4.text].replace:t4.text?a2.text+=t4.text:t4.body&&t4.body.map((e4=>{a2.text+=e4.text}))}return i2&&t3==="\\mathord"&&a2.type==="mathord"&&a2.text.length>1?a2:{type:"mclass",mode:e3.mode,mclass:"m"+t3.slice(5),body:x(i2?a2:n3),isCharacterBox:o2,mustPromote:i2}},mathmlBuilder:nr});let or=e3=>{let t3=e3.type==="ordgroup"&&e3.body.length&&e3.body.length===1?e3.body[0]:e3;return t3.type!=="atom"||t3.family!=="bin"&&t3.family!=="rel"?"mord":"m"+t3.family};f({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler:({parser:e3},t3)=>({type:"mcl
]`,Vr=`(\\\\[a-zA-Z@]+)${Gr}*`,Xr="[\u0300-\u036F]",Jr=new RegExp(`${Xr}+$`),Zr=`(${Gr}+)|\\\\(
|[ \r ]+
?)[ \r ]*|([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]${Xr}*|[\uD800-\uDBFF][\uDC00-\uDFFF]${Xr}*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|${Vr}|\\\\[^\uD800-\uDFFF])`;class Kr{constructor(e3,t3){this.input=e3,this.settings=t3,this.tokenRegex=new RegExp(Zr,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e3,t3){this.catcodes[e3]=t3}lex(){let e3=this.input,r3=this.tokenRegex.lastIndex;if(r3===e3.length)return new We("EOF",new Ue(this,r3,r3));let n3=this.tokenRegex.exec(e3);if(n3===null||n3.index!==r3)throw new t2(`Unexpected character: '${e3[r3]}'`,new We(e3[r3],new Ue(this,r3,r3+1)));let o2=n3[6]||n3[3]||(n3[2]?"\\ ":" ");if(this.catcodes[o2]===14){let r4=e3.indexOf(`
`,this.tokenRegex.lastIndex);if(r4===-1){if(this.tokenRegex.lastIndex=e3.length,this.settings.strict)throw new t2("% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode")}else this.tokenRegex.lastIndex=r4+1;return this.lex()}return new We(o2,new Ue(this,r3,this.tokenRegex.lastIndex))}}class Yr{constructor(e3={},t3={}){this.current=t3,this.builtins=e3,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new t2("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");let e3=this.undefStack.pop();for(let t3 in e3)Object.prototype.hasOwnProperty.call(e3,t3)&&(e3[t3]===void 0?delete this.current[t3]:this.current[t3]=e3[t3])}has(e3){return Object.prototype.hasOwnProperty.call(this.current,e3)||Object.prototype.hasOwnProperty.call(this.builtins,e3)}get(e3){return Object.prototype.hasOwnProperty.call(this.current,e3)?this.current[e3]:this.builtins[e3]}set(e3,t3,r3=!1){if(r3){for(let t4=0;t4<this.undefStack.length;t4++)delete this.undefStack[t4][e3];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e3]=t3)}else{let t4=this.undefStack[this.undefStack.length-1];t4&&!Object.prototype.hasOwnProperty.call(t4,e3)&&(t4[e3]=this.current[e3])}this.current[e3]=t3}}let Qr={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class en{constructor(e3,t3,r3){this.settings=t3,this.expansionCount=0,this.feed(e3),this.macros=new Yr(Ye,t3.macros),this.mode=r3,this.stack=[]}feed(e3){this.lexer=new Kr(e3,this.settings)}switchMode(e3){this.mode=e3}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e3){this.stack.push(e3)}pushTokens(e3){this.stack.push(...e3)}scanArgument(e3){let t3,r3,n3;if(e3){if(this.consumeSpaces(),this.future().text!=="[")return null;t3=this.popToken(),{tokens:n3,end:r3}=this.consumeArg(["]"])}else({tokens:n3,start:t3,end:r3}=this.consumeArg());return this.pushToken(new We("EOF",r3.loc)),this.pushTokens(n3),t3.range(r3,"")}consumeSpaces(){for(;this.future().text===" ";)this.stack.pop()}consumeArg(e3){let r3=[],n3=e3&&e3.length>0;n3||this.consumeSpaces();let o2=this.future(),i2,a2=0,s2=0;do{if(i2=this.popToken(),r3.push(i2),i2.text==="{")++a2;else if(i2.text==="}"){if(--a2,a2===-1)throw new t2("Extra }",i2)}else if(i2.text==="EOF")throw new t2("Unexpected end of input in a macro argument, expected '"+(e3&&n3?e3[s2]:"}")+"'",i2);if(e3&&n3)if((a2===0||a2===1&&e3[s2]==="{")&&i2.text===e3[s2]){if(++s2,s2===e3.length){r3.splice(-s2,s2);break}}else s2=0}while(a2!==0||n3);return o2.text==="{"&&r3[r3.length-1].text==="}"&&(r3.pop(),r3.shift()),r3.reverse(),{tokens:r3,start:o2,end:i2}}consumeArgs(e3,r3){if(r3){if(r3.length!==e3+1)throw new t2("The length of delimiters doesn't match the number of args!");let n4=r3[0];for(let e4=0;e4<n4.length;e4++){let r4=this.popToken();if(n4[e4]!==r4.text)throw new t2("Use of the macro doesn't match its definition",r4)}}let n3=[];for(let t3=0;t3<e3;t3++)n3.push(this.consumeArg(r3&&r3[t3+1]).tokens);return n3}expandOnce(e3){let r3=this.popToken(),n3=r3.text,o2=r3.noexpand?null:this._getExpansion(n3);if(o2==null||e3&&o2.unexpandable){if(e3&&o2==null&&n3[0]==="\\"&&!this.isDefined(n3))throw new t2("Undefined control sequence: "+n3);return this.pushToken(r3),!1}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new t2("Too many expansions: infinite loop or need to increase maxExpand setting");let i2=o2.tokens,a2=this.consumeArgs(o2.numArgs,o2.delimiters);if(o2.numArgs){i2=i2.slice();for(let e4=i2.length-1;e4>=0;--e4){let r4=i2[e4];if(r4.text==="#"){if(e4===0)throw new t2("Incomplete placeholder at end of macro body",r4);if(r4=i2[--e4],r4.text==="#")i2.splice(e4+1,1);else{if(!/^[1-9]$/.test(r4.text))throw new t2("Not a valid argument number",r4);i2.splice(e4,2,...a2[+r4.text-1])}}}}return this.pushTokens(i2),i2.length}expandAfterFuture(){return this.expandOnce(),
please report what input caused this bug`);return e4=e4.slice(1,-1),{type:"verb",mode:"text",body:e4,star:n4}}if(Object.prototype.hasOwnProperty.call(an,r3[0])&&this.mode==="math"&&!R[this.mode][r3[0]]){if(this.settings.strict&&this.mode==="math")throw new t2(`Accented Unicode text character "${r3[0]}" used in math mode`,e3);r3=an[r3[0]]+r3.slice(1)}let n3=this.mode==="math"?Jr.exec(r3):null,o2;if(n3&&(r3=r3.substring(0,n3.index),r3==="i"?r3="\u0131":r3==="j"&&(r3="\u0237")),R[this.mode][r3]){let t3=R[this.mode][r3].group;t3==="bin"&&sn.includes(this.prevAtomType)&&(t3="open");let n4=Ue.range(e3),i2;if(Object.prototype.hasOwnProperty.call(P,t3)){let e4=t3;i2={type:"atom",mode:this.mode,family:e4,loc:n4,text:r3},e4!=="rel"&&e4!=="bin"||this.prevAtomType!=="text"||cn.test(n4.lexer.input.slice(n4.end))&&(i2.needsSpacing=!0)}else{if(nn[r3]){this.consume();let e4=this.fetch().text.charCodeAt(0),t4=e4===65025?"mathscr":"mathcal";return e4!==65024&&e4!==65025||this.consume(),{type:"font",mode:"math",font:t4,body:{type:"mathord",mode:"math",loc:n4,text:nn[r3]}}}i2={type:t3,mode:this.mode,loc:n4,text:r3}}o2=i2}else{if(!(r3.charCodeAt(0)>=128||Jr.exec(r3)))return null;if(this.settings.strict&&this.mode==="math")throw new t2(`Unicode text character "${r3[0]}" used in math mode`,e3);o2={type:"textord",mode:"text",loc:Ue.range(e3),text:r3}}if(this.consume(),n3)for(let r4=0;r4<n3[0].length;r4++){let i2=n3[0][r4];if(!on2[i2])throw new t2(`Unknown accent ' ${i2}'`,e3);let a2=on2[i2][this.mode]||on2[i2].text;if(!a2)throw new t2(`Accent ${i2} unsupported in ${this.mode} mode`,e3);o2={type:"accent",mode:this.mode,loc:Ue.range(e3),label:a2,isStretchy:!1,base:o2}}return o2}}let dn=function(e3,r3){if(!(typeof e3=="string"||e3 instanceof String))throw new TypeError("Temml can only parse string typed expression");let n3=new un(e3,r3);delete n3.gullet.macros.current["\\df@tag"];let o2=n3.parse();if(!(o2.length>0&&o2[0].type&&o2[0].type==="array"&&o2[0].addEqnNum)&&n3.gullet.macros.get("\\df@tag")){if(!r3.displayMode)throw new t2("\\tag works only in display mode");n3.gullet.feed("\\df@tag"),o2=[{type:"tag",mode:"text",body:o2,tag:n3.parse()}]}return o2},hn=[2,2,3,3];class mn{constructor(e3){this.level=e3.level,this.color=e3.color,this.font=e3.font||"",this.fontFamily=e3.fontFamily||"",this.fontSize=e3.fontSize||1,this.fontWeight=e3.fontWeight||"",this.fontShape=e3.fontShape||"",this.maxSize=e3.maxSize}extend(e3){let t3={level:this.level,color:this.color,font:this.font,fontFamily:this.fontFamily,fontSize:this.fontSize,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize};for(let r3 in e3)Object.prototype.hasOwnProperty.call(e3,r3)&&(t3[r3]=e3[r3]);return new mn(t3)}withLevel(e3){return this.extend({level:e3})}incrementLevel(){return this.extend({level:Math.min(this.level+1,3)})}inSubOrSup(){return this.extend({level:hn[this.level]})}withColor(e3){return this.extend({color:e3})}withFont(e3){return this.extend({font:e3})}withTextFontFamily(e3){return this.extend({fontFamily:e3,font:""})}withFontSize(e3){return this.extend({fontSize:e3})}withTextFontWeight(e3){return this.extend({fontWeight:e3,font:""})}withTextFontShape(e3){return this.extend({fontShape:e3,font:""})}getColor(){return this.color}}function pn(e3){let t3={},r3=0,n3=document.getElementsByClassName("tml-eqn");for(let e4 of n3)for(r3+=1,e4.setAttribute("id","tml-eqn-"+String(r3));e4.tagName!=="mtable";){if(e4.getElementsByClassName("tml-label").length>0){let n4=e4.attributes.id.value;t3[n4]=String(r3);break}e4=e4.parentElement}let o2=document.getElementsByClassName("tml-tageqn");for(let e4 of o2)if(e4.getElementsByClassName("tml-label").length>0){let r4=e4.getElementsByClassName("tml-tag");if(r4.length>0){let n4=e4.attributes.id.value;t3[n4]=r4[0].textContent}}[...e3.getElementsByClassName("tml-ref")].forEach((e4=>{let r4=e4.getAttribute("href"),n4=t3[r4.slice(1)];e4.className.indexOf("tml-eqref")===-1?(n4=n4.replace(/^\(/,""),n4=n4.replace(/\)$/,"")):(n4.charAt(0)!=="("&&(n4="("+n4),n4.slice(-1)!==")"&&(n4+=")"));let o3=document.createElementNS("
`+e4.toString())]);return o2.style.color=n4.errorColor,o2.style.whiteSpace="pre-line",o2})(r4,e3,n3)}};var En={version:"0.13.01",render:An,renderToString:function(e3,t3){return Cn(e3,t3).toMarkup()},renderMathInElement:function(e3,t3){if(!e3)throw new Error("No element provided to render");let r3={};for(let e4 in t3)Object.prototype.hasOwnProperty.call(t3,e4)&&(r3[e4]=t3[e4]);r3.fences?r3.delimiters=(e4=>e4==="$"||e4==="("?xn[e4]:e4==="$+"||e4==="(+"?xn[e4.slice(0,1)].concat(vn):e4==="ams"?vn:e4==="all"?xn["("].concat(xn.$).concat(vn):bn)(r3.fences):r3.delimiters=r3.delimiters||bn,r3.ignoredTags=r3.ignoredTags||["script","noscript","style","textarea","pre","code","option"],r3.ignoredClasses=r3.ignoredClasses||[],r3.errorCallback=r3.errorCallback||console.error,r3.macros=r3.macros||{},wn(e3,r3),pn(e3)},postProcess:pn,ParseError:t2,definePreamble:function(e3,t3){let r3=new h2(t3);if(r3.macros={},!(typeof e3=="string"||e3 instanceof String))throw new TypeError("Temml can only parse string typed expression");let n3=new un(e3,r3,!0);return delete n3.gullet.macros.current["\\df@tag"],n3.parse()},__parse:function(e3,t3){let r3=new h2(t3);return dn(e3,r3)},__renderToMathMLTree:Cn,__defineSymbol:F,__defineMacro:Ke};e2.exports=En}},t={};function r(n2){var o=t[n2];if(o!==void 0)return o.exports;var i=t[n2]={exports:{}};return e[n2].call(i.exports,i,i.exports,r),i.exports}r.d=(e2,t2)=>{for(var n2 in t2)r.o(t2,n2)&&!r.o(e2,n2)&&Object.defineProperty(e2,n2,{enumerable:!0,get:t2[n2]})},r.o=(e2,t2)=>Object.prototype.hasOwnProperty.call(e2,t2),r.r=e2=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(e2,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e2,"__esModule",{value:!0})};var n=r(9098);return n=n.default})()))}});var require_is_retry_allowed=__commonJS({"node_modules/.pnpm/is-retry-allowed@2.2.0/node_modules/is-retry-allowed/index.js"(exports,module2){"use strict";var denyList=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);module2.exports=error51=>!denyList.has(error51&&error51.code)}});var require_constants=__commonJS({"node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/constants.js"(exports,module2){"use strict";var SEMVER_SPEC_VERSION="2.0.0",MAX_SAFE_INTEGER=Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH=16,MAX_SAFE_BUILD_LENGTH=250,RELEASE_TYPES=["major","premajor","minor","preminor","patch","prepatch","prerelease"];module2.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH,MAX_SAFE_BUILD_LENGTH,MAX_SAFE_INTEGER,RELEASE_TYPES,SEMVER_SPEC_VERSION,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}});var require_debug=__commonJS({"node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/debug.js"(exports,module2){"use strict";var debug=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...args)=>console.error("SEMVER",...args):()=>{};module2.exports=debug}});var require_re=__commonJS({"node_modules/.pnpm/semver@7.8.1/node_modules/semver/internal/re.js"(exports,module2){"use strict";var{MAX_SAFE_COMPONENT_LENGTH,MAX_SAFE_BUILD_LENGTH,MAX_LENGTH}=require_constants(),debug=require_debug();exports=module2.exports={};var re=exports.re=[],safeRe=exports.safeRe=[],src=exports.src=[],safeSrc=exports.safeSrc=[],t=exports.t={},R=0,LETTERDASHNUMBER="[a-zA-Z0-9-]",safeRegexReplacements=[["\\s",1],["\\d",MAX_LENGTH],[LETTERDASHNUMBER,MAX_SAFE_BUILD_LENGTH]]
{% if tags|length %}tags: {%for tag in tags %}
- {{tag}}{% endfor %}{% endif %}
`;var templateInstructions_default=`<p>
Template (<a href="https://mozilla.github.io/nunjucks/">Nunjucks</a>) for rendering every synced
Raindrop.io highlights & annotations.
</p>
<p>
<b>Available variables to use</b>
</p>
<p>Metadata</p>
<ul>
<li><span class="u-pop">{{now}}</span> (Moment) - Present time</li>
</ul>
<p>Article Metadata</p>
<ul>
<li><span class="u-pop">{{is_new_article}}</span> (bool) - New file indicator</li>
<li><span class="u-pop">{{id}}</span> (number) - Article identifier</li>
<li><span class="u-pop">{{title}}</span> (string) - Title</li>
<li><span class="u-pop">{{excerpt}}</span> (string) - Article excerpt</li>
<li><span class="u-pop">{{note}}</span> (string) - Article note</li>
<li><span class="u-pop">{{link}}</span> (string) - Link to source</li>
<li>
<span class="u-pop">{{highlights}}</span> (Highlight[]) - List of your Highlights (Detail
attributes refer to the following <span class="u-pop">Highlight</span> section)
</li>
<li>
<span class="u-pop">{{collection}}</span> (Collection) - Collection data (Detail attributes
refer to the following <span class="u-pop">Collection</span> section
</li>
<li>
<span class="u-pop">{{creator}}</span> (Creator) - Creator data (Detail attributes refer to
the following <span class="u-pop">Creator</span> section
</li>
<li><span class="u-pop">{{tags}}</span> (string[]) - List of tag</li>
<li><span class="u-pop">{{cover}}</span> (string) - Article cover</li>
<li><span class="u-pop">{{created}}</span> (Moment) - Created on</li>
<li><span class="u-pop">{{type}}</span> (string) - Article type</li>
<li><span class="u-pop">{{important}}</span> (bool) - Favorite article</li>
<li><span class="u-pop">{{raindropUrl}}</span> (string) - Link to raindrop page</li>
</ul>
<p>Creator</p>
<ul>
<li><span class="u-pop">{{name}}</span> (string) - Creator name</li>
<li><span class="u-pop">{{id}}</span> (number) - Creator id</li>
</ul>
<p>Collection</p>
<ul>
<li><span class="u-pop">{{title}}</span> (string) - Collection title</li>
</ul>
<p>Highlight</p>
<ul>
<li><span class="u-pop">{{id}}</span> (string) - Highlight identifier</li>
<li><span class="u-pop">{{text}}</span> (string) - Text</li>
<li><span class="u-pop">{{color}}</span> (string) - Highlight color</li>
<li><span class="u-pop">{{created}}</span> (Moment) - Created on</li>
<li><span class="u-pop">{{lastUpdate}}</span> (Moment) - Updated on</li>
<li><span class="u-pop">{{note}}</span> (string) - Annotation</li>
</ul>
<p>Filter</p>
<ul>
<li>
<span class="u-pop">date(format: string)</span> Convert Moment object to string - example:
<code>{{ now | date("YYYY/MM/DD") }}</code>. For more syntax, refer to
<a href="https://momentjs.com/docs/#/displaying/format/">format reference</a>.
</li>
<li>
<span class="u-pop">defuddle</span> Fetch a link and convert to markdown using Defuddle -
example: <code>{{ link | defuddle }}</code>. Useful for archiving the full content of the
link.
</li>
<li>
<span class="u-pop">download_attachment(filename?: string)</span> Download a URL to the
Obsidian attachment folder and return the local path. Filename is optional \u2014 defaults to
<code>{{title}}</code>.
<br />
<b>Examples:</b><br />
<code>{{ cover | download_attachment }}</code> <br />
<code>{{ cover | download_attachment(title ~ " - cover") }}</code>.
<br />
<b>Fallback rules:</b> On failure, the original URL is returned, so the template can handle
error handling gracefully (e.g. choose between two different formats:
<code>![](Remote URL)</code> or <code>![[Local Path]]</code>).
<br />
<b>Collision rules:</b> When the target path already exists, the file content is compared \u2014
if identical, no re-download. If different, suffixes <code>(1)</code>, <code>(2)</code>,
etc. are tried until a matching or empty slot is found.
</li>
</ul>
`;var metadataTemplateInstructions_default=`<p>
Metadata template (<a href="https://mozilla.github.io/nunjucks/">Nunjucks</a>) for rendering
every synced Raindrop.io highlights & annotations.
</p>
<p>Some notes:</p>
<ul>
<li>The rendered result is placed in the front matter of the generated post.</li>
<li>
If the rendered result does not follow the YAML syntax, the plugin will reject the update.
</li>
<li>
<code>raindrop_id</code> and <code>raindrop_highlights</code> properties are transparently
added and updated by the plugin.
</li>
<li>Available variables to use are the same as the previous template.</li>
</ul>
`;var filenameTemplateInstructions_default=`<p>
Filename template (<a href="https://mozilla.github.io/nunjucks/">Nunjucks</a>) for creating
synced Raindrop.io highlights & annotations.
</p>
<p>Some notes:</p>
<ul>
<li>The rendered result is used as the filename for the bookmark.</li>
<li>The rendered result is sanitized and truncated to 255 bytes.</li>
<li>The plugin will reject the invalid template.</li>
<li>
If the file already exists in the vault, the auto generated suffix will be appended to the
rendered result and used as the filename.
</li>
<li>Available variables to use are the same as the previous template.</li>
</ul>
`;var collectionGroupsInstructions_default=`Add collection group name to the hierarchy of collections. See
<a href="https://help.raindrop.io/collections/#groups"
>https://help.raindrop.io/collections/#groups</a
>
for more details about collection groups.
`;var appendModeInstructions_default=`<div>
<span class="u-pop">Dangerous Option!</span>
</div>
<ul>
<li>
On: The new highlights will be appended to the end of the existing file, but the old
metadata can not be updated in place.
</li>
<li>
Off: The synced files will always be kept in the latest states of the Raindrop articles, but
this will lose the flexiblity to add/modify the synced files. (i.e. the old file content
will be overwritten!)
</li>
</ul>
`;var autoescapingInstructions_default=`If this option is turned on, Nunjucks will
<a href="https://mozilla.github.io/nunjucks/templating.html#autoescaping">autoescape</a> all output
during the template rendering process. To manually mark output as safe, use the
<code>safe</code> filter (example: <code>{{ note | safe }}</code>). It's recommended to turn this
option on for security reasons.
`;var import_obsidian=require("obsidian"),CollectionsModal=class extends import_obsidian.Modal{constructor(app,plugin){super(app),this.plugin=plugin,this.titleEl.innerText="Raindrop.io: Manage collections to be synced",this.rerender(),this.open()}rerender(){this.contentEl.empty();let rootDiv=this.contentEl.createDiv(),autoSyncAllColDiv=rootDiv.createDiv({cls:"collection-entry"}),autoSyncAllColBtn=autoSyncAllColDiv.createEl("input",{type:"checkbox"});if(autoSyncAllColBtn.checked=this.plugin.settings.enableAutoSyncAllCollections,autoSyncAllColBtn.onclick=async()=>{await this.plugin.settings.toggleSyncAllCollections(),this.rerender()},autoSyncAllColDiv.createEl("span",{text:"Auto sync all collections"}),!this.plugin.settings.enableAutoSyncAllCollections){let autoSyncNestedColDiv=rootDiv.createDiv({cls:"collection-entry"}),autoSyncNestedColInput=autoSyncNestedColDiv.createEl("input",{type:"checkbox"});autoSyncNestedColInput.checked=this.plugin.settings.enableAutoSyncNewNestedCollections,autoSyncNestedColInput.onclick=async()=>{await this.plugin.settings.toggleAutoSyncNestedCollections(),this.rerender()},autoSyncNestedColDiv.createEl("span",{text:"Auto sync new nested collections"})}let divider=rootDiv.createEl("hr");divider.style.marginTop="8px",divider.style.marginBottom="8px";let{sysCollections,userCollections}=this.plugin.settings.syncCollectionsSeparated,renderCollection=(collections,isSysCol)=>{var _a9;let table=rootDiv.createEl("table");for(let[id,collection]of collections){let row=table.createEl("tr"),entryDiv=row.createEl("td").createDiv({cls:"collection-entry"}),checkbox=entryDiv.createEl("input",{type:"checkbox"});isSysCol||(checkbox.disabled=this.plugin.settings.enableAutoSyncAllCollections),checkbox.checked=collection.sync,checkbox.onclick=async()=>{await this.plugin.settings.toggleCollectionSync(id),this.rerender()},entryDiv.createEl("span",{text:collection.title});let searchInput=row.createEl("td").createEl("input");searchInput.placeholder="Search",searchInput.value=(_a9=collection.search)!=null?_a9:"",searchInput.onchange=async event3=>{let value=event3.target.value;await this.plugin.settings.setCollectionSearch(id,value),this.rerender()}}},sysNoticeP=rootDiv.createEl("div",{cls:"collection-notice"}).createEl("span");sysNoticeP.innerHTML="NOTICE: Each bookmark belongs to its original collection and a special system collection called <b>All Bookmarks</b>. Syncing both can cause conflicts \u2014 the bookmark's state will follow the most recently synced collection.";let searchNoticeP=rootDiv.createEl("div",{cls:"collection-notice"}).createEl("span");searchNoticeP.innerHTML="NOTICE: Search syntax follows the <a href='https://help.raindrop.io/using-search#operators'>Raindrop.io documents</a>.",renderCollection(sysCollections,!0);let divider2=rootDiv.createEl("hr");divider2.style.marginTop="8px",divider2.style.marginBottom="8px",renderCollection(userCollections,!1)}onClose(){super.onClose()}};var import_nunjucks=__toESM(require_nunjucks()),import_moment=__toESM(require_moment()),import_sanitize_filename=__toESM(require_sanitize_filename()),import_obsidian3=require("obsidian");var import_obsidian2=require("obsidian");var types={"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"],"
${fakeContent}`;(0,import_obsidian3.parseYaml)(fakeMetadata)}return!0}catch(e){return!1}}async renderContent(bookmark,newArticle){return this.renderTemplate(this.plugin.settings.contentTemplate,bookmark,newArticle)}async renderFrontmatter(bookmark,newArticle){let newMdFrontmatter=await this.renderTemplate(this.plugin.settings.metadataTemplate,bookmark,newArticle),frontmatterObj={raindrop_id:bookmark.id};return bookmark.highlights.length>0&&(frontmatterObj.raindrop_highlights=Object.fromEntries(bookmark.highlights.map(hl=>[hl.id,hl.signature]))),newMdFrontmatter.length>0?`${(0,import_obsidian3.stringifyYaml)(frontmatterObj)}${newMdFrontmatter}`:(0,import_obsidian3.stringifyYaml)(frontmatterObj)}async renderFullArticle(bookmark){let newMdContent=await this.renderContent(bookmark,!0);return`---
${await this.renderFrontmatter(bookmark,!0)}
---
${newMdContent}`}async renderFileName(bookmark,newArticle){let filename=await this.renderTemplate(this.plugin.settings.filenameTemplate,bookmark,newArticle);return this.sanitizeFilename(filename)}sanitizeFilename(filename){return(0,import_sanitize_filename.default)(filename.replace(/[':#|]/g,"").trim())}renderTemplate(template,bookmark,newArticle){var _a9,_b3;let renderHighlights=bookmark.highlights.map(hl=>({id:hl.id,color:hl.color,created:(0,import_moment.default)(hl.created),lastUpdate:(0,import_moment.default)(hl.lastUpdate),note:hl.note,text:hl.text})),renderCollection={title:(_b3=(_a9=this.plugin.settings.syncCollections[bookmark.collectionId])==null?void 0:_a9.title)!=null?_b3:""},context={is_new_article:newArticle,id:bookmark.id,title:bookmark.title,excerpt:bookmark.excerpt,note:bookmark.note,link:bookmark.link,highlights:renderHighlights,collection:renderCollection,tags:bookmark.tags,cover:bookmark.cover,created:(0,import_moment.default)(bookmark.created),type:bookmark.type,important:bookmark.important,creator:bookmark.creator,now:(0,import_moment.default)(),raindropUrl:`https://app.raindrop.io/my/${bookmark.collectionId}/item/${bookmark.id}/edit`},env=this.createEnv(context);return this.renderStringAsync(env,template,context)}renderStringAsync(env,template,context){return new Promise((resolve,reject)=>{env.renderString(template,context,(err,content)=>{err?reject(err):resolve(content!=null?content:"")})})}createEnv(renderContext,isValidate=!1){let env=new import_nunjucks.default.Environment(void 0,{autoescape:this.plugin.settings.enableAutoEscape});return env.addFilter("date",(date5,format)=>date5.format(format)),env.addFilter("defuddle",(link,callback)=>{if(!link||isValidate){callback(null,"");return}(0,import_obsidian3.requestUrl)({url:link}).then(response=>{var _a9;let dom=new DOMParser().parseFromString(response.text,"text/html"),result=new import_full.default(dom,{url:link,markdown:!0}).parse();callback(null,(_a9=result.contentMarkdown)!=null?_a9:result.content)}).catch(err=>{console.error(`Defuddle error for link ${link}:`,err),callback(null,`*Defuddle error: ${err.message}*`)})},!0),env.addFilter("download_attachment",(url2,...args)=>{var _a9;let callback=args[args.length-1],templateFilename=args.length>1?String((_a9=args[0])!=null?_a9:""):void 0,urlStr=url2?String(url2):"";if(!urlStr||isValidate){callback(null,"");return}let defaultFilename=renderContext?`${renderContext.title}`:"attachment",filename=templateFilename!=null?templateFilename:defaultFilename;this.attDownloader.download(urlStr,filename).then(result=>callback(null,result)).catch(err=>{console.error(`download_attachment: failed for ${urlStr}`,err),callback(null,urlStr)})},!0),env}};var import_obsidian4=require("obsidian");var _a,_b,_c;typeof window!="undefined"&&((_c=(_b=(_a=window.__svelte)!=null?_a:window.__svelte={}).v)!=null?_c:_b.v=new Set).add("5");var async_mode_flag=!1,legacy_mode_flag=!1,tracing_mode_flag=!1;function enable_legacy_mode_flag(){legacy_mode_flag=!0}enable_legacy_mode_flag();var HYDRATION_ERROR={};var UNINITIALIZED=Symbol("uninitialized"),FILENAME=Symbol("filename"),HMR=Symbol("hmr"),NAMESPACE_HTML="http://www.w3.org/1999/xhtml";var _a2,_b2,node_env=(_b2=(_a2=globalThis.process)==null?void 0:_a2.env)==null?void 0:_b2.NODE_ENV,dev_fallback_default=node_env&&!node_env.toLowerCase().startsWith("prod");var is_array=Array.isArray,index_of=Array.prototype.indexOf,includes=Array.prototype.includes,array_from=Array.from,object_keys=Object.keys,define_property=Object.defineProperty,get_descriptor=Object.getOwnPropertyDescriptor,get_descriptors=Object.getOwnPropertyDescriptors,object_prototype=Object.prototype,array_prototype=Array.prototype,get_prototype_of=Object.getPrototypeOf,is_extensible=Object.isExtensible;var noop=()=>{};function run(fn){return fn()}function run_all(arr){for(var i=0;i<arr.length;i++)arr[i]()}function deferred(){var resolve,reject,promise2=new Promise((res,rej)=>{resolve=res,reject=rej});return{promise:promise2,resolve,reject}}var STATE_SYMBOL=Symbol("$state"),LEGACY_PROPS=Symbol("legacy props"),LOADING_ATT
An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${message}"
https://svelte.dev/e/invariant_violation`);throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/invariant_violation")}function derived_references_self(){if(dev_fallback_default){let error51=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/derived_references_self")}function effect_in_teardown(rune){if(dev_fallback_default){let error51=new Error(`effect_in_teardown
\`${rune}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function effect_in_unowned_derived(){if(dev_fallback_default){let error51=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function effect_orphan(rune){if(dev_fallback_default){let error51=new Error(`effect_orphan
\`${rune}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/effect_orphan`);throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/effect_orphan")}function effect_update_depth_exceeded(){if(dev_fallback_default){let error51=new Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
https://svelte.dev/e/effect_update_depth_exceeded`);throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function hydration_failed(){if(dev_fallback_default){let error51=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/hydration_failed")}function props_invalid_value(key2){if(dev_fallback_default){let error51=new Error(`props_invalid_value
Cannot do \`bind:${key2}={undefined}\` when \`${key2}\` has a fallback value
https://svelte.dev/e/props_invalid_value`);throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/props_invalid_value")}function rune_outside_svelte(rune){if(dev_fallback_default){let error51=new Error(`rune_outside_svelte
The \`${rune}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function state_descriptors_fixed(){if(dev_fallback_default){let error51=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function state_prototype_fixed(){if(dev_fallback_default){let error51=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function state_unsafe_mutation(){if(dev_fallback_default){let error51=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function svelte_boundary_reset_onerror(){if(dev_fallback_default){let error51=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw error51.name="Svelte error",error51}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var bold="font-weight: bold",normal="font-weight: normal";function await_reactivity_loss(name){dev_fallback_default?console.warn(`%c[svelte] await_reactivity_loss
%cDetected reactivity loss when reading \`${name}\`. This happens when state is read in an async function after an earlier \`await\`
https://svelte.dev/e/await_reactivity_loss`,bold,normal):console.warn("https://svelte.dev/e/await_reactivity_loss")}function derived_inert(){dev_fallback_default?console.warn(`%c[svelte] derived_inert
%cReading a derived belonging to a now-destroyed effect may result in stale values
https://svelte.dev/e/derived_inert`,bold,normal):console.warn("https://svelte.dev/e/derived_inert")}function hydration_mismatch(location){dev_fallback_default?console.warn(`%c[svelte] hydration_mismatch
%c${location?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/hydration_mismatch`,bold,normal):console.warn("https://svelte.dev/e/hydration_mismatch")}function lifecycle_double_unmount(){dev_fallback_default?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,bold,normal):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function state_proxy_equality_mismatch(operator){dev_fallback_default?console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${operator}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,bold,normal):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function state_proxy_unmount(){dev_fallback_default?console.warn(`%c[svelte] state_proxy_unmount
%cTried to unmount a state proxy, rather than a component
https://svelte.dev/e/state_proxy_unmount`,bold,normal):console.warn("https://svelte.dev/e/state_proxy_unmount")}function svelte_boundary_reset_noop(){dev_fallback_default?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",bold,normal):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var hydrating=!1;function set_hydrating(value){hydrating=value}var hydrate_node;function set_hydrate_node(node){if(node===null)throw hydration_mismatch(),HYDRATION_ERROR;return hydrate_node=node}function hydrate_next(){return set_hydrate_node(get_next_sibling(hydrate_node))}function reset(node){if(hydrating){if(get_next_sibling(hydrate_node)!==null)throw hydration_mismatch(),HYDRATION_ERROR;hydrate_node=node}}function next(count=1){if(hydrating){for(var i=count,node=hydrate_node;i--;)node=get_next_sibling(node);hydrate_node=node}}function skip_nodes(remove=!0){for(var depth=0,node=hydrate_node;;){if(node.nodeType===COMMENT_NODE){var data=node.data;if(data==="]"){if(depth===0)return node;depth-=1}else(data==="["||data==="[!"||data[0]==="["&&!isNaN(Number(data.slice(1))))&&(depth+=1)}var next2=get_next_sibling(node);remove&&node.remove(),node=next2}}function equals(value){return value===this.v}function safe_not_equal(a,b){return a!=a?b==b:a!==b||a!==null&&typeof a=="object"||typeof a=="function"}function safe_equals(value){return!safe_not_equal(value,this.v)}var tracing_expressions=null;function tag(source2,label){return source2.label=label,tag_proxy(source2.v,label),source2}function tag_proxy(value,label){var _a9;return(_a9=value==null?void 0:value[PROXY_PATH_SYMBOL])==null||_a9.call(value,label),value}function get_error(label){let error51=new Error,stack2=get_stack();return stack2.length===0?null:(stack2.unshift(`
`),define_property(error51,"stack",{value:stack2.join(`
`)}),define_property(error51,"name",{value:label}),error51)}function get_stack(){let limit=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let stack2=new Error().stack;if(Error.stackTraceLimit=limit,!stack2)return[];let lines=stack2.split(`
`),new_lines=[];for(let i=0;i<lines.length;i++){let line=lines[i],posixified=line.replaceAll("\\","/");if(line.trim()!=="Error"){if(line.includes("validate_each_keys"))return[];posixified.includes("svelte/src/internal")||posixified.includes("node_modules/.vite")||new_lines.push(line)}}return new_lines}function invariant(condition,message){if(!dev_fallback_default)throw new Error("invariant(...) was not guarded by if (DEV)");condition||invariant_violation(message)}var component_context=null;function set_component_context(context){component_context=context}var dev_stack=null;function set_dev_stack(stack2){dev_stack=stack2}var dev_current_component_function=null;function set_dev_current_component_function(fn){dev_current_component_function=fn}function push(props,runes=!1,fn){component_context={p:component_context,i:!1,c:null,e:null,s:props,x:null,r:active_effect,l:legacy_mode_flag&&!runes?{s:null,u:null,$:[]}:null},dev_fallback_default&&(component_context.function=fn,dev_current_component_function=fn)}function pop(component2){var _a9;var context=component_context,effects=context.e;if(effects!==null){context.e=null;for(var fn of effects)create_user_effect(fn)}return component2!==void 0&&(context.x=component2),context.i=!0,component_context=context.p,dev_fallback_default&&(dev_current_component_function=(_a9=component_context==null?void 0:component_context.function)!=null?_a9:null),component2!=null?component2:{}}function is_runes(){return!legacy_mode_flag||component_context!==null&&component_context.l===null}var micro_tasks=[];function run_micro_tasks(){var tasks=micro_tasks;micro_tasks=[],run_all(tasks)}function queue_micro_task(fn){if(micro_tasks.length===0&&!is_flushing_sync){var tasks=micro_tasks;queueMicrotask(()=>{tasks===micro_tasks&&run_micro_tasks()})}micro_tasks.push(fn)}function flush_tasks(){for(;micro_tasks.length>0;)run_micro_tasks()}var adjustments=new WeakMap;function handle_error(error51){var effect3=active_effect;if(effect3===null)return active_reaction.f|=8388608,error51;if(dev_fallback_default&&error51 instanceof Error&&!adjustments.has(error51)&&adjustments.set(error51,get_adjustments(error51,effect3)),(effect3.f&32768)===0&&(effect3.f&4)===0)throw dev_fallback_default&&!effect3.parent&&error51 instanceof Error&&apply_adjustments(error51),error51;invoke_error_boundary(error51,effect3)}function invoke_error_boundary(error51,effect3){for(;effect3!==null;){if((effect3.f&128)!==0){if((effect3.f&32768)===0)throw error51;try{effect3.b.error(error51);return}catch(e){error51=e}}effect3=effect3.parent}throw dev_fallback_default&&error51 instanceof Error&&apply_adjustments(error51),error51}function get_adjustments(error51,effect3){var _a9,_b3,_c2;let message_descriptor=get_descriptor(error51,"message");if(!(message_descriptor&&!message_descriptor.configurable)){for(var indent=is_firefox?" ":" ",component_stack=`
${indent}in ${((_a9=effect3.fn)==null?void 0:_a9.name)||"<unknown>"}`,context=effect3.ctx;context!==null;)component_stack+=`
${indent}in ${(_b3=context.function)==null?void 0:_b3[FILENAME].split("/").pop()}`,context=context.p;return{message:error51.message+`
${component_stack}
`,stack:(_c2=error51.stack)==null?void 0:_c2.split(`
`).filter(line=>!line.includes("svelte/src/internal")).join(`
`)}}}function apply_adjustments(error51){let adjusted=adjustments.get(error51);adjusted&&(define_property(error51,"message",{value:adjusted.message}),define_property(error51,"stack",{value:adjusted.stack}))}var STATUS_MASK=-7169;function set_signal_status(signal,status){signal.f=signal.f&STATUS_MASK|status}function update_derived_status(derived2){(derived2.f&512)!==0||derived2.deps===null?set_signal_status(derived2,1024):set_signal_status(derived2,4096)}function clear_marked(deps){if(deps!==null)for(let dep of deps)(dep.f&2)===0||(dep.f&65536)===0||(dep.f^=65536,clear_marked(dep.deps))}function defer_effect(effect3,dirty_effects,maybe_dirty_effects){(effect3.f&2048)!==0?dirty_effects.add(effect3):(effect3.f&4096)!==0&&maybe_dirty_effects.add(effect3),clear_marked(effect3.deps),set_signal_status(effect3,1024)}var legacy_is_updating_store=!1,is_store_binding=!1,IS_UNMOUNTED=Symbol("unmounted");function capture_store_binding(fn){var previous_is_store_binding=is_store_binding;try{return is_store_binding=!1,[fn(),is_store_binding]}finally{is_store_binding=previous_is_store_binding}}var first_batch=null,last_batch=null,current_batch=null,previous_batch=null,batch_values=null,last_scheduled_effect=null,is_flushing_sync=!1,is_processing=!1,collected_effects=null,legacy_updates=null,flush_count=0,source_stacks=new Set,uid=1,_started,_prev,_next,_commit_callbacks,_discard_callbacks,_fork_commit_callbacks,_pending,_blocking_pending,_deferred,_roots,_new_effects,_dirty_effects,_maybe_dirty_effects,_skipped_branches,_unskipped_branches,_decrement_queued,_Batch_instances,is_deferred_fn,process_fn,traverse_fn,find_earlier_batch_fn,merge_fn,defer_effects_fn,commit_fn,link_fn,unlink_fn,_Batch=class _Batch{constructor(){__privateAdd(this,_Batch_instances);__publicField(this,"id",uid++);__privateAdd(this,_started,!1);__publicField(this,"linked",!0);__privateAdd(this,_prev,null);__privateAdd(this,_next,null);__publicField(this,"async_deriveds",new Map);__publicField(this,"current",new Map);__publicField(this,"previous",new Map);__publicField(this,"unblocked",new Set);__privateAdd(this,_commit_callbacks,new Set);__privateAdd(this,_discard_callbacks,new Set);__privateAdd(this,_fork_commit_callbacks,new Set);__privateAdd(this,_pending,0);__privateAdd(this,_blocking_pending,new Map);__privateAdd(this,_deferred,null);__privateAdd(this,_roots,[]);__privateAdd(this,_new_effects,[]);__privateAdd(this,_dirty_effects,new Set);__privateAdd(this,_maybe_dirty_effects,new Set);__privateAdd(this,_skipped_branches,new Map);__privateAdd(this,_unskipped_branches,new Set);__publicField(this,"is_fork",!1);__privateAdd(this,_decrement_queued,!1)}skip_effect(effect3){__privateGet(this,_skipped_branches).has(effect3)||__privateGet(this,_skipped_branches).set(effect3,{d:[],m:[]}),__privateGet(this,_unskipped_branches).delete(effect3)}unskip_effect(effect3,callback=e=>this.schedule(e)){var tracked=__privateGet(this,_skipped_branches).get(effect3);if(tracked){__privateGet(this,_skipped_branches).delete(effect3);for(var e of tracked.d)set_signal_status(e,2048),callback(e);for(e of tracked.m)set_signal_status(e,4096),callback(e)}__privateGet(this,_unskipped_branches).add(effect3)}capture(source2,value,is_derived=!1){source2.v!==UNINITIALIZED&&!this.previous.has(source2)&&this.previous.set(source2,source2.v),(source2.f&8388608)===0&&(this.current.set(source2,[value,is_derived]),batch_values==null||batch_values.set(source2,value)),this.is_fork||(source2.v=value)}activate(){current_batch=this}deactivate(){current_batch=null,batch_values=null}flush(){try{dev_fallback_default&&source_stacks.clear(),is_processing=!0,current_batch=this,__privateMethod(this,_Batch_instances,process_fn).call(this)}finally{if(flush_count=0,last_scheduled_effect=null,collected_effects=null,legacy_updates=null,is_processing=!1,current_batch=null,batch_values=null,old_values.clear(),dev_fallback_default)for(let source2 of source_stacks)source2.updated=null}}discard(){for(let fn of __privateGet(this,_discard_callbacks))fn(this);__privateGet(this,_discard_callbacks).clear(),__privateGet(this,_fork_
`).some(line=>line.startsWith("https://svelte.dev/e/")))throw error51;return error51!==HYDRATION_ERROR&&console.warn("Failed to hydrate: ",error51),options.recover===!1&&hydration_failed(),init_operations(),clear_text_content(target),set_hydrating(!1),mount(component2,options)}finally{set_hydrating(was_hydrating),set_hydrate_node(previous_hydrate_node)}}var listeners=new Map;function _mount(Component,{target,anchor,props={},events,context,intro=!0,transformError}){init_operations();var component2=void 0,unmount2=component_root(()=>{var anchor_node=anchor!=null?anchor:target.appendChild(create_text());boundary(anchor_node,{pending:()=>{}},anchor_node2=>{push({});var ctx=component_context;if(context&&(ctx.c=context),events&&(props.$$events=events),hydrating&&assign_nodes(anchor_node2,null),should_intro=intro,component2=Component(anchor_node2,props)||{},should_intro=!0,hydrating&&(active_effect.nodes.end=hydrate_node,hydrate_node===null||hydrate_node.nodeType!==COMMENT_NODE||hydrate_node.data!=="]"))throw hydration_mismatch(),HYDRATION_ERROR;pop()},transformError);var registered_events=new Set,event_handle=events2=>{for(var i=0;i<events2.length;i++){var event_name=events2[i];if(!registered_events.has(event_name)){registered_events.add(event_name);var passive2=is_passive_event(event_name);for(let node of[target,document]){var counts=listeners.get(node);counts===void 0&&(counts=new Map,listeners.set(node,counts));var count=counts.get(event_name);count===void 0?(node.addEventListener(event_name,handle_event_propagation,{passive:passive2}),counts.set(event_name,1)):counts.set(event_name,count+1)}}}};return event_handle(array_from(all_registered_events)),root_event_handles.add(event_handle),()=>{var _a9;for(var event_name of registered_events)for(let node of[target,document]){var counts=listeners.get(node),count=counts.get(event_name);--count==0?(node.removeEventListener(event_name,handle_event_propagation),counts.delete(event_name),counts.size===0&&listeners.delete(node)):counts.set(event_name,count)}root_event_handles.delete(event_handle),anchor_node!==anchor&&((_a9=anchor_node.parentNode)==null||_a9.removeChild(anchor_node))}});return mounted_components.set(component2,unmount2),component2}var mounted_components=new WeakMap;function unmount(component2,options){let fn=mounted_components.get(component2);return fn?(mounted_components.delete(component2),fn(options)):(dev_fallback_default&&(STATE_SYMBOL in component2?state_proxy_unmount():lifecycle_double_unmount()),Promise.resolve())}if(dev_fallback_default){let throw_rune_error=function(rune){if(!(rune in globalThis)){let value;Object.defineProperty(globalThis,rune,{configurable:!0,get:()=>{if(value!==void 0)return value;rune_outside_svelte(rune)},set:v=>{value=v}})}};throw_rune_error("$state"),throw_rune_error("$effect"),throw_rune_error("$derived"),throw_rune_error("$inspect"),throw_rune_error("$props"),throw_rune_error("$bindable")}var NAN=Symbol("NaN");var whitespace=[...`
\r\f\xA0\v\uFEFF`];var CLASS=Symbol("class"),STYLE=Symbol("style"),IS_CUSTOM_ELEMENT=Symbol("is custom element"),IS_HTML=Symbol("is html");function is_bound_this(bound_value,element_or_component){return bound_value===element_or_component||(bound_value==null?void 0:bound_value[STATE_SYMBOL])===element_or_component}function bind_this(element_or_component={},update2,get_value,get_parts){var component_effect=component_context.r,parent=active_effect;return effect(()=>{var old_parts,parts;return render_effect(()=>{old_parts=parts,parts=(get_parts==null?void 0:get_parts())||[],untrack(()=>{is_bound_this(get_value(...parts),element_or_component)||(update2(element_or_component,...parts),old_parts&&is_bound_this(get_value(...old_parts),element_or_component)&&update2(null,...old_parts))})}),()=>{let p=parent;for(;p!==component_effect&&p.parent!==null&&p.parent.f&33554432;)p=p.parent;let teardown2=()=>{parts&&is_bound_this(get_value(...parts),element_or_component)&&update2(null,...parts)},original_teardown=p.teardown;p.teardown=()=>{teardown2(),original_teardown==null||original_teardown()}}}),element_or_component}function init(immutable=!1){let context=component_context,callbacks=context.l.u;if(!callbacks)return;let props=()=>deep_read_state(context.s);if(immutable){let version2=0,prev={},d=derived(()=>{let changed=!1,props2=context.s;for(let key2 in props2)props2[key2]!==prev[key2]&&(prev[key2]=props2[key2],changed=!0);return changed&&version2++,version2});props=()=>get2(d)}callbacks.b.length&&user_pre_effect(()=>{observe_all(context,props),run_all(callbacks.b)}),user_effect(()=>{let fns=untrack(()=>callbacks.m.map(run));return()=>{for(let fn of fns)typeof fn=="function"&&fn()}}),callbacks.a.length&&user_effect(()=>{observe_all(context,props),run_all(callbacks.a)})}function observe_all(context,props){if(context.l.s)for(let signal of context.l.s)get2(signal);props()}function prop(props,key2,flags2,fallback2){var _a9,_b3;var runes=!legacy_mode_flag||(flags2&2)!==0,bindable=(flags2&8)!==0,lazy2=(flags2&16)!==0,fallback_value=fallback2,fallback_dirty=!0,fallback_signal=void 0,get_fallback=()=>lazy2&&runes?(fallback_signal!=null||(fallback_signal=derived(fallback2)),get2(fallback_signal)):(fallback_dirty&&(fallback_dirty=!1,fallback_value=lazy2?untrack(fallback2):fallback2),fallback_value);let setter;if(bindable){var is_entry_props=STATE_SYMBOL in props||LEGACY_PROPS in props;setter=(_b3=(_a9=get_descriptor(props,key2))==null?void 0:_a9.set)!=null?_b3:is_entry_props&&key2 in props?v=>props[key2]=v:void 0}var initial_value,is_store_sub=!1;bindable?[initial_value,is_store_sub]=capture_store_binding(()=>props[key2]):initial_value=props[key2],initial_value===void 0&&fallback2!==void 0&&(initial_value=get_fallback(),setter&&(runes&&props_invalid_value(key2),setter(initial_value)));var getter;if(runes?getter=()=>{var value=props[key2];return value===void 0?get_fallback():(fallback_dirty=!0,value)}:getter=()=>{var value=props[key2];return value!==void 0&&(fallback_value=void 0),value===void 0?fallback_value:value},runes&&(flags2&4)===0)return getter;if(setter){var legacy_parent=props.$$legacy;return(function(value,mutation){return arguments.length>0?((!runes||!mutation||legacy_parent||is_store_sub)&&setter(mutation?getter():value),value):getter()})}var overridden=!1,d=((flags2&1)!==0?derived:derived_safe_equal)(()=>(overridden=!1,getter()));dev_fallback_default&&(d.label=key2),bindable&&get2(d);var parent_effect=active_effect;return(function(value,mutation){if(arguments.length>0){let new_value=mutation?get2(d):runes&&bindable?proxy(value):value;return set(d,new_value),overridden=!0,fallback_value!==void 0&&(fallback_value=new_value),value}return is_destroying_effect&&overridden||(parent_effect.f&16384)!==0?d.v:get2(d)})}function createClassComponent(options){return new Svelte4Component(options)}var _events,_instance,Svelte4Component=class{constructor(options){__privateAdd(this,_events);__privateAdd(this,_instance);var _a9,_b3;var sources=new Map,add_source=(key2,value)=>{var s=mutable_source(value,!1,!1);return sources.set(key2,s),s};let prop
${(0,import_obsidian5.stringifyYaml)(newFmObj)}---
${article.content}`;await this.app.vault.modify(file2,newFullFileContent)}else{Object.keys(highlightSigs).length==0&&"raindrop_highlights"in bookmarkFmObj&&delete bookmarkFmObj.raindrop_highlights;let newFullFileContent=`---
${(0,import_obsidian5.stringifyYaml)(bookmarkFmObj)}---
${fileContent}`;await this.app.vault.modify(file2,newFullFileContent)}}async updateFileOverwriteMode(file2,bookmark){console.debug("update file overwrite mode",file2.path);let mdContent=await this.renderer.renderFullArticle(bookmark);return this.app.vault.modify(file2,mdContent)}async createFile(filePath,bookmark){console.debug("create file",filePath);let mdContent=await this.renderer.renderFullArticle(bookmark);return this.app.vault.create(filePath,mdContent)}getBookmarkFiles(){return this.app.vault.getMarkdownFiles().map(file2=>{var _a9;let cache=this.app.metadataCache.getFileCache(file2),raindropId=(_a9=cache==null?void 0:cache.frontmatter)==null?void 0:_a9.raindrop_id;return{file:file2,raindropId}}).filter(({raindropId})=>raindropId)}splitFrontmatterAndContent(content,fmEndLine){let splitPosFm=-1;for(;fmEndLine--&&splitPosFm++<content.length;)if(splitPosFm=content.indexOf(`
`,splitPosFm),splitPosFm<0)throw Error("Split front matter failed");let splitPosContent=splitPosFm+1;return splitPosContent=content.indexOf(`
`,splitPosContent)+1,{content:content.substring(splitPosContent),frontmatter:content.substring(0,splitPosFm)}}};var RaindropSettingTab=class extends import_obsidian6.PluginSettingTab{constructor(app,plugin,api,settings){super(app,plugin),this.plugin=plugin,this.renderer=new Renderer(plugin),this.api=api,this.raindropSync=new RaindropSync(this.app,plugin,api),this.settings=settings}display(){let{containerEl}=this;containerEl.empty(),this.settings.isConnected?this.disconnect():this.connect(),new import_obsidian6.Setting(containerEl).setName("Plugin").setHeading(),this.ribbonIcon(),this.autoSyncInterval(),this.autoSyncSuccessNotice(),new import_obsidian6.Setting(containerEl).setName("Rules & Templates").setHeading(),this.collections(),this.onlyBookmarksWithHl(),this.syncDeleteFiles(),this.syncDeleteUseTrash(),this.appendMode(),this.template(),this.metadataTemplate(),this.highlightsFolder(),this.collectionsFolders(),this.collectionGroups(),this.preventMovingExistingFiles(),this.filenameTemplate(),this.autoescape(),new import_obsidian6.Setting(containerEl).setName("Maintenance").setHeading(),this.resetSyncHistory()}ribbonIcon(){new import_obsidian6.Setting(this.containerEl).setName("Enable ribbon icon in the sidebar (need reload)").addToggle(toggle=>toggle.setValue(this.settings.enableRibbonIcon).onChange(async value=>{await this.settings.setEnableRibbonIcon(value)}))}appendMode(){let descFragment=document.createRange().createContextualFragment(appendModeInstructions_default);new import_obsidian6.Setting(this.containerEl).setName("Append Mode").setDesc(descFragment).addToggle(toggle=>toggle.setValue(this.settings.enableAppendMode).onChange(async value=>{await this.settings.setEnableAppendMode(value)}))}onlyBookmarksWithHl(){new import_obsidian6.Setting(this.containerEl).setName("Only sync bookmarks with highlights").addToggle(toggle=>toggle.setValue(this.settings.onlySyncBookmarksWithHl).onChange(async value=>{await this.settings.setOnlySyncBookmarksWithHl(value)}))}preventMovingExistingFiles(){new import_obsidian6.Setting(this.containerEl).setName("Folder location: Prevent moving existing files on sync").setDesc("If enabled, existing files will not be moved during sync.").addToggle(toggle=>toggle.setValue(this.settings.enablePreventMovingExistingFiles).onChange(async value=>{await this.settings.setEnablePreventMovingExistingFiles(value)}))}syncDeleteFiles(){new import_obsidian6.Setting(this.containerEl).setName("Delete local files when removed from Raindrop").setDesc("Sync delete event from Raindrop. Note that enabling this option will always trigger full sync instead of incremental sync.").addToggle(toggle=>toggle.setValue(this.settings.syncDeleteFiles).onChange(async value=>{await this.settings.setSyncDeleteFiles(value)}))}syncDeleteUseTrash(){new import_obsidian6.Setting(this.containerEl).setName("Use Trash to delete synced files").setDesc("Must use 'Delete local files when removed from Raindrop' option. Files will be moved to Trash instead of permanently deleted.").addToggle(toggle=>toggle.setValue(this.settings.syncDeleteUseTrash).onChange(async value=>{await this.settings.setSyncDeleteUseTrash(value)}))}collectionsFolders(){new import_obsidian6.Setting(this.containerEl).setName("Folder location: Collections folders").setDesc("Organize highlights into folders based on their collections").addToggle(toggle=>toggle.setValue(this.settings.enableCollectionsFolders).onChange(async value=>{await this.settings.setEnableCollectionsFolders(value)}))}connect(){new import_obsidian6.Setting(this.containerEl).setName("Connect to Raindrop.io").addButton(button=>button.setButtonText("Connect").setCta().onClick(async()=>{if(await new ApiTokenModal2(this.app,this.api).waitForClose,this.api.tokenManager.get()){new import_obsidian6.Notice("Token saved");let user=await this.api.getUser();await this.settings.setIsConnected(!0,user.fullName)}this.display()}))}disconnect(){new import_obsidian6.Setting(this.containerEl).setName(`Connected to Raindrop.io as ${this.settings.username}`).addButton(button=>button.setButtonText("Test API").setCta().
`).forEach(function(line){i=line.indexOf(":"),key2=line.substring(0,i).trim().toLowerCase(),val=line.substring(i+1).trim(),!(!key2||parsed[key2]&&ignoreDuplicateOf[key2])&&(key2==="set-cookie"?parsed[key2]?parsed[key2].push(val):parsed[key2]=[val]:parsed[key2]=parsed[key2]?parsed[key2]+", "+val:val)}),parsed};function trimSPorHTAB(str){let start=0,end=str.length;for(;start<end;){let code=str.charCodeAt(start);if(code!==9&&code!==32)break;start+=1}for(;end>start;){let code=str.charCodeAt(end-1);if(code!==9&&code!==32)break;end-=1}return start===0&&end===str.length?str:str.slice(start,end)}var INVALID_UNICODE_HEADER_VALUE_CHARS=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),INVALID_BYTE_STRING_HEADER_VALUE_CHARS=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function sanitizeValue(value,invalidChars){return utils_default.isArray(value)?value.map(item=>sanitizeValue(item,invalidChars)):trimSPorHTAB(String(value).replace(invalidChars,""))}var sanitizeHeaderValue=value=>sanitizeValue(value,INVALID_UNICODE_HEADER_VALUE_CHARS),sanitizeByteStringHeaderValue=value=>sanitizeValue(value,INVALID_BYTE_STRING_HEADER_VALUE_CHARS);function toByteStringHeaderObject(headers){let byteStringHeaders=Object.create(null);return utils_default.forEach(headers.toJSON(),(value,header)=>{byteStringHeaders[header]=sanitizeByteStringHeaderValue(value)}),byteStringHeaders}var $internals=Symbol("internals");function normalizeHeader(header){return header&&String(header).trim().toLowerCase()}function normalizeValue(value){return value===!1||value==null?value:utils_default.isArray(value)?value.map(normalizeValue):sanitizeHeaderValue(String(value))}function parseTokens(str){let tokens=Object.create(null),tokensRE=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,match;for(;match=tokensRE.exec(str);)tokens[match[1]]=match[2];return tokens}var isValidHeaderName=str=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());function matchHeaderValue(context,value,header,filter2,isHeaderNameFilter){if(utils_default.isFunction(filter2))return filter2.call(this,value,header);if(isHeaderNameFilter&&(value=header),!!utils_default.isString(value)){if(utils_default.isString(filter2))return value.indexOf(filter2)!==-1;if(utils_default.isRegExp(filter2))return filter2.test(value)}}function formatHeader(header){return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(w,char,str)=>char.toUpperCase()+str)}function buildAccessors(obj,header){let accessorName=utils_default.toCamelCase(" "+header);["get","set","has"].forEach(methodName=>{Object.defineProperty(obj,methodName+accessorName,{__proto__:null,value:function(arg1,arg2,arg3){return this[methodName].call(this,header,arg1,arg2,arg3)},configurable:!0})})}var AxiosHeaders=class{constructor(headers){headers&&this.set(headers)}set(header,valueOrRewrite,rewrite){let self3=this;function setHeader(_value,_header,_rewrite){let lHeader=normalizeHeader(_header);if(!lHeader)throw new Error("header name must be a non-empty string");let key2=utils_default.findKey(self3,lHeader);(!key2||self3[key2]===void 0||_rewrite===!0||_rewrite===void 0&&self3[key2]!==!1)&&(self3[key2||_header]=normalizeValue(_value))}let setHeaders=(headers,_rewrite)=>utils_default.forEach(headers,(_value,_header)=>setHeader(_value,_header,_rewrite));if(utils_default.isPlainObject(header)||header instanceof this.constructor)setHeaders(header,valueOrRewrite);else if(utils_default.isString(header)&&(header=header.trim())&&!isValidHeaderName(header))setHeaders(parseHeaders_default(header),valueOrRewrite);else if(utils_default.isObject(header)&&utils_default.isIterable(header)){let obj={},dest,key2;for(let entry of header){if(!utils_default.isArray(entry))throw TypeError("Object iterator must return a key-value pair");obj[key2=entry[0]]=(dest=obj[key2])?utils_default.isArray(dest)?[...dest,entry[1]]:[dest,entry[1]]:entry[1]}setHeaders(obj,valueOrRewrite)}else header!=null&&setHeader(valueOrRewrite,header,rewrite);return this}get(header,parser){if(header=normalizeHeader(header),header){let key2=utils_default.findKey(this,header);if(key2){let value=this[key2
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(thing){return thing instanceof this?thing:new this(thing)}static concat(first,...targets){let computed=new this(first);return targets.forEach(target=>computed.set(target)),computed}static accessor(header){let accessors=(this[$internals]=this[$internals]={accessors:{}}).accessors,prototype2=this.prototype;function defineAccessor(_header){let lHeader=normalizeHeader(_header);accessors[lHeader]||(buildAccessors(prototype2,_header),accessors[lHeader]=!0)}return utils_default.isArray(header)?header.forEach(defineAccessor):defineAccessor(header),this}};AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils_default.reduceDescriptors(AxiosHeaders.prototype,({value},key2)=>{let mapped=key2[0].toUpperCase()+key2.slice(1);return{get:()=>value,set(headerValue){this[mapped]=headerValue}}});utils_default.freezeMethods(AxiosHeaders);var AxiosHeaders_default=AxiosHeaders;var REDACTED="[REDACTED ****]";function hasOwnOrPrototypeToJSON(source2){if(utils_default.hasOwnProp(source2,"toJSON"))return!0;let prototype2=Object.getPrototypeOf(source2);for(;prototype2&&prototype2!==Object.prototype;){if(utils_default.hasOwnProp(prototype2,"toJSON"))return!0;prototype2=Object.getPrototypeOf(prototype2)}return!1}function redactConfig(config2,redactKeys){let lowerKeys=new Set(redactKeys.map(k=>String(k).toLowerCase())),seen=[],visit=source2=>{if(source2===null||typeof source2!="object"||utils_default.isBuffer(source2))return source2;if(seen.indexOf(source2)!==-1)return;source2 instanceof AxiosHeaders_default&&(source2=source2.toJSON()),seen.push(source2);let result;if(utils_default.isArray(source2))result=[],source2.forEach((v,i)=>{let reducedValue=visit(v);utils_default.isUndefined(reducedValue)||(result[i]=reducedValue)});else{if(!utils_default.isPlainObject(source2)&&hasOwnOrPrototypeToJSON(source2))return seen.pop(),source2;result=Object.create(null);for(let[key2,value]of Object.entries(source2)){let reducedValue=lowerKeys.has(key2.toLowerCase())?REDACTED:visit(value);utils_default.isUndefined(reducedValue)||(result[key2]=reducedValue)}}return seen.pop(),result};return visit(config2)}var AxiosError=class _AxiosError extends Error{static from(error51,code,config2,request,response,customProps){let axiosError=new _AxiosError(error51.message,code||error51.code,config2,request,response);return axiosError.cause=error51,axiosError.name=error51.name,error51.status!=null&&axiosError.status==null&&(axiosError.status=error51.status),customProps&&Object.assign(axiosError,customProps),axiosError}constructor(message,code,config2,request,response){super(message),Object.defineProperty(this,"message",{__proto__:null,value:message,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,code&&(this.code=code),config2&&(this.config=config2),request&&(this.request=request),response&&(this.response=response,this.status=response.status)}toJSON(){let config2=this.config,redactKeys=config2&&utils_default.hasOwnProp(config2,"redact")?config2.redact:void 0,serializedConfig=utils_default.isArray(redactKeys)&&redactKeys.length>0?redactConfig(config2,redactKeys):utils_default.toJSONObject(config2);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:serializedConfig,code:this.code,status:this.status}}};AxiosError.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";AxiosError.ERR_BAD_OPTION="ERR_BAD_OPTION";AxiosError.ECONNABORTED="ECONNABORTED";AxiosError.ETIMEDOUT="ETIMEDOUT";AxiosError.ECONNREFUSED="ECONNREFUSED";AxiosError.ERR_NETWORK="ERR_NETWORK";AxiosError.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";AxiosError.ERR_DEPRECATED="ERR_DEPRECATED";AxiosError.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";AxiosError.ERR_BAD_REQUEST="ERR_BAD_REQUEST";AxiosError.ERR_CANCELED="ERR_CANCELED";AxiosError.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";AxiosErro
`+reasons.map(renderReason).join(`
`):" "+renderReason(reasons[0]):"as no adapter specified";throw new AxiosError_default("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return adapter2}var adapters_default={getAdapter,adapters:knownAdapters};function throwIfCancellationRequested(config2){if(config2.cancelToken&&config2.cancelToken.throwIfRequested(),config2.signal&&config2.signal.aborted)throw new CanceledError_default(null,config2)}function dispatchRequest(config2){return throwIfCancellationRequested(config2),config2.headers=AxiosHeaders_default.from(config2.headers),config2.data=transformData.call(config2,config2.transformRequest),["post","put","patch"].indexOf(config2.method)!==-1&&config2.headers.setContentType("application/x-www-form-urlencoded",!1),adapters_default.getAdapter(config2.adapter||defaults_default.adapter,config2)(config2).then(function(response){throwIfCancellationRequested(config2),config2.response=response;try{response.data=transformData.call(config2,config2.transformResponse,response)}finally{delete config2.response}return response.headers=AxiosHeaders_default.from(response.headers),response},function(reason){if(!isCancel(reason)&&(throwIfCancellationRequested(config2),reason&&reason.response)){config2.response=reason.response;try{reason.response.data=transformData.call(config2,config2.transformResponse,reason.response)}finally{delete config2.response}reason.response.headers=AxiosHeaders_default.from(reason.response.headers)}return Promise.reject(reason)})}var validators={};["object","boolean","number","function","string","symbol"].forEach((type,i)=>{validators[type]=function(thing){return typeof thing===type||"a"+(i<1?"n ":" ")+type}});var deprecatedWarnings={};validators.transitional=function(validator,version2,message){function formatMessage(opt,desc){return"[Axios v"+VERSION+"] Transitional option '"+opt+"'"+desc+(message?". "+message:"")}return(value,opt,opts)=>{if(validator===!1)throw new AxiosError_default(formatMessage(opt," has been removed"+(version2?" in "+version2:"")),AxiosError_default.ERR_DEPRECATED);return version2&&!deprecatedWarnings[opt]&&(deprecatedWarnings[opt]=!0,console.warn(formatMessage(opt," has been deprecated since v"+version2+" and will be removed in the near future"))),validator?validator(value,opt,opts):!0}};validators.spelling=function(correctSpelling){return(value,opt)=>(console.warn(`${opt} is likely a misspelling of ${correctSpelling}`),!0)};function assertOptions(options,schema,allowUnknown){if(typeof options!="object")throw new AxiosError_default("options must be an object",AxiosError_default.ERR_BAD_OPTION_VALUE);let keys=Object.keys(options),i=keys.length;for(;i-- >0;){let opt=keys[i],validator=Object.prototype.hasOwnProperty.call(schema,opt)?schema[opt]:void 0;if(validator){let value=options[opt],result=value===void 0||validator(value,opt,options);if(result!==!0)throw new AxiosError_default("option "+opt+" must be "+result,AxiosError_default.ERR_BAD_OPTION_VALUE);continue}if(allowUnknown!==!0)throw new AxiosError_default("Unknown option "+opt,AxiosError_default.ERR_BAD_OPTION)}}var validator_default={assertOptions,validators};var validators2=validator_default.validators,Axios=class{constructor(instanceConfig){this.defaults=instanceConfig||{},this.interceptors={request:new InterceptorManager_default,response:new InterceptorManager_default}}async request(configOrUrl,config2){try{return await this._request(configOrUrl,config2)}catch(err){if(err instanceof Error){let dummy={};Error.captureStackTrace?Error.captureStackTrace(dummy):dummy=new Error;let stack2=(()=>{if(!dummy.stack)return"";let firstNewlineIndex=dummy.stack.indexOf(`
`);return firstNewlineIndex===-1?"":dummy.stack.slice(firstNewlineIndex+1)})();try{if(!err.stack)err.stack=stack2;else if(stack2){let firstNewlineIndex=stack2.indexOf(`
`),secondNewlineIndex=firstNewlineIndex===-1?-1:stack2.indexOf(`
`,firstNewlineIndex+1),stackWithoutTwoTopLines=secondNewlineIndex===-1?"":stack2.slice(secondNewlineIndex+1);String(err.stack).endsWith(stackWithoutTwoTopLines)||(err.stack+=`
`+stack2)}}catch(e){}}throw err}}_request(configOrUrl,config2){typeof configOrUrl=="string"?(config2=config2||{},config2.url=configOrUrl):config2=configOrUrl||{},config2=mergeConfig(this.defaults,config2);let{transitional:transitional2,paramsSerializer,headers}=config2;transitional2!==void 0&&validator_default.assertOptions(transitional2,{silentJSONParsing:validators2.transitional(validators2.boolean),forcedJSONParsing:validators2.transitional(validators2.boolean),clarifyTimeoutError:validators2.transitional(validators2.boolean),legacyInterceptorReqResOrdering:validators2.transitional(validators2.boolean)},!1),paramsSerializer!=null&&(utils_default.isFunction(paramsSerializer)?config2.paramsSerializer={serialize:paramsSerializer}:validator_default.assertOptions(paramsSerializer,{encode:validators2.function,serialize:validators2.function},!0)),config2.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?config2.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:config2.allowAbsoluteUrls=!0),validator_default.assertOptions(config2,{baseUrl:validators2.spelling("baseURL"),withXsrfToken:validators2.spelling("withXSRFToken")},!0),config2.method=(config2.method||this.defaults.method||"get").toLowerCase();let contextHeaders=headers&&utils_default.merge(headers.common,headers[config2.method]);headers&&utils_default.forEach(["delete","get","head","post","put","patch","query","common"],method=>{delete headers[method]}),config2.headers=AxiosHeaders_default.concat(contextHeaders,headers);let requestInterceptorChain=[],synchronousRequestInterceptors=!0;this.interceptors.request.forEach(function(interceptor){if(typeof interceptor.runWhen=="function"&&interceptor.runWhen(config2)===!1)return;synchronousRequestInterceptors=synchronousRequestInterceptors&&interceptor.synchronous;let transitional3=config2.transitional||transitional_default;transitional3&&transitional3.legacyInterceptorReqResOrdering?requestInterceptorChain.unshift(interceptor.fulfilled,interceptor.rejected):requestInterceptorChain.push(interceptor.fulfilled,interceptor.rejected)});let responseInterceptorChain=[];this.interceptors.response.forEach(function(interceptor){responseInterceptorChain.push(interceptor.fulfilled,interceptor.rejected)});let promise2,i=0,len;if(!synchronousRequestInterceptors){let chain=[dispatchRequest.bind(this),void 0];for(chain.unshift(...requestInterceptorChain),chain.push(...responseInterceptorChain),len=chain.length,promise2=Promise.resolve(config2);i<len;)promise2=promise2.then(chain[i++],chain[i++]);return promise2}len=requestInterceptorChain.length;let newConfig=config2;for(;i<len;){let onFulfilled=requestInterceptorChain[i++],onRejected=requestInterceptorChain[i++];try{newConfig=onFulfilled(newConfig)}catch(error51){onRejected.call(this,error51);break}}try{promise2=dispatchRequest.call(this,newConfig)}catch(error51){return Promise.reject(error51)}for(i=0,len=responseInterceptorChain.length;i<len;)promise2=promise2.then(responseInterceptorChain[i++],responseInterceptorChain[i++]);return promise2}getUri(config2){config2=mergeConfig(this.defaults,config2);let fullPath=buildFullPath(config2.baseURL,config2.url,config2.allowAbsoluteUrls);return buildURL(fullPath,config2.params,config2.paramsSerializer)}};utils_default.forEach(["delete","get","head","options"],function(method){Axios.prototype[method]=function(url2,config2){return this.request(mergeConfig(config2||{},{method,url:url2,data:(config2||{}).data}))}});utils_default.forEach(["post","put","patch","query"],function(method){function generateHTTPMethod(isForm){return function(url2,data,config2){return this.request(mergeConfig(config2||{},{method,headers:isForm?{"Content-Type":"multipart/form-data"}:{},url:url2,data}))}}Axios.prototype[method]=generateHTTPMethod(),method!=="query"&&(Axios.prototype[method+"Form"]=generateHTTPMethod(!0))});var Axios_default=Axios;var CancelToken=class _CancelToken{constructor(executor){if(typeof executor!="function")throw new TypeError("executor must be a function.");let resolvePromise;this.promise=new Promise(function(resolve){resolvePromis
`)}var _parse=_Err=>(schema,value,_ctx,_params)=>{var _a9;let ctx=_ctx?{..._ctx,async:!1}:{async:!1},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;if(result.issues.length){let e=new((_a9=_params==null?void 0:_params.Err)!=null?_a9:_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e,_params==null?void 0:_params.callee),e}return result.value},parse=_parse($ZodRealError),_parseAsync=_Err=>async(schema,value,_ctx,params)=>{var _a9;let ctx=_ctx?{..._ctx,async:!0}:{async:!0},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise&&(result=await result),result.issues.length){let e=new((_a9=params==null?void 0:params.Err)!=null?_a9:_Err)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())));throw captureStackTrace(e,params==null?void 0:params.callee),e}return result.value},parseAsync=_parseAsync($ZodRealError),_safeParse=_Err=>(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,async:!1}:{async:!1},result=schema._zod.run({value,issues:[]},ctx);if(result instanceof Promise)throw new $ZodAsyncError;return result.issues.length?{success:!1,error:new(_Err!=null?_Err:$ZodError)(result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}:{success:!0,data:result.value}},safeParse=_safeParse($ZodRealError),_safeParseAsync=_Err=>async(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,async:!0}:{async:!0},result=schema._zod.run({value,issues:[]},ctx);return result instanceof Promise&&(result=await result),result.issues.length?{success:!1,error:new _Err(result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}:{success:!0,data:result.value}},safeParseAsync=_safeParseAsync($ZodRealError),_encode=_Err=>(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,direction:"backward"}:{direction:"backward"};return _parse(_Err)(schema,value,ctx)},encode3=_encode($ZodRealError),_decode=_Err=>(schema,value,_ctx)=>_parse(_Err)(schema,value,_ctx),decode=_decode($ZodRealError),_encodeAsync=_Err=>async(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,direction:"backward"}:{direction:"backward"};return _parseAsync(_Err)(schema,value,ctx)},encodeAsync=_encodeAsync($ZodRealError),_decodeAsync=_Err=>async(schema,value,_ctx)=>_parseAsync(_Err)(schema,value,_ctx),decodeAsync=_decodeAsync($ZodRealError),_safeEncode=_Err=>(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,direction:"backward"}:{direction:"backward"};return _safeParse(_Err)(schema,value,ctx)},safeEncode=_safeEncode($ZodRealError),_safeDecode=_Err=>(schema,value,_ctx)=>_safeParse(_Err)(schema,value,_ctx),safeDecode=_safeDecode($ZodRealError),_safeEncodeAsync=_Err=>async(schema,value,_ctx)=>{let ctx=_ctx?{..._ctx,direction:"backward"}:{direction:"backward"};return _safeParseAsync(_Err)(schema,value,ctx)},safeEncodeAsync=_safeEncodeAsync($ZodRealError),_safeDecodeAsync=_Err=>async(schema,value,_ctx)=>_safeParseAsync(_Err)(schema,value,_ctx),safeDecodeAsync=_safeDecodeAsync($ZodRealError);var regexes_exports={};__export(regexes_exports,{base64:()=>base64,base64url:()=>base64url,bigint:()=>bigint,boolean:()=>boolean,browserEmail:()=>browserEmail,cidrv4:()=>cidrv4,cidrv6:()=>cidrv6,cuid:()=>cuid,cuid2:()=>cuid2,date:()=>date,datetime:()=>datetime,domain:()=>domain,duration:()=>duration,e164:()=>e164,email:()=>email,emoji:()=>emoji,extendedDuration:()=>extendedDuration,guid:()=>guid,hex:()=>hex,hostname:()=>hostname,html5Email:()=>html5Email,httpProtocol:()=>httpProtocol,idnEmail:()=>idnEmail,integer:()=>integer,ipv4:()=>ipv4,ipv6:()=>ipv6,ksuid:()=>ksuid,lowercase:()=>lowercase,mac:()=>mac,md5_base64:()=>md5_base64,md5_base64url:()=>md5_base64url,md5_hex:()=>md5_hex,nanoid:()=>nanoid,null:()=>_null,number:()=>number,rfc5322Email:()=>rfc5322Email,sha1_base64:()=>sha1_base64,sha1_base64url:()=>sha1_base64url,sha1_hex:()=>sha1_hex,sha256_base64:()=>sha256_base64,sha256_base64url:()=>sha256_base64url,sha256_hex:()=>sha256_hex,sha384_base64:()=>sha384_base64,sha384_base64url:()=>sha384_base64url,sha384_hex:()=>sha384_hex,sha512_base64:()=>sha512_base64,sha512_base64url:()=>sha512_base64url,sha512_hex:()=>sha512_hex,string:()=>string,time
`).filter(x=>x),minIndent=Math.min(...lines.map(x=>x.length-x.trimStart().length)),dedented=lines.map(x=>x.slice(minIndent)).map(x=>" ".repeat(this.indent*2)+x);for(let line of dedented)this.content.push(line)}compile(){var _a9;let F=Function,args=this==null?void 0:this.args,lines=[...((_a9=this==null?void 0:this.content)!=null?_a9:[""]).map(x=>` ${x}`)];return new F(...args,lines.join(`
`))}};var version={major:4,minor:4,patch:3};var $ZodType=$constructor("$ZodType",(inst,def)=>{var _a10,_b3,_c2;var _a9;inst!=null||(inst={}),inst._zod.def=def,inst._zod.bag=inst._zod.bag||{},inst._zod.version=version;let checks=[...(_a10=inst._zod.def.checks)!=null?_a10:[]];inst._zod.traits.has("$ZodCheck")&&checks.unshift(inst);for(let ch of checks)for(let fn of ch._zod.onattach)fn(inst);if(checks.length===0)(_b3=(_a9=inst._zod).deferred)!=null||(_a9.deferred=[]),(_c2=inst._zod.deferred)==null||_c2.push(()=>{inst._zod.run=inst._zod.parse});else{let runChecks=(payload,checks2,ctx)=>{let isAborted=aborted2(payload),asyncResult;for(let ch of checks2){if(ch._zod.def.when){if(explicitlyAborted(payload)||!ch._zod.def.when(payload))continue}else if(isAborted)continue;let currLen=payload.issues.length,_=ch._zod.check(payload);if(_ instanceof Promise&&(ctx==null?void 0:ctx.async)===!1)throw new $ZodAsyncError;if(asyncResult||_ instanceof Promise)asyncResult=(asyncResult!=null?asyncResult:Promise.resolve()).then(async()=>{await _,payload.issues.length!==currLen&&(isAborted||(isAborted=aborted2(payload,currLen)))});else{if(payload.issues.length===currLen)continue;isAborted||(isAborted=aborted2(payload,currLen))}}return asyncResult?asyncResult.then(()=>payload):payload},handleCanaryResult=(canary,payload,ctx)=>{if(aborted2(canary))return canary.aborted=!0,canary;let checkResult=runChecks(payload,checks,ctx);if(checkResult instanceof Promise){if(ctx.async===!1)throw new $ZodAsyncError;return checkResult.then(checkResult2=>inst._zod.parse(checkResult2,ctx))}return inst._zod.parse(checkResult,ctx)};inst._zod.run=(payload,ctx)=>{if(ctx.skipChecks)return inst._zod.parse(payload,ctx);if(ctx.direction==="backward"){let canary=inst._zod.parse({value:payload.value,issues:[]},{...ctx,skipChecks:!0});return canary instanceof Promise?canary.then(canary2=>handleCanaryResult(canary2,payload,ctx)):handleCanaryResult(canary,payload,ctx)}let result=inst._zod.parse(payload,ctx);if(result instanceof Promise){if(ctx.async===!1)throw new $ZodAsyncError;return result.then(result2=>runChecks(result2,checks,ctx))}return runChecks(result,checks,ctx)}}defineLazy(inst,"~standard",()=>({validate:value=>{var _a11;try{let r=safeParse(inst,value);return r.success?{value:r.data}:{issues:(_a11=r.error)==null?void 0:_a11.issues}}catch(_){return safeParseAsync(inst,value).then(r=>{var _a12;return r.success?{value:r.data}:{issues:(_a12=r.error)==null?void 0:_a12.issues}})}},vendor:"zod",version:1}))}),$ZodString=$constructor("$ZodString",(inst,def)=>{var _a9,_b3,_c2;$ZodType.init(inst,def),inst._zod.pattern=(_c2=[...(_b3=(_a9=inst==null?void 0:inst._zod.bag)==null?void 0:_a9.patterns)!=null?_b3:[]].pop())!=null?_c2:string(inst._zod.bag),inst._zod.parse=(payload,_)=>{if(def.coerce)try{payload.value=String(payload.value)}catch(_2){}return typeof payload.value=="string"||payload.issues.push({expected:"string",code:"invalid_type",input:payload.value,inst}),payload}}),$ZodStringFormat=$constructor("$ZodStringFormat",(inst,def)=>{$ZodCheckStringFormat.init(inst,def),$ZodString.init(inst,def)}),$ZodGUID=$constructor("$ZodGUID",(inst,def)=>{var _a9;(_a9=def.pattern)!=null||(def.pattern=guid),$ZodStringFormat.init(inst,def)}),$ZodUUID=$constructor("$ZodUUID",(inst,def)=>{var _a9,_b3;if(def.version){let v={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[def.version];if(v===void 0)throw new Error(`Invalid UUID version: "${def.version}"`);(_a9=def.pattern)!=null||(def.pattern=uuid(v))}else(_b3=def.pattern)!=null||(def.pattern=uuid());$ZodStringFormat.init(inst,def)}),$ZodEmail=$constructor("$ZodEmail",(inst,def)=>{var _a9;(_a9=def.pattern)!=null||(def.pattern=email),$ZodStringFormat.init(inst,def)}),$ZodURL=$constructor("$ZodURL",(inst,def)=>{$ZodStringFormat.init(inst,def),inst._zod.check=payload=>{var _a9;try{let trimmed=payload.value.trim();if(!def.normalize&&((_a9=def.protocol)==null?void 0:_a9.source)===httpProtocol.source&&!/^https?:\/\//i.test(trimmed)){payload.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:payload.value,inst,continue:!def.abort
if (${id}.issues.length) {
if (${k} in input) {
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
...iss,
path: iss.path ? [${k}, ...iss.path] : [${k}]
})));
}
}
if (${id}.value === undefined) {
if (${k} in input) {
newResult[${k}] = undefined;
}
} else {
newResult[${k}] = ${id}.value;
}
`):isOptionalIn?doc.write(`
if (${id}.issues.length) {
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
...iss,
path: iss.path ? [${k}, ...iss.path] : [${k}]
})));
}
if (${id}.value === undefined) {
if (${k} in input) {
newResult[${k}] = undefined;
}
} else {
newResult[${k}] = ${id}.value;
}
`):doc.write(`
const ${id}_present = ${k} in input;
if (${id}.issues.length) {
payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
...iss,
path: iss.path ? [${k}, ...iss.path] : [${k}]
})));
}
if (!${id}_present && !${id}.issues.length) {
payload.issues.push({
code: "invalid_type",
expected: "nonoptional",
input: undefined,
path: [${k}]
});
}
if (${id}_present) {
if (${id}.value === undefined) {
newResult[${k}] = undefined;
} else {
newResult[${k}] = ${id}.value;
}
}
`)}doc.write("payload.value = newResult;"),doc.write("return payload;");let fn=doc.compile();return(payload,ctx)=>fn(shape,payload,ctx)},fastpass,isObject3=isObject2,jit=!globalConfig.jitless,fastEnabled=jit&&allowsEval.value,catchall=def.catchall,value;inst._zod.parse=(payload,ctx)=>{value!=null||(value=_normalized.value);let input=payload.value;return isObject3(input)?jit&&fastEnabled&&(ctx==null?void 0:ctx.async)===!1&&ctx.jitless!==!0?(fastpass||(fastpass=generateFastpass(def.shape)),payload=fastpass(payload,ctx),catchall?handleCatchall([],input,payload,ctx,value,inst):payload):superParse(payload,ctx):(payload.issues.push({expected:"object",code:"invalid_type",input,inst}),payload)}});function handleUnionResults(results,final,inst,ctx){for(let result of results)if(result.issues.length===0)return final.value=result.value,final;let nonaborted=results.filter(r=>!aborted2(r));return nonaborted.length===1?(final.value=nonaborted[0].value,nonaborted[0]):(final.issues.push({code:"invalid_union",input:final.value,inst,errors:results.map(result=>result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}),final)}var $ZodUnion=$constructor("$ZodUnion",(inst,def)=>{$ZodType.init(inst,def),defineLazy(inst._zod,"optin",()=>def.options.some(o=>o._zod.optin==="optional")?"optional":void 0),defineLazy(inst._zod,"optout",()=>def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),defineLazy(inst._zod,"values",()=>{if(def.options.every(o=>o._zod.values))return new Set(def.options.flatMap(option=>Array.from(option._zod.values)))}),defineLazy(inst._zod,"pattern",()=>{if(def.options.every(o=>o._zod.pattern)){let patterns=def.options.map(o=>o._zod.pattern);return new RegExp(`^(${patterns.map(p=>cleanRegex(p.source)).join("|")})$`)}});let first=def.options.length===1?def.options[0]._zod.run:null;inst._zod.parse=(payload,ctx)=>{if(first)return first(payload,ctx);let async2=!1,results=[];for(let option of def.options){let result=option._zod.run({value:payload.value,issues:[]},ctx);if(result instanceof Promise)results.push(result),async2=!0;else{if(result.issues.length===0)return result;results.push(result)}}return async2?Promise.all(results).then(results2=>handleUnionResults(results2,payload,inst,ctx)):handleUnionResults(results,payload,inst,ctx)}});function handleExclusiveUnionResults(results,final,inst,ctx){let successes=results.filter(r=>r.issues.length===0);return successes.length===1?(final.value=successes[0].value,final):(successes.length===0?final.issues.push({code:"invalid_union",input:final.value,inst,errors:results.map(result=>result.issues.map(iss=>finalizeIssue(iss,ctx,config())))}):final.issues.push({code:"invalid_union",input:final.value,inst,errors:[],inclusive:!1}),final)}var $ZodXor=$constructor("$ZodXor",(inst,def)=>{$ZodUnion.init(inst,def),def.inclusive=!1;let first=def.options.length===1?def.options[0]._zod.run:null;inst._zod.parse=(payload,ctx)=>{if(first)return first(payload,ctx);let async2=!1,results=[];for(let option of def.options){let result=option._zod.run({value:payload.value,issues:[]},ctx);result instanceof Promise?(results.push(result),async2=!0):results.push(result)}return async2?Promise.all(results).then(results2=>handleExclusiveUnionResults(results2,payload,inst,ctx)):handleExclusiveUnionResults(results,payload,inst,ctx)}}),$ZodDiscriminatedUnion=$constructor("$ZodDiscriminatedUnion",(inst,def)=>{def.inclusive=!1,$ZodUnion.init(inst,def);let _super=inst._zod.parse;defineLazy(inst._zod,"propValues",()=>{let propValues={};for(let option of def.options){let pv=option._zod.propValues;if(!pv||Object.keys(pv).length===0)throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);for(let[k,v]of Object.entries(pv)){propValues[k]||(propValues[k]=new Set);for(let val of v)propValues[k].add(val)}}return propValues});let disc=cached(()=>{var _a9;let opts=def.options,map2=new Map;for(let o of opts){let values=(_a9=o._zod.propValues)==null?void 0:_a9[def.discriminator];if(!values||values.size===0)throw new Error(`Invalid discriminated union option at index "${def.option
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let entry of ctx.seen.entries()){let seen=entry[1];if(schema===entry[0]){extractToDef(entry);continue}if(ctx.external){let ext=(_c2=ctx.external.registry.get(entry[0]))==null?void 0:_c2.id;if(schema!==entry[0]&&ext){extractToDef(entry);continue}}if((_d=ctx.metadataRegistry.get(entry[0]))==null?void 0:_d.id){extractToDef(entry);continue}if(seen.cycle){extractToDef(entry);continue}if(seen.count>1&&ctx.reused==="ref"){extractToDef(entry);continue}}}function finalize(ctx,schema){var _a9,_b3,_c2,_d,_e,_f;let root2=ctx.seen.get(schema);if(!root2)throw new Error("Unprocessed schema. This is a bug in Zod.");let flattenRef=zodSchema=>{var _a10,_b4,_c3;let seen=ctx.seen.get(zodSchema);if(seen.ref===null)return;let schema2=(_a10=seen.def)!=null?_a10:seen.schema,_cached={...schema2},ref=seen.ref;if(seen.ref=null,ref){flattenRef(ref);let refSeen=ctx.seen.get(ref),refSchema=refSeen.schema;if(refSchema.$ref&&(ctx.target==="draft-07"||ctx.target==="draft-04"||ctx.target==="openapi-3.0")?(schema2.allOf=(_b4=schema2.allOf)!=null?_b4:[],schema2.allOf.push(refSchema)):Object.assign(schema2,refSchema),Object.assign(schema2,_cached),zodSchema._zod.parent===ref)for(let key2 in schema2)key2==="$ref"||key2==="allOf"||key2 in _cached||delete schema2[key2];if(refSchema.$ref&&refSeen.def)for(let key2 in schema2)key2==="$ref"||key2==="allOf"||key2 in refSeen.def&&JSON.stringify(schema2[key2])===JSON.stringify(refSeen.def[key2])&&delete schema2[key2]}let parent=zodSchema._zod.parent;if(parent&&parent!==ref){flattenRef(parent);let parentSeen=ctx.seen.get(parent);if(parentSeen!=null&&parentSeen.schema.$ref&&(schema2.$ref=parentSeen.schema.$ref,parentSeen.def))for(let key2 in schema2)key2==="$ref"||key2==="allOf"||key2 in parentSeen.def&&JSON.stringify(schema2[key2])===JSON.stringify(parentSeen.def[key2])&&delete schema2[key2]}ctx.override({zodSchema,jsonSchema:schema2,path:(_c3=seen.path)!=null?_c3:[]})};for(let entry of[...ctx.seen.entries()].reverse())flattenRef(entry[0]);let result={};if(ctx.target==="draft-2020-12"?result.$schema="https://json-schema.org/draft/2020-12/schema":ctx.target==="draft-07"?result.$schema="http://json-schema.org/draft-07/schema#":ctx.target==="draft-04"?result.$schema="http://json-schema.org/draft-04/schema#":ctx.target,(_a9=ctx.external)!=null&&_a9.uri){let id=(_b3=ctx.external.registry.get(schema))==null?void 0:_b3.id;if(!id)throw new Error("Schema is missing an `id` property");result.$id=ctx.external.uri(id)}Object.assign(result,(_c2=root2.def)!=null?_c2:root2.schema);let rootMetaId=(_d=ctx.metadataRegistry.get(schema))==null?void 0:_d.id;rootMetaId!==void 0&&result.id===rootMetaId&&delete result.id;let defs=(_f=(_e=ctx.external)==null?void 0:_e.defs)!=null?_f:{};for(let entry of ctx.seen.entries()){let seen=entry[1];seen.def&&seen.defId&&(seen.def.id===seen.defId&&delete seen.def.id,defs[seen.defId]=seen.def)}ctx.external||Object.keys(defs).length>0&&(ctx.target==="draft-2020-12"?result.$defs=defs:result.definitions=defs);try{let finalized=JSON.parse(JSON.stringify(result));return Object.defineProperty(finalized,"~standard",{value:{...schema["~standard"],jsonSchema:{input:createStandardJSONSchemaMethod(schema,"input",ctx.processors),output:createStandardJSONSchemaMethod(schema,"output",ctx.processors)}},enumerable:!1,writable:!1}),finalized}catch(_err){throw new Error("Error converting schema to JSON.")}}function isTransforming(_schema,_ctx){let ctx=_ctx!=null?_ctx:{seen:new Set};if(ctx.seen.has(_schema))return!1;ctx.seen.add(_schema);let def=_schema._zod.def;if(def.type==="transform")return!0;if(def.type==="array")return isTransforming(def.element,ctx);if(def.type==="set")return isTransforming(def.valueType,ctx);if(def.type==="lazy")return isTransforming(def.getter(),ctx);if(def.type==="promise"||def.type==="optional"||def.type==="nonoptional"||def.type==="nullable"||def.type==="readonly"||def.type==="default"||def.type==="prefault")return isTransforming(def.innerType,ctx);if(def.type==="intersection")return isTransforming(def.left
# Metadata
{% if link %}Source URL:: {{link}}{% endif %}
{% if tags|length %}Topics:: #{{ tags | join(", #") }}{% endif %}
---
# {{title}}
{% if excerpt %}{{excerpt}}{% endif %}
## Highlights
{% endif -%}{% for highlight in highlights %}
{% if highlight.color == "red" -%}
{%- set callout = "danger" -%}
{%- elif highlight.color == "blue" -%}
{%- set callout = "info" -%}
{%- elif highlight.color == "green" -%}
{%- set callout = "check" -%}
{%- else -%}
{%- set callout = "quote" -%}
{%- endif -%}
> [!{{callout}}]+ Updated on {{highlight.lastUpdate}}
>
> {{highlight.text.split("\\n") | join("\\n>")}}
{% if highlight.note -%}> > {{highlight.note + "\\n"}}{%- endif %}
{%- endfor -%}
`;var defaultFilenameTemplate_default=`{{title}}
`;var VERSION3="0.0.25",DEFAULT_SETTINGS={version:VERSION3,username:void 0,isConnected:!1,ribbonIcon:!0,appendMode:!0,collectionsFolders:!0,onlyBookmarksWithHl:!1,syncDeleteFiles:!1,syncDeleteUseTrash:!0,highlightsFolder:"/",collectionGroups:!1,autoSyncSuccessNotice:!0,autoSyncAllCollections:!1,autoSyncNewNestedCollections:!1,syncCollections:{},template:defaultTemplate_default,metadataTemplate:defaultMetadataTemplate_default,filenameTemplate:defaultFilenameTemplate_default,preventMovingExistingFiles:!0,autoSyncInterval:0,autoescape:!0},SYSTEM_COLLECTIONS=[{id:0,title:"All bookmarks",parentId:null},{id:-1,title:"Unsorted",parentId:null},{id:-99,title:"Trash",parentId:null}];var BASEURL="https://api.raindrop.io/rest/v1",ZOptEmptyString=zod_default.string().optional().nullable().transform(val=>val!=null?val:""),ZUser=zod_default.object({user:zod_default.object({fullName:ZOptEmptyString,groups:zod_default.array(zod_default.object({collections:zod_default.array(zod_default.number()),title:ZOptEmptyString}))})}),ZRootCollection=zod_default.object({items:zod_default.array(zod_default.object({_id:zod_default.number(),title:ZOptEmptyString}))}),ZChildrenCollection=zod_default.object({items:zod_default.array(zod_default.object({_id:zod_default.number(),title:ZOptEmptyString,parent:zod_default.object({$id:zod_default.number()}).optional().nullable()}))}),ZRaindrop=zod_default.object({_id:zod_default.number(),collectionId:zod_default.number(),cover:ZOptEmptyString,created:zod_default.coerce.date(),creatorRef:zod_default.object({_id:zod_default.number(),name:ZOptEmptyString}),excerpt:ZOptEmptyString,highlights:zod_default.array(zod_default.object({color:zod_default.string().optional().default("yellow"),created:zod_default.coerce.date(),lastUpdate:zod_default.coerce.date(),note:ZOptEmptyString,text:ZOptEmptyString,_id:zod_default.string()})),important:zod_default.boolean().optional().default(!1),lastUpdate:zod_default.coerce.date(),link:ZOptEmptyString,note:ZOptEmptyString,tags:zod_default.array(zod_default.string()),title:ZOptEmptyString,type:ZOptEmptyString}),ZRaindrops=zod_default.object({count:zod_default.number(),items:zod_default.array(ZRaindrop)});esm_default(axios_default,{retries:3,retryCondition:error51=>error51.response&&error51.response.status===429?(new import_obsidian7.Notice("Too many requests, will retry sync after 1 minute",5),console.warn("Too many requests, will retry sync after 1 minute"),!0):(console.error(`request error: ${error51}`),!1),retryDelay:()=>6e4,onRetry:retryCount=>{new import_obsidian7.Notice(`Retry sync ${retryCount}/3`)}});var RaindropAPI=class{constructor(app){this.app=app,this.tokenManager=new TokenManager}async get(url2,params){let token=this.tokenManager.get();if(!token)throw new Error("Invalid token");let result=await axios_default.get(url2,{params,headers:{Authorization:`Bearer ${token}`,"Content-Type":"application/json"}});if(result.status==401)throw new Error("Unauthorized");if(result.status!==200)throw console.error("Raindrop API request failed:",result),new Error("Request failed");return result.data}async getCollections(enableCollectionGroup){let[rawRootCollections,rawNestedCollections]=await Promise.all([this.get(`${BASEURL}/collections`,{}),this.get(`${BASEURL}/collections/childrens`,{})]),collections=[...SYSTEM_COLLECTIONS],collectionGroupMap={};enableCollectionGroup&&(await this.getUser()).groups.forEach(g=>{g.collections.forEach(cid=>{collectionGroupMap[cid]=g.title})});let rootCollectionMap={};ZRootCollection.parse(rawRootCollections).items.forEach(collection=>{let id=collection._id,title=collection.title;enableCollectionGroup&&(title=`${collectionGroupMap[id]}/${title}`),rootCollectionMap[id]=title,collections.push({title,id,parentId:null})});let nestedCollectionMap={},nestedCollections=ZChildrenCollection.parse(rawNestedCollections);return nestedCollections.items.forEach(collection=>{var _a9,_b3;let id=collection._id;nestedCollectionMap[id]={title:collection.title,parentId:(_b3=(_a9=collection.parent)==null?void 0:_a9.$id)!=null?_b3:0}}),nestedCollections.items.forEach(collection=
<ul>
<li>The front matter property <code>raindrop_last_update</code> has now been replaced by <code>raindrop_highlights</code>, which stores the highlight signature for each highlight entry to fix the duplicate highlight entry bug in append mode.</li>
<li>The file name and front matter are now synced with templates while performing updates.</li>
</ul>
`),import_semver.default.lt(currentVersion,"0.0.18")&&(breakingChanges+=`<p>v0.0.18</p>
<ul>
<li>Date &amp; time format field is replaced by the <code>date</code> filter in template. Update <code>created</code> and <code>lastUpdate</code> in template accordingly.</li>
</ul>
`),breakingChanges!==""&&(this.contentEl.innerHTML=breakingChanges,this.open())}onClose(){super.onClose()}};var ZPluginSettings=zod_default.object({version:zod_default.string().optional().default(VERSION3),username:zod_default.string().optional(),isConnected:zod_default.boolean().optional().default(!1),ribbonIcon:zod_default.boolean().optional().default(!0),appendMode:zod_default.boolean().optional().default(!0),collectionsFolders:zod_default.boolean().optional().default(!0),onlyBookmarksWithHl:zod_default.boolean().optional().default(!1),syncDeleteFiles:zod_default.boolean().optional().default(!1),syncDeleteUseTrash:zod_default.boolean().optional().default(!0),highlightsFolder:zod_default.string().optional().default("/"),collectionGroups:zod_default.boolean().optional().default(!1),autoSyncSuccessNotice:zod_default.boolean().optional().default(!0),autoSyncAllCollections:zod_default.boolean().optional().default(!0),autoSyncNewNestedCollections:zod_default.boolean().optional().default(!1),syncCollections:zod_default.record(zod_default.string(),zod_default.object({id:zod_default.number(),title:zod_default.string(),sync:zod_default.boolean(),lastSyncDate:zod_default.coerce.date().optional(),parentId:zod_default.number().optional(),search:zod_default.string().optional()})).optional().default({}),template:zod_default.string().optional().default(defaultTemplate_default),metadataTemplate:zod_default.string().optional().default(""),filenameTemplate:zod_default.string().optional().default(defaultFilenameTemplate_default),preventMovingExistingFiles:zod_default.boolean().optional().default(!0),autoSyncInterval:zod_default.number().optional().default(0),autoescape:zod_default.boolean().optional().default(!0)});var import_semver2=__toESM(require_semver2()),RaindropPluginSettings=class{constructor(app,plugin){this._app=app,this._plugin=plugin,this._settings=DEFAULT_SETTINGS}get enableRibbonIcon(){return this._settings.ribbonIcon}async setEnableRibbonIcon(value){this._settings.ribbonIcon=value,await this.save()}get enableAppendMode(){return this._settings.appendMode}async setEnableAppendMode(value){this._settings.appendMode=value,await this.save()}get onlySyncBookmarksWithHl(){return this._settings.onlyBookmarksWithHl}async setOnlySyncBookmarksWithHl(value){this._settings.onlyBookmarksWithHl=value,await this.save()}get enablePreventMovingExistingFiles(){return this._settings.preventMovingExistingFiles}async setEnablePreventMovingExistingFiles(value){this._settings.preventMovingExistingFiles=value,await this.save()}get syncDeleteFiles(){return this._settings.syncDeleteFiles}async setSyncDeleteFiles(value){this._settings.syncDeleteFiles=value,await this.save()}get syncDeleteUseTrash(){return this._settings.syncDeleteUseTrash}async setSyncDeleteUseTrash(value){this._settings.syncDeleteUseTrash=value,await this.save()}get enableCollectionsFolders(){return this._settings.collectionsFolders}async setEnableCollectionsFolders(value){this._settings.collectionsFolders=value,await this.save()}get isConnected(){return this._settings.isConnected}get username(){return this._settings.username}async setIsConnected(connected,userName){this._settings.isConnected=connected,this._settings.username=userName,await this.save()}get highlightsFolder(){return this._settings.highlightsFolder}async setHighlightsFolder(path){this._settings.highlightsFolder=path,await this.save()}get enableCollectionGroups(){return this._settings.collectionGroups}async setEnableCollectionGroups(value){this._settings.collectionGroups=value,await this.save()}get contentTemplate(){return this._settings.template}async setContentTemplate(template){this._settings.template=template,await this.save()}get metadataTemplate(){return this._settings.metadataTemplate}async setMetadataTemplate(template){this._settings.metadataTemplate=template,await this.save()}get filenameTemplate(){return this._settings.filenameTemplate}async setFilenameTemplate(template){this._settings.filenameTemplate=template,await this.save()}get syncCollectionsList(){return Object.values(this._settings.syncCollections)}ge
`))}}),this.addCommand({id:"raindrop-open-link",name:"Open link in Raindrop",callback:async()=>{var _a9;let file2=this.app.workspace.getActiveFile();if(file2){let fmc=(_a9=this.app.metadataCache.getFileCache(file2))==null?void 0:_a9.frontmatter;try{let raindropId=zod_default.coerce.number().parse(fmc==null?void 0:fmc.raindrop_id),bookmark=await this.api.getRaindrop(raindropId);window.open(`https://app.raindrop.io/my/${bookmark.collectionId}/item/${bookmark.id}/edit`)}catch(e){new import_obsidian10.Notice("This is not a Raindrop bookmark file")}}else new import_obsidian10.Notice("No active file")}}),this.addCommand({id:"raindrop-manage-collection",name:"Manage collections to be synced",callback:async()=>{let notice=new import_obsidian10.Notice("Loading collections...");await this.raindropSync.syncCollectionMeta(),notice.hide(),new CollectionsModal(this.app,this)}}),this.addSettingTab(new RaindropSettingTab(this.app,this,this.api,this.settings)),this.settings.autoSyncInterval&&await this.startAutoSync()}async onunload(){this.clearAutoSync()}clearAutoSync(){this.timeoutIDAutoSync&&(window.clearTimeout(this.timeoutIDAutoSync),this.timeoutIDAutoSync=void 0),console.info("Clearing auto sync...")}async startAutoSync(minutes){let minutesToSync=minutes!=null?minutes:this.settings.autoSyncInterval;minutesToSync>0&&(this.timeoutIDAutoSync=window.setTimeout(async()=>{await this.raindropSync.sync({fullSync:!1}),await this.startAutoSync()},minutesToSync*6e4)),console.info(`StartAutoSync: this.timeoutIDAutoSync ${this.timeoutIDAutoSync} with ${minutesToSync} minutes`)}};
/*! Bundled license information:
nunjucks/browser/nunjucks.js:
(*! Browser bundle of nunjucks 3.2.4 *)
moment/moment.js:
(*! moment.js *)
(*! version : 2.30.1 *)
(*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
(*! license : MIT *)
(*! momentjs.com *)
*/
/* nosourcemap */