quartz-research-note/content/.obsidian/plugins/obsidian-zotero-desktop-connector/main.js

190 lines
973 KiB
JavaScript
Raw Normal View History

var tT=Object.create;var eo=Object.defineProperty;var aT=Object.getOwnPropertyDescriptor;var nT=Object.getOwnPropertyNames;var iT=Object.getPrototypeOf,rT=Object.prototype.hasOwnProperty;var O=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),oT=(e,t)=>{for(var a in t)eo(e,a,{get:t[a],enumerable:!0})},_m=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nT(t))!rT.call(e,i)&&i!==a&&eo(e,i,{get:()=>t[i],enumerable:!(n=aT(t,i))||n.enumerable});return e};var _e=(e,t,a)=>(a=e!=null?tT(iT(e)):{},_m(t||!e||!e.__esModule?eo(a,"default",{value:e,enumerable:!0}):a,e)),sT=e=>_m(eo({},"__esModule",{value:!0}),e);var Om=O((lD,Pm)=>{Pm.exports=Fm;Fm.sync=cT;var Tm=require("fs");function lT(e,t){var a=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var n=0;n<a.length;n++){var i=a[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function km(e,t,a){return!e.isSymbolicLink()&&!e.isFile()?!1:lT(t,a)}function Fm(e,t,a){Tm.stat(e,function(n,i){a(n,n?!1:km(i,e,t))})}function cT(e,t){return km(Tm.statSync(e),e,t)}});var Lm=O((cD,Bm)=>{Bm.exports=Nm;Nm.sync=uT;var Rm=require("fs");function Nm(e,t,a){Rm.stat(e,function(n,i){a(n,n?!1:jm(i,t))})}function uT(e,t){return jm(Rm.statSync(e),t)}function jm(e,t){return e.isFile()&&pT(e,t)}function pT(e,t){var a=e.mode,n=e.uid,i=e.gid,r=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),o=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),s=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=s|l,f=a&u||a&l&&i===o||a&s&&n===r||a&c&&r===0;return f}});var Dc=O((pD,Mm)=>{var uD=require("fs"),to;process.platform==="win32"||global.TESTING_WINDOWS?to=Om():to=Lm();Mm.exports=Mc;Mc.sync=dT;function Mc(e,t,a){if(typeof t=="function"&&(a=t,t={}),!a){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){Mc(e,t||{},function(r,o){r?i(r):n(o)})})}to(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),a(n,i)})}function dT(e,t){try{return to.sync(e,t||{})}catch(a){if(t&&t.ignoreErrors||a.code==="EACCES")return!1;throw a}}});var Vm=O((dD,Um)=>{var An=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Dm=require("path"),fT=An?";":":",Gm=Dc(),zm=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Hm=(e,t)=>{let a=t.colon||fT,n=e.match(/\//)||An&&e.match(/\\/)?[""]:[...An?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(a)],i=An?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",r=An?i.split(a):[""];return An&&e.indexOf(".")!==-1&&r[0]!==""&&r.unshift(""),{pathEnv:n,pathExt:r,pathExtExe:i}},Wm=(e,t,a)=>{typeof t=="function"&&(a=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:r}=Hm(e,t),o=[],s=u=>new Promise((c,f)=>{if(u===n.length)return t.all&&o.length?c(o):f(zm(e));let p=n[u],b=/^".*"$/.test(p)?p.slice(1,-1):p,d=Dm.join(b,e),h=!b&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;c(l(h,u,0))}),l=(u,c,f)=>new Promise((p,b)=>{if(f===i.length)return p(s(c+1));let d=i[f];Gm(u+d,{pathExt:r},(h,m)=>{if(!h&&m)if(t.all)o.push(u+d);else return p(u+d);return p(l(u,c,f+1))})});return a?s(0).then(u=>a(null,u),a):s(0)},mT=(e,t)=>{t=t||{};let{pathEnv:a,pathExt:n,pathExtExe:i}=Hm(e,t),r=[];for(let o=0;o<a.length;o++){let s=a[o],l=/^".*"$/.test(s)?s.slice(1,-1):s,u=Dm.join(l,e),c=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let f=0;f<n.length;f++){let p=c+n[f];try{if(Gm.sync(p,{pathExt:i}))if(t.all)r.push(p);else return p}catch(b){}}}if(t.all&&r.length)return r;if(t.nothrow)return null;throw zm(e)};Um.exports=Wm;Wm.sync=mT});var Zm=O((fD,Gc)=>{"use strict";var Jm=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Gc.exports=Jm;Gc.exports.default=Jm});var Ym=O((mD,$m)=>{"use strict";var qm=require("path"),hT=Vm(),vT=Zm();function Xm(e,t){let a=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,r=i&&process.chdir!==void 0&&!process.chdir.disabled;if(r)try{process
`:`
`.charCodeAt(),a=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===a&&(e=e.slice(0,e.length-1)),e}});var bh=O((SD,Xc)=>{"use strict";var vh=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Xc.exports=vh;Xc.exports.default=vh});var yh=O((CD,Fi)=>{"use strict";var ki=require("path"),gh=bh(),xh=e=>{e={cwd:process.cwd(),path:process.env[gh()],execPath:process.execPath,...e};let t,a=ki.resolve(e.cwd),n=[];for(;t!==a;)n.push(ki.join(a,"node_modules/.bin")),t=a,a=ki.resolve(a,"..");let i=ki.resolve(e.cwd,e.execPath,"..");return n.push(i),n.concat(e.path).join(ki.delimiter)};Fi.exports=xh;Fi.exports.default=xh;Fi.exports.env=e=>{e={env:process.env,...e};let t={...e.env},a=gh({env:t});return e.path=t[a],t[a]=Fi.exports(e),t}});var Eh=O((AD,$c)=>{"use strict";var wh=(e,t)=>{for(let a of Reflect.ownKeys(t))Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a));return e};$c.exports=wh;$c.exports.default=wh});var Ch=O((ID,no)=>{"use strict";var NT=Eh(),ao=new WeakMap,Sh=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let a,n=0,i=e.displayName||e.name||"<anonymous>",r=function(...o){if(ao.set(r,++n),n===1)a=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return a};return NT(r,e),ao.set(r,n),r};no.exports=Sh;no.exports.default=Sh;no.exports.callCount=e=>{if(!ao.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return ao.get(e)}});var Ah=O(io=>{"use strict";Object.defineProperty(io,"__esModule",{value:!0});io.SIGNALS=void 0;var jT=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",numbe
${n.message}`:h,x=[v,t,e].filter(Boolean).join(`
`);return m?(n.originalMessage=n.message,n.message=x):n=new Error(x),n.shortMessage=v,n.command=o,n.escapedCommand=s,n.exitCode=r,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,a!==void 0&&(n.all=a),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=u,n.killed=c&&!l,n};Ph.exports=ek});var Nh=O((OD,Kc)=>{"use strict";var oo=["stdin","stdout","stderr"],tk=e=>oo.some(t=>e[t]!==void 0),Rh=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return oo.map(n=>e[n]);if(tk(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${oo.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let a=Math.max(t.length,oo.length);return Array.from({length:a},(n,i)=>t[i])};Kc.exports=Rh;Kc.exports.node=e=>{let t=Rh(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}});var jh=O((RD,so)=>{so.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&so.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&so.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var tu=O((ND,Pn)=>{var ze=global.process,Ya=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};Ya(ze)?(Bh=require("assert"),kn=jh(),Lh=/^win/i.test(ze.platform),Pi=require("events"),typeof Pi!="function"&&(Pi=Pi.EventEmitter),ze.__signal_exit_emitter__?at=ze.__signal_exit_emitter__:(at=ze.__signal_exit_emitter__=new Pi,at.count=0,at.emitted={}),at.infinite||(at.setMaxListeners(1/0),at.infinite=!0),Pn.exports=function(e,t){if(!Ya(global.process))return function(){};Bh.equal(typeof e,"function","a callback must be provided for exit handler"),Fn===!1&&Qc();var a="exit";t&&t.alwaysLast&&(a="afterexit");var n=function(){at.removeListener(a,e),at.listeners("exit").length===0&&at.listeners("afterexit").length===0&&lo()};return at.on(a,e),n},lo=function(){!Fn||!Ya(global.process)||(Fn=!1,kn.forEach(function(t){try{ze.removeListener(t,co[t])}catch(a){}}),ze.emit=uo,ze.reallyExit=eu,at.count-=1)},Pn.exports.unload=lo,Ka=function(t,a,n){at.emitted[t]||(at.emitted[t]=!0,at.emit(t,a,n))},co={},kn.forEach(function(e){co[e]=function(){if(Ya(global.process)){var a=ze.listeners(e);a.length===at.count&&(lo(),Ka("exit",null,e),Ka("afterexit",null,e),Lh&&e==="SIGHUP"&&(e="SIGINT"),ze.kill(ze.pid,e))}}}),Pn.exports.signals=function(){return kn},Fn=!1,Qc=function(){Fn||!Ya(global.process)||(Fn=!0,at.count+=1,kn=kn.filter(function(t){try{return ze.on(t,co[t]),!0}catch(a){return!1}}),ze.emit=Dh,ze.reallyExit=Mh)},Pn.exports.load=Qc,eu=ze.reallyExit,Mh=function(t){Ya(global.process)&&(ze.exitCode=t||0,Ka("exit",ze.exitCode,null),Ka("afterexit",ze.exitCode,null),eu.call(ze,ze.exitCode))},uo=ze.emit,Dh=function(t,a){if(t==="exit"&&Ya(global.process)){a!==void 0&&(ze.exitCode=a);var n=uo.apply(this,arguments);return Ka("exit",ze.exitCode,null),Ka("afterexit",ze.exitCode,null),n}else return uo.apply(this,arguments)}):Pn.exports=function(){return function(){}};var Bh,kn,Lh,Pi,at,lo,Ka,co,Fn,Qc,eu,Mh,uo,Dh});var zh=O((jD,Gh)=>{"use strict";var ak=require("os"),nk=tu(),ik=1e3*5,rk=(e,t="SIGTERM",a={})=>{let n=e(t);return ok(e,t,a,n),n},ok=(e,t,a,n)=>{if(!sk(t,a,n))return;let i=ck(a),r=setTimeout(()=>{e("SIGKILL")},i);r.unref&&r.unref()},sk=(e,{forceKillAfterTimeout:t},a)=>lk(e)&&t!==!1&&a,lk=e=>e===ak.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",ck=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return ik;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},uk=(e,t)=>{e.kill()&&(t.isCanceled=!0)},pk=(e,t,a)=>{e.kill(t),a(Object.assign(new Er
/* [wrapped with `+t+`] */
`)}function GF(e,t){return t=t==null?Y5:t,!!t&&(typeof e=="number"||dF.test(e))&&e>-1&&e%1==0&&e<t}function zF(e){return!!t0&&t0 in e}function HF(e,t){for(var a=e.length,n=TF(t.length,a),i=RF(e);n--;){var r=t[n];e[n]=GF(r,a)?i[r]:void 0}return e}var m0=a0?function(e,t,a){var n=t+"";return a0(e,"toString",{configurable:!0,enumerable:!1,value:$F(DF(n,UF(MF(n),a)))})}:YF;function WF(e){if(e!=null){try{return u0.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function UF(e,t){return vF(Q5,function(a){var n="_."+a[0];t&a[1]&&!bF(e,n)&&e.push(n)}),e.sort()}function zu(e,t,a){t=a?void 0:t;var n=LF(e,an,void 0,void 0,void 0,void 0,void 0,t);return n.placeholder=zu.placeholder,n}function VF(e){var t=Gn(e)?p0.call(e):"";return t==eF||t==tF}function Gn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function JF(e){return!!e&&typeof e=="object"}function ZF(e){return typeof e=="symbol"||JF(e)&&p0.call(e)==aF}function qF(e){if(!e)return e===0?e:0;if(e=XF(e),e===Qg||e===-Qg){var t=e<0?-1:1;return t*K5}return e===e?e:0}function i0(e){var t=qF(e),a=t%1;return t===t?a?t-a:t:0}function XF(e){if(typeof e=="number")return e;if(ZF(e))return e0;if(Gn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Gn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(iF,"");var a=cF.test(e);return a||pF.test(e)?fF(e.slice(2),a?2:8):lF.test(e)?e0:+e}function $F(e){return function(){return e}}function YF(e){return e}zu.placeholder={};h0.exports=zu});var K0=O((cG,Y0)=>{"use strict";var{PassThrough:BP}=require("stream");Y0.exports=e=>{e={...e};let{array:t}=e,{encoding:a}=e,n=a==="buffer",i=!1;t?i=!(a||n):a=a||"utf8",n&&(a=null);let r=new BP({objectMode:i});a&&r.setEncoding(a);let o=0,s=[];return r.on("data",l=>{s.push(l),i?o=s.length:o+=l.length}),r.getBufferedValue=()=>t?s:n?Buffer.concat(s,o):s.join(""),r.getBufferedLength=()=>o,r}});var Q0=O((uG,Ki)=>{"use strict";var{constants:LP}=require("buffer"),MP=require("stream"),{promisify:DP}=require("util"),GP=K0(),zP=DP(MP.pipeline),xs=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Yu(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:a}=t,n=GP(t);return await new Promise((i,r)=>{let o=s=>{s&&n.getBufferedLength()<=LP.MAX_LENGTH&&(s.bufferedData=n.getBufferedValue()),r(s)};(async()=>{try{await zP(e,n),i()}catch(s){o(s)}})(),n.on("data",()=>{n.getBufferedLength()>a&&o(new xs)})}),n.getBufferedValue()}Ki.exports=Yu;Ki.exports.buffer=(e,t)=>Yu(e,{...t,encoding:"buffer"});Ki.exports.array=(e,t)=>Yu(e,{...t,array:!0});Ki.exports.MaxBufferError=xs});var Fx=O((ar,up)=>{(function(t,a){typeof ar=="object"&&typeof up=="object"?up.exports=a():typeof define=="function"&&define.amd?define([],a):typeof ar=="object"?ar.nunjucks=a():t.nunjucks=a()})(typeof self!="undefined"?self:ar,function(){return function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=t,a.d=function(n,i,r){a.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:r})},a.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(i,"a",i),i},a.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},a.p="",a(a.s=11)}([function(e,s,a){"use strict";var n=Array.prototype,i=Object.prototype,r={"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","\\":"&#92;"},o=/[&"'<>\\]/g,s=e.exports={};function l(T,j){return i.hasOwnProperty.call(T,j)}s.hasOwnProp=l;function u(T){return r[T]}function c(T,j,M){if(M.Update||(M=new s.TemplateError(M)),M.Update(T),!j){var D=M;M=new Error(D.message),M.name=D.name}return M}s._prettifyError=c;function f(T,j,M){var D,U;T instanceof Error&&(U=T,T=U.name+": "+U.message),Object.setPrototypeOf?(D=new Error(T),Object.setPrototypeOf(D,f.prototype)):(D=this,Object.defineProperty(D,"message",{enumerable:!1,writable:!0,value:T})),Object.defineProperty(D,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(D,th
`,this.firstUpdate&&(oe+=" "),this.message=oe+(this.message||""),this.firstUpdate=!1,this},D}Object.setPrototypeOf?Object.setPrototypeOf(f.prototype,Error.prototype):f.prototype=Object.create(Error.prototype,{constructor:{value:f}}),s.TemplateError=f;function p(T){return T.replace(o,u)}s.escape=p;function b(T){return i.toString.call(T)==="[object Function]"}s.isFunction=b;function d(T){return i.toString.call(T)==="[object Array]"}s.isArray=d;function h(T){return i.toString.call(T)==="[object String]"}s.isString=h;function m(T){return i.toString.call(T)==="[object Object]"}s.isObject=m;function v(T){return T?typeof T=="string"?T.split("."):[T]:[]}function x(T){var j=v(T);return function(D){for(var U=D,q=0;q<j.length;q++){var Z=j[q];if(l(U,Z))U=U[Z];else return}return U}}s.getAttrGetter=x;function E(T,j,M){for(var D={},U=b(j)?j:x(j),q=0;q<T.length;q++){var Z=T[q],pe=U(Z,q);if(pe===void 0&&M===!0)throw new TypeError('groupby: attribute "'+j+'" resolved to undefined');(D[pe]||(D[pe]=[])).push(Z)}return D}s.groupBy=E;function g(T){return Array.prototype.slice.call(T)}s.toArray=g;function w(T){var j=[];if(!T)return j;for(var M=T.length,D=g(arguments).slice(1),U=-1;++U<M;)P(D,T[U])===-1&&j.push(T[U]);return j}s.without=w;function C(T,j){for(var M="",D=0;D<j;D++)M+=T;return M}s.repeat=C;function y(T,j,M){if(T!=null){if(n.forEach&&T.forEach===n.forEach)T.forEach(j,M);else if(T.length===+T.length)for(var D=0,U=T.length;D<U;D++)j.call(M,T[D],D,T)}}s.each=y;function S(T,j){var M=[];if(T==null)return M;if(n.map&&T.map===n.map)return T.map(j);for(var D=0;D<T.length;D++)M[M.length]=j(T[D],D);return T.length===+T.length&&(M.length=T.length),M}s.map=S;function A(T,j,M){var D=-1;function U(){D++,D<T.length?j(T[D],D,U,M):M()}U()}s.asyncIter=A;function _(T,j,M){var D=F(T||{}),U=D.length,q=-1;function Z(){q++;var pe=D[q];q<U?j(pe,T[pe],q,U,Z):M()}Z()}s.asyncFor=_;function P(T,j,M){return Array.prototype.indexOf.call(T||[],j,M)}s.indexOf=P;function F(T){var j=[];for(var M in T)l(T,M)&&j.push(M);return j}s.keys=F;function N(T){return F(T).map(function(j){return[j,T[j]]})}s._entries=N;function B(T){return F(T).map(function(j){return T[j]})}s._values=B;function L(T,j){return T=T||{},F(j).forEach(function(M){T[M]=j[M]}),T}s._assign=s.extend=L;function k(T,j){if(d(j)||h(j))return j.indexOf(T)!==-1;if(m(j))return T in j;throw new Error('Cannot use "in" operator to search for "'+T+'" in unexpected types.')}s.inOperator=k},function(e,t,a){"use strict";function n(h,m){for(var v=0;v<m.length;v++){var x=m[v];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(h,r(x.key),x)}}function i(h,m,v){return m&&n(h.prototype,m),v&&n(h,v),Object.defineProperty(h,"prototype",{writable:!1}),h}function r(h){var m=o(h,"string");return typeof m=="symbol"?m:String(m)}function o(h,m){if(typeof h!="object"||h===null)return h;var v=h[Symbol.toPrimitive];if(v!==void 0){var x=v.call(h,m||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(h)}function s(h,m){h.prototype=Object.create(m.prototype),h.prototype.constructor=h,l(h,m)}function l(h,m){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,E){return x.__proto__=E,x},l(h,m)}var u=a(16),c=a(0);function f(h,m){return typeof h!="function"||typeof m!="function"?m:function(){var x=this.parent;this.parent=h;var E=m.apply(this,arguments);return this.parent=x,E}}function p(h,m,v){v=v||{},c.keys(v).forEach(function(E){v[E]=f(h.prototype[E],v[E])});var x=function(E){s(g,E);function g(){return E.apply(this,arguments)||this}return i(g,[{key:"typename",get:function(){return m}}]),g}(h);return c._assign(x.prototype,v),x}var b=function(){function h(){this.init.apply(this,arguments)}var m=h.prototype;return m.init=function(){},h.extend=function(x,E){return typeof x=="object"&&(E=x,x="anonymous"),p(this,x,E)},i(h,[{key:"typename",get:function(){return this.constructor.name}}]),h}(),d=function(h){s(m,h);function m(){var x,E;return E=h.call(this)||this,(x=E).init.apply(x,arguments)
`);ge.forEach(function(Ie,Xe){Ie&&(we&&Xe>0||!we)&&process.stdout.write(" ".repeat(ie));var St=Xe===ge.length-1?"":`
`;process.stdout.write(""+Ie+St)})}function _i(te,ie){if(ie=ie||0,Cn(te.typename+": ",ie),te instanceof d)Cn(`
`),te.children.forEach(function(Ie){_i(Ie,ie+2)});else if(te instanceof Bc)Cn(te.extName+"."+te.prop+`
`),te.args&&_i(te.args,ie+2),te.contentArgs&&te.contentArgs.forEach(function(Ie){_i(Ie,ie+2)});else{var we=[],ge=null;te.iterFields(function(Ie,Xe){Ie instanceof p?we.push([Xe,Ie]):(ge=ge||{},ge[Xe]=Ie)}),ge?Cn(JSON.stringify(ge,null,2)+`
`,null,!0):Cn(`
`),we.forEach(function(Ie){var Xe=Ie[0],St=Ie[1];Cn("["+Xe+"] =>",ie+2),_i(St,ie+4)})}}e.exports={Node:p,Root:h,NodeList:d,Value:b,Literal:m,Symbol:v,Group:x,Array:E,Pair:g,Dict:w,Output:X,Capture:$,TemplateData:he,If:y,IfAsync:S,InlineIf:A,For:_,AsyncEach:P,AsyncAll:F,Macro:N,Caller:B,Import:L,FromImport:k,FunCall:T,Filter:j,FilterAsync:M,KeywordArgs:D,Block:U,Super:q,Extends:pe,Include:fe,Set:ee,Switch:oe,Case:V,LookupVal:C,BinOp:Ge,In:vt,Is:R,Or:G,And:J,Not:H,Add:ne,Concat:K,Sub:Ae,Mul:ue,Div:je,FloorDiv:jt,Mod:Ut,Pow:Ta,Neg:Z_,Pos:q_,Compare:X_,CompareOperand:$_,CallExtension:Bc,CallExtensionAsync:Y_,printNodes:_i}},function(e,t){},function(e,t,a){"use strict";function n(m,v){m.prototype=Object.create(v.prototype),m.prototype.constructor=m,i(m,v)}function i(m,v){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,g){return E.__proto__=g,E},i(m,v)}var r=a(8),o=a(17),s=a(3),l=a(0),u=l.TemplateError,c=a(2),f=c.Frame,p=a(1),b=p.Obj,d={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},h=function(m){n(v,m);function v(){return m.apply(this,arguments)||this}var x=v.prototype;return x.init=function(g,w){this.templateName=g,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=w},x.fail=function(g,w,C){throw w!==void 0&&(w+=1),C!==void 0&&(C+=1),new u(g,w,C)},x._pushBuffer=function(){var g=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=g,this._emit("var "+this.buffer+' = "";'),g},x._popBuffer=function(){this.buffer=this.bufferStack.pop()},x._emit=function(g){this.codebuf.push(g)},x._emitLine=function(g){this._emit(g+`
`)},x._emitLines=function(){for(var g=this,w=arguments.length,C=new Array(w),y=0;y<w;y++)C[y]=arguments[y];C.forEach(function(S){return g._emitLine(S)})},x._emitFuncBegin=function(g,w){this.buffer="output",this._scopeClosers="",this._emitLine("function "+w+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+g.lineno+";"),this._emitLine("var colno = "+g.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},x._emitFuncEnd=function(g){g||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},x._addScopeLevel=function(){this._scopeClosers+="})"},x._closeScopeLevels=function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},x._withScopedSyntax=function(g){var w=this._scopeClosers;this._scopeClosers="",g.call(this),this._closeScopeLevels(),this._scopeClosers=w},x._makeCallback=function(g){var w=this._tmpid();return"function("+w+(g?","+g:"")+`) {
if(`+w+") { cb("+w+"); return; }"},x._tmpid=function(){return this.lastId++,"t_"+this.lastId},x._templateName=function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},x._compileChildren=function(g,w){var C=this;g.children.forEach(function(y){C.compile(y,w)})},x._compileAggregate=function(g,w,C,y){var S=this;C&&this._emit(C),g.children.forEach(function(A,_){_>0&&S._emit(","),S.compile(A,w)}),y&&this._emit(y)},x._compileExpression=function(g,w){this.assertType(g,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(g,w)},x.assertType=function(g){for(var w=arguments.length,C=new Array(w>1?w-1:0),y=1;y<w;y++)C[y-1]=arguments[y];C.some(function(S){return g instanceof S})||this.fail("assertType: invalid type: "+g.typename,g.lineno,g.colno)},x.compileCallExtension=function(g,w,C){var y=this,S=g.args,A=g.contentArgs,_=typeof g.autoescape=="boolean"?g.autoescape:!0;if(C||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+g.extName+'")["'+g.prop+'"]('),this._emit("context"),(S||A)&&this._emit(","),S&&(S instanceof s.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),S.children.forEach(function(F,N){y._compileExpression(F,w),(N!==S.children.length-1||A.length)&&y._emit(",")})),A.length&&A.forEach(function(F,N){if(N>0&&y._emit(","),F){y._emitLine("function(cb) {"),y._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var B=y._pushBuffer();y._withScopedSyntax(function(){y.compile(F,w),y._emitLine("cb(null, "+B+");")}),y._popBuffer(),y._emitLine("return "+B+";"),y._emitLine("}")}else y._emit("null")}),C){var P=this._tmpid();this._emitLine(", "+this._makeCallback(P)),this._emitLine(this.buffer+" += runtime.suppressValue("+P+", "+_+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+_+` && env.opts.autoescape);
`)},x.compileCallExtensionAsync=function(g,w){this.compileCallExtension(g,w,!0)},x.compileNodeList=function(g,w){this._compileChildren(g,w)},x.compileLiteral=function(g){if(typeof g.value=="string"){var w=g.value.replace(/\\/g,"\\\\");w=w.replace(/"/g,'\\"'),w=w.replace(/\n/g,"\\n"),w=w.replace(/\r/g,"\\r"),w=w.replace(/\t/g,"\\t"),w=w.replace(/\u2028/g,"\\u2028"),this._emit('"'+w+'"')}else g.value===null?this._emit("null"):this._emit(g.value.toString())},x.compileSymbol=function(g,w){var C=g.value,y=w.lookup(C);y?this._emit(y):this._emit('runtime.contextOrFrameLookup(context, frame, "'+C+'")')},x.compileGroup=function(g,w){this._compileAggregate(g,w,"(",")")},x.compileArray=function(g,w){this._compileAggregate(g,w,"[","]")},x.compileDict=function(g,w){this._compileAggregate(g,w,"{","}")},x.compilePair=function(g,w){var C=g.key,y=g.value;C instanceof s.Symbol?C=new s.Literal(C.lineno,C.colno,C.value):C instanceof s.Literal&&typeof C.value=="string"||this.fail("compilePair: Dict keys must be strings or names",C.lineno,C.colno),this.compile(C,w),this._emit(": "),this._compileExpression(y,w)},x.compileInlineIf=function(g,w){this._emit("("),this.compile(g.cond,w),this._emit("?"),this.compile(g.body,w),this._emit(":"),g.else_!==null?this.compile(g.else_,w):this._emit('""'),this._emit(")")},x.compileIn=function(g,w){this._emit("runtime.inOperator("),this.compile(g.left,w),this._emit(","),this.compile(g.right,w),this._emit(")")},x.compileIs=function(g,w){var C=g.right.name?g.right.name.value:g.right.value;this._emit('env.getTest("'+C+'").call(context, '),this.compile(g.left,w),g.right.args&&(this._emit(","),this.compile(g.right.args,w)),this._emit(") === true")},x._binOpEmitter=function(g,w,C){this.compile(g.left,w),this._emit(C),this.compile(g.right,w)},x.compileOr=function(g,w){return this._binOpEmitter(g,w," || ")},x.compileAnd=function(g,w){return this._binOpEmitter(g,w," && ")},x.compileAdd=function(g,w){return this._binOpEmitter(g,w," + ")},x.compileConcat=function(g,w){return this._binOpEmitter(g,w,' + "" + ')},x.compileSub=function(g,w){return this._binOpEmitter(g,w," - ")},x.compileMul=function(g,w){return this._binOpEmitter(g,w," * ")},x.compileDiv=function(g,w){return this._binOpEmitter(g,w," / ")},x.compileMod=function(g,w){return this._binOpEmitter(g,w," % ")},x.compileNot=function(g,w){this._emit("!"),this.compile(g.target,w)},x.compileFloorDiv=function(g,w){this._emit("Math.floor("),this.compile(g.left,w),this._emit(" / "),this.compile(g.right,w),this._emit(")")},x.compilePow=function(g,w){this._emit("Math.pow("),this.compile(g.left,w),this._emit(", "),this.compile(g.right,w),this._emit(")")},x.compileNeg=function(g,w){this._emit("-"),this.compile(g.target,w)},x.compilePos=function(g,w){this._emit("+"),this.compile(g.target,w)},x.compileCompare=function(g,w){var C=this;this.compile(g.expr,w),g.ops.forEach(function(y){C._emit(" "+d[y.type]+" "),C.compile(y.expr,w)})},x.compileLookupVal=function(g,w){this._emit("runtime.memberLookup(("),this._compileExpression(g.target,w),this._emit("),"),this._compileExpression(g.val,w),this._emit(")")},x._getNodeName=function(g){switch(g.typename){case"Symbol":return g.value;case"FunCall":return"the return value of ("+this._getNodeName(g.name)+")";case"LookupVal":return this._getNodeName(g.target)+'["'+this._getNodeName(g.val)+'"]';case"Literal":return g.value.toString();default:return"--expression--"}},x.compileFunCall=function(g,w){this._emit("(lineno = "+g.lineno+", colno = "+g.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(g.name,w),this._emit(', "'+this._getNodeName(g.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(g.args,w,"[","])"),this._emit(")")},x.compileFilter=function(g,w){var C=g.name;this.assertType(C,s.Symbol),this._emit('env.getFilter("'+C.value+'").call(context, '),this._compileAggregate(g.args,w),this._emit(")")},x.compileFilterAsync=function(g,w){var C=g.name,y=g.symbol.value;this.assertType(C,s.Symbol),w.set(y,y),this._emit('env.getFilter("'+C.value+'").call(context, '),this._compileAggregate(g.args,w),this._emitLine(", "
else {`),this._withScopedSyntax(function(){y.compile(g.else_,w),C&&y._emit("cb()")})):C&&(this._emitLine(`}
else {`),this._emit("cb()")),this._emitLine("}")},x.compileIfAsync=function(g,w){this._emit("(function(cb) {"),this.compileIf(g,w,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},x._emitLoopBindings=function(g,w,C,y){var S=this,A=[{name:"index",val:C+" + 1"},{name:"index0",val:C},{name:"revindex",val:y+" - "+C},{name:"revindex0",val:y+" - "+C+" - 1"},{name:"first",val:C+" === 0"},{name:"last",val:C+" === "+y+" - 1"},{name:"length",val:y}];A.forEach(function(_){S._emitLine('frame.set("loop.'+_.name+'", '+_.val+");")})},x.compileFor=function(g,w){var C=this,y=this._tmpid(),S=this._tmpid(),A=this._tmpid();if(w=w.push(),this._emitLine("frame = frame.push();"),this._emit("var "+A+" = "),this._compileExpression(g.arr,w),this._emitLine(";"),this._emit("if("+A+") {"),this._emitLine(A+" = runtime.fromIterator("+A+");"),g.name instanceof s.Array){this._emitLine("var "+y+";"),this._emitLine("if(runtime.isArray("+A+")) {"),this._emitLine("var "+S+" = "+A+".length;"),this._emitLine("for("+y+"=0; "+y+" < "+A+".length; "+y+"++) {"),g.name.children.forEach(function(k,T){var j=C._tmpid();C._emitLine("var "+j+" = "+A+"["+y+"]["+T+"];"),C._emitLine('frame.set("'+k+'", '+A+"["+y+"]["+T+"]);"),w.set(g.name.children[T].value,j)}),this._emitLoopBindings(g,A,y,S),this._withScopedSyntax(function(){C.compile(g.body,w)}),this._emitLine("}"),this._emitLine("} else {");var _=g.name.children,P=_[0],F=_[1],N=this._tmpid(),B=this._tmpid();w.set(P.value,N),w.set(F.value,B),this._emitLine(y+" = -1;"),this._emitLine("var "+S+" = runtime.keys("+A+").length;"),this._emitLine("for(var "+N+" in "+A+") {"),this._emitLine(y+"++;"),this._emitLine("var "+B+" = "+A+"["+N+"];"),this._emitLine('frame.set("'+P.value+'", '+N+");"),this._emitLine('frame.set("'+F.value+'", '+B+");"),this._emitLoopBindings(g,A,y,S),this._withScopedSyntax(function(){C.compile(g.body,w)}),this._emitLine("}"),this._emitLine("}")}else{var L=this._tmpid();w.set(g.name.value,L),this._emitLine("var "+S+" = "+A+".length;"),this._emitLine("for(var "+y+"=0; "+y+" < "+A+".length; "+y+"++) {"),this._emitLine("var "+L+" = "+A+"["+y+"];"),this._emitLine('frame.set("'+g.name.value+'", '+L+");"),this._emitLoopBindings(g,A,y,S),this._withScopedSyntax(function(){C.compile(g.body,w)}),this._emitLine("}")}this._emitLine("}"),g.else_&&(this._emitLine("if (!"+S+") {"),this.compile(g.else_,w),this._emitLine("}")),this._emitLine("frame = frame.pop();")},x._compileAsyncLoop=function(g,w,C){var y=this,S=this._tmpid(),A=this._tmpid(),_=this._tmpid(),P=C?"asyncAll":"asyncEach";if(w=w.push(),this._emitLine("frame = frame.push();"),this._emit("var "+_+" = runtime.fromIterator("),this._compileExpression(g.arr,w),this._emitLine(");"),g.name instanceof s.Array){var F=g.name.children.length;this._emit("runtime."+P+"("+_+", "+F+", function("),g.name.children.forEach(function(L){y._emit(L.value+",")}),this._emit(S+","+A+",next) {"),g.name.children.forEach(function(L){var k=L.value;w.set(k,k),y._emitLine('frame.set("'+k+'", '+k+");")})}else{var N=g.name.value;this._emitLine("runtime."+P+"("+_+", 1, function("+N+", "+S+", "+A+",next) {"),this._emitLine('frame.set("'+N+'", '+N+");"),w.set(N,N)}this._emitLoopBindings(g,_,S,A),this._withScopedSyntax(function(){var L;C&&(L=y._pushBuffer()),y.compile(g.body,w),y._emitLine("next("+S+(L?","+L:"")+");"),C&&y._popBuffer()});var B=this._tmpid();this._emitLine("}, "+this._makeCallback(B)),this._addScopeLevel(),C&&this._emitLine(this.buffer+" += "+B+";"),g.else_&&(this._emitLine("if (!"+_+".length) {"),this.compile(g.else_,w),this._emitLine("}")),this._emitLine("frame = frame.pop();")},x.compileAsyncEach=function(g,w){this._compileAsyncLoop(g,w)},x.compileAsyncAll=function(g,w){this._compileAsyncLoop(g,w,!0)},x._compileMacro=function(g,w){var C=this,y=[],S=null,A="macro_"+this._tmpid(),_=w!==void 0;g.args.children.forEach(function(k,T){T===g.args.children.length-1&&k instanceof s.Dict?S=k:(C.assertType(k,s.Symbol),y.push(k))});var P=[].concat(y.map(function(k){return"l_"+k.value}),["kwargs"]),F=y.map(function(k){return'"'+k.value+'"'}),N=(S&&S.children||[]).map(functio
`))})},x.compileRoot=function(g,w){var C=this;w&&this.fail("compileRoot: root node can't have frame"),w=new f,this._emitFuncBegin(g,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(g,w),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 y=[],S=g.findAll(s.Block);S.forEach(function(A,_){var P=A.name.value;if(y.indexOf(P)!==-1)throw new Error('Block "'+P+'" defined more than once.');y.push(P),C._emitFuncBegin(A,"b_"+P);var F=new f;C._emitLine("var frame = frame.push(true);"),C.compile(A.body,F),C._emitFuncEnd()}),this._emitLine("return {"),S.forEach(function(A,_){var P="b_"+A.name.value;C._emitLine(P+": "+P+",")}),this._emitLine(`root: root
};`)},x.compile=function(g,w){var C=this["compile"+g.typename];C?C.call(this,g,w):this.fail("compile: Cannot compile node: "+g.typename,g.lineno,g.colno)},x.getCode=function(){return this.codebuf.join("")},v}(b);e.exports={compile:function(v,x,E,g,w){w===void 0&&(w={});var C=new h(g,w.throwOnUndefined),y=(E||[]).map(function(A){return A.preprocess}).filter(function(A){return!!A}),S=y.reduce(function(A,_){return _(A)},v);return C.compile(o.transform(r.parse(S,E,w),x,g)),C.getCode()},Compiler:h}},function(e,t,a){"use strict";function n(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,i(l,u)}function i(l,u){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,p){return f.__proto__=p,f},i(l,u)}var r=a(4),o=a(1),s=o.EmitterObj;e.exports=function(l){n(u,l);function u(){return l.apply(this,arguments)||this}var c=u.prototype;return c.resolve=function(p,b){return r.resolve(r.dirname(p),b)},c.isRelative=function(p){return p.indexOf("./")===0||p.indexOf("../")===0},u}(s)},function(e,t,a){"use strict";function n(F,N){F.prototype=Object.create(N.prototype),F.prototype.constructor=F,i(F,N)}function i(F,N){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(L,k){return L.__proto__=k,L},i(F,N)}var r=a(12),o=a(15),s=a(0),l=a(5),u=a(18),c=a(10),f=c.FileSystemLoader,p=c.WebLoader,b=c.PrecompiledLoader,d=a(20),h=a(21),m=a(1),v=m.Obj,x=m.EmitterObj,E=a(2),g=E.handleError,w=E.Frame,C=a(22);function y(F,N,B){r(function(){F(N,B)})}var S={type:"code",obj:{root:function(N,B,L,k,T){try{T(null,"")}catch(j){T(g(j,null,null))}}}},A=function(F){n(N,F);function N(){return F.apply(this,arguments)||this}var B=N.prototype;return B.init=function(k,T){var j=this;T=this.opts=T||{},this.opts.dev=!!T.dev,this.opts.autoescape=T.autoescape!=null?T.autoescape:!0,this.opts.throwOnUndefined=!!T.throwOnUndefined,this.opts.trimBlocks=!!T.trimBlocks,this.opts.lstripBlocks=!!T.lstripBlocks,this.loaders=[],k?this.loaders=s.isArray(k)?k:[k]:f?this.loaders=[new f("views")]:p&&(this.loaders=[new p("/views")]),typeof window!="undefined"&&window.nunjucksPrecompiled&&this.loaders.unshift(new b(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=h(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],s._entries(u).forEach(function(M){var D=M[0],U=M[1];return j.addFilter(D,U)}),s._entries(d).forEach(function(M){var D=M[0],U=M[1];return j.addTest(D,U)})},B._initLoaders=function(){var k=this;this.loaders.forEach(function(T){T.cache={},typeof T.on=="function"&&(T.on("update",function(j,M){T.cache[j]=null,k.emit("update",j,M,T)}),T.on("load",function(j,M){k.emit("load",j,M,T)}))})},B.invalidateCache=function(){this.loaders.forEach(function(k){k.cache={}})},B.addExtension=function(k,T){return T.__name=k,this.extensions[k]=T,this.extensionsList.push(T),this},B.removeExtension=function(k){var T=this.getExtension(k);T&&(this.extensionsList=s.without(this.extensionsList,T),delete this.extensions[k])},B.getExtension=function(k){return this.extensions[k]},B.hasExtension=function(k){return!!this.extensions[k]},B.addGlobal=function(k,T){return this.globals[k]=T,this},B.getGlobal=function(k){if(typeof this.globals[k]=="undefined")throw new Error("global not found: "+k);return this.globals[k]},B.addFilter=function(k,T,j){var M=T;return j&&this.asyncFilters.push(k),this.filters[k]=M,this},B.getFilter=function(k){if(!this.filters[k])throw new Error("filter not found: "+k);return this.filters[k]},B.addTest=function(k,T){return this.tests[k]=T,this},B.getTest=function(k){if(!this.tests[k])throw new Error("test not found: "+k);return this.tests[k]},B.resolveTemplate=function(k,T,j){var M=k.isRelative&&T?k.isRelative(j):!1;return M&&k.resolve?k.resolve(T,j):j},B.getTemplate=function(k,T,j,M,D){var U=this,q=this,Z=null;if(k&&k.raw&&(k=k.raw),s.isFunction(j)&&(D=j,j=null,T=T||!1),s.isFunction(T)&&(D=T,T=!1),k instanceof P)Z=k;else{if(typeof k!="string")throw new Error("template names must be a string: "+k);for(var pe=0;pe<this.loaders.length;pe++){var fe=this.loaders[pe];if(Z=fe.cache[this.reso
\r\xA0`,r="()[]{}%*-+~/#,:|.<>=!",o="0123456789",s="{%",l="%}",u="{{",c="}}",f="{#",p="#}",b="string",d="whitespace",h="data",m="block-start",v="block-end",x="variable-start",E="variable-end",g="comment",w="left-paren",C="right-paren",y="left-bracket",S="right-bracket",A="left-curly",_="right-curly",P="operator",F="comma",N="colon",B="tilde",L="pipe",k="int",T="float",j="boolean",M="none",D="symbol",U="special",q="regex";function Z(fe,ee,oe,V){return{type:fe,value:ee,lineno:oe,colno:V}}var pe=function(){function fe(oe,V){this.str=oe,this.index=0,this.len=oe.length,this.lineno=0,this.colno=0,this.in_code=!1,V=V||{};var X=V.tags||{};this.tags={BLOCK_START:X.blockStart||s,BLOCK_END:X.blockEnd||l,VARIABLE_START:X.variableStart||u,VARIABLE_END:X.variableEnd||c,COMMENT_START:X.commentStart||f,COMMENT_END:X.commentEnd||p},this.trimBlocks=!!V.trimBlocks,this.lstripBlocks=!!V.lstripBlocks}var ee=fe.prototype;return ee.nextToken=function(){var V=this.lineno,X=this.colno,$;if(this.in_code){var he=this.current();if(this.isFinished())return null;if(he==='"'||he==="'")return Z(b,this._parseString(he),V,X);if($=this._extract(i))return Z(d,$,V,X);if(($=this._extractString(this.tags.BLOCK_END))||($=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(he=this.current(),he===`
`?this.forward():he==="\r"&&(this.forward(),he=this.current(),he===`
`?this.forward():this.back())),Z(v,$,V,X);if(($=this._extractString(this.tags.VARIABLE_END))||($=this._extractString("-"+this.tags.VARIABLE_END)))return this.in_code=!1,Z(E,$,V,X);if(he==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var qe="";!this.isFinished();)if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}else qe+=this.current(),this.forward();for(var Ge=["g","i","m","y"],vt="";!this.isFinished();){var R=Ge.indexOf(this.current())!==-1;if(R)vt+=this.current(),this.forward();else break}return Z(q,{body:qe,flags:vt},V,X)}else if(r.indexOf(he)!==-1){this.forward();var G=["==","===","!=","!==","<=",">=","//","**"],J=he+this.current(),H;switch(n.indexOf(G,J)!==-1&&(this.forward(),he=J,n.indexOf(G,J+this.current())!==-1&&(he=J+this.current(),this.forward())),he){case"(":H=w;break;case")":H=C;break;case"[":H=y;break;case"]":H=S;break;case"{":H=A;break;case"}":H=_;break;case",":H=F;break;case":":H=N;break;case"~":H=B;break;case"|":H=L;break;default:H=P}return Z(H,he,V,X)}else if($=this._extractUntil(i+r),$.match(/^[-+]?[0-9]+$/))if(this.current()==="."){this.forward();var ne=this._extract(o);return Z(T,$+"."+ne,V,X)}else return Z(k,$,V,X);else{if($.match(/^(true|false)$/))return Z(j,$,V,X);if($==="none")return Z(M,$,V,X);if($==="null")return Z(M,$,V,X);if($)return Z(D,$,V,X);throw new Error("Unexpected value while parsing: "+$)}}else{var K=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(($=this._extractString(this.tags.BLOCK_START+"-"))||($=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,Z(m,$,V,X);if(($=this._extractString(this.tags.VARIABLE_START+"-"))||($=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,Z(x,$,V,X);$="";var Ae,ue=!1;for(this._matches(this.tags.COMMENT_START)&&(ue=!0,$=this._extractString(this.tags.COMMENT_START));(Ae=this._extractUntil(K))!==null;)if($+=Ae,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!ue){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=$.length){var je=$.slice(-this.colno);if(/^\s+$/.test(je)&&($=$.slice(0,-this.colno),!$.length))return this.nextToken()}break}else if(this._matches(this.tags.COMMENT_END)){if(!ue)throw new Error("unexpected end of comment");$+=this._extractString(this.tags.COMMENT_END);break}else $+=this.current(),this.forward();if(Ae===null&&ue)throw new Error("expected end of comment, got end of file");return Z(ue?g:h,$,V,X)}},ee._parseString=function(V){this.forward();for(var X="";!this.isFinished()&&this.current()!==V;){var $=this.current();if($==="\\"){switch(this.forward(),this.current()){case"n":X+=`
`;break;case"t":X+=" ";break;case"r":X+="\r";break;default:X+=this.current()}this.forward()}else X+=$,this.forward()}return this.forward(),X},ee._matches=function(V){if(this.index+V.length>this.len)return null;var X=this.str.slice(this.index,this.index+V.length);return X===V},ee._extractString=function(V){return this._matches(V)?(this.forwardN(V.length),V):null},ee._extractUntil=function(V){return this._extractMatching(!0,V||"")},ee._extract=function(V){return this._extractMatching(!1,V)},ee._extractMatching=function(V,X){if(this.isFinished())return null;var $=X.indexOf(this.current());if(V&&$===-1||!V&&$!==-1){var he=this.current();this.forward();for(var qe=X.indexOf(this.current());(V&&qe===-1||!V&&qe!==-1)&&!this.isFinished();)he+=this.current(),this.forward(),qe=X.indexOf(this.current());return he}return""},ee._extractRegex=function(V){var X=this.currentStr().match(V);return X?(this.forwardN(X[0].length),X):null},ee.isFinished=function(){return this.index>=this.len},ee.forwardN=function(V){for(var X=0;X<V;X++)this.forward()},ee.forward=function(){this.index++,this.previous()===`
`?(this.lineno++,this.colno=0):this.colno++},ee.backN=function(V){for(var X=0;X<V;X++)this.back()},ee.back=function(){if(this.index--,this.current()===`
`){this.lineno--;var V=this.src.lastIndexOf(`
`,this.index-1);V===-1?this.colno=this.index:this.colno=this.index-V}else this.colno--},ee.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},ee.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},ee.previous=function(){return this.str.charAt(this.index-1)},fe}();e.exports={lex:function(ee,oe){return new pe(ee,oe)},TOKEN_STRING:b,TOKEN_WHITESPACE:d,TOKEN_DATA:h,TOKEN_BLOCK_START:m,TOKEN_BLOCK_END:v,TOKEN_VARIABLE_START:x,TOKEN_VARIABLE_END:E,TOKEN_COMMENT:g,TOKEN_LEFT_PAREN:w,TOKEN_RIGHT_PAREN:C,TOKEN_LEFT_BRACKET:y,TOKEN_RIGHT_BRACKET:S,TOKEN_LEFT_CURLY:A,TOKEN_RIGHT_CURLY:_,TOKEN_OPERATOR:P,TOKEN_COMMA:F,TOKEN_COLON:N,TOKEN_TILDE:B,TOKEN_PIPE:L,TOKEN_INT:k,TOKEN_FLOAT:T,TOKEN_BOOLEAN:j,TOKEN_NONE:M,TOKEN_SYMBOL:D,TOKEN_SPECIAL:U,TOKEN_REGEX:q}},function(e,t,a){"use strict";function n(u,c){u.prototype=Object.create(c.prototype),u.prototype.constructor=u,i(u,c)}function i(u,c){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,b){return p.__proto__=b,p},i(u,c)}var r=a(6),o=a(19),s=o.PrecompiledLoader,l=function(u){n(c,u);function c(p,b){var d;return d=u.call(this)||this,d.baseURL=p||".",b=b||{},d.useCache=!!b.useCache,d.async=!!b.async,d}var f=c.prototype;return f.resolve=function(b,d){throw new Error("relative templates not support in the browser yet")},f.getSource=function(b,d){var h=this,m=this.useCache,v;return this.fetch(this.baseURL+"/"+b,function(x,E){if(x)if(d)d(x.content);else if(x.status===404)v=null;else throw x.content;else v={src:E,path:b,noCache:!m},h.emit("load",b,v),d&&d(null,v)}),v},f.fetch=function(b,d){if(typeof window=="undefined")throw new Error("WebLoader can only by used in a browser");var h=new XMLHttpRequest,m=!0;h.onreadystatechange=function(){h.readyState===4&&m&&(m=!1,h.status===0||h.status===200?d(null,h.responseText):d({status:h.status,content:h.responseText}))},b+=(b.indexOf("?")===-1?"?":"&")+"s="+new Date().getTime(),h.open("GET",b,this.async),h.send()},c}(r);e.exports={WebLoader:l,PrecompiledLoader:s}},function(e,t,a){"use strict";var n=a(0),i=a(7),r=i.Environment,o=i.Template,s=a(6),l=a(10),u=a(23),c=a(5),f=a(8),p=a(9),b=a(2),d=a(3),h=a(25),m;function v(x,E){E=E||{},n.isObject(x)&&(E=x,x=null);var g;return l.FileSystemLoader?g=new l.FileSystemLoader(x,{watch:E.watch,noCache:E.noCache}):l.WebLoader&&(g=new l.WebLoader(x,{useCache:E.web&&E.web.useCache,async:E.web&&E.web.async})),m=new r(g,E),E&&E.express&&m.express(E.express),m}e.exports={Environment:r,Template:o,Loader:s,FileSystemLoader:l.FileSystemLoader,NodeResolveLoader:l.NodeResolveLoader,PrecompiledLoader:l.PrecompiledLoader,WebLoader:l.WebLoader,compiler:c,parser:f,lexer:p,runtime:b,lib:n,nodes:d,installJinjaCompat:h,configure:v,reset:function(){m=void 0},compile:function(E,g,w,C){return m||v(),new o(E,g,w,C)},render:function(E,g,w){return m||v(),m.render(E,g,w)},renderString:function(E,g,w){return m||v(),m.renderString(E,g,w)},precompile:u?u.precompile:void 0,precompileString:u?u.precompileString:void 0}},function(e,t,a){"use strict";var n=a(13),i=[],r=[],o=n.makeRequestCallFromTimer(s);function s(){if(r.length)throw r.shift()}e.exports=l;function l(c){var f;i.length?f=i.pop():f=new u,f.task=c,n(f)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(c){l.onerror?l.onerror(c):(r.push(c),o())}finally{this.task=null,i[i.length]=this}}},function(e,t,a){"use strict";(function(n){e.exports=i;function i(h){r.length||(s(),o=!0),r[r.length]=h}var r=[],o=!1,s,l=0,u=1024;function c(){for(;l<r.length;){var h=l;if(l=l+1,r[h].call(),l>u){for(var m=0,v=r.length-l;m<v;m++)r[m]=r[m+l];r.length-=l,l=0}}r.length=0,l=0,o=!1}var f=typeof n!="undefined"?n:self,p=f.MutationObserver||f.WebKitMutationObserver;typeof p=="function"?s=b(c):s=d(c),i.requestFlush=s;function b(h){var m=1,v=new p(h),x=document.createTextNode("");return v.observe(x,{characterData:!0}),function(){m=-m,x.data=m}}function d(h){return function(){var v=setTimeout(E,0),x=setInterval(E,50);function E(){clearTimeout(v),clearInterval(x),h()}}}i.makeRequestCallFromTimer=d}).call(t,a(14
`),ne=n.repeat(" ",G),K=H.map(function(Ae,ue){return ue===0&&!J?Ae:""+ne+Ae}).join(`
`);return i.copySafeness(R,K)}r.indent=E;function g(R,G,J){return G=G||"",J&&(R=n.map(R,function(H){return H[J]})),R.join(G)}r.join=g;function w(R){return R[R.length-1]}r.last=w;function C(R){var G=o(R,"");return G!==void 0?typeof Map=="function"&&G instanceof Map||typeof Set=="function"&&G instanceof Set?G.size:n.isObject(G)&&!(G instanceof i.SafeString)?n.keys(G).length:G.length:0}r.length=C;function y(R){if(n.isString(R))return R.split("");if(n.isObject(R))return n._entries(R||{}).map(function(G){var J=G[0],H=G[1];return{key:J,value:H}});if(n.isArray(R))return R;throw new n.TemplateError("list filter: type not iterable")}r.list=y;function S(R){return R=o(R,""),R.toLowerCase()}r.lower=S;function A(R){return R==null?"":i.copySafeness(R,R.replace(/\r\n|\n/g,`<br />
`))}r.nl2br=A;function _(R){return R[Math.floor(Math.random()*R.length)]}r.random=_;function P(R){function G(J,H,ne){H===void 0&&(H="truthy");var K=this,Ae=K.env.getTest(H);return n.toArray(J).filter(function(je){return Ae.call(K,je,ne)===R})}return G}r.reject=P(!1);function F(R,G){return R.filter(function(J){return!J[G]})}r.rejectattr=F,r.select=P(!0);function N(R,G){return R.filter(function(J){return!!J[G]})}r.selectattr=N;function B(R,G,J,H){var ne=R;if(G instanceof RegExp)return R.replace(G,J);typeof H=="undefined"&&(H=-1);var K="";if(typeof G=="number")G=""+G;else if(typeof G!="string")return R;if(typeof R=="number"&&(R=""+R),typeof R!="string"&&!(R instanceof i.SafeString))return R;if(G==="")return K=J+R.split("").join(J)+J,i.copySafeness(R,K);var Ae=R.indexOf(G);if(H===0||Ae===-1)return R;for(var ue=0,je=0;Ae>-1&&(H===-1||je<H);)K+=R.substring(ue,Ae)+J,ue=Ae+G.length,je++,Ae=R.indexOf(G,ue);return ue<R.length&&(K+=R.substring(ue)),i.copySafeness(ne,K)}r.replace=B;function L(R){var G;return n.isString(R)?G=y(R):G=n.map(R,function(J){return J}),G.reverse(),n.isString(R)?i.copySafeness(R,G.join("")):G}r.reverse=L;function k(R,G,J){G=G||0;var H=Math.pow(10,G),ne;return J==="ceil"?ne=Math.ceil:J==="floor"?ne=Math.floor:ne=Math.round,ne(R*H)/H}r.round=k;function T(R,G,J){for(var H=Math.floor(R.length/G),ne=R.length%G,K=[],Ae=0,ue=0;ue<G;ue++){var je=Ae+ue*H;ue<ne&&Ae++;var jt=Ae+(ue+1)*H,Ut=R.slice(je,jt);J&&ue>=ne&&Ut.push(J),K.push(Ut)}return K}r.slice=T;function j(R,G,J){return J===void 0&&(J=0),G&&(R=n.map(R,function(H){return H[G]})),J+R.reduce(function(H,ne){return H+ne},0)}r.sum=j,r.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(G,J,H,ne){var K=this,Ae=n.map(G,function(je){return je}),ue=n.getAttrGetter(ne);return Ae.sort(function(je,jt){var Ut=ne?ue(je):je,Ta=ne?ue(jt):jt;if(K.env.opts.throwOnUndefined&&ne&&(Ut===void 0||Ta===void 0))throw new TypeError('sort: attribute "'+ne+'" resolved to undefined');return!H&&n.isString(Ut)&&n.isString(Ta)&&(Ut=Ut.toLowerCase(),Ta=Ta.toLowerCase()),Ut<Ta?J?1:-1:Ut>Ta?J?-1:1:0}),Ae});function M(R){return i.copySafeness(R,R)}r.string=M;function D(R,G){R=o(R,"");var J=/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,H=q(R.replace(J,"")),ne="";return G?ne=H.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
`).replace(/\n\n\n+/g,`
`):ne=H.replace(/\s+/gi," "),i.copySafeness(R,ne)}r.striptags=D;function U(R){R=o(R,"");var G=R.split(" ").map(function(J){return u(J)});return i.copySafeness(R,G.join(" "))}r.title=U;function q(R){return i.copySafeness(R,R.replace(/^\s*|\s*$/g,""))}r.trim=q;function Z(R,G,J,H){var ne=R;if(R=o(R,""),G=G||255,R.length<=G)return R;if(J)R=R.substring(0,G);else{var K=R.lastIndexOf(" ",G);K===-1&&(K=G),R=R.substring(0,K)}return R+=H!=null?H:"...",i.copySafeness(ne,R)}r.truncate=Z;function pe(R){return R=o(R,""),R.toUpperCase()}r.upper=pe;function fe(R){var G=encodeURIComponent;if(n.isString(R))return G(R);var J=n.isArray(R)?R:n._entries(R);return J.map(function(H){var ne=H[0],K=H[1];return G(ne)+"="+G(K)}).join("&")}r.urlencode=fe;var ee=/^(?:\(|<|&lt;)?(.*?)(?:\.|,|\)|\n|&gt;)?$/,oe=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,V=/^https?:\/\/.*$/,X=/^www\./,$=/\.(?:org|net|com)(?:\:|\/|$)/;function he(R,G,J){s(G)&&(G=1/0);var H=J===!0?' rel="nofollow"':"",ne=R.split(/(\s+)/).filter(function(K){return K&&K.length}).map(function(K){var Ae=K.match(ee),ue=Ae?Ae[1]:K,je=ue.substr(0,G);return V.test(ue)?'<a href="'+ue+'"'+H+">"+je+"</a>":X.test(ue)?'<a href="http://'+ue+'"'+H+">"+je+"</a>":oe.test(ue)?'<a href="mailto:'+ue+'">'+ue+"</a>":$.test(ue)?'<a href="http://'+ue+'"'+H+">"+je+"</a>":K});return ne.join("")}r.urlize=he;function qe(R){R=o(R,"");var G=R?R.match(/\w+/g):null;return G?G.length:null}r.wordcount=qe;function Ge(R,G){var J=parseFloat(R);return s(J)?G:J}r.float=Ge;var vt=i.makeMacro(["value","default","base"],[],function(G,J,H){H===void 0&&(H=10);var ne=parseInt(G,H);return s(ne)?J:ne});r.int=vt,r.d=r.default,r.e=r.escape},function(e,t,a){"use strict";function n(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,i(s,l)}function i(s,l){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,f){return c.__proto__=f,c},i(s,l)}var r=a(6),o=function(s){n(l,s);function l(c){var f;return f=s.call(this)||this,f.precompiled=c||{},f}var u=l.prototype;return u.getSource=function(f){return this.precompiled[f]?{src:{type:"code",obj:this.precompiled[f]},path:f}:null},l}(r);e.exports={PrecompiledLoader:o}},function(e,t,a){"use strict";var n=a(2).SafeString;function i(_){return typeof _=="function"}t.callable=i;function r(_){return _!==void 0}t.defined=r;function o(_,P){return _%P===0}t.divisibleby=o;function s(_){return _ instanceof n}t.escaped=s;function l(_,P){return _===P}t.equalto=l,t.eq=t.equalto,t.sameas=t.equalto;function u(_){return _%2===0}t.even=u;function c(_){return!_}t.falsy=c;function f(_,P){return _>=P}t.ge=f;function p(_,P){return _>P}t.greaterthan=p,t.gt=t.greaterthan;function b(_,P){return _<=P}t.le=b;function d(_,P){return _<P}t.lessthan=d,t.lt=t.lessthan;function h(_){return _.toLowerCase()===_}t.lower=h;function m(_,P){return _!==P}t.ne=m;function v(_){return _===null}t.null=v;function x(_){return typeof _=="number"}t.number=x;function E(_){return _%2===1}t.odd=E;function g(_){return typeof _=="string"}t.string=g;function w(_){return!!_}t.truthy=w;function C(_){return _===void 0}t.undefined=C;function y(_){return _.toUpperCase()===_}t.upper=y;function S(_){return typeof Symbol!="undefined"?!!_[Symbol.iterator]:Array.isArray(_)||typeof _=="string"}t.iterable=S;function A(_){var P=_!=null&&typeof _=="object"&&!Array.isArray(_);return Set?P&&!(_ instanceof Set):P}t.mapping=A},function(e,t,a){"use strict";function n(o){var s=-1;return{current:null,reset:function(){s=-1,this.current=null},next:function(){return s++,s>=o.length&&(s=0),this.current=o[s],this.current}}}function i(o){o=o||",";var s=!0;return function(){var l=s?"":o;return s=!1,l}}function r(){return{range:function(s,l,u){typeof l=="undefined"?(l=s,s=0,u=1):u||(u=1);var c=[];if(u>0)for(var f=s;f<l;f+=u)c.push(f);else for(var p=s;p>l;p+=u)c.push(p);return c},cycler:function(){return n(Array.prototype.slice.call(arguments))},joiner:function(s){return i(s)}}}e.exports=r},function(e,t,a){var n=a(4);e.exports=function(r,o){function s(l,u){if(this.name=l,this.path=l,this.defaultEngine=u.defaultEngine,this.ext=n.e
`+u+`
})();
`,r.asFunction&&(o+="return function(ctx, cb) { return nunjucks.render("+l+`, ctx, cb); }
`),o+=`})();
`}return o}e.exports=n},function(e,t,a){function n(){"use strict";var i=this.runtime,r=this.lib,o=this.compiler.Compiler,s=this.parser.Parser,l=this.nodes,u=this.lexer,c=i.contextOrFrameLookup,f=i.memberLookup,p,b;o&&(p=o.prototype.assertType),s&&(b=s.prototype.parseAggregate);function d(){i.contextOrFrameLookup=c,i.memberLookup=f,o&&(o.prototype.assertType=p),s&&(s.prototype.parseAggregate=b)}i.contextOrFrameLookup=function(C,y,S){var A=c.apply(this,arguments);if(A!==void 0)return A;switch(S){case"True":return!0;case"False":return!1;case"None":return null;default:return}};function h(w){return{index:w.index,lineno:w.lineno,colno:w.colno}}if(l&&o&&s){var m=l.Node.extend("Slice",{fields:["start","stop","step"],init:function(C,y,S,A,_){S=S||new l.Literal(C,y,null),A=A||new l.Literal(C,y,null),_=_||new l.Literal(C,y,1),this.parent(C,y,S,A,_)}});o.prototype.assertType=function(C){C instanceof m||p.apply(this,arguments)},o.prototype.compileSlice=function(C,y){this._emit("("),this._compileExpression(C.start,y),this._emit("),("),this._compileExpression(C.stop,y),this._emit("),("),this._compileExpression(C.step,y),this._emit(")")},s.prototype.parseAggregate=function(){var C=this,y=h(this.tokens);y.colno--,y.index--;try{return b.apply(this)}catch(L){var S=h(this.tokens),A=function(){return r._assign(C.tokens,S),L};r._assign(this.tokens,y),this.peeked=!1;var _=this.peekToken();if(_.type!==u.TOKEN_LEFT_BRACKET)throw A();this.nextToken();for(var P=new m(_.lineno,_.colno),F=!1,N=0;N<=P.fields.length&&!this.skip(u.TOKEN_RIGHT_BRACKET);N++){if(N===P.fields.length)if(F)this.fail("parseSlice: too many slice components",_.lineno,_.colno);else break;if(this.skip(u.TOKEN_COLON))F=!0;else{var B=P.fields[N];P[B]=this.parseExpression(),F=this.skip(u.TOKEN_COLON)||F}}if(!F)throw A();return new l.Array(_.lineno,_.colno,[P])}}}function v(w,C,y,S){w=w||[],C===null&&(C=S<0?w.length-1:0),y===null?y=S<0?-1:w.length:y<0&&(y+=w.length),C<0&&(C+=w.length);for(var A=[],_=C;!(_<0||_>w.length||S>0&&_>=y||S<0&&_<=y);_+=S)A.push(i.memberLookup(w,_));return A}function x(w,C){return Object.prototype.hasOwnProperty.call(w,C)}var E={pop:function(C){if(C===void 0)return this.pop();if(C>=this.length||C<0)throw new Error("KeyError");return this.splice(C,1)},append:function(C){return this.push(C)},remove:function(C){for(var y=0;y<this.length;y++)if(this[y]===C)return this.splice(y,1);throw new Error("ValueError")},count:function(C){for(var y=0,S=0;S<this.length;S++)this[S]===C&&y++;return y},index:function(C){var y;if((y=this.indexOf(C))===-1)throw new Error("ValueError");return y},find:function(C){return this.indexOf(C)},insert:function(C,y){return this.splice(C,0,y)}},g={items:function(){return r._entries(this)},values:function(){return r._values(this)},keys:function(){return r.keys(this)},get:function(C,y){var S=this[C];return S===void 0&&(S=y),S},has_key:function(C){return x(this,C)},pop:function(C,y){var S=this[C];if(S===void 0&&y!==void 0)S=y;else{if(S===void 0)throw new Error("KeyError");delete this[C]}return S},popitem:function(){var C=r.keys(this);if(!C.length)throw new Error("KeyError");var y=C[0],S=this[y];return delete this[y],[y,S]},setdefault:function(C,y){return y===void 0&&(y=null),C in this||(this[C]=y),this[C]},update:function(C){return r._assign(this,C),null}};return g.iteritems=g.items,g.itervalues=g.values,g.iterkeys=g.keys,i.memberLookup=function(C,y,S){return arguments.length===4?v.apply(this,arguments):(C=C||{},r.isArray(C)&&x(E,y)?E[y].bind(C):r.isObject(C)&&x(g,y)?g[y].bind(C):f.apply(this,arguments))},d}e.exports=n}])})});var Bs=O((Ep,ay)=>{var js=require("buffer"),ea=js.Buffer;function ty(e,t){for(var a in e)t[a]=e[a]}ea.from&&ea.alloc&&ea.allocUnsafe&&ea.allocUnsafeSlow?ay.exports=js:(ty(js,Ep),Ep.Buffer=dn);function dn(e,t,a){return ea(e,t,a)}dn.prototype=Object.create(ea.prototype);ty(ea,dn);dn.from=function(e,t,a){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ea(e,t,a)};dn.alloc=function(e,t,a){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=ea(e);return t!==void 0?typeo
GFS4: `),console.error(e)});We[ut]||(yy=global[ut]||[],Ey(We,yy),We.close=function(e){function t(a,n){return e.call(We,a,function(i){i||wy(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,Gs,{value:e}),t}(We.close),We.closeSync=function(e){function t(a){e.apply(We,arguments),wy()}return Object.defineProperty(t,Gs,{value:e}),t}(We.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){fn(We[ut]),require("assert").equal(We[ut].length,0)}));var yy;global[ut]||Ey(global,We[ut]);_p.exports=Ap(i3(We));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!We.__patched&&(_p.exports=Ap(We),We.__patched=!0);function Ap(e){a3(e),e.gracefulify=Ap,e.createReadStream=w,e.createWriteStream=C;var t=e.readFile;e.readFile=a;function a(A,_,P){return typeof _=="function"&&(P=_,_=null),F(A,_,P);function F(N,B,L,k){return t(N,B,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?Zn([F,[N,B,L],T,k||Date.now(),Date.now()]):typeof L=="function"&&L.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=i;function i(A,_,P,F){return typeof P=="function"&&(F=P,P=null),N(A,_,P,F);function N(B,L,k,T,j){return n(B,L,k,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Zn([N,[B,L,k,T],M,j||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var r=e.appendFile;r&&(e.appendFile=o);function o(A,_,P,F){return typeof P=="function"&&(F=P,P=null),N(A,_,P,F);function N(B,L,k,T,j){return r(B,L,k,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Zn([N,[B,L,k,T],M,j||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=l);function l(A,_,P,F){return typeof P=="function"&&(F=P,P=0),N(A,_,P,F);function N(B,L,k,T,j){return s(B,L,k,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Zn([N,[B,L,k,T],M,j||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var u=e.readdir;e.readdir=f;var c=/^v[0-5]\./;function f(A,_,P){typeof _=="function"&&(P=_,_=null);var F=c.test(process.version)?function(L,k,T,j){return u(L,N(L,k,T,j))}:function(L,k,T,j){return u(L,k,N(L,k,T,j))};return F(A,_,P);function N(B,L,k,T){return function(j,M){j&&(j.code==="EMFILE"||j.code==="ENFILE")?Zn([F,[B,L,k],j,T||Date.now(),Date.now()]):(M&&M.sort&&M.sort(),typeof k=="function"&&k.call(this,j,M))}}}if(process.version.substr(0,4)==="v0.8"){var p=n3(e);v=p.ReadStream,E=p.WriteStream}var b=e.ReadStream;b&&(v.prototype=Object.create(b.prototype),v.prototype.open=x);var d=e.WriteStream;d&&(E.prototype=Object.create(d.prototype),E.prototype.open=g),Object.defineProperty(e,"ReadStream",{get:function(){return v},set:function(A){v=A},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return E},set:function(A){E=A},enumerable:!0,configurable:!0});var h=v;Object.defineProperty(e,"FileReadStream",{get:function(){return h},set:function(A){h=A},enumerable:!0,configurable:!0});var m=E;Object.defineProperty(e,"FileWriteStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});function v(A,_){return this instanceof v?(b.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function x(){var A=this;S(A.path,A.flags,A.mode,function(_,P){_?(A.autoClose&&A.destroy(),A.emit("error",_)):(A.fd=P,A.emit("open",P),A.read())})}function E(A,_){return this instanceof E?(d.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function g(){var A=this;S(A.path,A.flags,A.mode,function(_,P){_?(A.destroy(),A.emit("error",_)):(A.fd=P,A.emit("open",P))})}function w(A,_){return new e.ReadStream(A,_)}function C(A,_){return new e.WriteStream(A,_)}var y=e.open;e.open=S;function S(A,_,P,F){return typeof P=="function"&&(F=P,P=null),N(A,_,P,F);function N(B,L,k,T,j){return y(B,L,k,function(M,D){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Zn([N,[B,L,k,T],M,j||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}return e}function Zn(e){fn("ENQUEUE",e[0].name,e[1]),We[ut].push(e),Ip()}var Ds;function wy(){for(var e=Date.now(),t=0;t<We[ut].length;++t)We[ut][t].length>2&&(We[
`)),e.linkname&&(t+=$p(" linkpath="+e.linkname+`
`));var a=e.pax;if(a)for(var n in a)t+=$p(" "+n+"="+a[n]+`
`);return C6(t)};ti.decodePax=function(e){for(var t={};e.length;){for(var a=0;a<e.length&&e[a]!==32;)a++;var n=parseInt(e.slice(0,a).toString(),10);if(!n)return t;var i=e.slice(a+1,n-1).toString(),r=i.indexOf("=");if(r===-1)return t;t[i.slice(0,r)]=i.slice(r+1),e=e.slice(n)}return t};ti.encode=function(e){var t=A6(512),a=e.name,n="";if(e.typeflag===5&&a[a.length-1]!=="/"&&(a+="/"),Buffer.byteLength(a)!==a.length)return null;for(;Buffer.byteLength(a)>100;){var i=a.indexOf("/");if(i===-1)return null;n+=n?"/"+a.slice(0,i):a.slice(0,i),a=a.slice(i+1)}return Buffer.byteLength(a)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(a),t.write(Ga(e.mode&k6,6),100),t.write(Ga(e.uid,6),108),t.write(Ga(e.gid,6),116),t.write(Ga(e.size,11),124),t.write(Ga(e.mtime.getTime()/1e3|0,11),136),t[156]=y1+O6(e.type),e.linkname&&t.write(e.linkname,157),t.write(T6,257),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(Ga(e.devmajor||0,6),329),t.write(Ga(e.devminor||0,6),337),n&&t.write(n,345),t.write(Ga(E1(t),6),148),t)};ti.decode=function(e,t){var a=e[156]===0?0:e[156]-y1,n=ei(e,0,100,t),i=za(e,100,8),r=za(e,108,8),o=za(e,116,8),s=za(e,124,12),l=za(e,136,12),u=P6(a),c=e[157]===0?null:ei(e,157,100,t),f=ei(e,265,32),p=ei(e,297,32),b=za(e,329,8),d=za(e,337,8);e[345]&&(n=ei(e,345,155,t)+"/"+n),a===0&&n&&n[n.length-1]==="/"&&(a=5);var h=E1(e);if(h===8*32)return null;if(h!==za(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");return{name:n,mode:i,uid:r,gid:o,size:s,mtime:new Date(1e3*l),type:u,linkname:c,uname:f,gname:p,devmajor:b,devminor:d}}});var Kp=O((hH,A1)=>{"use strict";A1.exports=wa;var Qs=Da(),C1=Object.create(qn());C1.inherits=mn();C1.inherits(wa,Qs);function N6(e,t){var a=this._transformState;a.transforming=!1;var n=a.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));a.writechunk=null,a.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function wa(e){if(!(this instanceof wa))return new wa(e);Qs.call(this,e),this._transformState={afterTransform:N6.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",j6)}function j6(){var e=this;typeof this._flush=="function"?this._flush(function(t,a){S1(e,t,a)}):S1(this,null,null)}wa.prototype.push=function(e,t){return this._transformState.needTransform=!1,Qs.prototype.push.call(this,e,t)};wa.prototype._transform=function(e,t,a){throw new Error("_transform() is not implemented")};wa.prototype._write=function(e,t,a){var n=this._transformState;if(n.writecb=a,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};wa.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};wa.prototype._destroy=function(e,t){var a=this;Qs.prototype._destroy.call(this,e,function(n){t(n),a.emit("close")})};function S1(e,t,a){if(t)return e.emit("error",t);if(a!=null&&e.push(a),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var k1=O((vH,T1)=>{"use strict";T1.exports=fr;var I1=Kp(),_1=Object.create(qn());_1.inherits=mn();_1.inherits(fr,I1);function fr(e){if(!(this instanceof fr))return new fr(e);I1.call(this,e)}fr.prototype._transform=function(e,t,a){a(null,e)}});var ai=O((ta,F1)=>{ta=F1.exports=zp();ta.Stream=ta;ta.Readable=ta;ta.Writable=Up();ta.Duplex=Da();ta.Transform=Kp();ta.PassThrough=k1()});var L1=O((bH,B1)=>{var O1=require
${n.slice(0,77)}...`,e,a),this.name="ParseError",this.statusCode=t,this.statusMessage=ef.STATUS_CODES[this.statusCode]}};la.exports.HTTPError=class extends sa{constructor(e,t,a,n){t?t=t.replace(/\r?\n/g," ").trim():t=ef.STATUS_CODES[e],super(`Response code ${e} (${t})`,{},n),this.name="HTTPError",this.statusCode=e,this.statusMessage=t,this.headers=a}};la.exports.MaxRedirectsError=class extends sa{constructor(e,t,a){super("Redirected 10 times. Aborting.",{},a),this.name="MaxRedirectsError",this.statusCode=e,this.statusMessage=ef.STATUS_CODES[this.statusCode],this.redirectUrls=t}};la.exports.UnsupportedProtocolError=class extends sa{constructor(e){super(`Unsupported protocol "${e.protocol}"`,{},e),this.name="UnsupportedProtocolError"}};la.exports.CancelError=Pj.CancelError});var W2=O((aU,H2)=>{"use strict";var M2=require("events"),Rj=require("http"),Nj=require("https"),F2=require("stream").PassThrough,jj=require("stream").Transform,Pr=require("url"),P2=require("fs"),O2=require("querystring"),R2=VS(),Bj=JS(),Lj=n2(),xe=qd(),N2=jd(),Mj=o2(),Dj=l2(),Gj=u2(),zj=Ld(),j2=p2(),Hj=Dd(),Wj=f2(),Uj=E2(),Vj=Yd(),Jj=Qd(),B2=_2(),Nl=Bs().Buffer,L2=T2(),Zj=k2(),qj=new Set([300,301,302,303,304,305,307,308]),Xj=new Set([300,303,307,308]),tf=e=>xe.nodeStream(e)&&xe.function(e.getBoundary),$j=e=>{let t=e.body;return e.headers["content-length"]?Number(e.headers["content-length"]):!t&&!e.stream?0:xe.string(t)?Nl.byteLength(t):tf(t)?B2(t.getLength.bind(t))():t instanceof P2.ReadStream?B2(P2.stat)(t.path).then(a=>a.size):xe.nodeStream(t)&&xe.buffer(t._buffer)?t._buffer.length:null};function D2(e){e=e||{};let t=new M2,a=e.href||Pr.resolve(Pr.format(e),e.path),n=[],i=xe.object(e.agent)?e.agent:null,r=0,o,s,l=0,u=c=>{if(c.protocol!=="http:"&&c.protocol!=="https:"){t.emit("error",new tt.UnsupportedProtocolError(c));return}let f=c.protocol==="https:"?Nj:Rj;if(i){let h=c.protocol==="https:"?"https":"http";c.agent=i[h]||c.agent}if(c.useElectronNet&&process.versions.electron){let h=require("electron");f=h.net||h.remote.net}let p,d=new R2(f.request,c.cache)(c,h=>{clearInterval(p),t.emit("uploadProgress",{percent:1,transferred:l,total:s});let m=h.statusCode;h.url=o||a,h.requestUrl=a;let v=c.followRedirect&&"location"in h.headers,x=v&&qj.has(m);if(v&&Xj.has(m)||x&&(c.method==="GET"||c.method==="HEAD")){if(h.resume(),m===303&&(c.method="GET"),n.length>=10){t.emit("error",new tt.MaxRedirectsError(m,n,c),null,h);return}let g=Nl.from(h.headers.location,"binary").toString();o=Pr.resolve(Pr.format(c),g),n.push(o);let w=Object.assign({},c,Pr.parse(o));t.emit("redirect",h,w),u(w);return}setImmediate(()=>{try{Yj(h,c,t,n)}catch(g){t.emit("error",g)}})});d.on("error",h=>{h instanceof R2.RequestError?t.emit("error",new tt.RequestError(h,c)):t.emit("error",new tt.CacheError(h,c))}),d.once("request",h=>{let m=!1;h.once("abort",v=>{m=!0}),h.once("error",v=>{if(clearInterval(p),m)return;let x=c.retries(++r,v);if(x){setTimeout(u,x,c);return}t.emit("error",new tt.RequestError(v,c))}),t.once("request",v=>{t.emit("uploadProgress",{percent:0,transferred:0,total:s});let x=v.connection;if(x){let E=x.connecting===void 0?x._connecting:x.connecting,g=()=>{p=setInterval(()=>{if(x.destroyed){clearInterval(p);return}let C=l,y=v._header?Nl.byteLength(v._header):0;l=x.bytesWritten-y,s&&l>s&&(l=s),!(l===C||l===s)&&t.emit("uploadProgress",{percent:s?l/s:0,transferred:l,total:s})},150)};E?x.once("connect",g):g()}}),c.gotTimeout&&(clearInterval(p),Mj(h,c.gotTimeout)),setImmediate(()=>{t.emit("request",h)})})};return setImmediate(()=>{Promise.resolve($j(e)).then(c=>{s=c,xe.undefined(e.headers["content-length"])&&xe.undefined(e.headers["transfer-encoding"])&&tf(e.body)&&(e.headers["content-length"]=c),u(e)}).catch(c=>{t.emit("error",c)})}),t}function Yj(e,t,a,n){let i=Number(e.headers["content-length"])||null,r=0,o=new jj({transform(l,u,c){r+=l.length;let f=i?r/i:0;f<1&&a.emit("downloadProgress",{percent:f,transferred:r,total:i}),c(null,l)},flush(l){a.emit("downloadProgress",{percent:1,transferred:r,total:i}),l()}});Hj(e,o),o.redirectUrls=n;let s=t.decompress===!0&&xe.function(j2)&&t.method
`).filter(n=>!!n)){let[n,...i]=a.split("=");t[n]=i.join("=")}return t};async function fv(e){if(vo.default.platform==="win32")return vo.default.env;try{let{stdout:t}=await(0,dv.default)(e||pv,i4,{env:r4});return o4(t)}catch(t){if(e)throw t;return vo.default.env}}async function mv(){let{PATH:e}=await fv();return e}var La=require("obsidian");var Bi,Q,xv,s4,Qa,hv,yv,cu,wv,bo={},Ev=[],l4=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,yo=Array.isArray;function ma(e,t){for(var a in t)e[a]=t[a];return e}function Sv(e){var t=e.parentNode;t&&t.removeChild(e)}function se(e,t,a){var n,i,r,o={};for(r in t)r=="key"?n=t[r]:r=="ref"?i=t[r]:o[r]=t[r];if(arguments.length>2&&(o.children=arguments.length>3?Bi.call(arguments,2):a),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)o[r]===void 0&&(o[r]=e.defaultProps[r]);return Ni(e,o,n,i,null)}function Ni(e,t,a,n,i){var r={type:e,props:t,key:a,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++xv:i};return i==null&&Q.vnode!=null&&Q.vnode(r),r}function pu(){return{current:null}}function ot(e){return e.children}function Ct(e,t){this.props=e,this.context=t}function ji(e,t){if(t==null)return e.__?ji(e.__,e.__.__k.indexOf(e)+1):null;for(var a;t<e.__k.length;t++)if((a=e.__k[t])!=null&&a.__e!=null)return a.__e;return typeof e.type=="function"?ji(e):null}function Cv(e){var t,a;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((a=e.__k[t])!=null&&a.__e!=null){e.__e=e.__c.base=a.__e;break}return Cv(e)}}function uu(e){(!e.__d&&(e.__d=!0)&&Qa.push(e)&&!go.__r++||hv!==Q.debounceRendering)&&((hv=Q.debounceRendering)||yv)(go)}function go(){var e,t,a,n,i,r,o,s;for(Qa.sort(cu);e=Qa.shift();)e.__d&&(t=Qa.length,n=void 0,i=void 0,o=(r=(a=e).__v).__e,(s=a.__P)&&(n=[],(i=ma({},r)).__v=r.__v+1,du(s,r,i,a.__n,s.ownerSVGElement!==void 0,r.__h!=null?[o]:null,n,o==null?ji(r):o,r.__h),kv(n,r),r.__e!=o&&Cv(r)),Qa.length>t&&Qa.sort(cu));go.__r=0}function Av(e,t,a,n,i,r,o,s,l,u){var c,f,p,b,d,h,m,v=n&&n.__k||Ev,x=v.length;for(a.__k=[],c=0;c<t.length;c++)if((b=a.__k[c]=(b=t[c])==null||typeof b=="boolean"||typeof b=="function"?null:typeof b=="string"||typeof b=="number"||typeof b=="bigint"?Ni(null,b,null,null,b):yo(b)?Ni(ot,{children:b},null,null,null):b.__b>0?Ni(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)!=null){if(b.__=a,b.__b=a.__b+1,(p=v[c])===null||p&&b.key==p.key&&b.type===p.type)v[c]=void 0;else for(f=0;f<x;f++){if((p=v[f])&&b.key==p.key&&b.type===p.type){v[f]=void 0;break}p=null}du(e,b,p=p||bo,i,r,o,s,l,u),d=b.__e,(f=b.ref)&&p.ref!=f&&(m||(m=[]),p.ref&&m.push(p.ref,null,b),m.push(f,b.__c||d,b)),d!=null?(h==null&&(h=d),typeof b.type=="function"&&b.__k===p.__k?b.__d=l=Iv(b,l,e):l=_v(e,b,p,v,d,l),typeof a.type=="function"&&(a.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=ji(p))}for(a.__e=h,c=x;c--;)v[c]!=null&&(typeof a.type=="function"&&v[c].__e!=null&&v[c].__e==a.__d&&(a.__d=Tv(n).nextSibling),Pv(v[c],v[c]));if(m)for(c=0;c<m.length;c++)Fv(m[c],m[++c],m[++c])}function Iv(e,t,a){for(var n,i=e.__k,r=0;i&&r<i.length;r++)(n=i[r])&&(n.__=e,t=typeof n.type=="function"?Iv(n,t,a):_v(a,n,n,i,n.__e,t));return t}function Yt(e,t){return t=t||[],e==null||typeof e=="boolean"||(yo(e)?e.some(function(a){Yt(a,t)}):t.push(e)),t}function _v(e,t,a,n,i,r){var o,s,l;if(t.__d!==void 0)o=t.__d,t.__d=void 0;else if(a==null||i!=r||i.parentNode==null)e:if(r==null||r.parentNode!==e)e.appendChild(i),o=null;else{for(s=r,l=0;(s=s.nextSibling)&&l<n.length;l+=1)if(s==i)break e;e.insertBefore(i,r),o=r}return o!==void 0?o:i.nextSibling}function Tv(e){var t,a,n;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((a=e.__k[t])&&(n=Tv(a)))return n}return null}function c4(e,t,a,n,i){var r;for(r in a)r==="children"||r==="key"||r in t||xo(e,r,null,a[r],n);for(r in t)i&&typeof t[r]!="function"||r==="children"||r==="key"||r==="value"||r==="checked"||a[r]===t[r]||xo(e,r,t[r],a[r],n)}function vv(e,t,a){t[0]==="-"?e.setProperty(t,a==null?"":a):e[t]=a==null?"":typeof a!="number"||l4.test(t)?a:a+"px"}fu
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Le(e,t){return Pu(e)||Ou(e,t)||Hi(e,t)||Ru()}var Vu=_e(_g()),Hu=_e(Yg()),Wu=_e(v0());function b0(e){var t=e[0],a=e[1],n=e[2],i,r,o;return i=t*1+a*0+n*1.13983,r=t*1+a*-.39465+n*-.5806,o=t*1+a*2.02311+n*0,i=Math.min(Math.max(0,i),1),r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),[i*255,r*255,o*255]}function g0(e){var t=e[0]/255,a=e[1]/255,n=e[2]/255,i=t*.299+a*.587+n*.114,r=t*-.14713+a*-.28886+n*.436,o=t*.615+a*-.51499+n*-.10001;return[i,r,o]}function x0(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,n)}return a}function It(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?x0(Object(a),!0).forEach(function(n){Bt(e,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):x0(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))})}return e}var w0=Vu.default,y0=Object.keys(w0),KF=function(t){return t<.25?1:t<.5?.9-t:1.1-t},QF=function(t){var a=(0,Hu.default)(t),n=g0(a.array()),i=Le(n,3),r=i[0],o=i[1],s=i[2],l=[KF(r),o,s],u=b0(l);return Hu.default.rgb(u).hex()},zn=function(t){return function(a){return{className:[a.className,t.className].filter(Boolean).join(" "),style:It(It({},a.style||{}),t.style||{})}}},eP=function(t,a){if(t===void 0)return a;if(a===void 0)return t;var n=mt(t),i=mt(a);switch(n){case"string":switch(i){case"string":return[a,t].filter(Boolean).join(" ");case"object":return zn({className:t,style:a});case"function":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return zn({className:t})(a.apply(void 0,[r].concat(s)))}}break;case"object":switch(i){case"string":return zn({className:a,style:t});case"object":return It(It({},a),t);case"function":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return zn({style:t})(a.apply(void 0,[r].concat(s)))}}break;case"function":switch(i){case"string":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return t.apply(void 0,[zn(r)({className:a})].concat(s))};case"object":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return t.apply(void 0,[zn(r)({style:a})].concat(s))};case"function":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return t.apply(void 0,[a.apply(void 0,[r].concat(s))].concat(s))}}}},tP=function(t,a){var n=Object.keys(a);for(var i in t)n.indexOf(i)===-1&&n.push(i);return n.reduce(function(r,o){return r[o]=eP(t[o],a[o]),r},{})},aP=function(t,a){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];if(a===null)return t;Array.isArray(a)||(a=[a]);var o=a.map(function(l){return t[l]}).filter(Boolean),s=o.reduce(function(l,u){return typeof u=="string"?l.className=[l.className,u].filter(Boolean).join(" "):mt(u)==="object"?l.style=It(It({},l.style),u):typeof u=="function"&&(l=It(It({},l),u.apply(void 0,[l].concat(i)))),l},{className:"",style:{}});return s.className||delete s.className,Object.keys(s.style).length===0&&delete s.style,s},Uu=function(t){return Object.keys(t).reduce(function(a,n){return a[n]=/^base/.test(n)?QF(t[n]):n==="scheme"?t[n]+":inverted":t[n],a},{})},E0=(0,Wu.default)(function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.defaultBase16,i=n===void 0?w0:n,r=t.base16Themes,o=r===void 0?null:r,s=nP(a,o);s&&(a=It(It({},s),a));for(var l=y0.reduce(function(h,m){return h[m]=a[m]||i[m],h},{}),u=Object.keys(a).reduce(function(h,m){return y0.indexOf(m)===-1&&(h[m]=a[m]),h},{}),c=e(l),f=tP(u,c),p=arguments.length,b=new Array(p>3?p-3:0),d=3;d<p;d++)b[d-3]=arguments[d];return(0,Wu.default)(aP,2).apply(void 0,[f].concat(b))},3),S0=f
`:`
`.charCodeAt(),a=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===a&&(e=e.slice(0,-1)),e}var $i=_e(require("node:process"),1),Hn=_e(require("node:path"),1),k0=_e(require("node:url"),1);function hs(e={}){let{env:t=process.env,platform:a=process.platform}=e;return a!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}function dP(e={}){let{cwd:t=$i.default.cwd(),path:a=$i.default.env[hs()],execPath:n=$i.default.execPath}=e,i,r=t instanceof URL?k0.default.fileURLToPath(t):t,o=Hn.default.resolve(r),s=[];for(;i!==o;)s.push(Hn.default.join(o,"node_modules/.bin")),i=o,o=Hn.default.resolve(o,"..");return s.push(Hn.default.resolve(r,n,"..")),[...s,a].join(Hn.default.delimiter)}function F0({env:e=$i.default.env,...t}={}){e={...e};let a=hs({env:e});return t.path=e[a],e[a]=dP(t),e}var fP=(e,t,a,n)=>{if(a==="length"||a==="prototype"||a==="arguments"||a==="caller")return;let i=Object.getOwnPropertyDescriptor(e,a),r=Object.getOwnPropertyDescriptor(t,a);!mP(i,r)&&n||Object.defineProperty(e,a,r)},mP=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},hP=(e,t)=>{let a=Object.getPrototypeOf(t);a!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,a)},vP=(e,t)=>`/* Wrapped ${e}*/
${t}`,bP=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gP=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),xP=(e,t,a)=>{let n=a===""?"":`with ${a.trim()}() `,i=vP.bind(null,n,t.toString());Object.defineProperty(i,"name",gP),Object.defineProperty(e,"toString",{...bP,value:i})};function Zu(e,t,{ignoreNonConfigurable:a=!1}={}){let{name:n}=e;for(let i of Reflect.ownKeys(t))fP(e,t,i,a);return hP(e,t),xP(e,t,n),e}var vs=new WeakMap,P0=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let a,n=0,i=e.displayName||e.name||"<anonymous>",r=function(...o){if(vs.set(r,++n),n===1)a=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return a};return Zu(r,e),vs.set(r,n),r};P0.callCount=e=>{if(!vs.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return vs.get(e)};var O0=P0;var M0=require("node:os");var R0=()=>{let e=j0-N0+1;return Array.from({length:e},yP)},yP=(e,t)=>({name:`SIGRT${t+1}`,number:N0+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),N0=34,j0=64;var L0=require("node:os");var B0=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,
${n.message}`:h,x=[v,t,e].filter(Boolean).join(`
`);return m?(n.originalMessage=n.message,n.message=x):n=new Error(x),n.shortMessage=v,n.command=o,n.escapedCommand=s,n.exitCode=r,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,a!==void 0&&(n.all=a),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=u,n.killed=c&&!l,n};var bs=["stdin","stdout","stderr"],TP=e=>bs.some(t=>e[t]!==void 0),G0=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return bs.map(n=>e[n]);if(TP(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${bs.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let a=Math.max(t.length,bs.length);return Array.from({length:a},(n,i)=>t[i])};var z0=_e(require("node:os"),1),H0=_e(tu(),1),kP=1e3*5,W0=(e,t="SIGTERM",a={})=>{let n=e(t);return FP(e,t,a,n),n},FP=(e,t,a,n)=>{if(!PP(t,a,n))return;let i=RP(a),r=setTimeout(()=>{e("SIGKILL")},i);r.unref&&r.unref()},PP=(e,{forceKillAfterTimeout:t},a)=>OP(e)&&t!==!1&&a,OP=e=>e===z0.default.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",RP=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return kP;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},U0=(e,t)=>{e.kill()&&(t.isCanceled=!0)},NP=(e,t,a)=>{e.kill(t),a(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},V0=(e,{timeout:t,killSignal:a="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let i,r=new Promise((s,l)=>{i=setTimeout(()=>{NP(e,a,l)},t)}),o=n.finally(()=>{clearTimeout(i)});return Promise.race([r,o])},J0=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Z0=async(e,{cleanup:t,detached:a},n)=>{if(!t||a)return n;let i=(0,H0.default)(()=>{e.kill()});return n.finally(()=>{i()})};var q0=require("node:fs"),X0=require("node:child_process");function gs(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Xu(e){return gs(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}var jP=e=>e instanceof X0.ChildProcess&&typeof e.then=="function",$u=(e,t,a)=>{if(typeof a=="string")return e[t].pipe((0,q0.createWriteStream)(a)),e;if(Xu(a))return e[t].pipe(a),e;if(!jP(a))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Xu(a.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(a.stdin),a},$0=e=>{e.stdout!==null&&(e.pipeStdout=$u.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=$u.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=$u.bind(void 0,e,"all"))};var ys=require("node:fs");var ep=_e(Q0(),1),ex=_e(nu(),1),tx=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},HP=({input:e,inputFile:t})=>typeof t!="string"?e:(tx(e),(0,ys.readFileSync)(t)),ax=e=>{let t=HP(e);if(gs(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},WP=({input:e,inputFile:t})=>typeof t!="string"?e:(tx(e),(0,ys.createReadStream)(t)),nx=(e,t)=>{let a=WP(t);a!==void 0&&(gs(a)?a.pipe(e.stdin):e.stdin.end(a))},ix=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let a=(0,ex.default)();return e.stdout&&a.add(e.stdout),e.stderr&&a.add(e.stderr),a},Ku=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(a){return a.bufferedData}}},Qu=(e,{encoding:t,buffer:a,maxBuffer:n})=>{if(!(!e||!a))return t?(0,ep.default)(e,{encoding:t,maxBuffer:n}):ep.default.buffer(e,{maxBuffer:n})},rx=async({stdout:e,stderr:t,all:a},{encoding:n,buffer:i,maxBuffer:r},o)=>{let s=Qu(e,{encoding:n,buffer:i,maxBuffer:r}),l=Qu(t,{encoding:n,buffer:i,maxBuffer:r}),u=Qu(a,{encoding:n,buffer:i,maxBuffer:r*2});try{return await Promise.all([o,s,l,u])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},Ku(e,s),Ku(t,l),Ku(a,u)])}};
`)};var KP=1e3*1e3*100,QP=({env:e,extendEnv:t,preferLocal:a,localDir:n,execPath:i})=>{let r=t?{...Qi.default.env,...e}:e;return a?F0({env:r,cwd:n,execPath:i}):r},xx=(e,t,a={})=>{let n=gx.default._parse(e,t,a);return e=n.command,t=n.args,a=n.options,a={maxBuffer:KP,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:a.cwd||Qi.default.cwd(),execPath:Qi.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:mx,...a},a.env=QP(a),a.stdio=G0(a),Qi.default.platform==="win32"&&bx.default.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:a,parsed:n}},er=(e,t,a)=>typeof t!="string"&&!vx.Buffer.isBuffer(t)?a===void 0?void 0:"":e.stripFinalNewline?Ju(t):t;function tr(e,t,a){let n=xx(e,t,a),i=ap(e,t),r=np(e,t);rp(r,n.options),J0(n.options);let o;try{o=Es.default.spawn(n.file,n.args,n.options)}catch(b){let d=new Es.default.ChildProcess,h=Promise.reject(Yi({error:b,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return tp(d,h),d}let s=ox(o),l=V0(o,n.options,s),u=Z0(o,n.options,l),c={isCanceled:!1};o.kill=W0.bind(null,o.kill.bind(o)),o.cancel=U0.bind(null,o,c);let p=O0(async()=>{let[{error:b,exitCode:d,signal:h,timedOut:m},v,x,E]=await rx(o,n.options,u),g=er(n.options,v),w=er(n.options,x),C=er(n.options,E);if(b||d!==0||h!==null){let y=Yi({error:b,exitCode:d,signal:h,stdout:g,stderr:w,all:C,command:i,escapedCommand:r,parsed:n,timedOut:m,isCanceled:c.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:o.killed});if(!n.options.reject)return y;throw y}return{command:i,escapedCommand:r,exitCode:0,stdout:g,stderr:w,all:C,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return nx(o,n.options),o.all=ix(o,n.options),$0(o),tp(o,p),o}function eO(e,t,a){let n=xx(e,t,a),i=ap(e,t),r=np(e,t);rp(r,n.options);let o=ax(n.options),s;try{s=Es.default.spawnSync(n.file,n.args,{...n.options,input:o})}catch(c){throw Yi({error:c,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let l=er(n.options,s.stdout,s.error),u=er(n.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let c=Yi({stdout:l,stderr:u,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:r,parsed:n,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!n.options.reject)return c;throw c}return{command:i,escapedCommand:r,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var tO=({input:e,inputFile:t,stdio:a})=>e===void 0&&t===void 0&&a===void 0?{stdin:"inherit"}:{},hx=(e={})=>({preferLocal:!0,...tO(e),...e});function yx(e){function t(a,...n){if(!Array.isArray(a))return yx({...e,...a});let[i,...r]=ip(a,n);return tr(i,r,hx(e))}return t.sync=(a,...n)=>{if(!Array.isArray(a))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[i,...r]=ip(a,n);return eO(i,r,hx(e))},t}var kG=yx();var ct=_e(require("fs")),op=require("obsidian"),rn=_e(require("os")),Lt=_e(require("path"));function sp(){return require("electron").remote.BrowserWindow.getFocusedWindow()}function lp(e){return e<10?`0${e}`:e.toString()}function on(){return app.vault.adapter.getBasePath()}function _t(){return Lt.default.join(on(),"./.obsidian/plugins/obsidian-zotero-desktop-connector/")}function sn(){return rn.default.platform()==="win32"?"pdfannots2json.exe":`pdfannots2json-${rn.default.platform()}-${rn.default.arch()}`}function wx(){rn.default.platform()!=="win32"&&ct.default.renameSync(Lt.default.join(_t(),cp()),Lt.default.join(_t(),sn()))}function cp(){return rn.default.platform()==="win32"?"pdfannots2json.exe":"pdfannots2json"}function Ex(){return rn.default.platform()==="win32"?"pdf-annots2json.exe":"pdf-annots2json"}function Wn(e){return e?ct.default.existsSync(e):ct.default.existsSync(Lt.default.join(_t(),sn()))}function Sx(e){return e?ct.default.existsSync(e):ct.default.existsSync(Lt.default.join(_t(),cp()))}function Cx(){return ct.default.existsSync(Lt.default.join(_t(),Ex()))}function Ax(){ct.default.rmSync(Lt.default
{%- if creators and creators.length > 0 -%}
{%- for creator in creators -%}
{%- if creator.name -%}
{{creator.name}}
{%- else -%}
{{creator.firstName}} {{creator.lastName}}
{%- endif -%}
{% if not loop.last %}, {% endif %}
{%- endfor -%}
{%- endif -%}
`,uO=`
{%- if attachments and attachments.length > 0 -%}
{%- set file = attachments | filterby("path", "endswith", ".pdf") | first -%}
{%- if file and file.path and file.path.endsWith(".pdf") -%}
[{{file.title}}](file://{{file.path | replace(" ", "%20")}})
{%- endif -%}
{%- endif -%}
`,pO=`
{%- if attachments and attachments.length > 0 -%}
{%- set file = attachments | filterby("path", "endswith", ".pdf") | first -%}
{%- if file and file.path and file.path.endsWith(".pdf") -%}
[{{file.title}}]({{file.desktopURI}})
{%- endif -%}
{%- endif -%}
`,Ox=`
{%- if annotations and annotations.length > 0 -%}
{%- set annots = annotations | filterby("date", "dateafter", lastExportDate) -%}
{%- if annots.length > 0 %}
**Imported: {{importDate | format("YYYY-MM-DD")}}**
{% for annotation in annots -%}
{%- if annotation.annotatedText -%}
> \u201C{{annotation.annotatedText}}\u201D{% if annotation.color %} {{annotation.colorCategory}} {{annotation.type | capitalize}} {% else %} {{annotation.type | capitalize}} {% endif %}[Page {{annotation.page}}]({{annotation.attachment.desktopURI.replace("select", "open-pdf")}}?page={{annotation.pageLabel}}&annotation={{annotation.id}})
{%- endif %}
{%- if annotation.imageRelativePath -%}
> ![[{{annotation.imageRelativePath}}]]
{%- endif %}
{% if annotation.comment %}
{{annotation.comment}}
{% endif %}
{% endfor -%}
{%- endif -%}
{%- endif -%}
`;async function Vn(e,t){var r,o,s;if(!t)return t;let a=(t.creators||[]).reduce((l,u)=>(l[u.creatorType]||(l[u.creatorType]=[]),l[u.creatorType].push(u),l),{});await Promise.all(Object.keys(a).map(async l=>{t[`${l}s`]=(await nt(e,cO,{creators:a[l]})).trim()}));let n=(await nt(e,uO,t)).trim();n&&(t.pdfLink=n);let i=(await nt(e,pO,t)).trim();if(i&&(t.pdfZoteroLink=i),(r=t.notes)!=null&&r.length){let l=t.notes.reduce((u,c)=>c.note?`${u}
${c.note.trim()}`:u,"").trim();l&&(t.markdownNotes=l)}return(o=t.tags)!=null&&o.length&&(t.allTags=t.tags.map(l=>l.tag).join(", "),t.hashTags=t.tags.map(l=>`#${l.tag.replace(/\s+/g,"-")}`).join(", ")),(s=t.annotations)!=null&&s.length&&(t.formattedAnnotationsNew=(await nt(e,Ox,t)).trim(),t.formattedAnnotations=(await nt(e,Ox,{...t,lastExportDate:(0,Rx.moment)(0)})).trim()),t}var Na=require("obsidian");var Nx=require("obsidian"),it=class extends Nx.Modal{constructor(a,n){super(a);this.message=n}onOpen(){this.contentEl.createDiv({text:this.message})}onClose(){this.contentEl.empty()}};var As=_e(require("path")),Mt={"Content-Type":"application/json","User-Agent":"obsidian/zotero",Accept:"application/json",Connection:"keep-alive"};function Dt(e,t){return e==="Zotero"?"23119":e==="Juris-M"?"24119":t||"23119"}async function nr(e){let t=As.default.dirname(e);await app.vault.adapter.exists(t)||await app.vault.createFolder(t)}var dO=/\s*[*?]+\s*/g,fO=/\s*[:"<>|]+\s*/g;function jx(e){return e.replace(dO," ").trim().replace(fO," - ").trim()}function va(e){let t=As.default.parse(e),a=jx(t.dir),n=jx(t.name);return As.default.join(a,`${n}${t.ext}`)}function mO(e){let t="0",a="0",n="0";e.length==4?(t="0x"+e[1]+e[1],a="0x"+e[2]+e[2],n="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],a="0x"+e[3]+e[4],n="0x"+e[5]+e[6]);let i=+t/255,r=+a/255,o=+n/255,s=Math.min(i,r,o),l=Math.max(i,r,o),u=l-s,c=0,f=0,p=0;return u==0?c=0:l==i?c=(r-o)/u%6:l==r?c=(o-i)/u+2:c=(i-r)/u+4,c=Math.round(c*60),c<0&&(c+=360),p=(l+s)/2,f=u==0?0:u/(1-Math.abs(2*p-1)),f=+(f*100).toFixed(1),p=+(p*100).toFixed(1),{h:c,s:f,l:p}}function Bx(e){let{h:t,s:a,l:n}=mO(e);return n<12?"Black":n>98?"White":a<2?"Gray":t<15?"Red":t<45?"Orange":t<65?"Yellow":t<170?"Green":t<190?"Cyan":t<263?"Blue":t<280?"Purple":t<335?"Magenta":"Red"}function ba(e,t,a){let n=t.split("/").pop(),i=`zotero://${e}`,r="";if(/group/.test(t)?r=t.replace("http://zotero.org",i):r=`${i}/library/items/${n}`,a){let o=new URLSearchParams(a);r+=`?${o}`}return r}var Oe=require("obsidian");var dp=class e{constructor(t){this.compare=t;this.heapArray=[];this._limit=0}static getChildrenIndexOf(t){return[t*2+1,t*2+2]}static getParentIndexOf(t){if(t<=0)return-1;let a=t%2?1:2;return Math.floor((t-a)/2)}push(t){return this._sortNodeUp(this.heapArray.push(t)-1),!0}length(){return this.heapArray.length}peek(){return this.heapArray[0]}pop(){let t=this.heapArray.pop();return this.length()>0&&t!==void 0?this.replace(t):t}replace(t){let a=this.heapArray[0];return this.heapArray[0]=t,this._sortNodeDown(0),a}size(){return this.length()}_moveNode(t,a){[this.heapArray[t],this.heapArray[a]]=[this.heapArray[a],this.heapArray[t]]}_sortNodeDown(t){let a=t<this.heapArray.length-1,n=this.heapArray[t],i=(r,o)=>(this.heapArray.length>o&&this.compare(this.heapArray[o],this.heapArray[r])<0&&(r=o),r);for(;a;){let r=e.getChildrenIndexOf(t),o=r.reduce(i,r[0]),s=this.heapArray[o];typeof s!="undefined"&&this.compare(n,s)>0?(this._moveNode(t,o),t=o):a=!1}}_sortNodeUp(t){let a=t>0;for(;a;){let n=e.getParentIndexOf(t);n>=0&&this.compare(this.heapArray[n],this.heapArray[t])>0?(this._moveNode(t,n),t=n):a=!1}}};function hO(e,t){return e.prio-t.prio||e.counter-t.counter}var fp=class{constructor(t,a){this.maxConcurrent=t||1,this.minCycle=a||0,this.queueRunning=new Map,this.queueWaiting=new dp(hO),this.lastRun=0,this.nextTimer=null,this.counter=0}tryRun(){for(;this.queueWaiting.size()>0&&this.queueRunning.size<this.maxConcurrent;){if(Date.now()-this.lastRun<this.minCycle){this.nextTimer===null&&(this.nextTimer=new Promise(a=>activeWindow.setTimeout(()=>{this.nextTimer=null,this.tryRun(),a()},this.minCycle-Date.now()+this.lastRun)));return}let t=this.queueWaiting.pop();if(t!==void 0){let a,i={wait:new Promise(o=>{a=o}),signal:a},r={hash:t.hash,prio:t.prio,finish:i};if(this.queueRunning.has(t.hash))throw new Error("async-await-queue: duplicate hash "+t.hash);this.queueRunning.set(t.hash,r),this.lastRun=Date.now(),t.start.signal()}}}end(t){let a=this.queueRunning.get(t);if(a===void 0)throw new Error("async-await-queue: queue desync for "+t);this.queueRunning.dele
%% Import Date: ${(0,cn.moment)().toISOString(!0)} %%
`}function Vx(e){let t=e.match(/%% Begin annotations %%([\w\W]+)%% End annotations %%/);return t&&t[1]?t[1].trim():""}function Jx(e){return`
%% Begin annotations %%
${e}
%% End annotations %%
`}function Qt(e){return e.startsWith("/")?e.replace(/^\/+/,""):e}function bp(e){return e.endsWith(".md")||(e+=".md"),e.startsWith("/")&&(e=Qt(e)),e}async function gp(e,t,a,n){let i=new DOMParser().parseFromString(t,"text/html"),r=i.querySelectorAll("[data-annotation]"),o=i.querySelectorAll("[data-citation]");for(let s of Array.from(r))try{let l=s.dataset.annotation,u=l?JSON.parse(decodeURIComponent(l)):null;if(!u)return;let c=u.annotationKey,f=s instanceof HTMLImageElement;if(f){let p=a[c];if(p){let b=un.default.parse(p),d=await gO(c,b.ext.slice(1),n),m=un.default.parse(un.default.join(on(),d)).dir;(0,ja.existsSync)(m)||(0,ja.mkdirSync)(m,{recursive:!0});let v=un.default.join(b.dir,`${c}${b.ext}`);try{if(!(0,ja.existsSync)(v)){let x=v;if(v=p,!(0,ja.existsSync)(v))throw new Error("Cannot find annotation image: "+x)}(0,ja.copyFileSync)(v,un.default.join(on(),d))}catch(x){new Gt.Notice("Error: unable to copy annotation image from Zotero into your vault",7e3),console.error(x)}s.src=d}}s.insertAdjacentElement(f?"afterend":"beforebegin",createEl("a",{text:"Go to annotation",href:ba("open-pdf",u.attachmentURI,{page:u.pageLabel,annotation:u.annotationKey})})),f?s.insertAdjacentElement("afterend",createEl("br")):s.insertAdjacentElement("beforebegin",createSpan({text:" "}))}catch(l){console.error(l)}return o.forEach(s=>{var l;try{let u=s.dataset.citation,c=u?JSON.parse(decodeURIComponent(u)):null;if(!c||!c.citationItems.length||!((l=c.citationItems[0].uris)!=null&&l.length))return;let f=s.querySelector("span");if(!f)return;let p=f.innerText;f.empty(),f.createEl("a",{text:p,href:ba("select",c.citationItems[0].uris[0])})}catch(u){console.error(u)}}),i.body.innerHTML}async function xp(e,t){let a=await ln(e);if(!a.length)return;let n=await Lx(a,e);if(!n){new Gt.Notice("No notes found for selected items",7e3);return}let i=Object.keys(n);if(!i.length){new Gt.Notice("No notes found for selected items",7e3);return}let r={};for(let s of a){let l=await ir(s,e);if(l){let u={};l.forEach(c=>{var f;(f=c.annotations)==null||f.forEach(p=>{p.annotationType==="image"&&(u[p.key]=p.annotationImagePath)})}),r[s.key]=u}}let o={};for(let s of i){let l=[];for(let u of n[s])l.push((0,Gt.htmlToMarkdown)(await gp(s,u,r[s],t)));o[s]=l.join(`
`)}return o}async function gO(e,t,a){let n=app.vault.getConfig("attachmentFolderPath"),i=n==="."||n==="./",r=null;n.startsWith("./")&&(r=n.slice(2)),i?n=a||"":r&&(n=un.default.join(a||"",r)),n=(0,Gt.normalizePath)(n);let o=app.vault.getAbstractFileByPathInsensitive(n);return!o&&r&&(await app.vault.createFolder(n),o=app.vault.getAbstractFileByPathInsensitive(n)),o instanceof Gt.TFolder?`${o.getParentPrefix()+e}.${t}`:`${e}.${t}`}function Zx(e,t){e.replaceSelection(Object.values(t).join(`
`))}async function qx(e,t){let a=Object.keys(t),n=[];for(let i of a){let r=await xO(e,i,t[i]);if(!r)break;n.push(r)}return n.map(i=>i.path)}async function xO(e,t,a){let n=(0,Gt.normalizePath)(va(Qt(`${e}/${t}.md`))),i=app.vault.getAbstractFileByPath(n);try{i?await app.vault.modify(i,a):(await nr(n),i=await app.vault.create(n,a))}catch(r){return console.error(r),new Gt.Notice(`Error creating file "${n}": ${r.message}`,1e4),null}return i}var pn=require("obsidian"),Ts=_e(require("path"));var yO={noWrite:"-w",imageOutputPath:"-o",imageBaseName:"-n",imageFormat:"-f",imageDPI:"-d",imageQuality:"-q",ignoreBefore:"-b",attemptOCR:"-e",ocrLang:"-l",tesseractPath:"--tesseract-path",tessDataDir:"--tess-data-dir"};async function yp(e,t,a){let n=new it(app,"Extracting annotations...");n.open();let i=[e];Object.keys(t).forEach(r=>{let o=t[r];if(o===""||o===void 0)return"";let s=yO[r];typeof o=="boolean"?o&&i.push(s):(i.push(s),typeof o=="string"&&o.startsWith("-")?i.push(`"${o}"`):i.push(o.toString()))});try{if(!kx(a))return new pn.Notice("Error: PDF utility is not executable",1e4),"[]";let o=await tr(a||Ts.default.join(_t(),sn()),i);if(n.close(),o.stderr.toLowerCase().includes("password"))return new pn.Notice(`Error opening ${Ts.default.basename(e)}: PDF is password protected`,1e4),"[]";if(o.stderr&&!o.stderr.includes("warning"))throw new pn.Notice(`Error processing PDF: ${o.stderr}`,1e4),new Error(o.stderr);return o.stdout}catch(r){if(n.close(),r.message.toLowerCase().includes("password"))return new pn.Notice(`Error opening ${Ts.default.basename(e)}: PDF is password protected`,1e4),"[]";if(r.message.toLowerCase().includes("type3"))return new pn.Notice(`Error processing annotations: ${r.message}`,1e4),"[]";throw console.error(r),new pn.Notice(`Error processing PDF: ${r.message}`,1e4),r}}async function wO(e,t){t.note&&(t.note=(0,Fe.htmlToMarkdown)(await gp(e.key,t.note,{}))),t.dateAdded&&(t.dateAdded=(0,Fe.moment)(t.dateAdded)),t.dateModified&&(t.dateModified=(0,Fe.moment)(t.dateModified))}function EO(e){var t;e.dateAdded&&(e.dateAdded=(0,Fe.moment)(e.dateAdded)),e.dateModified&&(e.dateModified=(0,Fe.moment)(e.dateModified)),e.uri&&(e.itemKey=e.uri.split("/").pop(),e.desktopURI=e.select||ba("select",e.uri),(t=e.path)!=null&&t.endsWith(".pdf")&&(e.pdfURI=ba("open-pdf",e.uri)))}function Xx(e,t,a){e.date=(0,Fe.moment)(e.date),e.attachment=t,e.source="pdf",e.imagePath&&(e.imageBaseName=Zt.default.basename(e.imagePath),e.imageExtension=Zt.default.extname(e.imagePath).slice(1),e.imageRelativePath=(0,Fe.normalizePath)(Zt.default.join(a,e.imageBaseName))),e.desktopURI=ba("open-pdf",t.uri,{page:e.pageLabel})}function $x(e,t,a,n,i,r=!1){var l;let o=e.annotationPosition.rects[0],s={date:(0,Fe.moment)(e.dateModified),attachment:t,page:e.annotationPosition.pageIndex+1,pageLabel:e.annotationPageLabel,id:e.key,type:e.annotationType,x:o[0],y:o[1],color:e.annotationColor,colorCategory:Bx(e.annotationColor),desktopURI:ba("open-pdf",t.uri,{page:e.annotationPageLabel,annotation:e.key}),source:"zotero"};if(e.annotationText&&(s.annotatedText=e.annotationText),e.annotationComment&&(s.comment=e.annotationComment),e.annotationImagePath){let u=Zt.default.parse(e.annotationImagePath);s.imageBaseName=`${i}-${s.page}-x${Math.round(s.x)}-y${Math.round(s.y)}${u.ext}`,s.imageRelativePath=(0,Fe.normalizePath)(Zt.default.join(n,s.imageBaseName)),s.imageExtension=u.ext.slice(1);let c=Zt.default.join(a,s.imageBaseName);if(r){(0,Ba.existsSync)(a)||(0,Ba.mkdirSync)(a,{recursive:!0});let f=Zt.default.join(u.dir,`${e.key}${u.ext}`);try{if(!(0,Ba.existsSync)(f)){let p=f;if(f=e.annotationImagePath,!(0,Ba.existsSync)(f))throw new Error("Cannot find annotation image: "+p)}(0,Ba.copyFileSync)(f,c)}catch(p){new Fe.Notice("Error: unable to copy annotation image from Zotero into your vault",7e3),console.error(p)}}s.imagePath=c}return(l=e.tags)!=null&&l.length&&(s.tags=e.tags,s.allTags=e.tags.map(u=>u.tag).join(", "),s.hashTags=e.tags.map(u=>`#${u.tag.replace(/\s+/g,"-")}`).join(", ")),s}function Ps(e){let t=[],a=/^\+\s*/;return e.forEach(n=>{if(typeof n.comment=="string"&&a.test(n.
${r}
${o}`}}}catch(n){}return a}function ks(e,t,a){new Fe.Notice(createFragment(n=>{n.createSpan({text:`Error parsing template "${t}": `}),n.createEl("code",{text:Yx(e,a)})}),1e4)}function Fs(e,t,a){return new Error(`Error parsing template "${t}": ${Yx(e,a)}`)}async function Os(e,t,a,n){let{template:i,headerTemplate:r,annotationTemplate:o,footerTemplate:s}=await Ux(e);if(!i&&!r&&!o&&!s)throw new Error(`No templates found for export ${e.exportFormat.name}`);let l="";if(i){try{l=i?await nt(e.exportFormat.templatePath,i,t):""}catch(d){if(n)throw Fs(d,e.exportFormat.templatePath,i);return ks(d,e.exportFormat.templatePath,i),!1}return vp(l)}let u="",c="",f="";try{u=r?await nt(e.exportFormat.headerTemplatePath,r,t):""}catch(d){if(n)throw Fs(d,e.exportFormat.headerTemplatePath,r);return ks(d,e.exportFormat.headerTemplatePath,r),!1}try{c=o?await nt(e.exportFormat.annotationTemplatePath,o,t):""}catch(d){if(n)throw Fs(d,e.exportFormat.annotationTemplatePath,o);return ks(d,e.exportFormat.annotationTemplatePath,o),!1}try{f=s?await nt(e.exportFormat.footerTemplatePath,s,t):""}catch(d){if(n)throw Fs(d,e.exportFormat.footerTemplatePath,s);return ks(d,e.exportFormat.footerTemplatePath,s),!1}let p=[];r&&u.trim()&&p.push(u);let b=o&&(a+c).trim();return b&&p.push(Jx(a+c)),s&&f.trim()&&p.push(f),b?vp(p.join("")):p.join("")}function wp({exportFormat:e}){return e.templatePath||e.headerTemplatePath||e.annotationTemplatePath||e.footerTemplatePath||""}async function Kx(e){var p,b;let t=(0,Fe.moment)(),{database:a,exportFormat:n,settings:i}=e,r=wp(e),o=Wn(),s=await ln(a);if(!s.length)return[];let l=s[0].library,u;try{u=await rr(s,a,l)}catch(d){return[]}let c=[];for(let d=0,h=u.length;d<h;d++)await Rs(u[d],t,a,n.cslStyle);let f=on();for(let d=0,h=u.length;d<h;d++){let m=u[d].attachments;if(!m.some(E=>{var g;return(g=E.path)==null?void 0:g.endsWith(".pdf")})){let E=await Vn(r,{...u[d],annotations:[]}),g=(0,Fe.normalizePath)(va(Qt(await nt(r,n.outputPathTemplate,E)))),w=app.vault.getAbstractFileByPath(g),C="",y=(0,Fe.moment)(0);w&&(C=await app.vault.cachedRead(w),y=or(C));let S=y.valueOf()===0,A=await Vn(g,{...u[d],annotations:[],lastImportDate:y,isFirstImport:S,lastExportDate:y}),_=await Os(e,Jt.prepareTemplateData(A,C),"");if(!_)return[];C?app.vault.modify(w,_):(await nr(g),app.vault.create(g,_)),c.push(g);continue}let x={};try{let E=Ra(u[d]);E&&(x=(await ir(E,a)||[]).reduce((w,C)=>(C!=null&&C.path&&(w[C.path]=C),w),{}))}catch(E){}for(let E=0,g=m.length;E<g;E++){let w=m[E].path;if(!(w!=null&&w.endsWith(".pdf")))continue;let C=await Vn(r,{...m[E],...u[d]}),y=n.imageOutputPathTemplate?(0,Fe.normalizePath)(va(Qt(await nt(r,n.imageOutputPathTemplate,C)))):"",S=Zt.default.resolve(f,y),A=n.imageBaseNameTemplate?va(Qt(await nt(r,n.imageBaseNameTemplate,C))):"image",_=(0,Fe.normalizePath)(va(Qt(await nt(r,n.outputPathTemplate,C)))),P=app.vault.getAbstractFileByPath(_),F="",N=(0,Fe.moment)(0),B="";P&&(F=await app.vault.cachedRead(P),N=or(F),B=Vx(F));let L=N.valueOf()===0,k=[];if((b=(p=x[m[E].path])==null?void 0:p.annotations)==null||b.forEach(M=>{var D;(D=M.annotationPosition.rects)!=null&&D.length&&k.push($x(M,m[E],S,y,A,!0))}),i.shouldConcat&&k.length&&(k=Ps(k)),o)try{let M=await yp(w,{imageBaseName:A,imageDPI:i.pdfExportImageDPI,imageFormat:i.pdfExportImageFormat,imageOutputPath:S,imageQuality:i.pdfExportImageQuality,attemptOCR:i.pdfExportImageOCR,ocrLang:i.pdfExportImageOCRLang,tesseractPath:i.pdfExportImageTesseractPath,tessDataDir:i.pdfExportImageTessDataDir},i.exeOverridePath),D=JSON.parse(M);D.forEach(U=>{Xx(U,m[E],y)}),i.shouldConcat&&D.length&&(D=Ps(D)),k.push(...D)}catch(M){return[]}k.length&&(m[E].annotations=k);let T=await Vn(_,{...u[d],annotations:k||[],lastImportDate:N,isFirstImport:L,lastExportDate:N}),j=await Os(e,Jt.prepareTemplateData(T,F),B);if(!j)return[];P?app.vault.modify(P,j):(await nr(_),app.vault.create(_,j)),c.push(_)}}return c}async function Qx(e){let t=(0,Fe.moment)(),{database:a,format:n}=e,i=await ln(a);if(!i.length)return null;let r=i[0].library,o;try{o=await rr(i,a,r)}catch(l){return null}if(o.length===0)return null;let s=[];fo
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xl(e){return Of(e)||Rf(e)||Hi(e)||Nf()}function s9(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function l9(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var sA=function(){function e(a){var n=this;this._insertTag=function(i){var r;n.tags.length===0?n.insertionPoint?r=n.insertionPoint.nextSibling:n.prepend?r=n.container.firstChild:r=n.before:r=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,r),n.tags.push(i)},this.isSpeedy=a.speedy===void 0?!0:a.speedy,this.tags=[],this.ctr=0,this.nonce=a.nonce,this.key=a.key,this.container=a.container,this.prepend=a.prepend,this.insertionPoint=a.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(l9(this));var i=this.tags[this.tags.length-1];if(!1)var r;if(this.isSpeedy){var o=s9(i);try{o.insertRule(n,o.cssRules.length)}catch(s){}}else i.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e}();var ft="-ms-",Dr="-moz-",Se="-webkit-",$l="comm",hi="rule",bi="decl";var lA="@import";var Yl="@keyframes";var cA="@layer";var uA=Math.abs,yn=String.fromCharCode,pA=Object.assign;function dA(e,t){return $e(e,0)^45?(((t<<2^$e(e,0))<<2^$e(e,1))<<2^$e(e,2))<<2^$e(e,3):0}function Kl(e){return e.trim()}function jf(e,t){return(e=t.exec(e))?e[0]:e}function ye(e,t,a){return e.replace(t,a)}function Gr(e,t){return e.indexOf(t)}function $e(e,t){return e.charCodeAt(t)|0}function qa(e,t,a){return e.slice(t,a)}function yt(e){return e.length}function gi(e){return e.length}function xi(e,t){return t.push(e),e}function Bf(e,t){return e.map(t).join("")}var Ql=1,yi=1,fA=0,wt=0,Qe=0,Ei="";function zr(e,t,a,n,i,r,o){return{value:e,root:t,parent:a,type:n,props:i,children:r,line:Ql,column:yi,length:o,return:""}}function Si(e,t){return pA(zr("",null,null,"",null,null,0),e,{length:-e.length},t)}function mA(){return Qe}function hA(){return Qe=wt>0?$e(Ei,--wt):0,yi--,Qe===10&&(yi=1,Ql--),Qe}function Et(){return Qe=wt<fA?$e(Ei,wt++):0,yi++,Qe===10&&(yi=1,Ql++),Qe}function Ht(){return $e(Ei,wt)}function Hr(){return wt}function Ci(e,t){return qa(Ei,e,t)}function wi(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ec(e){return Ql=yi=1,fA=yt(Ei=e),wt=0,[]}function tc(e){return Ei="",e}function Ai(e){return Kl(Ci(wt-1,Lf(e===91?e+2:e===40?e+1:e)))}function vA(e){for(;(Qe=Ht())&&Qe<33;)Et();return wi(e)>2||wi(Qe)>3?"":" "}function bA(e,t){for(;--t&&Et()&&!(Qe<48||Qe>102||Qe>57&&Qe<65||Qe>70&&Qe<97););return Ci(e,Hr()+(t<6&&Ht()==32&&Et()==32))}function Lf(e){for(;Et();)switch(Qe){case e:return wt;case 34:case 39:e!==34&&e!==39&&Lf(Qe);break;case 40:e===41&&Lf(e);break;case 92:Et();break}return wt}function gA(e,t){for(;Et()&&e+Qe!==47+10;)if(e+Qe===42+42&&Ht()===47)break;return"/*"+Ci(t,wt-1)+"*"+yn(e===47?e:Et())}function xA(e){for(;!wi(Ht());)Et();return Ci(e,wt)}function EA(e){return tc(ac("",null,null,null,[""],e=ec(e),0,[0],e))}function ac(e,t,a,n,i,r,o,s,l){for(var u=0,c=0,f=o,p=0,b=0,d=0,h=1,m=1,v=1,x=0,E="",g=i,w=r,C=n,y=E;m;)switch(d=x,x=Et()){case 40:if(d!=108&&$e(y,f-1)==58){Gr(y+=ye(Ai(x),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:y+=Ai(x);break;case 9:case 10:case 13:case 32:y+=vA(d);break;case 92:y+=bA(Hr()-1,7);continue;case 47:switch(Ht()){case 42:case 47:xi(c9(gA(Et(),Hr()),t,a),l);break;default:y+="/"}break;case 123*h:s[u++]=yt(y)*v;case 125*h:case 59:case 0:switch(x){case 0:case 125:
0%, 80%, 100% { opacity: 0; }
40% { opacity: 1; }
`]))),MI=function(t,a){var n=t.isFocused,i=t.size,r=t.theme,o=r.colors,s=r.spacing.baseUnit;return ae({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},a?{}:{color:n?o.neutral60:o.neutral20,padding:s*2})},im=function(t){var a=t.delay,n=t.offset;return re("span",{css:Ur({animation:"".concat(mL," 1s ease-in-out ").concat(a,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},DI=function(t){var a=t.innerProps,n=t.isRtl;return re("div",W({},Ze(t,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),a),re(im,{delay:0,offset:n}),re(im,{delay:160,offset:!0}),re(im,{delay:320,offset:!n}))};DI.defaultProps={size:4};var GI=function(t,a){var n=t.isDisabled,i=t.isFocused,r=t.theme,o=r.colors,s=r.borderRadius,l=r.spacing;return ae({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},a?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:i?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},hL=function(t){var a=t.children,n=t.isDisabled,i=t.isFocused,r=t.innerRef,o=t.innerProps,s=t.menuIsOpen;return re("div",W({ref:r},Ze(t,"control",{control:!0,"control--is-disabled":n,"control--is-focused":i,"control--menu-is-open":s}),o),a)},vL=hL,bL=["data"],zI=function(t,a){var n=t.theme.spacing;return a?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},gL=function(t){var a=t.children,n=t.cx,i=t.getStyles,r=t.getClassNames,o=t.Heading,s=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,f=t.selectProps;return re("div",W({},Ze(t,"group",{group:!0}),l),re(o,W({},s,{selectProps:f,theme:c,getStyles:i,getClassNames:r,cx:n}),u),re("div",null,a))},HI=function(t,a){var n=t.theme,i=n.colors,r=n.spacing;return ae({label:"group",cursor:"default",display:"block"},a?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:r.baseUnit*3,paddingRight:r.baseUnit*3,textTransform:"uppercase"})},xL=function(t){var a=uI(t);a.data;var n=Wt(a,bL);return re("div",W({},Ze(t,"groupHeading",{"group-heading":!0}),n))},yL=gL,wL=["innerRef","isDisabled","isHidden","inputClassName"],WI=function(t,a){var n=t.isDisabled,i=t.value,r=t.theme,o=r.spacing,s=r.colors;return ae(ae({visibility:n?"hidden":"visible",transform:i?"translateZ(0)":""},EL),a?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},UI={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},EL={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ae({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},UI)},SL=function(t){return ae({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},UI)},CL=function(t){var a=t.cx,n=t.value,i=uI(t),r=i.innerRef,o=i.isDisabled,s=i.isHidden,l=i.inputClassName,u=Wt(i,wL);return re("div",W({},Ze(t,"input",{"input-container":!0}),{"data-value":n||""}),re("input",W({className:a({input:!0},l),ref:r,style:SL(s),disabled:o},u)))},AL=CL,VI=function(t,a){var n=t.theme,i=n.spacing,r=n.borderRadius,o=n.colors;return ae({label:"multiValue",display:"flex",minWidth:0},a?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:i.baseUnit/2})},JI=function(t,a){var n=t.theme,i=n.borderRadius,r=n.colors,o=t.cropWithEllipsis;return ae({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},a?{}:{borderRadius:i/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},ZI=function(t,a){var n=t.theme,i=n.spacing,r=n.borderRadius,o=n.colors,s=t.isFocused;return ae({alignItems:"center",display:"flex"},a?{}:{borderRadius:r/2,backgroundColor:s?o.dangerLight:voi
/*! Bundled license information:
nunjucks/browser/nunjucks.js:
(*! Browser bundle of nunjucks 3.2.4 *)
safe-buffer/index.js:
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
content-disposition/index.js:
(*!
* content-disposition
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*)
object-assign/index.js:
(*
object-assign
(c) Sindre Sorhus
@license MIT
*)
is-natural-number/index.js:
(*!
* is-natural-number.js | MIT (c) Shinnosuke Watanabe
* https://github.com/shinnn/is-natural-number.js
*)
strip-dirs/index.js:
(*!
* strip-dirs | MIT (c) Shinnosuke Watanabe
* https://github.com/shinnn/node-strip-dirs
*)
has-symbol-support-x/index.js:
(**
* @file Tests if ES6 Symbol is supported.
* @version 1.4.2
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module has-symbol-support-x
*)
has-to-string-tag-x/index.js:
(**
* @file Tests if ES6 @@toStringTag is supported.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag|26.3.1 @@toStringTag}
* @version 1.4.1
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module has-to-string-tag-x
*)
mime-db/index.js:
(*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*)
react-is/cjs/react-is.production.min.js:
(** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
*/