Files
my-vault/.obsidian/plugins/mcp-tools/main.js
T

523 lines
1.4 MiB
JavaScript
Raw Normal View History

2026-01-05 13:03:55 +08:00
/*
THIS IS A GENERATED/BUNDLED FILE BY BUN
if you want to view the source, please visit https://github.com/jacksteamdev/obsidian-mcp-tools
*/
var Jw=Object.create;var{getPrototypeOf:Gw,defineProperty:A7,getOwnPropertyNames:HU,getOwnPropertyDescriptor:Yw}=Object,zU=Object.prototype.hasOwnProperty;var Z8=(Q,X,Z)=>{Z=Q!=null?Jw(Gw(Q)):{};let J=X||!Q||!Q.__esModule?A7(Z,"default",{value:Q,enumerable:!0}):Z;for(let G of HU(Q))if(!zU.call(J,G))A7(J,G,{get:()=>Q[G],enumerable:!0});return J},qU=new WeakMap,Ww=(Q)=>{var X=qU.get(Q),Z;if(X)return X;if(X=A7({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function")HU(Q).map((J)=>!zU.call(X,J)&&A7(X,J,{get:()=>Q[J],enumerable:!(Z=Yw(Q,J))||Z.enumerable}));return qU.set(Q,X),X},r=(Q,X)=>()=>(X||Q((X={exports:{}}).exports,X),X.exports);var LJ=(Q,X)=>{for(var Z in X)A7(Q,Z,{get:X[Z],enumerable:!0,configurable:!0,set:(J)=>X[Z]=()=>J})};var t0=r((QG)=>{Object.defineProperty(QG,"__esModule",{value:!0});QG.isFunction=void 0;function Sj(Q){return typeof Q==="function"}QG.isFunction=Sj});var iQ=r((ZG)=>{Object.defineProperty(ZG,"__esModule",{value:!0});ZG.createErrorClass=void 0;function kj(Q){var X=function(J){Error.call(J),J.stack=new Error().stack},Z=Q(X);return Z.prototype=Object.create(Error.prototype),Z.prototype.constructor=Z,Z}ZG.createErrorClass=kj});var Yz=r((XG)=>{Object.defineProperty(XG,"__esModule",{value:!0});XG.UnsubscriptionError=void 0;var yj=iQ();XG.UnsubscriptionError=yj.createErrorClass(function(Q){return function X(Z){Q(this),this.message=Z?Z.length+` errors occurred during unsubscription:
`+Z.map(function(J,G){return G+1+") "+J.toString()}).join(`
`):"",this.name="UnsubscriptionError",this.errors=Z}})});var MQ=r((JG)=>{Object.defineProperty(JG,"__esModule",{value:!0});JG.arrRemove=void 0;function xj(Q,X){if(Q){var Z=Q.indexOf(X);0<=Z&&Q.splice(Z,1)}}JG.arrRemove=xj});var o8=r((O8)=>{var JF=O8&&O8.__values||function(Q){var X=typeof Symbol==="function"&&Symbol.iterator,Z=X&&Q[X],J=0;if(Z)return Z.call(Q);if(Q&&typeof Q.length==="number")return{next:function(){if(Q&&J>=Q.length)Q=void 0;return{value:Q&&Q[J++],done:!Q}}};throw new TypeError(X?"Object is not iterable.":"Symbol.iterator is not defined.")},GF=O8&&O8.__read||function(Q,X){var Z=typeof Symbol==="function"&&Q[Symbol.iterator];if(!Z)return Q;var J=Z.call(Q),G,Y=[],H;try{while((X===void 0||X-- >0)&&!(G=J.next()).done)Y.push(G.value)}catch(K){H={error:K}}finally{try{if(G&&!G.done&&(Z=J.return))Z.call(J)}finally{if(H)throw H.error}}return Y},YF=O8&&O8.__spreadArray||function(Q,X){for(var Z=0,J=X.length,G=Q.length;Z<J;Z++,G++)Q[G]=X[Z];return Q};Object.defineProperty(O8,"__esModule",{value:!0});O8.isSubscription=O8.EMPTY_SUBSCRIPTION=O8.Subscription=void 0;var o7=t0(),Wz=Yz(),WF=MQ(),qz=function(){function Q(X){this.initialTeardown=X,this.closed=!1,this._parentage=null,this._finalizers=null}return Q.prototype.unsubscribe=function(){var X,Z,J,G,Y;if(!this.closed){this.closed=!0;var H=this._parentage;if(H)if(this._parentage=null,Array.isArray(H))try{for(var K=JF(H),z=K.next();!z.done;z=K.next()){var W=z.value;W.remove(this)}}catch(P){X={error:P}}finally{try{if(z&&!z.done&&(Z=K.return))Z.call(K)}finally{if(X)throw X.error}}else H.remove(this);var $=this.initialTeardown;if(o7.isFunction($))try{$()}catch(P){Y=P instanceof Wz.UnsubscriptionError?P.errors:[P]}var q=this._finalizers;if(q){this._finalizers=null;try{for(var B=JF(q),D=B.next();!D.done;D=B.next()){var F=D.value;try{qF(F)}catch(P){if(Y=Y!==null&&Y!==void 0?Y:[],P instanceof Wz.UnsubscriptionError)Y=YF(YF([],GF(Y)),GF(P.errors));else Y.push(P)}}}catch(P){J={error:P}}finally{try{if(D&&!D.done&&(G=B.return))G.call(B)}finally{if(J)throw J.error}}}if(Y)throw new Wz.UnsubscriptionError(Y)}},Q.prototype.add=function(X){var Z;if(X&&X!==this)if(this.closed)qF(X);else{if(X instanceof Q){if(X.closed||X._hasParent(this))return;X._addParent(this)}(this._finalizers=(Z=this._finalizers)!==null&&Z!==void 0?Z:[]).push(X)}},Q.prototype._hasParent=function(X){var Z=this._parentage;return Z===X||Array.isArray(Z)&&Z.includes(X)},Q.prototype._addParent=function(X){var Z=this._parentage;this._parentage=Array.isArray(Z)?(Z.push(X),Z):Z?[Z,X]:X},Q.prototype._removeParent=function(X){var Z=this._parentage;if(Z===X)this._parentage=null;else if(Array.isArray(Z))WF.arrRemove(Z,X)},Q.prototype.remove=function(X){var Z=this._finalizers;if(Z&&WF.arrRemove(Z,X),X instanceof Q)X._removeParent(this)},Q.EMPTY=function(){var X=new Q;return X.closed=!0,X}(),Q}();O8.Subscription=qz;O8.EMPTY_SUBSCRIPTION=qz.EMPTY;function vj(Q){return Q instanceof qz||Q&&"closed"in Q&&o7.isFunction(Q.remove)&&o7.isFunction(Q.add)&&o7.isFunction(Q.unsubscribe)}O8.isSubscription=vj;function qF(Q){if(o7.isFunction(Q))Q();else Q.unsubscribe()}});var Q5=r((GG)=>{Object.defineProperty(GG,"__esModule",{value:!0});GG.config=void 0;GG.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var Hz=r((a9)=>{var HF=a9&&a9.__read||function(Q,X){var Z=typeof Symbol==="function"&&Q[Symbol.iterator];if(!Z)return Q;var J=Z.call(Q),G,Y=[],H;try{while((X===void 0||X-- >0)&&!(G=J.next()).done)Y.push(G.value)}catch(K){H={error:K}}finally{try{if(G&&!G.done&&(Z=J.return))Z.call(J)}finally{if(H)throw H.error}}return Y},zF=a9&&a9.__spreadArray||function(Q,X){for(var Z=0,J=X.length,G=Q.length;Z<J;Z++,G++)Q[G]=X[Z];return Q};Object.defineProperty(a9,"__esModule",{value:!0});a9.timeoutProvider=void 0;a9.timeoutProvider={setTimeout:function(Q,X){var Z=[];for(var J=2;J<arguments.length;J++)Z[J-2]=arguments[J];var G=a9.timeoutProvider.delegate;if(G===null||G===void 0?void 0:G.setTimeout)return G.setTimeout.apply(G,zF([Q,X],HF(Z)));return setTimeout.apply(
`)}return z},Z.decode=function(Y,H){if(typeof Y!=="string")throw new TypeError('"input" must be a string.');if(typeof H!=="string")throw new TypeError('"alphabet" must be a string.');var K=J[H];if(!K){K=J[H]=[];for(var z=0;z<H.length;++z)K[H.charCodeAt(z)]=z}Y=Y.replace(/\s/g,"");var W=H.length,$=H.charAt(0),q=[0];for(var z=0;z<Y.length;z++){var B=K[Y.charCodeAt(z)];if(B===void 0)return;for(var D=0,F=B;D<q.length;++D)F+=q[D]*W,q[D]=F&255,F>>=8;while(F>0)q.push(F&255),F>>=8}for(var P=0;Y[P]===$&&P<Y.length-1;++P)q.push(0);if(typeof Buffer!=="undefined")return Buffer.from(q.reverse());return new Uint8Array(q.reverse())};function G(Y,H){var K=0,z=H.length,W=H.charAt(0),$=[0];for(K=0;K<Y.length();++K){for(var q=0,B=Y.at(K);q<$.length;++q)B+=$[q]<<8,$[q]=B%z,B=B/z|0;while(B>0)$.push(B%z),B=B/z|0}var D="";for(K=0;Y.at(K)===0&&K<Y.length()-1;++K)D+=W;for(K=$.length-1;K>=0;--K)D+=H[$[K]];return D}}}),d0=W1({"node_modules/node-forge/lib/util.js"(Q,X){var Z=y0(),J=Ao(),G=X.exports=Z.util=Z.util||{};(function(){if(typeof process!=="undefined"&&process.nextTick){if(G.nextTick=process.nextTick,typeof setImmediate==="function")G.setImmediate=setImmediate;else G.setImmediate=G.nextTick;return}if(typeof setImmediate==="function"){G.setImmediate=function(){return setImmediate.apply(void 0,arguments)},G.nextTick=function(T){return setImmediate(T)};return}if(G.setImmediate=function(T){setTimeout(T,0)},typeof window!=="undefined"&&typeof window.postMessage==="function"){let T=function(S){if(S.source===window&&S.data===M){S.stopPropagation();var v=I.slice();I.length=0,v.forEach(function(h){h()})}};var V=T,M="forge.setImmediate",I=[];G.setImmediate=function(S){if(I.push(S),I.length===1)window.postMessage(M,"*")},window.addEventListener("message",T,!0)}if(typeof MutationObserver!=="undefined"){var E=Date.now(),w=!0,A=document.createElement("div"),I=[];new MutationObserver(function(){var S=I.slice();I.length=0,S.forEach(function(v){v()})}).observe(A,{attributes:!0});var R=G.setImmediate;G.setImmediate=function(S){if(Date.now()-E>15)E=Date.now(),R(S);else if(I.push(S),I.length===1)A.setAttribute("a",w=!w)}}G.nextTick=G.setImmediate})(),G.isNodejs=typeof process!=="undefined"&&process.versions&&process.versions.node,G.globalScope=function(){if(G.isNodejs)return global;return typeof self==="undefined"?window:self}(),G.isArray=Array.isArray||function(V){return Object.prototype.toString.call(V)==="[object Array]"},G.isArrayBuffer=function(V){return typeof ArrayBuffer!=="undefined"&&V instanceof ArrayBuffer},G.isArrayBufferView=function(V){return V&&G.isArrayBuffer(V.buffer)&&V.byteLength!==void 0};function Y(V){if(!(V===8||V===16||V===24||V===32))throw new Error("Only 8, 16, 24, or 32 bits supported: "+V)}G.ByteBuffer=H;function H(V){if(this.data="",this.read=0,typeof V==="string")this.data=V;else if(G.isArrayBuffer(V)||G.isArrayBufferView(V))if(typeof Buffer!=="undefined"&&V instanceof Buffer)this.data=V.toString("binary");else{var M=new Uint8Array(V);try{this.data=String.fromCharCode.apply(null,M)}catch(E){for(var I=0;I<M.length;++I)this.putByte(M[I])}}else if(V instanceof H||typeof V==="object"&&typeof V.data==="string"&&typeof V.read==="number")this.data=V.data,this.read=V.read;this._constructedStringLength=0}G.ByteStringBuffer=H;var K=4096;G.ByteStringBuffer.prototype._optimizeConstructedString=function(V){if(this._constructedStringLength+=V,this._constructedStringLength>K)this.data.substr(0,1),this._constructedStringLength=0},G.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},G.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},G.ByteStringBuffer.prototype.putByte=function(V){return this.putBytes(String.fromCharCode(V))},G.ByteStringBuffer.prototype.fillWithByte=function(V,M){V=String.fromCharCode(V);var I=this.data;while(M>0){if(M&1)I+=V;if(M>>>=1,M>0)V+=V}return this.data=I,this._optimizeConstructedString(M),this},G.ByteStringBuffer.prototype.putBytes=function(V){return this.data+=V,this._optimizeConstructedString(V.length),this},G.ByteStringBuffer.prototype.putString=function(V){return thi
`,I=I.substr(M)}return E+=I,E},G.decode64=function(V){V=V.replace(/[^A-Za-z0-9\+\/\=]/g,"");var M="",I,E,w,A,R=0;while(R<V.length)if(I=$[V.charCodeAt(R++)-43],E=$[V.charCodeAt(R++)-43],w=$[V.charCodeAt(R++)-43],A=$[V.charCodeAt(R++)-43],M+=String.fromCharCode(I<<2|E>>4),w!==64){if(M+=String.fromCharCode((E&15)<<4|w>>2),A!==64)M+=String.fromCharCode((w&3)<<6|A)}return M},G.encodeUtf8=function(V){return unescape(encodeURIComponent(V))},G.decodeUtf8=function(V){return decodeURIComponent(escape(V))},G.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:J.encode,decode:J.decode}},G.binary.raw.encode=function(V){return String.fromCharCode.apply(null,V)},G.binary.raw.decode=function(V,M,I){var E=M;if(!E)E=new Uint8Array(V.length);I=I||0;var w=I;for(var A=0;A<V.length;++A)E[w++]=V.charCodeAt(A);return M?w-I:E},G.binary.hex.encode=G.bytesToHex,G.binary.hex.decode=function(V,M,I){var E=M;if(!E)E=new Uint8Array(Math.ceil(V.length/2));I=I||0;var w=0,A=I;if(V.length&1)w=1,E[A++]=parseInt(V[0],16);for(;w<V.length;w+=2)E[A++]=parseInt(V.substr(w,2),16);return M?A-I:E},G.binary.base64.encode=function(V,M){var I="",E="",w,A,R,T=0;while(T<V.byteLength){if(w=V[T++],A=V[T++],R=V[T++],I+=W.charAt(w>>2),I+=W.charAt((w&3)<<4|A>>4),isNaN(A))I+="==";else I+=W.charAt((A&15)<<2|R>>6),I+=isNaN(R)?"=":W.charAt(R&63);if(M&&I.length>M)E+=I.substr(0,M)+`\r
`,I=I.substr(M)}return E+=I,E},G.binary.base64.decode=function(V,M,I){var E=M;if(!E)E=new Uint8Array(Math.ceil(V.length/4)*3);V=V.replace(/[^A-Za-z0-9\+\/\=]/g,""),I=I||0;var w,A,R,T,S=0,v=I;while(S<V.length)if(w=$[V.charCodeAt(S++)-43],A=$[V.charCodeAt(S++)-43],R=$[V.charCodeAt(S++)-43],T=$[V.charCodeAt(S++)-43],E[v++]=w<<2|A>>4,R!==64){if(E[v++]=(A&15)<<4|R>>2,T!==64)E[v++]=(R&3)<<6|T}return M?v-I:E.subarray(0,v)},G.binary.base58.encode=function(V,M){return G.binary.baseN.encode(V,q,M)},G.binary.base58.decode=function(V,M){return G.binary.baseN.decode(V,q,M)},G.text={utf8:{},utf16:{}},G.text.utf8.encode=function(V,M,I){V=G.encodeUtf8(V);var E=M;if(!E)E=new Uint8Array(V.length);I=I||0;var w=I;for(var A=0;A<V.length;++A)E[w++]=V.charCodeAt(A);return M?w-I:E},G.text.utf8.decode=function(V){return G.decodeUtf8(String.fromCharCode.apply(null,V))},G.text.utf16.encode=function(V,M,I){var E=M;if(!E)E=new Uint8Array(V.length*2);var w=new Uint16Array(E.buffer);I=I||0;var A=I,R=I;for(var T=0;T<V.length;++T)w[R++]=V.charCodeAt(T),A+=2;return M?A-I:E},G.text.utf16.decode=function(V){return String.fromCharCode.apply(null,new Uint16Array(V.buffer))},G.deflate=function(V,M,I){if(M=G.decode64(V.deflate(G.encode64(M)).rval),I){var E=2,w=M.charCodeAt(1);if(w&32)E=6;M=M.substring(E,M.length-4)}return M},G.inflate=function(V,M,I){var E=V.inflate(G.encode64(M)).rval;return E===null?null:G.decode64(E)};var B=function(V,M,I){if(!V)throw new Error("WebStorage not available.");var E;if(I===null)E=V.removeItem(M);else I=G.encode64(JSON.stringify(I)),E=V.setItem(M,I);if(typeof E!=="undefined"&&E.rval!==!0){var w=new Error(E.error.message);throw w.id=E.error.id,w.name=E.error.name,w}},D=function(V,M){if(!V)throw new Error("WebStorage not available.");var I=V.getItem(M);if(V.init)if(I.rval===null){if(I.error){var E=new Error(I.error.message);throw E.id=I.error.id,E.name=I.error.name,E}I=null}else I=I.rval;if(I!==null)I=JSON.parse(G.decode64(I));return I},F=function(V,M,I,E){var w=D(V,M);if(w===null)w={};w[I]=E,B(V,M,w)},P=function(V,M,I){var E=D(V,M);if(E!==null)E=I in E?E[I]:null;return E},N=function(V,M,I){var E=D(V,M);if(E!==null&&I in E){delete E[I];var w=!0;for(var A in E){w=!1;break}if(w)E=null;B(V,M,E)}},C=function(V,M){B(V,M,null)},L=function(V,M,I){var E=null;if(typeof I==="undefined")I=["web","flash"];var w,A=!1,R=null;for(var T in I){w=I[T];try{if(w==="flash"||w==="both"){if(M[0]===null)throw new Error("Flash local storage not available.");E=V.apply(this,M),A=w==="flash"}if(w==="web"||w==="both")M[0]=localStorage,E=V.apply(this,M),A=!0}catch(S){R=S}if(A)break}if(!A)throw R;return E};G.setItem=function(V,M,I,E,w){L(F,arguments,w)},G.getItem=function(V,M,I,E){return L(P,arguments,E)},G.removeItem=function(V,M,I,E){L(N,arguments,E)},G.clearItems=function(V,M,I){L(C,arguments,I)},G.isEmpty=function(V){for(var M in V)if(V.hasOwnProperty(M))return!1;return!0},G.format=function(V){var M=/%./g,I,E,w=0,A=[],R=0;while(I=M.exec(V)){if(E=V.substring(R,M.lastIndex-2),E.length>0)A.push(E);R=M.lastIndex;var T=I[0][1];switch(T){case"s":case"o":if(w<arguments.length)A.push(arguments[w+++1]);else A.push("<?>");break;case"%":A.push("%");break;default:A.push("<%"+T+"?>")}}return A.push(V.substring(R)),A.join("")},G.formatNumber=function(V,M,I,E){var w=V,A=isNaN(M=Math.abs(M))?2:M,R=I===void 0?",":I,T=E===void 0?".":E,S=w<0?"-":"",v=parseInt(w=Math.abs(+w||0).toFixed(A),10)+"",h=v.length>3?v.length%3:0;return S+(h?v.substr(0,h)+T:"")+v.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+T)+(A?R+Math.abs(w-v).toFixed(A).slice(2):"")},G.formatSize=function(V){if(V>=1073741824)V=G.formatNumber(V/1073741824,2,".","")+" GiB";else if(V>=1048576)V=G.formatNumber(V/1048576,2,".","")+" MiB";else if(V>=1024)V=G.formatNumber(V/1024,0)+" KiB";else V=G.formatNumber(V,0)+" bytes";return V},G.bytesFromIP=function(V){if(V.indexOf(".")!==-1)return G.bytesFromIPv4(V);if(V.indexOf(":")!==-1)return G.bytesFromIPv6(V);return null},G.bytesFromIPv4=function(V){if(V=V.split("."),V.length!==4)return null;var M=G.createBuffer();for(var I=0;I<V.length;++I){var E=parseInt(V[I],10);if(isNaN(E))ret
`;var B="";for(var D=0;D<W*$;++D)B+=" ";switch(q+=B+"Tag: ",z.tagClass){case J.Class.UNIVERSAL:q+="Universal:";break;case J.Class.APPLICATION:q+="Application:";break;case J.Class.CONTEXT_SPECIFIC:q+="Context-Specific:";break;case J.Class.PRIVATE:q+="Private:";break}if(z.tagClass===J.Class.UNIVERSAL)switch(q+=z.type,z.type){case J.Type.NONE:q+=" (None)";break;case J.Type.BOOLEAN:q+=" (Boolean)";break;case J.Type.INTEGER:q+=" (Integer)";break;case J.Type.BITSTRING:q+=" (Bit string)";break;case J.Type.OCTETSTRING:q+=" (Octet string)";break;case J.Type.NULL:q+=" (Null)";break;case J.Type.OID:q+=" (Object Identifier)";break;case J.Type.ODESC:q+=" (Object Descriptor)";break;case J.Type.EXTERNAL:q+=" (External or Instance of)";break;case J.Type.REAL:q+=" (Real)";break;case J.Type.ENUMERATED:q+=" (Enumerated)";break;case J.Type.EMBEDDED:q+=" (Embedded PDV)";break;case J.Type.UTF8:q+=" (UTF8)";break;case J.Type.ROID:q+=" (Relative Object Identifier)";break;case J.Type.SEQUENCE:q+=" (Sequence)";break;case J.Type.SET:q+=" (Set)";break;case J.Type.PRINTABLESTRING:q+=" (Printable String)";break;case J.Type.IA5String:q+=" (IA5String (ASCII))";break;case J.Type.UTCTIME:q+=" (UTC time)";break;case J.Type.GENERALIZEDTIME:q+=" (Generalized time)";break;case J.Type.BMPSTRING:q+=" (BMP String)";break}else q+=z.type;if(q+=`
`,q+=B+"Constructed: "+z.constructed+`
`,z.composed){var F=0,P="";for(var D=0;D<z.value.length;++D)if(z.value[D]!==void 0){if(F+=1,P+=J.prettyPrint(z.value[D],W+1,$),D+1<z.value.length)P+=","}q+=B+"Sub values: "+F+P}else{if(q+=B+"Value: ",z.type===J.Type.OID){var N=J.derToOid(z.value);if(q+=N,Z.pki&&Z.pki.oids){if(N in Z.pki.oids)q+=" ("+Z.pki.oids[N]+") "}}if(z.type===J.Type.INTEGER)try{q+=J.derToInteger(z.value)}catch(L){q+="0x"+Z.util.bytesToHex(z.value)}else if(z.type===J.Type.BITSTRING){if(z.value.length>1)q+="0x"+Z.util.bytesToHex(z.value.slice(1));else q+="(none)";if(z.value.length>0){var C=z.value.charCodeAt(0);if(C==1)q+=" (1 unused bit shown)";else if(C>1)q+=" ("+C+" unused bits shown)"}}else if(z.type===J.Type.OCTETSTRING){if(!K.test(z.value))q+="("+z.value+") ";q+="0x"+Z.util.bytesToHex(z.value)}else if(z.type===J.Type.UTF8)try{q+=Z.util.decodeUtf8(z.value)}catch(L){if(L.message==="URI malformed")q+="0x"+Z.util.bytesToHex(z.value)+" (malformed UTF8)";else throw L}else if(z.type===J.Type.PRINTABLESTRING||z.type===J.Type.IA5String)q+=z.value;else if(K.test(z.value))q+="0x"+Z.util.bytesToHex(z.value);else if(z.value.length===0)q+="[null]";else q+=z.value}return q}}}),xQ=W1({"node_modules/node-forge/lib/md.js"(Q,X){var Z=y0();X.exports=Z.md=Z.md||{},Z.md.algorithms=Z.md.algorithms||{}}}),kX=W1({"node_modules/node-forge/lib/hmac.js"(Q,X){var Z=y0();xQ(),d0();var J=X.exports=Z.hmac=Z.hmac||{};J.create=function(){var G=null,Y=null,H=null,K=null,z={};return z.start=function(W,$){if(W!==null)if(typeof W==="string")if(W=W.toLowerCase(),W in Z.md.algorithms)Y=Z.md.algorithms[W].create();else throw new Error('Unknown hash algorithm "'+W+'"');else Y=W;if($===null)$=G;else{if(typeof $==="string")$=Z.util.createBuffer($);else if(Z.util.isArray($)){var q=$;$=Z.util.createBuffer();for(var B=0;B<q.length;++B)$.putByte(q[B])}var D=$.length();if(D>Y.blockLength)Y.start(),Y.update($.bytes()),$=Y.digest();H=Z.util.createBuffer(),K=Z.util.createBuffer(),D=$.length();for(var B=0;B<D;++B){var q=$.at(B);H.putByte(54^q),K.putByte(92^q)}if(D<Y.blockLength){var q=Y.blockLength-D;for(var B=0;B<q;++B)H.putByte(54),K.putByte(92)}G=$,H=H.bytes(),K=K.bytes()}Y.start(),Y.update(H)},z.update=function(W){Y.update(W)},z.getMac=function(){var W=Y.digest().bytes();return Y.start(),Y.update(K),Y.update(W),Y.digest()},z.digest=z.getMac,z}}}),L$=W1({"node_modules/node-forge/lib/md5.js"(Q,X){var Z=y0();xQ(),d0();var J=X.exports=Z.md5=Z.md5||{};Z.md.md5=Z.md.algorithms.md5=J,J.create=function(){if(!z)W();var q=null,B=Z.util.createBuffer(),D=new Array(16),F={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8};return F.start=function(){F.messageLength=0,F.fullMessageLength=F.messageLength64=[];var P=F.messageLengthSize/4;for(var N=0;N<P;++N)F.fullMessageLength.push(0);return B=Z.util.createBuffer(),q={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878},F},F.start(),F.update=function(P,N){if(N==="utf8")P=Z.util.encodeUtf8(P);var C=P.length;F.messageLength+=C,C=[C/4294967296>>>0,C>>>0];for(var L=F.fullMessageLength.length-1;L>=0;--L)F.fullMessageLength[L]+=C[1],C[1]=C[0]+(F.fullMessageLength[L]/4294967296>>>0),F.fullMessageLength[L]=F.fullMessageLength[L]>>>0,C[0]=C[1]/4294967296>>>0;if(B.putBytes(P),$(q,D,B),B.read>2048||B.length()===0)B.compact();return F},F.digest=function(){var P=Z.util.createBuffer();P.putBytes(B.bytes());var N=F.fullMessageLength[F.fullMessageLength.length-1]+F.messageLengthSize,C=N&F.blockLength-1;P.putBytes(G.substr(0,F.blockLength-C));var L,V=0;for(var M=F.fullMessageLength.length-1;M>=0;--M)L=F.fullMessageLength[M]*8+V,V=L/4294967296>>>0,P.putInt32Le(L>>>0);var I={h0:q.h0,h1:q.h1,h2:q.h2,h3:q.h3};$(I,D,P);var E=Z.util.createBuffer();return E.putInt32Le(I.h0),E.putInt32Le(I.h1),E.putInt32Le(I.h2),E.putInt32Le(I.h3),E},F};var G=null,Y=null,H=null,K=null,z=!1;function W(){G=String.fromCharCode(128),G+=Z.util.fillString(String.fromCharCode(0),64),Y=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],H=[7,12,17,22,
`,W;if(H.procType)W={name:"Proc-Type",values:[String(H.procType.version),H.procType.type]},z+=G(W);if(H.contentDomain)W={name:"Content-Domain",values:[H.contentDomain]},z+=G(W);if(H.dekInfo){if(W={name:"DEK-Info",values:[H.dekInfo.algorithm]},H.dekInfo.parameters)W.values.push(H.dekInfo.parameters);z+=G(W)}if(H.headers)for(var $=0;$<H.headers.length;++$)z+=G(H.headers[$]);if(H.procType)z+=`\r
`;return z+=Z.util.encode64(H.body,K.maxline||64)+`\r
`,z+="-----END "+H.type+`-----\r
`,z},J.decode=function(H){var K=[],z=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,W=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,$=/\r?\n/,q;while(!0){if(q=z.exec(H),!q)break;var B=q[1];if(B==="NEW CERTIFICATE REQUEST")B="CERTIFICATE REQUEST";var D={type:B,procType:null,contentDomain:null,dekInfo:null,headers:[],body:Z.util.decode64(q[3])};if(K.push(D),!q[2])continue;var F=q[2].split($),P=0;while(q&&P<F.length){var N=F[P].replace(/\s+$/,"");for(var C=P+1;C<F.length;++C){var L=F[C];if(!/\s/.test(L[0]))break;N+=L,P=C}if(q=N.match(W),q){var V={name:q[1],values:[]},M=q[2].split(",");for(var I=0;I<M.length;++I)V.values.push(Y(M[I]));if(!D.procType){if(V.name!=="Proc-Type")throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');else if(V.values.length!==2)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');D.procType={version:M[0],type:M[1]}}else if(!D.contentDomain&&V.name==="Content-Domain")D.contentDomain=M[0]||"";else if(!D.dekInfo&&V.name==="DEK-Info"){if(V.values.length===0)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');D.dekInfo={algorithm:M[0],parameters:M[1]||null}}else D.headers.push(V)}++P}if(D.procType==="ENCRYPTED"&&!D.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}if(K.length===0)throw new Error("Invalid PEM formatted message.");return K};function G(H){var K=H.name+": ",z=[],W=function(F,P){return" "+P};for(var $=0;$<H.values.length;++$)z.push(H.values[$].replace(/^(\S+\r\n)/,W));K+=z.join(",")+`\r
`;var q=0,B=-1;for(var $=0;$<K.length;++$,++q)if(q>65&&B!==-1){var D=K[B];if(D===",")++B,K=K.substr(0,B)+`\r
`+K.substr(B);else K=K.substr(0,B)+`\r
`+D+K.substr(B+1);q=$-B-1,B=-1,++$}else if(K[$]===" "||K[$]==="\t"||K[$]===",")B=$;return K}function Y(H){return H.replace(/^\s+/,"")}}}),pq=W1({"node_modules/node-forge/lib/des.js"(Q,X){var Z=y0();D$(),AM(),d0(),X.exports=Z.des=Z.des||{},Z.des.startEncrypting=function(P,N,C,L){var V=F({key:P,output:C,decrypt:!1,mode:L||(N===null?"ECB":"CBC")});return V.start(N),V},Z.des.createEncryptionCipher=function(P,N){return F({key:P,output:null,decrypt:!1,mode:N})},Z.des.startDecrypting=function(P,N,C,L){var V=F({key:P,output:C,decrypt:!0,mode:L||(N===null?"ECB":"CBC")});return V.start(N),V},Z.des.createDecryptionCipher=function(P,N){return F({key:P,output:null,decrypt:!0,mode:N})},Z.des.Algorithm=function(P,N){var C=this;C.name=P,C.mode=new N({blockSize:8,cipher:{encrypt:function(L,V){return D(C._keys,L,V,!1)},decrypt:function(L,V){return D(C._keys,L,V,!0)}}}),C._init=!1},Z.des.Algorithm.prototype.initialize=function(P){if(this._init)return;var N=Z.util.createBuffer(P.key);if(this.name.indexOf("3DES")===0){if(N.length()!==24)throw new Error("Invalid Triple-DES key size: "+N.length()*8)}this._keys=B(N),this._init=!0},J("DES-ECB",Z.cipher.modes.ecb),J("DES-CBC",Z.cipher.modes.cbc),J("DES-CFB",Z.cipher.modes.cfb),J("DES-OFB",Z.cipher.modes.ofb),J("DES-CTR",Z.cipher.modes.ctr),J("3DES-ECB",Z.cipher.modes.ecb),J("3DES-CBC",Z.cipher.modes.cbc),J("3DES-CFB",Z.cipher.modes.cfb),J("3DES-OFB",Z.cipher.modes.ofb),J("3DES-CTR",Z.cipher.modes.ctr);function J(P,N){var C=function(){return new Z.des.Algorithm(P,N)};Z.cipher.registerAlgorithm(P,C)}var G=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],Y=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],H=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],K=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],z=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],W=[536870928,541065216,16384,541081616,541065216,16,541081616,4
`;B+="Encryption: "+q+`\r
`,B+="Comment: "+W+`\r
`;var D=Z.util.createBuffer();Y(D,$),G(D,K.e),G(D,K.n);var F=Z.util.encode64(D.bytes(),64),P=Math.floor(F.length/66)+1;B+="Public-Lines: "+P+`\r
`,B+=F;var N=Z.util.createBuffer();G(N,K.d),G(N,K.p),G(N,K.q),G(N,K.qInv);var C;if(!z)C=Z.util.encode64(N.bytes(),64);else{var L=N.length()+16-1;L-=L%16;var V=H(N.bytes());V.truncate(V.length()-L+N.length()),N.putBuffer(V);var M=Z.util.createBuffer();M.putBuffer(H("\x00\x00\x00\x00",z)),M.putBuffer(H("\x00\x00\x00\x01",z));var I=Z.aes.createEncryptionCipher(M.truncate(8),"CBC");I.start(Z.util.createBuffer().fillWithByte(0,16)),I.update(N.copy()),I.finish();var E=I.output;E.truncate(16),C=Z.util.encode64(E.bytes(),64)}P=Math.floor(C.length/66)+1,B+=`\r
Private-Lines: `+P+`\r
`,B+=C;var w=H("putty-private-key-file-mac-key",z),A=Z.util.createBuffer();Y(A,$),Y(A,q),Y(A,W),A.putInt32(D.length()),A.putBuffer(D),A.putInt32(N.length()),A.putBuffer(N);var R=Z.hmac.create();return R.start("sha1",w),R.update(A.bytes()),B+=`\r
Private-MAC: `+R.digest().toHex()+`\r
`,B},J.publicKeyToOpenSSH=function(K,z){var W="ssh-rsa";z=z||"";var $=Z.util.createBuffer();return Y($,W),G($,K.e),G($,K.n),W+" "+Z.util.encode64($.bytes())+" "+z},J.privateKeyToOpenSSH=function(K,z){if(!z)return Z.pki.privateKeyToPem(K);return Z.pki.encryptRsaPrivateKey(K,z,{legacy:!0,algorithm:"aes128"})},J.getPublicKeyFingerprint=function(K,z){z=z||{};var W=z.md||Z.md.md5.create(),$="ssh-rsa",q=Z.util.createBuffer();Y(q,$),G(q,K.e),G(q,K.n),W.start(),W.update(q.getBytes());var B=W.digest();if(z.encoding==="hex"){var D=B.toHex();if(z.delimiter)return D.match(/.{2}/g).join(z.delimiter);return D}else if(z.encoding==="binary")return B.getBytes();else if(z.encoding)throw new Error('Unknown encoding "'+z.encoding+'".');return B};function G(K,z){var W=z.toString(16);if(W[0]>="8")W="00"+W;var $=Z.util.hexToBytes(W);K.putInt32($.length),K.putBytes($)}function Y(K,z){K.putInt32(z.length),K.putString(z)}function H(){var K=Z.md.sha1.create(),z=arguments.length;for(var W=0;W<z;++W)K.update(arguments[W]);return K.digest()}}}),bM=W1({"node_modules/node-forge/lib/index.js"(Q,X){X.exports=y0(),NZ(),wo(),WQ(),D$(),pq(),jo(),kX(),So(),ko(),yo(),xM(),C$(),Y7(),jM(),vM(),xo(),gM(),SM(),wM(),N$(),d9(),EM(),vo(),hM(),d0()}}),go=W1({"node_modules/obsidian-daily-notes-interface/dist/main.js"(Q){Object.defineProperty(Q,"__esModule",{value:!0});var X=require("obsidian"),Z="YYYY-MM-DD",J="gggg-[W]ww",G="YYYY-MM",Y="YYYY-[Q]Q",H="YYYY";function K(_){var J1,B1;let L1=window.app.plugins.getPlugin("periodic-notes");return L1&&((B1=(J1=L1.settings)==null?void 0:J1[_])==null?void 0:B1.enabled)}function z(){var _,J1,B1,L1;try{let{internalPlugins:H1,plugins:M1}=window.app;if(K("daily")){let{format:X0,folder:t1,template:B0}=((J1=(_=M1.getPlugin("periodic-notes"))==null?void 0:_.settings)==null?void 0:J1.daily)||{};return{format:X0||Z,folder:(t1==null?void 0:t1.trim())||"",template:(B0==null?void 0:B0.trim())||""}}let{folder:u1,format:s1,template:a1}=((L1=(B1=H1.getPluginById("daily-notes"))==null?void 0:B1.instance)==null?void 0:L1.options)||{};return{format:s1||Z,folder:(u1==null?void 0:u1.trim())||"",template:(a1==null?void 0:a1.trim())||""}}catch(H1){console.info("No custom daily note settings found!",H1)}}function W(){var _,J1,B1,L1,H1,M1,u1;try{let s1=window.app.plugins,a1=(_=s1.getPlugin("calendar"))==null?void 0:_.options,X0=(B1=(J1=s1.getPlugin("periodic-notes"))==null?void 0:J1.settings)==null?void 0:B1.weekly;if(K("weekly"))return{format:X0.format||J,folder:((L1=X0.folder)==null?void 0:L1.trim())||"",template:((H1=X0.template)==null?void 0:H1.trim())||""};let t1=a1||{};return{format:t1.weeklyNoteFormat||J,folder:((M1=t1.weeklyNoteFolder)==null?void 0:M1.trim())||"",template:((u1=t1.weeklyNoteTemplate)==null?void 0:u1.trim())||""}}catch(s1){console.info("No custom weekly note settings found!",s1)}}function $(){var _,J1,B1,L1;let H1=window.app.plugins;try{let M1=K("monthly")&&((J1=(_=H1.getPlugin("periodic-notes"))==null?void 0:_.settings)==null?void 0:J1.monthly)||{};return{format:M1.format||G,folder:((B1=M1.folder)==null?void 0:B1.trim())||"",template:((L1=M1.template)==null?void 0:L1.trim())||""}}catch(M1){console.info("No custom monthly note settings found!",M1)}}function q(){var _,J1,B1,L1;let H1=window.app.plugins;try{let M1=K("quarterly")&&((J1=(_=H1.getPlugin("periodic-notes"))==null?void 0:_.settings)==null?void 0:J1.quarterly)||{};return{format:M1.format||Y,folder:((B1=M1.folder)==null?void 0:B1.trim())||"",template:((L1=M1.template)==null?void 0:L1.trim())||""}}catch(M1){console.info("No custom quarterly note settings found!",M1)}}function B(){var _,J1,B1,L1;let H1=window.app.plugins;try{let M1=K("yearly")&&((J1=(_=H1.getPlugin("periodic-notes"))==null?void 0:_.settings)==null?void 0:J1.yearly)||{};return{format:M1.format||H,folder:((B1=M1.folder)==null?void 0:B1.trim())||"",template:((L1=M1.template)==null?void 0:L1.trim())||""}}catch(M1){console.info("No custom yearly note settings found!",M1)}}function D(..._){let J1=[];for(let L1=0,H1=_.length;L1<H1;L1++)J1=J1.concat(_[L1].split("/"));let B1=[];for(let L1=0,H1=J1.length;L1<H1;L1++
`||s.charAt(f1)==="\r"&&s.charAt(f1+1)!==`
`)&&(y1++,h1===0&&(h1=f1+1)),f1--}var V0=R1+y1,K6=q1-h1;return F1[q1]={line:V0,lineStart:h1},{offset:q1,line:V0+1,column:K6+1}}function l8(s){if(!k1(s))throw new Error("not a parser: "+s)}function y4(s,q1){return typeof s=="string"?s.charAt(q1):s[q1]}function KQ(s){if(typeof s!="number")throw new Error("not a number: "+s)}function i9(s){if(typeof s!="function")throw new Error("not a function: "+s)}function $Q(s){if(typeof s!="string")throw new Error("not a string: "+s)}var N7=2,$J=3,A9=8,T7=5*A9,BJ=4*A9,M7=" ";function T8(s,q1){return new Array(q1+1).join(s)}function n9(s,q1,F1){var R1=q1-s.length;return R1<=0?s:T8(F1,R1)+s}function tB(s,q1,F1,R1){return{from:s-q1>0?s-q1:0,to:s+F1>R1?R1:s+F1}}function iO(s,q1){var F1,R1,y1,h1,f1,V0=q1.index,K6=V0.offset,V8=1;if(K6===s.length)return"Got the end of the input";if(A6(s)){var o6=K6-K6%A9,UQ=K6-o6,c8=tB(o6,T7,BJ+A9,s.length),VQ=m1(function(m6){return m1(function(kZ){return n9(kZ.toString(16),2,"0")},m6)},function(m6,kZ){var yZ=m6.length,g4=[],xZ=0;if(yZ<=kZ)return[m6.slice()];for(var vZ=0;vZ<yZ;vZ++)g4[xZ]||g4.push([]),g4[xZ].push(m6[vZ]),(vZ+1)%kZ==0&&xZ++;return g4}(s.slice(c8.from,c8.to).toJSON().data,A9));h1=function(m6){return m6.from===0&&m6.to===1?{from:m6.from,to:m6.to}:{from:m6.from/A9,to:Math.floor(m6.to/A9)}}(c8),R1=o6/A9,F1=3*UQ,UQ>=4&&(F1+=1),V8=2,y1=m1(function(m6){return m6.length<=4?m6.join(" "):m6.slice(0,4).join(" ")+" "+m6.slice(4).join(" ")},VQ),(f1=(8*(h1.to>0?h1.to-1:h1.to)).toString(16).length)<2&&(f1=2)}else{var SZ=s.split(/\r\n|[\n\r\u2028\u2029]/);F1=V0.column-1,R1=V0.line-1,h1=tB(R1,N7,$J,SZ.length),y1=SZ.slice(h1.from,h1.to),f1=h1.to.toString().length}var Xw=R1-h1.from;return A6(s)&&(f1=(8*(h1.to>0?h1.to-1:h1.to)).toString(16).length)<2&&(f1=2),T1(function(m6,kZ,yZ){var g4,xZ=yZ===Xw,vZ=xZ?"> ":M7;return g4=A6(s)?n9((8*(h1.from+yZ)).toString(16),f1,"0"):n9((h1.from+yZ+1).toString(),f1," "),[].concat(m6,[vZ+g4+" | "+kZ],xZ?[M7+T8(" ",f1)+" | "+n9("",F1," ")+T8("^",V8)]:[])},[],y1).join(`
`)}function rB(s,q1){return[`
`,"-- PARSING FAILED "+T8("-",50),`
`,iO(s,q1),`
`,(F1=q1.expected,F1.length===1?`Expected:
`+F1[0]:`Expected one of the following:
`+F1.join(", ")),`
`].join("");var F1}function eB(s){return s.flags!==void 0?s.flags:[s.global?"g":"",s.ignoreCase?"i":"",s.multiline?"m":"",s.unicode?"u":"",s.sticky?"y":""].join("")}function UJ(){for(var s=[].slice.call(arguments),q1=s.length,F1=0;F1<q1;F1+=1)l8(s[F1]);return c(function(R1,y1){for(var h1,f1=new Array(q1),V0=0;V0<q1;V0+=1){if(!(h1=g0(s[V0]._(R1,y1),h1)).status)return h1;f1[V0]=h1.value,y1=h1.index}return g0(q0(y1,f1),h1)})}function x4(){var s=[].slice.call(arguments);if(s.length===0)throw new Error("seqMap needs at least one argument");var q1=s.pop();return i9(q1),UJ.apply(null,s).map(function(F1){return q1.apply(null,F1)})}function VJ(){var s=[].slice.call(arguments),q1=s.length;if(q1===0)return PJ("zero alternates");for(var F1=0;F1<q1;F1+=1)l8(s[F1]);return c(function(R1,y1){for(var h1,f1=0;f1<s.length;f1+=1)if((h1=g0(s[f1]._(R1,y1),h1)).status)return h1;return h1})}function QU(s,q1){return b3(s,q1).or(v4([]))}function b3(s,q1){return l8(s),l8(q1),x4(s,q1.then(s).many(),function(F1,R1){return[F1].concat(R1)})}function I7(s){$Q(s);var q1="'"+s+"'";return c(function(F1,R1){var y1=R1+s.length,h1=F1.slice(R1,y1);return h1===s?q0(y1,h1):P6(R1,q1)})}function BQ(s,q1){(function(y1){if(!(y1 instanceof RegExp))throw new Error("not a regexp: "+y1);for(var h1=eB(y1),f1=0;f1<h1.length;f1++){var V0=h1.charAt(f1);if(V0!=="i"&&V0!=="m"&&V0!=="u"&&V0!=="s")throw new Error('unsupported regexp flag "'+V0+'": '+y1)}})(s),arguments.length>=2?KQ(q1):q1=0;var F1=function(y1){return RegExp("^(?:"+y1.source+")",eB(y1))}(s),R1=""+s;return c(function(y1,h1){var f1=F1.exec(y1.slice(h1));if(f1){if(0<=q1&&q1<=f1.length){var V0=f1[0],K6=f1[q1];return q0(h1+V0.length,K6)}return P6(h1,"valid match group (0 to "+f1.length+") in "+R1)}return P6(h1,R1)})}function v4(s){return c(function(q1,F1){return q0(F1,s)})}function PJ(s){return c(function(q1,F1){return P6(F1,s)})}function FJ(s){if(k1(s))return c(function(q1,F1){var R1=s._(q1,F1);return R1.index=F1,R1.value="",R1});if(typeof s=="string")return FJ(I7(s));if(s instanceof RegExp)return FJ(BQ(s));throw new Error("not a string, regexp, or parser: "+s)}function ZU(s){return l8(s),c(function(q1,F1){var R1=s._(q1,F1),y1=q1.slice(F1,R1.index);return R1.status?P6(F1,'not "'+y1+'"'):q0(F1,null)})}function DJ(s){return i9(s),c(function(q1,F1){var R1=y4(q1,F1);return F1<q1.length&&s(R1)?q0(F1+1,R1):P6(F1,"a character/byte matching "+s)})}function XU(s,q1){arguments.length<2&&(q1=s,s=void 0);var F1=c(function(R1,y1){return F1._=q1()._,F1._(R1,y1)});return s?F1.desc(s):F1}function m3(){return PJ("fantasy-land/empty")}a.parse=function(s){if(typeof s!="string"&&!A6(s))throw new Error(".parse must be called with a string or Buffer as its argument");var q1,F1=this.skip(_3)._(s,0);return q1=F1.status?{status:!0,value:F1.value}:{status:!1,index:zQ(s,F1.furthest),expected:F1.expected},delete y6[s],q1},a.tryParse=function(s){var q1=this.parse(s);if(q1.status)return q1.value;var F1=rB(s,q1),R1=new Error(F1);throw R1.type="ParsimmonError",R1.result=q1,R1},a.assert=function(s,q1){return this.chain(function(F1){return s(F1)?v4(F1):PJ(q1)})},a.or=function(s){return VJ(this,s)},a.trim=function(s){return this.wrap(s,s)},a.wrap=function(s,q1){return x4(s,this,q1,function(F1,R1){return R1})},a.thru=function(s){return s(this)},a.then=function(s){return l8(s),UJ(this,s).map(function(q1){return q1[1]})},a.many=function(){var s=this;return c(function(q1,F1){for(var R1=[],y1=void 0;;){if(!(y1=g0(s._(q1,F1),y1)).status)return g0(q0(F1,R1),y1);if(F1===y1.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");F1=y1.index,R1.push(y1.value)}})},a.tieWith=function(s){return $Q(s),this.map(function(q1){if(function(y1){if(!C0(y1))throw new Error("not an array: "+y1)}(q1),q1.length){$Q(q1[0]);for(var F1=q1[0],R1=1;R1<q1.length;R1++)$Q(q1[R1]),F1+=s+q1[R1];return F1}return""})},a.tie=function(){return this.tieWith("")},a.times=function(s,q1){var F1=this;return arguments.length<2&&(q1=s),KQ(s),KQ(q1),c(function(R1,y1){for(var h1=[],f1=void 0,V0=void 0
`),YU=I7(`\r
`),WU=VJ(YU,GU,JU).desc("newline"),Zw=VJ(WU,_3);c.all=oO,c.alt=VJ,c.any=nO,c.cr=JU,c.createLanguage=function(s){var q1={};for(var F1 in s)({}).hasOwnProperty.call(s,F1)&&function(R1){q1[R1]=XU(function(){return s[R1](q1)})}(F1);return q1},c.crlf=YU,c.custom=function(s){return c(s(q0,P6))},c.digit=aO,c.digits=sO,c.empty=m3,c.end=Zw,c.eof=_3,c.fail=PJ,c.formatError=rB,c.index=R7,c.isParser=k1,c.lazy=XU,c.letter=tO,c.letters=rO,c.lf=GU,c.lookahead=FJ,c.makeFailure=P6,c.makeSuccess=q0,c.newline=WU,c.noneOf=function(s){return DJ(function(q1){return s.indexOf(q1)<0}).desc("none of '"+s+"'")},c.notFollowedBy=ZU,c.of=v4,c.oneOf=function(s){for(var q1=s.split(""),F1=0;F1<q1.length;F1++)q1[F1]="'"+q1[F1]+"'";return DJ(function(R1){return s.indexOf(R1)>=0}).desc(q1)},c.optWhitespace=eO,c.Parser=c,c.range=function(s,q1){return DJ(function(F1){return s<=F1&&F1<=q1}).desc(s+"-"+q1)},c.regex=BQ,c.regexp=BQ,c.sepBy=QU,c.sepBy1=b3,c.seq=UJ,c.seqMap=x4,c.seqObj=function(){for(var s,q1={},F1=0,R1=(s=arguments,Array.prototype.slice.call(s)),y1=R1.length,h1=0;h1<y1;h1+=1){var f1=R1[h1];if(!k1(f1)){if(C0(f1)&&f1.length===2&&typeof f1[0]=="string"&&k1(f1[1])){var V0=f1[0];if(Object.prototype.hasOwnProperty.call(q1,V0))throw new Error("seqObj: duplicate key "+V0);q1[V0]=!0,F1++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(F1===0)throw new Error("seqObj expects at least one named parser, found zero");return c(function(K6,V8){for(var o6,UQ={},c8=0;c8<y1;c8+=1){var VQ,SZ;if(C0(R1[c8])?(VQ=R1[c8][0],SZ=R1[c8][1]):(VQ=null,SZ=R1[c8]),!(o6=g0(SZ._(K6,V8),o6)).status)return o6;VQ&&(UQ[VQ]=o6.value),V8=o6.index}return g0(q0(V8,UQ),o6)})},c.string=I7,c.succeed=v4,c.takeWhile=function(s){return i9(s),c(function(q1,F1){for(var R1=F1;R1<q1.length&&s(y4(q1,R1));)R1++;return q0(R1,q1.slice(F1,R1))})},c.test=DJ,c.whitespace=Qw,c["fantasy-land/empty"]=m3,c["fantasy-land/of"]=v4,c.Binary={bitSeq:W0,bitSeqObj:function(s){_1();var q1={},F1=0,R1=m1(function(h1){if(C0(h1)){var f1=h1;if(f1.length!==2)throw new Error("["+f1.join(", ")+"] should be length 2, got length "+f1.length);if($Q(f1[0]),KQ(f1[1]),Object.prototype.hasOwnProperty.call(q1,f1[0]))throw new Error("duplicate key in bitSeqObj: "+f1[0]);return q1[f1[0]]=!0,F1++,f1}return KQ(h1),[null,h1]},s);if(F1<1)throw new Error("bitSeqObj expects at least one named pair, got ["+s.join(", ")+"]");var y1=m1(function(h1){return h1[0]},R1);return W0(m1(function(h1){return h1[1]},R1)).map(function(h1){return T1(function(f1,V0){return V0[0]!==null&&(f1[V0[0]]=V0[1]),f1},{},m1(function(f1,V0){return[f1,h1[V0]]},y1))})},byte:function(s){if(_1(),KQ(s),s>255)throw new Error("Value specified to byte constructor ("+s+"=0x"+s.toString(16)+") is larger in value than a single byte.");var q1=(s>15?"0x":"0x0")+s.toString(16);return c(function(F1,R1){var y1=y4(F1,R1);return y1===s?q0(R1+1,y1):P6(R1,q1)})},buffer:function(s){return J6("buffer",s).map(function(q1){return Buffer.from(q1)})},encodedString:function(s,q1){return J6("string",q1).map(function(F1){return F1.toString(s)})},uintBE:n6,uint8BE:n6(1),uint16BE:n6(2),uint32BE:n6(4),uintLE:G9,uint8LE:G9(1),uint16LE:G9(2),uint32LE:G9(4),intBE:R9,int8BE:R9(1),int16BE:R9(2),int32BE:R9(4),intLE:HQ,int8LE:HQ(1),int16LE:HQ(2),int32LE:HQ(4),floatBE:J6("floatBE",4).map(function(s){return s.readFloatBE(0)}),floatLE:J6("floatLE",4).map(function(s){return s.readFloatLE(0)}),doubleBE:J6("doubleBE",8).map(function(s){return s.readDoubleBE(0)}),doubleLE:J6("doubleLE",8).map(function(s){return s.readDoubleLE(0)})},y.exports=c}])})}(zJ,zJ.exports);var X1=zJ.exports,y3=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26
`)[0];let g=y.substring(2).trim();return X1.makeSuccess(O+y.length,g)}),namedField:(U)=>X1.alt(U.explicitNamedField,uO(I9.field).map(([O,y])=>KJ.named(pO(y),O))),sortField:(U)=>X1.seqMap(I9.field.skip(X1.optWhitespace),X1.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(O,y)=>{let g=y.length==0?"ascending":y[0].toLowerCase();if(g=="desc")g="descending";if(g=="asc")g="ascending";return{field:O,direction:g}}),headerClause:(U)=>U.queryType.chain((O)=>{switch(O){case"table":return aB(()=>({type:O,fields:[],showId:!0}),X1.seqMap(X1.regexp(/WITHOUT\s+ID/i).skip(X1.optWhitespace).atMost(1),X1.sepBy(U.namedField,X1.string(",").trim(X1.optWhitespace)),(y,g)=>{return{type:O,fields:g,showId:y.length==0}}));case"list":return aB(()=>({type:O,format:void 0,showId:!0}),X1.seqMap(X1.regexp(/WITHOUT\s+ID/i).skip(X1.optWhitespace).atMost(1),I9.field.atMost(1),(y,g)=>{return{type:O,format:g.length==1?g[0]:void 0,showId:y.length==0}}));case"task":return X1.succeed({type:O});case"calendar":return X1.whitespace.then(X1.seqMap(U.namedField,(y)=>{return{type:O,showId:!0,field:y}}));default:return X1.fail(`Unrecognized query type '${O}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:(U)=>X1.seqMap(X1.regexp(/FROM/i),X1.whitespace,I9.source,(O,y,g)=>g),whereClause:(U)=>X1.seqMap(X1.regexp(/WHERE/i),X1.whitespace,I9.field,(O,y,g)=>{return{type:"where",clause:g}}).desc("WHERE <expression>"),sortByClause:(U)=>X1.seqMap(X1.regexp(/SORT/i),X1.whitespace,U.sortField.sepBy1(X1.string(",").trim(X1.optWhitespace)),(O,y,g)=>{return{type:"sort",fields:g}}).desc("SORT field [ASC/DESC]"),limitClause:(U)=>X1.seqMap(X1.regexp(/LIMIT/i),X1.whitespace,I9.field,(O,y,g)=>{return{type:"limit",amount:g}}).desc("LIMIT <value>"),flattenClause:(U)=>X1.seqMap(X1.regexp(/FLATTEN/i).skip(X1.whitespace),U.namedField,(O,y)=>{return{type:"flatten",field:y}}).desc("FLATTEN <value> [AS <name>]"),groupByClause:(U)=>X1.seqMap(X1.regexp(/GROUP BY/i).skip(X1.whitespace),U.namedField,(O,y)=>{return{type:"group",field:y}}).desc("GROUP BY <value> [AS <name>]"),clause:(U)=>X1.alt(U.fromClause,U.whereClause,U.sortByClause,U.limitClause,U.groupByClause,U.flattenClause),query:(U)=>X1.seqMap(U.headerClause.trim(f3),U.fromClause.trim(f3).atMost(1),U.clause.trim(f3).many(),(O,y,g)=>{return{header:O,source:y.length==0?c9.folder(""):y[0],operations:g,settings:k3}})}),f3=X1.alt(X1.whitespace,sB.comment).many().map((U)=>U.join("")),lO=(U)=>{var O;if(U)return(O=U.plugins.plugins.dataview)==null?void 0:O.api;else return window.DataviewAPI},cO=(U)=>U.plugins.enabledPlugins.has("dataview");Q.DATE_SHORTHANDS=g3,Q.DURATION_TYPES=v3,Q.EXPRESSION=I9,Q.KEYWORDS=h3,Q.QUERY_LANGUAGE=sB,Q.getAPI=lO,Q.isPluginEnabled=cO,Q.parseField=dO}}),xX=W1({"node_modules/bytes/index.js"(Q,X){X.exports=H,X.exports.format=K,X.exports.parse=z;var Z=/\B(?=(\d{3})+(?!\d))/g,J=/(?:\.0*|(\.[^0]+)0+)$/,G={b:1,kb:1024,mb:1048576,gb:1073741824,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},Y=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function H(W,$){if(typeof W==="string")return z(W);if(typeof W==="number")return K(W,$);return null}function K(W,$){if(!Number.isFinite(W))return null;var q=Math.abs(W),B=$&&$.thousandsSeparator||"",D=$&&$.unitSeparator||"",F=$&&$.decimalPlaces!==void 0?$.decimalPlaces:2,P=Boolean($&&$.fixedDecimals),N=$&&$.unit||"";if(!N||!G[N.toLowerCase()])if(q>=G.pb)N="PB";else if(q>=G.tb)N="TB";else if(q>=G.gb)N="GB";else if(q>=G.mb)N="MB";else if(q>=G.kb)N="KB";else N="B";var C=W/G[N.toLowerCase()],L=C.toFixed(F);if(!P)L=L.replace(J,"$1");if(B)L=L.split(".").map(function(V,M){return M===0?V.replace(Z,B):V}).join(".");return L+D+N}function z(W){if(typeof W==="number"&&!isNaN(W))return W;if(typeof W!=="string")return null;var $=Y.exec(W),q,B="b";if(!$)q=parseInt(W,10),B="b";else q=parseFloat($[1]),B=$[4].toLowerCase();if(isNaN(q))return null;return Math.floor(G[B]*q)}}}),iq=W1({"node_modules/content-type/index.js"(Q){var X=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,Z=/^[\u000b\u002
at `+w[R].toString();return A}function z(w){if(!w)throw new TypeError("argument namespace is required");var A=L(),R=D(A[1]),T=R[0];function S(v){B.call(S,v)}return S._file=T,S._ignored=$(w),S._namespace=w,S._traced=q(w),S._warned=Object.create(null),S.function=M,S.property=I,S}function W(w,A){var R=typeof w.listenerCount!=="function"?w.listeners(A).length:w.listenerCount(A);return R>0}function $(w){if(process.noDeprecation)return!0;var A=process.env.NO_DEPRECATION||"";return G(A,w)}function q(w){if(process.traceDeprecation)return!0;var A=process.env.TRACE_DEPRECATION||"";return G(A,w)}function B(w,A){var R=W(process,"deprecation");if(!R&&this._ignored)return;var T,S,v,h,x=0,p=!1,n=L(),t=this._file;if(A)h=A,v=D(n[1]),v.name=h.name,t=v[0];else x=2,h=D(n[x]),v=h;for(;x<n.length;x++)if(T=D(n[x]),S=T[0],S===t)p=!0;else if(S===this._file)t=this._file;else if(p)break;var Y1=T?h.join(":")+"__"+T.join(":"):void 0;if(Y1!==void 0&&Y1 in this._warned)return;this._warned[Y1]=!0;var G1=w;if(!G1)G1=v===h||!v.name?F(h):F(v);if(R){var V1=E(this._namespace,G1,n.slice(x));process.emit("deprecation",V1);return}var C1=process.stderr.isTTY?N:P,N1=C1.call(this,G1,T,n.slice(x));process.stderr.write(N1+`
`,"utf8")}function D(w){var A=w.getFileName()||"<anonymous>",R=w.getLineNumber(),T=w.getColumnNumber();if(w.isEval())A=w.getEvalOrigin()+", "+A;var S=[A,R,T];return S.callSite=w,S.name=w.getFunctionName(),S}function F(w){var{callSite:A,name:R}=w;if(!R)R="<anonymous@"+C(w)+">";var T=A.getThis(),S=T&&A.getTypeName();if(S==="Object")S=void 0;if(S==="Function")S=T.name||S;return S&&A.getMethodName()?S+"."+R:R}function P(w,A,R){var T=new Date().toUTCString(),S=T+" "+this._namespace+" deprecated "+w;if(this._traced){for(var v=0;v<R.length;v++)S+=`
at `+R[v].toString();return S}if(A)S+=" at "+C(A);return S}function N(w,A,R){var T="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+w+"\x1B[39m";if(this._traced){for(var S=0;S<R.length;S++)T+=`
\x1B[36mat `+R[S].toString()+"\x1B[39m";return T}if(A)T+=" \x1B[36m"+C(A)+"\x1B[39m";return T}function C(w){return Z(J,w[0])+":"+w[1]+":"+w[2]}function L(){var w=Error.stackTraceLimit,A={},R=Error.prepareStackTrace;Error.prepareStackTrace=V,Error.stackTraceLimit=Math.max(10,w),Error.captureStackTrace(A);var T=A.stack.slice(1);return Error.prepareStackTrace=R,Error.stackTraceLimit=w,T}function V(w,A){return A}function M(w,A){if(typeof w!=="function")throw new TypeError("argument fn must be a function");var R=H(w.length),T=L(),S=D(T[1]);S.name=w.name;var v=new Function("fn","log","deprecate","message","site",`"use strict"
return function (`+R+`) {log.call(deprecate, message, site)
return fn.apply(this, arguments)
}`)(w,B,this,A,S);return v}function I(w,A,R){if(!w||typeof w!=="object"&&typeof w!=="function")throw new TypeError("argument obj must be object");var T=Object.getOwnPropertyDescriptor(w,A);if(!T)throw new TypeError("must call property on owner object");if(!T.configurable)throw new TypeError("property must be configurable");var S=this,v=L(),h=D(v[1]);if(h.name=A,"value"in T)T=Y(w,A,R);var{get:x,set:p}=T;if(typeof x==="function")T.get=function n(){return B.call(S,R,h),x.apply(this,arguments)};if(typeof p==="function")T.set=function n(){return B.call(S,R,h),p.apply(this,arguments)};Object.defineProperty(w,A,T)}function E(w,A,R){var T=new Error,S;return Object.defineProperty(T,"constructor",{value:E}),Object.defineProperty(T,"message",{configurable:!0,enumerable:!1,value:A,writable:!0}),Object.defineProperty(T,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(T,"namespace",{configurable:!0,enumerable:!1,value:w,writable:!0}),Object.defineProperty(T,"stack",{configurable:!0,enumerable:!1,get:function(){if(S!==void 0)return S;return S=K.call(this,R)},set:function v(h){S=h}}),T}}}),M$=W1({"node_modules/setprototypeof/index.js"(Q,X){X.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?Z:J);function Z(G,Y){return G.__proto__=Y,G}function J(G,Y){for(var H in Y)if(!Object.prototype.hasOwnProperty.call(G,H))G[H]=Y[H];return G}}}),fo=W1({"node_modules/statuses/codes.json"(Q,X){X.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}}}),nq=W1({"node_modules/statuses/index.js"(Q,X){var Z=fo();X.exports=K,K.message=Z,K.code=J(Z),K.codes=G(Z),K.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},K.empty={204:!0,205:!0,304:!0},K.retry={502:!0,503:!0,504:!0};function J(z){var W={};return Object.keys(z).forEach(function $(q){var B=z[q],D=Number(q);W[B.toLowerCase()]=D}),W}function G(z){return Object.keys(z).map(function W($){return Number($)})}function Y(z){var W=z.toLowerCase();if(!Object.prototype.hasOwnProperty.call(K.code,W))throw new Error('invalid status message: "'+z+'"');return K.code[W]}function H(z){if(!Object.prototype.hasOwnProperty.call(K.message,z))throw new Error("invalid status code: "+z);return K.message[z]}function K(z){if(typeof z==="number")return H(z);if(typeof z!=="string")throw new TypeError("code must be a number or string");var W=parseInt(z,10);if(!isNaN(W))return H(W);return Y(z)}}}),bo=W1({"node_modules/inherits/inherits_browser.js"(Q,X){if(typeof Object.create==="function")X.exports=function Z(J,G){if(G)J.super_=G,J.prototype=Object.create(G.prototype,{constructor:{value:J,enumerable:
`).map(function(D){return D.trim()}).join(" ")},Q.formatters.O=function(B){return this.inspectOpts.colors=this.useColors,J.inspect(B,this.inspectOpts)};function H(B){var D=this.namespace,F=this.useColors;if(F){var P=this.color,N="\x1B[3"+(P<8?P:"8;5;"+P),C=" "+N+";1m"+D+" \x1B[0m";B[0]=C+B[0].split(`
`).join(`
`+C),B.push(N+"m+"+Q.humanize(this.diff)+"\x1B[0m")}else B[0]=K()+D+" "+B[0]}function K(){if(Q.inspectOpts.hideDate)return"";else return new Date().toISOString()+" "}function z(){return process.stderr.write(J.format.apply(J,arguments)+`
`)}function W(B){if(B==null)delete process.env.DEBUG;else process.env.DEBUG=B}function $(){return process.env.DEBUG}function q(B){B.inspectOpts={};var D=Object.keys(Q.inspectOpts);for(var F=0;F<D.length;F++)B.inspectOpts[D[F]]=Q.inspectOpts[D[F]]}Q.enable($())}}),oq=W1({"node_modules/body-parser/node_modules/debug/src/index.js"(Q,X){if(typeof process==="undefined"||process.type==="renderer")X.exports=po();else X.exports=co()}}),io=W1({"node_modules/ee-first/index.js"(Q,X){X.exports=Z;function Z(G,Y){if(!Array.isArray(G))throw new TypeError("arg must be an array of [ee, events...] arrays");var H=[];for(var K=0;K<G.length;K++){var z=G[K];if(!Array.isArray(z)||z.length<2)throw new TypeError("each array member must be [ee, events...]");var W=z[0];for(var $=1;$<z.length;$++){var q=z[$],B=J(q,D);W.on(q,B),H.push({ee:W,event:q,fn:B})}}function D(){F(),Y.apply(null,arguments)}function F(){var N;for(var C=0;C<H.length;C++)N=H[C],N.ee.removeListener(N.event,N.fn)}function P(N){Y=N}return P.cancel=F,P}function J(G,Y){return function H(K){var z=new Array(arguments.length),W=this,$=G==="error"?K:null;for(var q=0;q<z.length;q++)z[q]=arguments[q];Y($,W,G,z)}}}}),O4=W1({"node_modules/on-finished/index.js"(Q,X){X.exports=Y,X.exports.isFinished=H;var Z=q(),J=io(),G=typeof setImmediate==="function"?setImmediate:function(D){process.nextTick(D.bind.apply(D,arguments))};function Y(D,F){if(H(D)!==!1)return G(F,null,D),D;return z(D,B(F)),D}function H(D){var F=D.socket;if(typeof D.finished==="boolean")return Boolean(D.finished||F&&!F.writable);if(typeof D.complete==="boolean")return Boolean(D.upgrade||!F||!F.readable||D.complete&&!D.readable);return}function K(D,F){var P,N,C=!1;function L(M){P.cancel(),N.cancel(),C=!0,F(M)}P=N=J([[D,"end","finish"]],L);function V(M){if(D.removeListener("socket",V),C)return;if(P!==N)return;N=J([[M,"error","close"]],L)}if(D.socket){V(D.socket);return}if(D.on("socket",V),D.socket===void 0)$(D,V)}function z(D,F){var P=D.__onFinished;if(!P||!P.queue)P=D.__onFinished=W(D),K(D,P);P.queue.push(F)}function W(D){function F(P){if(D.__onFinished===F)D.__onFinished=null;if(!F.queue)return;var N=F.queue;F.queue=null;for(var C=0;C<N.length;C++)N[C](P,D)}return F.queue=[],F}function $(D,F){var P=D.assignSocket;if(typeof P!=="function")return;D.assignSocket=function N(C){P.call(this,C),F(C)}}function q(){try{return require("async_hooks")}catch(D){return{}}}function B(D){var F;if(Z.AsyncResource)F=new Z.AsyncResource(D.name||"bound-anonymous-fn");if(!F||!F.runInAsyncScope)return D;return F.runInAsyncScope.bind(F,D,null)}}}),dM=W1({"node_modules/destroy/index.js"(Q,X){var Z=require("events").EventEmitter,J=require("fs").ReadStream,G=require("stream"),Y=require("zlib");X.exports=H;function H(C,L){if(B(C))K(C);else if(D(C))W(C);else if($(C))C.destroy();if(q(C)&&L)C.removeAllListeners("error"),C.addListener("error",F);return C}function K(C){if(C.destroy(),typeof C.close==="function")C.on("open",N)}function z(C){if(C._hadError===!0){var L=C._binding===null?"_binding":"_handle";C[L]={close:function(){this[L]=null}}}C.close()}function W(C){if(typeof C.destroy==="function")if(C._binding)if(C.destroy(),C._processing)C._needDrain=!0,C.once("drain",P);else C._binding.clear();else if(C._destroy&&C._destroy!==G.Transform.prototype._destroy)C.destroy();else if(C._destroy&&typeof C.close==="function")C.destroyed=!0,C.close();else C.destroy();else if(typeof C.close==="function")z(C)}function $(C){return C instanceof G&&typeof C.destroy==="function"}function q(C){return C instanceof Z}function B(C){return C instanceof J}function D(C){return C instanceof Y.Gzip||C instanceof Y.Gunzip||C instanceof Y.Deflate||C instanceof Y.DeflateRaw||C instanceof Y.Inflate||C instanceof Y.InflateRaw||C instanceof Y.Unzip}function F(){}function P(){this._binding.clear()}function N(){if(typeof this.fd==="number")this.close()}}}),MZ=W1({"node_modules/safer-buffer/safer.js"(Q,X){var Z=require("buffer"),J=Z.Buffer,G={},Y;for(Y in Z){if(!Z.hasOwnProperty(Y))continue;if(Y==="SlowBuffer"||Y==="Buffer")continue;G[Y]=Z[Y]}var H=G.Buffer={};for(Y in J){if(!J.hasOwnProperty
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$ルェ&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ツーツキ竏吮笆停楳笏や半笏、笏ャ笏懌閥笏絶伯笏披曝ホイ竏槃アツスツシ竕按ォツサスツツュつ」ツ、ソス趣コ擾コ包コ叮鯉コ晢コ。・ルル。ル「ル」ル、ル・ルヲルァルィルゥ滞幢コアケリ淞「€サ奇コ具コ搾コ托コ難コ暦コ幢コ滂コ」ソサ具サ渉ヲツャテキテ暦サ菓€難サ暦サ幢サ滂サ」鯉サ趣サ搾サ。スル托サ・撰サ包サオ晢サ呻サア笆ス`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"シテゥテテァテェテォティテッテョテャテ嘉ヲテエテカテイテサテケテソテ姪愿クツテ倪ぉニ津テュテウテコテアテ堕ェツコツソ竚青ャツスツシツツォツ笆鯛亦笆凪狽笏笊問封笊笊鯛風笊昶復笊帚柏笏披閥笏ャ笏懌楳笏シ笊樞福笊壺部笊ゥ笊ヲ笊笊絶噴笊ァ笊ィ笊笊吮葺笊停蕪笊ォ笊ェ笏倪伯笆遺埋笆娯鱒笆€ホアテ湮苫€マδオマヲホ佩ゥホエ竏槃オ竏ゥ竕ツア竕テキ竕按ー竏卍キ竏壺ツイ笆"},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"ミ籍岱漬寅頒片孟厘侑厰墟嶢慴斷榧渙ミヲミァミィミゥミェミォミャミュミョミッミーミアミイミウミエミオミカミキミクミケミコミサミシミスミセミソ笆鯛亦笆凪狽笏笊問封笊笊鯛風笊昶復笊帚柏笏披閥笏ャ笏懌楳笏シ笊樞福笊壺部笊ゥ笊ヲ笊笊絶噴笊ァ笊ィ笊笊吮葺笊停蕪笊ォ笊ェ笏倪伯笆遺埋笆娯鱒笆€€びτ尉禾貫錦袴采紗紹厘紗楪ー竏卍キ竏壺"},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"スホソスツキツャツヲ窶倪€厥遺€偏火莞ェホ鯉ソススホ斜ォツゥホ渉イツウホャツホュホョホッマ莞積狐歳対槻鳶釆偏茂猟スホ佩卍ォツサ笆鯛亦笆凪狽笏ホ墅嶄慚昶淵笊鯛風笊斟榻溪柏笏披閥笏ャ笏懌楳笏シホ笊壺部笊ゥ笊ヲ笊笊絶噴ホホヲホァホィホゥホアホイホウ笏倪伯笆遺埋ホエホオ笆€ホカホキホクホケホコホサホシホスホセホソマ€ρぱュツアマァマ夷ーツィマ珂勤ーマ寂蔓ツ"},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€つδ按可環仰個債篠渉青堕陳督板閉鳴猟伉卍堋崢慊敖楪淞ツヲツァツィツゥツェツォツャツュツョ窶セツーツアツイツウツエツオツカツキツクツケツコツサツシツスツセツソテ€づε暗嘉甘凝古催偲焦テ妥津禿氾陛姪療佚凖堙崚愿敘ステ淌テヲテァティテゥテェテォテャテュテョテッナテアテイテウテエテオテカテキテクテケテコテサテシテスナセテソ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"暗療キアツ遺蔓笏や楳笏絶伯笏披曝ソ奇サー趣サ擾サ撰サカシツクツ具コ托コ暦コ幢コ滂コリ個ュウルルヲルァルィルゥキリ幢コサソ韓滂サ筋リヲリァリィリゥリェリォリャリュリョリッリーリアリイリウリエリオリカリキケリコ鯉コゑココ趣サ遁€異菓館緊雇裁勺詔拙胎抵サ暦サ幢サ滂"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€つδ按可環仰個債篠渉青堕陳督板閉鳴猟伉卍堋崢慊敖楪淞ぴ籍威禍諌巾個ュミ社紹籍岱漬寅頒片孟厘侑厰墟嶢慴斷榧渙ミヲミァミィミゥミェミォミャミュミョミッミーミアミイミウミエミオミカミキミクミケミコミサミシミスミセミソム€びτ尉禾貫錦袴采紗鞘ム帯辻帯飯篇毛林佯厶墫嶝慊ァム樮"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"ミ籍岱漬寅頒片孟厘侑厰墟嶢慴斷榧渙ミヲミァミィミゥミェミォミャミュミョミッミーミアミイミウミエミオミカミキミクミケミコミサミシミスミセミソ笆鯛亦笆凪狽笏笊問封笊笊鯛風笊昶復笊帚柏笏披閥笏ャ笏懌楳笏シ笊樞福笊壺部笊ゥ笊ヲ笊笊絶噴笊ァ笊ィ笊笊吮葺笊停蕪笊ォ笊ェ笏倪伯笆遺埋笆娯鱒笆€€びτ尉禾貫錦袴采紗紹待脊岱猟キ竏壺"},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€つδ按可環仰個債篠渉青堕陳督板閉鳴猟伉卍堋崢慊敖楪淞ツヲツァナ督ゥツェツォツャツュツョツッツーツアツイツウナクツオツカツキナ陳ケツコツサツシツスツセツソテ€てづ暗嘉甘粁€テ催偲焼静体嘉禿犯テ姪療佚凖堙崚愴ッフε淌トεテヲテァティテゥテェテォフュテョテット妥アフテウテエニテカテキテクテケテコテサテシニー竄ォテソ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€つδ按可環仰個債篠渉青堕陳督板閉鳴猟伉卍堋崢慊敖楪淞コもココ謂コェ犲癌コ財コ扉コ歩コ籾コ伶コ吭コ壟コ巵コ憫コ杳コ樅コ游コ犲ァ犲ォ犲ュ犲ョス犲ッ犲ー犲イ犲ウ犲エ犲オ犲カ犲キ犲ク犲ケ犲シ犲ア犲サ犲スス狃€サもササ謂サ霞サ癌サ金サ呉サ財サソス狃憫サ昶くス狃説サ隊サ亭サ内サ扉サ歩サ籾サ伶サ倨サ呻ソススツツャツヲ"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"ス犹謂ククもクク謂ク霞ク癌ク金ク呉ク財ク錫ク鐘ク説ク隊ク亭ク内ク扉ク歩ク籾ク伶ク倨ク吭ク壟ク巵ク憫ク杳ク樅ク游ク犧ヲ犧ァ犧ィ犧ゥ犧ェ犧ォ犧ャ犧ュ犧ョ犧ッ犧ー犧ア犧イ犧
\v\f\r\x0E\x0F\x10盻ィ盻ー盻イ盻カ盻クテ昵サエ\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~テ€蘯「テε≪コ蘯カ蘯ャテ違ココ蘯シテ蚊コク盻吾サ案ィテ冴サ甘低サ偲陛乍サ吾サ倔サ憮サ榱サ盻壯サ「テ吼サヲナィツトづづ甘犯ニット斉ε「テェテエニ。ニート黛コーフ€フ歌ξ⇔」テ蘯」テ」テ。蘯。蘯イ蘯ア蘯ウ蘯オ蘯ッ蘯エ蘯ョ蘯ヲ蘯ィ蘯ェ蘯、盻€蘯キ蘯ァ蘯ゥ蘯ォ蘯・蘯ュティ盻ゃコサ蘯ステゥ蘯ケ盻≪サコソ盻ャ盻蚊サコセ盻墜ゥテュ盻凝イ盻批サ湘オテウ盻冴サ乍サ甫サ例サ黛サ吼サ昵サ溂サ。盻帋サ」テケ盻貰サァナゥテコ盻・盻ォ盻ュ盻ッ盻ゥ盻ア盻ウ盻キ盻ケテス盻オ盻秦},georgianacademy:{type:"_sbcs",chars:"€≫€堡停€€ヲ窶€ーナ窶ケナ陳債篠渉絶€€€€€「窶凪€藩懌窶コナ督敖槐クツツヲツァツィツゥツェツォツャツュツョツッツーツアツイツウツエツオツカツキツクツケツコツサツシツスツセツソ痺雪ヱ痺低ン痺批ヵ痺貰痺倔痺壯痺憮痺榱Α痺痺ヲ痺ァ痺ィ痺ゥ痺ェ痺ォ痺ャ痺ュ痺ョ痺ッ痺ー痺ア痺イ痺ウ痺エ痺オ痺カテァティテゥテェテォテャテュテョテッテーテアテイテウテエテオテカテキテクテケテコテサテシテステセテソ"},georgianps:{type:"_sbcs",chars:"€≫€堡停€€ヲ窶€ーナ窶ケナ陳債篠渉絶€€€€€「窶凪€藩懌窶コナ督敖槐クツツヲツァツィツゥツェツォツャツュツョツッツーツアツイツウツエツオツカツキツクツケツコツサツシツスツセツソ痺雪ヱ痺低ン痺批ヵ痺貰Τ痺例痺吼痺帋痺イ痺昵痺溂Β痺痺ウ痺痺ヲ痺ァ痺ィ痺ゥ痺ェ痺ォ痺ャ痺ュ痺ョ痺エ痺ッ痺ー痺オテヲテァティテゥテェテォテャテュテョテッテーテアテイテウテエテオテカテキテクテケテコテサテシテステセテソ"},pt154:{type:"_sbcs",chars:"メ猛蔦ョメ凪€€ヲメカメョメイメッメメ墺コメクメ冷€€€€€「窶凪€挽ウメキメメ嶬サメケツミ紗榧意ィメ來ーツァミゥモ伉ォツャモッツョメ慊ーメアミ猛簒ゥツカツキム鯛モ卍サム來ェメォメ斷籍岱漬寅頒片孟厘侑厰墟嶢慴斷榧渙ミヲミァミィミゥミェミォミャミュミョミッミーミアミイミウミエミオミカミキミクミケミコミサミシミスミセミソム€びτ尉禾貫錦袴采紗"},viscii:{type:"_sbcs",chars:`\x00\x01蘯イ\x03\x04蘯エ蘯ェ\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13盻カ\x15\x16\x17\x18盻ク\x1A\x1B\x1C\x1D盻エ\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~蘯ョ蘯ー蘯カ蘯、蘯ヲ蘯ィ蘯ャ蘯シ蘯ク蘯セ盻€盻ゃササ雪サ低サ批サ貰サ倔サ「盻壯サ憮サ榱サ眼サ若サ吾サ違サヲナィ盻、盻イテ甫コッ蘯ア蘯キ蘯・蘯ァ蘯ゥ蘯ュ蘯ス蘯ケ蘯ソ盻≪ササ黛サ乍サ甫サ例サ盻吼サ昵サ溂サ吟サー盻ィ盻ェ盻ャニ。盻嵌ッテ€テコ「トゃコウ蘯オテ暗嘉眼ココテ古再ィ盻ウト雪サゥテ津禿批コ。盻キ盻ォ盻ュテ凖壯サケ盻オテ昵サ。ニーテテ。テ「テ」蘯」トサッ蘯ォティテゥテェ蘯サテャテュトゥ盻夏黛サアテイテウテエテオ盻障サ冴サ・テケテコナゥ盻ァテス盻」盻ョ`},iso646cn:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#ツ・%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}窶セス`},iso646jp:{type:"_sbcs",chars:`\x00\x01\x02\x03\x04\x05\x06\x07\b
\v\f\r\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[ツ・]^_\`abcdefghijklmnopqrstuvwxyz{|}窶セス`},hproman8:{type:"_sbcs",chars:"ツ€ツつδ按可環仰個債篠渉青堕陳督板閉鳴猟伉卍堋崢慊敖楪淞テ€テづ暗甘凝偲渉エヒ桐ィヒ愿凖帚うツッテ敕スツーテァテ妥アツ。ツソツ、ツ」ツ・ツァニ陳「テ「テェテエテサテ。テゥテウテコテティテイテケテ、テォテカテシテョテ佚・テュテクテヲテャテ姪愿嘉ッテ淌氾ε」テ静ーテ催古禿津陛オナナ。テ塲クテソテ榲セツキツオツカツセ窶板シツスツェツコツォ笆ツサツアス"},macintosh:{type:"_sbcs",chars:"テ嘉妥姪愿。テテ「テ、テ」テ・テァテゥティテェテォテュテャテョテッテアテウテイテエテカテオテコテケテサテシ窶ツーツ「ツ」ツァ窶「ツカテ淞ョツゥ邃「ツエツィ竕ツア竕、竕・ツ・ツオ竏や竏粧€竏ォツェツコ邃ヲテヲテクツソツ。ツャ竏堡停沿竏ォツサ窶ヲツテ€テε頁椎凪€凪€披€懌€昶€倪€凖キ笳甘ソナク竅、窶ケ窶コャや€。ツキ窶壺€樞€ーテづ甘凝暗催偲湘古禿費ソステ津堙崚卞アヒ慊ッヒ侏厖堋クヒ斃嵳"},ascii:{type:"_sbcs",chars:"ス"},tis620:{type:"_sbcs",chars:"ス犧≒クもクク謂ク霞ク癌ク金ク呉ク財ク錫ク鐘ク説ク隊ク亭ク内ク扉ク歩ク籾ク伶ク倨ク吭ク壟ク巵ク憫ク杳ク樅ク游ク犧。犧「犧」犧、犧・犧ヲ犧ァ犧ィ犧ゥ犧ェ犧ォ犧ャ犧ュ犧ョ犧ッ犧ー犧ア犧イ犧ウ犧エ犧オ犧カ犧キ犧ク犧ケ犧コス犧ソ犹€犹≒ケもケケ謂ケ霞ケ癌ケ金ケ呉ケ財ケ錫ケ鐘ケ説ケ隊ケ亭ケ内ケ扉ケ歩ケ籾ケ伶ケ倨ケ吭ケ壟ケ幢ソスス"}}}}),Za=W1({"node_modules/iconv-lite/encodings/dbcs-codec.js"(Q){var X=MZ().Buffer;Q._dbcs=W;var Z=-1,J=-2,G=-10,Y=-1000,H=new Array(256),K=-1;for(z=0;z<256;z++)H[z]=Z;var z;function W(D,F){if(this.encodingName=D.encodingName,!D)throw new Error("DBCS codec is called without the data.");if(!D.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var P=D.table();this.decodeTables=[],this.decodeTables[0]=H.slice(0),this.decodeTableSeq=[];for(var N=0;N<P.length;N++)this._addDecodeChunk(P[N]);this.defaultCharUnicode=F.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var C={};if(D.encodeSkipVals)for(var N=0;N<D.encodeSkipVals.length;N++){var L=D.encodeSkipVals[N];if(typeof L==="number")C[L]=!0;else for(var V=L.from;V<=L.to;V++)C[V]=!0}if(this._fillEncodeTable(0,0,C),D.encodeAdd){for(var M in D.encodeAdd)if(Object.prototype.hasOwnProperty.call(D.encodeAdd,M))this._setEncodeChar(M.charCodeAt(0),D.encodeAdd[M])}if(this.defCharSB=this.encodeTable[0][F.defaultCharSingleByte.charCodeAt(0)],this.defCharSB===Z)this.defCharSB=this.encodeTable[0]["?"];if(this.defCharSB===Z)this.defCharSB=63;if(typeof D.gb18030==="function"){this.gb18030=D.gb18030();var I=this.decodeTables.length,E=this.decodeTables[I]=H.slice(0),w=this.decodeTables.length,A=this.decodeTables[w]=H.slice(0);for(var N=129;N<=254;N++){var R=Y-this.decodeTables[0][N],T=this.decodeTables[R];for(var V=48;V<=57;V++)T[V]=Y-I}for(var N=129;N<=254;N++)E[N]=Y-w;for(var N=48;N<=57;N++)A[N]=J}}W.prototype.encoder=$,W.prototype.decoder=q,W.prototype._getDecodeTrieNode=function(D){var F=[];for(;D>0;D>>=8)F.push(D&255);if(F.length==0)F.push(0);var P=this.decodeTables[0];for(var N=F.length-1;N>0;N--){var C=P[F[N]];if(C==Z)P[F[N]]=Y-this.decodeTables.length,this.decodeTables.push(P=H.slice(0));else if(C<=Y)P=this.decodeTables[Y-C];else throw new Error("Overwrite byte in "+this.encodingName+", addr: "+D.toString(16))}return P},W.prototype._addDecodeChunk=function(D){var F=parseInt(D[0],16),P=this._getDecodeTrieNode(F);F=F&255;for(var N=1;N<D.length;N++){var C=D[N];if(typeof C==="string")fo
`)>=0)return!1;return!0}function x0($1,U1){var z0;if($1.indent==="\t")z0="\t";else if(typeof $1.indent==="number"&&$1.indent>0)z0=T.call(Array($1.indent+1)," ");else return null;return{base:z0,prev:T.call(Array(U1+1),z0)}}function R0($1,U1){if($1.length===0)return"";var z0=`
`+U1.prev+U1.base;return z0+T.call($1,","+z0)+`
`+U1.prev}function U0($1,U1){var z0=e($1),L0=[];if(z0){L0.length=$1.length;for(var J0=0;J0<$1.length;J0++)L0[J0]=Z1($1,J0)?U1($1[J0],$1):""}var v1=typeof x==="function"?x($1):[],W6;if(n){W6={};for(var j6=0;j6<v1.length;j6++)W6["$"+v1[j6]]=v1[j6]}for(var I6 in $1){if(!Z1($1,I6))continue;if(z0&&String(Number(I6))===I6&&I6<$1.length)continue;if(n&&W6["$"+I6]instanceof Symbol)continue;else if(A.call(/[^\w$]/,I6))L0.push(U1(I6,$1)+": "+U1($1[I6],$1));else L0.push(I6+": "+U1($1[I6],$1))}if(typeof x==="function"){for(var i6=0;i6<v1.length;i6++)if(Y1.call($1,v1[i6]))L0.push("["+U1(v1[i6])+"]: "+U1($1[v1[i6]],$1))}return L0}}}),ga=W1({"node_modules/side-channel/index.js"(Q,X){var Z=H7(),J=ya(),G=va(),Y=gX(),H=Z("%WeakMap%",!0),K=Z("%Map%",!0),z=J("WeakMap.prototype.get",!0),W=J("WeakMap.prototype.set",!0),$=J("WeakMap.prototype.has",!0),q=J("Map.prototype.get",!0),B=J("Map.prototype.set",!0),D=J("Map.prototype.has",!0),F=function(L,V){var M=L,I;for(;(I=M.next)!==null;M=I)if(I.key===V)return M.next=I.next,I.next=L.next,L.next=I,I},P=function(L,V){var M=F(L,V);return M&&M.value},N=function(L,V,M){var I=F(L,V);if(I)I.value=M;else L.next={key:V,next:L.next,value:M}},C=function(L,V){return!!F(L,V)};X.exports=function L(){var V,M,I,E={assert:function(w){if(!E.has(w))throw new Y("Side channel does not contain "+G(w))},get:function(w){if(H&&w&&(typeof w==="object"||typeof w==="function")){if(V)return z(V,w)}else if(K){if(M)return q(M,w)}else if(I)return P(I,w)},has:function(w){if(H&&w&&(typeof w==="object"||typeof w==="function")){if(V)return $(V,w)}else if(K){if(M)return D(M,w)}else if(I)return C(I,w);return!1},set:function(w,A){if(H&&w&&(typeof w==="object"||typeof w==="function")){if(!V)V=new H;W(V,w,A)}else if(K){if(!M)M=new K;B(M,w,A)}else{if(!I)I={key:{},next:null};N(I,w,A)}}};return E}}}),w$=W1({"node_modules/qs/lib/formats.js"(Q,X){var Z=String.prototype.replace,J=/%20/g,G={RFC1738:"RFC1738",RFC3986:"RFC3986"};X.exports={default:G.RFC3986,formatters:{RFC1738:function(Y){return Z.call(Y,J,"+")},RFC3986:function(Y){return String(Y)}},RFC1738:G.RFC1738,RFC3986:G.RFC3986}}}),cM=W1({"node_modules/qs/lib/utils.js"(Q,X){var Z=w$(),J=Object.prototype.hasOwnProperty,G=Array.isArray,Y=function(){var C=[];for(var L=0;L<256;++L)C.push("%"+((L<16?"0":"")+L.toString(16)).toUpperCase());return C}(),H=function C(L){while(L.length>1){var V=L.pop(),M=V.obj[V.prop];if(G(M)){var I=[];for(var E=0;E<M.length;++E)if(typeof M[E]!=="undefined")I.push(M[E]);V.obj[V.prop]=I}}},K=function C(L,V){var M=V&&V.plainObjects?Object.create(null):{};for(var I=0;I<L.length;++I)if(typeof L[I]!=="undefined")M[I]=L[I];return M},z=function C(L,V,M){if(!V)return L;if(typeof V!=="object"){if(G(L))L.push(V);else if(L&&typeof L==="object"){if(M&&(M.plainObjects||M.allowPrototypes)||!J.call(Object.prototype,V))L[V]=!0}else return[L,V];return L}if(!L||typeof L!=="object")return[L].concat(V);var I=L;if(G(L)&&!G(V))I=K(L,M);if(G(L)&&G(V))return V.forEach(function(E,w){if(J.call(L,w)){var A=L[w];if(A&&typeof A==="object"&&E&&typeof E==="object")L[w]=C(A,E,M);else L.push(E)}else L[w]=E}),L;return Object.keys(V).reduce(function(E,w){var A=V[w];if(J.call(E,w))E[w]=C(E[w],A,M);else E[w]=A;return E},I)},W=function C(L,V){return Object.keys(V).reduce(function(M,I){return M[I]=V[I],M},L)},$=function(C,L,V){var M=C.replace(/\+/g," ");if(V==="iso-8859-1")return M.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(M)}catch(I){return M}},q=function C(L,V,M,I,E){if(L.length===0)return L;var w=L;if(typeof L==="symbol")w=Symbol.prototype.toString.call(L);else if(typeof L!=="string")w=String(L);if(M==="iso-8859-1")return escape(w).replace(/%u[0-9a-f]{4}/gi,function(S){return"%26%23"+parseInt(S.slice(2),16)+"%3B"});var A="";for(var R=0;R<w.length;++R){var T=w.charCodeAt(R);if(T===45||T===46||T===95||T===126||T>=48&&T<=57||T>=65&&T<=90||T>=97&&T<=122||E===Z.RFC1738&&(T===40||T===41)){A+=w.charAt(R);continue}if(T<128){A=A+Y[T];continue}if(T<2048){A=A+(Y[192|T>>6]+Y[128|T&63]);continue}if(T<55296||T>=57344){A=A+(Y[224|T>>12]+Y[128|T>>6&63]+Y[128|T&63]);continue}R+=1,T=65536+((T&1023
`).map(function(F){return F.trim()}).join(" ")},Q.formatters.O=function(D){return this.inspectOpts.colors=this.useColors,J.inspect(D,this.inspectOpts)};function K(D){var F=this.namespace,P=this.useColors;if(P){var N=this.color,C=" \x1B[3"+N+";1m"+F+" \x1B[0m";D[0]=C+D[0].split(`
`).join(`
`+C),D.push("\x1B[3"+N+"m+"+Q.humanize(this.diff)+"\x1B[0m")}else D[0]=new Date().toUTCString()+" "+F+" "+D[0]}function z(){return Y.write(J.format.apply(J,arguments)+`
`)}function W(D){if(D==null)delete process.env.DEBUG;else process.env.DEBUG=D}function $(){return process.env.DEBUG}function q(D){var F,P=process.binding("tty_wrap");switch(P.guessHandleType(D)){case"TTY":if(F=new Z.WriteStream(D),F._type="tty",F._handle&&F._handle.unref)F._handle.unref();break;case"FILE":var N=require("fs");F=new N.SyncWriteStream(D,{autoClose:!1}),F._type="fs";break;case"PIPE":case"TCP":var C=require("net");if(F=new C.Socket({fd:D,readable:!1,writable:!0}),F.readable=!1,F.read=null,F._type="pipe",F._handle&&F._handle.unref)F._handle.unref();break;default:throw new Error("Implement me. Unknown stream file type!")}return F.fd=D,F._isStdio=!0,F}function B(D){D.inspectOpts={};var F=Object.keys(Q.inspectOpts);for(var P=0;P<F.length;P++)D.inspectOpts[F[P]]=Q.inspectOpts[F[P]]}Q.enable($())}}),pa=W1({"node_modules/finalhandler/node_modules/debug/src/index.js"(Q,X){if(typeof process!=="undefined"&&process.type==="renderer")X.exports=da();else X.exports=ua()}}),sq=W1({"node_modules/encodeurl/index.js"(Q,X){X.exports=Y;var Z=/(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g,J=/(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g,G="$1ス$2";function Y(H){return String(H).replace(J,G).replace(Z,encodeURI)}}}),tq=W1({"node_modules/escape-html/index.js"(Q,X){var Z=/["'&<>]/;X.exports=J;function J(G){var Y=""+G,H=Z.exec(Y);if(!H)return Y;var K,z="",W=0,$=0;for(W=H.index;W<Y.length;W++){switch(Y.charCodeAt(W)){case 34:K="&quot;";break;case 38:K="&amp;";break;case 39:K="&#39;";break;case 60:K="&lt;";break;case 62:K="&gt;";break;default:continue}if($!==W)z+=Y.substring($,W);$=W+1,z+=K}return $!==W?z+Y.substring($,W):z}}}),rq=W1({"node_modules/parseurl/index.js"(Q,X){var Z=require("url"),J=Z.parse,G=Z.Url;X.exports=Y,X.exports.original=H;function Y(W){var $=W.url;if($===void 0)return;var q=W._parsedUrl;if(z($,q))return q;return q=K($),q._raw=$,W._parsedUrl=q}function H(W){var $=W.originalUrl;if(typeof $!=="string")return Y(W);var q=W._parsedOriginalUrl;if(z($,q))return q;return q=K($),q._raw=$,W._parsedOriginalUrl=q}function K(W){if(typeof W!=="string"||W.charCodeAt(0)!==47)return J(W);var $=W,q=null,B=null;for(var D=1;D<W.length;D++)switch(W.charCodeAt(D)){case 63:if(B===null)$=W.substring(0,D),q=W.substring(D+1),B=W.substring(D);break;case 9:case 10:case 12:case 13:case 32:case 35:case 160:case 65279:return J(W)}var F=G!==void 0?new G:{};if(F.path=W,F.href=W,F.pathname=$,B!==null)F.query=q,F.search=B;return F}function z(W,$){return typeof $==="object"&&$!==null&&(G===void 0||$ instanceof G)&&$._raw===W}}}),la=W1({"node_modules/finalhandler/index.js"(Q,X){var Z=pa()("finalhandler"),J=sq(),G=tq(),Y=O4(),H=rq(),K=nq(),z=R$(),W=/\x20{2}/g,$=/\n/g,q=typeof setImmediate==="function"?setImmediate:function(w){process.nextTick(w.bind.apply(w,arguments))},B=Y.isFinished;function D(w){var A=G(w).replace($,"<br>").replace(W," &nbsp;");return`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>`+A+`</pre>
</body>
</html>
`}X.exports=F;function F(w,A,R){var T=R||{},S=T.env||"production",v=T.onerror;return function(h){var x,p,n;if(!h&&M(A)){Z("cannot 404 after headers sent");return}if(h){if(n=C(h),n===void 0)n=V(A);else x=P(h);p=N(h,n,S)}else n=404,p="Cannot "+w.method+" "+J(L(w));if(Z("default %s",n),h&&v)q(v,h,w,A);if(M(A)){Z("cannot %d after headers sent",n),w.socket.destroy();return}I(w,A,n,x,p)}}function P(w){if(!w.headers||typeof w.headers!=="object")return;var A=Object.create(null),R=Object.keys(w.headers);for(var T=0;T<R.length;T++){var S=R[T];A[S]=w.headers[S]}return A}function N(w,A,R){var T;if(R!=="production"){if(T=w.stack,!T&&typeof w.toString==="function")T=w.toString()}return T||K.message[A]}function C(w){if(typeof w.status==="number"&&w.status>=400&&w.status<600)return w.status;if(typeof w.statusCode==="number"&&w.statusCode>=400&&w.statusCode<600)return w.statusCode;return}function L(w){try{return H.original(w).pathname}catch(A){return"resource"}}function V(w){var A=w.statusCode;if(typeof A!=="number"||A<400||A>599)A=500;return A}function M(w){return typeof w.headersSent!=="boolean"?Boolean(w._header):w.headersSent}function I(w,A,R,T,S){function v(){var h=D(S);if(A.statusCode=R,A.statusMessage=K.message[R],A.removeHeader("Content-Encoding"),A.removeHeader("Content-Language"),A.removeHeader("Content-Range"),E(A,T),A.setHeader("Content-Security-Policy","default-src 'none'"),A.setHeader("X-Content-Type-Options","nosniff"),A.setHeader("Content-Type","text/html; charset=utf-8"),A.setHeader("Content-Length",Buffer.byteLength(h,"utf8")),w.method==="HEAD"){A.end();return}A.end(h,"utf8")}if(B(w)){v();return}z(w),Y(w,v),w.resume()}function E(w,A){if(!A)return;var R=Object.keys(A);for(var T=0;T<R.length;T++){var S=R[T];w.setHeader(S,A[S])}}}}),E$=W1({"node_modules/methods/index.js"(Q,X){var Z=require("http");X.exports=J()||G();function J(){return Z.METHODS&&Z.METHODS.map(function Y(H){return H.toLowerCase()})}function G(){return["get","post","put","head","delete","options","trace","copy","lock","mkcol","move","purge","propfind","proppatch","unlock","report","mkactivity","checkout","merge","m-search","notify","subscribe","unsubscribe","patch","search","connect"]}}}),ca=W1({"node_modules/express/node_modules/ms/index.js"(Q,X){var Z=1000,J=Z*60,G=J*60,Y=G*24,H=Y*365.25;X.exports=function(q,B){B=B||{};var D=typeof q;if(D==="string"&&q.length>0)return K(q);else if(D==="number"&&isNaN(q)===!1)return B.long?W(q):z(q);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(q))};function K(q){if(q=String(q),q.length>100)return;var B=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(q);if(!B)return;var D=parseFloat(B[1]),F=(B[2]||"ms").toLowerCase();switch(F){case"years":case"year":case"yrs":case"yr":case"y":return D*H;case"days":case"day":case"d":return D*Y;case"hours":case"hour":case"hrs":case"hr":case"h":return D*G;case"minutes":case"minute":case"mins":case"min":case"m":return D*J;case"seconds":case"second":case"secs":case"sec":case"s":return D*Z;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return D;default:return}}function z(q){if(q>=Y)return Math.round(q/Y)+"d";if(q>=G)return Math.round(q/G)+"h";if(q>=J)return Math.round(q/J)+"m";if(q>=Z)return Math.round(q/Z)+"s";return q+"ms"}function W(q){return $(q,Y,"day")||$(q,G,"hour")||$(q,J,"minute")||$(q,Z,"second")||q+" ms"}function $(q,B,D){if(q<B)return;if(q<B*1.5)return Math.floor(q/B)+" "+D;return Math.ceil(q/B)+" "+D+"s"}}}),aM=W1({"node_modules/express/node_modules/debug/src/debug.js"(Q,X){Q=X.exports=J.debug=J.default=J,Q.coerce=z,Q.disable=H,Q.enable=Y,Q.enabled=K,Q.humanize=ca(),Q.instances=[],Q.names=[],Q.skips=[],Q.formatters={};function Z(W){var $=0,q;for(q in W)$=($<<5)-$+W.charCodeAt(q),$|=0;return Q.colors[Math.abs($)%Q.colors.length]}function J(W){var $;function q(){if(!q.enabled)return;var B=q,D=+new Date,F=D-($||D);B.diff=F,B.prev=$,B.curr=D,$=D;var P=new Array(arguments.length);for(var N=0;N<P.length;N++)P[N]=arguments[N];if(P[0]=Q.coerce(P[0]),ty
`).map(function(D){return D.trim()}).join(" ")},Q.formatters.O=function(B){return this.inspectOpts.colors=this.useColors,J.inspect(B,this.inspectOpts)};function H(B){var D=this.namespace,F=this.useColors;if(F){var P=this.color,N="\x1B[3"+(P<8?P:"8;5;"+P),C=" "+N+";1m"+D+" \x1B[0m";B[0]=C+B[0].split(`
`).join(`
`+C),B.push(N+"m+"+Q.humanize(this.diff)+"\x1B[0m")}else B[0]=K()+D+" "+B[0]}function K(){if(Q.inspectOpts.hideDate)return"";else return new Date().toISOString()+" "}function z(){return process.stderr.write(J.format.apply(J,arguments)+`
`)}function W(B){if(B==null)delete process.env.DEBUG;else process.env.DEBUG=B}function $(){return process.env.DEBUG}function q(B){B.inspectOpts={};var D=Object.keys(Q.inspectOpts);for(var F=0;F<D.length;F++)B.inspectOpts[D[F]]=Q.inspectOpts[D[F]]}Q.enable($())}}),sM=W1({"node_modules/express/node_modules/debug/src/index.js"(Q,X){if(typeof process==="undefined"||process.type==="renderer")X.exports=ia();else X.exports=na()}}),oa=W1({"node_modules/express/lib/view.js"(Q,X){var Z=sM()("express:view"),J=require("path"),G=require("fs"),Y=J.dirname,H=J.basename,K=J.extname,z=J.join,W=J.resolve;X.exports=$;function $(B,D){var F=D||{};if(this.defaultEngine=F.defaultEngine,this.ext=K(B),this.name=B,this.root=F.root,!this.ext&&!this.defaultEngine)throw new Error("No default engine was specified and no extension was provided.");var P=B;if(!this.ext)this.ext=this.defaultEngine[0]!=="."?"."+this.defaultEngine:this.defaultEngine,P+=this.ext;if(!F.engines[this.ext]){var N=this.ext.slice(1);Z('require "%s"',N);var C=require(N).__express;if(typeof C!=="function")throw new Error('Module "'+N+'" does not provide a view engine.');F.engines[this.ext]=C}this.engine=F.engines[this.ext],this.path=this.lookup(P)}$.prototype.lookup=function B(D){var F,P=[].concat(this.root);Z('lookup "%s"',D);for(var N=0;N<P.length&&!F;N++){var C=P[N],L=W(C,D),V=Y(L),M=H(L);F=this.resolve(V,M)}return F},$.prototype.render=function B(D,F){var P=!0;Z('render "%s"',this.path),this.engine(this.path,D,function N(){if(!P)return F.apply(this,arguments);var C=new Array(arguments.length),L=this;for(var V=0;V<arguments.length;V++)C[V]=arguments[V];return process.nextTick(function M(){return F.apply(L,C)})}),P=!1},$.prototype.resolve=function B(D,F){var P=this.ext,N=z(D,F),C=q(N);if(C&&C.isFile())return N;if(N=z(D,H(F,P),"index"+P),C=q(N),C&&C.isFile())return N};function q(B){Z('stat "%s"',B);try{return G.statSync(B)}catch(D){return}}}}),j$=W1({"node_modules/safe-buffer/index.js"(Q,X){var Z=require("buffer"),J=Z.Buffer;function G(H,K){for(var z in H)K[z]=H[z]}if(J.from&&J.alloc&&J.allocUnsafe&&J.allocUnsafeSlow)X.exports=Z;else G(Z,Q),Q.Buffer=Y;function Y(H,K,z){return J(H,K,z)}Y.prototype=Object.create(J.prototype),G(J,Y),Y.from=function(H,K,z){if(typeof H==="number")throw new TypeError("Argument must not be a number");return J(H,K,z)},Y.alloc=function(H,K,z){if(typeof H!=="number")throw new TypeError("Argument must be a number");var W=J(H);if(K!==void 0)if(typeof z==="string")W.fill(K,z);else W.fill(K);else W.fill(0);return W},Y.allocUnsafe=function(H){if(typeof H!=="number")throw new TypeError("Argument must be a number");return J(H)},Y.allocUnsafeSlow=function(H){if(typeof H!=="number")throw new TypeError("Argument must be a number");return Z.SlowBuffer(H)}}}),tM=W1({"node_modules/etag/index.js"(Q,X){X.exports=H;var Z=require("crypto"),J=require("fs").Stats,G=Object.prototype.toString;function Y(W){if(W.length===0)return'"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"';var $=Z.createHash("sha1").update(W,"utf8").digest("base64").substring(0,27),q=typeof W==="string"?Buffer.byteLength(W,"utf8"):W.length;return'"'+q.toString(16)+"-"+$+'"'}function H(W,$){if(W==null)throw new TypeError("argument entity is required");var q=K(W),B=$&&typeof $.weak==="boolean"?$.weak:q;if(!q&&typeof W!=="string"&&!Buffer.isBuffer(W))throw new TypeError("argument entity must be string, Buffer, or fs.Stats");var D=q?z(W):Y(W);return B?"W/"+D:D}function K(W){if(typeof J==="function"&&W instanceof J)return!0;return W&&typeof W==="object"&&"ctime"in W&&G.call(W.ctime)==="[object Date]"&&"mtime"in W&&G.call(W.mtime)==="[object Date]"&&"ino"in W&&typeof W.ino==="number"&&"size"in W&&typeof W.size==="number"}function z(W){var $=W.mtime.getTime().toString(16),q=W.size.toString(16);return'"'+q+"-"+$+'"'}}}),aa=W1({"node_modules/forwarded/index.js"(Q,X){X.exports=Z;function Z(Y){if(!Y)throw new TypeError("argument req is required");var H=G(Y.headers["x-forwarded-for"]||""),K=J(Y),z=[K].concat(H);return z}function J(Y){return Y.socket?Y.socket.remoteAddress:Y.connection.remoteAddress}function G(Y){var H=Y.length,K=[],z
`).map(function(D){return D.trim()}).join(" ")},Q.formatters.O=function(B){return this.inspectOpts.colors=this.useColors,J.inspect(B,this.inspectOpts)};function H(B){var D=this.namespace,F=this.useColors;if(F){var P=this.color,N="\x1B[3"+(P<8?P:"8;5;"+P),C=" "+N+";1m"+D+" \x1B[0m";B[0]=C+B[0].split(`
`).join(`
`+C),B.push(N+"m+"+Q.humanize(this.diff)+"\x1B[0m")}else B[0]=K()+D+" "+B[0]}function K(){if(Q.inspectOpts.hideDate)return"";else return new Date().toISOString()+" "}function z(){return process.stderr.write(J.format.apply(J,arguments)+`
`)}function W(B){if(B==null)delete process.env.DEBUG;else process.env.DEBUG=B}function $(){return process.env.DEBUG}function q(B){B.inspectOpts={};var D=Object.keys(Q.inspectOpts);for(var F=0;F<D.length;F++)B.inspectOpts[D[F]]=Q.inspectOpts[D[F]]}Q.enable($())}}),Vs=W1({"node_modules/send/node_modules/debug/src/index.js"(Q,X){if(typeof process==="undefined"||process.type==="renderer")X.exports=Bs();else X.exports=Us()}}),Ps=W1({"node_modules/send/node_modules/ms/index.js"(Q,X){var Z=1000,J=Z*60,G=J*60,Y=G*24,H=Y*7,K=Y*365.25;X.exports=function(B,D){D=D||{};var F=typeof B;if(F==="string"&&B.length>0)return z(B);else if(F==="number"&&isFinite(B))return D.long?$(B):W(B);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(B))};function z(B){if(B=String(B),B.length>100)return;var D=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(B);if(!D)return;var F=parseFloat(D[1]),P=(D[2]||"ms").toLowerCase();switch(P){case"years":case"year":case"yrs":case"yr":case"y":return F*K;case"weeks":case"week":case"w":return F*H;case"days":case"day":case"d":return F*Y;case"hours":case"hour":case"hrs":case"hr":case"h":return F*G;case"minutes":case"minute":case"mins":case"min":case"m":return F*J;case"seconds":case"second":case"secs":case"sec":case"s":return F*Z;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return F;default:return}}function W(B){var D=Math.abs(B);if(D>=Y)return Math.round(B/Y)+"d";if(D>=G)return Math.round(B/G)+"h";if(D>=J)return Math.round(B/J)+"m";if(D>=Z)return Math.round(B/Z)+"s";return B+"ms"}function $(B){var D=Math.abs(B);if(D>=Y)return q(B,D,Y,"day");if(D>=G)return q(B,D,G,"hour");if(D>=J)return q(B,D,J,"minute");if(D>=Z)return q(B,D,Z,"second");return B+" ms"}function q(B,D,F,P){var N=D>=F*1.5;return Math.round(B/F)+" "+P+(N?"s":"")}}}),YI=W1({"node_modules/send/index.js"(Q,X){var Z=W7(),J=Vs()("send"),G=dM(),Y=sq(),H=tq(),K=tM(),z=XI(),W=require("fs"),$=q7(),q=Ps(),B=O4(),D=JI(),F=require("path"),P=nq(),N=require("stream"),C=require("util"),L=F.extname,V=F.join,M=F.normalize,I=F.resolve,E=F.sep,w=/^ *bytes=/,A=31536000000,R=/(?:^|[\\/])\.\.(?:[\\/]|$)/;X.exports=T;function T(D1,e,P1){return new S(D1,e,P1)}function S(D1,e,P1){N.call(this);var Q1=P1||{};if(this.options=Q1,this.path=e,this.req=D1,this._acceptRanges=Q1.acceptRanges!==void 0?Boolean(Q1.acceptRanges):!0,this._cacheControl=Q1.cacheControl!==void 0?Boolean(Q1.cacheControl):!0,this._etag=Q1.etag!==void 0?Boolean(Q1.etag):!0,this._dotfiles=Q1.dotfiles!==void 0?Q1.dotfiles:"ignore",this._dotfiles!=="ignore"&&this._dotfiles!=="allow"&&this._dotfiles!=="deny")throw new TypeError('dotfiles option must be "allow", "deny", or "ignore"');this._extensions=Q1.extensions!==void 0?C1(Q1.extensions,"extensions option"):[],this._immutable=Q1.immutable!==void 0?Boolean(Q1.immutable):!1,this._index=Q1.index!==void 0?C1(Q1.index,"index option"):["index.html"],this._lastModified=Q1.lastModified!==void 0?Boolean(Q1.lastModified):!0,this._maxage=Q1.maxAge||Q1.maxage,this._maxage=typeof this._maxage==="string"?q(this._maxage):Number(this._maxage),this._maxage=!isNaN(this._maxage)?Math.min(Math.max(0,this._maxage),A):0,this._root=Q1.root?I(Q1.root):null}C.inherits(S,N),S.prototype.error=function D1(e,P1){if(V1(this,"error"))return this.emit("error",t(e,P1));var Q1=this.res,O1=P.message[e]||String(e),S1=n("Error",H(O1));if(v(Q1),P1&&P1.headers)d1(Q1,P1.headers);Q1.statusCode=e,Q1.setHeader("Content-Type","text/html; charset=UTF-8"),Q1.setHeader("Content-Length",Buffer.byteLength(S1)),Q1.setHeader("Content-Security-Policy","default-src 'none'"),Q1.setHeader("X-Content-Type-Options","nosniff"),Q1.end(S1)},S.prototype.hasTrailingSlash=function D1(){return this.path[this.path.length-1]==="/"},S.prototype.isConditionalGET=function D1(){return this.req.headers["if-match"]||this.req.headers["if-unmodified-since"]||this.req.headers["if-none-match"]||this.req.headers["if-modified-since"]},S.prototype.isPreconditionFailure=function D1(){var e=this.req,P1=
<html lang="en">
<head>
<meta charset="utf-8">
<title>`+D1+`</title>
</head>
<body>
<pre>`+e+`</pre>
</body>
</html>
`}function t(D1,e){if(!e)return Z(D1);return e instanceof Error?Z(D1,e,{expose:!1}):Z(D1,e)}function Y1(D1){try{return decodeURIComponent(D1)}catch(e){return-1}}function G1(D1){return typeof D1.getHeaderNames!=="function"?Object.keys(D1._headers||{}):D1.getHeaderNames()}function V1(D1,e){var P1=typeof D1.listenerCount!=="function"?D1.listeners(e).length:D1.listenerCount(e);return P1>0}function C1(D1,e){var P1=[].concat(D1||[]);for(var Q1=0;Q1<P1.length;Q1++)if(typeof P1[Q1]!=="string")throw new TypeError(e+" must be array of strings or false");return P1}function N1(D1){var e=D1&&Date.parse(D1);return typeof e==="number"?e:NaN}function j1(D1){var e=0,P1=[],Q1=0;for(var O1=0,S1=D1.length;O1<S1;O1++)switch(D1.charCodeAt(O1)){case 32:if(Q1===e)Q1=e=O1+1;break;case 44:if(Q1!==e)P1.push(D1.substring(Q1,e));Q1=e=O1+1;break;default:e=O1+1;break}if(Q1!==e)P1.push(D1.substring(Q1,e));return P1}function d1(D1,e){var P1=Object.keys(e);for(var Q1=0;Q1<P1.length;Q1++){var O1=P1[Q1];D1.setHeader(O1,e[O1])}}}}),WI=W1({"node_modules/vary/index.js"(Q,X){X.exports=Y,X.exports.append=J;var Z=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function J(H,K){if(typeof H!=="string")throw new TypeError("header argument is required");if(!K)throw new TypeError("field argument is required");var z=!Array.isArray(K)?G(String(K)):K;for(var W=0;W<z.length;W++)if(!Z.test(z[W]))throw new TypeError("field argument contains an invalid header name");if(H==="*")return H;var $=H,q=G(H.toLowerCase());if(z.indexOf("*")!==-1||q.indexOf("*")!==-1)return"*";for(var B=0;B<z.length;B++){var D=z[B].toLowerCase();if(q.indexOf(D)===-1)q.push(D),$=$?$+", "+z[B]:z[B]}return $}function G(H){var K=0,z=[],W=0;for(var $=0,q=H.length;$<q;$++)switch(H.charCodeAt($)){case 32:if(W===K)W=K=$+1;break;case 44:z.push(H.substring(W,K)),W=K=$+1;break;default:K=$+1;break}return z.push(H.substring(W,K)),z}function Y(H,K){if(!H||!H.getHeader||!H.setHeader)throw new TypeError("res argument is required");var z=H.getHeader("Vary")||"",W=Array.isArray(z)?z.join(", "):String(z);if(z=J(W,K))H.setHeader("Vary",z)}}}),Fs=W1({"node_modules/express/lib/response.js"(Q,X){var Z=j$().Buffer,J=qs(),G=W7(),Y=mM()("express"),H=sq(),K=tq(),z=require("http"),W=O4(),$=q7(),q=require("path"),B=Hs(),D=nq(),F=k$(),P=zs().sign,N=G7().normalizeType,C=G7().normalizeTypes,L=G7().setCharset,V=Ks(),M=YI(),I=q.extname,E=q.resolve,w=WI(),A=Object.create(z.ServerResponse.prototype);X.exports=A;var R=/^(?:[a-zA-Z][a-zA-Z0-9+.-]*:)?\/\/[^\\\/\?]+/;A.status=function v(h){if((typeof h==="string"||Math.floor(h)!==h)&&h>99&&h<1000)Y("res.status("+JSON.stringify(h)+"): use res.status("+Math.floor(h)+") instead");return this.statusCode=h,this},A.links=function(v){var h=this.get("Link")||"";if(h)h+=", ";return this.set("Link",h+Object.keys(v).map(function(x){return"<"+v[x]+'>; rel="'+x+'"'}).join(", "))},A.send=function v(h){var x=h,p,n=this.req,t,Y1=this.app;switch(typeof x){case"string":if(!this.get("Content-Type"))this.type("html");break;case"boolean":case"number":case"object":if(x===null)x="";else if(Z.isBuffer(x)){if(!this.get("Content-Type"))this.type("bin")}else return this.json(x);break}if(typeof x==="string"){if(p="utf8",t=this.get("Content-Type"),typeof t==="string")this.set("Content-Type",L(t,"utf-8"))}var G1=Y1.get("etag fn"),V1=!this.get("ETag")&&typeof G1==="function",C1;if(x!==void 0){if(Z.isBuffer(x))C1=x.length;else if(!V1&&x.length<1000)C1=Z.byteLength(x,p);else x=Z.from(x,p),p=void 0,C1=x.length;this.set("Content-Length",C1)}var N1;if(V1&&C1!==void 0){if(N1=G1(x,p))this.set("ETag",N1)}if(n.fresh)this.statusCode=304;if(this.statusCode===204||this.statusCode===304)this.removeHeader("Content-Type"),this.removeHeader("Content-Length"),this.removeHeader("Transfer-Encoding"),x="";if(this.statusCode===205)this.set("Content-Length","0"),this.removeHeader("Transfer-Encoding"),x="";if(n.method==="HEAD")this.end();else this.end(x,p);return this},A.json=function v(h){var x=this.app,p=x.get("json escape"),n=x.get("json replacer"),t=x.get("json spaces"),Y1=S(h,n,t,p);if(!this.get("Content-Type"))this.set("Content-Type","application/json
<html lang="en">
<head>
<meta charset="utf-8">
<title>`+D+`</title>
</head>
<body>
<pre>`+F+`</pre>
</body>
</html>
`}function q(){return function D(){this.error(404)}}function B(){return function D(F){if(this.hasTrailingSlash()){this.error(404);return}var P=G.original(this.req);P.path=null,P.pathname=W(P.pathname+"/");var N=Z(K.format(P)),C=$("Redirecting",'Redirecting to <a href="'+J(N)+'">'+J(N)+"</a>");F.statusCode=301,F.setHeader("Content-Type","text/html; charset=UTF-8"),F.setHeader("Content-Length",Buffer.byteLength(C)),F.setHeader("Content-Security-Policy","default-src 'none'"),F.setHeader("X-Content-Type-Options","nosniff"),F.setHeader("Location",N),F.end(C)}}}}),Ls=W1({"node_modules/express/lib/express.js"(Q,X){var Z=nM(),J=require("events").EventEmitter,G=ma(),Y=ea(),H=ZI(),K=Ws(),z=Fs();Q=X.exports=W;function W(){var $=function(q,B,D){$.handle(q,B,D)};return G($,J.prototype,!1),G($,Y,!1),$.request=Object.create(K,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.response=Object.create(z,{app:{configurable:!0,enumerable:!0,writable:!0,value:$}}),$.init(),$}Q.application=Y,Q.request=K,Q.response=z,Q.Route=H.Route,Q.Router=H,Q.json=Z.json,Q.raw=Z.raw,Q.static=Ds(),Q.text=Z.text,Q.urlencoded=Z.urlencoded}}),Cs=W1({"node_modules/express/index.js"(Q,X){X.exports=Ls()}}),Ns=W1({"node_modules/object-assign/index.js"(Q,X){var Z=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;function Y(K){if(K===null||K===void 0)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(K)}function H(){try{if(!Object.assign)return!1;var K=new String("abc");if(K[5]="de",Object.getOwnPropertyNames(K)[0]==="5")return!1;var z={};for(var W=0;W<10;W++)z["_"+String.fromCharCode(W)]=W;var $=Object.getOwnPropertyNames(z).map(function(B){return z[B]});if($.join("")!=="0123456789")return!1;var q={};if("abcdefghijklmnopqrst".split("").forEach(function(B){q[B]=B}),Object.keys(Object.assign({},q)).join("")!=="abcdefghijklmnopqrst")return!1;return!0}catch(B){return!1}}X.exports=H()?Object.assign:function(K,z){var W,$=Y(K),q;for(var B=1;B<arguments.length;B++){W=Object(arguments[B]);for(var D in W)if(J.call(W,D))$[D]=W[D];if(Z){q=Z(W);for(var F=0;F<q.length;F++)if(G.call(W,q[F]))$[q[F]]=W[q[F]]}}return $}}}),Ts=W1({"node_modules/cors/lib/index.js"(Q,X){(function(){var Z=Ns(),J=WI(),G={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function Y(N){return typeof N==="string"||N instanceof String}function H(N,C){if(Array.isArray(C)){for(var L=0;L<C.length;++L)if(H(N,C[L]))return!0;return!1}else if(Y(C))return N===C;else if(C instanceof RegExp)return C.test(N);else return!!C}function K(N,C){var L=C.headers.origin,V=[],M;if(!N.origin||N.origin==="*")V.push([{key:"Access-Control-Allow-Origin",value:"*"}]);else if(Y(N.origin))V.push([{key:"Access-Control-Allow-Origin",value:N.origin}]),V.push([{key:"Vary",value:"Origin"}]);else M=H(L,N.origin),V.push([{key:"Access-Control-Allow-Origin",value:M?L:!1}]),V.push([{key:"Vary",value:"Origin"}]);return V}function z(N){var C=N.methods;if(C.join)C=N.methods.join(",");return{key:"Access-Control-Allow-Methods",value:C}}function W(N){if(N.credentials===!0)return{key:"Access-Control-Allow-Credentials",value:"true"};return null}function $(N,C){var L=N.allowedHeaders||N.headers,V=[];if(!L)L=C.headers["access-control-request-headers"],V.push([{key:"Vary",value:"Access-Control-Request-Headers"}]);else if(L.join)L=L.join(",");if(L&&L.length)V.push([{key:"Access-Control-Allow-Headers",value:L}]);return V}function q(N){var C=N.exposedHeaders;if(!C)return null;else if(C.join)C=C.join(",");if(C&&C.length)return{key:"Access-Control-Expose-Headers",value:C};return null}function B(N){var C=(typeof N.maxAge==="number"||N.maxAge)&&N.maxAge.toString();if(C&&C.length)return{key:"Access-Control-Max-Age",value:C};return null}function D(N,C){for(var L=0,V=N.length;L<V;L++){var M=N[L];if(M){if(Array.isArray(M))D(M,C);else if(M.key==="Vary"&&M.value)J(C,M.value);else if(M.value)C.setHeader(M.key,M.value)}}}function F(N,C,L,V){var M=[],I=C.method&&C.method.toUpperCase&&C.method.toUpperCase();if(I==="OPTIONS")
at `+callSiteToString(Q[Z]);return X}function depd(Q){if(!Q)throw new TypeError("argument namespace is required");var X=getStack(),Z=callSiteLocation(X[1]),J=Z[0];function G(Y){log.call(G,Y)}return G._file=J,G._ignored=isignored(Q),G._namespace=Q,G._traced=istraced(Q),G._warned=Object.create(null),G.function=wrapfunction,G.property=wrapproperty,G}function isignored(Q){if(process.noDeprecation)return!0;var X=process.env.NO_DEPRECATION||"";return containsNamespace(X,Q)}function istraced(Q){if(process.traceDeprecation)return!0;var X=process.env.TRACE_DEPRECATION||"";return containsNamespace(X,Q)}function log(Q,X){var Z=eventListenerCount(process,"deprecation")!==0;if(!Z&&this._ignored)return;var J,G,Y,H,K=0,z=!1,W=getStack(),$=this._file;if(X)H=X,Y=callSiteLocation(W[1]),Y.name=H.name,$=Y[0];else K=2,H=callSiteLocation(W[K]),Y=H;for(;K<W.length;K++)if(J=callSiteLocation(W[K]),G=J[0],G===$)z=!0;else if(G===this._file)$=this._file;else if(z)break;var q=J?H.join(":")+"__"+J.join(":"):void 0;if(q!==void 0&&q in this._warned)return;this._warned[q]=!0;var B=Q;if(!B)B=Y===H||!Y.name?defaultMessage(H):defaultMessage(Y);if(Z){var D=DeprecationError(this._namespace,B,W.slice(K));process.emit("deprecation",D);return}var F=process.stderr.isTTY?formatColor:formatPlain,P=F.call(this,B,J,W.slice(K));process.stderr.write(P+`
`,"utf8")}function callSiteLocation(Q){var X=Q.getFileName()||"<anonymous>",Z=Q.getLineNumber(),J=Q.getColumnNumber();if(Q.isEval())X=Q.getEvalOrigin()+", "+X;var G=[X,Z,J];return G.callSite=Q,G.name=Q.getFunctionName(),G}function defaultMessage(Q){var{callSite:X,name:Z}=Q;if(!Z)Z="<anonymous@"+formatLocation(Q)+">";var J=X.getThis(),G=J&&X.getTypeName();if(G==="Object")G=void 0;if(G==="Function")G=J.name||G;return G&&X.getMethodName()?G+"."+Z:Z}function formatPlain(Q,X,Z){var J=new Date().toUTCString(),G=J+" "+this._namespace+" deprecated "+Q;if(this._traced){for(var Y=0;Y<Z.length;Y++)G+=`
at `+callSiteToString(Z[Y]);return G}if(X)G+=" at "+formatLocation(X);return G}function formatColor(Q,X,Z){var J="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+Q+"\x1B[39m";if(this._traced){for(var G=0;G<Z.length;G++)J+=`
\x1B[36mat `+callSiteToString(Z[G])+"\x1B[39m";return J}if(X)J+=" \x1B[36m"+formatLocation(X)+"\x1B[39m";return J}function formatLocation(Q){return relative(basePath,Q[0])+":"+Q[1]+":"+Q[2]}function getStack(){var Q=Error.stackTraceLimit,X={},Z=Error.prepareStackTrace;Error.prepareStackTrace=prepareObjectStackTrace,Error.stackTraceLimit=Math.max(10,Q),Error.captureStackTrace(X);var J=X.stack.slice(1);return Error.prepareStackTrace=Z,Error.stackTraceLimit=Q,J}function prepareObjectStackTrace(Q,X){return X}function wrapfunction(fn,message){if(typeof fn!=="function")throw new TypeError("argument fn must be a function");var args=createArgumentsString(fn.length),deprecate=this,stack=getStack(),site=callSiteLocation(stack[1]);site.name=fn.name;var deprecatedfn=eval("(function ("+args+`) {
"use strict"
log.call(deprecate, message, site)
return fn.apply(this, arguments)
})`);return deprecatedfn}function wrapproperty(Q,X,Z){if(!Q||typeof Q!=="object"&&typeof Q!=="function")throw new TypeError("argument obj must be object");var J=Object.getOwnPropertyDescriptor(Q,X);if(!J)throw new TypeError("must call property on owner object");if(!J.configurable)throw new TypeError("property must be configurable");var G=this,Y=getStack(),H=callSiteLocation(Y[1]);if(H.name=X,"value"in J)J=convertDataDescriptorToAccessor(Q,X,Z);var{get:K,set:z}=J;if(typeof K==="function")J.get=function W(){return log.call(G,Z,H),K.apply(this,arguments)};if(typeof z==="function")J.set=function W(){return log.call(G,Z,H),z.apply(this,arguments)};Object.defineProperty(Q,X,J)}function DeprecationError(Q,X,Z){var J=new Error,G;return Object.defineProperty(J,"constructor",{value:DeprecationError}),Object.defineProperty(J,"message",{configurable:!0,enumerable:!1,value:X,writable:!0}),Object.defineProperty(J,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(J,"namespace",{configurable:!0,enumerable:!1,value:Q,writable:!0}),Object.defineProperty(J,"stack",{configurable:!0,enumerable:!1,get:function(){if(G!==void 0)return G;return G=createStackString.call(this,Z)},set:function Y(H){G=H}}),J}}}),Os=W1({"node_modules/on-headers/index.js"(Q,X){X.exports=J;function Z(K,z){var W=!1;return function $(q){var B=H.apply(this,arguments);if(!W){if(W=!0,z.call(this),typeof B[0]==="number"&&this.statusCode!==B[0])B[0]=this.statusCode,B.length=1}return K.apply(this,B)}}function J(K,z){if(!K)throw new TypeError("argument res is required");if(typeof z!=="function")throw new TypeError("argument listener must be a function");K.writeHead=Z(K.writeHead,z)}function G(K,z){for(var W=0;W<z.length;W++)K.setHeader(z[W][0],z[W][1])}function Y(K,z){var W=Object.keys(z);for(var $=0;$<W.length;$++){var q=W[$];if(q)K.setHeader(q,z[q])}}function H(K){var z=arguments.length,W=z>1&&typeof arguments[1]==="string"?2:1,$=z>=W+1?arguments[W]:void 0;if(this.statusCode=K,Array.isArray($))G(this,$);else if($)Y(this,$);var q=new Array(Math.min(z,W));for(var B=0;B<q.length;B++)q[B]=arguments[B];return q}}}),ws=W1({"node_modules/response-time/index.js"(Q,X){var Z=As()("response-time"),J=Os();X.exports=G;function G(H){var K=H||{};if(typeof H==="number")Z("number argument: use {digits: "+JSON.stringify(H)+"} instead"),K={digits:H};var z=typeof K!=="function"?Y(K):K;return function W($,q,B){var D=process.hrtime();J(q,function F(){var P=process.hrtime(D),N=P[0]*1000+P[1]*0.000001;z($,q,N)}),B()}}function Y(H){var K=H.digits!==void 0?H.digits:3,z=H.header||"X-Response-Time",W=H.suffix!==void 0?Boolean(H.suffix):!0;return function $(q,B,D){if(B.getHeader(z))return;var F=D.toFixed(K);if(W)F+="ms";B.setHeader(z,F)}}}}),Es=W1({"node_modules/strict-uri-encode/index.js"(Q,X){X.exports=(Z)=>encodeURIComponent(Z).replace(/[!'()*]/g,(J)=>`%${J.charCodeAt(0).toString(16).toUpperCase()}`)}}),js=W1({"node_modules/decode-uri-component/index.js"(Q,X){var Z="%[a-f0-9]{2}",J=new RegExp("("+Z+")|([^%]+?)","gi"),G=new RegExp("("+Z+")+","gi");function Y(z,W){try{return[decodeURIComponent(z.join(""))]}catch(B){}if(z.length===1)return z;W=W||1;var $=z.slice(0,W),q=z.slice(W);return Array.prototype.concat.call([],Y($),Y(q))}function H(z){try{return decodeURIComponent(z)}catch(q){var W=z.match(J)||[];for(var $=1;$<W.length;$++)z=Y(W,$).join(""),W=z.match(J)||[];return z}}function K(z){var W={"%FE%FF":"ス","%FF%FE":"ス"},$=G.exec(z);while($){try{W[$[0]]=decodeURIComponent($[0])}catch(P){var q=H($[0]);if(q!==$[0])W[$[0]]=q}$=G.exec(z)}W["%C2"]="ス";var B=Object.keys(W);for(var D=0;D<B.length;D++){var F=B[D];z=z.replace(new RegExp(F,"g"),W[F])}return z}X.exports=function(z){if(typeof z!=="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof z+"`");try{return z=z.replace(/\+/g," "),decodeURIComponent(z)}catch(W){return K(z)}}}}),Ss=W1({"node_modules/split-on-first/index.js"(Q,X){X.exports=(Z,J)=>{if(!(typeof Z==="string"&&typeof J==="string"))throw new TypeError("Expected the arguments to be of type `string`");i
`)}getStatusCode({statusCode:Q,errorCode:X}){if(Q)return Q;return Math.floor(X/100)}returnCannedResponse(Q,{statusCode:X,message:Z,errorCode:J}){let G={message:this.getResponseMessage({statusCode:X,message:Z,errorCode:J}),errorCode:J!=null?J:X*100};Q.status(this.getStatusCode({statusCode:X,errorCode:J})).json(G)}root(Q,X){let Z;try{Z=fs.default.pki.certificateFromPem(this.settings.crypto.cert)}catch(J){}X.status(200).json({status:"OK",manifest:this.manifest,versions:{obsidian:_q.apiVersion,self:this.manifest.version},service:"Obsidian Local REST API",authenticated:this.requestIsAuthenticated(Q),certificateInfo:this.requestIsAuthenticated(Q)&&Z?{validityDays:qI(Z),regenerateRecommended:!HI(Z)}:void 0,apiExtensions:this.requestIsAuthenticated(Q)?this.apiExtensions.map(({manifest:J})=>J):void 0})}_vaultGet(Q,X,Z){return T0(this,null,function*(){if(!Q||Q.endsWith("/")){let J=[...new Set(this.app.vault.getFiles().map((G)=>G.path).filter((G)=>G.startsWith(Q)).map((G)=>{let Y=G.slice(Q.length);if(Y.indexOf("/")>-1)return Y.slice(0,Y.indexOf("/")+1);return Y}))];if(J.sort(),J.length===0){this.returnCannedResponse(Z,{statusCode:404});return}Z.json({files:J})}else if((yield this.app.vault.adapter.exists(Q))&&(yield this.app.vault.adapter.stat(Q)).type==="file"){let G=yield this.app.vault.adapter.readBinary(Q),Y=_s.default.lookup(Q);if(Z.set({"Content-Disposition":`attachment; filename="${encodeURI(Q).replace(",","%2C")}"`,"Content-Type":`${Y}`+(Y==_9.markdown?"; charset=utf-8":"")}),X.headers.accept===_9.olrapiNoteJson){let H=this.app.vault.getAbstractFileByPath(Q);Z.setHeader("Content-Type",_9.olrapiNoteJson),Z.send(JSON.stringify(yield this.getFileMetadataObject(H),null,2));return}Z.send(Buffer.from(G))}else{this.returnCannedResponse(Z,{statusCode:404});return}})}vaultGet(Q,X){return T0(this,null,function*(){let Z=Q.params[0];return this._vaultGet(Z,Q,X)})}_vaultPut(Q,X,Z){return T0(this,null,function*(){if(!Q||Q.endsWith("/")){this.returnCannedResponse(Z,{errorCode:l0.RequestMethodValidOnlyForFiles});return}try{yield this.app.vault.createFolder(NM.default.dirname(Q))}catch(J){}if(typeof X.body==="string")yield this.app.vault.adapter.write(Q,X.body);else yield this.app.vault.adapter.writeBinary(Q,is(X.body));this.returnCannedResponse(Z,{statusCode:204});return})}vaultPut(Q,X){return T0(this,null,function*(){let Z=Q.params[0];return this._vaultPut(Z,Q,X)})}_vaultPatch(Q,X,Z){return T0(this,null,function*(){let J=X.get("Heading-Boundary")||"::",G=(X.get("Heading")||"").split(J).filter(Boolean),Y=X.get("Content-Insertion-Position"),H=!1,K=!1;if(!Q||Q.endsWith("/")){this.returnCannedResponse(Z,{errorCode:l0.RequestMethodValidOnlyForFiles});return}if(Y===void 0)H=!1;else if(Y==="beginning")H=!0;else if(Y==="end")H=!1;else{this.returnCannedResponse(Z,{errorCode:l0.InvalidContentInsertionPositionValue});return}if(typeof X.body!="string"){this.returnCannedResponse(Z,{errorCode:l0.TextContentEncodingRequired});return}if(typeof X.get("Content-Insertion-Ignore-Newline")=="string")K=X.get("Content-Insertion-Ignore-Newline").toLowerCase()=="true";if(!G.length){this.returnCannedResponse(Z,{errorCode:l0.MissingHeadingHeader});return}let z=this.app.vault.getAbstractFileByPath(Q);if(!(z instanceof _q.TFile)){this.returnCannedResponse(Z,{statusCode:404});return}let W=this.app.metadataCache.getFileCache(z),$=ls(W,G);if(!$){this.returnCannedResponse(Z,{errorCode:l0.InvalidHeadingHeader});return}let B=(yield this.app.vault.read(z)).split(`
`),D=cs(B,$,H,K);B.splice(D,0,X.body);let F=B.join(`
`);yield this.app.vault.adapter.write(Q,F),Z.status(200).send(F)})}vaultPatch(Q,X){return T0(this,null,function*(){let Z=Q.params[0];return this._vaultPatch(Z,Q,X)})}_vaultPost(Q,X,Z){return T0(this,null,function*(){if(!Q||Q.endsWith("/")){this.returnCannedResponse(Z,{errorCode:l0.RequestMethodValidOnlyForFiles});return}if(typeof X.body!="string"){this.returnCannedResponse(Z,{errorCode:l0.TextContentEncodingRequired});return}try{yield this.app.vault.createFolder(NM.default.dirname(Q))}catch(Y){}let J="",G=this.app.vault.getAbstractFileByPath(Q);if(G instanceof _q.TFile){if(J=yield this.app.vault.read(G),!J.endsWith(`
`))J+=`
`}J+=X.body,yield this.app.vault.adapter.write(Q,J),this.returnCannedResponse(Z,{statusCode:204});return})}vaultPost(Q,X){return T0(this,null,function*(){let Z=Q.params[0];return this._vaultPost(Z,Q,X)})}_vaultDelete(Q,X,Z){return T0(this,null,function*(){if(!Q||Q.endsWith("/")){this.returnCannedResponse(Z,{errorCode:l0.RequestMethodValidOnlyForFiles});return}if(!(yield this.app.vault.adapter.exists(Q))){this.returnCannedResponse(Z,{statusCode:404});return}yield this.app.vault.adapter.remove(Q),this.returnCannedResponse(Z,{statusCode:204});return})}vaultDelete(Q,X){return T0(this,null,function*(){let Z=Q.params[0];return this._vaultDelete(Z,Q,X)})}getPeriodicNoteInterface(){return{daily:{settings:L6.default.getDailyNoteSettings(),loaded:L6.default.appHasDailyNotesPluginLoaded(),create:L6.default.createDailyNote,get:L6.default.getDailyNote,getAll:L6.default.getAllDailyNotes},weekly:{settings:L6.default.getWeeklyNoteSettings(),loaded:L6.default.appHasWeeklyNotesPluginLoaded(),create:L6.default.createWeeklyNote,get:L6.default.getWeeklyNote,getAll:L6.default.getAllWeeklyNotes},monthly:{settings:L6.default.getMonthlyNoteSettings(),loaded:L6.default.appHasMonthlyNotesPluginLoaded(),create:L6.default.createMonthlyNote,get:L6.default.getMonthlyNote,getAll:L6.default.getAllMonthlyNotes},quarterly:{settings:L6.default.getQuarterlyNoteSettings(),loaded:L6.default.appHasQuarterlyNotesPluginLoaded(),create:L6.default.createQuarterlyNote,get:L6.default.getQuarterlyNote,getAll:L6.default.getAllQuarterlyNotes},yearly:{settings:L6.default.getYearlyNoteSettings(),loaded:L6.default.appHasYearlyNotesPluginLoaded(),create:L6.default.createYearlyNote,get:L6.default.getYearlyNote,getAll:L6.default.getAllYearlyNotes}}}periodicGetInterface(Q){let X=this.getPeriodicNoteInterface();if(!X[Q])return[null,l0.PeriodDoesNotExist];if(!X[Q].loaded)return[null,l0.PeriodIsNotEnabled];return[X[Q],null]}periodicGetNote(Q){let[X,Z]=this.periodicGetInterface(Q);if(Z)return[null,Z];let J=window.moment(Date.now()),G=X.getAll(),Y=X.get(J,G);if(!Y)return[null,l0.PeriodicNoteDoesNotExist];return[Y,null]}periodicGetOrCreateNote(Q){return T0(this,null,function*(){let[X,Z]=this.periodicGetNote(Q),J=X;if(Z===l0.PeriodicNoteDoesNotExist){let[G]=this.periodicGetInterface(Q),Y=window.moment(Date.now());J=yield G.create(Y),yield new Promise((K)=>{let z=null,W=setInterval(()=>{if(z=this.app.metadataCache.getFileCache(J),z)clearInterval(W),K(z)},100)})}else if(Z)return[null,Z];return[J,null]})}redirectToVaultPath(Q,X,Z,J){let G=Q.path;return Z.set("Content-Location",encodeURI(G)),J(G,X,Z)}periodicGet(Q,X){return T0(this,null,function*(){let[Z,J]=this.periodicGetNote(Q.params.period);if(J){this.returnCannedResponse(X,{errorCode:J});return}return this.redirectToVaultPath(Z,Q,X,this._vaultGet.bind(this))})}periodicPut(Q,X){return T0(this,null,function*(){let[Z,J]=yield this.periodicGetOrCreateNote(Q.params.period);if(J){this.returnCannedResponse(X,{errorCode:J});return}return this.redirectToVaultPath(Z,Q,X,this._vaultPut.bind(this))})}periodicPost(Q,X){return T0(this,null,function*(){let[Z,J]=yield this.periodicGetOrCreateNote(Q.params.period);if(J){this.returnCannedResponse(X,{errorCode:J});return}return this.redirectToVaultPath(Z,Q,X,this._vaultPost.bind(this))})}periodicPatch(Q,X){return T0(this,null,function*(){let[Z,J]=yield this.periodicGetOrCreateNote(Q.params.period);if(J){this.returnCannedResponse(X,{errorCode:J});return}return this.redirectToVaultPath(Z,Q,X,this._vaultPatch.bind(this))})}periodicDelete(Q,X){return T0(this,null,function*(){let[Z,J]=this.periodicGetNote(Q.params.period);if(J){this.returnCannedResponse(X,{errorCode:J});return}return this.redirectToVaultPath(Z,Q,X,this._vaultDelete.bind(this))})}activeFileGet(Q,X){return T0(this,null,function*(){let Z=this.app.workspace.getActiveFile();return this.redirectToVaultPath(Z,Q,X,this._vaultGet.bind(this))})}activeFilePut(Q,X){return T0(this,null,function*(){let Z=this.app.workspace.getActiveFile();return this.redirectToVaultPath(Z,Q,X,this._vaultPut.bind(this))})}activeFilePost(Q,X){return T0(this,null,functio
`))if(H.trim())Y.push({type:2,value:H.trim()})}G.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!1,dataEncipherment:!1,critical:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0,codeSigning:!0,emailProtection:!0,timeStamping:!0},{name:"nsCertType",client:!0,server:!0,email:!0,objsign:!0,sslCA:!0,emailCA:!0,objCA:!0},{name:"subjectAltName",altNames:Y}]),G.serialNumber="1",G.publicKey=Z.publicKey,G.validity.notAfter=Q,G.validity.notBefore=X,G.sign(Z.privateKey,yQ.default.md.sha256.create()),this.settings.crypto={cert:yQ.pki.certificateToPem(G),privateKey:yQ.pki.privateKeyToPem(Z.privateKey),publicKey:yQ.pki.publicKeyToPem(Z.publicKey)},this.saveSettings()}this.addSettingTab(new ts(this.app,this)),this.refreshServerState(),this.app.workspace.trigger("obsidian-local-rest-api:loaded")})}getPublicApi(Q){if(!Q.id||!Q.name||!Q.version)throw new Error("PluginManifest instance must include a defined id, name, and version to be accempted.");return console.log("[REST API] Added new API extension",Q),this.requestHandler.registerApiExtension(Q)}debounce(Q,X){let Z;return(...J)=>{clearTimeout(Z),Z=setTimeout(()=>Q(...J),X)}}_refreshServerState(){var Q,X,Z,J,G;if(this.secureServer)this.secureServer.close(),this.secureServer=null;if((Q=this.settings.enableSecureServer)!=null?Q:!0)this.secureServer=vs.createServer({key:this.settings.crypto.privateKey,cert:this.settings.crypto.cert},this.requestHandler.api),this.secureServer.listen(this.settings.port,(X=this.settings.bindingHost)!=null?X:CZ),console.log(`[REST API] Listening on https://${(Z=this.settings.bindingHost)!=null?Z:CZ}:${this.settings.port}/`);if(this.insecureServer)this.insecureServer.close(),this.insecureServer=null;if(this.settings.enableInsecureServer)this.insecureServer=gs.createServer(this.requestHandler.api),this.insecureServer.listen(this.settings.insecurePort,(J=this.settings.bindingHost)!=null?J:CZ),console.log(`[REST API] Listening on http://${(G=this.settings.bindingHost)!=null?G:CZ}:${this.settings.insecurePort}/`)}onunload(){if(this.secureServer)this.secureServer.close();if(this.insecureServer)this.insecureServer.close()}loadSettings(){return T0(this,null,function*(){this.settings=Object.assign({},zI,yield this.loadData())})}saveSettings(){return T0(this,null,function*(){yield this.saveData(this.settings)})}},ts=class extends Q8.PluginSettingTab{constructor(Q,X){super(Q,X);this.showAdvancedSettings=!1,this.plugin=X}display(){var Q;let{containerEl:X}=this;X.replaceChildren();let Z=yQ.default.pki.certificateFromPem(this.plugin.settings.crypto.cert),J=qI(Z),G=!HI(Z);X.empty(),X.classList.add("obsidian-local-rest-api-settings"),X.createEl("h2",{text:"Local REST API"}),X.createEl("h3",{text:"How to Access"});let Y=X.createEl("div");Y.classList.add("api-key-display");let H=Y.createEl("p");H.innerHTML=`
You can access Obsidian Local REST API via the following URLs:
`;let z=Y.createEl("table",{cls:"api-urls"}).createEl("tbody"),W=z.createEl("tr",this.plugin.settings.enableSecureServer===!1?{cls:"disabled",title:"Disabled. You can enable this in 'Settings' below."}:{title:"Enabled"}),$=`https://127.0.0.1:${this.plugin.settings.port}/`;W.innerHTML=`
<td>
${this.plugin.settings.enableSecureServer===!1?"笶":"笨"}
</td>
<td class="name">
Encrypted (HTTPS) API URL<br /><br />
<i>
Requires that <a href="https://127.0.0.1:${this.plugin.settings.port}/${dq}">this certificate</a> be
configured as a trusted certificate authority for
your browser. See <a href="https://github.com/coddingtonbear/obsidian-web/wiki/How-do-I-get-my-browser-trust-my-Obsidian-Local-REST-API-certificate%3F">wiki</a> for more information.
</i>
</td>
`;let q=W.createEl("td",{cls:"url"});if(q.innerHTML=`
${$} <a href="javascript:navigator.clipboard.writeText('${$}')">(copy)</a><br />
`,this.plugin.settings.subjectAltNames){for(let C of this.plugin.settings.subjectAltNames.split(`
`))if(C.trim()){let L=`https://${C.trim()}:${this.plugin.settings.port}/`;q.innerHTML+=`
${L} <a href="javascript:navigator.clipboard.writeText('${L}')">(copy)</a><br />
`}}let B=z.createEl("tr",this.plugin.settings.enableInsecureServer===!1?{cls:"disabled",title:"Disabled. You can enable this in 'Settings' below."}:{title:"Enabled"}),D=`http://127.0.0.1:${this.plugin.settings.insecurePort}/`;B.innerHTML=`
<td>
${this.plugin.settings.enableInsecureServer===!1?"笶":"笨"}
</td>
<td class="name">
Non-encrypted (HTTP) API URL
</td>
`;let F=B.createEl("td",{cls:"url"});if(F.innerHTML=`
${D} <a href="javascript:navigator.clipboard.writeText('${D}')">(copy)</a><br />
`,this.plugin.settings.subjectAltNames){for(let C of this.plugin.settings.subjectAltNames.split(`
`))if(C.trim()){let L=`http://${C.trim()}:${this.plugin.settings.insecurePort}/`;F.innerHTML+=`
${L} <a href="javascript:navigator.clipboard.writeText('${L}')">(copy)</a><br />
`}}let P=Y.createEl("p");P.innerHTML=`
Your API Key must be passed in requests via an authorization header
<a href="javascript:navigator.clipboard.writeText('${this.plugin.settings.apiKey}')">(copy)</a>:
`,Y.createEl("pre",{text:this.plugin.settings.apiKey}),Y.createEl("p",{text:"For example, the following request will return all notes in the root directory of your vault:"}),Y.createEl("pre",{text:`GET /vault/ HTTP/1.1
${(Q=this.plugin.settings.authorizationHeaderName)!=null?Q:"Authorization"}: Bearer ${this.plugin.settings.apiKey}`});let N=Y.createEl("p");if(N.innerHTML=`
Comprehensive documentation of what API endpoints are available can
be found in
<a href="https://coddingtonbear.github.io/obsidian-local-rest-api/">the online docs</a>.
`,X.createEl("h3",{text:"Settings"}),J<0){let C=Y.createEl("div");C.classList.add("certificate-expired"),C.innerHTML=`
<b>Your certificate has expired!</b>
You must re-generate your certificate below by pressing
the "Re-generate Certificates" button below in
order to connect securely to this API.
`}else if(J<30){let C=Y.createEl("div");C.classList.add("certificate-expiring-soon"),C.innerHTML=`
<b>Your certificate will expire in ${Math.floor(J)} day${Math.floor(J)===1?"":"s"}s!</b>
You should re-generate your certificate below by pressing
the "Re-generate Certificates" button below in
order to continue to connect securely to this API.
`}if(G){let C=Y.createEl("div");C.classList.add("certificate-regeneration-recommended"),C.innerHTML=`
<b>You should re-generate your certificate!</b>
Your certificate was generated using earlier standards than
are currently used by Obsidian Local REST API. Some systems
or tools may not accept your certificate with its current
configuration, and re-generating your certificate may
improve compatibility with such tools. To re-generate your
certificate, press the "Re-generate Certificates" button
below.
`}if(new Q8.Setting(X).setName("Enable Non-encrypted (HTTP) Server").setDesc("Enables a non-encrypted (HTTP) server on the port designated below. By default this plugin requires a secure HTTPS connection, but in safe environments you may turn on the non-encrypted server to simplify interacting with the API. Interactions with the API will still require the API Key shown above. Under no circumstances is it recommended that you expose this service to the internet, especially if you turn on this feature!").addToggle((C)=>C.onChange((L)=>{let V=this.plugin.settings.enableInsecureServer;if(this.plugin.settings.enableInsecureServer=L,this.plugin.saveSettings(),this.plugin.refreshServerState(),L!==V)this.display()}).setValue(this.plugin.settings.enableInsecureServer)),new Q8.Setting(X).setName("Reset All Cryptography").setDesc(`Pressing this button will cause your certificate,
private key, public key, and API key to be regenerated.
This settings panel will be closed when you press this.`).addButton((C)=>{C.setWarning().setButtonText("Reset All Crypto").onClick(()=>{delete this.plugin.settings.apiKey,delete this.plugin.settings.crypto,this.plugin.saveSettings(),this.plugin.unload(),this.plugin.load()})}),new Q8.Setting(X).setName("Re-generate Certificates").setDesc(`Pressing this button will cause your certificate,
private key, and public key to be re-generated, but your API key will remain unchanged.
This settings panel will be closed when you press this.`).addButton((C)=>{C.setWarning().setButtonText("Re-generate Certificates").onClick(()=>{delete this.plugin.settings.crypto,this.plugin.saveSettings(),this.plugin.unload(),this.plugin.load()})}),new Q8.Setting(X).setName("Restore Default Settings").setDesc(`Pressing this button will reset this plugin's
settings to defaults.
This settings panel will be closed when you press this.`).addButton((C)=>{C.setWarning().setButtonText("Restore Defaults").onClick(()=>{this.plugin.settings=Object.assign({},zI),this.plugin.saveSettings(),this.plugin.unload(),this.plugin.load()})}),new Q8.Setting(X).setName("Show advanced settings").setDesc("Advanced settings are dangerous and may make your environment less secure.").addToggle((C)=>{C.onChange((L)=>{if(this.showAdvancedSettings!==L)this.showAdvancedSettings=L,this.display()}).setValue(this.showAdvancedSettings)}),this.showAdvancedSettings){X.createEl("hr"),X.createEl("h3",{text:"Advanced Settings"}),X.createEl("p",{text:`
The settings below are potentially dangerous and
are intended for use only by people who know what
they are doing. Do not change any of these settings if
you do not understand what that setting is used for
and what security impacts changing that setting will have.
`});let C=X.createEl("p");C.createEl("span",{text:`
Use of this software is licensed to you under the
MIT license, and it is important that you understand that
this license provides you with no warranty.
For the complete license text please see
`}),C.createEl("a",{href:MM,text:MM}),C.createEl("span",{text:"."}),new Q8.Setting(X).setName("Enable Encrypted (HTTPs) Server").setDesc(`
This controls whether the HTTPs server is enabled. You almost certainly want to leave this switch in its default state ('on'),
but may find it useful to turn this switch off for
troubleshooting.
`).addToggle((L)=>{var V;return L.onChange((M)=>{let I=this.plugin.settings.enableSecureServer;if(this.plugin.settings.enableSecureServer=M,this.plugin.saveSettings(),this.plugin.refreshServerState(),M!==I)this.display()}).setValue((V=this.plugin.settings.enableSecureServer)!=null?V:!0)}),new Q8.Setting(X).setName("Encrypted (HTTPS) Server Port").setDesc("This configures the port on which your REST API will listen for HTTPS connections. It is recommended that you leave this port with its default setting as tools integrating with this API may expect the default port to be in use. Under no circumstances is it recommended that you expose this service directly to the internet.").addText((L)=>L.onChange((V)=>{this.plugin.settings.port=parseInt(V,10),this.plugin.saveSettings(),this.plugin.refreshServerState()}).setValue(this.plugin.settings.port.toString())),new Q8.Setting(X).setName("Non-encrypted (HTTP) Server Port").addText((L)=>L.onChange((V)=>{this.plugin.settings.insecurePort=parseInt(V,10),this.plugin.saveSettings(),this.plugin.refreshServerState()}).setValue(this.plugin.settings.insecurePort.toString())),new Q8.Setting(X).setName("API Key").addText((L)=>{L.onChange((V)=>{this.plugin.settings.apiKey=V,this.plugin.saveSettings(),this.plugin.refreshServerState()}).setValue(this.plugin.settings.apiKey)}),new Q8.Setting(X).setName("Certificate Hostnames").setDesc(`
List of extra hostnames to add
to your certificate's \`subjectAltName\` field.
One hostname per line.
You must click the "Re-generate Certificates" button above after changing this value
for this to have an effect. This is useful for
situations in which you are accessing Obsidian
from a hostname other than the host on which
it is running.
`).addTextArea((L)=>L.onChange((V)=>{this.plugin.settings.subjectAltNames=V,this.plugin.saveSettings()}).setValue(this.plugin.settings.subjectAltNames)),new Q8.Setting(X).setName("Certificate").addTextArea((L)=>L.onChange((V)=>{this.plugin.settings.crypto.cert=V,this.plugin.saveSettings(),this.plugin.refreshServerState()}).setValue(this.plugin.settings.crypto.cert)),new Q8.Setting(X).setName("Public Key").addTextArea((L)=>L.onChange((V)=>{this.plugin.settings.crypto.publicKey=V,this.plugin.saveSettings(),this.plugin.refreshServerState()}).setValue(this.plugin.settings.crypto.publicKey)),new Q8.Setting(X).setName("Private Key").addTextArea((L)=>L.onChange((V)=>{this.plugin.settings.crypto.privateKey=V,this.plugin.saveSettings(),this.plugin.refreshServerState()}).setValue(this.plugin.settings.crypto.privateKey)),new Q8.Setting(X).setName("Authorization Header").addText((L)=>{var V;L.onChange((M)=>{if(M!==TM)this.plugin.settings.authorizationHeaderName=M;else delete this.plugin.settings.authorizationHeaderName;this.plugin.saveSettings(),this.plugin.refreshServerState()}).setValue((V=this.plugin.settings.authorizationHeaderName)!=null?V:TM)}),new Q8.Setting(X).setName("Binding Host").addText((L)=>{var V;L.onChange((M)=>{if(M!==CZ)this.plugin.settings.bindingHost=M;else delete this.plugin.settings.bindingHost;this.plugin.saveSettings(),this.plugin.refreshServerState()}).setValue((V=this.plugin.settings.bindingHost)!=null?V:CZ)})}}},rs=(Q,X)=>{let Z=Q.plugins.plugins["obsidian-local-rest-api"];if(Z)return Z.getPublicApi(X)};/*!
* accepts
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* body-parser
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* body-parser
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* bytes
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson
* MIT Licensed
*//*!
* content-disposition
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*//*!
* content-type
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* cookie
* Copyright(c) 2012-2014 Roman Shtylman
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* depd
* Copyright(c) 2014 Douglas Christopher Wilson
* MIT Licensed
*//*!
* depd
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* depd
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*//*!
* depd
* Copyright(c) 2014-2018 Douglas Christopher Wilson
* MIT Licensed
*//*!
* depd
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* destroy
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*//*!
* ee-first
* Copyright(c) 2014 Jonathan Ong
* MIT Licensed
*//*!
* encodeurl
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* escape-html
* Copyright(c) 2012-2013 TJ Holowaychuk
* Copyright(c) 2015 Andreas Lubbe
* Copyright(c) 2015 Tiancheng "Timothy" Gu
* MIT Licensed
*//*!
* etag
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* express
* Copyright(c) 2009-2013 TJ Holowaychuk
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* finalhandler
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*//*!
* forwarded
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*//*!
* fresh
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2016-2017 Douglas Christopher Wilson
* MIT Licensed
*//*!
* http-errors
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* media-typer
* Copyright(c) 2014 Douglas Christopher Wilson
* MIT Licensed
*//*!
* merge-descriptors
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* methods
* Copyright(c) 2013-2014 TJ Holowaychuk
* Copyright(c) 2015-2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*//*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* negotiator
* Copyright(c) 2012 Federico Romero
* Copyright(c) 2012-2014 Isaac Z. Schlueter
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* on-finished
* Copyright(c) 2013 Jonathan Ong
* Copyright(c) 2014 Douglas Christopher Wilson
* MIT Licensed
*//*!
* on-headers
* Copyright(c) 2014 Douglas Christopher Wilson
* MIT Licensed
*//*!
* parseurl
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*//*!
* proxy-addr
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* range-parser
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015-2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* raw-body
* Copyright(c) 2013-2014 Jonathan Ong
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*//*!
* response-time
* Copyright(c) 2011 TJ Holowaychuk
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* router
* Copyright(c) 2013 Roman Shtylman
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*//*!
* send
* Copyright(c) 2012 TJ Holowaychuk
* Copyright(c) 2014-2022 Douglas Christopher Wilson
* MIT Licensed
*//*!
* serve-static
* Copyright(c) 2010 Sencha Inc.
* Copyright(c) 2011 TJ Holowaychuk
* Copyright(c) 2014-2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* statuses
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* toidentifier
* Copyright(c) 2016 Douglas Christopher Wilson
* MIT Licensed
*//*!
* type-is
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2014-2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* unpipe
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*//*!
* vary
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*//*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */});var hX=r((kL1,LI)=>{var Zt=Number.MAX_SAFE_INTEGER||9007199254740991,Xt=["major","premajor","minor","preminor","patch","prepatch","prerelease"];LI.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Zt,RELEASE_TYPES:Xt,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var fX=r((yL1,CI)=>{var Jt=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...Q)=>console.error("SEMVER",...Q):()=>{};CI.exports=Jt});var K7=r((vQ,NI)=>{var{MAX_SAFE_COMPONENT_LENGTH:m$,MAX_SAFE_BUILD_LENGTH:Gt,MAX_LENGTH:Yt}=hX(),Wt=fX();vQ=NI.exports={};var qt=vQ.re=[],Ht=vQ.safeRe=[],i1=vQ.src=[],n1=vQ.t={},zt=0,_$="[a-zA-Z0-9-]",Kt=[["\\s",1],["\\d",Yt],[_$,Gt]],$t=(Q)=>{for(let[X,Z]of Kt)Q=Q.split(`${X}*`).join(`${X}{0,${Z}}`).split(`${X}+`).join(`${X}{1,${Z}}`);return Q},I0=(Q,X,Z)=>{let J=$t(X),G=zt++;Wt(Q,G,X),n1[Q]=G,i1[G]=X,qt[G]=new RegExp(X,Z?"g":void 0),Ht[G]=new RegExp(J,Z?"g":void 0)};I0("NUMERICIDENTIFIER","0|[1-9]\\d*");I0("NUMERICIDENTIFIERLOOSE","\\d+");I0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${_$}*`);I0("MAINVERSION",`(${i1[n1.NUMERICIDENTIFIER]})\\.(${i1[n1.NUMERICIDENTIFIER]})\\.(${i1[n1.NUMERICIDENTIFIER]})`);I0("MAINVERSIONLOOSE",`(${i1[n1.NUMERICIDENTIFIERLOOSE]})\\.(${i1[n1.NUMERICIDENTIFIERLOOSE]})\\.(${i1[n1.NUMERICIDENTIFIERLOOSE]})`);I0("PRERELEASEIDENTIFIER",`(?:${i1[n1.NUMERICIDENTIFIER]}|${i1[n1.NONNUMERICIDENTIFIER]})`);I0("PRERELEASEIDENTIFIERLOOSE",`(?:${i1[n1.NUMERICIDENTIFIERLOOSE]}|${i1[n1.NONNUMERICIDENTIFIER]})`);I0("PRERELEASE",`(?:-(${i1[n1.PRERELEASEIDENTIFIER]}(?:\\.${i1[n1.PRERELEASEIDENTIFIER]})*))`);I0("PRERELEASELOOSE",`(?:-?(${i1[n1.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i1[n1.PRERELEASEIDENTIFIERLOOSE]})*))`);I0("BUILDIDENTIFIER",`${_$}+`);I0("BUILD",`(?:\\+(${i1[n1.BUILDIDENTIFIER]}(?:\\.${i1[n1.BUILDIDENTIFIER]})*))`);I0("FULLPLAIN",`v?${i1[n1.MAINVERSION]}${i1[n1.PRERELEASE]}?${i1[n1.BUILD]}?`);I0("FULL",`^${i1[n1.FULLPLAIN]}$`);I0("LOOSEPLAIN",`[v=\\s]*${i1[n1.MAINVERSIONLOOSE]}${i1[n1.PRERELEASELOOSE]}?${i1[n1.BUILD]}?`);I0("LOOSE",`^${i1[n1.LOOSEPLAIN]}$`);I0("GTLT","((?:<|>)?=?)");I0("XRANGEIDENTIFIERLOOSE",`${i1[n1.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);I0("XRANGEIDENTIFIER",`${i1[n1.NUMERICIDENTIFIER]}|x|X|\\*`);I0("XRANGEPLAIN",`[v=\\s]*(${i1[n1.XRANGEIDENTIFIER]})(?:\\.(${i1[n1.XRANGEIDENTIFIER]})(?:\\.(${i1[n1.XRANGEIDENTIFIER]})(?:${i1[n1.PRERELEASE]})?${i1[n1.BUILD]}?)?)?`);I0("XRANGEPLAINLOOSE",`[v=\\s]*(${i1[n1.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i1[n1.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i1[n1.XRANGEIDENTIFIERLOOSE]})(?:${i1[n1.PRERELEASELOOSE]})?${i1[n1.BUILD]}?)?)?`);I0("XRANGE",`^${i1[n1.GTLT]}\\s*${i1[n1.XRANGEPLAIN]}$`);I0("XRANGELOOSE",`^${i1[n1.GTLT]}\\s*${i1[n1.XRANGEPLAINLOOSE]}$`);I0("COERCEPLAIN",`(^|[^\\d])(\\d{1,${m$}})(?:\\.(\\d{1,${m$}}))?(?:\\.(\\d{1,${m$}}))?`);I0("COERCE",`${i1[n1.COERCEPLAIN]}(?:$|[^\\d])`);I0("COERCEFULL",i1[n1.COERCEPLAIN]+`(?:${i1[n1.PRERELEASE]})?(?:${i1[n1.BUILD]})?(?:$|[^\\d])`);I0("COERCERTL",i1[n1.COERCE],!0);I0("COERCERTLFULL",i1[n1.COERCEFULL],!0);I0("LONETILDE","(?:~>?)");I0("TILDETRIM",`(\\s*)${i1[n1.LONETILDE]}\\s+`,!0);vQ.tildeTrimReplace="$1~";I0("TILDE",`^${i1[n1.LONETILDE]}${i1[n1.XRANGEPLAIN]}$`);I0("TILDELOOSE",`^${i1[n1.LONETILDE]}${i1[n1.XRANGEPLAINLOOSE]}$`);I0("LONECARET","(?:\\^)");I0("CARETTRIM",`(\\s*)${i1[n1.LONECARET]}\\s+`,!0);vQ.caretTrimReplace="$1^";I0("CARET",`^${i1[n1.LONECARET]}${i1[n1.XRANGEPLAIN]}$`);I0("CARETLOOSE",`^${i1[n1.LONECARET]}${i1[n1.XRANGEPLAINLOOSE]}$`);I0("COMPARATORLOOSE",`^${i1[n1.GTLT]}\\s*(${i1[n1.LOOSEPLAIN]})$|^$`);I0("COMPARATOR",`^${i1[n1.GTLT]}\\s*(${i1[n1.FULLPLAIN]})$|^$`);I0("COMPARATORTRIM",`(\\s*)${i1[n1.GTLT]}\\s*(${i1[n1.LOOSEPLAIN]}|${i1[n1.XRANGEPLAIN]})`,!0);vQ.comparatorTrimReplace="$1$2$3";I0("HYPHENRANGE",`^\\s*(${i1[n1.XRANGEPLAIN]})\\s+-\\s+(${i1[n1.XRANGEPLAIN]})\\s*$`);I0("HYPHENRANGELOOSE",`^\\s*(${i1[n1.XRANGEPLAINLOOSE]})\\s+-\\s+(${i1[n1.XRANGEPLAINLOOSE]})\\s*$`);I0("STAR","(<|>
Message: ${J}
Source: (${Q.slice(0,-1)}) => {
${Q.at(-1)}
}`)}}};class _Q{constructor(Q,...[X]){return Object.assign(Object.setPrototypeOf(Q.bind(X?.bind??this),this.constructor.prototype),X?.attach)}}var NU=Bw(()=>{try{return new Function("return false")()}catch{return!0}});var TU=fZ("arkInferred");var y11=fZ("args");class X8{constructor(){}}var MU=(Q)=>Q[0].toUpperCase()+Q.slice(1);var n3=(Q)=>new RegExp(Uw(Q),typeof Q==="string"?"":Q.flags);var Uw=(Q)=>{return`^(?:${typeof Q==="string"?Q:Q.source})$`};var DQ={negativeLookahead:(Q)=>`(?!${Q})`,nonCapturingGroup:(Q)=>`(?:${Q})`},k7="\\",dQ={" ":1,"\n":1,"\t":1};var Vw=/^-0\.?0*$/.source,RU=/[1-9]\d*/.source,Pw=/\.\d+/.source,Fw=/\.\d*[1-9]/.source,AU=(Q)=>n3(DQ.negativeLookahead(Vw)+DQ.nonCapturingGroup("-?"+DQ.nonCapturingGroup(DQ.nonCapturingGroup("0|"+RU)+DQ.nonCapturingGroup(Q.decimalPattern)+"?")+(Q.allowDecimalOnly?"":"|"+Q.decimalPattern)+"?")),IU=AU({decimalPattern:Fw,allowDecimalOnly:!1}),Dw=IU.test.bind(IU),OU=AU({decimalPattern:Pw,allowDecimalOnly:!0}),Lw=/^-?\d*\.?\d*$/,Cw=(Q)=>Q.length!==0&&Lw.test(Q),y7=n3(DQ.negativeLookahead("^-0$")+"-?"+DQ.nonCapturingGroup(DQ.nonCapturingGroup("0|"+RU))),Nw=y7.test.bind(y7),o3=/^-?\d+$/,Tw=o3.test.bind(o3),wU={number:"a number",bigint:"a bigint",integer:"an integer"},EU=(Q,X)=>`'${Q}' was parsed as ${wU[X]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,Mw=(Q,X)=>X==="number"?Dw(Q):Nw(Q),Iw=(Q,X)=>X==="number"?Number(Q):Number.parseInt(Q),Rw=(Q,X)=>X==="number"?Cw(Q):Tw(Q),jU=(Q,X)=>a3(Q,"number",X),SU=(Q,X)=>a3(Q,"number",{...X,strict:!0}),kU=(Q,X)=>a3(Q,"integer",X),a3=(Q,X,Z)=>{let J=Iw(Q,X);if(!Number.isNaN(J)){if(Rw(Q,X)){if(Z?.strict)return Mw(Q,X)?J:I1(EU(Q,X));return J}}return Z?.errorOnFail?I1(Z?.errorOnFail===!0?`Failed to parse ${wU[X]} from '${Q}'`:Z?.errorOnFail):void 0},yU=(Q)=>{if(Q[Q.length-1]!=="n")return;let X=Q.slice(0,-1),Z;try{Z=BigInt(X)}catch{return}if(y7.test(X))return Z;if(o3.test(X))return I1(EU(Q,"bigint"))};var Aw="0.30.0",Ow={version:Aw,filename:"mcp-tools-for-obsidian.ts",FileConstructor:l3},m4=Ow,xU=new WeakMap,s3=Object.create(null),x7=(Q)=>{let X=xU.get(Q);if(X)return X;let Z=ww(Q);if(s3[Z])Z=`${Z}${s3[Z]++}`;else s3[Z]=1;return m4[Z]=Q,xU.set(Q,Z),Z},bZ=(Q)=>/^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(Q),ww=(Q)=>{switch(typeof Q){case"object":{if(Q===null)break;let X=E7(Q)??"object";return X[0].toLowerCase()+X.slice(1)}case"function":return bZ(Q.name)?Q.name:"fn";case"symbol":return Q.description&&bZ(Q.description)?Q.description:"symbol"}return a0(`Unexpected attempt to register serializable value of type ${P8(Q)}`)};var MJ=(Q)=>typeof Q==="string"?JSON.stringify(Q):typeof Q==="bigint"?`${Q}n`:`${Q}`;var vU=(Q,X={})=>v7(Q,{onUndefined:"$ark.undefined",onBigInt:(Z)=>`$ark.bigint-${Z}`,...X},[]);var O0=(Q,X)=>{switch(P8(Q)){case"object":let Z=Q,J=Z.constructor.name;return J==="Object"||J==="Array"?JSON.stringify(v7(Z,IJ,[]),null,X):Z instanceof Date?_4(Z):typeof Z.expression==="string"?Z.expression:J;case"symbol":return IJ.onSymbol(Q);default:return MJ(Q)}},IJ={onCycle:()=>"(cycle)",onSymbol:(Q)=>`Symbol(${x7(Q)})`,onFunction:(Q)=>`Function(${x7(Q)})`},v7=(Q,X,Z)=>{switch(P8(Q)){case"object":{let J=Q;if("toJSON"in J&&typeof J.toJSON==="function")return J.toJSON();if(typeof J==="function")return IJ.onFunction(J);if(Z.includes(J))return"(cycle)";let G=[...Z,J];if(Array.isArray(J))return J.map((H)=>v7(H,X,G));if(J instanceof Date)return J.toDateString();let Y={};for(let H in J)Y[H]=v7(J[H],X,G);for(let H of Object.getOwnPropertySymbols(J))Y[X.onSymbol?.(H)??H.toString()]=v7(J[H],X,G);return Y}case"symbol":return IJ.onSymbol(Q);case"bigint":return X.onBigInt?.(Q)??`${Q}n`;case"undefined":return X.onUndefined??"undefined";default:return Q}},_4=(Q)=>{let X=Q.getFullYear(),Z=Q.getMonth(),J=Q.getDate(),G=Q.getHours(),Y=Q.getMinutes(),H=Q.getSeconds(),K=Q.getMilliseconds();if(Z===0&&J===1&&G===0&&Y===0&&H===0&&K===0)return`${X}`;let z=`${Ew[Z]} ${J}, ${X}`;if(G===0&&Y===0&&H===0&&K===0)return z;let W=Q.toLocaleTimeString(),$=W.endsWith(" AM")||W.endsWith(" PM")?W.slice(-3):""
`))}var kw=(Q)=>`${hU}.${Q}`,g6=(Q)=>kw(x7(Q));class RJ extends O7{argNames;body="";constructor(...Q){super();this.argNames=Q;for(let X of Q){if(X in this)throw new Error(`Arg name '${X}' would overwrite an existing property on FunctionBody`);this[X]=X}}indentation=0;indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(Q,X=!1){return QH(Q,X)}index(Q,X=!1){return fU(`${Q}`,X)}line(Q){return this.body+=`${" ".repeat(this.indentation)}${Q}
`,this}const(Q,X){return this.line(`const ${Q} = ${X}`),this}let(Q,X){return this.line(`let ${Q} = ${X}`)}set(Q,X){return this.line(`${Q} = ${X}`)}if(Q,X){return this.block(`if (${Q})`,X)}elseIf(Q,X){return this.block(`else if (${Q})`,X)}else(Q){return this.block("else",Q)}for(Q,X,Z=0){return this.block(`for (let i = ${Z}; ${Q}; i++)`,X)}forIn(Q,X){return this.block(`for (const k in ${Q})`,X)}block(Q,X,Z=""){return this.line(`${Q} {`),this.indent(),X(this),this.dedent(),this.line(`}${Z}`)}return(Q=""){return this.line(`return ${Q}`)}write(Q="anonymous"){return`${Q}(${this.argNames.join(", ")}) {
${this.body}}`}compile(){return new CU(...this.argNames,this.body)}}var LQ=(Q)=>M8(Q,"object")||typeof Q==="symbol"?g6(Q):MJ(Q),QH=(Q,X=!1)=>{if(typeof Q==="string"&&bZ(Q))return`${X?"?":""}.${Q}`;return fU(yw(Q),X)},yw=(Q)=>typeof Q==="symbol"?g6(Q):JSON.stringify(Q),fU=(Q,X=!1)=>`${X?"?.":""}[${Q}]`;class AJ extends RJ{path=[];discriminants=[];traversalKind;constructor(Q){super("data","ctx");this.traversalKind=Q}invoke(Q,X){let Z=X?.arg??this.data,J=typeof Q==="string"?!0:this.requiresContextFor(Q),G=typeof Q==="string"?Q:Q.id;if(J)return`${this.referenceToId(G,X)}(${Z}, ${this.ctx})`;return`${this.referenceToId(G,X)}(${Z})`}referenceToId(Q,X){let Z=X?.kind??this.traversalKind,J=`this.${Q}${Z}`;return X?.bind?`${J}.bind(${X?.bind})`:J}requiresContextFor(Q){return this.traversalKind==="Apply"||Q.allowsRequiresContext}initializeErrorCount(){return this.const("errorCount","ctx.currentErrorCount")}returnIfFail(){return this.if("ctx.currentErrorCount > errorCount",()=>this.return())}returnIfFailFast(){return this.if("ctx.failFast && ctx.currentErrorCount > errorCount",()=>this.return())}traverseKey(Q,X,Z){let J=this.requiresContextFor(Z);if(J)this.line(`${this.ctx}.path.push(${Q})`);if(this.check(Z,{arg:X}),J)this.line(`${this.ctx}.path.pop()`);return this}check(Q,X){return this.traversalKind==="Allows"?this.if(`!${this.invoke(Q,X)}`,()=>this.return(!1)):this.line(this.invoke(Q,X))}}var OJ=(Q)=>w0(Q,(X,Z)=>[X,G6(Z)?[...Z]:Z]),I8=fZ("arkKind"),r1=(Q,X)=>Q?.[I8]===X,F6=(Q)=>r1(Q,"root")||r1(Q,"constraint");var bU=["unit","proto","domain"],mZ=["required","optional","index","sequence"],ZH=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],wJ=[...ZH,...mZ,"structure","predicate"],_Z=["alias","union","morph","unit","intersection","proto","domain"],xw=[..._Z,...wJ],EJ=w0(wJ,(Q,X)=>[X,1]),mU=w0([...mZ,"undeclared"],(Q,X)=>[X,1]),_U=w0(xw,(Q,X)=>[X,Q]),dZ=(Q)=>typeof Q==="string"&&(Q in _U);var uZ=(Q)=>_U[Q],jJ=(Q)=>_Z.slice(uZ(Q)+1),d01=[...jJ("union"),"alias"],u01=[...jJ("morph"),"alias"],CQ=(Q)=>{if(typeof Q==="string"||typeof Q==="boolean"||Q===null)return Q;if(typeof Q==="number"){if(Number.isNaN(Q))return"NaN";if(Q===Number.POSITIVE_INFINITY)return"Infinity";if(Q===Number.NEGATIVE_INFINITY)return"-Infinity";return Q}return LQ(Q)},uQ=(Q)=>{let X="{ ";for(let[Z,J]of Object.entries(Q))X+=`${Z}: ${LQ(J)}, `;return X+" }"},N0=(Q)=>{let X=Q;if(X.hasAssociatedError)X.defaults.expected??=(Z)=>("description"in Z)?Z.description:X.defaults.description(Z),X.defaults.actual??=(Z)=>O0(Z),X.defaults.problem??=(Z)=>`must be ${Z.expected}${Z.actual?` (was ${Z.actual})`:""}`,X.defaults.message??=(Z)=>{if(Z.path.length===0)return Z.problem;let J=`${Z.propString} ${Z.problem}`;if(J[0]==="[")return`value at ${J}`;return J};return X};E1.config??={};var vw=(Q,X)=>{let Z={...Q},J;for(J in X)Z[J]=dZ(J)?{...Q[J],...X[J]}:X[J];return Z},dU=(Q,X)=>{if(!X)return Q;return vw(Q,X)},uU=(Q)=>dU(dU(E1.defaultConfig,E1.config),Q);class p4 extends O7{[I8]="error";path;data;nodeConfig;input;constructor(Q,X){super();this.input=Q,VU(this,Q);let Z=X.data;if(Q.code==="union")Q.errors=Q.errors.flatMap((J)=>J.hasCode("union")?J.errors:J);this.nodeConfig=X.config[this.code],this.path=Q.relativePath?new u4(...X.path,...Q.relativePath):Q.path?new u4(...Q.path):new u4(...X.path),this.data="data"in Q?Q.data:Z}hasCode(Q){return this.code===Q}get propString(){return d4(this.path)}get expected(){return this.input.expected??this.nodeConfig.expected?.(this.input)}get actual(){return this.input.actual??this.nodeConfig.actual?.(this.data)}get problem(){return this.input.problem??this.nodeConfig.problem(this)}get message(){return this.input.message??this.nodeConfig.message(this)}toString(){return this.message}throw(){throw this}}class R8 extends CJ{ctx;constructor(Q){super();this.ctx=Q}byPath=Object.create(null);byAncestorPath=Object.create(null);count=0;mutable=this;add(Q){if(this.includes(Q))return;this._add(Q)}affectsPath(Q){if(this.length===0)return!1;return Q.stringifyAncestors().some((X)=>(X in this.byPath))||Q.stringify()in this.byAnces
`)}throw(){throw new AggregateError(this,this.message)}}class SJ{path=[];queuedMorphs=[];errors=new R8(this);branches=[];seen={};root;config;constructor(Q,X){this.root=Q,this.config=X}get currentBranch(){return this.branches.at(-1)}queueMorphs(Q){let X={path:new u4(...this.path),morphs:Q};if(this.currentBranch)this.currentBranch.queuedMorphs.push(X);else this.queuedMorphs.push(X)}finalize(){if(!this.queuedMorphs.length)return this.hasError()?this.errors:this.root;if(typeof this.root==="object"&&this.root!==null&&this.config.clone)this.root=this.config.clone(this.root);return this.applyQueuedMorphs(),this.hasError()?this.errors:this.root}applyQueuedMorphs(){while(this.queuedMorphs.length){let Q=this.queuedMorphs;this.queuedMorphs=[];for(let{path:X,morphs:Z}of Q){if(this.errors.affectsPath(X))continue;this.applyMorphsAtPath(X,Z)}}}applyMorphsAtPath(Q,X){let Z=Q.at(-1),J;if(Z!==void 0){J=this.root;for(let G=0;G<Q.length-1;G++)J=J[Q[G]]}this.path=[...Q];for(let G of X){let Y=F6(G),H=G(J===void 0?this.root:J[Z],this);if(H instanceof p4){this.errors.add(H);break}if(H instanceof R8){if(!Y)this.errors.merge(H);break}if(J===void 0)this.root=H;else J[Z]=H;this.applyQueuedMorphs()}}get currentErrorCount(){return this.currentBranch?this.currentBranch.error?1:0:this.errors.count}hasError(){return this.currentErrorCount!==0}get failFast(){return this.branches.length!==0}error(Q){let X=typeof Q==="object"?Q.code?Q:{...Q,code:"predicate"}:{code:"predicate",expected:Q},Z=new p4(X,this);if(this.currentBranch)this.currentBranch.error=Z;else this.errors.add(Z);return Z}get data(){let Q=this.root;for(let X of this.path)Q=Q?.[X];return Q}reject(Q){return this.error(Q),!1}mustBe(Q){return this.error(Q),!1}pushBranch(){this.branches.push({error:void 0,queuedMorphs:[]})}popBranch(){return this.branches.pop()}}var A8=(Q,X,Z)=>{if(!Z)return X();Z.path.push(Q);let J=X();return Z.path.pop(),J};class g7 extends _Q{attachments;$;constructor(Q,X){super((Z,J)=>{if(!this.includesMorph&&!this.allowsRequiresContext&&this.allows(Z))return Z;if(J)return this.traverseApply(Z,J),J.hasError()?J.errors:J.data;let G=new SJ(Z,this.$.resolvedConfig);return this.traverseApply(Z,G),G.finalize()},{attach:Q});this.attachments=Q,this.$=X}withMeta(Q){return this.$.node(this.kind,{...this.inner,meta:typeof Q==="function"?Q({...this.meta}):Q})}includesMorph=this.kind==="morph"||this.hasKind("optional")&&this.hasDefault()||this.hasKind("sequence")&&this.defaultablesLength!==0||this.hasKind("structure")&&this.undeclared==="delete"||this.children.some((Q)=>Q.includesMorph);hasContextualPredicate=this.hasKind("predicate")&&this.inner.predicate.length!==1||this.children.some((Q)=>Q.hasContextualPredicate);isCyclic=this.kind==="alias"||this.children.some((Q)=>Q.isCyclic);allowsRequiresContext=this.hasContextualPredicate||this.isCyclic;referencesById=this.children.reduce((Q,X)=>Object.assign(Q,X.referencesById),{[this.id]:this});cacheGetter(Q,X){return Object.defineProperty(this,Q,{value:X}),X}get description(){let Q=this.$?.resolvedConfig[this.kind].description??E1.config[this.kind]?.description??E1.defaultConfig[this.kind].description;return this.cacheGetter("description",this.meta?.description??Q(this))}get references(){return Object.values(this.referencesById)}get shallowReferences(){return this.cacheGetter("shallowReferences",this.hasKind("structure")?[this,...this.children]:this.children.reduce((Q,X)=>fw(Q,X.shallowReferences),[this]))}get shallowMorphs(){return this.cacheGetter("shallowMorphs",this.shallowReferences.filter((Q)=>Q.hasKind("morph")).sort((Q,X)=>Q.expression<X.expression?-1:1))}get flatRefs(){return this.cacheGetter("flatRefs",this.children.reduce((Q,X)=>pZ(Q,X.flatRefs),[]).sort((Q,X)=>Q.path.length>X.path.length?1:Q.path.length<X.path.length?-1:Q.propString>X.propString?1:Q.propString<X.propString?-1:Q.node.expression<X.node.expression?-1:1))}precedence=uZ(this.kind);precompilation;allows=(Q)=>{if(this.allowsRequiresContext)return this.traverseAllows(Q,new SJ(Q,this.$.resolvedConfig));return this.traverseAllows(Q)};traverse(Q){return this(Q)}get in(){retur
窶「 ${this.map(({path:Q,l:X,r:Z})=>`${Q}: ${pU(X,Z)}`).join(`
窶「 `)}`}throw(){return I1(this.describeReasons())}invert(){return this.map((Q)=>({...Q,l:Q.r,r:Q.l}))}withPrefixKey(Q,X){return this.map((Z)=>({...Z,path:[Q,...Z.path],optional:Z.optional||X==="optional"}))}toNeverIfDisjoint(){return E1.intrinsic.never}}var pU=(Q,X)=>`${XH(Q)} and ${XH(X)}`,XH=(Q)=>F6(Q)?Q.expression:G6(Q)?Q.map(XH).join(" | ")||"never":String(Q),JH=(Q)=>`${Q} results in an unsatisfiable type`;var lZ={},i8=(Q,X,Z)=>$6(Q,X,{$:Z,invert:!1,pipe:!1}),YH=(Q,X,Z)=>$6(Q,X,{$:Z,invert:!1,pipe:!0}),$6=(Q,X,Z)=>{let J=Z.pipe?"|>":"&",G=`${Q.hash}${J}${X.hash}`;if(lZ[G]!==void 0)return lZ[G];if(!Z.pipe){let K=`${X.hash}${J}${Q.hash}`;if(lZ[K]!==void 0){let z=lZ[K],W=z instanceof p1?z.invert():z;return lZ[G]=W,W}}let Y=!Z.pipe||!Q.includesMorph&&!X.includesMorph;if(Y&&Q.equals(X))return Q;let H=Y?GH(Q,X,Z):Q.hasKindIn(..._Z)?bw(Q,X,Z):GH(Q,X,Z);if(F6(H)){if(Q.equals(H))H=Q;else if(X.equals(H))H=X}return lZ[G]=H,H},GH=(Q,X,Z)=>{let J=Q.precedence<X.precedence?Q.kind:X.kind,G=Q.impl.intersections[X.kind]??X.impl.intersections[Q.kind];if(G===void 0)return null;else if(J===Q.kind)return G(Q,X,Z);else{let Y=G(X,Q,{...Z,invert:!Z.invert});if(Y instanceof p1)Y=Y.invert();return Y}},bw=(Q,X,Z)=>Q.includesMorph||X.includesMorph?Z.invert?lU(X,Q,Z):lU(Q,X,Z):GH(Q,X,Z),lU=(Q,X,Z)=>Q.distribute((J)=>mw(J,X,Z),(J)=>{let G=J.filter(F6);if(G.length===0)return p1.init("union",Q.branches,X.branches);if(G.length<Q.branches.length||!Q.branches.every((K,z)=>K.in.equals(G[z].in)))return Z.$.parseSchema(G);let Y;if(G.length===1){let K=G[0];if(!Y)return K;return Z.$.node("morph",{...K.inner,in:K.in.withMeta(Y)})}let H={branches:G};if(Y)H.meta=Y;return Z.$.parseSchema(H)}),mw=(Q,X,Z)=>{if(Q.hasKind("morph")){let G=[...Q.morphs];if(Q.lastMorphIfNode){let Y=$6(Q.lastMorphIfNode,X,Z);if(Y instanceof p1)return Y;G[G.length-1]=Y}else G.push(X);return Z.$.node("morph",{morphs:G,in:Q.inner.in})}if(X.hasKind("morph")){let G=$6(Q,X.in,Z);if(G instanceof p1)return G;return Z.$.node("morph",{morphs:[X],in:G})}return Z.$.node("morph",{morphs:[X],in:Q})};class W9 extends g7{constructor(Q,X){super(Q,X);Object.defineProperty(this,I8,{value:"constraint",enumerable:!1})}impliedSiblings;intersect(Q){return i8(this,Q,this.$)}}class NQ extends W9{traverseApply=(Q,X)=>{if(!this.traverseAllows(Q,X))X.error(this.errorContext)};compile(Q){if(Q.traversalKind==="Allows")Q.return(this.compiledCondition);else Q.if(this.compiledNegation,()=>Q.line(`${Q.ctx}.error(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,...this.inner}}get compiledErrorContext(){return uQ(this.errorContext)}}var J8=(Q)=>(X,Z)=>{if(G6(X)){if(X.length===0)return;let G=X.map((Y)=>Z.$.node(Q,Y));if(Q==="predicate")return G;return G.sort((Y,H)=>Y.hash<H.hash?-1:1)}let J=Z.$.node(Q,X);return J.hasOpenIntersection()?[J]:J},cZ=(Q)=>{let X=Q.r.shift();if(!X){let J=Q.l.length===0&&Q.kind==="structure"?E1.intrinsic.unknown.internal:Q.ctx.$.node(Q.kind,Object.assign(Q.baseInner,_w(Q.l)),{prereduced:!0});for(let G of Q.roots){if(J instanceof p1)return J;J=$6(G,J,Q.ctx)}return J}let Z=!1;for(let J=0;J<Q.l.length;J++){let G=$6(Q.l[J],X,Q.ctx);if(G===null)continue;if(G instanceof p1)return G;if(!Z){if(G.isRoot())return Q.roots.push(G),Q.l.splice(J),cZ(Q);Q.l[J]=G,Z=!0}else if(!Q.l.includes(G))return a0(`Unexpectedly encountered multiple distinct intersection results for refinement ${G}`)}if(!Z)Q.l.push(X);if(Q.kind==="intersection")X.impliedSiblings?.forEach((J)=>FQ(Q.r,J));return cZ(Q)},iZ=(Q)=>{return Object.entries(Q).flatMap(([Z,J])=>(Z in EJ)?J:[]).sort((Z,J)=>Z.precedence<J.precedence?-1:Z.precedence>J.precedence?1:Z.kind==="predicate"&&J.kind==="predicate"?0:Z.hash<J.hash?-1:1)},_w=(Q)=>{let X={};for(let Z of Q)if(Z.hasOpenIntersection())X[Z.kind]=h0(X[Z.kind],Z);else{if(X[Z.kind])return a0(`Unexpected intersection of closed refinements of kind ${Z.kind}`);X[Z.kind]=Z}return X},cU=(...Q)=>I1(iU(...Q)),iU=(Q,X,Z)=>`${MU(Q)} operand must be ${X.description} (was ${Z.exclude(X).description})`;var nU=(Q,X,Z)=>new pQ(Q,X,Z,Z,null);class kJ extends _Q{}cl
${Y}
`})}}),this)}pipe=Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)});to(Q){return this.$.finalize(this.toNode(this.$.parseDefinition(Q)))}toNode(Q){let X=YH(this,Q,this.$);if(X instanceof p1)return X.throw();return X}pipeOnce(Q){if(r1(Q,"root"))return this.toNode(Q);return this.distribute((X)=>X.hasKind("morph")?this.$.node("morph",{in:X.inner.in,morphs:[...X.morphs,Q]}):this.$.node("morph",{in:X,morphs:[Q]}),this.$.parseSchema)}get flatMorphs(){return this.cacheGetter("flatMorphs",this.flatRefs.reduce((Q,X)=>pZ(Q,X.node.hasKind("union")?X.node.branches.filter((Z)=>Z.hasKind("morph")).map((Z)=>({path:X.path,propString:X.propString,node:Z})):X.node.hasKind("morph")?X:[]),[]))}narrow(Q){return this.constrainOut("predicate",Q)}constrain(Q,X){return this._constrain("root",Q,X)}constrainIn(Q,X){return this._constrain("in",Q,X)}constrainOut(Q,X){return this._constrain("out",Q,X)}_constrain(Q,X,Z){let J=this.$.node(X,Z);if(J.isRoot())return J.isUnknown()?this:a0(`Unexpected constraint node ${J}`);let G=Q==="root"?this:this[Q];if(G.hasKind("morph")||J.impliedBasis&&!G.extends(J.impliedBasis))return cU(X,J.impliedBasis,this);let Y=this.$.node("intersection",{[J.kind]:J}),H=Q==="out"?YH(this,Y,this.$):i8(this,Y,this.$);if(H instanceof p1)H.throw();return this.$.finalize(H)}onUndeclaredKey(Q){let X=typeof Q==="string"?Q:Q.rule,Z=typeof Q==="string"?!1:Q.deep;return this.$.finalize(this.transform((J,G)=>J==="structure"?X==="ignore"?UU(G,{undeclared:1}):{...G,undeclared:X}:G,Z?void 0:{shouldTransform:(J)=>!PQ(mZ,J.kind)}))}onDeepUndeclaredKey(Q){return this.onUndeclaredKey({rule:Q,deep:!0})}satisfying(Q){return this.constrain("predicate",Q)}divisibleBy(Q){return this.constrain("divisor",Q)}matching(Q){return this.constrain("pattern",Q)}atLeast(Q){return this.constrain("min",Q)}atMost(Q){return this.constrain("max",Q)}moreThan(Q){return this.constrain("min",aZ(Q))}lessThan(Q){return this.constrain("max",aZ(Q))}atLeastLength(Q){return this.constrain("minLength",Q)}atMostLength(Q){return this.constrain("maxLength",Q)}moreThanLength(Q){return this.constrain("minLength",aZ(Q))}lessThanLength(Q){return this.constrain("maxLength",aZ(Q))}exactlyLength(Q){return this.constrain("exactLength",Q)}atOrAfter(Q){return this.constrain("after",Q)}atOrBefore(Q){return this.constrain("before",Q)}laterThan(Q){return this.constrain("after",aZ(Q))}earlierThan(Q){return this.constrain("before",aZ(Q))}}var KE="Expected a non-empty brand name after #",aZ=(Q)=>typeof Q==="object"&&!(Q instanceof Date)?{...Q,exclusive:!0}:{rule:Q,exclusive:!0},d7=(Q,X)=>r1(X,"root")?r1(Q,"root")?Q.extends(X):X.allows(Q):r1(Q,"root")?Q.hasUnit(X):X===Q,VV=(Q)=>{if(Q.hasKind("morph"))return null;if(Q.hasKind("intersection"))return Q.inner.structure??(Q.basis?.domain==="object"?Q.$.bindReference(E1.intrinsic.emptyStructure):null);if(Q.isBasis()&&Q.domain==="object")return Q.$.bindReference(E1.intrinsic.emptyStructure);return null},$E=(Q)=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
${Q}`,PV=(Q,X)=>`${Q} operand must be an object (was ${X})`;var o9=(Q,X)=>w0(jJ(Q),(Z,J)=>[J,X]);var BE=(Q)=>typeof Q==="string"?{reference:Q}:Q,FV=(Q)=>Q instanceof p1?E1.intrinsic.never.internal:Q,UE=N0({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:(Q)=>Q.startsWith("$")?Q:`$ark.${Q}`},resolve:{}},normalize:BE,defaults:{description:(Q)=>Q.reference},intersections:{alias:(Q,X,Z)=>Z.$.lazilyResolve(()=>FV($6(Q.resolution,X.resolution,Z)),`${Q.reference}${Z.pipe?"=>":"&"}${X.reference}`),...o9("alias",(Q,X,Z)=>{if(X.isUnknown())return Q;if(X.isNever())return X;return Z.$.lazilyResolve(()=>FV($6(Q.resolution,X,Z)),`${Q.reference}${Z.pipe?"=>":"&"}${X.id}`)})}});class DV extends q9{expression=this.reference;structure=void 0;get resolution(){let Q=this._resolve();return F8[this.id]=Q}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));let Q=this.reference,X=F8[Q],Z=[];while(r1(X,"context")){if(Z.includes(X.id))return I1(VE(X.id,Z));Z.push(X.id),X=F8[X.id]}if(!r1(X,"root"))return a0(`Unexpected resolution for reference ${this.reference}
Seen: [${Z.join("->")}]
Resolution: ${O0(X)}`);return X}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;let Q=this.reference.slice(1),X=this.$.resolutions[Q];if(typeof X==="string")return X;if(r1(X,"root"))return X.id;return a0(`Unexpected resolution for reference ${this.reference}: ${O0(X)}`)}get shortDescription(){return Y9.object}innerToJsonSchema(){return I1(aU(this.expression))}traverseAllows=(Q,X)=>{let Z=X.seen[this.reference];if(Z?.includes(Q))return!0;return X.seen[this.reference]=h0(Z,Q),this.resolution.traverseAllows(Q,X)};traverseApply=(Q,X)=>{let Z=X.seen[this.reference];if(Z?.includes(Q))return;X.seen[this.reference]=h0(Z,Q),this.resolution.traverseApply(Q,X)};compile(Q){let X=this.resolutionId;Q.if(`ctx.seen.${X} && ctx.seen.${X}.includes(data)`,()=>Q.return(!0)),Q.if(`!ctx.seen.${X}`,()=>Q.line(`ctx.seen.${X} = []`)),Q.line(`ctx.seen.${X}.push(data)`),Q.return(Q.invoke(X))}}var VE=(Q,X)=>`Alias '${Q}' has a shallow resolution cycle: ${[...X,Q].join("->")}`,u7={implementation:UE,Node:DV};class l4 extends q9{traverseApply=(Q,X)=>{if(!this.traverseAllows(Q,X))X.error(this.errorContext)};get errorContext(){return{code:this.kind,description:this.description,...this.inner}}get compiledErrorContext(){return uQ(this.errorContext)}compile(Q){if(Q.traversalKind==="Allows")Q.return(this.compiledCondition);else Q.if(this.compiledNegation,()=>Q.line(`${Q.ctx}.error(${this.compiledErrorContext})`))}}var PE=N0({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{}},normalize:(Q)=>typeof Q==="string"?{domain:Q}:Q,defaults:{description:(Q)=>Y9[Q.domain],actual:(Q)=>Y9[P8(Q)]},intersections:{domain:(Q,X)=>p1.init("domain",Q,X)}});class LV extends l4{traverseAllows=(Q)=>P8(Q)===this.domain;compiledCondition=this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"`;compiledNegation=this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"`;expression=this.domain;get shortDescription(){return Y9[this.domain]}innerToJsonSchema(){if(this.domain==="bigint"||this.domain==="symbol")return I1(N6(this.domain));return{type:this.domain}}}var TH={implementation:PE,Node:LV};var FE=N0({kind:"intersection",hasAssociatedError:!0,normalize:(Q)=>{if(F6(Q))return Q;let{structure:X,...Z}=Q,J=!!X,G=X??{},Y=w0(Z,(H,K)=>{if(a6(H,mU)){if(J)I1(`Flattened structure key ${H} cannot be specified alongside a root 'structure' key.`);return G[H]=K,[]}return[H,K]});if(r1(G,"constraint")||!O9(G))Y.structure=G;return Y},finalizeInnerJson:({structure:Q,...X})=>M8(Q,"object")?{...Q,...X}:X,keys:{domain:{child:!0,parse:(Q,X)=>X.$.node("domain",Q)},proto:{child:!0,parse:(Q,X)=>X.$.node("proto",Q)},structure:{child:!0,parse:(Q,X)=>X.$.node("structure",Q),serialize:(Q)=>{if(!Q.sequence?.minLength)return Q.collapsibleJson;let{sequence:X,...Z}=Q.collapsibleJson,{minVariadicLength:J,...G}=X,Y=G.variadic&&Object.keys(G).length===1?G.variadic:G;return{...Z,sequence:Y}}},divisor:{child:!0,parse:J8("divisor")},max:{child:!0,parse:J8("max")},min:{child:!0,parse:J8("min")},maxLength:{child:!0,parse:J8("maxLength")},minLength:{child:!0,parse:J8("minLength")},exactLength:{child:!0,parse:J8("exactLength")},before:{child:!0,parse:J8("before")},after:{child:!0,parse:J8("after")},pattern:{child:!0,parse:J8("pattern")},predicate:{child:!0,parse:J8("predicate")}},reduce:(Q,X)=>fJ({},Q,{$:X,invert:!1,pipe:!1}),defaults:{description:(Q)=>Q.children.length===0?"unknown":Q.structure?.description??Q.children.map((X)=>X.description).join(" and "),expected:(Q)=>` 窶「 ${Q.errors.map((X)=>X.expected).join(`
窶「 `)}`,problem:(Q)=>`(${Q.actual}) must be...
${Q.expected}`},intersections:{intersection:(Q,X,Z)=>fJ(Q,X,Z),...o9("intersection",(Q,X,Z)=>{if(Q.children.length===0)return X;let{domain:J,proto:G,...Y}=Q.inner,H=G??J,K=H?$6(H,X,Z):X;return K instanceof p1?K:Q?.basis?.equals(K)?Q:Q.$.node("intersection",{...Y,[K.kind]:K},{prereduced:!0})})}});class CV extends q9{basis=this.domain??this.proto??null;refinements=this.children.filter((Q)=>Q.isRefinement());get expression(){let Q=this.structure?.expression||`${this.basis?this.basis.nestableExpression+" ":""}${this.refinements.join(" & ")}`||"unknown";if(Q==="Array == 0")Q="[]";return this.cacheGetter("expression",Q)}get shortDescription(){return this.basis?.shortDescription??"present"}innerToJsonSchema(){return this.children.reduce((Q,X)=>X.isBasis()?X.toJsonSchema():X.reduceJsonSchema(Q),{})}traverseAllows=(Q,X)=>this.children.every((Z)=>Z.traverseAllows(Q,X));traverseApply=(Q,X)=>{let Z=X.currentErrorCount;if(this.basis){if(this.basis.traverseApply(Q,X),X.currentErrorCount>Z)return}if(this.refinements.length){for(let J=0;J<this.refinements.length-1;J++)if(this.refinements[J].traverseApply(Q,X),X.failFast&&X.currentErrorCount>Z)return;if(this.refinements.at(-1).traverseApply(Q,X),X.currentErrorCount>Z)return}if(this.structure){if(this.structure.traverseApply(Q,X),X.currentErrorCount>Z)return}if(this.predicate){for(let J=0;J<this.predicate.length-1;J++)if(this.predicate[J].traverseApply(Q,X),X.failFast&&X.currentErrorCount>Z)return;this.predicate.at(-1).traverseApply(Q,X)}};compile(Q){if(Q.traversalKind==="Allows"){this.children.forEach((X)=>Q.check(X)),Q.return(!0);return}if(Q.initializeErrorCount(),this.basis){if(Q.check(this.basis),this.children.length>1)Q.returnIfFail()}if(this.refinements.length){for(let X=0;X<this.refinements.length-1;X++)Q.check(this.refinements[X]),Q.returnIfFailFast();if(Q.check(this.refinements.at(-1)),this.structure||this.predicate)Q.returnIfFail()}if(this.structure){if(Q.check(this.structure),this.predicate)Q.returnIfFail()}if(this.predicate){for(let X=0;X<this.predicate.length-1;X++)Q.check(this.predicate[X]),Q.returnIfFail();Q.check(this.predicate.at(-1))}}}var MH={implementation:FE,Node:CV},fJ=(Q,X,Z)=>{if(r1(Q,"root")&&Q.hasKind("intersection"))return fJ(Q.inner,X,Z);if(r1(X,"root")&&X.hasKind("intersection"))return fJ(Q,X.inner,Z);let J={},G=Q.proto??Q.domain,Y=X.proto??X.domain,H=G?Y?$6(G,Y,Z):G:Y;if(H instanceof p1)return H;if(H)J[H.kind]=H;return cZ({kind:"intersection",baseInner:J,l:iZ(Q),r:iZ(X),roots:[],ctx:Z})};var DE=N0({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(Q,X)=>X.$.parseSchema(Q)},morphs:{parse:gZ,serialize:(Q)=>Q.map((X)=>r1(X,"root")?X.json:g6(X))},declaredIn:{child:!1,serialize:(Q)=>Q.json},declaredOut:{child:!1,serialize:(Q)=>Q.json}},normalize:(Q)=>Q,defaults:{description:(Q)=>`a morph from ${Q.in.description} to ${Q.out?.description??"unknown"}`},intersections:{morph:(Q,X,Z)=>{if(!Q.hasEqualMorphs(X))return I1(LE(Q.expression,X.expression));let J=$6(Q.in,X.in,Z);if(J instanceof p1)return J;let G={morphs:Q.morphs};if(Q.declaredIn||X.declaredIn){let Y=$6(Q.in,X.in,Z);if(Y instanceof p1)return Y.throw();else G.declaredIn=Y}if(Q.declaredOut||X.declaredOut){let Y=$6(Q.out,X.out,Z);if(Y instanceof p1)return Y.throw();else G.declaredOut=Y}return J.distribute((Y)=>Z.$.node("morph",{...G,in:Y}),Z.$.parseSchema)},...o9("morph",(Q,X,Z)=>{let J=Q.inner.in?$6(Q.inner.in,X,Z):X;return J instanceof p1?J:J.equals(Q.inner.in)?Q:Z.$.node("morph",{...Q.inner,in:J})})}});class NV extends q9{serializedMorphs=this.morphs.map(g6);compiledMorphs=`[${this.serializedMorphs}]`;lastMorph=this.inner.morphs.at(-1);lastMorphIfNode=r1(this.lastMorph,"root")?this.lastMorph:void 0;introspectableIn=this.inner.in;introspectableOut=this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.out:void 0;get in(){return this.declaredIn??this.inner.in?.in??E1.intrinsic.unknown.internal}get out(){return this.declaredOut??this.introspectableOut??E1.intrinsic.unknown.internal}declareIn(Q){return this.$.node("morph",{...this.inner,declaredI
Left: ${Q}
Right: ${X}`;var CE=N0({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:(Q)=>S7(Q)??CQ(Q)}},normalize:(Q)=>typeof Q==="string"?{proto:f4[Q]}:typeof Q==="function"?F6(Q)?Q:{proto:Q}:typeof Q.proto==="string"?{...Q,proto:f4[Q.proto]}:Q,defaults:{description:(Q)=>Q.builtinName?PU[Q.builtinName]:`an instance of ${Q.proto.name}`,actual:(Q)=>j7(Q)},intersections:{proto:(Q,X)=>i3(Q.proto,X.proto)?Q:i3(X.proto,Q.proto)?X:p1.init("proto",Q,X),domain:(Q,X)=>X.domain==="object"?Q:p1.init("domain",E1.intrinsic.object.internal,X)}});class TV extends l4{builtinName=S7(this.proto);serializedConstructor=this.json.proto;compiledCondition=`data instanceof ${this.serializedConstructor}`;compiledNegation=`!(${this.compiledCondition})`;innerToJsonSchema(){switch(this.builtinName){case"Array":return{type:"array"};default:return I1(N6(this.description))}}traverseAllows=(Q)=>Q instanceof this.proto;expression=this.proto.name;domain="object";get shortDescription(){return this.description}}var RH={implementation:CE,Node:TV};var NE=N0({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(Q,X)=>{let Z=[];if(Q.forEach((J)=>{(r1(J,"root")?J.branches:X.$.parseSchema(J).branches).forEach((Y)=>{if(Y.hasKind("morph")){let H=Z.findIndex((K)=>K.hasKind("morph")&&K.hasEqualMorphs(Y));if(H===-1)Z.push(Y);else{let K=Z[H];Z[H]=X.$.node("morph",{...K.inner,in:K.in.rawOr(Y.in)})}}else Z.push(Y)})}),!X.def.ordered)Z.sort((J,G)=>J.hash<G.hash?-1:1);return Z}}},normalize:(Q)=>G6(Q)?{branches:Q}:Q,reduce:(Q,X)=>{let Z=OE(Q);if(Z.length===1)return Z[0];if(Z.length===Q.branches.length)return;return X.node("union",{...Q,branches:Z},{prereduced:!0})},defaults:{description:(Q)=>Q.distribute((X)=>X.description,sZ),expected:(Q)=>{let X=NJ(Q.errors,"propString"),Z=Object.entries(X).map(([J,G])=>{let Y=[];G.forEach((z)=>FQ(Y,z.expected));let H=sZ(Y),K=G.every((z)=>z.actual===G[0].actual)?G[0].actual:O0(G[0].data);return`${J&&`${J} `}must be ${H}${K&&` (was ${K})`}`});return sZ(Z)},problem:(Q)=>Q.expected,message:(Q)=>Q.problem},intersections:{union:(Q,X,Z)=>{if(Q.isNever!==X.isNever)return p1.init("presence",Q,X);let J;if(Q.ordered){if(X.ordered)I1(SE(Q.expression,X.expression));if(J=AH(X.branches,Q.branches,Z),J instanceof p1)J.invert()}else J=AH(Q.branches,X.branches,Z);if(J instanceof p1)return J;return Z.$.parseSchema(Q.ordered||X.ordered?{branches:J,ordered:!0}:{branches:J})},...o9("union",(Q,X,Z)=>{let J=AH(Q.branches,[X],Z);if(J instanceof p1)return J;if(J.length===1)return J[0];return Z.$.parseSchema(Q.ordered?{branches:J,ordered:!0}:{branches:J})})}});class MV extends q9{isBoolean=this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0);get branchGroups(){let Q=[],X=-1;return this.branches.forEach((Z)=>{if(Z.hasKind("unit")&&Z.domain==="boolean"){if(X===-1)X=Q.length,Q.push(Z);else Q[X]=E1.intrinsic.boolean;return}Q.push(Z)}),Q}unitBranches=this.branches.filter((Q)=>Q.in.hasKind("unit"));discriminant=this.discriminate();discriminantJson=this.discriminant?IE(this.discriminant):null;expression=this.distribute((Q)=>Q.nestableExpression,AE);get shortDescription(){return this.distribute((Q)=>Q.shortDescription,sZ)}innerToJsonSchema(){return{anyOf:this.branchGroups.map((Q)=>Q.equals(E1.intrinsic.boolean)?{type:"boolean"}:Q.toJsonSchema())}}traverseAllows=(Q,X)=>this.branches.some((Z)=>Z.traverseAllows(Q,X));traverseApply=(Q,X)=>{let Z=[];for(let J=0;J<this.branches.length;J++){if(X.pushBranch(),this.branches[J].traverseApply(Q,X),!X.hasError()){if(this.branches[J].includesMorph)return X.queuedMorphs.push(...X.popBranch().queuedMorphs);return X.popBranch()}Z.push(X.popBranch().error)}X.error({code:"union",errors:Z})};compile(Q){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(Q);let X=this.discriminant.optionallyChainedPropString;if(this.discriminant.kind==="domain")X=`typeof ${X} === "object" ? ${X} === null ? "null" : "object" : typeof ${X} === "function" ? "object" : typeof ${X
expected: ${H},
actual: ${K},
relativePath: [${Y}]
})`)}compileIndiscriminable(Q){if(Q.traversalKind==="Apply")Q.const("errors","[]"),this.branches.forEach((X)=>Q.line("ctx.pushBranch()").line(Q.invoke(X)).if("!ctx.hasError()",()=>Q.return(X.includesMorph?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)")),Q.line('ctx.error({ code: "union", errors })');else this.branches.forEach((X)=>Q.if(`${Q.invoke(X)}`,()=>Q.return(!0))),Q.return(!1)}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){if(this.branches.length<2)return null;if(this.unitBranches.length===this.branches.length){let Y=w0(this.unitBranches,(H,K)=>[`${K.in.serializedValue}`,K.hasKind("morph")?K:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:Y}}let Q=[];for(let Y=0;Y<this.branches.length-1;Y++){let H=this.branches[Y];for(let K=Y+1;K<this.branches.length;K++){let z=this.branches[K],W=i8(H.in,z.in,H.$);if(!(W instanceof p1))continue;for(let $ of W){if(!$.kind||$.optional)continue;let q,B;if($.kind==="domain"){let{l:F,r:P}=$;q=`"${typeof F==="string"?F:F.domain}"`,B=`"${typeof P==="string"?P:P.domain}"`}else if($.kind==="unit")q=$.l.serializedValue,B=$.r.serializedValue;else continue;let D=Q.find((F)=>hZ(F.path,$.path)&&F.kind===$.kind);if(!D)Q.push({kind:$.kind,cases:{[q]:[H],[B]:[z]},path:$.path});else D.cases[q]=FQ(D.cases[q],H),D.cases[B]=FQ(D.cases[B],z)}}}let X=Q.sort((Y,H)=>Object.keys(Y.cases).length-Object.keys(H.cases).length).at(-1);if(!X)return null;let Z=[...this.branches],J={kind:X.kind,path:X.path,optionallyChainedPropString:IV(X.path)},G=w0(X.cases,(Y,H)=>{let K=[];Z=Z.filter((W)=>!H.includes(W));for(let W of H){let $=EE(W,J);if($===null)return[Y,!0];K.push($)}let z=K.length===1?K[0]:this.$.node("union",K);return Object.assign(this.referencesById,z.referencesById),[Y,z]});if(Z.length)G.default=this.$.node("union",Z,{prereduced:!0}),Object.assign(this.referencesById,G.default.referencesById);return Object.assign(J,{cases:G})}}var IV=(Q)=>Q.reduce((X,Z)=>X+QH(Z,!0),"data"),TE=g6($U),ME=g6(O0),OH={implementation:NE,Node:MV},IE=(Q)=>({kind:Q.kind,path:Q.path.map((X)=>typeof X==="string"?X:LQ(X)),cases:w0(Q.cases,(X,Z)=>[X,Z===!0?Z:Z.hasKind("union")&&Z.discriminantJson?Z.discriminantJson:Z.json])}),RE={delimiter:" | ",finalDelimiter:" | "},AE=(Q)=>sZ(Q,RE),sZ=(Q,X)=>{let Z=X?.delimiter??", ",J=X?.finalDelimiter??" or ";if(Q.length===0)return"never";if(Q.length===1)return Q[0];if(Q.length===2&&Q[0]==="false"&&Q[1]==="true"||Q[0]==="true"&&Q[1]==="false")return"boolean";let G={},Y=Q.filter((K)=>G[K]?!1:G[K]=!0),H=Y.pop();return`${Y.join(Z)}${Y.length?J:""}${H}`},AH=(Q,X,Z)=>{let J=X.map(()=>[]);for(let Y=0;Y<Q.length;Y++){let H={};for(let K=0;K<X.length;K++){if(J[K]===null)continue;if(Q[Y].equals(X[K])){J[K]=null,H={};break}let z=$6(Q[Y],X[K],Z);if(z instanceof p1)continue;if(z.equals(Q[Y])){J[K].push(Q[Y]),H={};break}if(z.equals(X[K]))J[K]=null;else H[K]=z}for(let K in H)J[K][Y]=H[K]}let G=J.flatMap((Y,H)=>Y?.flatMap((K)=>K.branches)??X[H]);return G.length===0?p1.init("union",Q,X):G},OE=({branches:Q,ordered:X})=>{if(Q.length<2)return Q;let Z=Q.map(()=>!0);for(let J=0;J<Q.length;J++)for(let G=J+1;G<Q.length&&Z[J]&&Z[G];G++){if(Q[J].equals(Q[G])){Z[G]=!1;continue}let Y=i8(Q[J].in,Q[G].in,Q[0].$);if(Y instanceof p1)continue;if(!X)wE(Q[J],Q[G]);if(Y.equals(Q[J].in))Z[J]=!!X;else if(Y.equals(Q[G].in))Z[G]=!1}return Q.filter((J,G)=>Z[G])},wE=(Q,X)=>{if((Q.includesMorph||X.includesMorph)&&(!hZ(Q.shallowMorphs,X.shallowMorphs,{isEqual:(Z,J)=>Z.hasEqualMorphs(J)})||!hZ(Q.flatMorphs,X.flatMorphs,{isEqual:(Z,J)=>Z.propString===J.propString&&Z.node.hasEqualMorphs(J.node)})))I1(jE(Q.expression,X.expression))},EE=(Q,X)=>Q.transform((Z,J)=>{if(Z==="domain"||Z==="unit")return null;return J},{shouldTransform:(Z,J)=>{let G=IV(J.path);if(!X.optionallyChainedPropString.startsWith(G))return!1;if(Z.hasKind("domain")&&Z.domain==="object")return!0;if((Z.hasKind("domain")||X.kind==="unit")&&G===X.optionallyChainedPropString)return!0;return Z.children.length!==0&&Z.kind!=="index"}}),jE=(Q,X)
Left: ${Q}
Right: ${X}`,SE=(Q,X)=>`The intersection of two ordered unions is indeterminate:
Left: ${Q}
Right: ${X}`;var kE=N0({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:(Q)=>Q instanceof Date?Q.toISOString():CQ(Q)}},normalize:(Q)=>Q,defaults:{description:(Q)=>O0(Q.unit),problem:({expected:Q,actual:X})=>`${Q===X?`must be reference equal to ${Q} (serialized to the same value)`:`must be ${Q} (was ${X})`}`},intersections:{unit:(Q,X)=>p1.init("unit",Q,X),...o9("unit",(Q,X)=>{if(X.allows(Q.unit))return Q;let Z=X.hasKind("intersection")?X.basis:X;if(Z){let J=Z.hasKind("domain")?Z:E1.intrinsic.object;if(Q.domain!==J.domain){let G=Q.domain==="undefined"||Q.domain==="null"||Q.domain==="boolean"?Q.domain:E1.intrinsic[Q.domain];return p1.init("domain",G,J)}}return p1.init("assignability",Q,X.hasKind("intersection")?X.children.find((J)=>!J.allows(Q.unit)):X)})}});class AV extends l4{compiledValue=this.json.unit;serializedValue=typeof this.unit==="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`;compiledCondition=RV(this.unit,this.serializedValue);compiledNegation=RV(this.unit,this.serializedValue,"negated");expression=O0(this.unit);domain=P8(this.unit);get shortDescription(){return this.domain==="object"?Y9.object:this.description}innerToJsonSchema(){return E1.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:I1(N6(this.shortDescription))}traverseAllows=this.unit instanceof Date?(Q)=>Q instanceof Date&&Q.toISOString()===this.compiledValue:Number.isNaN(this.unit)?(Q)=>Number.isNaN(Q):(Q)=>Q===this.unit}var wH={implementation:kE,Node:AV},RV=(Q,X,Z)=>{if(Q instanceof Date){let J=`data instanceof Date && data.toISOString() === ${X}`;return Z?`!(${J})`:J}if(Number.isNaN(Q))return`${Z?"!":""}Number.isNaN(data)`;return`data ${Z?"!":"="}== ${X}`};var yE=N0({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(Q,X)=>{let Z=X.$.parseSchema(Q);if(!Z.extends(E1.intrinsic.key))return I1(vE(Z.expression));let J=Z.branches.filter((G)=>G.hasKind("unit"));if(J.length)return I1(xE(J.map((G)=>O0(G.unit))));return Z}},value:{child:!0,parse:(Q,X)=>X.$.parseSchema(Q)}},normalize:(Q)=>Q,defaults:{description:(Q)=>`[${Q.signature.expression}]: ${Q.value.description}`},intersections:{index:(Q,X,Z)=>{if(Q.signature.equals(X.signature)){let J=$6(Q.value,X.value,Z),G=J instanceof p1?E1.intrinsic.never.internal:J;return Z.$.node("index",{signature:Q.signature,value:G})}if(Q.signature.extends(X.signature)&&Q.value.subsumes(X.value))return X;if(X.signature.extends(Q.signature)&&X.value.subsumes(Q.value))return Q;return null}}});class OV extends W9{impliedBasis=E1.intrinsic.object.internal;expression=`[${this.signature.expression}]: ${this.value.expression}`;traverseAllows=(Q,X)=>w7(Q).every((Z)=>{if(this.signature.traverseAllows(Z[0],X))return A8(Z[0],()=>this.value.traverseAllows(Z[1],X),X);return!0});traverseApply=(Q,X)=>w7(Q).forEach((Z)=>{if(this.signature.traverseAllows(Z[0],X))A8(Z[0],()=>this.value.traverseApply(Z[1],X),X)});_transform(Q,X){X.path.push(this.signature);let Z=super._transform(Q,X);return X.path.pop(),Z}get flatRefs(){return h0(this.value.flatRefs.map((Q)=>w9([this.signature,...Q.path],Q.node)),w9([this.signature],this.value))}compile(){}}var EH={implementation:yE,Node:OV},xE=(Q)=>`Index keys ${Q.join(", ")} should be specified as named props.`,vE=(Q)=>`Indexed key definition '${Q}' must be a string or symbol`;var gE=N0({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(Q,X)=>X.$.parseSchema(Q)}},normalize:(Q)=>Q,defaults:{description:(Q)=>`${Q.compiledKey}: ${Q.value.description}`,expected:(Q)=>Q.missingValueDescription,actual:()=>"missing"},intersections:{required:f7,optional:f7}});class wV extends b7{expression=`${this.compiledKey}: ${this.value.expression}`;errorContext=Object.freeze({code:"required",missingValueDescription:this.value.shortDescription,relativePath:[this.key]});compiledErrorContext=uQ(this.errorContext)}var jH={implementation:gE,Node:wV};var hE=N0({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(Q,X)=>{if(Q.l
${H},
`},`{
`)+"}";l7.export();var{schema:s0,node:tZ,defineSchema:e41,generic:H9}=l7;var pV=_J({bigint:"bigint",boolean:[{unit:!1},{unit:!0}],false:{unit:!1},never:[],null:{unit:null},number:"number",object:"object",string:"string",symbol:"symbol",true:{unit:!0},unknown:{},undefined:{unit:void 0},Array,Date},{prereducedAliases:!0}).export();E1.intrinsic={...pV};var lV=_J({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:yH}},{prereducedAliases:!0}).export();Object.assign(E1.intrinsic,lV);var tE=_J({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonArray:{proto:Array,sequence:"$jsonData"},jsonData:["$jsonPrimitive","$jsonObject","$jsonArray"],json:["$jsonObject","$jsonArray"]},{prereducedAliases:!0}).export(),P0={...pV,...lV,...tE,emptyStructure:tZ("structure",{},{prereduced:!0})};E1.intrinsic={...P0};var iV=(Q)=>typeof Q==="string"&&Q[0]==="d"&&(Q[1]==="'"||Q[1]==='"')&&Q.at(-1)===Q[1],cV=(Q)=>Q.toString()!=="Invalid Date",nV=(Q)=>Q.slice(2,-1),bH=(Q)=>`'${Q}' could not be parsed by the Date constructor`,oV=(Q,X)=>rE(Q,X),rE=(Q,X)=>{let Z=new Date(Q);if(cV(Z))return Z;let J=jU(Q);if(J!==void 0){let G=new Date(J);if(cV(G))return G}return X?I1(X===!0?bH(Q):X):void 0};var mH=(Q,X)=>{let Z=Q.scanner.shiftUntil(eE[sV[X]]);if(Q.scanner.lookahead==="")return Q.error(Z2(Z,X));if(Q.scanner.shift(),X==="/"){try{new RegExp(Z)}catch(J){I1(String(J))}Q.root=Q.ctx.$.node("intersection",{domain:"string",pattern:Z},{prereduced:!0})}else if(a6(X,_H))Q.root=Q.ctx.$.node("unit",{unit:Z});else{let J=oV(Z,bH(Z));Q.root=Q.ctx.$.node("unit",{meta:Z,unit:J})}},_H={"'":1,'"':1},aV={"/":1,"'":1,'"':1},sV={"d'":"'",'d"':'"',"'":"'",'"':'"',"/":"/"},eE={"'":(Q)=>Q.lookahead==="'",'"':(Q)=>Q.lookahead==='"',"/":(Q)=>Q.lookahead==="/"},Q2={'"':"double-quote","'":"single-quote","/":"forward slash"},Z2=(Q,X)=>`${X}${Q} requires a closing ${Q2[sV[X]]}`;var tV=(Q)=>`Private type references should not include '#'. Use '${Q}' instead.`,dJ="Optional definitions like 'string?' are only valid as properties in an object or tuple",uJ="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple";var rV={">":!0,">=":!0},eV={"<":!0,"<=":!0};var rZ={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},QP=(Q)=>`Unmatched )${Q===""?"":` before ${Q}`}`,pJ=(Q)=>`Missing ${Q}`,ZP=(Q,X)=>`Left bounds are only valid when paired with right bounds (try ...${X}${Q})`,lJ=(Q)=>`Left-bounded expressions must specify their limits using < or <= (was ${Q})`,XP=(Q,X,Z,J)=>`An expression may have at most one left bound (parsed ${Q}${rZ[X]}, ${Z}${rZ[J]})`;var JP=(Q,X,Z)=>GP(Q,X,Z,[]),GP=(Q,X,Z,J)=>{let G=Z.parseUntilFinalizer();if(J.push(G.root),G.finalizer===">"){if(J.length!==X.params.length)return Z.error(dH(Q,X.names,J.map((Y)=>Y.expression)));return J}if(G.finalizer===",")return GP(Q,X,Z,J);return G.error(pJ(">"))},dH=(Q,X,Z)=>`${Q}<${X.join(", ")}> requires exactly ${X.length} args (got ${Z.length}${Z.length===0?"":`: ${Z.join(", ")}`})`;var uH=(Q)=>{let X=Q.scanner.shiftUntilNextTerminator();if(X==="keyof")Q.addPrefix("keyof");else Q.root=J2(Q,X)},X2=(Q,X,Z)=>{if(Z.scanner.shiftUntilNonWhitespace(),Z.scanner.shift()!=="<")return Z.error(dH(Q,X.names,[]));let G=JP(Q,X,Z);return X(...G)},J2=(Q,X)=>G2(Q,X)??Y2(Q,X)??Q.error(X===""?Q.scanner.lookahead==="#"?tV(Q.shiftedByOne().scanner.shiftUntilNextTerminator()):pH(Q):fH(X)),G2=(Q,X)=>{if(Q.ctx.args?.[X]){let J=Q.ctx.args[X];if(typeof J!=="string")return J;return Q.ctx.$.node("alias",{reference:J},{prereduced:!0})}let Z=Q.ctx.$.maybeResolve(X);if(r1(Z,"root"))return Z;if(Z===void 0)return;if(r1(Z,"generic"))return X2(X,Z,Q);return I1(`Unexpected resolution ${O0(Z)}`)},Y2=(Q,X)=>{let Z=SU(X);if(Z!==void 0)return Q.ctx.$.node("unit",{unit:Z});let J=yU(X);if(J!==void 0)return Q.ctx.$.node("unit",{unit:J})},pH=(Q)=>{let X=Q.previousOperator();return X?lH(X,Q.scanner.unscanned):W2(Q.scanner.unscanned)},lH=(Q,X="")=>`Token '${Q}' requi
${JSON.stringify(Z,null,2)}`:"";return`${J} [${Q.padEnd(5)}] ${JSON.stringify(X)}${G}
`},ci=c1({appName:"string",filename:"string",level:pi}),Kq=ci.pipe((Q)=>{let X=SN(Q.appName,Q.filename),Z=CK.slice(CK.indexOf(Q.level));return{...Q,levels:Z,filename:X}});function kN(Q){let X=Kq.assert(Q),Z={},J=[],G=(q,B,D)=>{if(!X.levels.includes(q))return;ui(b5.dirname(SN(X.appName,X.filename))),J.push(jN.appendFile(X.filename,li(q,B,{...Z,...D??{}})))},$={debug:(q,B)=>G("DEBUG",q,B),info:(q,B)=>G("INFO",q,B),warn:(q,B)=>G("WARN",q,B),error:(q,B)=>G("ERROR",q,B),fatal:(q,B)=>G("FATAL",q,B),flush(){return Promise.all(J)},get config(){return{...X}},set config(q){X=Kq.assert({...X,...q}),$.debug("Updated logger configuration",{config:X})},set meta(q){Z=q}};return $}var Bq={};LJ(Bq,{MIME_TYPE_OLRAPI_NOTE_JSON:()=>qn,ApiVaultFileResponse:()=>Zn,ApiVaultDirectoryResponse:()=>Qn,ApiTemplateExecutionResponse:()=>Wn,ApiTemplateExecutionParams:()=>Yn,ApiStatusResponse:()=>oi,ApiSmartSearchResult:()=>vN,ApiSmartSearchResponse:()=>ti,ApiSimpleSearchResponse:()=>si,ApiSimpleSearchMatch:()=>xN,ApiSearchResponse:()=>ai,ApiSearchParameters:()=>ri,ApiPatchParameters:()=>Xn,ApiNoteJson:()=>ni,ApiNoContentResponse:()=>Gn,ApiError:()=>ii,ApiContentResponse:()=>Jn,ApiCommandsResponse:()=>ei,ApiCommand:()=>gN});var ii=c1({errorCode:"number",message:"string"}),ni=c1({content:"string",frontmatter:"Record<string, string>",path:"string",stat:{ctime:"number",mtime:"number",size:"number"},tags:"string[]"}),yN=c1({id:"string",name:"string",version:"string",minAppVersion:"string",description:"string",author:"string",authorUrl:"string",isDesktopOnly:"boolean",dir:"string"}),oi=c1({status:"string",manifest:yN,versions:{obsidian:"string",self:"string"},service:"string",authenticated:"boolean",certificateInfo:{validityDays:"number",regenerateRecommended:"boolean"},apiExtensions:yN.array()}),ai=c1({filename:"string",result:"string|number|string[]|object|boolean"}).array(),xN=c1({match:{start:"number",end:"number"},context:"string"}),si=c1({filename:"string",matches:xN.array(),score:"number"}).array(),vN=c1({path:"string",text:"string",score:"number",breadcrumbs:"string"}),ti=c1({results:vN.array()}),ri=c1({query:"string",filter:{folders:"string[]?",excludeFolders:"string[]?",limit:"number?"}}),gN=c1({id:"string",name:"string"}),ei=c1({commands:gN.array()}),Qn=c1({files:"string[]"}),Zn=c1({frontmatter:{tags:"string[]",description:"string?"},content:"string",path:"string",stat:{ctime:"number",mtime:"number",size:"number"},tags:"string[]"}),Xn=c1({operation:c1("'append' | 'prepend' | 'replace'").describe("Specifies how to modify the content: append (add after), prepend (add before), or replace existing content"),targetType:c1("'heading' | 'block' | 'frontmatter'").describe("Identifies what to modify: a section under a heading, a referenced block, or a frontmatter field"),target:c1("string").describe("The identifier - either heading path (e.g. 'Heading 1::Subheading 1:1'), block reference ID, or frontmatter field name"),"targetDelimiter?":c1("string").describe("The separator used in heading paths to indicate nesting (default '::')"),"trimTargetWhitespace?":c1("boolean").describe("Whether to remove whitespace from target identifier before matching (default: false)"),content:c1("string").describe("The actual content to insert, append, or use as replacement"),"contentType?":c1("'text/markdown' | 'application/json'").describe("Format of the content - use application/json for structured data like table rows or frontmatter values")}),Jn=c1("string").describe("Content"),Gn=c1("unknown").describe("No Content"),Yn=c1({name:c1("string").describe("The full vault path to the template file"),arguments:"Record<string, string>","createFile?":c1("boolean").describe("Whether to create a new file from the template"),"targetPath?":c1("string").describe("Path to save the file; required if createFile is true")}),Wn=c1({message:"string",content:"string"}),qn="application/vnd.olrapi.note+json";var Uq={};LJ(Uq,{SmartSearchFilter:()=>Hn});var Hn=c1({"exclude_key?":c1("string").describe("A single key to exclude."),"exclude_keys?":c1("string[]").describe("An array of keys to exclud
${Q} called \`${X}\` on an instance of ${Z}, which is no longer valid in Svelte 5
https://svelte.dev/e/component_api_changed`);throw J.name="Svelte error",J}else throw new Error("https://svelte.dev/e/component_api_changed")}function iN(Q,X){if(b1){let Z=new Error(`component_api_invalid_new
Attempted to instantiate ${Q} with \`new ${X}\`, which is no longer valid in Svelte 5. If this component is not under your control, set the \`compatibility.componentApi\` compiler option to \`4\` to keep it working.
https://svelte.dev/e/component_api_invalid_new`);throw Z.name="Svelte error",Z}else throw new Error("https://svelte.dev/e/component_api_invalid_new")}function nN(){if(b1){let Q=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw Q.name="Svelte error",Q}else throw new Error("https://svelte.dev/e/derived_references_self")}function oN(Q,X,Z){if(b1){let J=new Error(`each_key_duplicate
${Z?`Keyed each block has duplicate key \`${Z}\` at indexes ${Q} and ${X}`:`Keyed each block has duplicate key at indexes ${Q} and ${X}`}
https://svelte.dev/e/each_key_duplicate`);throw J.name="Svelte error",J}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function aN(Q){if(b1){let X=new Error(`effect_in_teardown
\`${Q}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throw X.name="Svelte error",X}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function sN(){if(b1){let Q=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw Q.name="Svelte error",Q}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function tN(Q){if(b1){let X=new Error(`effect_orphan
\`${Q}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/effect_orphan`);throw X.name="Svelte error",X}else throw new Error("https://svelte.dev/e/effect_orphan")}function rN(){if(b1){let Q=new Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
https://svelte.dev/e/effect_update_depth_exceeded`);throw Q.name="Svelte error",Q}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function eN(){if(b1){let Q=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw Q.name="Svelte error",Q}else throw new Error("https://svelte.dev/e/hydration_failed")}function QT(Q){if(b1){let X=new Error(`props_invalid_value
Cannot do \`bind:${Q}={undefined}\` when \`${Q}\` has a fallback value
https://svelte.dev/e/props_invalid_value`);throw X.name="Svelte error",X}else throw new Error("https://svelte.dev/e/props_invalid_value")}function ZT(Q){if(b1){let X=new Error(`rune_outside_svelte
The \`${Q}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throw X.name="Svelte error",X}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function XT(){if(b1){let Q=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw Q.name="Svelte error",Q}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function JT(){if(b1){let Q=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw Q.name="Svelte error",Q}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function GT(){if(b1){let Q=new Error("state_unsafe_local_read\nReading state that was created inside the same derived is forbidden. Consider using `untrack` to read locally created state\nhttps://svelte.dev/e/state_unsafe_local_read");throw Q.name="Svelte error",Q}else throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function YT(){if(b1){let Q=new Error("state_unsafe_mutation\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw Q.name="Svelte error",Q}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}var ZQ=!1,XQ=!1;function WT(){ZQ=!0}var Mq=1,Iq=2,AK=4,qT=8,HT=16,zT=1,KT=2,$T=4,BT=8,UT=16;var VT=1,PT=2,zZ="[",F4="[!",D4="]",L4={};var f6=Symbol(),f0=Symbol("filename"),FT=Symbol("hmr");var BX=null;function EQ(Q){let X=Error(),Z=X.stack;if(Z){let J=Z.split(`
`),G=[`
`];for(let Y=0;Y<J.length;Y++){let H=J[Y];if(H==="Error")continue;if(H.includes("validate_each_keys"))return null;if(H.includes("svelte/src/internal"))continue;G.push(H)}if(G.length===1)return null;_6(X,"stack",{value:G.join(`
`)}),_6(X,"name",{value:`${Q}Error`})}return X}var KZ=new Set;function wK(Q){KZ=Q}function d6(Q,X){var Z={f:0,v:Q,reactions:null,equals:Nq,rv:0,wv:0};if(b1&&XQ)Z.created=X??EQ("CreatedAt"),Z.debug=null;return Z}function GQ(Q,X=!1){let Z=d6(Q);if(!X)Z.equals=m5;if(ZQ&&j0!==null&&j0.l!==null)(j0.l.s??=[]).push(Z);return Z}function EK(Q,X=!1){return Vn(GQ(Q,X))}function Vn(Q){if(E0!==null&&(E0.f&l6)!==0)if(h9===null)CT([Q]);else h9.push(Q);return Q}function Y6(Q,X){if(E0!==null&&C4()&&(E0.f&(l6|WZ))!==0&&(h9===null||!h9.includes(Q)))YT();return d5(Q,X)}function d5(Q,X){if(!Q.equals(X)){var Z=Q.v;if(Q.v=X,Q.wv=VX(),b1&&XQ){if(Q.updated=EQ("UpdatedAt"),$0!=null)Q.trace_need_increase=!0,Q.trace_v??=Z}if(LT(Q,D8),C4()&&$0!==null&&($0.f&x6)!==0&&($0.f&(j8|x9))===0)if(JQ===null)NT([Q]);else JQ.push(Q);if(b1&&KZ.size>0){let G=Array.from(KZ);var J=jQ;_5(!0);try{for(let Y of G){if((Y.f&x6)!==0)G8(Y,a8);if(N4(Y))u5(Y)}}finally{_5(J)}KZ.clear()}}return X}function LT(Q,X){var Z=Q.reactions;if(Z===null)return;var J=C4(),G=Z.length;for(var Y=0;Y<G;Y++){var H=Z[Y],K=H.f;if((K&D8)!==0)continue;if(!J&&H===$0)continue;if(b1&&(K&Dq)!==0){KZ.add(H);continue}if(G8(H,X),(K&(x6|v9))!==0)if((K&l6)!==0)LT(H,a8);else p5(H)}}var PX="font-weight: bold",FX="font-weight: normal";function TT(Q,X,Z){if(b1)console.warn(`%c[svelte] hydration_attribute_changed
%cThe \`${Q}\` attribute on \`${X}\` changed its value between server and client renders. The client value, \`${Z}\`, will be ignored in favour of the server value
https://svelte.dev/e/hydration_attribute_changed`,PX,FX);else console.warn("https://svelte.dev/e/hydration_attribute_changed")}function l5(Q){if(b1)console.warn(`%c[svelte] hydration_mismatch
%c${Q?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${Q}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/hydration_mismatch`,PX,FX);else console.warn("https://svelte.dev/e/hydration_mismatch")}function MT(){if(b1)console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,PX,FX);else console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function jK(Q,X){if(b1)console.warn(`%c[svelte] ownership_invalid_mutation
%c${Q?`${Q} mutated a value owned by ${X}. This is strongly discouraged. Consider passing values to child components with \`bind:\`, or use a callback instead`:"Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead"}
https://svelte.dev/e/ownership_invalid_mutation`,PX,FX);else console.warn("https://svelte.dev/e/ownership_invalid_mutation")}function DX(Q){if(b1)console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${Q}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,PX,FX);else console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}var H0=!1;function k8(Q){H0=Q}var F0;function O6(Q){if(Q===null)throw l5(),L4;return F0=Q}function Y8(){return O6(W8(F0))}function y8(Q){if(!H0)return;if(W8(F0)!==null)throw l5(),L4;F0=Q}function Rq(Q=1){if(H0){var X=Q,Z=F0;while(X--)Z=W8(Z);F0=Z}}function c5(){var Q=0,X=F0;while(!0){if(X.nodeType===8){var Z=X.data;if(Z===D4){if(Q===0)return X;Q-=1}else if(Z===zZ||Z===F4)Q+=1}var J=W8(X);X.remove(),X=J}}var SK={},Pn=/at (?:.+ \()?(.+):(\d+):(\d+)\)?$/,Fn=/@(.+):(\d+):(\d+)$/;function kK(){let Q=new Error().stack;if(!Q)return null;let X=[];for(let Z of Q.split(`
`)){let J=Pn.exec(Z)??Fn.exec(Z);if(J)X.push({file:J[1],line:+J[2],column:+J[3]})}return X}function yK(){let Q=kK()?.slice(4);if(!Q)return null;for(let X=0;X<Q.length;X++){let Z=Q[X],J=SK[Z.file];if(!J){if(X===0)return null;continue}for(let G of J){if(G.end==null)return null;if(G.start.line<Z.line&&G.end.line>Z.line)return G.component}}return null}var Dn=Symbol("ADD_OWNER");function LX(){let Q=kK()?.[2];if(Q)(SK[Q.file]??=[]).push({start:Q,end:null,component:null})}function CX(Q){let X=kK()?.[2];if(X){let Z=SK[X.file],J=Z[Z.length-1];J.end=X,J.component=Q}}function xK(Q,X){if(X.owners===null)return;while(Q){if(Q.owners===null){X.owners=null;break}for(let Z of Q.owners)X.owners.add(Z);Q=Q.parent}}function IT(Q,X){if(Q.owners===null)return!0;return Q.owners.has(X)||Q.parent!==null&&IT(Q.parent,X)}function RT(Q){return Q?.owners?.values().next().value??RT(Q.parent)}var Ln=!1;function AT(Q){if(Ln)return;let X=yK();if(X&&!IT(Q,X)){let Z=RT(Q);if(Z[f0]!==X[f0])jK(X[f0],Z[f0]);else jK()}}function T4(Q,X=null,Z){var J=null;if(b1&&XQ)J=EQ("CreatedAt");if(typeof Q!=="object"||Q===null||S8 in Q)return Q;let G=P4(Q);if(G!==TK&&G!==uN)return Q;var Y=new Map,H=K9(Q),K=d6(0);if(H)Y.set("length",d6(Q.length,J));var z;if(b1)if(z={parent:X,owners:null},Z){let W=Z.v?.[HZ]?.owners;z.owners=W?new Set(W):null}else z.owners=X===null?j0!==null?new Set([j0.function]):null:new Set;return new Proxy(Q,{defineProperty(W,$,q){if(!("value"in q)||q.configurable===!1||q.enumerable===!1||q.writable===!1)XT();var B=Y.get($);if(B===void 0)B=d6(q.value,J),Y.set($,B);else Y6(B,T4(q.value,z));return!0},deleteProperty(W,$){var q=Y.get($);if(q===void 0){if($ in W)Y.set($,d6(f6,J))}else{if(H&&typeof $==="string"){var B=Y.get("length"),D=Number($);if(Number.isInteger(D)&&D<B.v)Y6(B,D)}Y6(q,f6),OT(K)}return!0},get(W,$,q){if(b1&&$===HZ)return z;if($===S8)return Q;var B=Y.get($),D=$ in W;if(B===void 0&&(!D||k9(W,$)?.writable))B=d6(T4(D?W[$]:f6,z),J),Y.set($,B);if(B!==void 0){var F=G0(B);if(b1){var P=F?.[HZ];if(P&&P?.parent!==z)xK(z,P)}return F===f6?void 0:F}return Reflect.get(W,$,q)},getOwnPropertyDescriptor(W,$){var q=Reflect.getOwnPropertyDescriptor(W,$);if(q&&"value"in q){var B=Y.get($);if(B)q.value=G0(B)}else if(q===void 0){var D=Y.get($),F=D?.v;if(D!==void 0&&F!==f6)return{enumerable:!0,configurable:!0,value:F,writable:!0}}return q},has(W,$){if(b1&&$===HZ)return!0;if($===S8)return!0;var q=Y.get($),B=q!==void 0&&q.v!==f6||Reflect.has(W,$);if(q!==void 0||$0!==null&&(!B||k9(W,$)?.writable)){if(q===void 0)q=d6(B?T4(W[$],z):f6,J),Y.set($,q);var D=G0(q);if(D===f6)return!1}return B},set(W,$,q,B){var D=Y.get($),F=$ in W;if(H&&$==="length")for(var P=q;P<D.v;P+=1){var N=Y.get(P+"");if(N!==void 0)Y6(N,f6);else if(P in W)N=d6(f6,J),Y.set(P+"",N)}if(D===void 0){if(!F||k9(W,$)?.writable)D=d6(void 0,J),Y6(D,T4(q,z)),Y.set($,D)}else F=D.v!==f6,Y6(D,T4(q,z));if(b1){var C=q?.[HZ];if(C&&C?.parent!==z)xK(z,C);AT(z)}var L=Reflect.getOwnPropertyDescriptor(W,$);if(L?.set)L.set.call(B,q);if(!F){if(H&&typeof $==="string"){var V=Y.get("length"),M=Number($);if(Number.isInteger(M)&&M>=V.v)Y6(V,M+1)}OT(K)}return!0},ownKeys(W){G0(K);var $=Reflect.ownKeys(W).filter((D)=>{var F=Y.get(D);return F===void 0||F.v!==f6});for(var[q,B]of Y)if(B.v!==f6&&!(q in W))$.push(q);return $},setPrototypeOf(){JT()}})}function OT(Q,X=1){Y6(Q,Q.v+X)}function n5(Q){if(Q!==null&&typeof Q==="object"&&S8 in Q)return Q[S8];return Q}function wT(){let{prototype:Q,__svelte_cleanup:X}=Array;if(X)X();let{indexOf:Z,lastIndexOf:J,includes:G}=Q;Q.indexOf=function(Y,H){let K=Z.call(this,Y,H);if(K===-1){for(let z=H??0;z<this.length;z+=1)if(n5(this[z])===Y){DX("array.indexOf(...)");break}}return K},Q.lastIndexOf=function(Y,H){let K=J.call(this,Y,H??this.length-1);if(K===-1){for(let z=0;z<=(H??this.length-1);z+=1)if(n5(this[z])===Y){DX("array.lastIndexOf(...)");break}}return K},Q.includes=function(Y,H){let K=G.call(this,Y,H);if(!K){for(let z=0;z<this.length;z+=1)if(n5(this[z])===Y){DX("array.includes(...)");break}}return K},Array.__svelte_cleanup=()=>{Q.indexOf=Z,Q.lastIndexOf=J,Q.includes=G}}function SQ(Q,X,Z=!0){try{if(Q===X!
\`${Q}(...)\` can only be used during component initialisation
https://svelte.dev/e/lifecycle_outside_component`);throw X.name="Svelte error",X}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function bT(Q){if(b1){let X=new Error(`store_invalid_shape
\`${Q}\` is not a store with a \`subscribe\` method
https://svelte.dev/e/store_invalid_shape`);throw X.name="Svelte error",X}else throw new Error("https://svelte.dev/e/store_invalid_shape")}var pT=0,Rn=1,mT=new WeakSet,kq=!1,yq=pT,IX=!1,a5=null,jQ=!1,Eq=!1;function _5(Q){jQ=Q}function mK(Q){Eq=Q}var VZ=[],s5=0,RX=[],E0=null;function L8(Q){E0=Q}var $0=null;function u6(Q){$0=Q}var h9=null;function CT(Q){h9=Q}var f8=null,r8=0,JQ=null;function NT(Q){JQ=Q}var lT=1,xq=0,kQ=!1,UX=null;var j0=null;var U9=null;function VX(){return++lT}function C4(){return!ZQ||j0!==null&&j0.l===null}function N4(Q){var X=Q.f;if((X&D8)!==0)return!0;if((X&a8)!==0){var Z=Q.deps,J=(X&v9)!==0;if(Z!==null){var G,Y,H=(X&$X)!==0,K=J&&$0!==null&&!kQ,z=Z.length;if(H||K){for(G=0;G<z;G++)if(Y=Z[G],H||!Y?.reactions?.includes(Q))(Y.reactions??=[]).push(Q);if(H)Q.f^=$X}for(G=0;G<z;G++){if(Y=Z[G],N4(Y))bK(Y);if(Y.wv>Q.wv)return!0}}if(!J||$0!==null&&!kQ)G8(Q,x6)}return!1}function _T(Q,X){var Z=X;while(Z!==null){if((Z.f&qZ)!==0)try{Z.fn(Q);return}catch{Z.f^=qZ}Z=Z.parent}throw kq=!1,Q}function dT(Q){return(Q.f&wQ)===0&&(Q.parent===null||(Q.parent.f&qZ)===0)}function t5(Q,X,Z,J){if(kq){if(Z===null)kq=!1;if(dT(X))throw Q;return}if(Z!==null)kq=!0;if(!b1||J===null||!(Q instanceof Error)||mT.has(Q)){_T(Q,X);return}mT.add(Q);let G=[],Y=X.fn?.name;if(Y)G.push(Y);let H=J;while(H!==null){if(b1){var K=H.function?.[f0];if(K){let $=K.split("/").pop();G.push($)}}H=H.p}let z=/Firefox/.test(navigator.userAgent)?" ":"\t";_6(Q,"message",{value:Q.message+`
${G.map(($)=>`
${z}in ${$}`).join("")}
`}),_6(Q,"component_stack",{value:G});let W=Q.stack;if(W){let $=W.split(`
`),q=[];for(let B=0;B<$.length;B++){let D=$[B];if(D.includes("svelte/src/internal"))continue;q.push(D)}_6(Q,"stack",{value:q.join(`
`)})}if(_T(Q,X),dT(X))throw Q}function cT(Q,X,Z=0){var J=Q.reactions;if(J===null)return;for(var G=0;G<J.length;G++){var Y=J[G];if((Y.f&l6)!==0)cT(Y,X,Z+1);else if(X===Y){if(Z===0)G8(Y,D8);else if((Y.f&x6)!==0)G8(Y,a8);p5(Y)}}}function Oq(Q){var X=f8,Z=r8,J=JQ,G=E0,Y=kQ,H=h9,K=j0,z=Q.f;f8=null,r8=0,JQ=null,E0=(z&(j8|x9))===0?Q:null,kQ=!jQ&&(z&v9)!==0,h9=null,j0=Q.ctx,xq++;try{var W=Q.fn(),$=Q.deps;if(f8!==null){var q;if(BZ(Q,r8),$!==null&&r8>0){$.length=r8+f8.length;for(q=0;q<f8.length;q++)$[r8+q]=f8[q]}else Q.deps=$=f8;if(!kQ)for(q=r8;q<$.length;q++)($[q].reactions??=[]).push(Q)}else if($!==null&&r8<$.length)BZ(Q,r8),$.length=r8;if(C4()&&JQ!==null&&(Q.f&(l6|a8|D8))===0)for(q=0;q<JQ.length;q++)cT(JQ[q],Q);if(G!==null)xq++;return W}finally{f8=X,r8=Z,JQ=J,E0=G,kQ=Y,h9=H,j0=K}}function An(Q,X){let Z=X.reactions;if(Z!==null){var J=dN.call(Z,Q);if(J!==-1){var G=Z.length-1;if(G===0)Z=X.reactions=null;else Z[J]=Z[G],Z.pop()}}if(Z===null&&(X.f&l6)!==0&&(f8===null||!f8.includes(X))){if(G8(X,a8),(X.f&(v9|$X))===0)X.f^=$X;BZ(X,0)}}function BZ(Q,X){var Z=Q.deps;if(Z===null)return;for(var J=X;J<Z.length;J++)An(Q,Z[J])}function u5(Q){var X=Q.f;if((X&wQ)!==0)return;G8(Q,x6);var Z=$0,J=j0;if($0=Q,b1){var G=U9;U9=Q.component_function}try{if((X&WZ)!==0)yT(Q);else lK(Q);pK(Q),uK(Q);var Y=Oq(Q);Q.teardown=typeof Y==="function"?Y:null,Q.wv=lT;var H=Q.deps;if(b1&&XQ&&(Q.f&D8)!==0&&H!==null)for(let z=0;z<H.length;z++){var K=H[z];if(K.trace_need_increase)K.wv=VX(),K.trace_need_increase=void 0,K.trace_v=void 0}if(b1)RX.push(Q)}catch(z){t5(z,Q,Z,J||Q.ctx)}finally{if($0=Z,b1)U9=G}}function uT(){console.error("Last ten effects were: ",RX.slice(-10).map((Q)=>Q.fn)),RX=[]}function iT(){if(s5>1000){s5=0;try{rN()}catch(Q){if(b1)_6(Q,"stack",{value:""});if(a5!==null)if(b1)try{t5(Q,a5,null,null)}catch(X){throw uT(),X}else t5(Q,a5,null,null);else{if(b1)uT();throw Q}}}s5++}function nT(Q){var X=Q.length;if(X===0)return;iT();var Z=jQ;jQ=!0;try{for(var J=0;J<X;J++){var G=Q[J];if((G.f&x6)===0)G.f^=x6;var Y=[];oT(G,Y),On(Y)}}finally{jQ=Z}}function On(Q){var X=Q.length;if(X===0)return;for(var Z=0;Z<X;Z++){var J=Q[Z];if((J.f&(wQ|s8))===0)try{if(N4(J)){if(u5(J),J.deps===null&&J.first===null&&J.nodes_start===null)if(J.teardown===null)cK(J);else J.fn=null}}catch(G){t5(G,J,null,J.ctx)}}}function wn(){if(IX=!1,s5>1001)return;let Q=VZ;if(VZ=[],nT(Q),!IX){if(s5=0,a5=null,b1)RX=[]}}function p5(Q){if(yq===pT){if(!IX)IX=!0,queueMicrotask(wn)}a5=Q;var X=Q;while(X.parent!==null){X=X.parent;var Z=X.f;if((Z&(x9|j8))!==0){if((Z&x6)===0)return;X.f^=x6}}VZ.push(X)}function oT(Q,X){var Z=Q.first,J=[];Q:while(Z!==null){var G=Z.f,Y=(G&j8)!==0,H=Y&&(G&x6)!==0,K=Z.next;if(!H&&(G&s8)===0){if((G&YZ)!==0){if(Y)Z.f^=x6;else try{if(N4(Z))u5(Z)}catch(q){t5(q,Z,null,Z.ctx)}var z=Z.first;if(z!==null){Z=z;continue}}else if((G&Fq)!==0)J.push(Z)}if(K===null){let q=Z.parent;while(q!==null){if(Q===q)break Q;var W=q.next;if(W!==null){Z=W;continue Q}q=q.parent}}Z=K}for(var $=0;$<J.length;$++)z=J[$],X.push(z),oT(z,X)}function r5(Q){var X=yq,Z=VZ;try{iT();let G=[];yq=Rn,VZ=G,IX=!1,nT(Z);var J=Q?.();if(fT(),VZ.length>0||G.length>0)r5();if(s5=0,a5=null,b1)RX=[];return J}finally{yq=X,VZ=Z}}function G0(Q){var X=Q.f,Z=(X&l6)!==0;if(Z&&(X&wQ)!==0){var J=fK(Q);return MX(Q),J}if(UX!==null)UX.add(Q);if(E0!==null){if(h9!==null&&h9.includes(Q))GT();var G=E0.deps;if(Q.rv<xq)if(Q.rv=xq,f8===null&&G!==null&&G[r8]===Q)r8++;else if(f8===null)f8=[Q];else f8.push(Q)}else if(Z&&Q.deps===null){var Y=Q,H=Y.parent,K=Y;while(H!==null)if((H.f&l6)!==0){var z=H;K=z,H=z.parent}else{var W=H;if(!W.deriveds?.includes(K))(W.deriveds??=[]).push(K);break}}if(Z){if(Y=Q,N4(Y))bK(Y)}if(b1&&XQ&&BX!==null&&E0!==null&&BX.reaction===E0){if(Q.debug)Q.debug();else if(Q.created){var $=BX.entries.get(Q);if($===void 0)$={read:[]},BX.entries.set(Q,$);$.read.push(EQ("TracedAt"))}}return Q.v}function E6(Q){let X=E0;try{return E0=null,Q()}finally{E0=X}}var En=~(D8|a8|x6);function G8(Q,X){Q.f=Q.f&En|X}function PZ(Q,X=!1,Z){if(j0={p:j0,c:null,e:null,m:!1,s:Q,x:null,l:null},ZQ&&!X)j0.l={s:null,u:null,r1:[],r2:d6(!1)};if(b1)j0.function=Z,U9=Z}function F
.error-message.svelte-1qdiqba {
color: var(--text-error);
margin-bottom: 1em;
}
.status-message.svelte-1qdiqba {
margin-bottom: 1em;
}
.dependency-item.svelte-1qdiqba {
margin-bottom: 0.5em;
}
/* (unused) .installed {
color: var(--text-success);
}*/
/* (unused) .not-installed {
color: var(--text-muted);
}*/
.link-item.svelte-1qdiqba {
margin-bottom: 0.5em;
}
button.svelte-1qdiqba {
margin-left: 0.5em;
}
/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWNwU2VydmVySW5zdGFsbFNldHRpbmdzLnN2ZWx0ZSIsInNvdXJjZXMiOlsiTWNwU2VydmVySW5zdGFsbFNldHRpbmdzLnN2ZWx0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyI8c2NyaXB0IGxhbmc9XCJ0c1wiPmltcG9ydCB7IEZVTExfTE9HR0VSX0ZJTEVOQU1FLCBsb2FkRGVwZW5kZW5jaWVzQXJyYXkgfSBmcm9tIFwiJC9zaGFyZWRcIjtcbmltcG9ydCB7IE5vdGljZSB9IGZyb20gXCJvYnNpZGlhblwiO1xuaW1wb3J0IHsgZGlybmFtZSB9IGZyb20gXCJwYXRoXCI7XG5pbXBvcnQgeyBvbk1vdW50IH0gZnJvbSBcInN2ZWx0ZVwiO1xuaW1wb3J0IHsgcmVtb3ZlRnJvbUNsYXVkZUNvbmZpZywgdXBkYXRlQ2xhdWRlQ29uZmlnLCB9IGZyb20gXCIuLi9zZXJ2aWNlcy9jb25maWdcIjtcbmltcG9ydCB7IGluc3RhbGxNY3BTZXJ2ZXIgfSBmcm9tIFwiLi4vc2VydmljZXMvaW5zdGFsbFwiO1xuaW1wb3J0IHsgZ2V0SW5zdGFsbGF0aW9uU3RhdHVzIH0gZnJvbSBcIi4uL3NlcnZpY2VzL3N0YXR1c1wiO1xuaW1wb3J0IHsgdW5pbnN0YWxsU2VydmVyIH0gZnJvbSBcIi4uL3NlcnZpY2VzL3VuaW5zdGFsbFwiO1xuaW1wb3J0IHsgb3BlbkZvbGRlciB9IGZyb20gXCIuLi91dGlscy9vcGVuRm9sZGVyXCI7XG5leHBvcnQgbGV0IHBsdWdpbjtcbi8vIERlcGVuZGVuY2llcyBhbmQgQVBJIGtleSBzdGF0dXNcbmNvbnN0IGRlcHMgPSBsb2FkRGVwZW5kZW5jaWVzQXJyYXkocGx1Z2luKTtcbi8vIEluc3RhbGxhdGlvbiBzdGF0dXNcbmxldCBzdGF0dXMgPSB7XG4gICAgc3RhdGU6IFwibm90IGluc3RhbGxlZFwiLFxuICAgIHZlcnNpb25zOiB7fSxcbn07XG5vbk1vdW50KGFzeW5jICgpID0+IHtcbiAgICBzdGF0dXMgPSBhd2FpdCBnZXRJbnN0YWxsYXRpb25TdGF0dXMocGx1Z2luKTtcbn0pO1xuLy8gSGFuZGxlIGluc3RhbGxhdGlvblxuYXN5bmMgZnVuY3Rpb24gaGFuZGxlSW5zdGFsbCgpIHtcbiAgICB0cnkge1xuICAgICAgICBjb25zdCBhcGlLZXkgPSBhd2FpdCBwbHVnaW4uZ2V0TG9jYWxSZXN0QXBpS2V5KCk7XG4gICAgICAgIGlmICghYXBpS2V5KSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJMb2NhbCBSRVNUIEFQSSBrZXkgaXMgbm90IGNvbmZpZ3VyZWRcIik7XG4gICAgICAgIH1cbiAgICAgICAgc3RhdHVzID0geyAuLi5zdGF0dXMsIHN0YXRlOiBcImluc3RhbGxpbmdcIiB9O1xuICAgICAgICBjb25zdCBpbnN0YWxsUGF0aCA9IGF3YWl0IGluc3RhbGxNY3BTZXJ2ZXIocGx1Z2luKTtcbiAgICAgICAgLy8gVXBkYXRlIENsYXVkZSBjb25maWdcbiAgICAgICAgYXdhaXQgdXBkYXRlQ2xhdWRlQ29uZmlnKHBsdWdpbiwgaW5zdGFsbFBhdGgucGF0aCwgYXBpS2V5KTtcbiAgICAgICAgc3RhdHVzID0gYXdhaXQgZ2V0SW5zdGFsbGF0aW9uU3RhdHVzKHBsdWdpbik7XG4gICAgfVxuICAgIGNhdGNoIChlcnJvcikge1xuICAgICAgICBjb25zdCBtZXNzYWdlID0gZXJyb3IgaW5zdGFuY2VvZiBFcnJvciA/IGVycm9yLm1lc3NhZ2UgOiBcIkluc3RhbGxhdGlvbiBmYWlsZWRcIjtcbiAgICAgICAgc3RhdHVzID0geyAuLi5zdGF0dXMsIHN0YXRlOiBcImVycm9yXCIsIGVycm9yOiBtZXNzYWdlIH07XG4gICAgICAgIG5ldyBOb3RpY2UobWVzc2FnZSk7XG4gICAgfVxufVxuLy8gSGFuZGxlIHVuaW5zdGFsbFxuYXN5bmMgZnVuY3Rpb24gaGFuZGxlVW5pbnN0YWxsKCkge1xuICAgIHRyeSB7XG4gICAgICAgIHN0YXR1cyA9IHsgLi4uc3RhdHVzLCBzdGF0ZTogXCJpbnN0YWxsaW5nXCIgfTtcbiAgICAgICAgYXdhaXQgdW5pbnN0YWxsU2VydmVyKHBsdWdpbik7XG4gICAgICAgIGF3YWl0IHJlbW92ZUZyb21DbGF1ZGVDb25maWcoKTtcbiAgICAgICAgc3RhdHVzID0geyAuLi5zdGF0dXMsIHN0YXRlOiBcIm5vdCBpbnN0YWxsZWRcIiB9O1xuICAgIH1cbiAgICBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgY29uc3QgbWVzc2FnZSA9IGVycm9yIGluc3RhbmNlb2YgRXJyb3IgPyBlcnJvci5tZXNzYWdlIDogXCJVbmluc3RhbGxhdGlvbiBmYWlsZWRcIjtcbiAgICAgICAgc3RhdHVzID0ge1xuICAgICAgICAgICAgLi4uc3RhdHVzLFxuICAgICAgICAgICAgc3RhdGU6IFwiZXJyb3JcIixcbiAgICAgICAgICAgIGVycm9yOiBtZXNzYWdlLFxuICAgICAgICB9O1xuICAgICAgICBuZXcgTm90aWNlKG1lc3NhZ2UpO1xuICAgIH1cbn1cbjwvc2NyaXB0PlxuXG48ZGl2IGNsYXNzPVwiaW5zdGFsbGF0aW9uLXN0YXR1c1wiPlxuICA8aDM+SW5zdGFsbGF0aW9uIHN0YXR1czwvaDM+XG5cbiAgeyNpZiBzdGF0dXMuc3RhdGUgPT09IFwibm8gYXBpIGtleVwifVxuICAgIDxkaXYgY2xhc3M9XCJlcnJvci1tZXNzYWdlXCI+UGxlYXNlIGNvbmZpZ3VyZSB0aGUgTG9jYWwgUkVTVCBBUEkgcGx1Z2luPC9kaXY+XG4gIHs6ZWxzZSBpZiBzdGF0dXMuc3RhdGUgPT09IFwibm90IGluc3RhbGxlZFwifVxuICAgIDxkaXYgY2xhc3M9XCJzdGF0dXMtbWVzc2FnZVwiPlxuICAgICAgTUNQIFNlcnZlciBpcyBub3QgaW5zdGFsbGVkXG4gICAgICA8YnV0dG9uIG9uOmNsaWNrPXtoYW5kbGVJbnN0YWxsfT5JbnN0YWxsIHNlcnZlcjwvYnV0dG9uPlxuICAgIDwvZGl2PlxuICB7OmVsc2UgaWYgc3RhdHVzLnN0YXRlID09PSBcImluc3RhbGxpbmdcIn1cbiAgICA8ZGl2IGNsYXNzPVwic3RhdHVzLW1lc3NhZ2VcIj5JbnN0YWxsaW5nIE1DUCBzZXJ2ZXIuLi48L2Rpdj5cbiAgezplbHNlIGlmIHN0YXR1cy5zdGF0ZSA9PT0gXCJpbnN0YWxsZWRcIn1cbiAgICA8ZGl2IGNsYXNzPVwic3RhdHVzLW1lc3NhZ2VcIj5cbiAgICAgIE1DUCBTZXJ2ZXIgdntzdGF0dXMudmVyc2lvbnMuc2VydmVyfSBpcyBpbnN0YWxsZWRcbiAgICAgIDxidXR0b24gb246Y2xpY2s9e2hhbmRsZVVuaW5zdGFsbH0+VW5pbnN0YWxsPC9idXR0b24+XG4gICAgPC9kaXY+XG4gIHs6ZWxzZSBpZiBzdGF0dXMuc3RhdGUgPT09IFwib3V0ZGF0ZWRcIn1cbiAgICA8ZGl2IGNsYXNzPVwic3RhdHVzLW1lc3NhZ2VcIj5cbiAgICAgIFVwZGF0ZSBhdmFpbGFibGU
${G0(A).name??""}
${(G0(A).required?"(Required)":"(Optional)")??""} `)),D6(h,x)};D9(T,(h)=>{if(G0(A).installed)h(S);else h(v,!1)})}y8(R),D6(w,R)}),y8(P);var C=V9(P,2),L=V9(g8(C),2);{var V=(w)=>{var A=q11(),R=g8(A);y8(A),DZ("click",R,()=>G0(K).dir&&GB(G0(K).dir)),D6(w,A)};D9(L,(w)=>{if(G0(K).path)w(V)})}var M=V9(L,2),I=g8(M);y8(M),Rq(2),y8(C),DZ("click",I,()=>GB(DA.dirname(UI))),D6(Q,$);var E=FZ({...wX()});return J(),E}CX(p6);async function LA(Q){try{return{success:!0}}catch(X){return{success:!1,error:X instanceof Error?X.message:String(X)}}}LX();AZ[f0]="SettingsTab.svelte";var K11=z8(K8('<div class="settings-container"><!></div>'),AZ[f0],[[5,0]]);function AZ(Q,X){OX(new.target),PZ(X,!1,AZ);let Z=jX(X,"plugin",8);var J=K11(),G=g8(J);return p6(G,{get plugin(){return Z()}}),y8(J),D6(Q,J),FZ({...wX()})}CX(AZ);var CA=require("obsidian");class NA extends CA.PluginSettingTab{plugin;component;constructor(Q,X){super(Q,X);this.plugin=X}display(){let{containerEl:Q}=this;Q.empty(),this.component=Z7(AZ,{target:Q,props:{plugin:this.plugin}})}hide(){this.component&&AX(this.component)}}async function TA(Q){try{return Q.addSettingTab(new NA(Q.app,Q)),{success:!0}}catch(X){return{success:!1,error:X instanceof Error?X.message:String(X)}}}class WB extends w4.Plugin{localRestApi={id:"obsidian-local-rest-api",name:"Local REST API",required:!0,installed:!1};async getLocalRestApiKey(){return this.localRestApi.plugin?.settings?.apiKey}async onload(){await TA(this),await LA(this),F3.lastValueFrom(v$(this)).then((Q)=>{if(this.localRestApi=Q,!this.localRestApi.api){new w4.Notice(`${this.manifest.name}: Local REST API plugin is required but not found. Please install it from the community plugins and restart Obsidian.`,0);return}this.localRestApi.api.addRoute("/search/smart").post(this.handleSearchRequest.bind(this)),this.localRestApi.api.addRoute("/templates/execute").post(this.handleTemplateExecution.bind(this)),m0.info("MCP Tools Plugin loaded")})}async handleTemplateExecution(Q,X){try{let{api:Z}=await F3.lastValueFrom(g$(this));if(!Z){new w4.Notice(`${this.manifest.name}: Templater plugin is not available. Please install it from the community plugins.`,0),m0.error("Templater plugin is not available"),X.status(503).json({error:"Templater plugin is not available"});return}let J=Bq.ApiTemplateExecutionParams(Q.body);if(J instanceof c1.errors){let W={error:"Invalid request body",body:Q.body,summary:J.summary};m0.debug("Invalid request body",W),X.status(400).json(W);return}let G=this.app.vault.getAbstractFileByPath(J.name);if(!(G instanceof w4.TFile)){m0.debug("Template file not found",{params:J,templateFile:G}),X.status(404).json({error:`File not found: ${J.name}`});return}let Y=Z.create_running_config(G,G,Vq.RunMode.CreateNewFromTemplate),H=(W)=>{return J.arguments[W]??""},K=Z.functions_generator.generate_object.bind(Z.functions_generator);Z.functions_generator.generate_object=async function(W,$){let q=await K(W,$);return Object.assign(q,{mcpTools:{prompt:H}}),q};let z=await Z.read_and_parse_template(Y);if(Z.functions_generator.generate_object=K,J.createFile&&J.targetPath){await this.app.vault.create(J.targetPath,z),X.json({message:"Prompt executed and file created successfully",content:z});return}X.json({message:"Prompt executed without creating a file",content:z})}catch(Z){m0.error("Prompt execution error:",{error:Z instanceof Error?Z.message:Z,body:Q.body}),X.status(503).json({error:"An error occurred while processing the prompt"});return}}async handleSearchRequest(Q,X){try{let J=(await F3.lastValueFrom(x$(this))).api;if(!J){new w4.Notice("Smart Search REST API Plugin: smart-connections plugin is required but not found. Please install it from the community plugins.",0),X.status(503).json({error:"Smart Connections plugin is not available"});return}let G=bN.pipe(({query:K,filter:z={}})=>({query:K,filter:Gz({key_starts_with_any:z.folders,exclude_key_starts_with_any:z.excludeFolders,limit:z.limit})})).to(mN)(Q.body);if(G instanceof c1.errors){X.status(400).json({error:"Invalid request body",summary:G.summary});return}let Y=await J.search(G.query,G.filter),H={
/* nosourcemap */