@kitelev/exocortex-cli 16.186.0 → 16.187.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +60 -60
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// @kitelev/exocortex-cli v16.
|
|
2
|
+
// @kitelev/exocortex-cli v16.187.0
|
|
3
3
|
// CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
|
|
4
4
|
// License: MIT
|
|
5
5
|
|
|
6
|
-
"use strict";var R6=Object.create;var $f=Object.defineProperty;var C6=Object.getOwnPropertyDescriptor;var O6=Object.getOwnPropertyNames;var P6=Object.getPrototypeOf,D6=Object.prototype.hasOwnProperty;var a=(r,e)=>$f(r,"name",{value:e,configurable:!0});var F6=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Bb=(r,e)=>{for(var t in e)$f(r,t,{get:e[t],enumerable:!0})},WR=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of O6(e))!D6.call(r,i)&&i!==t&&$f(r,i,{get:()=>e[i],enumerable:!(n=C6(e,i))||n.enumerable});return r};var Se=(r,e,t)=>(t=r!=null?R6(P6(r)):{},WR(e||!r||!r.__esModule?$f(t,"default",{value:r,enumerable:!0}):t,r)),Dh=r=>WR($f({},"__esModule",{value:!0}),r);var Vb=E(()=>{var HR;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:c(),n=i(r);typeof t.Reflect<"u"&&(n=i(t.Reflect,n)),e(n,t),typeof t.Reflect>"u"&&(t.Reflect=r);function i(l,u){return function(f,d){Object.defineProperty(l,f,{configurable:!0,writable:!0,value:d}),u&&u(f,d)}}a(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}a(s,"functionThis");function o(){try{return(0,eval)("(function() { return this; })()")}catch{}}a(o,"indirectEvalThis");function c(){return s()||o()}a(c,"sloppyModeThis")})(function(e,t){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,u=!c&&!l,f={create:c?function(){return U(Object.create(null))}:l?function(){return U({__proto__:null})}:function(){return U({})},has:u?function(R,C){return n.call(R,C)}:function(R,C){return C in R},get:u?function(R,C){return n.call(R,C)?R[C]:void 0}:function(R,C){return R[C]}},d=Object.getPrototypeOf(Function),p=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:He(),h=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:m(),_=typeof WeakMap=="function"?WeakMap:L(),y=i?Symbol.for("@reflect-metadata:registry"):void 0,S=Me(),w=We(S);function T(R,C,D,b){if(Z(D)){if(!Ie(R))throw new TypeError;if(!Fe(C))throw new TypeError;return ae(R,C)}else{if(!Ie(R))throw new TypeError;if(!se(C))throw new TypeError;if(!se(b)&&!Z(b)&&!ye(b))throw new TypeError;return ye(b)&&(b=void 0),D=be(D),we(R,C,D,b)}}a(T,"decorate"),e("decorate",T);function O(R,C){function D(b,F){if(!se(b))throw new TypeError;if(!Z(F)&&!De(F))throw new TypeError;ie(R,C,b,F)}return a(D,"decorator"),D}a(O,"metadata"),e("metadata",O);function A(R,C,D,b){if(!se(D))throw new TypeError;return Z(b)||(b=be(b)),ie(R,C,D,b)}a(A,"defineMetadata"),e("defineMetadata",A);function x(R,C,D){if(!se(C))throw new TypeError;return Z(D)||(D=be(D)),te(R,C,D)}a(x,"hasMetadata"),e("hasMetadata",x);function P(R,C,D){if(!se(C))throw new TypeError;return Z(D)||(D=be(D)),pe(R,C,D)}a(P,"hasOwnMetadata"),e("hasOwnMetadata",P);function V(R,C,D){if(!se(C))throw new TypeError;return Z(D)||(D=be(D)),Y(R,C,D)}a(V,"getMetadata"),e("getMetadata",V);function j(R,C,D){if(!se(C))throw new TypeError;return Z(D)||(D=be(D)),Ee(R,C,D)}a(j,"getOwnMetadata"),e("getOwnMetadata",j);function $(R,C){if(!se(R))throw new TypeError;return Z(C)||(C=be(C)),ne(R,C)}a($,"getMetadataKeys"),e("getMetadataKeys",$);function K(R,C){if(!se(R))throw new TypeError;return Z(C)||(C=be(C)),de(R,C)}a(K,"getOwnMetadataKeys"),e("getOwnMetadataKeys",K);function N(R,C,D){if(!se(C))throw new TypeError;if(Z(D)||(D=be(D)),!se(C))throw new TypeError;Z(D)||(D=be(D));var b=$e(C,D,!1);return Z(b)?!1:b.OrdinaryDeleteMetadata(R,C,D)}a(N,"deleteMetadata"),e("deleteMetadata",N);function ae(R,C){for(var D=R.length-1;D>=0;--D){var b=R[D],F=b(C);if(!Z(F)&&!ye(F)){if(!Fe(F))throw new TypeError;C=F}}return C}a(ae,"DecorateConstructor");function we(R,C,D,b){for(var F=R.length-1;F>=0;--F){var X=R[F],G=X(C,D,b);if(!Z(G)&&!ye(G)){if(!se(G))throw new TypeError;b=G}}return b}a(we,"DecorateProperty");function te(R,C,D){var b=pe(R,C,D);if(b)return!0;var F=ke(C);return ye(F)?!1:te(R,F,D)}a(te,"OrdinaryHasMetadata");function pe(R,C,D){var b=$e(C,D,!1);return Z(b)?!1:Q(b.OrdinaryHasOwnMetadata(R,C,D))}a(pe,"OrdinaryHasOwnMetadata");function Y(R,C,D){var b=pe(R,C,D);if(b)return Ee(R,C,D);var F=ke(C);if(!ye(F))return Y(R,F,D)}a(Y,"OrdinaryGetMetadata");function Ee(R,C,D){var b=$e(C,D,!1);if(!Z(b))return b.OrdinaryGetOwnMetadata(R,C,D)}a(Ee,"OrdinaryGetOwnMetadata");function ie(R,C,D,b){var F=$e(D,b,!0);F.OrdinaryDefineOwnMetadata(R,C,D,b)}a(ie,"OrdinaryDefineOwnMetadata");function ne(R,C){var D=de(R,C),b=ke(R);if(b===null)return D;var F=ne(b,C);if(F.length<=0)return D;if(D.length<=0)return F;for(var X=new h,G=[],B=0,M=D;B<M.length;B++){var k=M[B],W=X.has(k);W||(X.add(k),G.push(k))}for(var H=0,oe=F;H<oe.length;H++){var k=oe[H],W=X.has(k);W||(X.add(k),G.push(k))}return G}a(ne,"OrdinaryMetadataKeys");function de(R,C){var D=$e(R,C,!1);return D?D.OrdinaryOwnMetadataKeys(R,C):[]}a(de,"OrdinaryOwnMetadataKeys");function ge(R){if(R===null)return 1;switch(typeof R){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return R===null?1:6;default:return 6}}a(ge,"Type");function Z(R){return R===void 0}a(Z,"IsUndefined");function ye(R){return R===null}a(ye,"IsNull");function Pe(R){return typeof R=="symbol"}a(Pe,"IsSymbol");function se(R){return typeof R=="object"?R!==null:typeof R=="function"}a(se,"IsObject");function _e(R,C){switch(ge(R)){case 0:return R;case 1:return R;case 2:return R;case 3:return R;case 4:return R;case 5:return R}var D=C===3?"string":C===5?"number":"default",b=ee(R,s);if(b!==void 0){var F=b.call(R,D);if(se(F))throw new TypeError;return F}return Ne(R,D==="default"?"number":D)}a(_e,"ToPrimitive");function Ne(R,C){if(C==="string"){var D=R.toString;if(Ce(D)){var b=D.call(R);if(!se(b))return b}var F=R.valueOf;if(Ce(F)){var b=F.call(R);if(!se(b))return b}}else{var F=R.valueOf;if(Ce(F)){var b=F.call(R);if(!se(b))return b}var X=R.toString;if(Ce(X)){var b=X.call(R);if(!se(b))return b}}throw new TypeError}a(Ne,"OrdinaryToPrimitive");function Q(R){return!!R}a(Q,"ToBoolean");function ce(R){return""+R}a(ce,"ToString");function be(R){var C=_e(R,3);return Pe(C)?C:ce(C)}a(be,"ToPropertyKey");function Ie(R){return Array.isArray?Array.isArray(R):R instanceof Object?R instanceof Array:Object.prototype.toString.call(R)==="[object Array]"}a(Ie,"IsArray");function Ce(R){return typeof R=="function"}a(Ce,"IsCallable");function Fe(R){return typeof R=="function"}a(Fe,"IsConstructor");function De(R){switch(ge(R)){case 3:return!0;case 4:return!0;default:return!1}}a(De,"IsPropertyKey");function Ae(R,C){return R===C||R!==R&&C!==C}a(Ae,"SameValueZero");function ee(R,C){var D=R[C];if(D!=null){if(!Ce(D))throw new TypeError;return D}}a(ee,"GetMethod");function he(R){var C=ee(R,o);if(!Ce(C))throw new TypeError;var D=C.call(R);if(!se(D))throw new TypeError;return D}a(he,"GetIterator");function Te(R){return R.value}a(Te,"IteratorValue");function xe(R){var C=R.next();return C.done?!1:C}a(xe,"IteratorStep");function je(R){var C=R.return;C&&C.call(R)}a(je,"IteratorClose");function ke(R){var C=Object.getPrototypeOf(R);if(typeof R!="function"||R===d||C!==d)return C;var D=R.prototype,b=D&&Object.getPrototypeOf(D);if(b==null||b===Object.prototype)return C;var F=b.constructor;return typeof F!="function"||F===R?C:F}a(ke,"OrdinaryGetPrototypeOf");function Ge(){var R;!Z(y)&&typeof t.Reflect<"u"&&!(y in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(R=Ve(t.Reflect));var C,D,b,F=new _,X={registerProvider:G,getProvider:M,setProvider:W};return X;function G(H){if(!Object.isExtensible(X))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case R===H:break;case Z(C):C=H;break;case C===H:break;case Z(D):D=H;break;case D===H:break;default:b===void 0&&(b=new h),b.add(H);break}}function B(H,oe){if(!Z(C)){if(C.isProviderFor(H,oe))return C;if(!Z(D)){if(D.isProviderFor(H,oe))return C;if(!Z(b))for(var me=he(b);;){var Re=xe(me);if(!Re)return;var rt=Te(Re);if(rt.isProviderFor(H,oe))return je(me),rt}}}if(!Z(R)&&R.isProviderFor(H,oe))return R}function M(H,oe){var me=F.get(H),Re;return Z(me)||(Re=me.get(oe)),Z(Re)&&(Re=B(H,oe),Z(Re)||(Z(me)&&(me=new p,F.set(H,me)),me.set(oe,Re))),Re}function k(H){if(Z(H))throw new TypeError;return C===H||D===H||!Z(b)&&b.has(H)}function W(H,oe,me){if(!k(me))throw new Error("Metadata provider not registered.");var Re=M(H,oe);if(Re!==me){if(!Z(Re))return!1;var rt=F.get(H);Z(rt)&&(rt=new p,F.set(H,rt)),rt.set(oe,me)}return!0}}a(Ge,"CreateMetadataRegistry");function Me(){var R;return!Z(y)&&se(t.Reflect)&&Object.isExtensible(t.Reflect)&&(R=t.Reflect[y]),Z(R)&&(R=Ge()),!Z(y)&&se(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:R}),R}a(Me,"GetOrCreateMetadataRegistry");function We(R){var C=new _,D={isProviderFor:a(function(k,W){var H=C.get(k);return Z(H)?!1:H.has(W)},"isProviderFor"),OrdinaryDefineOwnMetadata:G,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:X,OrdinaryOwnMetadataKeys:B,OrdinaryDeleteMetadata:M};return S.registerProvider(D),D;function b(k,W,H){var oe=C.get(k),me=!1;if(Z(oe)){if(!H)return;oe=new p,C.set(k,oe),me=!0}var Re=oe.get(W);if(Z(Re)){if(!H)return;if(Re=new p,oe.set(W,Re),!R.setProvider(k,W,D))throw oe.delete(W),me&&C.delete(k),new Error("Wrong provider for target.")}return Re}a(b,"GetOrCreateMetadataMap");function F(k,W,H){var oe=b(W,H,!1);return Z(oe)?!1:Q(oe.has(k))}a(F,"OrdinaryHasOwnMetadata");function X(k,W,H){var oe=b(W,H,!1);if(!Z(oe))return oe.get(k)}a(X,"OrdinaryGetOwnMetadata");function G(k,W,H,oe){var me=b(H,oe,!0);me.set(k,W)}a(G,"OrdinaryDefineOwnMetadata");function B(k,W){var H=[],oe=b(k,W,!1);if(Z(oe))return H;for(var me=oe.keys(),Re=he(me),rt=0;;){var Vr=xe(Re);if(!Vr)return H.length=rt,H;var Er=Te(Vr);try{H[rt]=Er}catch(tr){try{je(Re)}finally{throw tr}}rt++}}a(B,"OrdinaryOwnMetadataKeys");function M(k,W,H){var oe=b(W,H,!1);if(Z(oe)||!oe.delete(k))return!1;if(oe.size===0){var me=C.get(W);Z(me)||(me.delete(H),me.size===0&&C.delete(me))}return!0}a(M,"OrdinaryDeleteMetadata")}a(We,"CreateMetadataProvider");function Ve(R){var C=R.defineMetadata,D=R.hasOwnMetadata,b=R.getOwnMetadata,F=R.getOwnMetadataKeys,X=R.deleteMetadata,G=new _,B={isProviderFor:a(function(M,k){var W=G.get(M);return!Z(W)&&W.has(k)?!0:F(M,k).length?(Z(W)&&(W=new h,G.set(M,W)),W.add(k),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:C,OrdinaryHasOwnMetadata:D,OrdinaryGetOwnMetadata:b,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:X};return B}a(Ve,"CreateFallbackProvider");function $e(R,C,D){var b=S.getProvider(R,C);if(!Z(b))return b;if(D){if(S.setProvider(R,C,w))return w;throw new Error("Illegal state.")}}a($e,"GetMetadataProvider");function He(){var R={},C=[],D=(function(){function B(M,k,W){this._index=0,this._keys=M,this._values=k,this._selector=W}return a(B,"MapIterator"),B.prototype["@@iterator"]=function(){return this},B.prototype[o]=function(){return this},B.prototype.next=function(){var M=this._index;if(M>=0&&M<this._keys.length){var k=this._selector(this._keys[M],this._values[M]);return M+1>=this._keys.length?(this._index=-1,this._keys=C,this._values=C):this._index++,{value:k,done:!1}}return{value:void 0,done:!0}},B.prototype.throw=function(M){throw this._index>=0&&(this._index=-1,this._keys=C,this._values=C),M},B.prototype.return=function(M){return this._index>=0&&(this._index=-1,this._keys=C,this._values=C),{value:M,done:!0}},B})(),b=(function(){function B(){this._keys=[],this._values=[],this._cacheKey=R,this._cacheIndex=-2}return a(B,"Map"),Object.defineProperty(B.prototype,"size",{get:a(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),B.prototype.has=function(M){return this._find(M,!1)>=0},B.prototype.get=function(M){var k=this._find(M,!1);return k>=0?this._values[k]:void 0},B.prototype.set=function(M,k){var W=this._find(M,!0);return this._values[W]=k,this},B.prototype.delete=function(M){var k=this._find(M,!1);if(k>=0){for(var W=this._keys.length,H=k+1;H<W;H++)this._keys[H-1]=this._keys[H],this._values[H-1]=this._values[H];return this._keys.length--,this._values.length--,Ae(M,this._cacheKey)&&(this._cacheKey=R,this._cacheIndex=-2),!0}return!1},B.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=R,this._cacheIndex=-2},B.prototype.keys=function(){return new D(this._keys,this._values,F)},B.prototype.values=function(){return new D(this._keys,this._values,X)},B.prototype.entries=function(){return new D(this._keys,this._values,G)},B.prototype["@@iterator"]=function(){return this.entries()},B.prototype[o]=function(){return this.entries()},B.prototype._find=function(M,k){if(!Ae(this._cacheKey,M)){this._cacheIndex=-1;for(var W=0;W<this._keys.length;W++)if(Ae(this._keys[W],M)){this._cacheIndex=W;break}}return this._cacheIndex<0&&k&&(this._cacheIndex=this._keys.length,this._keys.push(M),this._values.push(void 0)),this._cacheIndex},B})();return b;function F(B,M){return B}function X(B,M){return M}function G(B,M){return[B,M]}}a(He,"CreateMapPolyfill");function m(){var R=(function(){function C(){this._map=new p}return a(C,"Set"),Object.defineProperty(C.prototype,"size",{get:a(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),C.prototype.has=function(D){return this._map.has(D)},C.prototype.add=function(D){return this._map.set(D,D),this},C.prototype.delete=function(D){return this._map.delete(D)},C.prototype.clear=function(){this._map.clear()},C.prototype.keys=function(){return this._map.keys()},C.prototype.values=function(){return this._map.keys()},C.prototype.entries=function(){return this._map.entries()},C.prototype["@@iterator"]=function(){return this.keys()},C.prototype[o]=function(){return this.keys()},C})();return R}a(m,"CreateSetPolyfill");function L(){var R=16,C=f.create(),D=b();return(function(){function M(){this._key=b()}return a(M,"WeakMap"),M.prototype.has=function(k){var W=F(k,!1);return W!==void 0?f.has(W,this._key):!1},M.prototype.get=function(k){var W=F(k,!1);return W!==void 0?f.get(W,this._key):void 0},M.prototype.set=function(k,W){var H=F(k,!0);return H[this._key]=W,this},M.prototype.delete=function(k){var W=F(k,!1);return W!==void 0?delete W[this._key]:!1},M.prototype.clear=function(){this._key=b()},M})();function b(){var M;do M="@@WeakMap@@"+B();while(f.has(C,M));return C[M]=!0,M}function F(M,k){if(!n.call(M,D)){if(!k)return;Object.defineProperty(M,D,{value:f.create()})}return M[D]}function X(M,k){for(var W=0;W<k;++W)M[W]=Math.random()*255|0;return M}function G(M){if(typeof Uint8Array=="function"){var k=new Uint8Array(M);return typeof crypto<"u"?crypto.getRandomValues(k):typeof msCrypto<"u"?msCrypto.getRandomValues(k):X(k,M),k}return X(new Array(M),M)}function B(){var M=G(R);M[6]=M[6]&79|64,M[8]=M[8]&191|128;for(var k="",W=0;W<R;++W){var H=M[W];(W===4||W===6||W===8)&&(k+="-"),H<16&&(k+="0"),k+=H.toString(16).toLowerCase()}return k}}a(L,"CreateWeakMapPolyfill");function U(R){return R.__=void 0,delete R.__,R}a(U,"MakeDictionary")})})(HR||(HR={}))});var Uf=E(Gb=>{var Fh=class extends Error{static{a(this,"CommanderError")}constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},qb=class extends Fh{static{a(this,"InvalidArgumentError")}constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Gb.CommanderError=Fh;Gb.InvalidArgumentError=qb});var Lh=E(Hb=>{var{InvalidArgumentError:L6}=Uf(),Wb=class{static{a(this,"Argument")}constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new L6(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function N6(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}a(N6,"humanReadableArgName");Hb.Argument=Wb;Hb.humanReadableArgName=N6});var Yb=E(Kb=>{var{humanReadableArgName:k6}=Lh(),zb=class{static{a(this,"Help")}constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let n=a(i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,""),"getSortKey");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!i&&!s?t.push(n):n.long&&!s?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>k6(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let i=new Map;return e.forEach(s=>{let o=n(s);i.has(o)||i.set(o,[])}),t.forEach(s=>{let o=n(s);i.has(o)||i.set(o,[]),i.get(o).push(s)}),i}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth??80;function s(d,p){return t.formatItem(d,n,p,t)}a(s,"callFormatItem");let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],c=t.commandDescription(e);c.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(c),i),""]));let l=t.visibleArguments(e).map(d=>s(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",l,t)),this.groupItems(e.options,t.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,p)=>{let h=d.map(_=>s(t.styleOptionTerm(t.optionTerm(_)),t.styleOptionDescription(t.optionDescription(_))));o=o.concat(this.formatItemList(p,h,t))}),t.showGlobalOptions){let d=t.visibleGlobalOptions(e).map(p=>s(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));o=o.concat(this.formatItemList("Global Options:",d,t))}return this.groupItems(e.commands,t.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,p)=>{let h=d.map(_=>s(t.styleSubcommandTerm(t.subcommandTerm(_)),t.styleSubcommandDescription(t.subcommandDescription(_))));o=o.concat(this.formatItemList(p,h,t))}),o.join(`
|
|
6
|
+
"use strict";var R6=Object.create;var $f=Object.defineProperty;var C6=Object.getOwnPropertyDescriptor;var O6=Object.getOwnPropertyNames;var P6=Object.getPrototypeOf,D6=Object.prototype.hasOwnProperty;var a=(r,e)=>$f(r,"name",{value:e,configurable:!0});var F6=(r,e)=>()=>(r&&(e=r(r=0)),e);var E=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Bb=(r,e)=>{for(var t in e)$f(r,t,{get:e[t],enumerable:!0})},WR=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of O6(e))!D6.call(r,i)&&i!==t&&$f(r,i,{get:()=>e[i],enumerable:!(n=C6(e,i))||n.enumerable});return r};var Se=(r,e,t)=>(t=r!=null?R6(P6(r)):{},WR(e||!r||!r.__esModule?$f(t,"default",{value:r,enumerable:!0}):t,r)),Dh=r=>WR($f({},"__esModule",{value:!0}),r);var Vb=E(()=>{var HR;(function(r){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:c(),n=i(r);typeof t.Reflect<"u"&&(n=i(t.Reflect,n)),e(n,t),typeof t.Reflect>"u"&&(t.Reflect=r);function i(l,u){return function(f,d){Object.defineProperty(l,f,{configurable:!0,writable:!0,value:d}),u&&u(f,d)}}a(i,"makeExporter");function s(){try{return Function("return this;")()}catch{}}a(s,"functionThis");function o(){try{return(0,eval)("(function() { return this; })()")}catch{}}a(o,"indirectEvalThis");function c(){return s()||o()}a(c,"sloppyModeThis")})(function(e,t){var n=Object.prototype.hasOwnProperty,i=typeof Symbol=="function",s=i&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",o=i&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",c=typeof Object.create=="function",l={__proto__:[]}instanceof Array,u=!c&&!l,f={create:c?function(){return U(Object.create(null))}:l?function(){return U({__proto__:null})}:function(){return U({})},has:u?function(R,C){return n.call(R,C)}:function(R,C){return C in R},get:u?function(R,C){return n.call(R,C)?R[C]:void 0}:function(R,C){return R[C]}},d=Object.getPrototypeOf(Function),p=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:He(),h=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:m(),_=typeof WeakMap=="function"?WeakMap:L(),y=i?Symbol.for("@reflect-metadata:registry"):void 0,S=Me(),w=We(S);function T(R,C,D,b){if(te(D)){if(!Ie(R))throw new TypeError;if(!Fe(C))throw new TypeError;return ae(R,C)}else{if(!Ie(R))throw new TypeError;if(!se(C))throw new TypeError;if(!se(b)&&!te(b)&&!me(b))throw new TypeError;return me(b)&&(b=void 0),D=be(D),we(R,C,D,b)}}a(T,"decorate"),e("decorate",T);function O(R,C){function D(b,F){if(!se(b))throw new TypeError;if(!te(F)&&!De(F))throw new TypeError;ie(R,C,b,F)}return a(D,"decorator"),D}a(O,"metadata"),e("metadata",O);function A(R,C,D,b){if(!se(D))throw new TypeError;return te(b)||(b=be(b)),ie(R,C,D,b)}a(A,"defineMetadata"),e("defineMetadata",A);function x(R,C,D){if(!se(C))throw new TypeError;return te(D)||(D=be(D)),ee(R,C,D)}a(x,"hasMetadata"),e("hasMetadata",x);function P(R,C,D){if(!se(C))throw new TypeError;return te(D)||(D=be(D)),pe(R,C,D)}a(P,"hasOwnMetadata"),e("hasOwnMetadata",P);function V(R,C,D){if(!se(C))throw new TypeError;return te(D)||(D=be(D)),Y(R,C,D)}a(V,"getMetadata"),e("getMetadata",V);function j(R,C,D){if(!se(C))throw new TypeError;return te(D)||(D=be(D)),Ee(R,C,D)}a(j,"getOwnMetadata"),e("getOwnMetadata",j);function $(R,C){if(!se(R))throw new TypeError;return te(C)||(C=be(C)),ne(R,C)}a($,"getMetadataKeys"),e("getMetadataKeys",$);function K(R,C){if(!se(R))throw new TypeError;return te(C)||(C=be(C)),de(R,C)}a(K,"getOwnMetadataKeys"),e("getOwnMetadataKeys",K);function N(R,C,D){if(!se(C))throw new TypeError;if(te(D)||(D=be(D)),!se(C))throw new TypeError;te(D)||(D=be(D));var b=$e(C,D,!1);return te(b)?!1:b.OrdinaryDeleteMetadata(R,C,D)}a(N,"deleteMetadata"),e("deleteMetadata",N);function ae(R,C){for(var D=R.length-1;D>=0;--D){var b=R[D],F=b(C);if(!te(F)&&!me(F)){if(!Fe(F))throw new TypeError;C=F}}return C}a(ae,"DecorateConstructor");function we(R,C,D,b){for(var F=R.length-1;F>=0;--F){var X=R[F],G=X(C,D,b);if(!te(G)&&!me(G)){if(!se(G))throw new TypeError;b=G}}return b}a(we,"DecorateProperty");function ee(R,C,D){var b=pe(R,C,D);if(b)return!0;var F=ke(C);return me(F)?!1:ee(R,F,D)}a(ee,"OrdinaryHasMetadata");function pe(R,C,D){var b=$e(C,D,!1);return te(b)?!1:Q(b.OrdinaryHasOwnMetadata(R,C,D))}a(pe,"OrdinaryHasOwnMetadata");function Y(R,C,D){var b=pe(R,C,D);if(b)return Ee(R,C,D);var F=ke(C);if(!me(F))return Y(R,F,D)}a(Y,"OrdinaryGetMetadata");function Ee(R,C,D){var b=$e(C,D,!1);if(!te(b))return b.OrdinaryGetOwnMetadata(R,C,D)}a(Ee,"OrdinaryGetOwnMetadata");function ie(R,C,D,b){var F=$e(D,b,!0);F.OrdinaryDefineOwnMetadata(R,C,D,b)}a(ie,"OrdinaryDefineOwnMetadata");function ne(R,C){var D=de(R,C),b=ke(R);if(b===null)return D;var F=ne(b,C);if(F.length<=0)return D;if(D.length<=0)return F;for(var X=new h,G=[],B=0,M=D;B<M.length;B++){var k=M[B],W=X.has(k);W||(X.add(k),G.push(k))}for(var H=0,oe=F;H<oe.length;H++){var k=oe[H],W=X.has(k);W||(X.add(k),G.push(k))}return G}a(ne,"OrdinaryMetadataKeys");function de(R,C){var D=$e(R,C,!1);return D?D.OrdinaryOwnMetadataKeys(R,C):[]}a(de,"OrdinaryOwnMetadataKeys");function ye(R){if(R===null)return 1;switch(typeof R){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return R===null?1:6;default:return 6}}a(ye,"Type");function te(R){return R===void 0}a(te,"IsUndefined");function me(R){return R===null}a(me,"IsNull");function Pe(R){return typeof R=="symbol"}a(Pe,"IsSymbol");function se(R){return typeof R=="object"?R!==null:typeof R=="function"}a(se,"IsObject");function _e(R,C){switch(ye(R)){case 0:return R;case 1:return R;case 2:return R;case 3:return R;case 4:return R;case 5:return R}var D=C===3?"string":C===5?"number":"default",b=Z(R,s);if(b!==void 0){var F=b.call(R,D);if(se(F))throw new TypeError;return F}return Ne(R,D==="default"?"number":D)}a(_e,"ToPrimitive");function Ne(R,C){if(C==="string"){var D=R.toString;if(Ce(D)){var b=D.call(R);if(!se(b))return b}var F=R.valueOf;if(Ce(F)){var b=F.call(R);if(!se(b))return b}}else{var F=R.valueOf;if(Ce(F)){var b=F.call(R);if(!se(b))return b}var X=R.toString;if(Ce(X)){var b=X.call(R);if(!se(b))return b}}throw new TypeError}a(Ne,"OrdinaryToPrimitive");function Q(R){return!!R}a(Q,"ToBoolean");function ce(R){return""+R}a(ce,"ToString");function be(R){var C=_e(R,3);return Pe(C)?C:ce(C)}a(be,"ToPropertyKey");function Ie(R){return Array.isArray?Array.isArray(R):R instanceof Object?R instanceof Array:Object.prototype.toString.call(R)==="[object Array]"}a(Ie,"IsArray");function Ce(R){return typeof R=="function"}a(Ce,"IsCallable");function Fe(R){return typeof R=="function"}a(Fe,"IsConstructor");function De(R){switch(ye(R)){case 3:return!0;case 4:return!0;default:return!1}}a(De,"IsPropertyKey");function Ae(R,C){return R===C||R!==R&&C!==C}a(Ae,"SameValueZero");function Z(R,C){var D=R[C];if(D!=null){if(!Ce(D))throw new TypeError;return D}}a(Z,"GetMethod");function he(R){var C=Z(R,o);if(!Ce(C))throw new TypeError;var D=C.call(R);if(!se(D))throw new TypeError;return D}a(he,"GetIterator");function Te(R){return R.value}a(Te,"IteratorValue");function xe(R){var C=R.next();return C.done?!1:C}a(xe,"IteratorStep");function je(R){var C=R.return;C&&C.call(R)}a(je,"IteratorClose");function ke(R){var C=Object.getPrototypeOf(R);if(typeof R!="function"||R===d||C!==d)return C;var D=R.prototype,b=D&&Object.getPrototypeOf(D);if(b==null||b===Object.prototype)return C;var F=b.constructor;return typeof F!="function"||F===R?C:F}a(ke,"OrdinaryGetPrototypeOf");function Ge(){var R;!te(y)&&typeof t.Reflect<"u"&&!(y in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(R=Ve(t.Reflect));var C,D,b,F=new _,X={registerProvider:G,getProvider:M,setProvider:W};return X;function G(H){if(!Object.isExtensible(X))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case R===H:break;case te(C):C=H;break;case C===H:break;case te(D):D=H;break;case D===H:break;default:b===void 0&&(b=new h),b.add(H);break}}function B(H,oe){if(!te(C)){if(C.isProviderFor(H,oe))return C;if(!te(D)){if(D.isProviderFor(H,oe))return C;if(!te(b))for(var ge=he(b);;){var Re=xe(ge);if(!Re)return;var rt=Te(Re);if(rt.isProviderFor(H,oe))return je(ge),rt}}}if(!te(R)&&R.isProviderFor(H,oe))return R}function M(H,oe){var ge=F.get(H),Re;return te(ge)||(Re=ge.get(oe)),te(Re)&&(Re=B(H,oe),te(Re)||(te(ge)&&(ge=new p,F.set(H,ge)),ge.set(oe,Re))),Re}function k(H){if(te(H))throw new TypeError;return C===H||D===H||!te(b)&&b.has(H)}function W(H,oe,ge){if(!k(ge))throw new Error("Metadata provider not registered.");var Re=M(H,oe);if(Re!==ge){if(!te(Re))return!1;var rt=F.get(H);te(rt)&&(rt=new p,F.set(H,rt)),rt.set(oe,ge)}return!0}}a(Ge,"CreateMetadataRegistry");function Me(){var R;return!te(y)&&se(t.Reflect)&&Object.isExtensible(t.Reflect)&&(R=t.Reflect[y]),te(R)&&(R=Ge()),!te(y)&&se(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:R}),R}a(Me,"GetOrCreateMetadataRegistry");function We(R){var C=new _,D={isProviderFor:a(function(k,W){var H=C.get(k);return te(H)?!1:H.has(W)},"isProviderFor"),OrdinaryDefineOwnMetadata:G,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:X,OrdinaryOwnMetadataKeys:B,OrdinaryDeleteMetadata:M};return S.registerProvider(D),D;function b(k,W,H){var oe=C.get(k),ge=!1;if(te(oe)){if(!H)return;oe=new p,C.set(k,oe),ge=!0}var Re=oe.get(W);if(te(Re)){if(!H)return;if(Re=new p,oe.set(W,Re),!R.setProvider(k,W,D))throw oe.delete(W),ge&&C.delete(k),new Error("Wrong provider for target.")}return Re}a(b,"GetOrCreateMetadataMap");function F(k,W,H){var oe=b(W,H,!1);return te(oe)?!1:Q(oe.has(k))}a(F,"OrdinaryHasOwnMetadata");function X(k,W,H){var oe=b(W,H,!1);if(!te(oe))return oe.get(k)}a(X,"OrdinaryGetOwnMetadata");function G(k,W,H,oe){var ge=b(H,oe,!0);ge.set(k,W)}a(G,"OrdinaryDefineOwnMetadata");function B(k,W){var H=[],oe=b(k,W,!1);if(te(oe))return H;for(var ge=oe.keys(),Re=he(ge),rt=0;;){var Vr=xe(Re);if(!Vr)return H.length=rt,H;var Er=Te(Vr);try{H[rt]=Er}catch(tr){try{je(Re)}finally{throw tr}}rt++}}a(B,"OrdinaryOwnMetadataKeys");function M(k,W,H){var oe=b(W,H,!1);if(te(oe)||!oe.delete(k))return!1;if(oe.size===0){var ge=C.get(W);te(ge)||(ge.delete(H),ge.size===0&&C.delete(ge))}return!0}a(M,"OrdinaryDeleteMetadata")}a(We,"CreateMetadataProvider");function Ve(R){var C=R.defineMetadata,D=R.hasOwnMetadata,b=R.getOwnMetadata,F=R.getOwnMetadataKeys,X=R.deleteMetadata,G=new _,B={isProviderFor:a(function(M,k){var W=G.get(M);return!te(W)&&W.has(k)?!0:F(M,k).length?(te(W)&&(W=new h,G.set(M,W)),W.add(k),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:C,OrdinaryHasOwnMetadata:D,OrdinaryGetOwnMetadata:b,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:X};return B}a(Ve,"CreateFallbackProvider");function $e(R,C,D){var b=S.getProvider(R,C);if(!te(b))return b;if(D){if(S.setProvider(R,C,w))return w;throw new Error("Illegal state.")}}a($e,"GetMetadataProvider");function He(){var R={},C=[],D=(function(){function B(M,k,W){this._index=0,this._keys=M,this._values=k,this._selector=W}return a(B,"MapIterator"),B.prototype["@@iterator"]=function(){return this},B.prototype[o]=function(){return this},B.prototype.next=function(){var M=this._index;if(M>=0&&M<this._keys.length){var k=this._selector(this._keys[M],this._values[M]);return M+1>=this._keys.length?(this._index=-1,this._keys=C,this._values=C):this._index++,{value:k,done:!1}}return{value:void 0,done:!0}},B.prototype.throw=function(M){throw this._index>=0&&(this._index=-1,this._keys=C,this._values=C),M},B.prototype.return=function(M){return this._index>=0&&(this._index=-1,this._keys=C,this._values=C),{value:M,done:!0}},B})(),b=(function(){function B(){this._keys=[],this._values=[],this._cacheKey=R,this._cacheIndex=-2}return a(B,"Map"),Object.defineProperty(B.prototype,"size",{get:a(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),B.prototype.has=function(M){return this._find(M,!1)>=0},B.prototype.get=function(M){var k=this._find(M,!1);return k>=0?this._values[k]:void 0},B.prototype.set=function(M,k){var W=this._find(M,!0);return this._values[W]=k,this},B.prototype.delete=function(M){var k=this._find(M,!1);if(k>=0){for(var W=this._keys.length,H=k+1;H<W;H++)this._keys[H-1]=this._keys[H],this._values[H-1]=this._values[H];return this._keys.length--,this._values.length--,Ae(M,this._cacheKey)&&(this._cacheKey=R,this._cacheIndex=-2),!0}return!1},B.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=R,this._cacheIndex=-2},B.prototype.keys=function(){return new D(this._keys,this._values,F)},B.prototype.values=function(){return new D(this._keys,this._values,X)},B.prototype.entries=function(){return new D(this._keys,this._values,G)},B.prototype["@@iterator"]=function(){return this.entries()},B.prototype[o]=function(){return this.entries()},B.prototype._find=function(M,k){if(!Ae(this._cacheKey,M)){this._cacheIndex=-1;for(var W=0;W<this._keys.length;W++)if(Ae(this._keys[W],M)){this._cacheIndex=W;break}}return this._cacheIndex<0&&k&&(this._cacheIndex=this._keys.length,this._keys.push(M),this._values.push(void 0)),this._cacheIndex},B})();return b;function F(B,M){return B}function X(B,M){return M}function G(B,M){return[B,M]}}a(He,"CreateMapPolyfill");function m(){var R=(function(){function C(){this._map=new p}return a(C,"Set"),Object.defineProperty(C.prototype,"size",{get:a(function(){return this._map.size},"get"),enumerable:!0,configurable:!0}),C.prototype.has=function(D){return this._map.has(D)},C.prototype.add=function(D){return this._map.set(D,D),this},C.prototype.delete=function(D){return this._map.delete(D)},C.prototype.clear=function(){this._map.clear()},C.prototype.keys=function(){return this._map.keys()},C.prototype.values=function(){return this._map.keys()},C.prototype.entries=function(){return this._map.entries()},C.prototype["@@iterator"]=function(){return this.keys()},C.prototype[o]=function(){return this.keys()},C})();return R}a(m,"CreateSetPolyfill");function L(){var R=16,C=f.create(),D=b();return(function(){function M(){this._key=b()}return a(M,"WeakMap"),M.prototype.has=function(k){var W=F(k,!1);return W!==void 0?f.has(W,this._key):!1},M.prototype.get=function(k){var W=F(k,!1);return W!==void 0?f.get(W,this._key):void 0},M.prototype.set=function(k,W){var H=F(k,!0);return H[this._key]=W,this},M.prototype.delete=function(k){var W=F(k,!1);return W!==void 0?delete W[this._key]:!1},M.prototype.clear=function(){this._key=b()},M})();function b(){var M;do M="@@WeakMap@@"+B();while(f.has(C,M));return C[M]=!0,M}function F(M,k){if(!n.call(M,D)){if(!k)return;Object.defineProperty(M,D,{value:f.create()})}return M[D]}function X(M,k){for(var W=0;W<k;++W)M[W]=Math.random()*255|0;return M}function G(M){if(typeof Uint8Array=="function"){var k=new Uint8Array(M);return typeof crypto<"u"?crypto.getRandomValues(k):typeof msCrypto<"u"?msCrypto.getRandomValues(k):X(k,M),k}return X(new Array(M),M)}function B(){var M=G(R);M[6]=M[6]&79|64,M[8]=M[8]&191|128;for(var k="",W=0;W<R;++W){var H=M[W];(W===4||W===6||W===8)&&(k+="-"),H<16&&(k+="0"),k+=H.toString(16).toLowerCase()}return k}}a(L,"CreateWeakMapPolyfill");function U(R){return R.__=void 0,delete R.__,R}a(U,"MakeDictionary")})})(HR||(HR={}))});var Uf=E(Gb=>{var Fh=class extends Error{static{a(this,"CommanderError")}constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},qb=class extends Fh{static{a(this,"InvalidArgumentError")}constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Gb.CommanderError=Fh;Gb.InvalidArgumentError=qb});var Lh=E(Hb=>{var{InvalidArgumentError:L6}=Uf(),Wb=class{static{a(this,"Argument")}constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:(t.push(e),t)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,n)=>{if(!this.argChoices.includes(t))throw new L6(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,n):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function N6(r){let e=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+e+">":"["+e+"]"}a(N6,"humanReadableArgName");Hb.Argument=Wb;Hb.humanReadableArgName=N6});var Yb=E(Kb=>{var{humanReadableArgName:k6}=Lh(),zb=class{static{a(this,"Help")}constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden),n=e._getHelpCommand();return n&&!n._hidden&&t.push(n),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let n=a(i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,""),"getSortKey");return n(e).localeCompare(n(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),n=e._getHelpOption();if(n&&!n.hidden){let i=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!i&&!s?t.push(n):n.long&&!s?t.push(e.createOption(n.long,n.description)):n.short&&!i&&t.push(e.createOption(n.short,n.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let n=e.parent;n;n=n.parent){let i=n.options.filter(s=>!s.hidden);t.push(...i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(n=>k6(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((n,i)=>Math.max(n,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let i=e.parent;i;i=i.parent)n=i.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatItemList(e,t,n){return t.length===0?[]:[n.styleTitle(e),...t,""]}groupItems(e,t,n){let i=new Map;return e.forEach(s=>{let o=n(s);i.has(o)||i.set(o,[])}),t.forEach(s=>{let o=n(s);i.has(o)||i.set(o,[]),i.get(o).push(s)}),i}formatHelp(e,t){let n=t.padWidth(e,t),i=t.helpWidth??80;function s(d,p){return t.formatItem(d,n,p,t)}a(s,"callFormatItem");let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],c=t.commandDescription(e);c.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(c),i),""]));let l=t.visibleArguments(e).map(d=>s(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",l,t)),this.groupItems(e.options,t.visibleOptions(e),d=>d.helpGroupHeading??"Options:").forEach((d,p)=>{let h=d.map(_=>s(t.styleOptionTerm(t.optionTerm(_)),t.styleOptionDescription(t.optionDescription(_))));o=o.concat(this.formatItemList(p,h,t))}),t.showGlobalOptions){let d=t.visibleGlobalOptions(e).map(p=>s(t.styleOptionTerm(t.optionTerm(p)),t.styleOptionDescription(t.optionDescription(p))));o=o.concat(this.formatItemList("Global Options:",d,t))}return this.groupItems(e.commands,t.visibleCommands(e),d=>d.helpGroup()||"Commands:").forEach((d,p)=>{let h=d.map(_=>s(t.styleSubcommandTerm(t.subcommandTerm(_)),t.styleSubcommandDescription(t.subcommandDescription(_))));o=o.concat(this.formatItemList(p,h,t))}),o.join(`
|
|
7
7
|
`)}displayWidth(e){return zR(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,n,i){let o=" ".repeat(2);if(!n)return o+e;let c=e.padEnd(t+e.length-i.displayWidth(e)),l=2,f=(this.helpWidth??80)-t-l-2,d;return f<this.minWidthToWrap||i.preformatted(n)?d=n:d=i.boxWrap(n,f).replace(/\n/g,`
|
|
8
8
|
`+" ".repeat(t+l)),o+c+" ".repeat(l)+d.replace(/\n/g,`
|
|
9
9
|
${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return n.forEach(o=>{let c=o.match(i);if(c===null){s.push("");return}let l=[c.shift()],u=this.displayWidth(l[0]);c.forEach(f=>{let d=this.displayWidth(f);if(u+d<=t){l.push(f),u+=d;return}s.push(l.join(""));let p=f.trimStart();l=[p],u=this.displayWidth(p)}),s.push(l.join(""))}),s.join(`
|
|
@@ -30,14 +30,14 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
|
|
|
30
30
|
Expecting one of '${n.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let o;typeof t=="function"?o=t({error:s.error,command:s.command}):o=t,o&&s.write(`${o}
|
|
31
31
|
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ZR(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,n="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],n=s[3],i=s[4]),t&&i!=="0"?`${t}=${n}:${parseInt(i)+1}`:e})}a(ZR,"incrementNodeInspectorPort");function nS(){if(_t.env.NO_COLOR||_t.env.FORCE_COLOR==="0"||_t.env.FORCE_COLOR==="false")return!1;if(_t.env.FORCE_COLOR||_t.env.CLICOLOR_FORCE!==void 0)return!0}a(nS,"useColor");iS.Command=rS;iS.useColor=nS});var iC=E(gi=>{var{Argument:tC}=Lh(),{Command:sS}=eC(),{CommanderError:z6,InvalidArgumentError:rC}=Uf(),{Help:K6}=Yb(),{Option:nC}=Zb();gi.program=new sS;gi.createCommand=r=>new sS(r);gi.createOption=(r,e)=>new nC(r,e);gi.createArgument=(r,e)=>new tC(r,e);gi.Command=sS;gi.Option=nC;gi.Argument=tC;gi.Help=K6;gi.CommanderError=z6;gi.InvalidArgumentError=rC;gi.InvalidOptionArgumentError=rC});var hc=E(kh=>{"use strict";Object.defineProperty(kh,"__esModule",{value:!0});kh.AssetClass=void 0;var oC;(function(r){r.AREA="ems__Area",r.TASK="ems__Task",r.PROJECT="ems__Project",r.ACTION="ems__Action",r.MEETING="ems__Meeting",r.INITIATIVE="ems__Initiative",r.TASK_PROTOTYPE="ems__TaskPrototype",r.MEETING_PROTOTYPE="ems__MeetingPrototype",r.EVENT_PROTOTYPE="exo__EventPrototype",r.PROJECT_PROTOTYPE="ems__ProjectPrototype",r.EVENT="exo__Event",r.DAILY_NOTE="pn__DailyNote",r.CONCEPT="ims__Concept",r.SESSION_START_EVENT="ems__SessionStartEvent",r.SESSION_END_EVENT="ems__SessionEndEvent",r.PROTOTYPE="exo__Prototype",r.CLASS="exo__Class",r.FLEETING_NOTE="ztlk__FleetingNote",r.WORKFLOW="ems__Workflow",r.WORKFLOW_STATE="ems__WorkflowState",r.WORKFLOW_TRANSITION="ems__WorkflowTransition",r.COMMAND="exocmd__Command",r.PRECONDITION="exocmd__Precondition",r.GROUNDING="exocmd__Grounding",r.COMMAND_BINDING="exocmd__CommandBinding"})(oC||(kh.AssetClass=oC={}))});var El=E(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.EffortStatus=void 0;var aC;(function(r){r.DRAFT="ems__EffortStatusDraft",r.BACKLOG="ems__EffortStatusBacklog",r.ANALYSIS="ems__EffortStatusAnalysis",r.TODO="ems__EffortStatusToDo",r.DOING="ems__EffortStatusDoing",r.DONE="ems__EffortStatusDone",r.TRASHED="ems__EffortStatusTrashed"})(aC||(Mh.EffortStatus=aC={}))});var oS=E(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.EFFORT_STATUS_OPTIONS=void 0;jh.EFFORT_STATUS_OPTIONS=[{value:"[[ems__EffortStatusDraft]]",label:"Draft"},{value:"[[ems__EffortStatusBacklog]]",label:"Backlog"},{value:"[[ems__EffortStatusAnalysis]]",label:"Analysis"},{value:"[[ems__EffortStatusToDo]]",label:"To Do"},{value:"[[ems__EffortStatusDoing]]",label:"Doing"},{value:"[[ems__EffortStatusDone]]",label:"Done"},{value:"[[ems__EffortStatusTrashed]]",label:"Trashed"}]});var da=E($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.GroundingType=void 0;var cC;(function(r){r.SPARQL_UPDATE="sparql_update",r.PROPERTY_DELETE="property_delete",r.PROPERTY_SET="property_set",r.COMPOSITE="composite",r.SERVICE_CALL="service_call",r.CREATE_INSTANCE="create_instance",r.PROPERTY_APPEND="property_append",r.PROPERTY_INCREMENT="property_increment",r.PROPERTY_SHIFT="property_shift",r.WORKFLOW_TRANSITION="workflow_transition",r.BODY_TEMPLATE="body_template"})(cC||($h.GroundingType=cC={}))});var Bf=E($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.GROUNDING_TYPE_IRI_TO_ENUM=$n.GROUNDING_TYPE_UID_TO_ENUM=$n.GROUNDING_TYPE_UIDS=void 0;$n.resolveGroundingTypeFromIRI=Q6;$n.resolveGroundingTypeFromWikilinkLiteral=X6;var Qt=da();$n.GROUNDING_TYPE_UIDS={[Qt.GroundingType.PROPERTY_SET]:"cf3bb923-f1f1-40be-b728-782844402426",[Qt.GroundingType.PROPERTY_DELETE]:"4bdf1d0b-e9da-4d96-bafe-c5aaef8c2bd5",[Qt.GroundingType.COMPOSITE]:"8f9a57db-3865-4886-92fb-c5ab7f3c3fa3",[Qt.GroundingType.SERVICE_CALL]:"9bf9fc99-ac37-4e51-b9f5-bd920099947c",[Qt.GroundingType.CREATE_INSTANCE]:"4367e2d6-6c92-450a-becb-abce1fb07682",[Qt.GroundingType.PROPERTY_APPEND]:"572f7e69-a8a1-42f6-8113-5aa65cc4b552",[Qt.GroundingType.PROPERTY_INCREMENT]:"afc29f90-45eb-4f94-9fe2-2ce738759161",[Qt.GroundingType.PROPERTY_SHIFT]:"f4e5266f-f3cc-49fd-a5a5-ce1e8b7847a4",[Qt.GroundingType.SPARQL_UPDATE]:"79c3e709-8d1d-4694-bcc6-b9ff07d59b86",[Qt.GroundingType.WORKFLOW_TRANSITION]:"5c1a2552-d576-496d-8823-563573dd1e2f",[Qt.GroundingType.BODY_TEMPLATE]:"6093bfcb-cf9b-4565-86c3-ff74d8bc11c0"};$n.GROUNDING_TYPE_UID_TO_ENUM=Object.freeze(Object.fromEntries(Object.entries($n.GROUNDING_TYPE_UIDS).map(([r,e])=>[e,r])));var Pi="https://exocortex.my/ontology/exocmd#";$n.GROUNDING_TYPE_IRI_TO_ENUM=Object.freeze({[`${Pi}GroundingTypePropertySet`]:Qt.GroundingType.PROPERTY_SET,[`${Pi}GroundingTypePropertyDelete`]:Qt.GroundingType.PROPERTY_DELETE,[`${Pi}GroundingTypeComposite`]:Qt.GroundingType.COMPOSITE,[`${Pi}GroundingTypeServiceCall`]:Qt.GroundingType.SERVICE_CALL,[`${Pi}GroundingTypeCreateInstance`]:Qt.GroundingType.CREATE_INSTANCE,[`${Pi}GroundingTypePropertyAppend`]:Qt.GroundingType.PROPERTY_APPEND,[`${Pi}GroundingTypePropertyIncrement`]:Qt.GroundingType.PROPERTY_INCREMENT,[`${Pi}GroundingTypePropertyShift`]:Qt.GroundingType.PROPERTY_SHIFT,[`${Pi}GroundingTypeSparqlUpdate`]:Qt.GroundingType.SPARQL_UPDATE,[`${Pi}GroundingTypeWorkflowTransition`]:Qt.GroundingType.WORKFLOW_TRANSITION,[`${Pi}GroundingTypeBodyTemplate`]:Qt.GroundingType.BODY_TEMPLATE});var Y6=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;function Q6(r){let e=$n.GROUNDING_TYPE_IRI_TO_ENUM[r];if(e!==void 0)return e;let t=r.match(Y6);return t?$n.GROUNDING_TYPE_UID_TO_ENUM[t[1].toLowerCase()]??null:null}a(Q6,"resolveGroundingTypeFromIRI");function X6(r){let e=r.match(/^\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\|[^\]]*)?\]\]$/i);return e?$n.GROUNDING_TYPE_UID_TO_ENUM[e[1].toLowerCase()]??null:null}a(X6,"resolveGroundingTypeFromWikilinkLiteral")});var aS=E(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.CommandBindingStyleProperty=yi.CommandBindingProperty=yi.GroundingProperty=yi.PreconditionProperty=yi.CommandProperty=void 0;yi.CommandProperty={ICON:"exocmd__Command_icon",PRECONDITION:"exocmd__Command_precondition",GROUNDING:"exocmd__Command_grounding",CONFIRM_MESSAGE:"exocmd__Command_confirmMessage",SUCCESS_MESSAGE:"exocmd__Command_successMessage",CATEGORY:"exocmd__Command_category",OPEN_IN_SAME_TAB:"exocmd__Command_openInSameTab"};yi.PreconditionProperty={SPARQL_ASK:"exocmd__Precondition_sparqlAsk",QUERY:"exocmd__Precondition_query"};yi.GroundingProperty={TYPE:"exocmd__Grounding_type",SPARQL_UPDATE:"exocmd__Grounding_sparqlUpdate",TARGET_PROPERTY:"exocmd__Grounding_targetProperty",STEPS:"exocmd__Grounding_steps",IS_DEFINED_BY:"exocmd__Grounding_isDefinedBy",LABEL_TEMPLATE:"exocmd__Grounding_labelTemplate"};yi.CommandBindingProperty={COMMAND:"exocmd__CommandBinding_command",TARGET_CLASS:"exocmd__CommandBinding_targetClass",TARGET_PROTOTYPE:"exocmd__CommandBinding_targetPrototype",TARGET_ASSET:"exocmd__CommandBinding_targetAsset",POSITION:"exocmd__CommandBinding_position",ORDER:"exocmd__CommandBinding_order",PRECONDITION:"exocmd__CommandBinding_precondition",STYLE:"exocmd__CommandBinding_style",VARIANT:"exocmd__CommandBinding_variant"};yi.CommandBindingStyleProperty={VARIANT:"exocmd__CommandBindingStyle_variant",SHOW_ICON:"exocmd__CommandBindingStyle_showIcon",LABEL_CLASS:"exocmd__CommandBindingStyle_labelClass",ARIA_LABEL:"exocmd__CommandBindingStyle_ariaLabel",TOOLTIP:"exocmd__CommandBindingStyle_tooltip",KEYBOARD_SHORTCUT:"exocmd__CommandBindingStyle_keyboardShortcut",SOURCE:"exocmd__CommandBindingStyle_source"}});var cS=E(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.STYLE_SOURCE_VALUES=Un.LABEL_CLASS_VALUES=Un.COMMAND_VARIANT_VALUES=void 0;Un.isCommandVariant=J6;Un.isLabelClass=Z6;Un.isStyleSource=eU;Un.COMMAND_VARIANT_VALUES=Object.freeze(["primary","secondary","success","warning","danger","muted"]);Un.LABEL_CLASS_VALUES=Object.freeze(["muted","bold","uppercase","compact"]);Un.STYLE_SOURCE_VALUES=Object.freeze(["vendor","user"]);function J6(r){return typeof r=="string"&&Un.COMMAND_VARIANT_VALUES.includes(r)}a(J6,"isCommandVariant");function Z6(r){return typeof r=="string"&&Un.LABEL_CLASS_VALUES.includes(r)}a(Z6,"isLabelClass");function eU(r){return typeof r=="string"&&Un.STYLE_SOURCE_VALUES.includes(r)}a(eU,"isStyleSource")});var lC=E(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.isCommandFrontmatter=tU;vl.isPreconditionFrontmatter=rU;vl.isGroundingFrontmatter=nU;vl.isCommandBindingFrontmatter=iU;function tU(r){return Uh(r,"exocmd__Command")}a(tU,"isCommandFrontmatter");function rU(r){return Uh(r,"exocmd__Precondition")}a(rU,"isPreconditionFrontmatter");function nU(r){return Uh(r,"exocmd__Grounding")}a(nU,"isGroundingFrontmatter");function iU(r){return Uh(r,"exocmd__CommandBinding")}a(iU,"isCommandBindingFrontmatter");function Uh(r,e){let t=r.exo__Instance_class;if(t==null)return!1;let n=Array.isArray(t)?t:[t];for(let i of n){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/);if((s?s[1]:i)===e)return!0}return!1}a(Uh,"hasInstanceClass")});var uC=E(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});uS.parseGroundingDefinitionFromFrontmatter=oU;var sU=Bf();function lS(r){if(typeof r!="string")return"";let e=r.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t>=0?e.slice(0,t).trim():e}a(lS,"normalizeGroundingRef");function oU(r,e,t){let n=e.exocmd__Grounding_type,i=(()=>{if(typeof n!="string")return n;let w=(0,sU.resolveGroundingTypeFromWikilinkLiteral)(n);if(w!==null)return w;throw new Error(`[exocmd-grounding-type-literal-form] legacy literal-string '${n}' for exocmd__Grounding_type in fixture ${r}. Migrate to wikilink form per RFC 9d20c91f Phase 3.`)})(),s=i==="service_call"?e.exocmd__Grounding_serviceId??e.exocmd__Grounding_targetProperty:e.exocmd__Grounding_targetProperty,o;if(i==="composite"){let w=e.exocmd__Grounding_steps;Array.isArray(w)&&(o=w.map(T=>t(lS(T))))}let c=e.exocmd__Grounding_incrementBy,l;if(c!=null&&c!==""){let w=Number.parseInt(String(c),10);Number.isFinite(w)&&(l=w)}let u=e.exocmd__Grounding_targetValueRef,f=u?lS(u):void 0,d=e.exocmd__Grounding_templateRef,p=d?lS(d):void 0,h=e.exocmd__Grounding_cloneTargetBody,_=h===!0||h==="true",y=e.exocmd__Grounding_targetsCreatedInstance,S=y===!0||y==="true";return{id:r,label:e.exo__Asset_label??"",type:i,targetProperty:s,targetValueRef:f,targetValueLiteral:e.exocmd__Grounding_targetValueLiteral,targetValueSubstitution:e.exocmd__Grounding_targetValueSubstitution,serviceCallPayload:e.exocmd__Grounding_serviceCallPayload,appendExpression:e.exocmd__Grounding_appendExpression,targetClass:e.exocmd__Grounding_targetClass,targetPrototype:e.exocmd__Grounding_targetPrototype,targetFolder:e.exocmd__Grounding_targetFolder,shiftDelta:e.exocmd__Grounding_shiftDelta,incrementBy:l,linkBackProperty:e.exocmd__Grounding_linkBackProperty,bodyTemplate:e.exocmd__Grounding_bodyTemplate,templateRef:p,cloneTargetBody:_,targetsCreatedInstance:S,steps:o}}a(oU,"parseGroundingDefinitionFromFrontmatter")});var fC=E(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.hasPosition=aU;Bh.isFixed=cU;function aU(r){return typeof r.x=="number"&&typeof r.y=="number"}a(aU,"hasPosition");function cU(r){return r.fx!==null&&r.fx!==void 0&&r.fy!==null&&r.fy!==void 0}a(cU,"isFixed")});var dC=E(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.createEmptyGraphData=lU;Vh.mergeGraphData=uU;function lU(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}a(lU,"createEmptyGraphData");function uU(r,e){let t=new Map,n=new Set,i=[];for(let s of r.nodes)t.set(s.id,s);for(let s of e.nodes)t.set(s.id,s);for(let s of r.edges){let o=`${s.source}->${s.target}:${s.type}`;n.has(o)||(n.add(o),i.push(s))}for(let s of e.edges){let o=`${s.source}->${s.target}:${s.type}`;n.has(o)||(n.add(o),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(r.version??0,e.version??0)+1}}a(uU,"mergeGraphData")});var fS=E(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.createEdgeId=fU;qh.edgesEqual=dU;function fU(r,e,t,n){let i=n?`|${n}`:"";return`${r}->${e}:${t}${i}`}a(fU,"createEdgeId");function dU(r,e){return r.source===e.source&&r.target===e.target&&r.type===e.type&&r.predicate===e.predicate}a(dU,"edgesEqual")});var dS=E(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.BUILT_IN_EDGE_STYLES=Xt.BUILT_IN_NODE_STYLES=Xt.DEFAULT_EDGE_STYLE=Xt.DEFAULT_NODE_STYLE=Xt.RDF_TYPE_PREDICATES=void 0;Xt.mergeNodeStyles=pU;Xt.mergeEdgeStyles=hU;Xt.extractLocalName=mU;Xt.isClassType=gU;Xt.isTypePredicate=yU;Xt.isSubClassPredicate=_U;Xt.RDF_TYPE_PREDICATES={RDF_TYPE:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",RDFS_CLASS:"http://www.w3.org/2000/01/rdf-schema#Class",OWL_CLASS:"http://www.w3.org/2002/07/owl#Class",RDFS_SUBCLASS_OF:"http://www.w3.org/2000/01/rdf-schema#subClassOf",OWL_EQUIVALENT_CLASS:"http://www.w3.org/2002/07/owl#equivalentClass",RDFS_LABEL:"http://www.w3.org/2000/01/rdf-schema#label",RDFS_COMMENT:"http://www.w3.org/2000/01/rdf-schema#comment"};Xt.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};Xt.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};Xt.BUILT_IN_NODE_STYLES={"http://www.w3.org/2000/01/rdf-schema#Class":{color:"#f59e0b",shape:"diamond",size:40},"http://www.w3.org/2002/07/owl#Class":{color:"#f59e0b",shape:"diamond",size:40},ems__Task:{color:"#22c55e",shape:"circle"},ems__Project:{color:"#3b82f6",shape:"square"},ems__Area:{color:"#8b5cf6",shape:"hexagon",size:40},ems__Meeting:{color:"#ec4899",shape:"circle"},exo__Class:{color:"#f59e0b",shape:"diamond"},person__Person:{color:"#06b6d4",shape:"circle"},ims__Person:{color:"#06b6d4",shape:"circle"}};Xt.BUILT_IN_EDGE_STYLES={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":{color:"#f59e0b",lineStyle:"dashed",arrow:"standard"},"http://www.w3.org/2000/01/rdf-schema#subClassOf":{color:"#8b5cf6",width:2,arrow:"triangle"},"https://exocortex.my/ontology/ems#Effort_parent":{color:"#6366f1",width:2,arrow:"standard"},"https://exocortex.my/ontology/exo#Asset_prototype":{color:"#f59e0b",lineStyle:"dashed",arrow:"circle"},"https://exocortex.my/ontology/exo#references":{color:"#22c55e",opacity:.4,arrow:"standard"}};function pU(r,e){return{...r,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(pU,"mergeNodeStyles");function hU(r,e){return{...r,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(hU,"mergeEdgeStyles");function mU(r){let e=r.lastIndexOf("#"),t=r.lastIndexOf("/"),n=Math.max(e,t);return n>=0?r.substring(n+1):r}a(mU,"extractLocalName");function gU(r){return r===Xt.RDF_TYPE_PREDICATES.RDFS_CLASS||r===Xt.RDF_TYPE_PREDICATES.OWL_CLASS}a(gU,"isClassType");function yU(r){return r===Xt.RDF_TYPE_PREDICATES.RDF_TYPE}a(yU,"isTypePredicate");function _U(r){return r===Xt.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}a(_U,"isSubClassPredicate")});var hC=E(pC=>{"use strict";Object.defineProperty(pC,"__esModule",{value:!0})});var Ke=E(Gh=>{"use strict";Object.defineProperty(Gh,"__esModule",{value:!0});Gh.IRI=void 0;var pS=class r{static{a(this,"IRI")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("IRI cannot be empty");if(!r.isValidIRI(t))throw new Error("Invalid IRI format");this._value=t}get value(){return this._value}equals(e){return this._value===e._value}toString(){return this._value}static isValidIRI(e){if(!e||e.trim().length===0||/\s/.test(e)||!/^[a-z][a-z0-9+.-]*:/i.test(e))return!1;let n=["http","https","ftp","ftps","file","mailto","tel","data","ws","wss","urn","obsidian"],i=e.match(/^([a-z][a-z0-9+.-]*?):/i);if(i){let s=i[1].toLowerCase();if(!n.includes(s))return!1}try{return new URL(e),!0}catch{return/^urn:[a-z0-9][a-z0-9-]{0,31}:[^\s]+$/i.test(e)}}};Gh.IRI=pS});var tt=E(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.Literal=void 0;mc.parseLanguageTag=mC;mc.createDirectionalLiteral=SU;mc.createLiteralFromLanguageTag=wU;var bU="http://www.w3.org/2001/XMLSchema#string",Vf=class{static{a(this,"Literal")}constructor(e,t,n,i){if(e.length===0)throw new Error("Literal value cannot be empty");if(t&&n)throw new Error("Literal cannot have both datatype and language tag");if(i&&!n)throw new Error("Literal cannot have direction without language tag");if(i&&i!=="ltr"&&i!=="rtl")throw new Error('Direction must be "ltr" or "rtl"');this._value=e,this._datatype=t,this._language=n?n.toLowerCase():void 0,this._direction=i}get value(){return this._value}get datatype(){return this._datatype}get language(){return this._language}get direction(){return this._direction}hasDirection(){return this._direction!==void 0}equals(e){if(this._value!==e._value||this._language!==e._language||this._direction!==e._direction)return!1;let t=this.normalizedDatatype(),n=e.normalizedDatatype();return t===n}normalizedDatatype(){return!this._datatype||this._datatype.value===bU?null:this._datatype.value}toString(){let e=`"${this._value}"`;return this._datatype?e+=`^^<${this._datatype.value}>`:this._language&&(e+=`@${this._language}`,this._direction&&(e+=`--${this._direction}`)),e}};mc.Literal=Vf;function mC(r){let t=r.lastIndexOf("--");if(t===-1)return{language:r.toLowerCase()};let n=r.substring(t+2),i=r.substring(0,t);return n==="ltr"||n==="rtl"?{language:i.toLowerCase(),direction:n}:{language:r.toLowerCase()}}a(mC,"parseLanguageTag");function SU(r,e,t){return new Vf(r,void 0,e,t)}a(SU,"createDirectionalLiteral");function wU(r,e){let{language:t,direction:n}=mC(e);return new Vf(r,void 0,t,n)}a(wU,"createLiteralFromLanguageTag")});var qt=E(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});Hh.BlankNode=void 0;var Wh=class r{static{a(this,"BlankNode")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("BlankNode id cannot be empty");this._id=t}get id(){return this._id}equals(e){return this._id===e._id}toString(){return`_:${this._id}`}static generateId(){return`b${++r.counter}`}static create(){return new r(r.generateId())}};Hh.BlankNode=Wh;Wh.counter=0});var Jt=E(zh=>{"use strict";Object.defineProperty(zh,"__esModule",{value:!0});zh.Namespace=void 0;var gC=Ke(),at=class r{static{a(this,"Namespace")}constructor(e,t){if(e.trim().length===0)throw new Error("Namespace prefix cannot be empty");this._prefix=e,this._iri=new gC.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new gC.IRI(`${this._iri.value}${e}`)}expand(e){let t=e.split(":");if(t.length!==2)return null;let[n,i]=t;return n!==this._prefix?null:this.term(i)}static forPrefix(e){if(!/^[a-z][a-zA-Z0-9]*$/.test(e))return null;let t=r.KNOWN_NAMESPACES.find(n=>n.prefix===e);return t||new r(e,`${r.EXOCORTEX_ONTOLOGY_BASE}${e}#`)}static fromPropertyKey(e){let t=/^([a-z][a-zA-Z0-9]*)__(.+)$/.exec(e);if(!t)return null;let n=r.forPrefix(t[1]);return n?{namespace:n,localName:t[2]}:null}};zh.Namespace=at;at.RDF=new at("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");at.RDFS=new at("rdfs","http://www.w3.org/2000/01/rdf-schema#");at.OWL=new at("owl","http://www.w3.org/2002/07/owl#");at.XSD=new at("xsd","http://www.w3.org/2001/XMLSchema#");at.EXO=new at("exo","https://exocortex.my/ontology/exo#");at.EMS=new at("ems","https://exocortex.my/ontology/ems#");at.EXOCMD=new at("exocmd","https://exocortex.my/ontology/exocmd#");at.IMS=new at("ims","https://exocortex.my/ontology/ims#");at.ZTLK=new at("ztlk","https://exocortex.my/ontology/ztlk#");at.PTMS=new at("ptms","https://exocortex.my/ontology/ptms#");at.LIT=new at("lit","https://exocortex.my/ontology/lit#");at.INBOX=new at("inbox","https://exocortex.my/ontology/inbox#");at.PMBOK=new at("pmbok","https://exocortex.my/ontology/pmbok#");at.EXOCORTEX_ONTOLOGY_BASE="https://exocortex.my/ontology/";at.KNOWN_NAMESPACES=[at.EXO,at.EMS,at.EXOCMD,at.IMS,at.ZTLK,at.PTMS,at.LIT,at.INBOX,at.PMBOK]});var ri=E(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});Kh.Triple=void 0;var hS=Ke(),mS=tt(),gS=qt(),yS=class{static{a(this,"Triple")}constructor(e,t,n){this._subject=e,this._predicate=t,this._object=n}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof hS.IRI&&t instanceof hS.IRI||e instanceof gS.BlankNode&&t instanceof gS.BlankNode||e instanceof mS.Literal&&t instanceof mS.Literal||this.isQuotedTriple(e)&&this.isQuotedTriple(t)?e.equals(t):!1}isQuotedTriple(e){return typeof e=="object"&&e!==null&&"termType"in e&&e.termType==="QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,n=this.nodeToString(this._object);return`${e} ${t} ${n} .`}nodeToString(e){return e instanceof hS.IRI?`<${e.value}>`:e instanceof gS.BlankNode||e instanceof mS.Literal||this.isQuotedTriple(e)?e.toString():""}};Kh.Triple=yS});var qf=E(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.QuotedTriple=void 0;var _S=Ke(),bS=tt(),SS=qt(),wS=class r{static{a(this,"QuotedTriple")}constructor(e,t,n){this._subject=e,this._predicate=t,this._object=n}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof _S.IRI&&t instanceof _S.IRI||e instanceof SS.BlankNode&&t instanceof SS.BlankNode||e instanceof bS.Literal&&t instanceof bS.Literal||e instanceof r&&t instanceof r?e.equals(t):!1}get termType(){return"QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,n=this.nodeToString(this._object);return`<< ${e} ${t} ${n} >>`}nodeToString(e){return e instanceof _S.IRI?`<${e.value}>`:e instanceof SS.BlankNode||e instanceof bS.Literal||e instanceof r?e.toString():""}};Yh.QuotedTriple=wS});var yC=E(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.QuotedTriple=ur.Triple=ur.Namespace=ur.BlankNode=ur.createLiteralFromLanguageTag=ur.createDirectionalLiteral=ur.parseLanguageTag=ur.Literal=ur.IRI=void 0;var EU=Ke();Object.defineProperty(ur,"IRI",{enumerable:!0,get:a(function(){return EU.IRI},"get")});var Qh=tt();Object.defineProperty(ur,"Literal",{enumerable:!0,get:a(function(){return Qh.Literal},"get")});Object.defineProperty(ur,"parseLanguageTag",{enumerable:!0,get:a(function(){return Qh.parseLanguageTag},"get")});Object.defineProperty(ur,"createDirectionalLiteral",{enumerable:!0,get:a(function(){return Qh.createDirectionalLiteral},"get")});Object.defineProperty(ur,"createLiteralFromLanguageTag",{enumerable:!0,get:a(function(){return Qh.createLiteralFromLanguageTag},"get")});var vU=qt();Object.defineProperty(ur,"BlankNode",{enumerable:!0,get:a(function(){return vU.BlankNode},"get")});var TU=Jt();Object.defineProperty(ur,"Namespace",{enumerable:!0,get:a(function(){return TU.Namespace},"get")});var AU=ri();Object.defineProperty(ur,"Triple",{enumerable:!0,get:a(function(){return AU.Triple},"get")});var IU=qf();Object.defineProperty(ur,"QuotedTriple",{enumerable:!0,get:a(function(){return IU.QuotedTriple},"get")})});var Xh=E(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.UUID_URL_NAMESPACE=bi.DEFAULT_LANGUAGE_TAG=bi.REQUIRED_PROPERTIES=bi.ALLOWED_PROPERTIES=bi.Exo003MetadataType=void 0;var _i;(function(r){r.Namespace="namespace",r.Anchor="anchor",r.BlankNode="blank_node",r.Statement="statement",r.Body="body"})(_i||(bi.Exo003MetadataType=_i={}));bi.ALLOWED_PROPERTIES={[_i.Namespace]:["metadata","uri","aliases"],[_i.Anchor]:["metadata","uri","aliases"],[_i.BlankNode]:["metadata","uri","aliases"],[_i.Statement]:["metadata","subject","predicate","object","aliases"],[_i.Body]:["metadata","subject","predicate","aliases"]};bi.REQUIRED_PROPERTIES={[_i.Namespace]:["metadata","uri"],[_i.Anchor]:["metadata","uri"],[_i.BlankNode]:["metadata","uri"],[_i.Statement]:["metadata","subject","predicate","object"],[_i.Body]:["metadata","subject","predicate"]};bi.DEFAULT_LANGUAGE_TAG="ru";bi.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var _C=E(ES=>{"use strict";Object.defineProperty(ES,"__esModule",{value:!0});ES.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var bC=E(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});vS.default="00000000-0000-0000-0000-000000000000"});var SC=E(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});TS.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var Gf=E(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var xU=SC();function RU(r){return typeof r=="string"&&xU.default.test(r)}a(RU,"validate");AS.default=RU});var Wf=E(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});var CU=Gf();function OU(r){if(!(0,CU.default)(r))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(r.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(r.slice(9,13),16))>>>8,e&255,(e=parseInt(r.slice(14,18),16))>>>8,e&255,(e=parseInt(r.slice(19,23),16))>>>8,e&255,(e=parseInt(r.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}a(OU,"parse");IS.default=OU});var po=E(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.unsafeStringify=void 0;var PU=Gf(),Wr=[];for(let r=0;r<256;++r)Wr.push((r+256).toString(16).slice(1));function wC(r,e=0){return(Wr[r[e+0]]+Wr[r[e+1]]+Wr[r[e+2]]+Wr[r[e+3]]+"-"+Wr[r[e+4]]+Wr[r[e+5]]+"-"+Wr[r[e+6]]+Wr[r[e+7]]+"-"+Wr[r[e+8]]+Wr[r[e+9]]+"-"+Wr[r[e+10]]+Wr[r[e+11]]+Wr[r[e+12]]+Wr[r[e+13]]+Wr[r[e+14]]+Wr[r[e+15]]).toLowerCase()}a(wC,"unsafeStringify");Hf.unsafeStringify=wC;function DU(r,e=0){let t=wC(r,e);if(!(0,PU.default)(t))throw TypeError("Stringified UUID is invalid");return t}a(DU,"stringify");Hf.default=DU});var em=E(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var FU=require("crypto"),Zh=new Uint8Array(256),Jh=Zh.length;function LU(){return Jh>Zh.length-16&&((0,FU.randomFillSync)(Zh),Jh=0),Zh.slice(Jh,Jh+=16)}a(LU,"rng");xS.default=LU});var RS=E(Kf=>{"use strict";Object.defineProperty(Kf,"__esModule",{value:!0});Kf.updateV1State=void 0;var EC=em(),NU=po(),zf={};function kU(r,e,t){let n,i=r?._v6??!1;if(r){let s=Object.keys(r);s.length===1&&s[0]==="_v6"&&(r=void 0)}if(r)n=vC(r.random??r.rng?.()??(0,EC.default)(),r.msecs,r.nsecs,r.clockseq,r.node,e,t);else{let s=Date.now(),o=(0,EC.default)();TC(zf,s,o),n=vC(o,zf.msecs,zf.nsecs,i?void 0:zf.clockseq,i?void 0:zf.node,e,t)}return e??(0,NU.unsafeStringify)(n)}a(kU,"v1");function TC(r,e,t){return r.msecs??=-1/0,r.nsecs??=0,e===r.msecs?(r.nsecs++,r.nsecs>=1e4&&(r.node=void 0,r.nsecs=0)):e>r.msecs?r.nsecs=0:e<r.msecs&&(r.node=void 0),r.node||(r.node=t.slice(10,16),r.node[0]|=1,r.clockseq=(t[8]<<8|t[9])&16383),r.msecs=e,r}a(TC,"updateV1State");Kf.updateV1State=TC;function vC(r,e,t,n,i,s,o=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!s)s=new Uint8Array(16),o=0;else if(o<0||o+16>s.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);e??=Date.now(),t??=0,n??=(r[8]<<8|r[9])&16383,i??=r.slice(10,16),e+=122192928e5;let c=((e&268435455)*1e4+t)%4294967296;s[o++]=c>>>24&255,s[o++]=c>>>16&255,s[o++]=c>>>8&255,s[o++]=c&255;let l=e/4294967296*1e4&268435455;s[o++]=l>>>8&255,s[o++]=l&255,s[o++]=l>>>24&15|16,s[o++]=l>>>16&255,s[o++]=n>>>8|128,s[o++]=n&255;for(let u=0;u<6;++u)s[o++]=i[u];return s}a(vC,"v1Bytes");Kf.default=kU});var OS=E(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var MU=Wf(),jU=po();function $U(r){let e=typeof r=="string"?(0,MU.default)(r):r,t=UU(e);return typeof r=="string"?(0,jU.unsafeStringify)(t):t}a($U,"v1ToV6");CS.default=$U;function UU(r){return Uint8Array.of((r[6]&15)<<4|r[7]>>4&15,(r[7]&15)<<4|(r[4]&240)>>4,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,(r[1]&15)<<4|(r[2]&240)>>4,96|r[2]&15,r[3],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}a(UU,"_v1ToV6")});var AC=E(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var BU=require("crypto");function VU(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),(0,BU.createHash)("md5").update(r).digest()}a(VU,"md5");PS.default=VU});var Yf=E(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.URL=ho.DNS=ho.stringToBytes=void 0;var IC=Wf(),qU=po();function xC(r){r=unescape(encodeURIComponent(r));let e=new Uint8Array(r.length);for(let t=0;t<r.length;++t)e[t]=r.charCodeAt(t);return e}a(xC,"stringToBytes");ho.stringToBytes=xC;ho.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";ho.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function GU(r,e,t,n,i,s){let o=typeof t=="string"?xC(t):t,c=typeof n=="string"?(0,IC.default)(n):n;if(typeof n=="string"&&(n=(0,IC.default)(n)),n?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+o.length);if(l.set(c),l.set(o,c.length),l=e(l),l[6]=l[6]&15|r,l[8]=l[8]&63|128,i){if(s=s||0,s<0||s+16>i.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,qU.unsafeStringify)(l)}a(GU,"v35");ho.default=GU});var CC=E(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.URL=gc.DNS=void 0;var WU=AC(),DS=Yf(),RC=Yf();Object.defineProperty(gc,"DNS",{enumerable:!0,get:a(function(){return RC.DNS},"get")});Object.defineProperty(gc,"URL",{enumerable:!0,get:a(function(){return RC.URL},"get")});function FS(r,e,t,n){return(0,DS.default)(48,WU.default,r,e,t,n)}a(FS,"v3");FS.DNS=DS.DNS;FS.URL=DS.URL;gc.default=FS});var OC=E(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var HU=require("crypto");LS.default={randomUUID:HU.randomUUID}});var DC=E(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var PC=OC(),zU=em(),KU=po();function YU(r,e,t){if(PC.default.randomUUID&&!e&&!r)return PC.default.randomUUID();r=r||{};let n=r.random??r.rng?.()??(0,zU.default)();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=n[i];return e}return(0,KU.unsafeStringify)(n)}a(YU,"v4");NS.default=YU});var FC=E(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var QU=require("crypto");function XU(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),(0,QU.createHash)("sha1").update(r).digest()}a(XU,"sha1");kS.default=XU});var NC=E(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.URL=yc.DNS=void 0;var JU=FC(),MS=Yf(),LC=Yf();Object.defineProperty(yc,"DNS",{enumerable:!0,get:a(function(){return LC.DNS},"get")});Object.defineProperty(yc,"URL",{enumerable:!0,get:a(function(){return LC.URL},"get")});function jS(r,e,t,n){return(0,MS.default)(80,JU.default,r,e,t,n)}a(jS,"v5");jS.DNS=MS.DNS;jS.URL=MS.URL;yc.default=jS});var kC=E($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var ZU=po(),eB=RS(),tB=OS();function rB(r,e,t){r??={},t??=0;let n=(0,eB.default)({...r,_v6:!0},new Uint8Array(16));if(n=(0,tB.default)(n),e){if(t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;i++)e[t+i]=n[i];return e}return(0,ZU.unsafeStringify)(n)}a(rB,"v6");$S.default=rB});var MC=E(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var nB=Wf(),iB=po();function sB(r){let e=typeof r=="string"?(0,nB.default)(r):r,t=oB(e);return typeof r=="string"?(0,iB.unsafeStringify)(t):t}a(sB,"v6ToV1");US.default=sB;function oB(r){return Uint8Array.of((r[3]&15)<<4|r[4]>>4&15,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|r[6]&15,r[7],(r[1]&15)<<4|(r[2]&240)>>4,(r[2]&15)<<4|(r[3]&240)>>4,16|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}a(oB,"_v6ToV1")});var BC=E(Qf=>{"use strict";Object.defineProperty(Qf,"__esModule",{value:!0});Qf.updateV7State=void 0;var jC=em(),aB=po(),BS={};function cB(r,e,t){let n;if(r)n=$C(r.random??r.rng?.()??(0,jC.default)(),r.msecs,r.seq,e,t);else{let i=Date.now(),s=(0,jC.default)();UC(BS,i,s),n=$C(s,BS.msecs,BS.seq,e,t)}return e??(0,aB.unsafeStringify)(n)}a(cB,"v7");function UC(r,e,t){return r.msecs??=-1/0,r.seq??=0,e>r.msecs?(r.seq=t[6]<<23|t[7]<<16|t[8]<<8|t[9],r.msecs=e):(r.seq=r.seq+1|0,r.seq===0&&r.msecs++),r}a(UC,"updateV7State");Qf.updateV7State=UC;function $C(r,e,t,n,i=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return e??=Date.now(),t??=r[6]*127<<24|r[7]<<16|r[8]<<8|r[9],n[i++]=e/1099511627776&255,n[i++]=e/4294967296&255,n[i++]=e/16777216&255,n[i++]=e/65536&255,n[i++]=e/256&255,n[i++]=e&255,n[i++]=112|t>>>28&15,n[i++]=t>>>20&255,n[i++]=128|t>>>14&63,n[i++]=t>>>6&255,n[i++]=t<<2&255|r[10]&3,n[i++]=r[11],n[i++]=r[12],n[i++]=r[13],n[i++]=r[14],n[i++]=r[15],n}a($C,"v7Bytes");Qf.default=cB});var VC=E(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var lB=Gf();function uB(r){if(!(0,lB.default)(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}a(uB,"version");VS.default=uB});var Di=E(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.version=St.validate=St.v7=St.v6ToV1=St.v6=St.v5=St.v4=St.v3=St.v1ToV6=St.v1=St.stringify=St.parse=St.NIL=St.MAX=void 0;var fB=_C();Object.defineProperty(St,"MAX",{enumerable:!0,get:a(function(){return fB.default},"get")});var dB=bC();Object.defineProperty(St,"NIL",{enumerable:!0,get:a(function(){return dB.default},"get")});var pB=Wf();Object.defineProperty(St,"parse",{enumerable:!0,get:a(function(){return pB.default},"get")});var hB=po();Object.defineProperty(St,"stringify",{enumerable:!0,get:a(function(){return hB.default},"get")});var mB=RS();Object.defineProperty(St,"v1",{enumerable:!0,get:a(function(){return mB.default},"get")});var gB=OS();Object.defineProperty(St,"v1ToV6",{enumerable:!0,get:a(function(){return gB.default},"get")});var yB=CC();Object.defineProperty(St,"v3",{enumerable:!0,get:a(function(){return yB.default},"get")});var _B=DC();Object.defineProperty(St,"v4",{enumerable:!0,get:a(function(){return _B.default},"get")});var bB=NC();Object.defineProperty(St,"v5",{enumerable:!0,get:a(function(){return bB.default},"get")});var SB=kC();Object.defineProperty(St,"v6",{enumerable:!0,get:a(function(){return SB.default},"get")});var wB=MC();Object.defineProperty(St,"v6ToV1",{enumerable:!0,get:a(function(){return wB.default},"get")});var EB=BC();Object.defineProperty(St,"v7",{enumerable:!0,get:a(function(){return EB.default},"get")});var vB=Gf();Object.defineProperty(St,"validate",{enumerable:!0,get:a(function(){return vB.default},"get")});var TB=VC();Object.defineProperty(St,"version",{enumerable:!0,get:a(function(){return TB.default},"get")})});var WS=E(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.Exo003UUIDGenerator=void 0;var qS=Di(),qC=Xh(),GS=class{static{a(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,qS.v5)(e,qC.UUID_URL_NAMESPACE)}static generateAssetUUID(e,t){if(!t||t.trim().length===0)throw new Error("Local identifier cannot be empty");let n=this.generateNamespaceUUID(e);return(0,qS.v5)(t,n)}static generateFromIRI(e){if(!e||e.trim().length===0)throw new Error("IRI cannot be empty");let{namespace:t,localName:n}=this.splitIRI(e);return n?this.generateAssetUUID(t,n):(0,qS.v5)(e,qC.UUID_URL_NAMESPACE)}static generateBlankNodeUUID(e,t){if(!e||e.trim().length===0)throw new Error("Blank node ID cannot be empty");let n="urn:exocortex:blank-node:",i=t?`${t}#${e}`:e;return this.generateAssetUUID(n,i)}static generateStatementUUID(e,t,n){if(!e||!t||!n)throw new Error("Subject, predicate, and object cannot be empty");let i="urn:exocortex:statement:",s=`${e} ${t} ${n}`;return this.generateAssetUUID(i,s)}static generateBodyUUID(e,t){let n="urn:exocortex:body:",i=e;return t?.datatype?i+=`^^${t.datatype}`:t?.language&&(i+=`@${t.language}`,t.direction&&(i+=`--${t.direction}`)),this.generateAssetUUID(n,i)}static splitIRI(e){let t=e.lastIndexOf("#");if(t!==-1&&t<e.length-1)return{namespace:e.substring(0,t+1),localName:e.substring(t+1)};let n=e.lastIndexOf("/"),i=e.indexOf("://");return n!==-1&&n>i+2&&n<e.length-1?{namespace:e.substring(0,n+1),localName:e.substring(n+1)}:{namespace:e,localName:""}}static isValidUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};tm.Exo003UUIDGenerator=GS});var WC=E(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.Exo003Parser=void 0;var It=Xh(),Xf=WS(),pa=Ke(),rm=tt(),GC=qt(),AB=ri(),HS=class{static{a(this,"Exo003Parser")}static parse(e,t){let n=this.validate(e);if(!n.valid)return{success:!1,errors:n.errors};let i=e.metadata;try{return{success:!0,metadata:this.parseByType(e,i),bodyContent:i===It.Exo003MetadataType.Body?t:void 0}}catch(s){return{success:!1,errors:[s instanceof Error?s.message:String(s)]}}}static validate(e){let t=[],n=[];if(!e.metadata)return t.push("Missing required property: metadata"),{valid:!1,errors:t,warnings:n};let i=e.metadata;if(!Object.values(It.Exo003MetadataType).includes(i))return t.push(`Invalid metadata: ${i}. Valid types: ${Object.values(It.Exo003MetadataType).join(", ")}`),{valid:!1,errors:t,warnings:n};let s=i,o=It.ALLOWED_PROPERTIES[s],c=It.REQUIRED_PROPERTIES[s];for(let l of c)(e[l]===void 0||e[l]===null)&&t.push(`Missing required property: ${l}`);for(let l of Object.keys(e))o.includes(l)||t.push(`Forbidden property for ${s}: ${l}`);switch(s){case It.Exo003MetadataType.Namespace:this.validateNamespaceMetadata(e,t);break;case It.Exo003MetadataType.Anchor:this.validateAnchorMetadata(e,t);break;case It.Exo003MetadataType.BlankNode:this.validateBlankNodeMetadata(e,t);break;case It.Exo003MetadataType.Statement:this.validateStatementMetadata(e,t);break;case It.Exo003MetadataType.Body:this.validateBodyMetadata(e,t,n);break}return{valid:t.length===0,errors:t,warnings:n}}static parseByType(e,t){let n={metadata:t,aliases:e.aliases};switch(t){case It.Exo003MetadataType.Namespace:return{...n,metadata:It.Exo003MetadataType.Namespace,uri:e.uri};case It.Exo003MetadataType.Anchor:return{...n,metadata:It.Exo003MetadataType.Anchor,uri:e.uri};case It.Exo003MetadataType.BlankNode:return{...n,metadata:It.Exo003MetadataType.BlankNode,uri:e.uri};case It.Exo003MetadataType.Statement:return{...n,metadata:It.Exo003MetadataType.Statement,subject:e.subject,predicate:e.predicate,object:e.object};case It.Exo003MetadataType.Body:return{...n,metadata:It.Exo003MetadataType.Body,subject:e.subject,predicate:e.predicate}}}static validateNamespaceMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n)try{new pa.IRI(n)}catch{t.push(`uri is not a valid IRI: ${String(n)}`)}}static validateAnchorMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n)try{new pa.IRI(n)}catch{t.push(`uri is not a valid IRI: ${String(n)}`)}}static validateBlankNodeMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n){let i=n;if(!i.startsWith("_:"))try{new pa.IRI(i)}catch{t.push(`uri is not a valid IRI or blank node identifier: ${String(n)}`)}}}static validateStatementMetadata(e,t){let n=e.subject,i=e.predicate,s=e.object,o=[["subject",n],["predicate",i],["object",s]];for(let[c,l]of o)l&&typeof l!="string"&&t.push(`${c} must be a string`)}static validateBodyMetadata(e,t,n){let i=e.subject,s=e.predicate;i&&typeof i!="string"&&t.push("subject must be a string"),s&&typeof s!="string"&&t.push("predicate must be a string")}static toTriple(e,t,n){let i=t(e.subject),s;if(i.type==="iri")s=new pa.IRI(i.value);else if(i.type==="blank")s=new GC.BlankNode(i.value);else throw new Error("Statement subject cannot be a literal");let o=t(e.predicate);if(o.type!=="iri")throw new Error("Statement predicate must be an IRI");let c=new pa.IRI(o.value),l=t(e.object),u;if(l.type==="iri")u=new pa.IRI(l.value);else if(l.type==="blank")u=new GC.BlankNode(l.value);else{let f=n||l.value;if(l.datatype)u=new rm.Literal(f,new pa.IRI(l.datatype));else{let d=l.language||It.DEFAULT_LANGUAGE_TAG;u=(0,rm.createDirectionalLiteral)(f,d,l.direction)}}return new AB.Triple(s,c,u)}static toLiteral(e,t,n){if(n?.datatype)return new rm.Literal(t,new pa.IRI(n.datatype));let i=n?.language||It.DEFAULT_LANGUAGE_TAG;return(0,rm.createDirectionalLiteral)(t,i,n?.direction)}static isExo003Format(e){let t=e.metadata;return typeof t=="string"&&Object.values(It.Exo003MetadataType).includes(t)}static generateUUID(e,t){switch(e.metadata){case It.Exo003MetadataType.Namespace:return Xf.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case It.Exo003MetadataType.Anchor:return Xf.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case It.Exo003MetadataType.BlankNode:return Xf.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case It.Exo003MetadataType.Statement:{let n=e;return Xf.Exo003UUIDGenerator.generateStatementUUID(n.subject,n.predicate,n.object)}case It.Exo003MetadataType.Body:{let n=e;return Xf.Exo003UUIDGenerator.generateBodyUUID(n.subject+"|"+n.predicate)}}}};nm.Exo003Parser=HS});var zS=E(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.Exo003Parser=nn.Exo003UUIDGenerator=nn.UUID_URL_NAMESPACE=nn.DEFAULT_LANGUAGE_TAG=nn.REQUIRED_PROPERTIES=nn.ALLOWED_PROPERTIES=nn.Exo003MetadataType=void 0;var Jf=Xh();Object.defineProperty(nn,"Exo003MetadataType",{enumerable:!0,get:a(function(){return Jf.Exo003MetadataType},"get")});Object.defineProperty(nn,"ALLOWED_PROPERTIES",{enumerable:!0,get:a(function(){return Jf.ALLOWED_PROPERTIES},"get")});Object.defineProperty(nn,"REQUIRED_PROPERTIES",{enumerable:!0,get:a(function(){return Jf.REQUIRED_PROPERTIES},"get")});Object.defineProperty(nn,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:a(function(){return Jf.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(nn,"UUID_URL_NAMESPACE",{enumerable:!0,get:a(function(){return Jf.UUID_URL_NAMESPACE},"get")});var IB=WS();Object.defineProperty(nn,"Exo003UUIDGenerator",{enumerable:!0,get:a(function(){return IB.Exo003UUIDGenerator},"get")});var xB=WC();Object.defineProperty(nn,"Exo003Parser",{enumerable:!0,get:a(function(){return xB.Exo003Parser},"get")})});var xs=E(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});im.WikiLinkHelpers=void 0;var Zf=class{static{a(this,"WikiLinkHelpers")}static normalize(e){if(!e)return"";let t=e.replace(this.WIKI_LINK_PATTERN,"").trim();if(!t)return"";let n=t.indexOf("|");if(n===-1)return t;let i=t.substring(0,n).trim(),s=t.substring(n+1).trim();return this.UUID_PATTERN.test(i)&&s||i}static normalizeArray(e){return e?(Array.isArray(e)?e:[e]).map(n=>this.normalize(n)).filter(n=>n.length>0):[]}static equals(e,t){return this.normalize(e)===this.normalize(t)}static includes(e,t){let n=this.normalizeArray(e),i=this.normalize(t);return n.includes(i)}static resolveSymbolic(e,t){let n=this.normalize(e);if(!n)return"";if(this.UUID_PATTERN.test(n)){let i=t(n);return i&&i.length>0?i:n}return n}static resolveSymbolicArray(e,t){return e?(Array.isArray(e)?e:[e]).map(i=>this.resolveSymbolic(i,t)).filter(i=>i.length>0):[]}};im.WikiLinkHelpers=Zf;Zf.WIKI_LINK_PATTERN=/\[\[|\]\]/g;Zf.UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});var ha=E(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.CommandBindingProperty=xt.GroundingProperty=xt.PreconditionProperty=xt.CommandProperty=xt.resolveGroundingTypeFromWikilinkLiteral=xt.resolveGroundingTypeFromIRI=xt.GROUNDING_TYPE_IRI_TO_ENUM=xt.GROUNDING_TYPE_UID_TO_ENUM=xt.GROUNDING_TYPE_UIDS=xt.GroundingType=xt.EFFORT_STATUS_OPTIONS=xt.EffortStatus=xt.AssetClass=void 0;var RB=hc();Object.defineProperty(xt,"AssetClass",{enumerable:!0,get:a(function(){return RB.AssetClass},"get")});var CB=El();Object.defineProperty(xt,"EffortStatus",{enumerable:!0,get:a(function(){return CB.EffortStatus},"get")});var OB=oS();Object.defineProperty(xt,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return OB.EFFORT_STATUS_OPTIONS},"get")});var PB=da();Object.defineProperty(xt,"GroundingType",{enumerable:!0,get:a(function(){return PB.GroundingType},"get")});var ed=Bf();Object.defineProperty(xt,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return ed.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(xt,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return ed.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(xt,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return ed.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(xt,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return ed.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(xt,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return ed.resolveGroundingTypeFromWikilinkLiteral},"get")});var sm=aS();Object.defineProperty(xt,"CommandProperty",{enumerable:!0,get:a(function(){return sm.CommandProperty},"get")});Object.defineProperty(xt,"PreconditionProperty",{enumerable:!0,get:a(function(){return sm.PreconditionProperty},"get")});Object.defineProperty(xt,"GroundingProperty",{enumerable:!0,get:a(function(){return sm.GroundingProperty},"get")});Object.defineProperty(xt,"CommandBindingProperty",{enumerable:!0,get:a(function(){return sm.CommandBindingProperty},"get")})});var YC=E(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.hasClass=bc;sn.isAreaOrProject=DB;sn.isEffort=FB;sn.hasStatus=LB;sn.isAssetArchived=NB;sn.hasEmptyProperties=kB;sn.needsFolderRepair=MB;sn.getTodayDateString=KS;sn.isPlannedForToday=jB;sn.hasPlannedStartTimestamp=$B;sn.extractDailyNoteDate=UB;sn.isCurrentDateGteDay=BB;sn.inheritsFromPrototype=KC;sn.isPrototypeClass=qB;var zC=xs(),_c=ha();function bc(r,e){return r?(Array.isArray(r)?r:[r]).some(n=>zC.WikiLinkHelpers.normalize(n)===e):!1}a(bc,"hasClass");function DB(r){return bc(r,_c.AssetClass.AREA)||bc(r,_c.AssetClass.PROJECT)}a(DB,"isAreaOrProject");function FB(r){return bc(r,_c.AssetClass.TASK)||bc(r,_c.AssetClass.PROJECT)||bc(r,_c.AssetClass.MEETING)}a(FB,"isEffort");function LB(r,e){if(!r)return!1;let t=Array.isArray(r)?r[0]:r;return t?zC.WikiLinkHelpers.normalize(t)===e:!1}a(LB,"hasStatus");function NB(r){if(r===!0||r===1)return!0;if(typeof r=="string"){let e=r.toLowerCase();return e==="true"||e==="yes"}return!1}a(NB,"isAssetArchived");function kB(r){if(!r||Object.keys(r).length===0)return!1;let e=a(t=>t==null||t==="","isEmptyArrayItem");return Object.values(r).some(t=>t==null?!0:typeof t=="string"?t==="":Array.isArray(t)?t.length===0||t.every(e):typeof t=="object"&&Object.keys(t).length===0)}a(kB,"hasEmptyProperties");function MB(r,e){if(!e)return!1;let t=r.replace(/\/$/,""),n=e.replace(/\/$/,"");return t!==n}a(MB,"needsFolderRepair");function KS(){let r=new Date,e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${n}`}a(KS,"getTodayDateString");function jB(r){let e=r.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=KS();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}a(jB,"isPlannedForToday");function $B(r){let e=r.ems__Effort_plannedStartTimestamp;return e?typeof e=="string"?e.trim().length>0:Array.isArray(e)&&e.length>0?String(e[0]).trim().length>0:!1:!1}a($B,"hasPlannedStartTimestamp");function UB(r){let e=r.pn__DailyNote_day;if(!e)return null;if(typeof e=="string"){let t=e.match(/\[\[([^\[\]]+)\]\]/);return t?t[1]:e}if(Array.isArray(e)&&e.length>0){let t=String(e[0]),n=t.match(/\[\[([^\[\]]+)\]\]/);return n?n[1]:t}return null}a(UB,"extractDailyNoteDate");function BB(r){return KS()>=r}a(BB,"isCurrentDateGteDay");function HC(r){return r?r.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}a(HC,"normalizeWithQuotes");var VB=10;function KC(r,e=VB){let t=r.exo__Class_superClass;if(!t)return!1;let n=new Set,i=[],s=Array.isArray(t)?t:[t];for(let o of s){let c=HC(o);c&&i.push({className:c,depth:0})}for(;i.length>0;){let o=i.shift();if(!o)continue;let{className:c,depth:l}=o;if(l>e)continue;if(c===_c.AssetClass.PROTOTYPE)return!0;if(n.has(c))continue;n.add(c);let u=`${c}__exo__Class_superClass`,f=r[u];if(f){let d=Array.isArray(f)?f:[f];for(let p of d){let h=HC(p);h&&!n.has(h)&&i.push({className:h,depth:l+1})}}}return!1}a(KC,"inheritsFromPrototype");function qB(r,e){return bc(r,_c.AssetClass.CLASS)?KC(e):!1}a(qB,"isPrototypeClass")});var QC=E(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.isPrototypeClass=wt.inheritsFromPrototype=wt.isCurrentDateGteDay=wt.extractDailyNoteDate=wt.hasPlannedStartTimestamp=wt.isPlannedForToday=wt.getTodayDateString=wt.needsFolderRepair=wt.hasEmptyProperties=wt.isAssetArchived=wt.hasStatus=wt.isEffort=wt.isAreaOrProject=wt.hasClass=void 0;var Bn=YC();Object.defineProperty(wt,"hasClass",{enumerable:!0,get:a(function(){return Bn.hasClass},"get")});Object.defineProperty(wt,"isAreaOrProject",{enumerable:!0,get:a(function(){return Bn.isAreaOrProject},"get")});Object.defineProperty(wt,"isEffort",{enumerable:!0,get:a(function(){return Bn.isEffort},"get")});Object.defineProperty(wt,"hasStatus",{enumerable:!0,get:a(function(){return Bn.hasStatus},"get")});Object.defineProperty(wt,"isAssetArchived",{enumerable:!0,get:a(function(){return Bn.isAssetArchived},"get")});Object.defineProperty(wt,"hasEmptyProperties",{enumerable:!0,get:a(function(){return Bn.hasEmptyProperties},"get")});Object.defineProperty(wt,"needsFolderRepair",{enumerable:!0,get:a(function(){return Bn.needsFolderRepair},"get")});Object.defineProperty(wt,"getTodayDateString",{enumerable:!0,get:a(function(){return Bn.getTodayDateString},"get")});Object.defineProperty(wt,"isPlannedForToday",{enumerable:!0,get:a(function(){return Bn.isPlannedForToday},"get")});Object.defineProperty(wt,"hasPlannedStartTimestamp",{enumerable:!0,get:a(function(){return Bn.hasPlannedStartTimestamp},"get")});Object.defineProperty(wt,"extractDailyNoteDate",{enumerable:!0,get:a(function(){return Bn.extractDailyNoteDate},"get")});Object.defineProperty(wt,"isCurrentDateGteDay",{enumerable:!0,get:a(function(){return Bn.isCurrentDateGteDay},"get")});Object.defineProperty(wt,"inheritsFromPrototype",{enumerable:!0,get:a(function(){return Bn.inheritsFromPrototype},"get")});Object.defineProperty(wt,"isPrototypeClass",{enumerable:!0,get:a(function(){return Bn.isPrototypeClass},"get")})});var XC=E(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.TsFloorViolationError=Et.CATALOG_KEEP_NAMESPACES=Et.PLUGIN_UI_FLOOR=Et.SDK_FLOOR=Et.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=Et.SDK_FLOOR_ASSETSPACE_UIDS=Et.TS_FLOOR_AS_UID_SHARED_IDENTITIES=Et.TS_FLOOR_AS_UID_EXOCMD=Et.TS_FLOOR_AS_UID_EXO=void 0;Et.assertTsFloor=GB;Et.assertTsFloorReconciled=WB;Et.isTsFloorAssetSpace=HB;Et.isTsFloorMountPath=zB;Et.TS_FLOOR_AS_UID_EXO="49fd2e56-4656-4ca7-a789-f472b16ea260";Et.TS_FLOOR_AS_UID_EXOCMD="c9c65b0f-1e01-47c1-a1f9-1bf70b11df6a";Et.TS_FLOOR_AS_UID_SHARED_IDENTITIES="0cde1557-6320-4bd0-a7c4-8b72afc38720";Et.SDK_FLOOR_ASSETSPACE_UIDS=new Set([Et.TS_FLOOR_AS_UID_EXO]);Et.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=new Set([Et.TS_FLOOR_AS_UID_EXO]);Et.SDK_FLOOR=[{uid:Et.TS_FLOOR_AS_UID_EXO,namespace:"exo"}];Et.PLUGIN_UI_FLOOR=Et.SDK_FLOOR;Et.CATALOG_KEEP_NAMESPACES=new Set(["registry","profiles"]);var td=class extends Error{static{a(this,"TsFloorViolationError")}constructor(e){super(e),this.name="TsFloorViolationError"}};Et.TsFloorViolationError=td;function GB(r,e){let t=[];for(let n of e)r.has(n)||t.push(n);if(t.length>0)throw new td(`Target profile's declared set excludes TS-floor AssetSpace UID(s): ${t.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(GB,"assertTsFloor");function WB(r,e,t){let n=[];for(let i of t)r.has(i.uid)||e.has(i.namespace)||n.push(`${i.namespace} (${i.uid})`);if(n.length>0)throw new td(`Target profile's declared set excludes TS-floor AssetSpace(s): ${n.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(WB,"assertTsFloorReconciled");function HB(r,e,t=Et.SDK_FLOOR){return t.some(n=>r.length>0&&n.uid===r||e.length>0&&n.namespace===e)}a(HB,"isTsFloorAssetSpace");function zB(r,e=Et.SDK_FLOOR){let t=r.replace(/\/+$/,""),n=t.slice(t.lastIndexOf("/")+1),i=n.startsWith("exoas-")?n.slice(6):n;return i.length===0?!1:e.some(s=>s.namespace===i)}a(zB,"isTsFloorMountPath")});var JC=E(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});YS.transitiveDependsOnClosure=KB;function KB(r,e){let t=new Set,n=[];for(let i of r)t.has(i)||(t.add(i),n.push(i));for(;n.length>0;){let i=n.shift();if(i===void 0)break;let s=e.get(i);if(s!==void 0)for(let o of s)t.has(o)||(t.add(o),n.push(o))}return t}a(KB,"transitiveDependsOnClosure")});var om=E(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});rd.PropertyFieldType=void 0;rd.rangeToFieldType=XB;var Hr;(function(r){r.Text="text",r.Number="number",r.Date="date",r.DateTime="datetime",r.Boolean="boolean",r.Reference="reference",r.Enum="enum",r.StatusSelect="status-select",r.SizeSelect="size-select",r.Wikilink="wikilink",r.Timestamp="timestamp",r.Unknown="unknown"})(Hr||(rd.PropertyFieldType=Hr={}));var ZC="http://www.w3.org/2001/XMLSchema#",YB="https://exocortex.my/ontology/exo#",QB="https://exocortex.my/ontology/ems#";function XB(r){if(!r)return Hr.Unknown;let e=r.trim();if(!e)return Hr.Unknown;if(e.startsWith(ZC)){let t=e.substring(ZC.length);return QS(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return QS(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),n=e.substring(t+10);return QS(n)}return e.startsWith(QB)||e.startsWith("ems:")?JB(e):e.startsWith(YB)||e.startsWith("exo:")||ZB(e)?Hr.Reference:Hr.Text}a(XB,"rangeToFieldType");function QS(r){switch(r.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return Hr.Text;case"integer":case"int":case"long":case"short":case"byte":case"nonnegativeinteger":case"positiveinteger":case"nonpositiveinteger":case"negativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"decimal":case"float":case"double":return Hr.Number;case"date":return Hr.Date;case"datetime":case"datetimestamp":return Hr.DateTime;case"boolean":return Hr.Boolean;case"time":return Hr.Timestamp;default:return Hr.Text}}a(QS,"xsdTypeToFieldType");function JB(r){let e=r.toLowerCase();return e.includes("effortstatus")?Hr.StatusSelect:e.includes("tasksize")?Hr.SizeSelect:Hr.Reference}a(JB,"emsTypeToFieldType");function ZB(r){let e=r.toLowerCase();return e.includes("exocortex.my/ontology")?!0:["asset","task","project","area","effort","class","property","concept"].some(n=>e.includes(n))}a(ZB,"isClassReference")});var XS=E(nd=>{"use strict";Object.defineProperty(nd,"__esModule",{value:!0});nd.propertyNameToUri=e7;nd.uriToPropertyName=eO;nd.extractPropertyLabel=t7;function e7(r){return r.replace(/^([a-z]+)__/,"$1:")}a(e7,"propertyNameToUri");function eO(r){if(r.startsWith("http://")||r.startsWith("https://")){let e=r.match(/\/([a-z]+)#([A-Za-z0-9_]+)$/);if(e)return`${e[1]}__${e[2]}`;let t=r.lastIndexOf("#"),n=r.lastIndexOf("/"),i=Math.max(t,n);return i>=0?r.substring(i+1):r}return r.replace(/^([a-z]+):/,"$1__")}a(eO,"uriToPropertyName");function t7(r){let n=(r.includes(":")?eO(r):r).replace(/^[a-z]+__/,"").split("_");return(n.length>1?n.slice(1).join(" "):n[0]).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,s=>s.toUpperCase())}a(t7,"extractPropertyLabel")});var am={};Bb(am,{__assign:()=>ZS,__asyncDelegator:()=>h7,__asyncGenerator:()=>p7,__asyncValues:()=>m7,__await:()=>id,__awaiter:()=>a7,__classPrivateFieldGet:()=>b7,__classPrivateFieldSet:()=>S7,__createBinding:()=>l7,__decorate:()=>i7,__exportStar:()=>u7,__extends:()=>r7,__generator:()=>c7,__importDefault:()=>_7,__importStar:()=>y7,__makeTemplateObject:()=>g7,__metadata:()=>o7,__param:()=>s7,__read:()=>tO,__rest:()=>n7,__spread:()=>f7,__spreadArrays:()=>d7,__values:()=>ew});function r7(r,e){JS(r,e);function t(){this.constructor=r}a(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function n7(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function i7(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function s7(r,e){return function(t,n){e(t,n,r)}}function o7(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function a7(r,e,t,n){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return a(i,"adopt"),new(t||(t=Promise))(function(s,o){function c(f){try{u(n.next(f))}catch(d){o(d)}}a(c,"fulfilled");function l(f){try{u(n.throw(f))}catch(d){o(d)}}a(l,"rejected");function u(f){f.done?s(f.value):i(f.value).then(c,l)}a(u,"step"),u((n=n.apply(r,e||[])).next())})}function c7(r,e){var t={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,i,s,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(u){return function(f){return l([u,f])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(f){u=[6,f],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function l7(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function u7(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function ew(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:a(function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function tO(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s}function f7(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(tO(arguments[e]));return r}function d7(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,i++)n[i]=s[o];return n}function id(r){return this instanceof id?(this.v=r,this):new id(r)}function p7(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){n[p]&&(i[p]=function(h){return new Promise(function(_,y){s.push([p,h,_,y])>1||c(p,h)})})}function c(p,h){try{l(n[p](h))}catch(_){d(s[0][3],_)}}function l(p){p.value instanceof id?Promise.resolve(p.value.v).then(u,f):d(s[0][2],p)}function u(p){c("next",p)}function f(p){c("throw",p)}function d(p,h){p(h),s.shift(),s.length&&c(s[0][0],s[0][1])}}function h7(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=r[i]?function(o){return(t=!t)?{value:id(r[i](o)),done:i==="return"}:s?s(o):o}:s}}function m7(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof ew=="function"?ew(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(o){return new Promise(function(c,l){o=r[s](o),i(c,l,o.done,o.value)})}}function i(s,o,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},o)}}function g7(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function y7(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function _7(r){return r&&r.__esModule?r:{default:r}}function b7(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function S7(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var JS,ZS,cm=F6(()=>{JS=a(function(r,e){return JS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},JS(r,e)},"extendStatics");a(r7,"__extends");ZS=a(function(){return ZS=Object.assign||a(function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),ZS.apply(this,arguments)},"__assign");a(n7,"__rest");a(i7,"__decorate");a(s7,"__param");a(o7,"__metadata");a(a7,"__awaiter");a(c7,"__generator");a(l7,"__createBinding");a(u7,"__exportStar");a(ew,"__values");a(tO,"__read");a(f7,"__spread");a(d7,"__spreadArrays");a(id,"__await");a(p7,"__asyncGenerator");a(h7,"__asyncDelegator");a(m7,"__asyncValues");a(g7,"__makeTemplateObject");a(y7,"__importStar");a(_7,"__importDefault");a(b7,"__classPrivateFieldGet");a(S7,"__classPrivateFieldSet")});var nw=E(rw=>{"use strict";Object.defineProperty(rw,"__esModule",{value:!0});var tw;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(tw||(tw={}));rw.default=tw});var rO=E(iw=>{"use strict";Object.defineProperty(iw,"__esModule",{value:!0});var w7=nw();Object.defineProperty(iw,"Lifecycle",{enumerable:!0,get:a(function(){return w7.default},"get")})});var Sc=E(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.defineInjectionTokenMetadata=Fi.getParamInfo=Fi.INJECTION_TOKEN_METADATA_KEY=void 0;Fi.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function E7(r){let e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(Fi.INJECTION_TOKEN_METADATA_KEY,r)||{};return Object.keys(t).forEach(n=>{e[+n]=t[n]}),e}a(E7,"getParamInfo");Fi.getParamInfo=E7;function v7(r,e){return function(t,n,i){let s=Reflect.getOwnMetadata(Fi.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:r,transform:e.transformToken,transformArgs:e.args||[]}:r,Reflect.defineMetadata(Fi.INJECTION_TOKEN_METADATA_KEY,s,t)}}a(v7,"defineInjectionTokenMetadata");Fi.defineInjectionTokenMetadata=v7});var sw=E(lm=>{"use strict";Object.defineProperty(lm,"__esModule",{value:!0});lm.isClassProvider=void 0;function T7(r){return!!r.useClass}a(T7,"isClassProvider");lm.isClassProvider=T7});var ow=E(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});um.isFactoryProvider=void 0;function A7(r){return!!r.useFactory}a(A7,"isFactoryProvider");um.isFactoryProvider=A7});var dm=E(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.delay=Tl.DelayedConstructor=void 0;var fm=class{static{a(this,"DelayedConstructor")}constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let t={},n=!1,i,s=a(()=>(n||(i=e(this.wrap()),n=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},n=a(i=>{t[i]=(...s)=>{s[0]=e();let o=Reflect[i];return o(...s)}},"install");return this.reflectMethods.forEach(n),t}};Tl.DelayedConstructor=fm;function I7(r){if(typeof r>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new fm(r)}a(I7,"delay");Tl.delay=I7});var pm=E(Rs=>{"use strict";Object.defineProperty(Rs,"__esModule",{value:!0});Rs.isConstructorToken=Rs.isTransformDescriptor=Rs.isTokenDescriptor=Rs.isNormalToken=void 0;var x7=dm();function R7(r){return typeof r=="string"||typeof r=="symbol"}a(R7,"isNormalToken");Rs.isNormalToken=R7;function C7(r){return typeof r=="object"&&"token"in r&&"multiple"in r}a(C7,"isTokenDescriptor");Rs.isTokenDescriptor=C7;function O7(r){return typeof r=="object"&&"token"in r&&"transform"in r}a(O7,"isTransformDescriptor");Rs.isTransformDescriptor=O7;function P7(r){return typeof r=="function"||r instanceof x7.DelayedConstructor}a(P7,"isConstructorToken");Rs.isConstructorToken=P7});var aw=E(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.isTokenProvider=void 0;function D7(r){return!!r.useToken}a(D7,"isTokenProvider");hm.isTokenProvider=D7});var cw=E(mm=>{"use strict";Object.defineProperty(mm,"__esModule",{value:!0});mm.isValueProvider=void 0;function F7(r){return r.useValue!=null}a(F7,"isValueProvider");mm.isValueProvider=F7});var lw=E(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});var L7=sw();Object.defineProperty(wc,"isClassProvider",{enumerable:!0,get:a(function(){return L7.isClassProvider},"get")});var N7=ow();Object.defineProperty(wc,"isFactoryProvider",{enumerable:!0,get:a(function(){return N7.isFactoryProvider},"get")});var k7=pm();Object.defineProperty(wc,"isNormalToken",{enumerable:!0,get:a(function(){return k7.isNormalToken},"get")});var M7=aw();Object.defineProperty(wc,"isTokenProvider",{enumerable:!0,get:a(function(){return M7.isTokenProvider},"get")});var j7=cw();Object.defineProperty(wc,"isValueProvider",{enumerable:!0,get:a(function(){return j7.isValueProvider},"get")})});var nO=E(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.isProvider=void 0;var $7=sw(),U7=cw(),B7=aw(),V7=ow();function q7(r){return $7.isClassProvider(r)||U7.isValueProvider(r)||B7.isTokenProvider(r)||V7.isFactoryProvider(r)}a(q7,"isProvider");gm.isProvider=q7});var dw=E(fw=>{"use strict";Object.defineProperty(fw,"__esModule",{value:!0});var uw=class{static{a(this,"RegistryBase")}constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(e){return this.ensure(e),this._registryMap.get(e)}get(e){this.ensure(e);let t=this._registryMap.get(e);return t[t.length-1]||null}set(e,t){this.ensure(e),this._registryMap.get(e).push(t)}setAll(e,t){this._registryMap.set(e,t)}has(e){return this.ensure(e),this._registryMap.get(e).length>0}clear(){this._registryMap.clear()}ensure(e){this._registryMap.has(e)||this._registryMap.set(e,[])}};fw.default=uw});var iO=E(hw=>{"use strict";Object.defineProperty(hw,"__esModule",{value:!0});var G7=dw(),pw=class extends G7.default{static{a(this,"Registry")}};hw.default=pw});var sO=E(gw=>{"use strict";Object.defineProperty(gw,"__esModule",{value:!0});var mw=class{static{a(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};gw.default=mw});var yw=E(ym=>{"use strict";Object.defineProperty(ym,"__esModule",{value:!0});ym.formatErrorCtor=void 0;function W7(r,e){return r===null?`at position #${e}`:`"${r.split(",")[e].trim()}" at position #${e}`}a(W7,"formatDependency");function H7(r,e,t=" "){return[r,...e.message.split(`
|
|
32
32
|
`).map(n=>t+n)].join(`
|
|
33
|
-
`)}a(H7,"composeErrorMessage");function z7(r,e,t){let[,n=null]=r.toString().match(/constructor\(([\w, ]+)\)/)||[],i=W7(n,e);return H7(`Cannot inject the dependency ${i} of "${r.name}" constructor. Reason:`,t)}a(z7,"formatErrorCtor");ym.formatErrorCtor=z7});var oO=E(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.isDisposable=void 0;function K7(r){return!(typeof r.dispose!="function"||r.dispose.length>0)}a(K7,"isDisposable");_m.isDisposable=K7});var cO=E(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.PostResolutionInterceptors=Ec.PreResolutionInterceptors=void 0;var aO=dw(),bm=class extends aO.default{static{a(this,"PreResolutionInterceptors")}};Ec.PreResolutionInterceptors=bm;var Sm=class extends aO.default{static{a(this,"PostResolutionInterceptors")}};Ec.PostResolutionInterceptors=Sm;var _w=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new bm,this.postResolution=new Sm}};Ec.default=_w});var ma=E(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.instance=mo.typeInfo=void 0;var Y7=(cm(),Dh(am)),An=lw(),Q7=nO(),wm=pm(),X7=iO(),Vn=nw(),Em=sO(),J7=yw(),Z7=dm(),e8=oO(),t8=cO();mo.typeInfo=new Map;var bw=class r{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new X7.default,this.interceptors=new t8.default,this.disposed=!1,this.disposables=new Set}register(e,t,n={lifecycle:Vn.default.Transient}){this.ensureNotDisposed();let i;if(Q7.isProvider(t)?i=t:i={useClass:t},An.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let c=o.useToken;if(s.includes(c))throw new Error(`Token registration cycle detected! ${[...s,c].join(" -> ")}`);s.push(c);let l=this._registry.get(c);l&&An.isTokenProvider(l.provider)?o=l.provider:o=null}}if((n.lifecycle===Vn.default.Singleton||n.lifecycle==Vn.default.ContainerScoped||n.lifecycle==Vn.default.ResolutionScoped)&&(An.isValueProvider(i)||An.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Vn.default[n.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:n}),this}registerType(e,t){return this.ensureNotDisposed(),An.isNormalToken(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})}registerInstance(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})}registerSingleton(e,t){if(this.ensureNotDisposed(),An.isNormalToken(e)){if(An.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Vn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Vn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let n=e;return t&&!An.isNormalToken(t)&&(n=t),this.register(e,{useClass:n},{lifecycle:Vn.default.Singleton})}resolve(e,t=new Em.default,n=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&An.isNormalToken(e)){if(n)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),i){let s=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(wm.isConstructorToken(e)){let s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,t){if(this.interceptors.preResolution.has(e)){let n=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&n.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,n)}}executePostResolutionInterceptor(e,t,n){if(this.interceptors.postResolution.has(e)){let i=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&i.push(s),s.callback(e,t,n);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Vn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let n=e.options.lifecycle===Vn.default.Singleton,i=e.options.lifecycle===Vn.default.ContainerScoped,s=n||i,o;return An.isValueProvider(e.provider)?o=e.provider.useValue:An.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):An.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):An.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Vn.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new Em.default,n=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&An.isNormalToken(e)){if(n)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,o,"All"),o}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(n=>!An.isValueProvider(n.provider)).map(n=>(n.instance=void 0,n)))}createChildContainer(){this.ensureNotDisposed();let e=new r(this);for(let[t,n]of this._registry.entries())n.some(({options:i})=>i.lifecycle===Vn.default.ContainerScoped)&&e._registry.setAll(t,n.map(i=>i.options.lifecycle===Vn.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,n={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:n})}afterResolution(e,t,n={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:n})}dispose(){return Y7.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let n=t.dispose();n&&e.push(n)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,t){if(e instanceof Z7.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let n=(()=>{let i=mo.typeInfo.get(e);if(!i||i.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=i.map(this.resolveParams(t,e));return new e(...s)})();return e8.isDisposable(n)&&this.disposables.add(n),n}resolveParams(e,t){return(n,i)=>{try{return wm.isTokenDescriptor(n)?wm.isTransformDescriptor(n)?n.multiple?this.resolve(n.transform).transform(this.resolveAll(n.token,new Em.default,n.isOptional),...n.transformArgs):this.resolve(n.transform).transform(this.resolve(n.token,e,n.isOptional),...n.transformArgs):n.multiple?this.resolveAll(n.token,new Em.default,n.isOptional):this.resolve(n.token,e,n.isOptional):wm.isTransformDescriptor(n)?this.resolve(n.transform,e).transform(this.resolve(n.token,e),...n.transformArgs):this.resolve(n,e)}catch(s){throw new Error(J7.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};mo.instance=new bw;mo.default=mo.instance});var lO=E(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});var r8=Sc(),go=ma(),Sw=pm(),n8=yw();function i8(){return function(r){let e=r8.getParamInfo(r);return class extends r{constructor(...t){super(...t.concat(e.slice(t.length).map((n,i)=>{try{return Sw.isTokenDescriptor(n)?Sw.isTransformDescriptor(n)?n.multiple?go.instance.resolve(n.transform).transform(go.instance.resolveAll(n.token),...n.transformArgs):go.instance.resolve(n.transform).transform(go.instance.resolve(n.token),...n.transformArgs):n.multiple?go.instance.resolveAll(n.token):go.instance.resolve(n.token):Sw.isTransformDescriptor(n)?go.instance.resolve(n.transform).transform(go.instance.resolve(n.token),...n.transformArgs):go.instance.resolve(n)}catch(s){let o=i+t.length;throw new Error(n8.formatErrorCtor(r,o,s))}})))}}}}a(i8,"autoInjectable");ww.default=i8});var uO=E(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});var s8=Sc();function o8(r,e){let t={token:r,multiple:!1,isOptional:e&&e.isOptional};return s8.defineInjectionTokenMetadata(t)}a(o8,"inject");Ew.default=o8});var vm=E(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var a8=Sc(),c8=ma(),fO=ma();function l8(r){return function(e){c8.typeInfo.set(e,a8.getParamInfo(e)),r&&r.token&&(Array.isArray(r.token)?r.token.forEach(t=>{fO.instance.register(t,e)}):fO.instance.register(r.token,e))}}a(l8,"injectable");vw.default=l8});var dO=E(Tw=>{"use strict";Object.defineProperty(Tw,"__esModule",{value:!0});var u8=(cm(),Dh(am)),f8=ma();function d8(r=[]){return function(e){return r.forEach(t=>{var{token:n,options:i}=t,s=u8.__rest(t,["token","options"]);return f8.instance.register(n,s,i)}),e}}a(d8,"registry");Tw.default=d8});var pO=E(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});var p8=vm(),h8=ma();function m8(){return function(r){p8.default()(r),h8.instance.registerSingleton(r)}}a(m8,"singleton");Aw.default=m8});var hO=E(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var g8=Sc();function y8(r,e){let t={token:r,multiple:!0,isOptional:e&&e.isOptional};return g8.defineInjectionTokenMetadata(t)}a(y8,"injectAll");Iw.default=y8});var mO=E(xw=>{"use strict";Object.defineProperty(xw,"__esModule",{value:!0});var _8=Sc();function b8(r,e,...t){let n={token:r,multiple:!0,transform:e,transformArgs:t};return _8.defineInjectionTokenMetadata(n)}a(b8,"injectAllWithTransform");xw.default=b8});var gO=E(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var S8=Sc();function w8(r,e,...t){return S8.defineInjectionTokenMetadata(r,{transformToken:e,args:t})}a(w8,"injectWithTransform");Rw.default=w8});var yO=E(Cw=>{"use strict";Object.defineProperty(Cw,"__esModule",{value:!0});var E8=vm(),v8=ma();function T8(r,e){return function(t){E8.default()(t),v8.instance.register(e||t,t,{lifecycle:r})}}a(T8,"scoped");Cw.default=T8});var _O=E(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});var A8=lO();Object.defineProperty(Li,"autoInjectable",{enumerable:!0,get:a(function(){return A8.default},"get")});var I8=uO();Object.defineProperty(Li,"inject",{enumerable:!0,get:a(function(){return I8.default},"get")});var x8=vm();Object.defineProperty(Li,"injectable",{enumerable:!0,get:a(function(){return x8.default},"get")});var R8=dO();Object.defineProperty(Li,"registry",{enumerable:!0,get:a(function(){return R8.default},"get")});var C8=pO();Object.defineProperty(Li,"singleton",{enumerable:!0,get:a(function(){return C8.default},"get")});var O8=hO();Object.defineProperty(Li,"injectAll",{enumerable:!0,get:a(function(){return O8.default},"get")});var P8=mO();Object.defineProperty(Li,"injectAllWithTransform",{enumerable:!0,get:a(function(){return P8.default},"get")});var D8=gO();Object.defineProperty(Li,"injectWithTransform",{enumerable:!0,get:a(function(){return D8.default},"get")});var F8=yO();Object.defineProperty(Li,"scoped",{enumerable:!0,get:a(function(){return F8.default},"get")})});var bO=E(Ow=>{"use strict";Object.defineProperty(Ow,"__esModule",{value:!0});function L8(r){let e;return t=>(e==null&&(e=r(t)),e)}a(L8,"instanceCachingFactory");Ow.default=L8});var SO=E(Pw=>{"use strict";Object.defineProperty(Pw,"__esModule",{value:!0});function N8(r){let e=new WeakMap;return t=>{let n=e.get(t);return n==null&&(n=r(t),e.set(t,n)),n}}a(N8,"instancePerContainerCachingFactory");Pw.default=N8});var wO=E(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});function k8(r,e,t,n=!0){let i,s;return o=>{let c=r(o);return(!n||s!==c)&&((s=c)?i=o.resolve(e):i=o.resolve(t)),i}}a(k8,"predicateAwareClassFactory");Dw.default=k8});var EO=E(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var M8=bO();Object.defineProperty(sd,"instanceCachingFactory",{enumerable:!0,get:a(function(){return M8.default},"get")});var j8=SO();Object.defineProperty(sd,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return j8.default},"get")});var $8=wO();Object.defineProperty(sd,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return $8.default},"get")})});var Ze=E(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var Fw=(cm(),Dh(am));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var U8=rO();Object.defineProperty(ga,"Lifecycle",{enumerable:!0,get:a(function(){return U8.Lifecycle},"get")});Fw.__exportStar(_O(),ga);Fw.__exportStar(EO(),ga);Fw.__exportStar(lw(),ga);var B8=dm();Object.defineProperty(ga,"delay",{enumerable:!0,get:a(function(){return B8.delay},"get")});var V8=ma();Object.defineProperty(ga,"container",{enumerable:!0,get:a(function(){return V8.instance},"get")})});var Al=E(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.NullLogger=void 0;Tm.NullLogger={debug(){},info(){},warn(){},error(){}}});var xl=E(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.bytesToBase64=TO;Il.base64ToBytes=AO;Il.base64ToUtf8=q8;Il.utf8ToBase64=G8;var vO=32768;function TO(r){let e="";for(let t=0;t<r.length;t+=vO)e+=String.fromCharCode(...r.subarray(t,t+vO));return btoa(e)}a(TO,"bytesToBase64");function AO(r){let e=r.replace(/\s/g,""),t=e.length%4,n=t===2||t===3?e+"=".repeat(4-t):e,i=atob(n),s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s}a(AO,"base64ToBytes");function q8(r){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(AO(r))}a(q8,"base64ToUtf8");function G8(r){return TO(new TextEncoder().encode(r))}a(G8,"utf8ToBase64")});var od=E(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});Lw.iriToObsidianName=W8;function W8(r){let e=r.match(/^https:\/\/exocortex\.my\/ontology\/([a-z][a-zA-Z0-9]*)#([^#]+)$/);if(e){let[,n,i]=e;return`${n}__${i}`}let t=r.match(/\/([^/]+)\.md$/);return t?t[1]:null}a(W8,"iriToObsidianName")});var IO=E(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.registerUniversalDefaultLoader=H8;ya.clearUniversalDefaultLoader=z8;ya.clearUniversalDefault=K8;ya.loadUniversalDefault=Y8;ya.mergePropertyDefaults=Q8;ya.mergeInheritanceRules=X8;var Am=null,yo,ad=!1;function H8(r){Am=r,yo=void 0,ad=!1}a(H8,"registerUniversalDefaultLoader");function z8(){Am=null,yo=void 0,ad=!1}a(z8,"clearUniversalDefaultLoader");function K8(){yo=void 0,ad=!1}a(K8,"clearUniversalDefault");async function Y8(){if(yo!==void 0)return yo;if(!Am)return yo=null,null;try{yo=await Am()??null}catch(r){ad||(console.warn("[UniversalDefaultTemplateResolver] loader threw, falling back to legacy primitives:",r),ad=!0),yo=null}return yo}a(Y8,"loadUniversalDefault");function Q8(r,e){let t=new Map;for(let s of e)t.set(s.propertyName,s);let n=[],i=new Set;for(let s of r){let o=t.get(s.propertyName);o?(n.push(o),i.add(o.propertyName)):n.push(s)}for(let s of e)i.has(s.propertyName)||n.push(s);return n}a(Q8,"mergePropertyDefaults");function X8(r,e){let t=new Map;for(let s of e)t.set(s.targetPropertyName,s);let n=[],i=new Set;for(let s of r){let o=t.get(s.targetPropertyName);o?(n.push(o),i.add(o.targetPropertyName)):n.push(s)}for(let s of e)i.has(s.targetPropertyName)||n.push(s);return n}a(X8,"mergeInheritanceRules")});var Nw=E((Lme,xO)=>{var Rl=class{static{a(this,"Wildcard")}constructor(){return J8||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(Rl.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(Rl.prototype,"termType",{enumerable:!0,value:"Wildcard"});var J8=new Rl;xO.exports.Wildcard=Rl});var CO=E((kme,RO)=>{var Z8=(function(){var r=a(function(z,q,J,le){for(J=J||{},le=z.length;le--;J[z[le]]=q);return J},"o"),e=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],t=[2,247],n=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],o=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],d=[1,45],p=[1,41],h=[1,44],_=[123,126],y=[1,67],S=[39,45,87],w=[13,16,45,197,224,308],T=[1,87],O=[2,281],A=[1,86],x=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],P=[6,28,29,53,63,70,73,81,83,85],V=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],j=[6,13,16,28,29,45,53,63,70,73,81,82,83,85,87,89,197,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314],$=[6,13,16,28,29,31,39,45,47,48,53,63,70,73,81,82,83,85,87,89,109,112,121,123,126,128,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,337,338,340,341,342,343,344,345,346],K=[13,16,308],N=[112,132,327,334],ae=[13,16,112,132,308],we=[1,111],te=[1,117],pe=[112,132,327,328,334],Y=[13,16,112,132,308,328],Ee=[28,29,45,53,87],ie=[1,138],ne=[1,151],de=[1,128],ge=[1,127],Z=[1,129],ye=[1,140],Pe=[1,141],se=[1,142],_e=[1,143],Ne=[1,144],Q=[1,145],ce=[1,147],be=[1,148],Ie=[2,457],Ce=[1,158],Fe=[1,159],De=[1,160],Ae=[1,152],ee=[1,153],he=[1,156],Te=[1,171],xe=[1,172],je=[1,173],ke=[1,174],Ge=[1,175],Me=[1,176],We=[1,167],Ve=[1,168],$e=[1,169],He=[1,170],m=[1,157],L=[1,166],U=[1,161],R=[1,162],C=[1,163],D=[1,164],b=[1,165],F=[6,13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],X=[1,195],G=[6,31,73,81,83,85],B=[2,285],M=[1,199],k=[1,201],W=[6,31,70,73,81,83,85],H=[2,283],oe=[1,207],me=[1,218],Re=[1,223],rt=[1,219],Vr=[1,225],Er=[1,226],tr=[1,224],nR=[6,63,70,73,81,83,85],iR=[1,236],sR=[2,334],oR=[1,243],aR=[1,241],qr=[6,193],uh=[2,349],cR=[2,339],la=[28,128],lR=[47,48,193,272],fh=[47,48,193,242,272],fl=[47,48,193,242,246,272],dl=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Pr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],uR=[1,271],fR=[1,270],cr=[6,13,16,29,31,39,45,47,48,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],dR=[1,281],pR=[1,280],En=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],Cf=[45,89],dh=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],ph=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],hh=[31,89],mh=[48,87],ic=[6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338],ws=[6,13,16,39,45,48,82,87,89,231,263,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338,340],hR=[1,313],pl=[6,85],Sb=[6,31,81,83,85],mR=[2,361],no=[2,353],sc=[1,343],Of=[31,112,335],io=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],wb=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335],gR=[6,109,193],oc=[31,112],lr=[13,16,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],Eb=[1,390],vb=[1,391],ua=[13,16,87,197,308,314],yR=[13,16,39,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],gh=[1,417],yh=[1,418],_R=[13,16,48,197,229,308],fa=[6,31,85],bR=[6,13,16,31,45,73,81,83,85,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Tb=[6,13,16,29,31,45,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,231,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,346,347,348,349,350,351],ac=[29,31,85,112,159,160,161,163,164],_h=[1,443],bh=[1,444],SR=[1,449],cc=[31,112,193,232,318,335],Sh=[13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],wR=[13,16,31,45,48,82,87,89,112,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Ab=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Pf=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Df=[31,45],ER=[1,507],vR=[1,508],TR=[6,13,16,29,31,39,45,47,48,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,336,338,341,342,343,344,345,346,347,348,349,350,351],wh=[29,31,85,112,159,160,161,163,164,335],lc=[6,13,16,31,45,70,73,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],AR=[13,16,31,45,48,82,87,89,112,193,197,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],IR=[2,352],Ib=[13,16,197,308,314],xR=[1,565],hl=[6,13,16,31,45,76,78,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],RR=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],so=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],CR=[13,16,87,308],oo=[2,364],ml=[29,31,85,112,159,160,161,163,164,193,232,318,335],Eh=[31,112,193,232,272,318,335],ao=[2,359],OR=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],vh=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],PR=[13,16,31,45,82,87,89,112,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],DR=[2,347],xb={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:a(function(q,J,le,Be,nt,v,Tn){var I=v.length-1;switch(nt){case 1:if(v[I-1]=v[I-1]||{},ot.base&&(v[I-1].base=ot.base),ot.base="",v[I-1].prefixes=ot.prefixes,ot.prefixes=null,ot.pathOnly){if(v[I-1].type==="path"||"termType"in v[I-1])return v[I-1];throw new Error("Received full SPARQL query in path only mode")}else if(v[I-1].type==="path"||"termType"in v[I-1])throw new Error("Received only path in full SPARQL mode");if(v[I-1].type==="update"){let Ot={};for(let Vt of v[I-1].updates)if(Vt.updateType==="insert"){let yt={};for(let Tt of Vt.insert)if(Tt.type==="bgp"||Tt.type==="graph")for(let jn of Tt.triples)jn.subject.termType==="BlankNode"&&(yt[jn.subject.value]=!0),jn.predicate.termType==="BlankNode"&&(yt[jn.predicate.value]=!0),jn.object.termType==="BlankNode"&&(yt[jn.object.value]=!0);for(let Tt of Object.keys(yt)){if(Ot[Tt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");Ot[Tt]=!0}}}return v[I-1];case 2:this.$={...v[I-1],...v[I],type:"query"};break;case 4:ot.base=Ff(v[I]);break;case 5:ot.prefixes||(ot.prefixes={}),v[I-1]=v[I-1].substr(0,v[I-1].length-1),v[I]=Ff(v[I]),ot.prefixes[v[I-1]]=v[I];break;case 6:this.$={...v[I-3],...dc(v[I-2]),...v[I-1],...v[I]};break;case 7:if(!ot.skipValidation&&(Nb(v[I-3].variables.map(Vt=>Lb(Vt.expression))).some(Vt=>Vt.aggregation==="count"&&!(Vt.expression instanceof Th))||v[I].group)){for(let Vt of v[I-3].variables)if(Vt.termType==="Variable"){if(!v[I].group||!v[I].group.map(yt=>bl(yt)).includes(bl(Vt)))throw Error("Projection of ungrouped variable (?"+bl(Vt)+")")}else if(Lb(Vt.expression).length===0){let yt=A6(Vt.expression);for(let Tt of yt)if(!v[I].group||!v[I].group.map||!v[I].group.map(jn=>bl(jn)).includes(bl(Tt)))throw Error("Use of ungrouped variable in projection of operation (?"+bl(Tt)+")")}}let As=v[I-1].where.filter(Ot=>Ot.type==="query");if(As.length>0){let Ot=v[I-3].variables.filter(yt=>yt.variable&&yt.variable.value).map(yt=>yt.variable.value),Vt=Nb(As.map(yt=>yt.variables)).map(yt=>yt.value||yt.variable.value);for(let yt of Ot)if(Vt.indexOf(yt)>=0)throw Error("Target id of 'AS' (?"+yt+") already used in subquery")}this.$=rr(v[I-3],dc(v[I-2]),v[I-1],v[I]);break;case 8:this.$=rr({queryType:"CONSTRUCT",template:v[I-3]},dc(v[I-2]),v[I-1],v[I]);break;case 9:this.$=rr({queryType:"CONSTRUCT",template:v[I-2]=v[I-2]?v[I-2].triples:[]},dc(v[I-5]),{where:[{type:"bgp",triples:fc([],v[I-2])}]},v[I]);break;case 10:this.$=rr({queryType:"DESCRIBE",variables:v[I-3]==="*"?[new Th]:v[I-3]},dc(v[I-2]),v[I-1],v[I]);break;case 11:this.$=rr({queryType:"ASK"},dc(v[I-2]),v[I-1],v[I]);break;case 12:this.$=rr(v[I-1],{variables:[new Th]});break;case 13:let jf=v[I].map(Ot=>Ot.value||Ot.variable.value),Sl=I6(jf);if(Sl.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Sl[0]+")");this.$=rr(v[I-1],{variables:v[I]});break;case 14:this.$=rr({queryType:"SELECT"},v[I]&&(v[I-1]=vn(v[I]),v[I]={},v[I][v[I-1]]=!0,v[I]));break;case 16:case 27:this.$=gl(v[I-3],{variable:v[I-1]});break;case 17:case 18:this.$=rr(v[I-3],v[I-2],v[I-1],v[I],{type:"query"});break;case 19:case 58:this.$={iri:v[I],named:!!v[I-1]};break;case 20:this.$={where:v[I].patterns};break;case 21:this.$=rr(v[I-1],v[I]);break;case 22:this.$=rr(v[I-2],v[I-1],v[I]);break;case 23:this.$={group:v[I]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=gl(v[I]);break;case 26:this.$=gl(v[I-1]);break;case 29:this.$={having:v[I]};break;case 30:this.$={order:v[I]};break;case 32:this.$=gl(v[I],{descending:!0});break;case 35:this.$={limit:_l(v[I])};break;case 36:this.$={offset:_l(v[I])};break;case 37:this.$={limit:_l(v[I-2]),offset:_l(v[I])};break;case 38:this.$={limit:_l(v[I]),offset:_l(v[I-2])};break;case 39:case 43:this.$={type:"values",values:v[I]};break;case 40:case 84:this.$=v[I-1].map(Ot=>({[v[I-3]]:Ot}));break;case 41:case 85:this.$=v[I-1].map(()=>({}));break;case 42:case 86:var Ts=v[I-4].length;v[I-4]=v[I-4].map(Rb),this.$=v[I-1].map(function(Ot){if(Ot.length!==Ts)throw Error("Inconsistent VALUES length");for(var Vt={},yt=0;yt<Ts;yt++)Vt["?"+v[I-4][yt].value]=Ot[yt];return Vt});break;case 44:case 65:case 100:case 126:case 175:this.$=v[I-1];break;case 45:this.$={type:"update",updates:co(v[I-2],v[I-1])};break;case 46:this.$=rr({type:"load",silent:!!v[I-2],source:v[I-1]},v[I]&&{destination:v[I]});break;case 47:this.$={type:vn(v[I-2]),silent:!!v[I-1],graph:v[I]};break;case 48:this.$={type:vn(v[I-4]),silent:!!v[I-3],source:v[I-2],destination:v[I]};break;case 49:this.$={type:"create",silent:!!v[I-2],graph:{type:"graph",name:v[I]}};break;case 50:this.$={updateType:"insert",insert:qR(v[I])};break;case 51:this.$={updateType:"delete",delete:jb(qR(v[I]))};break;case 52:this.$={updateType:"deletewhere",delete:jb(v[I])};break;case 53:this.$={updateType:"insertdelete",...v[I-4],...v[I-3],...dc(v[I-2],"using"),where:v[I].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=v[I];break;case 55:this.$={delete:jb(v[I-1]),insert:v[I]||[]};break;case 56:this.$={delete:[],insert:v[I]};break;case 59:this.$={graph:v[I]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:v[I]};break;case 64:this.$={[vn(v[I])]:!0};break;case 66:this.$=v[I-1]?Es(v[I],[v[I-1]]):Es(v[I]);break;case 67:var kf=rr(v[I-3]||{triples:[]},{type:"graph",name:v[I-5]});this.$=v[I]?[kf,v[I]]:[kf];break;case 68:case 73:this.$={type:"bgp",triples:Es(v[I-2],[v[I-1]])};break;case 69:this.$={type:"group",patterns:[v[I-1]]};break;case 70:for(let Ot of v[I-1].filter(Vt=>Vt.type==="bind")){let Vt=v[I-1].indexOf(Ot),yt=new Set;for(let Tt of v[I-1].slice(0,Vt))(Tt.type==="group"||Tt.type==="bgp")&&BR(Tt).forEach(jn=>yt.add(jn));if(yt.has(Ot.variable.value))throw Error("Variable used to bind is already bound (?"+Ot.variable.value+")")}this.$={type:"group",patterns:v[I-1]};break;case 71:this.$=v[I-1]?Es([v[I-1]],v[I]):Es(v[I]);break;case 72:this.$=v[I]?[v[I-2],v[I]]:v[I-2];break;case 75:this.$=rr(v[I],{type:"optional"});break;case 76:this.$=rr(v[I],{type:"minus"});break;case 77:this.$=rr(v[I],{type:"graph",name:v[I-1]});break;case 78:this.$=rr(v[I],{type:"service",name:v[I-1],silent:!!v[I-2]});break;case 79:this.$={type:"filter",expression:v[I]};break;case 80:this.$={type:"bind",variable:v[I-1],expression:v[I-3]};break;case 89:this.$=Nf(v[I]);break;case 90:this.$=void 0;break;case 91:this.$=v[I-1].length?{type:"union",patterns:Es(v[I-1].map(Ob),[Ob(v[I])])}:v[I];break;case 95:this.$={...v[I],function:v[I-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:co(v[I-2],v[I-1]),distinct:!!v[I-3]};break;case 98:case 115:case 128:case 247:case 249:case 251:case 253:case 255:case 263:case 267:case 297:case 299:case 303:case 307:case 328:case 341:case 349:case 355:case 361:case 367:case 369:case 373:case 375:case 379:case 381:case 385:case 391:case 395:case 401:case 405:case 409:case 411:case 420:case 428:case 430:case 440:case 444:case 446:case 448:this.$=[];break;case 99:this.$=co(v[I-2],v[I-1]);break;case 101:this.$=Es(v[I-2],[v[I-1]]);break;case 102:case 112:this.$=Mb(v[I].map(Ot=>rr(lo(v[I-1]),Ot)));break;case 103:this.$=Mb(fc(v[I].map(Ot=>rr(lo(v[I-1].entity),Ot)),v[I-1].triples));break;case 105:this.$=Es([v[I-1]],v[I]);break;case 106:this.$=Es(v[I]);break;case 107:this.$=Fb(v[I-1],v[I]);break;case 109:case 237:this.$=ot.factory.namedNode(m6);break;case 110:case 118:this.$=co(v[I-1],v[I]);break;case 111:this.$=v[I]?{annotation:v[I],object:v[I-1]}:v[I-1];break;case 113:this.$=v[I]?Mb(fc(v[I].map(Ot=>rr(lo(v[I-1].entity),Ot)),v[I-1].triples)):v[I-1].triples;break;case 114:this.$=Fb(...v[I-1],v[I]);break;case 116:this.$=Fb(...v[I]);break;case 117:case 159:case 163:this.$=[v[I-1],v[I]];break;case 119:this.$=v[I]?{object:v[I-1],annotation:v[I]}:v[I-1];break;case 120:this.$=v[I-1].length?yl("|",co(v[I-1],v[I])):v[I];break;case 121:this.$=v[I-1].length?yl("/",co(v[I-1],v[I])):v[I];break;case 122:this.$=v[I]?yl(v[I],[v[I-1]]):v[I-1];break;case 123:this.$=v[I-1]?yl(v[I-1],[v[I]]):v[I];break;case 125:case 131:this.$=yl(v[I-1],[v[I]]);break;case 129:this.$=yl("|",co(v[I-2],v[I-1]));break;case 132:case 134:this.$=v6(v[I-1]);break;case 133:case 135:this.$=T6(v[I-1]);break;case 140:this.$={entity:v[I],triples:[]};break;case 145:this.$=Rb(v[I]);break;case 149:this.$=ot.factory.namedNode(FR);break;case 151:case 153:case 158:case 162:this.$=Cb(v[I-1],v[I]);break;case 152:this.$=["||",v[I]];break;case 154:this.$=["&&",v[I]];break;case 156:this.$=Gr(v[I-1],[v[I-2],v[I]]);break;case 157:this.$=Gr(v[I-2]?"notin":"in",[v[I-3],v[I]]);break;case 160:this.$=["+",Cb(v[I-1],v[I])];break;case 161:var xh=vs(v[I-1].value.replace("-",""),v[I-1].datatype);this.$=["-",Cb(xh,v[I])];break;case 164:this.$=Gr("UPLUS",[v[I]]);break;case 165:this.$=Gr(v[I-1],[v[I]]);break;case 166:this.$=Gr("UMINUS",[v[I]]);break;case 177:this.$=Gr(vn(v[I-1]));break;case 178:this.$=Gr(vn(v[I-3]),[v[I-1]]);break;case 179:this.$=Nf(Gr(vn(v[I-3]),[v[I-1]]));break;case 180:this.$=Gr(vn(v[I-5]),[v[I-3],v[I-1]]);break;case 181:this.$=Gr(vn(v[I-7]),[v[I-5],v[I-3],v[I-1]]);break;case 182:this.$=Nf(Gr(vn(v[I-7]),[v[I-5],v[I-3],v[I-1]]));break;case 183:this.$=Gr(vn(v[I-1]),v[I]);break;case 184:this.$=Gr("bound",[Rb(v[I-1])]);break;case 185:this.$=Gr(v[I-1],[]);break;case 186:this.$=Gr(v[I-3],[v[I-1]]);break;case 187:this.$=Gr(v[I-2]?"notexists":"exists",[Ob(v[I])]);break;case 188:case 189:this.$=gl(v[I-1],{type:"aggregate",aggregation:vn(v[I-4]),distinct:!!v[I-2]});break;case 190:this.$=gl(v[I-2],{type:"aggregate",aggregation:vn(v[I-5]),distinct:!!v[I-3],separator:typeof v[I-1]=="string"?v[I-1]:" "});break;case 192:this.$=vs(v[I]);break;case 193:this.$=b6(v[I-1],vn(v[I].substr(1)));break;case 194:this.$=vs(v[I-2],v[I]);break;case 195:case 204:this.$=vs(v[I],LR);break;case 196:case 205:this.$=vs(v[I],NR);break;case 197:case 206:this.$=vs(vn(v[I]),kR);break;case 200:this.$=vs(v[I].toLowerCase(),_6);break;case 201:this.$=vs(v[I].substr(1),LR);break;case 202:this.$=vs(v[I].substr(1),NR);break;case 203:this.$=vs(v[I].substr(1).toLowerCase(),kR);break;case 207:case 208:this.$=UR(v[I],1);break;case 209:case 210:this.$=UR(v[I],3);break;case 211:this.$=ot.factory.namedNode(Ff(v[I]));break;case 213:var Rh=v[I].indexOf(":"),Mf=v[I].substr(0,Rh),Ch=ot.prefixes[Mf];if(!Ch)throw new Error("Unknown prefix: "+Mf);var Yt=Ff(Ch+v[I].substr(Rh+1));this.$=ot.factory.namedNode(Yt);break;case 214:if(v[I]=v[I].substr(0,v[I].length-1),!(v[I]in ot.prefixes))throw new Error("Unknown prefix: "+v[I]);var Yt=Ff(ot.prefixes[v[I]]);this.$=ot.factory.namedNode(Yt);break;case 215:this.$=Lf(v[I].replace(/^(_:)/,""));break;case 216:this.$=Lf();break;case 217:case 218:case 232:this.$=Nf(Pb(v[I-3],v[I-2],v[I-1]));break;case 230:case 231:this.$=Nf(v[I-1]);break;case 248:case 250:case 252:case 254:case 256:case 260:case 264:case 268:case 270:case 292:case 294:case 296:case 298:case 300:case 302:case 304:case 306:case 329:case 342:case 356:case 368:case 370:case 372:case 374:case 392:case 402:case 425:case 427:case 429:case 431:case 441:case 445:case 447:case 449:v[I-1].push(v[I]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[v[I]];break;case 308:v[I-3].push(v[I-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:v[I-2].push(v[I-1]);break}},"anonymous"),table:[r(e,t,{3:1,4:2,10:3}),{1:[3]},r(n,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:i,16:i,45:i,197:i,224:i,229:i,308:i,24:[1,13],32:[1,14],36:[1,15],41:s}),r([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:o},{6:[2,239]},r(c,[2,411],{216:28,217:29}),r(l,[2,249],{18:30}),r(l,[2,251],{22:31}),r(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16:d,33:35,39:[1,37],44:39,55:40,87:p,139:38,307:43,308:h,323:36},r(l,[2,267],{37:46}),r(_,[2,326],{98:47,103:49,106:50,117:55,130:61,100:[1,48],110:[1,51],113:[1,52],115:[1,53],116:[1,54],131:[1,62],329:[1,56],330:[1,57],331:[1,58],332:[1,59],333:[1,60]}),{39:[1,63],40:64,43:65,44:66,45:y,87:p},r(S,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),r(e,[2,248]),r(e,[2,245]),r(e,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},r([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),r(w,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:T,29:O,52:84,53:A,56:85},{19:88,28:T,29:O,52:89,53:A,56:85},r(l,[2,253],{26:90}),{28:[1,91],52:92,53:A},r(x,[2,385],{181:93,182:94,183:95,31:[2,383]}),r(P,[2,263],{34:96}),r(P,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:p,308:h}),r(P,[2,262]),r(V,[2,259]),r(j,[2,143]),r(j,[2,144]),r([6,13,16,28,29,31,39,45,47,48,53,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,145]),r($,[2,211]),r($,[2,212]),r($,[2,213]),r($,[2,214]),{19:98,28:T,29:O,52:99,53:A,56:85},{6:[2,309],99:100,193:[1,101]},r(K,[2,311],{101:102,328:[1,103]}),r(N,[2,317],{104:104,328:[1,105]}),r(ae,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:we,114:110},{29:we,114:112},{29:we,114:113},{118:114,123:[1,115],125:116,126:te},r(pe,[2,315]),r(pe,[2,316]),r(Y,[2,319]),r(Y,[2,320]),r(Y,[2,321]),r(_,[2,327]),{13:f,16:d,55:118,307:43,308:h},r(l,[2,12]),r(l,[2,13],{44:66,43:119,45:y,87:p}),r(Ee,[2,269]),r(Ee,[2,15]),{13:f,16:d,44:136,45:ie,46:120,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(S,[2,14]),r(S,[2,274]),r(S,[2,271]),r(S,[2,272]),r(e,[2,4]),{13:[1,177]},r(F,[2,39]),{29:[1,178]},{29:[1,179]},{87:[1,181],91:180},{45:[1,187],87:[1,185],89:[1,186],93:182,165:183,166:184},r(c,[2,410]),r([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337],[2,121],{338:[1,188]}),{13:f,16:d,45:[1,193],55:194,197:X,219:189,220:190,223:191,224:[1,192],307:43,308:h},r(w,[2,419]),r(G,B,{20:196,59:197,69:198,70:M}),r(l,[2,250]),{29:k,57:200},r(K,[2,279],{54:202,327:[1,203]}),{29:[2,282]},r(W,H,{23:204,58:205,62:206,63:oe}),r(l,[2,252]),{19:208,28:T,29:O,52:209,53:A,56:85},{29:[1,210]},r(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:me,55:220,82:ne,87:p,89:Re,145:212,172:221,185:213,187:214,231:rt,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(nR,[2,265],{56:85,35:227,52:228,19:229,28:T,29:O,53:A}),r(V,[2,260]),r(W,H,{58:205,62:206,23:230,63:oe}),r(l,[2,268]),{6:[2,45]},r(e,t,{10:3,4:231}),{13:f,16:d,55:232,307:43,308:h},r(K,[2,312]),{105:233,112:iR,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},r(N,[2,318]),r(K,sR,{108:240,133:242,112:oR,132:aR}),r(ae,[2,323]),{112:[1,244]},{112:[2,325]},r(qr,[2,50]),r(x,uh,{135:245,136:246,143:247,144:248,31:cR,112:cR}),r(qr,[2,51]),r(qr,[2,52]),r(la,[2,328],{119:249}),{29:we,114:250},r(la,[2,56]),{29:we,114:251},r(_,[2,59]),r(Ee,[2,270]),{47:[1,252]},r(lR,[2,150]),r(fh,[2,428],{240:253}),r(fl,[2,430],{244:254}),r(fl,[2,155],{248:255,249:256,250:[2,438],290:[1,257],341:[1,258],342:[1,259],343:[1,260],344:[1,261],345:[1,262],346:[1,263]}),r(dl,[2,440],{252:264}),r(Pr,[2,448],{260:265}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,255:154,257:155,264:266,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,255:154,257:155,264:267,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,255:154,257:155,264:268,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(Pr,[2,167]),r(Pr,[2,168]),r(Pr,[2,169]),r(Pr,[2,170],{176:269,45:uR,89:fR}),r(Pr,[2,171]),r(Pr,[2,172]),r(Pr,[2,173]),r(Pr,[2,174]),{13:f,16:d,44:136,45:ie,46:272,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(cr,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:dR,89:pR,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},r(En,[2,192],{292:[1,286],293:[1,287]}),r(En,[2,195]),r(En,[2,196]),r(En,[2,197]),r(En,[2,198]),r(En,[2,199]),r(En,[2,200]),{13:f,16:d,44:39,55:40,82:ne,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},r(Cf,[2,452]),r(Cf,[2,453]),r(Cf,[2,454]),r(Cf,[2,455]),r(Cf,[2,456]),{279:[2,458]},r(dh,[2,207]),r(dh,[2,208]),r(dh,[2,209]),r(dh,[2,210]),r(En,[2,201]),r(En,[2,202]),r(En,[2,203]),r(En,[2,204]),r(En,[2,205]),r(En,[2,206]),r(e,[2,5]),r(ph,[2,297],{88:295}),r(hh,[2,299],{90:296}),{48:[1,297],87:[1,298]},r(mh,[2,301]),r(F,[2,43]),r(F,[2,82]),r(F,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},r(c,[2,412]),r(ic,[2,123]),r(ic,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),r(ws,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:X,223:312,225:308,226:309,229:hR,307:43,308:h},r(c,i,{215:10,214:314}),r(ws,[2,236]),r(ws,[2,237]),r(pl,[2,6]),r(Sb,[2,287],{60:315,72:316,73:[1,317]}),r(G,[2,286]),{13:f,16:d,45:ie,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:b},r([6,31,63,70,73,81,83,85],[2,20]),r(x,mR,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:no,31:no,85:no,112:no,159:no,160:no,161:no,163:no,164:no,41:s}),{13:f,16:d,55:331,307:43,308:h},r(K,[2,280]),r(pl,[2,7]),r(G,B,{59:197,69:198,20:332,70:M}),r(W,[2,284]),{64:[1,333]},r(W,H,{58:205,62:206,23:334,63:oe}),r(l,[2,254]),r(x,uh,{144:248,30:335,143:336,31:[2,257]}),r(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:d,44:39,55:40,87:p,139:342,186:339,190:340,195:341,197:sc,307:43,308:h},r(Of,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:f,16:d,87:p,197:sc,308:h}),r(io,[2,227]),r(io,[2,228]),r(io,[2,229]),{13:f,16:d,44:215,45:me,55:220,82:ne,87:p,89:Re,172:221,185:351,187:350,200:348,230:347,231:rt,234:349,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},{13:f,16:d,44:39,55:40,87:p,139:342,186:352,190:340,195:341,197:sc,307:43,308:h},r(io,[2,146]),r(io,[2,147]),r(io,[2,148]),r(io,[2,149]),{13:f,16:d,44:354,55:355,82:ne,87:p,172:357,237:356,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:358,312:tr,313:353},r(wb,[2,215]),r(wb,[2,216]),r(W,H,{58:205,62:206,23:359,63:oe}),r(P,[2,264]),r(nR,[2,266]),r(pl,[2,11]),r(n,[2,308],{6:[2,310]}),r(qr,[2,313],{102:360,120:361,121:[1,362]}),r(qr,[2,47]),r(qr,[2,63]),r(qr,[2,64]),{13:f,16:d,55:363,307:43,308:h},r(qr,[2,336]),r(qr,[2,337]),r(qr,[2,338]),{109:[1,364]},r(gR,[2,60]),{13:f,16:d,55:365,307:43,308:h},r(K,[2,335]),{13:f,16:d,55:366,307:43,308:h},{31:[1,367]},r(oc,[2,341],{137:368}),r(oc,[2,340]),{13:f,16:d,44:215,45:me,55:220,82:ne,87:p,89:Re,145:369,172:221,185:213,187:214,231:rt,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},{28:[1,370],127:371,128:[1,372]},r(la,[2,330],{124:373,125:374,126:te}),r(la,[2,57]),{44:375,87:p},r(lR,[2,151],{241:376,242:[1,377]}),r(fh,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,247:380,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{250:[1,381]},r(lr,[2,432]),r(lr,[2,433]),r(lr,[2,434]),r(lr,[2,435]),r(lr,[2,436]),r(lr,[2,437]),{250:[2,439]},r([47,48,193,242,246,250,272,290,341,342,343,344,345,346],[2,158],{253:382,254:383,255:384,257:385,263:[1,386],265:[1,387],297:Te,298:xe,299:je,300:ke,301:Ge,302:Me}),r(dl,[2,162],{261:388,262:389,39:Eb,338:vb}),r(Pr,[2,164]),r(Pr,[2,165]),r(Pr,[2,166]),r(cr,[2,95]),r(cr,[2,96]),r(lr,[2,377],{177:392,325:[1,393]}),{48:[1,394]},r(cr,[2,177]),{13:f,16:d,44:136,45:ie,46:395,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:396,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:397,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:398,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:399,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(cr,[2,183]),r(cr,[2,98]),r(lr,[2,381],{180:400}),{87:[1,401]},r(cr,[2,185]),{13:f,16:d,44:136,45:ie,46:402,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{29:k,57:403},r(En,[2,193]),{13:f,16:d,55:404,307:43,308:h},{13:f,16:d,44:39,55:40,87:p,139:342,195:405,197:sc,307:43,308:h},r(ua,[2,233]),r(ua,[2,234]),r(ua,[2,235]),r(yR,[2,459],{281:406,325:[1,407]}),r(lr,[2,463],{284:408,325:[1,409]}),r(lr,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:ne,171:413,172:415,173:416,174:gh,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:yh},{31:[1,419],89:[1,420]},{29:[1,421]},r(mh,[2,302]),r(ph,[2,367],{167:422}),r(hh,[2,369],{168:423}),{48:[1,424],87:[1,425]},r(mh,[2,371]),r(ic,[2,122]),r(ic,[2,417]),r(ic,[2,413]),r(ic,[2,414]),r(ic,[2,415]),r(ws,[2,125]),r(ws,[2,127]),r(ws,[2,128]),r(_R,[2,420],{227:426}),r(ws,[2,130]),{13:f,16:d,55:194,197:X,223:427,307:43,308:h},{48:[1,428]},r(fa,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),r(Sb,[2,288]),{64:[1,433]},r(G,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:f,16:d,45:ie,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,276:ce,277:be,279:Ie,280:Ce,283:Fe,285:De,308:h,346:L,347:U,348:R,349:C,350:D,351:b}),r(bR,[2,293]),r(Tb,[2,92]),r(Tb,[2,93]),r(Tb,[2,94]),{45:uR,89:fR,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:T,29:O,56:85},{19:438,28:T,29:O,56:85},r(ac,[2,355],{149:439}),r(ac,[2,354]),{13:f,16:d,44:215,45:_h,55:220,82:ne,87:p,89:Re,156:440,172:221,185:441,203:442,231:bh,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(P,[2,19]),r(fa,[2,21]),{13:f,16:d,44:450,45:SR,55:323,65:445,66:446,67:447,68:448,87:p,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:b},r(pl,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},r(x,[2,386],{31:[2,388]}),r(Of,[2,102]),r(cc,[2,391],{191:452}),r(x,[2,395],{196:453,198:454}),r(x,[2,108]),r(x,[2,109]),r(Of,[2,103]),r(Of,[2,104]),r(Of,[2,390]),{13:f,16:d,44:215,45:me,48:[1,455],55:220,82:ne,87:p,89:Re,172:221,185:351,187:350,200:456,231:rt,234:349,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(Sh,[2,424]),r(wR,[2,136]),r(wR,[2,137]),r(Ab,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:p,139:342,195:458,197:sc,307:43,308:h},r(ua,[2,219]),r(ua,[2,220]),r(ua,[2,221]),r(ua,[2,222]),r(ua,[2,223]),r(pl,[2,10]),r(qr,[2,46]),r(qr,[2,314]),{112:iR,122:459},r(qr,[2,62]),r(K,sR,{133:242,108:460,112:oR,132:aR}),r(gR,[2,61]),r(qr,[2,49]),r([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},r(oc,[2,351],{146:463,335:[1,464]}),{29:k,57:465},r(la,[2,329]),r(K,[2,332],{129:466,327:[1,467]}),r(la,[2,55]),r(la,[2,331]),{48:[1,468]},r(fh,[2,429]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(fl,[2,431]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,243:470,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(fl,[2,156]),{45:dR,89:pR,179:471},r(dl,[2,441]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,251:472,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(Pr,[2,444],{256:473}),r(Pr,[2,446],{258:474}),r(lr,[2,442]),r(lr,[2,443]),r(Pr,[2,449]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,255:154,257:155,259:475,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(lr,[2,450]),r(lr,[2,451]),r(lr,[2,379],{178:476}),r(lr,[2,378]),r([6,13,16,29,31,39,45,47,48,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,175]),{48:[1,477]},{48:[1,478]},{272:[1,479]},{272:[1,480]},{272:[1,481]},{13:f,16:d,44:136,45:ie,46:482,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{48:[1,483]},{48:[1,484]},r(cr,[2,187]),r(En,[2,194]),{13:f,16:d,44:39,55:40,82:ne,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,320:485},{13:f,16:d,39:[1,487],44:136,45:ie,46:488,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,282:486,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(yR,[2,460]),{13:f,16:d,44:136,45:ie,46:489,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(lr,[2,464]),{13:f,16:d,44:136,45:ie,46:490,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(lr,[2,466]),r(F,[2,40]),r(ph,[2,298]),r(Pf,[2,87]),r(Pf,[2,88]),r(Pf,[2,89]),r(Pf,[2,90]),{13:f,16:d,55:492,82:ne,172:493,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,311:494,312:tr,315:491},r(F,[2,41]),r(hh,[2,300]),r(Df,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:ne,171:497,172:415,173:416,174:gh,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:yh},{31:[1,498],89:[1,499]},{29:[1,500]},r(mh,[2,372]),{13:f,16:d,48:[2,422],55:194,197:X,223:312,226:502,228:501,229:hR,307:43,308:h},r(ws,[2,131]),r(ws,[2,126]),r(fa,[2,22]),r(fa,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:ie,55:323,67:321,68:322,74:505,75:506,76:ER,77:320,78:vR,79:509,87:p,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:b},r(bR,[2,294]),r(TR,[2,69]),r(TR,[2,70]),r(G,B,{59:197,69:198,20:511,70:M}),r(W,H,{58:205,62:206,23:512,63:oe}),{29:[2,375],31:[2,71],84:522,85:o,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},r(ac,[2,363],{157:524,335:[1,525]}),r(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:p}),r(wh,[2,399],{215:10,205:527,208:528,214:529,44:530,204:531,202:532,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:p}),{13:f,16:d,44:215,45:_h,55:220,82:ne,87:p,89:Re,172:221,185:351,203:536,212:534,231:bh,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:p}),r(W,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:d,45:SR,87:p,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,276:ce,277:be,279:Ie,280:Ce,283:Fe,285:De,308:h,346:L,347:U,348:R,349:C,350:D,351:b}),r(lc,[2,291]),r(lc,[2,24]),r(lc,[2,25]),{13:f,16:d,44:136,45:ie,46:539,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(lc,[2,28]),r(W,H,{58:205,62:206,23:540,63:oe}),r([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),r(cc,[2,107]),{13:f,16:d,44:215,45:me,55:220,82:ne,87:p,89:Re,172:221,185:351,187:350,199:543,200:544,231:rt,234:349,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(AR,[2,132]),r(Sh,[2,425]),r(AR,[2,133]),{13:f,16:d,44:354,55:355,82:ne,87:p,172:357,237:356,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:358,312:tr,313:545},r(qr,[2,54]),r(qr,[2,48]),r(oc,[2,342]),{13:f,16:d,44:39,55:40,87:p,139:546,307:43,308:h},r(oc,[2,68]),r(x,[2,350],{31:IR,112:IR}),r(qr,[2,53]),{13:f,16:d,55:547,307:43,308:h},r(K,[2,333]),r(Ee,[2,16]),r(fh,[2,152]),r(fl,[2,154]),r(fl,[2,157]),r(dl,[2,159]),r(dl,[2,160],{262:389,261:548,39:Eb,338:vb}),r(dl,[2,161],{262:389,261:549,39:Eb,338:vb}),r(Pr,[2,163]),{13:f,16:d,44:136,45:ie,46:550,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(cr,[2,178]),r(cr,[2,179]),{13:f,16:d,44:136,45:ie,46:551,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:552,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:553,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{48:[1,554],272:[1,555]},r(cr,[2,184]),r(cr,[2,186]),{314:[1,556]},{48:[1,557]},{48:[2,461]},{48:[2,462]},{48:[1,558]},{48:[2,467],193:[1,561],287:559,288:560},{13:f,16:d,55:194,197:X,223:562,307:43,308:h},r(Ib,[2,224]),r(Ib,[2,225]),r(Ib,[2,226]),{31:[1,563],45:xR,94:564},r(F,[2,84]),r(ph,[2,368]),r(F,[2,85]),r(hh,[2,370]),r(Df,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},r(fa,[2,35],{83:[1,569]}),r(fa,[2,36],{81:[1,570]}),r(Sb,[2,30],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:509,44:510,75:571,13:f,16:d,45:ie,76:ER,78:vR,87:p,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,276:ce,277:be,279:Ie,280:Ce,283:Fe,285:De,308:h,346:L,347:U,348:R,349:C,350:D,351:b}),r(hl,[2,295]),{45:ie,77:572},{45:ie,77:573},r(hl,[2,33]),r(hl,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},r(ac,[2,356]),r(RR,[2,357],{152:578,335:[1,579]}),r(so,[2,74]),{29:k,57:580},{29:k,57:581},{13:f,16:d,44:39,55:40,87:p,139:582,307:43,308:h},r(CR,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:ie,55:323,67:321,68:322,77:320,79:585,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:b},{45:[1,586]},r(so,[2,81]),{29:k,57:587},r(ac,[2,73]),r(x,[2,362],{29:oo,31:oo,85:oo,112:oo,159:oo,160:oo,161:oo,163:oo,164:oo}),r(wh,[2,112]),r(ml,[2,401],{206:588}),r(x,[2,405],{209:589,210:590}),r(x,[2,403]),r(x,[2,404]),r(wh,[2,113]),r(wh,[2,400]),{13:f,16:d,44:215,45:_h,48:[1,591],55:220,82:ne,87:p,89:Re,172:221,185:351,203:536,212:592,231:bh,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(Sh,[2,426]),r(Ab,[2,138]),r(Ab,[2,139]),{232:[1,593]},r(lc,[2,292]),{47:[1,595],48:[1,594]},r(pl,[2,9]),r(cc,[2,392]),r(cc,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:p,197:sc,308:h}),r(cc,[2,110],{272:[1,598]}),r(Eh,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},r(la,[2,58]),r(Pr,[2,445]),r(Pr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},r(cr,[2,99]),r(lr,[2,382]),r([13,16,39,47,48,87,193,197,242,246,250,263,265,272,290,297,298,299,300,301,302,308,314,338,341,342,343,344,345,346],[2,232]),r(cr,[2,188]),r(cr,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:ne,172:493,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,311:494,312:tr,315:611},r(F,[2,42]),r(Df,[2,304]),{13:f,16:d,55:414,82:ne,95:612,171:613,172:415,173:416,174:gh,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:yh},{31:[1,614],45:xR,94:615},r(ws,[2,129]),r(_R,[2,421]),{82:[1,616]},{82:[1,617]},r(hl,[2,296]),r(hl,[2,31]),r(hl,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},r(x,mR,{155:330,153:618,154:619,29:ao,31:ao,85:ao,112:ao,159:ao,160:ao,161:ao,163:ao,164:ao}),r(RR,[2,358]),r(so,[2,75]),r(so,[2,76]),{29:k,57:620},{13:f,16:d,44:39,55:40,87:p,139:621,307:43,308:h},r(CR,[2,366]),r(so,[2,79]),{13:f,16:d,44:136,45:ie,46:622,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(so,[2,91],{336:[1,623]}),r([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),r(ml,[2,117]),{13:f,16:d,44:215,45:_h,55:220,82:ne,87:p,89:Re,172:221,185:351,203:536,211:626,212:627,231:bh,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(io,[2,134]),r(Sh,[2,427]),r(io,[2,135]),r(lc,[2,26]),{44:628,87:p},r(cc,[2,106]),r(cc,[2,394]),r(x,[2,396]),r(Eh,[2,111]),r(Eh,[2,398]),{13:f,16:d,44:39,55:40,87:p,139:342,186:629,190:340,195:341,197:sc,307:43,308:h},r(wb,[2,217]),r(x,uh,{144:248,140:630,143:631,31:[2,343]}),r(cr,[2,97]),r(lr,[2,380]),r(cr,[2,180]),{13:f,16:d,44:136,45:ie,46:632,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:633,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ge,264:130,265:Z,266:137,267:139,268:ye,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(cr,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:ne,171:637,172:415,173:416,174:gh,255:154,257:155,291:150,294:Ae,295:ee,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:yh},r(OR,[2,305]),r(F,[2,86]),r(Df,[2,374]),r(fa,[2,37]),r(fa,[2,38]),r(ac,[2,72]),r(ac,[2,360]),r(so,[2,77]),{29:k,57:638},{47:[1,639]},{29:[2,376]},r(ml,[2,402]),r(ml,[2,115],{215:10,208:528,214:529,44:530,205:640,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:p}),r(ml,[2,118],{272:[1,641]}),r(vh,[2,407],{213:642,319:643,317:[1,644]}),{48:[1,645]},{318:[1,646]},{31:[1,647]},{31:[2,344]},{48:[1,648]},{48:[1,649]},{291:650,303:We,304:Ve,305:$e,306:He},r(Pf,[2,218]),r(Df,[2,44]),r(OR,[2,306]),r(so,[2,78]),{44:651,87:p},r(ml,[2,116]),r(x,[2,406]),r(vh,[2,119]),r(vh,[2,408]),r(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:p}),r(lc,[2,27]),r(Eh,[2,230]),r(PR,[2,345],{141:653,335:[1,654]}),r(cr,[2,181]),r(cr,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},r(x,uh,{144:248,142:657,143:658,31:DR,112:DR}),r(PR,[2,346]),r(so,[2,80]),r(vh,[2,231]),r(oc,[2,67]),r(oc,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:a(function(q,J){if(J.recoverable)this.trace(q);else{var le=new Error(q);throw le.hash=J,le}},"parseError"),parse:a(function(q){var J=this,le=[0],Be=[],nt=[null],v=[],Tn=this.table,I="",Ts=0,kf=0,xh=0,Rh=2,Mf=1,Ch=v.slice.call(arguments,1),Yt=Object.create(this.lexer),As={yy:{}};for(var jf in this.yy)Object.prototype.hasOwnProperty.call(this.yy,jf)&&(As.yy[jf]=this.yy[jf]);Yt.setInput(q,As.yy),As.yy.lexer=Yt,As.yy.parser=this,typeof Yt.yylloc>"u"&&(Yt.yylloc={});var Sl=Yt.yylloc;v.push(Sl);var Ot=Yt.options&&Yt.options.ranges;typeof As.yy.parseError=="function"?this.parseError=As.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(Is){le.length=le.length-2*Is,nt.length=nt.length-Is,v.length=v.length-Is}a(Vt,"popStack");for(var yt=a(function(){var Is;return Is=Yt.lex()||Mf,typeof Is!="number"&&(Is=J.symbols_[Is]||Is),Is},"lex"),Tt,jn,pc,mi,Qfe,$b,wl={},Oh,uo,GR,Ph;;){if(pc=le[le.length-1],this.defaultActions[pc]?mi=this.defaultActions[pc]:((Tt===null||typeof Tt>"u")&&(Tt=yt()),mi=Tn[pc]&&Tn[pc][Tt]),typeof mi>"u"||!mi.length||!mi[0]){var Ub="";Ph=[];for(Oh in Tn[pc])this.terminals_[Oh]&&Oh>Rh&&Ph.push("'"+this.terminals_[Oh]+"'");Yt.showPosition?Ub="Parse error on line "+(Ts+1)+`:
|
|
33
|
+
`)}a(H7,"composeErrorMessage");function z7(r,e,t){let[,n=null]=r.toString().match(/constructor\(([\w, ]+)\)/)||[],i=W7(n,e);return H7(`Cannot inject the dependency ${i} of "${r.name}" constructor. Reason:`,t)}a(z7,"formatErrorCtor");ym.formatErrorCtor=z7});var oO=E(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.isDisposable=void 0;function K7(r){return!(typeof r.dispose!="function"||r.dispose.length>0)}a(K7,"isDisposable");_m.isDisposable=K7});var cO=E(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.PostResolutionInterceptors=Ec.PreResolutionInterceptors=void 0;var aO=dw(),bm=class extends aO.default{static{a(this,"PreResolutionInterceptors")}};Ec.PreResolutionInterceptors=bm;var Sm=class extends aO.default{static{a(this,"PostResolutionInterceptors")}};Ec.PostResolutionInterceptors=Sm;var _w=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new bm,this.postResolution=new Sm}};Ec.default=_w});var ma=E(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.instance=mo.typeInfo=void 0;var Y7=(cm(),Dh(am)),An=lw(),Q7=nO(),wm=pm(),X7=iO(),Vn=nw(),Em=sO(),J7=yw(),Z7=dm(),e8=oO(),t8=cO();mo.typeInfo=new Map;var bw=class r{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new X7.default,this.interceptors=new t8.default,this.disposed=!1,this.disposables=new Set}register(e,t,n={lifecycle:Vn.default.Transient}){this.ensureNotDisposed();let i;if(Q7.isProvider(t)?i=t:i={useClass:t},An.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let c=o.useToken;if(s.includes(c))throw new Error(`Token registration cycle detected! ${[...s,c].join(" -> ")}`);s.push(c);let l=this._registry.get(c);l&&An.isTokenProvider(l.provider)?o=l.provider:o=null}}if((n.lifecycle===Vn.default.Singleton||n.lifecycle==Vn.default.ContainerScoped||n.lifecycle==Vn.default.ResolutionScoped)&&(An.isValueProvider(i)||An.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Vn.default[n.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:n}),this}registerType(e,t){return this.ensureNotDisposed(),An.isNormalToken(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})}registerInstance(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})}registerSingleton(e,t){if(this.ensureNotDisposed(),An.isNormalToken(e)){if(An.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Vn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Vn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let n=e;return t&&!An.isNormalToken(t)&&(n=t),this.register(e,{useClass:n},{lifecycle:Vn.default.Singleton})}resolve(e,t=new Em.default,n=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&An.isNormalToken(e)){if(n)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),i){let s=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(wm.isConstructorToken(e)){let s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,t){if(this.interceptors.preResolution.has(e)){let n=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&n.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,n)}}executePostResolutionInterceptor(e,t,n){if(this.interceptors.postResolution.has(e)){let i=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&i.push(s),s.callback(e,t,n);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Vn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let n=e.options.lifecycle===Vn.default.Singleton,i=e.options.lifecycle===Vn.default.ContainerScoped,s=n||i,o;return An.isValueProvider(e.provider)?o=e.provider.useValue:An.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):An.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):An.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Vn.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new Em.default,n=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&An.isNormalToken(e)){if(n)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,o,"All"),o}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(n=>!An.isValueProvider(n.provider)).map(n=>(n.instance=void 0,n)))}createChildContainer(){this.ensureNotDisposed();let e=new r(this);for(let[t,n]of this._registry.entries())n.some(({options:i})=>i.lifecycle===Vn.default.ContainerScoped)&&e._registry.setAll(t,n.map(i=>i.options.lifecycle===Vn.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,n={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:n})}afterResolution(e,t,n={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:n})}dispose(){return Y7.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let n=t.dispose();n&&e.push(n)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,t){if(e instanceof Z7.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let n=(()=>{let i=mo.typeInfo.get(e);if(!i||i.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=i.map(this.resolveParams(t,e));return new e(...s)})();return e8.isDisposable(n)&&this.disposables.add(n),n}resolveParams(e,t){return(n,i)=>{try{return wm.isTokenDescriptor(n)?wm.isTransformDescriptor(n)?n.multiple?this.resolve(n.transform).transform(this.resolveAll(n.token,new Em.default,n.isOptional),...n.transformArgs):this.resolve(n.transform).transform(this.resolve(n.token,e,n.isOptional),...n.transformArgs):n.multiple?this.resolveAll(n.token,new Em.default,n.isOptional):this.resolve(n.token,e,n.isOptional):wm.isTransformDescriptor(n)?this.resolve(n.transform,e).transform(this.resolve(n.token,e),...n.transformArgs):this.resolve(n,e)}catch(s){throw new Error(J7.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};mo.instance=new bw;mo.default=mo.instance});var lO=E(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});var r8=Sc(),go=ma(),Sw=pm(),n8=yw();function i8(){return function(r){let e=r8.getParamInfo(r);return class extends r{constructor(...t){super(...t.concat(e.slice(t.length).map((n,i)=>{try{return Sw.isTokenDescriptor(n)?Sw.isTransformDescriptor(n)?n.multiple?go.instance.resolve(n.transform).transform(go.instance.resolveAll(n.token),...n.transformArgs):go.instance.resolve(n.transform).transform(go.instance.resolve(n.token),...n.transformArgs):n.multiple?go.instance.resolveAll(n.token):go.instance.resolve(n.token):Sw.isTransformDescriptor(n)?go.instance.resolve(n.transform).transform(go.instance.resolve(n.token),...n.transformArgs):go.instance.resolve(n)}catch(s){let o=i+t.length;throw new Error(n8.formatErrorCtor(r,o,s))}})))}}}}a(i8,"autoInjectable");ww.default=i8});var uO=E(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});var s8=Sc();function o8(r,e){let t={token:r,multiple:!1,isOptional:e&&e.isOptional};return s8.defineInjectionTokenMetadata(t)}a(o8,"inject");Ew.default=o8});var vm=E(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var a8=Sc(),c8=ma(),fO=ma();function l8(r){return function(e){c8.typeInfo.set(e,a8.getParamInfo(e)),r&&r.token&&(Array.isArray(r.token)?r.token.forEach(t=>{fO.instance.register(t,e)}):fO.instance.register(r.token,e))}}a(l8,"injectable");vw.default=l8});var dO=E(Tw=>{"use strict";Object.defineProperty(Tw,"__esModule",{value:!0});var u8=(cm(),Dh(am)),f8=ma();function d8(r=[]){return function(e){return r.forEach(t=>{var{token:n,options:i}=t,s=u8.__rest(t,["token","options"]);return f8.instance.register(n,s,i)}),e}}a(d8,"registry");Tw.default=d8});var pO=E(Aw=>{"use strict";Object.defineProperty(Aw,"__esModule",{value:!0});var p8=vm(),h8=ma();function m8(){return function(r){p8.default()(r),h8.instance.registerSingleton(r)}}a(m8,"singleton");Aw.default=m8});var hO=E(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var g8=Sc();function y8(r,e){let t={token:r,multiple:!0,isOptional:e&&e.isOptional};return g8.defineInjectionTokenMetadata(t)}a(y8,"injectAll");Iw.default=y8});var mO=E(xw=>{"use strict";Object.defineProperty(xw,"__esModule",{value:!0});var _8=Sc();function b8(r,e,...t){let n={token:r,multiple:!0,transform:e,transformArgs:t};return _8.defineInjectionTokenMetadata(n)}a(b8,"injectAllWithTransform");xw.default=b8});var gO=E(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var S8=Sc();function w8(r,e,...t){return S8.defineInjectionTokenMetadata(r,{transformToken:e,args:t})}a(w8,"injectWithTransform");Rw.default=w8});var yO=E(Cw=>{"use strict";Object.defineProperty(Cw,"__esModule",{value:!0});var E8=vm(),v8=ma();function T8(r,e){return function(t){E8.default()(t),v8.instance.register(e||t,t,{lifecycle:r})}}a(T8,"scoped");Cw.default=T8});var _O=E(Li=>{"use strict";Object.defineProperty(Li,"__esModule",{value:!0});var A8=lO();Object.defineProperty(Li,"autoInjectable",{enumerable:!0,get:a(function(){return A8.default},"get")});var I8=uO();Object.defineProperty(Li,"inject",{enumerable:!0,get:a(function(){return I8.default},"get")});var x8=vm();Object.defineProperty(Li,"injectable",{enumerable:!0,get:a(function(){return x8.default},"get")});var R8=dO();Object.defineProperty(Li,"registry",{enumerable:!0,get:a(function(){return R8.default},"get")});var C8=pO();Object.defineProperty(Li,"singleton",{enumerable:!0,get:a(function(){return C8.default},"get")});var O8=hO();Object.defineProperty(Li,"injectAll",{enumerable:!0,get:a(function(){return O8.default},"get")});var P8=mO();Object.defineProperty(Li,"injectAllWithTransform",{enumerable:!0,get:a(function(){return P8.default},"get")});var D8=gO();Object.defineProperty(Li,"injectWithTransform",{enumerable:!0,get:a(function(){return D8.default},"get")});var F8=yO();Object.defineProperty(Li,"scoped",{enumerable:!0,get:a(function(){return F8.default},"get")})});var bO=E(Ow=>{"use strict";Object.defineProperty(Ow,"__esModule",{value:!0});function L8(r){let e;return t=>(e==null&&(e=r(t)),e)}a(L8,"instanceCachingFactory");Ow.default=L8});var SO=E(Pw=>{"use strict";Object.defineProperty(Pw,"__esModule",{value:!0});function N8(r){let e=new WeakMap;return t=>{let n=e.get(t);return n==null&&(n=r(t),e.set(t,n)),n}}a(N8,"instancePerContainerCachingFactory");Pw.default=N8});var wO=E(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});function k8(r,e,t,n=!0){let i,s;return o=>{let c=r(o);return(!n||s!==c)&&((s=c)?i=o.resolve(e):i=o.resolve(t)),i}}a(k8,"predicateAwareClassFactory");Dw.default=k8});var EO=E(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var M8=bO();Object.defineProperty(sd,"instanceCachingFactory",{enumerable:!0,get:a(function(){return M8.default},"get")});var j8=SO();Object.defineProperty(sd,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return j8.default},"get")});var $8=wO();Object.defineProperty(sd,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return $8.default},"get")})});var Ze=E(ga=>{"use strict";Object.defineProperty(ga,"__esModule",{value:!0});var Fw=(cm(),Dh(am));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var U8=rO();Object.defineProperty(ga,"Lifecycle",{enumerable:!0,get:a(function(){return U8.Lifecycle},"get")});Fw.__exportStar(_O(),ga);Fw.__exportStar(EO(),ga);Fw.__exportStar(lw(),ga);var B8=dm();Object.defineProperty(ga,"delay",{enumerable:!0,get:a(function(){return B8.delay},"get")});var V8=ma();Object.defineProperty(ga,"container",{enumerable:!0,get:a(function(){return V8.instance},"get")})});var Al=E(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.NullLogger=void 0;Tm.NullLogger={debug(){},info(){},warn(){},error(){}}});var xl=E(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.bytesToBase64=TO;Il.base64ToBytes=AO;Il.base64ToUtf8=q8;Il.utf8ToBase64=G8;var vO=32768;function TO(r){let e="";for(let t=0;t<r.length;t+=vO)e+=String.fromCharCode(...r.subarray(t,t+vO));return btoa(e)}a(TO,"bytesToBase64");function AO(r){let e=r.replace(/\s/g,""),t=e.length%4,n=t===2||t===3?e+"=".repeat(4-t):e,i=atob(n),s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s}a(AO,"base64ToBytes");function q8(r){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(AO(r))}a(q8,"base64ToUtf8");function G8(r){return TO(new TextEncoder().encode(r))}a(G8,"utf8ToBase64")});var od=E(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});Lw.iriToObsidianName=W8;function W8(r){let e=r.match(/^https:\/\/exocortex\.my\/ontology\/([a-z][a-zA-Z0-9]*)#([^#]+)$/);if(e){let[,n,i]=e;return`${n}__${i}`}let t=r.match(/\/([^/]+)\.md$/);return t?t[1]:null}a(W8,"iriToObsidianName")});var IO=E(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.registerUniversalDefaultLoader=H8;ya.clearUniversalDefaultLoader=z8;ya.clearUniversalDefault=K8;ya.loadUniversalDefault=Y8;ya.mergePropertyDefaults=Q8;ya.mergeInheritanceRules=X8;var Am=null,yo,ad=!1;function H8(r){Am=r,yo=void 0,ad=!1}a(H8,"registerUniversalDefaultLoader");function z8(){Am=null,yo=void 0,ad=!1}a(z8,"clearUniversalDefaultLoader");function K8(){yo=void 0,ad=!1}a(K8,"clearUniversalDefault");async function Y8(){if(yo!==void 0)return yo;if(!Am)return yo=null,null;try{yo=await Am()??null}catch(r){ad||(console.warn("[UniversalDefaultTemplateResolver] loader threw, falling back to legacy primitives:",r),ad=!0),yo=null}return yo}a(Y8,"loadUniversalDefault");function Q8(r,e){let t=new Map;for(let s of e)t.set(s.propertyName,s);let n=[],i=new Set;for(let s of r){let o=t.get(s.propertyName);o?(n.push(o),i.add(o.propertyName)):n.push(s)}for(let s of e)i.has(s.propertyName)||n.push(s);return n}a(Q8,"mergePropertyDefaults");function X8(r,e){let t=new Map;for(let s of e)t.set(s.targetPropertyName,s);let n=[],i=new Set;for(let s of r){let o=t.get(s.targetPropertyName);o?(n.push(o),i.add(o.targetPropertyName)):n.push(s)}for(let s of e)i.has(s.targetPropertyName)||n.push(s);return n}a(X8,"mergeInheritanceRules")});var Nw=E((Nme,xO)=>{var Rl=class{static{a(this,"Wildcard")}constructor(){return J8||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(Rl.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(Rl.prototype,"termType",{enumerable:!0,value:"Wildcard"});var J8=new Rl;xO.exports.Wildcard=Rl});var CO=E((Mme,RO)=>{var Z8=(function(){var r=a(function(z,q,J,le){for(J=J||{},le=z.length;le--;J[z[le]]=q);return J},"o"),e=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],t=[2,247],n=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],o=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],d=[1,45],p=[1,41],h=[1,44],_=[123,126],y=[1,67],S=[39,45,87],w=[13,16,45,197,224,308],T=[1,87],O=[2,281],A=[1,86],x=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],P=[6,28,29,53,63,70,73,81,83,85],V=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],j=[6,13,16,28,29,45,53,63,70,73,81,82,83,85,87,89,197,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314],$=[6,13,16,28,29,31,39,45,47,48,53,63,70,73,81,82,83,85,87,89,109,112,121,123,126,128,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,337,338,340,341,342,343,344,345,346],K=[13,16,308],N=[112,132,327,334],ae=[13,16,112,132,308],we=[1,111],ee=[1,117],pe=[112,132,327,328,334],Y=[13,16,112,132,308,328],Ee=[28,29,45,53,87],ie=[1,138],ne=[1,151],de=[1,128],ye=[1,127],te=[1,129],me=[1,140],Pe=[1,141],se=[1,142],_e=[1,143],Ne=[1,144],Q=[1,145],ce=[1,147],be=[1,148],Ie=[2,457],Ce=[1,158],Fe=[1,159],De=[1,160],Ae=[1,152],Z=[1,153],he=[1,156],Te=[1,171],xe=[1,172],je=[1,173],ke=[1,174],Ge=[1,175],Me=[1,176],We=[1,167],Ve=[1,168],$e=[1,169],He=[1,170],m=[1,157],L=[1,166],U=[1,161],R=[1,162],C=[1,163],D=[1,164],b=[1,165],F=[6,13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],X=[1,195],G=[6,31,73,81,83,85],B=[2,285],M=[1,199],k=[1,201],W=[6,31,70,73,81,83,85],H=[2,283],oe=[1,207],ge=[1,218],Re=[1,223],rt=[1,219],Vr=[1,225],Er=[1,226],tr=[1,224],nR=[6,63,70,73,81,83,85],iR=[1,236],sR=[2,334],oR=[1,243],aR=[1,241],qr=[6,193],uh=[2,349],cR=[2,339],la=[28,128],lR=[47,48,193,272],fh=[47,48,193,242,272],fl=[47,48,193,242,246,272],dl=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Pr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],uR=[1,271],fR=[1,270],cr=[6,13,16,29,31,39,45,47,48,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],dR=[1,281],pR=[1,280],En=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],Cf=[45,89],dh=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],ph=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],hh=[31,89],mh=[48,87],ic=[6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338],ws=[6,13,16,39,45,48,82,87,89,231,263,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338,340],hR=[1,313],pl=[6,85],Sb=[6,31,81,83,85],mR=[2,361],no=[2,353],sc=[1,343],Of=[31,112,335],io=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],wb=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335],gR=[6,109,193],oc=[31,112],lr=[13,16,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],Eb=[1,390],vb=[1,391],ua=[13,16,87,197,308,314],yR=[13,16,39,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],gh=[1,417],yh=[1,418],_R=[13,16,48,197,229,308],fa=[6,31,85],bR=[6,13,16,31,45,73,81,83,85,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Tb=[6,13,16,29,31,45,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,231,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,346,347,348,349,350,351],ac=[29,31,85,112,159,160,161,163,164],_h=[1,443],bh=[1,444],SR=[1,449],cc=[31,112,193,232,318,335],Sh=[13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],wR=[13,16,31,45,48,82,87,89,112,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Ab=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Pf=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Df=[31,45],ER=[1,507],vR=[1,508],TR=[6,13,16,29,31,39,45,47,48,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,336,338,341,342,343,344,345,346,347,348,349,350,351],wh=[29,31,85,112,159,160,161,163,164,335],lc=[6,13,16,31,45,70,73,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],AR=[13,16,31,45,48,82,87,89,112,193,197,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],IR=[2,352],Ib=[13,16,197,308,314],xR=[1,565],hl=[6,13,16,31,45,76,78,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],RR=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],so=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],CR=[13,16,87,308],oo=[2,364],ml=[29,31,85,112,159,160,161,163,164,193,232,318,335],Eh=[31,112,193,232,272,318,335],ao=[2,359],OR=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],vh=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],PR=[13,16,31,45,82,87,89,112,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],DR=[2,347],xb={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:a(function(q,J,le,Be,nt,v,Tn){var I=v.length-1;switch(nt){case 1:if(v[I-1]=v[I-1]||{},ot.base&&(v[I-1].base=ot.base),ot.base="",v[I-1].prefixes=ot.prefixes,ot.prefixes=null,ot.pathOnly){if(v[I-1].type==="path"||"termType"in v[I-1])return v[I-1];throw new Error("Received full SPARQL query in path only mode")}else if(v[I-1].type==="path"||"termType"in v[I-1])throw new Error("Received only path in full SPARQL mode");if(v[I-1].type==="update"){let Ot={};for(let Vt of v[I-1].updates)if(Vt.updateType==="insert"){let yt={};for(let Tt of Vt.insert)if(Tt.type==="bgp"||Tt.type==="graph")for(let jn of Tt.triples)jn.subject.termType==="BlankNode"&&(yt[jn.subject.value]=!0),jn.predicate.termType==="BlankNode"&&(yt[jn.predicate.value]=!0),jn.object.termType==="BlankNode"&&(yt[jn.object.value]=!0);for(let Tt of Object.keys(yt)){if(Ot[Tt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");Ot[Tt]=!0}}}return v[I-1];case 2:this.$={...v[I-1],...v[I],type:"query"};break;case 4:ot.base=Ff(v[I]);break;case 5:ot.prefixes||(ot.prefixes={}),v[I-1]=v[I-1].substr(0,v[I-1].length-1),v[I]=Ff(v[I]),ot.prefixes[v[I-1]]=v[I];break;case 6:this.$={...v[I-3],...dc(v[I-2]),...v[I-1],...v[I]};break;case 7:if(!ot.skipValidation&&(Nb(v[I-3].variables.map(Vt=>Lb(Vt.expression))).some(Vt=>Vt.aggregation==="count"&&!(Vt.expression instanceof Th))||v[I].group)){for(let Vt of v[I-3].variables)if(Vt.termType==="Variable"){if(!v[I].group||!v[I].group.map(yt=>bl(yt)).includes(bl(Vt)))throw Error("Projection of ungrouped variable (?"+bl(Vt)+")")}else if(Lb(Vt.expression).length===0){let yt=A6(Vt.expression);for(let Tt of yt)if(!v[I].group||!v[I].group.map||!v[I].group.map(jn=>bl(jn)).includes(bl(Tt)))throw Error("Use of ungrouped variable in projection of operation (?"+bl(Tt)+")")}}let As=v[I-1].where.filter(Ot=>Ot.type==="query");if(As.length>0){let Ot=v[I-3].variables.filter(yt=>yt.variable&&yt.variable.value).map(yt=>yt.variable.value),Vt=Nb(As.map(yt=>yt.variables)).map(yt=>yt.value||yt.variable.value);for(let yt of Ot)if(Vt.indexOf(yt)>=0)throw Error("Target id of 'AS' (?"+yt+") already used in subquery")}this.$=rr(v[I-3],dc(v[I-2]),v[I-1],v[I]);break;case 8:this.$=rr({queryType:"CONSTRUCT",template:v[I-3]},dc(v[I-2]),v[I-1],v[I]);break;case 9:this.$=rr({queryType:"CONSTRUCT",template:v[I-2]=v[I-2]?v[I-2].triples:[]},dc(v[I-5]),{where:[{type:"bgp",triples:fc([],v[I-2])}]},v[I]);break;case 10:this.$=rr({queryType:"DESCRIBE",variables:v[I-3]==="*"?[new Th]:v[I-3]},dc(v[I-2]),v[I-1],v[I]);break;case 11:this.$=rr({queryType:"ASK"},dc(v[I-2]),v[I-1],v[I]);break;case 12:this.$=rr(v[I-1],{variables:[new Th]});break;case 13:let jf=v[I].map(Ot=>Ot.value||Ot.variable.value),Sl=I6(jf);if(Sl.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Sl[0]+")");this.$=rr(v[I-1],{variables:v[I]});break;case 14:this.$=rr({queryType:"SELECT"},v[I]&&(v[I-1]=vn(v[I]),v[I]={},v[I][v[I-1]]=!0,v[I]));break;case 16:case 27:this.$=gl(v[I-3],{variable:v[I-1]});break;case 17:case 18:this.$=rr(v[I-3],v[I-2],v[I-1],v[I],{type:"query"});break;case 19:case 58:this.$={iri:v[I],named:!!v[I-1]};break;case 20:this.$={where:v[I].patterns};break;case 21:this.$=rr(v[I-1],v[I]);break;case 22:this.$=rr(v[I-2],v[I-1],v[I]);break;case 23:this.$={group:v[I]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=gl(v[I]);break;case 26:this.$=gl(v[I-1]);break;case 29:this.$={having:v[I]};break;case 30:this.$={order:v[I]};break;case 32:this.$=gl(v[I],{descending:!0});break;case 35:this.$={limit:_l(v[I])};break;case 36:this.$={offset:_l(v[I])};break;case 37:this.$={limit:_l(v[I-2]),offset:_l(v[I])};break;case 38:this.$={limit:_l(v[I]),offset:_l(v[I-2])};break;case 39:case 43:this.$={type:"values",values:v[I]};break;case 40:case 84:this.$=v[I-1].map(Ot=>({[v[I-3]]:Ot}));break;case 41:case 85:this.$=v[I-1].map(()=>({}));break;case 42:case 86:var Ts=v[I-4].length;v[I-4]=v[I-4].map(Rb),this.$=v[I-1].map(function(Ot){if(Ot.length!==Ts)throw Error("Inconsistent VALUES length");for(var Vt={},yt=0;yt<Ts;yt++)Vt["?"+v[I-4][yt].value]=Ot[yt];return Vt});break;case 44:case 65:case 100:case 126:case 175:this.$=v[I-1];break;case 45:this.$={type:"update",updates:co(v[I-2],v[I-1])};break;case 46:this.$=rr({type:"load",silent:!!v[I-2],source:v[I-1]},v[I]&&{destination:v[I]});break;case 47:this.$={type:vn(v[I-2]),silent:!!v[I-1],graph:v[I]};break;case 48:this.$={type:vn(v[I-4]),silent:!!v[I-3],source:v[I-2],destination:v[I]};break;case 49:this.$={type:"create",silent:!!v[I-2],graph:{type:"graph",name:v[I]}};break;case 50:this.$={updateType:"insert",insert:qR(v[I])};break;case 51:this.$={updateType:"delete",delete:jb(qR(v[I]))};break;case 52:this.$={updateType:"deletewhere",delete:jb(v[I])};break;case 53:this.$={updateType:"insertdelete",...v[I-4],...v[I-3],...dc(v[I-2],"using"),where:v[I].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=v[I];break;case 55:this.$={delete:jb(v[I-1]),insert:v[I]||[]};break;case 56:this.$={delete:[],insert:v[I]};break;case 59:this.$={graph:v[I]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:v[I]};break;case 64:this.$={[vn(v[I])]:!0};break;case 66:this.$=v[I-1]?Es(v[I],[v[I-1]]):Es(v[I]);break;case 67:var kf=rr(v[I-3]||{triples:[]},{type:"graph",name:v[I-5]});this.$=v[I]?[kf,v[I]]:[kf];break;case 68:case 73:this.$={type:"bgp",triples:Es(v[I-2],[v[I-1]])};break;case 69:this.$={type:"group",patterns:[v[I-1]]};break;case 70:for(let Ot of v[I-1].filter(Vt=>Vt.type==="bind")){let Vt=v[I-1].indexOf(Ot),yt=new Set;for(let Tt of v[I-1].slice(0,Vt))(Tt.type==="group"||Tt.type==="bgp")&&BR(Tt).forEach(jn=>yt.add(jn));if(yt.has(Ot.variable.value))throw Error("Variable used to bind is already bound (?"+Ot.variable.value+")")}this.$={type:"group",patterns:v[I-1]};break;case 71:this.$=v[I-1]?Es([v[I-1]],v[I]):Es(v[I]);break;case 72:this.$=v[I]?[v[I-2],v[I]]:v[I-2];break;case 75:this.$=rr(v[I],{type:"optional"});break;case 76:this.$=rr(v[I],{type:"minus"});break;case 77:this.$=rr(v[I],{type:"graph",name:v[I-1]});break;case 78:this.$=rr(v[I],{type:"service",name:v[I-1],silent:!!v[I-2]});break;case 79:this.$={type:"filter",expression:v[I]};break;case 80:this.$={type:"bind",variable:v[I-1],expression:v[I-3]};break;case 89:this.$=Nf(v[I]);break;case 90:this.$=void 0;break;case 91:this.$=v[I-1].length?{type:"union",patterns:Es(v[I-1].map(Ob),[Ob(v[I])])}:v[I];break;case 95:this.$={...v[I],function:v[I-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:co(v[I-2],v[I-1]),distinct:!!v[I-3]};break;case 98:case 115:case 128:case 247:case 249:case 251:case 253:case 255:case 263:case 267:case 297:case 299:case 303:case 307:case 328:case 341:case 349:case 355:case 361:case 367:case 369:case 373:case 375:case 379:case 381:case 385:case 391:case 395:case 401:case 405:case 409:case 411:case 420:case 428:case 430:case 440:case 444:case 446:case 448:this.$=[];break;case 99:this.$=co(v[I-2],v[I-1]);break;case 101:this.$=Es(v[I-2],[v[I-1]]);break;case 102:case 112:this.$=Mb(v[I].map(Ot=>rr(lo(v[I-1]),Ot)));break;case 103:this.$=Mb(fc(v[I].map(Ot=>rr(lo(v[I-1].entity),Ot)),v[I-1].triples));break;case 105:this.$=Es([v[I-1]],v[I]);break;case 106:this.$=Es(v[I]);break;case 107:this.$=Fb(v[I-1],v[I]);break;case 109:case 237:this.$=ot.factory.namedNode(m6);break;case 110:case 118:this.$=co(v[I-1],v[I]);break;case 111:this.$=v[I]?{annotation:v[I],object:v[I-1]}:v[I-1];break;case 113:this.$=v[I]?Mb(fc(v[I].map(Ot=>rr(lo(v[I-1].entity),Ot)),v[I-1].triples)):v[I-1].triples;break;case 114:this.$=Fb(...v[I-1],v[I]);break;case 116:this.$=Fb(...v[I]);break;case 117:case 159:case 163:this.$=[v[I-1],v[I]];break;case 119:this.$=v[I]?{object:v[I-1],annotation:v[I]}:v[I-1];break;case 120:this.$=v[I-1].length?yl("|",co(v[I-1],v[I])):v[I];break;case 121:this.$=v[I-1].length?yl("/",co(v[I-1],v[I])):v[I];break;case 122:this.$=v[I]?yl(v[I],[v[I-1]]):v[I-1];break;case 123:this.$=v[I-1]?yl(v[I-1],[v[I]]):v[I];break;case 125:case 131:this.$=yl(v[I-1],[v[I]]);break;case 129:this.$=yl("|",co(v[I-2],v[I-1]));break;case 132:case 134:this.$=v6(v[I-1]);break;case 133:case 135:this.$=T6(v[I-1]);break;case 140:this.$={entity:v[I],triples:[]};break;case 145:this.$=Rb(v[I]);break;case 149:this.$=ot.factory.namedNode(FR);break;case 151:case 153:case 158:case 162:this.$=Cb(v[I-1],v[I]);break;case 152:this.$=["||",v[I]];break;case 154:this.$=["&&",v[I]];break;case 156:this.$=Gr(v[I-1],[v[I-2],v[I]]);break;case 157:this.$=Gr(v[I-2]?"notin":"in",[v[I-3],v[I]]);break;case 160:this.$=["+",Cb(v[I-1],v[I])];break;case 161:var xh=vs(v[I-1].value.replace("-",""),v[I-1].datatype);this.$=["-",Cb(xh,v[I])];break;case 164:this.$=Gr("UPLUS",[v[I]]);break;case 165:this.$=Gr(v[I-1],[v[I]]);break;case 166:this.$=Gr("UMINUS",[v[I]]);break;case 177:this.$=Gr(vn(v[I-1]));break;case 178:this.$=Gr(vn(v[I-3]),[v[I-1]]);break;case 179:this.$=Nf(Gr(vn(v[I-3]),[v[I-1]]));break;case 180:this.$=Gr(vn(v[I-5]),[v[I-3],v[I-1]]);break;case 181:this.$=Gr(vn(v[I-7]),[v[I-5],v[I-3],v[I-1]]);break;case 182:this.$=Nf(Gr(vn(v[I-7]),[v[I-5],v[I-3],v[I-1]]));break;case 183:this.$=Gr(vn(v[I-1]),v[I]);break;case 184:this.$=Gr("bound",[Rb(v[I-1])]);break;case 185:this.$=Gr(v[I-1],[]);break;case 186:this.$=Gr(v[I-3],[v[I-1]]);break;case 187:this.$=Gr(v[I-2]?"notexists":"exists",[Ob(v[I])]);break;case 188:case 189:this.$=gl(v[I-1],{type:"aggregate",aggregation:vn(v[I-4]),distinct:!!v[I-2]});break;case 190:this.$=gl(v[I-2],{type:"aggregate",aggregation:vn(v[I-5]),distinct:!!v[I-3],separator:typeof v[I-1]=="string"?v[I-1]:" "});break;case 192:this.$=vs(v[I]);break;case 193:this.$=b6(v[I-1],vn(v[I].substr(1)));break;case 194:this.$=vs(v[I-2],v[I]);break;case 195:case 204:this.$=vs(v[I],LR);break;case 196:case 205:this.$=vs(v[I],NR);break;case 197:case 206:this.$=vs(vn(v[I]),kR);break;case 200:this.$=vs(v[I].toLowerCase(),_6);break;case 201:this.$=vs(v[I].substr(1),LR);break;case 202:this.$=vs(v[I].substr(1),NR);break;case 203:this.$=vs(v[I].substr(1).toLowerCase(),kR);break;case 207:case 208:this.$=UR(v[I],1);break;case 209:case 210:this.$=UR(v[I],3);break;case 211:this.$=ot.factory.namedNode(Ff(v[I]));break;case 213:var Rh=v[I].indexOf(":"),Mf=v[I].substr(0,Rh),Ch=ot.prefixes[Mf];if(!Ch)throw new Error("Unknown prefix: "+Mf);var Yt=Ff(Ch+v[I].substr(Rh+1));this.$=ot.factory.namedNode(Yt);break;case 214:if(v[I]=v[I].substr(0,v[I].length-1),!(v[I]in ot.prefixes))throw new Error("Unknown prefix: "+v[I]);var Yt=Ff(ot.prefixes[v[I]]);this.$=ot.factory.namedNode(Yt);break;case 215:this.$=Lf(v[I].replace(/^(_:)/,""));break;case 216:this.$=Lf();break;case 217:case 218:case 232:this.$=Nf(Pb(v[I-3],v[I-2],v[I-1]));break;case 230:case 231:this.$=Nf(v[I-1]);break;case 248:case 250:case 252:case 254:case 256:case 260:case 264:case 268:case 270:case 292:case 294:case 296:case 298:case 300:case 302:case 304:case 306:case 329:case 342:case 356:case 368:case 370:case 372:case 374:case 392:case 402:case 425:case 427:case 429:case 431:case 441:case 445:case 447:case 449:v[I-1].push(v[I]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[v[I]];break;case 308:v[I-3].push(v[I-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:v[I-2].push(v[I-1]);break}},"anonymous"),table:[r(e,t,{3:1,4:2,10:3}),{1:[3]},r(n,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:i,16:i,45:i,197:i,224:i,229:i,308:i,24:[1,13],32:[1,14],36:[1,15],41:s}),r([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:o},{6:[2,239]},r(c,[2,411],{216:28,217:29}),r(l,[2,249],{18:30}),r(l,[2,251],{22:31}),r(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16:d,33:35,39:[1,37],44:39,55:40,87:p,139:38,307:43,308:h,323:36},r(l,[2,267],{37:46}),r(_,[2,326],{98:47,103:49,106:50,117:55,130:61,100:[1,48],110:[1,51],113:[1,52],115:[1,53],116:[1,54],131:[1,62],329:[1,56],330:[1,57],331:[1,58],332:[1,59],333:[1,60]}),{39:[1,63],40:64,43:65,44:66,45:y,87:p},r(S,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),r(e,[2,248]),r(e,[2,245]),r(e,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},r([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),r(w,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:T,29:O,52:84,53:A,56:85},{19:88,28:T,29:O,52:89,53:A,56:85},r(l,[2,253],{26:90}),{28:[1,91],52:92,53:A},r(x,[2,385],{181:93,182:94,183:95,31:[2,383]}),r(P,[2,263],{34:96}),r(P,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:p,308:h}),r(P,[2,262]),r(V,[2,259]),r(j,[2,143]),r(j,[2,144]),r([6,13,16,28,29,31,39,45,47,48,53,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,145]),r($,[2,211]),r($,[2,212]),r($,[2,213]),r($,[2,214]),{19:98,28:T,29:O,52:99,53:A,56:85},{6:[2,309],99:100,193:[1,101]},r(K,[2,311],{101:102,328:[1,103]}),r(N,[2,317],{104:104,328:[1,105]}),r(ae,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:we,114:110},{29:we,114:112},{29:we,114:113},{118:114,123:[1,115],125:116,126:ee},r(pe,[2,315]),r(pe,[2,316]),r(Y,[2,319]),r(Y,[2,320]),r(Y,[2,321]),r(_,[2,327]),{13:f,16:d,55:118,307:43,308:h},r(l,[2,12]),r(l,[2,13],{44:66,43:119,45:y,87:p}),r(Ee,[2,269]),r(Ee,[2,15]),{13:f,16:d,44:136,45:ie,46:120,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(S,[2,14]),r(S,[2,274]),r(S,[2,271]),r(S,[2,272]),r(e,[2,4]),{13:[1,177]},r(F,[2,39]),{29:[1,178]},{29:[1,179]},{87:[1,181],91:180},{45:[1,187],87:[1,185],89:[1,186],93:182,165:183,166:184},r(c,[2,410]),r([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337],[2,121],{338:[1,188]}),{13:f,16:d,45:[1,193],55:194,197:X,219:189,220:190,223:191,224:[1,192],307:43,308:h},r(w,[2,419]),r(G,B,{20:196,59:197,69:198,70:M}),r(l,[2,250]),{29:k,57:200},r(K,[2,279],{54:202,327:[1,203]}),{29:[2,282]},r(W,H,{23:204,58:205,62:206,63:oe}),r(l,[2,252]),{19:208,28:T,29:O,52:209,53:A,56:85},{29:[1,210]},r(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:ge,55:220,82:ne,87:p,89:Re,145:212,172:221,185:213,187:214,231:rt,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(nR,[2,265],{56:85,35:227,52:228,19:229,28:T,29:O,53:A}),r(V,[2,260]),r(W,H,{58:205,62:206,23:230,63:oe}),r(l,[2,268]),{6:[2,45]},r(e,t,{10:3,4:231}),{13:f,16:d,55:232,307:43,308:h},r(K,[2,312]),{105:233,112:iR,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},r(N,[2,318]),r(K,sR,{108:240,133:242,112:oR,132:aR}),r(ae,[2,323]),{112:[1,244]},{112:[2,325]},r(qr,[2,50]),r(x,uh,{135:245,136:246,143:247,144:248,31:cR,112:cR}),r(qr,[2,51]),r(qr,[2,52]),r(la,[2,328],{119:249}),{29:we,114:250},r(la,[2,56]),{29:we,114:251},r(_,[2,59]),r(Ee,[2,270]),{47:[1,252]},r(lR,[2,150]),r(fh,[2,428],{240:253}),r(fl,[2,430],{244:254}),r(fl,[2,155],{248:255,249:256,250:[2,438],290:[1,257],341:[1,258],342:[1,259],343:[1,260],344:[1,261],345:[1,262],346:[1,263]}),r(dl,[2,440],{252:264}),r(Pr,[2,448],{260:265}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,255:154,257:155,264:266,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,255:154,257:155,264:267,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,255:154,257:155,264:268,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(Pr,[2,167]),r(Pr,[2,168]),r(Pr,[2,169]),r(Pr,[2,170],{176:269,45:uR,89:fR}),r(Pr,[2,171]),r(Pr,[2,172]),r(Pr,[2,173]),r(Pr,[2,174]),{13:f,16:d,44:136,45:ie,46:272,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(cr,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:dR,89:pR,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},r(En,[2,192],{292:[1,286],293:[1,287]}),r(En,[2,195]),r(En,[2,196]),r(En,[2,197]),r(En,[2,198]),r(En,[2,199]),r(En,[2,200]),{13:f,16:d,44:39,55:40,82:ne,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},r(Cf,[2,452]),r(Cf,[2,453]),r(Cf,[2,454]),r(Cf,[2,455]),r(Cf,[2,456]),{279:[2,458]},r(dh,[2,207]),r(dh,[2,208]),r(dh,[2,209]),r(dh,[2,210]),r(En,[2,201]),r(En,[2,202]),r(En,[2,203]),r(En,[2,204]),r(En,[2,205]),r(En,[2,206]),r(e,[2,5]),r(ph,[2,297],{88:295}),r(hh,[2,299],{90:296}),{48:[1,297],87:[1,298]},r(mh,[2,301]),r(F,[2,43]),r(F,[2,82]),r(F,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},r(c,[2,412]),r(ic,[2,123]),r(ic,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),r(ws,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:X,223:312,225:308,226:309,229:hR,307:43,308:h},r(c,i,{215:10,214:314}),r(ws,[2,236]),r(ws,[2,237]),r(pl,[2,6]),r(Sb,[2,287],{60:315,72:316,73:[1,317]}),r(G,[2,286]),{13:f,16:d,45:ie,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:b},r([6,31,63,70,73,81,83,85],[2,20]),r(x,mR,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:no,31:no,85:no,112:no,159:no,160:no,161:no,163:no,164:no,41:s}),{13:f,16:d,55:331,307:43,308:h},r(K,[2,280]),r(pl,[2,7]),r(G,B,{59:197,69:198,20:332,70:M}),r(W,[2,284]),{64:[1,333]},r(W,H,{58:205,62:206,23:334,63:oe}),r(l,[2,254]),r(x,uh,{144:248,30:335,143:336,31:[2,257]}),r(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:d,44:39,55:40,87:p,139:342,186:339,190:340,195:341,197:sc,307:43,308:h},r(Of,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:f,16:d,87:p,197:sc,308:h}),r(io,[2,227]),r(io,[2,228]),r(io,[2,229]),{13:f,16:d,44:215,45:ge,55:220,82:ne,87:p,89:Re,172:221,185:351,187:350,200:348,230:347,231:rt,234:349,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},{13:f,16:d,44:39,55:40,87:p,139:342,186:352,190:340,195:341,197:sc,307:43,308:h},r(io,[2,146]),r(io,[2,147]),r(io,[2,148]),r(io,[2,149]),{13:f,16:d,44:354,55:355,82:ne,87:p,172:357,237:356,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:358,312:tr,313:353},r(wb,[2,215]),r(wb,[2,216]),r(W,H,{58:205,62:206,23:359,63:oe}),r(P,[2,264]),r(nR,[2,266]),r(pl,[2,11]),r(n,[2,308],{6:[2,310]}),r(qr,[2,313],{102:360,120:361,121:[1,362]}),r(qr,[2,47]),r(qr,[2,63]),r(qr,[2,64]),{13:f,16:d,55:363,307:43,308:h},r(qr,[2,336]),r(qr,[2,337]),r(qr,[2,338]),{109:[1,364]},r(gR,[2,60]),{13:f,16:d,55:365,307:43,308:h},r(K,[2,335]),{13:f,16:d,55:366,307:43,308:h},{31:[1,367]},r(oc,[2,341],{137:368}),r(oc,[2,340]),{13:f,16:d,44:215,45:ge,55:220,82:ne,87:p,89:Re,145:369,172:221,185:213,187:214,231:rt,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},{28:[1,370],127:371,128:[1,372]},r(la,[2,330],{124:373,125:374,126:ee}),r(la,[2,57]),{44:375,87:p},r(lR,[2,151],{241:376,242:[1,377]}),r(fh,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,247:380,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{250:[1,381]},r(lr,[2,432]),r(lr,[2,433]),r(lr,[2,434]),r(lr,[2,435]),r(lr,[2,436]),r(lr,[2,437]),{250:[2,439]},r([47,48,193,242,246,250,272,290,341,342,343,344,345,346],[2,158],{253:382,254:383,255:384,257:385,263:[1,386],265:[1,387],297:Te,298:xe,299:je,300:ke,301:Ge,302:Me}),r(dl,[2,162],{261:388,262:389,39:Eb,338:vb}),r(Pr,[2,164]),r(Pr,[2,165]),r(Pr,[2,166]),r(cr,[2,95]),r(cr,[2,96]),r(lr,[2,377],{177:392,325:[1,393]}),{48:[1,394]},r(cr,[2,177]),{13:f,16:d,44:136,45:ie,46:395,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:396,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:397,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:398,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:399,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(cr,[2,183]),r(cr,[2,98]),r(lr,[2,381],{180:400}),{87:[1,401]},r(cr,[2,185]),{13:f,16:d,44:136,45:ie,46:402,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{29:k,57:403},r(En,[2,193]),{13:f,16:d,55:404,307:43,308:h},{13:f,16:d,44:39,55:40,87:p,139:342,195:405,197:sc,307:43,308:h},r(ua,[2,233]),r(ua,[2,234]),r(ua,[2,235]),r(yR,[2,459],{281:406,325:[1,407]}),r(lr,[2,463],{284:408,325:[1,409]}),r(lr,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:ne,171:413,172:415,173:416,174:gh,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:yh},{31:[1,419],89:[1,420]},{29:[1,421]},r(mh,[2,302]),r(ph,[2,367],{167:422}),r(hh,[2,369],{168:423}),{48:[1,424],87:[1,425]},r(mh,[2,371]),r(ic,[2,122]),r(ic,[2,417]),r(ic,[2,413]),r(ic,[2,414]),r(ic,[2,415]),r(ws,[2,125]),r(ws,[2,127]),r(ws,[2,128]),r(_R,[2,420],{227:426}),r(ws,[2,130]),{13:f,16:d,55:194,197:X,223:427,307:43,308:h},{48:[1,428]},r(fa,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),r(Sb,[2,288]),{64:[1,433]},r(G,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:f,16:d,45:ie,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,276:ce,277:be,279:Ie,280:Ce,283:Fe,285:De,308:h,346:L,347:U,348:R,349:C,350:D,351:b}),r(bR,[2,293]),r(Tb,[2,92]),r(Tb,[2,93]),r(Tb,[2,94]),{45:uR,89:fR,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:T,29:O,56:85},{19:438,28:T,29:O,56:85},r(ac,[2,355],{149:439}),r(ac,[2,354]),{13:f,16:d,44:215,45:_h,55:220,82:ne,87:p,89:Re,156:440,172:221,185:441,203:442,231:bh,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(P,[2,19]),r(fa,[2,21]),{13:f,16:d,44:450,45:SR,55:323,65:445,66:446,67:447,68:448,87:p,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:b},r(pl,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},r(x,[2,386],{31:[2,388]}),r(Of,[2,102]),r(cc,[2,391],{191:452}),r(x,[2,395],{196:453,198:454}),r(x,[2,108]),r(x,[2,109]),r(Of,[2,103]),r(Of,[2,104]),r(Of,[2,390]),{13:f,16:d,44:215,45:ge,48:[1,455],55:220,82:ne,87:p,89:Re,172:221,185:351,187:350,200:456,231:rt,234:349,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(Sh,[2,424]),r(wR,[2,136]),r(wR,[2,137]),r(Ab,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:p,139:342,195:458,197:sc,307:43,308:h},r(ua,[2,219]),r(ua,[2,220]),r(ua,[2,221]),r(ua,[2,222]),r(ua,[2,223]),r(pl,[2,10]),r(qr,[2,46]),r(qr,[2,314]),{112:iR,122:459},r(qr,[2,62]),r(K,sR,{133:242,108:460,112:oR,132:aR}),r(gR,[2,61]),r(qr,[2,49]),r([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},r(oc,[2,351],{146:463,335:[1,464]}),{29:k,57:465},r(la,[2,329]),r(K,[2,332],{129:466,327:[1,467]}),r(la,[2,55]),r(la,[2,331]),{48:[1,468]},r(fh,[2,429]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(fl,[2,431]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,243:470,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(fl,[2,156]),{45:dR,89:pR,179:471},r(dl,[2,441]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,251:472,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(Pr,[2,444],{256:473}),r(Pr,[2,446],{258:474}),r(lr,[2,442]),r(lr,[2,443]),r(Pr,[2,449]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,255:154,257:155,259:475,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(lr,[2,450]),r(lr,[2,451]),r(lr,[2,379],{178:476}),r(lr,[2,378]),r([6,13,16,29,31,39,45,47,48,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,175]),{48:[1,477]},{48:[1,478]},{272:[1,479]},{272:[1,480]},{272:[1,481]},{13:f,16:d,44:136,45:ie,46:482,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{48:[1,483]},{48:[1,484]},r(cr,[2,187]),r(En,[2,194]),{13:f,16:d,44:39,55:40,82:ne,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,320:485},{13:f,16:d,39:[1,487],44:136,45:ie,46:488,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,282:486,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(yR,[2,460]),{13:f,16:d,44:136,45:ie,46:489,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(lr,[2,464]),{13:f,16:d,44:136,45:ie,46:490,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(lr,[2,466]),r(F,[2,40]),r(ph,[2,298]),r(Pf,[2,87]),r(Pf,[2,88]),r(Pf,[2,89]),r(Pf,[2,90]),{13:f,16:d,55:492,82:ne,172:493,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,311:494,312:tr,315:491},r(F,[2,41]),r(hh,[2,300]),r(Df,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:ne,171:497,172:415,173:416,174:gh,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:yh},{31:[1,498],89:[1,499]},{29:[1,500]},r(mh,[2,372]),{13:f,16:d,48:[2,422],55:194,197:X,223:312,226:502,228:501,229:hR,307:43,308:h},r(ws,[2,131]),r(ws,[2,126]),r(fa,[2,22]),r(fa,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:ie,55:323,67:321,68:322,74:505,75:506,76:ER,77:320,78:vR,79:509,87:p,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:b},r(bR,[2,294]),r(TR,[2,69]),r(TR,[2,70]),r(G,B,{59:197,69:198,20:511,70:M}),r(W,H,{58:205,62:206,23:512,63:oe}),{29:[2,375],31:[2,71],84:522,85:o,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},r(ac,[2,363],{157:524,335:[1,525]}),r(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:p}),r(wh,[2,399],{215:10,205:527,208:528,214:529,44:530,204:531,202:532,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:p}),{13:f,16:d,44:215,45:_h,55:220,82:ne,87:p,89:Re,172:221,185:351,203:536,212:534,231:bh,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:p}),r(W,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:d,45:SR,87:p,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,276:ce,277:be,279:Ie,280:Ce,283:Fe,285:De,308:h,346:L,347:U,348:R,349:C,350:D,351:b}),r(lc,[2,291]),r(lc,[2,24]),r(lc,[2,25]),{13:f,16:d,44:136,45:ie,46:539,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(lc,[2,28]),r(W,H,{58:205,62:206,23:540,63:oe}),r([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),r(cc,[2,107]),{13:f,16:d,44:215,45:ge,55:220,82:ne,87:p,89:Re,172:221,185:351,187:350,199:543,200:544,231:rt,234:349,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(AR,[2,132]),r(Sh,[2,425]),r(AR,[2,133]),{13:f,16:d,44:354,55:355,82:ne,87:p,172:357,237:356,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:358,312:tr,313:545},r(qr,[2,54]),r(qr,[2,48]),r(oc,[2,342]),{13:f,16:d,44:39,55:40,87:p,139:546,307:43,308:h},r(oc,[2,68]),r(x,[2,350],{31:IR,112:IR}),r(qr,[2,53]),{13:f,16:d,55:547,307:43,308:h},r(K,[2,333]),r(Ee,[2,16]),r(fh,[2,152]),r(fl,[2,154]),r(fl,[2,157]),r(dl,[2,159]),r(dl,[2,160],{262:389,261:548,39:Eb,338:vb}),r(dl,[2,161],{262:389,261:549,39:Eb,338:vb}),r(Pr,[2,163]),{13:f,16:d,44:136,45:ie,46:550,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(cr,[2,178]),r(cr,[2,179]),{13:f,16:d,44:136,45:ie,46:551,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:552,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:553,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{48:[1,554],272:[1,555]},r(cr,[2,184]),r(cr,[2,186]),{314:[1,556]},{48:[1,557]},{48:[2,461]},{48:[2,462]},{48:[1,558]},{48:[2,467],193:[1,561],287:559,288:560},{13:f,16:d,55:194,197:X,223:562,307:43,308:h},r(Ib,[2,224]),r(Ib,[2,225]),r(Ib,[2,226]),{31:[1,563],45:xR,94:564},r(F,[2,84]),r(ph,[2,368]),r(F,[2,85]),r(hh,[2,370]),r(Df,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},r(fa,[2,35],{83:[1,569]}),r(fa,[2,36],{81:[1,570]}),r(Sb,[2,30],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:509,44:510,75:571,13:f,16:d,45:ie,76:ER,78:vR,87:p,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,276:ce,277:be,279:Ie,280:Ce,283:Fe,285:De,308:h,346:L,347:U,348:R,349:C,350:D,351:b}),r(hl,[2,295]),{45:ie,77:572},{45:ie,77:573},r(hl,[2,33]),r(hl,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},r(ac,[2,356]),r(RR,[2,357],{152:578,335:[1,579]}),r(so,[2,74]),{29:k,57:580},{29:k,57:581},{13:f,16:d,44:39,55:40,87:p,139:582,307:43,308:h},r(CR,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:ie,55:323,67:321,68:322,77:320,79:585,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:b},{45:[1,586]},r(so,[2,81]),{29:k,57:587},r(ac,[2,73]),r(x,[2,362],{29:oo,31:oo,85:oo,112:oo,159:oo,160:oo,161:oo,163:oo,164:oo}),r(wh,[2,112]),r(ml,[2,401],{206:588}),r(x,[2,405],{209:589,210:590}),r(x,[2,403]),r(x,[2,404]),r(wh,[2,113]),r(wh,[2,400]),{13:f,16:d,44:215,45:_h,48:[1,591],55:220,82:ne,87:p,89:Re,172:221,185:351,203:536,212:592,231:bh,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(Sh,[2,426]),r(Ab,[2,138]),r(Ab,[2,139]),{232:[1,593]},r(lc,[2,292]),{47:[1,595],48:[1,594]},r(pl,[2,9]),r(cc,[2,392]),r(cc,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:p,197:sc,308:h}),r(cc,[2,110],{272:[1,598]}),r(Eh,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},r(la,[2,58]),r(Pr,[2,445]),r(Pr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},r(cr,[2,99]),r(lr,[2,382]),r([13,16,39,47,48,87,193,197,242,246,250,263,265,272,290,297,298,299,300,301,302,308,314,338,341,342,343,344,345,346],[2,232]),r(cr,[2,188]),r(cr,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:ne,172:493,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,311:494,312:tr,315:611},r(F,[2,42]),r(Df,[2,304]),{13:f,16:d,55:414,82:ne,95:612,171:613,172:415,173:416,174:gh,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:yh},{31:[1,614],45:xR,94:615},r(ws,[2,129]),r(_R,[2,421]),{82:[1,616]},{82:[1,617]},r(hl,[2,296]),r(hl,[2,31]),r(hl,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},r(x,mR,{155:330,153:618,154:619,29:ao,31:ao,85:ao,112:ao,159:ao,160:ao,161:ao,163:ao,164:ao}),r(RR,[2,358]),r(so,[2,75]),r(so,[2,76]),{29:k,57:620},{13:f,16:d,44:39,55:40,87:p,139:621,307:43,308:h},r(CR,[2,366]),r(so,[2,79]),{13:f,16:d,44:136,45:ie,46:622,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(so,[2,91],{336:[1,623]}),r([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),r(ml,[2,117]),{13:f,16:d,44:215,45:_h,55:220,82:ne,87:p,89:Re,172:221,185:351,203:536,211:626,212:627,231:bh,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,309:Vr,310:Er,311:217,312:tr},r(io,[2,134]),r(Sh,[2,427]),r(io,[2,135]),r(lc,[2,26]),{44:628,87:p},r(cc,[2,106]),r(cc,[2,394]),r(x,[2,396]),r(Eh,[2,111]),r(Eh,[2,398]),{13:f,16:d,44:39,55:40,87:p,139:342,186:629,190:340,195:341,197:sc,307:43,308:h},r(wb,[2,217]),r(x,uh,{144:248,140:630,143:631,31:[2,343]}),r(cr,[2,97]),r(lr,[2,380]),r(cr,[2,180]),{13:f,16:d,44:136,45:ie,46:632,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},{13:f,16:d,44:136,45:ie,46:633,55:133,67:132,68:134,77:131,82:ne,87:p,172:135,224:de,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:ye,264:130,265:te,266:137,267:139,268:me,269:Pe,270:se,271:_e,273:Ne,274:Q,275:146,276:ce,277:be,278:149,279:Ie,280:Ce,283:Fe,285:De,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:b},r(cr,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:ne,171:637,172:415,173:416,174:gh,255:154,257:155,291:150,294:Ae,295:Z,296:he,297:Te,298:xe,299:je,300:ke,301:Ge,302:Me,303:We,304:Ve,305:$e,306:He,307:43,308:h,312:yh},r(OR,[2,305]),r(F,[2,86]),r(Df,[2,374]),r(fa,[2,37]),r(fa,[2,38]),r(ac,[2,72]),r(ac,[2,360]),r(so,[2,77]),{29:k,57:638},{47:[1,639]},{29:[2,376]},r(ml,[2,402]),r(ml,[2,115],{215:10,208:528,214:529,44:530,205:640,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:p}),r(ml,[2,118],{272:[1,641]}),r(vh,[2,407],{213:642,319:643,317:[1,644]}),{48:[1,645]},{318:[1,646]},{31:[1,647]},{31:[2,344]},{48:[1,648]},{48:[1,649]},{291:650,303:We,304:Ve,305:$e,306:He},r(Pf,[2,218]),r(Df,[2,44]),r(OR,[2,306]),r(so,[2,78]),{44:651,87:p},r(ml,[2,116]),r(x,[2,406]),r(vh,[2,119]),r(vh,[2,408]),r(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:p}),r(lc,[2,27]),r(Eh,[2,230]),r(PR,[2,345],{141:653,335:[1,654]}),r(cr,[2,181]),r(cr,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},r(x,uh,{144:248,142:657,143:658,31:DR,112:DR}),r(PR,[2,346]),r(so,[2,80]),r(vh,[2,231]),r(oc,[2,67]),r(oc,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:a(function(q,J){if(J.recoverable)this.trace(q);else{var le=new Error(q);throw le.hash=J,le}},"parseError"),parse:a(function(q){var J=this,le=[0],Be=[],nt=[null],v=[],Tn=this.table,I="",Ts=0,kf=0,xh=0,Rh=2,Mf=1,Ch=v.slice.call(arguments,1),Yt=Object.create(this.lexer),As={yy:{}};for(var jf in this.yy)Object.prototype.hasOwnProperty.call(this.yy,jf)&&(As.yy[jf]=this.yy[jf]);Yt.setInput(q,As.yy),As.yy.lexer=Yt,As.yy.parser=this,typeof Yt.yylloc>"u"&&(Yt.yylloc={});var Sl=Yt.yylloc;v.push(Sl);var Ot=Yt.options&&Yt.options.ranges;typeof As.yy.parseError=="function"?this.parseError=As.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Vt(Is){le.length=le.length-2*Is,nt.length=nt.length-Is,v.length=v.length-Is}a(Vt,"popStack");for(var yt=a(function(){var Is;return Is=Yt.lex()||Mf,typeof Is!="number"&&(Is=J.symbols_[Is]||Is),Is},"lex"),Tt,jn,pc,mi,Xfe,$b,wl={},Oh,uo,GR,Ph;;){if(pc=le[le.length-1],this.defaultActions[pc]?mi=this.defaultActions[pc]:((Tt===null||typeof Tt>"u")&&(Tt=yt()),mi=Tn[pc]&&Tn[pc][Tt]),typeof mi>"u"||!mi.length||!mi[0]){var Ub="";Ph=[];for(Oh in Tn[pc])this.terminals_[Oh]&&Oh>Rh&&Ph.push("'"+this.terminals_[Oh]+"'");Yt.showPosition?Ub="Parse error on line "+(Ts+1)+`:
|
|
34
34
|
`+Yt.showPosition()+`
|
|
35
35
|
Expecting `+Ph.join(", ")+", got '"+(this.terminals_[Tt]||Tt)+"'":Ub="Parse error on line "+(Ts+1)+": Unexpected "+(Tt==Mf?"end of input":"'"+(this.terminals_[Tt]||Tt)+"'"),this.parseError(Ub,{text:Yt.match,token:this.terminals_[Tt]||Tt,line:Yt.yylineno,loc:Sl,expected:Ph})}if(mi[0]instanceof Array&&mi.length>1)throw new Error("Parse Error: multiple actions possible at state: "+pc+", token: "+Tt);switch(mi[0]){case 1:le.push(Tt),nt.push(Yt.yytext),v.push(Yt.yylloc),le.push(mi[1]),Tt=null,jn?(Tt=jn,jn=null):(kf=Yt.yyleng,I=Yt.yytext,Ts=Yt.yylineno,Sl=Yt.yylloc,xh>0&&xh--);break;case 2:if(uo=this.productions_[mi[1]][1],wl.$=nt[nt.length-uo],wl._$={first_line:v[v.length-(uo||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(uo||1)].first_column,last_column:v[v.length-1].last_column},Ot&&(wl._$.range=[v[v.length-(uo||1)].range[0],v[v.length-1].range[1]]),$b=this.performAction.apply(wl,[I,kf,Ts,As.yy,mi[1],nt,v].concat(Ch)),typeof $b<"u")return $b;uo&&(le=le.slice(0,-1*uo*2),nt=nt.slice(0,-1*uo),v=v.slice(0,-1*uo)),le.push(this.productions_[mi[1]][0]),nt.push(wl.$),v.push(wl._$),GR=Tn[le[le.length-2]][le[le.length-1]],le.push(GR);break;case 3:return!0}}return!0},"parse")},Th=Nw().Wildcard,Ah="http://www.w3.org/1999/02/22-rdf-syntax-ns#",m6=Ah+"type",g6=Ah+"first",y6=Ah+"rest",FR=Ah+"nil",Ih="http://www.w3.org/2001/XMLSchema#",LR=Ih+"integer",NR=Ih+"decimal",kR=Ih+"double",_6=Ih+"boolean",uc="",MR="",jR="";function vn(z){return z.toLowerCase()}a(vn,"lowercase");function co(z,q){return z.push(q),z}a(co,"appendTo");function fc(z,q){return z.push.apply(z,q),z}a(fc,"appendAllTo");function rr(z){z||(z={});for(var q=1,J=arguments.length,le;q<J&&(le=arguments[q]||{});q++)for(var Be in le)z[Be]=le[Be];return z}a(rr,"extend");function Es(){for(var z=[],q=0,J=arguments.length;q<J;q++)z=z.concat.apply(z,arguments[q]);return z}a(Es,"unionAll");function Ff(z){if(z[0]==="<"&&(z=z.substring(1,z.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(z))return z;if(!ot.base)throw new Error("Cannot resolve relative IRI "+z+" because no base IRI was set.");switch(uc!==ot.base&&(uc=ot.base,MR=uc.replace(/[^\/:]*$/,""),jR=uc.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),z[0]){case void 0:return uc;case"#":return uc+z;case"?":return uc.replace(/(?:\?.*)?$/,z);case"/":return jR+z;default:return MR+z}}a(Ff,"resolveIRI");function Rb(z){if(z){var q=z[0];if(q==="?"||q==="$")return ot.factory.variable(z.substr(1))}return z}a(Rb,"toVar");function Gr(z,q){return{type:"operation",operator:z,args:q||[]}}a(Gr,"operation");function gl(z,q){var J={expression:z==="*"?new Th:z};if(q)for(var le in q)J[le]=q[le];return J}a(gl,"expression");function yl(z,q){return{type:"path",pathType:z,items:q}}a(yl,"path");function Cb(z,q){for(var J=0,le=q.length,Be;J<le&&(Be=q[J]);J++)z=Gr(Be[0],[z,Be[1]]);return z}a(Cb,"createOperationTree");function dc(z,q){var J=[],le=[],Be=z.length,nt,v={};if(!Be)return null;for(var Tn=0;Tn<Be&&(nt=z[Tn]);Tn++)(nt.named?le:J).push(nt.iri);return v[q||"from"]={default:J,named:le},v}a(dc,"groupDatasets");function _l(z){return parseInt(z,10)}a(_l,"toInt");function Ob(z){return z.type==="group"&&z.patterns.length===1?z.patterns[0]:z}a(Ob,"degroupSingle");function vs(z,q){return q&&q.termType!=="NamedNode"&&(q=ot.factory.namedNode(q)),ot.factory.literal(z,q)}a(vs,"createTypedLiteral");function b6(z,q){return ot.factory.literal(z,q)}a(b6,"createLangLiteral");function Pb(z,q,J){if(!("termType"in q))throw new Error("Nested triples cannot contain paths");return ot.factory.quad(z,q,J)}a(Pb,"nestedTriple");function lo(z,q,J,le){var Be={};return z!=null&&(Be.subject=z),q!=null&&(Be.predicate=q),J!=null&&(Be.object=J),le!=null&&(Be.annotations=le),Be}a(lo,"triple");function Lf(z){return typeof z=="string"?z.startsWith("e_")?ot.factory.blankNode(z):ot.factory.blankNode("e_"+z):ot.factory.blankNode("g_"+$R++)}a(Lf,"blank");var $R=0;ot._resetBlanks=function(){$R=0};var S6=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,w6={"\\":"\\","'":"'",'"':'"',t:" ",b:"\b",n:`
|
|
36
|
-
`,r:"\r",f:"\f"},E6=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,Db=String.fromCharCode;function UR(z,q){z=z.substring(q,z.length-q);try{z=z.replace(S6,function(J,le,Be,nt){var v;if(le){if(v=parseInt(le,16),isNaN(v))throw new Error;return Db(v)}else if(Be){if(v=parseInt(Be,16),isNaN(v))throw new Error;return v<65535?Db(v):Db(55296+((v-=65536)>>10),56320+(v&1023))}else{var Tn=w6[nt];if(!Tn)throw new Error;return Tn}})}catch{return""}if(E6.exec(z))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+z);return z}a(UR,"unescapeString");function v6(z){var q=Lf(),J=q,le=[],Be,nt=[];z.forEach(function(Ts){le.push(Ts.entity),fc(nt,Ts.triples)});for(var v=0,Tn=0,I=le.length,Be=Array(I*2);v<I;)Be[Tn++]=lo(J,ot.factory.namedNode(g6),le[v]),Be[Tn++]=lo(J,ot.factory.namedNode(y6),J=++v<I?Lf():ot.factory.namedNode(FR));return{entity:q,triples:fc(Be,nt)}}a(v6,"createList");function T6(z){var q=Lf();return{entity:q,triples:z.map(function(J){return rr(lo(q),J)})}}a(T6,"createAnonymousObject");function Fb(z,q,J){var le=[],Be=[];return q.forEach(function(nt){let v=null;nt.annotation&&(v=nt.annotation,nt=nt.object),le.push(lo(null,z,nt.entity,v)),fc(Be,nt.triples)}),Es(le,J||[],Be)}a(Fb,"objectListToTriples");function
|
|
36
|
+
`,r:"\r",f:"\f"},E6=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,Db=String.fromCharCode;function UR(z,q){z=z.substring(q,z.length-q);try{z=z.replace(S6,function(J,le,Be,nt){var v;if(le){if(v=parseInt(le,16),isNaN(v))throw new Error;return Db(v)}else if(Be){if(v=parseInt(Be,16),isNaN(v))throw new Error;return v<65535?Db(v):Db(55296+((v-=65536)>>10),56320+(v&1023))}else{var Tn=w6[nt];if(!Tn)throw new Error;return Tn}})}catch{return""}if(E6.exec(z))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+z);return z}a(UR,"unescapeString");function v6(z){var q=Lf(),J=q,le=[],Be,nt=[];z.forEach(function(Ts){le.push(Ts.entity),fc(nt,Ts.triples)});for(var v=0,Tn=0,I=le.length,Be=Array(I*2);v<I;)Be[Tn++]=lo(J,ot.factory.namedNode(g6),le[v]),Be[Tn++]=lo(J,ot.factory.namedNode(y6),J=++v<I?Lf():ot.factory.namedNode(FR));return{entity:q,triples:fc(Be,nt)}}a(v6,"createList");function T6(z){var q=Lf();return{entity:q,triples:z.map(function(J){return rr(lo(q),J)})}}a(T6,"createAnonymousObject");function Fb(z,q,J){var le=[],Be=[];return q.forEach(function(nt){let v=null;nt.annotation&&(v=nt.annotation,nt=nt.object),le.push(lo(null,z,nt.entity,v)),fc(Be,nt.triples)}),Es(le,J||[],Be)}a(Fb,"objectListToTriples");function Yfe(z){for(var q=[],J,le=0,Be;Be=z[le];le++)switch(Be.type){case"bgp":Be.triples.length&&(J?fc(J.triples,Be.triples):co(q,J=Be));break;default:(!Be.patterns||Be.patterns.length>0)&&(co(q,Be),J=null)}return q}a(Yfe,"mergeAdjacentBGPs");function bl(z){return z.variable?z.variable.value:z.value||z.expression.value}a(bl,"getExpressionId");function Lb(z){if(!z)return[];if(z.type==="aggregate")return[z];if(z.type==="operation"){let q=[];for(let J of z.args)q.push(...Lb(J));return q}return[]}a(Lb,"getAggregatesOfExpression");function A6(z){let q=new Set,J=a(function(le){le&&(le.termType==="Variable"?q.add(le):le.type==="operation"&&le.args.forEach(J))},"visitExpression");return J(z),q}a(A6,"getVariablesFromExpression");function Nb(z,q=1,J=[]){for(let le of z)q>0&&le instanceof Array?Nb(le,q-1,J):J.push(le);return J}a(Nb,"flatten");function kb(z){return z.termType==="Variable"}a(kb,"isVariable");function BR(z){if(z.triples){let q=[];for(let J of z.triples)kb(J.subject)&&q.push(J.subject.value),kb(J.predicate)&&q.push(J.predicate.value),kb(J.object)&&q.push(J.object.value);return q}else if(z.patterns){let q=[];for(let J of z.patterns)q.push(...BR(J));return q}return[]}a(BR,"getBoundVarsFromGroupGraphPattern");function I6(z){let q=z.slice().sort(),J=[];for(let le=0;le<q.length-1;le++)q[le+1]==q[le]&&J.push(q[le]);return J}a(I6,"getDuplicatesInArray");function Nf(z){if(!ot.sparqlStar)throw new Error("SPARQL-star support is not enabled");return z}a(Nf,"ensureSparqlStar");function VR(z,q,J){for(let le of q){let Be=lo("subject"in le?le.subject:z,le.predicate,le.object);J.push(Be),le.annotations&&VR(Pb(z,le.predicate,le.object),le.annotations,J)}}a(VR,"_applyAnnotations");function Mb(z){if(ot.sparqlStar){let q=[];return z.forEach(J=>{let le=lo(J.subject,J.predicate,J.object);q.push(le),J.annotations&&VR(Pb(J.subject,J.predicate,J.object),J.annotations,q)}),q}return z}a(Mb,"applyAnnotations");function Qfe(z){if(!ot.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return z}a(Qfe,"ensureSparqlStarNestedQuads");function qR(z){for(let q of z){if(q.type==="graph"&&q.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(q.type==="bgp"||q.type==="graph"){for(let J of q.triples)if(J.subject.termType==="Variable"||J.predicate.termType==="Variable"||J.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return z}a(qR,"ensureNoVariables");function jb(z){for(let q of z)if(q.type==="bgp"){for(let J of q.triples)if(J.subject.termType==="BlankNode"||J.predicate.termType==="BlankNode"||J.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return z}a(jb,"ensureNoBnodes");var x6=(function(){var z={EOF:1,parseError:a(function(J,le){if(this.yy.parser)this.yy.parser.parseError(J,le);else throw new Error(J)},"parseError"),setInput:a(function(q,J){return this.yy=J||this.yy||{},this._input=q,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var q=this._input[0];this.yytext+=q,this.yyleng++,this.offset++,this.match+=q,this.matched+=q;var J=q.match(/(?:\r\n?|\n).*/g);return J?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),q},"input"),unput:a(function(q){var J=q.length,le=q.split(/(?:\r\n?|\n)/g);this._input=q+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-J),this.offset-=J;var Be=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),le.length-1&&(this.yylineno-=le.length-1);var nt=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:le?(le.length===Be.length?this.yylloc.first_column:0)+Be[Be.length-le.length].length-le[0].length:this.yylloc.first_column-J},this.options.ranges&&(this.yylloc.range=[nt[0],nt[0]+this.yyleng-J]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
37
37
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(q){this.unput(this.match.slice(q))},"less"),pastInput:a(function(){var q=this.matched.substr(0,this.matched.length-this.match.length);return(q.length>20?"...":"")+q.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var q=this.match;return q.length<20&&(q+=this._input.substr(0,20-q.length)),(q.substr(0,20)+(q.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var q=this.pastInput(),J=new Array(q.length+1).join("-");return q+this.upcomingInput()+`
|
|
38
38
|
`+J+"^"},"showPosition"),test_match:a(function(q,J){var le,Be,nt;if(this.options.backtrack_lexer&&(nt={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(nt.yylloc.range=this.yylloc.range.slice(0))),Be=q[0].match(/(?:\r\n?|\n).*/g),Be&&(this.yylineno+=Be.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:Be?Be[Be.length-1].length-Be[Be.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+q[0].length},this.yytext+=q[0],this.match+=q[0],this.matches=q,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(q[0].length),this.matched+=q[0],le=this.performAction.call(this,this.yy,this,J,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),le)return le;if(this._backtrack){for(var v in nt)this[v]=nt[v];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var q,J,le,Be;this._more||(this.yytext="",this.match="");for(var nt=this._currentRules(),v=0;v<nt.length;v++)if(le=this._input.match(this.rules[nt[v]]),le&&(!J||le[0].length>J[0].length)){if(J=le,Be=v,this.options.backtrack_lexer){if(q=this.test_match(le,nt[v]),q!==!1)return q;if(this._backtrack){J=!1;continue}else return!1}else if(!this.options.flex)break}return J?(q=this.test_match(J,nt[Be]),q!==!1?q:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
39
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var J=this.next();return J||this.lex()},"lex"),begin:a(function(J){this.conditionStack.push(J)},"begin"),popState:a(function(){var J=this.conditionStack.length-1;return J>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(J){return J=this.conditionStack.length-1-Math.abs(J||0),J>=0?this.conditionStack[J]:"INITIAL"},"topState"),pushState:a(function(J){this.begin(J)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{flex:!0,"case-insensitive":!0},performAction:a(function(J,le,Be,nt){var v=nt;switch(Be){case 0:break;case 1:return 12;case 2:return 15;case 3:return 41;case 4:return 325;case 5:return 326;case 6:return 45;case 7:return 47;case 8:return 48;case 9:return 39;case 10:return 24;case 11:return 28;case 12:return 29;case 13:return 31;case 14:return 32;case 15:return 36;case 16:return 53;case 17:return 327;case 18:return 63;case 19:return 64;case 20:return 70;case 21:return 73;case 22:return 76;case 23:return 78;case 24:return 81;case 25:return 83;case 26:return 85;case 27:return 193;case 28:return 100;case 29:return 328;case 30:return 121;case 31:return 329;case 32:return 330;case 33:return 110;case 34:return 331;case 35:return 109;case 36:return 332;case 37:return 333;case 38:return 113;case 39:return 115;case 40:return 116;case 41:return 131;case 42:return 123;case 43:return 126;case 44:return 128;case 45:return 132;case 46:return 112;case 47:return 334;case 48:return 335;case 49:return 159;case 50:return 161;case 51:return 164;case 52:return 174;case 53:return 160;case 54:return 336;case 55:return 163;case 56:return 312;case 57:return 314;case 58:return 317;case 59:return 318;case 60:return 272;case 61:return 197;case 62:return 337;case 63:return 338;case 64:return 229;case 65:return 340;case 66:return 263;case 67:return 224;case 68:return 231;case 69:return 232;case 70:return 242;case 71:return 246;case 72:return 290;case 73:return 341;case 74:return 342;case 75:return 343;case 76:return 344;case 77:return 345;case 78:return 250;case 79:return 346;case 80:return 265;case 81:return 276;case 82:return 277;case 83:return 268;case 84:return 269;case 85:return 270;case 86:return 271;case 87:return 347;case 88:return 348;case 89:return 273;case 90:return 274;case 91:return 350;case 92:return 349;case 93:return 351;case 94:return 279;case 95:return 280;case 96:return 283;case 97:return 285;case 98:return 289;case 99:return 293;case 100:return 296;case 101:return 13;case 102:return 16;case 103:return 308;case 104:return 309;case 105:return 87;case 106:return 292;case 107:return 82;case 108:return 294;case 109:return 295;case 110:return 297;case 111:return 298;case 112:return 299;case 113:return 300;case 114:return 301;case 115:return 302;case 116:return"EXPONENT";case 117:return 303;case 118:return 304;case 119:return 305;case 120:return 306;case 121:return 89;case 122:return 310;case 123:return 6;case 124:return"INVALID";case 125:console.log(le.yytext);break}},"anonymous"),rules:[/^(?:\s+|(#[^\n\r]*))/i,/^(?:BASE)/i,/^(?:PREFIX)/i,/^(?:SELECT)/i,/^(?:DISTINCT)/i,/^(?:REDUCED)/i,/^(?:\()/i,/^(?:AS)/i,/^(?:\))/i,/^(?:\*)/i,/^(?:CONSTRUCT)/i,/^(?:WHERE)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:DESCRIBE)/i,/^(?:ASK)/i,/^(?:FROM)/i,/^(?:NAMED)/i,/^(?:GROUP)/i,/^(?:BY)/i,/^(?:HAVING)/i,/^(?:ORDER)/i,/^(?:ASC)/i,/^(?:DESC)/i,/^(?:LIMIT)/i,/^(?:OFFSET)/i,/^(?:VALUES)/i,/^(?:;)/i,/^(?:LOAD)/i,/^(?:SILENT)/i,/^(?:INTO)/i,/^(?:CLEAR)/i,/^(?:DROP)/i,/^(?:CREATE)/i,/^(?:ADD)/i,/^(?:TO)/i,/^(?:MOVE)/i,/^(?:COPY)/i,/^(?:INSERT((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)WHERE)/i,/^(?:WITH)/i,/^(?:DELETE)/i,/^(?:INSERT)/i,/^(?:USING)/i,/^(?:DEFAULT)/i,/^(?:GRAPH)/i,/^(?:ALL)/i,/^(?:\.)/i,/^(?:OPTIONAL)/i,/^(?:SERVICE)/i,/^(?:BIND)/i,/^(?:UNDEF)/i,/^(?:MINUS)/i,/^(?:UNION)/i,/^(?:FILTER)/i,/^(?:<<)/i,/^(?:>>)/i,/^(?:\{\|)/i,/^(?:\|\})/i,/^(?:,)/i,/^(?:a)/i,/^(?:\|)/i,/^(?:\/)/i,/^(?:\^)/i,/^(?:\?)/i,/^(?:\+)/i,/^(?:!)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:IN)/i,/^(?:NOT)/i,/^(?:-)/i,/^(?:BOUND)/i,/^(?:BNODE)/i,/^(?:(RAND|NOW|UUID|STRUUID))/i,/^(?:(LANG|DATATYPE|IRI|URI|ABS|CEIL|FLOOR|ROUND|STRLEN|STR|UCASE|LCASE|ENCODE_FOR_URI|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|MD5|SHA1|SHA256|SHA384|SHA512|isIRI|isURI|isBLANK|isLITERAL|isNUMERIC))/i,/^(?:(SUBJECT|PREDICATE|OBJECT|isTRIPLE))/i,/^(?:(LANGMATCHES|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|STRLANG|STRDT|sameTerm))/i,/^(?:CONCAT)/i,/^(?:COALESCE)/i,/^(?:IF)/i,/^(?:TRIPLE)/i,/^(?:REGEX)/i,/^(?:SUBSTR)/i,/^(?:REPLACE)/i,/^(?:EXISTS)/i,/^(?:COUNT)/i,/^(?:SUM|MIN|MAX|AVG|SAMPLE)/i,/^(?:GROUP_CONCAT)/i,/^(?:SEPARATOR)/i,/^(?:\^\^)/i,/^(?:true|false)/i,/^(?:(<(?:[^<>\"\{\}\|\^`\\\u0000-\u0020])*>))/i,/^(?:((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:))/i,/^(?:(((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:)((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|:|[0-9]|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(_:(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?))/i,/^(?:([\?\$]((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])*)))/i,/^(?:(@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*))/i,/^(?:([0-9]+))/i,/^(?:([0-9]*\.[0-9]+))/i,/^(?:([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+)))/i,/^(?:(\+([0-9]+)))/i,/^(?:(\+([0-9]*\.[0-9]+)))/i,/^(?:(\+([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:(-([0-9]+)))/i,/^(?:(-([0-9]*\.[0-9]+)))/i,/^(?:(-([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(?:(?:[^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*'))/i,/^(?:("(?:(?:[^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*"))/i,/^(?:('''(?:(?:'|'')?(?:[^'\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*'''))/i,/^(?:("""(?:(?:"|"")?(?:[^\"\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*"""))/i,/^(?:(\((\u0020|\u0009|\u000D|\u000A)*\)))/i,/^(?:(\[(\u0020|\u0009|\u000D|\u000A)*\]))/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],inclusive:!0}}};return z})();xb.lexer=x6;function ot(){this.yy={}}return a(ot,"Parser"),ot.prototype=xb,xb.Parser=ot,new ot})();RO.exports=Z8});var FO=E((jme,DO)=>{var eV="http://www.w3.org/2001/XMLSchema#integer",tV="http://www.w3.org/2001/XMLSchema#string";function Nt(r){this._options=r=r||{};var e=r.prefixes||{};this._prefixByIri={};var t=[];for(var n in e){var i=e[n];cd(i)&&(this._prefixByIri[i]=n,t.push(i))}var s=t.join("|").replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&");this._prefixRegex=new RegExp("^("+s+")([a-zA-Z][\\-_a-zA-Z0-9]*)$"),this._usedPrefixes={},this._sparqlStar=r.sparqlStar,this._indent=cd(r.indent)?r.indent:" ",this._newline=cd(r.newline)?r.newline:`
|
|
40
|
-
`,this._explicitDatatype=!!r.explicitDatatype}a(Nt,"Generator");Nt.prototype.toQuery=function(r){var e="";return r.queryType&&(e+=r.queryType.toUpperCase()+" "),r.reduced&&(e+="REDUCED "),r.distinct&&(e+="DISTINCT "),r.variables?e+=ni(r.variables,void 0,function(t){return/^[?$]/.test(t)?t:_a(t)?this.toEntity(t):"("+this.toExpression(t.expression)+" AS "+Im(t.variable)+")"},this)+" ":r.template&&(e+=this.group(r.template,!0)+this._newline),r.from&&(e+=this.graphs("FROM ",r.from.default)+this.graphs("FROM NAMED ",r.from.named)),r.where&&(e+="WHERE "+this.group(r.where,!0)+this._newline),r.updates&&(e+=ni(r.updates,";"+this._newline,this.toUpdate,this)),r.group&&(e+="GROUP BY "+ni(r.group,void 0,function(t){var n=_a(t.expression)?this.toEntity(t.expression):"("+this.toExpression(t.expression)+")";return t.variable?"("+n+" AS "+Im(t.variable)+")":n},this)+this._newline),r.having&&(e+="HAVING ("+ni(r.having,void 0,this.toExpression,this)+")"+this._newline),r.order&&(e+="ORDER BY "+ni(r.order,void 0,function(t){var n="("+this.toExpression(t.expression)+")";return t.descending?"DESC "+n:n},this)+this._newline),r.offset&&(e+="OFFSET "+r.offset+this._newline),r.limit&&(e+="LIMIT "+r.limit+this._newline),r.values&&(e+=this.values(r)),e=this.baseAndPrefixes(r)+e,e.trim()};Nt.prototype.baseAndPrefixes=function(r){var e=r.base?"BASE <"+r.base+">"+this._newline:"",t="";for(var n in r.prefixes)(this._options.allPrefixes||this._usedPrefixes[n])&&(t+="PREFIX "+n+": <"+r.prefixes[n]+">"+this._newline);return e+t};Nt.prototype.toPattern=function(r){var e=r.type||r instanceof Array&&"array"||(r.subject&&r.predicate&&r.object?"triple":"");if(!(e in this))throw new Error("Unknown entry type: "+e);return this[e](r)};Nt.prototype.triple=function(r){return this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+"."};Nt.prototype.array=function(r){return ni(r,this._newline,this.toPattern,this)};Nt.prototype.bgp=function(r){return this.encodeTriples(r.triples)};Nt.prototype.encodeTriples=function(r){if(!r.length)return"";for(var e=[],t=void 0,n=void 0,i=0;i<r.length;i++){var s=r[i];vc(s.subject,t)?vc(s.predicate,n)?e.push(","):(n=s.predicate,e.push(";"+this._newline,this._indent,this.toEntity(n))):(t&&e.push("."+this._newline),t=s.subject,n=s.predicate,e.push(this.toEntity(t)," ",this.toEntity(n))),e.push(" ",this.toEntity(s.object))}return e.push("."),e.join("")};Nt.prototype.graph=function(r){return"GRAPH "+this.toEntity(r.name)+" "+this.group(r)};Nt.prototype.graphs=function(r,e){return!e||e.length===0?"":ni(e,"",function(t){return r+this.toEntity(t)+this._newline},this)};Nt.prototype.group=function(r,e){return r=e!==!0?this.array(r.patterns||r.triples):this.toPattern(r.type!=="group"?r:r.patterns),r.indexOf(this._newline)===-1?"{ "+r+" }":"{"+this._newline+this.indent(r)+this._newline+"}"};Nt.prototype.query=function(r){return this.toQuery(r)};Nt.prototype.filter=function(r){return"FILTER("+this.toExpression(r.expression)+")"};Nt.prototype.bind=function(r){return"BIND("+this.toExpression(r.expression)+" AS "+Im(r.variable)+")"};Nt.prototype.optional=function(r){return"OPTIONAL "+this.group(r)};Nt.prototype.union=function(r){return ni(r.patterns,this._newline+"UNION"+this._newline,function(e){return this.group(e,!0)},this)};Nt.prototype.minus=function(r){return"MINUS "+this.group(r)};Nt.prototype.values=function(r){var e=Object.keys(r.values.reduce(function(i,s){for(var o in s)i[o]=!0;return i},{})),t,n;return e.length===1?t=n="":(t="(",n=")"),"VALUES "+t+e.join(" ")+n+" {"+this._newline+ni(r.values,this._newline,function(i){return" "+t+ni(e,void 0,function(s){return i[s]?this.toEntity(i[s]):"UNDEF"},this)+n},this)+this._newline+"}"};Nt.prototype.service=function(r){return"SERVICE "+(r.silent?"SILENT ":"")+this.toEntity(r.name)+" "+this.group(r)};Nt.prototype.toExpression=function(r){if(_a(r))return this.toEntity(r);switch(r.type.toLowerCase()){case"aggregate":return r.aggregation.toUpperCase()+"("+(r.distinct?"DISTINCT ":"")+this.toExpression(r.expression)+(typeof r.separator=="string"?'; SEPARATOR = "'+r.separator.replace(OO,PO)+'"':"")+")";case"functioncall":return this.toEntity(r.function)+"("+ni(r.args,", ",this.toExpression,this)+")";case"operation":var e=r.operator.toUpperCase(),t=r.args||[];switch(r.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(_a(t[0])?this.toEntity(t[0]):"("+this.toExpression(t[0])+")")+" "+e+" "+(_a(t[1])?this.toEntity(t[1]):"("+this.toExpression(t[1])+")");case"!":return"!("+this.toExpression(t[0])+")";case"uplus":return"+("+this.toExpression(t[0])+")";case"uminus":return"-("+this.toExpression(t[0])+")";case"notin":e="NOT IN";case"in":return this.toExpression(t[0])+" "+e+"("+(cd(t[1])?t[1]:ni(t[1],", ",this.toExpression,this))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+this.group(t[0],!0);default:return e+"("+ni(t,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+r.type)}};Nt.prototype.toEntity=function(r){if(_a(r))switch(r.termType){case"Wildcard":return"*";case"Variable":return Im(r);case"BlankNode":return"_:"+r.value;case"Literal":var e=r.value||"",t=r.language||"",n=r.datatype;if(r='"'+e.replace(OO,PO)+'"',t)r+="@"+t;else if(n){if(!this._explicitDatatype)switch(n.value){case tV:return r;case eV:if(/^\d+$/.test(e))return e+" "}r+="^^"+this.encodeIRI(n.value)}return r;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return r.graph&&r.graph.termType!=="DefaultGraph"?"<< GRAPH "+this.toEntity(r.graph)+" { "+this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+" } >>":"<< "+this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+" >>";default:return this.encodeIRI(r.value)}else{var i=r.items.map(this.toEntity,this),s=r.pathType;switch(s){case"^":case"!":return s+i[0];case"*":case"+":case"?":return"("+i[0]+s+")";default:return"("+i.join(s)+")"}}};var OO=/["\\\t\n\r\b\f]/g,PO=a(function(r){return rV[r]},"escapeReplacer"),rV={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};Nt.prototype.encodeIRI=function(r){var e=this._prefixRegex.exec(r);if(e){var t=this._prefixByIri[e[1]];return this._usedPrefixes[t]=!0,t+":"+e[2]}return"<"+r+">"};Nt.prototype.toUpdate=function(r){switch(r.type||r.updateType){case"load":return"LOAD"+(r.source?" "+this.toEntity(r.source):"")+(r.destination?" INTO GRAPH "+this.toEntity(r.destination):"");case"insert":return"INSERT DATA "+this.group(r.insert,!0);case"delete":return"DELETE DATA "+this.group(r.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(r.delete,!0);case"insertdelete":return(r.graph?"WITH "+this.toEntity(r.graph)+this._newline:"")+(r.delete.length?"DELETE "+this.group(r.delete,!0)+this._newline:"")+(r.insert.length?"INSERT "+this.group(r.insert,!0)+this._newline:"")+(r.using?this.graphs("USING ",r.using.default):"")+(r.using?this.graphs("USING NAMED ",r.using.named):"")+"WHERE "+this.group(r.where,!0);case"add":case"copy":case"move":return r.type.toUpperCase()+" "+(r.silent?"SILENT ":"")+(r.source.default?"DEFAULT":this.toEntity(r.source.name))+" TO "+this.toEntity(r.destination.name);case"create":case"clear":case"drop":return r.type.toUpperCase()+(r.silent?" SILENT ":" ")+(r.graph.default?"DEFAULT":r.graph.named?"NAMED":r.graph.all?"ALL":"GRAPH "+this.toEntity(r.graph.name));default:throw new Error("Unknown update query type: "+r.type)}};Nt.prototype.indent=function(r){return r.replace(/^/gm,this._indent)};function Im(r){return"?"+r.value}a(Im,"variableToString");function cd(r){return typeof r=="string"}a(cd,"isString");function _a(r){return typeof r.termType=="string"}a(_a,"isTerm");function vc(r,e){if(!r||!_a(r)||!e||!_a(e)||r.termType!==e.termType)return!1;switch(r.termType){case"Literal":return r.value===e.value&&r.language===e.language&&vc(r.datatype,e.datatype);case"Quad":return vc(r.subject,e.subject)&&vc(r.predicate,e.predicate)&&vc(r.object,e.object)&&vc(r.graph,e.graph);default:return r.value===e.value}}a(vc,"equalTerms");function ni(r,e,t,n){return r.map(t,n).join(cd(e)?e:" ")}a(ni,"mapJoin");function nV(r={}){return{stringify:a(function(e){var t=Object.create(r);return t.prefixes=e.prefixes,new Nt(t).toQuery(e)},"stringify"),createGenerator:a(function(){return new Nt(r)},"createGenerator")}}a(nV,"_Generator");DO.exports={Generator:nV}});var Mw=E(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.BlankNode=void 0;var kw=class{static{a(this,"BlankNode")}constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}};xm.BlankNode=kw});var jw=E(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.DefaultGraph=void 0;var ld=class{static{a(this,"DefaultGraph")}constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}};Rm.DefaultGraph=ld;ld.INSTANCE=new ld});var Om=E(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.NamedNode=void 0;var $w=class{static{a(this,"NamedNode")}constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}};Cm.NamedNode=$w});var Uw=E(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Literal=void 0;var LO=Om(),ud=class r{static{a(this,"Literal")}constructor(e,t){this.termType="Literal",this.value=e,typeof t=="string"?(this.language=t,this.datatype=r.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=r.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}};Pm.Literal=ud;ud.RDF_LANGUAGE_STRING=new LO.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");ud.XSD_STRING=new LO.NamedNode("http://www.w3.org/2001/XMLSchema#string")});var Vw=E(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.Quad=void 0;var Bw=class{static{a(this,"Quad")}constructor(e,t,n,i){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}};Dm.Quad=Bw});var Gw=E(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.Variable=void 0;var qw=class{static{a(this,"Variable")}constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}};Fm.Variable=qw});var kO=E(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});Lm.DataFactory=void 0;var iV=Mw(),sV=jw(),NO=Uw(),oV=Om(),aV=Vw(),cV=Gw(),lV=0,Ww=class{static{a(this,"DataFactory")}constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${lV++}_`}namedNode(e){return new oV.NamedNode(e)}blankNode(e){return new iV.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new NO.Literal(e,t)}variable(e){return new cV.Variable(e)}defaultGraph(){return sV.DefaultGraph.INSTANCE}quad(e,t,n,i){return new aV.Quad(e,t,n,i||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(NO.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}};Lm.DataFactory=Ww});var MO=E(ii=>{"use strict";var uV=ii&&ii.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Tc=ii&&ii.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&uV(e,r,t)};Object.defineProperty(ii,"__esModule",{value:!0});Tc(Mw(),ii);Tc(kO(),ii);Tc(jw(),ii);Tc(Uw(),ii);Tc(Om(),ii);Tc(Vw(),ii);Tc(Gw(),ii)});var $O=E((rge,jO)=>{var{Parser:_o}=CO(),{Generator:fV}=FO(),{Wildcard:dV}=Nw(),{DataFactory:pV}=MO();function hV({prefixes:r,baseIRI:e,factory:t,pathOnly:n,sparqlStar:i,skipValidation:s,skipUngroupedVariableCheck:o}={}){let c={};for(let u in r??{})c[u]=r[u];let l=new _o;return l.parse=function(){return _o.base=e||"",_o.prefixes=Object.create(c),_o.factory=t||new pV,_o.sparqlStar=!!i,_o.pathOnly=!!n,_o.skipValidation=!!s||!!o,_o.prototype.parse.apply(l,arguments)},l._resetBlanks=_o._resetBlanks,l}a(hV,"_Parser");jO.exports={Parser:hV,Generator:fV,Wildcard:dV}});var zw=E(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.CaseWhenTransformerError=Cl.CaseWhenTransformer=void 0;var Hw=class{static{a(this,"CaseWhenTransformer")}transform(e){let t=this.stripLineComments(e),n,i=0,s=100;do if(n=t,t=this.transformSinglePass(t),i++,i>s)throw new bo("Too many nested CASE expressions (max 100 iterations)");while(t!==n);return t}stripLineComments(e){let t="",n=0;for(;n<e.length;){let i=e[n];if(i==="'"||i==='"'){let s=i;for(t+=i,n++;n<e.length&&e[n]!==s;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}t+=e[n],n++}n<e.length&&(t+=e[n],n++);continue}if(i==="<"){let s=e.indexOf(">",n),o=e.indexOf(`
|
|
39
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var J=this.next();return J||this.lex()},"lex"),begin:a(function(J){this.conditionStack.push(J)},"begin"),popState:a(function(){var J=this.conditionStack.length-1;return J>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(J){return J=this.conditionStack.length-1-Math.abs(J||0),J>=0?this.conditionStack[J]:"INITIAL"},"topState"),pushState:a(function(J){this.begin(J)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{flex:!0,"case-insensitive":!0},performAction:a(function(J,le,Be,nt){var v=nt;switch(Be){case 0:break;case 1:return 12;case 2:return 15;case 3:return 41;case 4:return 325;case 5:return 326;case 6:return 45;case 7:return 47;case 8:return 48;case 9:return 39;case 10:return 24;case 11:return 28;case 12:return 29;case 13:return 31;case 14:return 32;case 15:return 36;case 16:return 53;case 17:return 327;case 18:return 63;case 19:return 64;case 20:return 70;case 21:return 73;case 22:return 76;case 23:return 78;case 24:return 81;case 25:return 83;case 26:return 85;case 27:return 193;case 28:return 100;case 29:return 328;case 30:return 121;case 31:return 329;case 32:return 330;case 33:return 110;case 34:return 331;case 35:return 109;case 36:return 332;case 37:return 333;case 38:return 113;case 39:return 115;case 40:return 116;case 41:return 131;case 42:return 123;case 43:return 126;case 44:return 128;case 45:return 132;case 46:return 112;case 47:return 334;case 48:return 335;case 49:return 159;case 50:return 161;case 51:return 164;case 52:return 174;case 53:return 160;case 54:return 336;case 55:return 163;case 56:return 312;case 57:return 314;case 58:return 317;case 59:return 318;case 60:return 272;case 61:return 197;case 62:return 337;case 63:return 338;case 64:return 229;case 65:return 340;case 66:return 263;case 67:return 224;case 68:return 231;case 69:return 232;case 70:return 242;case 71:return 246;case 72:return 290;case 73:return 341;case 74:return 342;case 75:return 343;case 76:return 344;case 77:return 345;case 78:return 250;case 79:return 346;case 80:return 265;case 81:return 276;case 82:return 277;case 83:return 268;case 84:return 269;case 85:return 270;case 86:return 271;case 87:return 347;case 88:return 348;case 89:return 273;case 90:return 274;case 91:return 350;case 92:return 349;case 93:return 351;case 94:return 279;case 95:return 280;case 96:return 283;case 97:return 285;case 98:return 289;case 99:return 293;case 100:return 296;case 101:return 13;case 102:return 16;case 103:return 308;case 104:return 309;case 105:return 87;case 106:return 292;case 107:return 82;case 108:return 294;case 109:return 295;case 110:return 297;case 111:return 298;case 112:return 299;case 113:return 300;case 114:return 301;case 115:return 302;case 116:return"EXPONENT";case 117:return 303;case 118:return 304;case 119:return 305;case 120:return 306;case 121:return 89;case 122:return 310;case 123:return 6;case 124:return"INVALID";case 125:console.log(le.yytext);break}},"anonymous"),rules:[/^(?:\s+|(#[^\n\r]*))/i,/^(?:BASE)/i,/^(?:PREFIX)/i,/^(?:SELECT)/i,/^(?:DISTINCT)/i,/^(?:REDUCED)/i,/^(?:\()/i,/^(?:AS)/i,/^(?:\))/i,/^(?:\*)/i,/^(?:CONSTRUCT)/i,/^(?:WHERE)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:DESCRIBE)/i,/^(?:ASK)/i,/^(?:FROM)/i,/^(?:NAMED)/i,/^(?:GROUP)/i,/^(?:BY)/i,/^(?:HAVING)/i,/^(?:ORDER)/i,/^(?:ASC)/i,/^(?:DESC)/i,/^(?:LIMIT)/i,/^(?:OFFSET)/i,/^(?:VALUES)/i,/^(?:;)/i,/^(?:LOAD)/i,/^(?:SILENT)/i,/^(?:INTO)/i,/^(?:CLEAR)/i,/^(?:DROP)/i,/^(?:CREATE)/i,/^(?:ADD)/i,/^(?:TO)/i,/^(?:MOVE)/i,/^(?:COPY)/i,/^(?:INSERT((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)WHERE)/i,/^(?:WITH)/i,/^(?:DELETE)/i,/^(?:INSERT)/i,/^(?:USING)/i,/^(?:DEFAULT)/i,/^(?:GRAPH)/i,/^(?:ALL)/i,/^(?:\.)/i,/^(?:OPTIONAL)/i,/^(?:SERVICE)/i,/^(?:BIND)/i,/^(?:UNDEF)/i,/^(?:MINUS)/i,/^(?:UNION)/i,/^(?:FILTER)/i,/^(?:<<)/i,/^(?:>>)/i,/^(?:\{\|)/i,/^(?:\|\})/i,/^(?:,)/i,/^(?:a)/i,/^(?:\|)/i,/^(?:\/)/i,/^(?:\^)/i,/^(?:\?)/i,/^(?:\+)/i,/^(?:!)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:IN)/i,/^(?:NOT)/i,/^(?:-)/i,/^(?:BOUND)/i,/^(?:BNODE)/i,/^(?:(RAND|NOW|UUID|STRUUID))/i,/^(?:(LANG|DATATYPE|IRI|URI|ABS|CEIL|FLOOR|ROUND|STRLEN|STR|UCASE|LCASE|ENCODE_FOR_URI|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|MD5|SHA1|SHA256|SHA384|SHA512|isIRI|isURI|isBLANK|isLITERAL|isNUMERIC))/i,/^(?:(SUBJECT|PREDICATE|OBJECT|isTRIPLE))/i,/^(?:(LANGMATCHES|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|STRLANG|STRDT|sameTerm))/i,/^(?:CONCAT)/i,/^(?:COALESCE)/i,/^(?:IF)/i,/^(?:TRIPLE)/i,/^(?:REGEX)/i,/^(?:SUBSTR)/i,/^(?:REPLACE)/i,/^(?:EXISTS)/i,/^(?:COUNT)/i,/^(?:SUM|MIN|MAX|AVG|SAMPLE)/i,/^(?:GROUP_CONCAT)/i,/^(?:SEPARATOR)/i,/^(?:\^\^)/i,/^(?:true|false)/i,/^(?:(<(?:[^<>\"\{\}\|\^`\\\u0000-\u0020])*>))/i,/^(?:((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:))/i,/^(?:(((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:)((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|:|[0-9]|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(_:(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?))/i,/^(?:([\?\$]((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])*)))/i,/^(?:(@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*))/i,/^(?:([0-9]+))/i,/^(?:([0-9]*\.[0-9]+))/i,/^(?:([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+)))/i,/^(?:(\+([0-9]+)))/i,/^(?:(\+([0-9]*\.[0-9]+)))/i,/^(?:(\+([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:(-([0-9]+)))/i,/^(?:(-([0-9]*\.[0-9]+)))/i,/^(?:(-([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(?:(?:[^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*'))/i,/^(?:("(?:(?:[^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*"))/i,/^(?:('''(?:(?:'|'')?(?:[^'\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*'''))/i,/^(?:("""(?:(?:"|"")?(?:[^\"\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*"""))/i,/^(?:(\((\u0020|\u0009|\u000D|\u000A)*\)))/i,/^(?:(\[(\u0020|\u0009|\u000D|\u000A)*\]))/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],inclusive:!0}}};return z})();xb.lexer=x6;function ot(){this.yy={}}return a(ot,"Parser"),ot.prototype=xb,xb.Parser=ot,new ot})();RO.exports=Z8});var FO=E(($me,DO)=>{var eV="http://www.w3.org/2001/XMLSchema#integer",tV="http://www.w3.org/2001/XMLSchema#string";function Nt(r){this._options=r=r||{};var e=r.prefixes||{};this._prefixByIri={};var t=[];for(var n in e){var i=e[n];cd(i)&&(this._prefixByIri[i]=n,t.push(i))}var s=t.join("|").replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&");this._prefixRegex=new RegExp("^("+s+")([a-zA-Z][\\-_a-zA-Z0-9]*)$"),this._usedPrefixes={},this._sparqlStar=r.sparqlStar,this._indent=cd(r.indent)?r.indent:" ",this._newline=cd(r.newline)?r.newline:`
|
|
40
|
+
`,this._explicitDatatype=!!r.explicitDatatype}a(Nt,"Generator");Nt.prototype.toQuery=function(r){var e="";return r.queryType&&(e+=r.queryType.toUpperCase()+" "),r.reduced&&(e+="REDUCED "),r.distinct&&(e+="DISTINCT "),r.variables?e+=ni(r.variables,void 0,function(t){return/^[?$]/.test(t)?t:_a(t)?this.toEntity(t):"("+this.toExpression(t.expression)+" AS "+Im(t.variable)+")"},this)+" ":r.template&&(e+=this.group(r.template,!0)+this._newline),r.from&&(e+=this.graphs("FROM ",r.from.default)+this.graphs("FROM NAMED ",r.from.named)),r.where&&(e+="WHERE "+this.group(r.where,!0)+this._newline),r.updates&&(e+=ni(r.updates,";"+this._newline,this.toUpdate,this)),r.group&&(e+="GROUP BY "+ni(r.group,void 0,function(t){var n=_a(t.expression)?this.toEntity(t.expression):"("+this.toExpression(t.expression)+")";return t.variable?"("+n+" AS "+Im(t.variable)+")":n},this)+this._newline),r.having&&(e+="HAVING ("+ni(r.having,void 0,this.toExpression,this)+")"+this._newline),r.order&&(e+="ORDER BY "+ni(r.order,void 0,function(t){var n="("+this.toExpression(t.expression)+")";return t.descending?"DESC "+n:n},this)+this._newline),r.offset&&(e+="OFFSET "+r.offset+this._newline),r.limit&&(e+="LIMIT "+r.limit+this._newline),r.values&&(e+=this.values(r)),e=this.baseAndPrefixes(r)+e,e.trim()};Nt.prototype.baseAndPrefixes=function(r){var e=r.base?"BASE <"+r.base+">"+this._newline:"",t="";for(var n in r.prefixes)(this._options.allPrefixes||this._usedPrefixes[n])&&(t+="PREFIX "+n+": <"+r.prefixes[n]+">"+this._newline);return e+t};Nt.prototype.toPattern=function(r){var e=r.type||r instanceof Array&&"array"||(r.subject&&r.predicate&&r.object?"triple":"");if(!(e in this))throw new Error("Unknown entry type: "+e);return this[e](r)};Nt.prototype.triple=function(r){return this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+"."};Nt.prototype.array=function(r){return ni(r,this._newline,this.toPattern,this)};Nt.prototype.bgp=function(r){return this.encodeTriples(r.triples)};Nt.prototype.encodeTriples=function(r){if(!r.length)return"";for(var e=[],t=void 0,n=void 0,i=0;i<r.length;i++){var s=r[i];vc(s.subject,t)?vc(s.predicate,n)?e.push(","):(n=s.predicate,e.push(";"+this._newline,this._indent,this.toEntity(n))):(t&&e.push("."+this._newline),t=s.subject,n=s.predicate,e.push(this.toEntity(t)," ",this.toEntity(n))),e.push(" ",this.toEntity(s.object))}return e.push("."),e.join("")};Nt.prototype.graph=function(r){return"GRAPH "+this.toEntity(r.name)+" "+this.group(r)};Nt.prototype.graphs=function(r,e){return!e||e.length===0?"":ni(e,"",function(t){return r+this.toEntity(t)+this._newline},this)};Nt.prototype.group=function(r,e){return r=e!==!0?this.array(r.patterns||r.triples):this.toPattern(r.type!=="group"?r:r.patterns),r.indexOf(this._newline)===-1?"{ "+r+" }":"{"+this._newline+this.indent(r)+this._newline+"}"};Nt.prototype.query=function(r){return this.toQuery(r)};Nt.prototype.filter=function(r){return"FILTER("+this.toExpression(r.expression)+")"};Nt.prototype.bind=function(r){return"BIND("+this.toExpression(r.expression)+" AS "+Im(r.variable)+")"};Nt.prototype.optional=function(r){return"OPTIONAL "+this.group(r)};Nt.prototype.union=function(r){return ni(r.patterns,this._newline+"UNION"+this._newline,function(e){return this.group(e,!0)},this)};Nt.prototype.minus=function(r){return"MINUS "+this.group(r)};Nt.prototype.values=function(r){var e=Object.keys(r.values.reduce(function(i,s){for(var o in s)i[o]=!0;return i},{})),t,n;return e.length===1?t=n="":(t="(",n=")"),"VALUES "+t+e.join(" ")+n+" {"+this._newline+ni(r.values,this._newline,function(i){return" "+t+ni(e,void 0,function(s){return i[s]?this.toEntity(i[s]):"UNDEF"},this)+n},this)+this._newline+"}"};Nt.prototype.service=function(r){return"SERVICE "+(r.silent?"SILENT ":"")+this.toEntity(r.name)+" "+this.group(r)};Nt.prototype.toExpression=function(r){if(_a(r))return this.toEntity(r);switch(r.type.toLowerCase()){case"aggregate":return r.aggregation.toUpperCase()+"("+(r.distinct?"DISTINCT ":"")+this.toExpression(r.expression)+(typeof r.separator=="string"?'; SEPARATOR = "'+r.separator.replace(OO,PO)+'"':"")+")";case"functioncall":return this.toEntity(r.function)+"("+ni(r.args,", ",this.toExpression,this)+")";case"operation":var e=r.operator.toUpperCase(),t=r.args||[];switch(r.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(_a(t[0])?this.toEntity(t[0]):"("+this.toExpression(t[0])+")")+" "+e+" "+(_a(t[1])?this.toEntity(t[1]):"("+this.toExpression(t[1])+")");case"!":return"!("+this.toExpression(t[0])+")";case"uplus":return"+("+this.toExpression(t[0])+")";case"uminus":return"-("+this.toExpression(t[0])+")";case"notin":e="NOT IN";case"in":return this.toExpression(t[0])+" "+e+"("+(cd(t[1])?t[1]:ni(t[1],", ",this.toExpression,this))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+this.group(t[0],!0);default:return e+"("+ni(t,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+r.type)}};Nt.prototype.toEntity=function(r){if(_a(r))switch(r.termType){case"Wildcard":return"*";case"Variable":return Im(r);case"BlankNode":return"_:"+r.value;case"Literal":var e=r.value||"",t=r.language||"",n=r.datatype;if(r='"'+e.replace(OO,PO)+'"',t)r+="@"+t;else if(n){if(!this._explicitDatatype)switch(n.value){case tV:return r;case eV:if(/^\d+$/.test(e))return e+" "}r+="^^"+this.encodeIRI(n.value)}return r;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return r.graph&&r.graph.termType!=="DefaultGraph"?"<< GRAPH "+this.toEntity(r.graph)+" { "+this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+" } >>":"<< "+this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+" >>";default:return this.encodeIRI(r.value)}else{var i=r.items.map(this.toEntity,this),s=r.pathType;switch(s){case"^":case"!":return s+i[0];case"*":case"+":case"?":return"("+i[0]+s+")";default:return"("+i.join(s)+")"}}};var OO=/["\\\t\n\r\b\f]/g,PO=a(function(r){return rV[r]},"escapeReplacer"),rV={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};Nt.prototype.encodeIRI=function(r){var e=this._prefixRegex.exec(r);if(e){var t=this._prefixByIri[e[1]];return this._usedPrefixes[t]=!0,t+":"+e[2]}return"<"+r+">"};Nt.prototype.toUpdate=function(r){switch(r.type||r.updateType){case"load":return"LOAD"+(r.source?" "+this.toEntity(r.source):"")+(r.destination?" INTO GRAPH "+this.toEntity(r.destination):"");case"insert":return"INSERT DATA "+this.group(r.insert,!0);case"delete":return"DELETE DATA "+this.group(r.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(r.delete,!0);case"insertdelete":return(r.graph?"WITH "+this.toEntity(r.graph)+this._newline:"")+(r.delete.length?"DELETE "+this.group(r.delete,!0)+this._newline:"")+(r.insert.length?"INSERT "+this.group(r.insert,!0)+this._newline:"")+(r.using?this.graphs("USING ",r.using.default):"")+(r.using?this.graphs("USING NAMED ",r.using.named):"")+"WHERE "+this.group(r.where,!0);case"add":case"copy":case"move":return r.type.toUpperCase()+" "+(r.silent?"SILENT ":"")+(r.source.default?"DEFAULT":this.toEntity(r.source.name))+" TO "+this.toEntity(r.destination.name);case"create":case"clear":case"drop":return r.type.toUpperCase()+(r.silent?" SILENT ":" ")+(r.graph.default?"DEFAULT":r.graph.named?"NAMED":r.graph.all?"ALL":"GRAPH "+this.toEntity(r.graph.name));default:throw new Error("Unknown update query type: "+r.type)}};Nt.prototype.indent=function(r){return r.replace(/^/gm,this._indent)};function Im(r){return"?"+r.value}a(Im,"variableToString");function cd(r){return typeof r=="string"}a(cd,"isString");function _a(r){return typeof r.termType=="string"}a(_a,"isTerm");function vc(r,e){if(!r||!_a(r)||!e||!_a(e)||r.termType!==e.termType)return!1;switch(r.termType){case"Literal":return r.value===e.value&&r.language===e.language&&vc(r.datatype,e.datatype);case"Quad":return vc(r.subject,e.subject)&&vc(r.predicate,e.predicate)&&vc(r.object,e.object)&&vc(r.graph,e.graph);default:return r.value===e.value}}a(vc,"equalTerms");function ni(r,e,t,n){return r.map(t,n).join(cd(e)?e:" ")}a(ni,"mapJoin");function nV(r={}){return{stringify:a(function(e){var t=Object.create(r);return t.prefixes=e.prefixes,new Nt(t).toQuery(e)},"stringify"),createGenerator:a(function(){return new Nt(r)},"createGenerator")}}a(nV,"_Generator");DO.exports={Generator:nV}});var Mw=E(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.BlankNode=void 0;var kw=class{static{a(this,"BlankNode")}constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}};xm.BlankNode=kw});var jw=E(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.DefaultGraph=void 0;var ld=class{static{a(this,"DefaultGraph")}constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}};Rm.DefaultGraph=ld;ld.INSTANCE=new ld});var Om=E(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.NamedNode=void 0;var $w=class{static{a(this,"NamedNode")}constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}};Cm.NamedNode=$w});var Uw=E(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Literal=void 0;var LO=Om(),ud=class r{static{a(this,"Literal")}constructor(e,t){this.termType="Literal",this.value=e,typeof t=="string"?(this.language=t,this.datatype=r.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=r.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}};Pm.Literal=ud;ud.RDF_LANGUAGE_STRING=new LO.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");ud.XSD_STRING=new LO.NamedNode("http://www.w3.org/2001/XMLSchema#string")});var Vw=E(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.Quad=void 0;var Bw=class{static{a(this,"Quad")}constructor(e,t,n,i){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}};Dm.Quad=Bw});var Gw=E(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.Variable=void 0;var qw=class{static{a(this,"Variable")}constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}};Fm.Variable=qw});var kO=E(Lm=>{"use strict";Object.defineProperty(Lm,"__esModule",{value:!0});Lm.DataFactory=void 0;var iV=Mw(),sV=jw(),NO=Uw(),oV=Om(),aV=Vw(),cV=Gw(),lV=0,Ww=class{static{a(this,"DataFactory")}constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${lV++}_`}namedNode(e){return new oV.NamedNode(e)}blankNode(e){return new iV.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new NO.Literal(e,t)}variable(e){return new cV.Variable(e)}defaultGraph(){return sV.DefaultGraph.INSTANCE}quad(e,t,n,i){return new aV.Quad(e,t,n,i||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(NO.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}};Lm.DataFactory=Ww});var MO=E(ii=>{"use strict";var uV=ii&&ii.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Tc=ii&&ii.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&uV(e,r,t)};Object.defineProperty(ii,"__esModule",{value:!0});Tc(Mw(),ii);Tc(kO(),ii);Tc(jw(),ii);Tc(Uw(),ii);Tc(Om(),ii);Tc(Vw(),ii);Tc(Gw(),ii)});var $O=E((nge,jO)=>{var{Parser:_o}=CO(),{Generator:fV}=FO(),{Wildcard:dV}=Nw(),{DataFactory:pV}=MO();function hV({prefixes:r,baseIRI:e,factory:t,pathOnly:n,sparqlStar:i,skipValidation:s,skipUngroupedVariableCheck:o}={}){let c={};for(let u in r??{})c[u]=r[u];let l=new _o;return l.parse=function(){return _o.base=e||"",_o.prefixes=Object.create(c),_o.factory=t||new pV,_o.sparqlStar=!!i,_o.pathOnly=!!n,_o.skipValidation=!!s||!!o,_o.prototype.parse.apply(l,arguments)},l._resetBlanks=_o._resetBlanks,l}a(hV,"_Parser");jO.exports={Parser:hV,Generator:fV,Wildcard:dV}});var zw=E(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.CaseWhenTransformerError=Cl.CaseWhenTransformer=void 0;var Hw=class{static{a(this,"CaseWhenTransformer")}transform(e){let t=this.stripLineComments(e),n,i=0,s=100;do if(n=t,t=this.transformSinglePass(t),i++,i>s)throw new bo("Too many nested CASE expressions (max 100 iterations)");while(t!==n);return t}stripLineComments(e){let t="",n=0;for(;n<e.length;){let i=e[n];if(i==="'"||i==='"'){let s=i;for(t+=i,n++;n<e.length&&e[n]!==s;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}t+=e[n],n++}n<e.length&&(t+=e[n],n++);continue}if(i==="<"){let s=e.indexOf(">",n),o=e.indexOf(`
|
|
41
41
|
`,n);if(s!==-1&&(o===-1||s<o)){t+=e.substring(n,s+1),n=s+1;continue}}if(i==="#"){let s=e.indexOf(`
|
|
42
42
|
`,n),o=s===-1?e.length:s;t+=" ".repeat(o-n),n=o;continue}t+=i,n++}return t}transformSinglePass(e){let t=this.findCasePositions(e);if(t.length===0)return e;let n=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractCaseExpression(n,s);if(o){let c=this.convertCaseToIf(o.content);n=n.substring(0,s)+c+n.substring(s+o.length)}}return n}findCasePositions(e){let t=[],n=e.toUpperCase(),i=0;for(;i<e.length;){if(e[i]==="'"||e[i]==='"'){let s=e[i];for(i++;i<e.length&&e[i]!==s;)e[i]==="\\"&&i++,i++;i++;continue}if(n.substring(i,i+4)==="CASE"&&this.isWordBoundary(e,i,4)){t.push(i),i+=4;continue}i++}return t}extractCaseExpression(e,t){let n=1,i=t+4,s=e.toUpperCase();for(;i<e.length&&n>0;){if(e[i]==="'"||e[i]==='"'){let o=e[i];for(i++;i<e.length&&e[i]!==o;)e[i]==="\\"&&i++,i++;i++;continue}if(s.substring(i,i+4)==="CASE"&&this.isWordBoundary(e,i,4)){n++,i+=4;continue}if(s.substring(i,i+3)==="END"&&this.isWordBoundary(e,i,3)){if(n--,n===0){let o=e.substring(t,i+3);return{content:o,length:o.length}}i+=3;continue}i++}if(n>0)throw new bo(`Unclosed CASE expression at position ${t}`);return null}isWordBoundary(e,t,n){let i=t>0?e[t-1]:"",s=t===0||!/[a-zA-Z0-9_?$]/.test(i),o=t+n<e.length?e[t+n]:"",c=t+n>=e.length||!/[a-zA-Z0-9_]/.test(o);return s&&c}convertCaseToIf(e){let t=this.extractWhenClauses(e),n=this.extractElseClause(e);if(t.length===0)throw new bo("CASE expression must have at least one WHEN clause");let i=n!==null?n:'""';for(let s=t.length-1;s>=0;s--){let{condition:o,result:c}=t[s];i=`IF(${o}, ${c}, ${i})`}return i}extractWhenClauses(e){let t=[],n=e.replace(/^\s*CASE\s+/i,"").replace(/\s*END\s*$/i,""),i=this.findKeywordPositions(n,"WHEN"),s=this.findKeywordPositions(n,"ELSE"),o=s.length>0?s[0]:n.length;for(let c=0;c<i.length;c++){let l=i[c]+4,u=c+1<i.length?i[c+1]:o,f=n.substring(l,u).trim(),d=this.parseWhenClause(f);d&&t.push(d)}return t}findKeywordPositions(e,t){let n=[],i=e.toUpperCase(),s=0,o=0;for(;s<e.length;){let c=e[s];if(c==="'"||c==='"'){let l=c;for(s++;s<e.length&&e[s]!==l;)e[s]==="\\"&&s++,s++;s++;continue}if(c==="("){o++,s++;continue}if(c===")"){o--,s++;continue}if(o===0&&i.substring(s,s+t.length)===t&&this.isWordBoundary(e,s,t.length)){n.push(s),s+=t.length;continue}s++}return n}parseWhenClause(e){let t=this.findKeywordPositions(e,"THEN");if(t.length===0)throw new bo(`WHEN clause missing THEN keyword: ${e.substring(0,50)}...`);let n=t[0],i=e.substring(0,n).trim(),s=e.substring(n+4).trim();if(!i)throw new bo("WHEN clause has empty condition");if(!s)throw new bo("WHEN clause has empty result");return{condition:i,result:s}}extractElseClause(e){let t=e.replace(/^\s*CASE\s+/i,"").replace(/\s*END\s*$/i,""),n=this.findKeywordPositions(t,"ELSE");if(n.length>0){let i=n[0];return t.substring(i+4).trim()}return null}};Cl.CaseWhenTransformer=Hw;var bo=class extends Error{static{a(this,"CaseWhenTransformerError")}constructor(e){super(`CASE WHEN transformation error: ${e}`),this.name="CaseWhenTransformerError"}};Cl.CaseWhenTransformerError=bo});var Kw=E(Ol=>{"use strict";Object.defineProperty(Ol,"__esModule",{value:!0});Ol.LateralTransformerError=Ol.LateralTransformer=void 0;var Nm=class r{static{a(this,"LateralTransformer")}transform(e){let t=e,n,i=0,s=100;do if(n=t,t=this.transformSinglePass(t),i++,i>s)throw new ba("Too many nested LATERAL joins (max 100 iterations)");while(t!==n);return t}hasLateral(e){return this.findLateralPositions(e).length>0}static isLateralJoin(e){if(e.type==="group"&&e.patterns){for(let t of e.patterns)if(t.type==="query"&&t.queryType==="SELECT"&&t.variables&&Array.isArray(t.variables)){for(let n of t.variables)if(n.termType==="Variable"&&n.value===r.LATERAL_MARKER)return!0}}if(e.type==="query"&&e.queryType==="SELECT"&&e.variables&&Array.isArray(e.variables)){for(let t of e.variables)if(t.termType==="Variable"&&t.value===r.LATERAL_MARKER)return!0}return!1}transformSinglePass(e){let t=this.findLateralPositions(e);if(t.length===0)return e;let n=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractLateralExpression(n,s);if(o){let c=this.transformLateral(o.content);n=n.substring(0,s)+c+n.substring(s+o.length)}}return n}findLateralPositions(e){let t=[],n=e.toUpperCase(),i=0;for(;i<e.length;){if(e[i]==="'"||e[i]==='"'){let s=e[i];for(i++;i<e.length&&e[i]!==s;)e[i]==="\\"&&i++,i++;i++;continue}if(e[i]==="#"){for(;i<e.length&&e[i]!==`
|
|
43
43
|
`;)i++;continue}if(n.substring(i,i+7)==="LATERAL"&&this.isWordBoundary(e,i,7)){t.push(i),i+=7;continue}i++}return t}extractLateralExpression(e,t){let n=t+7;for(;n<e.length&&/\s/.test(e[n]);)n++;if(e[n]!=="{")throw new ba(`Expected '{' after LATERAL keyword at position ${t}`);let i=1;for(n++;n<e.length&&i>0;){if(e[n]==="'"||e[n]==='"'){let s=e[n];for(n++;n<e.length&&e[n]!==s;)e[n]==="\\"&&n++,n++;n++;continue}if(e[n]==="#"){for(;n<e.length&&e[n]!==`
|
|
@@ -67,7 +67,7 @@ ${n}}`}default:throw new nu(`Unsupported operation type for SPARQL generation: $
|
|
|
67
67
|
`)}generateTriple(e){let t=this.generateElement(e.subject),n=this.generatePredicate(e.predicate),i=this.generateElement(e.object);return`${t} ${n} ${i}`}generatePredicate(e){return"pathType"in e?this.generatePropertyPath(e):this.generateElement(e)}generatePropertyPath(e){let t=e.items.map(n=>"pathType"in n?`(${this.generatePropertyPath(n)})`:`<${n.value}>`);switch(e.pathType){case"/":return t.join("/");case"|":return t.join("|");case"^":return`^${t[0]}`;case"+":return`${t[0]}+`;case"*":return`${t[0]}*`;case"?":return`${t[0]}?`}}generateElement(e){switch(e.type){case"variable":return`?${e.value}`;case"iri":return`<${e.value}>`;case"literal":{let n=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`;return e.language?n+=`@${e.language}`:e.datatype&&(n+=`^^<${e.datatype}>`),n}case"blank":return`_:${e.value}`;default:throw new nu(`Unknown element type: ${e.type}`)}}generateValues(e,t){let n=" ".repeat(t);if(e.variables.length===0||e.bindings.length===0)return"";if(e.variables.length===1){let o=e.variables[0],c=e.bindings.map(l=>{let u=l[o];return u?this.generateValuesTerm(u):"UNDEF"}).join(" ");return`${n}VALUES ?${o} { ${c} }`}let i=e.variables.map(o=>`?${o}`).join(" "),s=e.bindings.map(o=>`(${e.variables.map(l=>{let u=o[l];return u?this.generateValuesTerm(u):"UNDEF"}).join(" ")})`);return`${n}VALUES (${i}) {
|
|
68
68
|
${s.map(o=>`${n} ${o}`).join(`
|
|
69
69
|
`)}
|
|
70
|
-
${n}}`}generateValuesTerm(e){if(e.type==="iri")return`<${e.value}>`;let n=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;return e.language?n+=`@${e.language}`:e.datatype&&(n+=`^^<${e.datatype}>`),n}generateExpression(e){switch(e.type){case"variable":return`?${e.name}`;case"literal":return typeof e.value=="string"?`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:typeof e.value=="boolean"?e.value?"true":"false":String(e.value);case"comparison":return`(${this.generateExpression(e.left)} ${e.operator} ${this.generateExpression(e.right)})`;case"logical":return e.operator==="!"?`!(${this.generateExpression(e.operands[0])})`:`(${e.operands.map(t=>this.generateExpression(t)).join(` ${e.operator} `)})`;case"arithmetic":return`(${this.generateExpression(e.left)} ${e.operator} ${this.generateExpression(e.right)})`;case"function":return`${e.function.toUpperCase()}(${e.args.map(t=>this.generateExpression(t)).join(", ")})`;case"functionCall":return`${(typeof e.function=="string"?e.function:e.function.value).toUpperCase()}(${e.args.map(n=>this.generateExpression(n)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.generateWhereClause(e.pattern,0)} }`;case"in":{let t=this.generateExpression(e.expression),n=e.list.map(i=>this.generateExpression(i)).join(", ");return e.negated?`${t} NOT IN (${n})`:`${t} IN (${n})`}default:throw new nu(`Unknown expression type: ${e.type}`)}}collectVariablesFromOperation(e,t){switch(e.type){case"bgp":for(let n of e.triples)this.collectVariablesFromTriple(n,t);break;case"filter":this.collectVariablesFromOperation(e.input,t),this.collectVariablesFromExpression(e.expression,t);break;case"join":case"leftjoin":case"union":case"minus":this.collectVariablesFromOperation(e.left,t),this.collectVariablesFromOperation(e.right,t);break;case"values":for(let n of e.variables)t.add(n);break;case"project":for(let n of e.variables)t.add(n);this.collectVariablesFromOperation(e.input,t);break;case"extend":t.add(e.variable),this.collectVariablesFromOperation(e.input,t);break;case"orderby":case"slice":case"distinct":case"reduced":this.collectVariablesFromOperation(e.input,t);break;case"group":for(let n of e.variables)t.add(n);for(let n of e.aggregates)t.add(n.variable);this.collectVariablesFromOperation(e.input,t);break;case"subquery":this.collectVariablesFromOperation(e.query,t);break}}collectVariablesFromTriple(e,t){e.subject.type==="variable"&&t.add(e.subject.value),"type"in e.predicate&&e.predicate.type==="variable"&&t.add(e.predicate.value),e.object.type==="variable"&&t.add(e.object.value)}collectVariablesFromExpression(e,t){switch(e.type){case"variable":t.add(e.name);break;case"comparison":case"arithmetic":this.collectVariablesFromExpression(e.left,t),this.collectVariablesFromExpression(e.right,t);break;case"logical":for(let n of e.operands)this.collectVariablesFromExpression(n,t);break;case"function":case"functionCall":for(let n of e.args)this.collectVariablesFromExpression(n,t);break;case"exists":this.collectVariablesFromOperation(e.pattern,t);break;case"in":this.collectVariablesFromExpression(e.expression,t);for(let n of e.list)this.collectVariablesFromExpression(n,t);break}}};iu.SPARQLGenerator=K1});var ou=E(Gn=>{"use strict";var rq=Gn&&Gn.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),nq=Gn&&Gn.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),DP=Gn&&Gn.__importStar||(function(){var r=a(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&rq(t,e,n[i]);return nq(t,e),t}})();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.QueryExecutor=Gn.ExoQLQueryExecutor=Gn.QueryExecutorError=void 0;var iq=h1(),sq=hg(),oq=F1(),aq=N1(),cq=SP(),lq=EP(),uq=IP(),fq=W1(),dq=RP(),pq=OP(),hq=PP(),mq=Ke(),gq=tt(),yq=ag(),Qr="http://www.w3.org/2001/XMLSchema#",_q=new Set([`${Qr}integer`,`${Qr}decimal`,`${Qr}float`,`${Qr}double`,`${Qr}nonPositiveInteger`,`${Qr}negativeInteger`,`${Qr}long`,`${Qr}int`,`${Qr}short`,`${Qr}byte`,`${Qr}nonNegativeInteger`,`${Qr}unsignedLong`,`${Qr}unsignedInt`,`${Qr}unsignedShort`,`${Qr}unsignedByte`,`${Qr}positiveInteger`]),su=class extends Error{static{a(this,"QueryExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="QueryExecutorError"}};Gn.QueryExecutorError=su;var vg=class{static{a(this,"ExoQLQueryExecutor")}constructor(e,t={}){this.tripleStore=e,this.bgpExecutor=new iq.BGPExecutor(e),this.filterExecutor=new sq.FilterExecutor,this.optionalExecutor=new oq.OptionalExecutor,this.unionExecutor=new aq.UnionExecutor,this.minusExecutor=new cq.MinusExecutor,this.valuesExecutor=new lq.ValuesExecutor,this.aggregateExecutor=new uq.AggregateExecutor,this.constructExecutor=new fq.ConstructExecutor,this.serviceExecutor=new dq.ServiceExecutor(t.serviceConfig),this.graphExecutor=new pq.GraphExecutor(e),this.sparqlGenerator=new hq.SPARQLGenerator,this.filterExecutor.setExistsEvaluator(async(n,i)=>this.evaluateExistsPattern(n,i)),this.filterExecutor.setTripleStore(e)}async evaluateExistsPattern(e,t){for await(let n of this.execute(e))if(t.merge(n)!==null)return!0;return!1}async executeAll(e){let t=[];for await(let n of this.execute(e))t.push(n);return t}async*execute(e){switch(e.type){case"bgp":yield*this.executeBGP(e);break;case"filter":yield*this.executeFilter(e);break;case"join":yield*this.executeJoin(e);break;case"leftjoin":yield*this.executeLeftJoin(e);break;case"union":yield*this.executeUnion(e);break;case"minus":yield*this.executeMinus(e);break;case"values":yield*this.executeValues(e);break;case"project":yield*this.executeProject(e);break;case"orderby":yield*this.executeOrderBy(e);break;case"slice":yield*this.executeSlice(e);break;case"distinct":yield*this.executeDistinct(e);break;case"reduced":yield*this.executeReduced(e);break;case"group":yield*this.executeGroup(e);break;case"extend":yield*this.executeExtend(e);break;case"subquery":yield*this.executeSubquery(e);break;case"lateraljoin":yield*this.executeLateralJoin(e);break;case"service":yield*this.executeService(e);break;case"graph":yield*this.executeGraph(e);break;default:throw new su(`Unknown operation type: ${e.type}`)}}async*executeBGP(e){yield*this.bgpExecutor.execute(e)}async*executeFilter(e){let t=this.execute(e.input);yield*this.filterExecutor.execute(e,t)}async*executeJoin(e){let t=[];for await(let o of this.execute(e.left))t.push(o);if(t.length===0)return;let n=new Set;for(let o of t)for(let c of o.variables())n.add(c);let i=this.collectOperationVariables(e.right);if([...n].some(o=>i.has(o)))for(let o of t){let c=this.substituteVariables(e.right,o);for await(let l of this.execute(c)){let u=o.merge(l);u!==null&&(yield u)}}else{let o=[];for await(let c of this.execute(e.right))o.push(c);for(let c of t)for(let l of o){let u=c.merge(l);u!==null&&(yield u)}}}async*executeLeftJoin(e){let t=[];for await(let o of this.execute(e.left))t.push(o);let n=[];for await(let o of this.execute(e.right))n.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of n)yield o}a(s,"rightGen"),yield*this.optionalExecutor.execute(i(),s())}async*executeUnion(e){let t=[];for await(let o of this.execute(e.left))t.push(o);let n=[];for await(let o of this.execute(e.right))n.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of n)yield o}a(s,"rightGen"),yield*this.unionExecutor.execute(i(),s())}async*executeMinus(e){let t=[];for await(let o of this.execute(e.left))t.push(o);let n=[];for await(let o of this.execute(e.right))n.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of n)yield o}a(s,"rightGen"),yield*this.minusExecutor.execute(i(),s())}async*executeValues(e){yield*this.valuesExecutor.execute(e)}async*executeProject(e){let{SolutionMapping:t}=await Promise.resolve().then(()=>DP(So())),n=new Set(e.variables);for await(let i of this.execute(e.input)){let s=new t;for(let o of i.variables())if(n.has(o)){let c=i.get(o);c!==void 0&&s.set(o,c)}yield s}}async*executeOrderBy(e){let t=[];for await(let n of this.execute(e.input))t.push(n);t.sort((n,i)=>{for(let s of e.comparators){let o=this.getExpressionValue(s.expression,n),c=this.getExpressionValue(s.expression,i),l=0;if(o===void 0&&c===void 0?l=0:o===void 0?l=1:c===void 0?l=-1:typeof o=="number"&&typeof c=="number"?l=o-c:l=String(o).localeCompare(String(c)),s.descending&&(l=-l),l!==0)return l}return 0});for(let n of t)yield n}async*executeSlice(e){let t=0,n=e.offset??0,i=e.limit;for await(let s of this.execute(e.input)){if(t>=n){if(i!==void 0&&t-n>=i)break;yield s}t++}}async*executeDistinct(e){let t=new Set;for await(let n of this.execute(e.input)){let i=this.getSolutionKey(n);t.has(i)||(t.add(i),yield n)}}async*executeReduced(e){let t=new Set;for await(let n of this.execute(e.input)){let i=this.getSolutionKey(n);t.has(i)||(t.add(i),yield n)}}async*executeGroup(e){let t=[];for await(let i of this.execute(e.input))t.push(i);let n=this.aggregateExecutor.execute(e,t);if(e.having&&e.having.length>0)for(let i of n)e.having.every(o=>this.filterExecutor.evaluateExpression(o,i)===!0)&&(yield i);else for(let i of n)yield i}async*executeExtend(e){let t=e.expression.type!=="aggregate"&&this.filterExecutor.expressionContainsExists(e.expression);for await(let n of this.execute(e.input)){let i=n.clone(),s=t?await this.evaluateExtendExpressionAsync(e.expression,n):this.evaluateExtendExpression(e.expression,n);s!==void 0&&i.set(e.variable,s),yield i}}async*executeSubquery(e){yield*this.execute(e.query)}async*executeLateralJoin(e){let t=[];for await(let n of this.execute(e.left))t.push(n);for(let n of t){let i=this.substituteVariables(e.right,n);for await(let s of this.execute(i)){let o=n.merge(s);o!==null&&(yield o)}}}substituteVariables(e,t){let n=JSON.parse(JSON.stringify(e));return this.substituteInOperation(n,t)}substituteInOperation(e,t){if(!e||typeof e!="object")return e;let n=e;return e.type==="bgp"&&e.triples?(e.triples=e.triples.map(i=>this.substituteInTriple(i,t)),e):(n.input&&(n.input=this.substituteInOperation(n.input,t)),n.left&&(n.left=this.substituteInOperation(n.left,t)),n.right&&(n.right=this.substituteInOperation(n.right,t)),n.pattern&&(n.pattern=this.substituteInOperation(n.pattern,t)),n.query&&(n.query=this.substituteInOperation(n.query,t)),n.where&&(n.where=this.substituteInOperation(n.where,t)),n.expression&&this.substituteInExpression(n.expression,t),e)}substituteInExpression(e,t){if(!(!e||typeof e!="object")){if(e.type==="exists"&&e.pattern&&(e.pattern=this.substituteInOperation(e.pattern,t)),e.left&&this.substituteInExpression(e.left,t),e.right&&this.substituteInExpression(e.right,t),e.operands)for(let n of e.operands)this.substituteInExpression(n,t);if(e.args)for(let n of e.args)this.substituteInExpression(n,t);if(e.expression&&this.substituteInExpression(e.expression,t),e.list)for(let n of e.list)this.substituteInExpression(n,t)}}substituteInTriple(e,t){return{subject:this.substituteInTripleElement(e.subject,t),predicate:e.predicate,object:this.substituteInTripleElement(e.object,t)}}substituteInTripleElement(e,t){if(e&&e.type==="variable"){let n=t.get(e.value);if(n!=null){let i=n;if(n instanceof mq.IRI||i.termType==="NamedNode")return{type:"iri",value:n.value};if(i.termType==="Literal"||typeof i.value=="string")return{type:"literal",value:i.value,datatype:i.datatype?.value??i._datatype?.value,language:i.language??i._language}}}return e}async*executeService(e){yield*this.serviceExecutor.execute(e,t=>this.sparqlGenerator.generateSelect(t))}async*executeGraph(e){let t=async function*(n,i){let s=this.currentGraphContext;this.currentGraphContext=i;try{n.type==="bgp"&&i&&this.tripleStore.matchInGraph?yield*this.executeBGPInGraph(n,i):yield*this.execute(n)}finally{this.currentGraphContext=s}}.bind(this);yield*this.graphExecutor.execute(e,t)}async*executeBGPInGraph(e,t){if(e.triples.length===0){let{SolutionMapping:n}=await Promise.resolve().then(()=>DP(So()));yield new n;return}yield*this.bgpExecutor.executeInGraph(e,t)}evaluateExtendExpression(e,t){if(e.type!=="aggregate")try{return this.filterExecutor.evaluateExpression(e,t)}catch{return}}async evaluateExtendExpressionAsync(e,t){if(e.type!=="aggregate")try{return await this.filterExecutor.evaluateExpressionAsync(e,t)}catch{return}}getExpressionValue(e,t){if(e.type==="variable"){let n=t.get(e.name);if(!n)return;if(n instanceof gq.Literal){let i=n.datatype?.value;if(i===`${Qr}dayTimeDuration`)try{return yq.DateTimeFunctions.parseDayTimeDuration(n.value)}catch{return n.value}if(i&&_q.has(i)){let s=parseFloat(n.value);if(!Number.isNaN(s))return s}return n.value}return n.value??n.id??String(n)}if(e.type==="literal")return e.value}collectOperationVariables(e){let t=new Set;return this.collectVarsFromOperation(e,t),t}collectVarsFromOperation(e,t){if(!e||typeof e!="object")return;let n=e;if(n.type==="bgp"&&n.triples)for(let i of n.triples)this.collectVarsFromElement(i.subject,t),i.predicate?.type!=="path"&&this.collectVarsFromElement(i.predicate,t),this.collectVarsFromElement(i.object,t);if(n.type==="values"&&n.variables)for(let i of n.variables)t.add(i);n.expression&&this.collectVarsFromExpressionTree(n.expression,t),n.type==="extend"&&n.variable&&t.add(n.variable),n.input&&this.collectVarsFromOperation(n.input,t),n.left&&this.collectVarsFromOperation(n.left,t),n.right&&this.collectVarsFromOperation(n.right,t),n.pattern&&this.collectVarsFromOperation(n.pattern,t),n.query&&this.collectVarsFromOperation(n.query,t),n.where&&this.collectVarsFromOperation(n.where,t)}collectVarsFromElement(e,t){if(!e||typeof e!="object")return;let n=e;n.type==="variable"&&t.add(n.value),n.type==="quoted"&&(this.collectVarsFromElement(n.subject,t),this.collectVarsFromElement(n.predicate,t),this.collectVarsFromElement(n.object,t))}collectVarsFromExpressionTree(e,t){if(!e||typeof e!="object")return;let n=e;if(n.type==="variable"&&n.name&&t.add(n.name),n.type==="exists"&&n.pattern&&this.collectVarsFromOperation(n.pattern,t),n.left&&this.collectVarsFromExpressionTree(n.left,t),n.right&&this.collectVarsFromExpressionTree(n.right,t),n.operands)for(let i of n.operands)this.collectVarsFromExpressionTree(i,t);if(n.args)for(let i of n.args)this.collectVarsFromExpressionTree(i,t);if(n.expression&&this.collectVarsFromExpressionTree(n.expression,t),n.list)for(let i of n.list)this.collectVarsFromExpressionTree(i,t)}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}isConstructQuery(e){return e.type==="construct"}async executeConstruct(e){if(e.type!=="construct")throw new su("executeConstruct requires a CONSTRUCT operation");let t=await this.executeAll(e.where);return this.constructExecutor.execute(e.template,t)}isAskQuery(e){return e.type==="ask"}async executeAsk(e){if(e.type!=="ask")throw new su("executeAsk requires an ASK operation");for await(let t of this.execute(e.where))return!0;return!1}};Gn.ExoQLQueryExecutor=vg;Gn.QueryExecutor=vg});var UP=E(wo=>{"use strict";var bq=wo&&wo.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Sq=wo&&wo.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)};Object.defineProperty(wo,"__esModule",{value:!0});wo.CommandResolver=void 0;var wq=Ze(),Eq=Al(),nr=Ke(),Mt=tt(),re=Jt(),FP=da(),LP=Bf(),vq=xl(),Tq=od(),au=cS(),Tg=IO(),Aq=Ml(),Iq=$l(),xq=ou(),Pc=10,Ag="exo__Asset",Rq=Pc+1,NP="08cec529-90eb-4d43-88de-ceecccea12b0",Cq=re.Namespace.EXOCMD.term("SubstitutionToken").value,kP=new Set(["today","tomorrow","todayStart","targetFolder","target","randomUUIDv4","nowTimestamp","nowDate","nowYear","nowMonth","userInputLabel","userInput","targetProperty","labelAsArray","groundingTargetClass","targetClassSelf"]);function Oq(r,e){return`__SUBSTITUTE__${r}__${e}__`}a(Oq,"buildSubstitutionMarker");function Pq(r,e,t){let n=(0,vq.utf8ToBase64)(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return`__SUBSTITUTE_P__${r}__${e}__${n}__`}a(Pq,"buildParameterisedMarker");var MP="3f28af98-c031-4718-8ba2-44ad0b012c52",Dq=re.Namespace.EXOCMD.term("TokenInvocation").value,jP="29e2c8f8-2d27-4e58-b467-2e85d46f8122",$P="universal-default-template",Y1=class{static{a(this,"CommandResolver")}clearUniversalCache(){this._universalCacheReady=!1,this._universalCacheValue=null,(0,Tg.clearUniversalDefault)()}constructor(e,t=Eq.NullLogger){this.tripleStore=e,this.logger=t,this.cache=new Map,this.multiCache=new Map,this._ancestorDepthCache=new Map,this._legacyPropertyDefaultsWarnedGroundings=new Set,this._universalCacheReady=!1,this._universalCacheValue=null}async resolveForAssetMulti(e,t,n){if(t.length===0)return[];let i=[...t].sort().join(","),s=`${e}::${i}::${n??""}`,o=this.multiCache.get(s);if(o)return o;let c=n?await this.expandPrototypeChain(n):void 0,l=await this.expandClassHierarchy(t),u=new Map;for(let[h,_]of l){let y=await this.resolveForAsset(e,h,c);for(let S of y){let w=this.getBindingPriority(S.binding)===2?_:0,T=u.get(S.binding.id);(!T||w<T.depth)&&u.set(S.binding.id,{rc:S,depth:w})}}let f=new Set;for(let{rc:h}of u.values())if(h.binding.overrides)for(let _ of h.binding.overrides)f.add(_);let d=Array.from(u.entries()).filter(([h])=>!f.has(h)).map(([,h])=>h);d.sort((h,_)=>{let y=this.getBindingPriority(h.rc.binding),S=this.getBindingPriority(_.rc.binding);return y!==S?y-S:h.depth!==_.depth?h.depth-_.depth:(h.rc.binding.order??100)-(_.rc.binding.order??100)});let p=d.map(h=>h.rc);return this.multiCache.set(s,p),p}async expandClassHierarchy(e){let t=new Map;for(let c of e){if(c===Ag){t.set(c,new Set);continue}let l=[];try{l=await this.getClassAncestors(c)}catch{l=[]}t.set(c,new Set(l))}let n=a(c=>{for(let l of e)if(l!==c&&t.get(l)?.has(c)&&!t.get(c)?.has(l))return!0;return!1},"isAncestorOfSibling"),i=e.filter(c=>!n(c)),s=new Map,o=a((c,l)=>{let u=s.get(c);(u===void 0||l<u)&&s.set(c,l)},"setMin");for(let c of i){if(o(c,0),this.looksLikeUUID(c))try{let u=await this.resolveLabelByUID(c);u&&o(u,0)}catch{}if(c===Ag)continue;let l=[];try{l=await this.getClassAncestorsWithDepth(c)}catch{l=[]}for(let{ref:u,depth:f}of l)o(u,f)}return s.has(Ag)||s.set(Ag,Rq),s}async resolveForAsset(e,t,n){let i=typeof n=="string"?`s:${n}`:n?`c:${n.join("\0")}`:"",s=`${e}:${t}:${i}`,o=this.cache.get(s);if(o)return o;let c=typeof n=="string"?await this.expandPrototypeChain(n):n,l=await this.findBindings(t,c,e),u=[];for(let f of l){let d=await this.loadCommand(f.commandRef,{targetClass:f.targetClass});if(!d)continue;let p=f.precondition?{...d,precondition:f.precondition}:d;u.push({command:p,binding:f})}return u.sort((f,d)=>{let p=this.getBindingPriority(f.binding),h=this.getBindingPriority(d.binding);return p!==h?p-h:(f.binding.order??100)-(d.binding.order??100)}),this.cache.set(s,u),u}async loadCommand(e,t){let n=await this.findSubjectByUID(e);if(!n||(await this.tripleStore.match(n,re.Namespace.RDF.term("type"),re.Namespace.EXOCMD.term("Command"))).length===0)return null;let s=await this.getLiteralValue(n,re.Namespace.EXO.term("Asset_label"))??"Unknown Command",o=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_labelTemplate")),c=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_icon")),l=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_confirmMessage")),u=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_successMessage")),f=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_category")),d=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_openInSameTab")),p=d!==null&&String(d).trim().toLowerCase()==="true",h=await this.loadLinkedPrecondition(n),_=await this.loadLinkedGrounding(n,0,t);return _?{id:e,name:s,labelTemplate:o??void 0,icon:c??void 0,precondition:h??void 0,grounding:_,confirmMessage:l??void 0,successMessage:u??void 0,category:f??void 0,openInSameTab:p||void 0}:null}async findBindings(e,t,n){let i=typeof t=="string"?await this.expandPrototypeChain(t):t,s=await this.tripleStore.match(void 0,re.Namespace.RDF.term("type"),re.Namespace.EXOCMD.term("CommandBinding")),o=[];for(let c of s){let l=c.subject,u=await this.loadBindingDefinition(l);u&&this.bindingMatches(u,e,i,n)&&o.push(u)}return o}async findPaletteEnabledCommands(){let e=await this.tripleStore.match(void 0,re.Namespace.RDF.term("type"),re.Namespace.EXOCMD.term("Command")),t=[],n=new Set;for(let i of e){let s=i.subject;if((await this.getLiteralValue(s,re.Namespace.EXOCMD.term("Command_paletteEnabled")))?.toLowerCase()!=="true")continue;let c=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_uid"));if(!c){this.logger.warn(`[CommandResolver] paletteEnabled command at ${s.value} has no exo__Asset_uid \u2014 skipped`);continue}let l=await this.loadCommand(c);if(!l){this.logger.warn(`[CommandResolver] paletteEnabled command ${c} could not be loaded (missing grounding?) \u2014 skipped`);continue}let u=await this.getLiteralValue(s,re.Namespace.EXOCMD.term("Command_paletteId")),f=await this.getLiteralValue(s,re.Namespace.EXOCMD.term("Command_cliName")),d=u??f??c;if(n.has(d)){this.logger.warn(`[CommandResolver] duplicate paletteId "${d}" \u2014 first registration wins, dropping ${c}`);continue}n.add(d),t.push({command:l,paletteId:d})}return t}invalidateCache(){this.cache.clear(),this.multiCache.clear(),this._ancestorDepthCache.clear()}async resolveLabel(e,t){if(!e.labelTemplate)return e.name;let n=e.labelTemplate,i=this.extractPlaceholders(e.labelTemplate);for(let{full:s,body:o}of i){let c=await this.evaluateSelectSnippet(o,t);n=n.replace(s,c)}return n}extractPlaceholders(e){let t=[],n=0;for(;n<e.length;)if(e[n]==="{"){let i=1,s=n+1;for(;s<e.length&&i>0;)e[s]==="{"?i++:e[s]==="}"&&i--,s++;if(i===0){let o=e.slice(n,s),c=e.slice(n+1,s-1);t.push({full:o,body:c})}n=s}else n++;return t}async evaluateSelectSnippet(e,t){try{let n=e.replace(/\$target/g,`<${t}>`),s=new Aq.ExoQLParser().parse(n),c=new Iq.ExoQLAlgebraTranslator().translate(s),u=await new xq.ExoQLQueryExecutor(this.tripleStore).executeAll(c);if(u.length===0)return"";let f=u[0],d=f.variables();if(d.length===0)return"";let p=f.get(d[0]);return p?p instanceof Mt.Literal||p instanceof nr.IRI?p.value:String(p):""}catch{return""}}async loadBindingDefinition(e){let t=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid"));if(!t)return null;let n=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_label"))??"",i=await this.getLinkedUID(e,re.Namespace.EXOCMD.term("CommandBinding_command"));if(!i)return null;let s=await this.getLinkedValue(e,re.Namespace.EXOCMD.term("CommandBinding_targetClass")),o=await this.getLinkedValue(e,re.Namespace.EXOCMD.term("CommandBinding_targetPrototype")),c=await this.getLinkedValue(e,re.Namespace.EXOCMD.term("CommandBinding_targetAsset"));if(!s&&!o&&!c)return null;let l=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBinding_position")),u=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBinding_order")),f=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBinding_variant")),d=f!==null?this.coerceVariant(f,t):void 0,p=await this.loadLinkedPreconditionFromProperty(e,re.Namespace.EXOCMD.term("CommandBinding_precondition")),h=await this.loadLinkedStyle(e,t),_=await this.getLinkedUIDs(e,re.Namespace.EXOCMD.term("CommandBinding_overrides"));return{id:t,label:n,commandRef:i,targetClass:s??void 0,targetPrototype:o??void 0,targetAsset:c??void 0,position:l??void 0,order:u?parseInt(u,10):void 0,variant:d,precondition:p??void 0,style:h??void 0,overrides:_.length>0?_:void 0}}async loadLinkedStyle(e,t){let n=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("CommandBinding_style"),void 0);if(n.length>0){let s=n[0].object,o=null;if(s instanceof nr.IRI)o=s;else if(s instanceof Mt.Literal){let c=this.normalizeWikilink(s.value);o=await this.findSubjectByUID(c)}if(o){let c=await this.loadStyleAsset(o);if(c)return c}this.logger.warn(this.capWarning(`CommandBinding ${t}: style reference unresolved, falling back to inline variant`))}let i=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBinding_variant"));if(i!==null){let s=this.coerceVariant(i,t);if(s!==void 0)return{id:`inline:${t}`,label:"",variant:s,inline:!0}}return null}async loadStyleAsset(e){let t=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid"));if(!t)return null;let n=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_label"))??"",i=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_variant")),s=i!==null?this.coerceVariant(i,t):void 0,o=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_showIcon")),c=this.coerceBoolean(o),l=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_labelClass")),u=l!==null?this.coerceLabelClass(l,t):void 0,f=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_ariaLabel")),d=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_tooltip")),p=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_keyboardShortcut")),h=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_source")),_=h!==null?this.coerceStyleSource(h,t):void 0;return{id:t,label:n,variant:s,showIcon:c,labelClass:u,ariaLabel:f??void 0,tooltip:d??void 0,keyboardShortcut:p??void 0,source:_,inline:!1}}coerceVariant(e,t){if(e==null)return;let n=String(e).trim().toLowerCase();if(n!==""){if(au.COMMAND_VARIANT_VALUES.includes(n))return n;this.logger.warn(this.capWarning(`CommandBindingStyle variant "${n}" not in whitelist [${au.COMMAND_VARIANT_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceLabelClass(e,t){if(e==null)return;let n=String(e).trim().toLowerCase();if(n!==""){if(au.LABEL_CLASS_VALUES.includes(n))return n;this.logger.warn(this.capWarning(`CommandBindingStyle labelClass "${n}" not in whitelist [${au.LABEL_CLASS_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceStyleSource(e,t){if(e==null)return;let n=String(e).trim().toLowerCase();if(n!==""){if(au.STYLE_SOURCE_VALUES.includes(n))return n;this.logger.warn(this.capWarning(`CommandBindingStyle source "${n}" not in whitelist [${au.STYLE_SOURCE_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceBoolean(e){if(e===null)return;let t=e.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}capWarning(e){return e.length<=200?e:e.slice(0,197)+"..."}bindingMatches(e,t,n,i){if(e.targetAsset&&i&&this.matchesReference(e.targetAsset,i))return!0;if(e.targetPrototype&&n){for(let s of n)if(this.matchesReference(e.targetPrototype,s))return!0}return!!(e.targetClass&&t&&this.matchesReference(e.targetClass,t))}matchesReference(e,t){let n=this.normalizeWikilink(e),i=this.normalizeWikilink(t);if(n===i)return!0;let s=this.extractPathBasename(i);if(s&&s===n)return!0;let o=this.extractPathBasename(n);if(o&&o===i)return!0;let c=this.extractAlias(t);if(c&&n===c)return!0;let l=this.extractAlias(e);return!!(l&&l===i)}extractPathBasename(e){let t=e.match(/\/([^/]+)\.md$/);return t?t[1]:null}extractAlias(e){let t=e.replace(/["'[\]]/g,"").trim(),n=t.indexOf("|");return n>=0?t.substring(n+1).trim():null}getBindingPriority(e){return e.targetAsset?0:e.targetPrototype?1:2}async loadLinkedPrecondition(e){return this.loadLinkedPreconditionFromProperty(e,re.Namespace.EXOCMD.term("Command_precondition"))}async loadLinkedPreconditionFromProperty(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=await this.resolvePreconditionRef(n[0].object);return i?this.loadPreconditionSubject(i,new Set,0):null}async resolvePreconditionRef(e){if(e instanceof nr.IRI)return e;if(e instanceof Mt.Literal){let t=this.normalizeWikilink(e.value);return await this.findSubjectByUID(t)}return null}async loadPreconditionSubject(e,t,n){let i=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid")),s=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_label"))??"";if(i&&t.has(i))return this.brokenPreconditionNode(i,s);if(n>=Pc)return this.brokenPreconditionNode(i??"",s);let o=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("AllPrecondition_preconditions"),void 0),c=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("AnyPrecondition_preconditions"),void 0),l=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("NotPrecondition_precondition"),void 0);if(o.length>0||c.length>0||l.length>0){let p=new Set(t);if(i&&p.add(i),o.length>0||c.length>0){let _=o.length>0?"all":"any",y=o.length>0?o:c,S=[];for(let w of y)S.push(await this.loadChildPrecondition(w.object,p,n+1));return{id:i??"",label:s,composite:{op:_,children:S}}}let h=await this.loadChildPrecondition(l[0].object,p,n+1);return{id:i??"",label:s,not:h}}let u=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Precondition_sparqlAsk")),f=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Precondition_hostFunction")),d=await this.loadPreconditionQueryRef(e);return!i||!u&&!f&&!d?null:{id:i,label:s,...u&&{sparqlAsk:u},...f&&{hostFunction:f},...d&&{query:d}}}async loadChildPrecondition(e,t,n){let i=await this.resolvePreconditionRef(e);if(!i){let c=e instanceof Mt.Literal?this.normalizeWikilink(e.value):"";return this.brokenPreconditionNode(c,"")}let s=await this.loadPreconditionSubject(i,t,n);if(s)return s;let o=await this.getLiteralValue(i,re.Namespace.EXO.term("Asset_uid"));return this.brokenPreconditionNode(o??"","")}async loadPreconditionQueryRef(e){let t=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Precondition_query"),void 0);if(t.length===0)return;let n=t[0].object;if(n instanceof nr.IRI)return await this.getLiteralValue(n,re.Namespace.EXO.term("Asset_uid"))??void 0;if(n instanceof Mt.Literal)return this.normalizeWikilink(n.value)}brokenPreconditionNode(e,t){return{id:e,label:t,broken:!0}}async loadLinkedGrounding(e,t,n){if(t>=Pc)return null;let i=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Command_grounding"),void 0);if(i.length===0)return null;if(i.length===1||!n?.targetClass){let o=await this.resolveGroundingRef(i[0].object);return o?this.loadGroundingDefinition(o,t):null}for(let o of i){let c=await this.resolveGroundingRef(o.object);if(!c)continue;let l=await this.getObsidianName(c,re.Namespace.EXOCMD.term("Grounding_targetPrototype"));if(l&&this.matchesReference(l,n.targetClass))return this.loadGroundingDefinition(c,t)}this.logger.warn(`Command ${e.value}: ${i.length} groundings declared, none matched context.targetClass='${n.targetClass}' via Grounding_targetPrototype \u2014 falling back to first grounding by iteration order (legacy behaviour). Check that one grounding's Grounding_targetPrototype references this targetClass.`);let s=await this.resolveGroundingRef(i[0].object);return s?this.loadGroundingDefinition(s,t):null}async resolveGroundingRef(e){if(e instanceof nr.IRI)return e;if(e instanceof Mt.Literal){let t=this.normalizeWikilink(e.value);return await this.findSubjectByUID(t)}return null}async loadGroundingByUid(e){let t=await this.findSubjectByUID(e);return t?this.loadGroundingDefinition(t,0):null}async loadGroundingDefinition(e,t){if(t>=Pc)return null;let n=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid"));if(!n)return null;let i=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_label"))??"",s=await this.resolveGroundingTypeReference(e);if(!s)return null;let o=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetProperty"));if(o&&this.looksLikeUUID(o)){let se=await this.resolveLabelByUID(o);if(!se)return this.logger.warn(`Grounding ${n}: targetProperty wikilink UID '${o}' is not resolvable to exo__Asset_label \u2014 grounding skipped (would otherwise write a UUID-named frontmatter key).`),null;o=se}if(s===FP.GroundingType.SERVICE_CALL){let se=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_serviceId"));se&&(o=se)}let c=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetValueRef")),l=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_targetValueLiteral")),u=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetValueSubstitution")),f=null;if(u&&this.looksLikeUUID(u)){let se=await this.resolveLabelByUID(u);if(!se)return this.logger.warn(`Grounding ${n}: targetValueSubstitution UID '${u}' is not resolvable to exo__Asset_label (SubstitutionToken instance missing or unlabelled) \u2014 grounding skipped.`),null;f=se}else u&&(f=u);let d=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetValueQuery")),p=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_serviceCallPayload")),h=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_appendExpression")),_=await this.getObsidianWikilinkValue(e,re.Namespace.EXOCMD.term("Grounding_isDefinedBy")),y=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_sparqlUpdate")),S=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetClass"));if(S&&!this.looksLikeUUID(S)){let se=await this.findUidByLabel(S);se&&(S=se)}let w=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetPrototype")),T=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_targetFolder")),O=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_linkBackProperty")),A=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_inputSchema")),x=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_incrementBy")),P=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_shiftDelta")),V;if(x!=null&&x!==""){let se=Number.parseInt(String(x),10);Number.isFinite(se)&&(V=se)}let j=await this.resolvePropertyDefaults(e,n),$=await this.resolveInheritanceRules(e,n),K=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_propertyDefaults"));K!==null&&K!==""&&!this._legacyPropertyDefaultsWarnedGroundings.has(n)&&(this.logger.warn(`Grounding ${n}: deprecated exocmd__Grounding_propertyDefaults (plural) JSON predicate detected \u2014 the parser was removed in RFC v2 Phase 5 (#3167); value is ignored. Migrate to ref-form exocmd__Grounding_propertyDefault (singular) pointing to exocmd__PropertyDefault assets. See vault TBox c8f87363-d39c-45cb-9d4d-1be96d70f892 for the canonical replacement.`),this._legacyPropertyDefaultsWarnedGroundings.add(n));let N;s===FP.GroundingType.COMPOSITE&&(N=await this.loadCompositeSteps(e,t+1));let ae;if(A)try{let se=JSON.parse(A);se?.properties&&(ae=Object.entries(se.properties).map(([_e,Ne])=>{let Q=Ne.type,ce=Q==="string"?"text":Q,be=Ne.defaultValue!==void 0?Ne.defaultValue:Ne.default,Ie={name:_e,type:ce,label:Ne.title??_e,required:Array.isArray(se.required)&&se.required.includes(_e)};return be!=null&&(Ie.defaultValue=String(be)),typeof Ne.targetClassUid=="string"&&(Ie.targetClassUid=Ne.targetClassUid),Ie}))}catch{}let we=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_prefillLabelWithDate")),te=we!==null&&String(we).trim().toLowerCase()==="true",pe=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_labelTemplate")),Y=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_direction")),Ee;if(Y!=null){let se=String(Y).trim().toLowerCase();se==="forward"||se==="rollback"?Ee=se:se!==""&&this.logger.warn(`Grounding ${n}: exocmd__Grounding_direction value '${Y}' is not 'forward' or 'rollback' \u2014 treating as undefined (will default to 'forward' at dispatch).`)}let ie=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_bodyTemplate")),ne=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_templateRef")),de=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_cloneTargetBody")),ge=de!==null&&String(de).trim().toLowerCase()==="true",Z=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_targetsCreatedInstance")),ye=Z!==null&&String(Z).trim().toLowerCase()==="true",Pe={id:n,label:i,type:s,targetProperty:o??void 0,targetValueRef:c??void 0,targetValueLiteral:l??void 0,targetValueSubstitution:f??void 0,targetValueQuery:d??void 0,serviceCallPayload:p??void 0,appendExpression:h??void 0,sparqlUpdate:y??void 0,steps:N,targetClass:S??void 0,targetPrototype:w??void 0,targetFolder:T??void 0,linkBackProperty:O??void 0,incrementBy:V,shiftDelta:P??void 0,propertyDefault:j.length>0?j:void 0,inheritanceRule:$.length>0?$:void 0,isDefinedBy:_??void 0,prefillLabelWithDate:te||void 0,labelTemplate:pe??void 0,direction:Ee,bodyTemplate:ie??void 0,templateRef:ne??void 0,cloneTargetBody:ge||void 0,targetsCreatedInstance:ye||void 0};return ae&&(Pe.inputSchema=ae),Pe}async loadCompositeSteps(e,t){if(t>=Pc)return[];let n=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Grounding_steps"),void 0),i=[];for(let s of n){let o=null;if(s.object instanceof nr.IRI)o=s.object;else if(s.object instanceof Mt.Literal){let l=this.normalizeWikilink(s.object.value);o=await this.findSubjectByUID(l)}if(!o)continue;let c=await this.loadGroundingDefinition(o,t);c&&i.push(c)}return i}async resolvePropertyDefaults(e,t){let n=await this.resolvePropertyDefaultsForSubject(e,t,re.Namespace.EXOCMD.term("Grounding_propertyDefault")),i=await this.getUniversalCache();return i&&i.propertyDefaults.length>0?(0,Tg.mergePropertyDefaults)(i.propertyDefaults,n):n}async resolvePropertyDefaultsForSubject(e,t,n){let i=await this.tripleStore.match(e,n,void 0),s=[];for(let o of i){let c=await this.resolveRefTripleObject(o.object);if(!c)continue;let l=await this.getObsidianName(c,re.Namespace.EXOCMD.term("PropertyDefault_property"));if(!l){this.logger.warn(`Grounding ${t}: PropertyDefault asset missing exocmd__PropertyDefault_property \u2014 entry skipped.`);continue}let u=this.looksLikeUUID(l)?await this.resolveLabelByUID(l):l;if(!u){this.logger.warn(`Grounding ${t}: PropertyDefault property UID '${l}' is not resolvable to exo__Asset_label \u2014 entry skipped.`);continue}let f=await this.getObsidianName(c,re.Namespace.EXOCMD.term("PropertyDefault_value"));if(!f){this.logger.warn(`Grounding ${t}: PropertyDefault '${u}' missing exocmd__PropertyDefault_value \u2014 entry skipped.`);continue}let d=await this.resolvePropertyDefaultValue(f,t,u);d!==null&&s.push({propertyName:u,value:d})}return s}async getUniversalCache(){if(this._universalCacheReady)return this._universalCacheValue;this._universalCacheReady=!0;let e=await(0,Tg.loadUniversalDefault)();if(e)return this._universalCacheValue=e,e;let t=await this.findUniversalSingleton();if(!t)return this._universalCacheValue=null,null;let n=await this.resolvePropertyDefaultsForSubject(t,$P,re.Namespace.EXOCMD.term("Template_propertyDefault")),i=await this.resolveInheritanceRulesForSubject(t,$P,re.Namespace.EXOCMD.term("Template_inheritanceRule"));return this._universalCacheValue={propertyDefaults:n,inheritanceRules:i},this._universalCacheValue}async findUniversalSingleton(){let e=re.Namespace.EXOCMD.term("UniversalDefaultTemplate").value,t=await this.tripleStore.match(void 0,re.Namespace.EXO.term("Instance_class"),void 0),n=[];for(let i of t){let s=!1;if(i.object instanceof nr.IRI)s=i.object.value===e||i.object.value.includes(jP);else if(i.object instanceof Mt.Literal){let o=this.unwrapWikilink(i.object.value);s=o==="exocmd__UniversalDefaultTemplate"||o===jP}s&&i.subject instanceof nr.IRI&&n.push(i.subject)}return n.length===0?null:(n.length===1||(n.sort((i,s)=>i.value.localeCompare(s.value)),this.logger.warn(`Multiple UniversalDefaultTemplate singletons found (${n.length}); selecting deterministically by lexicographic UID order: ${n[0].value}`)),n[0])}async resolveInheritanceRules(e,t){let n=await this.resolveInheritanceRulesForSubject(e,t,re.Namespace.EXOCMD.term("Grounding_inheritanceRule")),i=await this.getUniversalCache();return i&&i.inheritanceRules.length>0?(0,Tg.mergeInheritanceRules)(i.inheritanceRules,n):n}async resolveInheritanceRulesForSubject(e,t,n){let i=await this.tripleStore.match(e,n,void 0),s=[],o=t;for(let c of i){let l=await this.resolveRefTripleObject(c.object);if(!l)continue;let u=await this.resolveLabelRef(l,re.Namespace.EXOCMD.term("InheritanceRule_sourceProperty"));if(!u){this.logger.warn(`Grounding ${o}: InheritanceRule missing/unresolvable exocmd__InheritanceRule_sourceProperty \u2014 entry skipped.`);continue}let f=await this.resolveLabelRef(l,re.Namespace.EXOCMD.term("InheritanceRule_targetProperty"));if(!f){this.logger.warn(`Grounding ${o}: InheritanceRule missing/unresolvable exocmd__InheritanceRule_targetProperty \u2014 entry skipped.`);continue}let d=await this.tripleStore.match(l,re.Namespace.EXOCMD.term("InheritanceRule_targetClassCondition"),void 0),p,h;if(d.length>0){let A=await this.getObsidianName(l,re.Namespace.EXOCMD.term("InheritanceRule_targetClassCondition"));if(!A||!A.trim()){this.logger.warn(`Grounding ${o}: InheritanceRule has exocmd__InheritanceRule_targetClassCondition triple but ref is unresolvable \u2014 entire rule skipped (would otherwise apply unconditionally, broadening scope).`);continue}this.looksLikeUUID(A)?(h=A,p=await this.resolveLabelByUID(A)??void 0):p=A}let _=await this.tripleStore.match(l,re.Namespace.EXOCMD.term("InheritanceRule_targetClassExclusion"),void 0),y=[],S=[],w=!1;for(let A of _){let x=null;if(A.object instanceof nr.IRI?x=this.iriToObsidianName(A.object.value)??A.object.value:A.object instanceof Mt.Literal&&(x=this.unwrapWikilink(A.object.value)),!x){w=!0;continue}if(this.looksLikeUUID(x)){S.push(x);let P=await this.resolveLabelByUID(x);P&&y.push(P)}else y.push(x)}if(w){this.logger.warn(`Grounding ${o}: InheritanceRule has unresolvable exocmd__InheritanceRule_targetClassExclusion entry \u2014 entire rule skipped (would otherwise expand scope by silently dropping the excluded class).`);continue}let T=await this.getLiteralValue(l,re.Namespace.EXOCMD.term("InheritanceRule_priority")),O=50;if(T!==null&&T!==""){let A=Number.parseInt(String(T),10);Number.isFinite(A)&&(O=A)}s.push({sourcePropertyName:u,targetPropertyName:f,targetClassCondition:p,targetClassConditionUid:h,targetClassExclusion:y,targetClassExclusionUids:S,priority:O})}return s}async resolveRefTripleObject(e){if(e instanceof nr.IRI)return e;if(e instanceof Mt.Literal){let t=this.normalizeWikilink(e.value);return t?this.findSubjectByUID(t):null}return null}async resolveLabelRef(e,t){let n=await this.getObsidianName(e,t);return n?this.looksLikeUUID(n)?this.resolveLabelByUID(n):n:null}async resolvePropertyDefaultValue(e,t,n){if(!this.looksLikeUUID(e))return`"[[${e}]]"`;let i=await this.findSubjectByUID(e);return i?await this.assetIsTokenInvocation(i)?this.resolveTokenInvocation(i,e,t,n):await this.assetIsSubstitutionToken(i)?this.dispatchSubstitutionToken(i,e,t,n,void 0):`"[[${e}]]"`:`"[[${e}]]"`}async dispatchSubstitutionToken(e,t,n,i,s){let o=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("SubstitutionToken_resolver"));if(!o||!o.trim())return this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' references SubstitutionToken '${t}' with no exocmd__SubstitutionToken_resolver \u2014 falling back to wikilink form.`),`"[[${t}]]"`;let c=o.trim();return kP.has(c)?s!==void 0?Pq(c,t,s):Oq(c,t):(this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' SubstitutionToken '${t}' declares unknown resolver-id '${c}' \u2014 falling back to wikilink form. Known ids: ${Array.from(kP).join(", ")}.`),`"[[${t}]]"`)}async resolveTokenInvocation(e,t,n,i){let s=await this.getObsidianName(e,re.Namespace.EXOCMD.term("TokenInvocation_token"));if(!s)return this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' TokenInvocation '${t}' missing exocmd__TokenInvocation_token \u2014 entry skipped.`),null;let o=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("TokenInvocation_parameter"))??"";if(!this.looksLikeUUID(s))return this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' TokenInvocation '${t}' references non-UUID token '${s}' \u2014 entry skipped.`),null;let c=await this.findSubjectByUID(s);return c?this.dispatchSubstitutionToken(c,s,n,i,o):(this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' TokenInvocation '${t}' token ref '${s}' not found in store \u2014 entry skipped.`),null)}async assetIsTokenInvocation(e){let t=await this.tripleStore.match(e,re.Namespace.EXO.term("Instance_class"),void 0);for(let n of t)if(n.object instanceof nr.IRI){if(n.object.value===Dq||n.object.value.includes(MP))return!0}else if(n.object instanceof Mt.Literal){let i=this.unwrapWikilink(n.object.value);if(i==="exocmd__TokenInvocation"||i===MP)return!0}return!1}async assetIsSubstitutionToken(e){let t=await this.tripleStore.match(e,re.Namespace.EXO.term("Instance_class"),void 0);for(let n of t)if(n.object instanceof nr.IRI){if(n.object.value===Cq||n.object.value.includes(NP))return!0}else if(n.object instanceof Mt.Literal){let i=this.unwrapWikilink(n.object.value);if(i==="exocmd__SubstitutionToken"||i===NP)return!0}return!1}async resolveGroundingTypeReference(e){let t=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Grounding_type"),void 0);if(t.length===0)return null;let n=t[0].object;if(n instanceof nr.IRI)return(0,LP.resolveGroundingTypeFromIRI)(n.value);if(n instanceof Mt.Literal){let i=n.value,s=i.match(/^\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\|[^\]]*)?\]\]$/i);return s?(0,LP.resolveGroundingTypeFromIRI)(`obsidian://vault/${s[1].toLowerCase()}.md`):(this.logger.warn(`[exocmd-grounding-type-literal-form] legacy literal-string form '${i}' for exocmd__Grounding_type on <${e.value}>. Migrate to wikilink form per RFC 9d20c91f Phase 3.`),null)}return null}async expandPrototypeChain(e){if(!e||!this.normalizeWikilink(e))return[];let t=[e],n=new Set([this.normalizeWikilink(e).toLowerCase()]),i=e;for(let s=0;s<Pc;s++){let o=this.extractUuidFromRef(i);if(!o)break;let c=null;try{let u=await this.findSubjectByUID(o);if(!u)break;c=await this.getLinkedValue(u,re.Namespace.EXO.term("Asset_prototype"))}catch(u){this.logger.debug(this.capWarning(`[expandPrototypeChain] store lookup failed at hop ${s} for '${i}': ${String(u)}`));break}if(!c)break;let l=this.normalizeWikilink(c).toLowerCase();if(n.has(l))break;n.add(l),t.push(c),i=c}return t}extractUuidFromRef(e){let t=this.normalizeWikilink(e);if(this.looksLikeUUID(t))return t;let n=this.extractPathBasename(t);return n&&this.looksLikeUUID(n)?n:null}async findSubjectByUID(e){if(this.tripleStore.findSubjectsByUUID){let n=await this.tripleStore.findSubjectsByUUID(e);if(n.length>0)return n[0]}let t=await this.tripleStore.match(void 0,re.Namespace.EXO.term("Asset_uid"),void 0);for(let n of t)if(n.object instanceof Mt.Literal&&n.object.value===e)return n.subject;return null}async getLiteralValue(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;return i instanceof Mt.Literal||i instanceof nr.IRI?i.value:null}looksLikeUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}async resolveLabelByUID(e){let t=await this.findSubjectByUID(e);return t?this.getLiteralValue(t,re.Namespace.EXO.term("Asset_label")):null}async getClassAncestors(e){return(await this.getClassAncestorsWithDepth(e)).map(n=>n.ref)}async getClassAncestorsWithDepth(e){let t=this._ancestorDepthCache.get(e);if(t)return t;let n=new Map,i=new Set,s=await this.resolveClassFileIRI(e);if(!s)return[];let o=new Set([e]),c=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_uid"));c&&o.add(c);let l=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_label"));l&&o.add(l);let u=a((p,h)=>{if(o.has(p))return;let _=n.get(p);(_===void 0||h<_)&&n.set(p,h)},"setMin"),f=[{fileIRI:s,depth:0}];for(;f.length>0;){let p=f.shift();if(!p)break;let{fileIRI:h,depth:_}=p;if(_>=Pc||i.has(h.value))continue;i.add(h.value);let y=await this.tripleStore.match(h,re.Namespace.EXO.term("Class_superClass"),void 0);for(let S of y){let w=S.object;if(!(w instanceof nr.IRI))continue;let T=_+1,O=w.value.startsWith("obsidian://vault/"),A=this.iriToObsidianName(w.value);A&&u(A,T);let x=null;if(O?x=w:A&&(x=await this.resolveClassFileIRI(A)),!x)continue;let P=await this.getLiteralValue(x,re.Namespace.EXO.term("Asset_uid"));P&&u(P,T),i.has(x.value)||f.push({fileIRI:x,depth:T})}}let d=Array.from(n.entries()).map(([p,h])=>({ref:p,depth:h}));return this._ancestorDepthCache.set(e,d),d}async resolveClassFileIRI(e){if(this.looksLikeUUID(e))return this.findSubjectByUID(e);let t=await this.findUidByLabel(e);return t?this.findSubjectByUID(t):null}async findUidByLabel(e){let t=await this.tripleStore.match(void 0,re.Namespace.EXO.term("Asset_label"),void 0);for(let n of t)if(n.object instanceof Mt.Literal&&n.object.value===e&&n.subject instanceof nr.IRI){let i=await this.tripleStore.match(n.subject,re.Namespace.EXO.term("Asset_uid"),void 0);if(i.length>0&&i[0].object instanceof Mt.Literal)return i[0].object.value}return null}async getLinkedUID(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;if(i instanceof nr.IRI){let s=await this.tripleStore.match(i,re.Namespace.EXO.term("Asset_uid"),void 0);return s.length>0&&s[0].object instanceof Mt.Literal?s[0].object.value:i.value.split("/").pop()?.replace(".md","")??null}return i instanceof Mt.Literal?this.normalizeWikilink(i.value):null}async getLinkedUIDs(e,t){let n=await this.tripleStore.match(e,t,void 0),i=[];for(let s of n){let o=s.object;if(o instanceof nr.IRI){let c=await this.tripleStore.match(o,re.Namespace.EXO.term("Asset_uid"),void 0);if(c.length>0&&c[0].object instanceof Mt.Literal)i.push(c[0].object.value);else{let l=o.value.split("/").pop()?.replace(".md","");l&&i.push(l)}}else if(o instanceof Mt.Literal){let c=this.normalizeWikilink(o.value);c&&i.push(c)}}return i}async getLinkedValue(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;return i instanceof Mt.Literal?this.normalizeWikilink(i.value):i instanceof nr.IRI?this.iriToObsidianName(i.value)??i.value:null}async getObsidianName(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;return i instanceof Mt.Literal?this.unwrapWikilink(i.value):i instanceof nr.IRI?this.iriToObsidianName(i.value)??i.value:null}unwrapWikilink(e){if(!e)return e;let t=e.trim().replace(/^"|"$/g,"");if(t.startsWith("http://")||t.startsWith("https://"))return this.iriToObsidianName(t)??t;let n=t.match(/^\[\[([^\]|]+)\|([^\]]+)\]\]$/);if(n)return n[2].trim();let i=t.match(/^\[\[([^\]|]+)\]\]$/);if(i){let s=i[1].trim();return s.startsWith("http://")||s.startsWith("https://")?this.iriToObsidianName(s)??s:s}return t}async getObsidianWikilinkValue(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;if(i instanceof Mt.Literal)return this.resolveWikilinkAlias(i.value);if(i instanceof nr.IRI){let s=this.iriToObsidianName(i.value);return s?`"[[${s}]]"`:i.value}return null}async resolveWikilinkAlias(e){let t=e.match(/\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\]\]/);if(!t)return e;let n=t[1],i=await this.findSubjectByUID(n);if(!i)return e;let s=await this.getLiteralValue(i,re.Namespace.EXO.term("Asset_label"));return s?e.replace(`[[${n}]]`,`[[${n}|${s}]]`):e}iriToObsidianName(e){return(0,Tq.iriToObsidianName)(e)}normalizeWikilink(e){let t=e.replace(/["'[\]]/g,"").trim(),n=t.indexOf("|");return n>=0?t.substring(0,n):t}};wo.CommandResolver=Y1;wo.CommandResolver=Y1=bq([(0,wq.injectable)(),Sq("design:paramtypes",[Object,Object])],Y1)});var X1=E(Q1=>{"use strict";Object.defineProperty(Q1,"__esModule",{value:!0});Q1.validateExoQLAllowlist=Fq;var Ig=md();function Fq(r){if(!r||typeof r!="object")return;let e=r;if(e.type==="update"){let t=r.updates??[];for(let n of t)if(n?.type==="load")throw new Ig.ExoQLForbiddenKeywordError("LOAD");throw new Ig.ExoQLForbiddenKeywordError("UPDATE")}if(e.type==="query"){if(e.from){let t=Array.isArray(e.from.default)&&e.from.default.length>0,n=Array.isArray(e.from.named)&&e.from.named.length>0;if(t||n)throw new Ig.ExoQLForbiddenKeywordError("FROM")}if(Array.isArray(e.where))for(let t of e.where)xg(t);if(Array.isArray(e.template))for(let t of e.template)xg(t)}}a(Fq,"validateExoQLAllowlist");function xg(r){if(!r||typeof r!="object")return;if(r.type==="service")throw new Ig.ExoQLForbiddenKeywordError("SERVICE");if(Array.isArray(r.patterns))for(let t of r.patterns)xg(t);let e=r.where;if(Array.isArray(e))for(let t of e)xg(t)}a(xg,"walkPatternForBannedKeywords")});var J1=E(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.DEFAULT_EVAL_CONFIG=void 0;Rg.DEFAULT_EVAL_CONFIG=Object.freeze({enabled:!0,maxNestedEvalCount:100,maxAggregateEvalMillis:1e4})});var Cg=E(Z1=>{"use strict";Object.defineProperty(Z1,"__esModule",{value:!0});Z1.evaluateWithExoEval=Uq;var Lq=Ml(),Nq=$l(),kq=ou(),Mq=X1(),jq=J1(),$q=md();async function Uq(r,e={}){if(typeof r!="string")throw new TypeError("evaluateWithExoEval: sparql must be a string");let n=new Lq.ExoQLParser().parse(r);if((0,Mq.validateExoQLAllowlist)(n),!{...jq.DEFAULT_EVAL_CONFIG,...e.config??{}}.enabled)throw new $q.ExoQLEvalDisabledError;let s="queryType"in n&&typeof n.queryType=="string"?n.queryType:"SELECT";if(!e.store)return s==="ASK"?{kind:"ask",result:!1}:s==="CONSTRUCT"?{kind:"construct",triples:[]}:{kind:"select",rows:[]};let c=new Nq.ExoQLAlgebraTranslator().translate(n),l=new kq.ExoQLQueryExecutor(e.store);return l.isAskQuery(c)?{kind:"ask",result:await l.executeAsk(c)}:l.isConstructQuery(c)?{kind:"construct",triples:await l.executeConstruct(c)}:{kind:"select",rows:await l.executeAll(c)}}a(Uq,"evaluateWithExoEval")});var on=E(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.DateFormatter=void 0;var eE=class r{static{a(this,"DateFormatter")}static toISOTimestamp(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}static toLocalTimestamp(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),c=String(e.getSeconds()).padStart(2,"0");return`${t}-${n}-${i}T${s}:${o}:${c}`}static toDateWikilink(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`"[[${t}-${n}-${i}]]"`}static getTodayWikilink(){return r.toDateWikilink(new Date)}static toDateString(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${i}`}static parseWikilink(e){let n=e.replace(/^["']|["']$/g,"").match(/\[\[(\d{4}-\d{2}-\d{2})\]\]/);return n?n[1]:null}static addDays(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}static isSameDay(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}static getTodayStartTimestamp(){let e=new Date;return e.setHours(0,0,0,0),r.toLocalTimestamp(e)}static toTimestampAtStartOfDay(e){let t=e.split("-").map(Number);if(t.length!==3||t.some(isNaN))throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD`);let[n,i,s]=t,o=new Date(n,i-1,s,0,0,0,0);if(isNaN(o.getTime()))throw new Error(`Invalid date values: ${e}`);return r.toLocalTimestamp(o)}static normalizeTimestamp(e){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e;let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`Invalid timestamp format: ${e}`);return r.toISOTimestamp(t)}static isISOTimestamp(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e)}};Og.DateFormatter=eE});var yd=E(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.liveClock=Bq;Pg.frozenClock=Vq;function Bq(){return{now:a(()=>new Date,"now")}}a(Bq,"liveClock");function Vq(r){let e=new Date(r);return{now:a(()=>new Date(e.getTime()),"now")}}a(Vq,"frozenClock")});var VP=E(Eo=>{"use strict";var qq=Eo&&Eo.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Gq=Eo&&Eo.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},bd;Object.defineProperty(Eo,"__esModule",{value:!0});Eo.PreconditionEvaluator=void 0;var Wq=Ze(),Hq=Ml(),zq=$l(),BP=ou(),Kq=Cg(),_d=on(),Yq=yd(),Sd=bd=class{static{a(this,"PreconditionEvaluator")}constructor(e,t,n){this.hostFunctions=new Map,this.askCache=new Map,this.tripleStore=e,this.queryBodyResolver=t,this.clock=n?.clock??(0,Yq.liveClock)()}async evaluate(e,t,n){if(!e)return!0;let i=new Map;return await this.evaluateNode(e,t,n,i)==="yes"}async evaluateNode(e,t,n,i){if(e.broken)return"unknown";if(e.composite){let{op:s,children:o}=e.composite;if(o.length===0)return"unknown";let c=await Promise.all(o.map(l=>this.evaluateNode(l,t,n,i)));return s==="all"?c.includes("no")?"no":c.includes("unknown")?"unknown":"yes":c.includes("yes")?"yes":c.includes("unknown")?"unknown":"no"}if(e.not){let s=await this.evaluateNode(e.not,t,n,i);return s==="unknown"?"unknown":s==="yes"?"no":"yes"}return e.sparqlAsk?await this.evaluateSparqlAskMemoized(e.sparqlAsk,t,i)?"yes":"no":e.query?await this.evaluateQueryRef(e.query,t)?"yes":"no":e.hostFunction?this.evaluateHostFunction(e.hostFunction,t,n)?"yes":"no":"yes"}evaluateSparqlAskMemoized(e,t,n){let i=n.get(e);if(i!==void 0)return i;let s=this.evaluateSparqlAsk(e,t);return n.set(e,s),s}async evaluateQueryRef(e,t){if(!this.queryBodyResolver)return!1;try{let n=await this.queryBodyResolver.resolveSparql(e);if(!n)return!1;let i=this.substituteVariables(n,t),s=await(0,Kq.evaluateWithExoEval)(i,{store:this.tripleStore});return s.kind!=="ask"?!1:s.result}catch{return!1}}registerHostFunction(e,t){this.hostFunctions.set(e,t)}hasHostFunction(e){return this.hostFunctions.has(e)}evaluateHostFunctionSync(e,t,n){return this.hostFunctions.has(e)?this.evaluateHostFunction(e,t,n):null}invalidateCache(){this.askCache.clear()}compileAsk(e){let t=this.substituteVariables(e,bd.SENTINEL_IRI),i=new Hq.ExoQLParser().parse(t),o=new zq.ExoQLAlgebraTranslator().translate(i);return new BP.ExoQLQueryExecutor(this.tripleStore).isAskQuery(o)?o:null}evaluateHostFunction(e,t,n){let i=this.hostFunctions.get(e);if(!i)return!0;let s=n?{...n,targetIRI:t}:{targetIRI:t};try{return i(s)}catch{return!1}}async evaluateSparqlAsk(e,t){try{let n=bd.TEMPORAL_TOKEN.test(e),i=n?_d.DateFormatter.toDateString(this.clock.now()):null,s=this.askCache.get(e);if(s===void 0||n&&s.day!==i){let l=this.compileAsk(e);if(!l)return!1;s={day:i,compiled:l},this.askCache.set(e,s)}let o=JSON.parse(JSON.stringify(s.compiled).replaceAll(bd.SENTINEL_IRI,t));return await new BP.ExoQLQueryExecutor(this.tripleStore).executeAsk(o)}catch{return!1}}substituteVariables(e,t){let n=this.clock.now(),i=n.toISOString(),s=n.getFullYear(),o=n.getMonth(),c=n.getDate(),l=n.getDay(),u=_d.DateFormatter.toDateString(n),f=_d.DateFormatter.toDateString(new Date(s,o,c-1)),d=(l+6)%7,p=_d.DateFormatter.toDateString(new Date(s,o,c-d)),h=_d.DateFormatter.toDateString(new Date(s,o,c-d-7)),_=`${s}-${String(o+1).padStart(2,"0")}-01`,y=o===0?11:o-1,w=`${o===0?s-1:s}-${String(y+1).padStart(2,"0")}-01`,T=`${s}-01-01`;return e.replace(/\$target\b/g,`<${t}>`).replace(/\$now\b/g,`"${i}"^^xsd:dateTime`).replace(/\$yesterday\b/g,`"${f}"^^xsd:date`).replace(/\$thisWeekStart\b/g,`"${p}"^^xsd:date`).replace(/\$lastWeekStart\b/g,`"${h}"^^xsd:date`).replace(/\$thisMonthStart\b/g,`"${_}"^^xsd:date`).replace(/\$lastMonthStart\b/g,`"${w}"^^xsd:date`).replace(/\$thisYearStart\b/g,`"${T}"^^xsd:date`).replace(/\$today\b/g,`"${u}"^^xsd:date`)}};Eo.PreconditionEvaluator=Sd;Sd.SENTINEL_IRI="urn:exocortex:cache-sentinel:target";Sd.TEMPORAL_TOKEN=/\$(?:now|today|yesterday|thisWeekStart|lastWeekStart|thisMonthStart|lastMonthStart|thisYearStart)\b/;Eo.PreconditionEvaluator=Sd=bd=qq([(0,Wq.injectable)(),Gq("design:paramtypes",[Object,Object,Object])],Sd)});var qP=E(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.hasUidFilename=vo.hasNonUidFilename=void 0;vo.registerDefaultHostFunctions=Jq;var Qq=a(r=>{let e=r.assetUid;if(typeof e!="string"||e.trim()==="")return!1;let t=r.fileBasename;return typeof t!="string"?!1:t!==e},"hasNonUidFilename");vo.hasNonUidFilename=Qq;var Xq=a(r=>{let e=r.assetUid;if(typeof e!="string"||e.trim()==="")return!1;let t=r.fileBasename;return typeof t!="string"?!1:t===e},"hasUidFilename");vo.hasUidFilename=Xq;function Jq(r){r.registerHostFunction("hasNonUidFilename",vo.hasNonUidFilename),r.registerHostFunction("hasUidFilename",vo.hasUidFilename)}a(Jq,"registerDefaultHostFunctions")});var Fg=E(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.liveUidGenerator=Zq;Dg.seededUidGenerator=tG;var tE=Di();function Zq(){return{next:a(()=>(0,tE.v4)(),"next")}}a(Zq,"liveUidGenerator");var eG="6ba7b810-9dad-11d1-80b4-00c04fd430c8";function tG(r){let e=0,t=(0,tE.v5)(r,eG);return{next:a(()=>{let n=`${r}#${e}`;return e+=1,(0,tE.v5)(n,t)},"next")}}a(tG,"seededUidGenerator")});var kg=E(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.registerResolver=fr;Aa.getResolver=nG;Aa.isResolverModifierAware=iG;Aa.getRegisteredResolverIds=sG;Aa.clearResolvers=oG;Aa.installDefaultResolvers=gG;var rG=on(),Ng=new Map,rE=new Set;function fr(r,e,t=!1){Ng.set(r,e),t&&rE.add(r)}a(fr,"registerResolver");function nG(r){return Ng.get(r)}a(nG,"getResolver");function iG(r){return rE.has(r)}a(iG,"isResolverModifierAware");function sG(){return Array.from(Ng.keys())}a(sG,"getRegisteredResolverIds");function oG(){Ng.clear(),rE.clear()}a(oG,"clearResolvers");function Xr(r){return r<10?`0${r}`:String(r)}a(Xr,"pad2");var aG=["January","February","March","April","May","June","July","August","September","October","November","December"],cG=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lG=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],uG=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function fG(r){let e=["th","st","nd","rd"],t=r%100;return`${r}${e[(t-20)%10]||e[t]||e[0]}`}a(fG,"ordinalDay");var dG=/YYYY|YY|MMMM|MMM|MM|M|Do|DD|D|dddd|ddd|HH|H|hh|h|mm|m|ss|s|A|a/g;function pG(r,e){let t=(r.getHours()+11)%12+1;return e.replace(dG,n=>{switch(n){case"YYYY":return String(r.getFullYear());case"YY":return Xr(r.getFullYear()%100);case"MMMM":return aG[r.getMonth()];case"MMM":return cG[r.getMonth()];case"MM":return Xr(r.getMonth()+1);case"M":return String(r.getMonth()+1);case"Do":return fG(r.getDate());case"DD":return Xr(r.getDate());case"D":return String(r.getDate());case"dddd":return lG[r.getDay()];case"ddd":return uG[r.getDay()];case"HH":return Xr(r.getHours());case"H":return String(r.getHours());case"hh":return Xr(t);case"h":return String(t);case"mm":return Xr(r.getMinutes());case"m":return String(r.getMinutes());case"ss":return Xr(r.getSeconds());case"s":return String(r.getSeconds());case"A":return r.getHours()<12?"AM":"PM";case"a":return r.getHours()<12?"am":"pm";default:return n}})}a(pG,"formatDate");function GP(r,e,t){let n=r.getDate(),i=new Date(r.getTime());i.setDate(1),t==="M"?i.setMonth(i.getMonth()+e):i.setFullYear(i.getFullYear()+e);let s=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();return i.setDate(Math.min(n,s)),i}a(GP,"addMonthsClamped");function hG(r,e){if(!e)return r;let t=e.match(/^([+-])(\d+)([dwMy])?$/);if(!t)return r;let n=(t[1]==="-"?-1:1)*parseInt(t[2],10),i=t[3]??"d",s=new Date(r.getTime());switch(i){case"d":s.setDate(s.getDate()+n);break;case"w":s.setDate(s.getDate()+n*7);break;case"M":s=GP(s,n,"M");break;case"y":s=GP(s,n,"y");break}return isNaN(s.getTime())?r:s}a(hG,"applyDateOffset");function mG(r){if(!r)return{offset:null,format:null};let e=r.indexOf(":");if(e<0)return{offset:r,format:null};let t=r.slice(0,e),n=r.slice(e+1);return{offset:t||null,format:n||null}}a(mG,"parseDateModifier");function Lg(r,e){return(t,n)=>{let{offset:i,format:s}=mG(n),o=new Date;return r!==0&&o.setDate(o.getDate()+r),o=hG(o,i),pG(o,s??e)}}a(Lg,"makeDateResolver");function gG(){fr("today",()=>{let r=new Date;return`${r.getFullYear()}-${Xr(r.getMonth()+1)}-${Xr(r.getDate())}`}),fr("todayStart",()=>rG.DateFormatter.getTodayStartTimestamp()),fr("date",Lg(0,"YYYY-MM-DD"),!0),fr("now",Lg(0,"YYYY-MM-DDTHH:mm:ss"),!0),fr("tomorrow",Lg(1,"YYYY-MM-DD"),!0),fr("yesterday",Lg(-1,"YYYY-MM-DD"),!0),fr("target",r=>r.targetIRI?`"[[${r.targetIRI}]]"`:""),fr("targetFolder",r=>{if(!r.targetFilePath)return"";let e=r.targetFilePath.replace(/^\/+/,""),t=e.lastIndexOf("/");return t>=0?e.slice(0,t):""}),fr("randomUUIDv4",()=>{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();throw new Error("randomUUIDv4 resolver requires crypto.randomUUID() \u2014 runtime is missing Node crypto / Web Crypto API.")}),fr("nowTimestamp",()=>{let r=new Date;return`${r.getFullYear()}-${Xr(r.getMonth()+1)}-${Xr(r.getDate())}T${Xr(r.getHours())}:${Xr(r.getMinutes())}:${Xr(r.getSeconds())}`}),fr("nowDate",()=>{let r=new Date;return`${r.getFullYear()}-${Xr(r.getMonth()+1)}-${Xr(r.getDate())}`}),fr("nowYear",()=>String(new Date().getFullYear())),fr("nowMonth",()=>Xr(new Date().getMonth()+1)),fr("userInputLabel",r=>{let e=r.userInput?.label;return typeof e=="string"?e:""}),fr("userInput",(r,e)=>{if(!e)return null;let t=r.userInput?.[e];return typeof t=="string"?t:t==null?null:String(t)}),fr("targetProperty",(r,e)=>{if(!e||!r.targetFm)return null;let t=r.targetFm[e];return t==null?null:Array.isArray(t)?t.map(String):String(t)}),fr("labelAsArray",r=>{let e=r.userInput?.label;return typeof e=="string"&&e.length>0?[e]:[]}),fr("groundingTargetClass",r=>r.groundingTargetClassUid?`"[[${r.groundingTargetClassUid}]]"`:null),fr("targetClassSelf",r=>{if(!r.targetFilePath)return null;let e=r.targetFilePath.replace(/^\/+/,""),n=e.slice(e.lastIndexOf("/")+1).replace(/\.md$/i,"");return n.length>0?`"[[${n}]]"`:null})}a(gG,"installDefaultResolvers")});var iE=E(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.resolveTemplateBody=_G;Mg.stripTemplateFrontmatter=bG;var nE=kg();(0,nE.installDefaultResolvers)();var yG=/\$([A-Za-z][A-Za-z0-9_]*)((?:[+-]\d+[dwMy])?(?::[A-Za-z0-9:./-]+)?)/g;function _G(r,e={}){return r.replace(yG,(t,n,i)=>{let s=(0,nE.getResolver)(n);if(s===void 0)return t;let o=s(e,i.length>0?i:void 0);return typeof o!="string"||o.length===0?t:(0,nE.isResolverModifierAware)(n)?o:o+i})}a(_G,"resolveTemplateBody");function bG(r){let e=r.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return e?r.slice(e[0].length):r}a(bG,"stripTemplateFrontmatter")});var wd=E(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.registerOrderSpecLoader=SG;cu.clearOrderSpecLoader=wG;cu.loadDefaultSpec=EG;cu.orderProperties=vG;var jg=null,Ia,$g=!1;function SG(r){jg=r,Ia=void 0,$g=!1}a(SG,"registerOrderSpecLoader");function wG(){jg=null,Ia=void 0,$g=!1}a(wG,"clearOrderSpecLoader");function EG(){if(Ia!==void 0)return Ia;if(!jg)return Ia=null,null;try{Ia=jg()}catch(r){$g||(console.warn("[OrderSpecResolver] loader threw, falling back to insertion order:",r),$g=!0),Ia=null}return Ia}a(EG,"loadDefaultSpec");function vG(r,e){if(!e||e.head.length===0&&e.tail.length===0)return r;let t=Object.keys(r),n=new Set(e.head),i=new Set(e.tail),s=e.head.filter(u=>Object.prototype.hasOwnProperty.call(r,u)),o=e.tail.filter(u=>Object.prototype.hasOwnProperty.call(r,u)),c=t.filter(u=>!n.has(u)&&!i.has(u));e.middleStrategy==="alphabetical"&&c.sort((u,f)=>u.localeCompare(f));let l={};for(let u of s)l[u]=r[u];for(let u of c)l[u]=r[u];for(let u of o)l[u]=r[u];return l}a(vG,"orderProperties")});var Ed=E(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.STRING_SCALAR_PROPERTIES=void 0;Dc.needsYamlQuoting=WP;Dc.quoteYamlString=HP;Dc.serializeYamlScalar=FG;var TG=/^[-!&*?|>%@`"'#,[\]{}]/,AG=/[\u0000-\u001f\u007f]/,IG=/^(?:true|True|TRUE|false|False|FALSE)$/,xG=/^(?:null|Null|NULL|~)$/,RG=/^[-+]?(?:0b[01_]+|0o[0-7_]+|0x[0-9a-fA-F_]+|[0-9][0-9_]*)$/,CG=/^(?:[-+]?[0-9][0-9_]*(?:\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,OG=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;Dc.STRING_SCALAR_PROPERTIES=new Set(["exo__Asset_label","aliases"]);function PG(r){if(r.length<2||!r.startsWith('"')||!r.endsWith('"'))return!1;let e=r.slice(1,-1);for(let t=0;t<e.length;t++){if(e[t]==="\\"){if(t+1>=e.length)return!1;t++;continue}if(e[t]==='"')return!1}return!0}a(PG,"isCompleteDoubleQuotedScalar");function DG(r){return IG.test(r)||xG.test(r)||RG.test(r)||CG.test(r)||OG.test(r)}a(DG,"looksLikeNonStringScalar");function WP(r,e=!1){return r===""?!0:PG(r)?!1:!!(r!==r.trim()||/:(\s|$)/.test(r)||/\s#/.test(r)||TG.test(r)||AG.test(r)||e&&DG(r))}a(WP,"needsYamlQuoting");function HP(r){let e="";for(let t=0;t<r.length;t++){let n=r[t],i=r.charCodeAt(t);n==="\\"?e+="\\\\":n==='"'?e+='\\"':n===`
|
|
70
|
+
${n}}`}generateValuesTerm(e){if(e.type==="iri")return`<${e.value}>`;let n=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;return e.language?n+=`@${e.language}`:e.datatype&&(n+=`^^<${e.datatype}>`),n}generateExpression(e){switch(e.type){case"variable":return`?${e.name}`;case"literal":return typeof e.value=="string"?`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:typeof e.value=="boolean"?e.value?"true":"false":String(e.value);case"comparison":return`(${this.generateExpression(e.left)} ${e.operator} ${this.generateExpression(e.right)})`;case"logical":return e.operator==="!"?`!(${this.generateExpression(e.operands[0])})`:`(${e.operands.map(t=>this.generateExpression(t)).join(` ${e.operator} `)})`;case"arithmetic":return`(${this.generateExpression(e.left)} ${e.operator} ${this.generateExpression(e.right)})`;case"function":return`${e.function.toUpperCase()}(${e.args.map(t=>this.generateExpression(t)).join(", ")})`;case"functionCall":return`${(typeof e.function=="string"?e.function:e.function.value).toUpperCase()}(${e.args.map(n=>this.generateExpression(n)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.generateWhereClause(e.pattern,0)} }`;case"in":{let t=this.generateExpression(e.expression),n=e.list.map(i=>this.generateExpression(i)).join(", ");return e.negated?`${t} NOT IN (${n})`:`${t} IN (${n})`}default:throw new nu(`Unknown expression type: ${e.type}`)}}collectVariablesFromOperation(e,t){switch(e.type){case"bgp":for(let n of e.triples)this.collectVariablesFromTriple(n,t);break;case"filter":this.collectVariablesFromOperation(e.input,t),this.collectVariablesFromExpression(e.expression,t);break;case"join":case"leftjoin":case"union":case"minus":this.collectVariablesFromOperation(e.left,t),this.collectVariablesFromOperation(e.right,t);break;case"values":for(let n of e.variables)t.add(n);break;case"project":for(let n of e.variables)t.add(n);this.collectVariablesFromOperation(e.input,t);break;case"extend":t.add(e.variable),this.collectVariablesFromOperation(e.input,t);break;case"orderby":case"slice":case"distinct":case"reduced":this.collectVariablesFromOperation(e.input,t);break;case"group":for(let n of e.variables)t.add(n);for(let n of e.aggregates)t.add(n.variable);this.collectVariablesFromOperation(e.input,t);break;case"subquery":this.collectVariablesFromOperation(e.query,t);break}}collectVariablesFromTriple(e,t){e.subject.type==="variable"&&t.add(e.subject.value),"type"in e.predicate&&e.predicate.type==="variable"&&t.add(e.predicate.value),e.object.type==="variable"&&t.add(e.object.value)}collectVariablesFromExpression(e,t){switch(e.type){case"variable":t.add(e.name);break;case"comparison":case"arithmetic":this.collectVariablesFromExpression(e.left,t),this.collectVariablesFromExpression(e.right,t);break;case"logical":for(let n of e.operands)this.collectVariablesFromExpression(n,t);break;case"function":case"functionCall":for(let n of e.args)this.collectVariablesFromExpression(n,t);break;case"exists":this.collectVariablesFromOperation(e.pattern,t);break;case"in":this.collectVariablesFromExpression(e.expression,t);for(let n of e.list)this.collectVariablesFromExpression(n,t);break}}};iu.SPARQLGenerator=K1});var ou=E(Gn=>{"use strict";var rq=Gn&&Gn.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),nq=Gn&&Gn.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),DP=Gn&&Gn.__importStar||(function(){var r=a(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&rq(t,e,n[i]);return nq(t,e),t}})();Object.defineProperty(Gn,"__esModule",{value:!0});Gn.QueryExecutor=Gn.ExoQLQueryExecutor=Gn.QueryExecutorError=void 0;var iq=h1(),sq=hg(),oq=F1(),aq=N1(),cq=SP(),lq=EP(),uq=IP(),fq=W1(),dq=RP(),pq=OP(),hq=PP(),mq=Ke(),gq=tt(),yq=ag(),Qr="http://www.w3.org/2001/XMLSchema#",_q=new Set([`${Qr}integer`,`${Qr}decimal`,`${Qr}float`,`${Qr}double`,`${Qr}nonPositiveInteger`,`${Qr}negativeInteger`,`${Qr}long`,`${Qr}int`,`${Qr}short`,`${Qr}byte`,`${Qr}nonNegativeInteger`,`${Qr}unsignedLong`,`${Qr}unsignedInt`,`${Qr}unsignedShort`,`${Qr}unsignedByte`,`${Qr}positiveInteger`]),su=class extends Error{static{a(this,"QueryExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="QueryExecutorError"}};Gn.QueryExecutorError=su;var vg=class{static{a(this,"ExoQLQueryExecutor")}constructor(e,t={}){this.tripleStore=e,this.bgpExecutor=new iq.BGPExecutor(e),this.filterExecutor=new sq.FilterExecutor,this.optionalExecutor=new oq.OptionalExecutor,this.unionExecutor=new aq.UnionExecutor,this.minusExecutor=new cq.MinusExecutor,this.valuesExecutor=new lq.ValuesExecutor,this.aggregateExecutor=new uq.AggregateExecutor,this.constructExecutor=new fq.ConstructExecutor,this.serviceExecutor=new dq.ServiceExecutor(t.serviceConfig),this.graphExecutor=new pq.GraphExecutor(e),this.sparqlGenerator=new hq.SPARQLGenerator,this.filterExecutor.setExistsEvaluator(async(n,i)=>this.evaluateExistsPattern(n,i)),this.filterExecutor.setTripleStore(e)}async evaluateExistsPattern(e,t){for await(let n of this.execute(e))if(t.merge(n)!==null)return!0;return!1}async executeAll(e){let t=[];for await(let n of this.execute(e))t.push(n);return t}async*execute(e){switch(e.type){case"bgp":yield*this.executeBGP(e);break;case"filter":yield*this.executeFilter(e);break;case"join":yield*this.executeJoin(e);break;case"leftjoin":yield*this.executeLeftJoin(e);break;case"union":yield*this.executeUnion(e);break;case"minus":yield*this.executeMinus(e);break;case"values":yield*this.executeValues(e);break;case"project":yield*this.executeProject(e);break;case"orderby":yield*this.executeOrderBy(e);break;case"slice":yield*this.executeSlice(e);break;case"distinct":yield*this.executeDistinct(e);break;case"reduced":yield*this.executeReduced(e);break;case"group":yield*this.executeGroup(e);break;case"extend":yield*this.executeExtend(e);break;case"subquery":yield*this.executeSubquery(e);break;case"lateraljoin":yield*this.executeLateralJoin(e);break;case"service":yield*this.executeService(e);break;case"graph":yield*this.executeGraph(e);break;default:throw new su(`Unknown operation type: ${e.type}`)}}async*executeBGP(e){yield*this.bgpExecutor.execute(e)}async*executeFilter(e){let t=this.execute(e.input);yield*this.filterExecutor.execute(e,t)}async*executeJoin(e){let t=[];for await(let o of this.execute(e.left))t.push(o);if(t.length===0)return;let n=new Set;for(let o of t)for(let c of o.variables())n.add(c);let i=this.collectOperationVariables(e.right);if([...n].some(o=>i.has(o)))for(let o of t){let c=this.substituteVariables(e.right,o);for await(let l of this.execute(c)){let u=o.merge(l);u!==null&&(yield u)}}else{let o=[];for await(let c of this.execute(e.right))o.push(c);for(let c of t)for(let l of o){let u=c.merge(l);u!==null&&(yield u)}}}async*executeLeftJoin(e){let t=[];for await(let o of this.execute(e.left))t.push(o);let n=[];for await(let o of this.execute(e.right))n.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of n)yield o}a(s,"rightGen"),yield*this.optionalExecutor.execute(i(),s())}async*executeUnion(e){let t=[];for await(let o of this.execute(e.left))t.push(o);let n=[];for await(let o of this.execute(e.right))n.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of n)yield o}a(s,"rightGen"),yield*this.unionExecutor.execute(i(),s())}async*executeMinus(e){let t=[];for await(let o of this.execute(e.left))t.push(o);let n=[];for await(let o of this.execute(e.right))n.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of n)yield o}a(s,"rightGen"),yield*this.minusExecutor.execute(i(),s())}async*executeValues(e){yield*this.valuesExecutor.execute(e)}async*executeProject(e){let{SolutionMapping:t}=await Promise.resolve().then(()=>DP(So())),n=new Set(e.variables);for await(let i of this.execute(e.input)){let s=new t;for(let o of i.variables())if(n.has(o)){let c=i.get(o);c!==void 0&&s.set(o,c)}yield s}}async*executeOrderBy(e){let t=[];for await(let n of this.execute(e.input))t.push(n);t.sort((n,i)=>{for(let s of e.comparators){let o=this.getExpressionValue(s.expression,n),c=this.getExpressionValue(s.expression,i),l=0;if(o===void 0&&c===void 0?l=0:o===void 0?l=1:c===void 0?l=-1:typeof o=="number"&&typeof c=="number"?l=o-c:l=String(o).localeCompare(String(c)),s.descending&&(l=-l),l!==0)return l}return 0});for(let n of t)yield n}async*executeSlice(e){let t=0,n=e.offset??0,i=e.limit;for await(let s of this.execute(e.input)){if(t>=n){if(i!==void 0&&t-n>=i)break;yield s}t++}}async*executeDistinct(e){let t=new Set;for await(let n of this.execute(e.input)){let i=this.getSolutionKey(n);t.has(i)||(t.add(i),yield n)}}async*executeReduced(e){let t=new Set;for await(let n of this.execute(e.input)){let i=this.getSolutionKey(n);t.has(i)||(t.add(i),yield n)}}async*executeGroup(e){let t=[];for await(let i of this.execute(e.input))t.push(i);let n=this.aggregateExecutor.execute(e,t);if(e.having&&e.having.length>0)for(let i of n)e.having.every(o=>this.filterExecutor.evaluateExpression(o,i)===!0)&&(yield i);else for(let i of n)yield i}async*executeExtend(e){let t=e.expression.type!=="aggregate"&&this.filterExecutor.expressionContainsExists(e.expression);for await(let n of this.execute(e.input)){let i=n.clone(),s=t?await this.evaluateExtendExpressionAsync(e.expression,n):this.evaluateExtendExpression(e.expression,n);s!==void 0&&i.set(e.variable,s),yield i}}async*executeSubquery(e){yield*this.execute(e.query)}async*executeLateralJoin(e){let t=[];for await(let n of this.execute(e.left))t.push(n);for(let n of t){let i=this.substituteVariables(e.right,n);for await(let s of this.execute(i)){let o=n.merge(s);o!==null&&(yield o)}}}substituteVariables(e,t){let n=JSON.parse(JSON.stringify(e));return this.substituteInOperation(n,t)}substituteInOperation(e,t){if(!e||typeof e!="object")return e;let n=e;return e.type==="bgp"&&e.triples?(e.triples=e.triples.map(i=>this.substituteInTriple(i,t)),e):(n.input&&(n.input=this.substituteInOperation(n.input,t)),n.left&&(n.left=this.substituteInOperation(n.left,t)),n.right&&(n.right=this.substituteInOperation(n.right,t)),n.pattern&&(n.pattern=this.substituteInOperation(n.pattern,t)),n.query&&(n.query=this.substituteInOperation(n.query,t)),n.where&&(n.where=this.substituteInOperation(n.where,t)),n.expression&&this.substituteInExpression(n.expression,t),e)}substituteInExpression(e,t){if(!(!e||typeof e!="object")){if(e.type==="exists"&&e.pattern&&(e.pattern=this.substituteInOperation(e.pattern,t)),e.left&&this.substituteInExpression(e.left,t),e.right&&this.substituteInExpression(e.right,t),e.operands)for(let n of e.operands)this.substituteInExpression(n,t);if(e.args)for(let n of e.args)this.substituteInExpression(n,t);if(e.expression&&this.substituteInExpression(e.expression,t),e.list)for(let n of e.list)this.substituteInExpression(n,t)}}substituteInTriple(e,t){return{subject:this.substituteInTripleElement(e.subject,t),predicate:e.predicate,object:this.substituteInTripleElement(e.object,t)}}substituteInTripleElement(e,t){if(e&&e.type==="variable"){let n=t.get(e.value);if(n!=null){let i=n;if(n instanceof mq.IRI||i.termType==="NamedNode")return{type:"iri",value:n.value};if(i.termType==="Literal"||typeof i.value=="string")return{type:"literal",value:i.value,datatype:i.datatype?.value??i._datatype?.value,language:i.language??i._language}}}return e}async*executeService(e){yield*this.serviceExecutor.execute(e,t=>this.sparqlGenerator.generateSelect(t))}async*executeGraph(e){let t=async function*(n,i){let s=this.currentGraphContext;this.currentGraphContext=i;try{n.type==="bgp"&&i&&this.tripleStore.matchInGraph?yield*this.executeBGPInGraph(n,i):yield*this.execute(n)}finally{this.currentGraphContext=s}}.bind(this);yield*this.graphExecutor.execute(e,t)}async*executeBGPInGraph(e,t){if(e.triples.length===0){let{SolutionMapping:n}=await Promise.resolve().then(()=>DP(So()));yield new n;return}yield*this.bgpExecutor.executeInGraph(e,t)}evaluateExtendExpression(e,t){if(e.type!=="aggregate")try{return this.filterExecutor.evaluateExpression(e,t)}catch{return}}async evaluateExtendExpressionAsync(e,t){if(e.type!=="aggregate")try{return await this.filterExecutor.evaluateExpressionAsync(e,t)}catch{return}}getExpressionValue(e,t){if(e.type==="variable"){let n=t.get(e.name);if(!n)return;if(n instanceof gq.Literal){let i=n.datatype?.value;if(i===`${Qr}dayTimeDuration`)try{return yq.DateTimeFunctions.parseDayTimeDuration(n.value)}catch{return n.value}if(i&&_q.has(i)){let s=parseFloat(n.value);if(!Number.isNaN(s))return s}return n.value}return n.value??n.id??String(n)}if(e.type==="literal")return e.value}collectOperationVariables(e){let t=new Set;return this.collectVarsFromOperation(e,t),t}collectVarsFromOperation(e,t){if(!e||typeof e!="object")return;let n=e;if(n.type==="bgp"&&n.triples)for(let i of n.triples)this.collectVarsFromElement(i.subject,t),i.predicate?.type!=="path"&&this.collectVarsFromElement(i.predicate,t),this.collectVarsFromElement(i.object,t);if(n.type==="values"&&n.variables)for(let i of n.variables)t.add(i);n.expression&&this.collectVarsFromExpressionTree(n.expression,t),n.type==="extend"&&n.variable&&t.add(n.variable),n.input&&this.collectVarsFromOperation(n.input,t),n.left&&this.collectVarsFromOperation(n.left,t),n.right&&this.collectVarsFromOperation(n.right,t),n.pattern&&this.collectVarsFromOperation(n.pattern,t),n.query&&this.collectVarsFromOperation(n.query,t),n.where&&this.collectVarsFromOperation(n.where,t)}collectVarsFromElement(e,t){if(!e||typeof e!="object")return;let n=e;n.type==="variable"&&t.add(n.value),n.type==="quoted"&&(this.collectVarsFromElement(n.subject,t),this.collectVarsFromElement(n.predicate,t),this.collectVarsFromElement(n.object,t))}collectVarsFromExpressionTree(e,t){if(!e||typeof e!="object")return;let n=e;if(n.type==="variable"&&n.name&&t.add(n.name),n.type==="exists"&&n.pattern&&this.collectVarsFromOperation(n.pattern,t),n.left&&this.collectVarsFromExpressionTree(n.left,t),n.right&&this.collectVarsFromExpressionTree(n.right,t),n.operands)for(let i of n.operands)this.collectVarsFromExpressionTree(i,t);if(n.args)for(let i of n.args)this.collectVarsFromExpressionTree(i,t);if(n.expression&&this.collectVarsFromExpressionTree(n.expression,t),n.list)for(let i of n.list)this.collectVarsFromExpressionTree(i,t)}getSolutionKey(e){let t=e.toJSON();return Object.keys(t).sort().map(i=>`${i}=${t[i]}`).join("|")}isConstructQuery(e){return e.type==="construct"}async executeConstruct(e){if(e.type!=="construct")throw new su("executeConstruct requires a CONSTRUCT operation");let t=await this.executeAll(e.where);return this.constructExecutor.execute(e.template,t)}isAskQuery(e){return e.type==="ask"}async executeAsk(e){if(e.type!=="ask")throw new su("executeAsk requires an ASK operation");for await(let t of this.execute(e.where))return!0;return!1}};Gn.ExoQLQueryExecutor=vg;Gn.QueryExecutor=vg});var UP=E(wo=>{"use strict";var bq=wo&&wo.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Sq=wo&&wo.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)};Object.defineProperty(wo,"__esModule",{value:!0});wo.CommandResolver=void 0;var wq=Ze(),Eq=Al(),nr=Ke(),Mt=tt(),re=Jt(),FP=da(),LP=Bf(),vq=xl(),Tq=od(),au=cS(),Tg=IO(),Aq=Ml(),Iq=$l(),xq=ou(),Pc=10,Ag="exo__Asset",Rq=Pc+1,NP="08cec529-90eb-4d43-88de-ceecccea12b0",Cq=re.Namespace.EXOCMD.term("SubstitutionToken").value,kP=new Set(["today","tomorrow","todayStart","targetFolder","target","randomUUIDv4","nowTimestamp","nowDate","nowYear","nowMonth","userInputLabel","userInput","targetProperty","labelAsArray","groundingTargetClass","targetClassSelf"]);function Oq(r,e){return`__SUBSTITUTE__${r}__${e}__`}a(Oq,"buildSubstitutionMarker");function Pq(r,e,t){let n=(0,vq.utf8ToBase64)(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return`__SUBSTITUTE_P__${r}__${e}__${n}__`}a(Pq,"buildParameterisedMarker");var MP="3f28af98-c031-4718-8ba2-44ad0b012c52",Dq=re.Namespace.EXOCMD.term("TokenInvocation").value,jP="29e2c8f8-2d27-4e58-b467-2e85d46f8122",$P="universal-default-template",Y1=class{static{a(this,"CommandResolver")}clearUniversalCache(){this._universalCacheReady=!1,this._universalCacheValue=null,(0,Tg.clearUniversalDefault)()}constructor(e,t=Eq.NullLogger){this.tripleStore=e,this.logger=t,this.cache=new Map,this.multiCache=new Map,this._ancestorDepthCache=new Map,this._legacyPropertyDefaultsWarnedGroundings=new Set,this._universalCacheReady=!1,this._universalCacheValue=null}async resolveForAssetMulti(e,t,n){if(t.length===0)return[];let i=[...t].sort().join(","),s=`${e}::${i}::${n??""}`,o=this.multiCache.get(s);if(o)return o;let c=n?await this.expandPrototypeChain(n):void 0,l=await this.expandClassHierarchy(t),u=new Map;for(let[h,_]of l){let y=await this.resolveForAsset(e,h,c);for(let S of y){let w=this.getBindingPriority(S.binding)===2?_:0,T=u.get(S.binding.id);(!T||w<T.depth)&&u.set(S.binding.id,{rc:S,depth:w})}}let f=new Set;for(let{rc:h}of u.values())if(h.binding.overrides)for(let _ of h.binding.overrides)f.add(_);let d=Array.from(u.entries()).filter(([h])=>!f.has(h)).map(([,h])=>h);d.sort((h,_)=>{let y=this.getBindingPriority(h.rc.binding),S=this.getBindingPriority(_.rc.binding);return y!==S?y-S:h.depth!==_.depth?h.depth-_.depth:(h.rc.binding.order??100)-(_.rc.binding.order??100)});let p=d.map(h=>h.rc);return this.multiCache.set(s,p),p}async expandClassHierarchy(e){let t=new Map;for(let c of e){if(c===Ag){t.set(c,new Set);continue}let l=[];try{l=await this.getClassAncestors(c)}catch{l=[]}t.set(c,new Set(l))}let n=a(c=>{for(let l of e)if(l!==c&&t.get(l)?.has(c)&&!t.get(c)?.has(l))return!0;return!1},"isAncestorOfSibling"),i=e.filter(c=>!n(c)),s=new Map,o=a((c,l)=>{let u=s.get(c);(u===void 0||l<u)&&s.set(c,l)},"setMin");for(let c of i){if(o(c,0),this.looksLikeUUID(c))try{let u=await this.resolveLabelByUID(c);u&&o(u,0)}catch{}if(c===Ag)continue;let l=[];try{l=await this.getClassAncestorsWithDepth(c)}catch{l=[]}for(let{ref:u,depth:f}of l)o(u,f)}return s.has(Ag)||s.set(Ag,Rq),s}async resolveForAsset(e,t,n){let i=typeof n=="string"?`s:${n}`:n?`c:${n.join("\0")}`:"",s=`${e}:${t}:${i}`,o=this.cache.get(s);if(o)return o;let c=typeof n=="string"?await this.expandPrototypeChain(n):n,l=await this.findBindings(t,c,e),u=[];for(let f of l){let d=await this.loadCommand(f.commandRef,{targetClass:f.targetClass});if(!d)continue;let p=f.precondition?{...d,precondition:f.precondition}:d;u.push({command:p,binding:f})}return u.sort((f,d)=>{let p=this.getBindingPriority(f.binding),h=this.getBindingPriority(d.binding);return p!==h?p-h:(f.binding.order??100)-(d.binding.order??100)}),this.cache.set(s,u),u}async loadCommand(e,t){let n=await this.findSubjectByUID(e);if(!n||(await this.tripleStore.match(n,re.Namespace.RDF.term("type"),re.Namespace.EXOCMD.term("Command"))).length===0)return null;let s=await this.getLiteralValue(n,re.Namespace.EXO.term("Asset_label"))??"Unknown Command",o=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_labelTemplate")),c=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_icon")),l=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_confirmMessage")),u=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_successMessage")),f=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_category")),d=await this.getLiteralValue(n,re.Namespace.EXOCMD.term("Command_openInSameTab")),p=d!==null&&String(d).trim().toLowerCase()==="true",h=await this.loadLinkedPrecondition(n),_=await this.loadLinkedGrounding(n,0,t);return _?{id:e,name:s,labelTemplate:o??void 0,icon:c??void 0,precondition:h??void 0,grounding:_,confirmMessage:l??void 0,successMessage:u??void 0,category:f??void 0,openInSameTab:p||void 0}:null}async findBindings(e,t,n){let i=typeof t=="string"?await this.expandPrototypeChain(t):t,s=await this.tripleStore.match(void 0,re.Namespace.RDF.term("type"),re.Namespace.EXOCMD.term("CommandBinding")),o=[];for(let c of s){let l=c.subject,u=await this.loadBindingDefinition(l);u&&this.bindingMatches(u,e,i,n)&&o.push(u)}return o}async findPaletteEnabledCommands(){let e=await this.tripleStore.match(void 0,re.Namespace.RDF.term("type"),re.Namespace.EXOCMD.term("Command")),t=[],n=new Set;for(let i of e){let s=i.subject;if((await this.getLiteralValue(s,re.Namespace.EXOCMD.term("Command_paletteEnabled")))?.toLowerCase()!=="true")continue;let c=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_uid"));if(!c){this.logger.warn(`[CommandResolver] paletteEnabled command at ${s.value} has no exo__Asset_uid \u2014 skipped`);continue}let l=await this.loadCommand(c);if(!l){this.logger.warn(`[CommandResolver] paletteEnabled command ${c} could not be loaded (missing grounding?) \u2014 skipped`);continue}let u=await this.getLiteralValue(s,re.Namespace.EXOCMD.term("Command_paletteId")),f=await this.getLiteralValue(s,re.Namespace.EXOCMD.term("Command_cliName")),d=u??f??c;if(n.has(d)){this.logger.warn(`[CommandResolver] duplicate paletteId "${d}" \u2014 first registration wins, dropping ${c}`);continue}n.add(d),t.push({command:l,paletteId:d})}return t}invalidateCache(){this.cache.clear(),this.multiCache.clear(),this._ancestorDepthCache.clear()}async resolveLabel(e,t){if(!e.labelTemplate)return e.name;let n=e.labelTemplate,i=this.extractPlaceholders(e.labelTemplate);for(let{full:s,body:o}of i){let c=await this.evaluateSelectSnippet(o,t);n=n.replace(s,c)}return n}extractPlaceholders(e){let t=[],n=0;for(;n<e.length;)if(e[n]==="{"){let i=1,s=n+1;for(;s<e.length&&i>0;)e[s]==="{"?i++:e[s]==="}"&&i--,s++;if(i===0){let o=e.slice(n,s),c=e.slice(n+1,s-1);t.push({full:o,body:c})}n=s}else n++;return t}async evaluateSelectSnippet(e,t){try{let n=e.replace(/\$target/g,`<${t}>`),s=new Aq.ExoQLParser().parse(n),c=new Iq.ExoQLAlgebraTranslator().translate(s),u=await new xq.ExoQLQueryExecutor(this.tripleStore).executeAll(c);if(u.length===0)return"";let f=u[0],d=f.variables();if(d.length===0)return"";let p=f.get(d[0]);return p?p instanceof Mt.Literal||p instanceof nr.IRI?p.value:String(p):""}catch{return""}}async loadBindingDefinition(e){let t=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid"));if(!t)return null;let n=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_label"))??"",i=await this.getLinkedUID(e,re.Namespace.EXOCMD.term("CommandBinding_command"));if(!i)return null;let s=await this.getLinkedValue(e,re.Namespace.EXOCMD.term("CommandBinding_targetClass")),o=await this.getLinkedValue(e,re.Namespace.EXOCMD.term("CommandBinding_targetPrototype")),c=await this.getLinkedValue(e,re.Namespace.EXOCMD.term("CommandBinding_targetAsset"));if(!s&&!o&&!c)return null;let l=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBinding_position")),u=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBinding_order")),f=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBinding_variant")),d=f!==null?this.coerceVariant(f,t):void 0,p=await this.loadLinkedPreconditionFromProperty(e,re.Namespace.EXOCMD.term("CommandBinding_precondition")),h=await this.loadLinkedStyle(e,t),_=await this.getLinkedUIDs(e,re.Namespace.EXOCMD.term("CommandBinding_overrides"));return{id:t,label:n,commandRef:i,targetClass:s??void 0,targetPrototype:o??void 0,targetAsset:c??void 0,position:l??void 0,order:u?parseInt(u,10):void 0,variant:d,precondition:p??void 0,style:h??void 0,overrides:_.length>0?_:void 0}}async loadLinkedStyle(e,t){let n=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("CommandBinding_style"),void 0);if(n.length>0){let s=n[0].object,o=null;if(s instanceof nr.IRI)o=s;else if(s instanceof Mt.Literal){let c=this.normalizeWikilink(s.value);o=await this.findSubjectByUID(c)}if(o){let c=await this.loadStyleAsset(o);if(c)return c}this.logger.warn(this.capWarning(`CommandBinding ${t}: style reference unresolved, falling back to inline variant`))}let i=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBinding_variant"));if(i!==null){let s=this.coerceVariant(i,t);if(s!==void 0)return{id:`inline:${t}`,label:"",variant:s,inline:!0}}return null}async loadStyleAsset(e){let t=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid"));if(!t)return null;let n=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_label"))??"",i=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_variant")),s=i!==null?this.coerceVariant(i,t):void 0,o=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_showIcon")),c=this.coerceBoolean(o),l=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_labelClass")),u=l!==null?this.coerceLabelClass(l,t):void 0,f=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_ariaLabel")),d=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_tooltip")),p=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_keyboardShortcut")),h=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_source")),_=h!==null?this.coerceStyleSource(h,t):void 0;return{id:t,label:n,variant:s,showIcon:c,labelClass:u,ariaLabel:f??void 0,tooltip:d??void 0,keyboardShortcut:p??void 0,source:_,inline:!1}}coerceVariant(e,t){if(e==null)return;let n=String(e).trim().toLowerCase();if(n!==""){if(au.COMMAND_VARIANT_VALUES.includes(n))return n;this.logger.warn(this.capWarning(`CommandBindingStyle variant "${n}" not in whitelist [${au.COMMAND_VARIANT_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceLabelClass(e,t){if(e==null)return;let n=String(e).trim().toLowerCase();if(n!==""){if(au.LABEL_CLASS_VALUES.includes(n))return n;this.logger.warn(this.capWarning(`CommandBindingStyle labelClass "${n}" not in whitelist [${au.LABEL_CLASS_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceStyleSource(e,t){if(e==null)return;let n=String(e).trim().toLowerCase();if(n!==""){if(au.STYLE_SOURCE_VALUES.includes(n))return n;this.logger.warn(this.capWarning(`CommandBindingStyle source "${n}" not in whitelist [${au.STYLE_SOURCE_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceBoolean(e){if(e===null)return;let t=e.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}capWarning(e){return e.length<=200?e:e.slice(0,197)+"..."}bindingMatches(e,t,n,i){if(e.targetAsset&&i&&this.matchesReference(e.targetAsset,i))return!0;if(e.targetPrototype&&n){for(let s of n)if(this.matchesReference(e.targetPrototype,s))return!0}return!!(e.targetClass&&t&&this.matchesReference(e.targetClass,t))}matchesReference(e,t){let n=this.normalizeWikilink(e),i=this.normalizeWikilink(t);if(n===i)return!0;let s=this.extractPathBasename(i);if(s&&s===n)return!0;let o=this.extractPathBasename(n);if(o&&o===i)return!0;let c=this.extractAlias(t);if(c&&n===c)return!0;let l=this.extractAlias(e);return!!(l&&l===i)}extractPathBasename(e){let t=e.match(/\/([^/]+)\.md$/);return t?t[1]:null}extractAlias(e){let t=e.replace(/["'[\]]/g,"").trim(),n=t.indexOf("|");return n>=0?t.substring(n+1).trim():null}getBindingPriority(e){return e.targetAsset?0:e.targetPrototype?1:2}async loadLinkedPrecondition(e){return this.loadLinkedPreconditionFromProperty(e,re.Namespace.EXOCMD.term("Command_precondition"))}async loadLinkedPreconditionFromProperty(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=await this.resolvePreconditionRef(n[0].object);return i?this.loadPreconditionSubject(i,new Set,0):null}async resolvePreconditionRef(e){if(e instanceof nr.IRI)return e;if(e instanceof Mt.Literal){let t=this.normalizeWikilink(e.value);return await this.findSubjectByUID(t)}return null}async loadPreconditionSubject(e,t,n){let i=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid")),s=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_label"))??"";if(i&&t.has(i))return this.brokenPreconditionNode(i,s);if(n>=Pc)return this.brokenPreconditionNode(i??"",s);let o=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("AllPrecondition_preconditions"),void 0),c=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("AnyPrecondition_preconditions"),void 0),l=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("NotPrecondition_precondition"),void 0);if(o.length>0||c.length>0||l.length>0){let p=new Set(t);if(i&&p.add(i),o.length>0||c.length>0){let _=o.length>0?"all":"any",y=o.length>0?o:c,S=[];for(let w of y)S.push(await this.loadChildPrecondition(w.object,p,n+1));return{id:i??"",label:s,composite:{op:_,children:S}}}let h=await this.loadChildPrecondition(l[0].object,p,n+1);return{id:i??"",label:s,not:h}}let u=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Precondition_sparqlAsk")),f=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Precondition_hostFunction")),d=await this.loadPreconditionQueryRef(e);return!i||!u&&!f&&!d?null:{id:i,label:s,...u&&{sparqlAsk:u},...f&&{hostFunction:f},...d&&{query:d}}}async loadChildPrecondition(e,t,n){let i=await this.resolvePreconditionRef(e);if(!i){let c=e instanceof Mt.Literal?this.normalizeWikilink(e.value):"";return this.brokenPreconditionNode(c,"")}let s=await this.loadPreconditionSubject(i,t,n);if(s)return s;let o=await this.getLiteralValue(i,re.Namespace.EXO.term("Asset_uid"));return this.brokenPreconditionNode(o??"","")}async loadPreconditionQueryRef(e){let t=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Precondition_query"),void 0);if(t.length===0)return;let n=t[0].object;if(n instanceof nr.IRI)return await this.getLiteralValue(n,re.Namespace.EXO.term("Asset_uid"))??void 0;if(n instanceof Mt.Literal)return this.normalizeWikilink(n.value)}brokenPreconditionNode(e,t){return{id:e,label:t,broken:!0}}async loadLinkedGrounding(e,t,n){if(t>=Pc)return null;let i=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Command_grounding"),void 0);if(i.length===0)return null;if(i.length===1||!n?.targetClass){let o=await this.resolveGroundingRef(i[0].object);return o?this.loadGroundingDefinition(o,t):null}for(let o of i){let c=await this.resolveGroundingRef(o.object);if(!c)continue;let l=await this.getObsidianName(c,re.Namespace.EXOCMD.term("Grounding_targetPrototype"));if(l&&this.matchesReference(l,n.targetClass))return this.loadGroundingDefinition(c,t)}this.logger.warn(`Command ${e.value}: ${i.length} groundings declared, none matched context.targetClass='${n.targetClass}' via Grounding_targetPrototype \u2014 falling back to first grounding by iteration order (legacy behaviour). Check that one grounding's Grounding_targetPrototype references this targetClass.`);let s=await this.resolveGroundingRef(i[0].object);return s?this.loadGroundingDefinition(s,t):null}async resolveGroundingRef(e){if(e instanceof nr.IRI)return e;if(e instanceof Mt.Literal){let t=this.normalizeWikilink(e.value);return await this.findSubjectByUID(t)}return null}async loadGroundingByUid(e){let t=await this.findSubjectByUID(e);return t?this.loadGroundingDefinition(t,0):null}async loadGroundingDefinition(e,t){if(t>=Pc)return null;let n=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid"));if(!n)return null;let i=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_label"))??"",s=await this.resolveGroundingTypeReference(e);if(!s)return null;let o=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetProperty"));if(o&&this.looksLikeUUID(o)){let se=await this.resolveLabelByUID(o);if(!se)return this.logger.warn(`Grounding ${n}: targetProperty wikilink UID '${o}' is not resolvable to exo__Asset_label \u2014 grounding skipped (would otherwise write a UUID-named frontmatter key).`),null;o=se}if(s===FP.GroundingType.SERVICE_CALL){let se=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_serviceId"));se&&(o=se)}let c=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetValueRef")),l=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_targetValueLiteral")),u=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetValueSubstitution")),f=null;if(u&&this.looksLikeUUID(u)){let se=await this.resolveLabelByUID(u);if(!se)return this.logger.warn(`Grounding ${n}: targetValueSubstitution UID '${u}' is not resolvable to exo__Asset_label (SubstitutionToken instance missing or unlabelled) \u2014 grounding skipped.`),null;f=se}else u&&(f=u);let d=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetValueQuery")),p=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_serviceCallPayload")),h=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_appendExpression")),_=await this.getObsidianWikilinkValue(e,re.Namespace.EXOCMD.term("Grounding_isDefinedBy")),y=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_sparqlUpdate")),S=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetClass"));if(S&&!this.looksLikeUUID(S)){let se=await this.findUidByLabel(S);se&&(S=se)}let w=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetPrototype")),T=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_targetFolder")),O=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_linkBackProperty")),A=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_inputSchema")),x=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_incrementBy")),P=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_shiftDelta")),V;if(x!=null&&x!==""){let se=Number.parseInt(String(x),10);Number.isFinite(se)&&(V=se)}let j=await this.resolvePropertyDefaults(e,n),$=await this.resolveInheritanceRules(e,n),K=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_propertyDefaults"));K!==null&&K!==""&&!this._legacyPropertyDefaultsWarnedGroundings.has(n)&&(this.logger.warn(`Grounding ${n}: deprecated exocmd__Grounding_propertyDefaults (plural) JSON predicate detected \u2014 the parser was removed in RFC v2 Phase 5 (#3167); value is ignored. Migrate to ref-form exocmd__Grounding_propertyDefault (singular) pointing to exocmd__PropertyDefault assets. See vault TBox c8f87363-d39c-45cb-9d4d-1be96d70f892 for the canonical replacement.`),this._legacyPropertyDefaultsWarnedGroundings.add(n));let N;s===FP.GroundingType.COMPOSITE&&(N=await this.loadCompositeSteps(e,t+1));let ae;if(A)try{let se=JSON.parse(A);se?.properties&&(ae=Object.entries(se.properties).map(([_e,Ne])=>{let Q=Ne.type,ce=Q==="string"?"text":Q,be=Ne.defaultValue!==void 0?Ne.defaultValue:Ne.default,Ie={name:_e,type:ce,label:Ne.title??_e,required:Array.isArray(se.required)&&se.required.includes(_e)};return be!=null&&(Ie.defaultValue=String(be)),typeof Ne.targetClassUid=="string"&&(Ie.targetClassUid=Ne.targetClassUid),Ie}))}catch{}let we=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_prefillLabelWithDate")),ee=we!==null&&String(we).trim().toLowerCase()==="true",pe=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_labelTemplate")),Y=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_direction")),Ee;if(Y!=null){let se=String(Y).trim().toLowerCase();se==="forward"||se==="rollback"?Ee=se:se!==""&&this.logger.warn(`Grounding ${n}: exocmd__Grounding_direction value '${Y}' is not 'forward' or 'rollback' \u2014 treating as undefined (will default to 'forward' at dispatch).`)}let ie=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_bodyTemplate")),ne=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_templateRef")),de=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_cloneTargetBody")),ye=de!==null&&String(de).trim().toLowerCase()==="true",te=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_targetsCreatedInstance")),me=te!==null&&String(te).trim().toLowerCase()==="true",Pe={id:n,label:i,type:s,targetProperty:o??void 0,targetValueRef:c??void 0,targetValueLiteral:l??void 0,targetValueSubstitution:f??void 0,targetValueQuery:d??void 0,serviceCallPayload:p??void 0,appendExpression:h??void 0,sparqlUpdate:y??void 0,steps:N,targetClass:S??void 0,targetPrototype:w??void 0,targetFolder:T??void 0,linkBackProperty:O??void 0,incrementBy:V,shiftDelta:P??void 0,propertyDefault:j.length>0?j:void 0,inheritanceRule:$.length>0?$:void 0,isDefinedBy:_??void 0,prefillLabelWithDate:ee||void 0,labelTemplate:pe??void 0,direction:Ee,bodyTemplate:ie??void 0,templateRef:ne??void 0,cloneTargetBody:ye||void 0,targetsCreatedInstance:me||void 0};return ae&&(Pe.inputSchema=ae),Pe}async loadCompositeSteps(e,t){if(t>=Pc)return[];let n=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Grounding_steps"),void 0),i=[];for(let s of n){let o=null;if(s.object instanceof nr.IRI)o=s.object;else if(s.object instanceof Mt.Literal){let l=this.normalizeWikilink(s.object.value);o=await this.findSubjectByUID(l)}if(!o)continue;let c=await this.loadGroundingDefinition(o,t);c&&i.push(c)}return i}async resolvePropertyDefaults(e,t){let n=await this.resolvePropertyDefaultsForSubject(e,t,re.Namespace.EXOCMD.term("Grounding_propertyDefault")),i=await this.getUniversalCache();return i&&i.propertyDefaults.length>0?(0,Tg.mergePropertyDefaults)(i.propertyDefaults,n):n}async resolvePropertyDefaultsForSubject(e,t,n){let i=await this.tripleStore.match(e,n,void 0),s=[];for(let o of i){let c=await this.resolveRefTripleObject(o.object);if(!c)continue;let l=await this.getObsidianName(c,re.Namespace.EXOCMD.term("PropertyDefault_property"));if(!l){this.logger.warn(`Grounding ${t}: PropertyDefault asset missing exocmd__PropertyDefault_property \u2014 entry skipped.`);continue}let u=this.looksLikeUUID(l)?await this.resolveLabelByUID(l):l;if(!u){this.logger.warn(`Grounding ${t}: PropertyDefault property UID '${l}' is not resolvable to exo__Asset_label \u2014 entry skipped.`);continue}let f=await this.getObsidianName(c,re.Namespace.EXOCMD.term("PropertyDefault_value"));if(!f){this.logger.warn(`Grounding ${t}: PropertyDefault '${u}' missing exocmd__PropertyDefault_value \u2014 entry skipped.`);continue}let d=await this.resolvePropertyDefaultValue(f,t,u);d!==null&&s.push({propertyName:u,value:d})}return s}async getUniversalCache(){if(this._universalCacheReady)return this._universalCacheValue;this._universalCacheReady=!0;let e=await(0,Tg.loadUniversalDefault)();if(e)return this._universalCacheValue=e,e;let t=await this.findUniversalSingleton();if(!t)return this._universalCacheValue=null,null;let n=await this.resolvePropertyDefaultsForSubject(t,$P,re.Namespace.EXOCMD.term("Template_propertyDefault")),i=await this.resolveInheritanceRulesForSubject(t,$P,re.Namespace.EXOCMD.term("Template_inheritanceRule"));return this._universalCacheValue={propertyDefaults:n,inheritanceRules:i},this._universalCacheValue}async findUniversalSingleton(){let e=re.Namespace.EXOCMD.term("UniversalDefaultTemplate").value,t=await this.tripleStore.match(void 0,re.Namespace.EXO.term("Instance_class"),void 0),n=[];for(let i of t){let s=!1;if(i.object instanceof nr.IRI)s=i.object.value===e||i.object.value.includes(jP);else if(i.object instanceof Mt.Literal){let o=this.unwrapWikilink(i.object.value);s=o==="exocmd__UniversalDefaultTemplate"||o===jP}s&&i.subject instanceof nr.IRI&&n.push(i.subject)}return n.length===0?null:(n.length===1||(n.sort((i,s)=>i.value.localeCompare(s.value)),this.logger.warn(`Multiple UniversalDefaultTemplate singletons found (${n.length}); selecting deterministically by lexicographic UID order: ${n[0].value}`)),n[0])}async resolveInheritanceRules(e,t){let n=await this.resolveInheritanceRulesForSubject(e,t,re.Namespace.EXOCMD.term("Grounding_inheritanceRule")),i=await this.getUniversalCache();return i&&i.inheritanceRules.length>0?(0,Tg.mergeInheritanceRules)(i.inheritanceRules,n):n}async resolveInheritanceRulesForSubject(e,t,n){let i=await this.tripleStore.match(e,n,void 0),s=[],o=t;for(let c of i){let l=await this.resolveRefTripleObject(c.object);if(!l)continue;let u=await this.resolveLabelRef(l,re.Namespace.EXOCMD.term("InheritanceRule_sourceProperty"));if(!u){this.logger.warn(`Grounding ${o}: InheritanceRule missing/unresolvable exocmd__InheritanceRule_sourceProperty \u2014 entry skipped.`);continue}let f=await this.resolveLabelRef(l,re.Namespace.EXOCMD.term("InheritanceRule_targetProperty"));if(!f){this.logger.warn(`Grounding ${o}: InheritanceRule missing/unresolvable exocmd__InheritanceRule_targetProperty \u2014 entry skipped.`);continue}let d=await this.tripleStore.match(l,re.Namespace.EXOCMD.term("InheritanceRule_targetClassCondition"),void 0),p,h;if(d.length>0){let A=await this.getObsidianName(l,re.Namespace.EXOCMD.term("InheritanceRule_targetClassCondition"));if(!A||!A.trim()){this.logger.warn(`Grounding ${o}: InheritanceRule has exocmd__InheritanceRule_targetClassCondition triple but ref is unresolvable \u2014 entire rule skipped (would otherwise apply unconditionally, broadening scope).`);continue}this.looksLikeUUID(A)?(h=A,p=await this.resolveLabelByUID(A)??void 0):p=A}let _=await this.tripleStore.match(l,re.Namespace.EXOCMD.term("InheritanceRule_targetClassExclusion"),void 0),y=[],S=[],w=!1;for(let A of _){let x=null;if(A.object instanceof nr.IRI?x=this.iriToObsidianName(A.object.value)??A.object.value:A.object instanceof Mt.Literal&&(x=this.unwrapWikilink(A.object.value)),!x){w=!0;continue}if(this.looksLikeUUID(x)){S.push(x);let P=await this.resolveLabelByUID(x);P&&y.push(P)}else y.push(x)}if(w){this.logger.warn(`Grounding ${o}: InheritanceRule has unresolvable exocmd__InheritanceRule_targetClassExclusion entry \u2014 entire rule skipped (would otherwise expand scope by silently dropping the excluded class).`);continue}let T=await this.getLiteralValue(l,re.Namespace.EXOCMD.term("InheritanceRule_priority")),O=50;if(T!==null&&T!==""){let A=Number.parseInt(String(T),10);Number.isFinite(A)&&(O=A)}s.push({sourcePropertyName:u,targetPropertyName:f,targetClassCondition:p,targetClassConditionUid:h,targetClassExclusion:y,targetClassExclusionUids:S,priority:O})}return s}async resolveRefTripleObject(e){if(e instanceof nr.IRI)return e;if(e instanceof Mt.Literal){let t=this.normalizeWikilink(e.value);return t?this.findSubjectByUID(t):null}return null}async resolveLabelRef(e,t){let n=await this.getObsidianName(e,t);return n?this.looksLikeUUID(n)?this.resolveLabelByUID(n):n:null}async resolvePropertyDefaultValue(e,t,n){if(!this.looksLikeUUID(e))return`"[[${e}]]"`;let i=await this.findSubjectByUID(e);return i?await this.assetIsTokenInvocation(i)?this.resolveTokenInvocation(i,e,t,n):await this.assetIsSubstitutionToken(i)?this.dispatchSubstitutionToken(i,e,t,n,void 0):`"[[${e}]]"`:`"[[${e}]]"`}async dispatchSubstitutionToken(e,t,n,i,s){let o=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("SubstitutionToken_resolver"));if(!o||!o.trim())return this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' references SubstitutionToken '${t}' with no exocmd__SubstitutionToken_resolver \u2014 falling back to wikilink form.`),`"[[${t}]]"`;let c=o.trim();return kP.has(c)?s!==void 0?Pq(c,t,s):Oq(c,t):(this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' SubstitutionToken '${t}' declares unknown resolver-id '${c}' \u2014 falling back to wikilink form. Known ids: ${Array.from(kP).join(", ")}.`),`"[[${t}]]"`)}async resolveTokenInvocation(e,t,n,i){let s=await this.getObsidianName(e,re.Namespace.EXOCMD.term("TokenInvocation_token"));if(!s)return this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' TokenInvocation '${t}' missing exocmd__TokenInvocation_token \u2014 entry skipped.`),null;let o=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("TokenInvocation_parameter"))??"";if(!this.looksLikeUUID(s))return this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' TokenInvocation '${t}' references non-UUID token '${s}' \u2014 entry skipped.`),null;let c=await this.findSubjectByUID(s);return c?this.dispatchSubstitutionToken(c,s,n,i,o):(this.logger.warn(`Grounding ${n}: PropertyDefault '${i}' TokenInvocation '${t}' token ref '${s}' not found in store \u2014 entry skipped.`),null)}async assetIsTokenInvocation(e){let t=await this.tripleStore.match(e,re.Namespace.EXO.term("Instance_class"),void 0);for(let n of t)if(n.object instanceof nr.IRI){if(n.object.value===Dq||n.object.value.includes(MP))return!0}else if(n.object instanceof Mt.Literal){let i=this.unwrapWikilink(n.object.value);if(i==="exocmd__TokenInvocation"||i===MP)return!0}return!1}async assetIsSubstitutionToken(e){let t=await this.tripleStore.match(e,re.Namespace.EXO.term("Instance_class"),void 0);for(let n of t)if(n.object instanceof nr.IRI){if(n.object.value===Cq||n.object.value.includes(NP))return!0}else if(n.object instanceof Mt.Literal){let i=this.unwrapWikilink(n.object.value);if(i==="exocmd__SubstitutionToken"||i===NP)return!0}return!1}async resolveGroundingTypeReference(e){let t=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Grounding_type"),void 0);if(t.length===0)return null;let n=t[0].object;if(n instanceof nr.IRI)return(0,LP.resolveGroundingTypeFromIRI)(n.value);if(n instanceof Mt.Literal){let i=n.value,s=i.match(/^\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\|[^\]]*)?\]\]$/i);return s?(0,LP.resolveGroundingTypeFromIRI)(`obsidian://vault/${s[1].toLowerCase()}.md`):(this.logger.warn(`[exocmd-grounding-type-literal-form] legacy literal-string form '${i}' for exocmd__Grounding_type on <${e.value}>. Migrate to wikilink form per RFC 9d20c91f Phase 3.`),null)}return null}async expandPrototypeChain(e){if(!e||!this.normalizeWikilink(e))return[];let t=[e],n=new Set([this.normalizeWikilink(e).toLowerCase()]),i=e;for(let s=0;s<Pc;s++){let o=this.extractUuidFromRef(i);if(!o)break;let c=null;try{let u=await this.findSubjectByUID(o);if(!u)break;c=await this.getLinkedValue(u,re.Namespace.EXO.term("Asset_prototype"))}catch(u){this.logger.debug(this.capWarning(`[expandPrototypeChain] store lookup failed at hop ${s} for '${i}': ${String(u)}`));break}if(!c)break;let l=this.normalizeWikilink(c).toLowerCase();if(n.has(l))break;n.add(l),t.push(c),i=c}return t}extractUuidFromRef(e){let t=this.normalizeWikilink(e);if(this.looksLikeUUID(t))return t;let n=this.extractPathBasename(t);return n&&this.looksLikeUUID(n)?n:null}async findSubjectByUID(e){if(this.tripleStore.findSubjectsByUUID){let n=await this.tripleStore.findSubjectsByUUID(e);if(n.length>0)return n[0]}let t=await this.tripleStore.match(void 0,re.Namespace.EXO.term("Asset_uid"),void 0);for(let n of t)if(n.object instanceof Mt.Literal&&n.object.value===e)return n.subject;return null}async getLiteralValue(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;return i instanceof Mt.Literal||i instanceof nr.IRI?i.value:null}looksLikeUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}async resolveLabelByUID(e){let t=await this.findSubjectByUID(e);return t?this.getLiteralValue(t,re.Namespace.EXO.term("Asset_label")):null}async getClassAncestors(e){return(await this.getClassAncestorsWithDepth(e)).map(n=>n.ref)}async getClassAncestorsWithDepth(e){let t=this._ancestorDepthCache.get(e);if(t)return t;let n=new Map,i=new Set,s=await this.resolveClassFileIRI(e);if(!s)return[];let o=new Set([e]),c=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_uid"));c&&o.add(c);let l=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_label"));l&&o.add(l);let u=a((p,h)=>{if(o.has(p))return;let _=n.get(p);(_===void 0||h<_)&&n.set(p,h)},"setMin"),f=[{fileIRI:s,depth:0}];for(;f.length>0;){let p=f.shift();if(!p)break;let{fileIRI:h,depth:_}=p;if(_>=Pc||i.has(h.value))continue;i.add(h.value);let y=await this.tripleStore.match(h,re.Namespace.EXO.term("Class_superClass"),void 0);for(let S of y){let w=S.object;if(!(w instanceof nr.IRI))continue;let T=_+1,O=w.value.startsWith("obsidian://vault/"),A=this.iriToObsidianName(w.value);A&&u(A,T);let x=null;if(O?x=w:A&&(x=await this.resolveClassFileIRI(A)),!x)continue;let P=await this.getLiteralValue(x,re.Namespace.EXO.term("Asset_uid"));P&&u(P,T),i.has(x.value)||f.push({fileIRI:x,depth:T})}}let d=Array.from(n.entries()).map(([p,h])=>({ref:p,depth:h}));return this._ancestorDepthCache.set(e,d),d}async resolveClassFileIRI(e){if(this.looksLikeUUID(e))return this.findSubjectByUID(e);let t=await this.findUidByLabel(e);return t?this.findSubjectByUID(t):null}async findUidByLabel(e){let t=await this.tripleStore.match(void 0,re.Namespace.EXO.term("Asset_label"),void 0);for(let n of t)if(n.object instanceof Mt.Literal&&n.object.value===e&&n.subject instanceof nr.IRI){let i=await this.tripleStore.match(n.subject,re.Namespace.EXO.term("Asset_uid"),void 0);if(i.length>0&&i[0].object instanceof Mt.Literal)return i[0].object.value}return null}async getLinkedUID(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;if(i instanceof nr.IRI){let s=await this.tripleStore.match(i,re.Namespace.EXO.term("Asset_uid"),void 0);return s.length>0&&s[0].object instanceof Mt.Literal?s[0].object.value:i.value.split("/").pop()?.replace(".md","")??null}return i instanceof Mt.Literal?this.normalizeWikilink(i.value):null}async getLinkedUIDs(e,t){let n=await this.tripleStore.match(e,t,void 0),i=[];for(let s of n){let o=s.object;if(o instanceof nr.IRI){let c=await this.tripleStore.match(o,re.Namespace.EXO.term("Asset_uid"),void 0);if(c.length>0&&c[0].object instanceof Mt.Literal)i.push(c[0].object.value);else{let l=o.value.split("/").pop()?.replace(".md","");l&&i.push(l)}}else if(o instanceof Mt.Literal){let c=this.normalizeWikilink(o.value);c&&i.push(c)}}return i}async getLinkedValue(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;return i instanceof Mt.Literal?this.normalizeWikilink(i.value):i instanceof nr.IRI?this.iriToObsidianName(i.value)??i.value:null}async getObsidianName(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;return i instanceof Mt.Literal?this.unwrapWikilink(i.value):i instanceof nr.IRI?this.iriToObsidianName(i.value)??i.value:null}unwrapWikilink(e){if(!e)return e;let t=e.trim().replace(/^"|"$/g,"");if(t.startsWith("http://")||t.startsWith("https://"))return this.iriToObsidianName(t)??t;let n=t.match(/^\[\[([^\]|]+)\|([^\]]+)\]\]$/);if(n)return n[2].trim();let i=t.match(/^\[\[([^\]|]+)\]\]$/);if(i){let s=i[1].trim();return s.startsWith("http://")||s.startsWith("https://")?this.iriToObsidianName(s)??s:s}return t}async getObsidianWikilinkValue(e,t){let n=await this.tripleStore.match(e,t,void 0);if(n.length===0)return null;let i=n[0].object;if(i instanceof Mt.Literal)return this.resolveWikilinkAlias(i.value);if(i instanceof nr.IRI){let s=this.iriToObsidianName(i.value);return s?`"[[${s}]]"`:i.value}return null}async resolveWikilinkAlias(e){let t=e.match(/\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\]\]/);if(!t)return e;let n=t[1],i=await this.findSubjectByUID(n);if(!i)return e;let s=await this.getLiteralValue(i,re.Namespace.EXO.term("Asset_label"));return s?e.replace(`[[${n}]]`,`[[${n}|${s}]]`):e}iriToObsidianName(e){return(0,Tq.iriToObsidianName)(e)}normalizeWikilink(e){let t=e.replace(/["'[\]]/g,"").trim(),n=t.indexOf("|");return n>=0?t.substring(0,n):t}};wo.CommandResolver=Y1;wo.CommandResolver=Y1=bq([(0,wq.injectable)(),Sq("design:paramtypes",[Object,Object])],Y1)});var X1=E(Q1=>{"use strict";Object.defineProperty(Q1,"__esModule",{value:!0});Q1.validateExoQLAllowlist=Fq;var Ig=md();function Fq(r){if(!r||typeof r!="object")return;let e=r;if(e.type==="update"){let t=r.updates??[];for(let n of t)if(n?.type==="load")throw new Ig.ExoQLForbiddenKeywordError("LOAD");throw new Ig.ExoQLForbiddenKeywordError("UPDATE")}if(e.type==="query"){if(e.from){let t=Array.isArray(e.from.default)&&e.from.default.length>0,n=Array.isArray(e.from.named)&&e.from.named.length>0;if(t||n)throw new Ig.ExoQLForbiddenKeywordError("FROM")}if(Array.isArray(e.where))for(let t of e.where)xg(t);if(Array.isArray(e.template))for(let t of e.template)xg(t)}}a(Fq,"validateExoQLAllowlist");function xg(r){if(!r||typeof r!="object")return;if(r.type==="service")throw new Ig.ExoQLForbiddenKeywordError("SERVICE");if(Array.isArray(r.patterns))for(let t of r.patterns)xg(t);let e=r.where;if(Array.isArray(e))for(let t of e)xg(t)}a(xg,"walkPatternForBannedKeywords")});var J1=E(Rg=>{"use strict";Object.defineProperty(Rg,"__esModule",{value:!0});Rg.DEFAULT_EVAL_CONFIG=void 0;Rg.DEFAULT_EVAL_CONFIG=Object.freeze({enabled:!0,maxNestedEvalCount:100,maxAggregateEvalMillis:1e4})});var Cg=E(Z1=>{"use strict";Object.defineProperty(Z1,"__esModule",{value:!0});Z1.evaluateWithExoEval=Uq;var Lq=Ml(),Nq=$l(),kq=ou(),Mq=X1(),jq=J1(),$q=md();async function Uq(r,e={}){if(typeof r!="string")throw new TypeError("evaluateWithExoEval: sparql must be a string");let n=new Lq.ExoQLParser().parse(r);if((0,Mq.validateExoQLAllowlist)(n),!{...jq.DEFAULT_EVAL_CONFIG,...e.config??{}}.enabled)throw new $q.ExoQLEvalDisabledError;let s="queryType"in n&&typeof n.queryType=="string"?n.queryType:"SELECT";if(!e.store)return s==="ASK"?{kind:"ask",result:!1}:s==="CONSTRUCT"?{kind:"construct",triples:[]}:{kind:"select",rows:[]};let c=new Nq.ExoQLAlgebraTranslator().translate(n),l=new kq.ExoQLQueryExecutor(e.store);return l.isAskQuery(c)?{kind:"ask",result:await l.executeAsk(c)}:l.isConstructQuery(c)?{kind:"construct",triples:await l.executeConstruct(c)}:{kind:"select",rows:await l.executeAll(c)}}a(Uq,"evaluateWithExoEval")});var on=E(Og=>{"use strict";Object.defineProperty(Og,"__esModule",{value:!0});Og.DateFormatter=void 0;var eE=class r{static{a(this,"DateFormatter")}static toISOTimestamp(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}static toLocalTimestamp(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),c=String(e.getSeconds()).padStart(2,"0");return`${t}-${n}-${i}T${s}:${o}:${c}`}static toDateWikilink(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`"[[${t}-${n}-${i}]]"`}static getTodayWikilink(){return r.toDateWikilink(new Date)}static toDateString(e){let t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${i}`}static parseWikilink(e){let n=e.replace(/^["']|["']$/g,"").match(/\[\[(\d{4}-\d{2}-\d{2})\]\]/);return n?n[1]:null}static addDays(e,t){let n=new Date(e);return n.setDate(n.getDate()+t),n}static isSameDay(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}static getTodayStartTimestamp(){let e=new Date;return e.setHours(0,0,0,0),r.toLocalTimestamp(e)}static toTimestampAtStartOfDay(e){let t=e.split("-").map(Number);if(t.length!==3||t.some(isNaN))throw new Error(`Invalid date format: ${e}. Expected YYYY-MM-DD`);let[n,i,s]=t,o=new Date(n,i-1,s,0,0,0,0);if(isNaN(o.getTime()))throw new Error(`Invalid date values: ${e}`);return r.toLocalTimestamp(o)}static normalizeTimestamp(e){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e))return e;let t=new Date(e);if(isNaN(t.getTime()))throw new Error(`Invalid timestamp format: ${e}`);return r.toISOTimestamp(t)}static isISOTimestamp(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e)}};Og.DateFormatter=eE});var yd=E(Pg=>{"use strict";Object.defineProperty(Pg,"__esModule",{value:!0});Pg.liveClock=Bq;Pg.frozenClock=Vq;function Bq(){return{now:a(()=>new Date,"now")}}a(Bq,"liveClock");function Vq(r){let e=new Date(r);return{now:a(()=>new Date(e.getTime()),"now")}}a(Vq,"frozenClock")});var VP=E(Eo=>{"use strict";var qq=Eo&&Eo.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Gq=Eo&&Eo.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},bd;Object.defineProperty(Eo,"__esModule",{value:!0});Eo.PreconditionEvaluator=void 0;var Wq=Ze(),Hq=Ml(),zq=$l(),BP=ou(),Kq=Cg(),_d=on(),Yq=yd(),Sd=bd=class{static{a(this,"PreconditionEvaluator")}constructor(e,t,n){this.hostFunctions=new Map,this.askCache=new Map,this.tripleStore=e,this.queryBodyResolver=t,this.clock=n?.clock??(0,Yq.liveClock)()}async evaluate(e,t,n){if(!e)return!0;let i=new Map;return await this.evaluateNode(e,t,n,i)==="yes"}async evaluateNode(e,t,n,i){if(e.broken)return"unknown";if(e.composite){let{op:s,children:o}=e.composite;if(o.length===0)return"unknown";let c=await Promise.all(o.map(l=>this.evaluateNode(l,t,n,i)));return s==="all"?c.includes("no")?"no":c.includes("unknown")?"unknown":"yes":c.includes("yes")?"yes":c.includes("unknown")?"unknown":"no"}if(e.not){let s=await this.evaluateNode(e.not,t,n,i);return s==="unknown"?"unknown":s==="yes"?"no":"yes"}return e.sparqlAsk?await this.evaluateSparqlAskMemoized(e.sparqlAsk,t,i)?"yes":"no":e.query?await this.evaluateQueryRef(e.query,t)?"yes":"no":e.hostFunction?this.evaluateHostFunction(e.hostFunction,t,n)?"yes":"no":"yes"}evaluateSparqlAskMemoized(e,t,n){let i=n.get(e);if(i!==void 0)return i;let s=this.evaluateSparqlAsk(e,t);return n.set(e,s),s}async evaluateQueryRef(e,t){if(!this.queryBodyResolver)return!1;try{let n=await this.queryBodyResolver.resolveSparql(e);if(!n)return!1;let i=this.substituteVariables(n,t),s=await(0,Kq.evaluateWithExoEval)(i,{store:this.tripleStore});return s.kind!=="ask"?!1:s.result}catch{return!1}}registerHostFunction(e,t){this.hostFunctions.set(e,t)}hasHostFunction(e){return this.hostFunctions.has(e)}evaluateHostFunctionSync(e,t,n){return this.hostFunctions.has(e)?this.evaluateHostFunction(e,t,n):null}invalidateCache(){this.askCache.clear()}compileAsk(e){let t=this.substituteVariables(e,bd.SENTINEL_IRI),i=new Hq.ExoQLParser().parse(t),o=new zq.ExoQLAlgebraTranslator().translate(i);return new BP.ExoQLQueryExecutor(this.tripleStore).isAskQuery(o)?o:null}evaluateHostFunction(e,t,n){let i=this.hostFunctions.get(e);if(!i)return!0;let s=n?{...n,targetIRI:t}:{targetIRI:t};try{return i(s)}catch{return!1}}async evaluateSparqlAsk(e,t){try{let n=bd.TEMPORAL_TOKEN.test(e),i=n?_d.DateFormatter.toDateString(this.clock.now()):null,s=this.askCache.get(e);if(s===void 0||n&&s.day!==i){let l=this.compileAsk(e);if(!l)return!1;s={day:i,compiled:l},this.askCache.set(e,s)}let o=JSON.parse(JSON.stringify(s.compiled).replaceAll(bd.SENTINEL_IRI,t));return await new BP.ExoQLQueryExecutor(this.tripleStore).executeAsk(o)}catch{return!1}}substituteVariables(e,t){let n=this.clock.now(),i=n.toISOString(),s=n.getFullYear(),o=n.getMonth(),c=n.getDate(),l=n.getDay(),u=_d.DateFormatter.toDateString(n),f=_d.DateFormatter.toDateString(new Date(s,o,c-1)),d=(l+6)%7,p=_d.DateFormatter.toDateString(new Date(s,o,c-d)),h=_d.DateFormatter.toDateString(new Date(s,o,c-d-7)),_=`${s}-${String(o+1).padStart(2,"0")}-01`,y=o===0?11:o-1,w=`${o===0?s-1:s}-${String(y+1).padStart(2,"0")}-01`,T=`${s}-01-01`;return e.replace(/\$target\b/g,`<${t}>`).replace(/\$now\b/g,`"${i}"^^xsd:dateTime`).replace(/\$yesterday\b/g,`"${f}"^^xsd:date`).replace(/\$thisWeekStart\b/g,`"${p}"^^xsd:date`).replace(/\$lastWeekStart\b/g,`"${h}"^^xsd:date`).replace(/\$thisMonthStart\b/g,`"${_}"^^xsd:date`).replace(/\$lastMonthStart\b/g,`"${w}"^^xsd:date`).replace(/\$thisYearStart\b/g,`"${T}"^^xsd:date`).replace(/\$today\b/g,`"${u}"^^xsd:date`)}};Eo.PreconditionEvaluator=Sd;Sd.SENTINEL_IRI="urn:exocortex:cache-sentinel:target";Sd.TEMPORAL_TOKEN=/\$(?:now|today|yesterday|thisWeekStart|lastWeekStart|thisMonthStart|lastMonthStart|thisYearStart)\b/;Eo.PreconditionEvaluator=Sd=bd=qq([(0,Wq.injectable)(),Gq("design:paramtypes",[Object,Object,Object])],Sd)});var qP=E(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.hasUidFilename=vo.hasNonUidFilename=void 0;vo.registerDefaultHostFunctions=Jq;var Qq=a(r=>{let e=r.assetUid;if(typeof e!="string"||e.trim()==="")return!1;let t=r.fileBasename;return typeof t!="string"?!1:t!==e},"hasNonUidFilename");vo.hasNonUidFilename=Qq;var Xq=a(r=>{let e=r.assetUid;if(typeof e!="string"||e.trim()==="")return!1;let t=r.fileBasename;return typeof t!="string"?!1:t===e},"hasUidFilename");vo.hasUidFilename=Xq;function Jq(r){r.registerHostFunction("hasNonUidFilename",vo.hasNonUidFilename),r.registerHostFunction("hasUidFilename",vo.hasUidFilename)}a(Jq,"registerDefaultHostFunctions")});var Fg=E(Dg=>{"use strict";Object.defineProperty(Dg,"__esModule",{value:!0});Dg.liveUidGenerator=Zq;Dg.seededUidGenerator=tG;var tE=Di();function Zq(){return{next:a(()=>(0,tE.v4)(),"next")}}a(Zq,"liveUidGenerator");var eG="6ba7b810-9dad-11d1-80b4-00c04fd430c8";function tG(r){let e=0,t=(0,tE.v5)(r,eG);return{next:a(()=>{let n=`${r}#${e}`;return e+=1,(0,tE.v5)(n,t)},"next")}}a(tG,"seededUidGenerator")});var kg=E(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.registerResolver=fr;Aa.getResolver=nG;Aa.isResolverModifierAware=iG;Aa.getRegisteredResolverIds=sG;Aa.clearResolvers=oG;Aa.installDefaultResolvers=gG;var rG=on(),Ng=new Map,rE=new Set;function fr(r,e,t=!1){Ng.set(r,e),t&&rE.add(r)}a(fr,"registerResolver");function nG(r){return Ng.get(r)}a(nG,"getResolver");function iG(r){return rE.has(r)}a(iG,"isResolverModifierAware");function sG(){return Array.from(Ng.keys())}a(sG,"getRegisteredResolverIds");function oG(){Ng.clear(),rE.clear()}a(oG,"clearResolvers");function Xr(r){return r<10?`0${r}`:String(r)}a(Xr,"pad2");var aG=["January","February","March","April","May","June","July","August","September","October","November","December"],cG=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lG=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],uG=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function fG(r){let e=["th","st","nd","rd"],t=r%100;return`${r}${e[(t-20)%10]||e[t]||e[0]}`}a(fG,"ordinalDay");var dG=/YYYY|YY|MMMM|MMM|MM|M|Do|DD|D|dddd|ddd|HH|H|hh|h|mm|m|ss|s|A|a/g;function pG(r,e){let t=(r.getHours()+11)%12+1;return e.replace(dG,n=>{switch(n){case"YYYY":return String(r.getFullYear());case"YY":return Xr(r.getFullYear()%100);case"MMMM":return aG[r.getMonth()];case"MMM":return cG[r.getMonth()];case"MM":return Xr(r.getMonth()+1);case"M":return String(r.getMonth()+1);case"Do":return fG(r.getDate());case"DD":return Xr(r.getDate());case"D":return String(r.getDate());case"dddd":return lG[r.getDay()];case"ddd":return uG[r.getDay()];case"HH":return Xr(r.getHours());case"H":return String(r.getHours());case"hh":return Xr(t);case"h":return String(t);case"mm":return Xr(r.getMinutes());case"m":return String(r.getMinutes());case"ss":return Xr(r.getSeconds());case"s":return String(r.getSeconds());case"A":return r.getHours()<12?"AM":"PM";case"a":return r.getHours()<12?"am":"pm";default:return n}})}a(pG,"formatDate");function GP(r,e,t){let n=r.getDate(),i=new Date(r.getTime());i.setDate(1),t==="M"?i.setMonth(i.getMonth()+e):i.setFullYear(i.getFullYear()+e);let s=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();return i.setDate(Math.min(n,s)),i}a(GP,"addMonthsClamped");function hG(r,e){if(!e)return r;let t=e.match(/^([+-])(\d+)([dwMy])?$/);if(!t)return r;let n=(t[1]==="-"?-1:1)*parseInt(t[2],10),i=t[3]??"d",s=new Date(r.getTime());switch(i){case"d":s.setDate(s.getDate()+n);break;case"w":s.setDate(s.getDate()+n*7);break;case"M":s=GP(s,n,"M");break;case"y":s=GP(s,n,"y");break}return isNaN(s.getTime())?r:s}a(hG,"applyDateOffset");function mG(r){if(!r)return{offset:null,format:null};let e=r.indexOf(":");if(e<0)return{offset:r,format:null};let t=r.slice(0,e),n=r.slice(e+1);return{offset:t||null,format:n||null}}a(mG,"parseDateModifier");function Lg(r,e){return(t,n)=>{let{offset:i,format:s}=mG(n),o=new Date;return r!==0&&o.setDate(o.getDate()+r),o=hG(o,i),pG(o,s??e)}}a(Lg,"makeDateResolver");function gG(){fr("today",()=>{let r=new Date;return`${r.getFullYear()}-${Xr(r.getMonth()+1)}-${Xr(r.getDate())}`}),fr("todayStart",()=>rG.DateFormatter.getTodayStartTimestamp()),fr("date",Lg(0,"YYYY-MM-DD"),!0),fr("now",Lg(0,"YYYY-MM-DDTHH:mm:ss"),!0),fr("tomorrow",Lg(1,"YYYY-MM-DD"),!0),fr("yesterday",Lg(-1,"YYYY-MM-DD"),!0),fr("target",r=>r.targetIRI?`"[[${r.targetIRI}]]"`:""),fr("targetFolder",r=>{if(!r.targetFilePath)return"";let e=r.targetFilePath.replace(/^\/+/,""),t=e.lastIndexOf("/");return t>=0?e.slice(0,t):""}),fr("randomUUIDv4",()=>{if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();throw new Error("randomUUIDv4 resolver requires crypto.randomUUID() \u2014 runtime is missing Node crypto / Web Crypto API.")}),fr("nowTimestamp",()=>{let r=new Date;return`${r.getFullYear()}-${Xr(r.getMonth()+1)}-${Xr(r.getDate())}T${Xr(r.getHours())}:${Xr(r.getMinutes())}:${Xr(r.getSeconds())}`}),fr("nowDate",()=>{let r=new Date;return`${r.getFullYear()}-${Xr(r.getMonth()+1)}-${Xr(r.getDate())}`}),fr("nowYear",()=>String(new Date().getFullYear())),fr("nowMonth",()=>Xr(new Date().getMonth()+1)),fr("userInputLabel",r=>{let e=r.userInput?.label;return typeof e=="string"?e:""}),fr("userInput",(r,e)=>{if(!e)return null;let t=r.userInput?.[e];return typeof t=="string"?t:t==null?null:String(t)}),fr("targetProperty",(r,e)=>{if(!e||!r.targetFm)return null;let t=r.targetFm[e];return t==null?null:Array.isArray(t)?t.map(String):String(t)}),fr("labelAsArray",r=>{let e=r.userInput?.label;return typeof e=="string"&&e.length>0?[e]:[]}),fr("groundingTargetClass",r=>r.groundingTargetClassUid?`"[[${r.groundingTargetClassUid}]]"`:null),fr("targetClassSelf",r=>{if(!r.targetFilePath)return null;let e=r.targetFilePath.replace(/^\/+/,""),n=e.slice(e.lastIndexOf("/")+1).replace(/\.md$/i,"");return n.length>0?`"[[${n}]]"`:null})}a(gG,"installDefaultResolvers")});var iE=E(Mg=>{"use strict";Object.defineProperty(Mg,"__esModule",{value:!0});Mg.resolveTemplateBody=_G;Mg.stripTemplateFrontmatter=bG;var nE=kg();(0,nE.installDefaultResolvers)();var yG=/\$([A-Za-z][A-Za-z0-9_]*)((?:[+-]\d+[dwMy])?(?::[A-Za-z0-9:./-]+)?)/g;function _G(r,e={}){return r.replace(yG,(t,n,i)=>{let s=(0,nE.getResolver)(n);if(s===void 0)return t;let o=s(e,i.length>0?i:void 0);return typeof o!="string"||o.length===0?t:(0,nE.isResolverModifierAware)(n)?o:o+i})}a(_G,"resolveTemplateBody");function bG(r){let e=r.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return e?r.slice(e[0].length):r}a(bG,"stripTemplateFrontmatter")});var wd=E(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.registerOrderSpecLoader=SG;cu.clearOrderSpecLoader=wG;cu.loadDefaultSpec=EG;cu.orderProperties=vG;var jg=null,Ia,$g=!1;function SG(r){jg=r,Ia=void 0,$g=!1}a(SG,"registerOrderSpecLoader");function wG(){jg=null,Ia=void 0,$g=!1}a(wG,"clearOrderSpecLoader");function EG(){if(Ia!==void 0)return Ia;if(!jg)return Ia=null,null;try{Ia=jg()}catch(r){$g||(console.warn("[OrderSpecResolver] loader threw, falling back to insertion order:",r),$g=!0),Ia=null}return Ia}a(EG,"loadDefaultSpec");function vG(r,e){if(!e||e.head.length===0&&e.tail.length===0)return r;let t=Object.keys(r),n=new Set(e.head),i=new Set(e.tail),s=e.head.filter(u=>Object.prototype.hasOwnProperty.call(r,u)),o=e.tail.filter(u=>Object.prototype.hasOwnProperty.call(r,u)),c=t.filter(u=>!n.has(u)&&!i.has(u));e.middleStrategy==="alphabetical"&&c.sort((u,f)=>u.localeCompare(f));let l={};for(let u of s)l[u]=r[u];for(let u of c)l[u]=r[u];for(let u of o)l[u]=r[u];return l}a(vG,"orderProperties")});var Ed=E(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.STRING_SCALAR_PROPERTIES=void 0;Dc.needsYamlQuoting=WP;Dc.quoteYamlString=HP;Dc.serializeYamlScalar=FG;var TG=/^[-!&*?|>%@`"'#,[\]{}]/,AG=/[\u0000-\u001f\u007f]/,IG=/^(?:true|True|TRUE|false|False|FALSE)$/,xG=/^(?:null|Null|NULL|~)$/,RG=/^[-+]?(?:0b[01_]+|0o[0-7_]+|0x[0-9a-fA-F_]+|[0-9][0-9_]*)$/,CG=/^(?:[-+]?[0-9][0-9_]*(?:\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,OG=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;Dc.STRING_SCALAR_PROPERTIES=new Set(["exo__Asset_label","aliases"]);function PG(r){if(r.length<2||!r.startsWith('"')||!r.endsWith('"'))return!1;let e=r.slice(1,-1);for(let t=0;t<e.length;t++){if(e[t]==="\\"){if(t+1>=e.length)return!1;t++;continue}if(e[t]==='"')return!1}return!0}a(PG,"isCompleteDoubleQuotedScalar");function DG(r){return IG.test(r)||xG.test(r)||RG.test(r)||CG.test(r)||OG.test(r)}a(DG,"looksLikeNonStringScalar");function WP(r,e=!1){return r===""?!0:PG(r)?!1:!!(r!==r.trim()||/:(\s|$)/.test(r)||/\s#/.test(r)||TG.test(r)||AG.test(r)||e&&DG(r))}a(WP,"needsYamlQuoting");function HP(r){let e="";for(let t=0;t<r.length;t++){let n=r[t],i=r.charCodeAt(t);n==="\\"?e+="\\\\":n==='"'?e+='\\"':n===`
|
|
71
71
|
`?e+="\\n":n==="\r"?e+="\\r":n===" "?e+="\\t":i<32||i===127?e+="\\x"+i.toString(16).toUpperCase().padStart(2,"0"):e+=n}return`"${e}"`}a(HP,"quoteYamlString");function FG(r,e=!1){return typeof r!="string"?String(r):WP(r,e)?HP(r):r}a(FG,"serializeYamlScalar")});var Fs=E(Ug=>{"use strict";Object.defineProperty(Ug,"__esModule",{value:!0});Ug.FrontmatterService=void 0;var zP=wd(),sE=Ed(),vd=class r{static{a(this,"FrontmatterService")}parse(e){let t=e.match(r.FRONTMATTER_REGEX);return t?{exists:!0,content:t[1],originalContent:e}:{exists:!1,content:"",originalContent:e}}parseObject(e){let t=this.parse(e);if(!t.exists)return null;let n={},i=t.content.split(/\r?\n/),s=null,o=null,c=a(()=>{s!==null&&o!==null&&(n[s]=o),s=null,o=null},"flushArray");for(let l of i){let u=/^ {2}- (.*)$/.exec(l);if(u){s!==null&&o!==null&&o.push(u[1].trim());continue}c();let f=/^([^:\s][^:]*):\s*(.*)$/.exec(l);if(!f)continue;let d=f[1].trim(),p=f[2].trim();p===""?(s=d,o=[]):n[d]=p}return c(),n}updateProperty(e,t,n){t=r.normalizeIRI(t),typeof n=="string"&&(n=r.normalizeIRIValue(n));let i=this.parse(e),s=this.serializeValue(t,n);if(!i.exists)return`---
|
|
72
72
|
${s}
|
|
73
73
|
---
|
|
@@ -89,7 +89,7 @@ ${Object.entries(n).map(([c,l])=>this.serializeValue(c,l,!0)).join(`
|
|
|
89
89
|
${o}`}let s=n?(0,sE.serializeYamlScalar)(t,i):String(t);return`${e}: ${s}`}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}};Ug.FrontmatterService=vd;vd.FRONTMATTER_REGEX=/^---\n([\s\S]*?)\n---/;vd.IRI_PREFIX_MAP={"https://exocortex.my/ontology/ems#":"ems__","https://exocortex.my/ontology/exo#":"exo__","https://exocortex.my/ontology/exocmd#":"exocmd__","https://exocortex.my/ontology/ims#":"ims__","https://exocortex.my/ontology/ztlk#":"ztlk__","https://exocortex.my/ontology/ptms#":"ptms__","https://exocortex.my/ontology/lit#":"lit__","https://exocortex.my/ontology/inbox#":"inbox__","https://exocortex.my/ontology/pmbok#":"pmbok__"}});var xa=E(Bg=>{"use strict";Object.defineProperty(Bg,"__esModule",{value:!0});Bg.LoggingService=void 0;var Td=class{static{a(this,"LoggingService")}static setVerbose(e){this.isVerbose=e}static setDevelopmentMode(e){this.isDevelopment=e}static checkIsDevelopment(){return this.isDevelopment!==void 0?this.isDevelopment:typeof process<"u"?(this.isDevelopment=!1,this.isDevelopment):(this.isDevelopment=!1,this.isDevelopment)}static debug(e,t){this.isVerbose&&console.debug(`[Exocortex] ${e}`,t??"")}static info(e,t){console.log(`[Exocortex] ${e}`,t??"")}static warn(e,t){console.warn(`[Exocortex] ${e}`,t??"")}static error(e,t,n){let i=this.checkIsDevelopment(),s=n?` [${n}]`:"";if(i){let o=t?.stack?`
|
|
90
90
|
Stack trace:
|
|
91
91
|
${t.stack}`:"";console.error(`[Exocortex ERROR]${s} ${e}${o}`,t??"")}else{let o=t?.message?`
|
|
92
|
-
Details: ${t.message}`:"";console.error(`[Exocortex ERROR]${s} ${e}${o}`)}}};Bg.LoggingService=Td;Td.isVerbose=!1;Td.isDevelopment=void 0});var aE=E(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.CLASS_UID_TO_LABEL=void 0;var oE=hc();Vg.CLASS_UID_TO_LABEL=Object.freeze({"1b20a8f0-d745-4e93-91db-4531b3df120e":oE.AssetClass.TASK,"7db5eeff-718a-49b0-8d2b-39b084a356e3":oE.AssetClass.PROJECT,"1b0a5e34-dd7f-4ead-b43a-6c7c5a5ecaca":oE.AssetClass.MEETING})});var ZP=E(Jr=>{"use strict";var LG=Jr&&Jr.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},NG=Jr&&Jr.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},dr;Object.defineProperty(Jr,"__esModule",{value:!0});Jr.GroundingExecutor=Jr.ServiceRegistry=Jr.CLASS_UID_TO_LABEL=Jr.STATUS_UID_BY_ENUM=void 0;var kG=Ze(),MG=yd(),jG=Fg(),Wn=da(),$G=iE(),UG=xl(),Fc=El(),BG=Ke(),KP=Fs(),YP=Ed(),qg=on(),QP=dd(),To=xa();Jr.STATUS_UID_BY_ENUM={[Fc.EffortStatus.DRAFT]:"c42245d0-01de-4c35-bfcf-d910445ea28e",[Fc.EffortStatus.BACKLOG]:"753a44d5-846c-4b82-9196-4fd9a4d48777",[Fc.EffortStatus.ANALYSIS]:"cde3525c-57ea-4efc-b477-2e7e7ccd3a1e",[Fc.EffortStatus.TODO]:"6a0e933a-6653-46f4-95ae-ed7508177c73",[Fc.EffortStatus.DOING]:"027e78f4-6e16-4b36-b8fb-5510507d5745",[Fc.EffortStatus.DONE]:"7b9b3116-7c3c-438c-9618-94fe301320a6",[Fc.EffortStatus.TRASHED]:"5d14f18d-db2b-4847-9ac1-144cb93b2541"};var VG=Object.freeze(Object.fromEntries(Object.entries(Jr.STATUS_UID_BY_ENUM).map(([r,e])=>[e,r]))),qG=aE();Object.defineProperty(Jr,"CLASS_UID_TO_LABEL",{enumerable:!0,get:a(function(){return qG.CLASS_UID_TO_LABEL},"get")});var cE=kg();(0,cE.installDefaultResolvers)();function GG(r){if(r){if(r==="1b20a8f0-d745-4e93-91db-4531b3df120e")return"ems__Task";if(r==="7db5eeff-718a-49b0-8d2b-39b084a356e3")return"ems__Project";if(r==="ems__Task"||r==="ems__Project")return r}}a(GG,"resolveClassFlipTarget");var XP=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,WG=/^__SUBSTITUTE__([a-zA-Z][a-zA-Z0-9_]*)__[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}__$/,HG=/^__SUBSTITUTE_P__([a-zA-Z][a-zA-Z0-9_]*)__[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}__([A-Za-z0-9_-]*)__$/,Gg=class{static{a(this,"ServiceRegistry")}constructor(){this.services=new Map}register(e,t){this.services.set(e,t)}get(e){return this.services.get(e)}has(e){return this.services.has(e)}getRegisteredIds(){return Array.from(this.services.keys())}};Jr.ServiceRegistry=Gg;var JP=20,Wg=dr=class{static{a(this,"GroundingExecutor")}constructor(e,t,n,i,s){this.frontmatterService=new KP.FrontmatterService,this.fileReader=e,this.fileWriter=t,this.serviceRegistry=n,this.classLabelToUid=i,this.refToFolder=s?.refToFolder,this.workflowResolver=s?.workflowResolver,this.groundingLoader=s?.groundingLoader,this.templateLoader=s?.templateLoader,this.namedQueryRunner=s?.namedQueryRunner,this.clock=s?.clock??(0,MG.liveClock)(),this.uidGen=s?.uidGenerator??(0,jG.liveUidGenerator)()}async execute(e,t,n,i){try{switch(e.type){case Wn.GroundingType.PROPERTY_SET:return await this.executePropertySet(e,t,n,i);case Wn.GroundingType.PROPERTY_DELETE:return await this.executePropertyDelete(e,n);case Wn.GroundingType.COMPOSITE:return await this.executeComposite(e,t,n,i,0);case Wn.GroundingType.SERVICE_CALL:return await this.executeServiceCall(e,t,n,i);case Wn.GroundingType.CREATE_INSTANCE:return await this.executeCreateInstance(e,t,n,i);case Wn.GroundingType.PROPERTY_APPEND:return await this.executePropertyAppend(e,t,n,i);case Wn.GroundingType.PROPERTY_INCREMENT:return await this.executePropertyIncrement(e,n);case Wn.GroundingType.PROPERTY_SHIFT:return await this.executePropertyShift(e,n);case Wn.GroundingType.SPARQL_UPDATE:return{success:!1,error:"sparql_update grounding not yet implemented. Use property_set/property_delete instead."};case Wn.GroundingType.WORKFLOW_TRANSITION:return await this.executeWorkflowTransition(e,t,n,i);case Wn.GroundingType.BODY_TEMPLATE:return await this.executeBodyTemplate(e,t,n,i);default:return{success:!1,error:`Unknown grounding type: ${e.type}`}}}catch(s){return{success:!1,error:s instanceof Error?s.message:String(s)}}}async executePropertySet(e,t,n,i){if(!e.targetProperty)return{success:!1,error:"property_set requires targetProperty"};let s;if([e.targetValueRef!==void 0,e.targetValueLiteral!==void 0,e.targetValueSubstitution!==void 0,e.targetValueQuery!==void 0].filter(Boolean).length>1)return{success:!1,error:"property_set: more than one of targetValueRef/targetValueLiteral/targetValueSubstitution/targetValueQuery set (cardinality 0..1 each, mutually exclusive)"};if(e.targetValueRef!==void 0)s=`"[[${e.targetValueRef}]]"`;else if(e.targetValueLiteral!==void 0)s=e.targetValueLiteral;else if(e.targetValueSubstitution!==void 0)s=e.targetValueSubstitution;else if(e.targetValueQuery!==void 0){let w=await this.resolveTargetValueQuery(e.targetValueQuery,t);if(!w.success)return w;s=w.value}else return{success:!1,error:"property_set requires one of targetValueRef/targetValueLiteral/targetValueSubstitution/targetValueQuery"};let c=i??{},l=a(w=>w!=null,"isProvided"),u=[...s.matchAll(/\$input\.([A-Za-z_]\w*)/g)].map(w=>w[1]),f=/\$input\b(?!\.)/.test(s)||/\$value\b/.test(s),d=u.find(w=>!l(c[w]));if(d!==void 0||f&&!l(c.value))return{success:!1,error:`property_set: value template references an input that was not provided (${d!==void 0?`--input '{"${d}":...}'`:`--input '{"value":...}'`} required)`};let p=this.substituteVariables(s,t,i),h=KP.FrontmatterService.normalizeIRI(e.targetProperty),_=YP.STRING_SCALAR_PROPERTIES.has(h)?(0,YP.serializeYamlScalar)(p,!0):p,y=await this.fileReader.readFile(n),S=this.frontmatterService.updateProperty(y,e.targetProperty,_);return await this.fileWriter.updateFile(n,S),{success:!0}}async resolveTargetValueQuery(e,t){if(!this.namedQueryRunner)return{success:!1,error:"property_set targetValueQuery requires NamedQueryRunner injection (options.namedQueryRunner). Wire the plugin/CLI before using this value-source."};let n;try{n=await this.namedQueryRunner.runScalar(e,{currentAsset:t})}catch(s){return{success:!1,error:`property_set targetValueQuery: NamedQuery '${e}' failed \u2014 ${s instanceof Error?s.message:String(s)}`}}return n===null?{success:!1,error:`property_set targetValueQuery: NamedQuery '${e}' returned no scalar value (empty result set or non-scalar shape).`}:{success:!0,value:n.kind==="iri"?`"[[${n.value}]]"`:n.value}}async executePropertyDelete(e,t){if(!e.targetProperty)return{success:!1,error:"property_delete requires targetProperty"};let n=await this.fileReader.readFile(t),i=this.frontmatterService.removeProperty(n,e.targetProperty);return await this.fileWriter.updateFile(t,i),{success:!0}}async executeComposite(e,t,n,i,s){if(s>=JP)return{success:!1,error:`Composite grounding exceeded maximum depth of ${JP}`};let o=e.steps??[];if(o.length===0)return{success:!0};let c;try{c=await this.fileReader.readFile(n)}catch{}let l=[],u;try{for(let f=0;f<o.length;f++){let d=o[f],h=(d.type===Wn.GroundingType.BODY_TEMPLATE||d.targetsCreatedInstance===!0)&&u?u:n,_=await this.executeStep(d,t,h,i,s+1);if(!_.success)return await this.rollback(c,n,l),{success:!1,error:`Composite step ${f} failed: ${_.error}`};_.openPath&&(u=_.openPath),l.push(f)}return{success:!0}}catch(f){return await this.rollback(c,n,l),{success:!1,error:`Composite execution failed: ${f instanceof Error?f.message:String(f)}`}}}async executeServiceCall(e,t,n,i){let s=e.targetProperty;if(!s)return{success:!1,error:"service_call requires targetProperty as serviceId"};if(s==="convertToTask")return await this.executeConvertToTask(n);if(s==="updateProperty"){let l=GG(e.targetValueRef);if(l==="ems__Task")return await this.executeConvertToTask(n);if(l==="ems__Project")return await this.executeConvertToProject(n)}let o=this.serviceRegistry.get(s);if(!o)return{success:!1,error:`Service not found: "${s}". Registered services: ${this.serviceRegistry.getRegisteredIds().join(", ")||"none"}`};let c=i;if(e.isDefinedBy&&(c={isDefinedBy:e.isDefinedBy,...c??{}}),e.serviceCallPayload)try{let l=this.substituteVariables(e.serviceCallPayload,t,i),u=JSON.parse(l);typeof u=="object"&&u!==null&&(c={...u,...c??{}})}catch{}return await o.execute(t,c),{success:!0}}async executeConvertToTask(e){let t=await this.fileReader.readFile(e),n=await this.resolveClassRefToUid("ems__Task"),i=this.frontmatterService.updateProperty(t,"exo__Instance_class",`["[[${n}]]"]`);return await this.fileWriter.updateFile(e,i),{success:!0}}async executeConvertToProject(e){let t=await this.fileReader.readFile(e),n=await this.resolveClassRefToUid("ems__Project"),i=this.frontmatterService.updateProperty(t,"exo__Instance_class",`["[[${n}]]"]`);return await this.fileWriter.updateFile(e,i),{success:!0}}async executeBodyTemplate(e,t,n,i){let s=null;if(e.templateRef)if(this.templateLoader){if(s=await this.templateLoader(e.templateRef),s===null)return{success:!1,error:`body_template: templateRef "${e.templateRef}" did not resolve to a template body (asset missing or empty).`}}else{if(e.bodyTemplate===void 0)return{success:!1,error:`body_template: templateRef "${e.templateRef}" set but no TemplateLoaderPort is wired (and no inline bodyTemplate fallback).`};s=e.bodyTemplate}else if(e.bodyTemplate!==void 0)s=e.bodyTemplate;else return{success:!1,error:"body_template requires bodyTemplate or templateRef"};let o=(0,$G.resolveTemplateBody)(s,{userInput:i,targetIRI:t,targetFilePath:n}),c;try{c=await this.fileReader.readFile(n)}catch(u){return{success:!1,error:`body_template: failed to read target file "${n}": ${u instanceof Error?u.message:String(u)}`}}let l=dr.replaceBody(c,o);return await this.fileWriter.updateFile(n,l),{success:!0}}static replaceBody(e,t){let n=e.match(/^---\r?\n[\s\S]*?\r?\n---/);return n?`${n[0]}
|
|
92
|
+
Details: ${t.message}`:"";console.error(`[Exocortex ERROR]${s} ${e}${o}`)}}};Bg.LoggingService=Td;Td.isVerbose=!1;Td.isDevelopment=void 0});var aE=E(Vg=>{"use strict";Object.defineProperty(Vg,"__esModule",{value:!0});Vg.CLASS_UID_TO_LABEL=void 0;var oE=hc();Vg.CLASS_UID_TO_LABEL=Object.freeze({"1b20a8f0-d745-4e93-91db-4531b3df120e":oE.AssetClass.TASK,"7db5eeff-718a-49b0-8d2b-39b084a356e3":oE.AssetClass.PROJECT,"1b0a5e34-dd7f-4ead-b43a-6c7c5a5ecaca":oE.AssetClass.MEETING})});var ZP=E(Jr=>{"use strict";var LG=Jr&&Jr.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},NG=Jr&&Jr.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},dr;Object.defineProperty(Jr,"__esModule",{value:!0});Jr.GroundingExecutor=Jr.ServiceRegistry=Jr.CLASS_UID_TO_LABEL=Jr.STATUS_UID_BY_ENUM=void 0;var kG=Ze(),MG=yd(),jG=Fg(),Wn=da(),$G=iE(),UG=xl(),Fc=El(),BG=Ke(),KP=Fs(),YP=Ed(),qg=on(),QP=dd(),To=xa();Jr.STATUS_UID_BY_ENUM={[Fc.EffortStatus.DRAFT]:"c42245d0-01de-4c35-bfcf-d910445ea28e",[Fc.EffortStatus.BACKLOG]:"753a44d5-846c-4b82-9196-4fd9a4d48777",[Fc.EffortStatus.ANALYSIS]:"cde3525c-57ea-4efc-b477-2e7e7ccd3a1e",[Fc.EffortStatus.TODO]:"6a0e933a-6653-46f4-95ae-ed7508177c73",[Fc.EffortStatus.DOING]:"027e78f4-6e16-4b36-b8fb-5510507d5745",[Fc.EffortStatus.DONE]:"7b9b3116-7c3c-438c-9618-94fe301320a6",[Fc.EffortStatus.TRASHED]:"5d14f18d-db2b-4847-9ac1-144cb93b2541"};var VG=Object.freeze(Object.fromEntries(Object.entries(Jr.STATUS_UID_BY_ENUM).map(([r,e])=>[e,r]))),qG=aE();Object.defineProperty(Jr,"CLASS_UID_TO_LABEL",{enumerable:!0,get:a(function(){return qG.CLASS_UID_TO_LABEL},"get")});var cE=kg();(0,cE.installDefaultResolvers)();function GG(r){if(r){if(r==="1b20a8f0-d745-4e93-91db-4531b3df120e")return"ems__Task";if(r==="7db5eeff-718a-49b0-8d2b-39b084a356e3")return"ems__Project";if(r==="ems__Task"||r==="ems__Project")return r}}a(GG,"resolveClassFlipTarget");var XP=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,WG=/^__SUBSTITUTE__([a-zA-Z][a-zA-Z0-9_]*)__[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}__$/,HG=/^__SUBSTITUTE_P__([a-zA-Z][a-zA-Z0-9_]*)__[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}__([A-Za-z0-9_-]*)__$/,Gg=class{static{a(this,"ServiceRegistry")}constructor(){this.services=new Map}register(e,t){this.services.set(e,t)}get(e){return this.services.get(e)}has(e){return this.services.has(e)}getRegisteredIds(){return Array.from(this.services.keys())}};Jr.ServiceRegistry=Gg;var JP=20,Wg=dr=class{static{a(this,"GroundingExecutor")}constructor(e,t,n,i,s){this.frontmatterService=new KP.FrontmatterService,this.fileReader=e,this.fileWriter=t,this.serviceRegistry=n,this.classLabelToUid=i,this.refToFolder=s?.refToFolder,this.workflowResolver=s?.workflowResolver,this.groundingLoader=s?.groundingLoader,this.templateLoader=s?.templateLoader,this.namedQueryRunner=s?.namedQueryRunner,this.clock=s?.clock??(0,MG.liveClock)(),this.uidGen=s?.uidGenerator??(0,jG.liveUidGenerator)()}async execute(e,t,n,i){try{switch(e.type){case Wn.GroundingType.PROPERTY_SET:return await this.executePropertySet(e,t,n,i);case Wn.GroundingType.PROPERTY_DELETE:return await this.executePropertyDelete(e,n);case Wn.GroundingType.COMPOSITE:return await this.executeComposite(e,t,n,i,0);case Wn.GroundingType.SERVICE_CALL:return await this.executeServiceCall(e,t,n,i);case Wn.GroundingType.CREATE_INSTANCE:return await this.executeCreateInstance(e,t,n,i);case Wn.GroundingType.PROPERTY_APPEND:return await this.executePropertyAppend(e,t,n,i);case Wn.GroundingType.PROPERTY_INCREMENT:return await this.executePropertyIncrement(e,n);case Wn.GroundingType.PROPERTY_SHIFT:return await this.executePropertyShift(e,n);case Wn.GroundingType.SPARQL_UPDATE:return{success:!1,error:"sparql_update grounding not yet implemented. Use property_set/property_delete instead."};case Wn.GroundingType.WORKFLOW_TRANSITION:return await this.executeWorkflowTransition(e,t,n,i);case Wn.GroundingType.BODY_TEMPLATE:return await this.executeBodyTemplate(e,t,n,i);default:return{success:!1,error:`Unknown grounding type: ${e.type}`}}}catch(s){return{success:!1,error:s instanceof Error?s.message:String(s)}}}async executePropertySet(e,t,n,i){if(!e.targetProperty)return{success:!1,error:"property_set requires targetProperty"};let s;if([e.targetValueRef!==void 0,e.targetValueLiteral!==void 0,e.targetValueSubstitution!==void 0,e.targetValueQuery!==void 0].filter(Boolean).length>1)return{success:!1,error:"property_set: more than one of targetValueRef/targetValueLiteral/targetValueSubstitution/targetValueQuery set (cardinality 0..1 each, mutually exclusive)"};if(e.targetValueRef!==void 0)s=`"[[${e.targetValueRef}]]"`;else if(e.targetValueLiteral!==void 0)s=e.targetValueLiteral;else if(e.targetValueSubstitution!==void 0)s=e.targetValueSubstitution;else if(e.targetValueQuery!==void 0){let w=await this.resolveTargetValueQuery(e.targetValueQuery,t);if(!w.success)return w;s=w.value}else return{success:!1,error:"property_set requires one of targetValueRef/targetValueLiteral/targetValueSubstitution/targetValueQuery"};let c=i??{},l=a(w=>w!=null,"isProvided"),u=[...s.matchAll(/\$input\.([A-Za-z_]\w*)/g)].map(w=>w[1]),f=/\$input\b(?!\.)/.test(s)||/\$value\b/.test(s),d=u.find(w=>!l(c[w]));if(d!==void 0||f&&!l(c.value))return{success:!1,error:`property_set: value template references an input that was not provided (${d!==void 0?`--input '{"${d}":...}'`:`--input '{"value":...}'`} required)`};let p=this.substituteVariables(s,t,i),h=KP.FrontmatterService.normalizeIRI(e.targetProperty),_=YP.STRING_SCALAR_PROPERTIES.has(h)?(0,YP.serializeYamlScalar)(p,!0):p,y=await this.fileReader.readFile(n),S=this.frontmatterService.updateProperty(y,e.targetProperty,_);return await this.fileWriter.updateFile(n,S),{success:!0}}async resolveTargetValueQuery(e,t){if(!this.namedQueryRunner)return{success:!1,error:"property_set targetValueQuery requires NamedQueryRunner injection (options.namedQueryRunner). Wire the plugin/CLI before using this value-source."};let n;try{n=await this.namedQueryRunner.runScalar(e,{currentAsset:t})}catch(s){return{success:!1,error:`property_set targetValueQuery: NamedQuery '${e}' failed \u2014 ${s instanceof Error?s.message:String(s)}`}}return n===null?{success:!1,error:`property_set targetValueQuery: NamedQuery '${e}' returned no scalar value (empty result set or non-scalar shape).`}:{success:!0,value:n.kind==="iri"?`"[[${n.value}]]"`:n.value}}async executePropertyDelete(e,t){if(!e.targetProperty)return{success:!1,error:"property_delete requires targetProperty"};let n=await this.fileReader.readFile(t),i=this.frontmatterService.removeProperty(n,e.targetProperty);return await this.fileWriter.updateFile(t,i),{success:!0}}async executeComposite(e,t,n,i,s){if(s>=JP)return{success:!1,error:`Composite grounding exceeded maximum depth of ${JP}`};let o=e.steps??[];if(o.length===0)return{success:!0};let c;try{c=await this.fileReader.readFile(n)}catch{}let l=[],u,f=[];try{for(let d=0;d<o.length;d++){let p=o[d],_=(p.type===Wn.GroundingType.BODY_TEMPLATE||p.targetsCreatedInstance===!0)&&u?u:n,y=await this.executeStep(p,t,_,i,s+1);if(!y.success)return await this.rollback(c,n,l),{success:!1,error:`Composite step ${d} failed: ${y.error}`};y.openPath&&(u=y.openPath),y.openPath&&f.push(y.openPath),y.createdPaths&&y.createdPaths.length>0&&f.push(...y.createdPaths),l.push(d)}return{success:!0,...f.length>0?{createdPaths:f}:{}}}catch(d){return await this.rollback(c,n,l),{success:!1,error:`Composite execution failed: ${d instanceof Error?d.message:String(d)}`}}}async executeServiceCall(e,t,n,i){let s=e.targetProperty;if(!s)return{success:!1,error:"service_call requires targetProperty as serviceId"};if(s==="convertToTask")return await this.executeConvertToTask(n);if(s==="updateProperty"){let l=GG(e.targetValueRef);if(l==="ems__Task")return await this.executeConvertToTask(n);if(l==="ems__Project")return await this.executeConvertToProject(n)}let o=this.serviceRegistry.get(s);if(!o)return{success:!1,error:`Service not found: "${s}". Registered services: ${this.serviceRegistry.getRegisteredIds().join(", ")||"none"}`};let c=i;if(e.isDefinedBy&&(c={isDefinedBy:e.isDefinedBy,...c??{}}),e.serviceCallPayload)try{let l=this.substituteVariables(e.serviceCallPayload,t,i),u=JSON.parse(l);typeof u=="object"&&u!==null&&(c={...u,...c??{}})}catch{}return await o.execute(t,c),{success:!0}}async executeConvertToTask(e){let t=await this.fileReader.readFile(e),n=await this.resolveClassRefToUid("ems__Task"),i=this.frontmatterService.updateProperty(t,"exo__Instance_class",`["[[${n}]]"]`);return await this.fileWriter.updateFile(e,i),{success:!0}}async executeConvertToProject(e){let t=await this.fileReader.readFile(e),n=await this.resolveClassRefToUid("ems__Project"),i=this.frontmatterService.updateProperty(t,"exo__Instance_class",`["[[${n}]]"]`);return await this.fileWriter.updateFile(e,i),{success:!0}}async executeBodyTemplate(e,t,n,i){let s=null;if(e.templateRef)if(this.templateLoader){if(s=await this.templateLoader(e.templateRef),s===null)return{success:!1,error:`body_template: templateRef "${e.templateRef}" did not resolve to a template body (asset missing or empty).`}}else{if(e.bodyTemplate===void 0)return{success:!1,error:`body_template: templateRef "${e.templateRef}" set but no TemplateLoaderPort is wired (and no inline bodyTemplate fallback).`};s=e.bodyTemplate}else if(e.bodyTemplate!==void 0)s=e.bodyTemplate;else return{success:!1,error:"body_template requires bodyTemplate or templateRef"};let o=(0,$G.resolveTemplateBody)(s,{userInput:i,targetIRI:t,targetFilePath:n}),c;try{c=await this.fileReader.readFile(n)}catch(u){return{success:!1,error:`body_template: failed to read target file "${n}": ${u instanceof Error?u.message:String(u)}`}}let l=dr.replaceBody(c,o);return await this.fileWriter.updateFile(n,l),{success:!0}}static replaceBody(e,t){let n=e.match(/^---\r?\n[\s\S]*?\r?\n---/);return n?`${n[0]}
|
|
93
93
|
${t}`:t}static extractBody(e){let t=e.match(/^---\r?\n[\s\S]*?\r?\n---/);return t?e.slice(t[0].length).replace(/^\r?\n/,""):e}async executeCreateInstance(e,t,n,i){if(!e.targetFolder)return{success:!1,error:"create_instance requires targetFolder"};let s={},o=null,c=null;if((e.inheritanceRule&&e.inheritanceRule.length>0||e.propertyDefault&&e.propertyDefault.some(T=>typeof T.value=="string"&&T.value.includes("__SUBSTITUTE"))||e.labelTemplate!==void 0&&/\$target\./.test(e.labelTemplate)||e.cloneTargetBody===!0)&&t&&n){let T;try{T=await this.fileReader.readFile(n)}catch(O){return{success:!1,error:`create_instance: failed to read $target file "${n}": ${O instanceof Error?O.message:String(O)}`}}o=this.frontmatterService.parseObject(T)??null,e.cloneTargetBody&&(c=dr.extractBody(T))}let u;e.targetClass&&(u=await this.resolveClassRefToUid(e.targetClass));let f={userInput:i,targetIRI:t,targetFilePath:n,targetFm:o??void 0,groundingTargetClassUid:u};if(e.propertyDefault&&e.propertyDefault.length>0&&this.applyPropertyDefaultStep(s,e.propertyDefault,f),this.applyMissingScalarPrimitives(s,i,u,e,t,o,n),i)for(let[T,O]of Object.entries(i))T!=="label"&&T!=="body"&&T!=="plannedDate"&&O!=null&&(s[T]=O);if(e.inheritanceRule&&e.inheritanceRule.length>0&&o&&await this.applyInheritanceRuleStep(s,e.inheritanceRule,o),this.applyMissingBacklinkTopUp(s,e,t,n),t&&e.linkBackProperty&&s[e.linkBackProperty]===void 0){let T=dr.extractBacklinkTarget(t,n);s[e.linkBackProperty]=`"[[${T}]]"`}this.applyPrototypeTimePropagation(s,o,i);let d=s.exo__Asset_uid,p=this.frontmatterService.createFrontmatter("",s),h=e.targetFolder.includes("$isDefinedByFolder")?await this.resolveIsDefinedByFolder(s,n):this.substituteVariables(e.targetFolder,t,i,void 0,n),_=h?`${h}/${d}.md`:`${d}.md`,y=i?.body,S=typeof y=="string"&&y.length>0?y:e.cloneTargetBody&&typeof c=="string"&&c.length>0?c:null,w=S!==null?dr.replaceBody(p,S):p;return await this.fileWriter.createFile(_,w),{success:!0,openPath:_}}resolveInstanceDate(e,t){let n=dr.firstScalar(e?.plannedDate);return n&&/^\d{4}-\d{2}-\d{2}$/.test(n)?n:qg.DateFormatter.toDateString(t??this.clock.now())}applyPrototypeTimePropagation(e,t,n){if(!t)return;let i=dr.firstScalar(t.ems__EffortPrototype_startTime);if(!i)return;let s=this.resolveInstanceDate(n);if(e.ems__Effort_plannedStartTimestamp===void 0){let c=dr.combineDateAndTime(s,i);c!==null?e.ems__Effort_plannedStartTimestamp=c:To.LoggingService.warn(`[GroundingExecutor] prototype ems__EffortPrototype_startTime "${i}" is not a valid HH:MM[:SS] time-of-day \u2014 skipping plannedStartTimestamp stamp.`)}let o=dr.firstScalar(t.ems__EffortPrototype_endTime);if(o&&e.ems__Effort_plannedEndTimestamp===void 0){let c=dr.combineDateAndTime(s,o);c!==null?e.ems__Effort_plannedEndTimestamp=c:To.LoggingService.warn(`[GroundingExecutor] prototype ems__EffortPrototype_endTime "${o}" is not a valid HH:MM[:SS] time-of-day \u2014 skipping plannedEndTimestamp stamp.`)}}static firstScalar(e){if(e==null)return null;let t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return null;let n=t.trim().replace(/^["'](.*)["']$/,"$1").trim();return n.length>0?n:null}static combineDateAndTime(e,t){if(!/^([01]\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/.test(t))return null;let n=/^\d{2}:\d{2}$/.test(t)?`${t}:00`:t;return`${e}T${n}`}async resolveIsDefinedByFolder(e,t){let n=dr.parentFolderOf(t),i=e.exo__Asset_isDefinedBy,s=dr.extractBareRef(i);if(s&&this.refToFolder)try{let o=await this.refToFolder(s);if(o!=null)return o}catch(o){To.LoggingService.error(`[GroundingExecutor] $isDefinedByFolder resolution failed for ref "${s}" \u2014 falling back to host folder.`,o instanceof Error?o:new Error(String(o)))}return n}static parentFolderOf(e){let t=e.replace(/^\/+/,""),n=t.lastIndexOf("/");return n>=0?t.slice(0,n):""}static extractBareRef(e){if(typeof e!="string")return null;let t=e.trim();t=t.replace(/^["']|["']$/g,"").trim(),t=t.replace(/^\[\[/,"").replace(/\]\]$/,"");let n=t.indexOf("|");return n>=0&&(t=t.slice(0,n)),t=t.trim(),t.length>0?t:null}async resolveClassRefToUid(e){if(XP.test(e)||!this.classLabelToUid)return e;try{let t=await this.classLabelToUid(e);return t&&t.length>0?t:e}catch{return e}}applyPropertyDefaultStep(e,t,n){for(let{propertyName:i,value:s}of t){if(e[i]!==void 0)continue;let o=this.resolveSubstitutionMarker(s,n);if(o!=null){if(Array.isArray(o)){if(o.length===0)continue;e[i]=o;continue}if(i==="exo__Instance_class"&&typeof o=="string"){e[i]=[o];continue}e[i]=o}}}applyMissingScalarPrimitives(e,t,n,i,s,o,c){let l=[];e.exo__Asset_uid===void 0&&(e.exo__Asset_uid=this.uidGen.next(),l.push("exo__Asset_uid")),e.exo__Asset_createdAt===void 0&&(e.exo__Asset_createdAt=qg.DateFormatter.toLocalTimestamp(this.clock.now()),l.push("exo__Asset_createdAt")),e.exo__Asset_updatedAt===void 0&&(e.exo__Asset_updatedAt=e.exo__Asset_createdAt);let u=typeof e.exo__Asset_label=="string"&&e.exo__Asset_label.trim().length===0;if(e.exo__Asset_label===void 0||u){let f=t?.label;if(f===void 0&&i?.labelTemplate)try{let p=this.substituteVariables(i.labelTemplate,s??"",t,o??void 0,c);p.trim().length>0&&(f=p)}catch(p){To.LoggingService.error(`[GroundingExecutor] labelTemplate substitution failed: ${p instanceof Error?p.message:String(p)}. Falling back to "Untitled".`)}let d=f!==void 0&&f.trim().length>0?f:"Untitled";e.exo__Asset_label=d,d!=="Untitled"&&e.aliases===void 0&&(e.aliases=[d]),d==="Untitled"&&l.push("exo__Asset_label")}e.exo__Instance_class===void 0&&n&&(e.exo__Instance_class=[`"[[${n}]]"`],l.push("exo__Instance_class")),l.length>0&&To.LoggingService.error(`[GroundingExecutor] Universal Default Template did not cover essential scalar primitives: ${l.join(", ")}. Filled from legacy TS fallback. Vault may be in an unhealthy state \u2014 verify UniversalDefaultTemplate singleton is present and complete.`)}applyMissingBacklinkTopUp(e,t,n,i){if(!n||t.linkBackProperty||e.exo__Asset_prototype!==void 0||e.ems__Effort_parent!==void 0)return;let s=dr.extractBacklinkTarget(n,i);dr.propertiesReferenceTarget(e,s)||(e.exo__Asset_prototype=`"[[${s}]]"`,To.LoggingService.error("[GroundingExecutor] No backlink rule fired (Universal IRs absent or no class match). Falling back to legacy exo__Asset_prototype default. Bug #5 may surface if target is not a prototype-instance."))}static propertiesReferenceTarget(e,t){if(!t)return!1;let n=`[[${t}]]`,i=a(s=>typeof s=="string"&&s.includes(n),"refs");for(let s of Object.values(e))if(i(s)||Array.isArray(s)&&s.some(i))return!0;return!1}resolveSubstitutionMarker(e,t){let n=e.match(HG);if(n){let c=n[1],l=n[2],u=dr.decodeBase64UrlSafe(l),f=(0,cE.getResolver)(c);return f?f(t,u):(To.LoggingService.warn(`[GroundingExecutor] Parameterised marker references unknown resolver '${c}' \u2014 value left as marker.`),e)}let i=e.match(WG);if(!i)return e;let s=i[1];if(s==="target"){let c=t.targetIRI??"",l=t.targetFilePath??"";return`"[[${dr.extractBacklinkTarget(c,l)}]]"`}if(s==="targetFolder"){let c=t.targetFilePath??"";if(!c)return"";let l=c.replace(/^\/+/,""),u=l.lastIndexOf("/");return u>=0?l.slice(0,u):""}let o=(0,cE.getResolver)(s);return o?o(t):(To.LoggingService.warn(`[GroundingExecutor] Marker references unknown resolver '${s}' \u2014 value left as marker.`),e)}static decodeBase64UrlSafe(e){return(0,UG.base64ToUtf8)(e.replace(/-/g,"+").replace(/_/g,"/"))}async applyInheritanceRuleStep(e,t,n){let i=this.extractTargetClassNames(n),s=[];for(let o of t)!await this.inheritanceConditionMatches(o.targetClassCondition,o.targetClassConditionUid,i)||await this.inheritanceExclusionMatches(o.targetClassExclusion,o.targetClassExclusionUids,i)||s.push(o);s.sort((o,c)=>c.priority-o.priority);for(let o of s){if(e[o.targetPropertyName]!==void 0)continue;let c=n[o.sourcePropertyName];c!=null&&(e[o.targetPropertyName]=this.formatInheritedValue(c))}}async inheritanceConditionMatches(e,t,n){return!e&&!t?!0:this.classRefMatchesAny(e,t,n)}async inheritanceExclusionMatches(e,t,n){for(let i of t??[])if(i&&n.includes(i))return!0;for(let i of e)if(await this.classRefMatchesAny(i,void 0,n))return!0;return!1}async classRefMatchesAny(e,t,n){if(t&&n.includes(t)||e&&n.includes(e))return!0;if(e&&this.classLabelToUid)try{let i=await this.classLabelToUid(e);if(i&&i.length>0&&n.includes(i))return!0}catch{}return!1}extractTargetClassNames(e){let t=e.exo__Instance_class;if(t==null)return[];let n=Array.isArray(t)?t:[t],i=[];for(let s of n){let o=this.extractWikilinkInner(String(s));o&&i.push(o)}return i}extractWikilinkInner(e){let t=e.match(/\[\[([^\]|]+)(?:\|[^\]]*)?\]\]/);return t?t[1].trim():e.replace(/^["']|["']$/g,"").trim()}formatInheritedValue(e){return Array.isArray(e)?e.map(t=>this.formatInheritedScalar(String(t))):this.formatInheritedScalar(String(e))}formatInheritedScalar(e){return/^"?\[\[.+\]\]"?$/.test(e)?this.reformatWikilink(e):XP.test(e)?`"[[${e}]]"`:e}reformatWikilink(e){return e.startsWith('"[[')&&e.endsWith(']]"')?e:e.startsWith("[[")&&e.endsWith("]]")?`"${e}"`:e}async executeStep(e,t,n,i,s){return e.type===Wn.GroundingType.COMPOSITE?this.executeComposite(e,t,n,i,s):this.execute(e,t,n,i)}async rollback(e,t,n){if(e!==void 0)try{await this.fileWriter.updateFile(t,e)}catch(i){To.LoggingService.error(`[GroundingExecutor] Rollback failed for ${t}`,i instanceof Error?i:new Error(String(i)))}}substituteVariables(e,t,n,i,s){let o=this.clock.now(),c=o.toISOString(),l=qg.DateFormatter.toLocalTimestamp(o),u=this.resolveInstanceDate(n,o),f=`${u}T00:00:00`,d=`${l.slice(0,10)}-${l.slice(11,13)}-${l.slice(14,16)}`,p=e.replace(/\$target\.([A-Za-z_][\w]*)/g,(h,_)=>{if(!i)throw new Error(`$target.${_} substitution requires target frontmatter context; none was supplied (asset IRI: ${t})`);let y=i[_];if(y==null)throw new Error(`$target.${_} is undefined on asset ${t}`);if(Array.isArray(y))throw new Error(`$target.${_} resolved to an array on asset ${t}; only scalar properties are supported for substitution`);return String(y).replace(/^["'](.*)["']$/,"$1")});if(/\$targetFolder\b/.test(p)){if(!s)throw new Error("$targetFolder substitution requires targetFilePath context; none was supplied (asset IRI: "+t+")");let h=s.replace(/^\/+/,""),_=h.lastIndexOf("/"),y=_>=0?h.slice(0,_):"";p=p.replace(/\$targetFolder\b/g,y)}if(p=p.replace(/\$target/g,t).replace(/\$nowCompact\b/g,d).replace(/\$nowLocal/g,l).replace(/\$now/g,c).replace(/\$todayStart\b/g,f).replace(/\$today/g,u),n){let h=n;p=p.replace(/\$input\.([A-Za-z_]\w*)|\$(?:input|value)\b/g,(_,y)=>{let S=y!==void 0?h[y]:h.value;return S==null?_:String(S)})}return p}async executePropertyAppend(e,t,n,i){if(!e.targetProperty)return{success:!1,error:"property_append requires targetProperty"};if(e.appendExpression===void 0)return{success:!1,error:"property_append requires appendExpression"};let s=await this.fileReader.readFile(n),o=this.frontmatterService.parseObject(s)??{},c=this.substituteVariables(e.appendExpression,t,i,o),l=o[e.targetProperty],u=Array.isArray(l)?l:l!==void 0?[String(l)]:[],f=a(_=>_.replace(/^["'](.*)["']$/,"$1"),"stripQuotes"),d=new Set(u.map(f)),p;if(d.has(f(c)))p=u;else{let _=`"${f(c)}"`;p=[...u,_]}let h=this.frontmatterService.updateProperty(s,e.targetProperty,p);return await this.fileWriter.updateFile(n,h),{success:!0}}async executePropertyIncrement(e,t){if(!e.targetProperty)return{success:!1,error:"property_increment requires targetProperty"};let n=e.incrementBy??1;if(!Number.isFinite(n)||!Number.isInteger(n))return{success:!1,error:`property_increment: incrementBy must be an integer (got ${String(e.incrementBy)})`};let i=await this.fileReader.readFile(t),o=(this.frontmatterService.parseObject(i)??{})[e.targetProperty],c;if(o==null||o==="")c=0;else{if(Array.isArray(o))return{success:!1,error:`property_increment: targetProperty "${e.targetProperty}" is an array, expected integer`};{let f=String(o).replace(/^["'](.*)["']$/,"$1").trim();if(!/^-?\d+$/.test(f))return{success:!1,error:`property_increment: targetProperty "${e.targetProperty}" current value "${String(o)}" is not a valid integer`};c=Number.parseInt(f,10)}}let l=c+n,u=this.frontmatterService.updateProperty(i,e.targetProperty,l);return await this.fileWriter.updateFile(t,u),{success:!0}}async executePropertyShift(e,t){if(!e.targetProperty)return{success:!1,error:"property_shift requires targetProperty"};if(!e.shiftDelta)return{success:!1,error:"property_shift requires shiftDelta (ISO-8601 duration literal)"};let n=await this.fileReader.readFile(t),s=(this.frontmatterService.parseObject(n)??{})[e.targetProperty];if(s==null||s==="")return{success:!1,error:`property_shift: targetProperty "${e.targetProperty}" is not set on target asset`};if(Array.isArray(s))return{success:!1,error:`property_shift: targetProperty "${e.targetProperty}" is an array, expected single datetime`};let o=String(s).replace(/^["'](.*)["']$/,"$1").trim(),c=new Date(o);if(Number.isNaN(c.getTime()))return{success:!1,error:`property_shift: current value "${o}" is not a valid datetime`};let l;try{l=dr.applyIsoDuration(c,e.shiftDelta)}catch(d){return{success:!1,error:`property_shift: invalid shiftDelta "${e.shiftDelta}": ${d instanceof Error?d.message:String(d)}`}}let u=qg.DateFormatter.toLocalTimestamp(l),f=this.frontmatterService.updateProperty(n,e.targetProperty,u);return await this.fileWriter.updateFile(t,f),{success:!0}}async executeWorkflowTransition(e,t,n,i){if(!this.workflowResolver)return{success:!1,error:"workflow_transition requires WorkflowResolver injection (options.workflowResolver). Wire the plugin/CLI before using this grounding type."};let s=await this.fileReader.readFile(n),o=this.frontmatterService.parseObject(s)??{},c=this.resolveClassRefsFromFrontmatter(o);if(c.length===0)return{success:!1,notApplicable:!0,error:"workflow_transition: target asset has no exo__Instance_class \u2014 status transitions are not available for it."};let l;try{l=new BG.IRI(t)}catch(O){return{success:!1,error:`workflow_transition: invalid targetIRI "${t}" \u2014 ${O instanceof Error?O.message:String(O)}`}}let u=await this.workflowResolver.resolveForAssetOrNull(l,c);if(!u)return{success:!1,notApplicable:!0,error:"workflow_transition: this asset's class has no status workflow \u2014 status transitions are not available for it."};let f=this.resolveStatusFromFrontmatter(o);if(!f)return{success:!1,error:"workflow_transition: target asset has no parseable ems__Effort_status value (need wikilink to an ems__EffortStatus* asset)."};let d=e.direction??"forward",p=d==="rollback",h=u.transitions.find(O=>O.from===f&&O.isRollback===p);if(!h)return{success:!1,error:`workflow_transition: no ${d} transition from "${f}" defined in workflow "${u.name}" (target class: ${u.targetClass}).`};let _=Jr.STATUS_UID_BY_ENUM[h.to];if(!_)return{success:!1,error:`workflow_transition: no UID mapping for destination status "${h.to}" (transition target unreachable).`};let y={id:`${e.id}.statusMutation`,label:`workflow_transition: ${h.from} \u2192 ${h.to}`,type:Wn.GroundingType.PROPERTY_SET,targetProperty:"ems__Effort_status",targetValueRef:_},S=await this.executePropertySet(y,t,n,i);if(!S.success)return{success:!1,error:`workflow_transition: status mutation failed \u2014 ${S.error}`};let w=h.postActions??[],T=this.groundingLoader;if(w.length>0&&T===void 0)return{success:!1,error:"workflow_transition: transition has postActions but no GroundingLoader injected (options.groundingLoader). Wire commandResolver.loadGroundingByUid in plugin/CLI."};for(let O of w){if(T===void 0)break;let A=await T(O);if(!A)return{success:!1,error:`workflow_transition: postAction grounding UID "${O}" could not be loaded (asset missing or invalid Grounding shape).`};let x=await this.execute(A,t,n,i);if(!x.success)return{success:!1,error:`workflow_transition: postAction "${A.label}" (UID ${O}) failed \u2014 ${x.error}`}}return{success:!0}}resolveClassRefsFromFrontmatter(e){let t=e.exo__Instance_class;if(t==null)return[];let n=Array.isArray(t)?t:[t],i=[];for(let s of n){if(typeof s!="string")continue;let o=s.replace(/^\s*"?\[\[/,"").replace(/\]\]"?\s*$/,"").trim();o.length>0&&i.push(o)}return i}resolveStatusFromFrontmatter(e){let t=e.ems__Effort_status;if(t==null)return null;if(Array.isArray(t)){if(t.length!==1)return null;t=t[0]}let i=String(t).trim().replace(/^["']/,"").replace(/["']$/,"").replace(/^\[\[/,"").replace(/\]\]$/,"");if(/^ems__EffortStatus[A-Za-z]+$/.test(i))return i;if(i.includes("|")){let o=i.split("|")[1].trim();if(/^ems__EffortStatus[A-Za-z]+$/.test(o))return o}let s=i.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(s){let o=VG[s[1].toLowerCase()];if(o)return o}return null}static applyIsoDuration(e,t){let n=t.trim();if(/^-?P(\d+Y)(\d+M)?$|^-?P\d+M$/.test(n)){let o=QP.DateTimeParsing.parseYearMonthDuration(n),c=new Date(e.getTime());return c.setMonth(c.getMonth()+o),c}let s=QP.DateTimeParsing.parseDayTimeDuration(n);return new Date(e.getTime()+s)}static extractBacklinkTarget(e,t){let n=dr.resolveTargetPath(e,t),i=n.split("/").pop()??n;return dr.UUID_BASENAME_RE.test(i)?i:n}static resolveTargetPath(e,t){if(t)return t.replace(/\.md$/i,"").replace(/^\/+/,"");if(e){let n=e.match(/^obsidian:\/\/vault\/(.+?)(?:\.md)?(?:\?|#|$)/i);if(n&&n[1])try{return decodeURIComponent(n[1])}catch{return n[1]}}return e}};Jr.GroundingExecutor=Wg;Wg.UUID_BASENAME_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;Jr.GroundingExecutor=Wg=dr=LG([(0,kG.injectable)(),NG("design:paramtypes",[Object,Object,Gg,Function,Object])],Wg)});var e3=E(lE=>{"use strict";Object.defineProperty(lE,"__esModule",{value:!0});lE.createVaultFrontmatterClassLabelResolver=zG;function zG(r){return async e=>{if(!e)return null;let t=await r.findFilesByMetadata({exo__Asset_label:e});if(t.length>0){let s=(await r.getFileMetadata(t[0])).exo__Asset_uid;if(typeof s=="string"&&s.length>0)return s}let n=await r.findFilesByMetadata({aliases:e});if(n.length>0){let s=(await r.getFileMetadata(n[0])).exo__Asset_uid;if(typeof s=="string"&&s.length>0)return s}return null}}a(zG,"createVaultFrontmatterClassLabelResolver")});var t3=E(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});uE.createVaultFrontmatterRefToFolderResolver=KG;function KG(r){return async e=>{if(!e)return null;let t=await r.findFilesByMetadata({exo__Asset_uid:e});return t.length===0?null:YG(t[0])}}a(KG,"createVaultFrontmatterRefToFolderResolver");function YG(r){let e=r.replace(/^\/+/,""),t=e.lastIndexOf("/");return t>=0?e.slice(0,t):""}a(YG,"parentFolderOf")});var n3=E(Ao=>{"use strict";var QG=Ao&&Ao.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},XG=Ao&&Ao.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},lu;Object.defineProperty(Ao,"__esModule",{value:!0});Ao.NamedQueryRunner=void 0;var JG=Ze(),ZG=Ke(),eW=tt(),r3=Cg(),tW=od(),fE=lu=class{static{a(this,"NamedQueryRunner")}constructor(e,t){this.queryBodyResolver=e,this.tripleStore=t}async run(e,t={}){if(!e)return null;let n=await this.queryBodyResolver.resolveSparql(e);if(!n)return null;let i=this.substitute(n,t);return(0,r3.evaluateWithExoEval)(i,{store:this.tripleStore})}async runScalar(e,t={},n){if(!e)throw new Error("NamedQueryRunner.runScalar: empty queryUid");let i=await this.queryBodyResolver.resolveSparql(e);if(!i)throw new Error(`NamedQueryRunner: query__NamedQuery '${e}' has no resolvable SPARQL body (asset missing or no \`\`\`sparql block).`);let s=this.substitute(i,t),o=await(0,r3.evaluateWithExoEval)(s,{store:this.tripleStore});if(o.kind==="ask")return{value:o.result?"true":"false",kind:"literal"};if(o.kind==="construct")return null;let c=o.rows[0];if(!c)return null;let l=c.variables(),u=n??l[0];if(!u)return null;let f=c.get(u);return f===void 0?null:f instanceof ZG.IRI?{value:(0,tW.iriToObsidianName)(f.value)??f.value,kind:"iri"}:f instanceof eW.Literal?{value:f.value,kind:"literal"}:null}substitute(e,t){let n=e;t.currentAsset&&(n=n.replace(/\$currentAsset\b/g,lu.formatIri(t.currentAsset))),t.currentClass&&(n=n.replace(/\$currentClass\b/g,lu.formatIri(t.currentClass)));let i=t.params;if(i){let s=Object.keys(i).sort((o,c)=>c.length-o.length);for(let o of s){let c=i[o],l=c.kind==="iri"?lu.formatIri(c.value):`"${lu.escapeLiteral(c.value)}"`,u=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(`\\$${u}\\b`,"g"),l)}}return n}static formatIri(e){if(/[\s<>"{}|\\^`]/.test(e))throw new Error(`NamedQueryRunner: refusing to inject malformed IRI "${e}" \u2014 contains a character illegal in a SPARQL IRIREF (would break out of <...>). Pass a percent-encoded IRI.`);return`<${e}>`}static escapeLiteral(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}};Ao.NamedQueryRunner=fE;Ao.NamedQueryRunner=fE=lu=QG([(0,JG.injectable)(),XG("design:paramtypes",[Object,Object])],fE)});var i3=E(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});Hg.extractSparqlBlock=rW;Hg.stripFrontmatter=nW;function rW(r){let e=r.match(/```sparql\s*\n([\s\S]*?)\n```/);if(!e)return null;let t=e[1].trim();return t.length>0?t:null}a(rW,"extractSparqlBlock");function nW(r){if(!r.startsWith("---"))return r;let e=r.indexOf(`
|
|
94
94
|
---`,3);return e<0?r:r.slice(e+4)}a(nW,"stripFrontmatter")});var o3=E(Io=>{"use strict";var iW=Io&&Io.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},sW=Io&&Io.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Ad;Object.defineProperty(Io,"__esModule",{value:!0});Io.CommandExecutionFlow=void 0;var oW=Ze(),s3=da(),aW=Ke(),cW=tt(),lW=Jt(),uW=on(),zg=Ad=class{static{a(this,"CommandExecutionFlow")}constructor(e,t,n,i,s,o,c){this.groundingExecutor=e,this.notificationService=t,this.logger=n,this.prompts=i,this.tripleStore=s,this.fileOpener=o,this.requiredPropertyResolver=c}async run(e,t){let{command:n}=e;if(n.confirmMessage&&!await this.prompts.confirm(n.confirmMessage))return;let i=t.injectedUserInput,s=Ad.extractInputSchema(e);if(s!==null&&s.length>0){let l=await this.applyLabelDatePrefill(s,n.grounding,t.targetIRI);l=await this.applyRequiredPropertyFields(l,n.grounding,t);let u=await this.prompts.promptInputSchema(l);if(u===null)return;i={...t.injectedUserInput??{},...u}}let o=await this.groundingExecutor.execute(n.grounding,t.targetIRI??"",t.filePath??"",i),c=t.filePath??"<no-file>";if(o.success){if(n.successMessage&&this.notificationService.success(n.successMessage),await new Promise(l=>setTimeout(l,100)),t.onComplete&&await t.onComplete(),o.openPath&&this.fileOpener)try{await this.fileOpener.open(o.openPath,{sameTab:n.openInSameTab})}catch(l){this.logger.info(`[CommandExecutionFlow] Failed to open created file "${o.openPath}": ${l instanceof Error?l.message:String(l)}`)}this.logger.info(`[CommandExecutionFlow] Executed "${n.name}" on ${c}`)}else o.notApplicable?(this.notificationService.info(o.error??"This command is not available for this asset."),this.logger.info(`[CommandExecutionFlow] Not applicable "${n.name}": ${o.error}`)):(this.notificationService.error(`Command failed: ${o.error??"unknown error"}`),this.logger.info(`[CommandExecutionFlow] Failed "${n.name}": ${o.error}`))}static extractInputSchema(e){let n=e.command.grounding.inputSchema;return!n||!Array.isArray(n)?null:n}async applyLabelDatePrefill(e,t,n){if(t.type!==s3.GroundingType.CREATE_INSTANCE||!t.prefillLabelWithDate||!n||!this.tripleStore)return e;let i=await this.resolveAssetLabel(n);if(!i)return e;let s=uW.DateFormatter.toDateString(new Date),o=`${i} ${s}`;return e.map(c=>{if(typeof c!="object"||c===null)return c;let l=c;if(l.name!=="label")return c;let u=l.defaultValue;return typeof u=="string"&&u.length>0?c:{...l,defaultValue:o}})}async applyRequiredPropertyFields(e,t,n){if(t.type!==s3.GroundingType.CREATE_INSTANCE||t.targetClass||!this.requiredPropertyResolver||!n.filePath)return e;let i=Ad.basenameUid(n.filePath);if(!i)return e;let s;try{s=await this.requiredPropertyResolver(i)}catch(l){return this.logger.info(`[CommandExecutionFlow] required-property resolution failed for "${i}": ${l instanceof Error?l.message:String(l)}`),e}if(s.length===0)return e;let o=new Set(Ad.ALWAYS_COVERED);for(let l of e)l&&typeof l=="object"&&typeof l.name=="string"&&o.add(l.name);let c=s.filter(l=>!o.has(l.propertyKey)).map(l=>{let u={name:l.propertyKey,type:l.fieldType,label:l.label,required:!0};return l.targetClassUid&&(u.targetClassUid=l.targetClassUid),l.fieldType==="boolean"&&(u.defaultValue="false"),u});return c.length===0?e:[...e,...c]}static basenameUid(e){let t=e.replace(/^\/+/,"").split("/").pop()?.replace(/\.md$/i,"");return t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)?t.toLowerCase():null}async resolveAssetLabel(e){if(!this.tripleStore)return;let t=new aW.IRI(e),n=await this.tripleStore.match(t,lW.Namespace.EXO.term("Asset_label"),void 0);if(n.length===0)return;let i=n[0].object;if(i instanceof cW.Literal)return i.value.length>0?i.value:void 0}};Io.CommandExecutionFlow=zg;zg.ALWAYS_COVERED=["exo__Asset_uid","exo__Asset_createdAt","exo__Asset_updatedAt","exo__Asset_label","exo__Asset_createdBy","exo__Instance_class","exo__Asset_isDefinedBy"];Io.CommandExecutionFlow=zg=Ad=iW([(0,oW.injectable)(),sW("design:paramtypes",[Function,Object,Object,Object,Object,Object,Function])],zg)});var l3=E(pE=>{"use strict";Object.defineProperty(pE,"__esModule",{value:!0});pE.createTripleStoreRequiredPropertyResolver=hW;var Id=Ke(),dE=tt(),a3=Jt(),c3="http://www.w3.org/2001/XMLSchema#",fW=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i,dW=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function xd(r){let e=fW.exec(r);return e?e[1].toLowerCase():dW.test(r.trim())?r.trim().toLowerCase():null}a(xd,"uidFrom");function pW(r){for(let e of r){let t=e.value;if(t.startsWith(c3)){let n=t.slice(c3.length).toLowerCase();return n==="date"||n==="datetime"?{fieldType:"date"}:n==="boolean"?{fieldType:"boolean"}:["integer","int","long","short","decimal","float","double","nonnegativeinteger","positiveinteger"].includes(n)?{fieldType:"number"}:{fieldType:"text"}}if(e.iri){let n=xd(t);return n?{fieldType:"assetRef",targetClassUid:n}:{fieldType:"assetRef"}}}return{fieldType:"text"}}a(pW,"fieldTypeFromRange");function hW(r){let e=a3.Namespace.EXO,t=a3.Namespace.RDFS;return async n=>{let i=xd(n)??n.trim().toLowerCase();if(!i)return[];let s=await r.match(void 0,e.term("Class_superClass"),void 0),o=new Map;for(let p of s){let h=p.subject instanceof Id.IRI?xd(p.subject.value):null,_=p.object instanceof Id.IRI?xd(p.object.value):null;if(!h||!_)continue;let y=o.get(h);y||(y=new Set,o.set(h,y)),y.add(_)}let c=new Set([i]),l=[i];for(;l.length>0;){let p=l.shift();if(p===void 0)break;for(let h of o.get(p)??[])c.has(h)||(c.add(h),l.push(h))}let u=await r.match(void 0,e.term("Property_minCount"),void 0),f=[],d=new Set;for(let p of u){if(!((p.object instanceof dE.Literal?parseInt(p.object.value,10):NaN)>0))continue;let _=p.subject;if(!(_ instanceof Id.IRI)||!(await r.match(_,e.term("Property_domain"),void 0)).map(P=>P.object instanceof Id.IRI?xd(P.object.value):null).filter(P=>P!==null).some(P=>c.has(P)))continue;let w=null;for(let P of[e.term("Asset_label"),t.term("label")]){let V=await r.match(_,P,void 0);for(let j of V)if(j.object instanceof dE.Literal&&j.object.value.trim().length>0){w=j.object.value.trim();break}if(w)break}if(!w||d.has(w))continue;d.add(w);let O=(await r.match(_,e.term("Property_range"),void 0)).map(P=>P.object instanceof Id.IRI?{iri:!0,value:P.object.value}:P.object instanceof dE.Literal?{iri:!1,value:P.object.value}:null).filter(P=>P!==null),{fieldType:A,targetClassUid:x}=pW(O);f.push({propertyKey:w,label:w,fieldType:A,targetClassUid:x})}return f.sort((p,h)=>p.propertyKey.localeCompare(h.propertyKey)),f}}a(hW,"createTripleStoreRequiredPropertyResolver")});var Rd=E(xo=>{"use strict";var mW=xo&&xo.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},gW=xo&&xo.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)};Object.defineProperty(xo,"__esModule",{value:!0});xo.WorkflowEngine=void 0;var yW=Ze(),hE=class{static{a(this,"WorkflowEngine")}constructor(e){this.definition=e}getAvailableTransitions(e){return this.definition.transitions.filter(t=>t.from===e&&!t.isRollback)}getRollbackTransitions(e){return this.definition.transitions.filter(t=>t.from===e&&t.isRollback)}getAllTransitions(e){return this.definition.transitions.filter(t=>t.from===e)}canTransition(e,t){return this.definition.transitions.some(n=>n.from===e&&n.to===t)}getPreviousStatus(e){return this.definition.transitions.find(n=>n.from===e&&n.isRollback)?.to??null}getNextStates(e){return this.getAvailableTransitions(e).map(t=>t.to)}isTerminalState(e){return this.definition.terminalStates.includes(e)}isInitialState(e){return this.definition.initialState===e}getTimestampsForStatus(e){return this.definition.states.find(n=>n.status===e)?.timestampOnEnter??[]}getTransition(e,t){return this.definition.transitions.find(n=>n.from===e&&n.to===t)}getOrderedStates(){return this.definition.states.map(e=>e.status)}getDefinition(){return this.definition}validate(){let e=[],t=new Set(this.definition.states.map(i=>i.status));this.definition.states.length===0&&e.push("Workflow must have at least one state"),t.has(this.definition.initialState)||e.push(`Initial state "${this.definition.initialState}" is not in the states list`);for(let i of this.definition.terminalStates)t.has(i)||e.push(`Terminal state "${i}" is not in the states list`);for(let i of this.definition.transitions)t.has(i.from)||e.push(`Transition "${i.label}" references unknown source state "${i.from}"`),t.has(i.to)||e.push(`Transition "${i.label}" references unknown target state "${i.to}"`);for(let i of this.definition.states){if(this.definition.terminalStates.includes(i.status))continue;this.definition.transitions.filter(o=>o.from===i.status&&!o.isRollback).length===0&&e.push(`State "${i.status}" has no outgoing forward transitions (dead end)`)}let n=new Set;for(let i of this.definition.transitions){let s=`${i.from}\u2192${i.to}`;n.has(s)&&e.push(`Duplicate transition: ${s}`),n.add(s)}return{valid:e.length===0,errors:e}}};xo.WorkflowEngine=hE;xo.WorkflowEngine=hE=mW([(0,yW.injectable)(),gW("design:paramtypes",[Object])],hE)});var u3=E(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.EFFORT_WORKFLOW_PROPERTY=Ls.WorkflowTransitionProperty=Ls.WorkflowStateProperty=Ls.WorkflowProperty=void 0;Ls.WorkflowProperty={TARGET_CLASS:"ems__Workflow_targetClass",INITIAL_STATE:"ems__Workflow_initialState",TERMINAL_STATES:"ems__Workflow_terminalStates",IS_DEFAULT:"ems__Workflow_isDefault"};Ls.WorkflowStateProperty={WORKFLOW:"ems__WorkflowState_workflow",STATUS:"ems__WorkflowState_status",ORDER:"ems__WorkflowState_order",OPTIONAL:"ems__WorkflowState_optional",TIMESTAMP_ON_ENTER:"ems__WorkflowState_timestampOnEnter",BADGE_COLOR:"ems__WorkflowState_badgeColor"};Ls.WorkflowTransitionProperty={WORKFLOW:"ems__WorkflowTransition_workflow",FROM:"ems__WorkflowTransition_from",TO:"ems__WorkflowTransition_to",LABEL:"ems__WorkflowTransition_label",ICON:"ems__WorkflowTransition_icon",IS_ROLLBACK:"ems__WorkflowTransition_isRollback"};Ls.EFFORT_WORKFLOW_PROPERTY="ems__Effort_workflow"});var Ro=E(Kg=>{"use strict";Object.defineProperty(Kg,"__esModule",{value:!0});Kg.MetadataHelpers=void 0;var f3=wd(),mE=Ed(),gE=class{static{a(this,"MetadataHelpers")}static findAllReferencingProperties(e,t){let n=[];for(let[i,s]of Object.entries(e))this.containsReference(s,t)&&n.push(i);return n}static findReferencingProperty(e,t){for(let[n,i]of Object.entries(e))if(this.containsReference(i,t))return n}static containsReference(e,t){if(!e)return!1;let n=t.replace(/\.md$/,"");if(typeof e=="string"){let i=/\[\[([^[\]]+)\]\]/g,s;for(;(s=i.exec(e))!==null;){let c=s[1].split("|")[0].trim();if(c===n||c.endsWith(`/${n}`))return!0}return!1}return Array.isArray(e)?e.some(i=>this.containsReference(i,t)):!1}static isAssetArchived(e){let t=e?.exo__Asset_isArchived;if(t!=null){if(t===!0||t===1)return!0;if(typeof t=="string"){let i=t.toLowerCase().trim();if(i==="true"||i==="yes"||i==="1")return!0}if(typeof t=="boolean")return t}let n=e?.archived;if(n==null)return!1;if(typeof n=="boolean")return n;if(typeof n=="number")return n!==0;if(typeof n=="string"){let i=n.toLowerCase().trim();return i==="true"||i==="yes"||i==="1"}return!1}static getPropertyValue(e,t){return t==="Name"||t==="title"?e.title:t==="created"?e.created:t==="modified"?e.modified:t==="path"?e.path:e.metadata?.[t]}static ensureQuoted(e){return!e||e==='""'?'""':e.startsWith('"')&&e.endsWith('"')?e:`"${e}"`}static buildFileContent(e,t){let n=(0,f3.orderProperties)(e,(0,f3.loadDefaultSpec)()),i=Object.entries(n).map(([c,l])=>{let u=mE.STRING_SCALAR_PROPERTIES.has(c);if(Array.isArray(l)){let f=l.map(d=>` - ${(0,mE.serializeYamlScalar)(d,u)}`).join(`
|
|
95
95
|
`);return`${c}:
|
|
@@ -216,14 +216,14 @@ PREFIX gtd: <https://exocortex.my/ontology/gtd#>
|
|
|
216
216
|
PREFIX period: <https://exocortex.my/ontology/period#>
|
|
217
217
|
PREFIX lit: <https://exocortex.my/ontology/lit#>
|
|
218
218
|
PREFIX inbox: <https://exocortex.my/ontology/inbox#>
|
|
219
|
-
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>`});var Pv=E(cn=>{"use strict";var lK=cn&&cn.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},uK=cn&&cn.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},fK=cn&&cn.__param||function(r,e){return function(t,n){e(t,n,r)}};Object.defineProperty(cn,"__esModule",{value:!0});cn.CriticalityZoneService=cn.CriticalityZoneUUIDs=void 0;var nD=Ze(),dK=Fs(),pK=Wt();cn.CriticalityZoneUUIDs={TODAY:"e266a2e9-9eb0-431d-b1fe-b95b9d3e9a3f",THIS_WEEK:"c7f1a968-0959-4ac7-ac82-31b0cdc2aba7",SOMEDAY:"6968a0fc-7a41-4393-82b1-17d767c7ad7c"};var Ov=class{static{a(this,"CriticalityZoneService")}constructor(e){this.vault=e,this.frontmatterService=new dK.FrontmatterService}async setZoneToday(e){await this.setZone(e,cn.CriticalityZoneUUIDs.TODAY)}async setZoneThisWeek(e){await this.setZone(e,cn.CriticalityZoneUUIDs.THIS_WEEK)}async setZoneSomeday(e){await this.setZone(e,cn.CriticalityZoneUUIDs.SOMEDAY)}async setZone(e,t){let n=await this.vault.read(e),i=this.frontmatterService.updateProperty(n,"ems__Task_zone",`"[[${t}]]"`);await this.vault.modify(e,i)}};cn.CriticalityZoneService=Ov;cn.CriticalityZoneService=Ov=lK([(0,nD.injectable)(),fK(0,(0,nD.inject)(pK.DI_TOKENS.IVaultAdapter)),uK("design:paramtypes",[Object])],Ov)});var hu=E((
|
|
219
|
+
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>`});var Pv=E(cn=>{"use strict";var lK=cn&&cn.__decorate||function(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},uK=cn&&cn.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},fK=cn&&cn.__param||function(r,e){return function(t,n){e(t,n,r)}};Object.defineProperty(cn,"__esModule",{value:!0});cn.CriticalityZoneService=cn.CriticalityZoneUUIDs=void 0;var nD=Ze(),dK=Fs(),pK=Wt();cn.CriticalityZoneUUIDs={TODAY:"e266a2e9-9eb0-431d-b1fe-b95b9d3e9a3f",THIS_WEEK:"c7f1a968-0959-4ac7-ac82-31b0cdc2aba7",SOMEDAY:"6968a0fc-7a41-4393-82b1-17d767c7ad7c"};var Ov=class{static{a(this,"CriticalityZoneService")}constructor(e){this.vault=e,this.frontmatterService=new dK.FrontmatterService}async setZoneToday(e){await this.setZone(e,cn.CriticalityZoneUUIDs.TODAY)}async setZoneThisWeek(e){await this.setZone(e,cn.CriticalityZoneUUIDs.THIS_WEEK)}async setZoneSomeday(e){await this.setZone(e,cn.CriticalityZoneUUIDs.SOMEDAY)}async setZone(e,t){let n=await this.vault.read(e),i=this.frontmatterService.updateProperty(n,"ems__Task_zone",`"[[${t}]]"`);await this.vault.modify(e,i)}};cn.CriticalityZoneService=Ov;cn.CriticalityZoneService=Ov=lK([(0,nD.injectable)(),fK(0,(0,nD.inject)(pK.DI_TOKENS.IVaultAdapter)),uK("design:paramtypes",[Object])],Ov)});var hu=E((Mbe,Mc)=>{"use strict";function iD(r){return typeof r>"u"||r===null}a(iD,"isNothing");function hK(r){return typeof r=="object"&&r!==null}a(hK,"isObject");function mK(r){return Array.isArray(r)?r:iD(r)?[]:[r]}a(mK,"toArray");function gK(r,e){if(e){let t=Object.keys(e);for(let n=0,i=t.length;n<i;n+=1){let s=t[n];r[s]=e[s]}}return r}a(gK,"extend");function yK(r,e){let t="";for(let n=0;n<e;n+=1)t+=r;return t}a(yK,"repeat");function _K(r){return r===0&&Number.NEGATIVE_INFINITY===1/r}a(_K,"isNegativeZero");Mc.exports.isNothing=iD;Mc.exports.isObject=hK;Mc.exports.toArray=mK;Mc.exports.repeat=yK;Mc.exports.isNegativeZero=_K;Mc.exports.extend=gK});var mu=E(($be,oD)=>{"use strict";function sD(r,e){let t="",n=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(t+='in "'+r.mark.name+'" '),t+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!e&&r.mark.snippet&&(t+=`
|
|
220
220
|
|
|
221
|
-
`+r.mark.snippet),n+" "+t):n}a(sD,"formatError");function Fd(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=sD(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}a(Fd,"YAMLException");Fd.prototype=Object.create(Error.prototype);Fd.prototype.constructor=Fd;Fd.prototype.toString=a(function(e){return this.name+": "+sD(this,e)},"toString");oD.exports=Fd});var cD=E((
|
|
221
|
+
`+r.mark.snippet),n+" "+t):n}a(sD,"formatError");function Fd(r,e){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=e,this.message=sD(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}a(Fd,"YAMLException");Fd.prototype=Object.create(Error.prototype);Fd.prototype.constructor=Fd;Fd.prototype.toString=a(function(e){return this.name+": "+sD(this,e)},"toString");oD.exports=Fd});var cD=E((Bbe,aD)=>{"use strict";var Ld=hu();function Dv(r,e,t,n,i){let s="",o="",c=Math.floor(i/2)-1;return n-e>c&&(s=" ... ",e=n-c+s.length),t-n>c&&(o=" ...",t=n+c-o.length),{str:s+r.slice(e,t).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}a(Dv,"getLine");function Fv(r,e){return Ld.repeat(" ",e-r.length)+r}a(Fv,"padStart");function bK(r,e){if(e=Object.create(e||null),!r.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);let t=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;for(;s=t.exec(r.buffer);)i.push(s.index),n.push(s.index+s[0].length),r.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);let c="",l=Math.min(r.line+e.linesAfter,i.length).toString().length,u=e.maxLength-(e.indent+l+3);for(let d=1;d<=e.linesBefore&&!(o-d<0);d++){let p=Dv(r.buffer,n[o-d],i[o-d],r.position-(n[o]-n[o-d]),u);c=Ld.repeat(" ",e.indent)+Fv((r.line-d+1).toString(),l)+" | "+p.str+`
|
|
222
222
|
`+c}let f=Dv(r.buffer,n[o],i[o],r.position,u);c+=Ld.repeat(" ",e.indent)+Fv((r.line+1).toString(),l)+" | "+f.str+`
|
|
223
223
|
`,c+=Ld.repeat("-",e.indent+l+3+f.pos)+`^
|
|
224
224
|
`;for(let d=1;d<=e.linesAfter&&!(o+d>=i.length);d++){let p=Dv(r.buffer,n[o+d],i[o+d],r.position-(n[o]-n[o+d]),u);c+=Ld.repeat(" ",e.indent)+Fv((r.line+d+1).toString(),l)+" | "+p.str+`
|
|
225
|
-
`}return c.replace(/\n$/,"")}a(bK,"makeSnippet");aD.exports=bK});var ln=E((
|
|
226
|
-
\r`;function oY(r){if(r===null)return!1;let e=0,t=r.length,n=Yv;for(let i=0;i<t;i++){let s=n.indexOf(r.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}a(oY,"resolveYamlBinary");function aY(r){let e=r.replace(/[\r\n=]/g,""),t=e.length,n=Yv,i=0,s=[];for(let c=0;c<t;c++)c%4===0&&c&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(c));let o=t%4*6;return o===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):o===18?(s.push(i>>10&255),s.push(i>>2&255)):o===12&&s.push(i>>4&255),new Uint8Array(s)}a(aY,"constructYamlBinary");function cY(r){let e="",t=0,n=r.length,i=Yv;for(let o=0;o<n;o++)o%3===0&&o&&(e+=i[t>>18&63],e+=i[t>>12&63],e+=i[t>>6&63],e+=i[t&63]),t=(t<<8)+r[o];let s=n%3;return s===0?(e+=i[t>>18&63],e+=i[t>>12&63],e+=i[t>>6&63],e+=i[t&63]):s===2?(e+=i[t>>10&63],e+=i[t>>4&63],e+=i[t<<2&63],e+=i[64]):s===1&&(e+=i[t>>2&63],e+=i[t<<4&63],e+=i[64],e+=i[64]),e}a(cY,"representYamlBinary");function lY(r){return Object.prototype.toString.call(r)==="[object Uint8Array]"}a(lY,"isBinary");RD.exports=new sY("tag:yaml.org,2002:binary",{kind:"scalar",resolve:oY,construct:aY,predicate:lY,represent:cY})});var Xv=E((
|
|
225
|
+
`}return c.replace(/\n$/,"")}a(bK,"makeSnippet");aD.exports=bK});var ln=E((qbe,uD)=>{"use strict";var lD=mu(),SK=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],wK=["scalar","sequence","mapping"];function EK(r){let e={};return r!==null&&Object.keys(r).forEach(function(t){r[t].forEach(function(n){e[String(n)]=t})}),e}a(EK,"compileStyleAliases");function vK(r,e){if(e=e||{},Object.keys(e).forEach(function(t){if(SK.indexOf(t)===-1)throw new lD('Unknown option "'+t+'" is met in definition of "'+r+'" YAML type.')}),this.options=e,this.tag=r,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=EK(e.styleAliases||null),wK.indexOf(this.kind)===-1)throw new lD('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')}a(vK,"Type");uD.exports=vK});var kv=E((Wbe,dD)=>{"use strict";var Nd=mu(),Lv=ln();function fD(r,e){let t=[];return r[e].forEach(function(n){let i=t.length;t.forEach(function(s,o){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=o)}),t[i]=n}),t}a(fD,"compileList");function TK(){let r={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function e(t){t.multi?(r.multi[t.kind].push(t),r.multi.fallback.push(t)):r[t.kind][t.tag]=r.fallback[t.tag]=t}a(e,"collectType");for(let t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(e);return r}a(TK,"compileMap");function Nv(r){return this.extend(r)}a(Nv,"Schema");Nv.prototype.extend=a(function(e){let t=[],n=[];if(e instanceof Lv)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new Nd("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(s){if(!(s instanceof Lv))throw new Nd("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Nd("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Nd("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof Lv))throw new Nd("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let i=Object.create(Nv.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=fD(i,"implicit"),i.compiledExplicit=fD(i,"explicit"),i.compiledTypeMap=TK(i.compiledImplicit,i.compiledExplicit),i},"extend");dD.exports=Nv});var Mv=E((zbe,pD)=>{"use strict";var AK=ln();pD.exports=new AK("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(r){return r!==null?r:""},"construct")})});var jv=E((Ybe,hD)=>{"use strict";var IK=ln();hD.exports=new IK("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(r){return r!==null?r:[]},"construct")})});var $v=E((Xbe,mD)=>{"use strict";var xK=ln();mD.exports=new xK("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(r){return r!==null?r:{}},"construct")})});var Uv=E((Zbe,gD)=>{"use strict";var RK=kv();gD.exports=new RK({explicit:[Mv(),jv(),$v()]})});var Bv=E((eSe,yD)=>{"use strict";var CK=ln();function OK(r){if(r===null)return!0;let e=r.length;return e===1&&r==="~"||e===4&&(r==="null"||r==="Null"||r==="NULL")}a(OK,"resolveYamlNull");function PK(){return null}a(PK,"constructYamlNull");function DK(r){return r===null}a(DK,"isNull");yD.exports=new CK("tag:yaml.org,2002:null",{kind:"scalar",resolve:OK,construct:PK,predicate:DK,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"})});var Vv=E((rSe,_D)=>{"use strict";var FK=ln();function LK(r){if(r===null)return!1;let e=r.length;return e===4&&(r==="true"||r==="True"||r==="TRUE")||e===5&&(r==="false"||r==="False"||r==="FALSE")}a(LK,"resolveYamlBoolean");function NK(r){return r==="true"||r==="True"||r==="TRUE"}a(NK,"constructYamlBoolean");function kK(r){return Object.prototype.toString.call(r)==="[object Boolean]"}a(kK,"isBoolean");_D.exports=new FK("tag:yaml.org,2002:bool",{kind:"scalar",resolve:LK,construct:NK,predicate:kK,represent:{lowercase:a(function(r){return r?"true":"false"},"lowercase"),uppercase:a(function(r){return r?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(r){return r?"True":"False"},"camelcase")},defaultStyle:"lowercase"})});var qv=E((iSe,bD)=>{"use strict";var MK=hu(),jK=ln();function $K(r){return r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102}a($K,"isHexCode");function UK(r){return r>=48&&r<=55}a(UK,"isOctCode");function BK(r){return r>=48&&r<=57}a(BK,"isDecCode");function VK(r){if(r===null)return!1;let e=r.length,t=0,n=!1;if(!e)return!1;let i=r[t];if((i==="-"||i==="+")&&(i=r[++t]),i==="0"){if(t+1===e)return!0;if(i=r[++t],i==="b"){for(t++;t<e;t++){if(i=r[t],i!=="0"&&i!=="1")return!1;n=!0}return n&&isFinite(kd(r))}if(i==="x"){for(t++;t<e;t++){if(!$K(r.charCodeAt(t)))return!1;n=!0}return n&&isFinite(kd(r))}if(i==="o"){for(t++;t<e;t++){if(!UK(r.charCodeAt(t)))return!1;n=!0}return n&&isFinite(kd(r))}}for(;t<e;t++){if(!BK(r.charCodeAt(t)))return!1;n=!0}return n?isFinite(kd(r)):!1}a(VK,"resolveYamlInteger");function kd(r){let e=r,t=1,n=e[0];if((n==="-"||n==="+")&&(n==="-"&&(t=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return t*parseInt(e.slice(2),2);if(e[1]==="x")return t*parseInt(e.slice(2),16);if(e[1]==="o")return t*parseInt(e.slice(2),8)}return t*parseInt(e,10)}a(kd,"parseYamlInteger");function qK(r){return kd(r)}a(qK,"constructYamlInteger");function GK(r){return Object.prototype.toString.call(r)==="[object Number]"&&r%1===0&&!MK.isNegativeZero(r)}a(GK,"isInteger");bD.exports=new jK("tag:yaml.org,2002:int",{kind:"scalar",resolve:VK,construct:qK,predicate:GK,represent:{binary:a(function(r){return r>=0?"0b"+r.toString(2):"-0b"+r.toString(2).slice(1)},"binary"),octal:a(function(r){return r>=0?"0o"+r.toString(8):"-0o"+r.toString(8).slice(1)},"octal"),decimal:a(function(r){return r.toString(10)},"decimal"),hexadecimal:a(function(r){return r>=0?"0x"+r.toString(16).toUpperCase():"-0x"+r.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var Gv=E((oSe,wD)=>{"use strict";var SD=hu(),WK=ln(),HK=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),zK=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function KK(r){return r===null||!HK.test(r)?!1:isFinite(parseFloat(r,10))?!0:zK.test(r)}a(KK,"resolveYamlFloat");function YK(r){let e=r.toLowerCase(),t=e[0]==="-"?-1:1;return"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:t*parseFloat(e,10)}a(YK,"constructYamlFloat");var QK=/^[-+]?[0-9]+e/;function XK(r,e){if(isNaN(r))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===r)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===r)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(SD.isNegativeZero(r))return"-0.0";let t=r.toString(10);return QK.test(t)?t.replace("e",".e"):t}a(XK,"representYamlFloat");function JK(r){return Object.prototype.toString.call(r)==="[object Number]"&&(r%1!==0||SD.isNegativeZero(r))}a(JK,"isFloat");wD.exports=new WK("tag:yaml.org,2002:float",{kind:"scalar",resolve:KK,construct:YK,predicate:JK,represent:XK,defaultStyle:"lowercase"})});var Wv=E((cSe,ED)=>{"use strict";ED.exports=Uv().extend({implicit:[Bv(),Vv(),qv(),Gv()]})});var Hv=E((lSe,vD)=>{"use strict";vD.exports=Wv()});var zv=E((uSe,ID)=>{"use strict";var ZK=ln(),TD=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),AD=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function eY(r){return r===null?!1:TD.exec(r)!==null||AD.exec(r)!==null}a(eY,"resolveYamlTimestamp");function tY(r){let e=0,t=null,n=TD.exec(r);if(n===null&&(n=AD.exec(r)),n===null)throw new Error("Date resolve error");let i=+n[1],s=+n[2]-1,o=+n[3];if(!n[4])return new Date(Date.UTC(i,s,o));let c=+n[4],l=+n[5],u=+n[6];if(n[7]){for(e=n[7].slice(0,3);e.length<3;)e+="0";e=+e}if(n[9]){let d=+n[10],p=+(n[11]||0);t=(d*60+p)*6e4,n[9]==="-"&&(t=-t)}let f=new Date(Date.UTC(i,s,o,c,l,u,e));return t&&f.setTime(f.getTime()-t),f}a(tY,"constructYamlTimestamp");function rY(r){return r.toISOString()}a(rY,"representYamlTimestamp");ID.exports=new ZK("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:eY,construct:tY,instanceOf:Date,represent:rY})});var Kv=E((dSe,xD)=>{"use strict";var nY=ln();function iY(r){return r==="<<"||r===null}a(iY,"resolveYamlMerge");xD.exports=new nY("tag:yaml.org,2002:merge",{kind:"scalar",resolve:iY})});var Qv=E((hSe,RD)=>{"use strict";var sY=ln(),Yv=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
226
|
+
\r`;function oY(r){if(r===null)return!1;let e=0,t=r.length,n=Yv;for(let i=0;i<t;i++){let s=n.indexOf(r.charAt(i));if(!(s>64)){if(s<0)return!1;e+=6}}return e%8===0}a(oY,"resolveYamlBinary");function aY(r){let e=r.replace(/[\r\n=]/g,""),t=e.length,n=Yv,i=0,s=[];for(let c=0;c<t;c++)c%4===0&&c&&(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)),i=i<<6|n.indexOf(e.charAt(c));let o=t%4*6;return o===0?(s.push(i>>16&255),s.push(i>>8&255),s.push(i&255)):o===18?(s.push(i>>10&255),s.push(i>>2&255)):o===12&&s.push(i>>4&255),new Uint8Array(s)}a(aY,"constructYamlBinary");function cY(r){let e="",t=0,n=r.length,i=Yv;for(let o=0;o<n;o++)o%3===0&&o&&(e+=i[t>>18&63],e+=i[t>>12&63],e+=i[t>>6&63],e+=i[t&63]),t=(t<<8)+r[o];let s=n%3;return s===0?(e+=i[t>>18&63],e+=i[t>>12&63],e+=i[t>>6&63],e+=i[t&63]):s===2?(e+=i[t>>10&63],e+=i[t>>4&63],e+=i[t<<2&63],e+=i[64]):s===1&&(e+=i[t>>2&63],e+=i[t<<4&63],e+=i[64],e+=i[64]),e}a(cY,"representYamlBinary");function lY(r){return Object.prototype.toString.call(r)==="[object Uint8Array]"}a(lY,"isBinary");RD.exports=new sY("tag:yaml.org,2002:binary",{kind:"scalar",resolve:oY,construct:aY,predicate:lY,represent:cY})});var Xv=E((gSe,CD)=>{"use strict";var uY=ln(),fY=Object.prototype.hasOwnProperty,dY=Object.prototype.toString;function pY(r){if(r===null)return!0;let e=[],t=r;for(let n=0,i=t.length;n<i;n+=1){let s=t[n],o=!1;if(dY.call(s)!=="[object Object]")return!1;let c;for(c in s)if(fY.call(s,c))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(c)===-1)e.push(c);else return!1}return!0}a(pY,"resolveYamlOmap");function hY(r){return r!==null?r:[]}a(hY,"constructYamlOmap");CD.exports=new uY("tag:yaml.org,2002:omap",{kind:"sequence",resolve:pY,construct:hY})});var Jv=E((_Se,OD)=>{"use strict";var mY=ln(),gY=Object.prototype.toString;function yY(r){if(r===null)return!0;let e=r,t=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n];if(gY.call(s)!=="[object Object]")return!1;let o=Object.keys(s);if(o.length!==1)return!1;t[n]=[o[0],s[o[0]]]}return!0}a(yY,"resolveYamlPairs");function _Y(r){if(r===null)return[];let e=r,t=new Array(e.length);for(let n=0,i=e.length;n<i;n+=1){let s=e[n],o=Object.keys(s);t[n]=[o[0],s[o[0]]]}return t}a(_Y,"constructYamlPairs");OD.exports=new mY("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:yY,construct:_Y})});var Zv=E((SSe,PD)=>{"use strict";var bY=ln(),SY=Object.prototype.hasOwnProperty;function wY(r){if(r===null)return!0;let e=r;for(let t in e)if(SY.call(e,t)&&e[t]!==null)return!1;return!0}a(wY,"resolveYamlSet");function EY(r){return r!==null?r:{}}a(EY,"constructYamlSet");PD.exports=new bY("tag:yaml.org,2002:set",{kind:"mapping",resolve:wY,construct:EY})});var uy=E((ESe,DD)=>{"use strict";DD.exports=Hv().extend({implicit:[zv(),Kv()],explicit:[Qv(),Xv(),Jv(),Zv()]})});var JD=E((vSe,nT)=>{"use strict";var jc=hu(),UD=mu(),vY=cD(),TY=uy(),ts=Object.prototype.hasOwnProperty,fy=1,BD=2,VD=3,dy=4,eT=1,AY=2,FD=3,IY=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,xY=/[\x85\u2028\u2029]/,RY=/[,\[\]{}]/,qD=/^(?:!|!!|![0-9A-Za-z-]+!)$/,GD=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function LD(r){return Object.prototype.toString.call(r)}a(LD,"_class");function $s(r){return r===10||r===13}a($s,"isEol");function Bo(r){return r===9||r===32}a(Bo,"isWhiteSpace");function Hn(r){return r===9||r===32||r===10||r===13}a(Hn,"isWsOrEol");function gu(r){return r===44||r===91||r===93||r===123||r===125}a(gu,"isFlowIndicator");function CY(r){if(r>=48&&r<=57)return r-48;let e=r|32;return e>=97&&e<=102?e-97+10:-1}a(CY,"fromHexCode");function OY(r){return r===120?2:r===117?4:r===85?8:0}a(OY,"escapedHexLen");function PY(r){return r>=48&&r<=57?r-48:-1}a(PY,"fromDecimalCode");function ND(r){switch(r){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
227
227
|
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}a(ND,"simpleEscapeSequence");function DY(r){return r<=65535?String.fromCharCode(r):String.fromCharCode((r-65536>>10)+55296,(r-65536&1023)+56320)}a(DY,"charFromCodepoint");function WD(r,e,t){e==="__proto__"?Object.defineProperty(r,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):r[e]=t}a(WD,"setProperty");var HD=new Array(256),zD=new Array(256);for(let r=0;r<256;r++)HD[r]=ND(r)?1:0,zD[r]=ND(r);function FY(r,e){this.input=r,this.filename=e.filename||null,this.schema=e.schema||TY,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:100,this.maxTotalMergeKeys=typeof e.maxTotalMergeKeys=="number"?e.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=r.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}a(FY,"State");function KD(r,e){let t={name:r.filename,buffer:r.input.slice(0,-1),position:r.position,line:r.line,column:r.position-r.lineStart};return t.snippet=vY(t),new UD(e,t)}a(KD,"generateError");function Ue(r,e){throw KD(r,e)}a(Ue,"throwError");function py(r,e){r.onWarning&&r.onWarning.call(null,KD(r,e))}a(py,"throwWarning");function $c(r,e,t){let n=r.anchorMapTransactions;if(n.length!==0){let i=n[n.length-1];ts.call(i,e)||(i[e]={existed:ts.call(r.anchorMap,e),value:r.anchorMap[e]})}r.anchorMap[e]=t}a($c,"storeAnchor");function LY(r){r.anchorMapTransactions.push(Object.create(null))}a(LY,"beginAnchorTransaction");function NY(r){let e=r.anchorMapTransactions.pop(),t=r.anchorMapTransactions;if(t.length===0)return;let n=t[t.length-1],i=Object.keys(e);for(let s=0,o=i.length;s<o;s+=1){let c=i[s];ts.call(n,c)||(n[c]=e[c])}}a(NY,"commitAnchorTransaction");function kY(r){let e=r.anchorMapTransactions.pop(),t=Object.keys(e);for(let n=t.length-1;n>=0;n-=1){let i=e[t[n]];i.existed?r.anchorMap[t[n]]=i.value:delete r.anchorMap[t[n]]}}a(kY,"rollbackAnchorTransaction");function YD(r){return{position:r.position,line:r.line,lineStart:r.lineStart,lineIndent:r.lineIndent,firstTabInLine:r.firstTabInLine,tag:r.tag,anchor:r.anchor,kind:r.kind,result:r.result}}a(YD,"snapshotState");function kD(r,e){r.position=e.position,r.line=e.line,r.lineStart=e.lineStart,r.lineIndent=e.lineIndent,r.firstTabInLine=e.firstTabInLine,r.tag=e.tag,r.anchor=e.anchor,r.kind=e.kind,r.result=e.result}a(kD,"restoreState");var MD={YAML:a(function(e,t,n){e.version!==null&&Ue(e,"duplication of %YAML directive"),n.length!==1&&Ue(e,"YAML directive accepts exactly one argument");let i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&Ue(e,"ill-formed argument of the YAML directive");let s=parseInt(i[1],10),o=parseInt(i[2],10);s!==1&&Ue(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&py(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(e,t,n){let i;n.length!==2&&Ue(e,"TAG directive accepts exactly two arguments");let s=n[0];i=n[1],qD.test(s)||Ue(e,"ill-formed tag handle (first argument) of the TAG directive"),ts.call(e.tagMap,s)&&Ue(e,'there is a previously declared suffix for "'+s+'" tag handle'),GD.test(i)||Ue(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch{Ue(e,"tag prefix is malformed: "+i)}e.tagMap[s]=i},"handleTagDirective")};function Pa(r,e,t,n){if(e<t){let i=r.input.slice(e,t);if(n)for(let s=0,o=i.length;s<o;s+=1){let c=i.charCodeAt(s);c===9||c>=32&&c<=1114111||Ue(r,"expected valid JSON character")}else IY.test(i)&&Ue(r,"the stream contains non-printable characters");r.result+=i}}a(Pa,"captureSegment");function jD(r,e,t,n){jc.isObject(t)||Ue(r,"cannot merge mappings; the provided source object is unacceptable");let i=Object.keys(t);for(let s=0,o=i.length;s<o;s+=1){let c=i[s];r.maxTotalMergeKeys!==-1&&++r.totalMergeKeys>r.maxTotalMergeKeys&&Ue(r,"merge keys exceeded maxTotalMergeKeys ("+r.maxTotalMergeKeys+")"),ts.call(e,c)||(WD(e,c,t[c]),n[c]=!0)}}a(jD,"mergeMappings");function yu(r,e,t,n,i,s,o,c,l){if(Array.isArray(i)){i=Array.prototype.slice.call(i);for(let u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&Ue(r,"nested arrays are not supported inside keys"),typeof i=="object"&&LD(i[u])==="[object Object]"&&(i[u]="[object Object]")}if(typeof i=="object"&&LD(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(let u=0,f=s.length;u<f;u+=1)jD(r,e,s[u],t);else jD(r,e,s,t);else!r.json&&!ts.call(t,i)&&ts.call(e,i)&&(r.line=o||r.line,r.lineStart=c||r.lineStart,r.position=l||r.position,Ue(r,"duplicated mapping key")),WD(e,i,s),delete t[i];return e}a(yu,"storeMappingPair");function tT(r){let e=r.input.charCodeAt(r.position);e===10?r.position++:e===13?(r.position++,r.input.charCodeAt(r.position)===10&&r.position++):Ue(r,"a line break is expected"),r.line+=1,r.lineStart=r.position,r.firstTabInLine=-1}a(tT,"readLineBreak");function pr(r,e,t){let n=0,i=r.input.charCodeAt(r.position);for(;i!==0;){for(;Bo(i);)i===9&&r.firstTabInLine===-1&&(r.firstTabInLine=r.position),i=r.input.charCodeAt(++r.position);if(e&&i===35)do i=r.input.charCodeAt(++r.position);while(i!==10&&i!==13&&i!==0);if($s(i))for(tT(r),i=r.input.charCodeAt(r.position),n++,r.lineIndent=0;i===32;)r.lineIndent++,i=r.input.charCodeAt(++r.position);else break}return t!==-1&&n!==0&&r.lineIndent<t&&py(r,"deficient indentation"),n}a(pr,"skipSeparationSpace");function hy(r){let e=r.position,t=r.input.charCodeAt(e);return!!((t===45||t===46)&&t===r.input.charCodeAt(e+1)&&t===r.input.charCodeAt(e+2)&&(e+=3,t=r.input.charCodeAt(e),t===0||Hn(t)))}a(hy,"testDocumentSeparator");function rT(r,e){e===1?r.result+=" ":e>1&&(r.result+=jc.repeat(`
|
|
228
228
|
`,e-1))}a(rT,"writeFoldedLines");function MY(r,e,t){let n,i,s,o,c,l,u=r.kind,f=r.result,d=r.input.charCodeAt(r.position);if(Hn(d)||gu(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96)return!1;if(d===63||d===45){let p=r.input.charCodeAt(r.position+1);if(Hn(p)||t&&gu(p))return!1}for(r.kind="scalar",r.result="",n=i=r.position,s=!1;d!==0;){if(d===58){let p=r.input.charCodeAt(r.position+1);if(Hn(p)||t&&gu(p))break}else if(d===35){let p=r.input.charCodeAt(r.position-1);if(Hn(p))break}else{if(r.position===r.lineStart&&hy(r)||t&&gu(d))break;if($s(d))if(o=r.line,c=r.lineStart,l=r.lineIndent,pr(r,!1,-1),r.lineIndent>=e){s=!0,d=r.input.charCodeAt(r.position);continue}else{r.position=i,r.line=o,r.lineStart=c,r.lineIndent=l;break}}s&&(Pa(r,n,i,!1),rT(r,r.line-o),n=i=r.position,s=!1),Bo(d)||(i=r.position+1),d=r.input.charCodeAt(++r.position)}return Pa(r,n,i,!1),r.result?!0:(r.kind=u,r.result=f,!1)}a(MY,"readPlainScalar");function jY(r,e){let t,n,i=r.input.charCodeAt(r.position);if(i!==39)return!1;for(r.kind="scalar",r.result="",r.position++,t=n=r.position;(i=r.input.charCodeAt(r.position))!==0;)if(i===39)if(Pa(r,t,r.position,!0),i=r.input.charCodeAt(++r.position),i===39)t=r.position,r.position++,n=r.position;else return!0;else $s(i)?(Pa(r,t,n,!0),rT(r,pr(r,!1,e)),t=n=r.position):r.position===r.lineStart&&hy(r)?Ue(r,"unexpected end of the document within a single quoted scalar"):(r.position++,Bo(i)||(n=r.position));Ue(r,"unexpected end of the stream within a single quoted scalar")}a(jY,"readSingleQuotedScalar");function $Y(r,e){let t,n,i,s=r.input.charCodeAt(r.position);if(s!==34)return!1;for(r.kind="scalar",r.result="",r.position++,t=n=r.position;(s=r.input.charCodeAt(r.position))!==0;){if(s===34)return Pa(r,t,r.position,!0),r.position++,!0;if(s===92){if(Pa(r,t,r.position,!0),s=r.input.charCodeAt(++r.position),$s(s))pr(r,!1,e);else if(s<256&&HD[s])r.result+=zD[s],r.position++;else if((i=OY(s))>0){let o=i,c=0;for(;o>0;o--)s=r.input.charCodeAt(++r.position),(i=CY(s))>=0?c=(c<<4)+i:Ue(r,"expected hexadecimal character");r.result+=DY(c),r.position++}else Ue(r,"unknown escape sequence");t=n=r.position}else $s(s)?(Pa(r,t,n,!0),rT(r,pr(r,!1,e)),t=n=r.position):r.position===r.lineStart&&hy(r)?Ue(r,"unexpected end of the document within a double quoted scalar"):(r.position++,Bo(s)||(n=r.position))}Ue(r,"unexpected end of the stream within a double quoted scalar")}a($Y,"readDoubleQuotedScalar");function UY(r,e){let t=!0,n,i,s,o=r.tag,c,l=r.anchor,u,f,d,p,h=Object.create(null),_,y,S,w=r.input.charCodeAt(r.position);if(w===91)u=93,p=!1,c=[];else if(w===123)u=125,p=!0,c={};else return!1;for(r.anchor!==null&&$c(r,r.anchor,c),w=r.input.charCodeAt(++r.position);w!==0;){if(pr(r,!0,e),w=r.input.charCodeAt(r.position),w===u)return r.position++,r.tag=o,r.anchor=l,r.kind=p?"mapping":"sequence",r.result=c,!0;if(t?w===44&&Ue(r,"expected the node content, but found ','"):Ue(r,"missed comma between flow collection entries"),y=_=S=null,f=d=!1,w===63){let T=r.input.charCodeAt(r.position+1);Hn(T)&&(f=d=!0,r.position++,pr(r,!0,e))}n=r.line,i=r.lineStart,s=r.position,_u(r,e,fy,!1,!0),y=r.tag,_=r.result,pr(r,!0,e),w=r.input.charCodeAt(r.position),(d||r.line===n)&&w===58&&(f=!0,w=r.input.charCodeAt(++r.position),pr(r,!0,e),_u(r,e,fy,!1,!0),S=r.result),p?yu(r,c,h,y,_,S,n,i,s):f?c.push(yu(r,null,h,y,_,S,n,i,s)):c.push(_),pr(r,!0,e),w=r.input.charCodeAt(r.position),w===44?(t=!0,w=r.input.charCodeAt(++r.position)):t=!1}Ue(r,"unexpected end of the stream within a flow collection")}a(UY,"readFlowCollection");function BY(r,e){let t,n=eT,i=!1,s=!1,o=e,c=0,l=!1,u,f=r.input.charCodeAt(r.position);if(f===124)t=!1;else if(f===62)t=!0;else return!1;for(r.kind="scalar",r.result="";f!==0;)if(f=r.input.charCodeAt(++r.position),f===43||f===45)eT===n?n=f===43?FD:AY:Ue(r,"repeat of a chomping mode identifier");else if((u=PY(f))>=0)u===0?Ue(r,"bad explicit indentation width of a block scalar; it cannot be less than one"):s?Ue(r,"repeat of an indentation width identifier"):(o=e+u-1,s=!0);else break;if(Bo(f)){do f=r.input.charCodeAt(++r.position);while(Bo(f));if(f===35)do f=r.input.charCodeAt(++r.position);while(!$s(f)&&f!==0)}for(;f!==0;){for(tT(r),r.lineIndent=0,f=r.input.charCodeAt(r.position);(!s||r.lineIndent<o)&&f===32;)r.lineIndent++,f=r.input.charCodeAt(++r.position);if(!s&&r.lineIndent>o&&(o=r.lineIndent),$s(f)){c++;continue}if(!s&&o===0&&Ue(r,"missing indentation for block scalar"),r.lineIndent<o){n===FD?r.result+=jc.repeat(`
|
|
229
229
|
`,i?1+c:c):n===eT&&i&&(r.result+=`
|
|
@@ -232,7 +232,7 @@ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>`});var Pv=E(cn=>{"use strict";va
|
|
|
232
232
|
`,c+1)):c===0?i&&(r.result+=" "):r.result+=jc.repeat(`
|
|
233
233
|
`,c):r.result+=jc.repeat(`
|
|
234
234
|
`,i?1+c:c),i=!0,s=!0,c=0;let d=r.position;for(;!$s(f)&&f!==0;)f=r.input.charCodeAt(++r.position);Pa(r,d,r.position,!1)}return!0}a(BY,"readBlockScalar");function $D(r,e){let t=r.tag,n=r.anchor,i=[],s=!1;if(r.firstTabInLine!==-1)return!1;r.anchor!==null&&$c(r,r.anchor,i);let o=r.input.charCodeAt(r.position);for(;o!==0&&(r.firstTabInLine!==-1&&(r.position=r.firstTabInLine,Ue(r,"tab characters must not be used in indentation")),o===45);){let c=r.input.charCodeAt(r.position+1);if(!Hn(c))break;if(s=!0,r.position++,pr(r,!0,-1)&&r.lineIndent<=e){i.push(null),o=r.input.charCodeAt(r.position);continue}let l=r.line;if(_u(r,e,VD,!1,!0),i.push(r.result),pr(r,!0,-1),o=r.input.charCodeAt(r.position),(r.line===l||r.lineIndent>e)&&o!==0)Ue(r,"bad indentation of a sequence entry");else if(r.lineIndent<e)break}return s?(r.tag=t,r.anchor=n,r.kind="sequence",r.result=i,!0):!1}a($D,"readBlockSequence");function QD(r,e,t){let n,i,s,o,c=r.tag,l=r.anchor,u={},f=Object.create(null),d=null,p=null,h=null,_=!1,y=!1;if(r.firstTabInLine!==-1)return!1;r.anchor!==null&&$c(r,r.anchor,u);let S=r.input.charCodeAt(r.position);for(;S!==0;){!_&&r.firstTabInLine!==-1&&(r.position=r.firstTabInLine,Ue(r,"tab characters must not be used in indentation"));let w=r.input.charCodeAt(r.position+1),T=r.line;if((S===63||S===58)&&Hn(w))S===63?(_&&(yu(r,u,f,d,p,null,i,s,o),d=p=h=null),y=!0,_=!0,n=!0):_?(_=!1,n=!0):Ue(r,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),r.position+=1,S=w;else{if(i=r.line,s=r.lineStart,o=r.position,!_u(r,t,BD,!1,!0))break;if(r.line===T){for(S=r.input.charCodeAt(r.position);Bo(S);)S=r.input.charCodeAt(++r.position);if(S===58)S=r.input.charCodeAt(++r.position),Hn(S)||Ue(r,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(yu(r,u,f,d,p,null,i,s,o),d=p=h=null),y=!0,_=!1,n=!1,d=r.tag,p=r.result;else if(y)Ue(r,"can not read an implicit mapping pair; a colon is missed");else return r.tag=c,r.anchor=l,!0}else if(y)Ue(r,"can not read a block mapping entry; a multiline key may not be an implicit key");else return r.tag=c,r.anchor=l,!0}if((r.line===T||r.lineIndent>e)&&(_&&(i=r.line,s=r.lineStart,o=r.position),_u(r,e,dy,!0,n)&&(_?p=r.result:h=r.result),_||(yu(r,u,f,d,p,h,i,s,o),d=p=h=null),pr(r,!0,-1),S=r.input.charCodeAt(r.position)),(r.line===T||r.lineIndent>e)&&S!==0)Ue(r,"bad indentation of a mapping entry");else if(r.lineIndent<e)break}return _&&yu(r,u,f,d,p,null,i,s,o),y&&(r.tag=c,r.anchor=l,r.kind="mapping",r.result=u),y}a(QD,"readBlockMapping");function VY(r){let e=!1,t=!1,n,i,s=r.input.charCodeAt(r.position);if(s!==33)return!1;r.tag!==null&&Ue(r,"duplication of a tag property"),s=r.input.charCodeAt(++r.position),s===60?(e=!0,s=r.input.charCodeAt(++r.position)):s===33?(t=!0,n="!!",s=r.input.charCodeAt(++r.position)):n="!";let o=r.position;if(e){do s=r.input.charCodeAt(++r.position);while(s!==0&&s!==62);r.position<r.length?(i=r.input.slice(o,r.position),s=r.input.charCodeAt(++r.position)):Ue(r,"unexpected end of the stream within a verbatim tag")}else{for(;s!==0&&!Hn(s);)s===33&&(t?Ue(r,"tag suffix cannot contain exclamation marks"):(n=r.input.slice(o-1,r.position+1),qD.test(n)||Ue(r,"named tag handle cannot contain such characters"),t=!0,o=r.position+1)),s=r.input.charCodeAt(++r.position);i=r.input.slice(o,r.position),RY.test(i)&&Ue(r,"tag suffix cannot contain flow indicator characters")}i&&!GD.test(i)&&Ue(r,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch{Ue(r,"tag name is malformed: "+i)}return e?r.tag=i:ts.call(r.tagMap,n)?r.tag=r.tagMap[n]+i:n==="!"?r.tag="!"+i:n==="!!"?r.tag="tag:yaml.org,2002:"+i:Ue(r,'undeclared tag handle "'+n+'"'),!0}a(VY,"readTagProperty");function qY(r){let e=r.input.charCodeAt(r.position);if(e!==38)return!1;r.anchor!==null&&Ue(r,"duplication of an anchor property"),e=r.input.charCodeAt(++r.position);let t=r.position;for(;e!==0&&!Hn(e)&&!gu(e);)e=r.input.charCodeAt(++r.position);return r.position===t&&Ue(r,"name of an anchor node must contain at least one character"),r.anchor=r.input.slice(t,r.position),!0}a(qY,"readAnchorProperty");function GY(r){let e=r.input.charCodeAt(r.position);if(e!==42)return!1;e=r.input.charCodeAt(++r.position);let t=r.position;for(;e!==0&&!Hn(e)&&!gu(e);)e=r.input.charCodeAt(++r.position);r.position===t&&Ue(r,"name of an alias node must contain at least one character");let n=r.input.slice(t,r.position);return ts.call(r.anchorMap,n)||Ue(r,'unidentified alias "'+n+'"'),r.result=r.anchorMap[n],pr(r,!0,-1),!0}a(GY,"readAlias");function WY(r,e,t,n){let i=YD(r);return LY(r),kD(r,e),r.tag=null,r.anchor=null,r.kind=null,r.result=null,QD(r,t,n)&&r.kind==="mapping"?(NY(r),!0):(kY(r),kD(r,i),!1)}a(WY,"tryReadBlockMappingFromProperty");function _u(r,e,t,n,i){let s,o,c=1,l=!1,u=!1,f=null,d,p,h;r.depth>=r.maxDepth&&Ue(r,"nesting exceeded maxDepth ("+r.maxDepth+")"),r.depth+=1,r.listener!==null&&r.listener("open",r),r.tag=null,r.anchor=null,r.kind=null,r.result=null;let _=s=o=dy===t||VD===t;if(n&&pr(r,!0,-1)&&(l=!0,r.lineIndent>e?c=1:r.lineIndent===e?c=0:r.lineIndent<e&&(c=-1)),c===1)for(;;){let y=r.input.charCodeAt(r.position),S=YD(r);if(l&&(y===33&&r.tag!==null||y===38&&r.anchor!==null)||!VY(r)&&!qY(r))break;f===null&&(f=S),pr(r,!0,-1)?(l=!0,o=_,r.lineIndent>e?c=1:r.lineIndent===e?c=0:r.lineIndent<e&&(c=-1)):o=!1}if(o&&(o=l||i),c===1||dy===t)if(fy===t||BD===t?p=e:p=e+1,h=r.position-r.lineStart,c===1)if(o&&($D(r,h)||QD(r,h,p))||UY(r,p))u=!0;else{let y=r.input.charCodeAt(r.position);f!==null&&_&&!o&&y!==124&&y!==62&&WY(r,f,f.position-f.lineStart,p)||s&&BY(r,p)||jY(r,p)||$Y(r,p)?u=!0:GY(r)?(u=!0,(r.tag!==null||r.anchor!==null)&&Ue(r,"alias node should not have any properties")):MY(r,p,fy===t)&&(u=!0,r.tag===null&&(r.tag="?")),r.anchor!==null&&$c(r,r.anchor,r.result)}else c===0&&(u=o&&$D(r,h));if(r.tag===null)r.anchor!==null&&$c(r,r.anchor,r.result);else if(r.tag==="?"){r.result!==null&&r.kind!=="scalar"&&Ue(r,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+r.kind+'"');for(let y=0,S=r.implicitTypes.length;y<S;y+=1)if(d=r.implicitTypes[y],d.resolve(r.result)){r.result=d.construct(r.result),r.tag=d.tag,r.anchor!==null&&$c(r,r.anchor,r.result);break}}else if(r.tag!=="!"){if(ts.call(r.typeMap[r.kind||"fallback"],r.tag))d=r.typeMap[r.kind||"fallback"][r.tag];else{d=null;let y=r.typeMap.multi[r.kind||"fallback"];for(let S=0,w=y.length;S<w;S+=1)if(r.tag.slice(0,y[S].tag.length)===y[S].tag){d=y[S];break}}d||Ue(r,"unknown tag !<"+r.tag+">"),r.result!==null&&d.kind!==r.kind&&Ue(r,"unacceptable node kind for !<"+r.tag+'> tag; it should be "'+d.kind+'", not "'+r.kind+'"'),d.resolve(r.result,r.tag)?(r.result=d.construct(r.result,r.tag),r.anchor!==null&&$c(r,r.anchor,r.result)):Ue(r,"cannot resolve a node with !<"+r.tag+"> explicit tag")}return r.listener!==null&&r.listener("close",r),r.depth-=1,r.tag!==null||r.anchor!==null||u}a(_u,"composeNode");function HY(r){let e=r.position,t=!1,n;for(r.version=null,r.checkLineBreaks=r.legacy,r.tagMap=Object.create(null),r.anchorMap=Object.create(null);(n=r.input.charCodeAt(r.position))!==0&&(pr(r,!0,-1),n=r.input.charCodeAt(r.position),!(r.lineIndent>0||n!==37));){t=!0,n=r.input.charCodeAt(++r.position);let i=r.position;for(;n!==0&&!Hn(n);)n=r.input.charCodeAt(++r.position);let s=r.input.slice(i,r.position),o=[];for(s.length<1&&Ue(r,"directive name must not be less than one character in length");n!==0;){for(;Bo(n);)n=r.input.charCodeAt(++r.position);if(n===35){do n=r.input.charCodeAt(++r.position);while(n!==0&&!$s(n));break}if($s(n))break;for(i=r.position;n!==0&&!Hn(n);)n=r.input.charCodeAt(++r.position);o.push(r.input.slice(i,r.position))}n!==0&&tT(r),ts.call(MD,s)?MD[s](r,s,o):py(r,'unknown document directive "'+s+'"')}if(pr(r,!0,-1),r.lineIndent===0&&r.input.charCodeAt(r.position)===45&&r.input.charCodeAt(r.position+1)===45&&r.input.charCodeAt(r.position+2)===45?(r.position+=3,pr(r,!0,-1)):t&&Ue(r,"directives end mark is expected"),_u(r,r.lineIndent-1,dy,!1,!0),pr(r,!0,-1),r.checkLineBreaks&&xY.test(r.input.slice(e,r.position))&&py(r,"non-ASCII line breaks are interpreted as content"),r.documents.push(r.result),r.position===r.lineStart&&hy(r)){r.input.charCodeAt(r.position)===46&&(r.position+=3,pr(r,!0,-1));return}r.position<r.length-1&&Ue(r,"end of the stream or a document separator is expected")}a(HY,"readDocument");function XD(r,e){r=String(r),e=e||{},r.length!==0&&(r.charCodeAt(r.length-1)!==10&&r.charCodeAt(r.length-1)!==13&&(r+=`
|
|
235
|
-
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));let t=new FY(r,e),n=r.indexOf("\0");for(n!==-1&&(t.position=n,Ue(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)HY(t);return t.documents}a(XD,"loadDocuments");function zY(r,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);let n=XD(r,t);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}a(zY,"loadAll");function KY(r,e){let t=XD(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new UD("expected a single document in the stream, but found more")}}a(KY,"load");nT.exports.loadAll=zY;nT.exports.load=KY});var bF=E((
|
|
235
|
+
`),r.charCodeAt(0)===65279&&(r=r.slice(1)));let t=new FY(r,e),n=r.indexOf("\0");for(n!==-1&&(t.position=n,Ue(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)HY(t);return t.documents}a(XD,"loadDocuments");function zY(r,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);let n=XD(r,t);if(typeof e!="function")return n;for(let i=0,s=n.length;i<s;i+=1)e(n[i])}a(zY,"loadAll");function KY(r,e){let t=XD(r,e);if(t.length!==0){if(t.length===1)return t[0];throw new UD("expected a single document in the stream, but found more")}}a(KY,"load");nT.exports.loadAll=zY;nT.exports.load=KY});var bF=E((ASe,_F)=>{"use strict";var yy=hu(),Bd=mu(),YY=uy(),aF=Object.prototype.toString,cF=Object.prototype.hasOwnProperty,cT=65279,QY=9,jd=10,XY=13,JY=32,ZY=33,eQ=34,iT=35,tQ=37,rQ=38,nQ=39,iQ=42,lF=44,sQ=45,my=58,oQ=61,aQ=62,cQ=63,lQ=64,uF=91,fF=93,uQ=96,dF=123,fQ=124,pF=125,un={};un[0]="\\0";un[7]="\\a";un[8]="\\b";un[9]="\\t";un[10]="\\n";un[11]="\\v";un[12]="\\f";un[13]="\\r";un[27]="\\e";un[34]='\\"';un[92]="\\\\";un[133]="\\N";un[160]="\\_";un[8232]="\\L";un[8233]="\\P";var dQ=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],pQ=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function hQ(r,e){if(e===null)return{};let t={},n=Object.keys(e);for(let i=0,s=n.length;i<s;i+=1){let o=n[i],c=String(e[o]);o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2));let l=r.compiledTypeMap.fallback[o];l&&cF.call(l.styleAliases,c)&&(c=l.styleAliases[c]),t[o]=c}return t}a(hQ,"compileStyleMap");function mQ(r){let e,t,n=r.toString(16).toUpperCase();if(r<=255)e="x",t=2;else if(r<=65535)e="u",t=4;else if(r<=4294967295)e="U",t=8;else throw new Bd("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+e+yy.repeat("0",t-n.length)+n}a(mQ,"encodeHex");var gQ=1,$d=2;function yQ(r){this.schema=r.schema||YY,this.indent=Math.max(1,r.indent||2),this.noArrayIndent=r.noArrayIndent||!1,this.skipInvalid=r.skipInvalid||!1,this.flowLevel=yy.isNothing(r.flowLevel)?-1:r.flowLevel,this.styleMap=hQ(this.schema,r.styles||null),this.sortKeys=r.sortKeys||!1,this.lineWidth=r.lineWidth||80,this.noRefs=r.noRefs||!1,this.noCompatMode=r.noCompatMode||!1,this.condenseFlow=r.condenseFlow||!1,this.quotingType=r.quotingType==='"'?$d:gQ,this.forceQuotes=r.forceQuotes||!1,this.replacer=typeof r.replacer=="function"?r.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}a(yQ,"State");function ZD(r,e){let t=yy.repeat(" ",e),n=0,i="",s=r.length;for(;n<s;){let o,c=r.indexOf(`
|
|
236
236
|
`,n);c===-1?(o=r.slice(n),n=s):(o=r.slice(n,c+1),n=c+1),o.length&&o!==`
|
|
237
237
|
`&&(i+=t),i+=o}return i}a(ZD,"indentString");function sT(r,e){return`
|
|
238
238
|
`+yy.repeat(" ",r.indent*e)}a(sT,"generateNextLine");function _Q(r,e){for(let t=0,n=r.implicitTypes.length;t<n;t+=1)if(r.implicitTypes[t].resolve(e))return!0;return!1}a(_Q,"testImplicitResolving");function gy(r){return r===JY||r===QY}a(gy,"isWhitespace");function Ud(r){return r>=32&&r<=126||r>=161&&r<=55295&&r!==8232&&r!==8233||r>=57344&&r<=65533&&r!==cT||r>=65536&&r<=1114111}a(Ud,"isPrintable");function eF(r){return Ud(r)&&r!==cT&&r!==XY&&r!==jd}a(eF,"isNsCharOrWhitespace");function tF(r,e,t){let n=eF(r),i=n&&!gy(r);return(t?n:n&&r!==lF&&r!==uF&&r!==fF&&r!==dF&&r!==pF)&&r!==iT&&!(e===my&&!i)||eF(e)&&!gy(e)&&r===iT||e===my&&i}a(tF,"isPlainSafe");function bQ(r){return Ud(r)&&r!==cT&&!gy(r)&&r!==sQ&&r!==cQ&&r!==my&&r!==lF&&r!==uF&&r!==fF&&r!==dF&&r!==pF&&r!==iT&&r!==rQ&&r!==iQ&&r!==ZY&&r!==fQ&&r!==oQ&&r!==aQ&&r!==nQ&&r!==eQ&&r!==tQ&&r!==lQ&&r!==uQ}a(bQ,"isPlainSafeFirst");function SQ(r){return!gy(r)&&r!==my}a(SQ,"isPlainSafeLast");function Md(r,e){let t=r.charCodeAt(e),n;return t>=55296&&t<=56319&&e+1<r.length&&(n=r.charCodeAt(e+1),n>=56320&&n<=57343)?(t-55296)*1024+n-56320+65536:t}a(Md,"codePointAt");function hF(r){return/^\n* /.test(r)}a(hF,"needIndentIndicator");var mF=1,oT=2,gF=3,yF=4,bu=5;function wQ(r,e,t,n,i,s,o,c){let l,u=0,f=null,d=!1,p=!1,h=n!==-1,_=-1,y=bQ(Md(r,0))&&SQ(Md(r,r.length-1));if(e||o)for(l=0;l<r.length;u>=65536?l+=2:l++){if(u=Md(r,l),!Ud(u))return bu;y=y&&tF(u,f,c),f=u}else{for(l=0;l<r.length;u>=65536?l+=2:l++){if(u=Md(r,l),u===jd)d=!0,h&&(p=p||l-_-1>n&&r[_+1]!==" ",_=l);else if(!Ud(u))return bu;y=y&&tF(u,f,c),f=u}p=p||h&&l-_-1>n&&r[_+1]!==" "}return!d&&!p?y&&!o&&!i(r)?mF:s===$d?bu:oT:t>9&&hF(r)?bu:o?s===$d?bu:oT:p?yF:gF}a(wQ,"chooseScalarStyle");function EQ(r,e,t,n,i){r.dump=(function(){if(e.length===0)return r.quotingType===$d?'""':"''";if(!r.noCompatMode&&(dQ.indexOf(e)!==-1||pQ.test(e)))return r.quotingType===$d?'"'+e+'"':"'"+e+"'";let s=r.indent*Math.max(1,t),o=r.lineWidth===-1?-1:Math.max(Math.min(r.lineWidth,40),r.lineWidth-s),c=n||r.flowLevel>-1&&t>=r.flowLevel;function l(u){return _Q(r,u)}switch(a(l,"testAmbiguity"),wQ(e,c,r.indent,o,l,r.quotingType,r.forceQuotes&&!n,i)){case mF:return e;case oT:return"'"+e.replace(/'/g,"''")+"'";case gF:return"|"+rF(e,r.indent)+nF(ZD(e,s));case yF:return">"+rF(e,r.indent)+nF(ZD(vQ(e,o),s));case bu:return'"'+TQ(e,o)+'"';default:throw new Bd("impossible error: invalid scalar style")}})()}a(EQ,"writeScalar");function rF(r,e){let t=hF(r)?String(e):"",n=r[r.length-1]===`
|
|
@@ -247,7 +247,7 @@ PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>`});var Pv=E(cn=>{"use strict";va
|
|
|
247
247
|
`+r.slice(i,s),i=s+1),o=c;return l+=`
|
|
248
248
|
`,r.length-i>e&&o>i?l+=r.slice(i,o)+`
|
|
249
249
|
`+r.slice(o+1):l+=r.slice(i),l.slice(1)}a(iF,"foldLine");function TQ(r){let e="",t=0;for(let n=0;n<r.length;t>=65536?n+=2:n++){t=Md(r,n);let i=un[t];!i&&Ud(t)?(e+=r[n],t>=65536&&(e+=r[n+1])):e+=i||mQ(t)}return e}a(TQ,"escapeString");function AQ(r,e,t){let n="",i=r.tag;for(let s=0,o=t.length;s<o;s+=1){let c=t[s];r.replacer&&(c=r.replacer.call(t,String(s),c)),(Vo(r,e,c,!1,!1)||typeof c>"u"&&Vo(r,e,null,!1,!1))&&(n!==""&&(n+=","+(r.condenseFlow?"":" ")),n+=r.dump)}r.tag=i,r.dump="["+n+"]"}a(AQ,"writeFlowSequence");function sF(r,e,t,n){let i="",s=r.tag;for(let o=0,c=t.length;o<c;o+=1){let l=t[o];r.replacer&&(l=r.replacer.call(t,String(o),l)),(Vo(r,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&Vo(r,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=sT(r,e)),r.dump&&jd===r.dump.charCodeAt(0)?i+="-":i+="- ",i+=r.dump)}r.tag=s,r.dump=i||"[]"}a(sF,"writeBlockSequence");function IQ(r,e,t){let n="",i=r.tag,s=Object.keys(t);for(let o=0,c=s.length;o<c;o+=1){let l="";n!==""&&(l+=", "),r.condenseFlow&&(l+='"');let u=s[o],f=t[u];r.replacer&&(f=r.replacer.call(t,u,f)),Vo(r,e,u,!1,!1)&&(r.dump.length>1024&&(l+="? "),l+=r.dump+(r.condenseFlow?'"':"")+":"+(r.condenseFlow?"":" "),Vo(r,e,f,!1,!1)&&(l+=r.dump,n+=l))}r.tag=i,r.dump="{"+n+"}"}a(IQ,"writeFlowMapping");function xQ(r,e,t,n){let i="",s=r.tag,o=Object.keys(t);if(r.sortKeys===!0)o.sort();else if(typeof r.sortKeys=="function")o.sort(r.sortKeys);else if(r.sortKeys)throw new Bd("sortKeys must be a boolean or a function");for(let c=0,l=o.length;c<l;c+=1){let u="";(!n||i!=="")&&(u+=sT(r,e));let f=o[c],d=t[f];if(r.replacer&&(d=r.replacer.call(t,f,d)),!Vo(r,e+1,f,!0,!0,!0))continue;let p=r.tag!==null&&r.tag!=="?"||r.dump&&r.dump.length>1024;p&&(r.dump&&jd===r.dump.charCodeAt(0)?u+="?":u+="? "),u+=r.dump,p&&(u+=sT(r,e)),Vo(r,e+1,d,!0,p)&&(r.dump&&jd===r.dump.charCodeAt(0)?u+=":":u+=": ",u+=r.dump,i+=u)}r.tag=s,r.dump=i||"{}"}a(xQ,"writeBlockMapping");function oF(r,e,t){let n=t?r.explicitTypes:r.implicitTypes;for(let i=0,s=n.length;i<s;i+=1){let o=n[i];if((o.instanceOf||o.predicate)&&(!o.instanceOf||typeof e=="object"&&e instanceof o.instanceOf)&&(!o.predicate||o.predicate(e))){if(t?o.multi&&o.representName?r.tag=o.representName(e):r.tag=o.tag:r.tag="?",o.represent){let c=r.styleMap[o.tag]||o.defaultStyle,l;if(aF.call(o.represent)==="[object Function]")l=o.represent(e,c);else if(cF.call(o.represent,c))l=o.represent[c](e,c);else throw new Bd("!<"+o.tag+'> tag resolver accepts not "'+c+'" style');r.dump=l}return!0}}return!1}a(oF,"detectType");function Vo(r,e,t,n,i,s,o){r.tag=null,r.dump=t,oF(r,t,!1)||oF(r,t,!0);let c=aF.call(r.dump),l=n;n&&(n=r.flowLevel<0||r.flowLevel>e);let u=c==="[object Object]"||c==="[object Array]",f,d;if(u&&(f=r.duplicates.indexOf(t),d=f!==-1),(r.tag!==null&&r.tag!=="?"||d||r.indent!==2&&e>0)&&(i=!1),d&&r.usedDuplicates[f])r.dump="*ref_"+f;else{if(u&&d&&!r.usedDuplicates[f]&&(r.usedDuplicates[f]=!0),c==="[object Object]")n&&Object.keys(r.dump).length!==0?(xQ(r,e,r.dump,i),d&&(r.dump="&ref_"+f+r.dump)):(IQ(r,e,r.dump),d&&(r.dump="&ref_"+f+" "+r.dump));else if(c==="[object Array]")n&&r.dump.length!==0?(r.noArrayIndent&&!o&&e>0?sF(r,e-1,r.dump,i):sF(r,e,r.dump,i),d&&(r.dump="&ref_"+f+r.dump)):(AQ(r,e,r.dump),d&&(r.dump="&ref_"+f+" "+r.dump));else if(c==="[object String]")r.tag!=="?"&&EQ(r,r.dump,e,s,l);else{if(c==="[object Undefined]")return!1;if(r.skipInvalid)return!1;throw new Bd("unacceptable kind of an object to dump "+c)}if(r.tag!==null&&r.tag!=="?"){let p=encodeURI(r.tag[0]==="!"?r.tag.slice(1):r.tag).replace(/!/g,"%21");r.tag[0]==="!"?p="!"+p:p.slice(0,18)==="tag:yaml.org,2002:"?p="!!"+p.slice(18):p="!<"+p+">",r.dump=p+" "+r.dump}}return!0}a(Vo,"writeNode");function RQ(r,e){let t=[],n=[];aT(r,t,n);let i=n.length;for(let s=0;s<i;s+=1)e.duplicates.push(t[n[s]]);e.usedDuplicates=new Array(i)}a(RQ,"getDuplicateReferences");function aT(r,e,t){if(r!==null&&typeof r=="object"){let n=e.indexOf(r);if(n!==-1)t.indexOf(n)===-1&&t.push(n);else if(e.push(r),Array.isArray(r))for(let i=0,s=r.length;i<s;i+=1)aT(r[i],e,t);else{let i=Object.keys(r);for(let s=0,o=i.length;s<o;s+=1)aT(r[i[s]],e,t)}}}a(aT,"inspectNode");function CQ(r,e){e=e||{};let t=new yQ(e);t.noRefs||RQ(r,t);let n=r;return t.replacer&&(n=t.replacer.call({"":n},"",n)),Vo(t,0,n,!0,!0)?t.dump+`
|
|
250
|
-
`:""}a(CQ,"dump");_F.exports.dump=CQ});var wF=E((
|
|
250
|
+
`:""}a(CQ,"dump");_F.exports.dump=CQ});var wF=E((xSe,Rn)=>{"use strict";var SF=JD(),OQ=bF();function lT(r,e){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}a(lT,"renamed");Rn.exports.Type=ln();Rn.exports.Schema=kv();Rn.exports.FAILSAFE_SCHEMA=Uv();Rn.exports.JSON_SCHEMA=Wv();Rn.exports.CORE_SCHEMA=Hv();Rn.exports.DEFAULT_SCHEMA=uy();Rn.exports.load=SF.load;Rn.exports.loadAll=SF.loadAll;Rn.exports.dump=OQ.dump;Rn.exports.YAMLException=mu();Rn.exports.types={binary:Qv(),float:Gv(),map:$v(),null:Bv(),pairs:Jv(),set:Zv(),timestamp:zv(),bool:Vv(),int:qv(),merge:Kv(),omap:Xv(),seq:jv(),str:Mv()};Rn.exports.safeLoad=lT("safeLoad","load");Rn.exports.safeLoadAll=lT("safeLoadAll","loadAll");Rn.exports.safeDump=lT("safeDump","dump")});var vF=E(Vd=>{"use strict";var PQ=Vd&&Vd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vd,"__esModule",{value:!0});Vd.parseYamlFrontmatterTolerant=DQ;var EF=PQ(wF());function DQ(r,e){let t;try{t=EF.default.load(r)}catch(n){try{t=EF.default.load(r,{json:!0})}catch{return null}let i=n instanceof Error?n.message.split(`
|
|
251
251
|
`)[0]:String(n);console.warn(`[frontmatter] tolerant-parsed malformed YAML${e?` (${e})`:""} \u2014 resolving last-wins: ${i}`)}return typeof t=="object"&&t!==null?t:null}a(DQ,"parseYamlFrontmatterTolerant")});var TF=E(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.EffortSortingHelpers=void 0;var uT=class r{static{a(this,"EffortSortingHelpers")}static getTimeFromTimestamp(e){if(!e)return"00:00:00";let t=new Date(e);if(isNaN(t.getTime()))return"00:00:00";let n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),s=String(t.getSeconds()).padStart(2,"0");return`${n}:${i}:${s}`}static sortByStartTime(e,t){let n=r.getTimeFromTimestamp(e.startTimestamp),i=r.getTimeFromTimestamp(t.startTimestamp),s=n==="00:00:00",o=i==="00:00:00";return s&&!o?1:!s&&o?-1:n.localeCompare(i)}static sortByPriority(e,t){if(e.isTrashed!==t.isTrashed)return e.isTrashed?1:-1;if(e.isDone!==t.isDone)return e.isDone?1:-1;let n=typeof e.metadata.ems__Effort_votes=="number"?e.metadata.ems__Effort_votes:0,i=typeof t.metadata.ems__Effort_votes=="number"?t.metadata.ems__Effort_votes:0;return n!==i?i-n:e.startTime&&t.startTime?e.startTime.localeCompare(t.startTime):e.startTime?-1:t.startTime?1:0}};_y.EffortSortingHelpers=uT});var AF=E(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.FilenameValidator=void 0;var Uc=class{static{a(this,"FilenameValidator")}static validate(e,t={}){let{maxLength:n=this.DEFAULT_MAX_LENGTH,replacementChar:i=this.DEFAULT_REPLACEMENT,allowEmpty:s=!1}=t,o=[];if(!e||e.trim().length===0)return s||o.push("Filename cannot be empty"),{valid:o.length===0,sanitized:"",errors:o};e.endsWith(" ")&&o.push("Filename should not end with a space");let c=e.trim();this.INVALID_CHARS_PATTERN.test(c)&&o.push('Filename contains invalid characters: / \\ : * ? " < > |');let l=this.getBaseName(c);this.RESERVED_NAMES.has(l.toUpperCase())&&o.push(`"${l}" is a reserved filename on Windows`),c.length>n&&o.push(`Filename exceeds maximum length of ${n} characters`),c.startsWith(".")&&o.push("Filename should not start with a dot"),c.endsWith(".")&&o.push("Filename should not end with a dot");let u=this.sanitize(e,{maxLength:n,replacementChar:i});return{valid:o.length===0,sanitized:u,errors:o}}static sanitize(e,t={}){let{maxLength:n=this.DEFAULT_MAX_LENGTH,replacementChar:i=this.DEFAULT_REPLACEMENT}=t;if(!e||e.trim().length===0)return"";let s=e.trim();for(s=s.replace(this.INVALID_CHARS_PATTERN,i);s.startsWith(".")&&s.length>1;)s=s.substring(1);for(;s.length>0&&(s.endsWith(".")||s.endsWith(" "));)s=s.slice(0,-1);for(s.includes(i)&&(s=s.split(i).filter(u=>u!=="").join(i));s.startsWith(i);)s=s.slice(i.length);for(;s.endsWith(i);)s=s.slice(0,-i.length);let o=this.getBaseName(s);if(this.RESERVED_NAMES.has(o.toUpperCase())){let c=this.getExtension(s);s=o+i+c}if(s.length>n)for(s=s.slice(0,n);s.endsWith(i);)s=s.slice(0,-i.length);return s}static hasInvalidChars(e){return this.INVALID_CHARS_PATTERN.test(e)}static getInvalidChars(e){let t=e.match(this.INVALID_CHARS_PATTERN);return t?[...new Set(t)]:[]}static getBaseName(e){let t=e.lastIndexOf(".");return t===-1||t===0?e:e.substring(0,t)}static getExtension(e){let t=e.lastIndexOf(".");return t===-1||t===0?"":e.substring(t)}};by.FilenameValidator=Uc;Uc.INVALID_CHARS_PATTERN=/[/\\:*?"<>|\x00-\x1F]/g;Uc.RESERVED_NAMES=new Set(["CON","PRN","AUX","NUL","COM1","COM2","COM3","COM4","COM5","COM6","COM7","COM8","COM9","LPT1","LPT2","LPT3","LPT4","LPT5","LPT6","LPT7","LPT8","LPT9"]);Uc.DEFAULT_MAX_LENGTH=200;Uc.DEFAULT_REPLACEMENT="_"});var dT=E(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.NTriplesSerializer=void 0;var fT=class{static{a(this,"NTriplesSerializer")}serialize(e,t={}){let n=t.newline??`
|
|
252
252
|
`;return e.length===0?"":e.map(i=>i.toString()).join(n)+n}serializeChunk(e,t){return e.length===0?"":e.map(n=>n.toString()).join(t)+t}};Sy.NTriplesSerializer=fT});var IF=E(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});wy.TurtleSerializer=void 0;var Su=Jt(),FQ=dT(),LQ={rdf:Su.Namespace.RDF.iri.value,rdfs:Su.Namespace.RDFS.iri.value,owl:Su.Namespace.OWL.iri.value,xsd:Su.Namespace.XSD.iri.value,exo:Su.Namespace.EXO.iri.value,ems:Su.Namespace.EMS.iri.value},pT=class{static{a(this,"TurtleSerializer")}constructor(){this.nTriplesSerializer=new FQ.NTriplesSerializer}serialize(e,t={}){let n=t.newline??`
|
|
253
253
|
`,i=this.composePrefixes(t),s=this.serializePrefixes(i,n),o=this.nTriplesSerializer.serialize(e,{newline:n}).trimEnd();return s?o?`${s}${n}${n}${o}${n}`:`${s}${n}`:o?`${o}${n}`:""}serializePrefixes(e,t){let n=Object.entries(e);return n.length===0?"":n.map(([i,s])=>`@prefix ${i}: <${s}> .`).join(t)}composePrefixes(e){return e.includeDefaultPrefixes??!0?{...LQ,...e.prefixes??{}}:{...e.prefixes??{}}}serializeTriplesOnly(e,t){return this.nTriplesSerializer.serializeChunk(e,t).trimEnd()}};wy.TurtleSerializer=pT});var CF=E(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.JSONLDSerializer=void 0;var xF=Ke(),RF=qt(),NQ=tt(),wu=Jt(),kQ={rdf:wu.Namespace.RDF.iri.value,rdfs:wu.Namespace.RDFS.iri.value,owl:wu.Namespace.OWL.iri.value,xsd:wu.Namespace.XSD.iri.value,exo:wu.Namespace.EXO.iri.value,ems:wu.Namespace.EMS.iri.value},hT=class{static{a(this,"JSONLDSerializer")}toDocument(e,t={}){let n={...kQ,...t.context??{}},i=new Map;for(let s of e){let o=this.subjectToId(s.subject),c=this.compactIri(s.predicate.value,n),l=this.objectToJSONLD(s.object,n),u=i.get(o)??{"@id":o},f=u[c];f===void 0?u[c]=l:Array.isArray(f)?f.push(l):u[c]=[f,l],i.set(o,u)}return{"@context":n,"@graph":Array.from(i.values())}}serialize(e,t={}){let n=this.toDocument(e,t),i=t.pretty?t.indent??2:void 0;return JSON.stringify(n,null,i)}subjectToId(e){return e instanceof xF.IRI?e.value:e instanceof RF.BlankNode?`_:${e.id}`:String(e)}compactIri(e,t){for(let[n,i]of Object.entries(t))if(e.startsWith(i)){let s=e.slice(i.length);if(s.length>0)return`${n}:${s}`}return e}objectToJSONLD(e,t){if(e instanceof xF.IRI)return{"@id":e.value};if(e instanceof RF.BlankNode)return{"@id":`_:${e.id}`};if(e instanceof NQ.Literal){let n={"@value":e.value};return e.datatype?n["@type"]=this.compactIri(e.datatype.value,t):e.language&&(n["@language"]=e.language,e.hasDirection()&&e.direction&&(n["@direction"]=e.direction)),n}return e}};Ey.JSONLDSerializer=hT});var yT=E(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.NTriplesParser=void 0;var MQ=ri(),OF=Ke(),mT=tt(),jQ=qt(),Eu=Jt(),$Q={rdf:Eu.Namespace.RDF.iri.value,rdfs:Eu.Namespace.RDFS.iri.value,owl:Eu.Namespace.OWL.iri.value,xsd:Eu.Namespace.XSD.iri.value,exo:Eu.Namespace.EXO.iri.value,ems:Eu.Namespace.EMS.iri.value},gT=class{static{a(this,"NTriplesParser")}parse(e,t={}){let n={prefixes:{...$Q,...t.prefixes??{}},strict:t.strict??!1},i=[];return e.split(/\r?\n/).forEach((o,c)=>{let l=o.trim();!l||l.startsWith("#")||i.push(this.parseLine(l,c+1,n))}),i}parseLine(e,t,n){if(!e.endsWith("."))throw new Error(`Invalid RDF statement at line ${t}: missing '.' terminator`);let s=e.slice(0,-1).trim(),o=this.parseSubject(s,t,n);s=o.rest.trim();let c=this.parsePredicate(s,t,n);s=c.rest.trim();let l=this.parseObject(s,t,n);if(s=l.rest.trim(),s.length>0)throw new Error(`Unexpected tokens after object at line ${t}`);return new MQ.Triple(o.node,c.node,l.node)}parseSubject(e,t,n){return e.startsWith("<")?this.consumeIRI(e,t,n):e.startsWith("_:")?this.consumeBlankNode(e,t):this.consumePrefixedName(e,t,n)}parsePredicate(e,t,n){return e.startsWith("<")?this.consumeIRI(e,t,n):this.consumePrefixedName(e,t,n)}parseObject(e,t,n){return e.startsWith("<")?this.consumeIRI(e,t,n):e.startsWith("_:")?this.consumeBlankNode(e,t):e.startsWith('"')?this.consumeLiteral(e,t,n):this.consumePrefixedName(e,t,n)}consumePrefixedName(e,t,n){let i=e.match(/^([a-zA-Z_][\w-]*):([^\s]+)(?:\s+(.*))?$/);if(!i)throw new Error(`Invalid token at line ${t}: ${e}`);let[,s,o,c]=i,l=n.prefixes[s];if(!l)throw new Error(`Unknown prefix "${s}" at line ${t}`);return{node:new OF.IRI(`${l}${o}`),rest:(c??"").trimStart()}}consumeIRI(e,t,n){let i=this.findClosingBracket(e,"<",">");if(i===-1)throw new Error(`Invalid IRI at line ${t}`);let s=e.slice(1,i),o=new OF.IRI(s),c=e.slice(i+1).trimStart();return{node:o,rest:c}}consumeBlankNode(e,t){let n=e.match(/^_:(\w+)(?:\s+(.*))?$/);if(!n)throw new Error(`Invalid blank node identifier at line ${t}`);let[,i,s]=n;return{node:new jQ.BlankNode(i),rest:(s??"").trimStart()}}consumeLiteral(e,t,n){let{value:i,rest:s}=this.consumeQuotedString(e,t),o=s.trimStart();if(o.startsWith("^^")){o=o.slice(2).trimStart();let c=o.startsWith("<")?this.consumeIRI(o,t,n):this.consumePrefixedName(o,t,n);return{node:new mT.Literal(i,c.node),rest:c.rest}}if(o.startsWith("@")){let c=o.match(/^@([a-zA-Z-]+)(?:\s+(.*))?$/);if(!c)throw new Error(`Invalid language tag at line ${t}`);let[,l,u]=c;return{node:new mT.Literal(i,void 0,l),rest:(u??"").trimStart()}}return{node:new mT.Literal(i),rest:o}}consumeQuotedString(e,t){if(!e.startsWith('"'))throw new Error(`Expected quoted string at line ${t}`);let n="";for(let i=1;i<e.length;i++){let s=e[i];if(s==="\\"){if(i+1>=e.length)throw new Error(`Invalid escape sequence at line ${t}`);let o=e[i+1];switch(o){case"t":n+=" ",i+=1;break;case"b":n+="\b",i+=1;break;case"n":n+=`
|
|
@@ -330,7 +330,7 @@ To resolve:
|
|
|
330
330
|
\u2022 Check service initialization parameters
|
|
331
331
|
\u2022 Verify all required dependencies are available
|
|
332
332
|
\u2022 Review service logs for detailed error information
|
|
333
|
-
\u2022 Contact support if the issue persists`}};c0.ServiceError=I2});var BL=E(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.ServiceError=_r.ResourceExhaustedError=_r.NotFoundError=_r.PermissionError=_r.StateTransitionError=_r.NetworkError=_r.ValidationError=_r.ApplicationError=_r.ErrorCode=void 0;var AZ=Bs();Object.defineProperty(_r,"ErrorCode",{enumerable:!0,get:a(function(){return AZ.ErrorCode},"get")});var IZ=Vs();Object.defineProperty(_r,"ApplicationError",{enumerable:!0,get:a(function(){return IZ.ApplicationError},"get")});var xZ=LL();Object.defineProperty(_r,"ValidationError",{enumerable:!0,get:a(function(){return xZ.ValidationError},"get")});var RZ=NL();Object.defineProperty(_r,"NetworkError",{enumerable:!0,get:a(function(){return RZ.NetworkError},"get")});var CZ=kL();Object.defineProperty(_r,"StateTransitionError",{enumerable:!0,get:a(function(){return CZ.StateTransitionError},"get")});var OZ=ML();Object.defineProperty(_r,"PermissionError",{enumerable:!0,get:a(function(){return OZ.PermissionError},"get")});var PZ=jL();Object.defineProperty(_r,"NotFoundError",{enumerable:!0,get:a(function(){return PZ.NotFoundError},"get")});var DZ=$L();Object.defineProperty(_r,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return DZ.ResourceExhaustedError},"get")});var FZ=UL();Object.defineProperty(_r,"ServiceError",{enumerable:!0,get:a(function(){return FZ.ServiceError},"get")})});var R2=E(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});l0.ShapeRegistry=void 0;var x2=class{static{a(this,"ShapeRegistry")}constructor(){this.shapes=new Map}get(e){return this.shapes.get(e)}register(e){this.shapes.set(e.propertyIRI,e)}getAll(){return Array.from(this.shapes.values())}get size(){return this.shapes.size}};l0.ShapeRegistry=x2});var VL=E(qs=>{"use strict";var LZ=qs&&qs.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),NZ=qs&&qs.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),C2=qs&&qs.__importStar||(function(){var r=a(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&LZ(t,e,n[i]);return NZ(t,e),t}})();Object.defineProperty(qs,"__esModule",{value:!0});qs.ShapeLoader=void 0;var O2=R2(),La=Ke(),Fu=tt(),Nr=Jt(),u0="http://www.w3.org/ns/shacl#",kZ="http://www.w3.org/2001/XMLSchema#",H1e=[["exo__",Nr.Namespace.EXO],["ems__",Nr.Namespace.EMS],["exocmd__",Nr.Namespace.EXOCMD],["ims__",Nr.Namespace.IMS],["ztlk__",Nr.Namespace.ZTLK],["ptms__",Nr.Namespace.PTMS],["lit__",Nr.Namespace.LIT],["inbox__",Nr.Namespace.INBOX],["pmbok__",Nr.Namespace.PMBOK]],Lu=class r{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e){let{readdir:t,readFile:n}=await Promise.resolve().then(()=>C2(require("fs/promises"))),i=await Promise.resolve().then(()=>C2(require("path"))),s=new O2.ShapeRegistry;return await r.scanDir(e,s,{readdir:t,readFile:n,path:i}),s}static async loadFromRDFGraph(e){let t=new O2.ShapeRegistry,n=Nr.Namespace.EXO,i=Nr.Namespace.RDFS,s=Nr.Namespace.RDF,o=await r.buildUidClassIndex(e),[c,l]=await Promise.all([e.match(void 0,s.term("type"),n.term("ObjectProperty")),e.match(void 0,s.term("type"),n.term("Property"))]),u=new Set;for(let f of[...c,...l])f.subject instanceof La.IRI&&u.add(f.subject.value);for(let f of u){let d;try{d=new La.IRI(f)}catch{continue}let[p,h,_,y,S,w,T,O,A]=await Promise.all([e.match(d,i.term("domain"),void 0),e.match(d,n.term("Property_domain"),void 0),e.match(d,i.term("range"),void 0),e.match(d,n.term("Property_range"),void 0),e.match(d,n.term("Property_cardinality"),void 0),e.match(d,n.term("Property_severity"),void 0),e.match(d,n.term("Asset_label"),void 0),e.match(d,i.term("label"),void 0),e.match(d,n.term("Property_minCount"),void 0)]),x=[...T,...O],P=[...p,...h],V=[..._,...y];if(P.length===0)continue;let j=null;for(let ie of x)if(ie.object instanceof Fu.Literal&&(j=r.labelToIRI(ie.object.value),j))break;if(!j)continue;let $=await Promise.all(P.map(async ie=>ie.object instanceof La.IRI?await r.resolveClassIRI(ie.object.value,e,o):null)),K=Array.from(new Set($.filter(ie=>ie!==null))),N=await Promise.all(V.map(async ie=>{if(ie.object instanceof La.IRI)return await r.resolveClassIRI(ie.object.value,e,o);if(ie.object instanceof Fu.Literal){let ne=ie.object.value;if(ne.startsWith("http://")||ne.startsWith("https://"))return ne}return null})),ae=Array.from(new Set(N.filter(ie=>ie!==null))),we=r.cardinalityFromIRI(S[0]?.object instanceof La.IRI?S[0].object.value:void 0),te=r.severityFromValue(w[0]?.object instanceof Fu.Literal||w[0]?.object instanceof La.IRI?w[0].object.value:void 0),pe=A[0]?.object,Y=pe instanceof Fu.Literal?parseInt(pe.value,10):NaN,Ee=isNaN(Y)?void 0:Y;t.register({propertyIRI:j,domain:K,range:ae.length>0?ae:void 0,cardinality:we,severity:te,minCount:Ee})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>C2(require("fs/promises"))),n=await t(e,"utf-8"),i=JSON.parse(n),s=new O2.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static extractUidFromFileIRI(e){let t=r.FILE_IRI_UID_RE.exec(e);return t?t[1].toLowerCase():null}static async buildUidClassIndex(e){let t=Nr.Namespace.RDFS,n=Nr.Namespace.EXO,[i,s]=await Promise.all([e.match(void 0,t.term("label"),void 0),e.match(void 0,n.term("Asset_label"),void 0)]),o=new Map;for(let c of[...i,...s]){if(!(c.subject instanceof La.IRI)||!(c.object instanceof Fu.Literal))continue;let l=r.extractUidFromFileIRI(c.subject.value);if(!l||o.has(l))continue;let u=c.object.value.trim();if(/\s/.test(u))continue;let f=r.labelToIRI(u);f&&o.set(l,f)}return o}static async resolveClassIRI(e,t,n){if(e.startsWith("https://exocortex.my/ontology/")||e.startsWith("http://www.w3.org/"))return e;let i;try{i=new La.IRI(e)}catch{return null}let s=Nr.Namespace.RDFS,o=Nr.Namespace.EXO,[c,l]=await Promise.all([t.match(i,s.term("label"),void 0),t.match(i,o.term("Asset_label"),void 0)]);for(let u of[...c,...l])if(u.object instanceof Fu.Literal){let f=r.labelToIRI(u.object.value);if(f)return f}if(n){let u=r.extractUidFromFileIRI(e);if(u){let f=n.get(u);if(f)return f}}return e}static async scanDir(e,t,n){let i;try{i=await n.readdir(e,{withFileTypes:!0})}catch{return}for(let s of i){let o=n.path.join(e,s.name);if(s.isDirectory())await r.scanDir(o,t,n);else if(s.isFile()&&s.name.endsWith(".md"))try{await r.processFile(o,t,n.readFile,n.path)}catch{}}}static async processFile(e,t,n,i){let s;try{s=await n(e,"utf-8")}catch{return}let o=r.parseFrontmatter(s);if(!o)return;let c="38277bfa-d7f9-4a75-b856-b23276ab0db3",l="9a1cf31c-9d41-4ef3-9023-584a8d087d16";if(!r.asArray(o.exo__Instance_class).some($=>{let K=r.extractWikilinkRef($);return K==="exo__Property"||K==="exo__ObjectProperty"||K===c||K===l||K?.includes("|exo__Property")||K?.includes("|exo__ObjectProperty")}))return;let d=null,p=o.exo__Asset_label;if(typeof p=="string"&&p.trim().length>0)d=p.trim();else if(i){let $=i.basename(e,".md");Nr.Namespace.fromPropertyKey($)&&(d=$)}if(!d)return;let h=r.labelToIRI(d);if(!h)return;let _=o.exo__Property_domain,y=o.exo__Property_range,S=o.exo__Property_cardinality,w=o.exo__Property_severity,T=o.exo__Property_minCount,O=r.asArray(_).map($=>r.wikilinkToIRI($)).filter($=>$!==null);if(O.length===0)return;let A=r.asArray(y).map($=>r.wikilinkToIRI($)).filter($=>$!==null),x=r.cardinalityFromLabel(typeof S=="string"?S:void 0),P=r.severityFromValue(typeof w=="string"?w:void 0),V=typeof T=="string"?parseInt(T,10):void 0,j=V!==void 0&&!isNaN(V)?V:void 0;t.register({propertyIRI:h,domain:O,range:A.length>0?A:void 0,cardinality:x,severity:P,minCount:j})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let n=t[1],i={},s=n.split(/\r?\n/),o=null,c=null;for(let l of s){let u=/^ {2}- (.*)$/.exec(l);if(u){o&&c&&c.push(u[1].trim());continue}o&&c&&(i[o]=c,o=null,c=null);let f=/^([^:]+):\s*(.*)$/.exec(l);if(!f)continue;let d=f[1].trim(),p=f[2].trim();p===""?(o=d,c=[]):i[d]=p}return o&&c&&(i[o]=c),i}static labelToIRI(e){let t=Nr.Namespace.fromPropertyKey(e);if(!t)return null;try{return t.namespace.term(t.localName).value}catch{return null}}static extractWikilinkRef(e){let t=e.replace(/^["']|["']$/g,""),n=/\[\[([^\]]+)\]\]/.exec(t);return n?n[1]:t}static wikilinkToIRI(e){let t=r.extractWikilinkRef(e);if(!t)return null;let n=t.split("|"),i=n.length>1?[n[1],n[0]]:[n[0]];for(let s of i){let o=r.labelToIRI(s.trim());if(o)return o}return t.startsWith("http")?t:t.startsWith("sh:")?u0+t.substring(3):t.startsWith("xsd:")?kZ+t.substring(4):null}static asArray(e){return Array.isArray(e)?e.map(String):typeof e=="string"?[e]:[]}static cardinalityFromIRI(e){if(e){if(e.endsWith("PropertyCardinalitySingle"))return"Single";if(e.endsWith("PropertyCardinalityMultiple"))return"Multiple";if(e.includes(r.CARDINALITY_SINGLE_UID))return"Single";if(e.includes(r.CARDINALITY_MULTIPLE_UID))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=r.extractWikilinkRef(e)??e,n=t.split("|").pop()??t;if(n.includes("Single"))return"Single";if(n.includes("Multiple"))return"Multiple";if(t.includes(r.CARDINALITY_SINGLE_UID))return"Single";if(t.includes(r.CARDINALITY_MULTIPLE_UID))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===u0+"Violation"?"sh:Violation":e.includes("Warning")||e===u0+"Warning"?"sh:Warning":e.includes("Info")||e===u0+"Info"?"sh:Info":"sh:Violation"}};qs.ShapeLoader=Lu;Lu.FILE_IRI_UID_RE=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;Lu.CARDINALITY_SINGLE_UID="c93c4b2f-b43d-4cc9-8dd0-31514d608da2";Lu.CARDINALITY_MULTIPLE_UID="59a37aa7-ffbe-4e0d-ba60-06ae370d880f"});var F2=E(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.ShapeRegistry=void 0;Nu.extractUidFromIRI=D2;Nu.validate=qZ;var P2=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(n=>[n.propertyIRI,n])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};Nu.ShapeRegistry=P2;var MZ="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",jZ=["http://www.w3.org/2001/XMLSchema#","http://www.w3.org/1999/02/22-rdf-syntax-ns#","http://www.w3.org/2000/01/rdf-schema#","http://www.w3.org/2002/07/owl#","http://www.w3.org/2004/02/skos/core#","http://purl.org/dc/elements/1.1/","http://purl.org/dc/terms/","http://xmlns.com/foaf/0.1/","https://schema.org/","https://exocortex.my/ontology/xsd#","https://exocortex.my/ontology/rdf#","https://exocortex.my/ontology/rdfs#","https://exocortex.my/ontology/owl#","https://exocortex.my/ontology/skos#"];function $Z(r){return jZ.some(e=>r.startsWith(e))}a($Z,"isExternalOntologyIRI");var UZ=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function BZ(r){return UZ.some(e=>r.startsWith(e))}a(BZ,"isXSDDatatypeIRI");var VZ=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function D2(r){let e=VZ.exec(r);return e?e[1].toLowerCase():null}a(D2,"extractUidFromIRI");function qZ(r,e,t,n){let i=new Map,s=new Map;for(let l of r){let{subject:u,predicate:f,object:d}=l;if(u.type!=="iri"||f.type!=="iri"||d.type!=="iri"&&d.type!=="literal")continue;let p=u.value,h=f.value,_=d;if(h===e.typePredicateIRI||h===MZ){if(_.type==="iri"){let S=i.get(p)??[];S.push(_.value),i.set(p,S);let w=D2(p);if(w){let T=`uid:${w}`,O=i.get(T)??[];O.push(_.value),i.set(T,O)}}}else{let S=s.get(p);S||(S=new Map,s.set(p,S));let w=S.get(h)??[];w.push(_),S.set(h,w)}}let o=[],c=new Set([...i.keys(),...s.keys()]);for(let l of c){if(l.startsWith("uid:"))continue;let u=i.get(l)??[],f=s.get(l)??new Map;for(let d of e.getAllShapes()){if(!(d.domain.length===0||d.domain.some(_=>u.some(y=>y===_||t.isSubClassOf(y,_)))))continue;let h=f.get(d.propertyIRI)??[];if(d.minCount!==void 0&&d.minCount>0&&h.length<d.minCount){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"minCount",message:d.message??`sh:minCount violation: expected at least ${d.minCount} value(s) for <${d.propertyIRI}>`});continue}if(h.length!==0){if(d.cardinality==="Single"&&h.length>1){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"maxCount",message:d.message??`sh:maxCount violation: expected at most 1 value for <${d.propertyIRI}>, got ${h.length}`});continue}if(d.range&&d.range.length>0){for(let _ of h)if(_.type==="iri"){if($Z(_.value))continue;let y=i.get(_.value)??[];if(y.length===0){let w=D2(_.value);w&&(y=i.get(`uid:${w}`)??[])}if(!d.range.some(w=>y.some(T=>T===w||t.isSubClassOf(T,w)))){let w=y.length===0;o.push({focusNode:l,propertyPath:d.propertyIRI,severity:w?"sh:Warning":d.severity,constraint:"class",message:w?`sh:class unresolvable-ref: <${_.value}> has no resolvable type in this vault (cross-vault, symbolic, or external reference); not validated against ${d.range.join(" | ")}`:d.message??`sh:class violation: <${_.value}> does not conform to expected class ${d.range.join(" | ")}`,actualValue:_.value,expectedRange:d.range.join(" | ")})}}else if(_.type==="literal"){let y=d.range.filter(T=>BZ(T));if(y.length===0)continue;let S=_.datatype??"http://www.w3.org/2001/XMLSchema#string";y.some(T=>T===S)||o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"datatype",message:d.message??`sh:datatype violation: literal "${_.value}" has datatype <${S}>, expected ${y.join(" | ")}`,actualValue:_.value,expectedRange:y.join(" | ")})}}}}}if(n?.closedWorldMode)for(let l of c){let u=s.get(l)??new Map;for(let f of u.keys())e.hasShape(f)||o.push({focusNode:l,propertyPath:f,severity:"sh:Warning",constraint:"unknown-property",message:`Unknown property: <${f}> has no registered shape`})}return o.sort((l,u)=>{let f=l.focusNode.localeCompare(u.focusNode);return f!==0?f:l.propertyPath.localeCompare(u.propertyPath)}),{conforms:!o.some(l=>l.severity==="sh:Violation"),violations:o}}a(qZ,"validate")});var qL=E(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.ApplicationErrorHandler=void 0;var L2=Vs(),GZ=Bs(),WZ=xa(),N2=class{static{a(this,"ApplicationErrorHandler")}constructor(e={},t,n){this.logger=t,this.notifier=n,this.telemetryHooks=new Set,this.retryConfig={maxRetries:e.maxRetries??3,initialDelayMs:e.initialDelayMs??1e3,backoffMultiplier:e.backoffMultiplier??2,maxDelayMs:e.maxDelayMs??1e4}}handle(e,t){let n=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(n.message),this.callTelemetryHooks("onError",n,t),this.formatError(n)}async executeWithRetry(e,t){let n,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(n=this.ensureApplicationError(s,t),!n.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",n,t),i>=this.retryConfig.maxRetries&&n.retriable&&this.callTelemetryHooks("onRetryExhausted",n,i+1),n;let o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",n,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw n}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof L2.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends L2.ApplicationError{constructor(){super(...arguments),this.code=i.code,this.retriable=i.retriable,this.guidance=i.guidance}}(e.message,s)}return e}return new class extends L2.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=GZ.ErrorCode.UNKNOWN_ERROR,this.retriable=!1,this.guidance="An unexpected error occurred"}}(e.message,e)}formatError(e){let t=[];return t.push(`\u274C ${e.name}: ${e.message}`),e.guidance&&t.push(`\u{1F4A1} ${e.guidance}`),e.context&&Object.keys(e.context).length>0&&t.push(`Context: ${JSON.stringify(e.context,null,2)}`),t.join(`
|
|
333
|
+
\u2022 Contact support if the issue persists`}};c0.ServiceError=I2});var BL=E(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.ServiceError=_r.ResourceExhaustedError=_r.NotFoundError=_r.PermissionError=_r.StateTransitionError=_r.NetworkError=_r.ValidationError=_r.ApplicationError=_r.ErrorCode=void 0;var AZ=Bs();Object.defineProperty(_r,"ErrorCode",{enumerable:!0,get:a(function(){return AZ.ErrorCode},"get")});var IZ=Vs();Object.defineProperty(_r,"ApplicationError",{enumerable:!0,get:a(function(){return IZ.ApplicationError},"get")});var xZ=LL();Object.defineProperty(_r,"ValidationError",{enumerable:!0,get:a(function(){return xZ.ValidationError},"get")});var RZ=NL();Object.defineProperty(_r,"NetworkError",{enumerable:!0,get:a(function(){return RZ.NetworkError},"get")});var CZ=kL();Object.defineProperty(_r,"StateTransitionError",{enumerable:!0,get:a(function(){return CZ.StateTransitionError},"get")});var OZ=ML();Object.defineProperty(_r,"PermissionError",{enumerable:!0,get:a(function(){return OZ.PermissionError},"get")});var PZ=jL();Object.defineProperty(_r,"NotFoundError",{enumerable:!0,get:a(function(){return PZ.NotFoundError},"get")});var DZ=$L();Object.defineProperty(_r,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return DZ.ResourceExhaustedError},"get")});var FZ=UL();Object.defineProperty(_r,"ServiceError",{enumerable:!0,get:a(function(){return FZ.ServiceError},"get")})});var R2=E(l0=>{"use strict";Object.defineProperty(l0,"__esModule",{value:!0});l0.ShapeRegistry=void 0;var x2=class{static{a(this,"ShapeRegistry")}constructor(){this.shapes=new Map}get(e){return this.shapes.get(e)}register(e){this.shapes.set(e.propertyIRI,e)}getAll(){return Array.from(this.shapes.values())}get size(){return this.shapes.size}};l0.ShapeRegistry=x2});var VL=E(qs=>{"use strict";var LZ=qs&&qs.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),NZ=qs&&qs.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),C2=qs&&qs.__importStar||(function(){var r=a(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&LZ(t,e,n[i]);return NZ(t,e),t}})();Object.defineProperty(qs,"__esModule",{value:!0});qs.ShapeLoader=void 0;var O2=R2(),La=Ke(),Fu=tt(),Nr=Jt(),u0="http://www.w3.org/ns/shacl#",kZ="http://www.w3.org/2001/XMLSchema#",z1e=[["exo__",Nr.Namespace.EXO],["ems__",Nr.Namespace.EMS],["exocmd__",Nr.Namespace.EXOCMD],["ims__",Nr.Namespace.IMS],["ztlk__",Nr.Namespace.ZTLK],["ptms__",Nr.Namespace.PTMS],["lit__",Nr.Namespace.LIT],["inbox__",Nr.Namespace.INBOX],["pmbok__",Nr.Namespace.PMBOK]],Lu=class r{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e){let{readdir:t,readFile:n}=await Promise.resolve().then(()=>C2(require("fs/promises"))),i=await Promise.resolve().then(()=>C2(require("path"))),s=new O2.ShapeRegistry;return await r.scanDir(e,s,{readdir:t,readFile:n,path:i}),s}static async loadFromRDFGraph(e){let t=new O2.ShapeRegistry,n=Nr.Namespace.EXO,i=Nr.Namespace.RDFS,s=Nr.Namespace.RDF,o=await r.buildUidClassIndex(e),[c,l]=await Promise.all([e.match(void 0,s.term("type"),n.term("ObjectProperty")),e.match(void 0,s.term("type"),n.term("Property"))]),u=new Set;for(let f of[...c,...l])f.subject instanceof La.IRI&&u.add(f.subject.value);for(let f of u){let d;try{d=new La.IRI(f)}catch{continue}let[p,h,_,y,S,w,T,O,A]=await Promise.all([e.match(d,i.term("domain"),void 0),e.match(d,n.term("Property_domain"),void 0),e.match(d,i.term("range"),void 0),e.match(d,n.term("Property_range"),void 0),e.match(d,n.term("Property_cardinality"),void 0),e.match(d,n.term("Property_severity"),void 0),e.match(d,n.term("Asset_label"),void 0),e.match(d,i.term("label"),void 0),e.match(d,n.term("Property_minCount"),void 0)]),x=[...T,...O],P=[...p,...h],V=[..._,...y];if(P.length===0)continue;let j=null;for(let ie of x)if(ie.object instanceof Fu.Literal&&(j=r.labelToIRI(ie.object.value),j))break;if(!j)continue;let $=await Promise.all(P.map(async ie=>ie.object instanceof La.IRI?await r.resolveClassIRI(ie.object.value,e,o):null)),K=Array.from(new Set($.filter(ie=>ie!==null))),N=await Promise.all(V.map(async ie=>{if(ie.object instanceof La.IRI)return await r.resolveClassIRI(ie.object.value,e,o);if(ie.object instanceof Fu.Literal){let ne=ie.object.value;if(ne.startsWith("http://")||ne.startsWith("https://"))return ne}return null})),ae=Array.from(new Set(N.filter(ie=>ie!==null))),we=r.cardinalityFromIRI(S[0]?.object instanceof La.IRI?S[0].object.value:void 0),ee=r.severityFromValue(w[0]?.object instanceof Fu.Literal||w[0]?.object instanceof La.IRI?w[0].object.value:void 0),pe=A[0]?.object,Y=pe instanceof Fu.Literal?parseInt(pe.value,10):NaN,Ee=isNaN(Y)?void 0:Y;t.register({propertyIRI:j,domain:K,range:ae.length>0?ae:void 0,cardinality:we,severity:ee,minCount:Ee})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>C2(require("fs/promises"))),n=await t(e,"utf-8"),i=JSON.parse(n),s=new O2.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static extractUidFromFileIRI(e){let t=r.FILE_IRI_UID_RE.exec(e);return t?t[1].toLowerCase():null}static async buildUidClassIndex(e){let t=Nr.Namespace.RDFS,n=Nr.Namespace.EXO,[i,s]=await Promise.all([e.match(void 0,t.term("label"),void 0),e.match(void 0,n.term("Asset_label"),void 0)]),o=new Map;for(let c of[...i,...s]){if(!(c.subject instanceof La.IRI)||!(c.object instanceof Fu.Literal))continue;let l=r.extractUidFromFileIRI(c.subject.value);if(!l||o.has(l))continue;let u=c.object.value.trim();if(/\s/.test(u))continue;let f=r.labelToIRI(u);f&&o.set(l,f)}return o}static async resolveClassIRI(e,t,n){if(e.startsWith("https://exocortex.my/ontology/")||e.startsWith("http://www.w3.org/"))return e;let i;try{i=new La.IRI(e)}catch{return null}let s=Nr.Namespace.RDFS,o=Nr.Namespace.EXO,[c,l]=await Promise.all([t.match(i,s.term("label"),void 0),t.match(i,o.term("Asset_label"),void 0)]);for(let u of[...c,...l])if(u.object instanceof Fu.Literal){let f=r.labelToIRI(u.object.value);if(f)return f}if(n){let u=r.extractUidFromFileIRI(e);if(u){let f=n.get(u);if(f)return f}}return e}static async scanDir(e,t,n){let i;try{i=await n.readdir(e,{withFileTypes:!0})}catch{return}for(let s of i){let o=n.path.join(e,s.name);if(s.isDirectory())await r.scanDir(o,t,n);else if(s.isFile()&&s.name.endsWith(".md"))try{await r.processFile(o,t,n.readFile,n.path)}catch{}}}static async processFile(e,t,n,i){let s;try{s=await n(e,"utf-8")}catch{return}let o=r.parseFrontmatter(s);if(!o)return;let c="38277bfa-d7f9-4a75-b856-b23276ab0db3",l="9a1cf31c-9d41-4ef3-9023-584a8d087d16";if(!r.asArray(o.exo__Instance_class).some($=>{let K=r.extractWikilinkRef($);return K==="exo__Property"||K==="exo__ObjectProperty"||K===c||K===l||K?.includes("|exo__Property")||K?.includes("|exo__ObjectProperty")}))return;let d=null,p=o.exo__Asset_label;if(typeof p=="string"&&p.trim().length>0)d=p.trim();else if(i){let $=i.basename(e,".md");Nr.Namespace.fromPropertyKey($)&&(d=$)}if(!d)return;let h=r.labelToIRI(d);if(!h)return;let _=o.exo__Property_domain,y=o.exo__Property_range,S=o.exo__Property_cardinality,w=o.exo__Property_severity,T=o.exo__Property_minCount,O=r.asArray(_).map($=>r.wikilinkToIRI($)).filter($=>$!==null);if(O.length===0)return;let A=r.asArray(y).map($=>r.wikilinkToIRI($)).filter($=>$!==null),x=r.cardinalityFromLabel(typeof S=="string"?S:void 0),P=r.severityFromValue(typeof w=="string"?w:void 0),V=typeof T=="string"?parseInt(T,10):void 0,j=V!==void 0&&!isNaN(V)?V:void 0;t.register({propertyIRI:h,domain:O,range:A.length>0?A:void 0,cardinality:x,severity:P,minCount:j})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let n=t[1],i={},s=n.split(/\r?\n/),o=null,c=null;for(let l of s){let u=/^ {2}- (.*)$/.exec(l);if(u){o&&c&&c.push(u[1].trim());continue}o&&c&&(i[o]=c,o=null,c=null);let f=/^([^:]+):\s*(.*)$/.exec(l);if(!f)continue;let d=f[1].trim(),p=f[2].trim();p===""?(o=d,c=[]):i[d]=p}return o&&c&&(i[o]=c),i}static labelToIRI(e){let t=Nr.Namespace.fromPropertyKey(e);if(!t)return null;try{return t.namespace.term(t.localName).value}catch{return null}}static extractWikilinkRef(e){let t=e.replace(/^["']|["']$/g,""),n=/\[\[([^\]]+)\]\]/.exec(t);return n?n[1]:t}static wikilinkToIRI(e){let t=r.extractWikilinkRef(e);if(!t)return null;let n=t.split("|"),i=n.length>1?[n[1],n[0]]:[n[0]];for(let s of i){let o=r.labelToIRI(s.trim());if(o)return o}return t.startsWith("http")?t:t.startsWith("sh:")?u0+t.substring(3):t.startsWith("xsd:")?kZ+t.substring(4):null}static asArray(e){return Array.isArray(e)?e.map(String):typeof e=="string"?[e]:[]}static cardinalityFromIRI(e){if(e){if(e.endsWith("PropertyCardinalitySingle"))return"Single";if(e.endsWith("PropertyCardinalityMultiple"))return"Multiple";if(e.includes(r.CARDINALITY_SINGLE_UID))return"Single";if(e.includes(r.CARDINALITY_MULTIPLE_UID))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=r.extractWikilinkRef(e)??e,n=t.split("|").pop()??t;if(n.includes("Single"))return"Single";if(n.includes("Multiple"))return"Multiple";if(t.includes(r.CARDINALITY_SINGLE_UID))return"Single";if(t.includes(r.CARDINALITY_MULTIPLE_UID))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===u0+"Violation"?"sh:Violation":e.includes("Warning")||e===u0+"Warning"?"sh:Warning":e.includes("Info")||e===u0+"Info"?"sh:Info":"sh:Violation"}};qs.ShapeLoader=Lu;Lu.FILE_IRI_UID_RE=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;Lu.CARDINALITY_SINGLE_UID="c93c4b2f-b43d-4cc9-8dd0-31514d608da2";Lu.CARDINALITY_MULTIPLE_UID="59a37aa7-ffbe-4e0d-ba60-06ae370d880f"});var F2=E(Nu=>{"use strict";Object.defineProperty(Nu,"__esModule",{value:!0});Nu.ShapeRegistry=void 0;Nu.extractUidFromIRI=D2;Nu.validate=qZ;var P2=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(n=>[n.propertyIRI,n])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};Nu.ShapeRegistry=P2;var MZ="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",jZ=["http://www.w3.org/2001/XMLSchema#","http://www.w3.org/1999/02/22-rdf-syntax-ns#","http://www.w3.org/2000/01/rdf-schema#","http://www.w3.org/2002/07/owl#","http://www.w3.org/2004/02/skos/core#","http://purl.org/dc/elements/1.1/","http://purl.org/dc/terms/","http://xmlns.com/foaf/0.1/","https://schema.org/","https://exocortex.my/ontology/xsd#","https://exocortex.my/ontology/rdf#","https://exocortex.my/ontology/rdfs#","https://exocortex.my/ontology/owl#","https://exocortex.my/ontology/skos#"];function $Z(r){return jZ.some(e=>r.startsWith(e))}a($Z,"isExternalOntologyIRI");var UZ=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function BZ(r){return UZ.some(e=>r.startsWith(e))}a(BZ,"isXSDDatatypeIRI");var VZ=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function D2(r){let e=VZ.exec(r);return e?e[1].toLowerCase():null}a(D2,"extractUidFromIRI");function qZ(r,e,t,n){let i=new Map,s=new Map;for(let l of r){let{subject:u,predicate:f,object:d}=l;if(u.type!=="iri"||f.type!=="iri"||d.type!=="iri"&&d.type!=="literal")continue;let p=u.value,h=f.value,_=d;if(h===e.typePredicateIRI||h===MZ){if(_.type==="iri"){let S=i.get(p)??[];S.push(_.value),i.set(p,S);let w=D2(p);if(w){let T=`uid:${w}`,O=i.get(T)??[];O.push(_.value),i.set(T,O)}}}else{let S=s.get(p);S||(S=new Map,s.set(p,S));let w=S.get(h)??[];w.push(_),S.set(h,w)}}let o=[],c=new Set([...i.keys(),...s.keys()]);for(let l of c){if(l.startsWith("uid:"))continue;let u=i.get(l)??[],f=s.get(l)??new Map;for(let d of e.getAllShapes()){if(!(d.domain.length===0||d.domain.some(_=>u.some(y=>y===_||t.isSubClassOf(y,_)))))continue;let h=f.get(d.propertyIRI)??[];if(d.minCount!==void 0&&d.minCount>0&&h.length<d.minCount){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"minCount",message:d.message??`sh:minCount violation: expected at least ${d.minCount} value(s) for <${d.propertyIRI}>`});continue}if(h.length!==0){if(d.cardinality==="Single"&&h.length>1){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"maxCount",message:d.message??`sh:maxCount violation: expected at most 1 value for <${d.propertyIRI}>, got ${h.length}`});continue}if(d.range&&d.range.length>0){for(let _ of h)if(_.type==="iri"){if($Z(_.value))continue;let y=i.get(_.value)??[];if(y.length===0){let w=D2(_.value);w&&(y=i.get(`uid:${w}`)??[])}if(!d.range.some(w=>y.some(T=>T===w||t.isSubClassOf(T,w)))){let w=y.length===0;o.push({focusNode:l,propertyPath:d.propertyIRI,severity:w?"sh:Warning":d.severity,constraint:"class",message:w?`sh:class unresolvable-ref: <${_.value}> has no resolvable type in this vault (cross-vault, symbolic, or external reference); not validated against ${d.range.join(" | ")}`:d.message??`sh:class violation: <${_.value}> does not conform to expected class ${d.range.join(" | ")}`,actualValue:_.value,expectedRange:d.range.join(" | ")})}}else if(_.type==="literal"){let y=d.range.filter(T=>BZ(T));if(y.length===0)continue;let S=_.datatype??"http://www.w3.org/2001/XMLSchema#string";y.some(T=>T===S)||o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,constraint:"datatype",message:d.message??`sh:datatype violation: literal "${_.value}" has datatype <${S}>, expected ${y.join(" | ")}`,actualValue:_.value,expectedRange:y.join(" | ")})}}}}}if(n?.closedWorldMode)for(let l of c){let u=s.get(l)??new Map;for(let f of u.keys())e.hasShape(f)||o.push({focusNode:l,propertyPath:f,severity:"sh:Warning",constraint:"unknown-property",message:`Unknown property: <${f}> has no registered shape`})}return o.sort((l,u)=>{let f=l.focusNode.localeCompare(u.focusNode);return f!==0?f:l.propertyPath.localeCompare(u.propertyPath)}),{conforms:!o.some(l=>l.severity==="sh:Violation"),violations:o}}a(qZ,"validate")});var qL=E(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.ApplicationErrorHandler=void 0;var L2=Vs(),GZ=Bs(),WZ=xa(),N2=class{static{a(this,"ApplicationErrorHandler")}constructor(e={},t,n){this.logger=t,this.notifier=n,this.telemetryHooks=new Set,this.retryConfig={maxRetries:e.maxRetries??3,initialDelayMs:e.initialDelayMs??1e3,backoffMultiplier:e.backoffMultiplier??2,maxDelayMs:e.maxDelayMs??1e4}}handle(e,t){let n=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(n.message),this.callTelemetryHooks("onError",n,t),this.formatError(n)}async executeWithRetry(e,t){let n,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(n=this.ensureApplicationError(s,t),!n.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",n,t),i>=this.retryConfig.maxRetries&&n.retriable&&this.callTelemetryHooks("onRetryExhausted",n,i+1),n;let o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",n,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw n}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof L2.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends L2.ApplicationError{constructor(){super(...arguments),this.code=i.code,this.retriable=i.retriable,this.guidance=i.guidance}}(e.message,s)}return e}return new class extends L2.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=GZ.ErrorCode.UNKNOWN_ERROR,this.retriable=!1,this.guidance="An unexpected error occurred"}}(e.message,e)}formatError(e){let t=[];return t.push(`\u274C ${e.name}: ${e.message}`),e.guidance&&t.push(`\u{1F4A1} ${e.guidance}`),e.context&&Object.keys(e.context).length>0&&t.push(`Context: ${JSON.stringify(e.context,null,2)}`),t.join(`
|
|
334
334
|
`)}calculateDelay(e){let t=this.retryConfig.initialDelayMs*Math.pow(this.retryConfig.backoffMultiplier,e);return Math.min(t,this.retryConfig.maxDelayMs)}sleep(e){return new Promise(t=>setTimeout(t,e))}callTelemetryHooks(e,...t){for(let n of this.telemetryHooks)try{let i=n[e];i&&i.apply(n,t)}catch(i){WZ.LoggingService.error("Error in telemetry hook",i instanceof Error?i:new Error(String(i)))}}};f0.ApplicationErrorHandler=N2});var GL=E(d0=>{"use strict";Object.defineProperty(d0,"__esModule",{value:!0});d0.ApplicationErrorHandler=void 0;var HZ=qL();Object.defineProperty(d0,"ApplicationErrorHandler",{enumerable:!0,get:a(function(){return HZ.ApplicationErrorHandler},"get")})});var WL=E(p0=>{"use strict";Object.defineProperty(p0,"__esModule",{value:!0});p0.ClassHierarchy=void 0;var zZ="http://www.w3.org/2000/01/rdf-schema#subClassOf",k2=class{static{a(this,"ClassHierarchy")}constructor(e){this.adjacency=new Map;for(let t of e){if(t.predicate.type!=="iri"||t.predicate.value!==zZ||t.subject.type!=="iri"||t.object.type!=="iri")continue;let n=t.subject.value,i=t.object.value,s=this.adjacency.get(n);s||(s=new Set,this.adjacency.set(n,s)),s.add(i)}}isSubClassOf(e,t){if(e===t)return!0;let n=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(n.has(s))continue;n.add(s);let o=this.adjacency.get(s);if(o)for(let c of o){if(c===t)return!0;n.has(c)||i.push(c)}}return!1}getAncestors(e){let t=new Set,n=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(n.has(s))continue;n.add(s);let o=this.adjacency.get(s);if(o)for(let c of o)t.add(c),n.has(c)||i.push(c)}return t}};p0.ClassHierarchy=k2});var M2=E(h0=>{"use strict";Object.defineProperty(h0,"__esModule",{value:!0});h0.parseTarball=KL;h0.parseTarballGzip=ZZ;var KZ={0:"file",1:"hardLink",2:"symbolicLink",3:"characterDevice",4:"blockDevice",5:"directory",6:"fifo",7:"contiguousFile",g:"globalExtendedHeader",x:"extendedHeader",D:"gnuDirectory",I:"gnuInodeMetadata",K:"gnuLongLinkName",L:"gnuLongFileName",N:"gnuOldLongFileName",M:"gnuMultiVolume",S:"gnuSparseFile",E:"gnuExtendedSparse"},YZ=new Set(["extendedHeader","globalExtendedHeader","gnuLongFileName","gnuOldLongFileName","gnuLongLinkName"]),HL;function zL(){return HL??(HL=new TextDecoder)}a(zL,"getDecoder");function Jd(r,e,t){let n=r.subarray(e,e+t),i=n.indexOf(0);return zL().decode(i===-1?n:n.subarray(0,i))}a(Jd,"readString");function QZ(r,e,t){let n="";for(let s=0;s<t;s++)n+=String.fromCodePoint(r[e+s]);let i=Number.parseInt(n,8);return Number.isNaN(i)?0:i}a(QZ,"readNumber");function XZ(r){let e=zL().decode(r),t={};for(let n of e.split(`
|
|
335
335
|
`)){let i=n.indexOf("=");if(i===-1)continue;let s=n.slice(n.indexOf(" ")+1,i),o=n.slice(i+1);s&&(t[s]=o)}return t}a(XZ,"parseExtendedHeaders");function JZ(r){let e=r.replace(/\\/g,"/");e=e.replace(/^[a-zA-Z]:\//,""),e=e.replace(/^\/+/,"");let t=e.startsWith("./"),n=e.split("/"),i=[];for(let o of n)o===".."?i.pop():o!=="."&&o!==""&&i.push(o);let s=i.join("/");return t&&!s.startsWith("./")&&(s="./"+s),r.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}a(JZ,"sanitizePath");function KL(r){let e=r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r:r.slice(),t=[],n=0,i,s;for(;n+512<=e.byteLength;){let o=Jd(e,n,100);if(o.length===0)break;let c=!1;if(i){let h=i.path??i.linkpath;h&&(o=h,c=!0)}let l=QZ(e,n+124,12),u=512+512*Math.trunc(l/512)+(l%512?512:0),f=Jd(e,n+156,1)||"0",d=KZ[f]??f;if(d==="extendedHeader"||d==="globalExtendedHeader"){let h=XZ(e.subarray(n+512,n+512+l));d==="extendedHeader"?i=h:(i=void 0,s={...s,...h}),n+=u;continue}if(YZ.has(d)){i={path:Jd(e,n+512,l)},n+=u;continue}if(!c&&Jd(e,n+257,6).startsWith("ustar")){let _=Jd(e,n+345,155);_.length>0&&(o=`${_}/${o}`)}o=JZ(o);let p=l===0?void 0:e.subarray(n+512,n+512+l);t.push({name:o,type:d,size:l,data:p}),i=void 0,n+=u}return t}a(KL,"parseTarball");async function ZZ(r){let e=new Uint8Array(r instanceof Uint8Array?r:new Uint8Array(r)),t=new DecompressionStream("gzip"),n=t.writable.getWriter(),[,i]=await Promise.all([n.write(e).then(()=>n.close()),new Response(t.readable).arrayBuffer()]);return KL(new Uint8Array(i))}a(ZZ,"parseTarballGzip")});var g0=E(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});m0.isBinaryPayload=$2;m0.restCreateCommit=tee;function $2(r){return typeof r!="string"}a($2,"isBinaryPayload");var eee="https://api.github.com";function YL(r){if(r!==null&&typeof r=="object"&&"object"in r){let e=r.object;if(e!==null&&typeof e=="object"&&"sha"in e){let t=e.sha;return typeof t=="string"?t:void 0}}}a(YL,"readObjectSha");function j2(r){if(r!==null&&typeof r=="object"&&"sha"in r){let e=r.sha;return typeof e=="string"?e:void 0}}a(j2,"readSha");async function tee(r,e){let{owner:t,repo:n,branch:i,files:s,message:o}=e,c=e.deletions??[],l=(e.baseURL??eee).replace(/\/$/,""),u=e.redact??(j=>j);if(typeof t!="string"||t.length===0)throw new Error("restCreateCommit: owner is required");if(typeof n!="string"||n.length===0)throw new Error("restCreateCommit: repo is required");if(typeof i!="string"||i.length===0)throw new Error("GitHub createCommit: branch is required");if(!(s instanceof Map)||s.size===0&&c.length===0)throw new Error("GitHub createCommit: files map must be non-empty (unless deletions are provided)");let f=new Set;for(let j of c){if(typeof j!="string"||j.length===0)throw new Error("GitHub createCommit: deletion path must be a non-empty string");if(s.has(j))throw new Error(u(`GitHub createCommit: path ${j} is both written and deleted \u2014 ambiguous`));f.add(j)}if(typeof o!="string"||o.length===0)throw new Error("GitHub createCommit: message is required");let d=encodeURIComponent(t),p=encodeURIComponent(n),h=encodeURIComponent(i),_=await r({method:"GET",url:`${l}/repos/${d}/${p}/git/refs/heads/${h}`}),y=YL(_?.json);if(typeof y!="string"||y.length===0)throw new Error(u(`GitHub createCommit: missing object.sha for ref heads/${i}`));if(e.expectedHeadSha!==void 0&&y!==e.expectedHeadSha)throw new Error(u(`GitHub createCommit: head heads/${i} moved since the caller's check (expected ${e.expectedHeadSha}, found ${y}) \u2014 refusing to avoid overwriting a concurrent change`));let S=new Map;for(let[j,$]of s){if(!$2($))continue;let K=await r({method:"POST",url:`${l}/repos/${d}/${p}/git/blobs`,contentType:"application/json",body:JSON.stringify({content:$.base64,encoding:"base64"})}),N=j2(K?.json);if(typeof N!="string"||N.length===0)throw new Error(u(`GitHub createCommit: blob create returned no sha for ${j}`));S.set(j,N)}let w=Array.from(s.entries()).map(([j,$])=>$2($)?{path:j,mode:"100644",type:"blob",sha:S.get(j)}:{path:j,mode:"100644",type:"blob",content:$});for(let j of f)w.push({path:j,mode:"100644",type:"blob",sha:null});let T=await r({method:"POST",url:`${l}/repos/${d}/${p}/git/trees`,contentType:"application/json",body:JSON.stringify({base_tree:y,tree:w})}),O=j2(T?.json);if(typeof O!="string"||O.length===0)throw new Error(u("GitHub createCommit: tree create returned no sha"));let A=await r({method:"POST",url:`${l}/repos/${d}/${p}/git/commits`,contentType:"application/json",body:JSON.stringify({message:o,tree:O,parents:[y]})}),x=j2(A?.json);if(typeof x!="string"||x.length===0)throw new Error(u("GitHub createCommit: commit create returned no sha"));let P=await r({method:"PATCH",url:`${l}/repos/${d}/${p}/git/refs/heads/${h}`,contentType:"application/json",body:JSON.stringify({sha:x,force:!1})}),V=YL(P?.json);if(V!==x)throw new Error(u(`GitHub createCommit: ref update mismatch (expected ${x}, got ${V})`));return x}a(tee,"restCreateCommit")});var JL=E(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.MATERIALIZE_PROGRESS_MIN_FILES=Yn.MATERIALIZE_PROGRESS_INTERVAL=void 0;Yn.discoverWrapperDir=QL;Yn.extractShaFromWrapper=XL;Yn.mountAssetSpaceFiles=iee;Yn.escapeGitmodulesRegex=B2;Yn.appendGitmodulesEntry=see;Yn.stripGitmodulesEntry=oee;var ree=M2(),U2=new Set(["globalExtendedHeader","extendedHeader"]);function y0(r){let e=r.replace(/\\/g,"/").replace(/\/+/g,"/");for(;e.startsWith("./");)e=e.slice(2);return e}a(y0,"normalizeEntryPath");function QL(r){let e=r.find(s=>!U2.has(s.type)&&y0(s.name).includes("/"));if(e===void 0)throw new Error("discoverWrapperDir: no wrapper-bearing entry in tarball");let t=y0(e.name),n=t.slice(0,t.indexOf("/"));if(n.length===0)throw new Error(`discoverWrapperDir: empty wrapper segment in entry "${e.name}"`);let i=n+"/";for(let s of r){if(U2.has(s.type))continue;let o=y0(s.name);if(!(o===n||o===i)&&!o.startsWith(i))throw new Error(`discoverWrapperDir: entry "${s.name}" not under wrapper "${n}"`)}return n}a(QL,"discoverWrapperDir");function XL(r){let e=r.match(/-([0-9a-fA-F]{7,40})$/);if(e===null)throw new Error(`extractShaFromWrapper: wrapper "${r}" does not match expected GitHub pattern <owner>-<repo>-<sha>`);return e[1].toLowerCase()}a(XL,"extractShaFromWrapper");function nee(r,e){let t=e+"/",n=[];for(let i of r){if(i.type==="symbolicLink"||i.type==="hardLink")throw new Error(`${i.type} entry "${i.name}" rejected for security`);if(U2.has(i.type)||i.type==="directory")continue;let s=y0(i.name);if(s===e||s===t)continue;if(!s.startsWith(t))throw new Error(`entry "${i.name}" not under wrapper "${e}"`);let o=s.slice(t.length);if(o.length!==0){if(o.split("/").some(c=>c===".."))throw new Error(`path traversal detected for entry "${i.name}"`);i.data!==void 0&&n.push({relPath:o,content:i.data})}}return n}a(nee,"buildMountFiles");Yn.MATERIALIZE_PROGRESS_INTERVAL=200;Yn.MATERIALIZE_PROGRESS_MIN_FILES=500;async function iee(r){let{http:e,fs:t,owner:n,repo:i,ref:s,targetPath:o}=r,c=a((S,w)=>{if(r.onProgress!==void 0)try{r.onProgress(S,w)}catch{}},"emit");c("fetch");let l=await e.fetchTarball(n,i,s);c("extract");let u=await(0,ree.parseTarballGzip)(l);if(u.length===0)throw new Error(`tarball empty for ${n}/${i}@${s}`);let f=QL(u),d=XL(f),p=nee(u,f);c("materialize");let h=p.length,_=r.onProgress!==void 0&&h>Yn.MATERIALIZE_PROGRESS_MIN_FILES,y=await t.materialize(o,p,_?S=>{S%Yn.MATERIALIZE_PROGRESS_INTERVAL===0&&S<h&&c("materialize",{processed:S,total:h})}:void 0);return{sha:d,fileCount:y}}a(iee,"mountAssetSpaceFiles");function B2(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(B2,"escapeGitmodulesRegex");function see(r,e,t){let n=new RegExp(`^\\s*\\[submodule\\s+"${B2(e)}"\\]`,"m");if(r.length>0&&n.test(r))return{content:r,added:!1};let i=r.length===0||r.endsWith(`
|
|
336
336
|
`)?"":`
|
|
@@ -338,37 +338,37 @@ To resolve:
|
|
|
338
338
|
path = ${e}
|
|
339
339
|
url = ${t}
|
|
340
340
|
`;return{content:r+i+s,added:!0}}a(see,"appendGitmodulesEntry");function oee(r,e){let t=r.split(/\r?\n/),n=[],i=!1,s=new RegExp(`^\\[submodule\\s+"${B2(e)}"\\]\\s*$`);for(let l of t){if(i){if(/^\[.+\]\s*$/.test(l)){i=!1,n.push(l);continue}continue}if(s.test(l)){i=!0;continue}n.push(l)}let o=[],c=!1;for(let l of n){let u=l.trim().length===0;u&&c||(o.push(l),c=u)}return o.join(`
|
|
341
|
-
`)}a(oee,"stripGitmodulesEntry")});var ku=E(V2=>{"use strict";Object.defineProperty(V2,"__esModule",{value:!0});V2.gitBlobSha=aee;async function aee(r,e){let t=new TextEncoder,n=typeof r=="string"?t.encode(r):r,i=t.encode(`blob ${n.byteLength}\0`),s=new Uint8Array(i.byteLength+n.byteLength);return s.set(i,0),s.set(n,i.byteLength),e(s)}a(aee,"gitBlobSha")});var Zd=E(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});_0.extractAssetUid=ZL;_0.detectChanges=lee;var cee=ku();function ZL(r){let e=/^---\r?\n([\s\S]*?)\r?\n---(?=\r?\n|$)/.exec(r);if(!e)return;let t=/^exo__Asset_uid:[ \t]*["']?([^\s"']+)["']?[ \t]*$/m.exec(e[1]);return t?t[1]:void 0}a(ZL,"extractAssetUid");async function lee(r){let{localFiles:e,cachedEntries:t,watermark:n,actualBaseTreeSha:i,sha1:s}=r;if(n===null)return{kind:"full-conflict",reason:"first-sync"};if(i===null)return{kind:"full-conflict",reason:"base-mismatch",detail:`watermark commit ${n.lastSyncedSha} not resolvable on remote`};if(i!==n.rootTreeSha)return{kind:"full-conflict",reason:"base-mismatch",detail:`stored root tree ${n.rootTreeSha} != actual ${i} at ${n.lastSyncedSha}`};let o=[],c=new Map;for(let[A,x]of e){let P=await(0,cee.gitBlobSha)(x,s);c.set(A,P),o.push({path:A,blobSha:P,uid:typeof x=="string"?ZL(x):void 0})}if(t!==void 0)for(let[A,x]of t)c.set(A,x.blobSha),o.push({path:A,blobSha:x.blobSha,uid:x.uid});let l=[],u=[],f=[],d=[],p=new Map;for(let A of o){if(A.uid===void 0)continue;let x=p.get(A.uid)??[];x.push(A.path),p.set(A.uid,x)}let h=new Map;for(let A of n.files){if(A.uid===void 0)continue;let x=h.get(A.uid)??[];x.push(A.path),h.set(A.uid,x)}let _=new Set;for(let[A,x]of p)x.length>1&&_.add(A);for(let[A,x]of h)x.length>1&&_.add(A);for(let A of[..._].sort()){let x=p.get(A)??[],P=x.length>1?`on disk (${x.join(", ")})`:`in the sync base (${(h.get(A)??[]).join(", ")})`;d.push(`duplicate uid ${A} ${P} \u2014 uid identity suppressed for the group; every path matched by path identity (#3477)`)}let y=new Map,S=[];for(let A of n.files)A.uid!==void 0&&!_.has(A.uid)?y.set(A.uid,A):S.push(A);let w=[],T=new Set;for(let A of o){let x=A.uid!==void 0&&!_.has(A.uid)?y.get(A.uid):void 0;A.uid!==void 0&&x!==void 0?(T.add(A.uid),(x.blobSha!==A.blobSha||x.path!==A.path)&&u.push({path:A.path,uid:A.uid,blobSha:A.blobSha,...x.path!==A.path?{basePath:x.path}:{}})):w.push(A)}let O=new Map;for(let A of S)O.set(A.path,A);for(let[A,x]of y)T.has(A)||O.set(x.path,x);for(let A of w){let x=O.get(A.path);x!==void 0?(O.delete(A.path),x.blobSha!==A.blobSha&&u.push({path:A.path,uid:A.uid,blobSha:A.blobSha})):l.push({path:A.path,uid:A.uid,blobSha:A.blobSha})}for(let A of O.values())f.push({path:A.path,uid:A.uid,blobSha:A.blobSha});return{kind:"changes",added:l,modified:u,deleted:f,warnings:d,diskBlobShas:c,duplicateUids:_}}a(lee,"detectChanges")});var rN=E(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.rewriteAssetUid=eN;ep.findDuplicateUidGroups=tN;ep.planDuplicateUidFix=fee;var uee=Zd();function eN(r,e){let t=/^(---\r?\n)([\s\S]*?)(\r?\n---(?=\r?\n|$))/.exec(r);if(t===null)return r;let n=t[2].replace(/^(exo__Asset_uid:[ \t]*["']?)[^\s"']+(["']?[ \t]*)$/m,`$1${e}$2`);return n===t[2]?r:r.slice(0,t.index)+t[1]+n+t[3]+r.slice(t.index+t[0].length)}a(eN,"rewriteAssetUid");function tN(r){let e=new Map;for(let t of r){let n=(0,uee.extractAssetUid)(t.content);if(n===void 0)continue;let i=e.get(n)??[];i.push(t.path),e.set(n,i)}return[...e.entries()].filter(([,t])=>t.length>1).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>({uid:t,paths:n}))}a(tN,"findDuplicateUidGroups");function fee(r,e){let t=new Map(r.map(i=>[i.path,i.content])),n=[];for(let i of tN(r)){let s=[...i.paths].sort((o,c)=>o.localeCompare(c));for(let o of s.slice(1)){let c=t.get(o);if(c===void 0)continue;let l=e(),u=eN(c,l);u!==c&&n.push({path:o,fromUid:i.uid,toUid:l,content:u})}}return n}a(fee,"planDuplicateUidFix")});var rp=E(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.getHeadSha=pee;zc.getCommitInfo=hee;zc.getTree=mee;zc.getBlobText=gee;zc.getBlobBytes=yee;var nN=xl(),dee="https://api.github.com";function tp(r){return(r??dee).replace(/\/$/,"")}a(tp,"api");function Hc(r){return r!==null&&typeof r=="object"?r:void 0}a(Hc,"asRecord");function Gs(r,e){let n=Hc(r)?.[e];return typeof n=="string"?n:void 0}a(Gs,"readString");async function pee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/refs/heads/${encodeURIComponent(n)}`}),o=Gs(Hc(s?.json)?.object,"sha");if(typeof o!="string"||o.length===0)throw new Error(`ExoSync: missing object.sha for ref heads/${n}`);return o}a(pee,"getHeadSha");async function hee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/commits/${encodeURIComponent(n)}`}),o=Hc(s?.json),c=Gs(o,"sha"),l=Gs(o?.tree,"sha");if(!c||!l)throw new Error(`ExoSync: malformed commit response for ${n}`);let u=o?.parents,f=Array.isArray(u)?u.map(d=>Gs(d,"sha")).filter(d=>typeof d=="string"):[];return{sha:c,treeSha:l,parents:f}}a(hee,"getCommitInfo");async function mee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/trees/${encodeURIComponent(n)}?recursive=1`}),o=Hc(s?.json);if(o?.truncated===!0)throw new Error(`ExoSync: tree ${n} is truncated by GitHub (repo too large for recursive listing) \u2014 refusing to diff`);let c=o?.tree;if(!Array.isArray(c))throw new Error(`ExoSync: malformed tree response for ${n}`);let l=[];for(let u of c){let f=Hc(u);if(f?.type!=="blob")continue;let d=Gs(f,"path"),p=Gs(f,"sha"),h=typeof f.size=="number"?f.size:void 0;d&&p&&l.push({path:d,blobSha:p,...h!==void 0?{size:h}:{}})}return l}a(mee,"getTree");async function gee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/blobs/${encodeURIComponent(n)}`}),o=Hc(s?.json),c=Gs(o,"content");if(typeof c!="string")throw new Error(`ExoSync: malformed blob response for ${n}`);return Gs(o,"encoding")==="utf-8"?c:(0,nN.base64ToUtf8)(c)}a(gee,"getBlobText");async function yee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/blobs/${encodeURIComponent(n)}`}),o=Hc(s?.json),c=Gs(o,"content");if(typeof c!="string")throw new Error(`ExoSync: malformed blob response for ${n}`);return Gs(o,"encoding")==="utf-8"?new TextEncoder().encode(c):(0,nN.base64ToBytes)(c)}a(yee,"getBlobBytes")});var W2=E(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.SyncPhaseTimer=er.SYNC_PHASES=void 0;er.classifyRestPhase=_ee;er.emptyTimings=sN;er.totalMs=b0;er.addTimings=oN;er.aggregateTimings=bee;er.dominantPhase=See;er.fmtMs=np;er.formatTimingsLine=wee;er.formatRepoTimings=Eee;er.SYNC_PHASES=["localList","localRead","localWrite","hash","restHead","restCommit","restTree","restBlob","restPush"];function G2(){let r={};for(let e of er.SYNC_PHASES)r[e]=0;return r}a(G2,"zeroDurations");function iN(){return{filesRead:0,filesHashed:0,filesWritten:0,restCalls:0}}a(iN,"zeroCounts");function _ee(r){if(r.method!=="GET")return"restPush";let e=r.url;return e.includes("/git/blobs/")?"restBlob":e.includes("/git/trees/")?"restTree":e.includes("/git/commits/")?"restCommit":e.includes("/git/refs/")?"restHead":"restCommit"}a(_ee,"classifyRestPhase");var q2=class{static{a(this,"SyncPhaseTimer")}constructor(e){this.now=e,this.durations=G2(),this.counts=iN()}async time(e,t){let n=this.now();try{return await t()}finally{this.durations[e]+=this.now()-n}}bumpRead(){this.counts.filesRead++}bumpHashed(){this.counts.filesHashed++}bumpWritten(){this.counts.filesWritten++}bumpRest(){this.counts.restCalls++}snapshot(){return{durations:{...this.durations},counts:{...this.counts}}}};er.SyncPhaseTimer=q2;function sN(){return{durations:G2(),counts:iN()}}a(sN,"emptyTimings");function b0(r){let e=0;for(let t of er.SYNC_PHASES)e+=r.durations[t];return e}a(b0,"totalMs");function oN(r,e){let t=G2();for(let n of er.SYNC_PHASES)t[n]=r.durations[n]+e.durations[n];return{durations:t,counts:{filesRead:r.counts.filesRead+e.counts.filesRead,filesHashed:r.counts.filesHashed+e.counts.filesHashed,filesWritten:r.counts.filesWritten+e.counts.filesWritten,restCalls:r.counts.restCalls+e.counts.restCalls}}}a(oN,"addTimings");function bee(r){let e=sN();for(let t of r)t.timings!==void 0&&(e=oN(e,t.timings));return e}a(bee,"aggregateTimings");function See(r){let e=b0(r);if(e<=0)return null;let t=er.SYNC_PHASES[0],n=-1;for(let i of er.SYNC_PHASES)r.durations[i]>n&&(n=r.durations[i],t=i);return{phase:t,ms:n,pct:n/e*100}}a(See,"dominantPhase");function np(r){return r>=1e3?`${(r/1e3).toFixed(1)}s`:`${Math.round(r)}ms`}a(np,"fmtMs");function wee(r){let e=b0(r);if(e<=0)return"";let t=er.SYNC_PHASES.filter(n=>r.durations[n]>0).sort((n,i)=>r.durations[i]-r.durations[n]).map(n=>`${n} ${np(r.durations[n])} ${Math.round(r.durations[n]/e*100)}%`);return`\u23F1 ExoSync ${np(e)} \u2014 ${t.join(" \xB7 ")} (${r.counts.filesHashed} hashed, ${r.counts.filesRead} read, ${r.counts.restCalls} REST)`}a(wee,"formatTimingsLine");function Eee(r,e){let t=er.SYNC_PHASES.map(n=>`${n}=${np(e.durations[n])}`);return`[ExoSync timings] ${r}: total ${np(b0(e))} \u2014 ${t.join(" ")} | hashed ${e.counts.filesHashed} read ${e.counts.filesRead} written ${e.counts.filesWritten} REST ${e.counts.restCalls}`}a(Eee,"formatRepoTimings")});var S0=E(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.LocalOutboxStore=Na.OUTBOX_REMOTE_ABSENT=Na.OUTBOX_STORE_FILENAME=void 0;Na.OUTBOX_STORE_FILENAME="exosync-outbox.local.json";Na.OUTBOX_REMOTE_ABSENT=" absent";function H2(r,e){return`${r}\0${e}`}a(H2,"outboxKey");function aN(r){if(r===null||typeof r!="object")return!1;let e=r;return typeof e.repoKey=="string"&&typeof e.path=="string"&&typeof e.chosenContent=="string"&&typeof e.baseRemoteSha=="string"}a(aN,"isEntry");var z2=class{static{a(this,"LocalOutboxStore")}constructor(e){this.writeChain=Promise.resolve(),this.io=e.io,this.now=e.now??(()=>new Date().toISOString())}async enqueue(e){await this.mutate(t=>{t.entries[H2(e.repoKey,e.path)]={version:1,...e,resolvedAt:e.resolvedAt.length>0?e.resolvedAt:this.now()}})}async remove(e,t){await this.mutate(n=>{delete n.entries[H2(e,t)]})}async list(){let e=await this.read();return Object.values(e.entries).filter(aN)}async listForRepo(e){return(await this.list()).filter(t=>t.repoKey===e)}async has(e,t){let i=(await this.read()).entries[H2(e,t)];return i!==void 0&&aN(i)}async mutate(e){let t=this.writeChain.then(async()=>{let n=await this.read();e(n),await this.io.writeAtomic(JSON.stringify(n,null,2))});return this.writeChain=t.catch(()=>{}),t}async read(){try{let e=await this.io.read();if(e===null)return{version:1,entries:{}};let t=JSON.parse(e);if(t===null||typeof t!="object")return{version:1,entries:{}};let n=t.entries;return n===null||typeof n!="object"?{version:1,entries:{}}:{version:1,entries:{...n}}}catch{return{version:1,entries:{}}}}};Na.LocalOutboxStore=z2});var w0=E(K2=>{"use strict";Object.defineProperty(K2,"__esModule",{value:!0});K2.isAuthError=vee;function vee(r){let e=r instanceof Error?r.message:String(r);return/HTTP 401/.test(e)?!0:/HTTP 403/.test(e)&&!/rate limit/i.test(e)&&!/abuse detection/i.test(e)}a(vee,"isAuthError")});var Y2=E(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});E0.scanForSecrets=Tee;E0.redactSecrets=Aee;var cN=[{kind:"github-token",re:/gh[pousr]_[A-Za-z0-9_]{36,}/},{kind:"github-fine-grained-token",re:/github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,}/},{kind:"private-key",re:/-----BEGIN [A-Z ]*PRIVATE KEY-----/}];function Tee(r){let e=[];for(let[t,n]of r)for(let{kind:i,re:s}of cN)s.test(n)&&e.push({path:t,kind:i});return e}a(Tee,"scanForSecrets");function Aee(r){let e=r;for(let{kind:t,re:n}of cN)e=e.replace(new RegExp(n.source,"g"),`[REDACTED:${t}]`);return e}a(Aee,"redactSecrets")});var T0=E(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});v0.isRateLimitError=lN;v0.withRateLimitBackoff=xee;function lN(r){let e=r instanceof Error?r.message:String(r);return/HTTP 429/.test(e)?!0:/HTTP 403/.test(e)&&(/rate limit/i.test(e)||/abuse detection/i.test(e))}a(lN,"isRateLimitError");var Iee=a(r=>new Promise(e=>setTimeout(e,r)),"defaultSleep");function xee(r,e={}){let t=e.maxRetries??3,n=e.baseDelayMs??1e3,i=e.sleep??Iee,s=e.random??Math.random;return async o=>{let c=0;for(;;)try{return await r(o)}catch(l){if(!lN(l)||c>=t)throw l;let u=n*2**c*(1+s());c++,await i(u)}}}a(xee,"withRateLimitBackoff")});var A0=E(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.DEFAULT_MAX_FILE_BYTES=Wo.InMemoryQuarantineStore=void 0;Wo.contentEquals=Ree;Wo.isSyncablePath=Cee;Wo.isFileSpaceSyncablePath=Oee;function Ree(r,e){if(r===void 0||e===void 0||typeof r=="string"&&typeof e=="string")return r===e;if(typeof r=="string"||typeof e=="string"||r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}a(Ree,"contentEquals");var Q2=class{static{a(this,"InMemoryQuarantineStore")}constructor(){this.entries=[]}async quarantine(e){this.entries.push(e)}};Wo.InMemoryQuarantineStore=Q2;function Cee(r){return r.endsWith(".md")&&!r.includes(".local.")&&!r.includes(".conflict.")}a(Cee,"isSyncablePath");function Oee(r){return!r.includes(".local.")&&!r.includes(".conflict.")}a(Oee,"isFileSpaceSyncablePath");Wo.DEFAULT_MAX_FILE_BYTES=30*1024*1024});var yN=E(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.SyncEngine=Qn.DEFAULT_LOCAL_MANIFEST_REHASH_MS=Qn.DEFAULT_MAX_PUSH_RETRIES=void 0;Qn.syncProgressPhaseText=Nee;Qn.isNonFastForwardError=gN;Qn.orderChildrenFirst=Vee;var uN=g0(),fN=W2(),gt=rp(),Ho=Zd(),Pee=xl(),Kc=ku(),X2=S0(),Dee=w0(),Fee=Y2(),Lee=T0(),Ws=A0();Qn.DEFAULT_MAX_PUSH_RETRIES=3;Qn.DEFAULT_LOCAL_MANIFEST_REHASH_MS=720*60*1e3;function Nee(r){switch(r.phase){case"reading-local":return r.detail!==void 0?`reading local files ${r.detail.done}\u2026`:"reading local files\u2026";case"detecting":return"detecting changes\u2026";case"pulling-remote":return"pulling remote tree\u2026";case"fetching-blobs":return r.detail!==void 0?`fetching remote files ${r.detail.done}/${r.detail.total}\u2026`:"fetching remote files\u2026";case"writing-files":return r.detail!==void 0?`writing files ${r.detail.done}\u2026`:"writing files\u2026";case"merging":return"merge layer firing\u2026";default:return r.phase}}a(Nee,"syncProgressPhaseText");var dN=25,kee=10,Mee=500,jee=25;function $ee(r){try{return new TextDecoder("utf-8",{fatal:!0}).decode(r)}catch{return null}}a($ee,"decodeUtf8Strict");function Uee(r){return typeof r=="string"?r:{base64:(0,Pee.bytesToBase64)(r)}}a(Uee,"toCommitContent");async function pN(r,e){if(r.readBinary===void 0)throw new Error("LocalFilesPort.readBinary is required for file-mode sync (Phase C)");return r.readBinary(e)}a(pN,"readBinaryStrict");async function Bee(r,e,t){if(r.writeBinary===void 0)throw new Error("LocalFilesPort.writeBinary is required for file-mode sync (Phase C)");return r.writeBinary(e,t)}a(Bee,"writeBinaryStrict");function hN(r){return r.length===0||r.startsWith("/")||r.includes("\\")?!1:r.split("/").every(e=>e.length>0&&e!=="."&&e!=="..")}a(hN,"isSafeRepoRelativePath");function gN(r){let e=r instanceof Error?r.message:String(r);return/HTTP 422/.test(e)&&/git\/refs/.test(e)||/ref update mismatch/.test(e)||/HTTP 422/.test(e)&&/git\/trees/.test(e)&&/BadObjectState/.test(e)}a(gN,"isNonFastForwardError");function Vee(r){let e=a(t=>t.split("/").filter(n=>n.length>0).length,"depth");return[...r].sort((t,n)=>e(n.localPath)-e(t.localPath))}a(Vee,"orderChildrenFirst");function mN(r,e){let t=new Map(r.map(o=>[o.path,o])),n=new Set,i=[];for(let o of e){n.add(o.path);let c=t.get(o.path);(c===void 0||c.blobSha!==o.blobSha)&&i.push(o)}let s=r.filter(o=>!n.has(o.path));return{changed:i,deleted:s}}a(mN,"diffTrees");function ka(r){return r instanceof Error?r.message:String(r)}a(ka,"errMsg");function qee(r,e,t){if(t.size===0)return r;let n=new Map(e.files.map(o=>[o.path,o])),i=new Set(r.map(o=>o.path)),s=[];for(let o of r){if(!t.has(o.path)){s.push(o);continue}let c=n.get(o.path);c!==void 0&&s.push(c)}for(let o of t){if(i.has(o))continue;let c=n.get(o);c!==void 0&&s.push(c)}return s}a(qee,"applyWatermarkPins");var J2={mergedFiles:new Map,mergedWrites:[],quarantineEntries:[],resolvedQuarantineEntries:[],mergedCount:0,mergedPaths:[],warnings:[]};function Z2(r){return new Map(r.map(e=>[e.path,e.blobSha]))}a(Z2,"treeByPath");function I0(r){return[...r.quarantineEntries.map(e=>e.path),...r.resolvedQuarantineEntries.map(e=>e.path)]}a(I0,"quarantinedPathsOf");var eA=class{static{a(this,"SyncEngine")}constructor(e){this.activeTimer=null,this.activeLocalIoProgress=null,this.opInProgress=!1,this.deps=e,this.now=e.now??(()=>Date.now()),this.transport=this.instrumentTransport((0,Lee.withRateLimitBackoff)(e.transport,e.backoff)),this.sha1=this.instrumentSha1(e.sha1)}instrumentTransport(e){return async t=>{let n=this.activeTimer;return n===null?e(t):(n.bumpRest(),n.time((0,fN.classifyRestPhase)(t),()=>e(t)))}}instrumentSha1(e){return t=>{let n=this.activeTimer;return n===null?e(t):(n.bumpHashed(),n.time("hash",()=>e(t)))}}instrumentLocalFiles(e){let t=a((c,l)=>{let u=this.activeTimer;return u===null?l():u.time(c,l)},"timed"),n={list:a(()=>t("localList",()=>e.list()),"list"),read:a(c=>(this.activeTimer?.bumpRead(),this.bumpReadProgress(),t("localRead",()=>e.read(c))),"read"),write:a((c,l)=>t("localWrite",()=>(this.activeTimer?.bumpWritten(),this.bumpWriteProgress(),e.write(c,l))),"write"),delete:a(c=>e.delete(c),"delete")},i=e.readBinary?.bind(e);i!==void 0&&(n.readBinary=c=>(this.activeTimer?.bumpRead(),this.bumpReadProgress(),t("localRead",()=>i(c))));let s=e.writeBinary?.bind(e);s!==void 0&&(n.writeBinary=(c,l)=>t("localWrite",()=>(this.activeTimer?.bumpWritten(),this.bumpWriteProgress(),s(c,l))));let o=e.stat?.bind(e);return o!==void 0&&(n.stat=c=>t("localList",()=>o(c))),n}busyResult(e){return{repoKey:e.repoKey,status:"busy",pulledCount:0,pushedCount:0,mergedCount:0,quarantinedCount:0,warnings:[],deferredDeletes:[],detail:"another sync operation is in progress (D11 guard) \u2014 retry after it finishes"}}modeOps(e){let t=e.spaceKind==="file",n=t?Ws.isFileSpaceSyncablePath:Ws.isSyncablePath,i=this.deps.maxFileBytes??Ws.DEFAULT_MAX_FILE_BYTES;return{fileMode:t,syncable:n,treeFilter:a(s=>n(s.path)&&(!t||s.size===void 0||s.size<=i),"treeFilter")}}async buildFileModeFirstSyncBase(e,t,n,i){let s=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),o=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,s,this.deps.baseURL),c=(await(0,gt.getTree)(this.transport,e.owner,e.repo,o.treeSha,this.deps.baseURL)).filter(n.treeFilter),l=[];for(let u of c){let f=t.get(u.path);f!==void 0&&await(0,Kc.gitBlobSha)(f,this.sha1)===u.blobSha&&l.push({path:u.path,blobSha:u.blobSha})}return i.push(`first-sync (file mode): synthetic base from ${l.length} already-identical file(s) at head ${s} \u2014 divergence resolves through the remote-wins layer (D22)`),{lastSyncedSha:s,rootTreeSha:o.treeSha,files:l,spaceKind:"file"}}async syncAll(e,t="sync",n){if(this.opInProgress)return e.map(i=>this.busyResult(i));this.opInProgress=!0;try{let i=[];for(let s of e)i.push(await this.syncLocked(s,t,n));return i}finally{this.opInProgress=!1}}async sync(e,t="sync",n){if(this.opInProgress)return this.busyResult(e);this.opInProgress=!0;try{return await this.syncLocked(e,t,n)}finally{this.opInProgress=!1}}emitProgress(e,t,n,i){if(e!==void 0)try{e(i===void 0?{repoKey:t,phase:n}:{repoKey:t,phase:n,detail:i})}catch{}}bumpReadProgress(){let e=this.activeLocalIoProgress;e!==null&&(e.reads+=1,e.reads%Mee===0&&this.emitProgress(e.emit,e.repoKey,"reading-local",{done:e.reads}))}bumpWriteProgress(){let e=this.activeLocalIoProgress;e!==null&&(e.writes+=1,e.writes%jee===0&&this.emitProgress(e.emit,e.repoKey,"writing-files",{done:e.writes}))}async syncLocked(e,t="sync",n){let i=new fN.SyncPhaseTimer(this.now),s=this.activeTimer;this.activeTimer=i;let o=this.activeLocalIoProgress;this.activeLocalIoProgress=n!==void 0?{emit:n,repoKey:e.repoKey,reads:0,writes:0}:null;let c=[],l=[],u=0,f=0,d=[],p=a((h,_={})=>({repoKey:e.repoKey,status:h,pulledCount:0,pushedCount:0,mergedCount:0,quarantinedCount:0,warnings:c,deferredDeletes:l,...u>0?{outboxPushedCount:u}:{},...f>0?{outboxReconflictedCount:f}:{},timings:i.snapshot(),..._}),"result");try{let h=await this.deps.materializationCheck.check(e);if(!h.fullyMaterialized)return c.push(`skipped: repo not fully materialized${h.reason?` (${h.reason})`:""} \u2014 deletes NOT inferred (D19)`),p("skipped-not-materialized");let _=this.modeOps(e),y=this.instrumentLocalFiles(this.deps.localFilesFor(e));if(_.fileMode&&(y.readBinary===void 0||y.writeBinary===void 0))return p("error",{detail:"file-mode repo requires a LocalFilesPort with readBinary/writeBinary \u2014 refusing to sync through the text-only port (binary would corrupt)"});if(_.fileMode&&this.deps.quarantine===void 0)return p("error",{detail:"file-mode repo requires a quarantine sink (D18 remote-wins preserves losing local bytes there) \u2014 configure the quarantine repo before syncing FileSpaces"});let S=this.deps.maxFileBytes??Ws.DEFAULT_MAX_FILE_BYTES;if(t!=="pull"&&this.deps.outbox!==void 0){let ee=await this.flushOutbox(e,c);u=ee.pushed,f=ee.reconflicted}let w=await this.deps.watermarkStore.get(e.repoKey);if(w?.spaceKind==="file"&&!_.fileMode)return p("error",{detail:"watermark was written by a FILE-mode sync but the spec now resolves to asset mode \u2014 refusing (fix the conflicting Space declarations, or clear the watermark to restart)"});w!==null&&_.fileMode&&w.spaceKind!=="file"&&(c.push("watermark was written by an ASSET-mode sync \u2014 rebuilding the base through the file-mode first-sync layer (kind flip)"),w=null);let T=this.deps.localManifestStore!==void 0?y.stat?.bind(y):void 0,O=T!==void 0&&w!==null&&!_.fileMode,A=O&&this.deps.localManifestStore!==void 0?await this.deps.localManifestStore.get(e.repoKey):null,x=this.deps.localManifestFullRehashMs??Qn.DEFAULT_LOCAL_MANIFEST_REHASH_MS,P=O&&(A===null||this.now()-A.lastFullRehashMs>=x),V=new Map,j=new Set,$=new Map,K=new Map,N=new Map,ae=!1,we=new Map;if(O&&w!==null)for(let ee of w.files)we.set(ee.path,ee.blobSha);for(let ee of(await y.list()).filter(_.syncable)){if(_.fileMode){let xe=await pN(y,ee);if(xe.byteLength>S){j.add(ee),c.push(`skipped oversized file ${ee} (${xe.byteLength} bytes > ${S} cap) \u2014 excluded from sync symmetrically (Phase C size cap)`);continue}V.set(ee,xe);continue}if(!O||T===void 0){V.set(ee,await y.read(ee));continue}let he=await T(ee),Te=!P&&he!==null?A?.files[ee]:void 0;if(he!==null&&Te!==void 0&&Te.mtimeMs===he.mtimeMs&&Te.size===he.size&&Te.blobSha===we.get(ee)){$.set(ee,{blobSha:Te.blobSha,...Te.uid!==void 0?{uid:Te.uid}:{}}),K.set(ee,Te.blobSha),N.set(ee,he);continue}ae=!0,V.set(ee,await y.read(ee)),he!==null&&N.set(ee,he)}let te=!1;if(w===null)if(_.fileMode)te=!0,w=await this.buildFileModeFirstSyncBase(e,V,_,c);else{let ee=await this.bootstrapWatermark(e,V,c,p);if(ee.kind==="settled")return ee.outcome;te=!0,w=ee.base}let pe=w;_.fileMode&&j.size>0&&(w={...w,files:w.files.filter(ee=>!j.has(ee.path))});let Y,Ee;O&&!P?(Y=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),Ee=Y===w.lastSyncedSha?w.rootTreeSha:await this.resolveBaseTreeSha(e,w)):Ee=await this.resolveBaseTreeSha(e,w),this.emitProgress(n,e.repoKey,"detecting");let ie=await(0,Ho.detectChanges)({localFiles:V,...O?{cachedEntries:$}:{},watermark:w,actualBaseTreeSha:Ee,sha1:this.sha1});if(ie.kind==="full-conflict")return p("full-conflict",{detail:`${ie.reason}${ie.detail?`: ${ie.detail}`:""} \u2014 divergence must go through merge/quarantine (A2/A3), not overwrite`});if(c.push(...ie.warnings),O&&this.deps.localManifestStore!==void 0){let ee={};for(let[he,Te]of V){let xe=N.get(he),je=ie.diskBlobShas.get(he);if(xe===void 0||je===void 0)continue;let ke=typeof Te=="string"?(0,Ho.extractAssetUid)(Te):void 0;ee[he]={mtimeMs:xe.mtimeMs,size:xe.size,blobSha:je,...ke!==void 0?{uid:ke}:{}}}for(let[he,Te]of $){let xe=N.get(he);xe!==void 0&&(ee[he]={mtimeMs:xe.mtimeMs,size:xe.size,blobSha:Te.blobSha,...Te.uid!==void 0?{uid:Te.uid}:{}})}if(A!==null&&Object.keys(A.files).some(he=>!(he in ee))&&(ae=!0),ae||P||A===null){let he={version:1,files:ee,lastFullRehashMs:P||A===null?this.now():A.lastFullRehashMs};await this.deps.localManifestStore.set(e.repoKey,he)}}let ne=this.pinLocalChanges(ie,V,c,l,t);d=[...ne.pushDeletionsAll.keys()];let de=await this.runPushLoop(e,w,ne,V,c,_,te,j,t,n,Y);if(d=[],de.kind!=="done"&&ne.pushDeletionsAll.size>0&&l.push(...ne.pushDeletionsAll.keys()),de.kind==="conflict")return p("conflict",{detail:de.detail});if(de.kind==="secret-detected")return p("error",{detail:de.detail});if(de.kind==="retry-exhausted"){c.push(...de.merge.warnings);let ee=await this.buildTerminalQuarantineEntries(e,w,de.pushFiles,de.merge.quarantineEntries,V),he=[...de.merge.quarantineEntries,...de.merge.resolvedQuarantineEntries,...ee];return await this.flushQuarantine(he,c),p("retry-exhausted",{detail:de.detail,quarantinedCount:he.length,...he.length>0?{quarantinedPaths:he.map(Te=>Te.path)}:{}})}let{examinedHead:ge,pushedSha:Z,applyWrites:ye,applyDeletes:Pe,pushFiles:se}=de,_e=de.merge;c.push(..._e.warnings),c.push(...de.deferredWarnings),l.push(...de.withheldDeletions);let Ne=de.deferredPaths.size>0?{deferredPaths:[...de.deferredPaths]}:{},Q=de.pushedDeletions.length>0?{pushedDeletes:de.pushedDeletions}:{},ce=await this.flushQuarantine([..._e.quarantineEntries,..._e.resolvedQuarantineEntries],c),be=new Set;if(!ce&&_e.resolvedQuarantineEntries.length>0){for(let ee of _e.resolvedQuarantineEntries)be.add(ee.path);c.push(`quarantine flush failed \u2014 remote-wins apply withheld for ${be.size} path(s); local files untouched, conflict re-derives next sync (D18 durability gate)`)}if(Z===void 0&&ge===w.lastSyncedSha&&ye.length===0&&Pe.length===0&&_e.mergedWrites.length===0&&_e.quarantineEntries.length===0&&_e.resolvedQuarantineEntries.length===0&&(w.pinnedPaths?.length??0)===0&&de.alreadyInHead.length===0&&de.deferredPaths.size===0&&!te)return p("synced");let Ie=Z??ge,Ce=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,Ie,this.deps.baseURL);if(Z!==void 0&&Ce.parents[0]!==ge)return await this.checkRaceWindow(e,w,ge,Ce.parents[0],se,new Set(de.pushedDeletions),c,_),c.push(`race-window: watermark NOT advanced (pushed commit's parent ${Ce.parents[0]} != examined head ${ge}) \u2014 next sync reconciles the concurrent change`),p("synced",{pushedSha:Z,pushedCount:se.size,mergedCount:_e.mergedCount,quarantinedCount:_e.quarantineEntries.length+_e.resolvedQuarantineEntries.length,..._e.mergedPaths.length>0?{mergedPaths:_e.mergedPaths}:{},...I0(_e).length>0?{quarantinedPaths:I0(_e)}:{},...Ne,...Q});let{pulledCount:Fe,pinnedPaths:De,pulledPaths:Ae}=await this.applyRemoteChanges(y,V,[...ye,..._e.mergedWrites].filter(ee=>!be.has(ee.path)),Pe.filter(ee=>!be.has(ee.path)),c,K);for(let ee of _e.quarantineEntries)De.add(ee.path);for(let ee of de.deferredPaths)De.add(ee);for(let ee of be)De.add(ee);if(_.fileMode){for(let ee of j)De.add(ee);for(let ee of de.remoteOversized)De.add(ee)}return await this.advanceWatermark(e,Ie,Ce.treeSha,V,[...ye,..._e.mergedWrites,...de.deferredRemoteChanges],pe,De,ie.diskBlobShas,_,j),await this.resolveClearedPins(e,pe,De,c,new Set(_e.resolvedQuarantineEntries.map(ee=>ee.path))),p("synced",{pushedSha:Z,pulledCount:Fe,pushedCount:se.size,mergedCount:_e.mergedCount,quarantinedCount:_e.quarantineEntries.length+_e.resolvedQuarantineEntries.length,..._e.mergedPaths.length>0?{mergedPaths:_e.mergedPaths}:{},...Ae.length>0?{pulledPaths:Ae}:{},...I0(_e).length>0?{quarantinedPaths:I0(_e)}:{},...Ne,...Q})}catch(h){let _=this.deps.redact??(y=>y);return d.length>0&&l.push(...d),(0,Dee.isAuthError)(h)?p("auth-required",{detail:_(`authentication failed: ${ka(h)} \u2014 the PAT is expired, revoked or under-scoped; update it in the per-device secure storage (R8). Never treated as success.`)}):(c.push(`sync failed: ${_(ka(h))}`),p("error",{detail:_(ka(h))}))}finally{this.activeTimer=s,this.activeLocalIoProgress=o}}async flushQuarantine(e,t){if(e.length===0)return!0;let n=this.deps.redact??(s=>s);for(let s of e)t.push(n(`quarantined ${s.path}: ${s.reason}`));let i=this.deps.quarantine;if(i===void 0)return!1;try{if(i.quarantineAll!==void 0)await i.quarantineAll(e);else for(let s of e)await i.quarantine(s);return!0}catch(s){let o=this.deps.redact??(c=>c);return t.push(`quarantine sink failed: ${o(ka(s))} \u2014 files untouched on disk; the conflict re-derives next sync (D17 degradation)`),!1}}async flushOutbox(e,t){let n=this.deps.outbox;if(n===void 0)return{pushed:0,reconflicted:0};let i=await n.listForRepo(e.repoKey);if(i.length===0)return{pushed:0,reconflicted:0};let s=this.deps.redact??(_=>_),o,c;try{({head:o,shaByPath:c}=await this.outboxHeadTreeShas(e))}catch(_){return t.push(`outbox flush deferred (${i.length} resolution(s) awaiting push): ${s(ka(_))}`),{pushed:0,reconflicted:0}}let l=0,u=[];for(let _ of i){let y=c.get(_.path)??X2.OUTBOX_REMOTE_ABSENT,S=y===X2.OUTBOX_REMOTE_ABSENT&&_.baseRemoteSha!==X2.OUTBOX_REMOTE_ABSENT?[...c].filter(([w,T])=>w!==_.path&&T===_.baseRemoteSha).map(([w])=>w):[];if(y!==_.baseRemoteSha&&S.length===0){await n.remove(_.repoKey,_.path),l++,t.push(s(`outbox: remote moved for ${_.path} since you resolved it \u2014 NOT pushed; resolve again (your choice is preserved on disk)`));continue}u.push({entry:_,stalePaths:S})}if(u.length===0)return{pushed:0,reconflicted:l};let f=new Map;for(let{entry:_}of u)f.set(_.path,_.chosenContent);let d=new Set;for(let{stalePaths:_}of u)for(let y of _)f.has(y)||d.add(y);let p=[...d];try{await(0,uN.restCreateCommit)(this.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:f,...p.length>0?{deletions:p}:{},message:p.length>0?`chore(exosync): resolve ${u.length} keep-local conflict(s) (consolidate ${p.length} stale remote path(s))`:`chore(exosync): push ${u.length} resolved conflict(s)`,expectedHeadSha:o,...this.deps.baseURL!==void 0?{baseURL:this.deps.baseURL}:{},...this.deps.redact!==void 0?{redact:this.deps.redact}:{}})}catch(_){return t.push(`outbox: batch push deferred for ${u.length} resolution(s), will retry next sync: ${s(ka(_))}`),{pushed:0,reconflicted:l}}let h=0;for(let{entry:_,stalePaths:y}of u){let S=y.filter(w=>!f.has(w));await this.snapOutboxWatermark(e,_.path,_.chosenContent,S),await this.deps.quarantine?.markResolved?.(_.repoKey,_.path);for(let w of S)await this.deps.quarantine?.markResolved?.(_.repoKey,w);await n.remove(_.repoKey,_.path),h++,S.length>0&&t.push(`consolidated cross-path conflict for ${_.path} \u2014 removed ${S.length} stale remote copy/copies (recoverable in git history)`)}return h>0&&t.push(`pushed ${h} resolved conflict(s)`),{pushed:h,reconflicted:l}}async outboxHeadTreeShas(e){let t=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),n=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,t,this.deps.baseURL),i=await(0,gt.getTree)(this.transport,e.owner,e.repo,n.treeSha,this.deps.baseURL),s=new Map;for(let o of i)s.set(o.path,o.blobSha);return{head:t,shaByPath:s}}async snapOutboxWatermark(e,t,n,i=[]){let s=await this.deps.watermarkStore.get(e.repoKey);if(s===null)return;let o=new Set([t,...i]),c=(s.pinnedPaths??[]).filter(y=>!o.has(y)),l=await(0,Kc.gitBlobSha)(n,this.sha1),u=(0,Ho.extractAssetUid)(n),f={path:t,blobSha:l,...u!==void 0?{uid:u}:{}},d=new Set(i),p=s.files.filter(y=>!d.has(y.path)),h=p.findIndex(y=>y.path===t),_=h>=0?p.map((y,S)=>S===h?f:y):[...p,f];await this.deps.watermarkStore.set(e.repoKey,{...s,files:_,...c.length>0?{pinnedPaths:c}:{pinnedPaths:void 0}})}async buildTerminalQuarantineEntries(e,t,n,i,s){let o=new Set(i.map(u=>u.path)),c=new Map;try{let u=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),f=(await(0,gt.getTree)(this.transport,e.owner,e.repo,(await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,u,this.deps.baseURL)).treeSha,this.deps.baseURL)).filter(d=>n.has(d.path));for(let d of f)c.set(d.path,await(0,gt.getBlobText)(this.transport,e.owner,e.repo,d.blobSha,this.deps.baseURL))}catch{}let l=[];for(let[u,f]of n){if(o.has(u))continue;let d=s.get(u),p=d??f,h=d!==void 0&&!(0,Ws.contentEquals)(d,f),_=typeof p=="string"?(0,Ho.extractAssetUid)(p):void 0,y=c.get(u);l.push({repoKey:e.repoKey,path:u,..._!==void 0?{uid:_}:{},reason:`non-fast-forward push failed after ${this.deps.maxPushRetries??Qn.DEFAULT_MAX_PUSH_RETRIES} retries (D16) \u2014 a concurrent writer keeps moving ${e.branch}; base recoverable from git history at ${t.lastSyncedSha}${h?"; the contended push payload was a merged proposal (never applied to disk) \u2014 the merge re-derives next sync":""}`,...typeof p=="string"?{localContent:p}:{localContentBytes:p},...y!==void 0?{remoteContent:y}:{}})}return l}async resolveClearedPins(e,t,n,i,s=new Set){let o=this.deps.quarantine;if(o===void 0||o.markResolved===void 0)return;let c=(t.pinnedPaths??[]).filter(l=>!n.has(l)&&!s.has(l));for(let l of c)try{await o.markResolved?.(e.repoKey,l)}catch(u){let f=this.deps.redact??(d=>d);i.push(`quarantine markResolved failed for ${l}: ${f(ka(u))} \u2014 unresolved-count may overcount until the resolver UI reconciles (CQ4)`)}}async resolveBaseTreeSha(e,t){try{return(await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,t.lastSyncedSha,this.deps.baseURL)).treeSha}catch{return null}}pinLocalChanges(e,t,n,i,s){let o=e.modified.filter(p=>p.basePath!==void 0),c=[...e.added,...e.modified.filter(p=>p.basePath===void 0)],l=new Map;if(s==="pull"){for(let p of o)p.basePath!==void 0&&i.push(p.basePath),n.push(`pull-only: rename (uid ${p.uid??"?"}) ${p.basePath} \u2192 ${p.path} not pushed \u2014 propagates on the next push/Sync (#3473)`);for(let p of e.deleted)i.push(p.path),n.push(`pull-only: delete of ${p.path} not pushed \u2014 propagates on the next push/Sync (#3473)`)}else{for(let p of o)p.basePath!==void 0&&l.set(p.basePath,p.path);for(let p of e.deleted)l.set(p.path,p.path)}let u=[...c,...o,...e.deleted.map(p=>({...p}))],f=new Set(e.deleted.map(p=>p.path)),d=new Map;for(let p of[...c,...s==="pull"?[]:o]){let h=t.get(p.path);h!==void 0&&d.set(p.path,h)}return{localChanges:u,localDeletedPaths:f,pushFilesAll:d,pushDeletionsAll:l,dupUids:e.duplicateUids}}async runPushLoop(e,t,n,i,s,o,c=!1,l=new Set,u="sync",f,d){let{localChanges:p,localDeletedPaths:h,pushFilesAll:_,pushDeletionsAll:y,dupUids:S}=n,w=this.deps.maxPushRetries??Qn.DEFAULT_MAX_PUSH_RETRIES,T=0,O="",A,x=[],P=[],V=new Map,j=new Set,$=[],K=J2,N=[],ae=new Set,we=[],te=[],pe=new Set;for(;;){O=T===0&&d!==void 0&&_.size===0&&y.size===0?d:await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),x=[],P=[],K=J2,N=[],ae=new Set,we=[],te=[];let Y,Ee=new Set,ie=(t.pinnedPaths?.length??0)>0;if(O!==t.lastSyncedSha||ie||c){this.emitProgress(f,e.repoKey,"pulling-remote");let ge=await this.collectRemoteChanges(e,t,O,o,l,s,pe,f);Y=ge.headTreeByPath;let Z=this.matchLocalVsRemote(p,h,i,ge.changes,Ee,S,ge.headTreeByPath);if(Z.conflicts.length>0){if(u==="sync"&&this.emitProgress(f,e.repoKey,"merging"),u!=="sync"){for(let ye of Z.conflicts){ae.add(ye.local.path),ye.local.basePath!==void 0&&ae.add(ye.local.basePath);for(let Pe of ye.remotes)ae.add(Pe.path),Pe.kind==="change"&&we.push(Pe)}te.push(`${u}-only: ${Z.conflicts.length} conflict(s) deferred to a full Sync (${Z.conflicts.map(ye=>ye.desc).join("; ")}) \u2014 paths pinned, nothing merged`)}else if(o.fileMode)K=this.resolveFileModeConflicts(e,Z.conflicts,i,Z.applyWrites,Z.applyDeletes);else{if(this.deps.mergeLayer===void 0)return{kind:"conflict",detail:`overlapping change on ${Z.conflicts[0].desc} \u2014 merge layer (A2/A3) required; nothing pushed, nothing written`};K=await this.resolveMergeConflicts(e,t,Z.conflicts,i)}if(u==="sync")for(let ye of Z.conflicts)for(let Pe of ye.remotes)Pe.path!==ye.local.path&&(ae.add(Pe.path),Pe.kind==="change"&&we.push(Pe),te.push(`conflict group ${ye.desc}: remote change at ${Pe.path} NOT applied \u2014 pinned to re-derive on the next sync (#3477)`))}if(x=Z.applyWrites,P=Z.applyDeletes,u==="push"&&(x.length>0||P.length>0)){for(let ye of x)ae.add(ye.path),we.push(ye);for(let ye of P)ae.add(ye.path);te.push(`push-only: ${x.length+P.length} remote change(s) NOT applied \u2014 pinned to re-derive on the next pull/Sync`),x=[],P=[]}}V=u==="pull"?new Map:new Map([...[..._].filter(([ge])=>!Ee.has(ge)),...K.mergedFiles]),j=new Set,$=[];for(let[ge,Z]of y){if(Ee.has(Z)){$.push(ge);continue}V.has(ge)||j.add(ge)}if((V.size>0||j.size>0)&&Y===void 0&&(Y=Z2(await(0,gt.getTree)(this.transport,e.owner,e.repo,t.rootTreeSha,this.deps.baseURL))),V.size>0&&Y!==void 0){for(let[ge,Z]of V){let ye=Y.get(ge);ye!==void 0&&ye===await(0,Kc.gitBlobSha)(Z,this.sha1)&&(V.delete(ge),N.push(ge))}N.length>0&&s.push(`phantom push skipped: ${N.length} file(s) already identical in remote HEAD (${N.join(", ")}) \u2014 excluded from the commit (#3475)`)}if(j.size>0&&Y!==void 0){for(let ge of[...j])Y.has(ge)||j.delete(ge);V.size===0&&j.size>=Y.size&&($.push(...j),te.push(`deletion of ALL ${j.size} remaining file(s) deferred \u2014 GitHub cannot create an empty tree; the deletes re-derive and propagate once the repo has at least one surviving file`),j.clear())}if(V.size===0&&j.size===0)break;let ne=new Map;for(let[ge,Z]of V)if(typeof Z=="string")ne.set(ge,Z);else{let ye=$ee(Z);ye!==null&&ne.set(ge,ye)}let de=(0,Fee.scanForSecrets)(ne);if(de.length>0)return{kind:"secret-detected",detail:`secret-scan: refusing to push \u2014 ${de.map(ge=>`${ge.path} (${ge.kind})`).join(", ")} (R5); remove the secret and re-sync`};try{A=await(0,uN.restCreateCommit)(this.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:new Map([...V].map(([ge,Z])=>[ge,Uee(Z)])),deletions:[...j],message:this.deps.commitMessage?.(e,V.size,j.size)??`chore(exosync): sync ${V.size} file(s)${j.size>0?`, ${j.size} deletion(s)`:""}`,baseURL:this.deps.baseURL,redact:this.deps.redact});break}catch(ge){if(!gN(ge))throw ge;if(T++,T>w)return{kind:"retry-exhausted",detail:`non-fast-forward push failed after ${w} retries (D16 cap) \u2014 contended files routed to quarantine (D17)`,pushFiles:V,merge:K};s.push(`non-fast-forward push (attempt ${T}/${w}) \u2014 re-pulling and retrying (D16)`)}}return{kind:"done",examinedHead:O,pushedSha:A,applyWrites:x,applyDeletes:P,pushFiles:V,pushedDeletions:A!==void 0?[...j]:[],withheldDeletions:$,merge:K,remoteOversized:pe,alreadyInHead:N,deferredPaths:ae,deferredRemoteChanges:we,deferredWarnings:te}}async resolveMergeConflicts(e,t,n,i){let s=this.deps.mergeLayer;if(s===void 0)return J2;let o=new Map(t.files.map(y=>[y.path,y])),c=new Map,l=[],u=[],f=[],d=[],p=0,h=a(y=>typeof y=="string"?y:void 0,"asText"),_=a((y,S,w)=>{let T=h(i.get(y.local.path)),O=h(y.remotes[0]?.content);return{repoKey:e.repoKey,path:y.local.path,...y.local.uid!==void 0?{uid:y.local.uid}:{},reason:S,...w!==void 0?{baseContent:w}:{},...T!==void 0?{localContent:T}:{},...O!==void 0?{remoteContent:O}:{}}},"entry");for(let y of n){let S=o.get(y.local.basePath??y.local.path)??o.get(y.remotes[0]?.path??""),w;if(S!==void 0&&(w=await(0,gt.getBlobText)(this.transport,e.owner,e.repo,S.blobSha,this.deps.baseURL)),y.remotes.length>1){u.push(_(y,`ambiguous conflict: local change overlaps ${y.remotes.length} remote changes (${y.remotes.map(P=>P.path).join(", ")})`,w));continue}let T=y.remotes[0],O=h(i.get(y.local.path)),A=await s.resolve({path:y.local.path,...y.local.uid!==void 0?{uid:y.local.uid}:{},...w!==void 0?{base:w}:{},...O!==void 0?{local:O}:{},...T.kind==="change"&&typeof T.content=="string"?{remote:T.content}:{}});if(A.action==="quarantine"){u.push(_(y,A.reason,w));continue}p++,d.push(y.local.path);for(let P of A.warnings??[])f.push(`merge(${y.local.path}): ${P}`);let x=T.kind==="change"?T.content:void 0;if(A.content!==x&&c.set(y.local.path,A.content),A.content!==i.get(y.local.path)){let P=(0,Ho.extractAssetUid)(A.content)??y.local.uid;l.push({path:y.local.path,kind:"change",content:A.content,blobSha:await(0,Kc.gitBlobSha)(A.content,this.sha1),...P!==void 0?{uid:P}:{}})}}return{mergedFiles:c,mergedWrites:l,quarantineEntries:u,resolvedQuarantineEntries:[],mergedCount:p,mergedPaths:d,warnings:f}}resolveFileModeConflicts(e,t,n,i,s){let o=[],c=[];for(let l of t){l.remotes.length>1&&c.push(`file-mode conflict on ${l.local.path} unexpectedly overlaps ${l.remotes.length} remote changes \u2014 resolving against the first`);let u=l.remotes[0],f=n.get(l.local.path);u.kind==="change"?i.push(u):s.push(u),!(l.localIsDelete||f===void 0)&&o.push({repoKey:e.repoKey,path:l.local.path,reason:`file-mode remote-wins (D18): remote ${u.kind==="change"?`version ${u.blobSha}`:"delete"} wins; this is the losing LOCAL version, preserved byte-exact`,...typeof f=="string"?{localContent:f}:{localContentBytes:f}})}return{mergedFiles:new Map,mergedWrites:[],quarantineEntries:[],resolvedQuarantineEntries:o,mergedCount:0,mergedPaths:[],warnings:c}}async applyRemoteChanges(e,t,n,i,s,o=new Map){let c=0,l=new Set,u=[],f=a(async(h,_)=>{try{return _?await pN(e,h):await e.read(h)}catch{return}},"tryRead"),d=a(async(h,_)=>{typeof _=="string"?await e.write(h,_):await Bee(e,h,_)},"writeContent"),p=a(async h=>{let _=await f(h,!1);return _===void 0?!0:await(0,Kc.gitBlobSha)(_,this.sha1)===o.get(h)},"cacheHitUnchanged");for(let h of n){if(h.content===void 0)continue;if(!hN(h.path)){s.push(`unsafe remote path skipped on pull-apply: ${h.path}`),l.add(h.path);continue}let _=t.get(h.path);if(_===void 0&&o.has(h.path)){if(!await p(h.path)){s.push(`pull-apply skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 remote change re-derives next sync`),l.add(h.path);continue}await d(h.path,h.content),c++,u.push(h.path);continue}let y=await f(h.path,typeof(_??h.content)!="string");if(!(0,Ws.contentEquals)(y,_)){s.push(`pull-apply skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 remote change re-derives next sync`),l.add(h.path);continue}await d(h.path,h.content),c++,u.push(h.path)}for(let h of i){if(!hN(h.path)){s.push(`unsafe remote path skipped on pull-delete: ${h.path}`),l.add(h.path);continue}let _=t.get(h.path);if(_===void 0&&o.has(h.path)){if(!await p(h.path)){s.push(`pull-delete skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 delete-vs-modify re-derives next sync`),l.add(h.path);continue}await e.delete(h.path),c++,u.push(h.path);continue}if(_!==void 0){let y=await f(h.path,typeof _!="string");if(y!==void 0&&!(0,Ws.contentEquals)(y,_)){s.push(`pull-delete skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 delete-vs-modify re-derives next sync`),l.add(h.path);continue}await e.delete(h.path),c++,u.push(h.path)}}return{pulledCount:c,pinnedPaths:l,pulledPaths:u}}async advanceWatermark(e,t,n,i,s,o,c,l,u,f=new Set){let d=(await(0,gt.getTree)(this.transport,e.owner,e.repo,n,this.deps.baseURL)).filter(h=>u.treeFilter(h)&&!f.has(h.path)),p=qee(await this.buildWatermarkFiles(e,d,i,s,o,l,u),o,c);await this.deps.watermarkStore.set(e.repoKey,{lastSyncedSha:t,rootTreeSha:n,files:p,...c.size>0?{pinnedPaths:[...c]}:{},...u.fileMode?{spaceKind:"file"}:{}})}async tryMountBaseBootstrap(e,t,n,i,s){let o=this.deps.mountBaseStore,c=null;if(o!==void 0)try{c=await o.get(e.repoKey)}catch{return null}let l=!1;if(c===null&&this.deps.localBaseShaProvider!==void 0)try{let S=await this.deps.localBaseShaProvider(e);typeof S=="string"&&S.length>0&&(c=S,l=!0)}catch{}if(c===null||t.startsWith(c))return null;let u=300,f=null;try{let S=t;for(let w=0;w<u;w++){let T=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,S,this.deps.baseURL);if(T.sha===c||T.sha.startsWith(c)){f=T;break}if(T.parents.length===0)break;S=T.parents[0]}}catch{return null}if(f===null)return null;let d;try{d=(await(0,gt.getTree)(this.transport,e.owner,e.repo,f.treeSha,this.deps.baseURL)).filter(S=>(0,Ws.isSyncablePath)(S.path))}catch{return null}let p;try{let S=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,t,this.deps.baseURL);p=Z2((await(0,gt.getTree)(this.transport,e.owner,e.repo,S.treeSha,this.deps.baseURL)).filter(w=>(0,Ws.isSyncablePath)(w.path)))}catch{return null}let h=d.filter(S=>!n.has(S.path)&&p.get(S.path)===S.blobSha);if(h.length>0){let S=h.slice(0,3).map(w=>w.path).join(", ")+(h.length>3?", \u2026":"");return i.push(`first-sync (asset mode): base-tree\u2286working-tree sanity guard fired \u2014 ${h.length} base file(s) absent from the working tree but UNCHANGED on remote head (${S}); the verified-ancestor base may not match the working tree's derivation commit (out-of-band submodule manipulation) \u2192 routing to merge/quarantine instead of inferring a silent deletion (#3610)`),{kind:"settled",outcome:s("full-conflict",{detail:`first-sync: base-tree\u2286working-tree sanity guard \u2014 ${h.length} base file(s) absent from the working tree are unchanged on remote head (${S}); refusing to infer a silent deletion from a base that may not match the derivation commit \u2014 divergence must go through merge/quarantine (A2/A3), never a silent delete (#3610)`})}}let _=d.map(S=>({path:S.path,blobSha:S.blobSha})),y={lastSyncedSha:f.sha,rootTreeSha:f.treeSha,files:_};if(l&&o!==void 0)try{await o.set(e.repoKey,f.sha)}catch{}return i.push(l?`first-sync (asset mode): BACKFILLED the 3-way base from the locally checked-out commit ${f.sha} (no recorded mount base) \u2014 remote head ${t} advanced since; local edits 3-way merge against it instead of false-conflicting (#3590)`:`first-sync (asset mode): reconciling against the recorded mount base ${f.sha} \u2014 remote head ${t} advanced since mount; local edits 3-way merge against it instead of false-conflicting (#3590)`),{kind:"additive-base",base:y}}async bootstrapWatermark(e,t,n,i){let s=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),o=await this.tryMountBaseBootstrap(e,s,t,n,i);if(o!==null)return o;let c=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,s,this.deps.baseURL),l=(await(0,gt.getTree)(this.transport,e.owner,e.repo,c.treeSha,this.deps.baseURL)).filter(p=>(0,Ws.isSyncablePath)(p.path)),u=[],f;for(let p of l){let h=t.get(p.path);if(h===void 0||await(0,Kc.gitBlobSha)(h,this.sha1)!==p.blobSha){f===void 0&&(f=p.path);continue}let _=typeof h=="string"?(0,Ho.extractAssetUid)(h):void 0;u.push({path:p.path,blobSha:p.blobSha,..._?{uid:_}:{}})}let d={lastSyncedSha:s,rootTreeSha:c.treeSha,files:u};return f!==void 0?this.deps.mergeLayer===void 0?{kind:"settled",outcome:i("full-conflict",{detail:`first-sync: no watermark and local content diverges from remote head at ${f} \u2014 A2/A3 scope`})}:(n.push(`first-sync (asset mode): no 3-way merge base and local diverges from remote head (first at ${f}) \u2014 reconciling ZERO-LOSS against ${u.length} byte-identical file(s) as a synthetic base: remote-only files pull, local-only files push, overlapping divergences route to the merge/quarantine layer (both versions preserved), never a silent overwrite or delete`),{kind:"additive-base",base:d}):t.size===l.length?(await this.deps.watermarkStore.set(e.repoKey,d),n.push(`watermark bootstrapped from head ${s} (local tree identical to remote)`),{kind:"settled",outcome:i("synced")}):(n.push(`first-sync (asset mode): local tree (${t.size} files) is a pure superset of remote head ${s} (${l.length} files) \u2014 ${t.size-l.length} local-only addition(s) derive as pushable adds (#3565)`),{kind:"additive-base",base:d})}async collectRemoteChanges(e,t,n,i,s=new Set,o=[],c=new Set,l){let u=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,n,this.deps.baseURL),f=await(0,gt.getTree)(this.transport,e.owner,e.repo,u.treeSha,this.deps.baseURL);if(i.fileMode)for(let T of f)i.syncable(T.path)&&!i.treeFilter(T)&&!c.has(T.path)&&(c.add(T.path),o.push(`skipped oversized REMOTE file ${T.path} (${T.size??"?"} bytes over cap) \u2014 excluded from sync symmetrically (Phase C size cap)`));let d=f.filter(T=>i.treeFilter(T)&&!s.has(T.path)),p=t.files.filter(T=>!c.has(T.path)&&!s.has(T.path)),{changed:h,deleted:_}=mN(p,d),y=h.length;y>=dN&&this.emitProgress(l,e.repoKey,"fetching-blobs",{done:0,total:y});let S=0,w=[];for(let T of h){if(i.fileMode){let O=await(0,gt.getBlobBytes)(this.transport,e.owner,e.repo,T.blobSha,this.deps.baseURL);w.push({path:T.path,kind:"change",blobSha:T.blobSha,content:O})}else{let O=await(0,gt.getBlobText)(this.transport,e.owner,e.repo,T.blobSha,this.deps.baseURL);w.push({path:T.path,kind:"change",blobSha:T.blobSha,content:O,uid:(0,Ho.extractAssetUid)(O)})}S+=1,y>=dN&&S%kee===0&&S<y&&this.emitProgress(l,e.repoKey,"fetching-blobs",{done:S,total:y})}for(let T of _)w.push({path:T.path,kind:"delete",uid:T.uid});return{changes:w,headTreeByPath:Z2(f)}}matchLocalVsRemote(e,t,n,i,s,o=new Set,c){let l=new Set,u=[],f=new Map;for(let y of i)y.kind==="change"&&y.uid!==void 0&&f.set(y.uid,(f.get(y.uid)??0)+1);let d=new Set(o);for(let[y,S]of f)S>1&&d.add(y);let p=new Map,h=new Map;for(let y of i){if(y.uid!==void 0&&!d.has(y.uid)){let S=p.get(y.uid)??[];S.push(y),p.set(y.uid,S)}h.set(y.path,y)}for(let y of e){let S=new Set;if(y.uid!==void 0&&!d.has(y.uid))for(let A of p.get(y.uid)??[])A.kind==="change"&&A.path!==y.path&&(c?.has(y.path)===!0||y.basePath!==void 0&&c?.has(y.basePath)===!0)||S.add(A);let w=h.get(y.path);if(w!==void 0&&S.add(w),y.basePath!==void 0){let A=h.get(y.basePath);A!==void 0&&S.add(A)}let T=[],O=!1;for(let A of S){if(O=t.has(y.path)&&!n.has(y.path),O&&A.kind==="delete"){l.add(A);continue}if(!O&&A.kind==="change"&&A.path===y.path&&A.blobSha===y.blobSha){l.add(A),s.add(y.path);continue}if(A.kind==="delete"&&y.basePath!==void 0&&A.path===y.basePath){let x=h.get(y.path);if(x!==void 0&&x.kind==="change"&&(x.blobSha===y.blobSha||x.uid!==void 0&&x.uid===y.uid)){l.add(A);continue}}if(A.kind==="delete"&&A.path!==y.path&&A.path!==y.basePath&&!n.has(A.path)&&c?.has(A.path)!==!0){l.add(A);continue}T.push(A),l.add(A)}T.length>0&&(u.push({local:y,localIsDelete:O,remotes:T,desc:`${y.uid!==void 0&&!d.has(y.uid)?y.uid:y.path} (local ${O?"delete":"change"} vs remote ${T[0].kind} at ${T[0].path})`}),s.add(y.path))}let _=i.filter(y=>!l.has(y));return{conflicts:u,applyWrites:_.filter(y=>y.kind==="change"),applyDeletes:_.filter(y=>y.kind==="delete")}}async checkRaceWindow(e,t,n,i,s,o,c,l){try{let u=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,i,this.deps.baseURL),f=(await(0,gt.getTree)(this.transport,e.owner,e.repo,u.treeSha,this.deps.baseURL)).filter(l.treeFilter),d=n===t.lastSyncedSha?t.files:(await(0,gt.getTree)(this.transport,e.owner,e.repo,(await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,n,this.deps.baseURL)).treeSha,this.deps.baseURL)).filter(l.treeFilter),{changed:p,deleted:h}=mN(d,f);for(let _ of p)s.has(_.path)&&c.push(`race-window: concurrent commit ${i} changed ${_.path} between conflict check (head ${n}) and push \u2014 local version won; previous version recoverable from git history`),o.has(_.path)&&c.push(`race-window: concurrent commit ${i} changed ${_.path} which this push DELETED \u2014 the delete won; the concurrent version is recoverable from git history`);for(let _ of h)s.has(_.path)&&c.push(`race-window: concurrent commit ${i} deleted ${_.path}; push re-created it`)}catch(u){let f=this.deps.redact??(d=>d);c.push(`race-window check failed: ${f(ka(u))}`)}}async buildWatermarkFiles(e,t,n,i,s,o,c){if(c.fileMode)return t.map(f=>({path:f.path,blobSha:f.blobSha}));let l=new Map;for(let f of i)f.kind==="change"&&f.blobSha!==void 0&&l.set(f.blobSha,f.uid);for(let[f,d]of n){let p=o?.get(f)??await(0,Kc.gitBlobSha)(d,this.sha1);l.set(p,typeof d=="string"?(0,Ho.extractAssetUid)(d):void 0)}for(let f of s.files)l.has(f.blobSha)||l.set(f.blobSha,f.uid);let u=[];for(let f of t){let d;if(l.has(f.blobSha))d=l.get(f.blobSha);else{let p=await(0,gt.getBlobText)(this.transport,e.owner,e.repo,f.blobSha,this.deps.baseURL);d=(0,Ho.extractAssetUid)(p)}u.push({path:f.path,blobSha:f.blobSha,...d?{uid:d}:{}})}return u}};Qn.SyncEngine=eA});var bN=E(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.QuarantineResolver=void 0;op.backupPathFor=_N;var Gee=g0(),x0=rp(),ip=ku(),sp=Zd(),Wee=S0(),Hs="\0absent",tA=class{static{a(this,"QuarantineResolver")}constructor(e){this.deps=e}async listOpenConflicts(e){let t=[];for(let n of e)t.push(...await this.listRepoConflicts(n));return t}async listRepoConflicts(e){if(e.spaceKind==="file")return[];let t=await this.deps.watermarkStore.get(e.repoKey),n=t?.pinnedPaths??[];if(n.length===0)return[];if(this.deps.outbox!==void 0){let h=await this.deps.outbox.listForRepo(e.repoKey);if(h.length>0){let _=new Set(h.map(y=>y.path));if(n=n.filter(y=>!_.has(y)),n.length===0)return[]}}let i=new Map;for(let h of t?.files??[])i.set(h.path,h.blobSha);let s=this.deps.conflictCache!==void 0,o=await this.cachedRecordsFor(e,n),c=n.some(h=>!o.has(h)),l=new Map,u=!0;if(c)if(s)try{l=await this.remoteTreeShas(e)}catch{u=!1}else l=await this.remoteTreeShas(e);let f=this.deps.localFilesFor(e),d=new Set(await f.list()),p=[];for(let h of n){let _=o.get(h),y,S;if(_!==void 0)S=_.remoteContent!==void 0?await(0,ip.gitBlobSha)(_.remoteContent,this.deps.sha1):Hs,y=_.baseContent!==void 0?await(0,ip.gitBlobSha)(_.baseContent,this.deps.sha1):i.get(h)??Hs;else{if(!u)continue;S=l.get(h)??Hs,y=i.get(h)??Hs}let w=Hs,T;if(d.has(h)&&(T=await f.read(h),w=await(0,ip.gitBlobSha)(T,this.deps.sha1)),!(w!==S&&w!==y&&S!==y))continue;let A=(T!==void 0?(0,sp.extractAssetUid)(T):void 0)??_?.uid;p.push({repoKey:e.repoKey,path:h,...A!==void 0?{uid:A}:{},hasLocal:w!==Hs,hasRemote:S!==Hs})}return p}async cachedRecordsFor(e,t){let n=new Map,i=this.deps.conflictCache;if(i===void 0)return n;for(let s of t){let o=await i.get(e.repoKey,s);o!==null&&n.set(s,o)}return n}async detectDuplicateUids(e){let t=new Map;for(let i of e){let s=this.deps.localFilesFor(i);for(let o of await s.list()){if(!o.endsWith(".md"))continue;let c;try{c=await s.read(o)}catch{continue}let l=(0,sp.extractAssetUid)(c);l!==void 0&&t.set(l,(t.get(l)??0)+1)}}let n=0;for(let i of t.values())i>1&&n++;return n}async loadConflict(e,t){let n=this.deps.localFilesFor(e),s=new Set(await n.list()).has(t)?await n.read(t):void 0,o=await this.deps.conflictCache?.get(e.repoKey,t)??null,c,l;if(o!==null)c=o.remoteContent,l=o.baseContent;else{let d=(await this.remoteTreeShas(e)).get(t);c=d!==void 0?await this.blobText(e,d):void 0;let h=((await this.deps.watermarkStore.get(e.repoKey))?.files??[]).find(_=>_.path===t)?.blobSha;if(h!==void 0)try{l=await this.blobText(e,h)}catch{l=void 0}}let u=(s!==void 0?(0,sp.extractAssetUid)(s):void 0)??(c!==void 0?(0,sp.extractAssetUid)(c):void 0)??o?.uid;return{repoKey:e.repoKey,path:t,...u!==void 0?{uid:u}:{},hasLocal:s!==void 0,hasRemote:c!==void 0,...l!==void 0?{base:l}:{},...s!==void 0?{local:s}:{},...c!==void 0?{remote:c}:{}}}async resolve(e,t,n){let i=this.deps.localFilesFor(e),o=new Set(await i.list()).has(t)?await i.read(t):void 0,c=this.deps.outbox!==void 0,{remote:l,remoteSha:u}=c?await this.remoteForResolve(e,t):await this.liveRemoteForResolve(e,t),f=this.chosenContent(n,o,l),d;n.take!=="local"&&o!==void 0&&o!==f&&(d=_N(t),await i.write(d,o)),f===void 0?await i.delete(t):await i.write(t,f);let h=f===void 0&&l===void 0||f===l;if(c&&this.deps.outbox!==void 0&&!h&&f!==void 0)return await this.deps.outbox.enqueue({repoKey:e.repoKey,path:t,chosenContent:f,resolvedTo:n.take==="merged"?"merged":"local",baseRemoteSha:u===Hs?Wee.OUTBOX_REMOTE_ABSENT:u,resolvedAt:""}),{repoKey:e.repoKey,path:t,resolvedTo:n.take,awaitingPush:!0,...d!==void 0?{discardedLocalBackupPath:d}:{}};let _;return h||(_=await this.commitChoice(e,t,f)),await this.snapWatermark(e,t,f),this.deps.quarantine?.markResolved!==void 0&&await this.deps.quarantine.markResolved(e.repoKey,t),{repoKey:e.repoKey,path:t,resolvedTo:n.take,..._!==void 0?{pushedSha:_}:{},...d!==void 0?{discardedLocalBackupPath:d}:{}}}async remoteForResolve(e,t){let n=await this.deps.conflictCache?.get(e.repoKey,t)??null;if(n!==null){let i=n.remoteContent,s=i!==void 0?await(0,ip.gitBlobSha)(i,this.deps.sha1):Hs;return{remote:i,remoteSha:s}}return this.liveRemoteForResolve(e,t)}async liveRemoteForResolve(e,t){let i=(await this.remoteTreeShas(e)).get(t);return{remote:i!==void 0?await this.blobText(e,i):void 0,remoteSha:i??Hs}}chosenContent(e,t,n){switch(e.take){case"local":if(t===void 0)throw new Error("resolve: cannot keep local \u2014 no local version exists on disk");return t;case"remote":return n;case"merged":return e.content}}async commitChoice(e,t,n){let i=this.deps.commitMessage?.(e,t)??`chore(exosync): resolve conflict for ${t}`;if(n===void 0)throw new Error(`resolve: cannot push an empty resolution for ${t}`);return(0,Gee.restCreateCommit)(this.deps.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:new Map([[t,n]]),message:i,...this.deps.baseURL!==void 0?{baseURL:this.deps.baseURL}:{},...this.deps.redact!==void 0?{redact:this.deps.redact}:{}})}async snapWatermark(e,t,n){let i=await this.deps.watermarkStore.get(e.repoKey);if(i===null)return;let s=(i.pinnedPaths??[]).filter(c=>c!==t),o=i.files;if(n===void 0)o=o.filter(c=>c.path!==t);else{let c=await(0,ip.gitBlobSha)(n,this.deps.sha1),l=(0,sp.extractAssetUid)(n),u={path:t,blobSha:c,...l!==void 0?{uid:l}:{}},f=o.findIndex(d=>d.path===t);o=f>=0?o.map((d,p)=>p===f?u:d):[...o,u]}await this.deps.watermarkStore.set(e.repoKey,{...i,files:o,...s.length>0?{pinnedPaths:s}:{pinnedPaths:void 0}})}async remoteTreeShas(e){let t=await(0,x0.getHeadSha)(this.deps.transport,e.owner,e.repo,e.branch,this.deps.baseURL),n=await(0,x0.getCommitInfo)(this.deps.transport,e.owner,e.repo,t,this.deps.baseURL),i=await(0,x0.getTree)(this.deps.transport,e.owner,e.repo,n.treeSha,this.deps.baseURL),s=new Map;for(let o of i)s.set(o.path,o.blobSha);return s}async blobText(e,t){return(0,x0.getBlobText)(this.deps.transport,e.owner,e.repo,t,this.deps.baseURL)}};op.QuarantineResolver=tA;function _N(r){return`${r}.conflict.local.txt`}a(_N,"backupPathFor")});var SN=E(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.FileLocalManifestStore=Mu.LOCAL_MANIFEST_STORE_FILENAME=void 0;Mu.LOCAL_MANIFEST_STORE_FILENAME="exosync-localmanifest.local.json";function Hee(r){if(r===null||typeof r!="object")return!1;let e=r;return e.version===1&&typeof e.lastFullRehashMs=="number"&&e.files!==null&&typeof e.files=="object"}a(Hee,"isLocalManifestRecord");var rA=class{static{a(this,"FileLocalManifestStore")}constructor(e){this.io=e,this.writeChain=Promise.resolve()}async get(e){let n=(await this.readRepos())[e];return Hee(n)?n:null}async set(e,t){let n=this.writeChain.then(async()=>{let i=await this.readRepos();i[e]=t;let s={version:1,repos:i};await this.io.writeAtomic(JSON.stringify(s))});return this.writeChain=n.catch(()=>{}),n}async readRepos(){try{let e=await this.io.read();if(e===null)return{};let t=JSON.parse(e);if(t===null||typeof t!="object")return{};let n=t.repos;return n===null||typeof n!="object"?{}:{...n}}catch{return{}}}};Mu.FileLocalManifestStore=rA});var sA=E(iA=>{"use strict";Object.defineProperty(iA,"__esModule",{value:!0});iA.diff3=zee;function wN(r,e){let t=r.length,n=e.length,i=Array.from({length:t+1},()=>new Int32Array(n+1));for(let l=t-1;l>=0;l--)for(let u=n-1;u>=0;u--)i[l][u]=r[l]===e[u]?i[l+1][u+1]+1:Math.max(i[l+1][u],i[l][u+1]);let s=new Map,o=0,c=0;for(;o<t&&c<n;)r[o]===e[c]?(s.set(o,c),o++,c++):i[o+1][c]>=i[o][c+1]?o++:c++;return s}a(wN,"lcsMatch");function nA(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}a(nA,"sliceEq");function zee(r,e,t){let n=wN(r,e),i=wN(r,t),s=[],o=0,c=0,l=0;for(;;){let u=o;for(;u<r.length&&!(n.has(u)&&i.has(u));)u++;let f=u<r.length?n.get(u):e.length,d=u<r.length?i.get(u):t.length,p=r.slice(o,u),h=e.slice(c,f),_=t.slice(l,d),y=!nA(h,p),S=!nA(_,p);if(!y&&!S)s.push(...p);else if(!y)s.push(..._);else if(!S)s.push(...h);else if(nA(h,_))s.push(...h);else return{ok:!1,conflict:{base:p,local:h,remote:_}};if(u>=r.length)break;s.push(r[u]),o=u+1,c=f+1,l=d+1}return{ok:!0,merged:s}}a(zee,"diff3")});var vN=E(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.StructuredMerger=void 0;lp.splitSections=R0;var EN=sA(),Kee=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/,ap="exo__Instance_class";function cp(r){if(r===null||typeof r!="object")return!0;if(Array.isArray(r))return r.every(cp);let e=Object.getPrototypeOf(r);return e!==Object.prototype&&e!==null?!1:Object.values(r).every(cp)}a(cp,"isPlainValue");function Ma(r,e){if(r===e)return!0;if(r===null||e===null||r===void 0||e===void 0||typeof r!="object"||typeof e!="object"||Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)&&Array.isArray(e))return r.length!==e.length?!1:r.every((s,o)=>Ma(s,e[o]));let t=r,n=e,i=Object.keys(t);return i.length!==Object.keys(n).length?!1:i.every(s=>Ma(t[s],n[s]))}a(Ma,"deepEqual");function Yc(r){return typeof r=="string"?`s:${r}`:`j:${JSON.stringify(r)}`}a(Yc,"setKey");function Si(r){return r==null?[]:Array.isArray(r)?r:[r]}a(Si,"toElements");function Yee(r,e,t){let n=new Set(Si(r).map(Yc)),i=Si(e),s=Si(t),o=new Set(i.map(Yc)),c=new Set(s.map(Yc)),l=a(d=>o.has(d)&&c.has(d)||o.has(d)&&!n.has(d)||c.has(d)&&!n.has(d),"keep"),u=[],f=new Set;for(let d of[...i,...s]){let p=Yc(d);f.has(p)||!l(p)||(f.add(p),u.push(d))}return u}a(Yee,"mergeSet");function Qee(r,e,t){let n=[],i=[],s=new Set;for(let c of[...Object.keys(r),...Object.keys(e),...Object.keys(t)])s.has(c)||(s.add(c),i.push(c));let o={};for(let c of i){let l=r[c],u=e[c],f=t[c];if(!cp(l)||!cp(u)||!cp(f))return{ok:!1,reason:`frontmatter key "${c}" contains a non-plain value (Date?) \u2014 the codec must round-trip scalars as strings (CORE_SCHEMA contract)`};if(Array.isArray(l)||Array.isArray(u)||Array.isArray(f)){if(!(c in e)&&!(c in t))continue;let d=Yee(l,u,f),p=new Set(Si(l).map(Yc)),h=Si(u).some(y=>!p.has(Yc(y))),_=Si(f).some(y=>!p.has(Yc(y)));h&&_&&!Ma(Si(u),Si(f))&&n.push(`both sides added values to multi-valued key "${c}" \u2014 union kept (D20)`),d.length>0&&(o[c]=d);continue}if(Ma(u,f)){u!==void 0&&(o[c]=u);continue}if(Ma(u,l)){f!==void 0&&(o[c]=f);continue}if(Ma(f,l)){u!==void 0&&(o[c]=u);continue}return{ok:!1,reason:`frontmatter key "${c}" changed differently on both sides`}}return{ok:!0,value:o,warnings:n}}a(Qee,"mergeFrontmatter");var Xee=/^(```|~~~)/,Jee=/^#{1,6}\s/;function R0(r){let e=r.split(`
|
|
341
|
+
`)}a(oee,"stripGitmodulesEntry")});var ku=E(V2=>{"use strict";Object.defineProperty(V2,"__esModule",{value:!0});V2.gitBlobSha=aee;async function aee(r,e){let t=new TextEncoder,n=typeof r=="string"?t.encode(r):r,i=t.encode(`blob ${n.byteLength}\0`),s=new Uint8Array(i.byteLength+n.byteLength);return s.set(i,0),s.set(n,i.byteLength),e(s)}a(aee,"gitBlobSha")});var Zd=E(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});_0.extractAssetUid=ZL;_0.detectChanges=lee;var cee=ku();function ZL(r){let e=/^---\r?\n([\s\S]*?)\r?\n---(?=\r?\n|$)/.exec(r);if(!e)return;let t=/^exo__Asset_uid:[ \t]*["']?([^\s"']+)["']?[ \t]*$/m.exec(e[1]);return t?t[1]:void 0}a(ZL,"extractAssetUid");async function lee(r){let{localFiles:e,cachedEntries:t,watermark:n,actualBaseTreeSha:i,sha1:s}=r;if(n===null)return{kind:"full-conflict",reason:"first-sync"};if(i===null)return{kind:"full-conflict",reason:"base-mismatch",detail:`watermark commit ${n.lastSyncedSha} not resolvable on remote`};if(i!==n.rootTreeSha)return{kind:"full-conflict",reason:"base-mismatch",detail:`stored root tree ${n.rootTreeSha} != actual ${i} at ${n.lastSyncedSha}`};let o=[],c=new Map;for(let[A,x]of e){let P=await(0,cee.gitBlobSha)(x,s);c.set(A,P),o.push({path:A,blobSha:P,uid:typeof x=="string"?ZL(x):void 0})}if(t!==void 0)for(let[A,x]of t)c.set(A,x.blobSha),o.push({path:A,blobSha:x.blobSha,uid:x.uid});let l=[],u=[],f=[],d=[],p=new Map;for(let A of o){if(A.uid===void 0)continue;let x=p.get(A.uid)??[];x.push(A.path),p.set(A.uid,x)}let h=new Map;for(let A of n.files){if(A.uid===void 0)continue;let x=h.get(A.uid)??[];x.push(A.path),h.set(A.uid,x)}let _=new Set;for(let[A,x]of p)x.length>1&&_.add(A);for(let[A,x]of h)x.length>1&&_.add(A);for(let A of[..._].sort()){let x=p.get(A)??[],P=x.length>1?`on disk (${x.join(", ")})`:`in the sync base (${(h.get(A)??[]).join(", ")})`;d.push(`duplicate uid ${A} ${P} \u2014 uid identity suppressed for the group; every path matched by path identity (#3477)`)}let y=new Map,S=[];for(let A of n.files)A.uid!==void 0&&!_.has(A.uid)?y.set(A.uid,A):S.push(A);let w=[],T=new Set;for(let A of o){let x=A.uid!==void 0&&!_.has(A.uid)?y.get(A.uid):void 0;A.uid!==void 0&&x!==void 0?(T.add(A.uid),(x.blobSha!==A.blobSha||x.path!==A.path)&&u.push({path:A.path,uid:A.uid,blobSha:A.blobSha,...x.path!==A.path?{basePath:x.path}:{}})):w.push(A)}let O=new Map;for(let A of S)O.set(A.path,A);for(let[A,x]of y)T.has(A)||O.set(x.path,x);for(let A of w){let x=O.get(A.path);x!==void 0?(O.delete(A.path),x.blobSha!==A.blobSha&&u.push({path:A.path,uid:A.uid,blobSha:A.blobSha})):l.push({path:A.path,uid:A.uid,blobSha:A.blobSha})}for(let A of O.values())f.push({path:A.path,uid:A.uid,blobSha:A.blobSha});return{kind:"changes",added:l,modified:u,deleted:f,warnings:d,diskBlobShas:c,duplicateUids:_}}a(lee,"detectChanges")});var rN=E(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.rewriteAssetUid=eN;ep.findDuplicateUidGroups=tN;ep.planDuplicateUidFix=fee;var uee=Zd();function eN(r,e){let t=/^(---\r?\n)([\s\S]*?)(\r?\n---(?=\r?\n|$))/.exec(r);if(t===null)return r;let n=t[2].replace(/^(exo__Asset_uid:[ \t]*["']?)[^\s"']+(["']?[ \t]*)$/m,`$1${e}$2`);return n===t[2]?r:r.slice(0,t.index)+t[1]+n+t[3]+r.slice(t.index+t[0].length)}a(eN,"rewriteAssetUid");function tN(r){let e=new Map;for(let t of r){let n=(0,uee.extractAssetUid)(t.content);if(n===void 0)continue;let i=e.get(n)??[];i.push(t.path),e.set(n,i)}return[...e.entries()].filter(([,t])=>t.length>1).sort(([t],[n])=>t.localeCompare(n)).map(([t,n])=>({uid:t,paths:n}))}a(tN,"findDuplicateUidGroups");function fee(r,e){let t=new Map(r.map(i=>[i.path,i.content])),n=[];for(let i of tN(r)){let s=[...i.paths].sort((o,c)=>o.localeCompare(c));for(let o of s.slice(1)){let c=t.get(o);if(c===void 0)continue;let l=e(),u=eN(c,l);u!==c&&n.push({path:o,fromUid:i.uid,toUid:l,content:u})}}return n}a(fee,"planDuplicateUidFix")});var rp=E(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.getHeadSha=pee;zc.getCommitInfo=hee;zc.getTree=mee;zc.getBlobText=gee;zc.getBlobBytes=yee;var nN=xl(),dee="https://api.github.com";function tp(r){return(r??dee).replace(/\/$/,"")}a(tp,"api");function Hc(r){return r!==null&&typeof r=="object"?r:void 0}a(Hc,"asRecord");function Gs(r,e){let n=Hc(r)?.[e];return typeof n=="string"?n:void 0}a(Gs,"readString");async function pee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/refs/heads/${encodeURIComponent(n)}`}),o=Gs(Hc(s?.json)?.object,"sha");if(typeof o!="string"||o.length===0)throw new Error(`ExoSync: missing object.sha for ref heads/${n}`);return o}a(pee,"getHeadSha");async function hee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/commits/${encodeURIComponent(n)}`}),o=Hc(s?.json),c=Gs(o,"sha"),l=Gs(o?.tree,"sha");if(!c||!l)throw new Error(`ExoSync: malformed commit response for ${n}`);let u=o?.parents,f=Array.isArray(u)?u.map(d=>Gs(d,"sha")).filter(d=>typeof d=="string"):[];return{sha:c,treeSha:l,parents:f}}a(hee,"getCommitInfo");async function mee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/trees/${encodeURIComponent(n)}?recursive=1`}),o=Hc(s?.json);if(o?.truncated===!0)throw new Error(`ExoSync: tree ${n} is truncated by GitHub (repo too large for recursive listing) \u2014 refusing to diff`);let c=o?.tree;if(!Array.isArray(c))throw new Error(`ExoSync: malformed tree response for ${n}`);let l=[];for(let u of c){let f=Hc(u);if(f?.type!=="blob")continue;let d=Gs(f,"path"),p=Gs(f,"sha"),h=typeof f.size=="number"?f.size:void 0;d&&p&&l.push({path:d,blobSha:p,...h!==void 0?{size:h}:{}})}return l}a(mee,"getTree");async function gee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/blobs/${encodeURIComponent(n)}`}),o=Hc(s?.json),c=Gs(o,"content");if(typeof c!="string")throw new Error(`ExoSync: malformed blob response for ${n}`);return Gs(o,"encoding")==="utf-8"?c:(0,nN.base64ToUtf8)(c)}a(gee,"getBlobText");async function yee(r,e,t,n,i){let s=await r({method:"GET",url:`${tp(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/blobs/${encodeURIComponent(n)}`}),o=Hc(s?.json),c=Gs(o,"content");if(typeof c!="string")throw new Error(`ExoSync: malformed blob response for ${n}`);return Gs(o,"encoding")==="utf-8"?new TextEncoder().encode(c):(0,nN.base64ToBytes)(c)}a(yee,"getBlobBytes")});var W2=E(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.SyncPhaseTimer=er.SYNC_PHASES=void 0;er.classifyRestPhase=_ee;er.emptyTimings=sN;er.totalMs=b0;er.addTimings=oN;er.aggregateTimings=bee;er.dominantPhase=See;er.fmtMs=np;er.formatTimingsLine=wee;er.formatRepoTimings=Eee;er.SYNC_PHASES=["localList","localRead","localWrite","hash","restHead","restCommit","restTree","restBlob","restPush"];function G2(){let r={};for(let e of er.SYNC_PHASES)r[e]=0;return r}a(G2,"zeroDurations");function iN(){return{filesRead:0,filesHashed:0,filesWritten:0,restCalls:0}}a(iN,"zeroCounts");function _ee(r){if(r.method!=="GET")return"restPush";let e=r.url;return e.includes("/git/blobs/")?"restBlob":e.includes("/git/trees/")?"restTree":e.includes("/git/commits/")?"restCommit":e.includes("/git/refs/")?"restHead":"restCommit"}a(_ee,"classifyRestPhase");var q2=class{static{a(this,"SyncPhaseTimer")}constructor(e){this.now=e,this.durations=G2(),this.counts=iN()}async time(e,t){let n=this.now();try{return await t()}finally{this.durations[e]+=this.now()-n}}bumpRead(){this.counts.filesRead++}bumpHashed(){this.counts.filesHashed++}bumpWritten(){this.counts.filesWritten++}bumpRest(){this.counts.restCalls++}snapshot(){return{durations:{...this.durations},counts:{...this.counts}}}};er.SyncPhaseTimer=q2;function sN(){return{durations:G2(),counts:iN()}}a(sN,"emptyTimings");function b0(r){let e=0;for(let t of er.SYNC_PHASES)e+=r.durations[t];return e}a(b0,"totalMs");function oN(r,e){let t=G2();for(let n of er.SYNC_PHASES)t[n]=r.durations[n]+e.durations[n];return{durations:t,counts:{filesRead:r.counts.filesRead+e.counts.filesRead,filesHashed:r.counts.filesHashed+e.counts.filesHashed,filesWritten:r.counts.filesWritten+e.counts.filesWritten,restCalls:r.counts.restCalls+e.counts.restCalls}}}a(oN,"addTimings");function bee(r){let e=sN();for(let t of r)t.timings!==void 0&&(e=oN(e,t.timings));return e}a(bee,"aggregateTimings");function See(r){let e=b0(r);if(e<=0)return null;let t=er.SYNC_PHASES[0],n=-1;for(let i of er.SYNC_PHASES)r.durations[i]>n&&(n=r.durations[i],t=i);return{phase:t,ms:n,pct:n/e*100}}a(See,"dominantPhase");function np(r){return r>=1e3?`${(r/1e3).toFixed(1)}s`:`${Math.round(r)}ms`}a(np,"fmtMs");function wee(r){let e=b0(r);if(e<=0)return"";let t=er.SYNC_PHASES.filter(n=>r.durations[n]>0).sort((n,i)=>r.durations[i]-r.durations[n]).map(n=>`${n} ${np(r.durations[n])} ${Math.round(r.durations[n]/e*100)}%`);return`\u23F1 ExoSync ${np(e)} \u2014 ${t.join(" \xB7 ")} (${r.counts.filesHashed} hashed, ${r.counts.filesRead} read, ${r.counts.restCalls} REST)`}a(wee,"formatTimingsLine");function Eee(r,e){let t=er.SYNC_PHASES.map(n=>`${n}=${np(e.durations[n])}`);return`[ExoSync timings] ${r}: total ${np(b0(e))} \u2014 ${t.join(" ")} | hashed ${e.counts.filesHashed} read ${e.counts.filesRead} written ${e.counts.filesWritten} REST ${e.counts.restCalls}`}a(Eee,"formatRepoTimings")});var S0=E(Na=>{"use strict";Object.defineProperty(Na,"__esModule",{value:!0});Na.LocalOutboxStore=Na.OUTBOX_REMOTE_ABSENT=Na.OUTBOX_STORE_FILENAME=void 0;Na.OUTBOX_STORE_FILENAME="exosync-outbox.local.json";Na.OUTBOX_REMOTE_ABSENT=" absent";function H2(r,e){return`${r}\0${e}`}a(H2,"outboxKey");function aN(r){if(r===null||typeof r!="object")return!1;let e=r;return typeof e.repoKey=="string"&&typeof e.path=="string"&&typeof e.chosenContent=="string"&&typeof e.baseRemoteSha=="string"}a(aN,"isEntry");var z2=class{static{a(this,"LocalOutboxStore")}constructor(e){this.writeChain=Promise.resolve(),this.io=e.io,this.now=e.now??(()=>new Date().toISOString())}async enqueue(e){await this.mutate(t=>{t.entries[H2(e.repoKey,e.path)]={version:1,...e,resolvedAt:e.resolvedAt.length>0?e.resolvedAt:this.now()}})}async remove(e,t){await this.mutate(n=>{delete n.entries[H2(e,t)]})}async list(){let e=await this.read();return Object.values(e.entries).filter(aN)}async listForRepo(e){return(await this.list()).filter(t=>t.repoKey===e)}async has(e,t){let i=(await this.read()).entries[H2(e,t)];return i!==void 0&&aN(i)}async mutate(e){let t=this.writeChain.then(async()=>{let n=await this.read();e(n),await this.io.writeAtomic(JSON.stringify(n,null,2))});return this.writeChain=t.catch(()=>{}),t}async read(){try{let e=await this.io.read();if(e===null)return{version:1,entries:{}};let t=JSON.parse(e);if(t===null||typeof t!="object")return{version:1,entries:{}};let n=t.entries;return n===null||typeof n!="object"?{version:1,entries:{}}:{version:1,entries:{...n}}}catch{return{version:1,entries:{}}}}};Na.LocalOutboxStore=z2});var w0=E(K2=>{"use strict";Object.defineProperty(K2,"__esModule",{value:!0});K2.isAuthError=vee;function vee(r){let e=r instanceof Error?r.message:String(r);return/HTTP 401/.test(e)?!0:/HTTP 403/.test(e)&&!/rate limit/i.test(e)&&!/abuse detection/i.test(e)}a(vee,"isAuthError")});var Y2=E(E0=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});E0.scanForSecrets=Tee;E0.redactSecrets=Aee;var cN=[{kind:"github-token",re:/gh[pousr]_[A-Za-z0-9_]{36,}/},{kind:"github-fine-grained-token",re:/github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,}/},{kind:"private-key",re:/-----BEGIN [A-Z ]*PRIVATE KEY-----/}];function Tee(r){let e=[];for(let[t,n]of r)for(let{kind:i,re:s}of cN)s.test(n)&&e.push({path:t,kind:i});return e}a(Tee,"scanForSecrets");function Aee(r){let e=r;for(let{kind:t,re:n}of cN)e=e.replace(new RegExp(n.source,"g"),`[REDACTED:${t}]`);return e}a(Aee,"redactSecrets")});var T0=E(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});v0.isRateLimitError=lN;v0.withRateLimitBackoff=xee;function lN(r){let e=r instanceof Error?r.message:String(r);return/HTTP 429/.test(e)?!0:/HTTP 403/.test(e)&&(/rate limit/i.test(e)||/abuse detection/i.test(e))}a(lN,"isRateLimitError");var Iee=a(r=>new Promise(e=>setTimeout(e,r)),"defaultSleep");function xee(r,e={}){let t=e.maxRetries??3,n=e.baseDelayMs??1e3,i=e.sleep??Iee,s=e.random??Math.random;return async o=>{let c=0;for(;;)try{return await r(o)}catch(l){if(!lN(l)||c>=t)throw l;let u=n*2**c*(1+s());c++,await i(u)}}}a(xee,"withRateLimitBackoff")});var A0=E(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.DEFAULT_MAX_FILE_BYTES=Wo.InMemoryQuarantineStore=void 0;Wo.contentEquals=Ree;Wo.isSyncablePath=Cee;Wo.isFileSpaceSyncablePath=Oee;function Ree(r,e){if(r===void 0||e===void 0||typeof r=="string"&&typeof e=="string")return r===e;if(typeof r=="string"||typeof e=="string"||r.byteLength!==e.byteLength)return!1;for(let t=0;t<r.byteLength;t++)if(r[t]!==e[t])return!1;return!0}a(Ree,"contentEquals");var Q2=class{static{a(this,"InMemoryQuarantineStore")}constructor(){this.entries=[]}async quarantine(e){this.entries.push(e)}};Wo.InMemoryQuarantineStore=Q2;function Cee(r){return r.endsWith(".md")&&!r.includes(".local.")&&!r.includes(".conflict.")}a(Cee,"isSyncablePath");function Oee(r){return!r.includes(".local.")&&!r.includes(".conflict.")}a(Oee,"isFileSpaceSyncablePath");Wo.DEFAULT_MAX_FILE_BYTES=30*1024*1024});var yN=E(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.SyncEngine=Qn.DEFAULT_LOCAL_MANIFEST_REHASH_MS=Qn.DEFAULT_MAX_PUSH_RETRIES=void 0;Qn.syncProgressPhaseText=Nee;Qn.isNonFastForwardError=gN;Qn.orderChildrenFirst=Vee;var uN=g0(),fN=W2(),gt=rp(),Ho=Zd(),Pee=xl(),Kc=ku(),X2=S0(),Dee=w0(),Fee=Y2(),Lee=T0(),Ws=A0();Qn.DEFAULT_MAX_PUSH_RETRIES=3;Qn.DEFAULT_LOCAL_MANIFEST_REHASH_MS=720*60*1e3;function Nee(r){switch(r.phase){case"reading-local":return r.detail!==void 0?`reading local files ${r.detail.done}\u2026`:"reading local files\u2026";case"detecting":return"detecting changes\u2026";case"pulling-remote":return"pulling remote tree\u2026";case"fetching-blobs":return r.detail!==void 0?`fetching remote files ${r.detail.done}/${r.detail.total}\u2026`:"fetching remote files\u2026";case"writing-files":return r.detail!==void 0?`writing files ${r.detail.done}\u2026`:"writing files\u2026";case"merging":return"merge layer firing\u2026";default:return r.phase}}a(Nee,"syncProgressPhaseText");var dN=25,kee=10,Mee=500,jee=25;function $ee(r){try{return new TextDecoder("utf-8",{fatal:!0}).decode(r)}catch{return null}}a($ee,"decodeUtf8Strict");function Uee(r){return typeof r=="string"?r:{base64:(0,Pee.bytesToBase64)(r)}}a(Uee,"toCommitContent");async function pN(r,e){if(r.readBinary===void 0)throw new Error("LocalFilesPort.readBinary is required for file-mode sync (Phase C)");return r.readBinary(e)}a(pN,"readBinaryStrict");async function Bee(r,e,t){if(r.writeBinary===void 0)throw new Error("LocalFilesPort.writeBinary is required for file-mode sync (Phase C)");return r.writeBinary(e,t)}a(Bee,"writeBinaryStrict");function hN(r){return r.length===0||r.startsWith("/")||r.includes("\\")?!1:r.split("/").every(e=>e.length>0&&e!=="."&&e!=="..")}a(hN,"isSafeRepoRelativePath");function gN(r){let e=r instanceof Error?r.message:String(r);return/HTTP 422/.test(e)&&/git\/refs/.test(e)||/ref update mismatch/.test(e)||/HTTP 422/.test(e)&&/git\/trees/.test(e)&&/BadObjectState/.test(e)}a(gN,"isNonFastForwardError");function Vee(r){let e=a(t=>t.split("/").filter(n=>n.length>0).length,"depth");return[...r].sort((t,n)=>e(n.localPath)-e(t.localPath))}a(Vee,"orderChildrenFirst");function mN(r,e){let t=new Map(r.map(o=>[o.path,o])),n=new Set,i=[];for(let o of e){n.add(o.path);let c=t.get(o.path);(c===void 0||c.blobSha!==o.blobSha)&&i.push(o)}let s=r.filter(o=>!n.has(o.path));return{changed:i,deleted:s}}a(mN,"diffTrees");function ka(r){return r instanceof Error?r.message:String(r)}a(ka,"errMsg");function qee(r,e,t){if(t.size===0)return r;let n=new Map(e.files.map(o=>[o.path,o])),i=new Set(r.map(o=>o.path)),s=[];for(let o of r){if(!t.has(o.path)){s.push(o);continue}let c=n.get(o.path);c!==void 0&&s.push(c)}for(let o of t){if(i.has(o))continue;let c=n.get(o);c!==void 0&&s.push(c)}return s}a(qee,"applyWatermarkPins");var J2={mergedFiles:new Map,mergedWrites:[],quarantineEntries:[],resolvedQuarantineEntries:[],mergedCount:0,mergedPaths:[],warnings:[]};function Z2(r){return new Map(r.map(e=>[e.path,e.blobSha]))}a(Z2,"treeByPath");function I0(r){return[...r.quarantineEntries.map(e=>e.path),...r.resolvedQuarantineEntries.map(e=>e.path)]}a(I0,"quarantinedPathsOf");var eA=class{static{a(this,"SyncEngine")}constructor(e){this.activeTimer=null,this.activeLocalIoProgress=null,this.opInProgress=!1,this.deps=e,this.now=e.now??(()=>Date.now()),this.transport=this.instrumentTransport((0,Lee.withRateLimitBackoff)(e.transport,e.backoff)),this.sha1=this.instrumentSha1(e.sha1)}instrumentTransport(e){return async t=>{let n=this.activeTimer;return n===null?e(t):(n.bumpRest(),n.time((0,fN.classifyRestPhase)(t),()=>e(t)))}}instrumentSha1(e){return t=>{let n=this.activeTimer;return n===null?e(t):(n.bumpHashed(),n.time("hash",()=>e(t)))}}instrumentLocalFiles(e){let t=a((c,l)=>{let u=this.activeTimer;return u===null?l():u.time(c,l)},"timed"),n={list:a(()=>t("localList",()=>e.list()),"list"),read:a(c=>(this.activeTimer?.bumpRead(),this.bumpReadProgress(),t("localRead",()=>e.read(c))),"read"),write:a((c,l)=>t("localWrite",()=>(this.activeTimer?.bumpWritten(),this.bumpWriteProgress(),e.write(c,l))),"write"),delete:a(c=>e.delete(c),"delete")},i=e.readBinary?.bind(e);i!==void 0&&(n.readBinary=c=>(this.activeTimer?.bumpRead(),this.bumpReadProgress(),t("localRead",()=>i(c))));let s=e.writeBinary?.bind(e);s!==void 0&&(n.writeBinary=(c,l)=>t("localWrite",()=>(this.activeTimer?.bumpWritten(),this.bumpWriteProgress(),s(c,l))));let o=e.stat?.bind(e);return o!==void 0&&(n.stat=c=>t("localList",()=>o(c))),n}busyResult(e){return{repoKey:e.repoKey,status:"busy",pulledCount:0,pushedCount:0,mergedCount:0,quarantinedCount:0,warnings:[],deferredDeletes:[],detail:"another sync operation is in progress (D11 guard) \u2014 retry after it finishes"}}modeOps(e){let t=e.spaceKind==="file",n=t?Ws.isFileSpaceSyncablePath:Ws.isSyncablePath,i=this.deps.maxFileBytes??Ws.DEFAULT_MAX_FILE_BYTES;return{fileMode:t,syncable:n,treeFilter:a(s=>n(s.path)&&(!t||s.size===void 0||s.size<=i),"treeFilter")}}async buildFileModeFirstSyncBase(e,t,n,i){let s=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),o=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,s,this.deps.baseURL),c=(await(0,gt.getTree)(this.transport,e.owner,e.repo,o.treeSha,this.deps.baseURL)).filter(n.treeFilter),l=[];for(let u of c){let f=t.get(u.path);f!==void 0&&await(0,Kc.gitBlobSha)(f,this.sha1)===u.blobSha&&l.push({path:u.path,blobSha:u.blobSha})}return i.push(`first-sync (file mode): synthetic base from ${l.length} already-identical file(s) at head ${s} \u2014 divergence resolves through the remote-wins layer (D22)`),{lastSyncedSha:s,rootTreeSha:o.treeSha,files:l,spaceKind:"file"}}async syncAll(e,t="sync",n){if(this.opInProgress)return e.map(i=>this.busyResult(i));this.opInProgress=!0;try{let i=[];for(let s of e)i.push(await this.syncLocked(s,t,n));return i}finally{this.opInProgress=!1}}async sync(e,t="sync",n){if(this.opInProgress)return this.busyResult(e);this.opInProgress=!0;try{return await this.syncLocked(e,t,n)}finally{this.opInProgress=!1}}emitProgress(e,t,n,i){if(e!==void 0)try{e(i===void 0?{repoKey:t,phase:n}:{repoKey:t,phase:n,detail:i})}catch{}}bumpReadProgress(){let e=this.activeLocalIoProgress;e!==null&&(e.reads+=1,e.reads%Mee===0&&this.emitProgress(e.emit,e.repoKey,"reading-local",{done:e.reads}))}bumpWriteProgress(){let e=this.activeLocalIoProgress;e!==null&&(e.writes+=1,e.writes%jee===0&&this.emitProgress(e.emit,e.repoKey,"writing-files",{done:e.writes}))}async syncLocked(e,t="sync",n){let i=new fN.SyncPhaseTimer(this.now),s=this.activeTimer;this.activeTimer=i;let o=this.activeLocalIoProgress;this.activeLocalIoProgress=n!==void 0?{emit:n,repoKey:e.repoKey,reads:0,writes:0}:null;let c=[],l=[],u=0,f=0,d=[],p=a((h,_={})=>({repoKey:e.repoKey,status:h,pulledCount:0,pushedCount:0,mergedCount:0,quarantinedCount:0,warnings:c,deferredDeletes:l,...u>0?{outboxPushedCount:u}:{},...f>0?{outboxReconflictedCount:f}:{},timings:i.snapshot(),..._}),"result");try{let h=await this.deps.materializationCheck.check(e);if(!h.fullyMaterialized)return c.push(`skipped: repo not fully materialized${h.reason?` (${h.reason})`:""} \u2014 deletes NOT inferred (D19)`),p("skipped-not-materialized");let _=this.modeOps(e),y=this.instrumentLocalFiles(this.deps.localFilesFor(e));if(_.fileMode&&(y.readBinary===void 0||y.writeBinary===void 0))return p("error",{detail:"file-mode repo requires a LocalFilesPort with readBinary/writeBinary \u2014 refusing to sync through the text-only port (binary would corrupt)"});if(_.fileMode&&this.deps.quarantine===void 0)return p("error",{detail:"file-mode repo requires a quarantine sink (D18 remote-wins preserves losing local bytes there) \u2014 configure the quarantine repo before syncing FileSpaces"});let S=this.deps.maxFileBytes??Ws.DEFAULT_MAX_FILE_BYTES;if(t!=="pull"&&this.deps.outbox!==void 0){let Z=await this.flushOutbox(e,c);u=Z.pushed,f=Z.reconflicted}let w=await this.deps.watermarkStore.get(e.repoKey);if(w?.spaceKind==="file"&&!_.fileMode)return p("error",{detail:"watermark was written by a FILE-mode sync but the spec now resolves to asset mode \u2014 refusing (fix the conflicting Space declarations, or clear the watermark to restart)"});w!==null&&_.fileMode&&w.spaceKind!=="file"&&(c.push("watermark was written by an ASSET-mode sync \u2014 rebuilding the base through the file-mode first-sync layer (kind flip)"),w=null);let T=this.deps.localManifestStore!==void 0?y.stat?.bind(y):void 0,O=T!==void 0&&w!==null&&!_.fileMode,A=O&&this.deps.localManifestStore!==void 0?await this.deps.localManifestStore.get(e.repoKey):null,x=this.deps.localManifestFullRehashMs??Qn.DEFAULT_LOCAL_MANIFEST_REHASH_MS,P=O&&(A===null||this.now()-A.lastFullRehashMs>=x),V=new Map,j=new Set,$=new Map,K=new Map,N=new Map,ae=!1,we=new Map;if(O&&w!==null)for(let Z of w.files)we.set(Z.path,Z.blobSha);for(let Z of(await y.list()).filter(_.syncable)){if(_.fileMode){let xe=await pN(y,Z);if(xe.byteLength>S){j.add(Z),c.push(`skipped oversized file ${Z} (${xe.byteLength} bytes > ${S} cap) \u2014 excluded from sync symmetrically (Phase C size cap)`);continue}V.set(Z,xe);continue}if(!O||T===void 0){V.set(Z,await y.read(Z));continue}let he=await T(Z),Te=!P&&he!==null?A?.files[Z]:void 0;if(he!==null&&Te!==void 0&&Te.mtimeMs===he.mtimeMs&&Te.size===he.size&&Te.blobSha===we.get(Z)){$.set(Z,{blobSha:Te.blobSha,...Te.uid!==void 0?{uid:Te.uid}:{}}),K.set(Z,Te.blobSha),N.set(Z,he);continue}ae=!0,V.set(Z,await y.read(Z)),he!==null&&N.set(Z,he)}let ee=!1;if(w===null)if(_.fileMode)ee=!0,w=await this.buildFileModeFirstSyncBase(e,V,_,c);else{let Z=await this.bootstrapWatermark(e,V,c,p);if(Z.kind==="settled")return Z.outcome;ee=!0,w=Z.base}let pe=w;_.fileMode&&j.size>0&&(w={...w,files:w.files.filter(Z=>!j.has(Z.path))});let Y,Ee;O&&!P?(Y=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),Ee=Y===w.lastSyncedSha?w.rootTreeSha:await this.resolveBaseTreeSha(e,w)):Ee=await this.resolveBaseTreeSha(e,w),this.emitProgress(n,e.repoKey,"detecting");let ie=await(0,Ho.detectChanges)({localFiles:V,...O?{cachedEntries:$}:{},watermark:w,actualBaseTreeSha:Ee,sha1:this.sha1});if(ie.kind==="full-conflict")return p("full-conflict",{detail:`${ie.reason}${ie.detail?`: ${ie.detail}`:""} \u2014 divergence must go through merge/quarantine (A2/A3), not overwrite`});if(c.push(...ie.warnings),O&&this.deps.localManifestStore!==void 0){let Z={};for(let[he,Te]of V){let xe=N.get(he),je=ie.diskBlobShas.get(he);if(xe===void 0||je===void 0)continue;let ke=typeof Te=="string"?(0,Ho.extractAssetUid)(Te):void 0;Z[he]={mtimeMs:xe.mtimeMs,size:xe.size,blobSha:je,...ke!==void 0?{uid:ke}:{}}}for(let[he,Te]of $){let xe=N.get(he);xe!==void 0&&(Z[he]={mtimeMs:xe.mtimeMs,size:xe.size,blobSha:Te.blobSha,...Te.uid!==void 0?{uid:Te.uid}:{}})}if(A!==null&&Object.keys(A.files).some(he=>!(he in Z))&&(ae=!0),ae||P||A===null){let he={version:1,files:Z,lastFullRehashMs:P||A===null?this.now():A.lastFullRehashMs};await this.deps.localManifestStore.set(e.repoKey,he)}}let ne=this.pinLocalChanges(ie,V,c,l,t);d=[...ne.pushDeletionsAll.keys()];let de=await this.runPushLoop(e,w,ne,V,c,_,ee,j,t,n,Y);if(d=[],de.kind!=="done"&&ne.pushDeletionsAll.size>0&&l.push(...ne.pushDeletionsAll.keys()),de.kind==="conflict")return p("conflict",{detail:de.detail});if(de.kind==="secret-detected")return p("error",{detail:de.detail});if(de.kind==="retry-exhausted"){c.push(...de.merge.warnings);let Z=await this.buildTerminalQuarantineEntries(e,w,de.pushFiles,de.merge.quarantineEntries,V),he=[...de.merge.quarantineEntries,...de.merge.resolvedQuarantineEntries,...Z];return await this.flushQuarantine(he,c),p("retry-exhausted",{detail:de.detail,quarantinedCount:he.length,...he.length>0?{quarantinedPaths:he.map(Te=>Te.path)}:{}})}let{examinedHead:ye,pushedSha:te,applyWrites:me,applyDeletes:Pe,pushFiles:se}=de,_e=de.merge;c.push(..._e.warnings),c.push(...de.deferredWarnings),l.push(...de.withheldDeletions);let Ne=de.deferredPaths.size>0?{deferredPaths:[...de.deferredPaths]}:{},Q=de.pushedDeletions.length>0?{pushedDeletes:de.pushedDeletions}:{},ce=await this.flushQuarantine([..._e.quarantineEntries,..._e.resolvedQuarantineEntries],c),be=new Set;if(!ce&&_e.resolvedQuarantineEntries.length>0){for(let Z of _e.resolvedQuarantineEntries)be.add(Z.path);c.push(`quarantine flush failed \u2014 remote-wins apply withheld for ${be.size} path(s); local files untouched, conflict re-derives next sync (D18 durability gate)`)}if(te===void 0&&ye===w.lastSyncedSha&&me.length===0&&Pe.length===0&&_e.mergedWrites.length===0&&_e.quarantineEntries.length===0&&_e.resolvedQuarantineEntries.length===0&&(w.pinnedPaths?.length??0)===0&&de.alreadyInHead.length===0&&de.deferredPaths.size===0&&!ee)return p("synced");let Ie=te??ye,Ce=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,Ie,this.deps.baseURL);if(te!==void 0&&Ce.parents[0]!==ye)return await this.checkRaceWindow(e,w,ye,Ce.parents[0],se,new Set(de.pushedDeletions),c,_),c.push(`race-window: watermark NOT advanced (pushed commit's parent ${Ce.parents[0]} != examined head ${ye}) \u2014 next sync reconciles the concurrent change`),p("synced",{pushedSha:te,pushedCount:se.size,mergedCount:_e.mergedCount,quarantinedCount:_e.quarantineEntries.length+_e.resolvedQuarantineEntries.length,..._e.mergedPaths.length>0?{mergedPaths:_e.mergedPaths}:{},...I0(_e).length>0?{quarantinedPaths:I0(_e)}:{},...Ne,...Q});let{pulledCount:Fe,pinnedPaths:De,pulledPaths:Ae}=await this.applyRemoteChanges(y,V,[...me,..._e.mergedWrites].filter(Z=>!be.has(Z.path)),Pe.filter(Z=>!be.has(Z.path)),c,K);for(let Z of _e.quarantineEntries)De.add(Z.path);for(let Z of de.deferredPaths)De.add(Z);for(let Z of be)De.add(Z);if(_.fileMode){for(let Z of j)De.add(Z);for(let Z of de.remoteOversized)De.add(Z)}return await this.advanceWatermark(e,Ie,Ce.treeSha,V,[...me,..._e.mergedWrites,...de.deferredRemoteChanges],pe,De,ie.diskBlobShas,_,j),await this.resolveClearedPins(e,pe,De,c,new Set(_e.resolvedQuarantineEntries.map(Z=>Z.path))),p("synced",{pushedSha:te,pulledCount:Fe,pushedCount:se.size,mergedCount:_e.mergedCount,quarantinedCount:_e.quarantineEntries.length+_e.resolvedQuarantineEntries.length,..._e.mergedPaths.length>0?{mergedPaths:_e.mergedPaths}:{},...Ae.length>0?{pulledPaths:Ae}:{},...I0(_e).length>0?{quarantinedPaths:I0(_e)}:{},...Ne,...Q})}catch(h){let _=this.deps.redact??(y=>y);return d.length>0&&l.push(...d),(0,Dee.isAuthError)(h)?p("auth-required",{detail:_(`authentication failed: ${ka(h)} \u2014 the PAT is expired, revoked or under-scoped; update it in the per-device secure storage (R8). Never treated as success.`)}):(c.push(`sync failed: ${_(ka(h))}`),p("error",{detail:_(ka(h))}))}finally{this.activeTimer=s,this.activeLocalIoProgress=o}}async flushQuarantine(e,t){if(e.length===0)return!0;let n=this.deps.redact??(s=>s);for(let s of e)t.push(n(`quarantined ${s.path}: ${s.reason}`));let i=this.deps.quarantine;if(i===void 0)return!1;try{if(i.quarantineAll!==void 0)await i.quarantineAll(e);else for(let s of e)await i.quarantine(s);return!0}catch(s){let o=this.deps.redact??(c=>c);return t.push(`quarantine sink failed: ${o(ka(s))} \u2014 files untouched on disk; the conflict re-derives next sync (D17 degradation)`),!1}}async flushOutbox(e,t){let n=this.deps.outbox;if(n===void 0)return{pushed:0,reconflicted:0};let i=await n.listForRepo(e.repoKey);if(i.length===0)return{pushed:0,reconflicted:0};let s=this.deps.redact??(_=>_),o,c;try{({head:o,shaByPath:c}=await this.outboxHeadTreeShas(e))}catch(_){return t.push(`outbox flush deferred (${i.length} resolution(s) awaiting push): ${s(ka(_))}`),{pushed:0,reconflicted:0}}let l=0,u=[];for(let _ of i){let y=c.get(_.path)??X2.OUTBOX_REMOTE_ABSENT,S=y===X2.OUTBOX_REMOTE_ABSENT&&_.baseRemoteSha!==X2.OUTBOX_REMOTE_ABSENT?[...c].filter(([w,T])=>w!==_.path&&T===_.baseRemoteSha).map(([w])=>w):[];if(y!==_.baseRemoteSha&&S.length===0){await n.remove(_.repoKey,_.path),l++,t.push(s(`outbox: remote moved for ${_.path} since you resolved it \u2014 NOT pushed; resolve again (your choice is preserved on disk)`));continue}u.push({entry:_,stalePaths:S})}if(u.length===0)return{pushed:0,reconflicted:l};let f=new Map;for(let{entry:_}of u)f.set(_.path,_.chosenContent);let d=new Set;for(let{stalePaths:_}of u)for(let y of _)f.has(y)||d.add(y);let p=[...d];try{await(0,uN.restCreateCommit)(this.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:f,...p.length>0?{deletions:p}:{},message:p.length>0?`chore(exosync): resolve ${u.length} keep-local conflict(s) (consolidate ${p.length} stale remote path(s))`:`chore(exosync): push ${u.length} resolved conflict(s)`,expectedHeadSha:o,...this.deps.baseURL!==void 0?{baseURL:this.deps.baseURL}:{},...this.deps.redact!==void 0?{redact:this.deps.redact}:{}})}catch(_){return t.push(`outbox: batch push deferred for ${u.length} resolution(s), will retry next sync: ${s(ka(_))}`),{pushed:0,reconflicted:l}}let h=0;for(let{entry:_,stalePaths:y}of u){let S=y.filter(w=>!f.has(w));await this.snapOutboxWatermark(e,_.path,_.chosenContent,S),await this.deps.quarantine?.markResolved?.(_.repoKey,_.path);for(let w of S)await this.deps.quarantine?.markResolved?.(_.repoKey,w);await n.remove(_.repoKey,_.path),h++,S.length>0&&t.push(`consolidated cross-path conflict for ${_.path} \u2014 removed ${S.length} stale remote copy/copies (recoverable in git history)`)}return h>0&&t.push(`pushed ${h} resolved conflict(s)`),{pushed:h,reconflicted:l}}async outboxHeadTreeShas(e){let t=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),n=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,t,this.deps.baseURL),i=await(0,gt.getTree)(this.transport,e.owner,e.repo,n.treeSha,this.deps.baseURL),s=new Map;for(let o of i)s.set(o.path,o.blobSha);return{head:t,shaByPath:s}}async snapOutboxWatermark(e,t,n,i=[]){let s=await this.deps.watermarkStore.get(e.repoKey);if(s===null)return;let o=new Set([t,...i]),c=(s.pinnedPaths??[]).filter(y=>!o.has(y)),l=await(0,Kc.gitBlobSha)(n,this.sha1),u=(0,Ho.extractAssetUid)(n),f={path:t,blobSha:l,...u!==void 0?{uid:u}:{}},d=new Set(i),p=s.files.filter(y=>!d.has(y.path)),h=p.findIndex(y=>y.path===t),_=h>=0?p.map((y,S)=>S===h?f:y):[...p,f];await this.deps.watermarkStore.set(e.repoKey,{...s,files:_,...c.length>0?{pinnedPaths:c}:{pinnedPaths:void 0}})}async buildTerminalQuarantineEntries(e,t,n,i,s){let o=new Set(i.map(u=>u.path)),c=new Map;try{let u=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),f=(await(0,gt.getTree)(this.transport,e.owner,e.repo,(await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,u,this.deps.baseURL)).treeSha,this.deps.baseURL)).filter(d=>n.has(d.path));for(let d of f)c.set(d.path,await(0,gt.getBlobText)(this.transport,e.owner,e.repo,d.blobSha,this.deps.baseURL))}catch{}let l=[];for(let[u,f]of n){if(o.has(u))continue;let d=s.get(u),p=d??f,h=d!==void 0&&!(0,Ws.contentEquals)(d,f),_=typeof p=="string"?(0,Ho.extractAssetUid)(p):void 0,y=c.get(u);l.push({repoKey:e.repoKey,path:u,..._!==void 0?{uid:_}:{},reason:`non-fast-forward push failed after ${this.deps.maxPushRetries??Qn.DEFAULT_MAX_PUSH_RETRIES} retries (D16) \u2014 a concurrent writer keeps moving ${e.branch}; base recoverable from git history at ${t.lastSyncedSha}${h?"; the contended push payload was a merged proposal (never applied to disk) \u2014 the merge re-derives next sync":""}`,...typeof p=="string"?{localContent:p}:{localContentBytes:p},...y!==void 0?{remoteContent:y}:{}})}return l}async resolveClearedPins(e,t,n,i,s=new Set){let o=this.deps.quarantine;if(o===void 0||o.markResolved===void 0)return;let c=(t.pinnedPaths??[]).filter(l=>!n.has(l)&&!s.has(l));for(let l of c)try{await o.markResolved?.(e.repoKey,l)}catch(u){let f=this.deps.redact??(d=>d);i.push(`quarantine markResolved failed for ${l}: ${f(ka(u))} \u2014 unresolved-count may overcount until the resolver UI reconciles (CQ4)`)}}async resolveBaseTreeSha(e,t){try{return(await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,t.lastSyncedSha,this.deps.baseURL)).treeSha}catch{return null}}pinLocalChanges(e,t,n,i,s){let o=e.modified.filter(p=>p.basePath!==void 0),c=[...e.added,...e.modified.filter(p=>p.basePath===void 0)],l=new Map;if(s==="pull"){for(let p of o)p.basePath!==void 0&&i.push(p.basePath),n.push(`pull-only: rename (uid ${p.uid??"?"}) ${p.basePath} \u2192 ${p.path} not pushed \u2014 propagates on the next push/Sync (#3473)`);for(let p of e.deleted)i.push(p.path),n.push(`pull-only: delete of ${p.path} not pushed \u2014 propagates on the next push/Sync (#3473)`)}else{for(let p of o)p.basePath!==void 0&&l.set(p.basePath,p.path);for(let p of e.deleted)l.set(p.path,p.path)}let u=[...c,...o,...e.deleted.map(p=>({...p}))],f=new Set(e.deleted.map(p=>p.path)),d=new Map;for(let p of[...c,...s==="pull"?[]:o]){let h=t.get(p.path);h!==void 0&&d.set(p.path,h)}return{localChanges:u,localDeletedPaths:f,pushFilesAll:d,pushDeletionsAll:l,dupUids:e.duplicateUids}}async runPushLoop(e,t,n,i,s,o,c=!1,l=new Set,u="sync",f,d){let{localChanges:p,localDeletedPaths:h,pushFilesAll:_,pushDeletionsAll:y,dupUids:S}=n,w=this.deps.maxPushRetries??Qn.DEFAULT_MAX_PUSH_RETRIES,T=0,O="",A,x=[],P=[],V=new Map,j=new Set,$=[],K=J2,N=[],ae=new Set,we=[],ee=[],pe=new Set;for(;;){O=T===0&&d!==void 0&&_.size===0&&y.size===0?d:await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),x=[],P=[],K=J2,N=[],ae=new Set,we=[],ee=[];let Y,Ee=new Set,ie=(t.pinnedPaths?.length??0)>0;if(O!==t.lastSyncedSha||ie||c){this.emitProgress(f,e.repoKey,"pulling-remote");let ye=await this.collectRemoteChanges(e,t,O,o,l,s,pe,f);Y=ye.headTreeByPath;let te=this.matchLocalVsRemote(p,h,i,ye.changes,Ee,S,ye.headTreeByPath);if(te.conflicts.length>0){if(u==="sync"&&this.emitProgress(f,e.repoKey,"merging"),u!=="sync"){for(let me of te.conflicts){ae.add(me.local.path),me.local.basePath!==void 0&&ae.add(me.local.basePath);for(let Pe of me.remotes)ae.add(Pe.path),Pe.kind==="change"&&we.push(Pe)}ee.push(`${u}-only: ${te.conflicts.length} conflict(s) deferred to a full Sync (${te.conflicts.map(me=>me.desc).join("; ")}) \u2014 paths pinned, nothing merged`)}else if(o.fileMode)K=this.resolveFileModeConflicts(e,te.conflicts,i,te.applyWrites,te.applyDeletes);else{if(this.deps.mergeLayer===void 0)return{kind:"conflict",detail:`overlapping change on ${te.conflicts[0].desc} \u2014 merge layer (A2/A3) required; nothing pushed, nothing written`};K=await this.resolveMergeConflicts(e,t,te.conflicts,i)}if(u==="sync")for(let me of te.conflicts)for(let Pe of me.remotes)Pe.path!==me.local.path&&(ae.add(Pe.path),Pe.kind==="change"&&we.push(Pe),ee.push(`conflict group ${me.desc}: remote change at ${Pe.path} NOT applied \u2014 pinned to re-derive on the next sync (#3477)`))}if(x=te.applyWrites,P=te.applyDeletes,u==="push"&&(x.length>0||P.length>0)){for(let me of x)ae.add(me.path),we.push(me);for(let me of P)ae.add(me.path);ee.push(`push-only: ${x.length+P.length} remote change(s) NOT applied \u2014 pinned to re-derive on the next pull/Sync`),x=[],P=[]}}V=u==="pull"?new Map:new Map([...[..._].filter(([ye])=>!Ee.has(ye)),...K.mergedFiles]),j=new Set,$=[];for(let[ye,te]of y){if(Ee.has(te)){$.push(ye);continue}V.has(ye)||j.add(ye)}if((V.size>0||j.size>0)&&Y===void 0&&(Y=Z2(await(0,gt.getTree)(this.transport,e.owner,e.repo,t.rootTreeSha,this.deps.baseURL))),V.size>0&&Y!==void 0){for(let[ye,te]of V){let me=Y.get(ye);me!==void 0&&me===await(0,Kc.gitBlobSha)(te,this.sha1)&&(V.delete(ye),N.push(ye))}N.length>0&&s.push(`phantom push skipped: ${N.length} file(s) already identical in remote HEAD (${N.join(", ")}) \u2014 excluded from the commit (#3475)`)}if(j.size>0&&Y!==void 0){for(let ye of[...j])Y.has(ye)||j.delete(ye);V.size===0&&j.size>=Y.size&&($.push(...j),ee.push(`deletion of ALL ${j.size} remaining file(s) deferred \u2014 GitHub cannot create an empty tree; the deletes re-derive and propagate once the repo has at least one surviving file`),j.clear())}if(V.size===0&&j.size===0)break;let ne=new Map;for(let[ye,te]of V)if(typeof te=="string")ne.set(ye,te);else{let me=$ee(te);me!==null&&ne.set(ye,me)}let de=(0,Fee.scanForSecrets)(ne);if(de.length>0)return{kind:"secret-detected",detail:`secret-scan: refusing to push \u2014 ${de.map(ye=>`${ye.path} (${ye.kind})`).join(", ")} (R5); remove the secret and re-sync`};try{A=await(0,uN.restCreateCommit)(this.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:new Map([...V].map(([ye,te])=>[ye,Uee(te)])),deletions:[...j],message:this.deps.commitMessage?.(e,V.size,j.size)??`chore(exosync): sync ${V.size} file(s)${j.size>0?`, ${j.size} deletion(s)`:""}`,baseURL:this.deps.baseURL,redact:this.deps.redact});break}catch(ye){if(!gN(ye))throw ye;if(T++,T>w)return{kind:"retry-exhausted",detail:`non-fast-forward push failed after ${w} retries (D16 cap) \u2014 contended files routed to quarantine (D17)`,pushFiles:V,merge:K};s.push(`non-fast-forward push (attempt ${T}/${w}) \u2014 re-pulling and retrying (D16)`)}}return{kind:"done",examinedHead:O,pushedSha:A,applyWrites:x,applyDeletes:P,pushFiles:V,pushedDeletions:A!==void 0?[...j]:[],withheldDeletions:$,merge:K,remoteOversized:pe,alreadyInHead:N,deferredPaths:ae,deferredRemoteChanges:we,deferredWarnings:ee}}async resolveMergeConflicts(e,t,n,i){let s=this.deps.mergeLayer;if(s===void 0)return J2;let o=new Map(t.files.map(y=>[y.path,y])),c=new Map,l=[],u=[],f=[],d=[],p=0,h=a(y=>typeof y=="string"?y:void 0,"asText"),_=a((y,S,w)=>{let T=h(i.get(y.local.path)),O=h(y.remotes[0]?.content);return{repoKey:e.repoKey,path:y.local.path,...y.local.uid!==void 0?{uid:y.local.uid}:{},reason:S,...w!==void 0?{baseContent:w}:{},...T!==void 0?{localContent:T}:{},...O!==void 0?{remoteContent:O}:{}}},"entry");for(let y of n){let S=o.get(y.local.basePath??y.local.path)??o.get(y.remotes[0]?.path??""),w;if(S!==void 0&&(w=await(0,gt.getBlobText)(this.transport,e.owner,e.repo,S.blobSha,this.deps.baseURL)),y.remotes.length>1){u.push(_(y,`ambiguous conflict: local change overlaps ${y.remotes.length} remote changes (${y.remotes.map(P=>P.path).join(", ")})`,w));continue}let T=y.remotes[0],O=h(i.get(y.local.path)),A=await s.resolve({path:y.local.path,...y.local.uid!==void 0?{uid:y.local.uid}:{},...w!==void 0?{base:w}:{},...O!==void 0?{local:O}:{},...T.kind==="change"&&typeof T.content=="string"?{remote:T.content}:{}});if(A.action==="quarantine"){u.push(_(y,A.reason,w));continue}p++,d.push(y.local.path);for(let P of A.warnings??[])f.push(`merge(${y.local.path}): ${P}`);let x=T.kind==="change"?T.content:void 0;if(A.content!==x&&c.set(y.local.path,A.content),A.content!==i.get(y.local.path)){let P=(0,Ho.extractAssetUid)(A.content)??y.local.uid;l.push({path:y.local.path,kind:"change",content:A.content,blobSha:await(0,Kc.gitBlobSha)(A.content,this.sha1),...P!==void 0?{uid:P}:{}})}}return{mergedFiles:c,mergedWrites:l,quarantineEntries:u,resolvedQuarantineEntries:[],mergedCount:p,mergedPaths:d,warnings:f}}resolveFileModeConflicts(e,t,n,i,s){let o=[],c=[];for(let l of t){l.remotes.length>1&&c.push(`file-mode conflict on ${l.local.path} unexpectedly overlaps ${l.remotes.length} remote changes \u2014 resolving against the first`);let u=l.remotes[0],f=n.get(l.local.path);u.kind==="change"?i.push(u):s.push(u),!(l.localIsDelete||f===void 0)&&o.push({repoKey:e.repoKey,path:l.local.path,reason:`file-mode remote-wins (D18): remote ${u.kind==="change"?`version ${u.blobSha}`:"delete"} wins; this is the losing LOCAL version, preserved byte-exact`,...typeof f=="string"?{localContent:f}:{localContentBytes:f}})}return{mergedFiles:new Map,mergedWrites:[],quarantineEntries:[],resolvedQuarantineEntries:o,mergedCount:0,mergedPaths:[],warnings:c}}async applyRemoteChanges(e,t,n,i,s,o=new Map){let c=0,l=new Set,u=[],f=a(async(h,_)=>{try{return _?await pN(e,h):await e.read(h)}catch{return}},"tryRead"),d=a(async(h,_)=>{typeof _=="string"?await e.write(h,_):await Bee(e,h,_)},"writeContent"),p=a(async h=>{let _=await f(h,!1);return _===void 0?!0:await(0,Kc.gitBlobSha)(_,this.sha1)===o.get(h)},"cacheHitUnchanged");for(let h of n){if(h.content===void 0)continue;if(!hN(h.path)){s.push(`unsafe remote path skipped on pull-apply: ${h.path}`),l.add(h.path);continue}let _=t.get(h.path);if(_===void 0&&o.has(h.path)){if(!await p(h.path)){s.push(`pull-apply skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 remote change re-derives next sync`),l.add(h.path);continue}await d(h.path,h.content),c++,u.push(h.path);continue}let y=await f(h.path,typeof(_??h.content)!="string");if(!(0,Ws.contentEquals)(y,_)){s.push(`pull-apply skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 remote change re-derives next sync`),l.add(h.path);continue}await d(h.path,h.content),c++,u.push(h.path)}for(let h of i){if(!hN(h.path)){s.push(`unsafe remote path skipped on pull-delete: ${h.path}`),l.add(h.path);continue}let _=t.get(h.path);if(_===void 0&&o.has(h.path)){if(!await p(h.path)){s.push(`pull-delete skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 delete-vs-modify re-derives next sync`),l.add(h.path);continue}await e.delete(h.path),c++,u.push(h.path);continue}if(_!==void 0){let y=await f(h.path,typeof _!="string");if(y!==void 0&&!(0,Ws.contentEquals)(y,_)){s.push(`pull-delete skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 delete-vs-modify re-derives next sync`),l.add(h.path);continue}await e.delete(h.path),c++,u.push(h.path)}}return{pulledCount:c,pinnedPaths:l,pulledPaths:u}}async advanceWatermark(e,t,n,i,s,o,c,l,u,f=new Set){let d=(await(0,gt.getTree)(this.transport,e.owner,e.repo,n,this.deps.baseURL)).filter(h=>u.treeFilter(h)&&!f.has(h.path)),p=qee(await this.buildWatermarkFiles(e,d,i,s,o,l,u),o,c);await this.deps.watermarkStore.set(e.repoKey,{lastSyncedSha:t,rootTreeSha:n,files:p,...c.size>0?{pinnedPaths:[...c]}:{},...u.fileMode?{spaceKind:"file"}:{}})}async tryMountBaseBootstrap(e,t,n,i,s){let o=this.deps.mountBaseStore,c=null;if(o!==void 0)try{c=await o.get(e.repoKey)}catch{return null}let l=!1;if(c===null&&this.deps.localBaseShaProvider!==void 0)try{let S=await this.deps.localBaseShaProvider(e);typeof S=="string"&&S.length>0&&(c=S,l=!0)}catch{}if(c===null||t.startsWith(c))return null;let u=300,f=null;try{let S=t;for(let w=0;w<u;w++){let T=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,S,this.deps.baseURL);if(T.sha===c||T.sha.startsWith(c)){f=T;break}if(T.parents.length===0)break;S=T.parents[0]}}catch{return null}if(f===null)return null;let d;try{d=(await(0,gt.getTree)(this.transport,e.owner,e.repo,f.treeSha,this.deps.baseURL)).filter(S=>(0,Ws.isSyncablePath)(S.path))}catch{return null}let p;try{let S=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,t,this.deps.baseURL);p=Z2((await(0,gt.getTree)(this.transport,e.owner,e.repo,S.treeSha,this.deps.baseURL)).filter(w=>(0,Ws.isSyncablePath)(w.path)))}catch{return null}let h=d.filter(S=>!n.has(S.path)&&p.get(S.path)===S.blobSha);if(h.length>0){let S=h.slice(0,3).map(w=>w.path).join(", ")+(h.length>3?", \u2026":"");return i.push(`first-sync (asset mode): base-tree\u2286working-tree sanity guard fired \u2014 ${h.length} base file(s) absent from the working tree but UNCHANGED on remote head (${S}); the verified-ancestor base may not match the working tree's derivation commit (out-of-band submodule manipulation) \u2192 routing to merge/quarantine instead of inferring a silent deletion (#3610)`),{kind:"settled",outcome:s("full-conflict",{detail:`first-sync: base-tree\u2286working-tree sanity guard \u2014 ${h.length} base file(s) absent from the working tree are unchanged on remote head (${S}); refusing to infer a silent deletion from a base that may not match the derivation commit \u2014 divergence must go through merge/quarantine (A2/A3), never a silent delete (#3610)`})}}let _=d.map(S=>({path:S.path,blobSha:S.blobSha})),y={lastSyncedSha:f.sha,rootTreeSha:f.treeSha,files:_};if(l&&o!==void 0)try{await o.set(e.repoKey,f.sha)}catch{}return i.push(l?`first-sync (asset mode): BACKFILLED the 3-way base from the locally checked-out commit ${f.sha} (no recorded mount base) \u2014 remote head ${t} advanced since; local edits 3-way merge against it instead of false-conflicting (#3590)`:`first-sync (asset mode): reconciling against the recorded mount base ${f.sha} \u2014 remote head ${t} advanced since mount; local edits 3-way merge against it instead of false-conflicting (#3590)`),{kind:"additive-base",base:y}}async bootstrapWatermark(e,t,n,i){let s=await(0,gt.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),o=await this.tryMountBaseBootstrap(e,s,t,n,i);if(o!==null)return o;let c=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,s,this.deps.baseURL),l=(await(0,gt.getTree)(this.transport,e.owner,e.repo,c.treeSha,this.deps.baseURL)).filter(p=>(0,Ws.isSyncablePath)(p.path)),u=[],f;for(let p of l){let h=t.get(p.path);if(h===void 0||await(0,Kc.gitBlobSha)(h,this.sha1)!==p.blobSha){f===void 0&&(f=p.path);continue}let _=typeof h=="string"?(0,Ho.extractAssetUid)(h):void 0;u.push({path:p.path,blobSha:p.blobSha,..._?{uid:_}:{}})}let d={lastSyncedSha:s,rootTreeSha:c.treeSha,files:u};return f!==void 0?this.deps.mergeLayer===void 0?{kind:"settled",outcome:i("full-conflict",{detail:`first-sync: no watermark and local content diverges from remote head at ${f} \u2014 A2/A3 scope`})}:(n.push(`first-sync (asset mode): no 3-way merge base and local diverges from remote head (first at ${f}) \u2014 reconciling ZERO-LOSS against ${u.length} byte-identical file(s) as a synthetic base: remote-only files pull, local-only files push, overlapping divergences route to the merge/quarantine layer (both versions preserved), never a silent overwrite or delete`),{kind:"additive-base",base:d}):t.size===l.length?(await this.deps.watermarkStore.set(e.repoKey,d),n.push(`watermark bootstrapped from head ${s} (local tree identical to remote)`),{kind:"settled",outcome:i("synced")}):(n.push(`first-sync (asset mode): local tree (${t.size} files) is a pure superset of remote head ${s} (${l.length} files) \u2014 ${t.size-l.length} local-only addition(s) derive as pushable adds (#3565)`),{kind:"additive-base",base:d})}async collectRemoteChanges(e,t,n,i,s=new Set,o=[],c=new Set,l){let u=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,n,this.deps.baseURL),f=await(0,gt.getTree)(this.transport,e.owner,e.repo,u.treeSha,this.deps.baseURL);if(i.fileMode)for(let T of f)i.syncable(T.path)&&!i.treeFilter(T)&&!c.has(T.path)&&(c.add(T.path),o.push(`skipped oversized REMOTE file ${T.path} (${T.size??"?"} bytes over cap) \u2014 excluded from sync symmetrically (Phase C size cap)`));let d=f.filter(T=>i.treeFilter(T)&&!s.has(T.path)),p=t.files.filter(T=>!c.has(T.path)&&!s.has(T.path)),{changed:h,deleted:_}=mN(p,d),y=h.length;y>=dN&&this.emitProgress(l,e.repoKey,"fetching-blobs",{done:0,total:y});let S=0,w=[];for(let T of h){if(i.fileMode){let O=await(0,gt.getBlobBytes)(this.transport,e.owner,e.repo,T.blobSha,this.deps.baseURL);w.push({path:T.path,kind:"change",blobSha:T.blobSha,content:O})}else{let O=await(0,gt.getBlobText)(this.transport,e.owner,e.repo,T.blobSha,this.deps.baseURL);w.push({path:T.path,kind:"change",blobSha:T.blobSha,content:O,uid:(0,Ho.extractAssetUid)(O)})}S+=1,y>=dN&&S%kee===0&&S<y&&this.emitProgress(l,e.repoKey,"fetching-blobs",{done:S,total:y})}for(let T of _)w.push({path:T.path,kind:"delete",uid:T.uid});return{changes:w,headTreeByPath:Z2(f)}}matchLocalVsRemote(e,t,n,i,s,o=new Set,c){let l=new Set,u=[],f=new Map;for(let y of i)y.kind==="change"&&y.uid!==void 0&&f.set(y.uid,(f.get(y.uid)??0)+1);let d=new Set(o);for(let[y,S]of f)S>1&&d.add(y);let p=new Map,h=new Map;for(let y of i){if(y.uid!==void 0&&!d.has(y.uid)){let S=p.get(y.uid)??[];S.push(y),p.set(y.uid,S)}h.set(y.path,y)}for(let y of e){let S=new Set;if(y.uid!==void 0&&!d.has(y.uid))for(let A of p.get(y.uid)??[])A.kind==="change"&&A.path!==y.path&&(c?.has(y.path)===!0||y.basePath!==void 0&&c?.has(y.basePath)===!0)||S.add(A);let w=h.get(y.path);if(w!==void 0&&S.add(w),y.basePath!==void 0){let A=h.get(y.basePath);A!==void 0&&S.add(A)}let T=[],O=!1;for(let A of S){if(O=t.has(y.path)&&!n.has(y.path),O&&A.kind==="delete"){l.add(A);continue}if(!O&&A.kind==="change"&&A.path===y.path&&A.blobSha===y.blobSha){l.add(A),s.add(y.path);continue}if(A.kind==="delete"&&y.basePath!==void 0&&A.path===y.basePath){let x=h.get(y.path);if(x!==void 0&&x.kind==="change"&&(x.blobSha===y.blobSha||x.uid!==void 0&&x.uid===y.uid)){l.add(A);continue}}if(A.kind==="delete"&&A.path!==y.path&&A.path!==y.basePath&&!n.has(A.path)&&c?.has(A.path)!==!0){l.add(A);continue}T.push(A),l.add(A)}T.length>0&&(u.push({local:y,localIsDelete:O,remotes:T,desc:`${y.uid!==void 0&&!d.has(y.uid)?y.uid:y.path} (local ${O?"delete":"change"} vs remote ${T[0].kind} at ${T[0].path})`}),s.add(y.path))}let _=i.filter(y=>!l.has(y));return{conflicts:u,applyWrites:_.filter(y=>y.kind==="change"),applyDeletes:_.filter(y=>y.kind==="delete")}}async checkRaceWindow(e,t,n,i,s,o,c,l){try{let u=await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,i,this.deps.baseURL),f=(await(0,gt.getTree)(this.transport,e.owner,e.repo,u.treeSha,this.deps.baseURL)).filter(l.treeFilter),d=n===t.lastSyncedSha?t.files:(await(0,gt.getTree)(this.transport,e.owner,e.repo,(await(0,gt.getCommitInfo)(this.transport,e.owner,e.repo,n,this.deps.baseURL)).treeSha,this.deps.baseURL)).filter(l.treeFilter),{changed:p,deleted:h}=mN(d,f);for(let _ of p)s.has(_.path)&&c.push(`race-window: concurrent commit ${i} changed ${_.path} between conflict check (head ${n}) and push \u2014 local version won; previous version recoverable from git history`),o.has(_.path)&&c.push(`race-window: concurrent commit ${i} changed ${_.path} which this push DELETED \u2014 the delete won; the concurrent version is recoverable from git history`);for(let _ of h)s.has(_.path)&&c.push(`race-window: concurrent commit ${i} deleted ${_.path}; push re-created it`)}catch(u){let f=this.deps.redact??(d=>d);c.push(`race-window check failed: ${f(ka(u))}`)}}async buildWatermarkFiles(e,t,n,i,s,o,c){if(c.fileMode)return t.map(f=>({path:f.path,blobSha:f.blobSha}));let l=new Map;for(let f of i)f.kind==="change"&&f.blobSha!==void 0&&l.set(f.blobSha,f.uid);for(let[f,d]of n){let p=o?.get(f)??await(0,Kc.gitBlobSha)(d,this.sha1);l.set(p,typeof d=="string"?(0,Ho.extractAssetUid)(d):void 0)}for(let f of s.files)l.has(f.blobSha)||l.set(f.blobSha,f.uid);let u=[];for(let f of t){let d;if(l.has(f.blobSha))d=l.get(f.blobSha);else{let p=await(0,gt.getBlobText)(this.transport,e.owner,e.repo,f.blobSha,this.deps.baseURL);d=(0,Ho.extractAssetUid)(p)}u.push({path:f.path,blobSha:f.blobSha,...d?{uid:d}:{}})}return u}};Qn.SyncEngine=eA});var bN=E(op=>{"use strict";Object.defineProperty(op,"__esModule",{value:!0});op.QuarantineResolver=void 0;op.backupPathFor=_N;var Gee=g0(),x0=rp(),ip=ku(),sp=Zd(),Wee=S0(),Hs="\0absent",tA=class{static{a(this,"QuarantineResolver")}constructor(e){this.deps=e}async listOpenConflicts(e){let t=[];for(let n of e)t.push(...await this.listRepoConflicts(n));return t}async listRepoConflicts(e){if(e.spaceKind==="file")return[];let t=await this.deps.watermarkStore.get(e.repoKey),n=t?.pinnedPaths??[];if(n.length===0)return[];if(this.deps.outbox!==void 0){let h=await this.deps.outbox.listForRepo(e.repoKey);if(h.length>0){let _=new Set(h.map(y=>y.path));if(n=n.filter(y=>!_.has(y)),n.length===0)return[]}}let i=new Map;for(let h of t?.files??[])i.set(h.path,h.blobSha);let s=this.deps.conflictCache!==void 0,o=await this.cachedRecordsFor(e,n),c=n.some(h=>!o.has(h)),l=new Map,u=!0;if(c)if(s)try{l=await this.remoteTreeShas(e)}catch{u=!1}else l=await this.remoteTreeShas(e);let f=this.deps.localFilesFor(e),d=new Set(await f.list()),p=[];for(let h of n){let _=o.get(h),y,S;if(_!==void 0)S=_.remoteContent!==void 0?await(0,ip.gitBlobSha)(_.remoteContent,this.deps.sha1):Hs,y=_.baseContent!==void 0?await(0,ip.gitBlobSha)(_.baseContent,this.deps.sha1):i.get(h)??Hs;else{if(!u)continue;S=l.get(h)??Hs,y=i.get(h)??Hs}let w=Hs,T;if(d.has(h)&&(T=await f.read(h),w=await(0,ip.gitBlobSha)(T,this.deps.sha1)),!(w!==S&&w!==y&&S!==y))continue;let A=(T!==void 0?(0,sp.extractAssetUid)(T):void 0)??_?.uid;p.push({repoKey:e.repoKey,path:h,...A!==void 0?{uid:A}:{},hasLocal:w!==Hs,hasRemote:S!==Hs})}return p}async cachedRecordsFor(e,t){let n=new Map,i=this.deps.conflictCache;if(i===void 0)return n;for(let s of t){let o=await i.get(e.repoKey,s);o!==null&&n.set(s,o)}return n}async detectDuplicateUids(e){let t=new Map;for(let i of e){let s=this.deps.localFilesFor(i);for(let o of await s.list()){if(!o.endsWith(".md"))continue;let c;try{c=await s.read(o)}catch{continue}let l=(0,sp.extractAssetUid)(c);l!==void 0&&t.set(l,(t.get(l)??0)+1)}}let n=0;for(let i of t.values())i>1&&n++;return n}async loadConflict(e,t){let n=this.deps.localFilesFor(e),s=new Set(await n.list()).has(t)?await n.read(t):void 0,o=await this.deps.conflictCache?.get(e.repoKey,t)??null,c,l;if(o!==null)c=o.remoteContent,l=o.baseContent;else{let d=(await this.remoteTreeShas(e)).get(t);c=d!==void 0?await this.blobText(e,d):void 0;let h=((await this.deps.watermarkStore.get(e.repoKey))?.files??[]).find(_=>_.path===t)?.blobSha;if(h!==void 0)try{l=await this.blobText(e,h)}catch{l=void 0}}let u=(s!==void 0?(0,sp.extractAssetUid)(s):void 0)??(c!==void 0?(0,sp.extractAssetUid)(c):void 0)??o?.uid;return{repoKey:e.repoKey,path:t,...u!==void 0?{uid:u}:{},hasLocal:s!==void 0,hasRemote:c!==void 0,...l!==void 0?{base:l}:{},...s!==void 0?{local:s}:{},...c!==void 0?{remote:c}:{}}}async resolve(e,t,n){let i=this.deps.localFilesFor(e),o=new Set(await i.list()).has(t)?await i.read(t):void 0,c=this.deps.outbox!==void 0,{remote:l,remoteSha:u}=c?await this.remoteForResolve(e,t):await this.liveRemoteForResolve(e,t),f=this.chosenContent(n,o,l),d;n.take!=="local"&&o!==void 0&&o!==f&&(d=_N(t),await i.write(d,o)),f===void 0?await i.delete(t):await i.write(t,f);let h=f===void 0&&l===void 0||f===l;if(c&&this.deps.outbox!==void 0&&!h&&f!==void 0)return await this.deps.outbox.enqueue({repoKey:e.repoKey,path:t,chosenContent:f,resolvedTo:n.take==="merged"?"merged":"local",baseRemoteSha:u===Hs?Wee.OUTBOX_REMOTE_ABSENT:u,resolvedAt:""}),{repoKey:e.repoKey,path:t,resolvedTo:n.take,awaitingPush:!0,...d!==void 0?{discardedLocalBackupPath:d}:{}};let _;return h||(_=await this.commitChoice(e,t,f)),await this.snapWatermark(e,t,f),this.deps.quarantine?.markResolved!==void 0&&await this.deps.quarantine.markResolved(e.repoKey,t),{repoKey:e.repoKey,path:t,resolvedTo:n.take,..._!==void 0?{pushedSha:_}:{},...d!==void 0?{discardedLocalBackupPath:d}:{}}}async remoteForResolve(e,t){let n=await this.deps.conflictCache?.get(e.repoKey,t)??null;if(n!==null){let i=n.remoteContent,s=i!==void 0?await(0,ip.gitBlobSha)(i,this.deps.sha1):Hs;return{remote:i,remoteSha:s}}return this.liveRemoteForResolve(e,t)}async liveRemoteForResolve(e,t){let i=(await this.remoteTreeShas(e)).get(t);return{remote:i!==void 0?await this.blobText(e,i):void 0,remoteSha:i??Hs}}chosenContent(e,t,n){switch(e.take){case"local":if(t===void 0)throw new Error("resolve: cannot keep local \u2014 no local version exists on disk");return t;case"remote":return n;case"merged":return e.content}}async commitChoice(e,t,n){let i=this.deps.commitMessage?.(e,t)??`chore(exosync): resolve conflict for ${t}`;if(n===void 0)throw new Error(`resolve: cannot push an empty resolution for ${t}`);return(0,Gee.restCreateCommit)(this.deps.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:new Map([[t,n]]),message:i,...this.deps.baseURL!==void 0?{baseURL:this.deps.baseURL}:{},...this.deps.redact!==void 0?{redact:this.deps.redact}:{}})}async snapWatermark(e,t,n){let i=await this.deps.watermarkStore.get(e.repoKey);if(i===null)return;let s=(i.pinnedPaths??[]).filter(c=>c!==t),o=i.files;if(n===void 0)o=o.filter(c=>c.path!==t);else{let c=await(0,ip.gitBlobSha)(n,this.deps.sha1),l=(0,sp.extractAssetUid)(n),u={path:t,blobSha:c,...l!==void 0?{uid:l}:{}},f=o.findIndex(d=>d.path===t);o=f>=0?o.map((d,p)=>p===f?u:d):[...o,u]}await this.deps.watermarkStore.set(e.repoKey,{...i,files:o,...s.length>0?{pinnedPaths:s}:{pinnedPaths:void 0}})}async remoteTreeShas(e){let t=await(0,x0.getHeadSha)(this.deps.transport,e.owner,e.repo,e.branch,this.deps.baseURL),n=await(0,x0.getCommitInfo)(this.deps.transport,e.owner,e.repo,t,this.deps.baseURL),i=await(0,x0.getTree)(this.deps.transport,e.owner,e.repo,n.treeSha,this.deps.baseURL),s=new Map;for(let o of i)s.set(o.path,o.blobSha);return s}async blobText(e,t){return(0,x0.getBlobText)(this.deps.transport,e.owner,e.repo,t,this.deps.baseURL)}};op.QuarantineResolver=tA;function _N(r){return`${r}.conflict.local.txt`}a(_N,"backupPathFor")});var SN=E(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.FileLocalManifestStore=Mu.LOCAL_MANIFEST_STORE_FILENAME=void 0;Mu.LOCAL_MANIFEST_STORE_FILENAME="exosync-localmanifest.local.json";function Hee(r){if(r===null||typeof r!="object")return!1;let e=r;return e.version===1&&typeof e.lastFullRehashMs=="number"&&e.files!==null&&typeof e.files=="object"}a(Hee,"isLocalManifestRecord");var rA=class{static{a(this,"FileLocalManifestStore")}constructor(e){this.io=e,this.writeChain=Promise.resolve()}async get(e){let n=(await this.readRepos())[e];return Hee(n)?n:null}async set(e,t){let n=this.writeChain.then(async()=>{let i=await this.readRepos();i[e]=t;let s={version:1,repos:i};await this.io.writeAtomic(JSON.stringify(s))});return this.writeChain=n.catch(()=>{}),n}async readRepos(){try{let e=await this.io.read();if(e===null)return{};let t=JSON.parse(e);if(t===null||typeof t!="object")return{};let n=t.repos;return n===null||typeof n!="object"?{}:{...n}}catch{return{}}}};Mu.FileLocalManifestStore=rA});var sA=E(iA=>{"use strict";Object.defineProperty(iA,"__esModule",{value:!0});iA.diff3=zee;function wN(r,e){let t=r.length,n=e.length,i=Array.from({length:t+1},()=>new Int32Array(n+1));for(let l=t-1;l>=0;l--)for(let u=n-1;u>=0;u--)i[l][u]=r[l]===e[u]?i[l+1][u+1]+1:Math.max(i[l+1][u],i[l][u+1]);let s=new Map,o=0,c=0;for(;o<t&&c<n;)r[o]===e[c]?(s.set(o,c),o++,c++):i[o+1][c]>=i[o][c+1]?o++:c++;return s}a(wN,"lcsMatch");function nA(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}a(nA,"sliceEq");function zee(r,e,t){let n=wN(r,e),i=wN(r,t),s=[],o=0,c=0,l=0;for(;;){let u=o;for(;u<r.length&&!(n.has(u)&&i.has(u));)u++;let f=u<r.length?n.get(u):e.length,d=u<r.length?i.get(u):t.length,p=r.slice(o,u),h=e.slice(c,f),_=t.slice(l,d),y=!nA(h,p),S=!nA(_,p);if(!y&&!S)s.push(...p);else if(!y)s.push(..._);else if(!S)s.push(...h);else if(nA(h,_))s.push(...h);else return{ok:!1,conflict:{base:p,local:h,remote:_}};if(u>=r.length)break;s.push(r[u]),o=u+1,c=f+1,l=d+1}return{ok:!0,merged:s}}a(zee,"diff3")});var vN=E(lp=>{"use strict";Object.defineProperty(lp,"__esModule",{value:!0});lp.StructuredMerger=void 0;lp.splitSections=R0;var EN=sA(),Kee=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/,ap="exo__Instance_class";function cp(r){if(r===null||typeof r!="object")return!0;if(Array.isArray(r))return r.every(cp);let e=Object.getPrototypeOf(r);return e!==Object.prototype&&e!==null?!1:Object.values(r).every(cp)}a(cp,"isPlainValue");function Ma(r,e){if(r===e)return!0;if(r===null||e===null||r===void 0||e===void 0||typeof r!="object"||typeof e!="object"||Array.isArray(r)!==Array.isArray(e))return!1;if(Array.isArray(r)&&Array.isArray(e))return r.length!==e.length?!1:r.every((s,o)=>Ma(s,e[o]));let t=r,n=e,i=Object.keys(t);return i.length!==Object.keys(n).length?!1:i.every(s=>Ma(t[s],n[s]))}a(Ma,"deepEqual");function Yc(r){return typeof r=="string"?`s:${r}`:`j:${JSON.stringify(r)}`}a(Yc,"setKey");function Si(r){return r==null?[]:Array.isArray(r)?r:[r]}a(Si,"toElements");function Yee(r,e,t){let n=new Set(Si(r).map(Yc)),i=Si(e),s=Si(t),o=new Set(i.map(Yc)),c=new Set(s.map(Yc)),l=a(d=>o.has(d)&&c.has(d)||o.has(d)&&!n.has(d)||c.has(d)&&!n.has(d),"keep"),u=[],f=new Set;for(let d of[...i,...s]){let p=Yc(d);f.has(p)||!l(p)||(f.add(p),u.push(d))}return u}a(Yee,"mergeSet");function Qee(r,e,t){let n=[],i=[],s=new Set;for(let c of[...Object.keys(r),...Object.keys(e),...Object.keys(t)])s.has(c)||(s.add(c),i.push(c));let o={};for(let c of i){let l=r[c],u=e[c],f=t[c];if(!cp(l)||!cp(u)||!cp(f))return{ok:!1,reason:`frontmatter key "${c}" contains a non-plain value (Date?) \u2014 the codec must round-trip scalars as strings (CORE_SCHEMA contract)`};if(Array.isArray(l)||Array.isArray(u)||Array.isArray(f)){if(!(c in e)&&!(c in t))continue;let d=Yee(l,u,f),p=new Set(Si(l).map(Yc)),h=Si(u).some(y=>!p.has(Yc(y))),_=Si(f).some(y=>!p.has(Yc(y)));h&&_&&!Ma(Si(u),Si(f))&&n.push(`both sides added values to multi-valued key "${c}" \u2014 union kept (D20)`),d.length>0&&(o[c]=d);continue}if(Ma(u,f)){u!==void 0&&(o[c]=u);continue}if(Ma(u,l)){f!==void 0&&(o[c]=f);continue}if(Ma(f,l)){u!==void 0&&(o[c]=u);continue}return{ok:!1,reason:`frontmatter key "${c}" changed differently on both sides`}}return{ok:!0,value:o,warnings:n}}a(Qee,"mergeFrontmatter");var Xee=/^(```|~~~)/,Jee=/^#{1,6}\s/;function R0(r){let e=r.split(`
|
|
342
342
|
`),t=[],n=null,i="",s=!1,o=a(()=>{n!==null&&t.push({heading:i,text:n.join(`
|
|
343
343
|
`)})},"flush");for(let c of e){if(Xee.test(c.trimStart())&&(s=!s),!s&&Jee.test(c)){o(),n=[c],i=c.trim();continue}n===null&&(n=[],i=""),n.push(c)}return o(),t}a(R0,"splitSections");function oA(r){return r.split(/\n{2,}/)}a(oA,"splitParagraphs");function Zee(r){return r.join(`
|
|
344
344
|
|
|
345
|
-
`)}a(Zee,"joinParagraphs");function aA(r){let e=new Map,t=new Map,n=[];for(let i of r){let s=e.get(i.heading)??0;e.set(i.heading,s+1);let o=`${i.heading}\0${s}`;t.set(o,i),n.push(o)}return{keyed:t,order:n}}a(aA,"keySections");function cA(r){let e=new Map;for(let t of r)e.set(t.heading,(e.get(t.heading)??0)+1);return e}a(cA,"headingCounts");function ete(r,e,t){if(e===t)return{ok:!0,body:e,warnings:[]};if(e===r)return{ok:!0,body:t,warnings:[]};if(t===r)return{ok:!0,body:e,warnings:[]};let n=[],i=R0(r),s=R0(e),o=R0(t),c=cA(i),l=cA(s),u=cA(o),f=new Set([...c.keys(),...l.keys(),...u.keys()]);for(let
|
|
345
|
+
`)}a(Zee,"joinParagraphs");function aA(r){let e=new Map,t=new Map,n=[];for(let i of r){let s=e.get(i.heading)??0;e.set(i.heading,s+1);let o=`${i.heading}\0${s}`;t.set(o,i),n.push(o)}return{keyed:t,order:n}}a(aA,"keySections");function cA(r){let e=new Map;for(let t of r)e.set(t.heading,(e.get(t.heading)??0)+1);return e}a(cA,"headingCounts");function ete(r,e,t){if(e===t)return{ok:!0,body:e,warnings:[]};if(e===r)return{ok:!0,body:t,warnings:[]};if(t===r)return{ok:!0,body:e,warnings:[]};let n=[],i=R0(r),s=R0(e),o=R0(t),c=cA(i),l=cA(s),u=cA(o),f=new Set([...c.keys(),...l.keys(),...u.keys()]);for(let ee of f){let pe=[c.get(ee)??0,l.get(ee)??0,u.get(ee)??0];if(Math.max(...pe)>1&&new Set(pe).size>1)return{ok:!1,reason:`duplicate heading "${ee||"(preamble)"}" count differs across versions \u2014 occurrence pairing unstable`}}let d=aA(i),p=aA(s),h=aA(o),_=new Map,y=[],S=new Set;for(let ee of[...d.order,...p.order,...h.order])S.has(ee)||(S.add(ee),y.push(ee));for(let ee of y){let pe=ee.slice(0,ee.lastIndexOf("\0")),Y=d.keyed.get(ee)?.text,Ee=p.keyed.get(ee)?.text,ie=h.keyed.get(ee)?.text;if(Ee===ie){Ee!==void 0&&_.set(ee,Ee);continue}if(Ee===Y){ie!==void 0&&_.set(ee,ie);continue}if(ie===Y){Ee!==void 0&&_.set(ee,Ee);continue}if(Ee===void 0||ie===void 0)return{ok:!1,reason:`section "${pe||"(preamble)"}": deleted on one side, modified on the other`};if(Y===void 0)return{ok:!1,reason:`section "${pe||"(preamble)"}": added differently on both sides`};let ne=(0,EN.diff3)(oA(Y),oA(Ee),oA(ie));if(ne.ok){_.set(ee,Zee(ne.merged));continue}let de=(0,EN.diff3)(Y.split(`
|
|
346
346
|
`),Ee.split(`
|
|
347
347
|
`),ie.split(`
|
|
348
|
-
`));if(!de.ok)return{ok:!1,reason:`section "${pe||"(preamble)"}": overlapping paragraph edits`};_.set(
|
|
349
|
-
`))}let w=a(
|
|
348
|
+
`));if(!de.ok)return{ok:!1,reason:`section "${pe||"(preamble)"}": overlapping paragraph edits`};_.set(ee,de.merged.join(`
|
|
349
|
+
`))}let w=a(ee=>ee.filter(pe=>_.has(pe)),"surviving"),T=w(d.order),O=w(p.order),A=w(h.order),x=a((ee,pe)=>ee.length===pe.length&&ee.every((Y,Ee)=>Y===pe[Ee]),"sameSeq"),P=O.filter(ee=>T.includes(ee)),V=A.filter(ee=>T.includes(ee)),j=T.filter(ee=>O.includes(ee)),$=T.filter(ee=>A.includes(ee)),K;x(P,j)?K=A:x(V,$)?K=O:(K=O,n.push("section order diverged on both sides \u2014 local order kept, remote additions appended"));let N=[],ae=new Set;for(let ee of K)_.has(ee)&&!ae.has(ee)&&(ae.add(ee),N.push(ee));for(let ee of[...O,...A])_.has(ee)&&!ae.has(ee)&&(ae.add(ee),N.push(ee));return{ok:!0,body:N.map(ee=>_.get(ee)).join(`
|
|
350
350
|
`),warnings:n}}a(ete,"mergeBody");var lA=class{static{a(this,"StructuredMerger")}constructor(e){this.codec=e}mergeAsset(e){let{path:t,base:n,local:i,remote:s}=e;if(i===void 0&&s===void 0)return{status:"conflict",reason:`${t}: gone on both sides \u2014 nothing to merge`};if(i===void 0||s===void 0)return{status:"conflict",reason:`${t}: ${i===void 0?"deleted locally, modified remotely":"modified locally, deleted remotely"} (delete-vs-modify)`};if(i===s)return{status:"merged",content:i,warnings:[]};if(n!==void 0&&i===n)return{status:"merged",content:s,warnings:[]};if(n!==void 0&&s===n)return{status:"merged",content:i,warnings:[]};let o=this.splitDoc(n??""),c=this.splitDoc(i),l=this.splitDoc(s);if(o===null||c===null||l===null)return{status:"conflict",reason:`${t}: unparseable frontmatter on ${o===null?"base":c===null?"local":"remote"} side`};let u=Qee(o.frontmatter,c.frontmatter,l.frontmatter);if(!u.ok)return{status:"conflict",reason:`${t}: ${u.reason}`};let f=Si(o.frontmatter[ap]),d=Si(c.frontmatter[ap]),p=Si(l.frontmatter[ap]),h=Si(u.value[ap]);if(f.length>0&&d.length>0&&p.length>0&&h.length===0)return{status:"conflict",reason:`${t}: cross-tombstones removed all ${ap} values \u2014 typeless merge refused`};let _=ete(o.body,c.body,l.body);if(!_.ok)return{status:"conflict",reason:`${t}: ${_.reason}`};let y=[...u.warnings,..._.warnings];if(Ma(u.value,c.frontmatter)&&_.body===c.body)return{status:"merged",content:i,warnings:y};if(Ma(u.value,l.frontmatter)&&_.body===l.body)return{status:"merged",content:s,warnings:y};let S;try{S=this.codec.stringify(u.value)}catch(T){return{status:"conflict",reason:`${t}: merged frontmatter failed to serialize (${T instanceof Error?T.message:String(T)})`}}return S.endsWith(`
|
|
351
351
|
`)||(S+=`
|
|
352
352
|
`),{status:"merged",content:`---
|
|
353
353
|
${S}---
|
|
354
354
|
${_.body}`,warnings:y}}splitDoc(e){let t=Kee.exec(e);if(!t)return{frontmatter:{},body:e};let n=e.slice(t[0].length);try{let i=this.codec.parse(t[1]);return i==null?{frontmatter:{},body:n}:typeof i!="object"||Array.isArray(i)?null:{frontmatter:i,body:n}}catch{return null}}};lp.StructuredMerger=lA});var TN=E(C0=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});C0.MergeShaclGate=void 0;var uA=F2(),tte="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function rte(r,e){let t=new Set;for(let n of r){if(n.subject.type!=="iri"||!("type"in n.predicate)||n.predicate.type!=="iri"||n.object.type!=="iri"||n.predicate.value!==e&&n.predicate.value!==tte)continue;t.add(n.subject.value);let i=(0,uA.extractUidFromIRI)(n.subject.value);i&&t.add(`uid:${i}`)}return t}a(rte,"typedSubjects");var fA=class{static{a(this,"MergeShaclGate")}constructor(e){this.deps=e}async checkMergedAsset(e,t){let n=await this.deps.triplesFor(e,t),i=this.deps.contextTriples??[],s=[...n,...i],o=(0,uA.validate)(s,this.deps.registry,this.deps.hierarchy),c=new Set;for(let p of n)p.subject.type==="iri"&&c.add(p.subject.value);let l=rte(s,this.deps.registry.typePredicateIRI),u=this.deps.isMountedRef??(p=>{if(l.has(p))return!0;let h=(0,uA.extractUidFromIRI)(p);return h!==null&&l.has(`uid:${h}`)}),f=[],d=0;for(let p of o.violations)if(c.has(p.focusNode)){if(p.constraint==="class"){if(p.actualValue!==void 0&&!u(p.actualValue)){d++;continue}f.push(p);continue}p.severity==="sh:Violation"&&f.push(p)}return{ok:f.length===0,violations:f,skippedOpenWorld:d}}};C0.MergeShaclGate=fA});var AN=E(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.GatedStructuredMerger=void 0;var dA=class{static{a(this,"GatedStructuredMerger")}constructor(e,t){this.merger=e,this.gate=t}async resolve(e){let t=this.merger.mergeAsset(e);if(t.status==="conflict")return{action:"quarantine",reason:t.reason};if(this.gate!==void 0){let n=await this.gate.checkMergedAsset(e.path,t.content);if(!n.ok)return{action:"quarantine",reason:`merged result is SHACL-invalid: ${n.violations.slice(0,3).map(s=>s.message).join("; ")}`}}return{action:"use-merged",content:t.content,warnings:t.warnings}}};O0.GatedStructuredMerger=dA});var IN=E(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.FileWatermarkStore=ju.WATERMARK_STORE_FILENAME=void 0;ju.WATERMARK_STORE_FILENAME="exosync-watermarks.local.json";function nte(r){if(r===null||typeof r!="object")return!1;let e=r;return typeof e.lastSyncedSha=="string"&&typeof e.rootTreeSha=="string"&&Array.isArray(e.files)}a(nte,"isWatermarkRecord");var pA=class{static{a(this,"FileWatermarkStore")}constructor(e){this.io=e,this.writeChain=Promise.resolve()}async get(e){let n=(await this.readRepos())[e];return nte(n)?n:null}async set(e,t){let n=this.writeChain.then(async()=>{let i=await this.readRepos();i[e]=t;let s={version:1,repos:i};await this.io.writeAtomic(JSON.stringify(s,null,2))});return this.writeChain=n.catch(()=>{}),n}async readRepos(){try{let e=await this.io.read();if(e===null)return{};let t=JSON.parse(e);if(t===null||typeof t!="object")return{};let n=t.repos;return n===null||typeof n!="object"?{}:{...n}}catch{return{}}}};ju.FileWatermarkStore=pA});var xN=E($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.FileMountBaseStore=$u.MOUNT_BASE_STORE_FILENAME=void 0;$u.MOUNT_BASE_STORE_FILENAME="exosync-mountbase.local.json";var hA=class{static{a(this,"FileMountBaseStore")}constructor(e){this.io=e,this.writeChain=Promise.resolve()}async get(e){let n=(await this.readRepos())[e];return typeof n=="string"&&n.length>0?n:null}async set(e,t){let n=this.writeChain.then(async()=>{let i=await this.readRepos();i[e]=t;let s={version:1,repos:i};await this.io.writeAtomic(JSON.stringify(s,null,2))});return this.writeChain=n.catch(()=>{}),n}async readRepos(){try{let e=await this.io.read();if(e===null)return{};let t=JSON.parse(e);if(t===null||typeof t!="object")return{};let n=t.repos;if(n===null||typeof n!="object")return{};let i={};for(let[s,o]of Object.entries(n))typeof o=="string"&&(i[s]=o);return i}catch{return{}}}};$u.FileMountBaseStore=hA});var RN=E(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.LocalConflictCacheStore=Uu.CONFLICT_CACHE_STORE_FILENAME=void 0;var ite=xl();Uu.CONFLICT_CACHE_STORE_FILENAME="exosync-conflicts.local.json";function mA(r,e){return`${r}\0${e}`}a(mA,"cacheKey");function gA(r){if(r===null||typeof r!="object")return!1;let e=r;return typeof e.repoKey=="string"&&typeof e.path=="string"&&typeof e.reason=="string"&&typeof e.quarantinedAt=="string"}a(gA,"isRecord");var yA=class{static{a(this,"LocalConflictCacheStore")}constructor(e){this.writeChain=Promise.resolve(),this.io=e.io,this.now=e.now??(()=>new Date().toISOString())}async quarantine(e){await this.quarantineAll([e])}async quarantineAll(e){e.length!==0&&await this.mutate(t=>{for(let n of e){let i=mA(n.repoKey,n.path),s=t.entries[i],o=s!==void 0&&gA(s)?s.quarantinedAt:this.now();t.entries[i]={version:1,repoKey:n.repoKey,path:n.path,...n.uid!==void 0?{uid:n.uid}:{},reason:n.reason,quarantinedAt:o,...n.baseContent!==void 0?{baseContent:n.baseContent}:{},...n.localContent!==void 0?{localContent:n.localContent}:{},...n.remoteContent!==void 0?{remoteContent:n.remoteContent}:{},...n.localContentBytes!==void 0?{localContentBytesBase64:(0,ite.bytesToBase64)(n.localContentBytes)}:{}}}})}async markResolved(e,t){let n=mA(e,t);await this.mutate(i=>{delete i.entries[n]})}async list(){let e=await this.read();return Object.values(e.entries).filter(gA)}async get(e,t){let i=(await this.read()).entries[mA(e,t)];return i!==void 0&&gA(i)?i:null}async mutate(e){let t=this.writeChain.then(async()=>{let n=await this.read();e(n),await this.io.writeAtomic(JSON.stringify(n,null,2))});return this.writeChain=t.catch(()=>{}),t}async read(){try{let e=await this.io.read();if(e===null)return{version:1,entries:{}};let t=JSON.parse(e);if(t===null||typeof t!="object")return{version:1,entries:{}};let n=t.entries;return n===null||typeof n!="object"?{version:1,entries:{}}:{version:1,entries:{...n}}}catch{return{version:1,entries:{}}}}};Uu.LocalConflictCacheStore=yA});var bA=E(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.SpaceSpecAccumulator=pn.SYNC_BRANCH=pn.ASSET_SPACE_CLASS_UID=void 0;pn.isAssetSpaceFrontmatter=PN;pn.isFileSpaceFrontmatter=DN;pn.readSpaceSource=FN;pn.parseStrictGitHubRepoURL=LN;pn.classifySpaceDeclaration=cte;var ste=Fy(),ote=Dy();pn.ASSET_SPACE_CLASS_UID="73bd00e4-ccc0-4f3f-b20d-c4388c4588fb";pn.SYNC_BRANCH="main";var CN=/\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\|[^\]]*)?\]\]/gi;function ON(r,e){let t=r.exo__Instance_class,n=Array.isArray(t)?t:[t];for(let i of n){if(typeof i!="string")continue;CN.lastIndex=0;let s;for(;(s=CN.exec(i))!==null;)if(s[1].toLowerCase()===e)return!0}return!1}a(ON,"instanceClassHasUid");function PN(r){return ON(r,pn.ASSET_SPACE_CLASS_UID)}a(PN,"isAssetSpaceFrontmatter");function DN(r){return ON(r,ste.FILE_SPACE_CLASS_UID)}a(DN,"isFileSpaceFrontmatter");function FN(r){let e=r.exo__AssetSpace_source;if(typeof e=="string"&&e.length>0)return e;let t=r.exo__AssetSpace_git;return typeof t=="string"&&t.length>0?t:null}a(FN,"readSpaceSource");var ate=/^https:\/\/github\.com\/[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/;function LN(r){if(typeof r!="string"||r.length===0||r.length>256||!ate.test(r))return null;let e=r.slice(19),[t,n,...i]=e.split("/");if(i.length>0||t===".."||n===".."||n.startsWith("."))return null;let s=n.replace(/\.git$/,"");return s.length===0?null:{owner:t,repo:s}}a(LN,"parseStrictGitHubRepoURL");function cte(r,e){let t=PN(r),n=DN(r);if(!t&&!n)return{kind:"not-space"};let i;t&&n&&(i=`declaration at ${e} carries BOTH exo__AssetSpace and exo__FileSpace classes (disjoint) \u2014 treating as AssetSpace (conservative)`);let s=t?"asset":"file",o=FN(r);if(o===null)return s==="file"?{kind:"skip",warning:`skipped FileSpace at ${e}: no exo__AssetSpace_source/_git \u2014 mount path underivable`}:{kind:"skip"};let c=o.replace(/\.git$/i,""),l=LN(c);if(l===null)return{kind:"skip",warning:`skipped AssetSpace at ${e}: source is not a plain https://github.com/<owner>/<repo> URL`};let u=(0,ote.derivePath)(c);if(u===null)return{kind:"skip",warning:`skipped AssetSpace at ${e}: cannot derive mount path from source`};let f=`${l.owner}/${l.repo}#${pn.SYNC_BRANCH}`,d=r.exo__Asset_uid,p=typeof d=="string"&&d.trim().length>0?d.trim():void 0;return{kind:"candidate",candidate:{spec:{owner:l.owner,repo:l.repo,branch:pn.SYNC_BRANCH,repoKey:f,localPath:u,...s==="file"?{spaceKind:s}:{}},spaceKind:s,...p!==void 0?{asUid:p}:{}},...i!==void 0?{warning:i}:{}}}a(cte,"classifySpaceDeclaration");var _A=class{static{a(this,"SpaceSpecAccumulator")}constructor(){this.specs=[],this.warnings=[],this.asUidByRepoKey=new Map,this.seen=new Set,this.kindByRepoKey=new Map}offer(e){let{spec:t,spaceKind:n}=e;if(this.seen.has(t.repoKey)){let i=this.kindByRepoKey.get(t.repoKey);if(i!==void 0&&i!==n&&(this.warnings.push(`repo ${t.repoKey} is declared as BOTH AssetSpace and FileSpace by different assets \u2014 treating as AssetSpace (deterministic, conservative); fix the vault (disjoint subtypes)`),i==="file")){this.kindByRepoKey.set(t.repoKey,"asset");let s=this.specs.find(o=>o.repoKey===t.repoKey);s!==void 0&&delete s.spaceKind}return null}return this.seen.add(t.repoKey),this.kindByRepoKey.set(t.repoKey,n),t}commit(e){this.specs.push(e.spec),e.asUid!==void 0&&this.asUidByRepoKey.set(e.spec.repoKey,e.asUid)}};pn.SpaceSpecAccumulator=_A});var kN=E(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.deriveAssetSpaceNamespace=NN;P0.buildAssetSpaceDescriptor=lte;var SA=bA();function NN(r){if(typeof r!="string")return null;let e=(0,SA.parseStrictGitHubRepoURL)(r.replace(/\.git$/i,""));if(e===null)return null;let t=e.repo,n=t.startsWith("exoas-")?t.slice(6):t;return n.length>0?n:null}a(NN,"deriveAssetSpaceNamespace");function lte(r){let e=typeof r.uid=="string"?r.uid.trim():"";if(e.length===0)return null;let t=typeof r.sourceUrl=="string"?r.sourceUrl.replace(/\.git$/i,""):"",n=(0,SA.parseStrictGitHubRepoURL)(t);if(n===null)return null;let i=(typeof r.namespace=="string"&&r.namespace.trim().length>0?r.namespace.trim():NN(t))??"";if(i.length===0)return null;let s=`${n.owner}/${n.repo}`,o=typeof r.createdAt=="string"&&r.createdAt.length>0?r.createdAt:new Date(0).toISOString(),c={exo__Asset_uid:e,exo__Asset_isDefinedBy:`[[${e}]]`,exo__Asset_createdAt:o,exo__Asset_updatedAt:o,exo__Instance_class:[`[[${SA.ASSET_SPACE_CLASS_UID}]]`],exo__Asset_label:s,exo__AssetSpace_source:t,exo__AssetSpace_namespace:i,aliases:[`$${i} AssetSpace`]},l=`exo__AssetSpace descriptor for \`${s}\` \u2014 registered for ExoSync (#3707). Mount path \`assetspaces/${n.owner}/${n.repo}/\`.`;return{fileName:`${e}.md`,frontmatter:c,body:l}}a(lte,"buildAssetSpaceDescriptor")});var wA=E(F0=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});F0.isFormatOnlyDrift=ute;F0.compareAssetSemantics=dte;function ute(r){return r.frontmatterEqual&&r.bodyEqual}a(ute,"isFormatOnlyDrift");var fte=/^---\r?\n([\s\S]*?)\r?\n---(?=\r?\n|$)/;function MN(r){let e=fte.exec(r);return e?{fm:e[1],body:r.slice(e[0].length)}:{fm:null,body:r}}a(MN,"splitDoc");function D0(r){if(Array.isArray(r))return`[${r.map(D0).sort().join(",")}]`;if(r!==null&&typeof r=="object"){let e=r;return`{${Object.keys(e).sort().map(n=>`${JSON.stringify(n)}:${D0(e[n])}`).join(",")}}`}return JSON.stringify(r)??"undefined"}a(D0,"canonicalise");function jN(r){return r.replace(/\r\n/g,`
|
|
355
|
-
`).replace(/\s+$/,"")}a(jN,"normaliseBody");function dte(r,e,t){let n=MN(r),i=MN(e),s;if(n.fm===null&&i.fm===null)s=!0;else if(n.fm===null||i.fm===null)s=!1;else try{s=D0(t.parse(n.fm))===D0(t.parse(i.fm))}catch{s=!1}return{frontmatterEqual:s,bodyEqual:jN(n.body)===jN(i.body)}}a(dte,"compareAssetSemantics")});var VN=E(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.ParityValidator=void 0;fp.summarizeParityRound=bte;var up=rp(),$N=ku(),pte=w0(),hte=T0(),Bu=A0(),UN=wA(),mte=50,gte=200,BN=new Set(["pending-local-edit","pending-remote-add","pending-remote-edit","pending-remote-delete","deferred-local-delete","pending-conflict","unverified-divergence"]),yte=new Set(["quarantine-pinned","format-only-drift"]);function ja(r){return r instanceof Error?r.message:String(r)}a(ja,"errMsg");function _te(r){return/HTTP 404/.test(ja(r))}a(_te,"isNotFoundError");var EA=class{static{a(this,"ParityValidator")}constructor(e){this.deps=e,this.transport=(0,hte.withRateLimitBackoff)(e.transport,e.backoff)}async captureSnapshot(e){let t=new Map,n=[],i=this.deps.redact??(s=>s);for(let s of e)try{let o=await this.deps.watermarks.get(s.repoKey);if(o===null)continue;let c=new Map(o.files.map(f=>[f.path,f.blobSha])),l=await this.readLocalSnapshot(s,s.spaceKind==="file"),u=new Map;for(let[f,d]of l.shas)c.get(f)!==d&&u.set(f,d);u.size>0&&t.set(s.repoKey,u)}catch(o){n.push(`${s.repoKey}: conservation snapshot failed (${i(ja(o))}) \u2014 no coverage this round`)}return{dirtyByRepo:t,warnings:n}}async runRound(e,t){let n=this.deps.now??(()=>new Date().toISOString()),i=this.deps.maxSemanticFetchesPerRun??gte,s=[];for(let u of e){let f=await this.checkRepo(u,t,{take:a(d=>i<d?!1:(i-=d,!0),"take")});s.push(f)}t.previousRound!=null&&t.trigger==="post-sync"&&this.escalatePersistentDivergence(s,t.previousRound,t.syncResults);let o=s.filter(u=>u.status==="checked").length,c=s.reduce((u,f)=>u+f.m1Violations.length,0),l=s.reduce((u,f)=>u+(f.status==="checked"?f.m2SemanticDiffs:0),0);return{version:1,ts:n(),trigger:t.trigger,repos:s,checkedRepos:o,m1Total:c,m2Total:l,ok:c===0&&l===0&&o>0,vacuous:o===0}}async checkRepo(e,t,n){let i=[],s=this.deps.redact??(l=>l),o=a((l,u={})=>({repoKey:e.repoKey,status:l,filesChecked:0,inParity:0,discrepancies:[],m2SemanticDiffs:0,accountedCount:0,m1Violations:[],warnings:i,...u}),"report"),c=t.syncResults?.find(l=>l.repoKey===e.repoKey);if(c?.warnings.some(l=>l.startsWith("race-window")))return o("inconclusive",{detail:"sync hit its race window (watermark not advanced) \u2014 parity deferred to the next round"});if(c?.status==="skipped-not-materialized")return o("inconclusive",{detail:"repo not fully materialized (D19) \u2014 local absence is not divergence; parity deferred to the next round"});try{let l=e.spaceKind==="file",u=await(0,up.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),f=await(0,up.getCommitInfo)(this.transport,e.owner,e.repo,u,this.deps.baseURL),d=await(0,up.getTree)(this.transport,e.owner,e.repo,f.treeSha,this.deps.baseURL),p=this.deps.maxFileBytes??Bu.DEFAULT_MAX_FILE_BYTES,h=l?Bu.isFileSpaceSyncablePath:Bu.isSyncablePath,_=new Map;for(let N of d)if(h(N.path)){if(N.size!==void 0&&N.size>p){i.push(`remote ${N.path} exceeds the ${p}-byte cap \u2014 excluded symmetrically`);continue}_.set(N.path,N)}let y=await this.readLocalSnapshot(e,l);i.push(...y.warnings);let S=await this.deps.watermarks.get(e.repoKey);if(S===null){let N=0;for(let[we,
|
|
355
|
+
`).replace(/\s+$/,"")}a(jN,"normaliseBody");function dte(r,e,t){let n=MN(r),i=MN(e),s;if(n.fm===null&&i.fm===null)s=!0;else if(n.fm===null||i.fm===null)s=!1;else try{s=D0(t.parse(n.fm))===D0(t.parse(i.fm))}catch{s=!1}return{frontmatterEqual:s,bodyEqual:jN(n.body)===jN(i.body)}}a(dte,"compareAssetSemantics")});var VN=E(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.ParityValidator=void 0;fp.summarizeParityRound=bte;var up=rp(),$N=ku(),pte=w0(),hte=T0(),Bu=A0(),UN=wA(),mte=50,gte=200,BN=new Set(["pending-local-edit","pending-remote-add","pending-remote-edit","pending-remote-delete","deferred-local-delete","pending-conflict","unverified-divergence"]),yte=new Set(["quarantine-pinned","format-only-drift"]);function ja(r){return r instanceof Error?r.message:String(r)}a(ja,"errMsg");function _te(r){return/HTTP 404/.test(ja(r))}a(_te,"isNotFoundError");var EA=class{static{a(this,"ParityValidator")}constructor(e){this.deps=e,this.transport=(0,hte.withRateLimitBackoff)(e.transport,e.backoff)}async captureSnapshot(e){let t=new Map,n=[],i=this.deps.redact??(s=>s);for(let s of e)try{let o=await this.deps.watermarks.get(s.repoKey);if(o===null)continue;let c=new Map(o.files.map(f=>[f.path,f.blobSha])),l=await this.readLocalSnapshot(s,s.spaceKind==="file"),u=new Map;for(let[f,d]of l.shas)c.get(f)!==d&&u.set(f,d);u.size>0&&t.set(s.repoKey,u)}catch(o){n.push(`${s.repoKey}: conservation snapshot failed (${i(ja(o))}) \u2014 no coverage this round`)}return{dirtyByRepo:t,warnings:n}}async runRound(e,t){let n=this.deps.now??(()=>new Date().toISOString()),i=this.deps.maxSemanticFetchesPerRun??gte,s=[];for(let u of e){let f=await this.checkRepo(u,t,{take:a(d=>i<d?!1:(i-=d,!0),"take")});s.push(f)}t.previousRound!=null&&t.trigger==="post-sync"&&this.escalatePersistentDivergence(s,t.previousRound,t.syncResults);let o=s.filter(u=>u.status==="checked").length,c=s.reduce((u,f)=>u+f.m1Violations.length,0),l=s.reduce((u,f)=>u+(f.status==="checked"?f.m2SemanticDiffs:0),0);return{version:1,ts:n(),trigger:t.trigger,repos:s,checkedRepos:o,m1Total:c,m2Total:l,ok:c===0&&l===0&&o>0,vacuous:o===0}}async checkRepo(e,t,n){let i=[],s=this.deps.redact??(l=>l),o=a((l,u={})=>({repoKey:e.repoKey,status:l,filesChecked:0,inParity:0,discrepancies:[],m2SemanticDiffs:0,accountedCount:0,m1Violations:[],warnings:i,...u}),"report"),c=t.syncResults?.find(l=>l.repoKey===e.repoKey);if(c?.warnings.some(l=>l.startsWith("race-window")))return o("inconclusive",{detail:"sync hit its race window (watermark not advanced) \u2014 parity deferred to the next round"});if(c?.status==="skipped-not-materialized")return o("inconclusive",{detail:"repo not fully materialized (D19) \u2014 local absence is not divergence; parity deferred to the next round"});try{let l=e.spaceKind==="file",u=await(0,up.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),f=await(0,up.getCommitInfo)(this.transport,e.owner,e.repo,u,this.deps.baseURL),d=await(0,up.getTree)(this.transport,e.owner,e.repo,f.treeSha,this.deps.baseURL),p=this.deps.maxFileBytes??Bu.DEFAULT_MAX_FILE_BYTES,h=l?Bu.isFileSpaceSyncablePath:Bu.isSyncablePath,_=new Map;for(let N of d)if(h(N.path)){if(N.size!==void 0&&N.size>p){i.push(`remote ${N.path} exceeds the ${p}-byte cap \u2014 excluded symmetrically`);continue}_.set(N.path,N)}let y=await this.readLocalSnapshot(e,l);i.push(...y.warnings);let S=await this.deps.watermarks.get(e.repoKey);if(S===null){let N=0;for(let[we,ee]of y.shas)_.get(we)?.blobSha===ee&&N++;let ae=new Set([...y.shas.keys(),..._.keys()]);return o("no-watermark",{filesChecked:ae.size,inParity:N,headSha:u,detail:`repo has no sync watermark on this device (${ae.size-N} raw diff(s)) \u2014 run a sync first; not counted toward M1/M2`})}let w=new Map(S.files.map(N=>[N.path,N.blobSha])),T=new Set(S.pinnedPaths??[]),{discrepancies:O,inParity:A,filesChecked:x}=await this.classifyAll(e,y,_,w,T,l,{warnings:i,runBudget:n}),P=await(0,up.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL);if(P!==u)return o("inconclusive",{headSha:u,detail:`remote head moved during the check (${u.slice(0,7)} \u2192 ${P.slice(0,7)}) \u2014 parity deferred to the next round`});let V=this.checkConservation(e,t,y,_,T,c),j=O.filter(N=>!yte.has(N.cls)).length,$=O.length-j,K;if(l){let N=[...y.shas.values()].sort().join(`
|
|
356
356
|
`),ae=[..._.values()].map(we=>we.blobSha).sort().join(`
|
|
357
357
|
`);K=N===ae}return o("checked",{filesChecked:x,inParity:A,discrepancies:O,m2SemanticDiffs:j,accountedCount:$,m1Violations:V,headSha:u,...K!==void 0?{attachmentHashSetIdentical:K}:{}})}catch(l){return(0,pte.isAuthError)(l)?o("auth-required",{detail:s(`authentication failed: ${ja(l)} \u2014 the PAT is expired, revoked or under-scoped; update it (R8)`)}):_te(l)?(i.push("repo unreachable (HTTP 404): dead AssetSpace pointer, or the fine-grained PAT does not allowlist this repo \u2014 skipped"),o("error",{detail:s(ja(l))})):(i.push(`parity check failed: ${s(ja(l))}`),o("error",{detail:s(ja(l))}))}}async readLocalSnapshot(e,t){let n=this.deps.localFilesFor(e),i=t?Bu.isFileSpaceSyncablePath:Bu.isSyncablePath,s=this.deps.maxFileBytes??Bu.DEFAULT_MAX_FILE_BYTES,o=new Map,c=new Map,l=[];if(t&&n.readBinary===void 0)throw new Error("file-mode repo requires a LocalFilesPort with readBinary \u2014 refusing to hash through the text-only port (binary would corrupt)");let u=new TextEncoder;for(let f of await n.list())if(i(f))try{if(t){let d=await n.readBinary(f);if(d.byteLength>s){l.push(`local ${f} exceeds the ${s}-byte cap \u2014 excluded symmetrically`);continue}o.set(f,await(0,$N.gitBlobSha)(d,this.deps.sha1))}else{let d=await n.read(f);if(u.encode(d).byteLength>s){l.push(`local ${f} exceeds the ${s}-byte cap \u2014 excluded symmetrically`);continue}c.set(f,d),o.set(f,await(0,$N.gitBlobSha)(d,this.deps.sha1))}}catch(d){let p=this.deps.redact??(h=>h);l.push(`local ${f} unreadable (${p(ja(d))}) \u2014 skipped`)}return{shas:o,texts:c,warnings:l}}async classifyAll(e,t,n,i,s,o,c){let l=[],u=0,f=this.deps.maxSemanticFetchesPerRepo??mte,d=new Set([...t.shas.keys(),...n.keys()]);for(let p of[...d].sort()){let h=t.shas.get(p),y=n.get(p)?.blobSha,S=i.get(p);if(h!==void 0&&y!==void 0){if(h===y){u++;continue}l.push(await this.classifyContentDiff(e,p,h,y,S,s,o,t,{...c,takeRepoFetch:a(()=>f-- >0,"takeRepoFetch")}));continue}if(h!==void 0){let w;s.has(p)?w={path:p,presence:"local-only",cls:"quarantine-pinned",localSha:h}:S===void 0?w={path:p,presence:"local-only",cls:"pending-local-add",localSha:h}:S===h?w={path:p,presence:"local-only",cls:"pending-remote-delete",localSha:h,detail:"remote deleted it; the local copy is unchanged"}:w={path:p,presence:"local-only",cls:"pending-conflict",localSha:h,detail:"remote deleted it AND the local copy was edited"},l.push(w);continue}if(y!==void 0){let w;s.has(p)?w={path:p,presence:"remote-only",cls:"quarantine-pinned",remoteSha:y}:S===void 0?w={path:p,presence:"remote-only",cls:"pending-remote-add",remoteSha:y}:S===y?w={path:p,presence:"remote-only",cls:"deferred-local-delete",remoteSha:y,detail:"locally deleted; the delete propagates on the next sync (#3476) \u2014 escalates if it survives a converged round"}:w={path:p,presence:"remote-only",cls:"pending-conflict",remoteSha:y,detail:"locally deleted AND the remote copy was edited"},l.push(w)}}return{discrepancies:l,inParity:u,filesChecked:d.size}}async classifyContentDiff(e,t,n,i,s,o,c,l,u){let f={localSha:n,remoteSha:i};if(o.has(t))return{path:t,presence:"both",cls:"quarantine-pinned",...f};if(s!==void 0&&s===n)return{path:t,presence:"both",cls:"pending-remote-edit",...f};if(s!==void 0&&s===i)return{path:t,presence:"both",cls:"pending-local-edit",...f};if(c)return{path:t,presence:"both",cls:"pending-conflict",...f,detail:"binary content differs on both sides"};if(!u.takeRepoFetch()||!u.runBudget.take(1))return u.warnings.push(`semantic-fetch cap reached \u2014 ${t} left unverified (counted into M2)`),{path:t,presence:"both",cls:"unverified-divergence",...f};let d=l.texts.get(t),p;try{p=await(0,up.getBlobText)(this.transport,e.owner,e.repo,i,this.deps.baseURL)}catch(_){let y=this.deps.redact??(S=>S);return u.warnings.push(`blob fetch for ${t} failed (${y(ja(_))}) \u2014 left unverified`),{path:t,presence:"both",cls:"unverified-divergence",...f}}let h=(0,UN.compareAssetSemantics)(d??"",p,this.deps.yaml);return(0,UN.isFormatOnlyDrift)(h)?{path:t,presence:"both",cls:"format-only-drift",...f,frontmatterEqual:!0,bodyEqual:!0}:{path:t,presence:"both",cls:"pending-conflict",...f,frontmatterEqual:h.frontmatterEqual,bodyEqual:h.bodyEqual,detail:`semantic divergence (frontmatter ${h.frontmatterEqual?"equal":"differs"}, body ${h.bodyEqual?"equal":"differs"})`}}checkConservation(e,t,n,i,s,o){let c=t.snapshot?.dirtyByRepo.get(e.repoKey);if(c===void 0||c.size===0)return[];let l=new Set(o?.mergedPaths??[]),u=new Set(o?.quarantinedPaths??[]),f=[];for(let[d,p]of c)n.shas.get(d)!==p&&i.get(d)?.blobSha!==p&&(l.has(d)||u.has(d)||s.has(d)||f.push({repoKey:e.repoKey,path:d,kind:"conservation",detail:`pre-sync dirty content ${p.slice(0,7)} survived NOWHERE: disk now ${n.shas.get(d)?.slice(0,7)??"absent"}, not in head tree, not merged/quarantined/pinned \u2014 possible lost edit`}));return f}escalatePersistentDivergence(e,t,n){for(let i of e){if(i.status!=="checked")continue;let s=n?.find(u=>u.repoKey===i.repoKey);if(s!==void 0&&s.status!=="synced")continue;let o=new Set(s?.deferredDeletes??[]),c=t.repos.find(u=>u.repoKey===i.repoKey&&u.status==="checked");if(c===void 0)continue;let l=new Map(c.discrepancies.filter(u=>BN.has(u.cls)).map(u=>[u.path,u]));for(let u of i.discrepancies){if(!BN.has(u.cls)||u.cls==="deferred-local-delete"&&o.has(u.path))continue;let f=l.get(u.path);f!==void 0&&f.localSha===u.localSha&&f.remoteSha===u.remoteSha&&i.m1Violations.push({repoKey:i.repoKey,path:u.path,kind:"persistent-divergence",detail:`identical divergence (local ${u.localSha?.slice(0,7)??"absent"}, remote ${u.remoteSha?.slice(0,7)??"absent"}) survived a sync round unchanged (${f.cls} \u2192 ${u.cls}) \u2014 the engine failed to converge it`})}}}};fp.ParityValidator=EA;function bte(r){if(r.vacuous)return`ExoSync parity: VACUOUS \u2014 0 of ${r.repos.length} repo(s) checked (errors / never synced)`;let e=r.repos.length-r.checkedRepos,t=e>0?`, ${e} skipped`:"";return r.ok?`ExoSync parity: M1=0, M2=\u2205 (${r.checkedRepos} repo(s) checked${t})`:`ExoSync parity: M1=${r.m1Total}, M2=${r.m2Total} diff(s) (${r.checkedRepos} repo(s) checked${t}) \u2014 see log`}a(bte,"summarizeParityRound")});var GN=E(qN=>{"use strict";Object.defineProperty(qN,"__esModule",{value:!0})});var dp=E(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.UID_UNIQUENESS_WHITELIST_CLASS_UIDS=kr.KNOWN_CHECK_IDS=kr.CHECK_ID_DAG_ONTOLOGY_IMPORTS=kr.CHECK_ID_UID_UNIQUENESS=kr.CHECK_ID_CO_LOCATION=kr.CHECK_ID_SHACL=void 0;kr.CHECK_ID_SHACL="f83ffedd-1f05-4ab5-839d-58873c69c4ba";kr.CHECK_ID_CO_LOCATION="61f95c82-f6fc-4b20-b06d-19f3dc1b1f12";kr.CHECK_ID_UID_UNIQUENESS="ac10db25-231c-4677-8cac-647d3cf15c64";kr.CHECK_ID_DAG_ONTOLOGY_IMPORTS="a57f4a6b-a462-4c8d-b958-0dbee4674727";kr.KNOWN_CHECK_IDS=new Set([kr.CHECK_ID_SHACL,kr.CHECK_ID_CO_LOCATION,kr.CHECK_ID_UID_UNIQUENESS,kr.CHECK_ID_DAG_ONTOLOGY_IMPORTS]);kr.UID_UNIQUENESS_WHITELIST_CLASS_UIDS=new Set(["b04e7a3e-6b49-4984-9f8d-b74e9f36818b","2b754a16-cccf-49ee-af69-a18c6d1e3b63"])});var L0=E(pp=>{"use strict";Object.defineProperty(pp,"__esModule",{value:!0});pp.readUid=Ste;pp.readIsDefinedByRef=wte;pp.readInstanceClassRefs=Ete;var WN=du();function Ste(r){let e=r.exo__Asset_uid;if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}a(Ste,"readUid");function wte(r){return(0,WN.extractAssetReference)(r.exo__Asset_isDefinedBy)}a(wte,"readIsDefinedByRef");function Ete(r){let e=r.exo__Instance_class,t=Array.isArray(e)?e:e==null?[]:[e],n=[];for(let i of t){let s=(0,WN.extractAssetReference)(i);s&&n.push(s)}return n}a(Ete,"readInstanceClassRefs")});var TA=E(vA=>{"use strict";Object.defineProperty(vA,"__esModule",{value:!0});vA.uidUniquenessCheck=Tte;var HN=L0(),vte=dp();function Tte(r){let e=new Map;for(let n of r.assets){let i=(0,HN.readUid)(n.frontmatter);if(!i||(0,HN.readInstanceClassRefs)(n.frontmatter).some(c=>vte.UID_UNIQUENESS_WHITELIST_CLASS_UIDS.has(c)))continue;let o=e.get(i);o?o.push(n.path):e.set(i,[n.path])}let t=[];for(let[n,i]of e){if(i.length<2)continue;let s=[...i].sort();for(let o of s)t.push({path:o,message:`duplicate exo__Asset_uid "${n}" \u2014 also at ${s.filter(c=>c!==o).join(", ")}`})}return t}a(Tte,"uidUniquenessCheck")});var IA=E(AA=>{"use strict";Object.defineProperty(AA,"__esModule",{value:!0});AA.coLocationCheck=Rte;var zN=L0(),Ate=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function KN(r){let e=r.lastIndexOf("/");return e<0?"":r.slice(0,e)}a(KN,"dirOf");function Ite(r){let e=r.slice(r.lastIndexOf("/")+1);return e.endsWith(".md")?e.slice(0,-3):e}a(Ite,"baseNameNoExt");function xte(r){return r.split("/").some(e=>e.toLowerCase()==="templates")}a(xte,"isTemplatesPath");function Rte(r){let e=new Map,t=new Map;for(let s of r.assets){let o=(0,zN.readUid)(s.frontmatter);o&&!e.has(o)&&e.set(o,s.path);let c=Ite(s.path);t.has(c)||t.set(c,s.path)}let n=a(s=>Ate.test(s)?e.get(s)??t.get(s):t.get(s)??e.get(s),"resolve"),i=[];for(let s of r.assets){if(s.path.split("/").includes("node_modules")||xte(s.path))continue;let o=(0,zN.readIsDefinedByRef)(s.frontmatter);if(!o||o.startsWith("!"))continue;let c=n(o);if(!c)continue;let l=KN(c),u=KN(s.path);l!==u&&i.push({path:s.path,message:`co-location: isDefinedBy=${o} expects folder "${l}/" but asset is in "${u}/"`})}return i}a(Rte,"coLocationCheck")});var RA=E(xA=>{"use strict";Object.defineProperty(xA,"__esModule",{value:!0});xA.shaclCheck=Cte;async function Cte(r){if(!r.runShacl)throw new Error("SHACL check is enabled but this context provides no triple-store (runShacl). Wire a warm getTripleStore()/runShapesValidation reader, or disable the check.");return(await r.runShacl()).map(t=>({path:t.focusNode??t.path,message:`SHACL: ${t.message}${t.path?` (path ${t.path})`:""}`}))}a(Cte,"shaclCheck")});var OA=E(CA=>{"use strict";Object.defineProperty(CA,"__esModule",{value:!0});CA.dagOntologyImportsCheck=Ote;async function Ote(r){if(!r.runDag)throw new Error("DAG ontology-imports check is enabled but this context provides no graph derivation (runDag). Wire a reader that supplies it, or disable the check.");return[...await r.runDag()]}a(Ote,"dagOntologyImportsCheck")});var PA=E(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.CheckRegistry=void 0;hp.createDefaultCheckRegistry=Nte;var N0=dp(),Pte=TA(),Dte=IA(),Fte=RA(),Lte=OA(),k0=class{static{a(this,"CheckRegistry")}constructor(){this.entries=new Map}register(e){return this.entries.set(e.id,e),this}get(e){return this.entries.get(e)}has(e){return this.entries.has(e)}ids(){return[...this.entries.keys()]}};hp.CheckRegistry=k0;function Nte(){return new k0().register({id:N0.CHECK_ID_UID_UNIQUENESS,label:"uid-uniqueness",run:Pte.uidUniquenessCheck}).register({id:N0.CHECK_ID_CO_LOCATION,label:"co-location",run:Dte.coLocationCheck}).register({id:N0.CHECK_ID_SHACL,label:"shacl",run:Fte.shaclCheck}).register({id:N0.CHECK_ID_DAG_ONTOLOGY_IMPORTS,label:"dag-ontology-imports",run:Lte.dagOntologyImportsCheck})}a(Nte,"createDefaultCheckRegistry")});var YN=E(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.VaultCheckRunner=void 0;var kte=PA(),DA=class{static{a(this,"VaultCheckRunner")}constructor(e=new kte.CheckRegistry){this.registry=e}async run(e,t){let n=await e.read();return this.runWithContext(n,t)}async runWithContext(e,t){let n=[];for(let i of t){let s=this.registry.get(i);if(!s){n.push({checkId:i,label:i,status:"error",findings:[],errorMessage:`fail-loud: enabled check-id "${i}" has no registered runner`});continue}try{let o=await s.run(e);n.push({checkId:i,label:s.label,status:o.length>0?"fail":"pass",findings:o})}catch(o){n.push({checkId:i,label:s.label,status:"error",findings:[],errorMessage:`fail-loud: check "${s.label}" threw \u2014 ${o instanceof Error?o.message:String(o)}`})}}return{totalAssets:e.assets.length,results:n,ok:n.every(i=>i.status==="pass")}}};M0.VaultCheckRunner=DA});var QN=E(FA=>{"use strict";Object.defineProperty(FA,"__esModule",{value:!0});FA.readEnabledCheckIds=$te;var Mte=dp(),jte=du();function $te(r){let e=new Set;for(let t of r){let n=(0,jte.extractAssetReference)(t.frontmatter.setting__Setting_key);if(!n||!Mte.KNOWN_CHECK_IDS.has(n))continue;let i=t.frontmatter.setting__Setting_value;(i===!0||i==="true")&&e.add(n)}return[...e]}a($te,"readEnabledCheckIds")});var ZN=E(vt=>{"use strict";var Ute=vt&&vt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),XN=vt&&vt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ute(e,r,t)};Object.defineProperty(vt,"__esModule",{value:!0});vt.readInstanceClassRefs=vt.readIsDefinedByRef=vt.readUid=vt.dagOntologyImportsCheck=vt.shaclCheck=vt.coLocationCheck=vt.uidUniquenessCheck=vt.readEnabledCheckIds=vt.VaultCheckRunner=vt.createDefaultCheckRegistry=vt.CheckRegistry=void 0;XN(GN(),vt);XN(dp(),vt);var JN=PA();Object.defineProperty(vt,"CheckRegistry",{enumerable:!0,get:a(function(){return JN.CheckRegistry},"get")});Object.defineProperty(vt,"createDefaultCheckRegistry",{enumerable:!0,get:a(function(){return JN.createDefaultCheckRegistry},"get")});var Bte=YN();Object.defineProperty(vt,"VaultCheckRunner",{enumerable:!0,get:a(function(){return Bte.VaultCheckRunner},"get")});var Vte=QN();Object.defineProperty(vt,"readEnabledCheckIds",{enumerable:!0,get:a(function(){return Vte.readEnabledCheckIds},"get")});var qte=TA();Object.defineProperty(vt,"uidUniquenessCheck",{enumerable:!0,get:a(function(){return qte.uidUniquenessCheck},"get")});var Gte=IA();Object.defineProperty(vt,"coLocationCheck",{enumerable:!0,get:a(function(){return Gte.coLocationCheck},"get")});var Wte=RA();Object.defineProperty(vt,"shaclCheck",{enumerable:!0,get:a(function(){return Wte.shaclCheck},"get")});var Hte=OA();Object.defineProperty(vt,"dagOntologyImportsCheck",{enumerable:!0,get:a(function(){return Hte.dagOntologyImportsCheck},"get")});var LA=L0();Object.defineProperty(vt,"readUid",{enumerable:!0,get:a(function(){return LA.readUid},"get")});Object.defineProperty(vt,"readIsDefinedByRef",{enumerable:!0,get:a(function(){return LA.readIsDefinedByRef},"get")});Object.defineProperty(vt,"readInstanceClassRefs",{enumerable:!0,get:a(function(){return LA.readInstanceClassRefs},"get")})});var tk=E(ek=>{"use strict";Object.defineProperty(ek,"__esModule",{value:!0})});var j0=E(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.LEGACY_SETTING_VALUE_PROPS=jt.LEGACY_SETTING_KEY_PROPS=jt.SETTING_VALUE_PROP=jt.SETTING_KEY_PROP=void 0;jt.coerceSettingValue=zte;jt.extractKeyRef=Kte;jt.readSettingValueRaw=Yte;jt.renderSettingAssetMarkdown=Xte;var rk=du();jt.SETTING_KEY_PROP="setting__Setting_key";jt.SETTING_VALUE_PROP="setting__Setting_value";jt.LEGACY_SETTING_KEY_PROPS=["exo__Setting_key"];jt.LEGACY_SETTING_VALUE_PROPS=["exo__Setting_value"];function zte(r,e){switch(r){case"boolean":{if(typeof e=="boolean")return e;if(typeof e=="string"){let t=e.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return}case"string":return typeof e=="string"?e:typeof e=="number"?String(e):void 0;case"stringList":{if(Array.isArray(e)){let t=e.filter(n=>typeof n=="string");return t.length===e.length?t:void 0}return typeof e=="string"?[e]:void 0}}}a(zte,"coerceSettingValue");function nk(r){let e=r.indexOf("#");return e===-1?r:r.slice(0,e).trim()}a(nk,"stripAnchor");function Kte(r){let e=(0,rk.extractAssetReference)(r[jt.SETTING_KEY_PROP]);if(e)return nk(e);for(let t of jt.LEGACY_SETTING_KEY_PROPS){let n=(0,rk.extractAssetReference)(r[t]);if(n)return nk(n)}return null}a(Kte,"extractKeyRef");function Yte(r){if(jt.SETTING_VALUE_PROP in r)return r[jt.SETTING_VALUE_PROP];for(let e of jt.LEGACY_SETTING_VALUE_PROPS)if(e in r)return r[e]}a(Yte,"readSettingValueRaw");function Qte(r,e){switch(r){case"boolean":return[`${jt.SETTING_VALUE_PROP}: ${e===!0?"true":"false"}`];case"string":return[`${jt.SETTING_VALUE_PROP}: ${JSON.stringify(String(e??""))}`];case"stringList":{let t=Array.isArray(e)?e:[];return t.length===0?[`${jt.SETTING_VALUE_PROP}: []`]:[`${jt.SETTING_VALUE_PROP}:`,...t.map(n=>` - ${JSON.stringify(n)}`)]}}}a(Qte,"renderValueYaml");function Xte(r,e,t,n,i){return["---",`exo__Asset_uid: ${r.settingUid}`,`exo__Asset_isDefinedBy: "[[${n}]]"`,`exo__Asset_createdAt: ${i}`,"exo__Instance_class:",` - "[[${t}]]"`,`exo__Asset_label: "Setting: ${r.field}"`,`${jt.SETTING_KEY_PROP}: "[[${r.keyUid}]]"`,...Qte(r.datatype,e),"---","",`Distributable Exocortex setting \`${r.field}\` (${r.datatype}), exported by the Settings Distribution engine (RFC f402002b, M2). Edit \`setting__Setting_value\` here or re-export to overwrite.`,""].join(`
|
|
358
|
-
`)}a(Xte,"renderSettingAssetMarkdown")});var ik=E(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.exportSettings=Jte;U0.importSettings=Zte;var $0=j0();function Jte(r,e){return r.declaredKeys().map(t=>({field:t.field,fileName:`${t.settingUid}.md`,content:(0,$0.renderSettingAssetMarkdown)(t,r.readLiveValue(t),r.settingClassUid,e.ontologyUid,e.nowIso)}))}a(Jte,"exportSettings");async function Zte(r,e){let t=new Map;for(let s of r.declaredKeys())t.set(s.keyUid,s),t.set(s.keyLabel,s);let n=[],i=[];for(let s of e){let o=(0,$0.extractKeyRef)(s.frontmatter),c=o!==null?t.get(o):void 0;if(c===void 0){i.push({path:s.path,reason:"unknown-key",detail:o??"<no setting key>"});continue}let l=(0,$0.coerceSettingValue)(c.datatype,(0,$0.readSettingValueRaw)(s.frontmatter));if(l===void 0){i.push({path:s.path,reason:"uncoercible",detail:`expected ${c.datatype}`});continue}await r.writeLiveValue(c,l),n.push(c.field)}return{applied:n,skipped:i}}a(Zte,"importSettings")});var sk=E(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID=void 0;mp.resolveDistributionOntology=ere;var NA=j0();mp.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID="ea44f996-64e5-46ce-8953-b13d21ee750d";function ere(r,e){for(let t of r){if((0,NA.extractKeyRef)(t.frontmatter)!==e)continue;let n=(0,NA.coerceSettingValue)("string",(0,NA.readSettingValueRaw)(t.frontmatter));if(typeof n=="string"){let i=n.trim();if(i.length>0)return i}}return null}a(ere,"resolveDistributionOntology")});var ak=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.PERIODIC_NOTES_DECLARED_KEYS=Zr.PERIODIC_NOTES_DATA_PATH=Zr.PERIODIC_NOTES_PLUGIN_ID=Zr.JsonConfigSettingsSource=Zr.OBSPLUGIN_SETTING_CLASS_UID=void 0;Zr.resolveConfigPath=ok;Zr.buildPeriodicNotesSource=tre;Zr.OBSPLUGIN_SETTING_CLASS_UID="01a9c996-fc2e-4e70-a22d-e6554d746c5f";function ok(r,e){let t=r;for(let n of e.split(".")){if(t===null||typeof t!="object"||!Object.prototype.hasOwnProperty.call(t,n))return;t=t[n]}return t}a(ok,"resolveConfigPath");var B0=class{static{a(this,"JsonConfigSettingsSource")}constructor(e,t,n){this.settingClassUid=e,this.keys=t,this.config=n}declaredKeys(){return this.keys}readLiveValue(e){return ok(this.config,e.field)}writeLiveValue(){return Promise.reject(new Error("obsplugin settings Import is not implemented in M4.1 (export-only) \u2014 see M4.2."))}};Zr.JsonConfigSettingsSource=B0;Zr.PERIODIC_NOTES_PLUGIN_ID="periodic-notes";Zr.PERIODIC_NOTES_DATA_PATH=`.obsidian/plugins/${Zr.PERIODIC_NOTES_PLUGIN_ID}/data.json`;Zr.PERIODIC_NOTES_DECLARED_KEYS=[{field:"daily.folder",keyUid:"6ba6a073-3ee9-4527-8958-34596e072a31",keyLabel:"obsplugin__SettingKeyPeriodicNotesDailyFolder",datatype:"string",settingUid:"2bb137e5-b2c7-4fc8-b234-60639de674a9"},{field:"daily.format",keyUid:"a8d5f2b9-ba43-49d1-a469-00d5461b7d7a",keyLabel:"obsplugin__SettingKeyPeriodicNotesDailyFormat",datatype:"string",settingUid:"6ed5cfdf-551b-49bc-a467-56756b822da5"},{field:"daily.template",keyUid:"524d639d-4c63-4c73-a9c5-cca2c057a380",keyLabel:"obsplugin__SettingKeyPeriodicNotesDailyTemplate",datatype:"string",settingUid:"5430a6c5-6be5-483e-bb94-d740d6dd2541"},{field:"daily.enabled",keyUid:"7314ec27-e1ec-4987-8101-76273d0a789f",keyLabel:"obsplugin__SettingKeyPeriodicNotesDailyEnabled",datatype:"boolean",settingUid:"411646dd-1a87-40d8-853d-01c37af7fb2c"}];function tre(r){return new B0(Zr.OBSPLUGIN_SETTING_CLASS_UID,Zr.PERIODIC_NOTES_DECLARED_KEYS,r)}a(tre,"buildPeriodicNotesSource")});var uk=E(et=>{"use strict";var rre=et&&et.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),nre=et&&et.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rre(e,r,t)};Object.defineProperty(et,"__esModule",{value:!0});et.resolveConfigPath=et.buildPeriodicNotesSource=et.JsonConfigSettingsSource=et.PERIODIC_NOTES_DECLARED_KEYS=et.PERIODIC_NOTES_DATA_PATH=et.PERIODIC_NOTES_PLUGIN_ID=et.OBSPLUGIN_SETTING_CLASS_UID=et.resolveDistributionOntology=et.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID=et.importSettings=et.exportSettings=et.renderSettingAssetMarkdown=et.readSettingValueRaw=et.extractKeyRef=et.coerceSettingValue=et.LEGACY_SETTING_VALUE_PROPS=et.LEGACY_SETTING_KEY_PROPS=et.SETTING_VALUE_PROP=et.SETTING_KEY_PROP=void 0;nre(tk(),et);var $a=j0();Object.defineProperty(et,"SETTING_KEY_PROP",{enumerable:!0,get:a(function(){return $a.SETTING_KEY_PROP},"get")});Object.defineProperty(et,"SETTING_VALUE_PROP",{enumerable:!0,get:a(function(){return $a.SETTING_VALUE_PROP},"get")});Object.defineProperty(et,"LEGACY_SETTING_KEY_PROPS",{enumerable:!0,get:a(function(){return $a.LEGACY_SETTING_KEY_PROPS},"get")});Object.defineProperty(et,"LEGACY_SETTING_VALUE_PROPS",{enumerable:!0,get:a(function(){return $a.LEGACY_SETTING_VALUE_PROPS},"get")});Object.defineProperty(et,"coerceSettingValue",{enumerable:!0,get:a(function(){return $a.coerceSettingValue},"get")});Object.defineProperty(et,"extractKeyRef",{enumerable:!0,get:a(function(){return $a.extractKeyRef},"get")});Object.defineProperty(et,"readSettingValueRaw",{enumerable:!0,get:a(function(){return $a.readSettingValueRaw},"get")});Object.defineProperty(et,"renderSettingAssetMarkdown",{enumerable:!0,get:a(function(){return $a.renderSettingAssetMarkdown},"get")});var ck=ik();Object.defineProperty(et,"exportSettings",{enumerable:!0,get:a(function(){return ck.exportSettings},"get")});Object.defineProperty(et,"importSettings",{enumerable:!0,get:a(function(){return ck.importSettings},"get")});var lk=sk();Object.defineProperty(et,"EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID",{enumerable:!0,get:a(function(){return lk.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID},"get")});Object.defineProperty(et,"resolveDistributionOntology",{enumerable:!0,get:a(function(){return lk.resolveDistributionOntology},"get")});var Qc=ak();Object.defineProperty(et,"OBSPLUGIN_SETTING_CLASS_UID",{enumerable:!0,get:a(function(){return Qc.OBSPLUGIN_SETTING_CLASS_UID},"get")});Object.defineProperty(et,"PERIODIC_NOTES_PLUGIN_ID",{enumerable:!0,get:a(function(){return Qc.PERIODIC_NOTES_PLUGIN_ID},"get")});Object.defineProperty(et,"PERIODIC_NOTES_DATA_PATH",{enumerable:!0,get:a(function(){return Qc.PERIODIC_NOTES_DATA_PATH},"get")});Object.defineProperty(et,"PERIODIC_NOTES_DECLARED_KEYS",{enumerable:!0,get:a(function(){return Qc.PERIODIC_NOTES_DECLARED_KEYS},"get")});Object.defineProperty(et,"JsonConfigSettingsSource",{enumerable:!0,get:a(function(){return Qc.JsonConfigSettingsSource},"get")});Object.defineProperty(et,"buildPeriodicNotesSource",{enumerable:!0,get:a(function(){return Qc.buildPeriodicNotesSource},"get")});Object.defineProperty(et,"resolveConfigPath",{enumerable:!0,get:a(function(){return Qc.resolveConfigPath},"get")})});var it=E(g=>{"use strict";var ire=g&&g.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Xn=g&&g.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ire(e,r,t)};Object.defineProperty(g,"__esModule",{value:!0});g.createVaultFrontmatterClassLabelResolver=g.ServiceRegistry=g.GroundingExecutor=g.registerDefaultHostFunctions=g.hasUidFilename=g.hasNonUidFilename=g.PreconditionEvaluator=g.CommandResolver=g.extractPropertyLabel=g.uriToPropertyName=g.propertyNameToUri=g.rangeToFieldType=g.PropertyFieldType=g.transitiveDependsOnClosure=g.isTsFloorMountPath=g.isTsFloorAssetSpace=g.assertTsFloorReconciled=g.assertTsFloor=g.TsFloorViolationError=g.CATALOG_KEEP_NAMESPACES=g.PLUGIN_UI_FLOOR=g.SDK_FLOOR=g.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=g.SDK_FLOOR_ASSETSPACE_UIDS=g.TS_FLOOR_AS_UID_SHARED_IDENTITIES=g.TS_FLOOR_AS_UID_EXOCMD=g.TS_FLOOR_AS_UID_EXO=g.parseGroundingDefinitionFromFrontmatter=g.isCommandBindingFrontmatter=g.isGroundingFrontmatter=g.isPreconditionFrontmatter=g.isCommandFrontmatter=g.isStyleSource=g.isLabelClass=g.isCommandVariant=g.STYLE_SOURCE_VALUES=g.LABEL_CLASS_VALUES=g.COMMAND_VARIANT_VALUES=g.CommandBindingStyleProperty=g.CommandBindingProperty=g.GroundingProperty=g.PreconditionProperty=g.CommandProperty=g.resolveGroundingTypeFromWikilinkLiteral=g.resolveGroundingTypeFromIRI=g.GROUNDING_TYPE_IRI_TO_ENUM=g.GROUNDING_TYPE_UID_TO_ENUM=g.GROUNDING_TYPE_UIDS=g.GroundingType=g.EFFORT_STATUS_OPTIONS=void 0;g.GraphQueryService=g.FixMissingLabelService=g.ArchiveAssetService=g.GenericAssetCreationService=g.URIConstructionService=g.SessionEventService=g.AssetConversionService=g.EnumValueResolver=g.ClassHierarchyResolver=g.PropertySchemaResolver=g.PlanningService=g.AlgorithmExtractor=g.orderProperties=g.loadDefaultSpec=g.clearOrderSpecLoader=g.registerOrderSpecLoader=g.DynamicFrontmatterGenerator=g.SupervisionCreationService=g.StatusTimestampService=g.RenameToUidService=g.PropertyCleanupService=g.LoggingService=g.extractAssetReference=g.FolderRepairService=g.EffortVotingService=g.WorkflowCommandAdapter=g.VisibilityGenerator=g.InstantiationRuleResolver=g.stripTemplateFrontmatter=g.resolveTemplateBody=g.getRegisteredResolverIds=g.clearResolvers=g.registerResolver=g.getResolver=g.installDefaultResolvers=g.WorkflowResolver=g.WorkflowEngine=g.EffortStatusWorkflow=g.ConceptCreationService=g.ClassCreationService=g.AreaHierarchyBuilder=g.AreaCreationService=g.TaskStatusService=g.createTripleStoreRequiredPropertyResolver=g.CommandExecutionFlow=g.stripFrontmatter=g.extractSparqlBlock=g.iriToObsidianName=g.NamedQueryRunner=g.createVaultFrontmatterRefToFolderResolver=void 0;g.AlgebraTranslator=g.ExoQLAlgebraTranslator=g.DescribeOptionsTransformerError=g.DescribeOptionsTransformer=g.SPARQLParseError=g.SPARQLParser=g.ExoQLParser=g.isPathExcluded=g.normaliseExcludedFolders=g.NoteToRDFConverter=g.SOURCE_VARIABLE=g.SourceAnnotator=g.MAX_LAZY_DEPTH=g.LazyAssetGraphLoader=g.FILE_SPACE_CLASS_UID=g.frontmatterDeclaresFileSpace=g.discoverFileSpaceExclusions=g.deriveLegacyFlatPath=g.deriveUrl=g.derivePath=g.IRICanonicalizer=g.INFERRED_GRAPH=g.PrototypeChainMaterializer=g.PropertyCardinalityRegistry=g.NonInheritablePropertyRegistry=g.RDFSInferenceEngine=g.RDFVocabularyMapper=g.DomainTriple=g.DomainBlankNode=g.DomainLiteral=g.DomainIRI=g.InMemoryTripleStore=g.OBSIDIAN_VAULT_SCHEME=g.iriToVaultPath=g.vaultPathToIRI=g.NullLogger=g.RDFSerializer=g.FilenameValidator=g.EffortSortingHelpers=g.MetadataExtractor=g.MetadataHelpers=g.WikiLinkHelpers=g.DateFormatter=g.parseYamlFrontmatterTolerant=g.serializeYamlScalar=g.FrontmatterService=g.CriticalityZoneUUIDs=g.CriticalityZoneService=g.SPARQL_PREFIXES=g.TypeRegistry=void 0;g.DEFAULT_FLEETING_NOTE_CLASS_UID=g.DEFAULT_INBOX_FOLDER=g.DEFAULT_OWNER_IDENTITY=g.VaultSettings=g.seededUidGenerator=g.liveUidGenerator=g.frozenClock=g.liveClock=g.TransactionError=g.TripleNotFoundError=g.TripleAlreadyExistsError=g.FileAlreadyExistsError=g.FileNotFoundError=g.FilterContainsOptimizer=g.VaultPrefixTransformer=g.CaseWhenTransformerError=g.CaseWhenTransformer=g.ResultSerializer=g.createIncrementalIndexer=g.IncrementalIndexer=g.createSPARQLResultCache=g.SPARQLResultCache=g.QueryPlanCache=g.createDoubleLiteral=g.createDecimalLiteral=g.getNumericValue=g.createPercentileAggregate=g.modeAggregate=g.stddevAggregate=g.varianceAggregate=g.medianAggregate=g.EXO_AGGREGATE_NS=g.BUILT_IN_AGGREGATES=g.CustomAggregateError=g.CustomAggregateRegistry=g.AggregateFunctions=g.BuiltInFunctions=g.SolutionMapping=g.UpdateExecutorError=g.UpdateExecutor=g.QueryExecutor=g.ExoQLQueryExecutor=g.DescribeExecutor=g.ConstructExecutor=g.UnionExecutor=g.OptionalExecutor=g.FilterExecutor=g.BGPExecutor=g.AlgebraSerializer=g.AlgebraOptimizer=void 0;g.parseTarball=g.TripleClassHierarchy=g.ShaclShapeRegistry=g.shaclValidate=g.Namespace=g.ShapeRegistry=g.ShapeLoader=g.selectByPriority=g.LayoutSelector=g.partitionDailyEffortsByClass=g.EMS_PROJECT_CLASS_UID=g.EMS_ACTION_CLASS_UID=g.resolveDailyEffortVisibility=g.resolveBlockVisibility=g.coerceVisibilityOverride=g.DAILY_EFFORTS_OVERRIDE_KEYS=g.BUILTIN_DAILY_EFFORTS_VISIBILITY=g.isPropertiesBlock=g.isLayoutBlockFrontmatter=g.isDailyEffortsByClassBlock=g.isBacklinksTableBlock=g.createLayoutBlockFromFrontmatter=g.PROPERTIES_BLOCK_CLASS_UID=g.PROPERTIES_BLOCK_CLASS_IRI=g.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_UID=g.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_IRI=g.BACKLINKS_TABLE_BLOCK_CLASS_UID=g.BACKLINKS_TABLE_BLOCK_CLASS_IRI=g.isLayoutFrontmatter=g.isLayout=g.createLayoutFromFrontmatter=g.LAYOUT_CLASS_UID=g.LAYOUT_CLASS_IRI=g.ExoQLError=g.ExoQL=g.createStreamingSource=g.StreamingLoader=g.resetGlobalPool=g.getGlobalPool=g.MemoryPool=g.CompactGraphStore=g.StringTable=g.DEFAULT_COLORS=g.NODE_FLAGS=g.container=g.resetContainer=g.getContainer=g.createChildContainer=g.registerCoreServices=g.DI_TOKENS=void 0;g.StructuredMerger=g.diff3=g.LOCAL_MANIFEST_STORE_FILENAME=g.FileLocalManifestStore=g.isSyncablePath=g.isFileSpaceSyncablePath=g.contentEquals=g.InMemoryQuarantineStore=g.DEFAULT_MAX_FILE_BYTES=g.backupPathFor=g.QuarantineResolver=g.formatRepoTimings=g.formatTimingsLine=g.fmtMs=g.dominantPhase=g.totalMs=g.aggregateTimings=g.addTimings=g.emptyTimings=g.classifyRestPhase=g.SYNC_PHASES=g.SyncPhaseTimer=g.syncProgressPhaseText=g.orderChildrenFirst=g.isNonFastForwardError=g.SyncEngine=g.DEFAULT_LOCAL_MANIFEST_REHASH_MS=g.DEFAULT_MAX_PUSH_RETRIES=g.getTree=g.getHeadSha=g.getCommitInfo=g.getBlobText=g.getBlobBytes=g.planDuplicateUidFix=g.findDuplicateUidGroups=g.rewriteAssetUid=g.gitBlobSha=g.extractAssetUid=g.detectChanges=g.MATERIALIZE_PROGRESS_MIN_FILES=g.MATERIALIZE_PROGRESS_INTERVAL=g.escapeGitmodulesRegex=g.stripGitmodulesEntry=g.appendGitmodulesEntry=g.extractAssetSpaceSha=g.discoverAssetSpaceWrapperDir=g.mountAssetSpaceFiles=g.isBinaryPayload=g.restCreateCommit=g.parseTarballGzip=void 0;g.isFormatOnlyDrift=g.compareAssetSemantics=g.summarizeParityRound=g.ParityValidator=g.deriveAssetSpaceNamespace=g.buildAssetSpaceDescriptor=g.readSpaceSource=g.parseStrictGitHubRepoURL=g.isFileSpaceFrontmatter=g.isAssetSpaceFrontmatter=g.classifySpaceDeclaration=g.SpaceSpecAccumulator=g.SYNC_BRANCH=g.ASSET_SPACE_CLASS_UID=g.OUTBOX_REMOTE_ABSENT=g.OUTBOX_STORE_FILENAME=g.LocalOutboxStore=g.CONFLICT_CACHE_STORE_FILENAME=g.LocalConflictCacheStore=g.scanForSecrets=g.redactSecrets=g.withRateLimitBackoff=g.isRateLimitError=g.isAuthError=g.MOUNT_BASE_STORE_FILENAME=g.FileMountBaseStore=g.WATERMARK_STORE_FILENAME=g.FileWatermarkStore=g.GatedStructuredMerger=g.MergeShaclGate=g.splitSections=void 0;Xn(hc(),g);Xn(El(),g);var sre=oS();Object.defineProperty(g,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return sre.EFFORT_STATUS_OPTIONS},"get")});var ore=da();Object.defineProperty(g,"GroundingType",{enumerable:!0,get:a(function(){return ore.GroundingType},"get")});var gp=Bf();Object.defineProperty(g,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return gp.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(g,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return gp.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(g,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return gp.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(g,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return gp.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(g,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return gp.resolveGroundingTypeFromWikilinkLiteral},"get")});var yp=aS();Object.defineProperty(g,"CommandProperty",{enumerable:!0,get:a(function(){return yp.CommandProperty},"get")});Object.defineProperty(g,"PreconditionProperty",{enumerable:!0,get:a(function(){return yp.PreconditionProperty},"get")});Object.defineProperty(g,"GroundingProperty",{enumerable:!0,get:a(function(){return yp.GroundingProperty},"get")});Object.defineProperty(g,"CommandBindingProperty",{enumerable:!0,get:a(function(){return yp.CommandBindingProperty},"get")});Object.defineProperty(g,"CommandBindingStyleProperty",{enumerable:!0,get:a(function(){return yp.CommandBindingStyleProperty},"get")});var Vu=cS();Object.defineProperty(g,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:a(function(){return Vu.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(g,"LABEL_CLASS_VALUES",{enumerable:!0,get:a(function(){return Vu.LABEL_CLASS_VALUES},"get")});Object.defineProperty(g,"STYLE_SOURCE_VALUES",{enumerable:!0,get:a(function(){return Vu.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(g,"isCommandVariant",{enumerable:!0,get:a(function(){return Vu.isCommandVariant},"get")});Object.defineProperty(g,"isLabelClass",{enumerable:!0,get:a(function(){return Vu.isLabelClass},"get")});Object.defineProperty(g,"isStyleSource",{enumerable:!0,get:a(function(){return Vu.isStyleSource},"get")});var V0=lC();Object.defineProperty(g,"isCommandFrontmatter",{enumerable:!0,get:a(function(){return V0.isCommandFrontmatter},"get")});Object.defineProperty(g,"isPreconditionFrontmatter",{enumerable:!0,get:a(function(){return V0.isPreconditionFrontmatter},"get")});Object.defineProperty(g,"isGroundingFrontmatter",{enumerable:!0,get:a(function(){return V0.isGroundingFrontmatter},"get")});Object.defineProperty(g,"isCommandBindingFrontmatter",{enumerable:!0,get:a(function(){return V0.isCommandBindingFrontmatter},"get")});var are=uC();Object.defineProperty(g,"parseGroundingDefinitionFromFrontmatter",{enumerable:!0,get:a(function(){return are.parseGroundingDefinitionFromFrontmatter},"get")});Xn(fC(),g);Xn(dC(),g);Xn(fS(),g);Xn(dS(),g);Xn(hC(),g);Xn(yC(),g);Xn(zS(),g);Xn(QC(),g);var ai=XC();Object.defineProperty(g,"TS_FLOOR_AS_UID_EXO",{enumerable:!0,get:a(function(){return ai.TS_FLOOR_AS_UID_EXO},"get")});Object.defineProperty(g,"TS_FLOOR_AS_UID_EXOCMD",{enumerable:!0,get:a(function(){return ai.TS_FLOOR_AS_UID_EXOCMD},"get")});Object.defineProperty(g,"TS_FLOOR_AS_UID_SHARED_IDENTITIES",{enumerable:!0,get:a(function(){return ai.TS_FLOOR_AS_UID_SHARED_IDENTITIES},"get")});Object.defineProperty(g,"SDK_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return ai.SDK_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(g,"PLUGIN_UI_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return ai.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(g,"SDK_FLOOR",{enumerable:!0,get:a(function(){return ai.SDK_FLOOR},"get")});Object.defineProperty(g,"PLUGIN_UI_FLOOR",{enumerable:!0,get:a(function(){return ai.PLUGIN_UI_FLOOR},"get")});Object.defineProperty(g,"CATALOG_KEEP_NAMESPACES",{enumerable:!0,get:a(function(){return ai.CATALOG_KEEP_NAMESPACES},"get")});Object.defineProperty(g,"TsFloorViolationError",{enumerable:!0,get:a(function(){return ai.TsFloorViolationError},"get")});Object.defineProperty(g,"assertTsFloor",{enumerable:!0,get:a(function(){return ai.assertTsFloor},"get")});Object.defineProperty(g,"assertTsFloorReconciled",{enumerable:!0,get:a(function(){return ai.assertTsFloorReconciled},"get")});Object.defineProperty(g,"isTsFloorAssetSpace",{enumerable:!0,get:a(function(){return ai.isTsFloorAssetSpace},"get")});Object.defineProperty(g,"isTsFloorMountPath",{enumerable:!0,get:a(function(){return ai.isTsFloorMountPath},"get")});var cre=JC();Object.defineProperty(g,"transitiveDependsOnClosure",{enumerable:!0,get:a(function(){return cre.transitiveDependsOnClosure},"get")});var fk=om();Object.defineProperty(g,"PropertyFieldType",{enumerable:!0,get:a(function(){return fk.PropertyFieldType},"get")});Object.defineProperty(g,"rangeToFieldType",{enumerable:!0,get:a(function(){return fk.rangeToFieldType},"get")});var kA=XS();Object.defineProperty(g,"propertyNameToUri",{enumerable:!0,get:a(function(){return kA.propertyNameToUri},"get")});Object.defineProperty(g,"uriToPropertyName",{enumerable:!0,get:a(function(){return kA.uriToPropertyName},"get")});Object.defineProperty(g,"extractPropertyLabel",{enumerable:!0,get:a(function(){return kA.extractPropertyLabel},"get")});var lre=UP();Object.defineProperty(g,"CommandResolver",{enumerable:!0,get:a(function(){return lre.CommandResolver},"get")});var ure=VP();Object.defineProperty(g,"PreconditionEvaluator",{enumerable:!0,get:a(function(){return ure.PreconditionEvaluator},"get")});var MA=qP();Object.defineProperty(g,"hasNonUidFilename",{enumerable:!0,get:a(function(){return MA.hasNonUidFilename},"get")});Object.defineProperty(g,"hasUidFilename",{enumerable:!0,get:a(function(){return MA.hasUidFilename},"get")});Object.defineProperty(g,"registerDefaultHostFunctions",{enumerable:!0,get:a(function(){return MA.registerDefaultHostFunctions},"get")});var dk=ZP();Object.defineProperty(g,"GroundingExecutor",{enumerable:!0,get:a(function(){return dk.GroundingExecutor},"get")});Object.defineProperty(g,"ServiceRegistry",{enumerable:!0,get:a(function(){return dk.ServiceRegistry},"get")});var fre=e3();Object.defineProperty(g,"createVaultFrontmatterClassLabelResolver",{enumerable:!0,get:a(function(){return fre.createVaultFrontmatterClassLabelResolver},"get")});var dre=t3();Object.defineProperty(g,"createVaultFrontmatterRefToFolderResolver",{enumerable:!0,get:a(function(){return dre.createVaultFrontmatterRefToFolderResolver},"get")});var pre=n3();Object.defineProperty(g,"NamedQueryRunner",{enumerable:!0,get:a(function(){return pre.NamedQueryRunner},"get")});var hre=od();Object.defineProperty(g,"iriToObsidianName",{enumerable:!0,get:a(function(){return hre.iriToObsidianName},"get")});var pk=i3();Object.defineProperty(g,"extractSparqlBlock",{enumerable:!0,get:a(function(){return pk.extractSparqlBlock},"get")});Object.defineProperty(g,"stripFrontmatter",{enumerable:!0,get:a(function(){return pk.stripFrontmatter},"get")});var mre=o3();Object.defineProperty(g,"CommandExecutionFlow",{enumerable:!0,get:a(function(){return mre.CommandExecutionFlow},"get")});var gre=l3();Object.defineProperty(g,"createTripleStoreRequiredPropertyResolver",{enumerable:!0,get:a(function(){return gre.createTripleStoreRequiredPropertyResolver},"get")});var yre=PE();Object.defineProperty(g,"TaskStatusService",{enumerable:!0,get:a(function(){return yre.TaskStatusService},"get")});var _re=NE();Object.defineProperty(g,"AreaCreationService",{enumerable:!0,get:a(function(){return _re.AreaCreationService},"get")});var bre=ME();Object.defineProperty(g,"AreaHierarchyBuilder",{enumerable:!0,get:a(function(){return bre.AreaHierarchyBuilder},"get")});var Sre=qE();Object.defineProperty(g,"ClassCreationService",{enumerable:!0,get:a(function(){return Sre.ClassCreationService},"get")});var wre=WE();Object.defineProperty(g,"ConceptCreationService",{enumerable:!0,get:a(function(){return wre.ConceptCreationService},"get")});var Ere=ry();Object.defineProperty(g,"EffortStatusWorkflow",{enumerable:!0,get:a(function(){return Ere.EffortStatusWorkflow},"get")});var vre=Rd();Object.defineProperty(g,"WorkflowEngine",{enumerable:!0,get:a(function(){return vre.WorkflowEngine},"get")});var Tre=bE();Object.defineProperty(g,"WorkflowResolver",{enumerable:!0,get:a(function(){return Tre.WorkflowResolver},"get")});var _p=kg();Object.defineProperty(g,"installDefaultResolvers",{enumerable:!0,get:a(function(){return _p.installDefaultResolvers},"get")});Object.defineProperty(g,"getResolver",{enumerable:!0,get:a(function(){return _p.getResolver},"get")});Object.defineProperty(g,"registerResolver",{enumerable:!0,get:a(function(){return _p.registerResolver},"get")});Object.defineProperty(g,"clearResolvers",{enumerable:!0,get:a(function(){return _p.clearResolvers},"get")});Object.defineProperty(g,"getRegisteredResolverIds",{enumerable:!0,get:a(function(){return _p.getRegisteredResolverIds},"get")});var hk=iE();Object.defineProperty(g,"resolveTemplateBody",{enumerable:!0,get:a(function(){return hk.resolveTemplateBody},"get")});Object.defineProperty(g,"stripTemplateFrontmatter",{enumerable:!0,get:a(function(){return hk.stripTemplateFrontmatter},"get")});var Are=I3();Object.defineProperty(g,"InstantiationRuleResolver",{enumerable:!0,get:a(function(){return Are.InstantiationRuleResolver},"get")});var Ire=x3();Object.defineProperty(g,"VisibilityGenerator",{enumerable:!0,get:a(function(){return Ire.VisibilityGenerator},"get")});var xre=R3();Object.defineProperty(g,"WorkflowCommandAdapter",{enumerable:!0,get:a(function(){return xre.WorkflowCommandAdapter},"get")});var Rre=JE();Object.defineProperty(g,"EffortVotingService",{enumerable:!0,get:a(function(){return Rre.EffortVotingService},"get")});var Cre=ay();Object.defineProperty(g,"FolderRepairService",{enumerable:!0,get:a(function(){return Cre.FolderRepairService},"get")});var Ore=du();Object.defineProperty(g,"extractAssetReference",{enumerable:!0,get:a(function(){return Ore.extractAssetReference},"get")});var Pre=xa();Object.defineProperty(g,"LoggingService",{enumerable:!0,get:a(function(){return Pre.LoggingService},"get")});var Dre=tv();Object.defineProperty(g,"PropertyCleanupService",{enumerable:!0,get:a(function(){return Dre.PropertyCleanupService},"get")});var Fre=nv();Object.defineProperty(g,"RenameToUidService",{enumerable:!0,get:a(function(){return Fre.RenameToUidService},"get")});var Lre=iy();Object.defineProperty(g,"StatusTimestampService",{enumerable:!0,get:a(function(){return Lre.StatusTimestampService},"get")});var Nre=ov();Object.defineProperty(g,"SupervisionCreationService",{enumerable:!0,get:a(function(){return Nre.SupervisionCreationService},"get")});var kre=cv();Object.defineProperty(g,"DynamicFrontmatterGenerator",{enumerable:!0,get:a(function(){return kre.DynamicFrontmatterGenerator},"get")});var q0=wd();Object.defineProperty(g,"registerOrderSpecLoader",{enumerable:!0,get:a(function(){return q0.registerOrderSpecLoader},"get")});Object.defineProperty(g,"clearOrderSpecLoader",{enumerable:!0,get:a(function(){return q0.clearOrderSpecLoader},"get")});Object.defineProperty(g,"loadDefaultSpec",{enumerable:!0,get:a(function(){return q0.loadDefaultSpec},"get")});Object.defineProperty(g,"orderProperties",{enumerable:!0,get:a(function(){return q0.orderProperties},"get")});var Mre=uv();Object.defineProperty(g,"AlgorithmExtractor",{enumerable:!0,get:a(function(){return Mre.AlgorithmExtractor},"get")});var jre=dv();Object.defineProperty(g,"PlanningService",{enumerable:!0,get:a(function(){return jre.PlanningService},"get")});var $re=j3();Object.defineProperty(g,"PropertySchemaResolver",{enumerable:!0,get:a(function(){return $re.PropertySchemaResolver},"get")});var Ure=$3();Object.defineProperty(g,"ClassHierarchyResolver",{enumerable:!0,get:a(function(){return Ure.ClassHierarchyResolver},"get")});var Bre=U3();Object.defineProperty(g,"EnumValueResolver",{enumerable:!0,get:a(function(){return Bre.EnumValueResolver},"get")});var Vre=yv();Object.defineProperty(g,"AssetConversionService",{enumerable:!0,get:a(function(){return Vre.AssetConversionService},"get")});var qre=Sv();Object.defineProperty(g,"SessionEventService",{enumerable:!0,get:a(function(){return qre.SessionEventService},"get")});var Gre=vv();Object.defineProperty(g,"URIConstructionService",{enumerable:!0,get:a(function(){return Gre.URIConstructionService},"get")});var Wre=Av();Object.defineProperty(g,"GenericAssetCreationService",{enumerable:!0,get:a(function(){return Wre.GenericAssetCreationService},"get")});var Hre=Q3();Object.defineProperty(g,"ArchiveAssetService",{enumerable:!0,get:a(function(){return Hre.ArchiveAssetService},"get")});var zre=J3();Object.defineProperty(g,"FixMissingLabelService",{enumerable:!0,get:a(function(){return zre.FixMissingLabelService},"get")});var Kre=Z3();Object.defineProperty(g,"GraphQueryService",{enumerable:!0,get:a(function(){return Kre.GraphQueryService},"get")});var Yre=tD();Object.defineProperty(g,"TypeRegistry",{enumerable:!0,get:a(function(){return Yre.TypeRegistry},"get")});var Qre=rD();Object.defineProperty(g,"SPARQL_PREFIXES",{enumerable:!0,get:a(function(){return Qre.SPARQL_PREFIXES},"get")});var mk=Pv();Object.defineProperty(g,"CriticalityZoneService",{enumerable:!0,get:a(function(){return mk.CriticalityZoneService},"get")});Object.defineProperty(g,"CriticalityZoneUUIDs",{enumerable:!0,get:a(function(){return mk.CriticalityZoneUUIDs},"get")});var Xre=Fs();Object.defineProperty(g,"FrontmatterService",{enumerable:!0,get:a(function(){return Xre.FrontmatterService},"get")});var Jre=Ed();Object.defineProperty(g,"serializeYamlScalar",{enumerable:!0,get:a(function(){return Jre.serializeYamlScalar},"get")});var Zre=vF();Object.defineProperty(g,"parseYamlFrontmatterTolerant",{enumerable:!0,get:a(function(){return Zre.parseYamlFrontmatterTolerant},"get")});var ene=on();Object.defineProperty(g,"DateFormatter",{enumerable:!0,get:a(function(){return ene.DateFormatter},"get")});var tne=xs();Object.defineProperty(g,"WikiLinkHelpers",{enumerable:!0,get:a(function(){return tne.WikiLinkHelpers},"get")});var rne=Ro();Object.defineProperty(g,"MetadataHelpers",{enumerable:!0,get:a(function(){return rne.MetadataHelpers},"get")});var nne=FE();Object.defineProperty(g,"MetadataExtractor",{enumerable:!0,get:a(function(){return nne.MetadataExtractor},"get")});var ine=TF();Object.defineProperty(g,"EffortSortingHelpers",{enumerable:!0,get:a(function(){return ine.EffortSortingHelpers},"get")});var sne=AF();Object.defineProperty(g,"FilenameValidator",{enumerable:!0,get:a(function(){return sne.FilenameValidator},"get")});var one=DF();Object.defineProperty(g,"RDFSerializer",{enumerable:!0,get:a(function(){return one.RDFSerializer},"get")});var ane=Al();Object.defineProperty(g,"NullLogger",{enumerable:!0,get:a(function(){return ane.NullLogger},"get")});var jA=wT();Object.defineProperty(g,"vaultPathToIRI",{enumerable:!0,get:a(function(){return jA.vaultPathToIRI},"get")});Object.defineProperty(g,"iriToVaultPath",{enumerable:!0,get:a(function(){return jA.iriToVaultPath},"get")});Object.defineProperty(g,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:a(function(){return jA.OBSIDIAN_VAULT_SCHEME},"get")});var cne=xE();Object.defineProperty(g,"InMemoryTripleStore",{enumerable:!0,get:a(function(){return cne.InMemoryTripleStore},"get")});var lne=Ke();Object.defineProperty(g,"DomainIRI",{enumerable:!0,get:a(function(){return lne.IRI},"get")});var une=tt();Object.defineProperty(g,"DomainLiteral",{enumerable:!0,get:a(function(){return une.Literal},"get")});var fne=qt();Object.defineProperty(g,"DomainBlankNode",{enumerable:!0,get:a(function(){return fne.BlankNode},"get")});var dne=ri();Object.defineProperty(g,"DomainTriple",{enumerable:!0,get:a(function(){return dne.Triple},"get")});var pne=vT();Object.defineProperty(g,"RDFVocabularyMapper",{enumerable:!0,get:a(function(){return pne.RDFVocabularyMapper},"get")});var hne=LF();Object.defineProperty(g,"RDFSInferenceEngine",{enumerable:!0,get:a(function(){return hne.RDFSInferenceEngine},"get")});var mne=xT();Object.defineProperty(g,"NonInheritablePropertyRegistry",{enumerable:!0,get:a(function(){return mne.NonInheritablePropertyRegistry},"get")});var gne=OT();Object.defineProperty(g,"PropertyCardinalityRegistry",{enumerable:!0,get:a(function(){return gne.PropertyCardinalityRegistry},"get")});var gk=FT();Object.defineProperty(g,"PrototypeChainMaterializer",{enumerable:!0,get:a(function(){return gk.PrototypeChainMaterializer},"get")});Object.defineProperty(g,"INFERRED_GRAPH",{enumerable:!0,get:a(function(){return gk.INFERRED_GRAPH},"get")});var yne=BF();Object.defineProperty(g,"IRICanonicalizer",{enumerable:!0,get:a(function(){return yne.IRICanonicalizer},"get")});var $A=Dy();Object.defineProperty(g,"derivePath",{enumerable:!0,get:a(function(){return $A.derivePath},"get")});Object.defineProperty(g,"deriveUrl",{enumerable:!0,get:a(function(){return $A.deriveUrl},"get")});Object.defineProperty(g,"deriveLegacyFlatPath",{enumerable:!0,get:a(function(){return $A.deriveLegacyFlatPath},"get")});var UA=Fy();Object.defineProperty(g,"discoverFileSpaceExclusions",{enumerable:!0,get:a(function(){return UA.discoverFileSpaceExclusions},"get")});Object.defineProperty(g,"frontmatterDeclaresFileSpace",{enumerable:!0,get:a(function(){return UA.frontmatterDeclaresFileSpace},"get")});Object.defineProperty(g,"FILE_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return UA.FILE_SPACE_CLASS_UID},"get")});var yk=HF();Object.defineProperty(g,"LazyAssetGraphLoader",{enumerable:!0,get:a(function(){return yk.LazyAssetGraphLoader},"get")});Object.defineProperty(g,"MAX_LAZY_DEPTH",{enumerable:!0,get:a(function(){return yk.MAX_LAZY_DEPTH},"get")});var _k=UT();Object.defineProperty(g,"SourceAnnotator",{enumerable:!0,get:a(function(){return _k.SourceAnnotator},"get")});Object.defineProperty(g,"SOURCE_VARIABLE",{enumerable:!0,get:a(function(){return _k.SOURCE_VARIABLE},"get")});var BA=GT();Object.defineProperty(g,"NoteToRDFConverter",{enumerable:!0,get:a(function(){return BA.NoteToRDFConverter},"get")});Object.defineProperty(g,"normaliseExcludedFolders",{enumerable:!0,get:a(function(){return BA.normaliseExcludedFolders},"get")});Object.defineProperty(g,"isPathExcluded",{enumerable:!0,get:a(function(){return BA.isPathExcluded},"get")});var VA=Ml();Object.defineProperty(g,"ExoQLParser",{enumerable:!0,get:a(function(){return VA.ExoQLParser},"get")});Object.defineProperty(g,"SPARQLParser",{enumerable:!0,get:a(function(){return VA.SPARQLParser},"get")});Object.defineProperty(g,"SPARQLParseError",{enumerable:!0,get:a(function(){return VA.SPARQLParseError},"get")});var bk=Qw();Object.defineProperty(g,"DescribeOptionsTransformer",{enumerable:!0,get:a(function(){return bk.DescribeOptionsTransformer},"get")});Object.defineProperty(g,"DescribeOptionsTransformerError",{enumerable:!0,get:a(function(){return bk.DescribeOptionsTransformerError},"get")});var Sk=$l();Object.defineProperty(g,"ExoQLAlgebraTranslator",{enumerable:!0,get:a(function(){return Sk.ExoQLAlgebraTranslator},"get")});Object.defineProperty(g,"AlgebraTranslator",{enumerable:!0,get:a(function(){return Sk.AlgebraTranslator},"get")});var _ne=ZF();Object.defineProperty(g,"AlgebraOptimizer",{enumerable:!0,get:a(function(){return _ne.AlgebraOptimizer},"get")});var bne=eL();Object.defineProperty(g,"AlgebraSerializer",{enumerable:!0,get:a(function(){return bne.AlgebraSerializer},"get")});var Sne=h1();Object.defineProperty(g,"BGPExecutor",{enumerable:!0,get:a(function(){return Sne.BGPExecutor},"get")});var wne=hg();Object.defineProperty(g,"FilterExecutor",{enumerable:!0,get:a(function(){return wne.FilterExecutor},"get")});var Ene=F1();Object.defineProperty(g,"OptionalExecutor",{enumerable:!0,get:a(function(){return Ene.OptionalExecutor},"get")});var vne=N1();Object.defineProperty(g,"UnionExecutor",{enumerable:!0,get:a(function(){return vne.UnionExecutor},"get")});var Tne=W1();Object.defineProperty(g,"ConstructExecutor",{enumerable:!0,get:a(function(){return Tne.ConstructExecutor},"get")});var Ane=rL();Object.defineProperty(g,"DescribeExecutor",{enumerable:!0,get:a(function(){return Ane.DescribeExecutor},"get")});var wk=ou();Object.defineProperty(g,"ExoQLQueryExecutor",{enumerable:!0,get:a(function(){return wk.ExoQLQueryExecutor},"get")});Object.defineProperty(g,"QueryExecutor",{enumerable:!0,get:a(function(){return wk.QueryExecutor},"get")});var Ek=iL();Object.defineProperty(g,"UpdateExecutor",{enumerable:!0,get:a(function(){return Ek.UpdateExecutor},"get")});Object.defineProperty(g,"UpdateExecutorError",{enumerable:!0,get:a(function(){return Ek.UpdateExecutorError},"get")});var Ine=So();Object.defineProperty(g,"SolutionMapping",{enumerable:!0,get:a(function(){return Ine.SolutionMapping},"get")});var xne=pg();Object.defineProperty(g,"BuiltInFunctions",{enumerable:!0,get:a(function(){return xne.BuiltInFunctions},"get")});var Rne=oL();Object.defineProperty(g,"AggregateFunctions",{enumerable:!0,get:a(function(){return Rne.AggregateFunctions},"get")});var vk=j1();Object.defineProperty(g,"CustomAggregateRegistry",{enumerable:!0,get:a(function(){return vk.CustomAggregateRegistry},"get")});Object.defineProperty(g,"CustomAggregateError",{enumerable:!0,get:a(function(){return vk.CustomAggregateError},"get")});var zs=$1();Object.defineProperty(g,"BUILT_IN_AGGREGATES",{enumerable:!0,get:a(function(){return zs.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(g,"EXO_AGGREGATE_NS",{enumerable:!0,get:a(function(){return zs.EXO_AGGREGATE_NS},"get")});Object.defineProperty(g,"medianAggregate",{enumerable:!0,get:a(function(){return zs.medianAggregate},"get")});Object.defineProperty(g,"varianceAggregate",{enumerable:!0,get:a(function(){return zs.varianceAggregate},"get")});Object.defineProperty(g,"stddevAggregate",{enumerable:!0,get:a(function(){return zs.stddevAggregate},"get")});Object.defineProperty(g,"modeAggregate",{enumerable:!0,get:a(function(){return zs.modeAggregate},"get")});Object.defineProperty(g,"createPercentileAggregate",{enumerable:!0,get:a(function(){return zs.createPercentileAggregate},"get")});Object.defineProperty(g,"getNumericValue",{enumerable:!0,get:a(function(){return zs.getNumericValue},"get")});Object.defineProperty(g,"createDecimalLiteral",{enumerable:!0,get:a(function(){return zs.createDecimalLiteral},"get")});Object.defineProperty(g,"createDoubleLiteral",{enumerable:!0,get:a(function(){return zs.createDoubleLiteral},"get")});var Cne=aL();Object.defineProperty(g,"QueryPlanCache",{enumerable:!0,get:a(function(){return Cne.QueryPlanCache},"get")});var Tk=cL();Object.defineProperty(g,"SPARQLResultCache",{enumerable:!0,get:a(function(){return Tk.SPARQLResultCache},"get")});Object.defineProperty(g,"createSPARQLResultCache",{enumerable:!0,get:a(function(){return Tk.createSPARQLResultCache},"get")});var Ak=lL();Object.defineProperty(g,"IncrementalIndexer",{enumerable:!0,get:a(function(){return Ak.IncrementalIndexer},"get")});Object.defineProperty(g,"createIncrementalIndexer",{enumerable:!0,get:a(function(){return Ak.createIncrementalIndexer},"get")});var One=uL();Object.defineProperty(g,"ResultSerializer",{enumerable:!0,get:a(function(){return One.ResultSerializer},"get")});var Ik=zw();Object.defineProperty(g,"CaseWhenTransformer",{enumerable:!0,get:a(function(){return Ik.CaseWhenTransformer},"get")});Object.defineProperty(g,"CaseWhenTransformerError",{enumerable:!0,get:a(function(){return Ik.CaseWhenTransformerError},"get")});var Pne=e1();Object.defineProperty(g,"VaultPrefixTransformer",{enumerable:!0,get:a(function(){return Pne.VaultPrefixTransformer},"get")});var Dne=HT();Object.defineProperty(g,"FilterContainsOptimizer",{enumerable:!0,get:a(function(){return Dne.FilterContainsOptimizer},"get")});var xk=fL();Object.defineProperty(g,"FileNotFoundError",{enumerable:!0,get:a(function(){return xk.FileNotFoundError},"get")});Object.defineProperty(g,"FileAlreadyExistsError",{enumerable:!0,get:a(function(){return xk.FileAlreadyExistsError},"get")});var qA=vE();Object.defineProperty(g,"TripleAlreadyExistsError",{enumerable:!0,get:a(function(){return qA.TripleAlreadyExistsError},"get")});Object.defineProperty(g,"TripleNotFoundError",{enumerable:!0,get:a(function(){return qA.TripleNotFoundError},"get")});Object.defineProperty(g,"TransactionError",{enumerable:!0,get:a(function(){return qA.TransactionError},"get")});var Rk=yd();Object.defineProperty(g,"liveClock",{enumerable:!0,get:a(function(){return Rk.liveClock},"get")});Object.defineProperty(g,"frozenClock",{enumerable:!0,get:a(function(){return Rk.frozenClock},"get")});var Ck=Fg();Object.defineProperty(g,"liveUidGenerator",{enumerable:!0,get:a(function(){return Ck.liveUidGenerator},"get")});Object.defineProperty(g,"seededUidGenerator",{enumerable:!0,get:a(function(){return Ck.seededUidGenerator},"get")});var G0=s2();Object.defineProperty(g,"VaultSettings",{enumerable:!0,get:a(function(){return G0.VaultSettings},"get")});Object.defineProperty(g,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:a(function(){return G0.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(g,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:a(function(){return G0.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(g,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:a(function(){return G0.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var Fne=Wt();Object.defineProperty(g,"DI_TOKENS",{enumerable:!0,get:a(function(){return Fne.DI_TOKENS},"get")});var bp=dL();Object.defineProperty(g,"registerCoreServices",{enumerable:!0,get:a(function(){return bp.registerCoreServices},"get")});Object.defineProperty(g,"createChildContainer",{enumerable:!0,get:a(function(){return bp.createChildContainer},"get")});Object.defineProperty(g,"getContainer",{enumerable:!0,get:a(function(){return bp.getContainer},"get")});Object.defineProperty(g,"resetContainer",{enumerable:!0,get:a(function(){return bp.resetContainer},"get")});Object.defineProperty(g,"container",{enumerable:!0,get:a(function(){return bp.container},"get")});var zo=_L();Object.defineProperty(g,"NODE_FLAGS",{enumerable:!0,get:a(function(){return zo.NODE_FLAGS},"get")});Object.defineProperty(g,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return zo.DEFAULT_COLORS},"get")});Object.defineProperty(g,"StringTable",{enumerable:!0,get:a(function(){return zo.StringTable},"get")});Object.defineProperty(g,"CompactGraphStore",{enumerable:!0,get:a(function(){return zo.CompactGraphStore},"get")});Object.defineProperty(g,"MemoryPool",{enumerable:!0,get:a(function(){return zo.MemoryPool},"get")});Object.defineProperty(g,"getGlobalPool",{enumerable:!0,get:a(function(){return zo.getGlobalPool},"get")});Object.defineProperty(g,"resetGlobalPool",{enumerable:!0,get:a(function(){return zo.resetGlobalPool},"get")});Object.defineProperty(g,"StreamingLoader",{enumerable:!0,get:a(function(){return zo.StreamingLoader},"get")});Object.defineProperty(g,"createStreamingSource",{enumerable:!0,get:a(function(){return zo.createStreamingSource},"get")});var Ok=bL();Object.defineProperty(g,"ExoQL",{enumerable:!0,get:a(function(){return Ok.ExoQL},"get")});Object.defineProperty(g,"ExoQLError",{enumerable:!0,get:a(function(){return Ok.ExoQLError},"get")});var Sp=Zy();Object.defineProperty(g,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return Sp.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(g,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return Sp.LAYOUT_CLASS_UID},"get")});Object.defineProperty(g,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return Sp.createLayoutFromFrontmatter},"get")});Object.defineProperty(g,"isLayout",{enumerable:!0,get:a(function(){return Sp.isLayout},"get")});Object.defineProperty(g,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return Sp.isLayoutFrontmatter},"get")});var as=Zy();Object.defineProperty(g,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return as.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return as.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return as.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return as.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return as.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return as.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return as.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(g,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return as.isBacklinksTableBlock},"get")});Object.defineProperty(g,"isDailyEffortsByClassBlock",{enumerable:!0,get:a(function(){return as.isDailyEffortsByClassBlock},"get")});Object.defineProperty(g,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return as.isLayoutBlockFrontmatter},"get")});Object.defineProperty(g,"isPropertiesBlock",{enumerable:!0,get:a(function(){return as.isPropertiesBlock},"get")});var Ua=Zy();Object.defineProperty(g,"BUILTIN_DAILY_EFFORTS_VISIBILITY",{enumerable:!0,get:a(function(){return Ua.BUILTIN_DAILY_EFFORTS_VISIBILITY},"get")});Object.defineProperty(g,"DAILY_EFFORTS_OVERRIDE_KEYS",{enumerable:!0,get:a(function(){return Ua.DAILY_EFFORTS_OVERRIDE_KEYS},"get")});Object.defineProperty(g,"coerceVisibilityOverride",{enumerable:!0,get:a(function(){return Ua.coerceVisibilityOverride},"get")});Object.defineProperty(g,"resolveBlockVisibility",{enumerable:!0,get:a(function(){return Ua.resolveBlockVisibility},"get")});Object.defineProperty(g,"resolveDailyEffortVisibility",{enumerable:!0,get:a(function(){return Ua.resolveDailyEffortVisibility},"get")});Object.defineProperty(g,"EMS_ACTION_CLASS_UID",{enumerable:!0,get:a(function(){return Ua.EMS_ACTION_CLASS_UID},"get")});Object.defineProperty(g,"EMS_PROJECT_CLASS_UID",{enumerable:!0,get:a(function(){return Ua.EMS_PROJECT_CLASS_UID},"get")});Object.defineProperty(g,"partitionDailyEffortsByClass",{enumerable:!0,get:a(function(){return Ua.partitionDailyEffortsByClass},"get")});var Pk=DL();Object.defineProperty(g,"LayoutSelector",{enumerable:!0,get:a(function(){return Pk.LayoutSelector},"get")});Object.defineProperty(g,"selectByPriority",{enumerable:!0,get:a(function(){return Pk.selectByPriority},"get")});Xn(BL(),g);var Lne=VL();Object.defineProperty(g,"ShapeLoader",{enumerable:!0,get:a(function(){return Lne.ShapeLoader},"get")});var Nne=R2();Object.defineProperty(g,"ShapeRegistry",{enumerable:!0,get:a(function(){return Nne.ShapeRegistry},"get")});var kne=Jt();Object.defineProperty(g,"Namespace",{enumerable:!0,get:a(function(){return kne.Namespace},"get")});var Dk=F2();Object.defineProperty(g,"shaclValidate",{enumerable:!0,get:a(function(){return Dk.validate},"get")});Object.defineProperty(g,"ShaclShapeRegistry",{enumerable:!0,get:a(function(){return Dk.ShapeRegistry},"get")});Xn(GL(),g);var Mne=WL();Object.defineProperty(g,"TripleClassHierarchy",{enumerable:!0,get:a(function(){return Mne.ClassHierarchy},"get")});var Fk=M2();Object.defineProperty(g,"parseTarball",{enumerable:!0,get:a(function(){return Fk.parseTarball},"get")});Object.defineProperty(g,"parseTarballGzip",{enumerable:!0,get:a(function(){return Fk.parseTarballGzip},"get")});var Lk=g0();Object.defineProperty(g,"restCreateCommit",{enumerable:!0,get:a(function(){return Lk.restCreateCommit},"get")});Object.defineProperty(g,"isBinaryPayload",{enumerable:!0,get:a(function(){return Lk.isBinaryPayload},"get")});var Ba=JL();Object.defineProperty(g,"mountAssetSpaceFiles",{enumerable:!0,get:a(function(){return Ba.mountAssetSpaceFiles},"get")});Object.defineProperty(g,"discoverAssetSpaceWrapperDir",{enumerable:!0,get:a(function(){return Ba.discoverWrapperDir},"get")});Object.defineProperty(g,"extractAssetSpaceSha",{enumerable:!0,get:a(function(){return Ba.extractShaFromWrapper},"get")});Object.defineProperty(g,"appendGitmodulesEntry",{enumerable:!0,get:a(function(){return Ba.appendGitmodulesEntry},"get")});Object.defineProperty(g,"stripGitmodulesEntry",{enumerable:!0,get:a(function(){return Ba.stripGitmodulesEntry},"get")});Object.defineProperty(g,"escapeGitmodulesRegex",{enumerable:!0,get:a(function(){return Ba.escapeGitmodulesRegex},"get")});Object.defineProperty(g,"MATERIALIZE_PROGRESS_INTERVAL",{enumerable:!0,get:a(function(){return Ba.MATERIALIZE_PROGRESS_INTERVAL},"get")});Object.defineProperty(g,"MATERIALIZE_PROGRESS_MIN_FILES",{enumerable:!0,get:a(function(){return Ba.MATERIALIZE_PROGRESS_MIN_FILES},"get")});var Nk=Zd();Object.defineProperty(g,"detectChanges",{enumerable:!0,get:a(function(){return Nk.detectChanges},"get")});Object.defineProperty(g,"extractAssetUid",{enumerable:!0,get:a(function(){return Nk.extractAssetUid},"get")});var jne=ku();Object.defineProperty(g,"gitBlobSha",{enumerable:!0,get:a(function(){return jne.gitBlobSha},"get")});var GA=rN();Object.defineProperty(g,"rewriteAssetUid",{enumerable:!0,get:a(function(){return GA.rewriteAssetUid},"get")});Object.defineProperty(g,"findDuplicateUidGroups",{enumerable:!0,get:a(function(){return GA.findDuplicateUidGroups},"get")});Object.defineProperty(g,"planDuplicateUidFix",{enumerable:!0,get:a(function(){return GA.planDuplicateUidFix},"get")});var wp=rp();Object.defineProperty(g,"getBlobBytes",{enumerable:!0,get:a(function(){return wp.getBlobBytes},"get")});Object.defineProperty(g,"getBlobText",{enumerable:!0,get:a(function(){return wp.getBlobText},"get")});Object.defineProperty(g,"getCommitInfo",{enumerable:!0,get:a(function(){return wp.getCommitInfo},"get")});Object.defineProperty(g,"getHeadSha",{enumerable:!0,get:a(function(){return wp.getHeadSha},"get")});Object.defineProperty(g,"getTree",{enumerable:!0,get:a(function(){return wp.getTree},"get")});var qu=yN();Object.defineProperty(g,"DEFAULT_MAX_PUSH_RETRIES",{enumerable:!0,get:a(function(){return qu.DEFAULT_MAX_PUSH_RETRIES},"get")});Object.defineProperty(g,"DEFAULT_LOCAL_MANIFEST_REHASH_MS",{enumerable:!0,get:a(function(){return qu.DEFAULT_LOCAL_MANIFEST_REHASH_MS},"get")});Object.defineProperty(g,"SyncEngine",{enumerable:!0,get:a(function(){return qu.SyncEngine},"get")});Object.defineProperty(g,"isNonFastForwardError",{enumerable:!0,get:a(function(){return qu.isNonFastForwardError},"get")});Object.defineProperty(g,"orderChildrenFirst",{enumerable:!0,get:a(function(){return qu.orderChildrenFirst},"get")});Object.defineProperty(g,"syncProgressPhaseText",{enumerable:!0,get:a(function(){return qu.syncProgressPhaseText},"get")});var cs=W2();Object.defineProperty(g,"SyncPhaseTimer",{enumerable:!0,get:a(function(){return cs.SyncPhaseTimer},"get")});Object.defineProperty(g,"SYNC_PHASES",{enumerable:!0,get:a(function(){return cs.SYNC_PHASES},"get")});Object.defineProperty(g,"classifyRestPhase",{enumerable:!0,get:a(function(){return cs.classifyRestPhase},"get")});Object.defineProperty(g,"emptyTimings",{enumerable:!0,get:a(function(){return cs.emptyTimings},"get")});Object.defineProperty(g,"addTimings",{enumerable:!0,get:a(function(){return cs.addTimings},"get")});Object.defineProperty(g,"aggregateTimings",{enumerable:!0,get:a(function(){return cs.aggregateTimings},"get")});Object.defineProperty(g,"totalMs",{enumerable:!0,get:a(function(){return cs.totalMs},"get")});Object.defineProperty(g,"dominantPhase",{enumerable:!0,get:a(function(){return cs.dominantPhase},"get")});Object.defineProperty(g,"fmtMs",{enumerable:!0,get:a(function(){return cs.fmtMs},"get")});Object.defineProperty(g,"formatTimingsLine",{enumerable:!0,get:a(function(){return cs.formatTimingsLine},"get")});Object.defineProperty(g,"formatRepoTimings",{enumerable:!0,get:a(function(){return cs.formatRepoTimings},"get")});var kk=bN();Object.defineProperty(g,"QuarantineResolver",{enumerable:!0,get:a(function(){return kk.QuarantineResolver},"get")});Object.defineProperty(g,"backupPathFor",{enumerable:!0,get:a(function(){return kk.backupPathFor},"get")});var Ep=A0();Object.defineProperty(g,"DEFAULT_MAX_FILE_BYTES",{enumerable:!0,get:a(function(){return Ep.DEFAULT_MAX_FILE_BYTES},"get")});Object.defineProperty(g,"InMemoryQuarantineStore",{enumerable:!0,get:a(function(){return Ep.InMemoryQuarantineStore},"get")});Object.defineProperty(g,"contentEquals",{enumerable:!0,get:a(function(){return Ep.contentEquals},"get")});Object.defineProperty(g,"isFileSpaceSyncablePath",{enumerable:!0,get:a(function(){return Ep.isFileSpaceSyncablePath},"get")});Object.defineProperty(g,"isSyncablePath",{enumerable:!0,get:a(function(){return Ep.isSyncablePath},"get")});var Mk=SN();Object.defineProperty(g,"FileLocalManifestStore",{enumerable:!0,get:a(function(){return Mk.FileLocalManifestStore},"get")});Object.defineProperty(g,"LOCAL_MANIFEST_STORE_FILENAME",{enumerable:!0,get:a(function(){return Mk.LOCAL_MANIFEST_STORE_FILENAME},"get")});var $ne=sA();Object.defineProperty(g,"diff3",{enumerable:!0,get:a(function(){return $ne.diff3},"get")});var jk=vN();Object.defineProperty(g,"StructuredMerger",{enumerable:!0,get:a(function(){return jk.StructuredMerger},"get")});Object.defineProperty(g,"splitSections",{enumerable:!0,get:a(function(){return jk.splitSections},"get")});var Une=TN();Object.defineProperty(g,"MergeShaclGate",{enumerable:!0,get:a(function(){return Une.MergeShaclGate},"get")});var Bne=AN();Object.defineProperty(g,"GatedStructuredMerger",{enumerable:!0,get:a(function(){return Bne.GatedStructuredMerger},"get")});var $k=IN();Object.defineProperty(g,"FileWatermarkStore",{enumerable:!0,get:a(function(){return $k.FileWatermarkStore},"get")});Object.defineProperty(g,"WATERMARK_STORE_FILENAME",{enumerable:!0,get:a(function(){return $k.WATERMARK_STORE_FILENAME},"get")});var Uk=xN();Object.defineProperty(g,"FileMountBaseStore",{enumerable:!0,get:a(function(){return Uk.FileMountBaseStore},"get")});Object.defineProperty(g,"MOUNT_BASE_STORE_FILENAME",{enumerable:!0,get:a(function(){return Uk.MOUNT_BASE_STORE_FILENAME},"get")});var Vne=w0();Object.defineProperty(g,"isAuthError",{enumerable:!0,get:a(function(){return Vne.isAuthError},"get")});var Bk=T0();Object.defineProperty(g,"isRateLimitError",{enumerable:!0,get:a(function(){return Bk.isRateLimitError},"get")});Object.defineProperty(g,"withRateLimitBackoff",{enumerable:!0,get:a(function(){return Bk.withRateLimitBackoff},"get")});var Vk=Y2();Object.defineProperty(g,"redactSecrets",{enumerable:!0,get:a(function(){return Vk.redactSecrets},"get")});Object.defineProperty(g,"scanForSecrets",{enumerable:!0,get:a(function(){return Vk.scanForSecrets},"get")});var qk=RN();Object.defineProperty(g,"LocalConflictCacheStore",{enumerable:!0,get:a(function(){return qk.LocalConflictCacheStore},"get")});Object.defineProperty(g,"CONFLICT_CACHE_STORE_FILENAME",{enumerable:!0,get:a(function(){return qk.CONFLICT_CACHE_STORE_FILENAME},"get")});var WA=S0();Object.defineProperty(g,"LocalOutboxStore",{enumerable:!0,get:a(function(){return WA.LocalOutboxStore},"get")});Object.defineProperty(g,"OUTBOX_STORE_FILENAME",{enumerable:!0,get:a(function(){return WA.OUTBOX_STORE_FILENAME},"get")});Object.defineProperty(g,"OUTBOX_REMOTE_ABSENT",{enumerable:!0,get:a(function(){return WA.OUTBOX_REMOTE_ABSENT},"get")});var Va=bA();Object.defineProperty(g,"ASSET_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return Va.ASSET_SPACE_CLASS_UID},"get")});Object.defineProperty(g,"SYNC_BRANCH",{enumerable:!0,get:a(function(){return Va.SYNC_BRANCH},"get")});Object.defineProperty(g,"SpaceSpecAccumulator",{enumerable:!0,get:a(function(){return Va.SpaceSpecAccumulator},"get")});Object.defineProperty(g,"classifySpaceDeclaration",{enumerable:!0,get:a(function(){return Va.classifySpaceDeclaration},"get")});Object.defineProperty(g,"isAssetSpaceFrontmatter",{enumerable:!0,get:a(function(){return Va.isAssetSpaceFrontmatter},"get")});Object.defineProperty(g,"isFileSpaceFrontmatter",{enumerable:!0,get:a(function(){return Va.isFileSpaceFrontmatter},"get")});Object.defineProperty(g,"parseStrictGitHubRepoURL",{enumerable:!0,get:a(function(){return Va.parseStrictGitHubRepoURL},"get")});Object.defineProperty(g,"readSpaceSource",{enumerable:!0,get:a(function(){return Va.readSpaceSource},"get")});var Gk=kN();Object.defineProperty(g,"buildAssetSpaceDescriptor",{enumerable:!0,get:a(function(){return Gk.buildAssetSpaceDescriptor},"get")});Object.defineProperty(g,"deriveAssetSpaceNamespace",{enumerable:!0,get:a(function(){return Gk.deriveAssetSpaceNamespace},"get")});var Wk=VN();Object.defineProperty(g,"ParityValidator",{enumerable:!0,get:a(function(){return Wk.ParityValidator},"get")});Object.defineProperty(g,"summarizeParityRound",{enumerable:!0,get:a(function(){return Wk.summarizeParityRound},"get")});var Hk=wA();Object.defineProperty(g,"compareAssetSemantics",{enumerable:!0,get:a(function(){return Hk.compareAssetSemantics},"get")});Object.defineProperty(g,"isFormatOnlyDrift",{enumerable:!0,get:a(function(){return Hk.isFormatOnlyDrift},"get")});Xn(ZN(),g);Xn(uk(),g)});var Mr=E(HA=>{"use strict";HA.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,n)=>{e.push((i,s)=>i!=null?n(i):t(s)),r.apply(this,e)})},"name",{value:r.name})};HA.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);e.pop(),r.apply(this,e).then(n=>t(null,n),t)},"name",{value:r.name})}});var Kk=E(($ve,zk)=>{var qa=require("constants"),qne=process.cwd,W0=null,Gne=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return W0||(W0=qne.call(process)),W0};try{process.cwd()}catch{}typeof process.chdir=="function"&&(zA=process.chdir,process.chdir=function(r){W0=null,zA.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,zA));var zA;zk.exports=Wne;function Wne(r){qa.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(r),r.lutimes||t(r),r.chown=s(r.chown),r.fchown=s(r.fchown),r.lchown=s(r.lchown),r.chmod=n(r.chmod),r.fchmod=n(r.fchmod),r.lchmod=n(r.lchmod),r.chownSync=o(r.chownSync),r.fchownSync=o(r.fchownSync),r.lchownSync=o(r.lchownSync),r.chmodSync=i(r.chmodSync),r.fchmodSync=i(r.fchmodSync),r.lchmodSync=i(r.lchmodSync),r.stat=c(r.stat),r.fstat=c(r.fstat),r.lstat=c(r.lstat),r.statSync=l(r.statSync),r.fstatSync=l(r.fstatSync),r.lstatSync=l(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(f,d,p){p&&process.nextTick(p)},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(f,d,p,h){h&&process.nextTick(h)},r.lchownSync=function(){}),Gne==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:(function(f){function d(p,h,_){var y=Date.now(),S=0;f(p,h,a(function w(T){if(T&&(T.code==="EACCES"||T.code==="EPERM"||T.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){r.stat(h,function(O,A){O&&O.code==="ENOENT"?f(p,h,w):_(T)})},S),S<100&&(S+=10);return}_&&_(T)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(r.rename)),r.read=typeof r.read!="function"?r.read:(function(f){function d(p,h,_,y,S,w){var T;if(w&&typeof w=="function"){var O=0;T=a(function(A,x,P){if(A&&A.code==="EAGAIN"&&O<10)return O++,f.call(r,p,h,_,y,S,T);w.apply(this,arguments)},"callback")}return f.call(r,p,h,_,y,S,T)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:(function(f){return function(d,p,h,_,y){for(var S=0;;)try{return f.call(r,d,p,h,_,y)}catch(w){if(w.code==="EAGAIN"&&S<10){S++;continue}throw w}}})(r.readSync);function e(f){f.lchmod=function(d,p,h){f.open(d,qa.O_WRONLY|qa.O_SYMLINK,p,function(_,y){if(_){h&&h(_);return}f.fchmod(y,p,function(S){f.close(y,function(w){h&&h(S||w)})})})},f.lchmodSync=function(d,p){var h=f.openSync(d,qa.O_WRONLY|qa.O_SYMLINK,p),_=!0,y;try{y=f.fchmodSync(h,p),_=!1}finally{if(_)try{f.closeSync(h)}catch{}else f.closeSync(h)}return y}}a(e,"patchLchmod");function t(f){qa.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,p,h,_){f.open(d,qa.O_SYMLINK,function(y,S){if(y){_&&_(y);return}f.futimes(S,p,h,function(w){f.close(S,function(T){_&&_(w||T)})})})},f.lutimesSync=function(d,p,h){var _=f.openSync(d,qa.O_SYMLINK),y,S=!0;try{y=f.futimesSync(_,p,h),S=!1}finally{if(S)try{f.closeSync(_)}catch{}else f.closeSync(_)}return y}):f.futimes&&(f.lutimes=function(d,p,h,_){_&&process.nextTick(_)},f.lutimesSync=function(){})}a(t,"patchLutimes");function n(f){return f&&function(d,p,h){return f.call(r,d,p,function(_){u(_)&&(_=null),h&&h.apply(this,arguments)})}}a(n,"chmodFix");function i(f){return f&&function(d,p){try{return f.call(r,d,p)}catch(h){if(!u(h))throw h}}}a(i,"chmodFixSync");function s(f){return f&&function(d,p,h,_){return f.call(r,d,p,h,function(y){u(y)&&(y=null),_&&_.apply(this,arguments)})}}a(s,"chownFix");function o(f){return f&&function(d,p,h){try{return f.call(r,d,p,h)}catch(_){if(!u(_))throw _}}}a(o,"chownFixSync");function c(f){return f&&function(d,p,h){typeof p=="function"&&(h=p,p=null);function _(y,S){S&&(S.uid<0&&(S.uid+=4294967296),S.gid<0&&(S.gid+=4294967296)),h&&h.apply(this,arguments)}return a(_,"callback"),p?f.call(r,d,p,_):f.call(r,d,_)}}a(c,"statFix");function l(f){return f&&function(d,p){var h=p?f.call(r,d,p):f.call(r,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}a(l,"statFixSync");function u(f){if(!f||f.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(f.code==="EINVAL"||f.code==="EPERM"))}a(u,"chownErOk")}a(Wne,"patch")});var Xk=E((Bve,Qk)=>{var Yk=require("stream").Stream;Qk.exports=Hne;function Hne(r){return{ReadStream:e,WriteStream:t};function e(n,i){if(!(this instanceof e))return new e(n,i);Yk.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),c=0,l=o.length;c<l;c++){var u=o[c];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}r.open(this.path,this.flags,this.mode,function(f,d){if(f){s.emit("error",f),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function t(n,i){if(!(this instanceof t))return new t(n,i);Yk.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,c=s.length;o<c;o++){var l=s[o];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Hne,"legacy")});var Zk=E((qve,Jk)=>{"use strict";Jk.exports=Kne;var zne=Object.getPrototypeOf||function(r){return r.__proto__};function Kne(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var e={__proto__:zne(r)};else var e=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}a(Kne,"clone")});var Wu=E((Wve,QA)=>{var zt=require("fs"),Yne=Kk(),Qne=Xk(),Xne=Zk(),H0=require("util"),en,K0;typeof Symbol=="function"&&typeof Symbol.for=="function"?(en=Symbol.for("graceful-fs.queue"),K0=Symbol.for("graceful-fs.previous")):(en="___graceful-fs.queue",K0="___graceful-fs.previous");function Jne(){}a(Jne,"noop");function rM(r,e){Object.defineProperty(r,en,{get:a(function(){return e},"get")})}a(rM,"publishQueue");var Xc=Jne;H0.debuglog?Xc=H0.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Xc=a(function(){var r=H0.format.apply(H0,arguments);r="GFS4: "+r.split(/\n/).join(`
|
|
359
|
-
GFS4: `),console.error(r)},"debug"));zt[en]||(eM=global[en]||[],rM(zt,eM),zt.close=(function(r){function e(t,n){return r.call(zt,t,function(i){i||tM(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,K0,{value:r}),e})(zt.close),zt.closeSync=(function(r){function e(t){r.apply(zt,arguments),tM()}return a(e,"closeSync"),Object.defineProperty(e,K0,{value:r}),e})(zt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Xc(zt[en]),require("assert").equal(zt[en].length,0)}));var eM;global[en]||rM(global,zt[en]);QA.exports=KA(Xne(zt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!zt.__patched&&(QA.exports=KA(zt),zt.__patched=!0);function KA(r){Yne(r),r.gracefulify=KA,r.createReadStream=x,r.createWriteStream=P;var e=r.readFile;r.readFile=t;function t($,K,N){return typeof K=="function"&&(N=K,K=null),ae($,K,N);function ae(we,te,pe,Y){return e(we,te,function(Ee){Ee&&(Ee.code==="EMFILE"||Ee.code==="ENFILE")?Gu([ae,[we,te,pe],Ee,Y||Date.now(),Date.now()]):typeof pe=="function"&&pe.apply(this,arguments)})}a(ae,"go$readFile")}a(t,"readFile");var n=r.writeFile;r.writeFile=i;function i($,K,N,ae){return typeof N=="function"&&(ae=N,N=null),we($,K,N,ae);function we(te,pe,Y,Ee,ie){return n(te,pe,Y,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Gu([we,[te,pe,Y,Ee],ne,ie||Date.now(),Date.now()]):typeof Ee=="function"&&Ee.apply(this,arguments)})}a(we,"go$writeFile")}a(i,"writeFile");var s=r.appendFile;s&&(r.appendFile=o);function o($,K,N,ae){return typeof N=="function"&&(ae=N,N=null),we($,K,N,ae);function we(te,pe,Y,Ee,ie){return s(te,pe,Y,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Gu([we,[te,pe,Y,Ee],ne,ie||Date.now(),Date.now()]):typeof Ee=="function"&&Ee.apply(this,arguments)})}a(we,"go$appendFile")}a(o,"appendFile");var c=r.copyFile;c&&(r.copyFile=l);function l($,K,N,ae){return typeof N=="function"&&(ae=N,N=0),we($,K,N,ae);function we(te,pe,Y,Ee,ie){return c(te,pe,Y,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Gu([we,[te,pe,Y,Ee],ne,ie||Date.now(),Date.now()]):typeof Ee=="function"&&Ee.apply(this,arguments)})}a(we,"go$copyFile")}a(l,"copyFile");var u=r.readdir;r.readdir=d;var f=/^v[0-5]\./;function d($,K,N){typeof K=="function"&&(N=K,K=null);var ae=f.test(process.version)?a(function(pe,Y,Ee,ie){return u(pe,we(pe,Y,Ee,ie))},"go$readdir"):a(function(pe,Y,Ee,ie){return u(pe,Y,we(pe,Y,Ee,ie))},"go$readdir");return ae($,K,N);function we(te,pe,Y,Ee){return function(ie,ne){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Gu([ae,[te,pe,Y],ie,Ee||Date.now(),Date.now()]):(ne&&ne.sort&&ne.sort(),typeof Y=="function"&&Y.call(this,ie,ne))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var p=Qne(r);w=p.ReadStream,O=p.WriteStream}var h=r.ReadStream;h&&(w.prototype=Object.create(h.prototype),w.prototype.open=T);var _=r.WriteStream;_&&(O.prototype=Object.create(_.prototype),O.prototype.open=A),Object.defineProperty(r,"ReadStream",{get:a(function(){return w},"get"),set:a(function($){w=$},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(r,"WriteStream",{get:a(function(){return O},"get"),set:a(function($){O=$},"set"),enumerable:!0,configurable:!0});var y=w;Object.defineProperty(r,"FileReadStream",{get:a(function(){return y},"get"),set:a(function($){y=$},"set"),enumerable:!0,configurable:!0});var S=O;Object.defineProperty(r,"FileWriteStream",{get:a(function(){return S},"get"),set:a(function($){S=$},"set"),enumerable:!0,configurable:!0});function w($,K){return this instanceof w?(h.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}a(w,"ReadStream");function T(){var $=this;j($.path,$.flags,$.mode,function(K,N){K?($.autoClose&&$.destroy(),$.emit("error",K)):($.fd=N,$.emit("open",N),$.read())})}a(T,"ReadStream$open");function O($,K){return this instanceof O?(_.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}a(O,"WriteStream");function A(){var $=this;j($.path,$.flags,$.mode,function(K,N){K?($.destroy(),$.emit("error",K)):($.fd=N,$.emit("open",N))})}a(A,"WriteStream$open");function x($,K){return new r.ReadStream($,K)}a(x,"createReadStream");function P($,K){return new r.WriteStream($,K)}a(P,"createWriteStream");var V=r.open;r.open=j;function j($,K,N,ae){return typeof N=="function"&&(ae=N,N=null),we($,K,N,ae);function we(te,pe,Y,Ee,ie){return V(te,pe,Y,function(ne,de){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Gu([we,[te,pe,Y,Ee],ne,ie||Date.now(),Date.now()]):typeof Ee=="function"&&Ee.apply(this,arguments)})}a(we,"go$open")}return a(j,"open"),r}a(KA,"patch");function Gu(r){Xc("ENQUEUE",r[0].name,r[1]),zt[en].push(r),YA()}a(Gu,"enqueue");var z0;function tM(){for(var r=Date.now(),e=0;e<zt[en].length;++e)zt[en][e].length>2&&(zt[en][e][3]=r,zt[en][e][4]=r);YA()}a(tM,"resetQueue");function YA(){if(clearTimeout(z0),z0=void 0,zt[en].length!==0){var r=zt[en].shift(),e=r[0],t=r[1],n=r[2],i=r[3],s=r[4];if(i===void 0)Xc("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Xc("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,n)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Xc("RETRY",e.name,t),e.apply(null,t.concat([i]))):zt[en].push(r)}z0===void 0&&(z0=setTimeout(YA,0))}}a(YA,"retry")});var On=E(Ko=>{"use strict";var nM=Mr().fromCallback,Cn=Wu(),Zne=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(r=>typeof Cn[r]=="function");Object.assign(Ko,Cn);Zne.forEach(r=>{Ko[r]=nM(Cn[r])});Ko.exists=function(r,e){return typeof e=="function"?Cn.exists(r,e):new Promise(t=>Cn.exists(r,t))};Ko.read=function(r,e,t,n,i,s){return typeof s=="function"?Cn.read(r,e,t,n,i,s):new Promise((o,c)=>{Cn.read(r,e,t,n,i,(l,u,f)=>{if(l)return c(l);o({bytesRead:u,buffer:f})})})};Ko.write=function(r,e,...t){return typeof t[t.length-1]=="function"?Cn.write(r,e,...t):new Promise((n,i)=>{Cn.write(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffer:c})})})};Ko.readv=function(r,e,...t){return typeof t[t.length-1]=="function"?Cn.readv(r,e,...t):new Promise((n,i)=>{Cn.readv(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesRead:o,buffers:c})})})};Ko.writev=function(r,e,...t){return typeof t[t.length-1]=="function"?Cn.writev(r,e,...t):new Promise((n,i)=>{Cn.writev(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffers:c})})})};typeof Cn.realpath.native=="function"?Ko.realpath.native=nM(Cn.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var sM=E((Kve,iM)=>{"use strict";var eie=require("path");iM.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(eie.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var lM=E((Qve,XA)=>{"use strict";var oM=On(),{checkPath:aM}=sM(),cM=a(r=>{let e={mode:511};return typeof r=="number"?r:{...e,...r}.mode},"getMode");XA.exports.makeDir=async(r,e)=>(aM(r),oM.mkdir(r,{mode:cM(e),recursive:!0}));XA.exports.makeDirSync=(r,e)=>(aM(r),oM.mkdirSync(r,{mode:cM(e),recursive:!0}))});var ls=E((Jve,uM)=>{"use strict";var tie=Mr().fromPromise,{makeDir:rie,makeDirSync:JA}=lM(),ZA=tie(rie);uM.exports={mkdirs:ZA,mkdirsSync:JA,mkdirp:ZA,mkdirpSync:JA,ensureDir:ZA,ensureDirSync:JA}});var Ga=E((Zve,dM)=>{"use strict";var nie=Mr().fromPromise,fM=On();function iie(r){return fM.access(r).then(()=>!0).catch(()=>!1)}a(iie,"pathExists");dM.exports={pathExists:nie(iie),pathExistsSync:fM.existsSync}});var eI=E((tTe,pM)=>{"use strict";var Hu=On(),sie=Mr().fromPromise;async function oie(r,e,t){let n=await Hu.open(r,"r+"),i=null;try{await Hu.futimes(n,e,t)}finally{try{await Hu.close(n)}catch(s){i=s}}if(i)throw i}a(oie,"utimesMillis");function aie(r,e,t){let n=Hu.openSync(r,"r+");return Hu.futimesSync(n,e,t),Hu.closeSync(n)}a(aie,"utimesMillisSync");pM.exports={utimesMillis:sie(oie),utimesMillisSync:aie}});var Jc=E((nTe,yM)=>{"use strict";var zu=On(),jr=require("path"),hM=Mr().fromPromise;function cie(r,e,t){let n=t.dereference?i=>zu.stat(i,{bigint:!0}):i=>zu.lstat(i,{bigint:!0});return Promise.all([n(r),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}a(cie,"getStats");function lie(r,e,t){let n,i=t.dereference?o=>zu.statSync(o,{bigint:!0}):o=>zu.lstatSync(o,{bigint:!0}),s=i(r);try{n=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:n}}a(lie,"getStatsSync");async function uie(r,e,t,n){let{srcStat:i,destStat:s}=await cie(r,e,n);if(s){if(vp(i,s)){let o=jr.basename(r),c=jr.basename(e);if(t==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&tI(r,e))throw new Error(Y0(r,e,t));return{srcStat:i,destStat:s}}a(uie,"checkPaths");function fie(r,e,t,n){let{srcStat:i,destStat:s}=lie(r,e,n);if(s){if(vp(i,s)){let o=jr.basename(r),c=jr.basename(e);if(t==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&tI(r,e))throw new Error(Y0(r,e,t));return{srcStat:i,destStat:s}}a(fie,"checkPathsSync");async function mM(r,e,t,n){let i=jr.resolve(jr.dirname(r)),s=jr.resolve(jr.dirname(t));if(s===i||s===jr.parse(s).root)return;let o;try{o=await zu.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(vp(e,o))throw new Error(Y0(r,t,n));return mM(r,e,s,n)}a(mM,"checkParentPaths");function gM(r,e,t,n){let i=jr.resolve(jr.dirname(r)),s=jr.resolve(jr.dirname(t));if(s===i||s===jr.parse(s).root)return;let o;try{o=zu.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(vp(e,o))throw new Error(Y0(r,t,n));return gM(r,e,s,n)}a(gM,"checkParentPathsSync");function vp(r,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===r.ino&&e.dev===r.dev}a(vp,"areIdentical");function tI(r,e){let t=jr.resolve(r).split(jr.sep).filter(i=>i),n=jr.resolve(e).split(jr.sep).filter(i=>i);return t.every((i,s)=>n[s]===i)}a(tI,"isSrcSubdir");function Y0(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}a(Y0,"errMsg");yM.exports={checkPaths:hM(uie),checkPathsSync:fie,checkParentPaths:hM(mM),checkParentPathsSync:gM,isSrcSubdir:tI,areIdentical:vp}});var bM=E((sTe,_M)=>{"use strict";async function die(r,e){let t=[];for await(let n of r)t.push(e(n).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(n=>n.then(i=>{if(i!==null)throw i})))}a(die,"asyncIteratorConcurrentProcess");_M.exports={asyncIteratorConcurrentProcess:die}});var TM=E((aTe,vM)=>{"use strict";var hn=On(),Tp=require("path"),{mkdirs:pie}=ls(),{pathExists:hie}=Ga(),{utimesMillis:mie}=eI(),Ap=Jc(),{asyncIteratorConcurrentProcess:gie}=bM();async function yie(r,e,t={}){typeof t=="function"&&(t={filter:t}),t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
358
|
+
`)}a(Xte,"renderSettingAssetMarkdown")});var ik=E(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});U0.exportSettings=Jte;U0.importSettings=Zte;var $0=j0();function Jte(r,e){return r.declaredKeys().map(t=>({field:t.field,fileName:`${t.settingUid}.md`,content:(0,$0.renderSettingAssetMarkdown)(t,r.readLiveValue(t),r.settingClassUid,e.ontologyUid,e.nowIso)}))}a(Jte,"exportSettings");async function Zte(r,e){let t=new Map;for(let s of r.declaredKeys())t.set(s.keyUid,s),t.set(s.keyLabel,s);let n=[],i=[];for(let s of e){let o=(0,$0.extractKeyRef)(s.frontmatter),c=o!==null?t.get(o):void 0;if(c===void 0){i.push({path:s.path,reason:"unknown-key",detail:o??"<no setting key>"});continue}let l=(0,$0.coerceSettingValue)(c.datatype,(0,$0.readSettingValueRaw)(s.frontmatter));if(l===void 0){i.push({path:s.path,reason:"uncoercible",detail:`expected ${c.datatype}`});continue}await r.writeLiveValue(c,l),n.push(c.field)}return{applied:n,skipped:i}}a(Zte,"importSettings")});var sk=E(mp=>{"use strict";Object.defineProperty(mp,"__esModule",{value:!0});mp.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID=void 0;mp.resolveDistributionOntology=ere;var NA=j0();mp.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID="ea44f996-64e5-46ce-8953-b13d21ee750d";function ere(r,e){for(let t of r){if((0,NA.extractKeyRef)(t.frontmatter)!==e)continue;let n=(0,NA.coerceSettingValue)("string",(0,NA.readSettingValueRaw)(t.frontmatter));if(typeof n=="string"){let i=n.trim();if(i.length>0)return i}}return null}a(ere,"resolveDistributionOntology")});var ak=E(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.PERIODIC_NOTES_DECLARED_KEYS=Zr.PERIODIC_NOTES_DATA_PATH=Zr.PERIODIC_NOTES_PLUGIN_ID=Zr.JsonConfigSettingsSource=Zr.OBSPLUGIN_SETTING_CLASS_UID=void 0;Zr.resolveConfigPath=ok;Zr.buildPeriodicNotesSource=tre;Zr.OBSPLUGIN_SETTING_CLASS_UID="01a9c996-fc2e-4e70-a22d-e6554d746c5f";function ok(r,e){let t=r;for(let n of e.split(".")){if(t===null||typeof t!="object"||!Object.prototype.hasOwnProperty.call(t,n))return;t=t[n]}return t}a(ok,"resolveConfigPath");var B0=class{static{a(this,"JsonConfigSettingsSource")}constructor(e,t,n){this.settingClassUid=e,this.keys=t,this.config=n}declaredKeys(){return this.keys}readLiveValue(e){return ok(this.config,e.field)}writeLiveValue(){return Promise.reject(new Error("obsplugin settings Import is not implemented in M4.1 (export-only) \u2014 see M4.2."))}};Zr.JsonConfigSettingsSource=B0;Zr.PERIODIC_NOTES_PLUGIN_ID="periodic-notes";Zr.PERIODIC_NOTES_DATA_PATH=`.obsidian/plugins/${Zr.PERIODIC_NOTES_PLUGIN_ID}/data.json`;Zr.PERIODIC_NOTES_DECLARED_KEYS=[{field:"daily.folder",keyUid:"6ba6a073-3ee9-4527-8958-34596e072a31",keyLabel:"obsplugin__SettingKeyPeriodicNotesDailyFolder",datatype:"string",settingUid:"2bb137e5-b2c7-4fc8-b234-60639de674a9"},{field:"daily.format",keyUid:"a8d5f2b9-ba43-49d1-a469-00d5461b7d7a",keyLabel:"obsplugin__SettingKeyPeriodicNotesDailyFormat",datatype:"string",settingUid:"6ed5cfdf-551b-49bc-a467-56756b822da5"},{field:"daily.template",keyUid:"524d639d-4c63-4c73-a9c5-cca2c057a380",keyLabel:"obsplugin__SettingKeyPeriodicNotesDailyTemplate",datatype:"string",settingUid:"5430a6c5-6be5-483e-bb94-d740d6dd2541"},{field:"daily.enabled",keyUid:"7314ec27-e1ec-4987-8101-76273d0a789f",keyLabel:"obsplugin__SettingKeyPeriodicNotesDailyEnabled",datatype:"boolean",settingUid:"411646dd-1a87-40d8-853d-01c37af7fb2c"}];function tre(r){return new B0(Zr.OBSPLUGIN_SETTING_CLASS_UID,Zr.PERIODIC_NOTES_DECLARED_KEYS,r)}a(tre,"buildPeriodicNotesSource")});var uk=E(et=>{"use strict";var rre=et&&et.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),nre=et&&et.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rre(e,r,t)};Object.defineProperty(et,"__esModule",{value:!0});et.resolveConfigPath=et.buildPeriodicNotesSource=et.JsonConfigSettingsSource=et.PERIODIC_NOTES_DECLARED_KEYS=et.PERIODIC_NOTES_DATA_PATH=et.PERIODIC_NOTES_PLUGIN_ID=et.OBSPLUGIN_SETTING_CLASS_UID=et.resolveDistributionOntology=et.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID=et.importSettings=et.exportSettings=et.renderSettingAssetMarkdown=et.readSettingValueRaw=et.extractKeyRef=et.coerceSettingValue=et.LEGACY_SETTING_VALUE_PROPS=et.LEGACY_SETTING_KEY_PROPS=et.SETTING_VALUE_PROP=et.SETTING_KEY_PROP=void 0;nre(tk(),et);var $a=j0();Object.defineProperty(et,"SETTING_KEY_PROP",{enumerable:!0,get:a(function(){return $a.SETTING_KEY_PROP},"get")});Object.defineProperty(et,"SETTING_VALUE_PROP",{enumerable:!0,get:a(function(){return $a.SETTING_VALUE_PROP},"get")});Object.defineProperty(et,"LEGACY_SETTING_KEY_PROPS",{enumerable:!0,get:a(function(){return $a.LEGACY_SETTING_KEY_PROPS},"get")});Object.defineProperty(et,"LEGACY_SETTING_VALUE_PROPS",{enumerable:!0,get:a(function(){return $a.LEGACY_SETTING_VALUE_PROPS},"get")});Object.defineProperty(et,"coerceSettingValue",{enumerable:!0,get:a(function(){return $a.coerceSettingValue},"get")});Object.defineProperty(et,"extractKeyRef",{enumerable:!0,get:a(function(){return $a.extractKeyRef},"get")});Object.defineProperty(et,"readSettingValueRaw",{enumerable:!0,get:a(function(){return $a.readSettingValueRaw},"get")});Object.defineProperty(et,"renderSettingAssetMarkdown",{enumerable:!0,get:a(function(){return $a.renderSettingAssetMarkdown},"get")});var ck=ik();Object.defineProperty(et,"exportSettings",{enumerable:!0,get:a(function(){return ck.exportSettings},"get")});Object.defineProperty(et,"importSettings",{enumerable:!0,get:a(function(){return ck.importSettings},"get")});var lk=sk();Object.defineProperty(et,"EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID",{enumerable:!0,get:a(function(){return lk.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID},"get")});Object.defineProperty(et,"resolveDistributionOntology",{enumerable:!0,get:a(function(){return lk.resolveDistributionOntology},"get")});var Qc=ak();Object.defineProperty(et,"OBSPLUGIN_SETTING_CLASS_UID",{enumerable:!0,get:a(function(){return Qc.OBSPLUGIN_SETTING_CLASS_UID},"get")});Object.defineProperty(et,"PERIODIC_NOTES_PLUGIN_ID",{enumerable:!0,get:a(function(){return Qc.PERIODIC_NOTES_PLUGIN_ID},"get")});Object.defineProperty(et,"PERIODIC_NOTES_DATA_PATH",{enumerable:!0,get:a(function(){return Qc.PERIODIC_NOTES_DATA_PATH},"get")});Object.defineProperty(et,"PERIODIC_NOTES_DECLARED_KEYS",{enumerable:!0,get:a(function(){return Qc.PERIODIC_NOTES_DECLARED_KEYS},"get")});Object.defineProperty(et,"JsonConfigSettingsSource",{enumerable:!0,get:a(function(){return Qc.JsonConfigSettingsSource},"get")});Object.defineProperty(et,"buildPeriodicNotesSource",{enumerable:!0,get:a(function(){return Qc.buildPeriodicNotesSource},"get")});Object.defineProperty(et,"resolveConfigPath",{enumerable:!0,get:a(function(){return Qc.resolveConfigPath},"get")})});var it=E(g=>{"use strict";var ire=g&&g.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Xn=g&&g.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ire(e,r,t)};Object.defineProperty(g,"__esModule",{value:!0});g.createVaultFrontmatterClassLabelResolver=g.ServiceRegistry=g.GroundingExecutor=g.registerDefaultHostFunctions=g.hasUidFilename=g.hasNonUidFilename=g.PreconditionEvaluator=g.CommandResolver=g.extractPropertyLabel=g.uriToPropertyName=g.propertyNameToUri=g.rangeToFieldType=g.PropertyFieldType=g.transitiveDependsOnClosure=g.isTsFloorMountPath=g.isTsFloorAssetSpace=g.assertTsFloorReconciled=g.assertTsFloor=g.TsFloorViolationError=g.CATALOG_KEEP_NAMESPACES=g.PLUGIN_UI_FLOOR=g.SDK_FLOOR=g.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=g.SDK_FLOOR_ASSETSPACE_UIDS=g.TS_FLOOR_AS_UID_SHARED_IDENTITIES=g.TS_FLOOR_AS_UID_EXOCMD=g.TS_FLOOR_AS_UID_EXO=g.parseGroundingDefinitionFromFrontmatter=g.isCommandBindingFrontmatter=g.isGroundingFrontmatter=g.isPreconditionFrontmatter=g.isCommandFrontmatter=g.isStyleSource=g.isLabelClass=g.isCommandVariant=g.STYLE_SOURCE_VALUES=g.LABEL_CLASS_VALUES=g.COMMAND_VARIANT_VALUES=g.CommandBindingStyleProperty=g.CommandBindingProperty=g.GroundingProperty=g.PreconditionProperty=g.CommandProperty=g.resolveGroundingTypeFromWikilinkLiteral=g.resolveGroundingTypeFromIRI=g.GROUNDING_TYPE_IRI_TO_ENUM=g.GROUNDING_TYPE_UID_TO_ENUM=g.GROUNDING_TYPE_UIDS=g.GroundingType=g.EFFORT_STATUS_OPTIONS=void 0;g.GraphQueryService=g.FixMissingLabelService=g.ArchiveAssetService=g.GenericAssetCreationService=g.URIConstructionService=g.SessionEventService=g.AssetConversionService=g.EnumValueResolver=g.ClassHierarchyResolver=g.PropertySchemaResolver=g.PlanningService=g.AlgorithmExtractor=g.orderProperties=g.loadDefaultSpec=g.clearOrderSpecLoader=g.registerOrderSpecLoader=g.DynamicFrontmatterGenerator=g.SupervisionCreationService=g.StatusTimestampService=g.RenameToUidService=g.PropertyCleanupService=g.LoggingService=g.extractAssetReference=g.FolderRepairService=g.EffortVotingService=g.WorkflowCommandAdapter=g.VisibilityGenerator=g.InstantiationRuleResolver=g.stripTemplateFrontmatter=g.resolveTemplateBody=g.getRegisteredResolverIds=g.clearResolvers=g.registerResolver=g.getResolver=g.installDefaultResolvers=g.WorkflowResolver=g.WorkflowEngine=g.EffortStatusWorkflow=g.ConceptCreationService=g.ClassCreationService=g.AreaHierarchyBuilder=g.AreaCreationService=g.TaskStatusService=g.createTripleStoreRequiredPropertyResolver=g.CommandExecutionFlow=g.stripFrontmatter=g.extractSparqlBlock=g.iriToObsidianName=g.NamedQueryRunner=g.createVaultFrontmatterRefToFolderResolver=void 0;g.AlgebraTranslator=g.ExoQLAlgebraTranslator=g.DescribeOptionsTransformerError=g.DescribeOptionsTransformer=g.SPARQLParseError=g.SPARQLParser=g.ExoQLParser=g.isPathExcluded=g.normaliseExcludedFolders=g.NoteToRDFConverter=g.SOURCE_VARIABLE=g.SourceAnnotator=g.MAX_LAZY_DEPTH=g.LazyAssetGraphLoader=g.FILE_SPACE_CLASS_UID=g.frontmatterDeclaresFileSpace=g.discoverFileSpaceExclusions=g.deriveLegacyFlatPath=g.deriveUrl=g.derivePath=g.IRICanonicalizer=g.INFERRED_GRAPH=g.PrototypeChainMaterializer=g.PropertyCardinalityRegistry=g.NonInheritablePropertyRegistry=g.RDFSInferenceEngine=g.RDFVocabularyMapper=g.DomainTriple=g.DomainBlankNode=g.DomainLiteral=g.DomainIRI=g.InMemoryTripleStore=g.OBSIDIAN_VAULT_SCHEME=g.iriToVaultPath=g.vaultPathToIRI=g.NullLogger=g.RDFSerializer=g.FilenameValidator=g.EffortSortingHelpers=g.MetadataExtractor=g.MetadataHelpers=g.WikiLinkHelpers=g.DateFormatter=g.parseYamlFrontmatterTolerant=g.serializeYamlScalar=g.FrontmatterService=g.CriticalityZoneUUIDs=g.CriticalityZoneService=g.SPARQL_PREFIXES=g.TypeRegistry=void 0;g.DEFAULT_FLEETING_NOTE_CLASS_UID=g.DEFAULT_INBOX_FOLDER=g.DEFAULT_OWNER_IDENTITY=g.VaultSettings=g.seededUidGenerator=g.liveUidGenerator=g.frozenClock=g.liveClock=g.TransactionError=g.TripleNotFoundError=g.TripleAlreadyExistsError=g.FileAlreadyExistsError=g.FileNotFoundError=g.FilterContainsOptimizer=g.VaultPrefixTransformer=g.CaseWhenTransformerError=g.CaseWhenTransformer=g.ResultSerializer=g.createIncrementalIndexer=g.IncrementalIndexer=g.createSPARQLResultCache=g.SPARQLResultCache=g.QueryPlanCache=g.createDoubleLiteral=g.createDecimalLiteral=g.getNumericValue=g.createPercentileAggregate=g.modeAggregate=g.stddevAggregate=g.varianceAggregate=g.medianAggregate=g.EXO_AGGREGATE_NS=g.BUILT_IN_AGGREGATES=g.CustomAggregateError=g.CustomAggregateRegistry=g.AggregateFunctions=g.BuiltInFunctions=g.SolutionMapping=g.UpdateExecutorError=g.UpdateExecutor=g.QueryExecutor=g.ExoQLQueryExecutor=g.DescribeExecutor=g.ConstructExecutor=g.UnionExecutor=g.OptionalExecutor=g.FilterExecutor=g.BGPExecutor=g.AlgebraSerializer=g.AlgebraOptimizer=void 0;g.parseTarball=g.TripleClassHierarchy=g.ShaclShapeRegistry=g.shaclValidate=g.Namespace=g.ShapeRegistry=g.ShapeLoader=g.selectByPriority=g.LayoutSelector=g.partitionDailyEffortsByClass=g.EMS_PROJECT_CLASS_UID=g.EMS_ACTION_CLASS_UID=g.resolveDailyEffortVisibility=g.resolveBlockVisibility=g.coerceVisibilityOverride=g.DAILY_EFFORTS_OVERRIDE_KEYS=g.BUILTIN_DAILY_EFFORTS_VISIBILITY=g.isPropertiesBlock=g.isLayoutBlockFrontmatter=g.isDailyEffortsByClassBlock=g.isBacklinksTableBlock=g.createLayoutBlockFromFrontmatter=g.PROPERTIES_BLOCK_CLASS_UID=g.PROPERTIES_BLOCK_CLASS_IRI=g.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_UID=g.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_IRI=g.BACKLINKS_TABLE_BLOCK_CLASS_UID=g.BACKLINKS_TABLE_BLOCK_CLASS_IRI=g.isLayoutFrontmatter=g.isLayout=g.createLayoutFromFrontmatter=g.LAYOUT_CLASS_UID=g.LAYOUT_CLASS_IRI=g.ExoQLError=g.ExoQL=g.createStreamingSource=g.StreamingLoader=g.resetGlobalPool=g.getGlobalPool=g.MemoryPool=g.CompactGraphStore=g.StringTable=g.DEFAULT_COLORS=g.NODE_FLAGS=g.container=g.resetContainer=g.getContainer=g.createChildContainer=g.registerCoreServices=g.DI_TOKENS=void 0;g.StructuredMerger=g.diff3=g.LOCAL_MANIFEST_STORE_FILENAME=g.FileLocalManifestStore=g.isSyncablePath=g.isFileSpaceSyncablePath=g.contentEquals=g.InMemoryQuarantineStore=g.DEFAULT_MAX_FILE_BYTES=g.backupPathFor=g.QuarantineResolver=g.formatRepoTimings=g.formatTimingsLine=g.fmtMs=g.dominantPhase=g.totalMs=g.aggregateTimings=g.addTimings=g.emptyTimings=g.classifyRestPhase=g.SYNC_PHASES=g.SyncPhaseTimer=g.syncProgressPhaseText=g.orderChildrenFirst=g.isNonFastForwardError=g.SyncEngine=g.DEFAULT_LOCAL_MANIFEST_REHASH_MS=g.DEFAULT_MAX_PUSH_RETRIES=g.getTree=g.getHeadSha=g.getCommitInfo=g.getBlobText=g.getBlobBytes=g.planDuplicateUidFix=g.findDuplicateUidGroups=g.rewriteAssetUid=g.gitBlobSha=g.extractAssetUid=g.detectChanges=g.MATERIALIZE_PROGRESS_MIN_FILES=g.MATERIALIZE_PROGRESS_INTERVAL=g.escapeGitmodulesRegex=g.stripGitmodulesEntry=g.appendGitmodulesEntry=g.extractAssetSpaceSha=g.discoverAssetSpaceWrapperDir=g.mountAssetSpaceFiles=g.isBinaryPayload=g.restCreateCommit=g.parseTarballGzip=void 0;g.isFormatOnlyDrift=g.compareAssetSemantics=g.summarizeParityRound=g.ParityValidator=g.deriveAssetSpaceNamespace=g.buildAssetSpaceDescriptor=g.readSpaceSource=g.parseStrictGitHubRepoURL=g.isFileSpaceFrontmatter=g.isAssetSpaceFrontmatter=g.classifySpaceDeclaration=g.SpaceSpecAccumulator=g.SYNC_BRANCH=g.ASSET_SPACE_CLASS_UID=g.OUTBOX_REMOTE_ABSENT=g.OUTBOX_STORE_FILENAME=g.LocalOutboxStore=g.CONFLICT_CACHE_STORE_FILENAME=g.LocalConflictCacheStore=g.scanForSecrets=g.redactSecrets=g.withRateLimitBackoff=g.isRateLimitError=g.isAuthError=g.MOUNT_BASE_STORE_FILENAME=g.FileMountBaseStore=g.WATERMARK_STORE_FILENAME=g.FileWatermarkStore=g.GatedStructuredMerger=g.MergeShaclGate=g.splitSections=void 0;Xn(hc(),g);Xn(El(),g);var sre=oS();Object.defineProperty(g,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return sre.EFFORT_STATUS_OPTIONS},"get")});var ore=da();Object.defineProperty(g,"GroundingType",{enumerable:!0,get:a(function(){return ore.GroundingType},"get")});var gp=Bf();Object.defineProperty(g,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return gp.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(g,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return gp.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(g,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return gp.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(g,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return gp.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(g,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return gp.resolveGroundingTypeFromWikilinkLiteral},"get")});var yp=aS();Object.defineProperty(g,"CommandProperty",{enumerable:!0,get:a(function(){return yp.CommandProperty},"get")});Object.defineProperty(g,"PreconditionProperty",{enumerable:!0,get:a(function(){return yp.PreconditionProperty},"get")});Object.defineProperty(g,"GroundingProperty",{enumerable:!0,get:a(function(){return yp.GroundingProperty},"get")});Object.defineProperty(g,"CommandBindingProperty",{enumerable:!0,get:a(function(){return yp.CommandBindingProperty},"get")});Object.defineProperty(g,"CommandBindingStyleProperty",{enumerable:!0,get:a(function(){return yp.CommandBindingStyleProperty},"get")});var Vu=cS();Object.defineProperty(g,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:a(function(){return Vu.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(g,"LABEL_CLASS_VALUES",{enumerable:!0,get:a(function(){return Vu.LABEL_CLASS_VALUES},"get")});Object.defineProperty(g,"STYLE_SOURCE_VALUES",{enumerable:!0,get:a(function(){return Vu.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(g,"isCommandVariant",{enumerable:!0,get:a(function(){return Vu.isCommandVariant},"get")});Object.defineProperty(g,"isLabelClass",{enumerable:!0,get:a(function(){return Vu.isLabelClass},"get")});Object.defineProperty(g,"isStyleSource",{enumerable:!0,get:a(function(){return Vu.isStyleSource},"get")});var V0=lC();Object.defineProperty(g,"isCommandFrontmatter",{enumerable:!0,get:a(function(){return V0.isCommandFrontmatter},"get")});Object.defineProperty(g,"isPreconditionFrontmatter",{enumerable:!0,get:a(function(){return V0.isPreconditionFrontmatter},"get")});Object.defineProperty(g,"isGroundingFrontmatter",{enumerable:!0,get:a(function(){return V0.isGroundingFrontmatter},"get")});Object.defineProperty(g,"isCommandBindingFrontmatter",{enumerable:!0,get:a(function(){return V0.isCommandBindingFrontmatter},"get")});var are=uC();Object.defineProperty(g,"parseGroundingDefinitionFromFrontmatter",{enumerable:!0,get:a(function(){return are.parseGroundingDefinitionFromFrontmatter},"get")});Xn(fC(),g);Xn(dC(),g);Xn(fS(),g);Xn(dS(),g);Xn(hC(),g);Xn(yC(),g);Xn(zS(),g);Xn(QC(),g);var ai=XC();Object.defineProperty(g,"TS_FLOOR_AS_UID_EXO",{enumerable:!0,get:a(function(){return ai.TS_FLOOR_AS_UID_EXO},"get")});Object.defineProperty(g,"TS_FLOOR_AS_UID_EXOCMD",{enumerable:!0,get:a(function(){return ai.TS_FLOOR_AS_UID_EXOCMD},"get")});Object.defineProperty(g,"TS_FLOOR_AS_UID_SHARED_IDENTITIES",{enumerable:!0,get:a(function(){return ai.TS_FLOOR_AS_UID_SHARED_IDENTITIES},"get")});Object.defineProperty(g,"SDK_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return ai.SDK_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(g,"PLUGIN_UI_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return ai.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(g,"SDK_FLOOR",{enumerable:!0,get:a(function(){return ai.SDK_FLOOR},"get")});Object.defineProperty(g,"PLUGIN_UI_FLOOR",{enumerable:!0,get:a(function(){return ai.PLUGIN_UI_FLOOR},"get")});Object.defineProperty(g,"CATALOG_KEEP_NAMESPACES",{enumerable:!0,get:a(function(){return ai.CATALOG_KEEP_NAMESPACES},"get")});Object.defineProperty(g,"TsFloorViolationError",{enumerable:!0,get:a(function(){return ai.TsFloorViolationError},"get")});Object.defineProperty(g,"assertTsFloor",{enumerable:!0,get:a(function(){return ai.assertTsFloor},"get")});Object.defineProperty(g,"assertTsFloorReconciled",{enumerable:!0,get:a(function(){return ai.assertTsFloorReconciled},"get")});Object.defineProperty(g,"isTsFloorAssetSpace",{enumerable:!0,get:a(function(){return ai.isTsFloorAssetSpace},"get")});Object.defineProperty(g,"isTsFloorMountPath",{enumerable:!0,get:a(function(){return ai.isTsFloorMountPath},"get")});var cre=JC();Object.defineProperty(g,"transitiveDependsOnClosure",{enumerable:!0,get:a(function(){return cre.transitiveDependsOnClosure},"get")});var fk=om();Object.defineProperty(g,"PropertyFieldType",{enumerable:!0,get:a(function(){return fk.PropertyFieldType},"get")});Object.defineProperty(g,"rangeToFieldType",{enumerable:!0,get:a(function(){return fk.rangeToFieldType},"get")});var kA=XS();Object.defineProperty(g,"propertyNameToUri",{enumerable:!0,get:a(function(){return kA.propertyNameToUri},"get")});Object.defineProperty(g,"uriToPropertyName",{enumerable:!0,get:a(function(){return kA.uriToPropertyName},"get")});Object.defineProperty(g,"extractPropertyLabel",{enumerable:!0,get:a(function(){return kA.extractPropertyLabel},"get")});var lre=UP();Object.defineProperty(g,"CommandResolver",{enumerable:!0,get:a(function(){return lre.CommandResolver},"get")});var ure=VP();Object.defineProperty(g,"PreconditionEvaluator",{enumerable:!0,get:a(function(){return ure.PreconditionEvaluator},"get")});var MA=qP();Object.defineProperty(g,"hasNonUidFilename",{enumerable:!0,get:a(function(){return MA.hasNonUidFilename},"get")});Object.defineProperty(g,"hasUidFilename",{enumerable:!0,get:a(function(){return MA.hasUidFilename},"get")});Object.defineProperty(g,"registerDefaultHostFunctions",{enumerable:!0,get:a(function(){return MA.registerDefaultHostFunctions},"get")});var dk=ZP();Object.defineProperty(g,"GroundingExecutor",{enumerable:!0,get:a(function(){return dk.GroundingExecutor},"get")});Object.defineProperty(g,"ServiceRegistry",{enumerable:!0,get:a(function(){return dk.ServiceRegistry},"get")});var fre=e3();Object.defineProperty(g,"createVaultFrontmatterClassLabelResolver",{enumerable:!0,get:a(function(){return fre.createVaultFrontmatterClassLabelResolver},"get")});var dre=t3();Object.defineProperty(g,"createVaultFrontmatterRefToFolderResolver",{enumerable:!0,get:a(function(){return dre.createVaultFrontmatterRefToFolderResolver},"get")});var pre=n3();Object.defineProperty(g,"NamedQueryRunner",{enumerable:!0,get:a(function(){return pre.NamedQueryRunner},"get")});var hre=od();Object.defineProperty(g,"iriToObsidianName",{enumerable:!0,get:a(function(){return hre.iriToObsidianName},"get")});var pk=i3();Object.defineProperty(g,"extractSparqlBlock",{enumerable:!0,get:a(function(){return pk.extractSparqlBlock},"get")});Object.defineProperty(g,"stripFrontmatter",{enumerable:!0,get:a(function(){return pk.stripFrontmatter},"get")});var mre=o3();Object.defineProperty(g,"CommandExecutionFlow",{enumerable:!0,get:a(function(){return mre.CommandExecutionFlow},"get")});var gre=l3();Object.defineProperty(g,"createTripleStoreRequiredPropertyResolver",{enumerable:!0,get:a(function(){return gre.createTripleStoreRequiredPropertyResolver},"get")});var yre=PE();Object.defineProperty(g,"TaskStatusService",{enumerable:!0,get:a(function(){return yre.TaskStatusService},"get")});var _re=NE();Object.defineProperty(g,"AreaCreationService",{enumerable:!0,get:a(function(){return _re.AreaCreationService},"get")});var bre=ME();Object.defineProperty(g,"AreaHierarchyBuilder",{enumerable:!0,get:a(function(){return bre.AreaHierarchyBuilder},"get")});var Sre=qE();Object.defineProperty(g,"ClassCreationService",{enumerable:!0,get:a(function(){return Sre.ClassCreationService},"get")});var wre=WE();Object.defineProperty(g,"ConceptCreationService",{enumerable:!0,get:a(function(){return wre.ConceptCreationService},"get")});var Ere=ry();Object.defineProperty(g,"EffortStatusWorkflow",{enumerable:!0,get:a(function(){return Ere.EffortStatusWorkflow},"get")});var vre=Rd();Object.defineProperty(g,"WorkflowEngine",{enumerable:!0,get:a(function(){return vre.WorkflowEngine},"get")});var Tre=bE();Object.defineProperty(g,"WorkflowResolver",{enumerable:!0,get:a(function(){return Tre.WorkflowResolver},"get")});var _p=kg();Object.defineProperty(g,"installDefaultResolvers",{enumerable:!0,get:a(function(){return _p.installDefaultResolvers},"get")});Object.defineProperty(g,"getResolver",{enumerable:!0,get:a(function(){return _p.getResolver},"get")});Object.defineProperty(g,"registerResolver",{enumerable:!0,get:a(function(){return _p.registerResolver},"get")});Object.defineProperty(g,"clearResolvers",{enumerable:!0,get:a(function(){return _p.clearResolvers},"get")});Object.defineProperty(g,"getRegisteredResolverIds",{enumerable:!0,get:a(function(){return _p.getRegisteredResolverIds},"get")});var hk=iE();Object.defineProperty(g,"resolveTemplateBody",{enumerable:!0,get:a(function(){return hk.resolveTemplateBody},"get")});Object.defineProperty(g,"stripTemplateFrontmatter",{enumerable:!0,get:a(function(){return hk.stripTemplateFrontmatter},"get")});var Are=I3();Object.defineProperty(g,"InstantiationRuleResolver",{enumerable:!0,get:a(function(){return Are.InstantiationRuleResolver},"get")});var Ire=x3();Object.defineProperty(g,"VisibilityGenerator",{enumerable:!0,get:a(function(){return Ire.VisibilityGenerator},"get")});var xre=R3();Object.defineProperty(g,"WorkflowCommandAdapter",{enumerable:!0,get:a(function(){return xre.WorkflowCommandAdapter},"get")});var Rre=JE();Object.defineProperty(g,"EffortVotingService",{enumerable:!0,get:a(function(){return Rre.EffortVotingService},"get")});var Cre=ay();Object.defineProperty(g,"FolderRepairService",{enumerable:!0,get:a(function(){return Cre.FolderRepairService},"get")});var Ore=du();Object.defineProperty(g,"extractAssetReference",{enumerable:!0,get:a(function(){return Ore.extractAssetReference},"get")});var Pre=xa();Object.defineProperty(g,"LoggingService",{enumerable:!0,get:a(function(){return Pre.LoggingService},"get")});var Dre=tv();Object.defineProperty(g,"PropertyCleanupService",{enumerable:!0,get:a(function(){return Dre.PropertyCleanupService},"get")});var Fre=nv();Object.defineProperty(g,"RenameToUidService",{enumerable:!0,get:a(function(){return Fre.RenameToUidService},"get")});var Lre=iy();Object.defineProperty(g,"StatusTimestampService",{enumerable:!0,get:a(function(){return Lre.StatusTimestampService},"get")});var Nre=ov();Object.defineProperty(g,"SupervisionCreationService",{enumerable:!0,get:a(function(){return Nre.SupervisionCreationService},"get")});var kre=cv();Object.defineProperty(g,"DynamicFrontmatterGenerator",{enumerable:!0,get:a(function(){return kre.DynamicFrontmatterGenerator},"get")});var q0=wd();Object.defineProperty(g,"registerOrderSpecLoader",{enumerable:!0,get:a(function(){return q0.registerOrderSpecLoader},"get")});Object.defineProperty(g,"clearOrderSpecLoader",{enumerable:!0,get:a(function(){return q0.clearOrderSpecLoader},"get")});Object.defineProperty(g,"loadDefaultSpec",{enumerable:!0,get:a(function(){return q0.loadDefaultSpec},"get")});Object.defineProperty(g,"orderProperties",{enumerable:!0,get:a(function(){return q0.orderProperties},"get")});var Mre=uv();Object.defineProperty(g,"AlgorithmExtractor",{enumerable:!0,get:a(function(){return Mre.AlgorithmExtractor},"get")});var jre=dv();Object.defineProperty(g,"PlanningService",{enumerable:!0,get:a(function(){return jre.PlanningService},"get")});var $re=j3();Object.defineProperty(g,"PropertySchemaResolver",{enumerable:!0,get:a(function(){return $re.PropertySchemaResolver},"get")});var Ure=$3();Object.defineProperty(g,"ClassHierarchyResolver",{enumerable:!0,get:a(function(){return Ure.ClassHierarchyResolver},"get")});var Bre=U3();Object.defineProperty(g,"EnumValueResolver",{enumerable:!0,get:a(function(){return Bre.EnumValueResolver},"get")});var Vre=yv();Object.defineProperty(g,"AssetConversionService",{enumerable:!0,get:a(function(){return Vre.AssetConversionService},"get")});var qre=Sv();Object.defineProperty(g,"SessionEventService",{enumerable:!0,get:a(function(){return qre.SessionEventService},"get")});var Gre=vv();Object.defineProperty(g,"URIConstructionService",{enumerable:!0,get:a(function(){return Gre.URIConstructionService},"get")});var Wre=Av();Object.defineProperty(g,"GenericAssetCreationService",{enumerable:!0,get:a(function(){return Wre.GenericAssetCreationService},"get")});var Hre=Q3();Object.defineProperty(g,"ArchiveAssetService",{enumerable:!0,get:a(function(){return Hre.ArchiveAssetService},"get")});var zre=J3();Object.defineProperty(g,"FixMissingLabelService",{enumerable:!0,get:a(function(){return zre.FixMissingLabelService},"get")});var Kre=Z3();Object.defineProperty(g,"GraphQueryService",{enumerable:!0,get:a(function(){return Kre.GraphQueryService},"get")});var Yre=tD();Object.defineProperty(g,"TypeRegistry",{enumerable:!0,get:a(function(){return Yre.TypeRegistry},"get")});var Qre=rD();Object.defineProperty(g,"SPARQL_PREFIXES",{enumerable:!0,get:a(function(){return Qre.SPARQL_PREFIXES},"get")});var mk=Pv();Object.defineProperty(g,"CriticalityZoneService",{enumerable:!0,get:a(function(){return mk.CriticalityZoneService},"get")});Object.defineProperty(g,"CriticalityZoneUUIDs",{enumerable:!0,get:a(function(){return mk.CriticalityZoneUUIDs},"get")});var Xre=Fs();Object.defineProperty(g,"FrontmatterService",{enumerable:!0,get:a(function(){return Xre.FrontmatterService},"get")});var Jre=Ed();Object.defineProperty(g,"serializeYamlScalar",{enumerable:!0,get:a(function(){return Jre.serializeYamlScalar},"get")});var Zre=vF();Object.defineProperty(g,"parseYamlFrontmatterTolerant",{enumerable:!0,get:a(function(){return Zre.parseYamlFrontmatterTolerant},"get")});var ene=on();Object.defineProperty(g,"DateFormatter",{enumerable:!0,get:a(function(){return ene.DateFormatter},"get")});var tne=xs();Object.defineProperty(g,"WikiLinkHelpers",{enumerable:!0,get:a(function(){return tne.WikiLinkHelpers},"get")});var rne=Ro();Object.defineProperty(g,"MetadataHelpers",{enumerable:!0,get:a(function(){return rne.MetadataHelpers},"get")});var nne=FE();Object.defineProperty(g,"MetadataExtractor",{enumerable:!0,get:a(function(){return nne.MetadataExtractor},"get")});var ine=TF();Object.defineProperty(g,"EffortSortingHelpers",{enumerable:!0,get:a(function(){return ine.EffortSortingHelpers},"get")});var sne=AF();Object.defineProperty(g,"FilenameValidator",{enumerable:!0,get:a(function(){return sne.FilenameValidator},"get")});var one=DF();Object.defineProperty(g,"RDFSerializer",{enumerable:!0,get:a(function(){return one.RDFSerializer},"get")});var ane=Al();Object.defineProperty(g,"NullLogger",{enumerable:!0,get:a(function(){return ane.NullLogger},"get")});var jA=wT();Object.defineProperty(g,"vaultPathToIRI",{enumerable:!0,get:a(function(){return jA.vaultPathToIRI},"get")});Object.defineProperty(g,"iriToVaultPath",{enumerable:!0,get:a(function(){return jA.iriToVaultPath},"get")});Object.defineProperty(g,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:a(function(){return jA.OBSIDIAN_VAULT_SCHEME},"get")});var cne=xE();Object.defineProperty(g,"InMemoryTripleStore",{enumerable:!0,get:a(function(){return cne.InMemoryTripleStore},"get")});var lne=Ke();Object.defineProperty(g,"DomainIRI",{enumerable:!0,get:a(function(){return lne.IRI},"get")});var une=tt();Object.defineProperty(g,"DomainLiteral",{enumerable:!0,get:a(function(){return une.Literal},"get")});var fne=qt();Object.defineProperty(g,"DomainBlankNode",{enumerable:!0,get:a(function(){return fne.BlankNode},"get")});var dne=ri();Object.defineProperty(g,"DomainTriple",{enumerable:!0,get:a(function(){return dne.Triple},"get")});var pne=vT();Object.defineProperty(g,"RDFVocabularyMapper",{enumerable:!0,get:a(function(){return pne.RDFVocabularyMapper},"get")});var hne=LF();Object.defineProperty(g,"RDFSInferenceEngine",{enumerable:!0,get:a(function(){return hne.RDFSInferenceEngine},"get")});var mne=xT();Object.defineProperty(g,"NonInheritablePropertyRegistry",{enumerable:!0,get:a(function(){return mne.NonInheritablePropertyRegistry},"get")});var gne=OT();Object.defineProperty(g,"PropertyCardinalityRegistry",{enumerable:!0,get:a(function(){return gne.PropertyCardinalityRegistry},"get")});var gk=FT();Object.defineProperty(g,"PrototypeChainMaterializer",{enumerable:!0,get:a(function(){return gk.PrototypeChainMaterializer},"get")});Object.defineProperty(g,"INFERRED_GRAPH",{enumerable:!0,get:a(function(){return gk.INFERRED_GRAPH},"get")});var yne=BF();Object.defineProperty(g,"IRICanonicalizer",{enumerable:!0,get:a(function(){return yne.IRICanonicalizer},"get")});var $A=Dy();Object.defineProperty(g,"derivePath",{enumerable:!0,get:a(function(){return $A.derivePath},"get")});Object.defineProperty(g,"deriveUrl",{enumerable:!0,get:a(function(){return $A.deriveUrl},"get")});Object.defineProperty(g,"deriveLegacyFlatPath",{enumerable:!0,get:a(function(){return $A.deriveLegacyFlatPath},"get")});var UA=Fy();Object.defineProperty(g,"discoverFileSpaceExclusions",{enumerable:!0,get:a(function(){return UA.discoverFileSpaceExclusions},"get")});Object.defineProperty(g,"frontmatterDeclaresFileSpace",{enumerable:!0,get:a(function(){return UA.frontmatterDeclaresFileSpace},"get")});Object.defineProperty(g,"FILE_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return UA.FILE_SPACE_CLASS_UID},"get")});var yk=HF();Object.defineProperty(g,"LazyAssetGraphLoader",{enumerable:!0,get:a(function(){return yk.LazyAssetGraphLoader},"get")});Object.defineProperty(g,"MAX_LAZY_DEPTH",{enumerable:!0,get:a(function(){return yk.MAX_LAZY_DEPTH},"get")});var _k=UT();Object.defineProperty(g,"SourceAnnotator",{enumerable:!0,get:a(function(){return _k.SourceAnnotator},"get")});Object.defineProperty(g,"SOURCE_VARIABLE",{enumerable:!0,get:a(function(){return _k.SOURCE_VARIABLE},"get")});var BA=GT();Object.defineProperty(g,"NoteToRDFConverter",{enumerable:!0,get:a(function(){return BA.NoteToRDFConverter},"get")});Object.defineProperty(g,"normaliseExcludedFolders",{enumerable:!0,get:a(function(){return BA.normaliseExcludedFolders},"get")});Object.defineProperty(g,"isPathExcluded",{enumerable:!0,get:a(function(){return BA.isPathExcluded},"get")});var VA=Ml();Object.defineProperty(g,"ExoQLParser",{enumerable:!0,get:a(function(){return VA.ExoQLParser},"get")});Object.defineProperty(g,"SPARQLParser",{enumerable:!0,get:a(function(){return VA.SPARQLParser},"get")});Object.defineProperty(g,"SPARQLParseError",{enumerable:!0,get:a(function(){return VA.SPARQLParseError},"get")});var bk=Qw();Object.defineProperty(g,"DescribeOptionsTransformer",{enumerable:!0,get:a(function(){return bk.DescribeOptionsTransformer},"get")});Object.defineProperty(g,"DescribeOptionsTransformerError",{enumerable:!0,get:a(function(){return bk.DescribeOptionsTransformerError},"get")});var Sk=$l();Object.defineProperty(g,"ExoQLAlgebraTranslator",{enumerable:!0,get:a(function(){return Sk.ExoQLAlgebraTranslator},"get")});Object.defineProperty(g,"AlgebraTranslator",{enumerable:!0,get:a(function(){return Sk.AlgebraTranslator},"get")});var _ne=ZF();Object.defineProperty(g,"AlgebraOptimizer",{enumerable:!0,get:a(function(){return _ne.AlgebraOptimizer},"get")});var bne=eL();Object.defineProperty(g,"AlgebraSerializer",{enumerable:!0,get:a(function(){return bne.AlgebraSerializer},"get")});var Sne=h1();Object.defineProperty(g,"BGPExecutor",{enumerable:!0,get:a(function(){return Sne.BGPExecutor},"get")});var wne=hg();Object.defineProperty(g,"FilterExecutor",{enumerable:!0,get:a(function(){return wne.FilterExecutor},"get")});var Ene=F1();Object.defineProperty(g,"OptionalExecutor",{enumerable:!0,get:a(function(){return Ene.OptionalExecutor},"get")});var vne=N1();Object.defineProperty(g,"UnionExecutor",{enumerable:!0,get:a(function(){return vne.UnionExecutor},"get")});var Tne=W1();Object.defineProperty(g,"ConstructExecutor",{enumerable:!0,get:a(function(){return Tne.ConstructExecutor},"get")});var Ane=rL();Object.defineProperty(g,"DescribeExecutor",{enumerable:!0,get:a(function(){return Ane.DescribeExecutor},"get")});var wk=ou();Object.defineProperty(g,"ExoQLQueryExecutor",{enumerable:!0,get:a(function(){return wk.ExoQLQueryExecutor},"get")});Object.defineProperty(g,"QueryExecutor",{enumerable:!0,get:a(function(){return wk.QueryExecutor},"get")});var Ek=iL();Object.defineProperty(g,"UpdateExecutor",{enumerable:!0,get:a(function(){return Ek.UpdateExecutor},"get")});Object.defineProperty(g,"UpdateExecutorError",{enumerable:!0,get:a(function(){return Ek.UpdateExecutorError},"get")});var Ine=So();Object.defineProperty(g,"SolutionMapping",{enumerable:!0,get:a(function(){return Ine.SolutionMapping},"get")});var xne=pg();Object.defineProperty(g,"BuiltInFunctions",{enumerable:!0,get:a(function(){return xne.BuiltInFunctions},"get")});var Rne=oL();Object.defineProperty(g,"AggregateFunctions",{enumerable:!0,get:a(function(){return Rne.AggregateFunctions},"get")});var vk=j1();Object.defineProperty(g,"CustomAggregateRegistry",{enumerable:!0,get:a(function(){return vk.CustomAggregateRegistry},"get")});Object.defineProperty(g,"CustomAggregateError",{enumerable:!0,get:a(function(){return vk.CustomAggregateError},"get")});var zs=$1();Object.defineProperty(g,"BUILT_IN_AGGREGATES",{enumerable:!0,get:a(function(){return zs.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(g,"EXO_AGGREGATE_NS",{enumerable:!0,get:a(function(){return zs.EXO_AGGREGATE_NS},"get")});Object.defineProperty(g,"medianAggregate",{enumerable:!0,get:a(function(){return zs.medianAggregate},"get")});Object.defineProperty(g,"varianceAggregate",{enumerable:!0,get:a(function(){return zs.varianceAggregate},"get")});Object.defineProperty(g,"stddevAggregate",{enumerable:!0,get:a(function(){return zs.stddevAggregate},"get")});Object.defineProperty(g,"modeAggregate",{enumerable:!0,get:a(function(){return zs.modeAggregate},"get")});Object.defineProperty(g,"createPercentileAggregate",{enumerable:!0,get:a(function(){return zs.createPercentileAggregate},"get")});Object.defineProperty(g,"getNumericValue",{enumerable:!0,get:a(function(){return zs.getNumericValue},"get")});Object.defineProperty(g,"createDecimalLiteral",{enumerable:!0,get:a(function(){return zs.createDecimalLiteral},"get")});Object.defineProperty(g,"createDoubleLiteral",{enumerable:!0,get:a(function(){return zs.createDoubleLiteral},"get")});var Cne=aL();Object.defineProperty(g,"QueryPlanCache",{enumerable:!0,get:a(function(){return Cne.QueryPlanCache},"get")});var Tk=cL();Object.defineProperty(g,"SPARQLResultCache",{enumerable:!0,get:a(function(){return Tk.SPARQLResultCache},"get")});Object.defineProperty(g,"createSPARQLResultCache",{enumerable:!0,get:a(function(){return Tk.createSPARQLResultCache},"get")});var Ak=lL();Object.defineProperty(g,"IncrementalIndexer",{enumerable:!0,get:a(function(){return Ak.IncrementalIndexer},"get")});Object.defineProperty(g,"createIncrementalIndexer",{enumerable:!0,get:a(function(){return Ak.createIncrementalIndexer},"get")});var One=uL();Object.defineProperty(g,"ResultSerializer",{enumerable:!0,get:a(function(){return One.ResultSerializer},"get")});var Ik=zw();Object.defineProperty(g,"CaseWhenTransformer",{enumerable:!0,get:a(function(){return Ik.CaseWhenTransformer},"get")});Object.defineProperty(g,"CaseWhenTransformerError",{enumerable:!0,get:a(function(){return Ik.CaseWhenTransformerError},"get")});var Pne=e1();Object.defineProperty(g,"VaultPrefixTransformer",{enumerable:!0,get:a(function(){return Pne.VaultPrefixTransformer},"get")});var Dne=HT();Object.defineProperty(g,"FilterContainsOptimizer",{enumerable:!0,get:a(function(){return Dne.FilterContainsOptimizer},"get")});var xk=fL();Object.defineProperty(g,"FileNotFoundError",{enumerable:!0,get:a(function(){return xk.FileNotFoundError},"get")});Object.defineProperty(g,"FileAlreadyExistsError",{enumerable:!0,get:a(function(){return xk.FileAlreadyExistsError},"get")});var qA=vE();Object.defineProperty(g,"TripleAlreadyExistsError",{enumerable:!0,get:a(function(){return qA.TripleAlreadyExistsError},"get")});Object.defineProperty(g,"TripleNotFoundError",{enumerable:!0,get:a(function(){return qA.TripleNotFoundError},"get")});Object.defineProperty(g,"TransactionError",{enumerable:!0,get:a(function(){return qA.TransactionError},"get")});var Rk=yd();Object.defineProperty(g,"liveClock",{enumerable:!0,get:a(function(){return Rk.liveClock},"get")});Object.defineProperty(g,"frozenClock",{enumerable:!0,get:a(function(){return Rk.frozenClock},"get")});var Ck=Fg();Object.defineProperty(g,"liveUidGenerator",{enumerable:!0,get:a(function(){return Ck.liveUidGenerator},"get")});Object.defineProperty(g,"seededUidGenerator",{enumerable:!0,get:a(function(){return Ck.seededUidGenerator},"get")});var G0=s2();Object.defineProperty(g,"VaultSettings",{enumerable:!0,get:a(function(){return G0.VaultSettings},"get")});Object.defineProperty(g,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:a(function(){return G0.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(g,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:a(function(){return G0.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(g,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:a(function(){return G0.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var Fne=Wt();Object.defineProperty(g,"DI_TOKENS",{enumerable:!0,get:a(function(){return Fne.DI_TOKENS},"get")});var bp=dL();Object.defineProperty(g,"registerCoreServices",{enumerable:!0,get:a(function(){return bp.registerCoreServices},"get")});Object.defineProperty(g,"createChildContainer",{enumerable:!0,get:a(function(){return bp.createChildContainer},"get")});Object.defineProperty(g,"getContainer",{enumerable:!0,get:a(function(){return bp.getContainer},"get")});Object.defineProperty(g,"resetContainer",{enumerable:!0,get:a(function(){return bp.resetContainer},"get")});Object.defineProperty(g,"container",{enumerable:!0,get:a(function(){return bp.container},"get")});var zo=_L();Object.defineProperty(g,"NODE_FLAGS",{enumerable:!0,get:a(function(){return zo.NODE_FLAGS},"get")});Object.defineProperty(g,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return zo.DEFAULT_COLORS},"get")});Object.defineProperty(g,"StringTable",{enumerable:!0,get:a(function(){return zo.StringTable},"get")});Object.defineProperty(g,"CompactGraphStore",{enumerable:!0,get:a(function(){return zo.CompactGraphStore},"get")});Object.defineProperty(g,"MemoryPool",{enumerable:!0,get:a(function(){return zo.MemoryPool},"get")});Object.defineProperty(g,"getGlobalPool",{enumerable:!0,get:a(function(){return zo.getGlobalPool},"get")});Object.defineProperty(g,"resetGlobalPool",{enumerable:!0,get:a(function(){return zo.resetGlobalPool},"get")});Object.defineProperty(g,"StreamingLoader",{enumerable:!0,get:a(function(){return zo.StreamingLoader},"get")});Object.defineProperty(g,"createStreamingSource",{enumerable:!0,get:a(function(){return zo.createStreamingSource},"get")});var Ok=bL();Object.defineProperty(g,"ExoQL",{enumerable:!0,get:a(function(){return Ok.ExoQL},"get")});Object.defineProperty(g,"ExoQLError",{enumerable:!0,get:a(function(){return Ok.ExoQLError},"get")});var Sp=Zy();Object.defineProperty(g,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return Sp.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(g,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return Sp.LAYOUT_CLASS_UID},"get")});Object.defineProperty(g,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return Sp.createLayoutFromFrontmatter},"get")});Object.defineProperty(g,"isLayout",{enumerable:!0,get:a(function(){return Sp.isLayout},"get")});Object.defineProperty(g,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return Sp.isLayoutFrontmatter},"get")});var as=Zy();Object.defineProperty(g,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return as.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return as.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return as.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return as.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return as.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return as.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return as.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(g,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return as.isBacklinksTableBlock},"get")});Object.defineProperty(g,"isDailyEffortsByClassBlock",{enumerable:!0,get:a(function(){return as.isDailyEffortsByClassBlock},"get")});Object.defineProperty(g,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return as.isLayoutBlockFrontmatter},"get")});Object.defineProperty(g,"isPropertiesBlock",{enumerable:!0,get:a(function(){return as.isPropertiesBlock},"get")});var Ua=Zy();Object.defineProperty(g,"BUILTIN_DAILY_EFFORTS_VISIBILITY",{enumerable:!0,get:a(function(){return Ua.BUILTIN_DAILY_EFFORTS_VISIBILITY},"get")});Object.defineProperty(g,"DAILY_EFFORTS_OVERRIDE_KEYS",{enumerable:!0,get:a(function(){return Ua.DAILY_EFFORTS_OVERRIDE_KEYS},"get")});Object.defineProperty(g,"coerceVisibilityOverride",{enumerable:!0,get:a(function(){return Ua.coerceVisibilityOverride},"get")});Object.defineProperty(g,"resolveBlockVisibility",{enumerable:!0,get:a(function(){return Ua.resolveBlockVisibility},"get")});Object.defineProperty(g,"resolveDailyEffortVisibility",{enumerable:!0,get:a(function(){return Ua.resolveDailyEffortVisibility},"get")});Object.defineProperty(g,"EMS_ACTION_CLASS_UID",{enumerable:!0,get:a(function(){return Ua.EMS_ACTION_CLASS_UID},"get")});Object.defineProperty(g,"EMS_PROJECT_CLASS_UID",{enumerable:!0,get:a(function(){return Ua.EMS_PROJECT_CLASS_UID},"get")});Object.defineProperty(g,"partitionDailyEffortsByClass",{enumerable:!0,get:a(function(){return Ua.partitionDailyEffortsByClass},"get")});var Pk=DL();Object.defineProperty(g,"LayoutSelector",{enumerable:!0,get:a(function(){return Pk.LayoutSelector},"get")});Object.defineProperty(g,"selectByPriority",{enumerable:!0,get:a(function(){return Pk.selectByPriority},"get")});Xn(BL(),g);var Lne=VL();Object.defineProperty(g,"ShapeLoader",{enumerable:!0,get:a(function(){return Lne.ShapeLoader},"get")});var Nne=R2();Object.defineProperty(g,"ShapeRegistry",{enumerable:!0,get:a(function(){return Nne.ShapeRegistry},"get")});var kne=Jt();Object.defineProperty(g,"Namespace",{enumerable:!0,get:a(function(){return kne.Namespace},"get")});var Dk=F2();Object.defineProperty(g,"shaclValidate",{enumerable:!0,get:a(function(){return Dk.validate},"get")});Object.defineProperty(g,"ShaclShapeRegistry",{enumerable:!0,get:a(function(){return Dk.ShapeRegistry},"get")});Xn(GL(),g);var Mne=WL();Object.defineProperty(g,"TripleClassHierarchy",{enumerable:!0,get:a(function(){return Mne.ClassHierarchy},"get")});var Fk=M2();Object.defineProperty(g,"parseTarball",{enumerable:!0,get:a(function(){return Fk.parseTarball},"get")});Object.defineProperty(g,"parseTarballGzip",{enumerable:!0,get:a(function(){return Fk.parseTarballGzip},"get")});var Lk=g0();Object.defineProperty(g,"restCreateCommit",{enumerable:!0,get:a(function(){return Lk.restCreateCommit},"get")});Object.defineProperty(g,"isBinaryPayload",{enumerable:!0,get:a(function(){return Lk.isBinaryPayload},"get")});var Ba=JL();Object.defineProperty(g,"mountAssetSpaceFiles",{enumerable:!0,get:a(function(){return Ba.mountAssetSpaceFiles},"get")});Object.defineProperty(g,"discoverAssetSpaceWrapperDir",{enumerable:!0,get:a(function(){return Ba.discoverWrapperDir},"get")});Object.defineProperty(g,"extractAssetSpaceSha",{enumerable:!0,get:a(function(){return Ba.extractShaFromWrapper},"get")});Object.defineProperty(g,"appendGitmodulesEntry",{enumerable:!0,get:a(function(){return Ba.appendGitmodulesEntry},"get")});Object.defineProperty(g,"stripGitmodulesEntry",{enumerable:!0,get:a(function(){return Ba.stripGitmodulesEntry},"get")});Object.defineProperty(g,"escapeGitmodulesRegex",{enumerable:!0,get:a(function(){return Ba.escapeGitmodulesRegex},"get")});Object.defineProperty(g,"MATERIALIZE_PROGRESS_INTERVAL",{enumerable:!0,get:a(function(){return Ba.MATERIALIZE_PROGRESS_INTERVAL},"get")});Object.defineProperty(g,"MATERIALIZE_PROGRESS_MIN_FILES",{enumerable:!0,get:a(function(){return Ba.MATERIALIZE_PROGRESS_MIN_FILES},"get")});var Nk=Zd();Object.defineProperty(g,"detectChanges",{enumerable:!0,get:a(function(){return Nk.detectChanges},"get")});Object.defineProperty(g,"extractAssetUid",{enumerable:!0,get:a(function(){return Nk.extractAssetUid},"get")});var jne=ku();Object.defineProperty(g,"gitBlobSha",{enumerable:!0,get:a(function(){return jne.gitBlobSha},"get")});var GA=rN();Object.defineProperty(g,"rewriteAssetUid",{enumerable:!0,get:a(function(){return GA.rewriteAssetUid},"get")});Object.defineProperty(g,"findDuplicateUidGroups",{enumerable:!0,get:a(function(){return GA.findDuplicateUidGroups},"get")});Object.defineProperty(g,"planDuplicateUidFix",{enumerable:!0,get:a(function(){return GA.planDuplicateUidFix},"get")});var wp=rp();Object.defineProperty(g,"getBlobBytes",{enumerable:!0,get:a(function(){return wp.getBlobBytes},"get")});Object.defineProperty(g,"getBlobText",{enumerable:!0,get:a(function(){return wp.getBlobText},"get")});Object.defineProperty(g,"getCommitInfo",{enumerable:!0,get:a(function(){return wp.getCommitInfo},"get")});Object.defineProperty(g,"getHeadSha",{enumerable:!0,get:a(function(){return wp.getHeadSha},"get")});Object.defineProperty(g,"getTree",{enumerable:!0,get:a(function(){return wp.getTree},"get")});var qu=yN();Object.defineProperty(g,"DEFAULT_MAX_PUSH_RETRIES",{enumerable:!0,get:a(function(){return qu.DEFAULT_MAX_PUSH_RETRIES},"get")});Object.defineProperty(g,"DEFAULT_LOCAL_MANIFEST_REHASH_MS",{enumerable:!0,get:a(function(){return qu.DEFAULT_LOCAL_MANIFEST_REHASH_MS},"get")});Object.defineProperty(g,"SyncEngine",{enumerable:!0,get:a(function(){return qu.SyncEngine},"get")});Object.defineProperty(g,"isNonFastForwardError",{enumerable:!0,get:a(function(){return qu.isNonFastForwardError},"get")});Object.defineProperty(g,"orderChildrenFirst",{enumerable:!0,get:a(function(){return qu.orderChildrenFirst},"get")});Object.defineProperty(g,"syncProgressPhaseText",{enumerable:!0,get:a(function(){return qu.syncProgressPhaseText},"get")});var cs=W2();Object.defineProperty(g,"SyncPhaseTimer",{enumerable:!0,get:a(function(){return cs.SyncPhaseTimer},"get")});Object.defineProperty(g,"SYNC_PHASES",{enumerable:!0,get:a(function(){return cs.SYNC_PHASES},"get")});Object.defineProperty(g,"classifyRestPhase",{enumerable:!0,get:a(function(){return cs.classifyRestPhase},"get")});Object.defineProperty(g,"emptyTimings",{enumerable:!0,get:a(function(){return cs.emptyTimings},"get")});Object.defineProperty(g,"addTimings",{enumerable:!0,get:a(function(){return cs.addTimings},"get")});Object.defineProperty(g,"aggregateTimings",{enumerable:!0,get:a(function(){return cs.aggregateTimings},"get")});Object.defineProperty(g,"totalMs",{enumerable:!0,get:a(function(){return cs.totalMs},"get")});Object.defineProperty(g,"dominantPhase",{enumerable:!0,get:a(function(){return cs.dominantPhase},"get")});Object.defineProperty(g,"fmtMs",{enumerable:!0,get:a(function(){return cs.fmtMs},"get")});Object.defineProperty(g,"formatTimingsLine",{enumerable:!0,get:a(function(){return cs.formatTimingsLine},"get")});Object.defineProperty(g,"formatRepoTimings",{enumerable:!0,get:a(function(){return cs.formatRepoTimings},"get")});var kk=bN();Object.defineProperty(g,"QuarantineResolver",{enumerable:!0,get:a(function(){return kk.QuarantineResolver},"get")});Object.defineProperty(g,"backupPathFor",{enumerable:!0,get:a(function(){return kk.backupPathFor},"get")});var Ep=A0();Object.defineProperty(g,"DEFAULT_MAX_FILE_BYTES",{enumerable:!0,get:a(function(){return Ep.DEFAULT_MAX_FILE_BYTES},"get")});Object.defineProperty(g,"InMemoryQuarantineStore",{enumerable:!0,get:a(function(){return Ep.InMemoryQuarantineStore},"get")});Object.defineProperty(g,"contentEquals",{enumerable:!0,get:a(function(){return Ep.contentEquals},"get")});Object.defineProperty(g,"isFileSpaceSyncablePath",{enumerable:!0,get:a(function(){return Ep.isFileSpaceSyncablePath},"get")});Object.defineProperty(g,"isSyncablePath",{enumerable:!0,get:a(function(){return Ep.isSyncablePath},"get")});var Mk=SN();Object.defineProperty(g,"FileLocalManifestStore",{enumerable:!0,get:a(function(){return Mk.FileLocalManifestStore},"get")});Object.defineProperty(g,"LOCAL_MANIFEST_STORE_FILENAME",{enumerable:!0,get:a(function(){return Mk.LOCAL_MANIFEST_STORE_FILENAME},"get")});var $ne=sA();Object.defineProperty(g,"diff3",{enumerable:!0,get:a(function(){return $ne.diff3},"get")});var jk=vN();Object.defineProperty(g,"StructuredMerger",{enumerable:!0,get:a(function(){return jk.StructuredMerger},"get")});Object.defineProperty(g,"splitSections",{enumerable:!0,get:a(function(){return jk.splitSections},"get")});var Une=TN();Object.defineProperty(g,"MergeShaclGate",{enumerable:!0,get:a(function(){return Une.MergeShaclGate},"get")});var Bne=AN();Object.defineProperty(g,"GatedStructuredMerger",{enumerable:!0,get:a(function(){return Bne.GatedStructuredMerger},"get")});var $k=IN();Object.defineProperty(g,"FileWatermarkStore",{enumerable:!0,get:a(function(){return $k.FileWatermarkStore},"get")});Object.defineProperty(g,"WATERMARK_STORE_FILENAME",{enumerable:!0,get:a(function(){return $k.WATERMARK_STORE_FILENAME},"get")});var Uk=xN();Object.defineProperty(g,"FileMountBaseStore",{enumerable:!0,get:a(function(){return Uk.FileMountBaseStore},"get")});Object.defineProperty(g,"MOUNT_BASE_STORE_FILENAME",{enumerable:!0,get:a(function(){return Uk.MOUNT_BASE_STORE_FILENAME},"get")});var Vne=w0();Object.defineProperty(g,"isAuthError",{enumerable:!0,get:a(function(){return Vne.isAuthError},"get")});var Bk=T0();Object.defineProperty(g,"isRateLimitError",{enumerable:!0,get:a(function(){return Bk.isRateLimitError},"get")});Object.defineProperty(g,"withRateLimitBackoff",{enumerable:!0,get:a(function(){return Bk.withRateLimitBackoff},"get")});var Vk=Y2();Object.defineProperty(g,"redactSecrets",{enumerable:!0,get:a(function(){return Vk.redactSecrets},"get")});Object.defineProperty(g,"scanForSecrets",{enumerable:!0,get:a(function(){return Vk.scanForSecrets},"get")});var qk=RN();Object.defineProperty(g,"LocalConflictCacheStore",{enumerable:!0,get:a(function(){return qk.LocalConflictCacheStore},"get")});Object.defineProperty(g,"CONFLICT_CACHE_STORE_FILENAME",{enumerable:!0,get:a(function(){return qk.CONFLICT_CACHE_STORE_FILENAME},"get")});var WA=S0();Object.defineProperty(g,"LocalOutboxStore",{enumerable:!0,get:a(function(){return WA.LocalOutboxStore},"get")});Object.defineProperty(g,"OUTBOX_STORE_FILENAME",{enumerable:!0,get:a(function(){return WA.OUTBOX_STORE_FILENAME},"get")});Object.defineProperty(g,"OUTBOX_REMOTE_ABSENT",{enumerable:!0,get:a(function(){return WA.OUTBOX_REMOTE_ABSENT},"get")});var Va=bA();Object.defineProperty(g,"ASSET_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return Va.ASSET_SPACE_CLASS_UID},"get")});Object.defineProperty(g,"SYNC_BRANCH",{enumerable:!0,get:a(function(){return Va.SYNC_BRANCH},"get")});Object.defineProperty(g,"SpaceSpecAccumulator",{enumerable:!0,get:a(function(){return Va.SpaceSpecAccumulator},"get")});Object.defineProperty(g,"classifySpaceDeclaration",{enumerable:!0,get:a(function(){return Va.classifySpaceDeclaration},"get")});Object.defineProperty(g,"isAssetSpaceFrontmatter",{enumerable:!0,get:a(function(){return Va.isAssetSpaceFrontmatter},"get")});Object.defineProperty(g,"isFileSpaceFrontmatter",{enumerable:!0,get:a(function(){return Va.isFileSpaceFrontmatter},"get")});Object.defineProperty(g,"parseStrictGitHubRepoURL",{enumerable:!0,get:a(function(){return Va.parseStrictGitHubRepoURL},"get")});Object.defineProperty(g,"readSpaceSource",{enumerable:!0,get:a(function(){return Va.readSpaceSource},"get")});var Gk=kN();Object.defineProperty(g,"buildAssetSpaceDescriptor",{enumerable:!0,get:a(function(){return Gk.buildAssetSpaceDescriptor},"get")});Object.defineProperty(g,"deriveAssetSpaceNamespace",{enumerable:!0,get:a(function(){return Gk.deriveAssetSpaceNamespace},"get")});var Wk=VN();Object.defineProperty(g,"ParityValidator",{enumerable:!0,get:a(function(){return Wk.ParityValidator},"get")});Object.defineProperty(g,"summarizeParityRound",{enumerable:!0,get:a(function(){return Wk.summarizeParityRound},"get")});var Hk=wA();Object.defineProperty(g,"compareAssetSemantics",{enumerable:!0,get:a(function(){return Hk.compareAssetSemantics},"get")});Object.defineProperty(g,"isFormatOnlyDrift",{enumerable:!0,get:a(function(){return Hk.isFormatOnlyDrift},"get")});Xn(ZN(),g);Xn(uk(),g)});var Mr=E(HA=>{"use strict";HA.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,n)=>{e.push((i,s)=>i!=null?n(i):t(s)),r.apply(this,e)})},"name",{value:r.name})};HA.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);e.pop(),r.apply(this,e).then(n=>t(null,n),t)},"name",{value:r.name})}});var Kk=E((Uve,zk)=>{var qa=require("constants"),qne=process.cwd,W0=null,Gne=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return W0||(W0=qne.call(process)),W0};try{process.cwd()}catch{}typeof process.chdir=="function"&&(zA=process.chdir,process.chdir=function(r){W0=null,zA.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,zA));var zA;zk.exports=Wne;function Wne(r){qa.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(r),r.lutimes||t(r),r.chown=s(r.chown),r.fchown=s(r.fchown),r.lchown=s(r.lchown),r.chmod=n(r.chmod),r.fchmod=n(r.fchmod),r.lchmod=n(r.lchmod),r.chownSync=o(r.chownSync),r.fchownSync=o(r.fchownSync),r.lchownSync=o(r.lchownSync),r.chmodSync=i(r.chmodSync),r.fchmodSync=i(r.fchmodSync),r.lchmodSync=i(r.lchmodSync),r.stat=c(r.stat),r.fstat=c(r.fstat),r.lstat=c(r.lstat),r.statSync=l(r.statSync),r.fstatSync=l(r.fstatSync),r.lstatSync=l(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(f,d,p){p&&process.nextTick(p)},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(f,d,p,h){h&&process.nextTick(h)},r.lchownSync=function(){}),Gne==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:(function(f){function d(p,h,_){var y=Date.now(),S=0;f(p,h,a(function w(T){if(T&&(T.code==="EACCES"||T.code==="EPERM"||T.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){r.stat(h,function(O,A){O&&O.code==="ENOENT"?f(p,h,w):_(T)})},S),S<100&&(S+=10);return}_&&_(T)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(r.rename)),r.read=typeof r.read!="function"?r.read:(function(f){function d(p,h,_,y,S,w){var T;if(w&&typeof w=="function"){var O=0;T=a(function(A,x,P){if(A&&A.code==="EAGAIN"&&O<10)return O++,f.call(r,p,h,_,y,S,T);w.apply(this,arguments)},"callback")}return f.call(r,p,h,_,y,S,T)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:(function(f){return function(d,p,h,_,y){for(var S=0;;)try{return f.call(r,d,p,h,_,y)}catch(w){if(w.code==="EAGAIN"&&S<10){S++;continue}throw w}}})(r.readSync);function e(f){f.lchmod=function(d,p,h){f.open(d,qa.O_WRONLY|qa.O_SYMLINK,p,function(_,y){if(_){h&&h(_);return}f.fchmod(y,p,function(S){f.close(y,function(w){h&&h(S||w)})})})},f.lchmodSync=function(d,p){var h=f.openSync(d,qa.O_WRONLY|qa.O_SYMLINK,p),_=!0,y;try{y=f.fchmodSync(h,p),_=!1}finally{if(_)try{f.closeSync(h)}catch{}else f.closeSync(h)}return y}}a(e,"patchLchmod");function t(f){qa.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,p,h,_){f.open(d,qa.O_SYMLINK,function(y,S){if(y){_&&_(y);return}f.futimes(S,p,h,function(w){f.close(S,function(T){_&&_(w||T)})})})},f.lutimesSync=function(d,p,h){var _=f.openSync(d,qa.O_SYMLINK),y,S=!0;try{y=f.futimesSync(_,p,h),S=!1}finally{if(S)try{f.closeSync(_)}catch{}else f.closeSync(_)}return y}):f.futimes&&(f.lutimes=function(d,p,h,_){_&&process.nextTick(_)},f.lutimesSync=function(){})}a(t,"patchLutimes");function n(f){return f&&function(d,p,h){return f.call(r,d,p,function(_){u(_)&&(_=null),h&&h.apply(this,arguments)})}}a(n,"chmodFix");function i(f){return f&&function(d,p){try{return f.call(r,d,p)}catch(h){if(!u(h))throw h}}}a(i,"chmodFixSync");function s(f){return f&&function(d,p,h,_){return f.call(r,d,p,h,function(y){u(y)&&(y=null),_&&_.apply(this,arguments)})}}a(s,"chownFix");function o(f){return f&&function(d,p,h){try{return f.call(r,d,p,h)}catch(_){if(!u(_))throw _}}}a(o,"chownFixSync");function c(f){return f&&function(d,p,h){typeof p=="function"&&(h=p,p=null);function _(y,S){S&&(S.uid<0&&(S.uid+=4294967296),S.gid<0&&(S.gid+=4294967296)),h&&h.apply(this,arguments)}return a(_,"callback"),p?f.call(r,d,p,_):f.call(r,d,_)}}a(c,"statFix");function l(f){return f&&function(d,p){var h=p?f.call(r,d,p):f.call(r,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}a(l,"statFixSync");function u(f){if(!f||f.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(f.code==="EINVAL"||f.code==="EPERM"))}a(u,"chownErOk")}a(Wne,"patch")});var Xk=E((Vve,Qk)=>{var Yk=require("stream").Stream;Qk.exports=Hne;function Hne(r){return{ReadStream:e,WriteStream:t};function e(n,i){if(!(this instanceof e))return new e(n,i);Yk.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),c=0,l=o.length;c<l;c++){var u=o[c];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}r.open(this.path,this.flags,this.mode,function(f,d){if(f){s.emit("error",f),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function t(n,i){if(!(this instanceof t))return new t(n,i);Yk.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,c=s.length;o<c;o++){var l=s[o];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Hne,"legacy")});var Zk=E((Gve,Jk)=>{"use strict";Jk.exports=Kne;var zne=Object.getPrototypeOf||function(r){return r.__proto__};function Kne(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var e={__proto__:zne(r)};else var e=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}a(Kne,"clone")});var Wu=E((Hve,QA)=>{var zt=require("fs"),Yne=Kk(),Qne=Xk(),Xne=Zk(),H0=require("util"),en,K0;typeof Symbol=="function"&&typeof Symbol.for=="function"?(en=Symbol.for("graceful-fs.queue"),K0=Symbol.for("graceful-fs.previous")):(en="___graceful-fs.queue",K0="___graceful-fs.previous");function Jne(){}a(Jne,"noop");function rM(r,e){Object.defineProperty(r,en,{get:a(function(){return e},"get")})}a(rM,"publishQueue");var Xc=Jne;H0.debuglog?Xc=H0.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Xc=a(function(){var r=H0.format.apply(H0,arguments);r="GFS4: "+r.split(/\n/).join(`
|
|
359
|
+
GFS4: `),console.error(r)},"debug"));zt[en]||(eM=global[en]||[],rM(zt,eM),zt.close=(function(r){function e(t,n){return r.call(zt,t,function(i){i||tM(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,K0,{value:r}),e})(zt.close),zt.closeSync=(function(r){function e(t){r.apply(zt,arguments),tM()}return a(e,"closeSync"),Object.defineProperty(e,K0,{value:r}),e})(zt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Xc(zt[en]),require("assert").equal(zt[en].length,0)}));var eM;global[en]||rM(global,zt[en]);QA.exports=KA(Xne(zt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!zt.__patched&&(QA.exports=KA(zt),zt.__patched=!0);function KA(r){Yne(r),r.gracefulify=KA,r.createReadStream=x,r.createWriteStream=P;var e=r.readFile;r.readFile=t;function t($,K,N){return typeof K=="function"&&(N=K,K=null),ae($,K,N);function ae(we,ee,pe,Y){return e(we,ee,function(Ee){Ee&&(Ee.code==="EMFILE"||Ee.code==="ENFILE")?Gu([ae,[we,ee,pe],Ee,Y||Date.now(),Date.now()]):typeof pe=="function"&&pe.apply(this,arguments)})}a(ae,"go$readFile")}a(t,"readFile");var n=r.writeFile;r.writeFile=i;function i($,K,N,ae){return typeof N=="function"&&(ae=N,N=null),we($,K,N,ae);function we(ee,pe,Y,Ee,ie){return n(ee,pe,Y,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Gu([we,[ee,pe,Y,Ee],ne,ie||Date.now(),Date.now()]):typeof Ee=="function"&&Ee.apply(this,arguments)})}a(we,"go$writeFile")}a(i,"writeFile");var s=r.appendFile;s&&(r.appendFile=o);function o($,K,N,ae){return typeof N=="function"&&(ae=N,N=null),we($,K,N,ae);function we(ee,pe,Y,Ee,ie){return s(ee,pe,Y,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Gu([we,[ee,pe,Y,Ee],ne,ie||Date.now(),Date.now()]):typeof Ee=="function"&&Ee.apply(this,arguments)})}a(we,"go$appendFile")}a(o,"appendFile");var c=r.copyFile;c&&(r.copyFile=l);function l($,K,N,ae){return typeof N=="function"&&(ae=N,N=0),we($,K,N,ae);function we(ee,pe,Y,Ee,ie){return c(ee,pe,Y,function(ne){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Gu([we,[ee,pe,Y,Ee],ne,ie||Date.now(),Date.now()]):typeof Ee=="function"&&Ee.apply(this,arguments)})}a(we,"go$copyFile")}a(l,"copyFile");var u=r.readdir;r.readdir=d;var f=/^v[0-5]\./;function d($,K,N){typeof K=="function"&&(N=K,K=null);var ae=f.test(process.version)?a(function(pe,Y,Ee,ie){return u(pe,we(pe,Y,Ee,ie))},"go$readdir"):a(function(pe,Y,Ee,ie){return u(pe,Y,we(pe,Y,Ee,ie))},"go$readdir");return ae($,K,N);function we(ee,pe,Y,Ee){return function(ie,ne){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Gu([ae,[ee,pe,Y],ie,Ee||Date.now(),Date.now()]):(ne&&ne.sort&&ne.sort(),typeof Y=="function"&&Y.call(this,ie,ne))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var p=Qne(r);w=p.ReadStream,O=p.WriteStream}var h=r.ReadStream;h&&(w.prototype=Object.create(h.prototype),w.prototype.open=T);var _=r.WriteStream;_&&(O.prototype=Object.create(_.prototype),O.prototype.open=A),Object.defineProperty(r,"ReadStream",{get:a(function(){return w},"get"),set:a(function($){w=$},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(r,"WriteStream",{get:a(function(){return O},"get"),set:a(function($){O=$},"set"),enumerable:!0,configurable:!0});var y=w;Object.defineProperty(r,"FileReadStream",{get:a(function(){return y},"get"),set:a(function($){y=$},"set"),enumerable:!0,configurable:!0});var S=O;Object.defineProperty(r,"FileWriteStream",{get:a(function(){return S},"get"),set:a(function($){S=$},"set"),enumerable:!0,configurable:!0});function w($,K){return this instanceof w?(h.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}a(w,"ReadStream");function T(){var $=this;j($.path,$.flags,$.mode,function(K,N){K?($.autoClose&&$.destroy(),$.emit("error",K)):($.fd=N,$.emit("open",N),$.read())})}a(T,"ReadStream$open");function O($,K){return this instanceof O?(_.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}a(O,"WriteStream");function A(){var $=this;j($.path,$.flags,$.mode,function(K,N){K?($.destroy(),$.emit("error",K)):($.fd=N,$.emit("open",N))})}a(A,"WriteStream$open");function x($,K){return new r.ReadStream($,K)}a(x,"createReadStream");function P($,K){return new r.WriteStream($,K)}a(P,"createWriteStream");var V=r.open;r.open=j;function j($,K,N,ae){return typeof N=="function"&&(ae=N,N=null),we($,K,N,ae);function we(ee,pe,Y,Ee,ie){return V(ee,pe,Y,function(ne,de){ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?Gu([we,[ee,pe,Y,Ee],ne,ie||Date.now(),Date.now()]):typeof Ee=="function"&&Ee.apply(this,arguments)})}a(we,"go$open")}return a(j,"open"),r}a(KA,"patch");function Gu(r){Xc("ENQUEUE",r[0].name,r[1]),zt[en].push(r),YA()}a(Gu,"enqueue");var z0;function tM(){for(var r=Date.now(),e=0;e<zt[en].length;++e)zt[en][e].length>2&&(zt[en][e][3]=r,zt[en][e][4]=r);YA()}a(tM,"resetQueue");function YA(){if(clearTimeout(z0),z0=void 0,zt[en].length!==0){var r=zt[en].shift(),e=r[0],t=r[1],n=r[2],i=r[3],s=r[4];if(i===void 0)Xc("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Xc("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,n)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Xc("RETRY",e.name,t),e.apply(null,t.concat([i]))):zt[en].push(r)}z0===void 0&&(z0=setTimeout(YA,0))}}a(YA,"retry")});var On=E(Ko=>{"use strict";var nM=Mr().fromCallback,Cn=Wu(),Zne=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(r=>typeof Cn[r]=="function");Object.assign(Ko,Cn);Zne.forEach(r=>{Ko[r]=nM(Cn[r])});Ko.exists=function(r,e){return typeof e=="function"?Cn.exists(r,e):new Promise(t=>Cn.exists(r,t))};Ko.read=function(r,e,t,n,i,s){return typeof s=="function"?Cn.read(r,e,t,n,i,s):new Promise((o,c)=>{Cn.read(r,e,t,n,i,(l,u,f)=>{if(l)return c(l);o({bytesRead:u,buffer:f})})})};Ko.write=function(r,e,...t){return typeof t[t.length-1]=="function"?Cn.write(r,e,...t):new Promise((n,i)=>{Cn.write(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffer:c})})})};Ko.readv=function(r,e,...t){return typeof t[t.length-1]=="function"?Cn.readv(r,e,...t):new Promise((n,i)=>{Cn.readv(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesRead:o,buffers:c})})})};Ko.writev=function(r,e,...t){return typeof t[t.length-1]=="function"?Cn.writev(r,e,...t):new Promise((n,i)=>{Cn.writev(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffers:c})})})};typeof Cn.realpath.native=="function"?Ko.realpath.native=nM(Cn.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var sM=E((Yve,iM)=>{"use strict";var eie=require("path");iM.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(eie.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var lM=E((Xve,XA)=>{"use strict";var oM=On(),{checkPath:aM}=sM(),cM=a(r=>{let e={mode:511};return typeof r=="number"?r:{...e,...r}.mode},"getMode");XA.exports.makeDir=async(r,e)=>(aM(r),oM.mkdir(r,{mode:cM(e),recursive:!0}));XA.exports.makeDirSync=(r,e)=>(aM(r),oM.mkdirSync(r,{mode:cM(e),recursive:!0}))});var ls=E((Zve,uM)=>{"use strict";var tie=Mr().fromPromise,{makeDir:rie,makeDirSync:JA}=lM(),ZA=tie(rie);uM.exports={mkdirs:ZA,mkdirsSync:JA,mkdirp:ZA,mkdirpSync:JA,ensureDir:ZA,ensureDirSync:JA}});var Ga=E((eTe,dM)=>{"use strict";var nie=Mr().fromPromise,fM=On();function iie(r){return fM.access(r).then(()=>!0).catch(()=>!1)}a(iie,"pathExists");dM.exports={pathExists:nie(iie),pathExistsSync:fM.existsSync}});var eI=E((rTe,pM)=>{"use strict";var Hu=On(),sie=Mr().fromPromise;async function oie(r,e,t){let n=await Hu.open(r,"r+"),i=null;try{await Hu.futimes(n,e,t)}finally{try{await Hu.close(n)}catch(s){i=s}}if(i)throw i}a(oie,"utimesMillis");function aie(r,e,t){let n=Hu.openSync(r,"r+");return Hu.futimesSync(n,e,t),Hu.closeSync(n)}a(aie,"utimesMillisSync");pM.exports={utimesMillis:sie(oie),utimesMillisSync:aie}});var Jc=E((iTe,yM)=>{"use strict";var zu=On(),jr=require("path"),hM=Mr().fromPromise;function cie(r,e,t){let n=t.dereference?i=>zu.stat(i,{bigint:!0}):i=>zu.lstat(i,{bigint:!0});return Promise.all([n(r),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}a(cie,"getStats");function lie(r,e,t){let n,i=t.dereference?o=>zu.statSync(o,{bigint:!0}):o=>zu.lstatSync(o,{bigint:!0}),s=i(r);try{n=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:n}}a(lie,"getStatsSync");async function uie(r,e,t,n){let{srcStat:i,destStat:s}=await cie(r,e,n);if(s){if(vp(i,s)){let o=jr.basename(r),c=jr.basename(e);if(t==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&tI(r,e))throw new Error(Y0(r,e,t));return{srcStat:i,destStat:s}}a(uie,"checkPaths");function fie(r,e,t,n){let{srcStat:i,destStat:s}=lie(r,e,n);if(s){if(vp(i,s)){let o=jr.basename(r),c=jr.basename(e);if(t==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&tI(r,e))throw new Error(Y0(r,e,t));return{srcStat:i,destStat:s}}a(fie,"checkPathsSync");async function mM(r,e,t,n){let i=jr.resolve(jr.dirname(r)),s=jr.resolve(jr.dirname(t));if(s===i||s===jr.parse(s).root)return;let o;try{o=await zu.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(vp(e,o))throw new Error(Y0(r,t,n));return mM(r,e,s,n)}a(mM,"checkParentPaths");function gM(r,e,t,n){let i=jr.resolve(jr.dirname(r)),s=jr.resolve(jr.dirname(t));if(s===i||s===jr.parse(s).root)return;let o;try{o=zu.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(vp(e,o))throw new Error(Y0(r,t,n));return gM(r,e,s,n)}a(gM,"checkParentPathsSync");function vp(r,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===r.ino&&e.dev===r.dev}a(vp,"areIdentical");function tI(r,e){let t=jr.resolve(r).split(jr.sep).filter(i=>i),n=jr.resolve(e).split(jr.sep).filter(i=>i);return t.every((i,s)=>n[s]===i)}a(tI,"isSrcSubdir");function Y0(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}a(Y0,"errMsg");yM.exports={checkPaths:hM(uie),checkPathsSync:fie,checkParentPaths:hM(mM),checkParentPathsSync:gM,isSrcSubdir:tI,areIdentical:vp}});var bM=E((oTe,_M)=>{"use strict";async function die(r,e){let t=[];for await(let n of r)t.push(e(n).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(n=>n.then(i=>{if(i!==null)throw i})))}a(die,"asyncIteratorConcurrentProcess");_M.exports={asyncIteratorConcurrentProcess:die}});var TM=E((cTe,vM)=>{"use strict";var hn=On(),Tp=require("path"),{mkdirs:pie}=ls(),{pathExists:hie}=Ga(),{utimesMillis:mie}=eI(),Ap=Jc(),{asyncIteratorConcurrentProcess:gie}=bM();async function yie(r,e,t={}){typeof t=="function"&&(t={filter:t}),t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
360
360
|
|
|
361
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Ap.checkPaths(r,e,"copy",t);if(await Ap.checkParentPaths(r,n,e,"copy"),!await wM(r,e,t))return;let o=Tp.dirname(e);await hie(o)||await pie(o),await EM(i,r,e,t)}a(yie,"copy");async function wM(r,e,t){return t.filter?t.filter(r,e):!0}a(wM,"runFilter");async function EM(r,e,t,n){let s=await(n.dereference?hn.stat:hn.lstat)(e);if(s.isDirectory())return wie(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return _ie(s,r,e,t,n);if(s.isSymbolicLink())return Eie(r,e,t,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(EM,"getStatsAndPerformCopy");async function _ie(r,e,t,n,i){if(!e)return SM(r,t,n,i);if(i.overwrite)return await hn.unlink(n),SM(r,t,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}a(_ie,"onFile");async function SM(r,e,t,n){if(await hn.copyFile(e,t),n.preserveTimestamps){bie(r.mode)&&await Sie(t,r.mode);let i=await hn.stat(e);await mie(t,i.atime,i.mtime)}return hn.chmod(t,r.mode)}a(SM,"copyFile");function bie(r){return(r&128)===0}a(bie,"fileIsNotWritable");function Sie(r,e){return hn.chmod(r,e|128)}a(Sie,"makeFileWritable");async function wie(r,e,t,n,i){e||await hn.mkdir(n),await gie(await hn.opendir(t),async s=>{let o=Tp.join(t,s.name),c=Tp.join(n,s.name);if(await wM(o,c,i)){let{destStat:u}=await Ap.checkPaths(o,c,"copy",i);await EM(u,o,c,i)}}),e||await hn.chmod(n,r.mode)}a(wie,"onDir");async function Eie(r,e,t,n){let i=await hn.readlink(e);if(n.dereference&&(i=Tp.resolve(process.cwd(),i)),!r)return hn.symlink(i,t);let s=null;try{s=await hn.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return hn.symlink(i,t);throw o}if(n.dereference&&(s=Tp.resolve(process.cwd(),s)),Ap.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Ap.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await hn.unlink(t),hn.symlink(i,t)}a(Eie,"onLink");vM.exports=yie});var CM=E((
|
|
361
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Ap.checkPaths(r,e,"copy",t);if(await Ap.checkParentPaths(r,n,e,"copy"),!await wM(r,e,t))return;let o=Tp.dirname(e);await hie(o)||await pie(o),await EM(i,r,e,t)}a(yie,"copy");async function wM(r,e,t){return t.filter?t.filter(r,e):!0}a(wM,"runFilter");async function EM(r,e,t,n){let s=await(n.dereference?hn.stat:hn.lstat)(e);if(s.isDirectory())return wie(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return _ie(s,r,e,t,n);if(s.isSymbolicLink())return Eie(r,e,t,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(EM,"getStatsAndPerformCopy");async function _ie(r,e,t,n,i){if(!e)return SM(r,t,n,i);if(i.overwrite)return await hn.unlink(n),SM(r,t,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}a(_ie,"onFile");async function SM(r,e,t,n){if(await hn.copyFile(e,t),n.preserveTimestamps){bie(r.mode)&&await Sie(t,r.mode);let i=await hn.stat(e);await mie(t,i.atime,i.mtime)}return hn.chmod(t,r.mode)}a(SM,"copyFile");function bie(r){return(r&128)===0}a(bie,"fileIsNotWritable");function Sie(r,e){return hn.chmod(r,e|128)}a(Sie,"makeFileWritable");async function wie(r,e,t,n,i){e||await hn.mkdir(n),await gie(await hn.opendir(t),async s=>{let o=Tp.join(t,s.name),c=Tp.join(n,s.name);if(await wM(o,c,i)){let{destStat:u}=await Ap.checkPaths(o,c,"copy",i);await EM(u,o,c,i)}}),e||await hn.chmod(n,r.mode)}a(wie,"onDir");async function Eie(r,e,t,n){let i=await hn.readlink(e);if(n.dereference&&(i=Tp.resolve(process.cwd(),i)),!r)return hn.symlink(i,t);let s=null;try{s=await hn.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return hn.symlink(i,t);throw o}if(n.dereference&&(s=Tp.resolve(process.cwd(),s)),Ap.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Ap.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await hn.unlink(t),hn.symlink(i,t)}a(Eie,"onLink");vM.exports=yie});var CM=E((uTe,RM)=>{"use strict";var Pn=Wu(),Ip=require("path"),vie=ls().mkdirsSync,Tie=eI().utimesMillisSync,xp=Jc();function Aie(r,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
362
362
|
|
|
363
|
-
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=xp.checkPathsSync(r,e,"copy",t);if(xp.checkParentPathsSync(r,n,e,"copy"),t.filter&&!t.filter(r,e))return;let s=Ip.dirname(e);return Pn.existsSync(s)||vie(s),AM(i,r,e,t)}a(Aie,"copySync");function AM(r,e,t,n){let s=(n.dereference?Pn.statSync:Pn.lstatSync)(e);if(s.isDirectory())return Die(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Iie(s,r,e,t,n);if(s.isSymbolicLink())return Nie(r,e,t,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(AM,"getStats");function Iie(r,e,t,n,i){return e?xie(r,t,n,i):IM(r,t,n,i)}a(Iie,"onFile");function xie(r,e,t,n){if(n.overwrite)return Pn.unlinkSync(t),IM(r,e,t,n);if(n.errorOnExist)throw new Error(`'${t}' already exists`)}a(xie,"mayCopyFile");function IM(r,e,t,n){return Pn.copyFileSync(e,t),n.preserveTimestamps&&Rie(r.mode,e,t),rI(t,r.mode)}a(IM,"copyFile");function Rie(r,e,t){return Cie(r)&&Oie(t,r),Pie(e,t)}a(Rie,"handleTimestamps");function Cie(r){return(r&128)===0}a(Cie,"fileIsNotWritable");function Oie(r,e){return rI(r,e|128)}a(Oie,"makeFileWritable");function rI(r,e){return Pn.chmodSync(r,e)}a(rI,"setDestMode");function Pie(r,e){let t=Pn.statSync(r);return Tie(e,t.atime,t.mtime)}a(Pie,"setDestTimestamps");function Die(r,e,t,n,i){return e?xM(t,n,i):Fie(r.mode,t,n,i)}a(Die,"onDir");function Fie(r,e,t,n){return Pn.mkdirSync(t),xM(e,t,n),rI(t,r)}a(Fie,"mkDirAndCopy");function xM(r,e,t){let n=Pn.opendirSync(r);try{let i;for(;(i=n.readSync())!==null;)Lie(i.name,r,e,t)}finally{n.closeSync()}}a(xM,"copyDir");function Lie(r,e,t,n){let i=Ip.join(e,r),s=Ip.join(t,r);if(n.filter&&!n.filter(i,s))return;let{destStat:o}=xp.checkPathsSync(i,s,"copy",n);return AM(o,i,s,n)}a(Lie,"copyDirItem");function Nie(r,e,t,n){let i=Pn.readlinkSync(e);if(n.dereference&&(i=Ip.resolve(process.cwd(),i)),r){let s;try{s=Pn.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Pn.symlinkSync(i,t);throw o}if(n.dereference&&(s=Ip.resolve(process.cwd(),s)),xp.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(xp.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return kie(i,t)}else return Pn.symlinkSync(i,t)}a(Nie,"onLink");function kie(r,e){return Pn.unlinkSync(e),Pn.symlinkSync(r,e)}a(kie,"copyLink");RM.exports=Aie});var Q0=E((
|
|
364
|
-
`,finalEOL:t=!0,replacer:n=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(r,n,i).replace(/\n/g,e)+s}a(dse,"stringify");function pse(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}a(pse,"stripBom");pj.exports={stringify:dse,stripBom:pse}});var yj=E((CTe,gj)=>{var Ku;try{Ku=Wu()}catch{Ku=require("fs")}var J0=Mr(),{stringify:hj,stripBom:mj}=X0();async function hse(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ku,n="throws"in e?e.throws:!0,i=await J0.fromCallback(t.readFile)(r,e);i=mj(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(n)throw o.message=`${r}: ${o.message}`,o;return null}return s}a(hse,"_readFile");var mse=J0.fromPromise(hse);function gse(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ku,n="throws"in e?e.throws:!0;try{let i=t.readFileSync(r,e);return i=mj(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${r}: ${i.message}`,i;return null}}a(gse,"readFileSync");async function yse(r,e,t={}){let n=t.fs||Ku,i=hj(e,t);await J0.fromCallback(n.writeFile)(r,i,t)}a(yse,"_writeFile");var _se=J0.fromPromise(yse);function bse(r,e,t={}){let n=t.fs||Ku,i=hj(e,t);return n.writeFileSync(r,i,t)}a(bse,"writeFileSync");gj.exports={readFile:mse,readFileSync:gse,writeFile:_se,writeFileSync:bse}});var bj=E((PTe,_j)=>{"use strict";var Z0=yj();_j.exports={readJson:Z0.readFile,readJsonSync:Z0.readFileSync,writeJson:Z0.writeFile,writeJsonSync:Z0.writeFileSync}});var e_=E((DTe,Ej)=>{"use strict";var Sse=Mr().fromPromise,nI=On(),Sj=require("path"),wj=ls(),wse=Ga().pathExists;async function Ese(r,e,t="utf-8"){let n=Sj.dirname(r);return await wse(n)||await wj.mkdirs(n),nI.writeFile(r,e,t)}a(Ese,"outputFile");function vse(r,...e){let t=Sj.dirname(r);nI.existsSync(t)||wj.mkdirsSync(t),nI.writeFileSync(r,...e)}a(vse,"outputFileSync");Ej.exports={outputFile:Sse(Ese),outputFileSync:vse}});var Tj=E((LTe,vj)=>{"use strict";var{stringify:Tse}=X0(),{outputFile:Ase}=e_();async function Ise(r,e,t={}){let n=Tse(e,t);await Ase(r,n,t)}a(Ise,"outputJson");vj.exports=Ise});var Ij=E((kTe,Aj)=>{"use strict";var{stringify:xse}=X0(),{outputFileSync:Rse}=e_();function Cse(r,e,t){let n=xse(e,t);Rse(r,n,t)}a(Cse,"outputJsonSync");Aj.exports=Cse});var Rj=E((jTe,xj)=>{"use strict";var Ose=Mr().fromPromise,Dn=bj();Dn.outputJson=Ose(Tj());Dn.outputJsonSync=Ij();Dn.outputJSON=Dn.outputJson;Dn.outputJSONSync=Dn.outputJsonSync;Dn.writeJSON=Dn.writeJson;Dn.writeJSONSync=Dn.writeJsonSync;Dn.readJSON=Dn.readJson;Dn.readJSONSync=Dn.readJsonSync;xj.exports=Dn});var Fj=E(($Te,Dj)=>{"use strict";var Pse=On(),Cj=require("path"),{copy:Dse}=Q0(),{remove:Pj}=Rp(),{mkdirp:Fse}=ls(),{pathExists:Lse}=Ga(),Oj=Jc();async function Nse(r,e,t={}){let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await Oj.checkPaths(r,e,"move",t);await Oj.checkParentPaths(r,i,e,"move");let o=Cj.dirname(e);return Cj.parse(o).root!==o&&await Fse(o),kse(r,e,n,s)}a(Nse,"move");async function kse(r,e,t,n){if(!n){if(t)await Pj(e);else if(await Lse(e))throw new Error("dest already exists.")}try{await Pse.rename(r,e)}catch(i){if(i.code!=="EXDEV")throw i;await Mse(r,e,t)}}a(kse,"doRename");async function Mse(r,e,t){return await Dse(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),Pj(r)}a(Mse,"moveAcrossDevice");Dj.exports=Nse});var jj=E((BTe,Mj)=>{"use strict";var Nj=Wu(),sI=require("path"),jse=Q0().copySync,kj=Rp().removeSync,$se=ls().mkdirpSync,Lj=Jc();function Use(r,e,t){t=t||{};let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=Lj.checkPathsSync(r,e,"move",t);return Lj.checkParentPathsSync(r,i,e,"move"),Bse(e)||$se(sI.dirname(e)),Vse(r,e,n,s)}a(Use,"moveSync");function Bse(r){let e=sI.dirname(r);return sI.parse(e).root===e}a(Bse,"isParentRoot");function Vse(r,e,t,n){if(n)return iI(r,e,t);if(t)return kj(e),iI(r,e,t);if(Nj.existsSync(e))throw new Error("dest already exists.");return iI(r,e,t)}a(Vse,"doRename");function iI(r,e,t){try{Nj.renameSync(r,e)}catch(n){if(n.code!=="EXDEV")throw n;return qse(r,e,t)}}a(iI,"rename");function qse(r,e,t){return jse(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),kj(r)}a(qse,"moveAcrossDevice");Mj.exports=Use});var Uj=E((qTe,$j)=>{"use strict";var Gse=Mr().fromPromise;$j.exports={move:Gse(Fj()),moveSync:jj()}});var Qo=E((GTe,Bj)=>{"use strict";Bj.exports={...On(),...Q0(),...UM(),...dj(),...Rj(),...ls(),...Uj(),...e_(),...Ga(),...Rp()}});var L4=E((a2e,F4)=>{"use strict";F4.exports=P4;function P4(r,e,t){r instanceof RegExp&&(r=O4(r,t)),e instanceof RegExp&&(e=O4(e,t));var n=D4(r,e,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+e.length)}}a(P4,"balanced");function O4(r,e){var t=e.match(r);return t?t[0]:null}a(O4,"maybeMatch");P4.range=D4;function D4(r,e,t){var n,i,s,o,c,l=t.indexOf(r),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(r===e)return[l,u];for(n=[],s=t.length;f>=0&&!c;)f==l?(n.push(f),l=t.indexOf(r,f+1)):n.length==1?c=[n.pop(),u]:(i=n.pop(),i<s&&(s=i,o=u),u=t.indexOf(e,f+1)),f=l<u&&l>=0?l:u;n.length&&(c=[s,o])}return c}a(D4,"range")});var V4=E((l2e,B4)=>{var N4=L4();B4.exports=Zse;var k4="\0SLASH"+Math.random()+"\0",M4="\0OPEN"+Math.random()+"\0",OI="\0CLOSE"+Math.random()+"\0",j4="\0COMMA"+Math.random()+"\0",$4="\0PERIOD"+Math.random()+"\0";function CI(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}a(CI,"numeric");function Xse(r){return r.split("\\\\").join(k4).split("\\{").join(M4).split("\\}").join(OI).split("\\,").join(j4).split("\\.").join($4)}a(Xse,"escapeBraces");function Jse(r){return r.split(k4).join("\\").split(M4).join("{").split(OI).join("}").split(j4).join(",").split($4).join(".")}a(Jse,"unescapeBraces");function U4(r){if(!r)return[""];var e=[],t=N4("{","}",r);if(!t)return r.split(",");var n=t.pre,i=t.body,s=t.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var c=U4(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),e.push.apply(e,o),e}a(U4,"parseCommaParts");function Zse(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),Dp(Xse(r),!0).map(Jse)):[]}a(Zse,"expandTop");function eoe(r){return"{"+r+"}"}a(eoe,"embrace");function toe(r){return/^-?0\d/.test(r)}a(toe,"isPadded");function roe(r,e){return r<=e}a(roe,"lte");function noe(r,e){return r>=e}a(noe,"gte");function Dp(r,e){var t=[],n=N4("{","}",r);if(!n)return[r];var i=n.pre,s=n.post.length?Dp(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<s.length;o++){var c=i+"{"+n.body+"}"+s[o];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),f=l||u,d=n.body.indexOf(",")>=0;if(!f&&!d)return n.post.match(/,(?!,).*\}/)?(r=n.pre+"{"+n.body+OI+n.post,Dp(r)):[r];var p;if(f)p=n.body.split(/\.\./);else if(p=U4(n.body),p.length===1&&(p=Dp(p[0],!1).map(eoe),p.length===1))return s.map(function(K){return n.pre+p[0]+K});var h;if(f){var _=CI(p[0]),y=CI(p[1]),S=Math.max(p[0].length,p[1].length),w=p.length==3?Math.max(Math.abs(CI(p[2])),1):1,T=roe,O=y<_;O&&(w*=-1,T=noe);var A=p.some(toe);h=[];for(var x=_;T(x,y);x+=w){var P;if(u)P=String.fromCharCode(x),P==="\\"&&(P="");else if(P=String(x),A){var V=S-P.length;if(V>0){var j=new Array(V+1).join("0");x<0?P="-"+j+P.slice(1):P=j+P}}h.push(P)}}else{h=[];for(var $=0;$<p.length;$++)h.push.apply(h,Dp(p[$],!1))}for(var $=0;$<h.length;$++)for(var o=0;o<s.length;o++){var c=i+h[$]+s[o];(!e||f||c)&&t.push(c)}}return t}a(Dp,"expand")});var l$=E(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.createPathBasedTargetResolver=bs;rn.createCreateRelatedTaskService=qle;rn.createCreateRelatedProjectService=Gle;rn.createCreateAssetService=Wle;rn.createArchiveAssetService=Hle;rn.createCleanPropertiesService=zle;rn.createFixMissingLabelService=Kle;rn.createRenameToUidService=Yle;rn.createRepairFolderService=Xle;rn.createPlanForEveningService=Jle;rn.createUpdatePropertyService=Zle;rn.createRemovePropertyService=eue;rn.createSetStatusService=tue;rn.createDuplicateAssetService=rue;rn.rewriteFrontmatterScalars=c$;var ah=it();function bs(r){return{resolveFile(e){let t=(0,ah.iriToVaultPath)(e)??e,n=t.endsWith(".md")?t:`${t}.md`,i=r.getAbstractFileByPath(n);if(!i||!("basename"in i))throw new Error(`Cannot resolve target file for IRI: ${e}`);return i}}}a(bs,"createPathBasedTargetResolver");var Mx=a(()=>null,"NULL_CLASS_RESOLVER");function Z_(r){return r.startsWith('"[[')&&r.endsWith(']]"')?r:r.startsWith("[[")&&r.endsWith("]]")?`"${r}"`:`"[[${r}]]"`}a(Z_,"toQuotedWikilink");function qle(r,e,t=bs(r),n,i=Mx){return{async execute(s,o){let c=o?.label;if(!c)throw new Error("createRelatedTask requires userInput.label");let l=t.resolveFile(s),u=r.getFrontmatter(l)??{},f=l.parent?.path||"",d={ems__Effort_status:'"[[c42245d0-01de-4c35-bfcf-d910445ea28e]]"'},p=o?.parentProperty;p&&l.basename&&(d[p]=`"[[${l.basename}]]"`);let h=await e.createAsset({className:"ems__Task",label:c,folderPath:f,propertyValues:d,parentFile:l,parentMetadata:u,classResolver:i});n&&await n(h)}}}a(qle,"createCreateRelatedTaskService");function Gle(r,e,t=bs(r),n,i=Mx){return{async execute(s,o){let c=o?.label;if(!c)throw new Error("createRelatedProject requires userInput.label");let l=t.resolveFile(s),u=r.getFrontmatter(l)??{},f=l.parent?.path||"",d={ems__Effort_status:'"[[c42245d0-01de-4c35-bfcf-d910445ea28e]]"'},p=o?.parentProperty;p&&l.basename&&(d[p]=`"[[${l.basename}]]"`);let h=await e.createAsset({className:"ems__Project",label:c,folderPath:f,propertyValues:d,parentFile:l,parentMetadata:u,classResolver:i});n&&await n(h)}}}a(Gle,"createCreateRelatedProjectService");function Wle(r,e,t=Mx,n=bs(r)){return{async execute(i,s){let o=s?.prototypeUID??s?.prototype,c=s?.label,l=s?.folder,u=s?.ownerIdentity,f=s?.isDefinedBy;if(!o)throw new Error("createAsset requires userInput.prototypeUID");if(!c)throw new Error("createAsset requires userInput.label");let d,p;if(i)try{let x=n.resolveFile(i);d=x.path,p=r.getFrontmatter(x)??void 0}catch{}if(!l&&d){let x=d.lastIndexOf("/");l=x>=0?d.substring(0,x):""}if(l===void 0)throw new Error("createAsset requires userInput.folder");let h=o.endsWith("Prototype")?o.slice(0,-9):o,_=crypto.randomUUID(),y=ah.DateFormatter.toISOTimestamp(new Date),S=`${_}.md`,w=l?`${l}/${S}`:S,T=["---",`exo__Asset_uid: ${_}`,`exo__Asset_createdAt: ${y}`,`exo__Asset_label: ${c}`,`exo__Asset_prototype: "[[${o}]]"`,"exo__Instance_class:",` - "[[${h}]]"`],O=!1;if(f&&(T.push(`exo__Asset_isDefinedBy: ${Z_(f)}`),O=!0),p){let x=p.exo__Instance_class,V=(Array.isArray(x)?x:x!=null?[x]:[]).some($=>ah.WikiLinkHelpers.resolveSymbolic(String($),t).includes("Area")),j=d?d.substring(d.lastIndexOf("/")+1).replace(/\.md$/,""):void 0;if(j){let $=V?"ems__Effort_area":"ems__Effort_parent";T.push(`${$}: "[[${j}]]"`)}!V&&p.ems__Effort_area&&T.push(`ems__Effort_area: ${Z_(String(p.ems__Effort_area))}`),T.push('ems__Effort_status: "[[753a44d5-846c-4b82-9196-4fd9a4d48777]]"'),!O&&p.exo__Asset_isDefinedBy&&(T.push(`exo__Asset_isDefinedBy: ${Z_(String(p.exo__Asset_isDefinedBy))}`),O=!0)}!O&&u&&T.push(`exo__Asset_isDefinedBy: ${Z_(u)}`),T.push("---","");let A=T.join(`
|
|
363
|
+
see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=xp.checkPathsSync(r,e,"copy",t);if(xp.checkParentPathsSync(r,n,e,"copy"),t.filter&&!t.filter(r,e))return;let s=Ip.dirname(e);return Pn.existsSync(s)||vie(s),AM(i,r,e,t)}a(Aie,"copySync");function AM(r,e,t,n){let s=(n.dereference?Pn.statSync:Pn.lstatSync)(e);if(s.isDirectory())return Die(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Iie(s,r,e,t,n);if(s.isSymbolicLink())return Nie(r,e,t,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(AM,"getStats");function Iie(r,e,t,n,i){return e?xie(r,t,n,i):IM(r,t,n,i)}a(Iie,"onFile");function xie(r,e,t,n){if(n.overwrite)return Pn.unlinkSync(t),IM(r,e,t,n);if(n.errorOnExist)throw new Error(`'${t}' already exists`)}a(xie,"mayCopyFile");function IM(r,e,t,n){return Pn.copyFileSync(e,t),n.preserveTimestamps&&Rie(r.mode,e,t),rI(t,r.mode)}a(IM,"copyFile");function Rie(r,e,t){return Cie(r)&&Oie(t,r),Pie(e,t)}a(Rie,"handleTimestamps");function Cie(r){return(r&128)===0}a(Cie,"fileIsNotWritable");function Oie(r,e){return rI(r,e|128)}a(Oie,"makeFileWritable");function rI(r,e){return Pn.chmodSync(r,e)}a(rI,"setDestMode");function Pie(r,e){let t=Pn.statSync(r);return Tie(e,t.atime,t.mtime)}a(Pie,"setDestTimestamps");function Die(r,e,t,n,i){return e?xM(t,n,i):Fie(r.mode,t,n,i)}a(Die,"onDir");function Fie(r,e,t,n){return Pn.mkdirSync(t),xM(e,t,n),rI(t,r)}a(Fie,"mkDirAndCopy");function xM(r,e,t){let n=Pn.opendirSync(r);try{let i;for(;(i=n.readSync())!==null;)Lie(i.name,r,e,t)}finally{n.closeSync()}}a(xM,"copyDir");function Lie(r,e,t,n){let i=Ip.join(e,r),s=Ip.join(t,r);if(n.filter&&!n.filter(i,s))return;let{destStat:o}=xp.checkPathsSync(i,s,"copy",n);return AM(o,i,s,n)}a(Lie,"copyDirItem");function Nie(r,e,t,n){let i=Pn.readlinkSync(e);if(n.dereference&&(i=Ip.resolve(process.cwd(),i)),r){let s;try{s=Pn.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Pn.symlinkSync(i,t);throw o}if(n.dereference&&(s=Ip.resolve(process.cwd(),s)),xp.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(xp.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return kie(i,t)}else return Pn.symlinkSync(i,t)}a(Nie,"onLink");function kie(r,e){return Pn.unlinkSync(e),Pn.symlinkSync(r,e)}a(kie,"copyLink");RM.exports=Aie});var Q0=E((dTe,OM)=>{"use strict";var Mie=Mr().fromPromise;OM.exports={copy:Mie(TM()),copySync:CM()}});var Rp=E((pTe,DM)=>{"use strict";var PM=Wu(),jie=Mr().fromCallback;function $ie(r,e){PM.rm(r,{recursive:!0,force:!0},e)}a($ie,"remove");function Uie(r){PM.rmSync(r,{recursive:!0,force:!0})}a(Uie,"removeSync");DM.exports={remove:jie($ie),removeSync:Uie}});var UM=E((mTe,$M)=>{"use strict";var Bie=Mr().fromPromise,NM=On(),kM=require("path"),MM=ls(),jM=Rp(),FM=Bie(a(async function(e){let t;try{t=await NM.readdir(e)}catch{return MM.mkdirs(e)}return Promise.all(t.map(n=>jM.remove(kM.join(e,n))))},"emptyDir"));function LM(r){let e;try{e=NM.readdirSync(r)}catch{return MM.mkdirsSync(r)}e.forEach(t=>{t=kM.join(r,t),jM.removeSync(t)})}a(LM,"emptyDirSync");$M.exports={emptyDirSync:LM,emptydirSync:LM,emptyDir:FM,emptydir:FM}});var GM=E((yTe,qM)=>{"use strict";var Vie=Mr().fromPromise,BM=require("path"),Yo=On(),VM=ls();async function qie(r){let e;try{e=await Yo.stat(r)}catch{}if(e&&e.isFile())return;let t=BM.dirname(r),n=null;try{n=await Yo.stat(t)}catch(i){if(i.code==="ENOENT"){await VM.mkdirs(t),await Yo.writeFile(r,"");return}else throw i}n.isDirectory()?await Yo.writeFile(r,""):await Yo.readdir(t)}a(qie,"createFile");function Gie(r){let e;try{e=Yo.statSync(r)}catch{}if(e&&e.isFile())return;let t=BM.dirname(r);try{Yo.statSync(t).isDirectory()||Yo.readdirSync(t)}catch(n){if(n&&n.code==="ENOENT")VM.mkdirsSync(t);else throw n}Yo.writeFileSync(r,"")}a(Gie,"createFileSync");qM.exports={createFile:Vie(qie),createFileSync:Gie}});var YM=E((bTe,KM)=>{"use strict";var Wie=Mr().fromPromise,WM=require("path"),Wa=On(),HM=ls(),{pathExists:Hie}=Ga(),{areIdentical:zM}=Jc();async function zie(r,e){let t;try{t=await Wa.lstat(e)}catch{}let n;try{n=await Wa.lstat(r)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(t&&zM(n,t))return;let i=WM.dirname(e);await Hie(i)||await HM.mkdirs(i),await Wa.link(r,e)}a(zie,"createLink");function Kie(r,e){let t;try{t=Wa.lstatSync(e)}catch{}try{let s=Wa.lstatSync(r);if(t&&zM(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=WM.dirname(e);return Wa.existsSync(n)||HM.mkdirsSync(n),Wa.linkSync(r,e)}a(Kie,"createLinkSync");KM.exports={createLink:Wie(zie),createLinkSync:Kie}});var XM=E((wTe,QM)=>{"use strict";var Ha=require("path"),Cp=On(),{pathExists:Yie}=Ga(),Qie=Mr().fromPromise;async function Xie(r,e){if(Ha.isAbsolute(r)){try{await Cp.lstat(r)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:r,toDst:r}}let t=Ha.dirname(e),n=Ha.join(t,r);if(await Yie(n))return{toCwd:n,toDst:r};try{await Cp.lstat(r)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:r,toDst:Ha.relative(t,r)}}a(Xie,"symlinkPaths");function Jie(r,e){if(Ha.isAbsolute(r)){if(!Cp.existsSync(r))throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}let t=Ha.dirname(e),n=Ha.join(t,r);if(Cp.existsSync(n))return{toCwd:n,toDst:r};if(!Cp.existsSync(r))throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:Ha.relative(t,r)}}a(Jie,"symlinkPathsSync");QM.exports={symlinkPaths:Qie(Xie),symlinkPathsSync:Jie}});var ej=E((vTe,ZM)=>{"use strict";var JM=On(),Zie=Mr().fromPromise;async function ese(r,e){if(e)return e;let t;try{t=await JM.lstat(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(ese,"symlinkType");function tse(r,e){if(e)return e;let t;try{t=JM.lstatSync(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(tse,"symlinkTypeSync");ZM.exports={symlinkType:Zie(ese),symlinkTypeSync:tse}});var ij=E((ATe,nj)=>{"use strict";var rse=Mr().fromPromise,tj=require("path"),Ks=On(),{mkdirs:nse,mkdirsSync:ise}=ls(),{symlinkPaths:sse,symlinkPathsSync:ose}=XM(),{symlinkType:ase,symlinkTypeSync:cse}=ej(),{pathExists:lse}=Ga(),{areIdentical:rj}=Jc();async function use(r,e,t){let n;try{n=await Ks.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let[c,l]=await Promise.all([Ks.stat(r),Ks.stat(e)]);if(rj(c,l))return}let i=await sse(r,e);r=i.toDst;let s=await ase(i.toCwd,t),o=tj.dirname(e);return await lse(o)||await nse(o),Ks.symlink(r,e,s)}a(use,"createSymlink");function fse(r,e,t){let n;try{n=Ks.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let c=Ks.statSync(r),l=Ks.statSync(e);if(rj(c,l))return}let i=ose(r,e);r=i.toDst,t=cse(i.toCwd,t);let s=tj.dirname(e);return Ks.existsSync(s)||ise(s),Ks.symlinkSync(r,e,t)}a(fse,"createSymlinkSync");nj.exports={createSymlink:rse(use),createSymlinkSync:fse}});var dj=E((xTe,fj)=>{"use strict";var{createFile:sj,createFileSync:oj}=GM(),{createLink:aj,createLinkSync:cj}=YM(),{createSymlink:lj,createSymlinkSync:uj}=ij();fj.exports={createFile:sj,createFileSync:oj,ensureFile:sj,ensureFileSync:oj,createLink:aj,createLinkSync:cj,ensureLink:aj,ensureLinkSync:cj,createSymlink:lj,createSymlinkSync:uj,ensureSymlink:lj,ensureSymlinkSync:uj}});var X0=E((RTe,pj)=>{function dse(r,{EOL:e=`
|
|
364
|
+
`,finalEOL:t=!0,replacer:n=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(r,n,i).replace(/\n/g,e)+s}a(dse,"stringify");function pse(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}a(pse,"stripBom");pj.exports={stringify:dse,stripBom:pse}});var yj=E((OTe,gj)=>{var Ku;try{Ku=Wu()}catch{Ku=require("fs")}var J0=Mr(),{stringify:hj,stripBom:mj}=X0();async function hse(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ku,n="throws"in e?e.throws:!0,i=await J0.fromCallback(t.readFile)(r,e);i=mj(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(n)throw o.message=`${r}: ${o.message}`,o;return null}return s}a(hse,"_readFile");var mse=J0.fromPromise(hse);function gse(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ku,n="throws"in e?e.throws:!0;try{let i=t.readFileSync(r,e);return i=mj(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${r}: ${i.message}`,i;return null}}a(gse,"readFileSync");async function yse(r,e,t={}){let n=t.fs||Ku,i=hj(e,t);await J0.fromCallback(n.writeFile)(r,i,t)}a(yse,"_writeFile");var _se=J0.fromPromise(yse);function bse(r,e,t={}){let n=t.fs||Ku,i=hj(e,t);return n.writeFileSync(r,i,t)}a(bse,"writeFileSync");gj.exports={readFile:mse,readFileSync:gse,writeFile:_se,writeFileSync:bse}});var bj=E((DTe,_j)=>{"use strict";var Z0=yj();_j.exports={readJson:Z0.readFile,readJsonSync:Z0.readFileSync,writeJson:Z0.writeFile,writeJsonSync:Z0.writeFileSync}});var e_=E((FTe,Ej)=>{"use strict";var Sse=Mr().fromPromise,nI=On(),Sj=require("path"),wj=ls(),wse=Ga().pathExists;async function Ese(r,e,t="utf-8"){let n=Sj.dirname(r);return await wse(n)||await wj.mkdirs(n),nI.writeFile(r,e,t)}a(Ese,"outputFile");function vse(r,...e){let t=Sj.dirname(r);nI.existsSync(t)||wj.mkdirsSync(t),nI.writeFileSync(r,...e)}a(vse,"outputFileSync");Ej.exports={outputFile:Sse(Ese),outputFileSync:vse}});var Tj=E((NTe,vj)=>{"use strict";var{stringify:Tse}=X0(),{outputFile:Ase}=e_();async function Ise(r,e,t={}){let n=Tse(e,t);await Ase(r,n,t)}a(Ise,"outputJson");vj.exports=Ise});var Ij=E((MTe,Aj)=>{"use strict";var{stringify:xse}=X0(),{outputFileSync:Rse}=e_();function Cse(r,e,t){let n=xse(e,t);Rse(r,n,t)}a(Cse,"outputJsonSync");Aj.exports=Cse});var Rj=E(($Te,xj)=>{"use strict";var Ose=Mr().fromPromise,Dn=bj();Dn.outputJson=Ose(Tj());Dn.outputJsonSync=Ij();Dn.outputJSON=Dn.outputJson;Dn.outputJSONSync=Dn.outputJsonSync;Dn.writeJSON=Dn.writeJson;Dn.writeJSONSync=Dn.writeJsonSync;Dn.readJSON=Dn.readJson;Dn.readJSONSync=Dn.readJsonSync;xj.exports=Dn});var Fj=E((UTe,Dj)=>{"use strict";var Pse=On(),Cj=require("path"),{copy:Dse}=Q0(),{remove:Pj}=Rp(),{mkdirp:Fse}=ls(),{pathExists:Lse}=Ga(),Oj=Jc();async function Nse(r,e,t={}){let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await Oj.checkPaths(r,e,"move",t);await Oj.checkParentPaths(r,i,e,"move");let o=Cj.dirname(e);return Cj.parse(o).root!==o&&await Fse(o),kse(r,e,n,s)}a(Nse,"move");async function kse(r,e,t,n){if(!n){if(t)await Pj(e);else if(await Lse(e))throw new Error("dest already exists.")}try{await Pse.rename(r,e)}catch(i){if(i.code!=="EXDEV")throw i;await Mse(r,e,t)}}a(kse,"doRename");async function Mse(r,e,t){return await Dse(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),Pj(r)}a(Mse,"moveAcrossDevice");Dj.exports=Nse});var jj=E((VTe,Mj)=>{"use strict";var Nj=Wu(),sI=require("path"),jse=Q0().copySync,kj=Rp().removeSync,$se=ls().mkdirpSync,Lj=Jc();function Use(r,e,t){t=t||{};let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=Lj.checkPathsSync(r,e,"move",t);return Lj.checkParentPathsSync(r,i,e,"move"),Bse(e)||$se(sI.dirname(e)),Vse(r,e,n,s)}a(Use,"moveSync");function Bse(r){let e=sI.dirname(r);return sI.parse(e).root===e}a(Bse,"isParentRoot");function Vse(r,e,t,n){if(n)return iI(r,e,t);if(t)return kj(e),iI(r,e,t);if(Nj.existsSync(e))throw new Error("dest already exists.");return iI(r,e,t)}a(Vse,"doRename");function iI(r,e,t){try{Nj.renameSync(r,e)}catch(n){if(n.code!=="EXDEV")throw n;return qse(r,e,t)}}a(iI,"rename");function qse(r,e,t){return jse(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),kj(r)}a(qse,"moveAcrossDevice");Mj.exports=Use});var Uj=E((GTe,$j)=>{"use strict";var Gse=Mr().fromPromise;$j.exports={move:Gse(Fj()),moveSync:jj()}});var Qo=E((WTe,Bj)=>{"use strict";Bj.exports={...On(),...Q0(),...UM(),...dj(),...Rj(),...ls(),...Uj(),...e_(),...Ga(),...Rp()}});var L4=E((c2e,F4)=>{"use strict";F4.exports=P4;function P4(r,e,t){r instanceof RegExp&&(r=O4(r,t)),e instanceof RegExp&&(e=O4(e,t));var n=D4(r,e,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+r.length,n[1]),post:t.slice(n[1]+e.length)}}a(P4,"balanced");function O4(r,e){var t=e.match(r);return t?t[0]:null}a(O4,"maybeMatch");P4.range=D4;function D4(r,e,t){var n,i,s,o,c,l=t.indexOf(r),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(r===e)return[l,u];for(n=[],s=t.length;f>=0&&!c;)f==l?(n.push(f),l=t.indexOf(r,f+1)):n.length==1?c=[n.pop(),u]:(i=n.pop(),i<s&&(s=i,o=u),u=t.indexOf(e,f+1)),f=l<u&&l>=0?l:u;n.length&&(c=[s,o])}return c}a(D4,"range")});var V4=E((u2e,B4)=>{var N4=L4();B4.exports=Zse;var k4="\0SLASH"+Math.random()+"\0",M4="\0OPEN"+Math.random()+"\0",OI="\0CLOSE"+Math.random()+"\0",j4="\0COMMA"+Math.random()+"\0",$4="\0PERIOD"+Math.random()+"\0";function CI(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}a(CI,"numeric");function Xse(r){return r.split("\\\\").join(k4).split("\\{").join(M4).split("\\}").join(OI).split("\\,").join(j4).split("\\.").join($4)}a(Xse,"escapeBraces");function Jse(r){return r.split(k4).join("\\").split(M4).join("{").split(OI).join("}").split(j4).join(",").split($4).join(".")}a(Jse,"unescapeBraces");function U4(r){if(!r)return[""];var e=[],t=N4("{","}",r);if(!t)return r.split(",");var n=t.pre,i=t.body,s=t.post,o=n.split(",");o[o.length-1]+="{"+i+"}";var c=U4(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),e.push.apply(e,o),e}a(U4,"parseCommaParts");function Zse(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),Dp(Xse(r),!0).map(Jse)):[]}a(Zse,"expandTop");function eoe(r){return"{"+r+"}"}a(eoe,"embrace");function toe(r){return/^-?0\d/.test(r)}a(toe,"isPadded");function roe(r,e){return r<=e}a(roe,"lte");function noe(r,e){return r>=e}a(noe,"gte");function Dp(r,e){var t=[],n=N4("{","}",r);if(!n)return[r];var i=n.pre,s=n.post.length?Dp(n.post,!1):[""];if(/\$$/.test(n.pre))for(var o=0;o<s.length;o++){var c=i+"{"+n.body+"}"+s[o];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body),f=l||u,d=n.body.indexOf(",")>=0;if(!f&&!d)return n.post.match(/,(?!,).*\}/)?(r=n.pre+"{"+n.body+OI+n.post,Dp(r)):[r];var p;if(f)p=n.body.split(/\.\./);else if(p=U4(n.body),p.length===1&&(p=Dp(p[0],!1).map(eoe),p.length===1))return s.map(function(K){return n.pre+p[0]+K});var h;if(f){var _=CI(p[0]),y=CI(p[1]),S=Math.max(p[0].length,p[1].length),w=p.length==3?Math.max(Math.abs(CI(p[2])),1):1,T=roe,O=y<_;O&&(w*=-1,T=noe);var A=p.some(toe);h=[];for(var x=_;T(x,y);x+=w){var P;if(u)P=String.fromCharCode(x),P==="\\"&&(P="");else if(P=String(x),A){var V=S-P.length;if(V>0){var j=new Array(V+1).join("0");x<0?P="-"+j+P.slice(1):P=j+P}}h.push(P)}}else{h=[];for(var $=0;$<p.length;$++)h.push.apply(h,Dp(p[$],!1))}for(var $=0;$<h.length;$++)for(var o=0;o<s.length;o++){var c=i+h[$]+s[o];(!e||f||c)&&t.push(c)}}return t}a(Dp,"expand")});var l$=E(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.createPathBasedTargetResolver=bs;rn.createCreateRelatedTaskService=qle;rn.createCreateRelatedProjectService=Gle;rn.createCreateAssetService=Wle;rn.createArchiveAssetService=Hle;rn.createCleanPropertiesService=zle;rn.createFixMissingLabelService=Kle;rn.createRenameToUidService=Yle;rn.createRepairFolderService=Xle;rn.createPlanForEveningService=Jle;rn.createUpdatePropertyService=Zle;rn.createRemovePropertyService=eue;rn.createSetStatusService=tue;rn.createDuplicateAssetService=rue;rn.rewriteFrontmatterScalars=c$;var ah=it();function bs(r){return{resolveFile(e){let t=(0,ah.iriToVaultPath)(e)??e,n=t.endsWith(".md")?t:`${t}.md`,i=r.getAbstractFileByPath(n);if(!i||!("basename"in i))throw new Error(`Cannot resolve target file for IRI: ${e}`);return i}}}a(bs,"createPathBasedTargetResolver");var Mx=a(()=>null,"NULL_CLASS_RESOLVER");function Z_(r){return r.startsWith('"[[')&&r.endsWith(']]"')?r:r.startsWith("[[")&&r.endsWith("]]")?`"${r}"`:`"[[${r}]]"`}a(Z_,"toQuotedWikilink");function qle(r,e,t=bs(r),n,i=Mx){return{async execute(s,o){let c=o?.label;if(!c)throw new Error("createRelatedTask requires userInput.label");let l=t.resolveFile(s),u=r.getFrontmatter(l)??{},f=l.parent?.path||"",d={ems__Effort_status:'"[[c42245d0-01de-4c35-bfcf-d910445ea28e]]"'},p=o?.parentProperty;p&&l.basename&&(d[p]=`"[[${l.basename}]]"`);let h=await e.createAsset({className:"ems__Task",label:c,folderPath:f,propertyValues:d,parentFile:l,parentMetadata:u,classResolver:i});n&&await n(h)}}}a(qle,"createCreateRelatedTaskService");function Gle(r,e,t=bs(r),n,i=Mx){return{async execute(s,o){let c=o?.label;if(!c)throw new Error("createRelatedProject requires userInput.label");let l=t.resolveFile(s),u=r.getFrontmatter(l)??{},f=l.parent?.path||"",d={ems__Effort_status:'"[[c42245d0-01de-4c35-bfcf-d910445ea28e]]"'},p=o?.parentProperty;p&&l.basename&&(d[p]=`"[[${l.basename}]]"`);let h=await e.createAsset({className:"ems__Project",label:c,folderPath:f,propertyValues:d,parentFile:l,parentMetadata:u,classResolver:i});n&&await n(h)}}}a(Gle,"createCreateRelatedProjectService");function Wle(r,e,t=Mx,n=bs(r)){return{async execute(i,s){let o=s?.prototypeUID??s?.prototype,c=s?.label,l=s?.folder,u=s?.ownerIdentity,f=s?.isDefinedBy;if(!o)throw new Error("createAsset requires userInput.prototypeUID");if(!c)throw new Error("createAsset requires userInput.label");let d,p;if(i)try{let x=n.resolveFile(i);d=x.path,p=r.getFrontmatter(x)??void 0}catch{}if(!l&&d){let x=d.lastIndexOf("/");l=x>=0?d.substring(0,x):""}if(l===void 0)throw new Error("createAsset requires userInput.folder");let h=o.endsWith("Prototype")?o.slice(0,-9):o,_=crypto.randomUUID(),y=ah.DateFormatter.toISOTimestamp(new Date),S=`${_}.md`,w=l?`${l}/${S}`:S,T=["---",`exo__Asset_uid: ${_}`,`exo__Asset_createdAt: ${y}`,`exo__Asset_label: ${c}`,`exo__Asset_prototype: "[[${o}]]"`,"exo__Instance_class:",` - "[[${h}]]"`],O=!1;if(f&&(T.push(`exo__Asset_isDefinedBy: ${Z_(f)}`),O=!0),p){let x=p.exo__Instance_class,V=(Array.isArray(x)?x:x!=null?[x]:[]).some($=>ah.WikiLinkHelpers.resolveSymbolic(String($),t).includes("Area")),j=d?d.substring(d.lastIndexOf("/")+1).replace(/\.md$/,""):void 0;if(j){let $=V?"ems__Effort_area":"ems__Effort_parent";T.push(`${$}: "[[${j}]]"`)}!V&&p.ems__Effort_area&&T.push(`ems__Effort_area: ${Z_(String(p.ems__Effort_area))}`),T.push('ems__Effort_status: "[[753a44d5-846c-4b82-9196-4fd9a4d48777]]"'),!O&&p.exo__Asset_isDefinedBy&&(T.push(`exo__Asset_isDefinedBy: ${Z_(String(p.exo__Asset_isDefinedBy))}`),O=!0)}!O&&u&&T.push(`exo__Asset_isDefinedBy: ${Z_(u)}`),T.push("---","");let A=T.join(`
|
|
365
365
|
`);await e.createFile(w,A)}}}a(Wle,"createCreateAssetService");function Hle(r,e,t=bs(r)){return{async execute(n){let i=t.resolveFile(n);await e.archiveAsset(i)}}}a(Hle,"createArchiveAssetService");function zle(r,e,t=bs(r)){return{async execute(n){let i=t.resolveFile(n);await e.cleanEmptyProperties(i)}}}a(zle,"createCleanPropertiesService");function Kle(r,e,t=bs(r)){return{async execute(n){let i=t.resolveFile(n);await e.fixMissingLabel(i)}}}a(Kle,"createFixMissingLabelService");function Yle(r,e,t=bs(r)){return{async execute(n){let i=t.resolveFile(n),s=r.getFrontmatter(i)??{};await e.renameToUid(i,s)}}}a(Yle,"createRenameToUidService");async function Qle(r,e,t){try{let n=await r.read(t),i=e.parseObject(n);if(i)return i}catch{}return r.getFrontmatter(t)??{}}a(Qle,"readFreshFrontmatter");function Xle(r,e,t=bs(r)){let n=new ah.FrontmatterService;return{async execute(i){let s=t.resolveFile(i),o=await Qle(r,n,s),c=await e.getExpectedFolder(s,o);if(c===null)throw new Error("repairFolder: cannot determine expected folder (missing exo__Asset_isDefinedBy or referenced asset not found)");(s.parent?.path??"")!==c&&await e.repairFolder(s,c)}}}a(Xle,"createRepairFolderService");function Jle(r,e,t=bs(r)){return{async execute(n){let i=t.resolveFile(n);await e.planForEvening(i)}}}a(Jle,"createPlanForEveningService");function Zle(r,e,t){return{async execute(n,i){let s=i?.property,o=i?.value;if(!s)throw new Error("updateProperty requires userInput.property");if(o===void 0)throw new Error("updateProperty requires userInput.value");let c=await t.resolveTargetPath(n),l=await r.readFile(c),u=e.updateProperty(l,s,o);await r.updateFile(c,u)}}}a(Zle,"createUpdatePropertyService");function eue(r,e,t){return{async execute(n,i){let s=i?.property;if(!s)throw new Error("removeProperty requires userInput.property");let o=await t.resolveTargetPath(n),c=await r.readFile(o),l=e.removeProperty(c,s);await r.updateFile(o,l)}}}a(eue,"createRemovePropertyService");function tue(r,e,t){return{async execute(n,i){let s=i?.statusUID;if(!s)throw new Error("setStatus requires userInput.statusUID");let o=await t.resolveTargetPath(n),c=await r.readFile(o),l=e.updateProperty(c,"ems__Effort_status",`"[[${s}]]"`);await r.updateFile(o,l)}}}a(tue,"createSetStatusService");function rue(r,e=bs(r),t){return{async execute(n){if(!n)throw new Error("duplicateAsset requires an active target \u2014 open an Exocortex asset before invoking");let i=e.resolveFile(n),s=await r.read(i),o=crypto.randomUUID(),c=ah.DateFormatter.toLocalTimestamp(new Date),l=c$(s,{exo__Asset_uid:o,exo__Asset_createdAt:c}),u=i.parent?.path??"",f=u?`${u}/${o}.md`:`${o}.md`,d=await r.create(f,l);t&&await t(d)}}}a(rue,"createDuplicateAssetService");function c$(r,e){let t=r.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!t)throw new Error("duplicateAsset: source file has no YAML frontmatter block");let n=t[1],i=new Map(Object.entries(e)),s=n.split(`
|
|
366
366
|
`).map(u=>{let f=u.match(/^([A-Za-z_][A-Za-z0-9_]*):/);if(!f)return u;let d=f[1],p=i.get(d);return p===void 0?u:(i.delete(d),`${d}: ${p}`)});for(let[u,f]of i)s.push(`${u}: ${f}`);let o=s.join(`
|
|
367
367
|
`),c=t[0].includes(`\r
|
|
368
368
|
`)?`\r
|
|
369
369
|
`:`
|
|
370
370
|
`;return`---${c}${o}${c}---`+r.slice(t[0].length)}a(c$,"rewriteFrontmatterScalars")});var u$=E(jx=>{"use strict";Object.defineProperty(jx,"__esModule",{value:!0});jx.createInstantiatePrototypeSubtreeService=cue;var ra=it(),nue="753a44d5-846c-4b82-9196-4fd9a4d48777",iue="ems__EffortPrototype_parentEffortPrototype",sue="8619c4fc-64f1-4869-b17e-e34186cacca9";function oue(r){if(typeof r!="string")return;let e=r.match(/\[\[[^\]|]+\|([^\]]+)\]\]/);return e?e[1].trim():void 0}a(oue,"extractAlias");function eb(r){let e=String(na(r)??""),t=e.match(/^"(.*)"$|^'(.*)'$/);return t?t[1]??t[2]??"":e}a(eb,"plainScalar");function na(r){return Array.isArray(r)?r[0]:r}a(na,"firstValue");function aue(r){let e=r.replace(/\.md$/,""),t=e.substring(e.lastIndexOf("/")+1);return decodeURIComponent(t)}a(aue,"uidFromIRI");function cue(r,e){return{async execute(t,n){let i=new Map;for(let A of r.getAllFiles()){let x=r.getFrontmatter(A);if(!x)continue;let P=x.exo__Asset_uid??A.basename;i.set(P,{file:A,fm:x,uid:P})}let s=a(A=>{let x=oue(na(A));if(x)return x;let P=(0,ra.extractAssetReference)(na(A));if(!P)return;let V=i.get(P);return V?eb(V.fm.exo__Asset_label):P},"classLabel"),o=a(A=>{for(let[x,P]of i){if(eb(P.fm.exo__Asset_label)!==A)continue;if((0,ra.extractAssetReference)(na(P.fm.exo__Instance_class))===sue)return x}},"classUidByLabel"),c=aue(t);if(!i.get(c))throw new Error(`instantiatePrototypeSubtree: root prototype not found for target "${t}" (uid ${c})`);let u=new Set([c]),f=!0;for(;f;){f=!1;for(let[A,x]of i){if(u.has(A))continue;let P=(0,ra.extractAssetReference)(na(x.fm[iue]));P&&u.has(P)&&(u.add(A),f=!0)}}let d=new Map;for(let A of u)d.set(A,crypto.randomUUID());let p={},h=[],_;for(let[A,x]of Object.entries(n??{})){if(x==null||A==="label"||A==="body")continue;let P=(0,ra.extractAssetReference)(na(x)),V=P?i.get(P):void 0;if(V){let j=V.fm.exo__Asset_label?eb(V.fm.exo__Asset_label):void 0;p[A]=j??String(x),(s(V.fm.exo__Instance_class)??"").includes("Project")?_||(_=P??void 0):h.push(P)}else p[A]=String(x)}let y=a(A=>{let x=String(A??"");for(let[P,V]of Object.entries(p))x=x.split(`{{${P}}}`).join(V);return x},"substitute"),S=new Set(h);for(let A of i.values()){if((0,ra.extractAssetReference)(na(A.fm.exo__Asset_prototype))!==c)continue;let P=A.fm.exo__Asset_relates,V=new Set((Array.isArray(P)?P:P!=null?[P]:[]).map(j=>(0,ra.extractAssetReference)(j)).filter(j=>j!=null));if(V.size===S.size&&[...S].every(j=>V.has(j)))throw new Error(`instantiatePrototypeSubtree: already deployed \u2014 an instance of prototype ${c} with the same ref-params [${[...S].join(", ")}] already exists (${A.file.path}). Refusing to duplicate the subgraph.`)}let w=new Map;for(let A of u){let x=i.get(A);if(!x)continue;let P=s(x.fm.exo__Instance_class),V=P&&P.endsWith("Prototype")?P.slice(0,-9):P;if(!V)throw new Error(`instantiatePrototypeSubtree: cannot resolve instance class for subtree node ${A} (${x.file.path}) \u2014 its exo__Instance_class is missing or unresolvable. Aborting so no asset is written with a dangling [[undefined]] class.`);let j=o(V);if(!j)throw new Error(`instantiatePrototypeSubtree: cannot resolve class UID for instance class \xAB${V}\xBB (subtree node ${A}, ${x.file.path}) \u2014 no class-definition asset with that label is loaded. Aborting so no asset is written with a dangling [[${V}]] class wikilink.`);w.set(A,`[[${j}|${V}]]`)}let T=ra.DateFormatter.toISOTimestamp(new Date),O=[c,...[...u].filter(A=>A!==c)];for(let A of O){let x=i.get(A);if(!x)continue;let{file:P,fm:V}=x,j=d.get(A),$=w.get(A),K=y(eb(V.exo__Asset_label)),N=["---",`exo__Asset_uid: ${j}`];V.exo__Asset_isDefinedBy&&N.push(`exo__Asset_isDefinedBy: "[[${(0,ra.extractAssetReference)(na(V.exo__Asset_isDefinedBy))}]]"`),N.push(`exo__Asset_createdAt: ${T}`,`exo__Asset_updatedAt: ${T}`,"exo__Instance_class:",` - "${$}"`,`exo__Asset_label: ${JSON.stringify(K)}`,"aliases:",` - ${JSON.stringify(K)}`,`exo__Asset_prototype: "[[${A}]]"`,`ems__Effort_status: "[[${nue}]]"`);let ae=(0,ra.extractAssetReference)(na(V.ems__Effort_blocker));if(ae){let Ee=d.get(ae)??ae;N.push(`ems__Effort_blocker: "[[${Ee}]]"`)}if(A===c){if(h.length>0){N.push("exo__Asset_relates:");for(let Ee of h)N.push(` - "[[${Ee}]]"`)}_&&N.push(`ems__Effort_parent: "[[${_}]]"`)}else N.push(`ems__Effort_parent: "[[${d.get(c)}]]"`);N.push("---","");let we=N.join(`
|
|
371
|
-
`),
|
|
371
|
+
`),ee=P.path.lastIndexOf("/"),pe=ee>=0?P.path.substring(0,ee):"",Y=pe?`${pe}/${j}.md`:`${j}.md`;await e.createFile(Y,we)}}}}a(cue,"createInstantiatePrototypeSubtreeService")});var f$=E(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.createInstantiatePrototypeSubtreeService=dt.createPathBasedTargetResolver=dt.rewriteFrontmatterScalars=dt.createDuplicateAssetService=dt.createSetStatusService=dt.createRemovePropertyService=dt.createUpdatePropertyService=dt.createPlanForEveningService=dt.createRepairFolderService=dt.createRenameToUidService=dt.createFixMissingLabelService=dt.createCleanPropertiesService=dt.createArchiveAssetService=dt.createCreateRelatedProjectService=dt.createCreateRelatedTaskService=dt.createCreateAssetService=void 0;var Mn=l$();Object.defineProperty(dt,"createCreateAssetService",{enumerable:!0,get:a(function(){return Mn.createCreateAssetService},"get")});Object.defineProperty(dt,"createCreateRelatedTaskService",{enumerable:!0,get:a(function(){return Mn.createCreateRelatedTaskService},"get")});Object.defineProperty(dt,"createCreateRelatedProjectService",{enumerable:!0,get:a(function(){return Mn.createCreateRelatedProjectService},"get")});Object.defineProperty(dt,"createArchiveAssetService",{enumerable:!0,get:a(function(){return Mn.createArchiveAssetService},"get")});Object.defineProperty(dt,"createCleanPropertiesService",{enumerable:!0,get:a(function(){return Mn.createCleanPropertiesService},"get")});Object.defineProperty(dt,"createFixMissingLabelService",{enumerable:!0,get:a(function(){return Mn.createFixMissingLabelService},"get")});Object.defineProperty(dt,"createRenameToUidService",{enumerable:!0,get:a(function(){return Mn.createRenameToUidService},"get")});Object.defineProperty(dt,"createRepairFolderService",{enumerable:!0,get:a(function(){return Mn.createRepairFolderService},"get")});Object.defineProperty(dt,"createPlanForEveningService",{enumerable:!0,get:a(function(){return Mn.createPlanForEveningService},"get")});Object.defineProperty(dt,"createUpdatePropertyService",{enumerable:!0,get:a(function(){return Mn.createUpdatePropertyService},"get")});Object.defineProperty(dt,"createRemovePropertyService",{enumerable:!0,get:a(function(){return Mn.createRemovePropertyService},"get")});Object.defineProperty(dt,"createSetStatusService",{enumerable:!0,get:a(function(){return Mn.createSetStatusService},"get")});Object.defineProperty(dt,"createDuplicateAssetService",{enumerable:!0,get:a(function(){return Mn.createDuplicateAssetService},"get")});Object.defineProperty(dt,"rewriteFrontmatterScalars",{enumerable:!0,get:a(function(){return Mn.rewriteFrontmatterScalars},"get")});Object.defineProperty(dt,"createPathBasedTargetResolver",{enumerable:!0,get:a(function(){return Mn.createPathBasedTargetResolver},"get")});var lue=u$();Object.defineProperty(dt,"createInstantiatePrototypeSubtreeService",{enumerable:!0,get:a(function(){return lue.createInstantiatePrototypeSubtreeService},"get")})});var Kfe={};Bb(Kfe,{createProgram:()=>bb});module.exports=Dh(Kfe);var vLe=Se(Vb());var sC=Se(iC(),1),{program:mde,createCommand:gde,createArgument:yde,createOption:_de,CommanderError:bde,InvalidArgumentError:Sde,InvalidOptionArgumentError:wde,Command:Le,Argument:Ede,Option:vde,Help:Tde}=sC.default;var sh=require("fs"),Ax=require("path"),or=Se(it());var br=Se(Qo()),Kt=Se(require("path"));function Wse(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}a(Wse,"getDefaultExportFromCjs");var mn={},t_={},za={},Vj;function Op(){if(Vj)return za;Vj=1;function r(o){return typeof o>"u"||o===null}a(r,"isNothing");function e(o){return typeof o=="object"&&o!==null}a(e,"isObject");function t(o){return Array.isArray(o)?o:r(o)?[]:[o]}a(t,"toArray");function n(o,c){if(c){let l=Object.keys(c);for(let u=0,f=l.length;u<f;u+=1){let d=l[u];o[d]=c[d]}}return o}a(n,"extend");function i(o,c){let l="";for(let u=0;u<c;u+=1)l+=o;return l}a(i,"repeat");function s(o){return o===0&&Number.NEGATIVE_INFINITY===1/o}return a(s,"isNegativeZero"),za.isNothing=r,za.isObject=e,za.toArray=t,za.repeat=i,za.isNegativeZero=s,za.extend=n,za}a(Op,"requireCommon");var oI,qj;function Pp(){if(qj)return oI;qj=1;function r(t,n){let i="",s=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(i+='in "'+t.mark.name+'" '),i+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!n&&t.mark.snippet&&(i+=`
|
|
372
372
|
|
|
373
373
|
`+t.mark.snippet),s+" "+i):s}a(r,"formatError");function e(t,n){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=n,this.message=r(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return a(e,"YAMLException2"),e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e.prototype.toString=a(function(n){return this.name+": "+r(this,n)},"toString"),oI=e,oI}a(Pp,"requireException");var aI,Gj;function Hse(){if(Gj)return aI;Gj=1;let r=Op();function e(i,s,o,c,l){let u="",f="",d=Math.floor(l/2)-1;return c-s>d&&(u=" ... ",s=c-d+u.length),o-c>d&&(f=" ...",o=c+d-f.length),{str:u+i.slice(s,o).replace(/\t/g,"\u2192")+f,pos:c-s+u.length}}a(e,"getLine");function t(i,s){return r.repeat(" ",s-i.length)+i}a(t,"padStart");function n(i,s){if(s=Object.create(s||null),!i.buffer)return null;s.maxLength||(s.maxLength=79),typeof s.indent!="number"&&(s.indent=1),typeof s.linesBefore!="number"&&(s.linesBefore=3),typeof s.linesAfter!="number"&&(s.linesAfter=2);let o=/\r?\n|\r|\0/g,c=[0],l=[],u,f=-1;for(;u=o.exec(i.buffer);)l.push(u.index),c.push(u.index+u[0].length),i.position<=u.index&&f<0&&(f=c.length-2);f<0&&(f=c.length-1);let d="",p=Math.min(i.line+s.linesAfter,l.length).toString().length,h=s.maxLength-(s.indent+p+3);for(let y=1;y<=s.linesBefore&&!(f-y<0);y++){let S=e(i.buffer,c[f-y],l[f-y],i.position-(c[f]-c[f-y]),h);d=r.repeat(" ",s.indent)+t((i.line-y+1).toString(),p)+" | "+S.str+`
|
|
374
374
|
`+d}let _=e(i.buffer,c[f],l[f],i.position,h);d+=r.repeat(" ",s.indent)+t((i.line+1).toString(),p)+" | "+_.str+`
|
|
@@ -376,18 +376,18 @@ GFS4: `),console.error(r)},"debug"));zt[en]||(eM=global[en]||[],rM(zt,eM),zt.clo
|
|
|
376
376
|
`;for(let y=1;y<=s.linesAfter&&!(f+y>=l.length);y++){let S=e(i.buffer,c[f+y],l[f+y],i.position-(c[f]-c[f+y]),h);d+=r.repeat(" ",s.indent)+t((i.line+y+1).toString(),p)+" | "+S.str+`
|
|
377
377
|
`}return d.replace(/\n$/,"")}return a(n,"makeSnippet"),aI=n,aI}a(Hse,"requireSnippet");var cI,Wj;function Fn(){if(Wj)return cI;Wj=1;let r=Pp(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],t=["scalar","sequence","mapping"];function n(s){let o={};return s!==null&&Object.keys(s).forEach(function(c){s[c].forEach(function(l){o[String(l)]=c})}),o}a(n,"compileStyleAliases");function i(s,o){if(o=o||{},Object.keys(o).forEach(function(c){if(e.indexOf(c)===-1)throw new r('Unknown option "'+c+'" is met in definition of "'+s+'" YAML type.')}),this.options=o,this.tag=s,this.kind=o.kind||null,this.resolve=o.resolve||function(){return!0},this.construct=o.construct||function(c){return c},this.instanceOf=o.instanceOf||null,this.predicate=o.predicate||null,this.represent=o.represent||null,this.representName=o.representName||null,this.defaultStyle=o.defaultStyle||null,this.multi=o.multi||!1,this.styleAliases=n(o.styleAliases||null),t.indexOf(this.kind)===-1)throw new r('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return a(i,"Type2"),cI=i,cI}a(Fn,"requireType");var lI,Hj;function p4(){if(Hj)return lI;Hj=1;let r=Pp(),e=Fn();function t(s,o){let c=[];return s[o].forEach(function(l){let u=c.length;c.forEach(function(f,d){f.tag===l.tag&&f.kind===l.kind&&f.multi===l.multi&&(u=d)}),c[u]=l}),c}a(t,"compileList");function n(){let s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(c){c.multi?(s.multi[c.kind].push(c),s.multi.fallback.push(c)):s[c.kind][c.tag]=s.fallback[c.tag]=c}a(o,"collectType");for(let c=0,l=arguments.length;c<l;c+=1)arguments[c].forEach(o);return s}a(n,"compileMap");function i(s){return this.extend(s)}return a(i,"Schema2"),i.prototype.extend=a(function(o){let c=[],l=[];if(o instanceof e)l.push(o);else if(Array.isArray(o))l=l.concat(o);else if(o&&(Array.isArray(o.implicit)||Array.isArray(o.explicit)))o.implicit&&(c=c.concat(o.implicit)),o.explicit&&(l=l.concat(o.explicit));else throw new r("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");c.forEach(function(f){if(!(f instanceof e))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new r("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(f.multi)throw new r("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),l.forEach(function(f){if(!(f instanceof e))throw new r("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let u=Object.create(i.prototype);return u.implicit=(this.implicit||[]).concat(c),u.explicit=(this.explicit||[]).concat(l),u.compiledImplicit=t(u,"implicit"),u.compiledExplicit=t(u,"explicit"),u.compiledTypeMap=n(u.compiledImplicit,u.compiledExplicit),u},"extend"),lI=i,lI}a(p4,"requireSchema");var uI,zj;function h4(){if(zj)return uI;zj=1;let r=Fn();return uI=new r("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(e){return e!==null?e:""},"construct")}),uI}a(h4,"requireStr");var fI,Kj;function m4(){if(Kj)return fI;Kj=1;let r=Fn();return fI=new r("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(e){return e!==null?e:[]},"construct")}),fI}a(m4,"requireSeq");var dI,Yj;function g4(){if(Yj)return dI;Yj=1;let r=Fn();return dI=new r("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(e){return e!==null?e:{}},"construct")}),dI}a(g4,"requireMap");var pI,Qj;function y4(){if(Qj)return pI;Qj=1;let r=p4();return pI=new r({explicit:[h4(),m4(),g4()]}),pI}a(y4,"requireFailsafe");var hI,Xj;function _4(){if(Xj)return hI;Xj=1;let r=Fn();function e(i){if(i===null)return!0;let s=i.length;return s===1&&i==="~"||s===4&&(i==="null"||i==="Null"||i==="NULL")}a(e,"resolveYamlNull");function t(){return null}a(t,"constructYamlNull");function n(i){return i===null}return a(n,"isNull"),hI=new r("tag:yaml.org,2002:null",{kind:"scalar",resolve:e,construct:t,predicate:n,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"}),hI}a(_4,"require_null");var mI,Jj;function b4(){if(Jj)return mI;Jj=1;let r=Fn();function e(i){if(i===null)return!1;let s=i.length;return s===4&&(i==="true"||i==="True"||i==="TRUE")||s===5&&(i==="false"||i==="False"||i==="FALSE")}a(e,"resolveYamlBoolean");function t(i){return i==="true"||i==="True"||i==="TRUE"}a(t,"constructYamlBoolean");function n(i){return Object.prototype.toString.call(i)==="[object Boolean]"}return a(n,"isBoolean"),mI=new r("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e,construct:t,predicate:n,represent:{lowercase:a(function(i){return i?"true":"false"},"lowercase"),uppercase:a(function(i){return i?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(i){return i?"True":"False"},"camelcase")},defaultStyle:"lowercase"}),mI}a(b4,"requireBool");var gI,Zj;function S4(){if(Zj)return gI;Zj=1;let r=Op(),e=Fn();function t(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}a(t,"isHexCode");function n(u){return u>=48&&u<=55}a(n,"isOctCode");function i(u){return u>=48&&u<=57}a(i,"isDecCode");function s(u){if(u===null)return!1;let f=u.length,d=0,p=!1;if(!f)return!1;let h=u[d];if((h==="-"||h==="+")&&(h=u[++d]),h==="0"){if(d+1===f)return!0;if(h=u[++d],h==="b"){for(d++;d<f;d++){if(h=u[d],h!=="0"&&h!=="1")return!1;p=!0}return p&&isFinite(o(u))}if(h==="x"){for(d++;d<f;d++){if(!t(u.charCodeAt(d)))return!1;p=!0}return p&&isFinite(o(u))}if(h==="o"){for(d++;d<f;d++){if(!n(u.charCodeAt(d)))return!1;p=!0}return p&&isFinite(o(u))}}for(;d<f;d++){if(!i(u.charCodeAt(d)))return!1;p=!0}return p?isFinite(o(u)):!1}a(s,"resolveYamlInteger");function o(u){let f=u,d=1,p=f[0];if((p==="-"||p==="+")&&(p==="-"&&(d=-1),f=f.slice(1),p=f[0]),f==="0")return 0;if(p==="0"){if(f[1]==="b")return d*parseInt(f.slice(2),2);if(f[1]==="x")return d*parseInt(f.slice(2),16);if(f[1]==="o")return d*parseInt(f.slice(2),8)}return d*parseInt(f,10)}a(o,"parseYamlInteger");function c(u){return o(u)}a(c,"constructYamlInteger");function l(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!r.isNegativeZero(u)}return a(l,"isInteger"),gI=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:c,predicate:l,represent:{binary:a(function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},"binary"),octal:a(function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},"octal"),decimal:a(function(u){return u.toString(10)},"decimal"),hexadecimal:a(function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),gI}a(S4,"requireInt");var yI,e4;function w4(){if(e4)return yI;e4=1;let r=Op(),e=Fn(),t=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),n=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function i(u){return u===null||!t.test(u)?!1:isFinite(parseFloat(u,10))?!0:n.test(u)}a(i,"resolveYamlFloat");function s(u){let f=u.toLowerCase(),d=f[0]==="-"?-1:1;return"+-".indexOf(f[0])>=0&&(f=f.slice(1)),f===".inf"?d===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:f===".nan"?NaN:d*parseFloat(f,10)}a(s,"constructYamlFloat");let o=/^[-+]?[0-9]+e/;function c(u,f){if(isNaN(u))switch(f){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(f){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(f){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(r.isNegativeZero(u))return"-0.0";let d=u.toString(10);return o.test(d)?d.replace("e",".e"):d}a(c,"representYamlFloat");function l(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||r.isNegativeZero(u))}return a(l,"isFloat"),yI=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:s,predicate:l,represent:c,defaultStyle:"lowercase"}),yI}a(w4,"requireFloat");var _I,t4;function E4(){return t4||(t4=1,_I=y4().extend({implicit:[_4(),b4(),S4(),w4()]})),_I}a(E4,"requireJson");var bI,r4;function v4(){return r4||(r4=1,bI=E4()),bI}a(v4,"requireCore");var SI,n4;function T4(){if(n4)return SI;n4=1;let r=Fn(),e=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function n(o){return o===null?!1:e.exec(o)!==null||t.exec(o)!==null}a(n,"resolveYamlTimestamp");function i(o){let c=0,l=null,u=e.exec(o);if(u===null&&(u=t.exec(o)),u===null)throw new Error("Date resolve error");let f=+u[1],d=+u[2]-1,p=+u[3];if(!u[4])return new Date(Date.UTC(f,d,p));let h=+u[4],_=+u[5],y=+u[6];if(u[7]){for(c=u[7].slice(0,3);c.length<3;)c+="0";c=+c}if(u[9]){let w=+u[10],T=+(u[11]||0);l=(w*60+T)*6e4,u[9]==="-"&&(l=-l)}let S=new Date(Date.UTC(f,d,p,h,_,y,c));return l&&S.setTime(S.getTime()-l),S}a(i,"constructYamlTimestamp");function s(o){return o.toISOString()}return a(s,"representYamlTimestamp"),SI=new r("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:n,construct:i,instanceOf:Date,represent:s}),SI}a(T4,"requireTimestamp");var wI,i4;function A4(){if(i4)return wI;i4=1;let r=Fn();function e(t){return t==="<<"||t===null}return a(e,"resolveYamlMerge"),wI=new r("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),wI}a(A4,"requireMerge");var EI,s4;function I4(){if(s4)return EI;s4=1;let r=Fn(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
378
378
|
\r`;function t(o){if(o===null)return!1;let c=0,l=o.length,u=e;for(let f=0;f<l;f++){let d=u.indexOf(o.charAt(f));if(!(d>64)){if(d<0)return!1;c+=6}}return c%8===0}a(t,"resolveYamlBinary");function n(o){let c=o.replace(/[\r\n=]/g,""),l=c.length,u=e,f=0,d=[];for(let h=0;h<l;h++)h%4===0&&h&&(d.push(f>>16&255),d.push(f>>8&255),d.push(f&255)),f=f<<6|u.indexOf(c.charAt(h));let p=l%4*6;return p===0?(d.push(f>>16&255),d.push(f>>8&255),d.push(f&255)):p===18?(d.push(f>>10&255),d.push(f>>2&255)):p===12&&d.push(f>>4&255),new Uint8Array(d)}a(n,"constructYamlBinary");function i(o){let c="",l=0,u=o.length,f=e;for(let p=0;p<u;p++)p%3===0&&p&&(c+=f[l>>18&63],c+=f[l>>12&63],c+=f[l>>6&63],c+=f[l&63]),l=(l<<8)+o[p];let d=u%3;return d===0?(c+=f[l>>18&63],c+=f[l>>12&63],c+=f[l>>6&63],c+=f[l&63]):d===2?(c+=f[l>>10&63],c+=f[l>>4&63],c+=f[l<<2&63],c+=f[64]):d===1&&(c+=f[l>>2&63],c+=f[l<<4&63],c+=f[64],c+=f[64]),c}a(i,"representYamlBinary");function s(o){return Object.prototype.toString.call(o)==="[object Uint8Array]"}return a(s,"isBinary"),EI=new r("tag:yaml.org,2002:binary",{kind:"scalar",resolve:t,construct:n,predicate:s,represent:i}),EI}a(I4,"requireBinary");var vI,o4;function x4(){if(o4)return vI;o4=1;let r=Fn(),e=Object.prototype.hasOwnProperty,t=Object.prototype.toString;function n(s){if(s===null)return!0;let o=[],c=s;for(let l=0,u=c.length;l<u;l+=1){let f=c[l],d=!1;if(t.call(f)!=="[object Object]")return!1;let p;for(p in f)if(e.call(f,p))if(!d)d=!0;else return!1;if(!d)return!1;if(o.indexOf(p)===-1)o.push(p);else return!1}return!0}a(n,"resolveYamlOmap");function i(s){return s!==null?s:[]}return a(i,"constructYamlOmap"),vI=new r("tag:yaml.org,2002:omap",{kind:"sequence",resolve:n,construct:i}),vI}a(x4,"requireOmap");var TI,a4;function R4(){if(a4)return TI;a4=1;let r=Fn(),e=Object.prototype.toString;function t(i){if(i===null)return!0;let s=i,o=new Array(s.length);for(let c=0,l=s.length;c<l;c+=1){let u=s[c];if(e.call(u)!=="[object Object]")return!1;let f=Object.keys(u);if(f.length!==1)return!1;o[c]=[f[0],u[f[0]]]}return!0}a(t,"resolveYamlPairs");function n(i){if(i===null)return[];let s=i,o=new Array(s.length);for(let c=0,l=s.length;c<l;c+=1){let u=s[c],f=Object.keys(u);o[c]=[f[0],u[f[0]]]}return o}return a(n,"constructYamlPairs"),TI=new r("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:t,construct:n}),TI}a(R4,"requirePairs");var AI,c4;function C4(){if(c4)return AI;c4=1;let r=Fn(),e=Object.prototype.hasOwnProperty;function t(i){if(i===null)return!0;let s=i;for(let o in s)if(e.call(s,o)&&s[o]!==null)return!1;return!0}a(t,"resolveYamlSet");function n(i){return i!==null?i:{}}return a(n,"constructYamlSet"),AI=new r("tag:yaml.org,2002:set",{kind:"mapping",resolve:t,construct:n}),AI}a(C4,"requireSet");var II,l4;function RI(){return l4||(l4=1,II=v4().extend({implicit:[T4(),A4()],explicit:[I4(),x4(),R4(),C4()]})),II}a(RI,"require_default");var u4;function zse(){if(u4)return t_;u4=1;let r=Op(),e=Pp(),t=Hse(),n=RI(),i=Object.prototype.hasOwnProperty,s=1,o=2,c=3,l=4,u=1,f=2,d=3,p=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,h=/[\x85\u2028\u2029]/,_=/[,\[\]{}]/,y=/^(?:!|!!|![0-9A-Za-z-]+!)$/,S=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function w(m){return Object.prototype.toString.call(m)}a(w,"_class");function T(m){return m===10||m===13}a(T,"isEol");function O(m){return m===9||m===32}a(O,"isWhiteSpace");function A(m){return m===9||m===32||m===10||m===13}a(A,"isWsOrEol");function x(m){return m===44||m===91||m===93||m===123||m===125}a(x,"isFlowIndicator");function P(m){if(m>=48&&m<=57)return m-48;let L=m|32;return L>=97&&L<=102?L-97+10:-1}a(P,"fromHexCode");function V(m){return m===120?2:m===117?4:m===85?8:0}a(V,"escapedHexLen");function j(m){return m>=48&&m<=57?m-48:-1}a(j,"fromDecimalCode");function $(m){switch(m){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
|
|
379
|
-
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}a($,"simpleEscapeSequence");function K(m){return m<=65535?String.fromCharCode(m):String.fromCharCode((m-65536>>10)+55296,(m-65536&1023)+56320)}a(K,"charFromCodepoint");function N(m,L,U){L==="__proto__"?Object.defineProperty(m,L,{configurable:!0,enumerable:!0,writable:!0,value:U}):m[L]=U}a(N,"setProperty");let ae=new Array(256),we=new Array(256);for(let m=0;m<256;m++)ae[m]=$(m)?1:0,we[m]=$(m);function
|
|
380
|
-
`,L-1))}a(Ie,"writeFoldedLines");function Ce(m,L,U){let R,C,D,b,F,X,G=m.kind,B=m.result,M=m.input.charCodeAt(m.position);if(A(M)||x(M)||M===35||M===38||M===42||M===33||M===124||M===62||M===39||M===34||M===37||M===64||M===96)return!1;if(M===63||M===45){let k=m.input.charCodeAt(m.position+1);if(A(k)||U&&x(k))return!1}for(m.kind="scalar",m.result="",R=C=m.position,D=!1;M!==0;){if(M===58){let k=m.input.charCodeAt(m.position+1);if(A(k)||U&&x(k))break}else if(M===35){let k=m.input.charCodeAt(m.position-1);if(A(k))break}else{if(m.position===m.lineStart&&be(m)||U&&x(M))break;if(T(M))if(b=m.line,F=m.lineStart,X=m.lineIndent,ce(m,!1,-1),m.lineIndent>=L){D=!0,M=m.input.charCodeAt(m.position);continue}else{m.position=C,m.line=b,m.lineStart=F,m.lineIndent=X;break}}D&&(se(m,R,C,!1),Ie(m,m.line-b),R=C=m.position,D=!1),O(M)||(C=m.position+1),M=m.input.charCodeAt(++m.position)}return se(m,R,C,!1),m.result?!0:(m.kind=G,m.result=B,!1)}a(Ce,"readPlainScalar");function Fe(m,L){let U,R,C=m.input.charCodeAt(m.position);if(C!==39)return!1;for(m.kind="scalar",m.result="",m.position++,U=R=m.position;(C=m.input.charCodeAt(m.position))!==0;)if(C===39)if(se(m,U,m.position,!0),C=m.input.charCodeAt(++m.position),C===39)U=m.position,m.position++,R=m.position;else return!0;else T(C)?(se(m,U,R,!0),Ie(m,ce(m,!1,L)),U=R=m.position):m.position===m.lineStart&&be(m)?Y(m,"unexpected end of the document within a single quoted scalar"):(m.position++,O(C)||(R=m.position));Y(m,"unexpected end of the stream within a single quoted scalar")}a(Fe,"readSingleQuotedScalar");function De(m,L){let U,R,C,D=m.input.charCodeAt(m.position);if(D!==34)return!1;for(m.kind="scalar",m.result="",m.position++,U=R=m.position;(D=m.input.charCodeAt(m.position))!==0;){if(D===34)return se(m,U,m.position,!0),m.position++,!0;if(D===92){if(se(m,U,m.position,!0),D=m.input.charCodeAt(++m.position),T(D))ce(m,!1,L);else if(D<256&&ae[D])m.result+=we[D],m.position++;else if((C=V(D))>0){let b=C,F=0;for(;b>0;b--)D=m.input.charCodeAt(++m.position),(C=P(D))>=0?F=(F<<4)+C:Y(m,"expected hexadecimal character");m.result+=K(F),m.position++}else Y(m,"unknown escape sequence");U=R=m.position}else T(D)?(se(m,U,R,!0),Ie(m,ce(m,!1,L)),U=R=m.position):m.position===m.lineStart&&be(m)?Y(m,"unexpected end of the document within a double quoted scalar"):(m.position++,O(D)||(R=m.position))}Y(m,"unexpected end of the stream within a double quoted scalar")}a(De,"readDoubleQuotedScalar");function Ae(m,L){let U=!0,R,C,D,b=m.tag,F,X=m.anchor,G,B,M,k,W=Object.create(null),H,oe,
|
|
379
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}a($,"simpleEscapeSequence");function K(m){return m<=65535?String.fromCharCode(m):String.fromCharCode((m-65536>>10)+55296,(m-65536&1023)+56320)}a(K,"charFromCodepoint");function N(m,L,U){L==="__proto__"?Object.defineProperty(m,L,{configurable:!0,enumerable:!0,writable:!0,value:U}):m[L]=U}a(N,"setProperty");let ae=new Array(256),we=new Array(256);for(let m=0;m<256;m++)ae[m]=$(m)?1:0,we[m]=$(m);function ee(m,L){this.input=m,this.filename=L.filename||null,this.schema=L.schema||n,this.onWarning=L.onWarning||null,this.legacy=L.legacy||!1,this.json=L.json||!1,this.listener=L.listener||null,this.maxDepth=typeof L.maxDepth=="number"?L.maxDepth:100,this.maxTotalMergeKeys=typeof L.maxTotalMergeKeys=="number"?L.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=m.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}a(ee,"State");function pe(m,L){let U={name:m.filename,buffer:m.input.slice(0,-1),position:m.position,line:m.line,column:m.position-m.lineStart};return U.snippet=t(U),new e(L,U)}a(pe,"generateError");function Y(m,L){throw pe(m,L)}a(Y,"throwError");function Ee(m,L){m.onWarning&&m.onWarning.call(null,pe(m,L))}a(Ee,"throwWarning");function ie(m,L,U){let R=m.anchorMapTransactions;if(R.length!==0){let C=R[R.length-1];i.call(C,L)||(C[L]={existed:i.call(m.anchorMap,L),value:m.anchorMap[L]})}m.anchorMap[L]=U}a(ie,"storeAnchor");function ne(m){m.anchorMapTransactions.push(Object.create(null))}a(ne,"beginAnchorTransaction");function de(m){let L=m.anchorMapTransactions.pop(),U=m.anchorMapTransactions;if(U.length===0)return;let R=U[U.length-1],C=Object.keys(L);for(let D=0,b=C.length;D<b;D+=1){let F=C[D];i.call(R,F)||(R[F]=L[F])}}a(de,"commitAnchorTransaction");function ye(m){let L=m.anchorMapTransactions.pop(),U=Object.keys(L);for(let R=U.length-1;R>=0;R-=1){let C=L[U[R]];C.existed?m.anchorMap[U[R]]=C.value:delete m.anchorMap[U[R]]}}a(ye,"rollbackAnchorTransaction");function te(m){return{position:m.position,line:m.line,lineStart:m.lineStart,lineIndent:m.lineIndent,firstTabInLine:m.firstTabInLine,tag:m.tag,anchor:m.anchor,kind:m.kind,result:m.result}}a(te,"snapshotState");function me(m,L){m.position=L.position,m.line=L.line,m.lineStart=L.lineStart,m.lineIndent=L.lineIndent,m.firstTabInLine=L.firstTabInLine,m.tag=L.tag,m.anchor=L.anchor,m.kind=L.kind,m.result=L.result}a(me,"restoreState");let Pe={YAML:a(function(L,U,R){L.version!==null&&Y(L,"duplication of %YAML directive"),R.length!==1&&Y(L,"YAML directive accepts exactly one argument");let C=/^([0-9]+)\.([0-9]+)$/.exec(R[0]);C===null&&Y(L,"ill-formed argument of the YAML directive");let D=parseInt(C[1],10),b=parseInt(C[2],10);D!==1&&Y(L,"unacceptable YAML version of the document"),L.version=R[0],L.checkLineBreaks=b<2,b!==1&&b!==2&&Ee(L,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(L,U,R){let C;R.length!==2&&Y(L,"TAG directive accepts exactly two arguments");let D=R[0];C=R[1],y.test(D)||Y(L,"ill-formed tag handle (first argument) of the TAG directive"),i.call(L.tagMap,D)&&Y(L,'there is a previously declared suffix for "'+D+'" tag handle'),S.test(C)||Y(L,"ill-formed tag prefix (second argument) of the TAG directive");try{C=decodeURIComponent(C)}catch{Y(L,"tag prefix is malformed: "+C)}L.tagMap[D]=C},"handleTagDirective")};function se(m,L,U,R){if(L<U){let C=m.input.slice(L,U);if(R)for(let D=0,b=C.length;D<b;D+=1){let F=C.charCodeAt(D);F===9||F>=32&&F<=1114111||Y(m,"expected valid JSON character")}else p.test(C)&&Y(m,"the stream contains non-printable characters");m.result+=C}}a(se,"captureSegment");function _e(m,L,U,R){r.isObject(U)||Y(m,"cannot merge mappings; the provided source object is unacceptable");let C=Object.keys(U);for(let D=0,b=C.length;D<b;D+=1){let F=C[D];m.maxTotalMergeKeys!==-1&&++m.totalMergeKeys>m.maxTotalMergeKeys&&Y(m,"merge keys exceeded maxTotalMergeKeys ("+m.maxTotalMergeKeys+")"),i.call(L,F)||(N(L,F,U[F]),R[F]=!0)}}a(_e,"mergeMappings");function Ne(m,L,U,R,C,D,b,F,X){if(Array.isArray(C)){C=Array.prototype.slice.call(C);for(let G=0,B=C.length;G<B;G+=1)Array.isArray(C[G])&&Y(m,"nested arrays are not supported inside keys"),typeof C=="object"&&w(C[G])==="[object Object]"&&(C[G]="[object Object]")}if(typeof C=="object"&&w(C)==="[object Object]"&&(C="[object Object]"),C=String(C),L===null&&(L={}),R==="tag:yaml.org,2002:merge")if(Array.isArray(D))for(let G=0,B=D.length;G<B;G+=1)_e(m,L,D[G],U);else _e(m,L,D,U);else!m.json&&!i.call(U,C)&&i.call(L,C)&&(m.line=b||m.line,m.lineStart=F||m.lineStart,m.position=X||m.position,Y(m,"duplicated mapping key")),N(L,C,D),delete U[C];return L}a(Ne,"storeMappingPair");function Q(m){let L=m.input.charCodeAt(m.position);L===10?m.position++:L===13?(m.position++,m.input.charCodeAt(m.position)===10&&m.position++):Y(m,"a line break is expected"),m.line+=1,m.lineStart=m.position,m.firstTabInLine=-1}a(Q,"readLineBreak");function ce(m,L,U){let R=0,C=m.input.charCodeAt(m.position);for(;C!==0;){for(;O(C);)C===9&&m.firstTabInLine===-1&&(m.firstTabInLine=m.position),C=m.input.charCodeAt(++m.position);if(L&&C===35)do C=m.input.charCodeAt(++m.position);while(C!==10&&C!==13&&C!==0);if(T(C))for(Q(m),C=m.input.charCodeAt(m.position),R++,m.lineIndent=0;C===32;)m.lineIndent++,C=m.input.charCodeAt(++m.position);else break}return U!==-1&&R!==0&&m.lineIndent<U&&Ee(m,"deficient indentation"),R}a(ce,"skipSeparationSpace");function be(m){let L=m.position,U=m.input.charCodeAt(L);return!!((U===45||U===46)&&U===m.input.charCodeAt(L+1)&&U===m.input.charCodeAt(L+2)&&(L+=3,U=m.input.charCodeAt(L),U===0||A(U)))}a(be,"testDocumentSeparator");function Ie(m,L){L===1?m.result+=" ":L>1&&(m.result+=r.repeat(`
|
|
380
|
+
`,L-1))}a(Ie,"writeFoldedLines");function Ce(m,L,U){let R,C,D,b,F,X,G=m.kind,B=m.result,M=m.input.charCodeAt(m.position);if(A(M)||x(M)||M===35||M===38||M===42||M===33||M===124||M===62||M===39||M===34||M===37||M===64||M===96)return!1;if(M===63||M===45){let k=m.input.charCodeAt(m.position+1);if(A(k)||U&&x(k))return!1}for(m.kind="scalar",m.result="",R=C=m.position,D=!1;M!==0;){if(M===58){let k=m.input.charCodeAt(m.position+1);if(A(k)||U&&x(k))break}else if(M===35){let k=m.input.charCodeAt(m.position-1);if(A(k))break}else{if(m.position===m.lineStart&&be(m)||U&&x(M))break;if(T(M))if(b=m.line,F=m.lineStart,X=m.lineIndent,ce(m,!1,-1),m.lineIndent>=L){D=!0,M=m.input.charCodeAt(m.position);continue}else{m.position=C,m.line=b,m.lineStart=F,m.lineIndent=X;break}}D&&(se(m,R,C,!1),Ie(m,m.line-b),R=C=m.position,D=!1),O(M)||(C=m.position+1),M=m.input.charCodeAt(++m.position)}return se(m,R,C,!1),m.result?!0:(m.kind=G,m.result=B,!1)}a(Ce,"readPlainScalar");function Fe(m,L){let U,R,C=m.input.charCodeAt(m.position);if(C!==39)return!1;for(m.kind="scalar",m.result="",m.position++,U=R=m.position;(C=m.input.charCodeAt(m.position))!==0;)if(C===39)if(se(m,U,m.position,!0),C=m.input.charCodeAt(++m.position),C===39)U=m.position,m.position++,R=m.position;else return!0;else T(C)?(se(m,U,R,!0),Ie(m,ce(m,!1,L)),U=R=m.position):m.position===m.lineStart&&be(m)?Y(m,"unexpected end of the document within a single quoted scalar"):(m.position++,O(C)||(R=m.position));Y(m,"unexpected end of the stream within a single quoted scalar")}a(Fe,"readSingleQuotedScalar");function De(m,L){let U,R,C,D=m.input.charCodeAt(m.position);if(D!==34)return!1;for(m.kind="scalar",m.result="",m.position++,U=R=m.position;(D=m.input.charCodeAt(m.position))!==0;){if(D===34)return se(m,U,m.position,!0),m.position++,!0;if(D===92){if(se(m,U,m.position,!0),D=m.input.charCodeAt(++m.position),T(D))ce(m,!1,L);else if(D<256&&ae[D])m.result+=we[D],m.position++;else if((C=V(D))>0){let b=C,F=0;for(;b>0;b--)D=m.input.charCodeAt(++m.position),(C=P(D))>=0?F=(F<<4)+C:Y(m,"expected hexadecimal character");m.result+=K(F),m.position++}else Y(m,"unknown escape sequence");U=R=m.position}else T(D)?(se(m,U,R,!0),Ie(m,ce(m,!1,L)),U=R=m.position):m.position===m.lineStart&&be(m)?Y(m,"unexpected end of the document within a double quoted scalar"):(m.position++,O(D)||(R=m.position))}Y(m,"unexpected end of the stream within a double quoted scalar")}a(De,"readDoubleQuotedScalar");function Ae(m,L){let U=!0,R,C,D,b=m.tag,F,X=m.anchor,G,B,M,k,W=Object.create(null),H,oe,ge,Re=m.input.charCodeAt(m.position);if(Re===91)G=93,k=!1,F=[];else if(Re===123)G=125,k=!0,F={};else return!1;for(m.anchor!==null&&ie(m,m.anchor,F),Re=m.input.charCodeAt(++m.position);Re!==0;){if(ce(m,!0,L),Re=m.input.charCodeAt(m.position),Re===G)return m.position++,m.tag=b,m.anchor=X,m.kind=k?"mapping":"sequence",m.result=F,!0;if(U?Re===44&&Y(m,"expected the node content, but found ','"):Y(m,"missed comma between flow collection entries"),oe=H=ge=null,B=M=!1,Re===63){let rt=m.input.charCodeAt(m.position+1);A(rt)&&(B=M=!0,m.position++,ce(m,!0,L))}R=m.line,C=m.lineStart,D=m.position,Me(m,L,s,!1,!0),oe=m.tag,H=m.result,ce(m,!0,L),Re=m.input.charCodeAt(m.position),(M||m.line===R)&&Re===58&&(B=!0,Re=m.input.charCodeAt(++m.position),ce(m,!0,L),Me(m,L,s,!1,!0),ge=m.result),k?Ne(m,F,W,oe,H,ge,R,C,D):B?F.push(Ne(m,null,W,oe,H,ge,R,C,D)):F.push(H),ce(m,!0,L),Re=m.input.charCodeAt(m.position),Re===44?(U=!0,Re=m.input.charCodeAt(++m.position)):U=!1}Y(m,"unexpected end of the stream within a flow collection")}a(Ae,"readFlowCollection");function Z(m,L){let U,R=u,C=!1,D=!1,b=L,F=0,X=!1,G,B=m.input.charCodeAt(m.position);if(B===124)U=!1;else if(B===62)U=!0;else return!1;for(m.kind="scalar",m.result="";B!==0;)if(B=m.input.charCodeAt(++m.position),B===43||B===45)u===R?R=B===43?d:f:Y(m,"repeat of a chomping mode identifier");else if((G=j(B))>=0)G===0?Y(m,"bad explicit indentation width of a block scalar; it cannot be less than one"):D?Y(m,"repeat of an indentation width identifier"):(b=L+G-1,D=!0);else break;if(O(B)){do B=m.input.charCodeAt(++m.position);while(O(B));if(B===35)do B=m.input.charCodeAt(++m.position);while(!T(B)&&B!==0)}for(;B!==0;){for(Q(m),m.lineIndent=0,B=m.input.charCodeAt(m.position);(!D||m.lineIndent<b)&&B===32;)m.lineIndent++,B=m.input.charCodeAt(++m.position);if(!D&&m.lineIndent>b&&(b=m.lineIndent),T(B)){F++;continue}if(!D&&b===0&&Y(m,"missing indentation for block scalar"),m.lineIndent<b){R===d?m.result+=r.repeat(`
|
|
381
381
|
`,C?1+F:F):R===u&&C&&(m.result+=`
|
|
382
382
|
`);break}U?O(B)?(X=!0,m.result+=r.repeat(`
|
|
383
383
|
`,C?1+F:F)):X?(X=!1,m.result+=r.repeat(`
|
|
384
384
|
`,F+1)):F===0?C&&(m.result+=" "):m.result+=r.repeat(`
|
|
385
385
|
`,F):m.result+=r.repeat(`
|
|
386
|
-
`,C?1+F:F),C=!0,D=!0,F=0;let M=m.position;for(;!T(B)&&B!==0;)B=m.input.charCodeAt(++m.position);se(m,M,m.position,!1)}return!0}a(
|
|
387
|
-
`),m.charCodeAt(0)===65279&&(m=m.slice(1)));let U=new
|
|
386
|
+
`,C?1+F:F),C=!0,D=!0,F=0;let M=m.position;for(;!T(B)&&B!==0;)B=m.input.charCodeAt(++m.position);se(m,M,m.position,!1)}return!0}a(Z,"readBlockScalar");function he(m,L){let U=m.tag,R=m.anchor,C=[],D=!1;if(m.firstTabInLine!==-1)return!1;m.anchor!==null&&ie(m,m.anchor,C);let b=m.input.charCodeAt(m.position);for(;b!==0&&(m.firstTabInLine!==-1&&(m.position=m.firstTabInLine,Y(m,"tab characters must not be used in indentation")),b===45);){let F=m.input.charCodeAt(m.position+1);if(!A(F))break;if(D=!0,m.position++,ce(m,!0,-1)&&m.lineIndent<=L){C.push(null),b=m.input.charCodeAt(m.position);continue}let X=m.line;if(Me(m,L,c,!1,!0),C.push(m.result),ce(m,!0,-1),b=m.input.charCodeAt(m.position),(m.line===X||m.lineIndent>L)&&b!==0)Y(m,"bad indentation of a sequence entry");else if(m.lineIndent<L)break}return D?(m.tag=U,m.anchor=R,m.kind="sequence",m.result=C,!0):!1}a(he,"readBlockSequence");function Te(m,L,U){let R,C,D,b,F=m.tag,X=m.anchor,G={},B=Object.create(null),M=null,k=null,W=null,H=!1,oe=!1;if(m.firstTabInLine!==-1)return!1;m.anchor!==null&&ie(m,m.anchor,G);let ge=m.input.charCodeAt(m.position);for(;ge!==0;){!H&&m.firstTabInLine!==-1&&(m.position=m.firstTabInLine,Y(m,"tab characters must not be used in indentation"));let Re=m.input.charCodeAt(m.position+1),rt=m.line;if((ge===63||ge===58)&&A(Re))ge===63?(H&&(Ne(m,G,B,M,k,null,C,D,b),M=k=W=null),oe=!0,H=!0,R=!0):H?(H=!1,R=!0):Y(m,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),m.position+=1,ge=Re;else{if(C=m.line,D=m.lineStart,b=m.position,!Me(m,U,o,!1,!0))break;if(m.line===rt){for(ge=m.input.charCodeAt(m.position);O(ge);)ge=m.input.charCodeAt(++m.position);if(ge===58)ge=m.input.charCodeAt(++m.position),A(ge)||Y(m,"a whitespace character is expected after the key-value separator within a block mapping"),H&&(Ne(m,G,B,M,k,null,C,D,b),M=k=W=null),oe=!0,H=!1,R=!1,M=m.tag,k=m.result;else if(oe)Y(m,"can not read an implicit mapping pair; a colon is missed");else return m.tag=F,m.anchor=X,!0}else if(oe)Y(m,"can not read a block mapping entry; a multiline key may not be an implicit key");else return m.tag=F,m.anchor=X,!0}if((m.line===rt||m.lineIndent>L)&&(H&&(C=m.line,D=m.lineStart,b=m.position),Me(m,L,l,!0,R)&&(H?k=m.result:W=m.result),H||(Ne(m,G,B,M,k,W,C,D,b),M=k=W=null),ce(m,!0,-1),ge=m.input.charCodeAt(m.position)),(m.line===rt||m.lineIndent>L)&&ge!==0)Y(m,"bad indentation of a mapping entry");else if(m.lineIndent<L)break}return H&&Ne(m,G,B,M,k,null,C,D,b),oe&&(m.tag=F,m.anchor=X,m.kind="mapping",m.result=G),oe}a(Te,"readBlockMapping");function xe(m){let L=!1,U=!1,R,C,D=m.input.charCodeAt(m.position);if(D!==33)return!1;m.tag!==null&&Y(m,"duplication of a tag property"),D=m.input.charCodeAt(++m.position),D===60?(L=!0,D=m.input.charCodeAt(++m.position)):D===33?(U=!0,R="!!",D=m.input.charCodeAt(++m.position)):R="!";let b=m.position;if(L){do D=m.input.charCodeAt(++m.position);while(D!==0&&D!==62);m.position<m.length?(C=m.input.slice(b,m.position),D=m.input.charCodeAt(++m.position)):Y(m,"unexpected end of the stream within a verbatim tag")}else{for(;D!==0&&!A(D);)D===33&&(U?Y(m,"tag suffix cannot contain exclamation marks"):(R=m.input.slice(b-1,m.position+1),y.test(R)||Y(m,"named tag handle cannot contain such characters"),U=!0,b=m.position+1)),D=m.input.charCodeAt(++m.position);C=m.input.slice(b,m.position),_.test(C)&&Y(m,"tag suffix cannot contain flow indicator characters")}C&&!S.test(C)&&Y(m,"tag name cannot contain such characters: "+C);try{C=decodeURIComponent(C)}catch{Y(m,"tag name is malformed: "+C)}return L?m.tag=C:i.call(m.tagMap,R)?m.tag=m.tagMap[R]+C:R==="!"?m.tag="!"+C:R==="!!"?m.tag="tag:yaml.org,2002:"+C:Y(m,'undeclared tag handle "'+R+'"'),!0}a(xe,"readTagProperty");function je(m){let L=m.input.charCodeAt(m.position);if(L!==38)return!1;m.anchor!==null&&Y(m,"duplication of an anchor property"),L=m.input.charCodeAt(++m.position);let U=m.position;for(;L!==0&&!A(L)&&!x(L);)L=m.input.charCodeAt(++m.position);return m.position===U&&Y(m,"name of an anchor node must contain at least one character"),m.anchor=m.input.slice(U,m.position),!0}a(je,"readAnchorProperty");function ke(m){let L=m.input.charCodeAt(m.position);if(L!==42)return!1;L=m.input.charCodeAt(++m.position);let U=m.position;for(;L!==0&&!A(L)&&!x(L);)L=m.input.charCodeAt(++m.position);m.position===U&&Y(m,"name of an alias node must contain at least one character");let R=m.input.slice(U,m.position);return i.call(m.anchorMap,R)||Y(m,'unidentified alias "'+R+'"'),m.result=m.anchorMap[R],ce(m,!0,-1),!0}a(ke,"readAlias");function Ge(m,L,U,R){let C=te(m);return ne(m),me(m,L),m.tag=null,m.anchor=null,m.kind=null,m.result=null,Te(m,U,R)&&m.kind==="mapping"?(de(m),!0):(ye(m),me(m,C),!1)}a(Ge,"tryReadBlockMappingFromProperty");function Me(m,L,U,R,C){let D,b,F=1,X=!1,G=!1,B=null,M,k,W;m.depth>=m.maxDepth&&Y(m,"nesting exceeded maxDepth ("+m.maxDepth+")"),m.depth+=1,m.listener!==null&&m.listener("open",m),m.tag=null,m.anchor=null,m.kind=null,m.result=null;let H=D=b=l===U||c===U;if(R&&ce(m,!0,-1)&&(X=!0,m.lineIndent>L?F=1:m.lineIndent===L?F=0:m.lineIndent<L&&(F=-1)),F===1)for(;;){let oe=m.input.charCodeAt(m.position),ge=te(m);if(X&&(oe===33&&m.tag!==null||oe===38&&m.anchor!==null)||!xe(m)&&!je(m))break;B===null&&(B=ge),ce(m,!0,-1)?(X=!0,b=H,m.lineIndent>L?F=1:m.lineIndent===L?F=0:m.lineIndent<L&&(F=-1)):b=!1}if(b&&(b=X||C),F===1||l===U)if(s===U||o===U?k=L:k=L+1,W=m.position-m.lineStart,F===1)if(b&&(he(m,W)||Te(m,W,k))||Ae(m,k))G=!0;else{let oe=m.input.charCodeAt(m.position);B!==null&&H&&!b&&oe!==124&&oe!==62&&Ge(m,B,B.position-B.lineStart,k)||D&&Z(m,k)||Fe(m,k)||De(m,k)?G=!0:ke(m)?(G=!0,(m.tag!==null||m.anchor!==null)&&Y(m,"alias node should not have any properties")):Ce(m,k,s===U)&&(G=!0,m.tag===null&&(m.tag="?")),m.anchor!==null&&ie(m,m.anchor,m.result)}else F===0&&(G=b&&he(m,W));if(m.tag===null)m.anchor!==null&&ie(m,m.anchor,m.result);else if(m.tag==="?"){m.result!==null&&m.kind!=="scalar"&&Y(m,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+m.kind+'"');for(let oe=0,ge=m.implicitTypes.length;oe<ge;oe+=1)if(M=m.implicitTypes[oe],M.resolve(m.result)){m.result=M.construct(m.result),m.tag=M.tag,m.anchor!==null&&ie(m,m.anchor,m.result);break}}else if(m.tag!=="!"){if(i.call(m.typeMap[m.kind||"fallback"],m.tag))M=m.typeMap[m.kind||"fallback"][m.tag];else{M=null;let oe=m.typeMap.multi[m.kind||"fallback"];for(let ge=0,Re=oe.length;ge<Re;ge+=1)if(m.tag.slice(0,oe[ge].tag.length)===oe[ge].tag){M=oe[ge];break}}M||Y(m,"unknown tag !<"+m.tag+">"),m.result!==null&&M.kind!==m.kind&&Y(m,"unacceptable node kind for !<"+m.tag+'> tag; it should be "'+M.kind+'", not "'+m.kind+'"'),M.resolve(m.result,m.tag)?(m.result=M.construct(m.result,m.tag),m.anchor!==null&&ie(m,m.anchor,m.result)):Y(m,"cannot resolve a node with !<"+m.tag+"> explicit tag")}return m.listener!==null&&m.listener("close",m),m.depth-=1,m.tag!==null||m.anchor!==null||G}a(Me,"composeNode");function We(m){let L=m.position,U=!1,R;for(m.version=null,m.checkLineBreaks=m.legacy,m.tagMap=Object.create(null),m.anchorMap=Object.create(null);(R=m.input.charCodeAt(m.position))!==0&&(ce(m,!0,-1),R=m.input.charCodeAt(m.position),!(m.lineIndent>0||R!==37));){U=!0,R=m.input.charCodeAt(++m.position);let C=m.position;for(;R!==0&&!A(R);)R=m.input.charCodeAt(++m.position);let D=m.input.slice(C,m.position),b=[];for(D.length<1&&Y(m,"directive name must not be less than one character in length");R!==0;){for(;O(R);)R=m.input.charCodeAt(++m.position);if(R===35){do R=m.input.charCodeAt(++m.position);while(R!==0&&!T(R));break}if(T(R))break;for(C=m.position;R!==0&&!A(R);)R=m.input.charCodeAt(++m.position);b.push(m.input.slice(C,m.position))}R!==0&&Q(m),i.call(Pe,D)?Pe[D](m,D,b):Ee(m,'unknown document directive "'+D+'"')}if(ce(m,!0,-1),m.lineIndent===0&&m.input.charCodeAt(m.position)===45&&m.input.charCodeAt(m.position+1)===45&&m.input.charCodeAt(m.position+2)===45?(m.position+=3,ce(m,!0,-1)):U&&Y(m,"directives end mark is expected"),Me(m,m.lineIndent-1,l,!1,!0),ce(m,!0,-1),m.checkLineBreaks&&h.test(m.input.slice(L,m.position))&&Ee(m,"non-ASCII line breaks are interpreted as content"),m.documents.push(m.result),m.position===m.lineStart&&be(m)){m.input.charCodeAt(m.position)===46&&(m.position+=3,ce(m,!0,-1));return}m.position<m.length-1&&Y(m,"end of the stream or a document separator is expected")}a(We,"readDocument");function Ve(m,L){m=String(m),L=L||{},m.length!==0&&(m.charCodeAt(m.length-1)!==10&&m.charCodeAt(m.length-1)!==13&&(m+=`
|
|
387
|
+
`),m.charCodeAt(0)===65279&&(m=m.slice(1)));let U=new ee(m,L),R=m.indexOf("\0");for(R!==-1&&(U.position=R,Y(U,"null byte is not allowed in input")),U.input+="\0";U.input.charCodeAt(U.position)===32;)U.lineIndent+=1,U.position+=1;for(;U.position<U.length-1;)We(U);return U.documents}a(Ve,"loadDocuments");function $e(m,L,U){L!==null&&typeof L=="object"&&typeof U>"u"&&(U=L,L=null);let R=Ve(m,U);if(typeof L!="function")return R;for(let C=0,D=R.length;C<D;C+=1)L(R[C])}a($e,"loadAll2");function He(m,L){let U=Ve(m,L);if(U.length!==0){if(U.length===1)return U[0];throw new e("expected a single document in the stream, but found more")}}return a(He,"load2"),t_.loadAll=$e,t_.load=He,t_}a(zse,"requireLoader");var xI={},f4;function Kse(){if(f4)return xI;f4=1;let r=Op(),e=Pp(),t=RI(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty,s=65279,o=9,c=10,l=13,u=32,f=33,d=34,p=35,h=37,_=38,y=39,S=42,w=44,T=45,O=58,A=61,x=62,P=63,V=64,j=91,$=93,K=96,N=123,ae=124,we=125,ee={};ee[0]="\\0",ee[7]="\\a",ee[8]="\\b",ee[9]="\\t",ee[10]="\\n",ee[11]="\\v",ee[12]="\\f",ee[13]="\\r",ee[27]="\\e",ee[34]='\\"',ee[92]="\\\\",ee[133]="\\N",ee[160]="\\_",ee[8232]="\\L",ee[8233]="\\P";let pe=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Y=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Ee(b,F){if(F===null)return{};let X={},G=Object.keys(F);for(let B=0,M=G.length;B<M;B+=1){let k=G[B],W=String(F[k]);k.slice(0,2)==="!!"&&(k="tag:yaml.org,2002:"+k.slice(2));let H=b.compiledTypeMap.fallback[k];H&&i.call(H.styleAliases,W)&&(W=H.styleAliases[W]),X[k]=W}return X}a(Ee,"compileStyleMap");function ie(b){let F,X,G=b.toString(16).toUpperCase();if(b<=255)F="x",X=2;else if(b<=65535)F="u",X=4;else if(b<=4294967295)F="U",X=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+F+r.repeat("0",X-G.length)+G}a(ie,"encodeHex");let ne=1,de=2;function ye(b){this.schema=b.schema||t,this.indent=Math.max(1,b.indent||2),this.noArrayIndent=b.noArrayIndent||!1,this.skipInvalid=b.skipInvalid||!1,this.flowLevel=r.isNothing(b.flowLevel)?-1:b.flowLevel,this.styleMap=Ee(this.schema,b.styles||null),this.sortKeys=b.sortKeys||!1,this.lineWidth=b.lineWidth||80,this.noRefs=b.noRefs||!1,this.noCompatMode=b.noCompatMode||!1,this.condenseFlow=b.condenseFlow||!1,this.quotingType=b.quotingType==='"'?de:ne,this.forceQuotes=b.forceQuotes||!1,this.replacer=typeof b.replacer=="function"?b.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}a(ye,"State");function te(b,F){let X=r.repeat(" ",F),G=0,B="",M=b.length;for(;G<M;){let k,W=b.indexOf(`
|
|
388
388
|
`,G);W===-1?(k=b.slice(G),G=M):(k=b.slice(G,W+1),G=W+1),k.length&&k!==`
|
|
389
|
-
`&&(B+=X),B+=k}return B}a(
|
|
390
|
-
`+r.repeat(" ",b.indent*F)}a(
|
|
389
|
+
`&&(B+=X),B+=k}return B}a(te,"indentString");function me(b,F){return`
|
|
390
|
+
`+r.repeat(" ",b.indent*F)}a(me,"generateNextLine");function Pe(b,F){for(let X=0,G=b.implicitTypes.length;X<G;X+=1)if(b.implicitTypes[X].resolve(F))return!0;return!1}a(Pe,"testImplicitResolving");function se(b){return b===u||b===o}a(se,"isWhitespace");function _e(b){return b>=32&&b<=126||b>=161&&b<=55295&&b!==8232&&b!==8233||b>=57344&&b<=65533&&b!==s||b>=65536&&b<=1114111}a(_e,"isPrintable");function Ne(b){return _e(b)&&b!==s&&b!==l&&b!==c}a(Ne,"isNsCharOrWhitespace");function Q(b,F,X){let G=Ne(b),B=G&&!se(b);return(X?G:G&&b!==w&&b!==j&&b!==$&&b!==N&&b!==we)&&b!==p&&!(F===O&&!B)||Ne(F)&&!se(F)&&b===p||F===O&&B}a(Q,"isPlainSafe");function ce(b){return _e(b)&&b!==s&&!se(b)&&b!==T&&b!==P&&b!==O&&b!==w&&b!==j&&b!==$&&b!==N&&b!==we&&b!==p&&b!==_&&b!==S&&b!==f&&b!==ae&&b!==A&&b!==x&&b!==y&&b!==d&&b!==h&&b!==V&&b!==K}a(ce,"isPlainSafeFirst");function be(b){return!se(b)&&b!==O}a(be,"isPlainSafeLast");function Ie(b,F){let X=b.charCodeAt(F),G;return X>=55296&&X<=56319&&F+1<b.length&&(G=b.charCodeAt(F+1),G>=56320&&G<=57343)?(X-55296)*1024+G-56320+65536:X}a(Ie,"codePointAt");function Ce(b){return/^\n* /.test(b)}a(Ce,"needIndentIndicator");let Fe=1,De=2,Ae=3,Z=4,he=5;function Te(b,F,X,G,B,M,k,W){let H,oe=0,ge=null,Re=!1,rt=!1,Vr=G!==-1,Er=-1,tr=ce(Ie(b,0))&&be(Ie(b,b.length-1));if(F||k)for(H=0;H<b.length;oe>=65536?H+=2:H++){if(oe=Ie(b,H),!_e(oe))return he;tr=tr&&Q(oe,ge,W),ge=oe}else{for(H=0;H<b.length;oe>=65536?H+=2:H++){if(oe=Ie(b,H),oe===c)Re=!0,Vr&&(rt=rt||H-Er-1>G&&b[Er+1]!==" ",Er=H);else if(!_e(oe))return he;tr=tr&&Q(oe,ge,W),ge=oe}rt=rt||Vr&&H-Er-1>G&&b[Er+1]!==" "}return!Re&&!rt?tr&&!k&&!B(b)?Fe:M===de?he:De:X>9&&Ce(b)?he:k?M===de?he:De:rt?Z:Ae}a(Te,"chooseScalarStyle");function xe(b,F,X,G,B){b.dump=(function(){if(F.length===0)return b.quotingType===de?'""':"''";if(!b.noCompatMode&&(pe.indexOf(F)!==-1||Y.test(F)))return b.quotingType===de?'"'+F+'"':"'"+F+"'";let M=b.indent*Math.max(1,X),k=b.lineWidth===-1?-1:Math.max(Math.min(b.lineWidth,40),b.lineWidth-M),W=G||b.flowLevel>-1&&X>=b.flowLevel;function H(oe){return Pe(b,oe)}switch(a(H,"testAmbiguity"),Te(F,W,b.indent,k,H,b.quotingType,b.forceQuotes&&!G,B)){case Fe:return F;case De:return"'"+F.replace(/'/g,"''")+"'";case Ae:return"|"+je(F,b.indent)+ke(te(F,M));case Z:return">"+je(F,b.indent)+ke(te(Ge(F,k),M));case he:return'"'+We(F)+'"';default:throw new e("impossible error: invalid scalar style")}})()}a(xe,"writeScalar");function je(b,F){let X=Ce(b)?String(F):"",G=b[b.length-1]===`
|
|
391
391
|
`,M=G&&(b[b.length-2]===`
|
|
392
392
|
`||b===`
|
|
393
393
|
`)?"+":G?"":"-";return X+M+`
|
|
@@ -398,8 +398,8 @@ GFS4: `),console.error(r)},"debug"));zt[en]||(eM=global[en]||[],rM(zt,eM),zt.clo
|
|
|
398
398
|
`:"")+Me(H,F),B=M}return G}a(Ge,"foldString");function Me(b,F){if(b===""||b[0]===" ")return b;let X=/ [^ ]/g,G,B=0,M,k=0,W=0,H="";for(;G=X.exec(b);)W=G.index,W-B>F&&(M=k>B?k:W,H+=`
|
|
399
399
|
`+b.slice(B,M),B=M+1),k=W;return H+=`
|
|
400
400
|
`,b.length-B>F&&k>B?H+=b.slice(B,k)+`
|
|
401
|
-
`+b.slice(k+1):H+=b.slice(B),H.slice(1)}a(Me,"foldLine");function We(b){let F="",X=0;for(let G=0;G<b.length;X>=65536?G+=2:G++){X=Ie(b,G);let B=
|
|
402
|
-
`:""}return a(D,"dump2"),xI.dump=D,xI}a(Kse,"requireDumper");var d4;function Yse(){if(d4)return mn;d4=1;let r=zse(),e=Kse();function t(n,i){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return a(t,"renamed"),mn.Type=Fn(),mn.Schema=p4(),mn.FAILSAFE_SCHEMA=y4(),mn.JSON_SCHEMA=E4(),mn.CORE_SCHEMA=v4(),mn.DEFAULT_SCHEMA=RI(),mn.load=r.load,mn.loadAll=r.loadAll,mn.dump=e.dump,mn.YAMLException=Pp(),mn.types={binary:I4(),float:w4(),map:g4(),null:_4(),pairs:R4(),set:C4(),timestamp:T4(),bool:b4(),int:S4(),merge:A4(),omap:x4(),seq:m4(),str:h4()},mn.safeLoad=t("safeLoad","load"),mn.safeLoadAll=t("safeLoadAll","loadAll"),mn.safeDump=t("safeDump","dump"),mn}a(Yse,"requireJsYaml");var Qse=Yse(),Ln=Wse(Qse),{Type:WTe,Schema:HTe,FAILSAFE_SCHEMA:zTe,JSON_SCHEMA:KTe,CORE_SCHEMA:YTe,DEFAULT_SCHEMA:QTe,load:XTe,loadAll:JTe,dump:ZTe,YAMLException:e2e,types:t2e,safeLoad:r2e,safeLoadAll:n2e,safeDump:i2e}=Ln;var P9=Se(it());var QI=Se(Qo()),rl=Se(require("path"));var X4=Se(V4(),1);var Fp=a(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var ioe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Lp=a(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),soe=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),q4=a(r=>r.join(""),"rangesToString"),G4=a((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<r.length;){let y=r.charAt(s);if((y==="!"||y==="^")&&s===t+1){u=!0,s++;continue}if(y==="]"&&o&&!l){f=s+1;break}if(o=!0,y==="\\"&&!l){l=!0,s++;continue}if(y==="["&&!l){for(let[S,[w,T,O]]of Object.entries(ioe))if(r.startsWith(S,s)){if(d)return["$.",!1,r.length-t,!0];s+=S.length,O?i.push(w):n.push(w),c=c||T;continue e}}if(l=!1,d){y>d?n.push(Lp(d)+"-"+Lp(y)):y===d&&n.push(Lp(y)),d="",s++;continue}if(r.startsWith("-]",s+1)){n.push(Lp(y+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=y,s+=2;continue}n.push(Lp(y)),s++}if(f<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let y=n[0].length===2?n[0].slice(-1):n[0];return[soe(y),!1,f-t,!1]}let p="["+(u?"^":"")+q4(n)+"]",h="["+(u?"":"^")+q4(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,c,f-t,!0]},"parseClass");var us=a((r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var Jn,ooe=new Set(["!","?","+","*","@"]),PI=a(r=>ooe.has(r),"isExtglobType"),W4=a(r=>PI(r.type),"isExtglobAST"),aoe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),coe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),loe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),H4=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),uoe="(?!(?:^|/)\\.\\.?(?:$|/))",r_="(?!\\.)",foe=new Set(["[","."]),doe=new Set(["..","."]),poe=new Set("().*{}+?[]^$\\!"),hoe=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),DI="[^/]",z4=DI+"*?",K4=DI+"+?",Zc=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#_;#i;#u=!1;#s;#l;#o=!1;constructor(e,t,n={}){this.type=e,e&&(this.#n=!0),this.#c=t,this.#e=this.#c?this.#c.#e:this,this.#s=this.#e===this?n:this.#e.#s,this.#i=this.#e===this?[]:this.#e.#i,e==="!"&&!this.#e.#u&&this.#i.push(this),this.#_=this.#c?this.#c.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let e of this.#t)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#t.map(e=>String(e)).join("|")+")":this.#l=this.#t.map(e=>String(e)).join("")}#h(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#i.pop();){if(e.type!=="!")continue;let t=e,n=t.#c;for(;n;){for(let i=t.#_+1;!n.type&&i<n.#t.length;i++)for(let s of e.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}t=n,n=t.#c}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Jn&&t.#c===this))throw new Error("invalid part: "+t);this.#t.push(t)}}toJSON(){let e=this.type===null?this.#t.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#t.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#c?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#c?.isStart())return!1;if(this.#_===0)return!0;let e=this.#c;for(let t=0;t<this.#_;t++){let n=e.#t[t];if(!(n instanceof Jn&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#c?.type==="!")return!0;if(!this.#c?.isEnd())return!1;if(!this.type)return this.#c?.isEnd();let e=this.#c?this.#c.#t.length:0;return this.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Jn(this.type,e);for(let n of this.#t)t.copyIn(n);return t}static#g(e,t,n,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let y=n,S="";for(;y<e.length;){let w=e.charAt(y++);if(c||w==="\\"){c=!c,S+=w;continue}if(l){y===u+1?(w==="^"||w==="!")&&(f=!0):w==="]"&&!(y===u+2&&f)&&(l=!1),S+=w;continue}else if(w==="["){l=!0,u=y,f=!1,S+=w;continue}if(!i.noext&&PI(w)&&e.charAt(y)==="("&&s<=o){t.push(S),S="";let O=new Jn(w,t);y=Jn.#g(e,O,y,i,s+1),t.push(O);continue}S+=w}return t.push(S),y}let d=n+1,p=new Jn(null,t),h=[],_="";for(;d<e.length;){let y=e.charAt(d++);if(c||y==="\\"){c=!c,_+=y;continue}if(l){d===u+1?(y==="^"||y==="!")&&(f=!0):y==="]"&&!(d===u+2&&f)&&(l=!1),_+=y;continue}else if(y==="["){l=!0,u=d,f=!1,_+=y;continue}if(PI(y)&&e.charAt(d)==="("&&(s<=o||t&&t.#y(y))){let w=t&&t.#y(y)?0:1;p.push(_),_="";let T=new Jn(y,p);p.push(T),d=Jn.#g(e,T,d,i,s+w);continue}if(y==="|"){p.push(_),_="",h.push(p),p=new Jn(null,t);continue}if(y===")")return _===""&&t.#t.length===0&&(t.#o=!0),p.push(_),_="",t.push(...h,p),d;_+=y}return t.type=null,t.#n=void 0,t.#t=[e.substring(n-1)],d}#d(e){return this.#m(e,coe)}#m(e,t=aoe){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null)return!1;let n=e.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#y(n.type,t)}#y(e,t=loe){return!!t.get(this.type)?.includes(e)}#f(e,t){let n=e.#t[0],i=new Jn(null,n,this.options);i.#t.push(""),n.push(i),this.#v(e,t)}#v(e,t){let n=e.#t[0];this.#t.splice(t,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#c=this);this.#l=void 0}#T(e){return!!H4.get(this.type)?.has(e)}#b(e){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let t=e.#t[0];return!t||typeof t!="object"||t.type===null?!1:this.#T(t.type)}#E(e){let t=H4.get(this.type),n=e.#t[0],i=t?.get(n.type);if(!i)return!1;this.#t=n.#t;for(let s of this.#t)typeof s=="object"&&(s.#c=this);this.type=i,this.#l=void 0,this.#o=!1}#S(){if(W4(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#t.length;n++){let i=this.#t[n];typeof i=="object"&&(i.#S(),this.#m(i)?(t=!1,this.#v(i,n)):this.#d(i)?(t=!1,this.#f(i,n)):this.#b(i)&&(t=!1,this.#E(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#S();this.#l=void 0}static fromGlob(e,t={}){let n=new Jn(null,void 0,t);return Jn.#g(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let c=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#s}toRegExpSource(e){let t=e??!!this.#s.dot;if(this.#e===this&&(this.#S(),this.#h()),!W4(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(h=>{let[_,y,S,w]=typeof h=="string"?Jn.#I(h,this.#n,l):h.toRegExpSource(e);return this.#n=this.#n||S,this.#r=this.#r||w,_}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&doe.has(this.#t[0]))){let _=foe,y=t&&_.has(u.charAt(0))||u.startsWith("\\.")&&_.has(u.charAt(2))||u.startsWith("\\.\\.")&&_.has(u.charAt(4)),S=!t&&!e&&_.has(u.charAt(0));f=y?uoe:S?r_:""}let d="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,us(u),this.#n=!!this.#n,this.#r]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#w(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,us(this.toString()),!1,!1]}let o=!n||e||t||!r_?"":this.#w(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?r_:"")+K4;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?r_:"")+z4+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,us(s),this.#n=!!this.#n,this.#r]}#w(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#r=this.#r||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#I(e,t,n=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(poe.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=G4(e,l);if(p){s+=f,o=o||d,l+=p-1,t=t||h,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=n&&/^[*]+$/.test(e)?K4:z4,t=!0;continue}else c=!1;if(u==="?"){s+=DI,t=!0;continue}s+=hoe(u)}return[s,us(e),!!t,o]}};Jn=Zc;var Yu=a((r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Nn=a((r,e,t={})=>(Fp(e),!t.nocomment&&e.charAt(0)==="#"?!1:new ci(e,t).match(r)),"minimatch"),moe=/^\*+([^+@!?\*\[\(]*)$/,goe=a(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),yoe=a(r=>e=>e.endsWith(r),"starDotExtTestDot"),_oe=a(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),boe=a(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),Soe=/^\*+\.\*+$/,woe=a(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),Eoe=a(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),voe=/^\.\*+$/,Toe=a(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),Aoe=/^\*+$/,Ioe=a(r=>r.length!==0&&!r.startsWith("."),"starTest"),xoe=a(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),Roe=/^\?+([^+@!?\*\[\(]*)?$/,Coe=a(([r,e=""])=>{let t=J4([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Ooe=a(([r,e=""])=>{let t=Z4([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Poe=a(([r,e=""])=>{let t=Z4([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTestDot"),Doe=a(([r,e=""])=>{let t=J4([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTest"),J4=a(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),Z4=a(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),e9=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Y4={win32:{sep:"\\"},posix:{sep:"/"}},Foe=e9==="win32"?Y4.win32.sep:Y4.posix.sep;Nn.sep=Foe;var ir=Symbol("globstar **");Nn.GLOBSTAR=ir;var Loe="[^/]",Noe=Loe+"*?",koe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Moe="(?:(?!(?:\\/|^)\\.).)*?",joe=a((r,e={})=>t=>Nn(t,r,e),"filter");Nn.filter=joe;var wi=a((r,e={})=>Object.assign({},r,e),"ext"),$oe=a(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Nn;let e=Nn;return Object.assign(a((n,i,s={})=>e(n,i,wi(r,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,wi(r,s))}static defaults(i){return e.defaults(wi(r,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,wi(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,wi(r,s))}},unescape:a((n,i={})=>e.unescape(n,wi(r,i)),"unescape"),escape:a((n,i={})=>e.escape(n,wi(r,i)),"escape"),filter:a((n,i={})=>e.filter(n,wi(r,i)),"filter"),defaults:a(n=>e.defaults(wi(r,n)),"defaults"),makeRe:a((n,i={})=>e.makeRe(n,wi(r,i)),"makeRe"),braceExpand:a((n,i={})=>e.braceExpand(n,wi(r,i)),"braceExpand"),match:a((n,i,s={})=>e.match(n,i,wi(r,s)),"match"),sep:e.sep,GLOBSTAR:ir})},"defaults");Nn.defaults=$oe;var t9=a((r,e={})=>(Fp(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,X4.default)(r)),"braceExpand");Nn.braceExpand=t9;var Uoe=a((r,e={})=>new ci(r,e).makeRe(),"makeRe");Nn.makeRe=Uoe;var Boe=a((r,e,t={})=>{let n=new ci(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r},"match");Nn.match=Boe;var Q4=/[?*]|[+@!]\(.*?\)|\[|\]/,Voe=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),ci=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Fp(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||e9,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Q4.test(s[2]))&&!Q4.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let c=n[i+1],l=n[i+2],u=n[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let c=n[o];o===1&&c===""&&n[0]===""||(c==="."||c==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...l),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let i=0,s=0,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,p=f?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[h,_]=[e[d],t[p]];h.toLowerCase()===_.toLowerCase()&&(t[p]=h,s=p,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(ir)?this.#e(e,t,n,i,s):this.#r(e,t,n,i,s)}#e(e,t,n,i,s){let o=t.indexOf(ir,s),c=t.lastIndexOf(ir),[l,u,f]=n?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let T=e.slice(i,i+l.length);if(!this.#r(T,l,n,0,0))return!1;i+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let T=e.length-f.length;if(this.#r(e,f,n,T,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(T--,!this.#r(e,f,n,T,0)))return!1;d=f.length+1}}if(!u.length){let T=!!d;for(let O=i;O<e.length-d;O++){let A=String(e[O]);if(T=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return n||T}let p=[[[],0]],h=p[0],_=0,y=[0];for(let T of u)T===ir?(y.push(_),h=[[],0],p.push(h)):(h[0].push(T),_++);let S=p.length-1,w=e.length-d;for(let T of p)T[1]=w-(y[S--]+T[0].length);return!!this.#n(e,p,i,0,n,0,!!d)}#n(e,t,n,i,s,o,c){let l=t[i];if(!l){for(let d=n;d<e.length;d++){c=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[u,f]=l;for(;n<=f;){if(this.#r(e.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#n(e,t,n+u.length,i+1,s,o+1,c);if(h!==!1)return h}let p=e[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#r(e,t,n,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===ir)return!1;let p;if(typeof f=="string"?(p=d===f,this.debug("string match",f,d,p)):(p=f.test(d),this.debug("pattern match",f,d,p)),!p)return!1}if(o===u&&c===l)return!0;if(o===u)return n;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return t9(this.pattern,this.options)}parse(e){Fp(e);let t=this.options;if(e==="**")return ir;if(e==="")return"";let n,i=null;(n=e.match(Aoe))?i=t.dot?xoe:Ioe:(n=e.match(moe))?i=(t.nocase?t.dot?boe:_oe:t.dot?yoe:goe)(n[1]):(n=e.match(Roe))?i=(t.nocase?t.dot?Ooe:Coe:t.dot?Poe:Doe)(n):(n=e.match(Soe))?i=t.dot?Eoe:woe:(n=e.match(voe))&&(i=Toe);let s=Zc.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Noe:t.dot?koe:Moe,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?Voe(f):f===ir?ir:f._src});return u.forEach((f,d)=>{let p=u[d+1],h=u[d-1];f!==ir||h===ir||(h===void 0?p!==void 0&&p!==ir?u[d+1]="(?:\\/|"+n+"\\/)?"+p:u[d]=n:p===void 0?u[d-1]=h+"(?:\\/|"+n+")?":p!==ir&&(u[d-1]=h+"(?:\\/|\\/"+n+"\\/)"+p,u[d+1]=ir))}),u.filter(f=>f!==ir).join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(n.matchBase&&l.length===1&&(u=[o]),this.matchOne(u,l,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Nn.defaults(e).Minimatch}};Nn.AST=Zc;Nn.Minimatch=ci;Nn.escape=Yu;Nn.unescape=us;var A9=require("node:url");var Qu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,n9=new Set,FI=typeof process=="object"&&process?process:{},i9=a((r,e,t,n)=>{typeof FI.emitWarning=="function"?FI.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},"emitWarning"),n_=globalThis.AbortController,r9=globalThis.AbortSignal;if(typeof n_>"u"){r9=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},n_=class{static{a(this,"AbortController")}constructor(){e()}signal=new r9;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let r=FI.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{r&&(r=!1,i9("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var qoe=a(r=>!n9.has(r),"shouldWarn");var Ka=a(r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),"isPosInt"),s9=a(r=>Ka(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Xu:null:null,"getUintArray"),Xu=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},LI=class r{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let t=s9(e);if(!t)return[];r.#e=!0;let n=new r(e,t);return r.#e=!1,n}constructor(e,t){if(!r.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Np=class r{static{a(this,"LRUCache")}#e;#n;#r;#t;#c;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#o;#h;#g;#d;#m;#y;#f;#v;#T;#b;#E;#S;#w;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#b,sizes:e.#v,keyMap:e.#s,keyList:e.#l,valList:e.#o,next:e.#h,prev:e.#g,get head(){return e.#d},get tail(){return e.#m},free:e.#y,isBackgroundFetch:a(t=>e.#p(t),"isBackgroundFetch"),backgroundFetch:a((t,n,i,s)=>e.#j(t,n,i,s),"backgroundFetch"),moveToTail:a(t=>e.#U(t),"moveToTail"),indexes:a(t=>e.#R(t),"indexes"),rindexes:a(t=>e.#C(t),"rindexes"),isStale:a(t=>e.#A(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#u}get size(){return this.#i}get fetchMethod(){return this.#c}get memoMethod(){return this.#_}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:h=0,maxEntrySize:_=0,sizeCalculation:y,fetchMethod:S,memoMethod:w,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:x,ignoreFetchAbort:P}=e;if(t!==0&&!Ka(t))throw new TypeError("max option must be a nonnegative integer");let V=t?s9(t):Array;if(!V)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=h,this.maxEntrySize=_||this.#n,this.sizeCalculation=y,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=w,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=S,this.#S=!!S,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#h=new V(t),this.#g=new V(t),this.#d=0,this.#m=0,this.#y=LI.create(t),this.#i=0,this.#u=0,typeof u=="function"&&(this.#r=u),typeof f=="function"?(this.#t=f,this.#f=[]):(this.#t=void 0,this.#f=void 0),this.#E=!!this.#r,this.#w=!!this.#t,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#n!==0&&!Ka(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Ka(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Ka(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Ka(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let j="LRU_CACHE_UNBOUNDED";qoe(j)&&(n9.add(j),i9("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,r))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#I(){let e=new Xu(this.#e),t=new Xu(this.#e);this.#b=e,this.#T=t,this.#D=(s,o,c=Qu.now())=>{if(t[s]=o!==0?c:0,e[s]=o,o!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#A(s)&&this.#P(this.#l[s],"expire")},o+1);l.unref&&l.unref()}},this.#x=s=>{t[s]=e[s]!==0?Qu.now():0},this.#a=(s,o)=>{if(e[o]){let c=e[o],l=t[o];if(!c||!l)return;s.ttl=c,s.start=l,s.now=n||i();let u=s.now-l;s.remainingTTL=c-u}};let n=0,i=a(()=>{let s=Qu.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return s},"getNow");this.getRemainingTTL=s=>{let o=this.#s.get(s);if(o===void 0)return 0;let c=e[o],l=t[o];if(!c||!l)return 1/0;let u=(n||i())-l;return c-u},this.#A=s=>{let o=t[s],c=e[s];return!!c&&!!o&&(n||i())-o>c}}#x=a(()=>{},"#updateItemAge");#a=a(()=>{},"#statusTTL");#D=a(()=>{},"#setItemTTL");#A=a(()=>!1,"#isStale");#O(){let e=new Xu(this.#e);this.#u=0,this.#v=e,this.#F=t=>{this.#u-=e[t],e[t]=0},this.#N=(t,n,i,s)=>{if(this.#p(n))return 0;if(!Ka(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!Ka(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#L=(t,n,i)=>{if(e[t]=n,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#M(!0)}this.#u+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#u)}}#F=a(e=>{},"#removeItemSize");#L=a((e,t,n)=>{},"#addItemSize");#N=a((e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#R({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#d));)t=this.#g[t]}*#C({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#d;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#m));)t=this.#h[t]}#k(e){return e!==void 0&&this.#s.get(this.#l[e])===e}*entries(){for(let e of this.#R())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#p(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*rentries(){for(let e of this.#C())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#p(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*keys(){for(let e of this.#R()){let t=this.#l[e];t!==void 0&&!this.#p(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#C()){let t=this.#l[e];t!==void 0&&!this.#p(this.#o[e])&&(yield t)}}*values(){for(let e of this.#R())this.#o[e]!==void 0&&!this.#p(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#C())this.#o[e]!==void 0&&!this.#p(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#R()){let i=this.#o[n],s=this.#p(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#R()){let i=this.#o[n],s=this.#p(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#C()){let i=this.#o[n],s=this.#p(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#C({allowStale:!0}))this.#A(t)&&(this.#P(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let n=this.#o[t],i=this.#p(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#b&&this.#T){let o=this.#b[t],c=this.#T[t];if(o&&c){let l=o-(Qu.now()-c);s.ttl=l,s.start=Date.now()}}return this.#v&&(s.size=this.#v[t]),s}dump(){let e=[];for(let t of this.#R({allowStale:!0})){let n=this.#l[t],i=this.#o[t],s=this.#p(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#b&&this.#T){o.ttl=this.#b[t];let c=Qu.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#v&&(o.size=this.#v[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=Qu.now()-i}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=n,{noUpdateTTL:u=this.noUpdateTTL}=n,f=this.#N(e,t,n.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let d=this.#i===0?void 0:this.#s.get(e);if(d===void 0)d=this.#i===0?this.#m:this.#y.length!==0?this.#y.pop():this.#i===this.#e?this.#M(!1):this.#i,this.#l[d]=e,this.#o[d]=t,this.#s.set(e,d),this.#h[this.#m]=d,this.#g[d]=this.#m,this.#m=d,this.#i++,this.#L(d,f,l),l&&(l.set="add"),u=!1;else{this.#U(d);let p=this.#o[d];if(t!==p){if(this.#S&&this.#p(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=p;h!==void 0&&!o&&(this.#E&&this.#r?.(h,e,"set"),this.#w&&this.#f?.push([h,e,"set"]))}else o||(this.#E&&this.#r?.(p,e,"set"),this.#w&&this.#f?.push([p,e,"set"]));if(this.#F(d),this.#L(d,f,l),this.#o[d]=t,l){l.set="replace";let h=p&&this.#p(p)?p.__staleWhileFetching:p;h!==void 0&&(l.oldValue=h)}}else l&&(l.set="update")}if(i!==0&&!this.#b&&this.#I(),this.#b&&(u||this.#D(d,i,s),l&&this.#a(l,d)),!o&&this.#w&&this.#f){let p=this.#f,h;for(;h=p?.shift();)this.#t?.(...h)}return this}pop(){try{for(;this.#i;){let e=this.#o[this.#d];if(this.#M(!0),this.#p(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#w&&this.#f){let e=this.#f,t;for(;t=e?.shift();)this.#t?.(...t)}}}#M(e){let t=this.#d,n=this.#l[t],i=this.#o[t];return this.#S&&this.#p(i)?i.__abortController.abort(new Error("evicted")):(this.#E||this.#w)&&(this.#E&&this.#r?.(i,n,"evict"),this.#w&&this.#f?.push([i,n,"evict"])),this.#F(t),e&&(this.#l[t]=void 0,this.#o[t]=void 0,this.#y.push(t)),this.#i===1?(this.#d=this.#m=0,this.#y.length=0):this.#d=this.#h[t],this.#s.delete(n),this.#i--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#s.get(e);if(s!==void 0){let o=this.#o[s];if(this.#p(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#a(i,s));else return n&&this.#x(s),i&&(i.has="hit",this.#a(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,i=this.#s.get(e);if(i===void 0||!n&&this.#A(i))return;let s=this.#o[i];return this.#p(s)?s.__staleWhileFetching:s}#j(e,t,n,i){let s=t===void 0?void 0:this.#o[t];if(this.#p(s))return s;let o=new n_,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=a((y,S=!1)=>{let{aborted:w}=o.signal,T=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(w&&!S?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,T&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),w&&!T&&!S)return d(o.signal.reason);let O=h;return this.#o[t]===h&&(y===void 0?O.__staleWhileFetching?this.#o[t]=O.__staleWhileFetching:this.#P(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,l.options))),y},"cb"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),d(y)),"eb"),d=a(y=>{let{aborted:S}=o.signal,w=S&&n.allowStaleOnFetchAbort,T=w||n.allowStaleOnFetchRejection,O=T||n.noDeleteOnFetchRejection,A=h;if(this.#o[t]===h&&(!O||A.__staleWhileFetching===void 0?this.#P(e,"fetch"):w||(this.#o[t]=A.__staleWhileFetching)),T)return n.status&&A.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),A.__staleWhileFetching;if(A.__returned===A)throw y},"fetchFail"),p=a((y,S)=>{let w=this.#c?.(e,s,l);w&&w instanceof Promise&&w.then(T=>y(T===void 0?void 0:T),S),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(T=>u(T,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(u,f),_=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...l.options,status:void 0}),t=this.#s.get(e)):this.#o[t]=_,_}#p(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof n_}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:y,forceRefresh:S=!1,status:w,signal:T}=t;if(!this.#S)return w&&(w.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let O={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:h,status:w,signal:T},A=this.#s.get(e);if(A===void 0){w&&(w.fetch="miss");let x=this.#j(e,A,O,y);return x.__returned=x}else{let x=this.#o[A];if(this.#p(x)){let K=n&&x.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",K&&(w.returnedStale=!0)),K?x.__staleWhileFetching:x.__returned=x}let P=this.#A(A);if(!S&&!P)return w&&(w.fetch="hit"),this.#U(A),i&&this.#x(A),w&&this.#a(w,A),x;let V=this.#j(e,A,O,y),$=V.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=P?"stale":"refresh",$&&P&&(w.returnedStale=!0)),$?V.__staleWhileFetching:V.__returned=V}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#_;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=t,c=this.get(e,o);if(!s&&c!==void 0)return c;let l=n(e,c,{options:o,context:i});return this.set(e,l,o),l}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#o[c],u=this.#p(l);return o&&this.#a(o,c),this.#A(c)?(o&&(o.get="stale"),u?(o&&n&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?l.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&n&&(o.returnedStale=!0),n?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(this.#U(c),i&&this.#x(c),l))}else o&&(o.get="miss")}#$(e,t){this.#g[t]=e,this.#h[e]=t}#U(e){e!==this.#m&&(e===this.#d?this.#d=this.#h[e]:this.#$(this.#g[e],this.#h[e]),this.#$(this.#m,e),this.#m=e)}delete(e){return this.#P(e,"delete")}#P(e,t){let n=!1;if(this.#i!==0){let i=this.#s.get(e);if(i!==void 0)if(n=!0,this.#i===1)this.#B(t);else{this.#F(i);let s=this.#o[i];if(this.#p(s)?s.__abortController.abort(new Error("deleted")):(this.#E||this.#w)&&(this.#E&&this.#r?.(s,e,t),this.#w&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#o[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#d)this.#d=this.#h[i];else{let o=this.#g[i];this.#h[o]=this.#h[i];let c=this.#h[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#w&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return n}clear(){return this.#B("delete")}#B(e){for(let t of this.#C({allowStale:!0})){let n=this.#o[t];if(this.#p(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#E&&this.#r?.(n,i,e),this.#w&&this.#f?.push([n,i,e])}}if(this.#s.clear(),this.#o.fill(void 0),this.#l.fill(void 0),this.#b&&this.#T&&(this.#b.fill(0),this.#T.fill(0)),this.#v&&this.#v.fill(0),this.#d=0,this.#m=0,this.#y.length=0,this.#u=0,this.#i=0,this.#w&&this.#f){let t=this.#f,n;for(;n=t?.shift();)this.#t?.(...n)}}};var ef=require("node:path"),m9=require("node:url"),Xs=require("fs"),Zoe=Se(require("node:fs"),1),Xa=require("node:fs/promises");var u_=require("node:events"),BI=Se(require("node:stream"),1),u9=require("node:string_decoder");var o9=typeof process=="object"&&process?process:{stdout:null,stderr:null},Goe=a(r=>!!r&&typeof r=="object"&&(r instanceof Qa||r instanceof BI.default||Woe(r)||Hoe(r)),"isStream"),Woe=a(r=>!!r&&typeof r=="object"&&r instanceof u_.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==BI.default.Writable.prototype.pipe,"isReadable"),Hoe=a(r=>!!r&&typeof r=="object"&&r instanceof u_.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable"),Xo=Symbol("EOF"),Jo=Symbol("maybeEmitEnd"),Ya=Symbol("emittedEnd"),i_=Symbol("emittingEnd"),kp=Symbol("emittedError"),s_=Symbol("closed"),a9=Symbol("read"),o_=Symbol("flush"),c9=Symbol("flushChunk"),fs=Symbol("encoding"),Ju=Symbol("decoder"),$r=Symbol("flowing"),Mp=Symbol("paused"),Zu=Symbol("resume"),Ur=Symbol("buffer"),kn=Symbol("pipes"),Br=Symbol("bufferLength"),NI=Symbol("bufferPush"),a_=Symbol("bufferShift"),gn=Symbol("objectMode"),sr=Symbol("destroyed"),kI=Symbol("error"),MI=Symbol("emitData"),l9=Symbol("emitEnd"),jI=Symbol("emitEnd2"),Ys=Symbol("async"),$I=Symbol("abort"),c_=Symbol("aborted"),jp=Symbol("signal"),el=Symbol("dataListeners"),li=Symbol("discarded"),$p=a(r=>Promise.resolve().then(r),"defer"),zoe=a(r=>r(),"nodefer"),Koe=a(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),Yoe=a(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),Qoe=a(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),l_=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Zu](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},UI=class extends l_{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},Xoe=a(r=>!!r.objectMode,"isObjectModeOptions"),Joe=a(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),Qa=class extends u_.EventEmitter{static{a(this,"Minipass")}[$r]=!1;[Mp]=!1;[kn]=[];[Ur]=[];[gn];[fs];[Ys];[Ju];[Xo]=!1;[Ya]=!1;[i_]=!1;[s_]=!1;[kp]=null;[Br]=0;[sr]=!1;[jp];[c_]=!1;[el]=0;[li]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Xoe(t)?(this[gn]=!0,this[fs]=null):Joe(t)?(this[fs]=t.encoding,this[gn]=!1):(this[gn]=!1,this[fs]=null),this[Ys]=!!t.async,this[Ju]=this[fs]?new u9.StringDecoder(this[fs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[Ur],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[kn],"get")});let{signal:n}=t;n&&(this[jp]=n,n.aborted?this[$I]():n.addEventListener("abort",()=>this[$I]()))}get bufferLength(){return this[Br]}get encoding(){return this[fs]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[gn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ys]}set async(e){this[Ys]=this[Ys]||!!e}[$I](){this[c_]=!0,this.emit("abort",this[jp]?.reason),this.destroy(this[jp]?.reason)}get aborted(){return this[c_]}set aborted(e){}write(e,t,n){if(this[c_])return!1;if(this[Xo])throw new Error("write after end");if(this[sr])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let i=this[Ys]?$p:zoe;if(!this[gn]&&!Buffer.isBuffer(e)){if(Qoe(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Yoe(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[gn]?(this[$r]&&this[Br]!==0&&this[o_](!0),this[$r]?this.emit("data",e):this[NI](e),this[Br]!==0&&this.emit("readable"),n&&i(n),this[$r]):e.length?(typeof e=="string"&&!(t===this[fs]&&!this[Ju]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[fs]&&(e=this[Ju].write(e)),this[$r]&&this[Br]!==0&&this[o_](!0),this[$r]?this.emit("data",e):this[NI](e),this[Br]!==0&&this.emit("readable"),n&&i(n),this[$r]):(this[Br]!==0&&this.emit("readable"),n&&i(n),this[$r])}read(e){if(this[sr])return null;if(this[li]=!1,this[Br]===0||e===0||e&&e>this[Br])return this[Jo](),null;this[gn]&&(e=null),this[Ur].length>1&&!this[gn]&&(this[Ur]=[this[fs]?this[Ur].join(""):Buffer.concat(this[Ur],this[Br])]);let t=this[a9](e||null,this[Ur][0]);return this[Jo](),t}[a9](e,t){if(this[gn])this[a_]();else{let n=t;e===n.length||e===null?this[a_]():typeof n=="string"?(this[Ur][0]=n.slice(e),t=n.slice(0,e),this[Br]-=e):(this[Ur][0]=n.subarray(e),t=n.subarray(0,e),this[Br]-=e)}return this.emit("data",t),!this[Ur].length&&!this[Xo]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Xo]=!0,this.writable=!1,(this[$r]||!this[Mp])&&this[Jo](),this}[Zu](){this[sr]||(!this[el]&&!this[kn].length&&(this[li]=!0),this[Mp]=!1,this[$r]=!0,this.emit("resume"),this[Ur].length?this[o_]():this[Xo]?this[Jo]():this.emit("drain"))}resume(){return this[Zu]()}pause(){this[$r]=!1,this[Mp]=!0,this[li]=!1}get destroyed(){return this[sr]}get flowing(){return this[$r]}get paused(){return this[Mp]}[NI](e){this[gn]?this[Br]+=1:this[Br]+=e.length,this[Ur].push(e)}[a_](){return this[gn]?this[Br]-=1:this[Br]-=this[Ur][0].length,this[Ur].shift()}[o_](e=!1){do;while(this[c9](this[a_]())&&this[Ur].length);!e&&!this[Ur].length&&!this[Xo]&&this.emit("drain")}[c9](e){return this.emit("data",e),this[$r]}pipe(e,t){if(this[sr])return e;this[li]=!1;let n=this[Ya];return t=t||{},e===o9.stdout||e===o9.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[kn].push(t.proxyErrors?new UI(this,e,t):new l_(this,e,t)),this[Ys]?$p(()=>this[Zu]()):this[Zu]()),e}unpipe(e){let t=this[kn].find(n=>n.dest===e);t&&(this[kn].length===1?(this[$r]&&this[el]===0&&(this[$r]=!1),this[kn]=[]):this[kn].splice(this[kn].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[li]=!1,this[el]++,!this[kn].length&&!this[$r]&&this[Zu]();else if(e==="readable"&&this[Br]!==0)super.emit("readable");else if(Koe(e)&&this[Ya])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[kp]){let i=t;this[Ys]?$p(()=>i.call(this,this[kp])):i.call(this,this[kp])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[el]=this.listeners("data").length,this[el]===0&&!this[li]&&!this[kn].length&&(this[$r]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[el]=0,!this[li]&&!this[kn].length&&(this[$r]=!1)),t}get emittedEnd(){return this[Ya]}[Jo](){!this[i_]&&!this[Ya]&&!this[sr]&&this[Ur].length===0&&this[Xo]&&(this[i_]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[s_]&&this.emit("close"),this[i_]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==sr&&this[sr])return!1;if(e==="data")return!this[gn]&&!n?!1:this[Ys]?($p(()=>this[MI](n)),!0):this[MI](n);if(e==="end")return this[l9]();if(e==="close"){if(this[s_]=!0,!this[Ya]&&!this[sr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[kp]=n,super.emit(kI,n);let s=!this[jp]||this.listeners("error").length?super.emit("error",n):!1;return this[Jo](),s}else if(e==="resume"){let s=super.emit("resume");return this[Jo](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[Jo](),i}[MI](e){for(let n of this[kn])n.dest.write(e)===!1&&this.pause();let t=this[li]?!1:super.emit("data",e);return this[Jo](),t}[l9](){return this[Ya]?!1:(this[Ya]=!0,this.readable=!1,this[Ys]?($p(()=>this[jI]()),!0):this[jI]())}[jI](){if(this[Ju]){let t=this[Ju].end();if(t){for(let n of this[kn])n.dest.write(t);this[li]||super.emit("data",t)}}for(let t of this[kn])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[gn]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[gn]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[gn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[fs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(sr,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[li]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Xo])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(sr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(sr,f),this.pause(),s({value:d,done:!!this[Xo]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(sr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(sr,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[li]=!1;let e=!1,t=a(()=>(this.pause(),this.off(kI,t),this.off(sr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(kI,t),this.once(sr,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[sr])return e?this.emit("error",e):this.emit(sr),this;this[sr]=!0,this[li]=!0,this[Ur].length=0,this[Br]=0;let t=this;return typeof t.close=="function"&&!this[s_]&&t.close(),e?this.emit("error",e):this.emit(sr),this}static get isStream(){return Goe}};var eae=Xs.realpathSync.native,Bp={lstatSync:Xs.lstatSync,readdir:Xs.readdir,readdirSync:Xs.readdirSync,readlinkSync:Xs.readlinkSync,realpathSync:eae,promises:{lstat:Xa.lstat,readdir:Xa.readdir,readlink:Xa.readlink,realpath:Xa.realpath}},g9=a(r=>!r||r===Bp||r===Zoe?Bp:{...Bp,...r,promises:{...Bp.promises,...r.promises||{}}},"fsFromOption"),y9=/^\\\\\?\\([a-z]:)\\?$/i,tae=a(r=>r.replace(/\//g,"\\").replace(y9,"$1\\"),"uncToDrive"),rae=/[\\\/]/,vi=0,_9=1,b9=2,Qs=4,S9=6,w9=8,tl=10,E9=12,Ei=15,Up=~Ei,VI=16,f9=32,Vp=64,ds=128,f_=256,p_=512,d9=Vp|ds|p_,nae=1023,qI=a(r=>r.isFile()?w9:r.isDirectory()?Qs:r.isSymbolicLink()?tl:r.isCharacterDevice()?b9:r.isBlockDevice()?S9:r.isSocket()?E9:r.isFIFO()?_9:vi,"entToType"),p9=new Map,qp=a(r=>{let e=p9.get(r);if(e)return e;let t=r.normalize("NFKD");return p9.set(r,t),t},"normalize"),h9=new Map,d_=a(r=>{let e=h9.get(r);if(e)return e;let t=qp(r.toLowerCase());return h9.set(r,t),t},"normalizeNocase"),h_=class extends Np{static{a(this,"ResolveCache")}constructor(){super({max:256})}},GI=class extends Np{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},v9=Symbol("PathScurry setAsCwd"),yn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#t;get nlink(){return this.#t}#c;get uid(){return this.#c}#_;get gid(){return this.#_}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#o;get blocks(){return this.#o}#h;get atimeMs(){return this.#h}#g;get mtimeMs(){return this.#g}#d;get ctimeMs(){return this.#d}#m;get birthtimeMs(){return this.#m}#y;get atime(){return this.#y}#f;get mtime(){return this.#f}#v;get ctime(){return this.#v}#T;get birthtime(){return this.#T}#b;#E;#S;#w;#I;#x;#a;#D;#A;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=vi,n,i,s,o,c){this.name=e,this.#b=s?d_(e):qp(e),this.#a=t&nae,this.nocase=s,this.roots=i,this.root=n||this,this.#D=o,this.#S=c.fullpath,this.#I=c.relative,this.#x=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=g9(c.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#F(i):this.#F(i)}#F(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#D.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#D.set(this,t),this.#a&=~VI,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?d_(e):qp(e);for(let l of n)if(l.#b===i)return l;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,c=this.newChild(e,vi,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#a|=ds),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#w!==void 0)return this.#w;if(this.sep==="/")return this.#w=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#w=`//?/${i}`:this.#w=i}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#w=n}isUnknown(){return(this.#a&Ei)===vi}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#a&Ei)===w9}isDirectory(){return(this.#a&Ei)===Qs}isCharacterDevice(){return(this.#a&Ei)===b9}isBlockDevice(){return(this.#a&Ei)===S9}isFIFO(){return(this.#a&Ei)===_9}isSocket(){return(this.#a&Ei)===E9}isSymbolicLink(){return(this.#a&tl)===tl}lstatCached(){return this.#a&f9?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#A)return!0;if(!this.parent)return!1;let e=this.#a&Ei;return!(e!==vi&&e!==tl||this.#a&f_||this.#a&ds)}calledReaddir(){return!!(this.#a&VI)}isENOENT(){return!!(this.#a&ds)}isNamed(e){return this.nocase?this.#b===d_(e):this.#b===qp(e)}async readlink(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#A=n}catch(t){this.#p(t.code);return}}readlinkSync(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#A=n}catch(t){this.#p(t.code);return}}#L(e){this.#a|=VI;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#N()}}#N(){this.#a&ds||(this.#a=(this.#a|ds)&Up,this.#R())}#R(){let e=this.children();e.provisional=0;for(let t of e)t.#N()}#C(){this.#a|=p_,this.#k()}#k(){if(this.#a&Vp)return;let e=this.#a;(e&Ei)===Qs&&(e&=Up),this.#a=e|Vp,this.#R()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#N():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#N()}#p(e=""){let t=this.#a;t|=f_,e==="ENOENT"&&(t|=ds),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Up),this.#a=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#$(e,t){return this.#P(e,t)||this.#U(e,t)}#U(e,t){let n=qI(e),i=this.newChild(e.name,n,{parent:this}),s=i.#a&Ei;return s!==Qs&&s!==tl&&s!==vi&&(i.#a|=Vp),t.unshift(i),t.provisional++,i}#P(e,t){for(let n=t.provisional;n<t.length;n++){let i=t[n];if((this.nocase?d_(e.name):qp(e.name))===i.#b)return this.#B(e,i,n,t)}}#B(e,t,n,i){let s=t.name;return t.#a=t.#a&Up|qI(e),s!==e.name&&(t.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#a&ds)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#a&ds)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#W(e){let{atime:t,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:_,mtimeMs:y,nlink:S,rdev:w,size:T,uid:O}=e;this.#y=t,this.#h=n,this.#T=i,this.#m=s,this.#u=o,this.#o=c,this.#v=l,this.#d=u,this.#n=f,this.#_=d,this.#s=p,this.#r=h,this.#f=_,this.#g=y,this.#t=S,this.#i=w,this.#l=T,this.#c=O;let A=qI(e);this.#a=this.#a&Up|A|f9,A!==vi&&A!==Qs&&A!==tl&&(this.#a|=Vp)}#q=[];#G=!1;#H(e){this.#G=!1;let t=this.#q.slice();this.#q.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#q.push(e),this.#G)return;this.#G=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#M(s.code),n.provisional=0;else{for(let c of o)this.#$(c,n);this.#L(n)}this.#H(n.slice(0,n.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#V)await this.#V;else{let n=a(()=>{},"resolve");this.#V=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#L(e)}catch(i){this.#M(i.code),e.provisional=0}this.#V=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#$(n,e);this.#L(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#a&d9)return!1;let e=Ei&this.#a;return e===vi||e===Qs||e===tl}shouldWalk(e,t){return(this.#a&Qs)===Qs&&!(this.#a&d9)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((p_|f_|ds)&this.#a))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#C()}}realpathSync(){if(this.#O)return this.#O;if(!((p_|f_|ds)&this.#a))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#C()}}[v9](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],i=this;for(;i&&i.parent;)t.add(i),i.#I=n.join(this.sep),i.#x=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#I=void 0,i.#x=void 0,i=i.parent}},m_=class r extends yn{static{a(this,"PathWin32")}sep="\\";splitSep=rae;constructor(e,t=vi,n,i,s,o,c){super(e,t,n,i,s,o,c)}newChild(e,t=vi,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return ef.win32.parse(e).root}getRoot(e){if(e=tae(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new tf(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(y9,"$1\\"),e===t}},g_=class r extends yn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=vi,n,i,s,o,c){super(e,t,n,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=vi,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},y_=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=Bp}={}){this.#t=g9(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,m9.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new h_,this.#n=new h_,this.#r=new GI(s);let l=c.substring(this.rootPath.length).split(n);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,p=this.rootPath,h=!1;for(let _ of l){let y=f--;u=u.child(_,{relative:new Array(y).fill("..").join(d),relativePosix:new Array(y).fill("..").join("/"),fullpath:p+=(h?"":d)+_}),h=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#e.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#n.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set,u=a((d,p)=>{l.add(d),d.readdirCB((h,_)=>{if(h)return p(h);let y=_.length;if(!y)return p();let S=a(()=>{--y===0&&p()},"next");for(let w of _)(!s||s(w))&&c.push(n?w:w.fullpath()),i&&w.isSymbolicLink()?w.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(l,o)?u(T,S):S()):w.shouldWalk(l,o)?u(w,S):S()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let d of f){(!s||s(d))&&c.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(l,o)&&l.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield n?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Qa({objectMode:!0});(!s||s(e))&&c.write(n?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let _=a((S,w,T=!1)=>{if(S)return c.emit("error",S);if(i&&!T){let O=[];for(let A of w)A.isSymbolicLink()&&O.push(A.realpath().then(x=>x?.isUnknown()?x.lstat():x));if(O.length){Promise.all(O).then(()=>_(null,w,!0));return}}for(let O of w)O&&(!s||s(O))&&(c.write(n?O:O.fullpath())||(p=!0));f--;for(let O of w){let A=O.realpathCached()||O;A.shouldWalk(l,o)&&u.push(A)}p&&!c.flowing?c.once("drain",d):y||d()},"onReaddir"),y=!0;h.readdirCB(_,!0),y=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Qa({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(n?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let _=h.readdirSync();for(let y of _)(!s||s(y))&&(c.write(n?y:y.fullpath())||(p=!0));f--;for(let y of _){let S=y;if(y.isSymbolicLink()){if(!(i&&(S=y.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(l,o)&&u.push(S)}}p&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[v9](t)}},tf=class extends y_{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,ef.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return ef.win32.parse(e).root.toUpperCase()}newRoot(e){return new m_(this.rootPath,Qs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},rf=class extends y_{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,ef.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new g_(this.rootPath,Qs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Gp=class extends rf{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},V2e=process.platform==="win32"?m_:g_,T9=process.platform==="win32"?tf:process.platform==="darwin"?Gp:rf;var iae=a(r=>r.length>=1,"isPatternList"),sae=a(r=>r.length>=1,"isGlobList"),nf=class r{static{a(this,"Pattern")}#e;#n;#r;length;#t;#c;#_;#i;#u;#s;#l=!0;constructor(e,t,n,i){if(!iae(e))throw new TypeError("empty pattern list");if(!sae(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=n,this.#t=i,this.#r===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#e,[f,d,p,h,..._]=this.#n;u[0]===""&&(u.shift(),_.shift());let y=[s,o,c,l,""].join("/"),S=[f,d,p,h,""].join("/");this.#e=[y,...u],this.#n=[S,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[c,...l]=this.#n;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...o],this.#n=[f,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===ir}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#_=this.#_||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#c!==void 0?this.#c:this.hasMore()?(this.#c=new r(this.#e,this.#n,this.#r+1,this.#t),this.#c.#s=this.#s,this.#c.#u=this.#u,this.#c.#i=this.#i,this.#c):this.#c=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#t==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#i!==void 0?this.#i:this.#i=this.#t==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var oae=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",sf=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:s,platform:o=oae}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new ci(e,this.mmopts);for(let n=0;n<t.set.length;n++){let i=t.set[n],s=t.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new nf(i,s,0,this.platform),c=new ci(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),n=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var WI=class r{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),i=this.store.get(n);i?i.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},HI=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,n){let i=(t?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},zI=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Wp=class r{static{a(this,"Processor")}hasWalkedCache;matches=new HI;subwalks=new zI;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new WI}processPatterns(e,t){this.patterns=t;let n=t.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===ir){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(i,c,d===""||d===".");else if(d===".."){let h=i.parent||i;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of n){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===ir?i.testGlobstar(s,o,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,n,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,t,n,i){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,t,n,i){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var aae=a((r,e)=>typeof r=="string"?new sf([r],e):Array.isArray(r)?new sf(r,e):r,"makeIgnore"),__=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#n=aae(n.ignore??[],n),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#c(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#t(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#t(e))return;if(!this.includeChildMatches&&this.#n?.add){let s=`${e.relativePosix()}/**`;this.#n.add(s)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,t)}matchSync(e,t,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new Wp(this.opts),n)}walkCB2(e,t,n,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,o):c.readdirCB((u,f)=>this.walkCB3(c,f,n,o),!0)}o()}walkCB3(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of n.subwalks.entries())s++,this.walkCB2(c,l,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new Wp(this.opts),n)}walkCB2Sync(e,t,n,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,o)}o()}walkCB3Sync(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())s++,this.walkCB2Sync(c,l,n.child(),o);o()}},Hp=class extends __{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},zp=class extends __{static{a(this,"GlobStream")}results;constructor(e,t,n){super(e,t,n),this.results=new Qa({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var cae=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ps=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,A9.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||cae,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?tf:t.platform==="darwin"?Gp:t.platform?rf:T9;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new ci(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new nf(l,f,0,this.platform)})}async walk(){return[...await new Hp(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Hp(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new zp(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new zp(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var KI=a((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new ci(t,e).hasMagic())return!0;return!1},"hasMagic");function b_(r,e={}){return new ps(r,e).streamSync()}a(b_,"globStreamSync");function x9(r,e={}){return new ps(r,e).stream()}a(x9,"globStream");function R9(r,e={}){return new ps(r,e).walkSync()}a(R9,"globSync");async function I9(r,e={}){return new ps(r,e).walk()}a(I9,"glob_");function S_(r,e={}){return new ps(r,e).iterateSync()}a(S_,"globIterateSync");function C9(r,e={}){return new ps(r,e).iterate()}a(C9,"globIterate");var lae=b_,uae=Object.assign(x9,{sync:b_}),fae=S_,dae=Object.assign(C9,{sync:S_}),pae=Object.assign(R9,{stream:b_,iterate:S_}),Ja=Object.assign(I9,{glob:I9,globSync:R9,sync:pae,globStream:x9,stream:uae,globStreamSync:b_,streamSync:lae,globIterate:C9,iterate:dae,globIterateSync:S_,iterateSync:fae,Glob:ps,hasMagic:KI,escape:Yu,unescape:us});Ja.glob=Ja;async function O9(r,e,t,n={}){let{dryRun:i=!1,excludeRelPath:s}=n,o=rl.default.join(r,"**/*.md"),c=await Ja(o,{nodir:!0,ignore:[rl.default.join(r,".obsidian/**"),rl.default.join(r,".trash/**"),rl.default.join(r,"**/.obsidian/**"),rl.default.join(r,"**/.trash/**")]}),l={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let u of c){let f=rl.default.relative(r,u);if(s&&f===s)continue;l.filesScanned+=1;let d;try{d=await QI.default.readFile(u,"utf-8")}catch{continue}let{updated:p,replacements:h}=hae(d,e,t);h>0&&(l.filesModified+=1,l.replacements+=h,l.modifiedFiles.push(f),i||await QI.default.writeFile(u,p,"utf-8"))}return l}a(O9,"rewriteInboundWikilinks");function hae(r,e,t){let n=r.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=n[s],c=mae(o,e,t);i+=c.replacements,n[s]=c.updated}return{updated:n.join(""),replacements:i}}a(hae,"rewriteContent");function mae(r,e,t){let n=r.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=gae(n[s],e,t);i+=o.replacements,n[s]=o.updated}return{updated:n.join(""),replacements:i}}a(mae,"rewriteProseSegment");function gae(r,e,t){let n=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:r.replace(n,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}a(gae,"replaceWikilinks");var yae=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$t=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await br.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return br.default.readFile(t,"utf-8")}async create(e,t){let n=this.resolvePath(e);if(await br.default.pathExists(n))throw new Error(`File already exists: ${e}`);return await br.default.ensureDir(Kt.default.dirname(n)),await br.default.writeFile(n,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let n=this.resolvePath(e.path);if(!await br.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await br.default.writeFile(n,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await br.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await br.default.remove(t)}async exists(e){let t=this.resolvePath(e);return br.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let n=br.default.statSync(t);if(n.isFile())return this.createFileObject(e);if(n.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let n=Kt.default.relative(this.rootPath,t);e.push(this.createFileObject(n))}}),e}getFrontmatter(e){try{let t=br.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let n=await this.read(e),i=this.extractFrontmatter(n)||{},s=t(i),o=this.replaceFrontmatter(n,s);await this.modify(e,o)}async rename(e,t){let n=this.resolvePath(e.path),i=this.resolvePath(t);if(!await br.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await br.default.ensureDir(Kt.default.dirname(i)),await br.default.move(n,i)}async createFolder(e){let t=this.resolvePath(e);await br.default.ensureDir(t)}getFirstLinkpathDest(e,t){let n=e.split("|")[0].trim();if(!n)return null;if(yae.test(n)){this.uuidIndex===null&&this.buildUuidIndex();let u=n.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let i=Kt.default.dirname(this.resolvePath(t)),s;if(Kt.default.isAbsolute(n)?s=this.resolvePath(n):s=Kt.default.resolve(i,n),n.endsWith(".md")||(s+=".md"),br.default.existsSync(s)){let u=Kt.default.relative(this.rootPath,s);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let o=n.toLowerCase(),c=this.basenameIndex.get(o);if(c)return this.createFileObject(c);let l=this.aliasIndex.get(o);return l?this.createFileObject(l):null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=Kt.default.relative(this.rootPath,e),n=Kt.default.basename(e,".md").toLowerCase();this.basenameIndex.has(n)||this.basenameIndex.set(n,t);let i;try{i=br.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let n=Kt.default.basename(e,".md").match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(n){let i=n[1].toLowerCase(),s=Kt.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let n=await this.read(e),i=t(n);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,n){let i=Kt.default.basename(t,".md");await O9(this.rootPath,n,i,{excludeRelPath:e})}resolvePath(e){if(Kt.default.isAbsolute(e))return e;let t=this.rootPath.replace(/[/\\]+$/,""),n=Kt.default.sep+e;return n===t||n.startsWith(t+Kt.default.sep)?n:Kt.default.join(this.rootPath,e)}createFileObject(e){let t=Kt.default.basename(e),n=Kt.default.basename(e,Kt.default.extname(e)),i=Kt.default.dirname(e);return{path:e,basename:n,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:Kt.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,n=e.match(t);return n?(0,P9.parseYamlFrontmatterTolerant)(n[1]):null}replaceFrontmatter(e,t){let n=Ln.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
|
|
401
|
+
`+b.slice(k+1):H+=b.slice(B),H.slice(1)}a(Me,"foldLine");function We(b){let F="",X=0;for(let G=0;G<b.length;X>=65536?G+=2:G++){X=Ie(b,G);let B=ee[X];!B&&_e(X)?(F+=b[G],X>=65536&&(F+=b[G+1])):F+=B||ie(X)}return F}a(We,"escapeString");function Ve(b,F,X){let G="",B=b.tag;for(let M=0,k=X.length;M<k;M+=1){let W=X[M];b.replacer&&(W=b.replacer.call(X,String(M),W)),(U(b,F,W,!1,!1)||typeof W>"u"&&U(b,F,null,!1,!1))&&(G!==""&&(G+=","+(b.condenseFlow?"":" ")),G+=b.dump)}b.tag=B,b.dump="["+G+"]"}a(Ve,"writeFlowSequence");function $e(b,F,X,G){let B="",M=b.tag;for(let k=0,W=X.length;k<W;k+=1){let H=X[k];b.replacer&&(H=b.replacer.call(X,String(k),H)),(U(b,F+1,H,!0,!0,!1,!0)||typeof H>"u"&&U(b,F+1,null,!0,!0,!1,!0))&&((!G||B!=="")&&(B+=me(b,F)),b.dump&&c===b.dump.charCodeAt(0)?B+="-":B+="- ",B+=b.dump)}b.tag=M,b.dump=B||"[]"}a($e,"writeBlockSequence");function He(b,F,X){let G="",B=b.tag,M=Object.keys(X);for(let k=0,W=M.length;k<W;k+=1){let H="";G!==""&&(H+=", "),b.condenseFlow&&(H+='"');let oe=M[k],ge=X[oe];b.replacer&&(ge=b.replacer.call(X,oe,ge)),U(b,F,oe,!1,!1)&&(b.dump.length>1024&&(H+="? "),H+=b.dump+(b.condenseFlow?'"':"")+":"+(b.condenseFlow?"":" "),U(b,F,ge,!1,!1)&&(H+=b.dump,G+=H))}b.tag=B,b.dump="{"+G+"}"}a(He,"writeFlowMapping");function m(b,F,X,G){let B="",M=b.tag,k=Object.keys(X);if(b.sortKeys===!0)k.sort();else if(typeof b.sortKeys=="function")k.sort(b.sortKeys);else if(b.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let W=0,H=k.length;W<H;W+=1){let oe="";(!G||B!=="")&&(oe+=me(b,F));let ge=k[W],Re=X[ge];if(b.replacer&&(Re=b.replacer.call(X,ge,Re)),!U(b,F+1,ge,!0,!0,!0))continue;let rt=b.tag!==null&&b.tag!=="?"||b.dump&&b.dump.length>1024;rt&&(b.dump&&c===b.dump.charCodeAt(0)?oe+="?":oe+="? "),oe+=b.dump,rt&&(oe+=me(b,F)),U(b,F+1,Re,!0,rt)&&(b.dump&&c===b.dump.charCodeAt(0)?oe+=":":oe+=": ",oe+=b.dump,B+=oe)}b.tag=M,b.dump=B||"{}"}a(m,"writeBlockMapping");function L(b,F,X){let G=X?b.explicitTypes:b.implicitTypes;for(let B=0,M=G.length;B<M;B+=1){let k=G[B];if((k.instanceOf||k.predicate)&&(!k.instanceOf||typeof F=="object"&&F instanceof k.instanceOf)&&(!k.predicate||k.predicate(F))){if(X?k.multi&&k.representName?b.tag=k.representName(F):b.tag=k.tag:b.tag="?",k.represent){let W=b.styleMap[k.tag]||k.defaultStyle,H;if(n.call(k.represent)==="[object Function]")H=k.represent(F,W);else if(i.call(k.represent,W))H=k.represent[W](F,W);else throw new e("!<"+k.tag+'> tag resolver accepts not "'+W+'" style');b.dump=H}return!0}}return!1}a(L,"detectType");function U(b,F,X,G,B,M,k){b.tag=null,b.dump=X,L(b,X,!1)||L(b,X,!0);let W=n.call(b.dump),H=G;G&&(G=b.flowLevel<0||b.flowLevel>F);let oe=W==="[object Object]"||W==="[object Array]",ge,Re;if(oe&&(ge=b.duplicates.indexOf(X),Re=ge!==-1),(b.tag!==null&&b.tag!=="?"||Re||b.indent!==2&&F>0)&&(B=!1),Re&&b.usedDuplicates[ge])b.dump="*ref_"+ge;else{if(oe&&Re&&!b.usedDuplicates[ge]&&(b.usedDuplicates[ge]=!0),W==="[object Object]")G&&Object.keys(b.dump).length!==0?(m(b,F,b.dump,B),Re&&(b.dump="&ref_"+ge+b.dump)):(He(b,F,b.dump),Re&&(b.dump="&ref_"+ge+" "+b.dump));else if(W==="[object Array]")G&&b.dump.length!==0?(b.noArrayIndent&&!k&&F>0?$e(b,F-1,b.dump,B):$e(b,F,b.dump,B),Re&&(b.dump="&ref_"+ge+b.dump)):(Ve(b,F,b.dump),Re&&(b.dump="&ref_"+ge+" "+b.dump));else if(W==="[object String]")b.tag!=="?"&&xe(b,b.dump,F,M,H);else{if(W==="[object Undefined]")return!1;if(b.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+W)}if(b.tag!==null&&b.tag!=="?"){let rt=encodeURI(b.tag[0]==="!"?b.tag.slice(1):b.tag).replace(/!/g,"%21");b.tag[0]==="!"?rt="!"+rt:rt.slice(0,18)==="tag:yaml.org,2002:"?rt="!!"+rt.slice(18):rt="!<"+rt+">",b.dump=rt+" "+b.dump}}return!0}a(U,"writeNode");function R(b,F){let X=[],G=[];C(b,X,G);let B=G.length;for(let M=0;M<B;M+=1)F.duplicates.push(X[G[M]]);F.usedDuplicates=new Array(B)}a(R,"getDuplicateReferences");function C(b,F,X){if(b!==null&&typeof b=="object"){let G=F.indexOf(b);if(G!==-1)X.indexOf(G)===-1&&X.push(G);else if(F.push(b),Array.isArray(b))for(let B=0,M=b.length;B<M;B+=1)C(b[B],F,X);else{let B=Object.keys(b);for(let M=0,k=B.length;M<k;M+=1)C(b[B[M]],F,X)}}}a(C,"inspectNode");function D(b,F){F=F||{};let X=new ye(F);X.noRefs||R(b,X);let G=b;return X.replacer&&(G=X.replacer.call({"":G},"",G)),U(X,0,G,!0,!0)?X.dump+`
|
|
402
|
+
`:""}return a(D,"dump2"),xI.dump=D,xI}a(Kse,"requireDumper");var d4;function Yse(){if(d4)return mn;d4=1;let r=zse(),e=Kse();function t(n,i){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return a(t,"renamed"),mn.Type=Fn(),mn.Schema=p4(),mn.FAILSAFE_SCHEMA=y4(),mn.JSON_SCHEMA=E4(),mn.CORE_SCHEMA=v4(),mn.DEFAULT_SCHEMA=RI(),mn.load=r.load,mn.loadAll=r.loadAll,mn.dump=e.dump,mn.YAMLException=Pp(),mn.types={binary:I4(),float:w4(),map:g4(),null:_4(),pairs:R4(),set:C4(),timestamp:T4(),bool:b4(),int:S4(),merge:A4(),omap:x4(),seq:m4(),str:h4()},mn.safeLoad=t("safeLoad","load"),mn.safeLoadAll=t("safeLoadAll","loadAll"),mn.safeDump=t("safeDump","dump"),mn}a(Yse,"requireJsYaml");var Qse=Yse(),Ln=Wse(Qse),{Type:HTe,Schema:zTe,FAILSAFE_SCHEMA:KTe,JSON_SCHEMA:YTe,CORE_SCHEMA:QTe,DEFAULT_SCHEMA:XTe,load:JTe,loadAll:ZTe,dump:e2e,YAMLException:t2e,types:r2e,safeLoad:n2e,safeLoadAll:i2e,safeDump:s2e}=Ln;var P9=Se(it());var QI=Se(Qo()),rl=Se(require("path"));var X4=Se(V4(),1);var Fp=a(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var ioe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Lp=a(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),soe=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),q4=a(r=>r.join(""),"rangesToString"),G4=a((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<r.length;){let y=r.charAt(s);if((y==="!"||y==="^")&&s===t+1){u=!0,s++;continue}if(y==="]"&&o&&!l){f=s+1;break}if(o=!0,y==="\\"&&!l){l=!0,s++;continue}if(y==="["&&!l){for(let[S,[w,T,O]]of Object.entries(ioe))if(r.startsWith(S,s)){if(d)return["$.",!1,r.length-t,!0];s+=S.length,O?i.push(w):n.push(w),c=c||T;continue e}}if(l=!1,d){y>d?n.push(Lp(d)+"-"+Lp(y)):y===d&&n.push(Lp(y)),d="",s++;continue}if(r.startsWith("-]",s+1)){n.push(Lp(y+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=y,s+=2;continue}n.push(Lp(y)),s++}if(f<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let y=n[0].length===2?n[0].slice(-1):n[0];return[soe(y),!1,f-t,!1]}let p="["+(u?"^":"")+q4(n)+"]",h="["+(u?"":"^")+q4(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,c,f-t,!0]},"parseClass");var us=a((r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var Jn,ooe=new Set(["!","?","+","*","@"]),PI=a(r=>ooe.has(r),"isExtglobType"),W4=a(r=>PI(r.type),"isExtglobAST"),aoe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),coe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),loe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),H4=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),uoe="(?!(?:^|/)\\.\\.?(?:$|/))",r_="(?!\\.)",foe=new Set(["[","."]),doe=new Set(["..","."]),poe=new Set("().*{}+?[]^$\\!"),hoe=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),DI="[^/]",z4=DI+"*?",K4=DI+"+?",Zc=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#_;#i;#u=!1;#s;#l;#o=!1;constructor(e,t,n={}){this.type=e,e&&(this.#n=!0),this.#c=t,this.#e=this.#c?this.#c.#e:this,this.#s=this.#e===this?n:this.#e.#s,this.#i=this.#e===this?[]:this.#e.#i,e==="!"&&!this.#e.#u&&this.#i.push(this),this.#_=this.#c?this.#c.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let e of this.#t)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#t.map(e=>String(e)).join("|")+")":this.#l=this.#t.map(e=>String(e)).join("")}#h(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#i.pop();){if(e.type!=="!")continue;let t=e,n=t.#c;for(;n;){for(let i=t.#_+1;!n.type&&i<n.#t.length;i++)for(let s of e.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}t=n,n=t.#c}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Jn&&t.#c===this))throw new Error("invalid part: "+t);this.#t.push(t)}}toJSON(){let e=this.type===null?this.#t.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#t.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#c?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#c?.isStart())return!1;if(this.#_===0)return!0;let e=this.#c;for(let t=0;t<this.#_;t++){let n=e.#t[t];if(!(n instanceof Jn&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#c?.type==="!")return!0;if(!this.#c?.isEnd())return!1;if(!this.type)return this.#c?.isEnd();let e=this.#c?this.#c.#t.length:0;return this.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Jn(this.type,e);for(let n of this.#t)t.copyIn(n);return t}static#g(e,t,n,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let y=n,S="";for(;y<e.length;){let w=e.charAt(y++);if(c||w==="\\"){c=!c,S+=w;continue}if(l){y===u+1?(w==="^"||w==="!")&&(f=!0):w==="]"&&!(y===u+2&&f)&&(l=!1),S+=w;continue}else if(w==="["){l=!0,u=y,f=!1,S+=w;continue}if(!i.noext&&PI(w)&&e.charAt(y)==="("&&s<=o){t.push(S),S="";let O=new Jn(w,t);y=Jn.#g(e,O,y,i,s+1),t.push(O);continue}S+=w}return t.push(S),y}let d=n+1,p=new Jn(null,t),h=[],_="";for(;d<e.length;){let y=e.charAt(d++);if(c||y==="\\"){c=!c,_+=y;continue}if(l){d===u+1?(y==="^"||y==="!")&&(f=!0):y==="]"&&!(d===u+2&&f)&&(l=!1),_+=y;continue}else if(y==="["){l=!0,u=d,f=!1,_+=y;continue}if(PI(y)&&e.charAt(d)==="("&&(s<=o||t&&t.#y(y))){let w=t&&t.#y(y)?0:1;p.push(_),_="";let T=new Jn(y,p);p.push(T),d=Jn.#g(e,T,d,i,s+w);continue}if(y==="|"){p.push(_),_="",h.push(p),p=new Jn(null,t);continue}if(y===")")return _===""&&t.#t.length===0&&(t.#o=!0),p.push(_),_="",t.push(...h,p),d;_+=y}return t.type=null,t.#n=void 0,t.#t=[e.substring(n-1)],d}#d(e){return this.#m(e,coe)}#m(e,t=aoe){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null)return!1;let n=e.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#y(n.type,t)}#y(e,t=loe){return!!t.get(this.type)?.includes(e)}#f(e,t){let n=e.#t[0],i=new Jn(null,n,this.options);i.#t.push(""),n.push(i),this.#v(e,t)}#v(e,t){let n=e.#t[0];this.#t.splice(t,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#c=this);this.#l=void 0}#T(e){return!!H4.get(this.type)?.has(e)}#b(e){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let t=e.#t[0];return!t||typeof t!="object"||t.type===null?!1:this.#T(t.type)}#E(e){let t=H4.get(this.type),n=e.#t[0],i=t?.get(n.type);if(!i)return!1;this.#t=n.#t;for(let s of this.#t)typeof s=="object"&&(s.#c=this);this.type=i,this.#l=void 0,this.#o=!1}#S(){if(W4(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#t.length;n++){let i=this.#t[n];typeof i=="object"&&(i.#S(),this.#m(i)?(t=!1,this.#v(i,n)):this.#d(i)?(t=!1,this.#f(i,n)):this.#b(i)&&(t=!1,this.#E(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#S();this.#l=void 0}static fromGlob(e,t={}){let n=new Jn(null,void 0,t);return Jn.#g(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let c=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#s}toRegExpSource(e){let t=e??!!this.#s.dot;if(this.#e===this&&(this.#S(),this.#h()),!W4(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(h=>{let[_,y,S,w]=typeof h=="string"?Jn.#I(h,this.#n,l):h.toRegExpSource(e);return this.#n=this.#n||S,this.#r=this.#r||w,_}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&doe.has(this.#t[0]))){let _=foe,y=t&&_.has(u.charAt(0))||u.startsWith("\\.")&&_.has(u.charAt(2))||u.startsWith("\\.\\.")&&_.has(u.charAt(4)),S=!t&&!e&&_.has(u.charAt(0));f=y?uoe:S?r_:""}let d="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,us(u),this.#n=!!this.#n,this.#r]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#w(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,us(this.toString()),!1,!1]}let o=!n||e||t||!r_?"":this.#w(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?r_:"")+K4;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?r_:"")+z4+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,us(s),this.#n=!!this.#n,this.#r]}#w(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#r=this.#r||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#I(e,t,n=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(poe.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=G4(e,l);if(p){s+=f,o=o||d,l+=p-1,t=t||h,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=n&&/^[*]+$/.test(e)?K4:z4,t=!0;continue}else c=!1;if(u==="?"){s+=DI,t=!0;continue}s+=hoe(u)}return[s,us(e),!!t,o]}};Jn=Zc;var Yu=a((r,{windowsPathsNoEscape:e=!1}={})=>e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Nn=a((r,e,t={})=>(Fp(e),!t.nocomment&&e.charAt(0)==="#"?!1:new ci(e,t).match(r)),"minimatch"),moe=/^\*+([^+@!?\*\[\(]*)$/,goe=a(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),yoe=a(r=>e=>e.endsWith(r),"starDotExtTestDot"),_oe=a(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),boe=a(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),Soe=/^\*+\.\*+$/,woe=a(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),Eoe=a(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),voe=/^\.\*+$/,Toe=a(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),Aoe=/^\*+$/,Ioe=a(r=>r.length!==0&&!r.startsWith("."),"starTest"),xoe=a(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),Roe=/^\?+([^+@!?\*\[\(]*)?$/,Coe=a(([r,e=""])=>{let t=J4([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Ooe=a(([r,e=""])=>{let t=Z4([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Poe=a(([r,e=""])=>{let t=Z4([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTestDot"),Doe=a(([r,e=""])=>{let t=J4([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTest"),J4=a(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),Z4=a(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),e9=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Y4={win32:{sep:"\\"},posix:{sep:"/"}},Foe=e9==="win32"?Y4.win32.sep:Y4.posix.sep;Nn.sep=Foe;var ir=Symbol("globstar **");Nn.GLOBSTAR=ir;var Loe="[^/]",Noe=Loe+"*?",koe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Moe="(?:(?!(?:\\/|^)\\.).)*?",joe=a((r,e={})=>t=>Nn(t,r,e),"filter");Nn.filter=joe;var wi=a((r,e={})=>Object.assign({},r,e),"ext"),$oe=a(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Nn;let e=Nn;return Object.assign(a((n,i,s={})=>e(n,i,wi(r,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,wi(r,s))}static defaults(i){return e.defaults(wi(r,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,wi(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,wi(r,s))}},unescape:a((n,i={})=>e.unescape(n,wi(r,i)),"unescape"),escape:a((n,i={})=>e.escape(n,wi(r,i)),"escape"),filter:a((n,i={})=>e.filter(n,wi(r,i)),"filter"),defaults:a(n=>e.defaults(wi(r,n)),"defaults"),makeRe:a((n,i={})=>e.makeRe(n,wi(r,i)),"makeRe"),braceExpand:a((n,i={})=>e.braceExpand(n,wi(r,i)),"braceExpand"),match:a((n,i,s={})=>e.match(n,i,wi(r,s)),"match"),sep:e.sep,GLOBSTAR:ir})},"defaults");Nn.defaults=$oe;var t9=a((r,e={})=>(Fp(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:(0,X4.default)(r)),"braceExpand");Nn.braceExpand=t9;var Uoe=a((r,e={})=>new ci(r,e).makeRe(),"makeRe");Nn.makeRe=Uoe;var Boe=a((r,e,t={})=>{let n=new ci(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r},"match");Nn.match=Boe;var Q4=/[?*]|[+@!]\(.*?\)|\[|\]/,Voe=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),ci=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){Fp(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||e9,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!Q4.test(s[2]))&&!Q4.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let n=0;n<e.length;n++)for(let i=0;i<e[n].length;i++)e[n][i]==="**"&&(e[n][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let c=n[i+1],l=n[i+2],u=n[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let c=n[o];o===1&&c===""&&n[0]===""||(c==="."||c==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...l),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!1){let i=0,s=0,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,p=f?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[h,_]=[e[d],t[p]];h.toLowerCase()===_.toLowerCase()&&(t[p]=h,s=p,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(ir)?this.#e(e,t,n,i,s):this.#r(e,t,n,i,s)}#e(e,t,n,i,s){let o=t.indexOf(ir,s),c=t.lastIndexOf(ir),[l,u,f]=n?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let T=e.slice(i,i+l.length);if(!this.#r(T,l,n,0,0))return!1;i+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let T=e.length-f.length;if(this.#r(e,f,n,T,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(T--,!this.#r(e,f,n,T,0)))return!1;d=f.length+1}}if(!u.length){let T=!!d;for(let O=i;O<e.length-d;O++){let A=String(e[O]);if(T=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return n||T}let p=[[[],0]],h=p[0],_=0,y=[0];for(let T of u)T===ir?(y.push(_),h=[[],0],p.push(h)):(h[0].push(T),_++);let S=p.length-1,w=e.length-d;for(let T of p)T[1]=w-(y[S--]+T[0].length);return!!this.#n(e,p,i,0,n,0,!!d)}#n(e,t,n,i,s,o,c){let l=t[i];if(!l){for(let d=n;d<e.length;d++){c=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[u,f]=l;for(;n<=f;){if(this.#r(e.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#n(e,t,n+u.length,i+1,s,o+1,c);if(h!==!1)return h}let p=e[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#r(e,t,n,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===ir)return!1;let p;if(typeof f=="string"?(p=d===f,this.debug("string match",f,d,p)):(p=f.test(d),this.debug("pattern match",f,d,p)),!p)return!1}if(o===u&&c===l)return!0;if(o===u)return n;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return t9(this.pattern,this.options)}parse(e){Fp(e);let t=this.options;if(e==="**")return ir;if(e==="")return"";let n,i=null;(n=e.match(Aoe))?i=t.dot?xoe:Ioe:(n=e.match(moe))?i=(t.nocase?t.dot?boe:_oe:t.dot?yoe:goe)(n[1]):(n=e.match(Roe))?i=(t.nocase?t.dot?Ooe:Coe:t.dot?Poe:Doe)(n):(n=e.match(Soe))?i=t.dot?Eoe:woe:(n=e.match(voe))&&(i=Toe);let s=Zc.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?Noe:t.dot?koe:Moe,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?Voe(f):f===ir?ir:f._src});return u.forEach((f,d)=>{let p=u[d+1],h=u[d-1];f!==ir||h===ir||(h===void 0?p!==void 0&&p!==ir?u[d+1]="(?:\\/|"+n+"\\/)?"+p:u[d]=n:p===void 0?u[d-1]=h+"(?:\\/|"+n+")?":p!==ir&&(u[d-1]=h+"(?:\\/|\\/"+n+"\\/)"+p,u[d+1]=ir))}),u.filter(f=>f!==ir).join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let n=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(n.matchBase&&l.length===1&&(u=[o]),this.matchOne(u,l,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return Nn.defaults(e).Minimatch}};Nn.AST=Zc;Nn.Minimatch=ci;Nn.escape=Yu;Nn.unescape=us;var A9=require("node:url");var Qu=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,n9=new Set,FI=typeof process=="object"&&process?process:{},i9=a((r,e,t,n)=>{typeof FI.emitWarning=="function"?FI.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},"emitWarning"),n_=globalThis.AbortController,r9=globalThis.AbortSignal;if(typeof n_>"u"){r9=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i)}},n_=class{static{a(this,"AbortController")}constructor(){e()}signal=new r9;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n)}}};let r=FI.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{r&&(r=!1,i9("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var qoe=a(r=>!n9.has(r),"shouldWarn");var Ka=a(r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),"isPosInt"),s9=a(r=>Ka(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Xu:null:null,"getUintArray"),Xu=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},LI=class r{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let t=s9(e);if(!t)return[];r.#e=!0;let n=new r(e,t);return r.#e=!1,n}constructor(e,t){if(!r.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Np=class r{static{a(this,"LRUCache")}#e;#n;#r;#t;#c;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#o;#h;#g;#d;#m;#y;#f;#v;#T;#b;#E;#S;#w;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#b,sizes:e.#v,keyMap:e.#s,keyList:e.#l,valList:e.#o,next:e.#h,prev:e.#g,get head(){return e.#d},get tail(){return e.#m},free:e.#y,isBackgroundFetch:a(t=>e.#p(t),"isBackgroundFetch"),backgroundFetch:a((t,n,i,s)=>e.#j(t,n,i,s),"backgroundFetch"),moveToTail:a(t=>e.#U(t),"moveToTail"),indexes:a(t=>e.#R(t),"indexes"),rindexes:a(t=>e.#C(t),"rindexes"),isStale:a(t=>e.#A(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#u}get size(){return this.#i}get fetchMethod(){return this.#c}get memoMethod(){return this.#_}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:h=0,maxEntrySize:_=0,sizeCalculation:y,fetchMethod:S,memoMethod:w,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:O,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:x,ignoreFetchAbort:P}=e;if(t!==0&&!Ka(t))throw new TypeError("max option must be a nonnegative integer");let V=t?s9(t):Array;if(!V)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=h,this.maxEntrySize=_||this.#n,this.sizeCalculation=y,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=w,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=S,this.#S=!!S,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#h=new V(t),this.#g=new V(t),this.#d=0,this.#m=0,this.#y=LI.create(t),this.#i=0,this.#u=0,typeof u=="function"&&(this.#r=u),typeof f=="function"?(this.#t=f,this.#f=[]):(this.#t=void 0,this.#f=void 0),this.#E=!!this.#r,this.#w=!!this.#t,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!x,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#n!==0&&!Ka(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!Ka(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!O,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Ka(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Ka(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let j="LRU_CACHE_UNBOUNDED";qoe(j)&&(n9.add(j),i9("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",j,r))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#I(){let e=new Xu(this.#e),t=new Xu(this.#e);this.#b=e,this.#T=t,this.#D=(s,o,c=Qu.now())=>{if(t[s]=o!==0?c:0,e[s]=o,o!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#A(s)&&this.#P(this.#l[s],"expire")},o+1);l.unref&&l.unref()}},this.#x=s=>{t[s]=e[s]!==0?Qu.now():0},this.#a=(s,o)=>{if(e[o]){let c=e[o],l=t[o];if(!c||!l)return;s.ttl=c,s.start=l,s.now=n||i();let u=s.now-l;s.remainingTTL=c-u}};let n=0,i=a(()=>{let s=Qu.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return s},"getNow");this.getRemainingTTL=s=>{let o=this.#s.get(s);if(o===void 0)return 0;let c=e[o],l=t[o];if(!c||!l)return 1/0;let u=(n||i())-l;return c-u},this.#A=s=>{let o=t[s],c=e[s];return!!c&&!!o&&(n||i())-o>c}}#x=a(()=>{},"#updateItemAge");#a=a(()=>{},"#statusTTL");#D=a(()=>{},"#setItemTTL");#A=a(()=>!1,"#isStale");#O(){let e=new Xu(this.#e);this.#u=0,this.#v=e,this.#F=t=>{this.#u-=e[t],e[t]=0},this.#N=(t,n,i,s)=>{if(this.#p(n))return 0;if(!Ka(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!Ka(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#L=(t,n,i)=>{if(e[t]=n,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#M(!0)}this.#u+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#u)}}#F=a(e=>{},"#removeItemSize");#L=a((e,t,n)=>{},"#addItemSize");#N=a((e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#R({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#d));)t=this.#g[t]}*#C({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#d;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#m));)t=this.#h[t]}#k(e){return e!==void 0&&this.#s.get(this.#l[e])===e}*entries(){for(let e of this.#R())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#p(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*rentries(){for(let e of this.#C())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#p(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*keys(){for(let e of this.#R()){let t=this.#l[e];t!==void 0&&!this.#p(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#C()){let t=this.#l[e];t!==void 0&&!this.#p(this.#o[e])&&(yield t)}}*values(){for(let e of this.#R())this.#o[e]!==void 0&&!this.#p(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#C())this.#o[e]!==void 0&&!this.#p(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let n of this.#R()){let i=this.#o[n],s=this.#p(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[n],this))return this.get(this.#l[n],t)}}forEach(e,t=this){for(let n of this.#R()){let i=this.#o[n],s=this.#p(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[n],this)}}rforEach(e,t=this){for(let n of this.#C()){let i=this.#o[n],s=this.#p(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[n],this)}}purgeStale(){let e=!1;for(let t of this.#C({allowStale:!0}))this.#A(t)&&(this.#P(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let n=this.#o[t],i=this.#p(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#b&&this.#T){let o=this.#b[t],c=this.#T[t];if(o&&c){let l=o-(Qu.now()-c);s.ttl=l,s.start=Date.now()}}return this.#v&&(s.size=this.#v[t]),s}dump(){let e=[];for(let t of this.#R({allowStale:!0})){let n=this.#l[t],i=this.#o[t],s=this.#p(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#b&&this.#T){o.ttl=this.#b[t];let c=Qu.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#v&&(o.size=this.#v[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=Qu.now()-i}this.set(t,n.value,n)}}set(e,t,n={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=n,{noUpdateTTL:u=this.noUpdateTTL}=n,f=this.#N(e,t,n.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#P(e,"set"),this;let d=this.#i===0?void 0:this.#s.get(e);if(d===void 0)d=this.#i===0?this.#m:this.#y.length!==0?this.#y.pop():this.#i===this.#e?this.#M(!1):this.#i,this.#l[d]=e,this.#o[d]=t,this.#s.set(e,d),this.#h[this.#m]=d,this.#g[d]=this.#m,this.#m=d,this.#i++,this.#L(d,f,l),l&&(l.set="add"),u=!1;else{this.#U(d);let p=this.#o[d];if(t!==p){if(this.#S&&this.#p(p)){p.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:h}=p;h!==void 0&&!o&&(this.#E&&this.#r?.(h,e,"set"),this.#w&&this.#f?.push([h,e,"set"]))}else o||(this.#E&&this.#r?.(p,e,"set"),this.#w&&this.#f?.push([p,e,"set"]));if(this.#F(d),this.#L(d,f,l),this.#o[d]=t,l){l.set="replace";let h=p&&this.#p(p)?p.__staleWhileFetching:p;h!==void 0&&(l.oldValue=h)}}else l&&(l.set="update")}if(i!==0&&!this.#b&&this.#I(),this.#b&&(u||this.#D(d,i,s),l&&this.#a(l,d)),!o&&this.#w&&this.#f){let p=this.#f,h;for(;h=p?.shift();)this.#t?.(...h)}return this}pop(){try{for(;this.#i;){let e=this.#o[this.#d];if(this.#M(!0),this.#p(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#w&&this.#f){let e=this.#f,t;for(;t=e?.shift();)this.#t?.(...t)}}}#M(e){let t=this.#d,n=this.#l[t],i=this.#o[t];return this.#S&&this.#p(i)?i.__abortController.abort(new Error("evicted")):(this.#E||this.#w)&&(this.#E&&this.#r?.(i,n,"evict"),this.#w&&this.#f?.push([i,n,"evict"])),this.#F(t),e&&(this.#l[t]=void 0,this.#o[t]=void 0,this.#y.push(t)),this.#i===1?(this.#d=this.#m=0,this.#y.length=0):this.#d=this.#h[t],this.#s.delete(n),this.#i--,t}has(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#s.get(e);if(s!==void 0){let o=this.#o[s];if(this.#p(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#a(i,s));else return n&&this.#x(s),i&&(i.has="hit",this.#a(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:n=this.allowStale}=t,i=this.#s.get(e);if(i===void 0||!n&&this.#A(i))return;let s=this.#o[i];return this.#p(s)?s.__staleWhileFetching:s}#j(e,t,n,i){let s=t===void 0?void 0:this.#o[t];if(this.#p(s))return s;let o=new n_,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=a((y,S=!1)=>{let{aborted:w}=o.signal,T=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(w&&!S?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,T&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),w&&!T&&!S)return d(o.signal.reason);let O=h;return this.#o[t]===h&&(y===void 0?O.__staleWhileFetching?this.#o[t]=O.__staleWhileFetching:this.#P(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,l.options))),y},"cb"),f=a(y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),d(y)),"eb"),d=a(y=>{let{aborted:S}=o.signal,w=S&&n.allowStaleOnFetchAbort,T=w||n.allowStaleOnFetchRejection,O=T||n.noDeleteOnFetchRejection,A=h;if(this.#o[t]===h&&(!O||A.__staleWhileFetching===void 0?this.#P(e,"fetch"):w||(this.#o[t]=A.__staleWhileFetching)),T)return n.status&&A.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),A.__staleWhileFetching;if(A.__returned===A)throw y},"fetchFail"),p=a((y,S)=>{let w=this.#c?.(e,s,l);w&&w instanceof Promise&&w.then(T=>y(T===void 0?void 0:T),S),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=a(T=>u(T,!0),"res")))})},"pcall");n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(u,f),_=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,_,{...l.options,status:void 0}),t=this.#s.get(e)):this.#o[t]=_,_}#p(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof n_}async fetch(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:_=this.allowStaleOnFetchAbort,context:y,forceRefresh:S=!1,status:w,signal:T}=t;if(!this.#S)return w&&(w.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let O={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:h,status:w,signal:T},A=this.#s.get(e);if(A===void 0){w&&(w.fetch="miss");let x=this.#j(e,A,O,y);return x.__returned=x}else{let x=this.#o[A];if(this.#p(x)){let K=n&&x.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",K&&(w.returnedStale=!0)),K?x.__staleWhileFetching:x.__returned=x}let P=this.#A(A);if(!S&&!P)return w&&(w.fetch="hit"),this.#U(A),i&&this.#x(A),w&&this.#a(w,A),x;let V=this.#j(e,A,O,y),$=V.__staleWhileFetching!==void 0&&n;return w&&(w.fetch=P?"stale":"refresh",$&&P&&(w.returnedStale=!0)),$?V.__staleWhileFetching:V.__returned=V}}async forceFetch(e,t={}){let n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let n=this.#_;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=t,c=this.get(e,o);if(!s&&c!==void 0)return c;let l=n(e,c,{options:o,context:i});return this.set(e,l,o),l}get(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#o[c],u=this.#p(l);return o&&this.#a(o,c),this.#A(c)?(o&&(o.get="stale"),u?(o&&n&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?l.__staleWhileFetching:void 0):(s||this.#P(e,"expire"),o&&n&&(o.returnedStale=!0),n?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(this.#U(c),i&&this.#x(c),l))}else o&&(o.get="miss")}#$(e,t){this.#g[t]=e,this.#h[e]=t}#U(e){e!==this.#m&&(e===this.#d?this.#d=this.#h[e]:this.#$(this.#g[e],this.#h[e]),this.#$(this.#m,e),this.#m=e)}delete(e){return this.#P(e,"delete")}#P(e,t){let n=!1;if(this.#i!==0){let i=this.#s.get(e);if(i!==void 0)if(n=!0,this.#i===1)this.#B(t);else{this.#F(i);let s=this.#o[i];if(this.#p(s)?s.__abortController.abort(new Error("deleted")):(this.#E||this.#w)&&(this.#E&&this.#r?.(s,e,t),this.#w&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#o[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#d)this.#d=this.#h[i];else{let o=this.#g[i];this.#h[o]=this.#h[i];let c=this.#h[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#w&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return n}clear(){return this.#B("delete")}#B(e){for(let t of this.#C({allowStale:!0})){let n=this.#o[t];if(this.#p(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#E&&this.#r?.(n,i,e),this.#w&&this.#f?.push([n,i,e])}}if(this.#s.clear(),this.#o.fill(void 0),this.#l.fill(void 0),this.#b&&this.#T&&(this.#b.fill(0),this.#T.fill(0)),this.#v&&this.#v.fill(0),this.#d=0,this.#m=0,this.#y.length=0,this.#u=0,this.#i=0,this.#w&&this.#f){let t=this.#f,n;for(;n=t?.shift();)this.#t?.(...n)}}};var ef=require("node:path"),m9=require("node:url"),Xs=require("fs"),Zoe=Se(require("node:fs"),1),Xa=require("node:fs/promises");var u_=require("node:events"),BI=Se(require("node:stream"),1),u9=require("node:string_decoder");var o9=typeof process=="object"&&process?process:{stdout:null,stderr:null},Goe=a(r=>!!r&&typeof r=="object"&&(r instanceof Qa||r instanceof BI.default||Woe(r)||Hoe(r)),"isStream"),Woe=a(r=>!!r&&typeof r=="object"&&r instanceof u_.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==BI.default.Writable.prototype.pipe,"isReadable"),Hoe=a(r=>!!r&&typeof r=="object"&&r instanceof u_.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable"),Xo=Symbol("EOF"),Jo=Symbol("maybeEmitEnd"),Ya=Symbol("emittedEnd"),i_=Symbol("emittingEnd"),kp=Symbol("emittedError"),s_=Symbol("closed"),a9=Symbol("read"),o_=Symbol("flush"),c9=Symbol("flushChunk"),fs=Symbol("encoding"),Ju=Symbol("decoder"),$r=Symbol("flowing"),Mp=Symbol("paused"),Zu=Symbol("resume"),Ur=Symbol("buffer"),kn=Symbol("pipes"),Br=Symbol("bufferLength"),NI=Symbol("bufferPush"),a_=Symbol("bufferShift"),gn=Symbol("objectMode"),sr=Symbol("destroyed"),kI=Symbol("error"),MI=Symbol("emitData"),l9=Symbol("emitEnd"),jI=Symbol("emitEnd2"),Ys=Symbol("async"),$I=Symbol("abort"),c_=Symbol("aborted"),jp=Symbol("signal"),el=Symbol("dataListeners"),li=Symbol("discarded"),$p=a(r=>Promise.resolve().then(r),"defer"),zoe=a(r=>r(),"nodefer"),Koe=a(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),Yoe=a(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),Qoe=a(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),l_=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Zu](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},UI=class extends l_{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},Xoe=a(r=>!!r.objectMode,"isObjectModeOptions"),Joe=a(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),Qa=class extends u_.EventEmitter{static{a(this,"Minipass")}[$r]=!1;[Mp]=!1;[kn]=[];[Ur]=[];[gn];[fs];[Ys];[Ju];[Xo]=!1;[Ya]=!1;[i_]=!1;[s_]=!1;[kp]=null;[Br]=0;[sr]=!1;[jp];[c_]=!1;[el]=0;[li]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Xoe(t)?(this[gn]=!0,this[fs]=null):Joe(t)?(this[fs]=t.encoding,this[gn]=!1):(this[gn]=!1,this[fs]=null),this[Ys]=!!t.async,this[Ju]=this[fs]?new u9.StringDecoder(this[fs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[Ur],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[kn],"get")});let{signal:n}=t;n&&(this[jp]=n,n.aborted?this[$I]():n.addEventListener("abort",()=>this[$I]()))}get bufferLength(){return this[Br]}get encoding(){return this[fs]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[gn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Ys]}set async(e){this[Ys]=this[Ys]||!!e}[$I](){this[c_]=!0,this.emit("abort",this[jp]?.reason),this.destroy(this[jp]?.reason)}get aborted(){return this[c_]}set aborted(e){}write(e,t,n){if(this[c_])return!1;if(this[Xo])throw new Error("write after end");if(this[sr])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let i=this[Ys]?$p:zoe;if(!this[gn]&&!Buffer.isBuffer(e)){if(Qoe(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Yoe(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[gn]?(this[$r]&&this[Br]!==0&&this[o_](!0),this[$r]?this.emit("data",e):this[NI](e),this[Br]!==0&&this.emit("readable"),n&&i(n),this[$r]):e.length?(typeof e=="string"&&!(t===this[fs]&&!this[Ju]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[fs]&&(e=this[Ju].write(e)),this[$r]&&this[Br]!==0&&this[o_](!0),this[$r]?this.emit("data",e):this[NI](e),this[Br]!==0&&this.emit("readable"),n&&i(n),this[$r]):(this[Br]!==0&&this.emit("readable"),n&&i(n),this[$r])}read(e){if(this[sr])return null;if(this[li]=!1,this[Br]===0||e===0||e&&e>this[Br])return this[Jo](),null;this[gn]&&(e=null),this[Ur].length>1&&!this[gn]&&(this[Ur]=[this[fs]?this[Ur].join(""):Buffer.concat(this[Ur],this[Br])]);let t=this[a9](e||null,this[Ur][0]);return this[Jo](),t}[a9](e,t){if(this[gn])this[a_]();else{let n=t;e===n.length||e===null?this[a_]():typeof n=="string"?(this[Ur][0]=n.slice(e),t=n.slice(0,e),this[Br]-=e):(this[Ur][0]=n.subarray(e),t=n.subarray(0,e),this[Br]-=e)}return this.emit("data",t),!this[Ur].length&&!this[Xo]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Xo]=!0,this.writable=!1,(this[$r]||!this[Mp])&&this[Jo](),this}[Zu](){this[sr]||(!this[el]&&!this[kn].length&&(this[li]=!0),this[Mp]=!1,this[$r]=!0,this.emit("resume"),this[Ur].length?this[o_]():this[Xo]?this[Jo]():this.emit("drain"))}resume(){return this[Zu]()}pause(){this[$r]=!1,this[Mp]=!0,this[li]=!1}get destroyed(){return this[sr]}get flowing(){return this[$r]}get paused(){return this[Mp]}[NI](e){this[gn]?this[Br]+=1:this[Br]+=e.length,this[Ur].push(e)}[a_](){return this[gn]?this[Br]-=1:this[Br]-=this[Ur][0].length,this[Ur].shift()}[o_](e=!1){do;while(this[c9](this[a_]())&&this[Ur].length);!e&&!this[Ur].length&&!this[Xo]&&this.emit("drain")}[c9](e){return this.emit("data",e),this[$r]}pipe(e,t){if(this[sr])return e;this[li]=!1;let n=this[Ya];return t=t||{},e===o9.stdout||e===o9.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[kn].push(t.proxyErrors?new UI(this,e,t):new l_(this,e,t)),this[Ys]?$p(()=>this[Zu]()):this[Zu]()),e}unpipe(e){let t=this[kn].find(n=>n.dest===e);t&&(this[kn].length===1?(this[$r]&&this[el]===0&&(this[$r]=!1),this[kn]=[]):this[kn].splice(this[kn].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[li]=!1,this[el]++,!this[kn].length&&!this[$r]&&this[Zu]();else if(e==="readable"&&this[Br]!==0)super.emit("readable");else if(Koe(e)&&this[Ya])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[kp]){let i=t;this[Ys]?$p(()=>i.call(this,this[kp])):i.call(this,this[kp])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[el]=this.listeners("data").length,this[el]===0&&!this[li]&&!this[kn].length&&(this[$r]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[el]=0,!this[li]&&!this[kn].length&&(this[$r]=!1)),t}get emittedEnd(){return this[Ya]}[Jo](){!this[i_]&&!this[Ya]&&!this[sr]&&this[Ur].length===0&&this[Xo]&&(this[i_]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[s_]&&this.emit("close"),this[i_]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==sr&&this[sr])return!1;if(e==="data")return!this[gn]&&!n?!1:this[Ys]?($p(()=>this[MI](n)),!0):this[MI](n);if(e==="end")return this[l9]();if(e==="close"){if(this[s_]=!0,!this[Ya]&&!this[sr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[kp]=n,super.emit(kI,n);let s=!this[jp]||this.listeners("error").length?super.emit("error",n):!1;return this[Jo](),s}else if(e==="resume"){let s=super.emit("resume");return this[Jo](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[Jo](),i}[MI](e){for(let n of this[kn])n.dest.write(e)===!1&&this.pause();let t=this[li]?!1:super.emit("data",e);return this[Jo](),t}[l9](){return this[Ya]?!1:(this[Ya]=!0,this.readable=!1,this[Ys]?($p(()=>this[jI]()),!0):this[jI]())}[jI](){if(this[Ju]){let t=this[Ju].end();if(t){for(let n of this[kn])n.dest.write(t);this[li]||super.emit("data",t)}}for(let t of this[kn])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[gn]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[gn]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[gn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[fs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(sr,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[li]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[Xo])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(sr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(sr,f),this.pause(),s({value:d,done:!!this[Xo]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(sr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(sr,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[li]=!1;let e=!1,t=a(()=>(this.pause(),this.off(kI,t),this.off(sr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),n=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(kI,t),this.once(sr,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[sr])return e?this.emit("error",e):this.emit(sr),this;this[sr]=!0,this[li]=!0,this[Ur].length=0,this[Br]=0;let t=this;return typeof t.close=="function"&&!this[s_]&&t.close(),e?this.emit("error",e):this.emit(sr),this}static get isStream(){return Goe}};var eae=Xs.realpathSync.native,Bp={lstatSync:Xs.lstatSync,readdir:Xs.readdir,readdirSync:Xs.readdirSync,readlinkSync:Xs.readlinkSync,realpathSync:eae,promises:{lstat:Xa.lstat,readdir:Xa.readdir,readlink:Xa.readlink,realpath:Xa.realpath}},g9=a(r=>!r||r===Bp||r===Zoe?Bp:{...Bp,...r,promises:{...Bp.promises,...r.promises||{}}},"fsFromOption"),y9=/^\\\\\?\\([a-z]:)\\?$/i,tae=a(r=>r.replace(/\//g,"\\").replace(y9,"$1\\"),"uncToDrive"),rae=/[\\\/]/,vi=0,_9=1,b9=2,Qs=4,S9=6,w9=8,tl=10,E9=12,Ei=15,Up=~Ei,VI=16,f9=32,Vp=64,ds=128,f_=256,p_=512,d9=Vp|ds|p_,nae=1023,qI=a(r=>r.isFile()?w9:r.isDirectory()?Qs:r.isSymbolicLink()?tl:r.isCharacterDevice()?b9:r.isBlockDevice()?S9:r.isSocket()?E9:r.isFIFO()?_9:vi,"entToType"),p9=new Map,qp=a(r=>{let e=p9.get(r);if(e)return e;let t=r.normalize("NFKD");return p9.set(r,t),t},"normalize"),h9=new Map,d_=a(r=>{let e=h9.get(r);if(e)return e;let t=qp(r.toLowerCase());return h9.set(r,t),t},"normalizeNocase"),h_=class extends Np{static{a(this,"ResolveCache")}constructor(){super({max:256})}},GI=class extends Np{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},v9=Symbol("PathScurry setAsCwd"),yn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#t;get nlink(){return this.#t}#c;get uid(){return this.#c}#_;get gid(){return this.#_}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#o;get blocks(){return this.#o}#h;get atimeMs(){return this.#h}#g;get mtimeMs(){return this.#g}#d;get ctimeMs(){return this.#d}#m;get birthtimeMs(){return this.#m}#y;get atime(){return this.#y}#f;get mtime(){return this.#f}#v;get ctime(){return this.#v}#T;get birthtime(){return this.#T}#b;#E;#S;#w;#I;#x;#a;#D;#A;#O;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=vi,n,i,s,o,c){this.name=e,this.#b=s?d_(e):qp(e),this.#a=t&nae,this.nocase=s,this.roots=i,this.root=n||this,this.#D=o,this.#S=c.fullpath,this.#I=c.relative,this.#x=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=g9(c.fs)}depth(){return this.#E!==void 0?this.#E:this.parent?this.#E=this.parent.depth()+1:this.#E=0}childrenCache(){return this.#D}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#F(i):this.#F(i)}#F(e){let t=this;for(let n of e)t=t.child(n);return t}children(){let e=this.#D.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#D.set(this,t),this.#a&=~VI,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?d_(e):qp(e);for(let l of n)if(l.#b===i)return l;let s=this.parent?this.sep:"",o=this.#S?this.#S+s+e:void 0,c=this.newChild(e,vi,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#a|=ds),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#I!==void 0)return this.#I;let e=this.name,t=this.parent;if(!t)return this.#I=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#S=i}fullpathPosix(){if(this.#w!==void 0)return this.#w;if(this.sep==="/")return this.#w=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#w=`//?/${i}`:this.#w=i}let e=this.parent,t=e.fullpathPosix(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#w=n}isUnknown(){return(this.#a&Ei)===vi}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#a&Ei)===w9}isDirectory(){return(this.#a&Ei)===Qs}isCharacterDevice(){return(this.#a&Ei)===b9}isBlockDevice(){return(this.#a&Ei)===S9}isFIFO(){return(this.#a&Ei)===_9}isSocket(){return(this.#a&Ei)===E9}isSymbolicLink(){return(this.#a&tl)===tl}lstatCached(){return this.#a&f9?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#O}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#A)return!0;if(!this.parent)return!1;let e=this.#a&Ei;return!(e!==vi&&e!==tl||this.#a&f_||this.#a&ds)}calledReaddir(){return!!(this.#a&VI)}isENOENT(){return!!(this.#a&ds)}isNamed(e){return this.nocase?this.#b===d_(e):this.#b===qp(e)}async readlink(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#A=n}catch(t){this.#p(t.code);return}}readlinkSync(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#A=n}catch(t){this.#p(t.code);return}}#L(e){this.#a|=VI;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#N()}}#N(){this.#a&ds||(this.#a=(this.#a|ds)&Up,this.#R())}#R(){let e=this.children();e.provisional=0;for(let t of e)t.#N()}#C(){this.#a|=p_,this.#k()}#k(){if(this.#a&Vp)return;let e=this.#a;(e&Ei)===Qs&&(e&=Up),this.#a=e|Vp,this.#R()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#N():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#N()}#p(e=""){let t=this.#a;t|=f_,e==="ENOENT"&&(t|=ds),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Up),this.#a=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#$(e,t){return this.#P(e,t)||this.#U(e,t)}#U(e,t){let n=qI(e),i=this.newChild(e.name,n,{parent:this}),s=i.#a&Ei;return s!==Qs&&s!==tl&&s!==vi&&(i.#a|=Vp),t.unshift(i),t.provisional++,i}#P(e,t){for(let n=t.provisional;n<t.length;n++){let i=t[n];if((this.nocase?d_(e.name):qp(e.name))===i.#b)return this.#B(e,i,n,t)}}#B(e,t,n,i){let s=t.name;return t.#a=t.#a&Up|qI(e),s!==e.name&&(t.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#a&ds)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#a&ds)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#W(e){let{atime:t,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:_,mtimeMs:y,nlink:S,rdev:w,size:T,uid:O}=e;this.#y=t,this.#h=n,this.#T=i,this.#m=s,this.#u=o,this.#o=c,this.#v=l,this.#d=u,this.#n=f,this.#_=d,this.#s=p,this.#r=h,this.#f=_,this.#g=y,this.#t=S,this.#i=w,this.#l=T,this.#c=O;let A=qI(e);this.#a=this.#a&Up|A|f9,A!==vi&&A!==Qs&&A!==tl&&(this.#a|=Vp)}#q=[];#G=!1;#H(e){this.#G=!1;let t=this.#q.slice();this.#q.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#q.push(e),this.#G)return;this.#G=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#M(s.code),n.provisional=0;else{for(let c of o)this.#$(c,n);this.#L(n)}this.#H(n.slice(0,n.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#V)await this.#V;else{let n=a(()=>{},"resolve");this.#V=new Promise(i=>n=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#L(e)}catch(i){this.#M(i.code),e.provisional=0}this.#V=void 0,n()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let n of this.#e.readdirSync(t,{withFileTypes:!0}))this.#$(n,e);this.#L(e)}catch(n){this.#M(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#a&d9)return!1;let e=Ei&this.#a;return e===vi||e===Qs||e===tl}shouldWalk(e,t){return(this.#a&Qs)===Qs&&!(this.#a&d9)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#O)return this.#O;if(!((p_|f_|ds)&this.#a))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#O=this.resolve(e)}catch{this.#C()}}realpathSync(){if(this.#O)return this.#O;if(!((p_|f_|ds)&this.#a))try{let e=this.#e.realpathSync(this.fullpath());return this.#O=this.resolve(e)}catch{this.#C()}}[v9](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],i=this;for(;i&&i.parent;)t.add(i),i.#I=n.join(this.sep),i.#x=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#I=void 0,i.#x=void 0,i=i.parent}},m_=class r extends yn{static{a(this,"PathWin32")}sep="\\";splitSep=rae;constructor(e,t=vi,n,i,s,o,c){super(e,t,n,i,s,o,c)}newChild(e,t=vi,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return ef.win32.parse(e).root}getRoot(e){if(e=tae(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new tf(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(y9,"$1\\"),e===t}},g_=class r extends yn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=vi,n,i,s,o,c){super(e,t,n,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=vi,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},y_=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=Bp}={}){this.#t=g9(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,m9.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new h_,this.#n=new h_,this.#r=new GI(s);let l=c.substring(this.rootPath.length).split(n);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,p=this.rootPath,h=!1;for(let _ of l){let y=f--;u=u.child(_,{relative:new Array(y).fill("..").join(d),relativePosix:new Array(y).fill("..").join("/"),fullpath:p+=(h?"":d)+_}),h=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#e.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let n=this.#n.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let i=await e.readdir();return n?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set,u=a((d,p)=>{l.add(d),d.readdirCB((h,_)=>{if(h)return p(h);let y=_.length;if(!y)return p();let S=a(()=>{--y===0&&p()},"next");for(let w of _)(!s||s(w))&&c.push(n?w:w.fullpath()),i&&w.isSymbolicLink()?w.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(l,o)?u(T,S):S()):w.shouldWalk(l,o)?u(w,S):S()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let d of f){(!s||s(d))&&c.push(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(l,o)&&l.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield n?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield n?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Qa({objectMode:!0});(!s||s(e))&&c.write(n?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let _=a((S,w,T=!1)=>{if(S)return c.emit("error",S);if(i&&!T){let O=[];for(let A of w)A.isSymbolicLink()&&O.push(A.realpath().then(x=>x?.isUnknown()?x.lstat():x));if(O.length){Promise.all(O).then(()=>_(null,w,!0));return}}for(let O of w)O&&(!s||s(O))&&(c.write(n?O:O.fullpath())||(p=!0));f--;for(let O of w){let A=O.realpathCached()||O;A.shouldWalk(l,o)&&u.push(A)}p&&!c.flowing?c.once("drain",d):y||d()},"onReaddir"),y=!0;h.readdirCB(_,!0),y=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof yn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Qa({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(n?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let _=h.readdirSync();for(let y of _)(!s||s(y))&&(c.write(n?y:y.fullpath())||(p=!0));f--;for(let y of _){let S=y;if(y.isSymbolicLink()){if(!(i&&(S=y.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(l,o)&&u.push(S)}}p&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[v9](t)}},tf=class extends y_{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,ef.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return ef.win32.parse(e).root.toUpperCase()}newRoot(e){return new m_(this.rootPath,Qs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},rf=class extends y_{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,ef.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new g_(this.rootPath,Qs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Gp=class extends rf{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},q2e=process.platform==="win32"?m_:g_,T9=process.platform==="win32"?tf:process.platform==="darwin"?Gp:rf;var iae=a(r=>r.length>=1,"isPatternList"),sae=a(r=>r.length>=1,"isGlobList"),nf=class r{static{a(this,"Pattern")}#e;#n;#r;length;#t;#c;#_;#i;#u;#s;#l=!0;constructor(e,t,n,i){if(!iae(e))throw new TypeError("empty pattern list");if(!sae(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=n,this.#t=i,this.#r===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#e,[f,d,p,h,..._]=this.#n;u[0]===""&&(u.shift(),_.shift());let y=[s,o,c,l,""].join("/"),S=[f,d,p,h,""].join("/");this.#e=[y,...u],this.#n=[S,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[c,...l]=this.#n;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...o],this.#n=[f,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===ir}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#_=this.#_||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#c!==void 0?this.#c:this.hasMore()?(this.#c=new r(this.#e,this.#n,this.#r+1,this.#t),this.#c.#s=this.#s,this.#c.#u=this.#u,this.#c.#i=this.#i,this.#c):this.#c=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#t==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#i!==void 0?this.#i:this.#i=this.#t==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var oae=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",sf=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:s,platform:o=oae}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new ci(e,this.mmopts);for(let n=0;n<t.set.length;n++){let i=t.set[n],s=t.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new nf(i,s,0,this.platform),c=new ci(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),n=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var WI=class r{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),i=this.store.get(n);i?i.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},HI=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,n){let i=(t?2:0)|(n?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},zI=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===t.globString())||n.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},Wp=class r{static{a(this,"Processor")}hasWalkedCache;matches=new HI;subwalks=new zI;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new WI}processPatterns(e,t){this.patterns=t;let n=t.map(i=>[e,i]);for(let[i,s]of n){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===ir){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(i,c,d===""||d===".");else if(d===".."){let h=i.parent||i;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of n){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===ir?i.testGlobstar(s,o,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,n,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,t,n,i){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,t,n,i){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}};var aae=a((r,e)=>typeof r=="string"?new sf([r],e):Array.isArray(r)?new sf(r,e):r,"makeIgnore"),__=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#r=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#n=aae(n.ignore??[],n),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#c(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#t(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#t(e))return;if(!this.includeChildMatches&&this.#n?.add){let s=`${e.relativePosix()}/**`;this.#n.add(s)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,t)}matchSync(e,t,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new Wp(this.opts),n)}walkCB2(e,t,n,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,o):c.readdirCB((u,f)=>this.walkCB3(c,f,n,o),!0)}o()}walkCB3(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of n.subwalks.entries())s++,this.walkCB2(c,l,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new Wp(this.opts),n)}walkCB2Sync(e,t,n,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,o)}o()}walkCB3Sync(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())s++,this.walkCB2Sync(c,l,n.child(),o);o()}},Hp=class extends __{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,n){super(e,t,n)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},zp=class extends __{static{a(this,"GlobStream")}results;constructor(e,t,n){super(e,t,n),this.results=new Qa({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var cae=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ps=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,A9.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||cae,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?tf:t.platform==="darwin"?Gp:t.platform?rf:T9;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new ci(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new nf(l,f,0,this.platform)})}async walk(){return[...await new Hp(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Hp(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new zp(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new zp(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var KI=a((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new ci(t,e).hasMagic())return!0;return!1},"hasMagic");function b_(r,e={}){return new ps(r,e).streamSync()}a(b_,"globStreamSync");function x9(r,e={}){return new ps(r,e).stream()}a(x9,"globStream");function R9(r,e={}){return new ps(r,e).walkSync()}a(R9,"globSync");async function I9(r,e={}){return new ps(r,e).walk()}a(I9,"glob_");function S_(r,e={}){return new ps(r,e).iterateSync()}a(S_,"globIterateSync");function C9(r,e={}){return new ps(r,e).iterate()}a(C9,"globIterate");var lae=b_,uae=Object.assign(x9,{sync:b_}),fae=S_,dae=Object.assign(C9,{sync:S_}),pae=Object.assign(R9,{stream:b_,iterate:S_}),Ja=Object.assign(I9,{glob:I9,globSync:R9,sync:pae,globStream:x9,stream:uae,globStreamSync:b_,streamSync:lae,globIterate:C9,iterate:dae,globIterateSync:S_,iterateSync:fae,Glob:ps,hasMagic:KI,escape:Yu,unescape:us});Ja.glob=Ja;async function O9(r,e,t,n={}){let{dryRun:i=!1,excludeRelPath:s}=n,o=rl.default.join(r,"**/*.md"),c=await Ja(o,{nodir:!0,ignore:[rl.default.join(r,".obsidian/**"),rl.default.join(r,".trash/**"),rl.default.join(r,"**/.obsidian/**"),rl.default.join(r,"**/.trash/**")]}),l={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let u of c){let f=rl.default.relative(r,u);if(s&&f===s)continue;l.filesScanned+=1;let d;try{d=await QI.default.readFile(u,"utf-8")}catch{continue}let{updated:p,replacements:h}=hae(d,e,t);h>0&&(l.filesModified+=1,l.replacements+=h,l.modifiedFiles.push(f),i||await QI.default.writeFile(u,p,"utf-8"))}return l}a(O9,"rewriteInboundWikilinks");function hae(r,e,t){let n=r.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=n[s],c=mae(o,e,t);i+=c.replacements,n[s]=c.updated}return{updated:n.join(""),replacements:i}}a(hae,"rewriteContent");function mae(r,e,t){let n=r.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=gae(n[s],e,t);i+=o.replacements,n[s]=o.updated}return{updated:n.join(""),replacements:i}}a(mae,"rewriteProseSegment");function gae(r,e,t){let n=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:r.replace(n,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}a(gae,"replaceWikilinks");var yae=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$t=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await br.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return br.default.readFile(t,"utf-8")}async create(e,t){let n=this.resolvePath(e);if(await br.default.pathExists(n))throw new Error(`File already exists: ${e}`);return await br.default.ensureDir(Kt.default.dirname(n)),await br.default.writeFile(n,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let n=this.resolvePath(e.path);if(!await br.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await br.default.writeFile(n,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await br.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await br.default.remove(t)}async exists(e){let t=this.resolvePath(e);return br.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let n=br.default.statSync(t);if(n.isFile())return this.createFileObject(e);if(n.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let n=Kt.default.relative(this.rootPath,t);e.push(this.createFileObject(n))}}),e}getFrontmatter(e){try{let t=br.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let n=await this.read(e),i=this.extractFrontmatter(n)||{},s=t(i),o=this.replaceFrontmatter(n,s);await this.modify(e,o)}async rename(e,t){let n=this.resolvePath(e.path),i=this.resolvePath(t);if(!await br.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await br.default.ensureDir(Kt.default.dirname(i)),await br.default.move(n,i)}async createFolder(e){let t=this.resolvePath(e);await br.default.ensureDir(t)}getFirstLinkpathDest(e,t){let n=e.split("|")[0].trim();if(!n)return null;if(yae.test(n)){this.uuidIndex===null&&this.buildUuidIndex();let u=n.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let i=Kt.default.dirname(this.resolvePath(t)),s;if(Kt.default.isAbsolute(n)?s=this.resolvePath(n):s=Kt.default.resolve(i,n),n.endsWith(".md")||(s+=".md"),br.default.existsSync(s)){let u=Kt.default.relative(this.rootPath,s);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let o=n.toLowerCase(),c=this.basenameIndex.get(o);if(c)return this.createFileObject(c);let l=this.aliasIndex.get(o);return l?this.createFileObject(l):null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=Kt.default.relative(this.rootPath,e),n=Kt.default.basename(e,".md").toLowerCase();this.basenameIndex.has(n)||this.basenameIndex.set(n,t);let i;try{i=br.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let n=Kt.default.basename(e,".md").match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(n){let i=n[1].toLowerCase(),s=Kt.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let n=await this.read(e),i=t(n);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,n){let i=Kt.default.basename(t,".md");await O9(this.rootPath,n,i,{excludeRelPath:e})}resolvePath(e){if(Kt.default.isAbsolute(e))return e;let t=this.rootPath.replace(/[/\\]+$/,""),n=Kt.default.sep+e;return n===t||n.startsWith(t+Kt.default.sep)?n:Kt.default.join(this.rootPath,e)}createFileObject(e){let t=Kt.default.basename(e),n=Kt.default.basename(e,Kt.default.extname(e)),i=Kt.default.dirname(e);return{path:e,basename:n,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:Kt.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,n=e.match(t);return n?(0,P9.parseYamlFrontmatterTolerant)(n[1]):null}replaceFrontmatter(e,t){let n=Ln.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
|
|
403
403
|
${n.trim()}
|
|
404
404
|
---`):`---
|
|
405
405
|
${n.trim()}
|
|
@@ -428,12 +428,12 @@ To fix this:
|
|
|
428
428
|
3. Simplify query: reduce WHERE clauses or add LIMIT
|
|
429
429
|
4. Use cache: --use-cache for faster vault loading${i!==void 0?`
|
|
430
430
|
|
|
431
|
-
Partial results: ${i} result(s) were collected before timeout.`:""}`}static{a(this,"QueryTimeoutError")}};var Yp=Se(require("path")),bn=Se(Qo()),Qp=Se(it());var fi=Se(it());function v_(r){if(r instanceof fi.IRI)return{type:"IRI",value:r.value};if(r instanceof fi.Literal){let e={type:"Literal",value:r.value};return r.datatype&&(e.datatype=r.datatype.value),r.language&&(e.language=r.language),e}return r instanceof fi.BlankNode?{type:"BlankNode",value:r.value}:{type:"IRI",value:String(r)}}a(v_,"serializeNode");function T_(r){switch(r.type){case"IRI":return new fi.IRI(r.value);case"Literal":return r.datatype?new fi.Literal(r.value,new fi.IRI(r.datatype)):r.language?new fi.Literal(r.value,void 0,r.language):new fi.Literal(r.value);case"BlankNode":return new fi.BlankNode(r.value);default:return new fi.IRI(r.value)}}a(T_,"deserializeNode");var Ti=class{constructor(e){this.cliVersion="1.0.0";this.vaultPath=Yp.default.resolve(e),this.cachePath=Yp.default.join(this.vaultPath,".exocortex","cache","triples.json")}static{a(this,"CacheManager")}getCachePath(){return this.cachePath}async isCacheValid(){try{if(!await bn.default.pathExists(this.cachePath))return!1;let e=await bn.default.readJson(this.cachePath);return!(!e.metadata||typeof e.metadata.vaultMtime!="number"||typeof e.metadata.tripleCount!="number"||(await bn.default.stat(this.vaultPath)).mtimeMs!==e.metadata.vaultMtime)}catch{return!1}}async loadOrBuild(){let e=Date.now();if(await this.isCacheValid())return{triples:await this.loadFromCache(),cacheHit:!0,durationMs:Date.now()-e};let{tripleCount:t}=await this.buildCache();return{triples:await this.loadFromCache(),cacheHit:!1,durationMs:Date.now()-e}}async loadFromCache(){return(await bn.default.readJson(this.cachePath)).triples.map(this.deserializeTriple)}async buildCache(){let e=await this.buildCacheWithValidation({strict:!1});return{tripleCount:e.tripleCount,durationMs:e.durationMs}}async buildCacheWithValidation(e={}){let t=Date.now(),n=new $t(this.vaultPath),s=await new Qp.NoteToRDFConverter(n).convertVaultWithValidation({strict:e.strict??!1}),o=await bn.default.stat(this.vaultPath),c=s.triples.map(this.serializeTriple),l={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:s.triples.length,vaultMtime:o.mtimeMs},triples:c};return await bn.default.ensureDir(Yp.default.dirname(this.cachePath)),await bn.default.writeJson(this.cachePath,l,{spaces:0}),{tripleCount:s.triples.length,durationMs:Date.now()-t,skippedFiles:s.skippedFiles,summary:s.summary}}async validateVault(){let e=new $t(this.vaultPath);return new Qp.NoteToRDFConverter(e).validateVault()}async invalidate(){await bn.default.pathExists(this.cachePath)&&await bn.default.remove(this.cachePath)}async getCacheStats(){try{if(!await bn.default.pathExists(this.cachePath))return null;let e=await bn.default.readJson(this.cachePath),t=await bn.default.stat(this.cachePath),n=await this.isCacheValid();return{tripleCount:e.metadata.tripleCount,createdAt:new Date(e.metadata.timestamp),isValid:n,sizeBytes:t.size}}catch{return null}}async saveTriples(e){let t=await bn.default.stat(this.vaultPath),n=e.map(this.serializeTriple),i={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:e.length,vaultMtime:t.mtimeMs},triples:n};await bn.default.ensureDir(Yp.default.dirname(this.cachePath)),await bn.default.writeJson(this.cachePath,i,{spaces:0})}serializeTriple(e){return{subject:v_(e.subject),predicate:v_(e.predicate),object:v_(e.object)}}deserializeTriple(e){return new Qp.Triple(T_(e.subject),T_(e.predicate),T_(e.object))}};var F9=Se(require("crypto")),Xp=Se(require("path")),L9=Se(require("os")),di=Se(Qo());var cf=class{static{a(this,"QueryResultCache")}constructor(e={}){this.cacheDir=e.cacheDir??Xp.default.join(L9.default.homedir(),".exocortex","cache","query-results")}getCacheDir(){return this.cacheDir}getCacheKey(e){let t=e.trim().replace(/\s+/g," ");return F9.default.createHash("sha256").update(t).digest("hex")}async get(e,t){let n=this.getCacheKey(e),i=this.getCachePath(n);try{if(!await di.default.pathExists(i))return null;let s=await di.default.readJson(i),o=Date.now()-s.timestamp,c=t*1e3;return o>c?(await di.default.remove(i),null):s.result}catch{return null}}async set(e,t,n){let i=this.getCacheKey(e),s=this.getCachePath(i);await di.default.ensureDir(this.cacheDir);let o={timestamp:Date.now(),result:t};await di.default.writeJson(s,o,{spaces:0})}async isCached(e,t){return await this.get(e,t)!==null}async invalidate(e){let t=this.getCacheKey(e),n=this.getCachePath(t);try{await di.default.remove(n)}catch{}}async clear(){try{if(await di.default.pathExists(this.cacheDir)){let e=await di.default.readdir(this.cacheDir);await Promise.all(e.filter(t=>t.endsWith(".json")).map(t=>di.default.remove(Xp.default.join(this.cacheDir,t))))}}catch{}}async getCacheStats(){try{if(!await di.default.pathExists(this.cacheDir))return{entryCount:0,totalSizeBytes:0};let t=(await di.default.readdir(this.cacheDir)).filter(i=>i.endsWith(".json")),n=0;for(let i of t){let s=await di.default.stat(Xp.default.join(this.cacheDir,i));n+=s.size}return{entryCount:t.length,totalSizeBytes:n}}catch{return{entryCount:0,totalSizeBytes:0}}}getCachePath(e){return Xp.default.join(this.cacheDir,`${e}.json`)}};var ih=Se(require("node:process"),1);var N9=a((r=0)=>e=>`\x1B[${e+r}m`,"wrapAnsi16"),k9=a((r=0)=>e=>`\x1B[${38+r};5;${e}m`,"wrapAnsi256"),M9=a((r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,"wrapAnsi16m"),Ut={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},pxe=Object.keys(Ut.modifier),_ae=Object.keys(Ut.color),bae=Object.keys(Ut.bgColor),hxe=[..._ae,...bae];function Sae(){let r=new Map;for(let[e,t]of Object.entries(Ut)){for(let[n,i]of Object.entries(t))Ut[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=Ut[n],r.set(i[0],i[1]);Object.defineProperty(Ut,e,{value:t,enumerable:!1})}return Object.defineProperty(Ut,"codes",{value:r,enumerable:!1}),Ut.color.close="\x1B[39m",Ut.bgColor.close="\x1B[49m",Ut.color.ansi=N9(),Ut.color.ansi256=k9(),Ut.color.ansi16m=M9(),Ut.bgColor.ansi=N9(10),Ut.bgColor.ansi256=k9(10),Ut.bgColor.ansi16m=M9(10),Object.defineProperties(Ut,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:a(e=>Ut.rgbToAnsi256(...Ut.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,n=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:a((e,t,n)=>Ut.ansi256ToAnsi(Ut.rgbToAnsi256(e,t,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Ut.ansi256ToAnsi(Ut.hexToAnsi256(e)),"value"),enumerable:!1}}),Ut}a(Sae,"assembleStyles");var wae=Sae(),hs=wae;var I_=Se(require("node:process"),1),$9=Se(require("node:os"),1),XI=Se(require("node:tty"),1);function Ai(r,e=globalThis.Deno?globalThis.Deno.args:I_.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}a(Ai,"hasFlag");var{env:Bt}=I_.default,A_;Ai("no-color")||Ai("no-colors")||Ai("color=false")||Ai("color=never")?A_=0:(Ai("color")||Ai("colors")||Ai("color=true")||Ai("color=always"))&&(A_=1);function Eae(){if("FORCE_COLOR"in Bt)return Bt.FORCE_COLOR==="true"?1:Bt.FORCE_COLOR==="false"?0:Bt.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Bt.FORCE_COLOR,10),3)}a(Eae,"envForceColor");function vae(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}a(vae,"translateLevel");function Tae(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=Eae();n!==void 0&&(A_=n);let i=t?A_:n;if(i===0)return 0;if(t){if(Ai("color=16m")||Ai("color=full")||Ai("color=truecolor"))return 3;if(Ai("color=256"))return 2}if("TF_BUILD"in Bt&&"AGENT_NAME"in Bt)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(Bt.TERM==="dumb")return s;if(I_.default.platform==="win32"){let o=$9.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Bt)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Bt)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Bt)||Bt.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Bt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Bt.TEAMCITY_VERSION)?1:0;if(Bt.COLORTERM==="truecolor"||Bt.TERM==="xterm-kitty"||Bt.TERM==="xterm-ghostty"||Bt.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Bt){let o=Number.parseInt((Bt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Bt.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Bt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Bt.TERM)||"COLORTERM"in Bt?1:s}a(Tae,"_supportsColor");function j9(r,e={}){let t=Tae(r,{streamIsTTY:r&&r.isTTY,...e});return vae(t)}a(j9,"createSupportsColor");var Aae={stdout:j9({isTTY:XI.default.isatty(1)}),stderr:j9({isTTY:XI.default.isatty(2)})},U9=Aae;function B9(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}a(B9,"stringReplaceAll");function V9(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
|
|
431
|
+
Partial results: ${i} result(s) were collected before timeout.`:""}`}static{a(this,"QueryTimeoutError")}};var Yp=Se(require("path")),bn=Se(Qo()),Qp=Se(it());var fi=Se(it());function v_(r){if(r instanceof fi.IRI)return{type:"IRI",value:r.value};if(r instanceof fi.Literal){let e={type:"Literal",value:r.value};return r.datatype&&(e.datatype=r.datatype.value),r.language&&(e.language=r.language),e}return r instanceof fi.BlankNode?{type:"BlankNode",value:r.value}:{type:"IRI",value:String(r)}}a(v_,"serializeNode");function T_(r){switch(r.type){case"IRI":return new fi.IRI(r.value);case"Literal":return r.datatype?new fi.Literal(r.value,new fi.IRI(r.datatype)):r.language?new fi.Literal(r.value,void 0,r.language):new fi.Literal(r.value);case"BlankNode":return new fi.BlankNode(r.value);default:return new fi.IRI(r.value)}}a(T_,"deserializeNode");var Ti=class{constructor(e){this.cliVersion="1.0.0";this.vaultPath=Yp.default.resolve(e),this.cachePath=Yp.default.join(this.vaultPath,".exocortex","cache","triples.json")}static{a(this,"CacheManager")}getCachePath(){return this.cachePath}async isCacheValid(){try{if(!await bn.default.pathExists(this.cachePath))return!1;let e=await bn.default.readJson(this.cachePath);return!(!e.metadata||typeof e.metadata.vaultMtime!="number"||typeof e.metadata.tripleCount!="number"||(await bn.default.stat(this.vaultPath)).mtimeMs!==e.metadata.vaultMtime)}catch{return!1}}async loadOrBuild(){let e=Date.now();if(await this.isCacheValid())return{triples:await this.loadFromCache(),cacheHit:!0,durationMs:Date.now()-e};let{tripleCount:t}=await this.buildCache();return{triples:await this.loadFromCache(),cacheHit:!1,durationMs:Date.now()-e}}async loadFromCache(){return(await bn.default.readJson(this.cachePath)).triples.map(this.deserializeTriple)}async buildCache(){let e=await this.buildCacheWithValidation({strict:!1});return{tripleCount:e.tripleCount,durationMs:e.durationMs}}async buildCacheWithValidation(e={}){let t=Date.now(),n=new $t(this.vaultPath),s=await new Qp.NoteToRDFConverter(n).convertVaultWithValidation({strict:e.strict??!1}),o=await bn.default.stat(this.vaultPath),c=s.triples.map(this.serializeTriple),l={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:s.triples.length,vaultMtime:o.mtimeMs},triples:c};return await bn.default.ensureDir(Yp.default.dirname(this.cachePath)),await bn.default.writeJson(this.cachePath,l,{spaces:0}),{tripleCount:s.triples.length,durationMs:Date.now()-t,skippedFiles:s.skippedFiles,summary:s.summary}}async validateVault(){let e=new $t(this.vaultPath);return new Qp.NoteToRDFConverter(e).validateVault()}async invalidate(){await bn.default.pathExists(this.cachePath)&&await bn.default.remove(this.cachePath)}async getCacheStats(){try{if(!await bn.default.pathExists(this.cachePath))return null;let e=await bn.default.readJson(this.cachePath),t=await bn.default.stat(this.cachePath),n=await this.isCacheValid();return{tripleCount:e.metadata.tripleCount,createdAt:new Date(e.metadata.timestamp),isValid:n,sizeBytes:t.size}}catch{return null}}async saveTriples(e){let t=await bn.default.stat(this.vaultPath),n=e.map(this.serializeTriple),i={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:e.length,vaultMtime:t.mtimeMs},triples:n};await bn.default.ensureDir(Yp.default.dirname(this.cachePath)),await bn.default.writeJson(this.cachePath,i,{spaces:0})}serializeTriple(e){return{subject:v_(e.subject),predicate:v_(e.predicate),object:v_(e.object)}}deserializeTriple(e){return new Qp.Triple(T_(e.subject),T_(e.predicate),T_(e.object))}};var F9=Se(require("crypto")),Xp=Se(require("path")),L9=Se(require("os")),di=Se(Qo());var cf=class{static{a(this,"QueryResultCache")}constructor(e={}){this.cacheDir=e.cacheDir??Xp.default.join(L9.default.homedir(),".exocortex","cache","query-results")}getCacheDir(){return this.cacheDir}getCacheKey(e){let t=e.trim().replace(/\s+/g," ");return F9.default.createHash("sha256").update(t).digest("hex")}async get(e,t){let n=this.getCacheKey(e),i=this.getCachePath(n);try{if(!await di.default.pathExists(i))return null;let s=await di.default.readJson(i),o=Date.now()-s.timestamp,c=t*1e3;return o>c?(await di.default.remove(i),null):s.result}catch{return null}}async set(e,t,n){let i=this.getCacheKey(e),s=this.getCachePath(i);await di.default.ensureDir(this.cacheDir);let o={timestamp:Date.now(),result:t};await di.default.writeJson(s,o,{spaces:0})}async isCached(e,t){return await this.get(e,t)!==null}async invalidate(e){let t=this.getCacheKey(e),n=this.getCachePath(t);try{await di.default.remove(n)}catch{}}async clear(){try{if(await di.default.pathExists(this.cacheDir)){let e=await di.default.readdir(this.cacheDir);await Promise.all(e.filter(t=>t.endsWith(".json")).map(t=>di.default.remove(Xp.default.join(this.cacheDir,t))))}}catch{}}async getCacheStats(){try{if(!await di.default.pathExists(this.cacheDir))return{entryCount:0,totalSizeBytes:0};let t=(await di.default.readdir(this.cacheDir)).filter(i=>i.endsWith(".json")),n=0;for(let i of t){let s=await di.default.stat(Xp.default.join(this.cacheDir,i));n+=s.size}return{entryCount:t.length,totalSizeBytes:n}}catch{return{entryCount:0,totalSizeBytes:0}}}getCachePath(e){return Xp.default.join(this.cacheDir,`${e}.json`)}};var ih=Se(require("node:process"),1);var N9=a((r=0)=>e=>`\x1B[${e+r}m`,"wrapAnsi16"),k9=a((r=0)=>e=>`\x1B[${38+r};5;${e}m`,"wrapAnsi256"),M9=a((r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,"wrapAnsi16m"),Ut={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},hxe=Object.keys(Ut.modifier),_ae=Object.keys(Ut.color),bae=Object.keys(Ut.bgColor),mxe=[..._ae,...bae];function Sae(){let r=new Map;for(let[e,t]of Object.entries(Ut)){for(let[n,i]of Object.entries(t))Ut[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=Ut[n],r.set(i[0],i[1]);Object.defineProperty(Ut,e,{value:t,enumerable:!1})}return Object.defineProperty(Ut,"codes",{value:r,enumerable:!1}),Ut.color.close="\x1B[39m",Ut.bgColor.close="\x1B[49m",Ut.color.ansi=N9(),Ut.color.ansi256=k9(),Ut.color.ansi16m=M9(),Ut.bgColor.ansi=N9(10),Ut.bgColor.ansi256=k9(10),Ut.bgColor.ansi16m=M9(10),Object.defineProperties(Ut,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:a(e=>Ut.rgbToAnsi256(...Ut.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,n=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:a((e,t,n)=>Ut.ansi256ToAnsi(Ut.rgbToAnsi256(e,t,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Ut.ansi256ToAnsi(Ut.hexToAnsi256(e)),"value"),enumerable:!1}}),Ut}a(Sae,"assembleStyles");var wae=Sae(),hs=wae;var I_=Se(require("node:process"),1),$9=Se(require("node:os"),1),XI=Se(require("node:tty"),1);function Ai(r,e=globalThis.Deno?globalThis.Deno.args:I_.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}a(Ai,"hasFlag");var{env:Bt}=I_.default,A_;Ai("no-color")||Ai("no-colors")||Ai("color=false")||Ai("color=never")?A_=0:(Ai("color")||Ai("colors")||Ai("color=true")||Ai("color=always"))&&(A_=1);function Eae(){if("FORCE_COLOR"in Bt)return Bt.FORCE_COLOR==="true"?1:Bt.FORCE_COLOR==="false"?0:Bt.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Bt.FORCE_COLOR,10),3)}a(Eae,"envForceColor");function vae(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}a(vae,"translateLevel");function Tae(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=Eae();n!==void 0&&(A_=n);let i=t?A_:n;if(i===0)return 0;if(t){if(Ai("color=16m")||Ai("color=full")||Ai("color=truecolor"))return 3;if(Ai("color=256"))return 2}if("TF_BUILD"in Bt&&"AGENT_NAME"in Bt)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(Bt.TERM==="dumb")return s;if(I_.default.platform==="win32"){let o=$9.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Bt)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in Bt)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Bt)||Bt.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Bt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Bt.TEAMCITY_VERSION)?1:0;if(Bt.COLORTERM==="truecolor"||Bt.TERM==="xterm-kitty"||Bt.TERM==="xterm-ghostty"||Bt.TERM==="wezterm")return 3;if("TERM_PROGRAM"in Bt){let o=Number.parseInt((Bt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Bt.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Bt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Bt.TERM)||"COLORTERM"in Bt?1:s}a(Tae,"_supportsColor");function j9(r,e={}){let t=Tae(r,{streamIsTTY:r&&r.isTTY,...e});return vae(t)}a(j9,"createSupportsColor");var Aae={stdout:j9({isTTY:XI.default.isatty(1)}),stderr:j9({isTTY:XI.default.isatty(2)})},U9=Aae;function B9(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}a(B9,"stringReplaceAll");function V9(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
|
|
432
432
|
`:`
|
|
433
433
|
`)+t,i=n+1,n=r.indexOf(`
|
|
434
434
|
`,i)}while(n!==-1);return s+=r.slice(i),s}a(V9,"stringEncaseCRLFWithFirstIndex");var{stdout:q9,stderr:G9}=U9,JI=Symbol("GENERATOR"),lf=Symbol("STYLER"),Jp=Symbol("IS_EMPTY"),W9=["ansi","ansi","ansi256","ansi16m"],uf=Object.create(null),Iae=a((r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=q9?q9.level:0;r.level=e.level===void 0?t:e.level},"applyOptions");var xae=a(r=>{let e=a((...t)=>t.join(" "),"chalk");return Iae(e,r),Object.setPrototypeOf(e,Zp.prototype),e},"chalkFactory");function Zp(r){return xae(r)}a(Zp,"createChalk");Object.setPrototypeOf(Zp.prototype,Function.prototype);for(let[r,e]of Object.entries(hs))uf[r]={get(){let t=x_(this,ex(e.open,e.close,this[lf]),this[Jp]);return Object.defineProperty(this,r,{value:t}),t}};uf.visible={get(){let r=x_(this,this[lf],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var ZI=a((r,e,t,...n)=>r==="rgb"?e==="ansi16m"?hs[t].ansi16m(...n):e==="ansi256"?hs[t].ansi256(hs.rgbToAnsi256(...n)):hs[t].ansi(hs.rgbToAnsi(...n)):r==="hex"?ZI("rgb",e,t,...hs.hexToRgb(...n)):hs[t][r](...n),"getModelAnsi"),Rae=["rgb","hex","ansi256"];for(let r of Rae){uf[r]={get(){let{level:t}=this;return function(...n){let i=ex(ZI(r,W9[t],"color",...n),hs.color.close,this[lf]);return x_(this,i,this[Jp])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);uf[e]={get(){let{level:t}=this;return function(...n){let i=ex(ZI(r,W9[t],"bgColor",...n),hs.bgColor.close,this[lf]);return x_(this,i,this[Jp])}}}}var Cae=Object.defineProperties(()=>{},{...uf,level:{enumerable:!0,get(){return this[JI].level},set(r){this[JI].level=r}}}),ex=a((r,e,t)=>{let n,i;return t===void 0?(n=r,i=e):(n=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:i,parent:t}},"createStyler"),x_=a((r,e,t)=>{let n=a((...i)=>Oae(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,Cae),n[JI]=r,n[lf]=e,n[Jp]=t,n},"createBuilder"),Oae=a((r,e)=>{if(r.level<=0||!e)return r[Jp]?"":e;let t=r[lf];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=B9(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
|
|
435
|
-
`);return s!==-1&&(e=V9(e,i,n,s)),n+e+i},"applyStyle");Object.defineProperties(Zp.prototype,uf);var Pae=Zp(),
|
|
436
|
-
${e}`,"wrappedToString"),kae=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Mae=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),jae=a((r,e,t)=>{let n=t===""?"":`with ${t.trim()}() `,i=Nae.bind(null,n,e.toString());Object.defineProperty(i,"name",Mae);let{writable:s,enumerable:o,configurable:c}=kae;Object.defineProperty(r,"toString",{value:i,writable:s,enumerable:o,configurable:c})},"changeToString");function tx(r,e,{ignoreNonConfigurable:t=!1}={}){let{name:n}=r;for(let i of Reflect.ownKeys(e))Dae(r,e,i,t);return Lae(r,e),jae(r,e,n),r}a(tx,"mimicFunction");var R_=new WeakMap,z9=a((r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,n=0,i=r.displayName||r.name||"<anonymous>",s=a(function(...o){if(R_.set(s,++n),n===1)t=r.apply(this,o),r=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t},"onetime");return tx(s,r),R_.set(s,n),s},"onetime");z9.callCount=r=>{if(!R_.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return R_.get(r)};var K9=z9;var nl=[];nl.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&nl.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&nl.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var C_=a(r=>!!r&&typeof r=="object"&&typeof r.removeListener=="function"&&typeof r.emit=="function"&&typeof r.reallyExit=="function"&&typeof r.listeners=="function"&&typeof r.kill=="function"&&typeof r.pid=="number"&&typeof r.on=="function","processOk"),rx=Symbol.for("signal-exit emitter"),nx=globalThis,$ae=Object.defineProperty.bind(Object),ix=class{static{a(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(nx[rx])return nx[rx];$ae(nx,rx,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],i=n.indexOf(t);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(t,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,n)||i),i}},O_=class{static{a(this,"SignalExitBase")}},Uae=a(r=>({onExit(e,t){return r.onExit(e,t)},load(){return r.load()},unload(){return r.unload()}}),"signalExitWrap"),sx=class extends O_{static{a(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},ox=class extends O_{static{a(this,"SignalExit")}#e=ax.platform==="win32"?"SIGINT":"SIGHUP";#n=new ix;#r;#t;#c;#_={};#i=!1;constructor(e){super(),this.#r=e,this.#_={};for(let t of nl)this.#_[t]=()=>{let n=this.#r.listeners(t),{count:i}=this.#n,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),n.length===i){this.unload();let o=this.#n.emit("exit",null,t),c=t==="SIGHUP"?this.#e:t;o||e.kill(e.pid,c)}};this.#c=e.reallyExit,this.#t=e.emit}onExit(e,t){if(!C_(this.#r))return()=>{};this.#i===!1&&this.load();let n=t?.alwaysLast?"afterExit":"exit";return this.#n.on(n,e),()=>{this.#n.removeListener(n,e),this.#n.listeners.exit.length===0&&this.#n.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#n.count+=1;for(let e of nl)try{let t=this.#_[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#s(e,...t),this.#r.reallyExit=e=>this.#u(e)}}unload(){this.#i&&(this.#i=!1,nl.forEach(e=>{let t=this.#_[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#t,this.#r.reallyExit=this.#c,this.#n.count-=1)}#u(e){return C_(this.#r)?(this.#r.exitCode=e||0,this.#n.emit("exit",this.#r.exitCode,null),this.#c.call(this.#r,this.#r.exitCode)):0}#s(e,...t){let n=this.#t;if(e==="exit"&&C_(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let i=n.call(this.#r,e,...t);return this.#n.emit("exit",this.#r.exitCode,null),i}else return n.call(this.#r,e,...t)}},ax=globalThis.process,{onExit:Y9,load:Lxe,unload:Nxe}=Uae(C_(ax)?new ox(ax):new sx);var Q9=eh.default.stderr.isTTY?eh.default.stderr:eh.default.stdout.isTTY?eh.default.stdout:void 0,Bae=Q9?K9(()=>{Y9(()=>{Q9.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},X9=Bae;var P_=!1,ff={};ff.show=(r=cx.default.stderr)=>{r.isTTY&&(P_=!1,r.write("\x1B[?25h"))};ff.hide=(r=cx.default.stderr)=>{r.isTTY&&(X9(),P_=!0,r.write("\x1B[?25l"))};ff.toggle=(r,e)=>{r!==void 0&&(P_=r),P_?ff.show(e):ff.hide(e)};var lx=ff;var ux={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var th=ux,Wxe=Object.keys(ux);var il={};Bb(il,{error:()=>zae,info:()=>Gae,success:()=>Wae,warning:()=>Hae});var J9=Se(require("node:tty"),1);var qae=J9.default?.WriteStream?.prototype?.hasColors?.()??!1,st=a((r,e)=>{if(!qae)return i=>i;let t=`\x1B[${r}m`,n=`\x1B[${e}m`;return i=>{let s=i+"",o=s.indexOf(n);if(o===-1)return t+s+n;let c=t,l=0,f=(e===22?n:"")+t;for(;o!==-1;)c+=s.slice(l,o)+f,l=o+n.length,o=s.indexOf(n,l);return c+=s.slice(l)+n,c}},"format"),Kxe=st(0,0),Yxe=st(1,22),Qxe=st(2,22),Xxe=st(3,23),Jxe=st(4,24),Zxe=st(53,55),eRe=st(7,27),tRe=st(8,28),rRe=st(9,29),nRe=st(30,39),Z9=st(31,39),e5=st(32,39),t5=st(33,39),r5=st(34,39),iRe=st(35,39),sRe=st(36,39),oRe=st(37,39),aRe=st(90,39),cRe=st(40,49),lRe=st(41,49),uRe=st(42,49),fRe=st(43,49),dRe=st(44,49),pRe=st(45,49),hRe=st(46,49),mRe=st(47,49),gRe=st(100,49),yRe=st(91,39),_Re=st(92,39),bRe=st(93,39),SRe=st(94,39),wRe=st(95,39),ERe=st(96,39),vRe=st(97,39),TRe=st(101,49),ARe=st(102,49),IRe=st(103,49),xRe=st(104,49),RRe=st(105,49),CRe=st(106,49),ORe=st(107,49);var fx=Se(require("node:process"),1);function rh(){let{env:r}=fx.default,{TERM:e,TERM_PROGRAM:t}=r;return fx.default.platform!=="win32"?e!=="linux":!!r.WT_SESSION||!!r.TERMINUS_SUBLIME||r.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||r.TERMINAL_EMULATOR==="JetBrains-JediTerm"}a(rh,"isUnicodeSupported");var D_=rh(),Gae=r5(D_?"\u2139":"i"),Wae=e5(D_?"\u2714":"\u221A"),Hae=t5(D_?"\u26A0":"\u203C"),zae=Z9(D_?"\u2716":"\xD7");function dx({onlyFirst:r=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,r?void 0:"g")}a(dx,"ansiRegex");var Kae=dx();function nh(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Kae,"")}a(nh,"stripAnsi");function n5(r){return r===161||r===164||r===167||r===168||r===170||r===173||r===174||r>=176&&r<=180||r>=182&&r<=186||r>=188&&r<=191||r===198||r===208||r===215||r===216||r>=222&&r<=225||r===230||r>=232&&r<=234||r===236||r===237||r===240||r===242||r===243||r>=247&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||r===294||r===295||r===299||r>=305&&r<=307||r===312||r>=319&&r<=322||r===324||r>=328&&r<=331||r===333||r===338||r===339||r===358||r===359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||r>=713&&r<=715||r===717||r===720||r>=728&&r<=731||r===733||r===735||r>=768&&r<=879||r>=913&&r<=929||r>=931&&r<=937||r>=945&&r<=961||r>=963&&r<=969||r===1025||r>=1040&&r<=1103||r===1105||r===8208||r>=8211&&r<=8214||r===8216||r===8217||r===8220||r===8221||r>=8224&&r<=8226||r>=8228&&r<=8231||r===8240||r===8242||r===8243||r===8245||r===8251||r===8254||r===8308||r===8319||r>=8321&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||r===8481||r===8482||r===8486||r===8491||r===8531||r===8532||r>=8539&&r<=8542||r>=8544&&r<=8555||r>=8560&&r<=8569||r===8585||r>=8592&&r<=8601||r===8632||r===8633||r===8658||r===8660||r===8679||r===8704||r===8706||r===8707||r===8711||r===8712||r===8715||r===8719||r===8721||r===8725||r===8730||r>=8733&&r<=8736||r===8739||r===8741||r>=8743&&r<=8748||r===8750||r>=8756&&r<=8759||r===8764||r===8765||r===8776||r===8780||r===8786||r===8800||r===8801||r>=8804&&r<=8807||r===8810||r===8811||r===8814||r===8815||r===8834||r===8835||r===8838||r===8839||r===8853||r===8857||r===8869||r===8895||r===8978||r>=9312&&r<=9449||r>=9451&&r<=9547||r>=9552&&r<=9587||r>=9600&&r<=9615||r>=9618&&r<=9621||r===9632||r===9633||r>=9635&&r<=9641||r===9650||r===9651||r===9654||r===9655||r===9660||r===9661||r===9664||r===9665||r>=9670&&r<=9672||r===9675||r>=9678&&r<=9681||r>=9698&&r<=9701||r===9711||r===9733||r===9734||r===9737||r===9742||r===9743||r===9756||r===9758||r===9792||r===9794||r===9824||r===9825||r>=9827&&r<=9829||r>=9831&&r<=9834||r===9836||r===9837||r===9839||r===9886||r===9887||r===9919||r>=9926&&r<=9933||r>=9935&&r<=9939||r>=9941&&r<=9953||r===9955||r===9960||r===9961||r>=9963&&r<=9969||r===9972||r>=9974&&r<=9977||r===9979||r===9980||r===9982||r===9983||r===10045||r>=10102&&r<=10111||r>=11094&&r<=11097||r>=12872&&r<=12879||r>=57344&&r<=63743||r>=65024&&r<=65039||r===65533||r>=127232&&r<=127242||r>=127248&&r<=127277||r>=127280&&r<=127337||r>=127344&&r<=127373||r===127375||r===127376||r>=127387&&r<=127404||r>=917760&&r<=917999||r>=983040&&r<=1048573||r>=1048576&&r<=1114109}a(n5,"isAmbiguous");function i5(r){return r===12288||r>=65281&&r<=65376||r>=65504&&r<=65510}a(i5,"isFullWidth");function s5(r){return r>=4352&&r<=4447||r===8986||r===8987||r===9001||r===9002||r>=9193&&r<=9196||r===9200||r===9203||r===9725||r===9726||r===9748||r===9749||r>=9776&&r<=9783||r>=9800&&r<=9811||r===9855||r>=9866&&r<=9871||r===9875||r===9889||r===9898||r===9899||r===9917||r===9918||r===9924||r===9925||r===9934||r===9940||r===9962||r===9970||r===9971||r===9973||r===9978||r===9981||r===9989||r===9994||r===9995||r===10024||r===10060||r===10062||r>=10067&&r<=10069||r===10071||r>=10133&&r<=10135||r===10160||r===10175||r===11035||r===11036||r===11088||r===11093||r>=11904&&r<=11929||r>=11931&&r<=12019||r>=12032&&r<=12245||r>=12272&&r<=12287||r>=12289&&r<=12350||r>=12353&&r<=12438||r>=12441&&r<=12543||r>=12549&&r<=12591||r>=12593&&r<=12686||r>=12688&&r<=12773||r>=12783&&r<=12830||r>=12832&&r<=12871||r>=12880&&r<=42124||r>=42128&&r<=42182||r>=43360&&r<=43388||r>=44032&&r<=55203||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65106||r>=65108&&r<=65126||r>=65128&&r<=65131||r>=94176&&r<=94180||r>=94192&&r<=94198||r>=94208&&r<=101589||r>=101631&&r<=101662||r>=101760&&r<=101874||r>=110576&&r<=110579||r>=110581&&r<=110587||r===110589||r===110590||r>=110592&&r<=110882||r===110898||r>=110928&&r<=110930||r===110933||r>=110948&&r<=110951||r>=110960&&r<=111355||r>=119552&&r<=119638||r>=119648&&r<=119670||r===126980||r===127183||r===127374||r>=127377&&r<=127386||r>=127488&&r<=127490||r>=127504&&r<=127547||r>=127552&&r<=127560||r===127568||r===127569||r>=127584&&r<=127589||r>=127744&&r<=127776||r>=127789&&r<=127797||r>=127799&&r<=127868||r>=127870&&r<=127891||r>=127904&&r<=127946||r>=127951&&r<=127955||r>=127968&&r<=127984||r===127988||r>=127992&&r<=128062||r===128064||r>=128066&&r<=128252||r>=128255&&r<=128317||r>=128331&&r<=128334||r>=128336&&r<=128359||r===128378||r===128405||r===128406||r===128420||r>=128507&&r<=128591||r>=128640&&r<=128709||r===128716||r>=128720&&r<=128722||r>=128725&&r<=128728||r>=128732&&r<=128735||r===128747||r===128748||r>=128756&&r<=128764||r>=128992&&r<=129003||r===129008||r>=129292&&r<=129338||r>=129340&&r<=129349||r>=129351&&r<=129535||r>=129648&&r<=129660||r>=129664&&r<=129674||r>=129678&&r<=129734||r===129736||r>=129741&&r<=129756||r>=129759&&r<=129770||r>=129775&&r<=129784||r>=131072&&r<=196605||r>=196608&&r<=262141}a(s5,"isWide");function Yae(r){if(!Number.isSafeInteger(r))throw new TypeError(`Expected a code point, got \`${typeof r}\`.`)}a(Yae,"validate");function px(r,{ambiguousAsWide:e=!1}={}){return Yae(r),i5(r)||s5(r)||e&&n5(r)?2:1}a(px,"eastAsianWidth");var Qae=new Intl.Segmenter,Xae=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),Jae=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),Zae=new RegExp("^\\p{RGI_Emoji}$","v");function ece(r){return r.replace(Jae,"")}a(ece,"baseVisible");function tce(r){return Xae.test(r)}a(tce,"isZeroWidthCluster");function rce(r,e){let t=0;if(r.length>1)for(let n of r.slice(1))n>="\uFF00"&&n<="\uFFEF"&&(t+=px(n.codePointAt(0),e));return t}a(rce,"trailingHalfwidthWidth");function hx(r,e={}){if(typeof r!="string"||r.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:n=!1}=e,i=r;if(n||(i=nh(i)),i.length===0)return 0;let s=0,o={ambiguousAsWide:!t};for(let{segment:c}of Qae.segment(i)){if(tce(c))continue;if(Zae.test(c)){s+=2;continue}let l=ece(c).codePointAt(0);s+=px(l,o),s+=rce(c,o)}return s}a(hx,"stringWidth");function mx({stream:r=process.stdout}={}){return!!(r&&r.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}a(mx,"isInteractive");var ms=Se(require("node:process"),1);var nce=3,gx=class{static{a(this,"StdinDiscarder")}#e=0;start(){this.#e++,this.#e===1&&this.#n()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#r()}#n(){ms.default.platform==="win32"||!ms.default.stdin.isTTY||(ms.default.stdin.setRawMode(!0),ms.default.stdin.on("data",this.#t),ms.default.stdin.resume())}#r(){ms.default.stdin.isTTY&&(ms.default.stdin.off("data",this.#t),ms.default.stdin.pause(),ms.default.stdin.setRawMode(!1))}#t(e){e[0]===nce&&ms.default.emit("SIGINT")}},ice=new gx,yx=ice;var _x=class{static{a(this,"Ora")}#e=0;#n=!1;#r=0;#t=-1;#c=0;#_=0;#i;#u;#s;#l;#o;#h;#g;#d;#m;#y;#f;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#i={color:"cyan",stream:ih.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#i.color,this.spinner=this.#i.spinner,this.#o=this.#i.interval,this.#s=this.#i.stream,this.#h=typeof this.#i.isEnabled=="boolean"?this.#i.isEnabled:mx({stream:this.#s}),this.#g=typeof this.#i.isSilent=="boolean"?this.#i.isSilent:!1,this.text=this.#i.text,this.prefixText=this.#i.prefixText,this.suffixText=this.#i.suffixText,this.indent=this.#i.indent,ih.default.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#h,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(t){this.#e=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#t}}),Object.defineProperty(this,"_lineCount",{get(){return this.#r}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#S()}get interval(){return this.#o??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#t=-1,this.#o=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(t=>typeof t!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!rh())this.#u=th.line;else if(e===void 0)this.#u=th.dots;else if(e!=="default"&&th[e])this.#u=th[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#m}set text(e=""){this.#m=e,this.#S()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#S()}get suffixText(){return this.#f}set suffixText(e=""){this.#f=e,this.#S()}get isSpinning(){return this.#l!==void 0}#v(e,t,n=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?n?t+i:i+t:""}#T(e=this.#y,t=" "){return this.#v(e,t,!1)}#b(e=this.#f,t=" "){return this.#v(e,t,!0)}#E(e,t){let n=0;for(let i of nh(e).split(`
|
|
435
|
+
`);return s!==-1&&(e=V9(e,i,n,s)),n+e+i},"applyStyle");Object.defineProperties(Zp.prototype,uf);var Pae=Zp(),Axe=Zp({level:G9?G9.level:0});var H9=Pae;var cx=Se(require("node:process"),1);var eh=Se(require("node:process"),1);var Dae=a((r,e,t,n)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;let i=Object.getOwnPropertyDescriptor(r,t),s=Object.getOwnPropertyDescriptor(e,t);!Fae(i,s)&&n||Object.defineProperty(r,t,s)},"copyProperty"),Fae=a(function(r,e){return r===void 0||r.configurable||r.writable===e.writable&&r.enumerable===e.enumerable&&r.configurable===e.configurable&&(r.writable||r.value===e.value)},"canCopyProperty"),Lae=a((r,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},"changePrototype"),Nae=a((r,e)=>`/* Wrapped ${r}*/
|
|
436
|
+
${e}`,"wrappedToString"),kae=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Mae=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),jae=a((r,e,t)=>{let n=t===""?"":`with ${t.trim()}() `,i=Nae.bind(null,n,e.toString());Object.defineProperty(i,"name",Mae);let{writable:s,enumerable:o,configurable:c}=kae;Object.defineProperty(r,"toString",{value:i,writable:s,enumerable:o,configurable:c})},"changeToString");function tx(r,e,{ignoreNonConfigurable:t=!1}={}){let{name:n}=r;for(let i of Reflect.ownKeys(e))Dae(r,e,i,t);return Lae(r,e),jae(r,e,n),r}a(tx,"mimicFunction");var R_=new WeakMap,z9=a((r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,n=0,i=r.displayName||r.name||"<anonymous>",s=a(function(...o){if(R_.set(s,++n),n===1)t=r.apply(this,o),r=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t},"onetime");return tx(s,r),R_.set(s,n),s},"onetime");z9.callCount=r=>{if(!R_.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return R_.get(r)};var K9=z9;var nl=[];nl.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&nl.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&nl.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var C_=a(r=>!!r&&typeof r=="object"&&typeof r.removeListener=="function"&&typeof r.emit=="function"&&typeof r.reallyExit=="function"&&typeof r.listeners=="function"&&typeof r.kill=="function"&&typeof r.pid=="number"&&typeof r.on=="function","processOk"),rx=Symbol.for("signal-exit emitter"),nx=globalThis,$ae=Object.defineProperty.bind(Object),ix=class{static{a(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(nx[rx])return nx[rx];$ae(nx,rx,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],i=n.indexOf(t);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(t,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,n)||i),i}},O_=class{static{a(this,"SignalExitBase")}},Uae=a(r=>({onExit(e,t){return r.onExit(e,t)},load(){return r.load()},unload(){return r.unload()}}),"signalExitWrap"),sx=class extends O_{static{a(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},ox=class extends O_{static{a(this,"SignalExit")}#e=ax.platform==="win32"?"SIGINT":"SIGHUP";#n=new ix;#r;#t;#c;#_={};#i=!1;constructor(e){super(),this.#r=e,this.#_={};for(let t of nl)this.#_[t]=()=>{let n=this.#r.listeners(t),{count:i}=this.#n,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),n.length===i){this.unload();let o=this.#n.emit("exit",null,t),c=t==="SIGHUP"?this.#e:t;o||e.kill(e.pid,c)}};this.#c=e.reallyExit,this.#t=e.emit}onExit(e,t){if(!C_(this.#r))return()=>{};this.#i===!1&&this.load();let n=t?.alwaysLast?"afterExit":"exit";return this.#n.on(n,e),()=>{this.#n.removeListener(n,e),this.#n.listeners.exit.length===0&&this.#n.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#n.count+=1;for(let e of nl)try{let t=this.#_[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#s(e,...t),this.#r.reallyExit=e=>this.#u(e)}}unload(){this.#i&&(this.#i=!1,nl.forEach(e=>{let t=this.#_[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#t,this.#r.reallyExit=this.#c,this.#n.count-=1)}#u(e){return C_(this.#r)?(this.#r.exitCode=e||0,this.#n.emit("exit",this.#r.exitCode,null),this.#c.call(this.#r,this.#r.exitCode)):0}#s(e,...t){let n=this.#t;if(e==="exit"&&C_(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let i=n.call(this.#r,e,...t);return this.#n.emit("exit",this.#r.exitCode,null),i}else return n.call(this.#r,e,...t)}},ax=globalThis.process,{onExit:Y9,load:Nxe,unload:kxe}=Uae(C_(ax)?new ox(ax):new sx);var Q9=eh.default.stderr.isTTY?eh.default.stderr:eh.default.stdout.isTTY?eh.default.stdout:void 0,Bae=Q9?K9(()=>{Y9(()=>{Q9.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},X9=Bae;var P_=!1,ff={};ff.show=(r=cx.default.stderr)=>{r.isTTY&&(P_=!1,r.write("\x1B[?25h"))};ff.hide=(r=cx.default.stderr)=>{r.isTTY&&(X9(),P_=!0,r.write("\x1B[?25l"))};ff.toggle=(r,e)=>{r!==void 0&&(P_=r),P_?ff.show(e):ff.hide(e)};var lx=ff;var ux={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var th=ux,Hxe=Object.keys(ux);var il={};Bb(il,{error:()=>zae,info:()=>Gae,success:()=>Wae,warning:()=>Hae});var J9=Se(require("node:tty"),1);var qae=J9.default?.WriteStream?.prototype?.hasColors?.()??!1,st=a((r,e)=>{if(!qae)return i=>i;let t=`\x1B[${r}m`,n=`\x1B[${e}m`;return i=>{let s=i+"",o=s.indexOf(n);if(o===-1)return t+s+n;let c=t,l=0,f=(e===22?n:"")+t;for(;o!==-1;)c+=s.slice(l,o)+f,l=o+n.length,o=s.indexOf(n,l);return c+=s.slice(l)+n,c}},"format"),Yxe=st(0,0),Qxe=st(1,22),Xxe=st(2,22),Jxe=st(3,23),Zxe=st(4,24),eRe=st(53,55),tRe=st(7,27),rRe=st(8,28),nRe=st(9,29),iRe=st(30,39),Z9=st(31,39),e5=st(32,39),t5=st(33,39),r5=st(34,39),sRe=st(35,39),oRe=st(36,39),aRe=st(37,39),cRe=st(90,39),lRe=st(40,49),uRe=st(41,49),fRe=st(42,49),dRe=st(43,49),pRe=st(44,49),hRe=st(45,49),mRe=st(46,49),gRe=st(47,49),yRe=st(100,49),_Re=st(91,39),bRe=st(92,39),SRe=st(93,39),wRe=st(94,39),ERe=st(95,39),vRe=st(96,39),TRe=st(97,39),ARe=st(101,49),IRe=st(102,49),xRe=st(103,49),RRe=st(104,49),CRe=st(105,49),ORe=st(106,49),PRe=st(107,49);var fx=Se(require("node:process"),1);function rh(){let{env:r}=fx.default,{TERM:e,TERM_PROGRAM:t}=r;return fx.default.platform!=="win32"?e!=="linux":!!r.WT_SESSION||!!r.TERMINUS_SUBLIME||r.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||r.TERMINAL_EMULATOR==="JetBrains-JediTerm"}a(rh,"isUnicodeSupported");var D_=rh(),Gae=r5(D_?"\u2139":"i"),Wae=e5(D_?"\u2714":"\u221A"),Hae=t5(D_?"\u26A0":"\u203C"),zae=Z9(D_?"\u2716":"\xD7");function dx({onlyFirst:r=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,r?void 0:"g")}a(dx,"ansiRegex");var Kae=dx();function nh(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Kae,"")}a(nh,"stripAnsi");function n5(r){return r===161||r===164||r===167||r===168||r===170||r===173||r===174||r>=176&&r<=180||r>=182&&r<=186||r>=188&&r<=191||r===198||r===208||r===215||r===216||r>=222&&r<=225||r===230||r>=232&&r<=234||r===236||r===237||r===240||r===242||r===243||r>=247&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||r===294||r===295||r===299||r>=305&&r<=307||r===312||r>=319&&r<=322||r===324||r>=328&&r<=331||r===333||r===338||r===339||r===358||r===359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||r>=713&&r<=715||r===717||r===720||r>=728&&r<=731||r===733||r===735||r>=768&&r<=879||r>=913&&r<=929||r>=931&&r<=937||r>=945&&r<=961||r>=963&&r<=969||r===1025||r>=1040&&r<=1103||r===1105||r===8208||r>=8211&&r<=8214||r===8216||r===8217||r===8220||r===8221||r>=8224&&r<=8226||r>=8228&&r<=8231||r===8240||r===8242||r===8243||r===8245||r===8251||r===8254||r===8308||r===8319||r>=8321&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||r===8481||r===8482||r===8486||r===8491||r===8531||r===8532||r>=8539&&r<=8542||r>=8544&&r<=8555||r>=8560&&r<=8569||r===8585||r>=8592&&r<=8601||r===8632||r===8633||r===8658||r===8660||r===8679||r===8704||r===8706||r===8707||r===8711||r===8712||r===8715||r===8719||r===8721||r===8725||r===8730||r>=8733&&r<=8736||r===8739||r===8741||r>=8743&&r<=8748||r===8750||r>=8756&&r<=8759||r===8764||r===8765||r===8776||r===8780||r===8786||r===8800||r===8801||r>=8804&&r<=8807||r===8810||r===8811||r===8814||r===8815||r===8834||r===8835||r===8838||r===8839||r===8853||r===8857||r===8869||r===8895||r===8978||r>=9312&&r<=9449||r>=9451&&r<=9547||r>=9552&&r<=9587||r>=9600&&r<=9615||r>=9618&&r<=9621||r===9632||r===9633||r>=9635&&r<=9641||r===9650||r===9651||r===9654||r===9655||r===9660||r===9661||r===9664||r===9665||r>=9670&&r<=9672||r===9675||r>=9678&&r<=9681||r>=9698&&r<=9701||r===9711||r===9733||r===9734||r===9737||r===9742||r===9743||r===9756||r===9758||r===9792||r===9794||r===9824||r===9825||r>=9827&&r<=9829||r>=9831&&r<=9834||r===9836||r===9837||r===9839||r===9886||r===9887||r===9919||r>=9926&&r<=9933||r>=9935&&r<=9939||r>=9941&&r<=9953||r===9955||r===9960||r===9961||r>=9963&&r<=9969||r===9972||r>=9974&&r<=9977||r===9979||r===9980||r===9982||r===9983||r===10045||r>=10102&&r<=10111||r>=11094&&r<=11097||r>=12872&&r<=12879||r>=57344&&r<=63743||r>=65024&&r<=65039||r===65533||r>=127232&&r<=127242||r>=127248&&r<=127277||r>=127280&&r<=127337||r>=127344&&r<=127373||r===127375||r===127376||r>=127387&&r<=127404||r>=917760&&r<=917999||r>=983040&&r<=1048573||r>=1048576&&r<=1114109}a(n5,"isAmbiguous");function i5(r){return r===12288||r>=65281&&r<=65376||r>=65504&&r<=65510}a(i5,"isFullWidth");function s5(r){return r>=4352&&r<=4447||r===8986||r===8987||r===9001||r===9002||r>=9193&&r<=9196||r===9200||r===9203||r===9725||r===9726||r===9748||r===9749||r>=9776&&r<=9783||r>=9800&&r<=9811||r===9855||r>=9866&&r<=9871||r===9875||r===9889||r===9898||r===9899||r===9917||r===9918||r===9924||r===9925||r===9934||r===9940||r===9962||r===9970||r===9971||r===9973||r===9978||r===9981||r===9989||r===9994||r===9995||r===10024||r===10060||r===10062||r>=10067&&r<=10069||r===10071||r>=10133&&r<=10135||r===10160||r===10175||r===11035||r===11036||r===11088||r===11093||r>=11904&&r<=11929||r>=11931&&r<=12019||r>=12032&&r<=12245||r>=12272&&r<=12287||r>=12289&&r<=12350||r>=12353&&r<=12438||r>=12441&&r<=12543||r>=12549&&r<=12591||r>=12593&&r<=12686||r>=12688&&r<=12773||r>=12783&&r<=12830||r>=12832&&r<=12871||r>=12880&&r<=42124||r>=42128&&r<=42182||r>=43360&&r<=43388||r>=44032&&r<=55203||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65106||r>=65108&&r<=65126||r>=65128&&r<=65131||r>=94176&&r<=94180||r>=94192&&r<=94198||r>=94208&&r<=101589||r>=101631&&r<=101662||r>=101760&&r<=101874||r>=110576&&r<=110579||r>=110581&&r<=110587||r===110589||r===110590||r>=110592&&r<=110882||r===110898||r>=110928&&r<=110930||r===110933||r>=110948&&r<=110951||r>=110960&&r<=111355||r>=119552&&r<=119638||r>=119648&&r<=119670||r===126980||r===127183||r===127374||r>=127377&&r<=127386||r>=127488&&r<=127490||r>=127504&&r<=127547||r>=127552&&r<=127560||r===127568||r===127569||r>=127584&&r<=127589||r>=127744&&r<=127776||r>=127789&&r<=127797||r>=127799&&r<=127868||r>=127870&&r<=127891||r>=127904&&r<=127946||r>=127951&&r<=127955||r>=127968&&r<=127984||r===127988||r>=127992&&r<=128062||r===128064||r>=128066&&r<=128252||r>=128255&&r<=128317||r>=128331&&r<=128334||r>=128336&&r<=128359||r===128378||r===128405||r===128406||r===128420||r>=128507&&r<=128591||r>=128640&&r<=128709||r===128716||r>=128720&&r<=128722||r>=128725&&r<=128728||r>=128732&&r<=128735||r===128747||r===128748||r>=128756&&r<=128764||r>=128992&&r<=129003||r===129008||r>=129292&&r<=129338||r>=129340&&r<=129349||r>=129351&&r<=129535||r>=129648&&r<=129660||r>=129664&&r<=129674||r>=129678&&r<=129734||r===129736||r>=129741&&r<=129756||r>=129759&&r<=129770||r>=129775&&r<=129784||r>=131072&&r<=196605||r>=196608&&r<=262141}a(s5,"isWide");function Yae(r){if(!Number.isSafeInteger(r))throw new TypeError(`Expected a code point, got \`${typeof r}\`.`)}a(Yae,"validate");function px(r,{ambiguousAsWide:e=!1}={}){return Yae(r),i5(r)||s5(r)||e&&n5(r)?2:1}a(px,"eastAsianWidth");var Qae=new Intl.Segmenter,Xae=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),Jae=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),Zae=new RegExp("^\\p{RGI_Emoji}$","v");function ece(r){return r.replace(Jae,"")}a(ece,"baseVisible");function tce(r){return Xae.test(r)}a(tce,"isZeroWidthCluster");function rce(r,e){let t=0;if(r.length>1)for(let n of r.slice(1))n>="\uFF00"&&n<="\uFFEF"&&(t+=px(n.codePointAt(0),e));return t}a(rce,"trailingHalfwidthWidth");function hx(r,e={}){if(typeof r!="string"||r.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:n=!1}=e,i=r;if(n||(i=nh(i)),i.length===0)return 0;let s=0,o={ambiguousAsWide:!t};for(let{segment:c}of Qae.segment(i)){if(tce(c))continue;if(Zae.test(c)){s+=2;continue}let l=ece(c).codePointAt(0);s+=px(l,o),s+=rce(c,o)}return s}a(hx,"stringWidth");function mx({stream:r=process.stdout}={}){return!!(r&&r.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}a(mx,"isInteractive");var ms=Se(require("node:process"),1);var nce=3,gx=class{static{a(this,"StdinDiscarder")}#e=0;start(){this.#e++,this.#e===1&&this.#n()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#r()}#n(){ms.default.platform==="win32"||!ms.default.stdin.isTTY||(ms.default.stdin.setRawMode(!0),ms.default.stdin.on("data",this.#t),ms.default.stdin.resume())}#r(){ms.default.stdin.isTTY&&(ms.default.stdin.off("data",this.#t),ms.default.stdin.pause(),ms.default.stdin.setRawMode(!1))}#t(e){e[0]===nce&&ms.default.emit("SIGINT")}},ice=new gx,yx=ice;var _x=class{static{a(this,"Ora")}#e=0;#n=!1;#r=0;#t=-1;#c=0;#_=0;#i;#u;#s;#l;#o;#h;#g;#d;#m;#y;#f;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#i={color:"cyan",stream:ih.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#i.color,this.spinner=this.#i.spinner,this.#o=this.#i.interval,this.#s=this.#i.stream,this.#h=typeof this.#i.isEnabled=="boolean"?this.#i.isEnabled:mx({stream:this.#s}),this.#g=typeof this.#i.isSilent=="boolean"?this.#i.isSilent:!1,this.text=this.#i.text,this.prefixText=this.#i.prefixText,this.suffixText=this.#i.suffixText,this.indent=this.#i.indent,ih.default.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#h,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(t){this.#e=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#t}}),Object.defineProperty(this,"_lineCount",{get(){return this.#r}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#S()}get interval(){return this.#o??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#t=-1,this.#o=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(t=>typeof t!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!rh())this.#u=th.line;else if(e===void 0)this.#u=th.dots;else if(e!=="default"&&th[e])this.#u=th[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#m}set text(e=""){this.#m=e,this.#S()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#S()}get suffixText(){return this.#f}set suffixText(e=""){this.#f=e,this.#S()}get isSpinning(){return this.#l!==void 0}#v(e,t,n=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?n?t+i:i+t:""}#T(e=this.#y,t=" "){return this.#v(e,t,!1)}#b(e=this.#f,t=" "){return this.#v(e,t,!0)}#E(e,t){let n=0;for(let i of nh(e).split(`
|
|
437
437
|
`))n+=Math.max(1,Math.ceil(hx(i)/t));return n}#S(){let e=this.#s.columns??80,t=typeof this.#y=="function"?"":this.#y,n=typeof this.#f=="function"?"":this.#f,i=typeof t=="string"&&t!==""?t+" ":"",s=typeof n=="string"&&n!==""?" "+n:"",c=" ".repeat(this.#d)+i+"-"+(typeof this.#m=="string"?" "+this.#m:"")+s;this.#r=this.#E(c,e)}get isEnabled(){return this.#h&&!this.#g}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#h=e}get isSilent(){return this.#g}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#g=e}frame(){let e=Date.now();(this.#t===-1||e-this.#c>=this.interval)&&(this.#t=++this.#t%this.#u.frames.length,this.#c=e);let{frames:t}=this.#u,n=t[this.#t];this.color&&(n=H9[this.color](n));let i=this.#T(this.#y," "),s=typeof this.text=="string"?" "+this.text:"",o=this.#b(this.#f," ");return i+n+s+o}clear(){if(!this.#h||!this.#s.isTTY)return this;this.#s.cursorTo(0);for(let e=0;e<this.#e;e++)e>0&&this.#s.moveCursor(0,-1),this.#s.clearLine(1);return(this.#d||this.#_!==this.#d)&&this.#s.cursorTo(this.#d),this.#_=this.#d,this.#e=0,this}render(){if(!this.#h||this.#g)return this;this.clear();let e=this.frame(),t=this.#s.columns??80,n=this.#E(e,t),i=this.#s.rows;if(i&&i>1&&n>i){let s=e.split(`
|
|
438
438
|
`),o=i-1;e=[...s.slice(0,o),"... (content truncated to fit terminal)"].join(`
|
|
439
439
|
`)}return this.#s.write(e),this.#e=this.#E(e,t),this}start(e){if(e&&(this.text=e),this.#g)return this;if(!this.#h){let t=" ".repeat(this.#d)+this.#T(this.#y," ")+(this.text?`- ${this.text}`:"")+this.#b(this.#f," ");return t.trim()!==""&&this.#s.write(t+`
|
|
@@ -516,7 +516,7 @@ Available prefixes: ${u}`,this.wellKnownPrefixes[n]&&c.push(`Add: PREFIX ${n}: <
|
|
|
516
516
|
\u{1F4CA} Execution Statistics:`),console.log(` Vault loading: ${y}ms${h?" (from cache)":""}`),console.log(` Query execution: ${$}ms`),console.log(` Total time: ${K}ms`),console.log(` Triples scanned: ${p.length}`),console.log(` Results returned: ${j.length}`),e.useCache&&console.log(` Triple cache: ${h?"HIT":"MISS (rebuilt)"}`),l&&console.log(" Query result cache: MISS (cached for next run)"))}}catch(s){f5(s,i,t)}finally{e.strict&&(n===void 0?delete process.env.EXOCORTEX_SPARQL_STRICT:process.env.EXOCORTEX_SPARQL_STRICT=n)}})}a(u5,"sparqlQueryCommand");function f5(r,e,t){let n=new M_;if(n.classifyError(r)!=="unknown"){let s=n.enhanceError(r,e);if(t==="json"){let o=ft.error("VALIDATION_INVALID_FORMAT",s.message,2,{context:{errorType:s.type,suggestions:s.suggestions,line:s.line,column:s.column,queryContext:s.context?{startLine:s.context.startLine,endLine:s.context.endLine,errorLine:s.context.errorLine}:void 0},recovery:{message:s.suggestions?.[0]||"Check query syntax"}});console.log(JSON.stringify(o,null,2)),process.exit(2)}else console.error(n.formatForText(s)),process.exit(2)}ve.handle(r)}a(f5,"handleSparqlError");function Ece(r){if(r.includes("SELECT")||r.includes("CONSTRUCT")||r.includes("INSERT")||r.includes("DELETE"))return r;let e=(0,Ax.resolve)(r);return(0,sh.existsSync)(e)?(0,sh.readFileSync)(e,"utf-8"):r}a(Ece,"loadQuery");async function vce(r,e,t){if(e.explain){let i=new L_,s=await i.analyze(r,{includeAlgebraPlan:!0,optimize:!e.noOptimize});if(t==="json"){let o=ft.success(s);console.log(JSON.stringify(o,null,2))}else s.valid?(console.log(`\u2705 Query syntax is valid
|
|
517
517
|
`),console.log(i.formatAnalysis(s,"text"))):(console.log(i.formatAnalysis(s,"text")),process.exit(2));return}let n=new or.ExoQLParser;try{let i=n.parse(r);if(i.type!=="update"){let o=new or.ExoQLAlgebraTranslator().translate(i);if(!e.noOptimize&&o.type!=="construct")o=new or.AlgebraOptimizer().optimize(o);else if(!e.noOptimize&&o.type==="construct"){let c=new or.AlgebraOptimizer,l=o;o={...l,where:c.optimize(l.where)}}}if(t==="json"){let s=ft.success({valid:!0,queryType:l5(i),message:"Query syntax is valid"});console.log(JSON.stringify(s,null,2))}else console.log("\u2705 Query syntax is valid"),console.log(` Query type: ${l5(i)}`)}catch(i){f5(i,r,t)}}a(vce,"executeDryRun");function l5(r){return r.type==="update"?"UPDATE":"queryType"in r?r.queryType:"UNKNOWN"}a(l5,"getQueryType");function Tce(r,e){switch(e){case"json":let t=new w_;console.log(t.format(r));break;case"csv":let n=new E_;console.log(n.format(r));break;case"table":default:let i=new of;console.log(i.format(r));break}}a(Tce,"formatSelectResults");function Ace(r,e){let t=new af;switch(e){case"json":console.log(t.formatJson(r));break;case"ntriples":console.log(t.formatNTriples(r));break;case"table":default:console.log(t.formatTable(r));break}}a(Ace,"formatConstructResults");function Ice(r,e){switch(e){case"json":console.log(JSON.stringify(r,null,2));break;case"csv":if(r.length===0){console.log("");return}let t=Object.keys(r[0]);console.log(t.join(","));for(let i of r){let s=t.map(o=>{let c=i[o];return c==null?"":String(c).includes(",")?`"${c}"`:String(c)});console.log(s.join(","))}break;case"table":default:if(r.length===0){console.log("No results.");return}let n=Object.keys(r[0]);console.log(n.join(" ")),console.log(n.map(()=>"---").join(" "));for(let i of r){let s=n.map(o=>String(i[o]??""));console.log(s.join(" "))}break}}a(Ice,"formatCachedSelectResults");function xce(r,e){switch(e){case"json":console.log(JSON.stringify(r,null,2));break;case"ntriples":for(let t of r)console.log(`<${t.subject}> <${t.predicate}> ${Rce(t.object)} .`);break;case"table":default:console.log("Subject Predicate Object"),console.log("--- --- ---");for(let t of r)console.log(`${t.subject} ${t.predicate} ${t.object}`);break}}a(xce,"formatCachedConstructResults");function Rce(r){return j_.formatObject(r)}a(Rce,"formatNTriplesObject");function Cce(r,e){for(let t of r){let n=[`${t.type.toUpperCase()}`];switch(t.inserted!==void 0&&n.push(`inserted: ${t.inserted}`),t.deleted!==void 0&&n.push(`deleted: ${t.deleted}`),n.push(t.success?"OK":"FAILED"),e){case"json":console.log(JSON.stringify(t,null,2));break;case"csv":r.indexOf(t)===0&&console.log("type,inserted,deleted,success"),console.log(`${t.type},${t.inserted??""},${t.deleted??""},${t.success}`);break;case"table":default:console.log(`\u2705 ${n.join(" | ")}`);break}}}a(Cce,"formatUpdateResults");var d5=require("fs"),p5=require("path"),Zs=Se(it());function h5(){return new Le("index").description("Build or refresh the triple cache for faster SPARQL queries").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--stats","Show cache statistics after building").option("--force","Force rebuild even if cache is valid").option("--strict","Fail on first invalid IRI instead of skipping").option("--no-inference","Disable RDFS subClassOf inference materialization").action(async r=>{let e=r.output||"text";ve.setFormat(e);try{let t=(0,p5.resolve)(r.vault);if(!(0,d5.existsSync)(t))throw new Je(t);let n=new Ti(t),i=n.getCachePath();r.force&&(e==="text"&&console.log("\u{1F5D1}\uFE0F Invalidating existing cache..."),await n.invalidate()),e==="text"&&console.log(`\u{1F4E6} Building triple cache for: ${t}...`);let s=Date.now(),o=await n.buildCacheWithValidation({strict:r.strict??!1}),c=0;if(r.inference!==!1){let{triples:u}=await n.loadOrBuild(),f=new Zs.InMemoryTripleStore;await f.addAll(u),c=await new Zs.RDFSInferenceEngine().materialize(f);let p=new Zs.NonInheritablePropertyRegistry;await p.initialize(f);let h=new Zs.PropertyCardinalityRegistry;await h.initialize(f);let y=await new Zs.PrototypeChainMaterializer(p,h).materialize(f);if(c+=y,c>0){let S=await f.match();await n.saveTriples(S),o.tripleCount+=c}e==="text"&&c>0&&console.log(`\u{1F9E0} Materialized ${c} inferred triples (RDFS + prototype chain)`)}let l=Date.now()-s;if(e==="json"){let u={action:"build",cachePath:i,tripleCount:o.tripleCount,durationMs:o.durationMs},f={summary:o.summary,skippedFiles:o.skippedFiles};if(r.stats){let d=await n.getCacheStats();if(d){let p={tripleCount:d.tripleCount,createdAt:d.createdAt.toISOString(),isValid:d.isValid,sizeBytes:d.sizeBytes,cachePath:i},h=ft.success({cache:u,stats:p,validation:f},{durationMs:l});console.log(JSON.stringify(h,null,2))}}else{let d=ft.success({cache:u,validation:f},{durationMs:l});console.log(JSON.stringify(d,null,2))}}else{if(o.skippedFiles.length>0){console.log(`
|
|
518
518
|
\u26A0\uFE0F Files skipped due to IRI issues:`);for(let u of o.skippedFiles)console.log(` - ${u.path}`),console.log(` ${u.reason}`);console.log("")}if(console.log(`\u2705 Indexed ${o.summary.indexed} files, skipped ${o.summary.skipped} (total: ${o.summary.total})`),console.log(`\u{1F4CA} Created cache with ${o.tripleCount.toLocaleString()} triples at ${i}`),console.log(`\u23F1\uFE0F Build time: ${o.durationMs}ms`),r.stats){let u=await n.getCacheStats();u&&(console.log(`
|
|
519
|
-
\u{1F4CA} Cache Statistics:`),console.log(` Triples: ${u.tripleCount.toLocaleString()}`),console.log(` Created: ${u.createdAt.toISOString()}`),console.log(` Valid: ${u.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${Oce(u.sizeBytes)}`))}}}catch(t){ve.handle(t)}})}a(h5,"sparqlIndexCommand");function Oce(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}a(Oce,"formatBytes");var V_=require("fs"),gs=require("path");function m5(){return new Le("resolve").description("Resolve UUID to file path").argument("<uuid>","Full or partial UUID to resolve").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: uri|path|json (default: uri)","uri").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--partial","Match partial UUIDs (returns all matches)").action(async(r,e)=>{let t=e.output||"text";ve.setFormat(t);try{let n=Date.now();if(!Pce(r))throw new ct(`Invalid UUID format: ${r}`,"exocortex resolve <uuid> [--format uri|path|json] [--partial]",{uuid:r});let i=(0,gs.resolve)(e.vault);if(!(0,V_.existsSync)(i))throw new Je(i);let s=Dce(i,r,e.partial??!1),o=Date.now()-n;if(s.length===0){if(t==="json"){let c=ft.error("VALIDATION_FILE_NOT_FOUND",`UUID not found: ${r}`,3,{context:{uuid:r}});console.log(JSON.stringify(c,null,2))}else console.error(`UUID not found: ${r}`);process.exit(1)}e.partial||s.length>1?Lce(s,i,e.format,t,r,o):Fce(s[0],i,e.format,t,r,o)}catch(n){ve.handle(n)}})}a(m5,"resolveCommand");function Pce(r){if(r.length<4)return!1;let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,t=/^[0-9a-f-]+$/i;return e.test(r)||t.test(r)}a(Pce,"isValidUuidFormat");function Dce(r,e,t){let n=[],i=e.toLowerCase();function s(o){let c=(0,V_.readdirSync)(o,{withFileTypes:!0});for(let l of c){let u=(0,gs.join)(o,l.name);if(l.isDirectory())!l.name.startsWith(".")&&l.name!=="node_modules"&&s(u);else if(l.isFile()&&l.name.endsWith(".md")){let f=l.name.toLowerCase();t?f.includes(i)&&n.push(u):(f.startsWith(i+".md")||f.startsWith(i+" ")||f.startsWith(i+"-"))&&n.push(u)}}}return a(s,"walk"),s(r),n}a(Dce,"findFilesWithUuid");function g5(r){return`obsidian://vault/${encodeURI(r)}`}a(g5,"pathToObsidianUri");function y5(r){let e=r.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);return e?e[1]:(0,gs.basename)(r,".md")}a(y5,"extractUuidFromFilename");function Fce(r,e,t,n,i,s){let o=(0,gs.relative)(e,r),c=g5(o),l=y5((0,gs.basename)(r));if(n==="json"){let u={uuid:l,path:o,absolutePath:r,uri:c},f=ft.success(u,{durationMs:s,searchUuid:i});console.log(JSON.stringify(f,null,2))}else switch(t){case"path":console.log(r);break;case"json":console.log(JSON.stringify({uuid:l,path:o,absolutePath:r,uri:c},null,2));break;case"uri":default:console.log(c);break}}a(Fce,"outputSingleResult");function Lce(r,e,t,n,i,s){let o=r.map(c=>{let l=(0,gs.relative)(e,c),u=g5(l);return{uuid:y5((0,gs.basename)(c)),path:l,absolutePath:c,uri:u}});if(n==="json"){let c=ft.success({matches:o,count:o.length},{durationMs:s,searchUuid:i,itemCount:o.length});console.log(JSON.stringify(c,null,2))}else switch(t){case"path":for(let c of o)console.log(c.absolutePath);break;case"json":console.log(JSON.stringify(o,null,2));break;case"uri":default:for(let c of o)console.log(c.uri);break}}a(Lce,"outputMultipleResults");var Ix=require("fs"),ys=require("path"),ar=Se(it());var _5=Se(it());function q_(r,e){return t=>{let n=typeof t.filePath=="string"&&t.filePath.length>0?t.filePath:null;if(n===null||n.split("/").includes("09 Templates"))return!1;let i=r.getAbstractFileByPath(n);if(i===null||!("basename"in i))return!1;let s=i,o=r.getFrontmatter(s)??{},c=e.getExpectedFolderSync(s,o),l=typeof t.currentFolder=="string"?t.currentFolder:s.parent?.path??"";return(0,_5.needsFolderRepair)(l,c)}}a(q_,"createIsInWrongFolderHostFunction");var b5=Se(it());function G_(r){return e=>{let t=typeof e.filePath=="string"&&e.filePath.length>0?e.filePath:null;if(t===null||t.split("/").includes("09 Templates"))return!1;let n=r.getAbstractFileByPath(t);if(n===null||!("basename"in n))return!1;let i=n,s=r.getFrontmatter(i)??{};return(0,b5.hasEmptyProperties)(s)}}a(G_,"createHasEmptyPropertiesHostFunction");var Nce=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function S5(r){if(typeof r!="string")return null;let e=r.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t!==-1&&(e=e.slice(0,t).trim()),e.length>0?e:null}a(S5,"cleanRef");function kce(r){if(!r)return[];let e=r.exo__Instance_class,t=[],n=a(i=>{let s=S5(i);s&&!t.includes(s)&&t.push(s)},"collect");if(typeof e=="string")n(e);else if(Array.isArray(e))for(let i of e)n(i);return t}a(kce,"extractClasses");function Mce(r){let e=r.match(/\/ontology\/([^#/]+)#(.+)$/);return e?`${e[1]}__${e[2]}`:null}a(Mce,"ontologyIriToSymbolic");async function jce(r,e){let t=await r.match(new ar.IRI(e),ar.Namespace.EXO.term("Instance_class"),void 0),n=[];for(let i of t){let s=typeof i.object.value=="string"?i.object.value:String(i.object),o=Mce(s);o&&!n.includes(o)&&n.push(o)}return n}a(jce,"deriveStoreSymbolicClasses");async function $ce(r){let e=new ar.IRI("https://exocortex.my/ontology/exocmd#Command_cliName"),t=await r.match(void 0,e,void 0),n=new Map;for(let i of t){let s=typeof i.subject.value=="string"?i.subject.value:String(i.subject),o=typeof i.object.value=="string"?i.object.value:String(i.object),c=s.match(Nce);c&&o.length>0&&n.set(c[1],o)}return n}a($ce,"buildCliNameMap");async function Uce(r,e,t=(0,ar.liveClock)()){let n=(0,ys.resolve)(r);if(!(0,Ix.existsSync)(n))throw new Je(n);let i=(0,ys.resolve)(n,e);if(!(0,Ix.existsSync)(i))throw new Error(`Target file not found: ${e}`);let s=(0,ys.relative)(n,i);if(s===".."||s.startsWith(`..${ys.sep}`)||(0,ys.isAbsolute)(s))throw new Error(`Target is outside the vault: ${e} (vault: ${n})`);let o=new $t(n),l=await new ar.NoteToRDFConverter(o).convertVault(),u=new ar.InMemoryTripleStore;await u.addAll(l);let f=(0,ar.vaultPathToIRI)(s),d=o.getAbstractFileByPath(s),p=d!==null&&"basename"in d?d:null,h=p?o.getFrontmatter(p):null,_=kce(h),y=await jce(u,f),S=[...new Set([..._,...y])],w=S5(h?.exo__Asset_prototype),T=h?.exo__Asset_uid,O=typeof T=="string"?T:void 0,x=await new ar.CommandResolver(u).resolveForAssetMulti(f,S,w??void 0),P=new ar.FolderRepairService(o),V=new ar.PreconditionEvaluator(u,void 0,{clock:t});(0,ar.registerDefaultHostFunctions)(V),V.registerHostFunction("isInWrongFolder",q_(o,P)),V.registerHostFunction("hasObsoleteProperties",G_(o));let j=(0,ys.dirname)(s),$={targetIRI:f,filePath:s,fileBasename:p?.basename,currentFolder:j==="."?"":j,assetUid:O},K=await $ce(u),N=await Promise.all(x.map(async pe=>{let Y;try{Y=await V.evaluate(pe.command.precondition,f,$)}catch{Y=!1}return{rc:pe,available:Y}})),ae=a(pe=>({id:pe.command.id,label:pe.command.name,cliName:K.get(pe.command.id)??null,category:pe.command.category??null}),"toEntry"),we=N.filter(pe=>pe.available).map(pe=>ae(pe.rc)),
|
|
519
|
+
\u{1F4CA} Cache Statistics:`),console.log(` Triples: ${u.tripleCount.toLocaleString()}`),console.log(` Created: ${u.createdAt.toISOString()}`),console.log(` Valid: ${u.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${Oce(u.sizeBytes)}`))}}}catch(t){ve.handle(t)}})}a(h5,"sparqlIndexCommand");function Oce(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}a(Oce,"formatBytes");var V_=require("fs"),gs=require("path");function m5(){return new Le("resolve").description("Resolve UUID to file path").argument("<uuid>","Full or partial UUID to resolve").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: uri|path|json (default: uri)","uri").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--partial","Match partial UUIDs (returns all matches)").action(async(r,e)=>{let t=e.output||"text";ve.setFormat(t);try{let n=Date.now();if(!Pce(r))throw new ct(`Invalid UUID format: ${r}`,"exocortex resolve <uuid> [--format uri|path|json] [--partial]",{uuid:r});let i=(0,gs.resolve)(e.vault);if(!(0,V_.existsSync)(i))throw new Je(i);let s=Dce(i,r,e.partial??!1),o=Date.now()-n;if(s.length===0){if(t==="json"){let c=ft.error("VALIDATION_FILE_NOT_FOUND",`UUID not found: ${r}`,3,{context:{uuid:r}});console.log(JSON.stringify(c,null,2))}else console.error(`UUID not found: ${r}`);process.exit(1)}e.partial||s.length>1?Lce(s,i,e.format,t,r,o):Fce(s[0],i,e.format,t,r,o)}catch(n){ve.handle(n)}})}a(m5,"resolveCommand");function Pce(r){if(r.length<4)return!1;let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,t=/^[0-9a-f-]+$/i;return e.test(r)||t.test(r)}a(Pce,"isValidUuidFormat");function Dce(r,e,t){let n=[],i=e.toLowerCase();function s(o){let c=(0,V_.readdirSync)(o,{withFileTypes:!0});for(let l of c){let u=(0,gs.join)(o,l.name);if(l.isDirectory())!l.name.startsWith(".")&&l.name!=="node_modules"&&s(u);else if(l.isFile()&&l.name.endsWith(".md")){let f=l.name.toLowerCase();t?f.includes(i)&&n.push(u):(f.startsWith(i+".md")||f.startsWith(i+" ")||f.startsWith(i+"-"))&&n.push(u)}}}return a(s,"walk"),s(r),n}a(Dce,"findFilesWithUuid");function g5(r){return`obsidian://vault/${encodeURI(r)}`}a(g5,"pathToObsidianUri");function y5(r){let e=r.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);return e?e[1]:(0,gs.basename)(r,".md")}a(y5,"extractUuidFromFilename");function Fce(r,e,t,n,i,s){let o=(0,gs.relative)(e,r),c=g5(o),l=y5((0,gs.basename)(r));if(n==="json"){let u={uuid:l,path:o,absolutePath:r,uri:c},f=ft.success(u,{durationMs:s,searchUuid:i});console.log(JSON.stringify(f,null,2))}else switch(t){case"path":console.log(r);break;case"json":console.log(JSON.stringify({uuid:l,path:o,absolutePath:r,uri:c},null,2));break;case"uri":default:console.log(c);break}}a(Fce,"outputSingleResult");function Lce(r,e,t,n,i,s){let o=r.map(c=>{let l=(0,gs.relative)(e,c),u=g5(l);return{uuid:y5((0,gs.basename)(c)),path:l,absolutePath:c,uri:u}});if(n==="json"){let c=ft.success({matches:o,count:o.length},{durationMs:s,searchUuid:i,itemCount:o.length});console.log(JSON.stringify(c,null,2))}else switch(t){case"path":for(let c of o)console.log(c.absolutePath);break;case"json":console.log(JSON.stringify(o,null,2));break;case"uri":default:for(let c of o)console.log(c.uri);break}}a(Lce,"outputMultipleResults");var Ix=require("fs"),ys=require("path"),ar=Se(it());var _5=Se(it());function q_(r,e){return t=>{let n=typeof t.filePath=="string"&&t.filePath.length>0?t.filePath:null;if(n===null||n.split("/").includes("09 Templates"))return!1;let i=r.getAbstractFileByPath(n);if(i===null||!("basename"in i))return!1;let s=i,o=r.getFrontmatter(s)??{},c=e.getExpectedFolderSync(s,o),l=typeof t.currentFolder=="string"?t.currentFolder:s.parent?.path??"";return(0,_5.needsFolderRepair)(l,c)}}a(q_,"createIsInWrongFolderHostFunction");var b5=Se(it());function G_(r){return e=>{let t=typeof e.filePath=="string"&&e.filePath.length>0?e.filePath:null;if(t===null||t.split("/").includes("09 Templates"))return!1;let n=r.getAbstractFileByPath(t);if(n===null||!("basename"in n))return!1;let i=n,s=r.getFrontmatter(i)??{};return(0,b5.hasEmptyProperties)(s)}}a(G_,"createHasEmptyPropertiesHostFunction");var Nce=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function S5(r){if(typeof r!="string")return null;let e=r.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t!==-1&&(e=e.slice(0,t).trim()),e.length>0?e:null}a(S5,"cleanRef");function kce(r){if(!r)return[];let e=r.exo__Instance_class,t=[],n=a(i=>{let s=S5(i);s&&!t.includes(s)&&t.push(s)},"collect");if(typeof e=="string")n(e);else if(Array.isArray(e))for(let i of e)n(i);return t}a(kce,"extractClasses");function Mce(r){let e=r.match(/\/ontology\/([^#/]+)#(.+)$/);return e?`${e[1]}__${e[2]}`:null}a(Mce,"ontologyIriToSymbolic");async function jce(r,e){let t=await r.match(new ar.IRI(e),ar.Namespace.EXO.term("Instance_class"),void 0),n=[];for(let i of t){let s=typeof i.object.value=="string"?i.object.value:String(i.object),o=Mce(s);o&&!n.includes(o)&&n.push(o)}return n}a(jce,"deriveStoreSymbolicClasses");async function $ce(r){let e=new ar.IRI("https://exocortex.my/ontology/exocmd#Command_cliName"),t=await r.match(void 0,e,void 0),n=new Map;for(let i of t){let s=typeof i.subject.value=="string"?i.subject.value:String(i.subject),o=typeof i.object.value=="string"?i.object.value:String(i.object),c=s.match(Nce);c&&o.length>0&&n.set(c[1],o)}return n}a($ce,"buildCliNameMap");async function Uce(r,e,t=(0,ar.liveClock)()){let n=(0,ys.resolve)(r);if(!(0,Ix.existsSync)(n))throw new Je(n);let i=(0,ys.resolve)(n,e);if(!(0,Ix.existsSync)(i))throw new Error(`Target file not found: ${e}`);let s=(0,ys.relative)(n,i);if(s===".."||s.startsWith(`..${ys.sep}`)||(0,ys.isAbsolute)(s))throw new Error(`Target is outside the vault: ${e} (vault: ${n})`);let o=new $t(n),l=await new ar.NoteToRDFConverter(o).convertVault(),u=new ar.InMemoryTripleStore;await u.addAll(l);let f=(0,ar.vaultPathToIRI)(s),d=o.getAbstractFileByPath(s),p=d!==null&&"basename"in d?d:null,h=p?o.getFrontmatter(p):null,_=kce(h),y=await jce(u,f),S=[...new Set([..._,...y])],w=S5(h?.exo__Asset_prototype),T=h?.exo__Asset_uid,O=typeof T=="string"?T:void 0,x=await new ar.CommandResolver(u).resolveForAssetMulti(f,S,w??void 0),P=new ar.FolderRepairService(o),V=new ar.PreconditionEvaluator(u,void 0,{clock:t});(0,ar.registerDefaultHostFunctions)(V),V.registerHostFunction("isInWrongFolder",q_(o,P)),V.registerHostFunction("hasObsoleteProperties",G_(o));let j=(0,ys.dirname)(s),$={targetIRI:f,filePath:s,fileBasename:p?.basename,currentFolder:j==="."?"":j,assetUid:O},K=await $ce(u),N=await Promise.all(x.map(async pe=>{let Y;try{Y=await V.evaluate(pe.command.precondition,f,$)}catch{Y=!1}return{rc:pe,available:Y}})),ae=a(pe=>({id:pe.command.id,label:pe.command.name,cliName:K.get(pe.command.id)??null,category:pe.command.category??null}),"toEntry"),we=N.filter(pe=>pe.available).map(pe=>ae(pe.rc)),ee=N.filter(pe=>!pe.available).map(pe=>({...ae(pe.rc),reason:"precondition-false"}));return{target:s,classes:S,prototype:w,visible:we,hidden:ee}}a(Uce,"resolveButtons");function Bce(r,e){let t=a(n=>`${n.label}${n.cliName?` (${n.cliName})`:""}`,"fmt");if(console.log(`Command buttons on "${r.target}" (${r.visible.length} visible):`),r.visible.length===0)console.log(" (none)");else for(let n of r.visible)console.log(` \u2713 ${t(n)}`);if(e)if(console.log(`
|
|
520
520
|
Hidden by precondition (${r.hidden.length}):`),r.hidden.length===0)console.log(" (none)");else for(let n of r.hidden)console.log(` \u2717 ${t(n)} \u2014 precondition not satisfied`)}a(Bce,"printHuman");function w5(){return new Le("resolve-inline-buttons").alias("resolve-buttons").description("Print the actual command button-set for an asset \u2014 binding-match \u2229 precondition-eval (Issue #3833). The authoritative button-visibility oracle; strictly more complete than `apply --dry-run` (precondition-only).").argument("<target>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--json","Emit structured JSON instead of human-readable text").option("--show-hidden","Also list commands that bind but are hidden by their precondition").action(async(r,e)=>{ve.setFormat(e.json?"json":"text");try{let t=await Uce(e.vault,r);if(e.json){let n=e.showHidden?t:{...t,hidden:[]};console.log(JSON.stringify(n,null,2))}else Bce(t,e.showHidden??!1)}catch(t){ve.handle(t),process.exit(5)}})}a(w5,"resolveButtonsCommand");var eo=require("fs"),Zo=require("path"),E5=require("child_process");var ut=Se(it());var Vce=new Set(["aliases","archived","tags","cssclasses","publish","permalink","description","image","cover","banner","title","share","share_link","share_updated","metadata","uri"]),Rx=new Map([["exo__","https://exocortex.my/ontology/exo#"],["ems__","https://exocortex.my/ontology/ems#"],["exocmd__","https://exocortex.my/ontology/exocmd#"],["ims__","https://exocortex.my/ontology/ims#"],["exoql__","https://exocortex.my/ontology/exoql#"],["query__","https://exocortex.my/ontology/query#"],["ztlk__","https://exocortex.my/ontology/ztlk#"],["ptms__","https://exocortex.my/ontology/ptms#"],["lit__","https://exocortex.my/ontology/lit#"],["inbox__","https://exocortex.my/ontology/inbox#"],["place__","https://exocortex.my/ontology/place#"],["pn__","https://exocortex.my/ontology/pn#"],["period__","https://exocortex.my/ontology/period#"],["rdf__","http://www.w3.org/1999/02/22-rdf-syntax-ns#"],["rdfs__","http://www.w3.org/2000/01/rdf-schema#"],["owl__","http://www.w3.org/2002/07/owl#"]]);function qce(r,e){if(!r)return!1;let t=r.exo__Instance_class;if(t==null)return!1;let n=Array.isArray(t)?t:[t];for(let i of n){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/),o=s?s[1]:i;if(o===e||o.includes(e))return!0}return!1}a(qce,"frontmatterMatchesClass");async function v5(r,e){let t,n=!1;if(e){let s=await new Ti(r).loadOrBuild();t=s.triples,n=s.cacheHit}else{let i=new $t(r);t=await new ut.NoteToRDFConverter(i).convertVault()}return{triples:t,cacheHit:n}}a(v5,"loadTriplesFromAllVaults");var Gce="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function T5(r){let e=r.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return r.match(/^---\r?\n---/)?{}:null;let t=e[1].split(`
|
|
521
521
|
`),n={};for(let i of t){let s=i.match(/^(\w[\w]*):\s*(.*)$/);s&&(n[s[1]]=!0)}return n}a(T5,"extractFrontmatter");function A5(r){for(let e of Rx.keys())if(r.startsWith(e))return!0;return!1}a(A5,"hasKnownPrefix");function I5(r){for(let[e,t]of Rx)if(r.startsWith(e))return t+r.substring(e.length);return null}a(I5,"keyToURI");function Wce(r){let e=[],t=[];for(let n of r)Vce.has(n)||(A5(n)?e.push(n):t.push(n));return{toValidate:e,unknownPrefix:t}}a(Wce,"classifyKeys");function x5(r){try{return(0,E5.execSync)("git diff --cached --name-only",{cwd:r,encoding:"utf-8"}).split(`
|
|
522
522
|
`).filter(t=>t.endsWith(".md")&&t.trim().length>0)}catch{return[]}}a(x5,"getStagedMdFiles");function Hce(r){let e=[];function t(n){let i=(0,eo.readdirSync)(n);for(let s of i){if(s.startsWith(".")||s==="node_modules")continue;let o=(0,Zo.join)(n,s);(0,eo.statSync)(o).isDirectory()?t(o):s.endsWith(".md")&&e.push((0,Zo.relative)(r,o))}}return a(t,"walk"),t(r),e}a(Hce,"collectMdFiles");function zce(r){let e=r.lastIndexOf("/");if(e===-1)return null;let t=decodeURIComponent(r.substring(e+1));return t.endsWith(".md")&&(t=t.slice(0,-3)),A5(t)?t:null}a(zce,"extractPropertyNameFromURI");async function Kce(r){let e=new ut.InMemoryTripleStore;await e.addAll(r);let t=new ut.ExoQLParser,n=df(`SELECT ?s ?label WHERE {
|
|
@@ -567,31 +567,31 @@ ${y}
|
|
|
567
567
|
`,o=n.split(/\r?\n/),c=[];for(let _ of o){let y=Nle.exec(_);y?c.push({key:y[1],lines:[_]}):c.length>0?c[c.length-1].lines.push(_):c.push({key:null,lines:[_]})}let l=new Map,u=new Map;c.forEach((_,y)=>{_.key!==null&&(l.set(_.key,(l.get(_.key)??0)+1),u.set(_.key,y))});let f=new Map,d=c.filter((_,y)=>_.key===null||(l.get(_.key)??0)<=1||y===u.get(_.key)?!0:(f.set(_.key,(f.get(_.key)??0)+1),!1));if(f.size===0)return{changed:!1,content:r,removed:[]};let p=d.map(_=>_.lines.join(s)).join(s);return{changed:!0,content:`${t}${p}${i}`+r.slice(e[0].length),removed:[...f.entries()].map(([_,y])=>({key:_,removedOccurrences:y}))}}a(kle,"dedupeFrontmatterKeys");function i$(){return new Le("repair-frontmatter").description("Remove duplicated top-level YAML frontmatter keys (keep-last) \u2014 the dogfood-clean repair for the invisible/unrepairable duplicate-key class (#3800). Operates on raw text, so it fixes a file the parser itself cannot read.").argument("<path>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--dry-run","Preview the dedupe diff without writing").option("--yes","Accepted for symmetry with the apply/create subcommands (repair-frontmatter is non-interactive; no-op)").action(async(r,e)=>{try{let t=(0,ta.resolve)(e.vault);if(!(0,Sf.existsSync)(t))throw new Je(t);let n=(0,ta.resolve)(t,r),i=(0,ta.relative)(t,n);if(i===".."||i.startsWith(`..${ta.sep}`)||(0,ta.isAbsolute)(i))throw new Error(`Target is outside the vault: ${r} (vault: ${t})`);let s;try{s=(0,Sf.readFileSync)(n,"utf-8")}catch(c){throw c.code==="ENOENT"?new Error(`Target file not found: ${r}`):c}let o=kle(s);if(!o.changed){process.stdout.write(JSON.stringify({path:i,changed:!1,dryRun:!!e.dryRun,removed:[]})+`
|
|
568
568
|
`);return}e.dryRun||(0,Sf.writeFileSync)(n,o.content,"utf-8"),process.stdout.write(JSON.stringify({path:i,changed:!0,dryRun:!!e.dryRun,removed:o.removed})+`
|
|
569
569
|
`)}catch(t){ve.handle(t)}})}a(i$,"repairFrontmatterCommand");var s$=require("fs"),o$=require("path"),Ri=Se(it());var Mle="https://exocortex.my/ontology/find#Alias_sparql",jle="https://exocortex.my/ontology/exo#Asset_label";function wf(r){if(r&&typeof r=="object"&&"value"in r){let e=r.value;return typeof e=="string"?e:String(e)}return String(r)}a(wf,"nodeValue");async function $le(r,e){let t=await r.match(void 0,void 0,void 0),n=[];for(let s of t)wf(s.predicate)!==jle||wf(s.object)!==e||n.push(wf(s.subject));if(n.length===0)return null;let i=[];for(let s of n)for(let o of t)wf(o.predicate)===Mle&&wf(o.subject)===s&&i.push(wf(o.object));if(i.length===0)return null;if(i.length>1)throw new ct(`Ambiguous find__Alias "${e}" \u2014 ${i.length} instances define a sparql fragment`,`Ensure exactly one find__Alias asset has exo:Asset_label "${e}"`);return i[0]}a($le,"resolveAliasFragment");var Ule=/^([a-z][a-zA-Z0-9]*)__([A-Za-z0-9_]+)$/,Ble="https://exocortex.my/ontology/";function Vle(r,e){let t=Ule.exec(e);if(t){let i=`<${Ble}${t[1]}#${t[2]}>`;return r.replace(/\?value\b/g,i)}let n=e.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return r.replace(/\?value\b/g,`"${n}"`)}a(Vle,"bindValueLiteral");function a$(){return new Le("find").description("Find vault assets via SPARQL \u2014 outputs file paths one per line (RFC 8e83442b T1.1)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--sparql <query>","SPARQL SELECT query (must bind ?path)").option("--class <value>","Filter by class label via find__Alias 'class' (e.g. ems__Task)").action(async r=>{ve.setFormat("text");try{if(r.sparql&&r.class)throw new ct("--sparql and --class are mutually exclusive","Pass either a raw --sparql query or a find__Alias-backed flag like --class");if(!r.sparql&&!r.class)throw new ct("one of --sparql <query> or --class <value> is required",'exocortex find --class ems__Task OR exocortex find --sparql "SELECT ?path WHERE { ... }"');let e=(0,o$.resolve)(r.vault);if(!(0,s$.existsSync)(e))throw new Je(e);let t=new $t(e),i=await new Ri.NoteToRDFConverter(t).convertVault(),s=new Ri.InMemoryTripleStore;await s.addAll(i);let o;if(r.class){let S=await $le(s,"class");if(S===null)throw new ct('No find__Alias with exo:Asset_label "class" was found in the vault',"Seed a find__Alias asset (label=class) or fall back to exocortex find --sparql");o=`SELECT ?path WHERE { ${Vle(S,r.class)} }`}else o=r.sparql;let c=U_(o);c=df(c);let l=new Ri.ExoQLParser,u=B_($_(e));u.size>0&&l.setVaultPrefixes(u);let f=l.parse(c),p=new Ri.ExoQLAlgebraTranslator().translate(f);p.type!=="construct"&&(p=new Ri.AlgebraOptimizer().optimize(p));let _=await new Ri.ExoQLQueryExecutor(s).executeAll(p),y="obsidian://vault/";for(let S of _){let T=S.toJSON().path;if(typeof T!="string"||!T.startsWith(y))continue;let O=T.slice(y.length),A;try{A=decodeURIComponent(O)}catch{A=O}process.stdout.write(A+`
|
|
570
|
-
`)}}catch(e){ve.handle(e),process.exit(5)}})}a(a$,"findCommand");var Ux=require("fs"),ia=require("path"),qe=Se(it());var h$=Se(it()),Ft=Se(f$());var d$="obsidian://vault/";function uue(r){let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return{async resolveTargetPath(t){if(!t)throw new Error("Cannot resolve empty targetIRI to a vault path");let n=t;if(n.startsWith(d$))n=decodeURI(n.slice(d$.length));else if(e.test(n)){let i=await r.findFileByUID(n);if(!i)throw new Error(`No vault file found for UID: ${n}`);n=i}if(n.endsWith(".md")||(n=`${n}.md`),!await r.fileExists(n))throw new Error(`Cannot resolve target file for IRI "${t}" (tried "${n}")`);return n}}}a(uue,"createCliPathResolver");var fue=["openFile","sparqlSelect","getActiveFileIRI","getActiveFilePath","trashFile","duplicateFile"],$x=class extends Error{constructor(t){super(`Service "${t}" is not implemented in the CLI (no-op stub). dyncommand exec on this service_call grounding cannot change vault state. See CLI parity issues #2865-#2868 for port status.`);this.serviceId=t;this.name="CliServiceNotImplementedError"}static{a(this,"CliServiceNotImplementedError")}};function p$(r){return{async execute(){throw new $x(r)}}}a(p$,"notImplementedService");function due(r){return e=>{let t=r.getFirstLinkpathDest(e,"");if(!t||!("basename"in t))return null;let i=r.getFrontmatter(t)?.exo__Asset_label;return typeof i=="string"&&i.length>0?i:null}}a(due,"createCliClassResolver");function m$(r,e){for(let t of fue)r.register(t,p$(t));for(let t of["updateProperty","removeProperty","setStatus","createAsset"])r.register(t,p$(t));if(e){if(e.fsAdapter){let t=new h$.FrontmatterService,n=uue(e.fsAdapter);r.register("updateProperty",(0,Ft.createUpdatePropertyService)(e.fsAdapter,t,n)),r.register("removeProperty",(0,Ft.createRemovePropertyService)(e.fsAdapter,t,n)),r.register("setStatus",(0,Ft.createSetStatusService)(e.fsAdapter,t,n)),r.register("createAsset",(0,Ft.createCreateAssetService)(e.vaultAdapter,e.fsAdapter,due(e.vaultAdapter))),r.register("instantiatePrototypeSubtree",(0,Ft.createInstantiatePrototypeSubtreeService)(e.vaultAdapter,e.fsAdapter))}r.register("createRelatedTask",(0,Ft.createCreateRelatedTaskService)(e.vaultAdapter,e.genericAssetCreationService)),r.register("createRelatedProject",(0,Ft.createCreateRelatedProjectService)(e.vaultAdapter,e.genericAssetCreationService)),r.register("archiveAsset",(0,Ft.createArchiveAssetService)(e.vaultAdapter,e.archiveAssetService)),r.register("planForEvening",(0,Ft.createPlanForEveningService)(e.vaultAdapter,e.taskStatusService)),r.register("cleanProperties",(0,Ft.createCleanPropertiesService)(e.vaultAdapter,e.propertyCleanupService)),r.register("renameToUid",(0,Ft.createRenameToUidService)(e.vaultAdapter,e.renameToUidService)),r.register("repairFolder",(0,Ft.createRepairFolderService)(e.vaultAdapter,e.folderRepairService)),r.register("fixMissingLabel",(0,Ft.createFixMissingLabelService)(e.vaultAdapter,e.fixMissingLabelService))}}a(m$,"populateCliServiceRegistry");var
|
|
571
|
-
`).map(t=>t.trim()).filter(t=>t.length>0)}a(
|
|
570
|
+
`)}}catch(e){ve.handle(e),process.exit(5)}})}a(a$,"findCommand");var Ux=require("fs"),ia=require("path"),qe=Se(it());var h$=Se(it()),Ft=Se(f$());var d$="obsidian://vault/";function uue(r){let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return{async resolveTargetPath(t){if(!t)throw new Error("Cannot resolve empty targetIRI to a vault path");let n=t;if(n.startsWith(d$))n=decodeURI(n.slice(d$.length));else if(e.test(n)){let i=await r.findFileByUID(n);if(!i)throw new Error(`No vault file found for UID: ${n}`);n=i}if(n.endsWith(".md")||(n=`${n}.md`),!await r.fileExists(n))throw new Error(`Cannot resolve target file for IRI "${t}" (tried "${n}")`);return n}}}a(uue,"createCliPathResolver");var fue=["openFile","sparqlSelect","getActiveFileIRI","getActiveFilePath","trashFile","duplicateFile"],$x=class extends Error{constructor(t){super(`Service "${t}" is not implemented in the CLI (no-op stub). dyncommand exec on this service_call grounding cannot change vault state. See CLI parity issues #2865-#2868 for port status.`);this.serviceId=t;this.name="CliServiceNotImplementedError"}static{a(this,"CliServiceNotImplementedError")}};function p$(r){return{async execute(){throw new $x(r)}}}a(p$,"notImplementedService");function due(r){return e=>{let t=r.getFirstLinkpathDest(e,"");if(!t||!("basename"in t))return null;let i=r.getFrontmatter(t)?.exo__Asset_label;return typeof i=="string"&&i.length>0?i:null}}a(due,"createCliClassResolver");function m$(r,e){for(let t of fue)r.register(t,p$(t));for(let t of["updateProperty","removeProperty","setStatus","createAsset"])r.register(t,p$(t));if(e){if(e.fsAdapter){let t=new h$.FrontmatterService,n=uue(e.fsAdapter);r.register("updateProperty",(0,Ft.createUpdatePropertyService)(e.fsAdapter,t,n)),r.register("removeProperty",(0,Ft.createRemovePropertyService)(e.fsAdapter,t,n)),r.register("setStatus",(0,Ft.createSetStatusService)(e.fsAdapter,t,n)),r.register("createAsset",(0,Ft.createCreateAssetService)(e.vaultAdapter,e.fsAdapter,due(e.vaultAdapter))),r.register("instantiatePrototypeSubtree",(0,Ft.createInstantiatePrototypeSubtreeService)(e.vaultAdapter,e.fsAdapter))}r.register("createRelatedTask",(0,Ft.createCreateRelatedTaskService)(e.vaultAdapter,e.genericAssetCreationService)),r.register("createRelatedProject",(0,Ft.createCreateRelatedProjectService)(e.vaultAdapter,e.genericAssetCreationService)),r.register("archiveAsset",(0,Ft.createArchiveAssetService)(e.vaultAdapter,e.archiveAssetService)),r.register("planForEvening",(0,Ft.createPlanForEveningService)(e.vaultAdapter,e.taskStatusService)),r.register("cleanProperties",(0,Ft.createCleanPropertiesService)(e.vaultAdapter,e.propertyCleanupService)),r.register("renameToUid",(0,Ft.createRenameToUidService)(e.vaultAdapter,e.renameToUidService)),r.register("repairFolder",(0,Ft.createRepairFolderService)(e.vaultAdapter,e.folderRepairService)),r.register("fixMissingLabel",(0,Ft.createFixMissingLabelService)(e.vaultAdapter,e.fixMissingLabelService))}}a(m$,"populateCliServiceRegistry");function pue(r,e){let t=r.getAbstractFileByPath(e),n=t!==null&&"basename"in t?t:null,i=n?r.getFrontmatter(n):null,s=i&&typeof i=="object"?i.exo__Asset_label:void 0;return{uuid:n?.basename??e.replace(/^.*\//,"").replace(/\.md$/,""),path:e,label:typeof s=="string"?s:""}}a(pue,"buildCreatedAsset");var hue=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function mue(){if(process.stdin.isTTY)return[];let r=[];for await(let t of process.stdin)r.push(t);return Buffer.concat(r).toString("utf-8").split(`
|
|
571
|
+
`).map(t=>t.trim()).filter(t=>t.length>0)}a(mue,"readStdinLines");function tb(r){if(r&&typeof r=="object"&&"value"in r){let e=r.value;return typeof e=="string"?e:String(e)}return String(r)}a(tb,"nodeValue");async function gue(r,e){let t=new qe.IRI("https://exocortex.my/ontology/exocmd#Command_cliName"),n=await r.match(void 0,t,void 0),i=[];for(let s of n)if(tb(s.object)===e){let l=tb(s.subject).match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i);l&&i.push(l[1])}if(i.length===0)return null;if(i.length>1)throw new ct(`Ambiguous cliName "${e}" \u2014 resolves to ${i.length} commands: ${i.join(", ")}`,"Use the UUID directly: exocortex apply <uuid> <path>");return i[0]}a(gue,"resolveSlugToUuid");async function yue(r,e){let t=new qe.IRI("https://exocortex.my/ontology/exocmd#Command_destructive"),n=await r.match(void 0,t,void 0);for(let i of n)if(tb(i.subject).includes(e)){let o=tb(i.object);if(o==="true"||o==="True")return!0}return!1}a(yue,"isDestructive");async function _ue(r,e,t,n,i,s,o,c){let l={ok:!1,created:[]},u=(0,ia.resolve)(r,i);if(!(0,Ux.existsSync)(u))return console.error(`\u274C Target file not found: ${i}`),l;let f=(0,ia.relative)(r,u);if(f===".."||f.startsWith(`..${ia.sep}`)||(0,ia.isAbsolute)(f))return console.error(`\u274C Target is outside the vault: ${i} (vault: ${r})`),l;let d=new qe.CommandResolver(e),p=await d.loadCommand(n);if(!p)return console.error(`\u274C Command with UID "${n}" not found.`),l;if(await yue(e,n)&&!s.dryRun&&!s.yes)return console.error(`\u274C Command "${p.name}" is marked destructive. Add --dry-run to preview, or --yes to apply.`),l;let _=(0,qe.vaultPathToIRI)(f),y=new $t(r),S=new qe.FolderRepairService(y),w=new qe.PreconditionEvaluator(e,void 0,{clock:o});(0,qe.registerDefaultHostFunctions)(w),w.registerHostFunction("isInWrongFolder",q_(y,S)),w.registerHostFunction("hasObsoleteProperties",G_(y));let T=y.getAbstractFileByPath(f),O=T!==null&&"basename"in T?T:null,A=O?y.getFrontmatter(O):null,x=A&&typeof A=="object"?A.exo__Asset_uid:void 0,P={targetIRI:_,filePath:f,fileBasename:O?.basename,assetUid:typeof x=="string"?x:void 0};if(!await w.evaluate(p.precondition,_,P))return console.error(`\u274C Precondition not satisfied for "${p.name}" on "${f}".`),l;if(s.dryRun)return s.json||console.log(`\u{1F50D} Dry-run: would apply "${p.name}" to "${f}" (precondition passed).`),{ok:!0,created:[]};let j=new qe.ServiceRegistry,$=new qe.GenericAssetCreationService(y).withDeterminism({clock:o,uidGenerator:c}),K=new qe.ArchiveAssetService(y),N=new qe.PropertyCleanupService(y),ae=new qe.FixMissingLabelService(y),we=new qe.RenameToUidService(y),ee=new qe.TaskStatusService(y,new qe.EffortStatusWorkflow,new qe.StatusTimestampService(y)),pe=new pi(r);m$(j,{vaultAdapter:y,fsAdapter:pe,genericAssetCreationService:$,archiveAssetService:K,taskStatusService:ee,propertyCleanupService:N,fixMissingLabelService:ae,renameToUidService:we,folderRepairService:S});let Y=new qe.NamedQueryRunner(new pf(e,pe),e),Ee=new qe.GroundingExecutor(pe,pe,j,(0,qe.createVaultFrontmatterClassLabelResolver)(pe),{clock:o,uidGenerator:c,workflowResolver:t,groundingLoader:a(de=>d.loadGroundingByUid(de),"groundingLoader"),templateLoader:a(async de=>{let ye=await pe.findFileByUID(de);return ye?(0,qe.stripTemplateFrontmatter)(await pe.readFile(ye)):null},"templateLoader"),namedQueryRunner:Y,refToFolder:(0,qe.createVaultFrontmatterRefToFolderResolver)(pe)}),ie;if(s.input)try{let de=JSON.parse(s.input);if(typeof de!="object"||de===null||Array.isArray(de))throw new Error("must be a JSON object");ie=de}catch(de){let ye=de instanceof Error?de.message:String(de);return console.error(`\u274C --input: invalid JSON object (${ye})`),l}let ne=await Ee.execute(p.grounding,_,f,ie);if(ne.success){let de=[];ne.openPath&&de.push(ne.openPath),ne.createdPaths&&de.push(...ne.createdPaths);let ye=[],te=new Set;for(let me of de)te.has(me)||(te.add(me),ye.push(pue(y,me)));if(!s.json){let me=p.successMessage??`Applied "${p.name}" to "${f}".`,Pe=ne.openPath??ne.createdPaths?.[0],se=Pe?` \u2192 ${Pe}`:"";console.log(`\u2705 ${me}${se}`)}return{ok:!0,created:ye}}else return console.error(`\u274C "${p.name}" failed on "${f}": ${ne.error}`),l}a(_ue,"executeOnTarget");function g$(){return new Le("apply").description("Apply an exocmd__Command to one or more vault assets (RFC 8e83442b T1.2). Pass a path arg or pipe paths via stdin.").argument("<cmd>","Command UUID or cliName slug").argument("[path]","Vault-relative path to target asset (omit to read paths from stdin)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--dry-run","Preview without writing").option("--yes","Skip destructive-command confirmation").option("--input <json>","JSON userInput for service_call groundings").option("--seed <uuid>","Deterministic UID seed for test/replay (uses seededUidGenerator)").option("--frozen-clock <iso>","Freeze clock to ISO timestamp for test/replay (uses frozenClock)").option("--json","Emit a machine-readable JSON result ({command,target,created:[{uuid,path,label}]}) instead of human-readable output").action(async(r,e,t)=>{ve.setFormat("text");try{let n=(0,ia.resolve)(t.vault);if(!(0,Ux.existsSync)(n))throw new Je(n);Q_(n);let i=t.frozenClock?(0,qe.frozenClock)(t.frozenClock):(0,qe.liveClock)(),s=t.seed?(0,qe.seededUidGenerator)(t.seed):(0,qe.liveUidGenerator)(),o=new $t(n),l=await new qe.NoteToRDFConverter(o).convertVault(),u=new qe.InMemoryTripleStore;await u.addAll(l);let f=new qe.WorkflowResolver(u),d;if(hue.test(r))d=r;else{let S=await gue(u,r);S||(console.error(`\u274C No command found with UUID or cliName "${r}".`),process.exit(3)),d=S}let p;if(e)p=[e];else if(p=await mue(),p.length===0)throw new ct("No target path provided and stdin is empty.","exocortex apply <uuid> <path> OR exocortex find ... | exocortex apply <uuid>");let h=0,_=0,y=[];for(let S of p){let w=await _ue(n,u,f,d,S,t,i,s);w.ok?h++:_++,y.push(...w.created)}if(p.length>1&&!t.json&&console.log(`
|
|
572
572
|
\u{1F4CA} Applied to ${h}/${p.length} target(s) (${_} failed).`),t.json){let S={command:r,created:y};e?S.target=e:S.targets=p,process.stdout.write(JSON.stringify(S)+`
|
|
573
|
-
`)}_>0&&process.exit(5)}catch(n){ve.handle(n),process.exit(5)}})}a(g$,"applyCommand");var rb=require("fs"),Vx=Se(require("path")),y$=require("path"),_$=Se(it());var
|
|
573
|
+
`)}_>0&&process.exit(5)}catch(n){ve.handle(n),process.exit(5)}})}a(g$,"applyCommand");var rb=require("fs"),Vx=Se(require("path")),y$=require("path"),_$=Se(it());var bue=new Set(["templates","09 templates"]);function ec(r){return r.split("/").some(e=>bue.has(e.toLowerCase()))}a(ec,"isTemplatesPath");function Ef(r){return r.split("/").includes("node_modules")}a(Ef,"isNodeModulesPath");var Sue=5;function Bx(r,e,t){r[e].length<Sue&&r[e].push(t)}a(Bx,"addExample");async function wue(r){let e=new Zn(r),t=await e.indexedAssets(),n=[],i={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0},s={"empty-isDefinedBy":[],"bang-prefix":[],unresolvable:[]},o=0;for(let{path:c,metadata:l}of t){if(c.split("/").includes("node_modules")||ec(c))continue;let u=l.exo__Asset_isDefinedBy,f=(0,_$.extractAssetReference)(u);if(!f){i["empty-isDefinedBy"]++,Bx(s,"empty-isDefinedBy",c);continue}if(f.startsWith("!")){i["bang-prefix"]++,Bx(s,"bang-prefix",c);continue}let d=await gf(e,f,c);if(!d){i.unresolvable++,Bx(s,"unresolvable",c);continue}o++;let p=Nx(Vx.default.dirname(d)),h=Nx(Vx.default.dirname(c));p!==h&&n.push({path:c,isDefinedBy:f,expectedFolder:p,actualFolder:h})}return{vaultPath:r,totalFiles:t.length,checked:o,violations:n,skips:i,skipExamples:s}}a(wue,"scanVaultForCoLocation");function b$(){return new Le("co-location").description("Detect asset\u2013ontology co-location violations: any asset not in the folder of its exo__Asset_isDefinedBy ontology file (fail-open, skip-accounted)").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";ve.setFormat(e);try{let t=(0,y$.resolve)(r.vault);if(!(0,rb.existsSync)(t)||!(0,rb.statSync)(t).isDirectory())throw new Je(t);let n=await wue(t),i=n.skips["empty-isDefinedBy"]+n.skips["bang-prefix"]+n.skips.unresolvable;if(e==="json")console.log(JSON.stringify({vaultPath:n.vaultPath,totalFiles:n.totalFiles,checked:n.checked,violationCount:n.violations.length,violations:n.violations,skips:n.skips,skipTotal:i,skipExamples:n.skipExamples,clean:n.violations.length===0},null,2));else{if(n.violations.length===0)console.log(`OK ${t}: 0 co-location violations (${n.checked}/${n.totalFiles} checked)`);else{console.error(`FAIL ${t}: ${n.violations.length} co-location violation(s) (${n.checked}/${n.totalFiles} checked):`);for(let s of n.violations)console.error(` ${s.path}
|
|
574
574
|
isDefinedBy=${s.isDefinedBy} expected=${s.expectedFolder}/ actual=${s.actualFolder}/`)}console.error(`
|
|
575
|
-
Skipped (fail-open, NOT verified): ${i} \u2014 empty-isDefinedBy=${n.skips["empty-isDefinedBy"]}, bang-prefix=${n.skips["bang-prefix"]}, unresolvable(cross-vault/missing)=${n.skips.unresolvable}`)}n.violations.length>0&&(process.exitCode=1)}catch(t){ve.handle(t)}})}a(b$,"auditCoLocationCommand");var ib=require("fs"),O$=require("path"),Wx=Se(it());function S$(r,e){let t=new Map,n=new Map,i=new Set,s=[],o=[],c=0;for(let l of r){if(t.has(l))continue;let u=[],f=a(d=>{t.set(d,c),n.set(d,c),c++,s.push(d),i.add(d),u.push([d,(e.get(d)??new Set).values()])},"pushNode");for(f(l);u.length>0;){let[d,p]=u[u.length-1],h=p.next();if(h.done){if(u.pop(),u.length>0){let _=u[u.length-1][0];n.set(_,Math.min(n.get(_),n.get(d)))}if(n.get(d)===t.get(d)){let _=[],y;do y=s.pop(),i.delete(y),_.push(y);while(y!==d);o.push(_)}}else{let _=h.value;t.has(_)?i.has(_)&&n.set(d,Math.min(n.get(d),t.get(_))):f(_)}}}return o}a(S$,"stronglyConnectedComponents");function w$(r,e){return S$(r,e).filter(t=>t.length>=2)}a(w$,"tarjanSCC");function nb(r,e){let t=new Map;for(let n of r){let i=new Set,s=[...e.get(n)??[]];for(;s.length>0;){let o=s.shift();if(!i.has(o)){i.add(o);for(let c of e.get(o)??[])i.has(c)||s.push(c)}}t.set(n,i)}return t}a(nb,"transitiveClosure");function E$(r,e){let t=S$(r,e),n=new Map;t.forEach((s,o)=>{for(let c of s)n.set(c,o)});let i=new Map;for(let[s,o]of e){let c=n.get(s);if(c!==void 0)for(let l of o){let u=n.get(l);if(u===void 0||c===u)continue;let f=i.get(c);f||(f=new Set,i.set(c,f)),f.add(u)}}return{components:t,componentOf:n,condensedEdges:i}}a(E$,"condense");function v$(r,e){let t=nb(r,e),n=new Map;for(let[i,s]of e)for(let o of s){let c=!1;for(let l of s)if(l!==o&&t.get(l)?.has(o)){c=!0;break}if(!c){let l=n.get(i);l||(l=new Set,n.set(i,l)),l.add(o)}}return n}a(v$,"transitiveReduction");function T$(r,e){let t=new Map,n=new Map;for(let p of r)t.set(p,new Map),n.set(p,new Map);for(let p of e){if(p.source===p.target)continue;let h=t.get(p.source),_=n.get(p.target);!h||!_||(h.set(p.target,(h.get(p.target)??0)+p.weight),_.set(p.source,(_.get(p.source)??0)+p.weight))}let i=new Set(r),s=[],o=[],c=a(p=>{i.delete(p);for(let h of t.get(p).keys())n.get(h)?.delete(p);for(let h of n.get(p).keys())t.get(h)?.delete(p);t.get(p).clear(),n.get(p).clear()},"removeNode"),l=a(p=>{let h=0;for(let _ of p.values())h+=_;return h},"sumWeights"),u=a(()=>[...i].sort(),"sortedRemaining");for(;i.size>0;){let p=!0;for(;p;){p=!1;for(let h of u())i.has(h)&&t.get(h).size===0&&(o.unshift(h),c(h),p=!0);for(let h of u())i.has(h)&&n.get(h).size===0&&(s.push(h),c(h),p=!0)}if(i.size>0){let h=null,_=-1/0;for(let y of u()){let S=l(t.get(y))-l(n.get(y));S>_&&(_=S,h=y)}h!==null&&(s.push(h),c(h))}}let f=[...s,...o],d=new Map(f.map((p,h)=>[p,h]));return e.filter(p=>{if(p.source===p.target)return!1;let h=d.get(p.source),_=d.get(p.target);return h===void 0||_===void 0?!1:h>_})}a(T$,"greedyFeedbackArcSet");var A$=/\[\[([^\]]+)\]\]/g;function
|
|
575
|
+
Skipped (fail-open, NOT verified): ${i} \u2014 empty-isDefinedBy=${n.skips["empty-isDefinedBy"]}, bang-prefix=${n.skips["bang-prefix"]}, unresolvable(cross-vault/missing)=${n.skips.unresolvable}`)}n.violations.length>0&&(process.exitCode=1)}catch(t){ve.handle(t)}})}a(b$,"auditCoLocationCommand");var ib=require("fs"),O$=require("path"),Wx=Se(it());function S$(r,e){let t=new Map,n=new Map,i=new Set,s=[],o=[],c=0;for(let l of r){if(t.has(l))continue;let u=[],f=a(d=>{t.set(d,c),n.set(d,c),c++,s.push(d),i.add(d),u.push([d,(e.get(d)??new Set).values()])},"pushNode");for(f(l);u.length>0;){let[d,p]=u[u.length-1],h=p.next();if(h.done){if(u.pop(),u.length>0){let _=u[u.length-1][0];n.set(_,Math.min(n.get(_),n.get(d)))}if(n.get(d)===t.get(d)){let _=[],y;do y=s.pop(),i.delete(y),_.push(y);while(y!==d);o.push(_)}}else{let _=h.value;t.has(_)?i.has(_)&&n.set(d,Math.min(n.get(d),t.get(_))):f(_)}}}return o}a(S$,"stronglyConnectedComponents");function w$(r,e){return S$(r,e).filter(t=>t.length>=2)}a(w$,"tarjanSCC");function nb(r,e){let t=new Map;for(let n of r){let i=new Set,s=[...e.get(n)??[]];for(;s.length>0;){let o=s.shift();if(!i.has(o)){i.add(o);for(let c of e.get(o)??[])i.has(c)||s.push(c)}}t.set(n,i)}return t}a(nb,"transitiveClosure");function E$(r,e){let t=S$(r,e),n=new Map;t.forEach((s,o)=>{for(let c of s)n.set(c,o)});let i=new Map;for(let[s,o]of e){let c=n.get(s);if(c!==void 0)for(let l of o){let u=n.get(l);if(u===void 0||c===u)continue;let f=i.get(c);f||(f=new Set,i.set(c,f)),f.add(u)}}return{components:t,componentOf:n,condensedEdges:i}}a(E$,"condense");function v$(r,e){let t=nb(r,e),n=new Map;for(let[i,s]of e)for(let o of s){let c=!1;for(let l of s)if(l!==o&&t.get(l)?.has(o)){c=!0;break}if(!c){let l=n.get(i);l||(l=new Set,n.set(i,l)),l.add(o)}}return n}a(v$,"transitiveReduction");function T$(r,e){let t=new Map,n=new Map;for(let p of r)t.set(p,new Map),n.set(p,new Map);for(let p of e){if(p.source===p.target)continue;let h=t.get(p.source),_=n.get(p.target);!h||!_||(h.set(p.target,(h.get(p.target)??0)+p.weight),_.set(p.source,(_.get(p.source)??0)+p.weight))}let i=new Set(r),s=[],o=[],c=a(p=>{i.delete(p);for(let h of t.get(p).keys())n.get(h)?.delete(p);for(let h of n.get(p).keys())t.get(h)?.delete(p);t.get(p).clear(),n.get(p).clear()},"removeNode"),l=a(p=>{let h=0;for(let _ of p.values())h+=_;return h},"sumWeights"),u=a(()=>[...i].sort(),"sortedRemaining");for(;i.size>0;){let p=!0;for(;p;){p=!1;for(let h of u())i.has(h)&&t.get(h).size===0&&(o.unshift(h),c(h),p=!0);for(let h of u())i.has(h)&&n.get(h).size===0&&(s.push(h),c(h),p=!0)}if(i.size>0){let h=null,_=-1/0;for(let y of u()){let S=l(t.get(y))-l(n.get(y));S>_&&(_=S,h=y)}h!==null&&(s.push(h),c(h))}}let f=[...s,...o],d=new Map(f.map((p,h)=>[p,h]));return e.filter(p=>{if(p.source===p.target)return!1;let h=d.get(p.source),_=d.get(p.target);return h===void 0||_===void 0?!1:h>_})}a(T$,"greedyFeedbackArcSet");var A$=/\[\[([^\]]+)\]\]/g;function Eue(r){let e=r.split(`
|
|
576
576
|
`),t=[],n=null;for(let i of e){let s=i.match(/^[ \t]*(`{3,}|~{3,})/),o=s&&(s[1][0]==="~"||!i.slice(i.indexOf(s[1])+s[1].length).includes("`"));n===null?o?n=s[1]:t.push(i):s&&s[1][0]===n[0]&&s[1].length>=n.length&&/^[ \t]*(?:`{3,}|~{3,})[ \t]*$/.test(i)&&(n=null)}return t.join(`
|
|
577
|
-
`)}a(
|
|
577
|
+
`)}a(Eue,"stripFencedCodeBlocks");function I$(r){let e=[],t;for(A$.lastIndex=0;(t=A$.exec(r))!==null;){let n=t[1],i=n.indexOf("|");i!==-1&&(n=n.slice(0,i));let s=n.indexOf("#");s!==-1&&(n=n.slice(0,s));let o=n.trim();o.length>0&&e.push(o)}return e}a(I$,"extractWikilinkTargets");function qx(r){return typeof r=="string"?[r]:Array.isArray(r)?r.flatMap(qx):r!==null&&typeof r=="object"?Object.values(r).flatMap(qx):[]}a(qx,"collectFrontmatterStrings");function vue(r){let e=r.match(/^---\n[\s\S]*?\n---/);return e?r.slice(e[0].length):r}a(vue,"bodyOf");function x$(r,e,t){let n=[];for(let[s,o]of Object.entries(r))if(!t?.has(s))for(let c of qx(o))for(let l of I$(c))n.push(l);let i=I$(Eue(vue(e)));return[...n,...i]}a(x$,"extractFileWikilinkTargets");var Tue=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function R$(r,e){if(e.includes("/")){let n=e.replace(/^\//,""),i=n.endsWith(".md")?n:`${n}.md`;if(await r.hasIndexedPath(i))return i;e=n.slice(n.lastIndexOf("/")+1)}if(e.endsWith(".md")&&(e=e.slice(0,-3)),Tue.test(e)){let n=await r.findFileByUID(e);if(n)return n}let t=await r.findPathsByBasename(e);return t.length===1?t[0]:t.length>1?new Set(t).size===1?t[0]:"ambiguous":null}a(R$,"resolveTargetPath");var Aue="829b9b3b-6fc3-4276-be6a-27d3398c012e",Iue=["exo__Asset_relates","ims__Concept_related","ims__Concept_broader","ims__Concept_synonym","exo__Asset_createdBy"],xue=5,Rue=10,Cue=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif","pdf","mp3","wav","m4a","ogg","flac","mp4","mov","webm","avi","mkv","zip","gz","tar","canvas","base","json","css","js","ts","html"]);function Oue(r){let e=r.lastIndexOf(".");if(e===-1||e===r.length-1)return!1;let t=r.slice(e+1).toLowerCase();return Cue.has(t)}a(Oue,"nonMarkdownExtension");function Gx(r){if(Array.isArray(r)){let e=r.filter(t=>typeof t=="string");return{value:e[0]??null,multiple:e.length>1}}return{value:typeof r=="string"?r:null,multiple:!1}}a(Gx,"firstString");function C$(r){let e=Array.isArray(r)?r:r==null?[]:[r],t=[];for(let n of e){let i=(0,Wx.extractAssetReference)(n);i&&t.push(i)}return t}a(C$,"asRefList");function ch(r,e,t=xue){r.length<t&&r.push(e)}a(ch,"pushExample");async function Pue(r,e={}){let t=new Zn(r,{cacheContent:!0}),n=await t.indexedAssets(),i=new Set(e.excludePredicates??[]),s=new Map,o=new Map,c=new Map,l=[];for(let Q of n){if(Ef(Q.path)||ec(Q.path)||!C$(Q.metadata.exo__Instance_class).includes(Aue))continue;let{value:be}=Gx(Q.metadata.exo__Asset_uid);if(!be){l.push(Q.path);continue}let{value:Ie}=Gx(Q.metadata.exo__Asset_label),Ce=Ie??Q.path,Fe=c.get(be);Fe?Fe.push(Q.path):c.set(be,[Q.path]),s.set(Q.path,be),o.has(be)||o.set(be,{uid:be,label:Ce,path:Q.path,metadata:Q.metadata})}let u=[...c.entries()].filter(([,Q])=>Q.length>1).map(([Q,ce])=>({uid:Q,paths:ce})),f=new Map,d={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0,"not-an-ontology":0},p=[],h=0,_=0,y=new Map,S=0,w=a((Q,ce)=>{f.set(Q,null),d[ce]++,h++,ch(p,`${Q} (${ce})`,Rue)},"markNoOntology");for(let Q of n){if(Ef(Q.path)||ec(Q.path))continue;S++;let ce=Q.metadata.exo__Asset_isDefinedBy,{value:be,multiple:Ie}=Gx(ce);Ie&&_++;let Ce=(0,Wx.extractAssetReference)(be);if(!Ce){w(Q.path,"empty-isDefinedBy");continue}if(Ce.startsWith("!")){w(Q.path,"bang-prefix");continue}let Fe=await gf(t,Ce,Q.path);if(!Fe){w(Q.path,"unresolvable");continue}let De=s.get(Fe);if(!De){w(Q.path,"not-an-ontology");continue}f.set(Q.path,De),y.set(De,(y.get(De)??0)+1)}let T=[...o.keys()],O=new Map,A=[],x=new Map,P=new Map,V=0;for(let Q of T){let ce=o.get(Q),be=C$(ce.metadata.exo__Ontology_imports),Ie=[],Ce=[],Fe=!1;for(let De of be){let Ae=null;if(o.has(De))Ae=De;else{let Z=await gf(t,De,ce.path);Ae=Z?s.get(Z)??null:null}if(Ae===null)Ce.push(De);else if(Ae===Q)Fe=!0;else{Ie.push(Ae);let Z=O.get(Q);Z||(Z=new Set,O.set(Q,Z)),Z.has(Ae)||(Z.add(Ae),V++)}}x.set(Q,Ie),P.set(Q,Ce),Fe&&A.push(Q)}let j=w$(T,O),$=nb(T,O),K={total:0,internal:0,crossOntologyValid:0,crossOntologyViolation:0,crossVault:0,noOntology:0},N={broken:0,"dup-basename":0,"non-markdown":0},ae={broken:[],"dup-basename":[],"non-markdown":[]},we=new Map,ee=new Map,pe=new Map,Y=new Map,Ee=new Map,ie=new Map,ne=a(Q=>{let ce=o.get(Q);return ce?{uid:ce.uid,label:ce.label,path:ce.path}:{uid:Q,label:Q,path:""}},"toRef");for(let Q of n){if(Ef(Q.path)||ec(Q.path))continue;let ce=f.get(Q.path)??null,be=x$(Q.metadata,Q.content??"",i);for(let Ie of be){if(K.total++,Oue(Ie)){N["non-markdown"]++,ch(ae["non-markdown"],`${Q.path} \u2192 ${Ie}`);continue}let Ce=await R$(t,Ie);if(Ce==="ambiguous"){N["dup-basename"]++,ch(ae["dup-basename"],`${Q.path} \u2192 ${Ie}`);continue}if(Ce===null){N.broken++,ch(ae.broken,`${Q.path} \u2192 ${Ie}`);continue}let Fe=f.get(Ce)??s.get(Ce)??null;if(ce===null||Fe===null){K.noOntology++;continue}if(ce===Fe){K.internal++,pe.set(ce,(pe.get(ce)??0)+1);continue}let De=$.get(ce)?.has(Fe)??!1,Ae=`${ce}\0${Fe}`,Z=we.get(Ae);if(Z?Z.occurrences++:we.set(Ae,{source:ce,target:Fe,occurrences:1,valid:De}),Y.set(ce,(Y.get(ce)??0)+1),Ee.set(Fe,(Ee.get(Fe)??0)+1),De)K.crossOntologyValid++;else{K.crossOntologyViolation++,ie.set(ce,(ie.get(ce)??0)+1);let he=ee.get(Ae);he?(he.occurrences++,ch(he.examples,Q.path)):ee.set(Ae,{source:ce,target:Fe,occurrences:1,examples:[Q.path]})}}}let de=[...we.values()].sort((Q,ce)=>ce.occurrences-Q.occurrences),ye=new Map,te=new Map;for(let Q of de)te.set(Q.source,(te.get(Q.source)??0)+1),ye.set(Q.target,(ye.get(Q.target)??0)+1);let me=T.map(Q=>({...ne(Q),declaredImports:x.get(Q)??[],unresolvedImports:P.get(Q)??[],selfImport:A.includes(Q),assetCount:y.get(Q)??0,inDegree:ye.get(Q)??0,outDegree:te.get(Q)??0,internalLinks:pe.get(Q)??0,externalLinksOut:Y.get(Q)??0,externalLinksIn:Ee.get(Q)??0,violatingOut:ie.get(Q)??0})).sort((Q,ce)=>Q.label.localeCompare(ce.label)),Pe=[...ee.values()].map(Q=>({source:ne(Q.source),target:ne(Q.target),occurrences:Q.occurrences,examples:Q.examples})).sort((Q,ce)=>ce.occurrences-Q.occurrences),se=[],_e=j.length===0,Ne=Pe.length===0&&K.crossVault===0&&_e&&u.length===0;return{vaultPath:r,totalFiles:n.length,scannedFiles:S,ontologies:me,duplicateOntologyUids:u,declared:{edgeCount:V,sccs:j,acyclic:_e},derivedEdges:de,violations:Pe,crossVault:se,linkCounts:K,skips:N,skipExamples:ae,noOntologyAssets:{count:h,byReason:d,examples:p},warnings:{selfImports:A,multipleIsDefinedBy:_,ontologiesWithoutUid:l},clean:Ne,...i.size>0?{excludedPredicates:[...i]}:{}}}a(Pue,"scanVaultForOntologyImports");function Due(r){let e=r.ontologies.map(x=>x.uid),t=new Map;for(let x of r.ontologies)t.set(x.uid,{uid:x.uid,label:x.label,path:x.path});let n=a(x=>t.get(x)??{uid:x,label:x,path:""},"refOf"),i=new Map;for(let x of r.ontologies)x.declaredImports.length>0&&i.set(x.uid,new Set(x.declaredImports));let s=new Map,o=new Map;for(let x of r.derivedEdges){let P=s.get(x.source);P||(P=new Set,s.set(x.source,P)),P.add(x.target),o.set(`${x.source} ${x.target}`,x.occurrences)}let{components:c,componentOf:l}=E$(e,s),u=[],f=new Map,d=0;for(let x of r.derivedEdges){let P=l.get(x.source),V=l.get(x.target);if(P!==void 0&&V!==void 0&&P===V){let $=f.get(P);$||($=[],f.set(P,$)),$.push({source:x.source,target:x.target,weight:x.occurrences})}else u.push({source:x.source,target:x.target,occurrences:x.occurrences}),x.valid&&d++}let p=a((x,P,V)=>{if(x===P)return!0;let j=[...V.get(x)??[]],$=new Set;for(;j.length>0;){let K=j.shift();if(K===P)return!0;if(!$.has(K)){$.add(K);for(let N of V.get(K)??[])j.push(N)}}return!1},"reaches"),h=new Map;for(let[x,P]of i)h.set(x,new Set(P));let _=[],y=[...u].sort((x,P)=>x.source===P.source?x.target.localeCompare(P.target):x.source.localeCompare(P.source));for(let x of y)if(p(x.target,x.source,h))_.push({source:n(x.source),target:n(x.target),occurrences:x.occurrences});else{let P=h.get(x.source);P||(P=new Set,h.set(x.source,P)),P.add(x.target)}let S=v$(e,h),w=[];for(let[x,P]of S)for(let V of P)i.get(x)?.has(V)||w.push({source:n(x),target:n(V),occurrences:o.get(`${x} ${V}`)??0});w.sort((x,P)=>P.occurrences-x.occurrences||x.source.uid.localeCompare(P.source.uid)||x.target.uid.localeCompare(P.target.uid));let T=[];for(let[x,P]of f){let V=c[x],$=T$(V,P).map(K=>({source:n(K.source),target:n(K.target),occurrences:K.weight})).sort((K,N)=>K.occurrences-N.occurrences||K.source.uid.localeCompare(N.source.uid)||K.target.uid.localeCompare(N.target.uid));T.push({ontologies:V.map(n).sort((K,N)=>K.label.localeCompare(N.label)),edgeCount:P.length,occurrenceCount:P.reduce((K,N)=>K+N.weight,0),suggestedCuts:$})}T.sort((x,P)=>P.ontologies.length-x.ontologies.length||P.occurrenceCount-x.occurrenceCount);let O=nb(e,i),A=[];for(let[x,P]of i)for(let V of P){let j=!1;for(let $ of P)if($!==V&&O.get($)?.has(V)){j=!0;break}j&&A.push({source:n(x),target:n(V),occurrences:o.get(`${x} ${V}`)??0})}return{additions:w,acyclicEdgeCount:u.length,alreadyCovered:d,conflicts:_,intraScc:T,redundantDeclared:A}}a(Due,"computeImportProposal");function Ss(r){return`${r.uid}|${r.label}|${r.path}`}a(Ss,"formatRef");function Fue(r){let e=r.ontologies.filter(i=>i.declaredImports.length>0||i.unresolvedImports.length>0).length,t=r.clean?console.log:console.error;if(t(`${r.clean?"OK":"FAIL"} ${r.vaultPath}: ontology-imports audit \u2014 ${r.linkCounts.crossOntologyViolation} violating occurrence(s) in ${r.violations.length} pair(s)`),t(`Ontologies: ${r.ontologies.length} (${e} with imports declared), declared graph: ${r.declared.edgeCount} edge(s), `+(r.declared.acyclic?"acyclic":`NOT ACYCLIC \u2014 ${r.declared.sccs.length} SCC(s)`)),r.excludedPredicates&&r.excludedPredicates.length>0&&t(`Structural-only mode (VL#30): excluded ${r.excludedPredicates.length} associative predicate(s) from edge extraction \u2014 ${r.excludedPredicates.join(", ")}`),r.duplicateOntologyUids.length>0){console.error(`
|
|
578
578
|
HARD ERRORS \u2014 duplicate ontology UIDs (R7):`);for(let i of r.duplicateOntologyUids)console.error(` ${i.uid}: ${i.paths.join(", ")}`)}if(!r.declared.acyclic){console.error(`
|
|
579
|
-
Declared-graph cycles (must be a DAG):`);for(let i of r.declared.sccs)console.error(` SCC[${i.length}]: ${i.map(s=>Ss(
|
|
579
|
+
Declared-graph cycles (must be a DAG):`);for(let i of r.declared.sccs)console.error(` SCC[${i.length}]: ${i.map(s=>Ss(Lue(r,s))).join(" \u21C4 ")}`)}if(r.violations.length>0){console.error(`
|
|
580
580
|
Violating pairs (src \u2192 tgt, occurrences desc):`);for(let i of r.violations)console.error(` ${Ss(i.source)} \u2192 ${Ss(i.target)}: ${i.occurrences}`)}let n=r.ontologies.reduce((i,s)=>i+s.unresolvedImports.length,0);t(`
|
|
581
|
-
Links: total=${r.linkCounts.total}, internal=${r.linkCounts.internal}, cross-ontology-valid=${r.linkCounts.crossOntologyValid}, cross-ontology-violation=${r.linkCounts.crossOntologyViolation}, cross-vault=${r.linkCounts.crossVault}, no-ontology=${r.linkCounts.noOntology}`),t(`Skipped (fail-open, NOT verified): broken=${r.skips.broken}, dup-basename=${r.skips["dup-basename"]}, non-markdown=${r.skips["non-markdown"]}`),t(`No-ontology assets (Phase-4 data gap): ${r.noOntologyAssets.count} \u2014 empty=${r.noOntologyAssets.byReason["empty-isDefinedBy"]}, bang-prefix=${r.noOntologyAssets.byReason["bang-prefix"]}, unresolvable=${r.noOntologyAssets.byReason.unresolvable}, not-an-ontology=${r.noOntologyAssets.byReason["not-an-ontology"]}`),(r.warnings.selfImports.length>0||r.warnings.multipleIsDefinedBy>0||r.warnings.ontologiesWithoutUid.length>0||n>0)&&t(`Warnings: self-imports=${r.warnings.selfImports.length}, unresolved-imports=${n}, multiple-isDefinedBy=${r.warnings.multipleIsDefinedBy}, ontologies-without-uid=${r.warnings.ontologiesWithoutUid.length}`)}a(
|
|
581
|
+
Links: total=${r.linkCounts.total}, internal=${r.linkCounts.internal}, cross-ontology-valid=${r.linkCounts.crossOntologyValid}, cross-ontology-violation=${r.linkCounts.crossOntologyViolation}, cross-vault=${r.linkCounts.crossVault}, no-ontology=${r.linkCounts.noOntology}`),t(`Skipped (fail-open, NOT verified): broken=${r.skips.broken}, dup-basename=${r.skips["dup-basename"]}, non-markdown=${r.skips["non-markdown"]}`),t(`No-ontology assets (Phase-4 data gap): ${r.noOntologyAssets.count} \u2014 empty=${r.noOntologyAssets.byReason["empty-isDefinedBy"]}, bang-prefix=${r.noOntologyAssets.byReason["bang-prefix"]}, unresolvable=${r.noOntologyAssets.byReason.unresolvable}, not-an-ontology=${r.noOntologyAssets.byReason["not-an-ontology"]}`),(r.warnings.selfImports.length>0||r.warnings.multipleIsDefinedBy>0||r.warnings.ontologiesWithoutUid.length>0||n>0)&&t(`Warnings: self-imports=${r.warnings.selfImports.length}, unresolved-imports=${n}, multiple-isDefinedBy=${r.warnings.multipleIsDefinedBy}, ontologies-without-uid=${r.warnings.ontologiesWithoutUid.length}`)}a(Fue,"printText");function Lue(r,e){return r.ontologies.find(t=>t.uid===e)??{uid:e,label:e,path:""}}a(Lue,"toRefSafe");function Nue(r){if(console.log(`
|
|
582
582
|
=== Import proposal (--propose-imports) ===
|
|
583
583
|
Acyclic part: ${r.acyclicEdgeCount} cross-SCC derived edge(s), ${r.alreadyCovered} already covered by declared closure.`),console.log(`
|
|
584
584
|
Additions (minimal \u2014 transitive reduction of the condensation), ${r.additions.length} edge(s):`),r.additions.length===0)console.log(" (none \u2014 acyclic part already covered)");else for(let e of r.additions)console.log(` + ${Ss(e.source)} imports ${Ss(e.target)} (${e.occurrences} occ)`);if(r.conflicts.length>0){console.log(`
|
|
585
585
|
Conflicts \u2014 derived edges that would create a declared-graph cycle (need Phase-3 re-home, not an import), ${r.conflicts.length}:`);for(let e of r.conflicts)console.log(` ! ${Ss(e.source)} \u2192 ${Ss(e.target)} (${e.occurrences} occ)`)}if(r.intraScc.length>0){console.log(`
|
|
586
586
|
Intra-SCC cycles (require Phase 3 \u2014 imports cannot legitimize a cycle), ${r.intraScc.length} component(s):`);for(let e of r.intraScc){console.log(` SCC[${e.ontologies.length}] ${e.edgeCount} edge(s) / ${e.occurrenceCount} occ \u2014 members: ${e.ontologies.map(t=>t.label).join(", ")}`),console.log(` suggested feedback-arc-set to cut (cheapest first), ${e.suggestedCuts.length} edge(s):`);for(let t of e.suggestedCuts)console.log(` \u2702 ${Ss(t.source)} \u2192 ${Ss(t.target)} (${t.occurrences} occ)`)}}if(r.redundantDeclared.length>0){console.log(`
|
|
587
|
-
Redundant declared imports (informational, R8 \u2014 never auto-removed), ${r.redundantDeclared.length}:`);for(let e of r.redundantDeclared)console.log(` ~ ${Ss(e.source)} imports ${Ss(e.target)} (reachable without the direct edge)`)}}a(
|
|
587
|
+
Redundant declared imports (informational, R8 \u2014 never auto-removed), ${r.redundantDeclared.length}:`);for(let e of r.redundantDeclared)console.log(` ~ ${Ss(e.source)} imports ${Ss(e.target)} (reachable without the direct edge)`)}}a(Nue,"printProposal");function P$(){return new Le("ontology-imports").description("Detect cross-ontology wikilinks not covered by the declared exo__Ontology_imports transitive closure (DAG check, per-pair grouping, fail-open skip-accounting); --propose-imports suggests minimal import additions").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").option("--propose-imports","Emit a minimal additions-only import proposal (SCC condensation + transitive reduction + suggested feedback-arc-set)").option("--structural-only","Exclude curated associative predicates (exo__Asset_relates, ims__Concept_related/broader/synonym, exo__Asset_createdBy) from edge extraction to measure the structural backbone import-DAG (EKA Phase B, Vision VL#30). Default: every wikilink counts.").option("--exclude-predicate <name>","Additional frontmatter predicate (top-level key) to exclude from edge extraction (repeatable; combines with --structural-only)",kue,[]).action(async r=>{let e=r.output??"text";ve.setFormat(e);try{let t=(0,O$.resolve)(r.vault);if(!(0,ib.existsSync)(t)||!(0,ib.statSync)(t).isDirectory())throw new Je(t);let n=[...r.structuralOnly?Iue:[],...r.excludePredicate??[]],i=await Pue(t,{excludePredicates:n});r.proposeImports&&(i.proposal=Due(i)),e==="json"?console.log(JSON.stringify(i,null,2)):(Fue(i),i.proposal&&Nue(i.proposal)),i.clean||(process.exitCode=1)}catch(t){ve.handle(t)}})}a(P$,"auditOntologyImportsCommand");function kue(r,e){return e.concat([r])}a(kue,"collectExcludePredicate");var sb=require("fs"),D$=require("path");var Mue="exocortex.my",jue=5;function $ue(r){return Array.isArray(r)?r.find(t=>typeof t=="string")??null:typeof r=="string"?r:null}a($ue,"firstString");function Uue(r){try{return new URL(r).host}catch{return null}}a(Uue,"urlHost");function Bue(r){return`${r.replace(/\/+$/,"")}#`}a(Bue,"expectedCanonicalForm");async function Vue(r){let t=await new Zn(r).indexedAssets(),n=[],i={"foreign-vocab":0,"unparseable-url":0},s={"foreign-vocab":[],"unparseable-url":[]},o=0,c=0,l=a((u,f)=>{s[u].length<jue&&s[u].push(f)},"addExample");for(let{path:u,metadata:f}of t){if(Ef(u)||ec(u))continue;let d=$ue(f.exo__Ontology_url);if(!d)continue;o++;let p=Uue(d);if(p===null){i["unparseable-url"]++,l("unparseable-url",u);continue}if(p!==Mue){i["foreign-vocab"]++,l("foreign-vocab",u);continue}c++,d.endsWith("#")||n.push({path:u,url:d,expected:Bue(d)})}return{vaultPath:r,totalFiles:t.length,ontologiesFound:o,checked:c,violations:n,skips:i,skipExamples:s}}a(Vue,"scanVaultForOntologyUrl");function F$(){return new Le("ontology-url").description("Detect exocortex.my ontologies whose exo__Ontology_url lacks the canonical trailing '#' separator (foreign vocabularies skipped, path hierarchy preserved, fail-open + skip-accounted)").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";ve.setFormat(e);try{let t=(0,D$.resolve)(r.vault);if(!(0,sb.existsSync)(t)||!(0,sb.statSync)(t).isDirectory())throw new Je(t);let n=await Vue(t),i=n.skips["foreign-vocab"]+n.skips["unparseable-url"];if(e==="json")console.log(JSON.stringify({vaultPath:n.vaultPath,totalFiles:n.totalFiles,ontologiesFound:n.ontologiesFound,checked:n.checked,violationCount:n.violations.length,violations:n.violations,skips:n.skips,skipTotal:i,skipExamples:n.skipExamples,clean:n.violations.length===0},null,2));else{if(n.violations.length===0)console.log(`OK ${t}: 0 ontology-url violations (${n.checked}/${n.ontologiesFound} exocortex.my ontologies checked)`);else{console.error(`FAIL ${t}: ${n.violations.length} ontology-url violation(s) (${n.checked}/${n.ontologiesFound} exocortex.my ontologies checked):`);for(let s of n.violations)console.error(` ${s.path}
|
|
588
588
|
url=${s.url} expected=${s.expected}`)}console.error(`
|
|
589
|
-
Skipped (fail-open, NOT verified): ${i} \u2014 foreign-vocab=${n.skips["foreign-vocab"]}, unparseable-url=${n.skips["unparseable-url"]}`)}n.violations.length>0&&(process.exitCode=1)}catch(t){ve.handle(t)}})}a(F$,"auditOntologyUrlCommand");function L$(){let r=new Le("audit").description("Audit vault for regression patterns (RFC cutover detectors)");return r.addCommand(b$()),r.addCommand(P$()),r.addCommand(F$()),r}a(L$,"auditCommand");var ob=require("fs"),N$=require("fs/promises"),k$=require("crypto"),al=require("path"),to=Se(it());var
|
|
589
|
+
Skipped (fail-open, NOT verified): ${i} \u2014 foreign-vocab=${n.skips["foreign-vocab"]}, unparseable-url=${n.skips["unparseable-url"]}`)}n.violations.length>0&&(process.exitCode=1)}catch(t){ve.handle(t)}})}a(F$,"auditOntologyUrlCommand");function L$(){let r=new Le("audit").description("Audit vault for regression patterns (RFC cutover detectors)");return r.addCommand(b$()),r.addCommand(P$()),r.addCommand(F$()),r}a(L$,"auditCommand");var ob=require("fs"),N$=require("fs/promises"),k$=require("crypto"),al=require("path"),to=Se(it());var que="35cf35fb-935f-4d35-a150-939f29109aec",Gue=[{checkId:to.CHECK_ID_UID_UNIQUENESS,label:"uid-uniqueness",value:!0},{checkId:to.CHECK_ID_CO_LOCATION,label:"co-location",value:!1},{checkId:to.CHECK_ID_SHACL,label:"shacl",value:!1},{checkId:to.CHECK_ID_DAG_ONTOLOGY_IMPORTS,label:"dag-ontology-imports",value:!1}];function Wue(r,e,t,n,i,s){return`---
|
|
590
590
|
exo__Asset_uid: ${r}
|
|
591
591
|
exo__Asset_isDefinedBy: "[[${e}]]"
|
|
592
592
|
exo__Asset_createdAt: ${s}
|
|
593
593
|
exo__Instance_class:
|
|
594
|
-
- "[[${
|
|
594
|
+
- "[[${que}]]"
|
|
595
595
|
exo__Asset_label: "Validation check: ${n} (${i?"enabled":"disabled"})"
|
|
596
596
|
setting__Setting_key: "[[${t}]]"
|
|
597
597
|
setting__Setting_value: ${i}
|
|
@@ -600,12 +600,12 @@ setting__Setting_value: ${i}
|
|
|
600
600
|
# Validation check: ${n}
|
|
601
601
|
|
|
602
602
|
Homoiconic validation-check setting (RFC f402002b, M1.5). \`Exocortex: Validate vault\` reads this instance's \`setting__Setting_value\` to decide whether to run the **${n}** check (key \`[[${t}]]\`). Scaffolded default \u2014 edit \`setting__Setting_value\` to toggle.
|
|
603
|
-
`}a(
|
|
604
|
-
Defaults: uid-uniqueness=true, co-location/shacl/dag=false. Run 'exocortex validate vault --vault <path>'.`)}}catch(t){ve.handle(t)}})}a(Wue,"scaffoldValidationCommand");var X$=require("fs"),J$=require("path");var ab=Se(Qo()),cb=Se(require("path")),tc=Se(it()),ub=Se(it());var Hue=tc.SDK_FLOOR_ASSETSPACE_UIDS,lh="73bd00e4-ccc0-4f3f-b20d-c4388c4588fb",Hx="3de846cd-1f0e-4f98-8613-b8587aa15174",zue=5,lb=class{static{a(this,"CliProfileResolver")}constructor(e){this.vaultPaths=[cb.default.resolve(e.vaultPath)],this.maxExtendsDepth=e.maxExtendsDepth??zue,this.warn=e.warn??(()=>{})}async resolveFilter(e){if(e==null||e==="")return{outcome:"no-profile"};let t;try{t=await this.scanAllVaults()}catch(f){let d=`[CliProfileResolver] vault scan threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}if(t.profiles.get(e)===void 0)return this.warn(`[CliProfileResolver] profileUid=${e} not found in any scanned vault \u2014 falling back to no-filter (full vault).`),{outcome:"missing-profile",profileUid:e};let i=new Set;try{this.walkProfileChain(e,t.profiles,i,new Set,0)}catch(f){let d=`[CliProfileResolver] profile chain walk threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}let s=(0,tc.transitiveDependsOnClosure)(i,t.dependsOn),o=new Set(t.folderMap.values()),c=new Set,l=[];for(let f of s){if(o.has(f)){c.add(f);continue}l.push(f)}for(let f of Hue)c.add(f);if(!Array.from(c).some(f=>o.has(f))){let f=`[CliProfileResolver] profileUid=${e} produced effective set with zero AssetSpace folder overlap (${c.size} AS UIDs incl. floor; ${t.folderMap.size} folders known). Likely cause: profile declares AssetSpace UIDs not present as descriptors, or vault has no scanned AssetSpaces. Falling back to no-filter (full vault indexed).`;return this.warn(f),{outcome:"degraded",reason:f}}return{outcome:"engaged",result:{effective:c,folderMap:t.folderMap,declaredOntologies:s,untranslated:l}}}walkProfileChain(e,t,n,i,s){if(s>this.maxExtendsDepth)throw new Error(`Profile chain exceeds max depth ${this.maxExtendsDepth} at ${e} \u2014 possible cycle`);if(i.has(e))return;i.add(e);let o=t.get(e);if(o!==void 0){for(let c of o.includes)n.add(c);typeof o.extends=="string"&&o.extends.length>0&&this.walkProfileChain(o.extends,t,n,i,s+1)}}async scanAllVaults(){let e=new Map,t=new Map,n=new Map;for(let i of this.vaultPaths){if(!await ab.default.pathExists(i)){this.warn(`[CliProfileResolver] vault path does not exist: ${i} \u2014 skipping.`);continue}let s=await this.walkVault(i);for(let o of s){let c=sa(o.frontmatter.exo__Instance_class);if(c.some(l=>l===lh)){let l=Yue(o.filePath,o.vaultRoot);l.length>0&&!e.has(l)&&e.set(l,o.uid);let u=typeof o.frontmatter.exo__AssetSpace_source=="string"?o.frontmatter.exo__AssetSpace_source:typeof o.frontmatter.exo__AssetSpace_git=="string"?o.frontmatter.exo__AssetSpace_git:"";if(u.length>0){let d=(0,tc.derivePath)(u);d!==null&&e.set(d,o.uid)}let f=sa(o.frontmatter.exo__AssetSpace_dependsOn);f.length>0&&n.set(o.uid,f)}if(c.some(l=>l===Hx)){let l={uid:o.uid,label:typeof o.frontmatter.exo__Asset_label=="string"?o.frontmatter.exo__Asset_label:void 0,includes:sa(o.frontmatter.exo__Profile_includes),extends:sa(o.frontmatter.exo__Profile_imports)[0]??null};t.set(o.uid,l)}}}return{folderMap:e,profiles:t,dependsOn:n}}async walkVault(e){let t=[],n=[e];for(;n.length>0;){let i=n.pop(),s;try{s=await ab.default.readdir(i,{withFileTypes:!0})}catch{continue}for(let o of s){let c=cb.default.join(i,o.name);if(o.isDirectory()){if(o.name.startsWith(".")||o.name==="node_modules"||o.name===".obsidian"||o.name===".exocortex")continue;n.push(c);continue}if(!o.isFile()||!o.name.endsWith(".md"))continue;let l=await this.tryReadFrontmatter(c);if(l===null)continue;let u=l.exo__Asset_uid;typeof u!="string"||u.length===0||t.push({uid:u,filePath:c,vaultRoot:e,frontmatter:l})}}return t}async tryReadFrontmatter(e){let t;try{t=await ab.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,tc.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function sa(r){if(r==null)return[];let e=Array.isArray(r)?r:[r],t=[];for(let n of e){if(typeof n!="string")continue;let i=Kue(n);i!==null&&t.push(i)}return t}a(sa,"parseWikilinkArray");function Kue(r){let e=r.trim().replace(/^\[\[/,"").replace(/\]\]$/,"").split("|")[0].trim();return e.length===0?null:e}a(Kue,"extractUidFromWikilink");function Yue(r,e){let t=cb.default.relative(e,r).replace(/\\/g,"/");if(!t.startsWith("assetspaces/"))return"";let n=t.slice(12),i=n.indexOf("/");return i<0?"":`assetspaces/${n.slice(0,i)}`}a(Yue,"parentFolderRelative");var cl=require("node:fs"),vf=require("node:path"),wn=Se(it());var Lt=require("node:fs"),$$=require("node:fs/promises"),U$=require("node:os"),Sn=require("node:path"),oa=Se(it());var Que=/^https:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:\.git)?$/,j$=50*1024*1024,ei=class r{static{a(this,"BootstrapAssetSpaceService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.mountBaseStore=e.mountBaseStore}redact(e){return(typeof e=="string"?e:String(e)).replace(r.PAT_REGEX,"***REDACTED***")}static parseGitHubURL(e){let t=e.match(Que);if(t===null)throw new Error(`parseGitHubURL: invalid URL shape \u2014 expected https://github.com/<owner>/<repo>, got: ${e}`);return{owner:t[1],repo:t[2]}}static deriveFolderName(e){let{repo:t}=r.parseGitHubURL(e);return t.startsWith("exoas-")?t.slice(6):t}async pullAssetSpace(e,t,n){let{owner:i,repo:s}=r.parseGitHubURL(e);if((0,Lt.existsSync)(n)&&(0,Lt.readdirSync)(n).length>0)throw new Error(`pullAssetSpace: target ${n} exists \u0438 not empty \u2014 refusing \u043A overwrite`);let o=await(0,oa.mountAssetSpaceFiles)({http:this.httpPort(),fs:this.fsPort(),owner:i,repo:s,ref:t,targetPath:n});if(this.mountBaseStore!==void 0)try{await this.mountBaseStore.set(`${i}/${s}#${oa.SYNC_BRANCH}`,o.sha)}catch{}return o}httpPort(){let e=this.fetchImpl,t=this.token,n=a(i=>this.redact(i),"redact");return{async fetchTarball(i,s,o){let c=`https://api.github.com/repos/${i}/${s}/tarball/${o}`,l={signal:AbortSignal.timeout(6e4)};t.length>0&&(l.headers={Authorization:`Bearer ${t}`,"User-Agent":"exocortex-cli","X-GitHub-Api-Version":"2022-11-28"});let u;try{u=await e(c,l)}catch(d){throw new Error(n(`pullAssetSpace: fetch error for ${c}: ${d instanceof Error?d.message:String(d)}`))}if(!u.ok){if(u.status===403){let d=u.headers?.get?.("x-ratelimit-remaining"),p=u.headers?.get?.("x-ratelimit-reset");if(d==="0"||p!=null){let h=p!=null?new Date(Number(p)*1e3).toISOString():"unknown";throw new Error(`pullAssetSpace: GitHub anonymous API rate-limit exceeded (60 req/hour). Reset at ${h}. Wait or use authenticated CLI.`)}}if(u.status===404){let d=t.length>0?"repo not found, or the provided token lacks access to it":"if this is a private repo, pass --token <pat> (or set GITHUB_TOKEN / GH_TOKEN)";throw new Error(n(`pullAssetSpace: fetch failed (404 Not Found) for ${c} \u2014 ${d}`))}throw new Error(n(`pullAssetSpace: fetch failed (${u.status} ${u.statusText}) for ${c}`))}let f=await u.arrayBuffer();if(f.byteLength>j$)throw new Error(`pullAssetSpace: tarball too large (${f.byteLength} bytes > ${j$})`);return new Uint8Array(f)}}}fsPort(){return{async exists(e){return(0,Lt.existsSync)(e)},async read(e){return(0,Lt.readFileSync)(e,"utf8")},async write(e,t){(0,Lt.writeFileSync)(e,t,{encoding:"utf8"})},async removeDir(e){(0,Lt.rmSync)(e,{recursive:!0,force:!0})},async materialize(e,t,n){let i=await(0,$$.mkdtemp)((0,Sn.join)((0,U$.tmpdir)(),`exo-bootstrap-${(0,Sn.basename)(e)}-`)),s=0;try{for(let o of t){let c=o.relPath;if(c.split("/").some(u=>u===".."))throw new Error(`pullAssetSpace: path traversal detected for entry "${c}"`);let l=(0,Sn.resolve)(i,c);if(l!==i&&!l.startsWith(i+Sn.sep))throw new Error(`pullAssetSpace: zip-slip detected for entry "${c}"`);(0,Lt.mkdirSync)((0,Sn.dirname)(l),{recursive:!0}),(0,Lt.writeFileSync)(l,o.content),s++,n?.(s)}(0,Lt.mkdirSync)((0,Sn.dirname)(e),{recursive:!0});try{(0,Lt.renameSync)(i,e)}catch(o){if(o.code==="EXDEV"){let{cpSync:c}=await import("node:fs");c(i,e,{recursive:!0}),(0,Lt.rmSync)(i,{recursive:!0,force:!0})}else throw o}}catch(o){throw(0,Lt.rmSync)(i,{recursive:!0,force:!0}),o}return s}}}ensureGitmodulesEntry(e,t,n){let i=(0,Sn.join)(e,".gitmodules"),s="";try{s=(0,Lt.readFileSync)(i,"utf8")}catch(l){if(l.code!=="ENOENT")throw l}let{content:o,added:c}=(0,oa.appendGitmodulesEntry)(s,t,n);return c?((0,Lt.appendFileSync)(i,o.slice(s.length),{encoding:"utf8"}),{added:!0}):{added:!1}}removeGitmodulesEntry(e,t){let n=(0,Sn.join)(e,".gitmodules"),i;try{i=(0,Lt.readFileSync)(n,"utf8")}catch(o){if(o.code==="ENOENT")return{removed:!1};throw o}let s=(0,oa.stripGitmodulesEntry)(i,t);return s===i?{removed:!1}:((0,Lt.writeFileSync)(n,s,{encoding:"utf8"}),{removed:!0})}static stripGitmodulesEntry(e,t){return(0,oa.stripGitmodulesEntry)(e,t)}unmountAssetSpace(e,t){let n=t.split("/");if(t.length===0||!t.startsWith("assetspaces/")||n.some(o=>o.length===0||o==="."||o===".."))throw new Error(`unmountAssetSpace: refusing unsafe submodulePath "${t}"`);let i=(0,Sn.resolve)(e),s=(0,Sn.resolve)(i,t);if(s===i||!s.startsWith(i+Sn.sep))throw new Error(`unmountAssetSpace: target "${s}" escapes vault root "${i}"`);this.removeGitmodulesEntry(e,t),(0,Lt.existsSync)(s)&&(0,Lt.rmSync)(s,{recursive:!0,force:!0})}};function Xue(r){let e=(0,wn.derivePath)(r);return e===null?r:(0,wn.deriveUrl)(e)??r}a(Xue,"toHttpsGitHubUrl");var Jue=new Set(["node_modules",".obsidian",".exocortex",".git"]),Tf=class{static{a(this,"CliApplyProfileService")}constructor(e){this.vaultPath=e.vaultPath,this.mount=e.mount??new ei,this.ref=e.ref??"main"}scanVault(){let e=[],t=new Map,n=new Set,i=[this.vaultPath];for(;i.length>0;){let s=i.pop(),o;try{o=(0,cl.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,vf.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||Jue.has(c.name))continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=this.readFrontmatter(l);if(u===null)continue;let f=u.exo__Asset_uid;if(typeof f!="string"||f.length===0)continue;let d=sa(u.exo__Instance_class);if(d.includes(lh)){if(n.has(f))continue;let h=(typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:"")||(typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:"");if(h.length===0)continue;let _=(0,wn.derivePath)(h);if(_===null)continue;let y=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:"",S=y||efe(_)||f.slice(0,8);n.add(f),e.push({uid:f,git:h,folderName:_,label:S,namespace:y})}if(d.includes(Hx)){let p=u.exo__Asset_label;typeof p=="string"&&p.length>0&&t.set(f,p)}}}return{infos:e,profileLabels:t}}assertTsFloor(e,t){(0,wn.assertTsFloorReconciled)(e,t,wn.SDK_FLOOR)}buildDiff(e){let{targetProfileUid:t,targetProfileLabel:n,sourceProfileUid:i,sourceProfileLabel:s,result:o,infos:c}=e,l=new Map;for(let T of c)l.set(T.uid,T);let u=new Set(l.keys()),f=new Set,d=new Set;for(let T of o.declaredOntologies)if(u.has(T)){f.add(T);let O=l.get(T)?.namespace;O!==void 0&&O.length>0&&d.add(O)}this.assertTsFloor(f,d);let p=new Set([...o.effective,...f]),h=new Set;for(let T of c)(0,cl.existsSync)((0,vf.join)(this.vaultPath,T.folderName))&&h.add(T.uid);for(let T of c)wn.CATALOG_KEEP_NAMESPACES.has(T.namespace)&&h.has(T.uid)&&p.add(T.uid);let _=[];for(let T of c)h.has(T.uid)&&(p.has(T.uid)||_.push({asUid:T.uid,folderName:T.folderName,label:T.label,files:this.enumerateFilesUnder(T.folderName)}));let y=[];for(let T of p){if(h.has(T))continue;let O=l.get(T);O!==void 0&&y.push({asUid:O.uid,folderName:O.folderName,httpsUrl:Xue(O.git),label:O.label})}let S=new Map;for(let T of _)S.set(T.asUid,T.files);let w={targetProfileUid:t,targetProfileLabel:n,sourceProfileUid:i,sourceProfileLabel:s,filesToDestroy:S,assetSpacesBeingTornDown:_.map(T=>({asUid:T.asUid,asLabel:T.label,fileCount:T.files.length})),assetSpacesBeingMaterialized:y.map(T=>({asUid:T.asUid,asLabel:T.label}))};return{toDestroy:_,toMaterialize:y,plan:w}}async execute(e){let t=[],n=[];for(let i of e.toDestroy)this.mount.unmountAssetSpace(this.vaultPath,i.folderName),t.push(i.asUid);for(let i of e.toMaterialize){let s=(0,vf.join)(this.vaultPath,i.folderName);await this.mount.pullAssetSpace(i.httpsUrl,this.ref,s),this.mount.ensureGitmodulesEntry(this.vaultPath,i.folderName,i.httpsUrl),n.push(i.asUid)}return{destroyed:t,materialized:n}}enumerateFilesUnder(e){let t=[],i=[(0,vf.join)(this.vaultPath,e)];for(;i.length>0;){let s=i.pop(),o;try{o=(0,cl.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,vf.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith("."))continue;i.push(l);continue}c.isFile()&&t.push(Zue(l,this.vaultPath))}}return t}readFrontmatter(e){let t;try{t=(0,cl.readFileSync)(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,wn.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function Zue(r,e){let t=e.endsWith("/")?e:e+"/";return(r.startsWith(t)?r.slice(t.length):r).split("\\").join("/")}a(Zue,"relativeVaultPath");function efe(r){let e=r.split("/").filter(t=>t.length>0);return e.length>0?e[e.length-1]:""}a(efe,"lastSegment");var Cr=require("node:fs"),z$=require("node:crypto"),K$=require("node:child_process"),Y$=require("node:util"),Or=Se(require("node:path"));var lt=Se(it());var aa=require("node:fs"),q$=require("node:crypto"),Ci=Se(require("node:path"));var Oi=Se(it());var B$=require("node:child_process"),V$=Se(it());var tfe=6e4,ro=class r{static{a(this,"RestPushService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.apiBase=(e.apiBase??"https://api.github.com").replace(/\/$/,"")}static resolveGhToken(e){let t=e??(()=>(0,B$.execFileSync)("gh",["auth","token"],{encoding:"utf8",timeout:15e3})),n;try{n=t()}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`RestPushService: \`gh auth token\` failed \u2014 is GitHub CLI installed and authenticated? (run \`gh auth login\`). Underlying: ${o}`.replace(r.PAT_REGEX,"***REDACTED***"))}let i=n.trim();if(i.length===0)throw new Error("RestPushService: `gh auth token` returned empty output \u2014 not authenticated. Run `gh auth login`.");return i}redact(e){return(typeof e=="string"?e:String(e)).replace(r.PAT_REGEX,"***REDACTED***")}async push(e,t,n,i,s){return(0,V$.restCreateCommit)(this.buildTransport(),{owner:e,repo:t,branch:n,files:i,message:s,baseURL:this.apiBase,redact:a(o=>this.redact(o),"redact")})}transport(){return this.buildTransport()}buildTransport(){let e=this.token,t=this.fetchImpl,n=a(i=>this.redact(i),"redact");return async i=>{let s={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"exocortex-cli"};e.length>0&&(s.Authorization=`Bearer ${e}`),i.contentType&&(s["Content-Type"]=i.contentType);let o;try{o=await t(i.url,{method:i.method,headers:s,body:i.body,signal:AbortSignal.timeout(tfe)})}catch(u){throw new Error(n(`GitHub request failed: ${rfe(u)}`))}let c=await o.text().catch(()=>"");if(o.status<200||o.status>=300)throw new Error(nfe(n(`GitHub request ${i.method} ${i.url} \u2192 HTTP ${o.status}: ${c}`),512));let l;try{l=c.length>0?JSON.parse(c):void 0}catch{l=void 0}return{status:o.status,json:l,text:c}}}};function rfe(r){if(r instanceof Error)return r.message;if(typeof r=="string")return r;try{return JSON.stringify(r)}catch{return String(r)}}a(rfe,"errMsg");function nfe(r,e){return r.length>e?r.slice(0,e)+"...":r}a(nfe,"truncate");var ife=a(async r=>{let e=await q$.webcrypto.subtle.digest("SHA-1",r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),sfe={parse:a(r=>Ln.load(r,{schema:Ln.CORE_SCHEMA}),"parse"),stringify:a(r=>Ln.dump(r,{schema:Ln.CORE_SCHEMA,lineWidth:-1}),"stringify")};function ofe(r,e){if(r.tokenFromGh===!0)return ro.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,n=r.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(n.length===0)throw new Error("A GitHub token is required (private sync units read as 404 without one). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return n}a(ofe,"resolveToken");function afe(r){let e=a(n=>Ci.join(r,n),"abs"),t=a(async(n,i)=>{let s;try{s=await aa.promises.readdir(n,{withFileTypes:!0})}catch{return}for(let o of s){let c=Ci.join(n,o.name);if(o.isDirectory()){if(o.name===".git")continue;await t(c,i)}else o.isFile()&&i.push(Ci.relative(r,c).split(Ci.sep).join("/"))}},"walk");return{async list(){let n=[];return(0,aa.existsSync)(r)&&await t(r,n),n},read:a(n=>aa.promises.readFile(e(n),"utf-8"),"read"),async readBinary(n){return new Uint8Array(await aa.promises.readFile(e(n)))},async write(){throw new Error("exosync-parity is read-only \u2014 write refused")},async delete(){throw new Error("exosync-parity is read-only \u2014 delete refused")}}}a(afe,"nodeLocalFilesPort");function Af(r){let e=new $t(r),t=new Oi.SpaceSpecAccumulator;for(let n of e.getAllFiles()){let i=e.getFrontmatter(n);if(!i)continue;let s=(0,Oi.classifySpaceDeclaration)(i,n.path);if(s.kind==="not-space"||(s.warning!==void 0&&t.warnings.push(s.warning),s.kind==="skip"))continue;let o=t.offer(s.candidate);o!==null&&(0,aa.existsSync)(Ci.join(r,o.localPath))&&t.commit(s.candidate)}return{specs:t.specs,warnings:t.warnings}}a(Af,"collectVaultSpecs");function cfe(r,e){for(let t of r.repos){let n=t.headSha!==void 0?` @${t.headSha.slice(0,7)}`:"";e(`${t.repoKey}${n}: ${t.status} \u2014 ${t.inParity}/${t.filesChecked} in parity, M2 diffs ${t.m2SemanticDiffs}, accounted ${t.accountedCount}, M1 violations ${t.m1Violations.length}${t.attachmentHashSetIdentical!==void 0?`, attachment hash-set ${t.attachmentHashSetIdentical?"identical":"DIFFERS"}`:""}`),t.detail!==void 0&&e(` ${t.detail}`);for(let i of t.warnings)e(` warn: ${i}`);for(let i of t.discrepancies)e(` ${i.cls}: ${i.path}${i.detail!==void 0?` (${i.detail})`:""}`);for(let i of t.m1Violations)e(` M1 VIOLATION: ${i.path} \u2014 ${i.detail}`)}e((0,Oi.summarizeParityRound)(r))}a(cfe,"printHumanReport");async function lfe(r,e={}){let t=e.out??(_=>console.log(_)),n=Ci.resolve(r.vault);if(!(0,aa.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let i=ofe(r,e),s=new ro({token:i,...r.apiBase!==void 0?{apiBase:r.apiBase}:{}}),o=e.transportFactory?.(i,r.apiBase)??s.transport(),{specs:c,warnings:l}=Af(n);for(let _ of l)t(`warn: ${_}`);if(c.length===0)return t("Nothing to check \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let u=r.configDir??".obsidian",f=Ci.join(n,u,"plugins","exocortex",Oi.WATERMARK_STORE_FILENAME),d=new Oi.FileWatermarkStore({read:a(async()=>{try{return await aa.promises.readFile(f,"utf-8")}catch{return null}},"read"),writeAtomic:a(async()=>{throw new Error("exosync-parity: watermark access is read-only by contract")},"writeAtomic")}),p=new Oi.ParityValidator({transport:o,sha1:ife,localFilesFor:a(_=>afe(Ci.join(n,_.localPath)),"localFilesFor"),watermarks:{get:a(_=>d.get(_),"get")},yaml:sfe,redact:a(_=>s.redact(_),"redact"),...r.apiBase!==void 0?{baseURL:r.apiBase}:{}});t(`ExoSync parity check: ${c.length} repo(s), vault ${n}`);let h=await p.runRound(c,{trigger:"standalone"});return r.json===!0?t(JSON.stringify(h,null,2)):cfe(h,t),h.vacuous?2:h.ok?0:1}a(lfe,"runExosyncParity");function G$(){return new Le("exosync-parity").description("ExoSync M1/M2 parity report: compare materialized sync units against their remote heads (read-only; RFC 4e4dc453 Phase E)").requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--json","Print the full round record as JSON").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--api-base <url>","GitHub API base (testing)").action(async r=>{try{process.exitCode=await lfe(r)}catch(e){ve.handle(e,{command:"exosync-parity"}),process.exitCode=1}})}a(G$,"exosyncParityCommand");var hi=require("node:fs"),Kx=require("node:crypto"),ti=Se(require("node:path")),wr=Se(it());var ufe="exosync-watermarks.local.json";function W$(r,e,t){let n=Xx(e,t),i=new ro({token:n,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),s=t.transportFactory?.(n,e.apiBase)??i.transport(),{specs:o,warnings:c}=Af(r),l=e.configDir??".obsidian",u=ti.join(r,l,"plugins","exocortex",ufe),f=ti.join(r,l,"plugins","exocortex",wr.CONFLICT_CACHE_STORE_FILENAME),d=new wr.LocalConflictCacheStore({io:ca(f)}),p=ti.join(r,l,"plugins","exocortex",wr.OUTBOX_STORE_FILENAME),h=new wr.LocalOutboxStore({io:ca(p)});return{resolver:new wr.QuarantineResolver({transport:s,watermarkStore:new wr.FileWatermarkStore(ca(u)),localFilesFor:a(y=>fb(ti.join(r,y.localPath)),"localFilesFor"),sha1:Qx,...e.apiBase!==void 0?{baseURL:e.apiBase}:{},redact:a(y=>i.redact(y),"redact"),conflictCache:d,outbox:h}),specs:o,warnings:c}}a(W$,"buildResolver");async function ffe(r,e={}){let t=e.out??(l=>console.log(l)),n=ti.resolve(r.vault);if(!(0,hi.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let{resolver:i,specs:s,warnings:o}=W$(n,r,e);for(let l of o)t(`warn: ${l}`);if(s.length===0)return t("No materialized AssetSpaces with a GitHub source found in this vault."),0;let c=await i.listOpenConflicts(s);if(r.json===!0)return t(JSON.stringify(c,null,2)),0;if(c.length===0)return t("No open conflicts \u2014 nothing to resolve. \u2705"),0;t(`${c.length} open conflict(s):`);for(let l of c){let u=`${l.hasLocal?"local":"(no local)"} vs ${l.hasRemote?"remote":"(no remote)"}`;t(` ${l.repoKey} ${l.path} [${u}]${l.uid?` uid=${l.uid}`:""}`)}return t(""),t("Resolve with: exosync quarantine resolve <path> --take local|remote|file <path> --vault <vault>"),0}a(ffe,"runQuarantineList");async function dfe(r,e,t={}){let n=t.out??(S=>console.log(S)),i=ti.resolve(e.vault);if(!(0,hi.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=(e.take??"").trim();if(s!=="local"&&s!=="remote"&&s!=="file")throw new Error("resolve requires --take local | remote | file (with --file <path> for the merged content)");let o;if(s==="file"){if(e.file===void 0||e.file.length===0)throw new Error("--take file requires --file <path> to the merged content");o={take:"merged",content:await hi.promises.readFile(ti.resolve(e.file),"utf-8")}}else o={take:s};let{resolver:c,specs:l,warnings:u}=W$(i,e,t);for(let S of u)n(`warn: ${S}`);let d=(await c.listOpenConflicts(l)).filter(S=>S.path===r&&(e.repo===void 0||S.repoKey===e.repo));if(d.length===0)return n(`No open conflict for "${r}"${e.repo?` in ${e.repo}`:""} \u2014 run \`exosync quarantine list\` to see the current set.`),1;if(d.length>1){n(`"${r}" conflicts in ${d.length} repos \u2014 disambiguate with --repo <repoKey>:`);for(let S of d)n(` --repo ${S.repoKey}`);return 1}let p=d[0],h=l.find(S=>S.repoKey===p.repoKey),_=await c.resolve(h,p.path,o),y=_.awaitingPush===!0?" \u2014 awaiting push (run `exosync sync` to push it)":_.pushedSha!==void 0?` \u2014 pushed @${_.pushedSha.slice(0,7)}`:" \u2014 remote already matched";return n(`Resolved ${p.path} (${_.resolvedTo}) in ${p.repoKey}${y}.`),_.discardedLocalBackupPath!==void 0&&n(` \u21B3 your discarded local version is preserved at ${h.localPath}/${_.discardedLocalBackupPath}`),0}a(dfe,"runQuarantineResolve");function Yx(r){return r.replace(/\r\n?/g,`
|
|
605
|
-
`).replace(/\n+$/,"")}a(Yx,"normalizeForCompare");function pfe(r,e,t){let n=[...e].sort((o,c)=>o.path.localeCompare(c.path)),i=[],s=[];for(let o of n){let c=Yx(o.content),l=i.find(u=>u.norm===c);if(l!==void 0){s.push({action:"delete",path:o.path,identicalTo:l.path});continue}i.push({path:o.path,norm:c}),i.length===1?s.push({action:"keep",path:o.path,uid:r}):s.push({action:"reuuid",path:o.path,fromUid:r,toUid:t()})}return s}a(pfe,"planDedupGroup");async function hfe(r,e={}){let t=e.out??(f=>console.log(f)),n=ti.resolve(r.vault);if(!(0,hi.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let{specs:i,warnings:s}=Af(n);for(let f of s)t(`warn: ${f}`);let o=[];for(let f of i){let d=ti.join(n,f.localPath);if(!(0,hi.existsSync)(d))continue;let p=fb(d);for(let h of await p.list())if(h.endsWith(".md"))try{o.push({path:ti.join(d,h),content:await p.read(h)})}catch{continue}}let c=(0,wr.findDuplicateUidGroups)(o).map(f=>[f.uid,[...f.paths]]);if(c.length===0)return t("No duplicate uids on disk. \u2705"),0;let l=a(f=>ti.relative(n,f),"rel");if(r.auto===!0){let f=[];for(let[S,w]of c){let T=[],O=new Map;for(let A of w){let x=await hi.promises.readFile(A,"utf-8");T.push({path:A,content:x}),O.set(A,x)}f.push({uid:S,decisions:pfe(S,T,Kx.randomUUID),snap:O})}let d=0,p=0;t(`${c.length} duplicate uid(s) on disk \u2014 zero-loss plan:`);for(let{uid:S,decisions:w}of f){t(` ${S}:`);for(let T of w)T.action==="keep"?t(` KEEP ${l(T.path)} (keeps uid ${S})`):T.action==="reuuid"?(p++,t(` RE-UUID ${l(T.path)} (content differs \u2192 fresh uid; both survive, zero-loss)`)):(d++,t(` DELETE ${l(T.path)} (identical content \u2192 ${l(T.identicalTo)}; zero-loss)`))}if(r.apply!==!0)return t(""),t(`Plan: delete ${d} identical copy(ies), re-uuid ${p} differing variant(s).`),t("DRY-RUN \u2014 nothing changed. Re-run with `--auto --apply` to execute (a deleted copy's content always survives in the kept file; if previously synced it is also recoverable from the git remote)."),1;let h=0,_=0,y=0;for(let{decisions:S,snap:w}of f){for(let T of S){if(T.action!=="delete")continue;let O;try{O=await hi.promises.readFile(T.path,"utf-8")}catch{continue}if(Yx(O)!==Yx(w.get(T.path)??"")){t(` ! skipped delete ${l(T.path)} (changed since scan \u2014 re-run dedup-uids)`),y++;continue}await hi.promises.rm(T.path,{force:!0}),t(` deleted ${l(T.path)} (identical to ${l(T.identicalTo)})`),h++}for(let T of S){if(T.action!=="reuuid")continue;let O;try{O=await hi.promises.readFile(T.path,"utf-8")}catch{continue}if((0,wr.extractAssetUid)(O)!==T.fromUid){t(` ! skipped re-uuid ${l(T.path)} (uid changed since scan \u2014 re-run dedup-uids)`),y++;continue}let A=(0,wr.rewriteAssetUid)(O,T.toUid);A!==O&&(await hi.promises.writeFile(T.path,A,"utf-8"),t(` re-uuid ${l(T.path)} \u2192 uid=${T.toUid} (content differs from kept copy)`),_++)}}return t(`Resolved: deleted ${h} identical copy(ies), re-uuid ${_} differing variant(s).${y>0?` ${y} skipped (re-run).`:""} Run \`exosync sync\` to propagate.`),y>0?1:0}r.apply===!0&&t("Note: --apply only applies with --auto; running in report mode."),t(`${c.length} duplicate uid(s) on disk:`);for(let[f,d]of c){t(` ${f} \u2014 ${d.length} files:`);for(let p of d)t(` ${l(p)}`)}if(r.fix!==!0)return t(""),t("Re-run with --fix to assign a fresh uuid to every duplicate but the first (frontmatter rewrite only \u2014 never renames the file)."),1;let u=0;for(let f of(0,wr.planDuplicateUidFix)(o,Kx.randomUUID))await hi.promises.writeFile(f.path,f.content,"utf-8"),t(` fixed ${l(f.path)} \u2192 uid=${f.toUid}`),u++;return t(`Reassigned ${u} uid(s). Run \`exosync sync\` to propagate.`),0}a(hfe,"runDedupUids");function zx(r){return r.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Machine-readable output").option("--api-base <url>","GitHub API base (testing)")}a(zx,"withQuarantineOptions");function H$(r){let e=new Le("quarantine").description("Inspect and resolve ExoSync conflicts (quarantine resolver; RFC 4e4dc453, finding a0a3d1d6)");zx(e.command("list").description("List open conflicts that need a manual choice")).action(async t=>{try{process.exitCode=await ffe(t)}catch(n){ve.handle(n,{command:"exosync quarantine list"}),process.exitCode=1}}),zx(e.command("resolve <path>").description("Resolve one conflict: --take local | remote | file <path> (merged)").option("--take <choice>","local | remote | file").option("--file <path>","Merged content file (with --take file)").option("--repo <repoKey>","Disambiguate a cross-repo path collision")).action(async(t,n)=>{try{process.exitCode=await dfe(t,n)}catch(i){ve.handle(i,{command:"exosync quarantine resolve"}),process.exitCode=1}}),r.addCommand(e),zx(r.command("dedup-uids").description("Report duplicate exo__Asset_uid on disk (#3477); --fix re-uuids all but the first; --auto zero-loss auto-resolve (identical\u2192delete, differing\u2192re-uuid; dry-run unless --apply)").option("--fix","Assign a fresh uuid to every duplicate but the first").option("--auto","Zero-loss auto-resolve: delete identical copies, re-uuid distinct variants (DRY-RUN unless --apply). Supersedes --fix.").option("--apply","Execute the --auto plan (without it --auto is a dry-run; a deleted copy's content always survives in the kept file, and if previously synced is recoverable from the git remote)")).action(async t=>{try{process.exitCode=await hfe(t)}catch(n){ve.handle(n,{command:"exosync dedup-uids"}),process.exitCode=1}})}a(H$,"registerQuarantineCommands");var Qx=a(async r=>{let e=await z$.webcrypto.subtle.digest("SHA-1",r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),mfe={parse:a(r=>Ln.load(r,{schema:Ln.CORE_SCHEMA}),"parse"),stringify:a(r=>Ln.dump(r,{schema:Ln.CORE_SCHEMA,lineWidth:-1}),"stringify")};function Xx(r,e){if(r.tokenFromGh===!0)return ro.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,n=r.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(n.length===0)throw new Error("A GitHub token is required (private sync units read as 404 and push needs write scope). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return n}a(Xx,"resolveToken");function fb(r){let e=a(i=>Or.join(r,i),"abs"),t=a(async(i,s)=>{let o;try{o=await Cr.promises.readdir(i,{withFileTypes:!0})}catch{return}for(let c of o){let l=Or.join(i,c.name);if(c.isDirectory()){if(c.name===".git")continue;await t(l,s)}else c.isFile()&&s.push(Or.relative(r,l).split(Or.sep).join("/"))}},"walk"),n=a(async(i,s)=>{let o=Or.dirname(i);await Cr.promises.mkdir(o,{recursive:!0});let c=`${i}.local.tmp`;await s(c),await Cr.promises.rename(c,i)},"writeAtomic");return{async list(){let i=[];return(0,Cr.existsSync)(r)&&await t(r,i),i},read:a(i=>Cr.promises.readFile(e(i),"utf-8"),"read"),async write(i,s){await n(e(i),o=>Cr.promises.writeFile(o,s,"utf-8"))},async delete(i){await Cr.promises.rm(e(i),{force:!0})},async readBinary(i){return new Uint8Array(await Cr.promises.readFile(e(i)))},async writeBinary(i,s){let o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);await n(e(i),c=>Cr.promises.writeFile(c,Buffer.from(o)))},async stat(i){try{let s=await Cr.promises.stat(e(i));return{mtimeMs:s.mtimeMs,size:s.size}}catch{return null}}}}a(fb,"nodeLocalFilesPort");function ca(r){return{async read(){try{return await Cr.promises.readFile(r,"utf-8")}catch{return null}},async writeAtomic(e){await Cr.promises.mkdir(Or.dirname(r),{recursive:!0});let t=`${r}.local.tmp`;await Cr.promises.writeFile(t,e,"utf-8"),await Cr.promises.rename(t,r)}}}a(ca,"nodeWatermarkFileIO");function ll(r,e=".obsidian"){let t=Or.join(r,e,"plugins","exocortex",lt.MOUNT_BASE_STORE_FILENAME);return new lt.FileMountBaseStore(ca(t))}a(ll,"nodeMountBaseStore");var gfe=(0,Y$.promisify)(K$.execFile);function yfe(r){return async e=>{if(e.localPath.length===0||e.localPath.startsWith("-"))return null;try{let{stdout:t}=await gfe("git",["-C",r,"submodule","status",e.localPath],{timeout:3e4,maxBuffer:4194304}),n=t.match(/^[ +\-U]?([0-9a-f]{40})\b/m);return n?n[1]:null}catch{return null}}}a(yfe,"nodeLocalBaseShaProvider");function _fe(r){return{async check(e){let t=Or.join(r,e.localPath);if(!(0,Cr.existsSync)(t))return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} does not exist`};let n=0;try{n=(await Cr.promises.readdir(t)).length}catch{return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is not readable`}}return n===0&&e.spaceKind!=="file"?{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is empty (mid-mount?)`}:{fullyMaterialized:!0}}}}a(_fe,"nodeMaterializationCheck");function bfe(r,e){let t=r.pushedSha!==void 0?` \u2192@${r.pushedSha.slice(0,7)}`:"",n=(r.outboxPushedCount??0)>0?`, pushed ${r.outboxPushedCount} resolved`:"",i=(r.outboxReconflictedCount??0)>0?`, ${r.outboxReconflictedCount} re-conflicted (remote moved)`:"";e(`${r.repoKey}${t}: ${r.status} \u2014 pulled ${r.pulledCount}, pushed ${r.pushedCount}, merged ${r.mergedCount}, quarantined ${r.quarantinedCount}${(r.pushedDeletes?.length??0)>0?`, deleted ${r.pushedDeletes.length}`:""}${n}${i}`),r.detail!==void 0&&e(` ${r.detail}`);for(let s of r.warnings)e(` warn: ${s}`);(r.quarantinedPaths?.length??0)>0&&e(` quarantined (\u2192 exosync quarantine resolve): ${r.quarantinedPaths.join(", ")}`),(r.deferredPaths?.length??0)>0&&e(` deferred (\u2192 full sync): ${r.deferredPaths.join(", ")}`),(r.deferredDeletes?.length??0)>0&&e(` deferred deletes: ${r.deferredDeletes.join(", ")}`),r.timings!==void 0&&(0,lt.totalMs)(r.timings)>0&&e(` ${(0,lt.formatRepoTimings)(r.repoKey,r.timings)}`)}a(bfe,"printRepoResult");function Sfe(r){return r==="conflict"||r==="full-conflict"||r==="retry-exhausted"||r==="busy"||r==="auth-required"||r==="error"}a(Sfe,"isFailureStatus");async function wfe(r,e,t={}){let n=t.out??(P=>console.log(P)),i=Or.resolve(e.vault);if(!(0,Cr.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=Xx(e,t),o=new ro({token:s,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),c=t.transportFactory?.(s,e.apiBase)??o.transport(),{specs:l,warnings:u}=Af(i);for(let P of u)n(`warn: ${P}`);if(l.length===0)return n("Nothing to sync \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let f=e.configDir??".obsidian",d=Or.join(i,f,"plugins","exocortex",lt.WATERMARK_STORE_FILENAME),p=Or.join(i,f,"plugins","exocortex",lt.LOCAL_MANIFEST_STORE_FILENAME),h=Or.join(i,f,"plugins","exocortex",lt.CONFLICT_CACHE_STORE_FILENAME),_=new lt.LocalConflictCacheStore({io:ca(h)}),y=Or.join(i,f,"plugins","exocortex",lt.OUTBOX_STORE_FILENAME),S=new lt.LocalOutboxStore({io:ca(y)}),w=_,T=new lt.SyncEngine({transport:c,watermarkStore:new lt.FileWatermarkStore(ca(d)),localManifestStore:new lt.FileLocalManifestStore(ca(p)),mountBaseStore:ll(i,f),localBaseShaProvider:yfe(i),materializationCheck:_fe(i),localFilesFor:a(P=>fb(Or.join(i,P.localPath)),"localFilesFor"),sha1:Qx,redact:a(P=>o.redact(P),"redact"),commitMessage:a((P,V,j=0)=>`exosync: ${V} change(s)${j>0?`, ${j} deletion(s)`:""} (CLI)`,"commitMessage"),mergeLayer:new lt.GatedStructuredMerger(new lt.StructuredMerger(mfe)),quarantine:w,outbox:S,...e.apiBase!==void 0?{baseURL:e.apiBase}:{}});n(`ExoSync ${r}: ${l.length} repo(s), vault ${i}`);let O=(0,lt.orderChildrenFirst)(l),A=e.json===!0?void 0:P=>{n(`[ExoSync] ${P.repoKey}: ${(0,lt.syncProgressPhaseText)(P)}`)},x=await T.syncAll(O,r,A);if(e.json===!0)n(JSON.stringify(x,null,2));else{for(let j of x)bfe(j,n);let P=x.reduce((j,$)=>({pulled:j.pulled+$.pulledCount,pushed:j.pushed+$.pushedCount,merged:j.merged+$.mergedCount,quarantined:j.quarantined+$.quarantinedCount}),{pulled:0,pushed:0,merged:0,quarantined:0});n(`Summary: ${x.length} repo(s) \u2014 pulled ${P.pulled}, pushed ${P.pushed}, merged ${P.merged}, quarantined ${P.quarantined}`);let V=(0,lt.aggregateTimings)(x);(0,lt.totalMs)(V)>0&&n((0,lt.formatTimingsLine)(V))}return x.some(P=>Sfe(P.status))?1:0}a(wfe,"runExosyncSync");function Jx(r){return r.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Print the full per-repo result array as JSON").option("--api-base <url>","GitHub API base (testing)")}a(Jx,"withSyncOptions");function Zx(r){return async e=>{try{process.exitCode=await wfe(r,e)}catch(t){ve.handle(t,{command:`exosync ${r}`}),process.exitCode=1}}}a(Zx,"makeDirectionAction");function Q$(){let r=new Le("exosync").description("ExoSync over the GitHub REST API: sync/pull/push the materialized AssetSpace set (CLI parity with the plugin; RFC 4e4dc453 Phase B). Read-only divergence check: `exosync-parity`.");return Jx(r.command("sync").description("Full pull\u2192merge\u2192push cycle for every materialized repo")).action(Zx("sync")),Jx(r.command("pull").description("Apply remote changes only (nothing leaves the device; local changes re-derive)")).action(Zx("pull")),Jx(r.command("push").description("Send the local delta only (remote changes are pinned to re-derive on the next pull/sync)")).action(Zx("push")),H$(r),r}a(Q$,"exosyncCommand");var Efe=a(r=>{process.stderr.write(`${r}
|
|
606
|
-
`)},"DEFAULT_LOG"),db=class{static{a(this,"HeadlessConfirmGate")}constructor(e){this.yes=e.yes,this.verbose=e.verbose??!1,this.log=e.log??
|
|
603
|
+
`}a(Wue,"settingAsset");function M$(){return new Le("scaffold").description("Scaffold homoiconic configuration assets").addCommand(Hue())}a(M$,"scaffoldCommand");function Hue(){return new Le("validation-settings").description("Scaffold the 4 validation-check setting__Setting instances (uid-uniqueness=true, rest=false) co-located in the chosen ontology").requiredOption("--vault <path>","Vault root directory").requiredOption("--ontology <uid>","UID of the ontology whose folder the check settings are co-located in").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";ve.setFormat(e);try{let t=(0,al.resolve)(r.vault);if(!(0,ob.existsSync)(t)||!(0,ob.statSync)(t).isDirectory())throw new Je(t);let s=(await new Zn(t).indexedAssets()).find(u=>(0,to.readUid)(u.metadata)===r.ontology);if(!s)throw new Error(`Ontology UID "${r.ontology}" not found in vault ${t} (its folder is where the check settings co-locate).`);let o=(0,al.join)(t,(0,al.dirname)(s.path)),c=new Date().toISOString().slice(0,19),l=[];for(let u of Gue){let f=(0,k$.randomUUID)(),d=(0,al.join)(o,`${f}.md`);await(0,N$.writeFile)(d,Wue(f,r.ontology,u.checkId,u.label,u.value,c),"utf-8"),l.push(d)}if(e==="json")console.log(JSON.stringify({vaultPath:t,ontology:r.ontology,targetDir:o,created:l},null,2));else{console.log(`OK: scaffolded ${l.length} validation-check setting(s) in ${o}`);for(let u of l)console.log(` ${u}`);console.log(`
|
|
604
|
+
Defaults: uid-uniqueness=true, co-location/shacl/dag=false. Run 'exocortex validate vault --vault <path>'.`)}}catch(t){ve.handle(t)}})}a(Hue,"scaffoldValidationCommand");var X$=require("fs"),J$=require("path");var ab=Se(Qo()),cb=Se(require("path")),tc=Se(it()),ub=Se(it());var zue=tc.SDK_FLOOR_ASSETSPACE_UIDS,lh="73bd00e4-ccc0-4f3f-b20d-c4388c4588fb",Hx="3de846cd-1f0e-4f98-8613-b8587aa15174",Kue=5,lb=class{static{a(this,"CliProfileResolver")}constructor(e){this.vaultPaths=[cb.default.resolve(e.vaultPath)],this.maxExtendsDepth=e.maxExtendsDepth??Kue,this.warn=e.warn??(()=>{})}async resolveFilter(e){if(e==null||e==="")return{outcome:"no-profile"};let t;try{t=await this.scanAllVaults()}catch(f){let d=`[CliProfileResolver] vault scan threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}if(t.profiles.get(e)===void 0)return this.warn(`[CliProfileResolver] profileUid=${e} not found in any scanned vault \u2014 falling back to no-filter (full vault).`),{outcome:"missing-profile",profileUid:e};let i=new Set;try{this.walkProfileChain(e,t.profiles,i,new Set,0)}catch(f){let d=`[CliProfileResolver] profile chain walk threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}let s=(0,tc.transitiveDependsOnClosure)(i,t.dependsOn),o=new Set(t.folderMap.values()),c=new Set,l=[];for(let f of s){if(o.has(f)){c.add(f);continue}l.push(f)}for(let f of zue)c.add(f);if(!Array.from(c).some(f=>o.has(f))){let f=`[CliProfileResolver] profileUid=${e} produced effective set with zero AssetSpace folder overlap (${c.size} AS UIDs incl. floor; ${t.folderMap.size} folders known). Likely cause: profile declares AssetSpace UIDs not present as descriptors, or vault has no scanned AssetSpaces. Falling back to no-filter (full vault indexed).`;return this.warn(f),{outcome:"degraded",reason:f}}return{outcome:"engaged",result:{effective:c,folderMap:t.folderMap,declaredOntologies:s,untranslated:l}}}walkProfileChain(e,t,n,i,s){if(s>this.maxExtendsDepth)throw new Error(`Profile chain exceeds max depth ${this.maxExtendsDepth} at ${e} \u2014 possible cycle`);if(i.has(e))return;i.add(e);let o=t.get(e);if(o!==void 0){for(let c of o.includes)n.add(c);typeof o.extends=="string"&&o.extends.length>0&&this.walkProfileChain(o.extends,t,n,i,s+1)}}async scanAllVaults(){let e=new Map,t=new Map,n=new Map;for(let i of this.vaultPaths){if(!await ab.default.pathExists(i)){this.warn(`[CliProfileResolver] vault path does not exist: ${i} \u2014 skipping.`);continue}let s=await this.walkVault(i);for(let o of s){let c=sa(o.frontmatter.exo__Instance_class);if(c.some(l=>l===lh)){let l=Que(o.filePath,o.vaultRoot);l.length>0&&!e.has(l)&&e.set(l,o.uid);let u=typeof o.frontmatter.exo__AssetSpace_source=="string"?o.frontmatter.exo__AssetSpace_source:typeof o.frontmatter.exo__AssetSpace_git=="string"?o.frontmatter.exo__AssetSpace_git:"";if(u.length>0){let d=(0,tc.derivePath)(u);d!==null&&e.set(d,o.uid)}let f=sa(o.frontmatter.exo__AssetSpace_dependsOn);f.length>0&&n.set(o.uid,f)}if(c.some(l=>l===Hx)){let l={uid:o.uid,label:typeof o.frontmatter.exo__Asset_label=="string"?o.frontmatter.exo__Asset_label:void 0,includes:sa(o.frontmatter.exo__Profile_includes),extends:sa(o.frontmatter.exo__Profile_imports)[0]??null};t.set(o.uid,l)}}}return{folderMap:e,profiles:t,dependsOn:n}}async walkVault(e){let t=[],n=[e];for(;n.length>0;){let i=n.pop(),s;try{s=await ab.default.readdir(i,{withFileTypes:!0})}catch{continue}for(let o of s){let c=cb.default.join(i,o.name);if(o.isDirectory()){if(o.name.startsWith(".")||o.name==="node_modules"||o.name===".obsidian"||o.name===".exocortex")continue;n.push(c);continue}if(!o.isFile()||!o.name.endsWith(".md"))continue;let l=await this.tryReadFrontmatter(c);if(l===null)continue;let u=l.exo__Asset_uid;typeof u!="string"||u.length===0||t.push({uid:u,filePath:c,vaultRoot:e,frontmatter:l})}}return t}async tryReadFrontmatter(e){let t;try{t=await ab.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,tc.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function sa(r){if(r==null)return[];let e=Array.isArray(r)?r:[r],t=[];for(let n of e){if(typeof n!="string")continue;let i=Yue(n);i!==null&&t.push(i)}return t}a(sa,"parseWikilinkArray");function Yue(r){let e=r.trim().replace(/^\[\[/,"").replace(/\]\]$/,"").split("|")[0].trim();return e.length===0?null:e}a(Yue,"extractUidFromWikilink");function Que(r,e){let t=cb.default.relative(e,r).replace(/\\/g,"/");if(!t.startsWith("assetspaces/"))return"";let n=t.slice(12),i=n.indexOf("/");return i<0?"":`assetspaces/${n.slice(0,i)}`}a(Que,"parentFolderRelative");var cl=require("node:fs"),vf=require("node:path"),wn=Se(it());var Lt=require("node:fs"),$$=require("node:fs/promises"),U$=require("node:os"),Sn=require("node:path"),oa=Se(it());var Xue=/^https:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:\.git)?$/,j$=50*1024*1024,ei=class r{static{a(this,"BootstrapAssetSpaceService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.mountBaseStore=e.mountBaseStore}redact(e){return(typeof e=="string"?e:String(e)).replace(r.PAT_REGEX,"***REDACTED***")}static parseGitHubURL(e){let t=e.match(Xue);if(t===null)throw new Error(`parseGitHubURL: invalid URL shape \u2014 expected https://github.com/<owner>/<repo>, got: ${e}`);return{owner:t[1],repo:t[2]}}static deriveFolderName(e){let{repo:t}=r.parseGitHubURL(e);return t.startsWith("exoas-")?t.slice(6):t}async pullAssetSpace(e,t,n){let{owner:i,repo:s}=r.parseGitHubURL(e);if((0,Lt.existsSync)(n)&&(0,Lt.readdirSync)(n).length>0)throw new Error(`pullAssetSpace: target ${n} exists \u0438 not empty \u2014 refusing \u043A overwrite`);let o=await(0,oa.mountAssetSpaceFiles)({http:this.httpPort(),fs:this.fsPort(),owner:i,repo:s,ref:t,targetPath:n});if(this.mountBaseStore!==void 0)try{await this.mountBaseStore.set(`${i}/${s}#${oa.SYNC_BRANCH}`,o.sha)}catch{}return o}httpPort(){let e=this.fetchImpl,t=this.token,n=a(i=>this.redact(i),"redact");return{async fetchTarball(i,s,o){let c=`https://api.github.com/repos/${i}/${s}/tarball/${o}`,l={signal:AbortSignal.timeout(6e4)};t.length>0&&(l.headers={Authorization:`Bearer ${t}`,"User-Agent":"exocortex-cli","X-GitHub-Api-Version":"2022-11-28"});let u;try{u=await e(c,l)}catch(d){throw new Error(n(`pullAssetSpace: fetch error for ${c}: ${d instanceof Error?d.message:String(d)}`))}if(!u.ok){if(u.status===403){let d=u.headers?.get?.("x-ratelimit-remaining"),p=u.headers?.get?.("x-ratelimit-reset");if(d==="0"||p!=null){let h=p!=null?new Date(Number(p)*1e3).toISOString():"unknown";throw new Error(`pullAssetSpace: GitHub anonymous API rate-limit exceeded (60 req/hour). Reset at ${h}. Wait or use authenticated CLI.`)}}if(u.status===404){let d=t.length>0?"repo not found, or the provided token lacks access to it":"if this is a private repo, pass --token <pat> (or set GITHUB_TOKEN / GH_TOKEN)";throw new Error(n(`pullAssetSpace: fetch failed (404 Not Found) for ${c} \u2014 ${d}`))}throw new Error(n(`pullAssetSpace: fetch failed (${u.status} ${u.statusText}) for ${c}`))}let f=await u.arrayBuffer();if(f.byteLength>j$)throw new Error(`pullAssetSpace: tarball too large (${f.byteLength} bytes > ${j$})`);return new Uint8Array(f)}}}fsPort(){return{async exists(e){return(0,Lt.existsSync)(e)},async read(e){return(0,Lt.readFileSync)(e,"utf8")},async write(e,t){(0,Lt.writeFileSync)(e,t,{encoding:"utf8"})},async removeDir(e){(0,Lt.rmSync)(e,{recursive:!0,force:!0})},async materialize(e,t,n){let i=await(0,$$.mkdtemp)((0,Sn.join)((0,U$.tmpdir)(),`exo-bootstrap-${(0,Sn.basename)(e)}-`)),s=0;try{for(let o of t){let c=o.relPath;if(c.split("/").some(u=>u===".."))throw new Error(`pullAssetSpace: path traversal detected for entry "${c}"`);let l=(0,Sn.resolve)(i,c);if(l!==i&&!l.startsWith(i+Sn.sep))throw new Error(`pullAssetSpace: zip-slip detected for entry "${c}"`);(0,Lt.mkdirSync)((0,Sn.dirname)(l),{recursive:!0}),(0,Lt.writeFileSync)(l,o.content),s++,n?.(s)}(0,Lt.mkdirSync)((0,Sn.dirname)(e),{recursive:!0});try{(0,Lt.renameSync)(i,e)}catch(o){if(o.code==="EXDEV"){let{cpSync:c}=await import("node:fs");c(i,e,{recursive:!0}),(0,Lt.rmSync)(i,{recursive:!0,force:!0})}else throw o}}catch(o){throw(0,Lt.rmSync)(i,{recursive:!0,force:!0}),o}return s}}}ensureGitmodulesEntry(e,t,n){let i=(0,Sn.join)(e,".gitmodules"),s="";try{s=(0,Lt.readFileSync)(i,"utf8")}catch(l){if(l.code!=="ENOENT")throw l}let{content:o,added:c}=(0,oa.appendGitmodulesEntry)(s,t,n);return c?((0,Lt.appendFileSync)(i,o.slice(s.length),{encoding:"utf8"}),{added:!0}):{added:!1}}removeGitmodulesEntry(e,t){let n=(0,Sn.join)(e,".gitmodules"),i;try{i=(0,Lt.readFileSync)(n,"utf8")}catch(o){if(o.code==="ENOENT")return{removed:!1};throw o}let s=(0,oa.stripGitmodulesEntry)(i,t);return s===i?{removed:!1}:((0,Lt.writeFileSync)(n,s,{encoding:"utf8"}),{removed:!0})}static stripGitmodulesEntry(e,t){return(0,oa.stripGitmodulesEntry)(e,t)}unmountAssetSpace(e,t){let n=t.split("/");if(t.length===0||!t.startsWith("assetspaces/")||n.some(o=>o.length===0||o==="."||o===".."))throw new Error(`unmountAssetSpace: refusing unsafe submodulePath "${t}"`);let i=(0,Sn.resolve)(e),s=(0,Sn.resolve)(i,t);if(s===i||!s.startsWith(i+Sn.sep))throw new Error(`unmountAssetSpace: target "${s}" escapes vault root "${i}"`);this.removeGitmodulesEntry(e,t),(0,Lt.existsSync)(s)&&(0,Lt.rmSync)(s,{recursive:!0,force:!0})}};function Jue(r){let e=(0,wn.derivePath)(r);return e===null?r:(0,wn.deriveUrl)(e)??r}a(Jue,"toHttpsGitHubUrl");var Zue=new Set(["node_modules",".obsidian",".exocortex",".git"]),Tf=class{static{a(this,"CliApplyProfileService")}constructor(e){this.vaultPath=e.vaultPath,this.mount=e.mount??new ei,this.ref=e.ref??"main"}scanVault(){let e=[],t=new Map,n=new Set,i=[this.vaultPath];for(;i.length>0;){let s=i.pop(),o;try{o=(0,cl.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,vf.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||Zue.has(c.name))continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=this.readFrontmatter(l);if(u===null)continue;let f=u.exo__Asset_uid;if(typeof f!="string"||f.length===0)continue;let d=sa(u.exo__Instance_class);if(d.includes(lh)){if(n.has(f))continue;let h=(typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:"")||(typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:"");if(h.length===0)continue;let _=(0,wn.derivePath)(h);if(_===null)continue;let y=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:"",S=y||tfe(_)||f.slice(0,8);n.add(f),e.push({uid:f,git:h,folderName:_,label:S,namespace:y})}if(d.includes(Hx)){let p=u.exo__Asset_label;typeof p=="string"&&p.length>0&&t.set(f,p)}}}return{infos:e,profileLabels:t}}assertTsFloor(e,t){(0,wn.assertTsFloorReconciled)(e,t,wn.SDK_FLOOR)}buildDiff(e){let{targetProfileUid:t,targetProfileLabel:n,sourceProfileUid:i,sourceProfileLabel:s,result:o,infos:c}=e,l=new Map;for(let T of c)l.set(T.uid,T);let u=new Set(l.keys()),f=new Set,d=new Set;for(let T of o.declaredOntologies)if(u.has(T)){f.add(T);let O=l.get(T)?.namespace;O!==void 0&&O.length>0&&d.add(O)}this.assertTsFloor(f,d);let p=new Set([...o.effective,...f]),h=new Set;for(let T of c)(0,cl.existsSync)((0,vf.join)(this.vaultPath,T.folderName))&&h.add(T.uid);for(let T of c)wn.CATALOG_KEEP_NAMESPACES.has(T.namespace)&&h.has(T.uid)&&p.add(T.uid);let _=[];for(let T of c)h.has(T.uid)&&(p.has(T.uid)||_.push({asUid:T.uid,folderName:T.folderName,label:T.label,files:this.enumerateFilesUnder(T.folderName)}));let y=[];for(let T of p){if(h.has(T))continue;let O=l.get(T);O!==void 0&&y.push({asUid:O.uid,folderName:O.folderName,httpsUrl:Jue(O.git),label:O.label})}let S=new Map;for(let T of _)S.set(T.asUid,T.files);let w={targetProfileUid:t,targetProfileLabel:n,sourceProfileUid:i,sourceProfileLabel:s,filesToDestroy:S,assetSpacesBeingTornDown:_.map(T=>({asUid:T.asUid,asLabel:T.label,fileCount:T.files.length})),assetSpacesBeingMaterialized:y.map(T=>({asUid:T.asUid,asLabel:T.label}))};return{toDestroy:_,toMaterialize:y,plan:w}}async execute(e){let t=[],n=[];for(let i of e.toDestroy)this.mount.unmountAssetSpace(this.vaultPath,i.folderName),t.push(i.asUid);for(let i of e.toMaterialize){let s=(0,vf.join)(this.vaultPath,i.folderName);await this.mount.pullAssetSpace(i.httpsUrl,this.ref,s),this.mount.ensureGitmodulesEntry(this.vaultPath,i.folderName,i.httpsUrl),n.push(i.asUid)}return{destroyed:t,materialized:n}}enumerateFilesUnder(e){let t=[],i=[(0,vf.join)(this.vaultPath,e)];for(;i.length>0;){let s=i.pop(),o;try{o=(0,cl.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,vf.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith("."))continue;i.push(l);continue}c.isFile()&&t.push(efe(l,this.vaultPath))}}return t}readFrontmatter(e){let t;try{t=(0,cl.readFileSync)(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,wn.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function efe(r,e){let t=e.endsWith("/")?e:e+"/";return(r.startsWith(t)?r.slice(t.length):r).split("\\").join("/")}a(efe,"relativeVaultPath");function tfe(r){let e=r.split("/").filter(t=>t.length>0);return e.length>0?e[e.length-1]:""}a(tfe,"lastSegment");var Cr=require("node:fs"),z$=require("node:crypto"),K$=require("node:child_process"),Y$=require("node:util"),Or=Se(require("node:path"));var lt=Se(it());var aa=require("node:fs"),q$=require("node:crypto"),Ci=Se(require("node:path"));var Oi=Se(it());var B$=require("node:child_process"),V$=Se(it());var rfe=6e4,ro=class r{static{a(this,"RestPushService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.apiBase=(e.apiBase??"https://api.github.com").replace(/\/$/,"")}static resolveGhToken(e){let t=e??(()=>(0,B$.execFileSync)("gh",["auth","token"],{encoding:"utf8",timeout:15e3})),n;try{n=t()}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`RestPushService: \`gh auth token\` failed \u2014 is GitHub CLI installed and authenticated? (run \`gh auth login\`). Underlying: ${o}`.replace(r.PAT_REGEX,"***REDACTED***"))}let i=n.trim();if(i.length===0)throw new Error("RestPushService: `gh auth token` returned empty output \u2014 not authenticated. Run `gh auth login`.");return i}redact(e){return(typeof e=="string"?e:String(e)).replace(r.PAT_REGEX,"***REDACTED***")}async push(e,t,n,i,s){return(0,V$.restCreateCommit)(this.buildTransport(),{owner:e,repo:t,branch:n,files:i,message:s,baseURL:this.apiBase,redact:a(o=>this.redact(o),"redact")})}transport(){return this.buildTransport()}buildTransport(){let e=this.token,t=this.fetchImpl,n=a(i=>this.redact(i),"redact");return async i=>{let s={Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"exocortex-cli"};e.length>0&&(s.Authorization=`Bearer ${e}`),i.contentType&&(s["Content-Type"]=i.contentType);let o;try{o=await t(i.url,{method:i.method,headers:s,body:i.body,signal:AbortSignal.timeout(rfe)})}catch(u){throw new Error(n(`GitHub request failed: ${nfe(u)}`))}let c=await o.text().catch(()=>"");if(o.status<200||o.status>=300)throw new Error(ife(n(`GitHub request ${i.method} ${i.url} \u2192 HTTP ${o.status}: ${c}`),512));let l;try{l=c.length>0?JSON.parse(c):void 0}catch{l=void 0}return{status:o.status,json:l,text:c}}}};function nfe(r){if(r instanceof Error)return r.message;if(typeof r=="string")return r;try{return JSON.stringify(r)}catch{return String(r)}}a(nfe,"errMsg");function ife(r,e){return r.length>e?r.slice(0,e)+"...":r}a(ife,"truncate");var sfe=a(async r=>{let e=await q$.webcrypto.subtle.digest("SHA-1",r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),ofe={parse:a(r=>Ln.load(r,{schema:Ln.CORE_SCHEMA}),"parse"),stringify:a(r=>Ln.dump(r,{schema:Ln.CORE_SCHEMA,lineWidth:-1}),"stringify")};function afe(r,e){if(r.tokenFromGh===!0)return ro.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,n=r.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(n.length===0)throw new Error("A GitHub token is required (private sync units read as 404 without one). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return n}a(afe,"resolveToken");function cfe(r){let e=a(n=>Ci.join(r,n),"abs"),t=a(async(n,i)=>{let s;try{s=await aa.promises.readdir(n,{withFileTypes:!0})}catch{return}for(let o of s){let c=Ci.join(n,o.name);if(o.isDirectory()){if(o.name===".git")continue;await t(c,i)}else o.isFile()&&i.push(Ci.relative(r,c).split(Ci.sep).join("/"))}},"walk");return{async list(){let n=[];return(0,aa.existsSync)(r)&&await t(r,n),n},read:a(n=>aa.promises.readFile(e(n),"utf-8"),"read"),async readBinary(n){return new Uint8Array(await aa.promises.readFile(e(n)))},async write(){throw new Error("exosync-parity is read-only \u2014 write refused")},async delete(){throw new Error("exosync-parity is read-only \u2014 delete refused")}}}a(cfe,"nodeLocalFilesPort");function Af(r){let e=new $t(r),t=new Oi.SpaceSpecAccumulator;for(let n of e.getAllFiles()){let i=e.getFrontmatter(n);if(!i)continue;let s=(0,Oi.classifySpaceDeclaration)(i,n.path);if(s.kind==="not-space"||(s.warning!==void 0&&t.warnings.push(s.warning),s.kind==="skip"))continue;let o=t.offer(s.candidate);o!==null&&(0,aa.existsSync)(Ci.join(r,o.localPath))&&t.commit(s.candidate)}return{specs:t.specs,warnings:t.warnings}}a(Af,"collectVaultSpecs");function lfe(r,e){for(let t of r.repos){let n=t.headSha!==void 0?` @${t.headSha.slice(0,7)}`:"";e(`${t.repoKey}${n}: ${t.status} \u2014 ${t.inParity}/${t.filesChecked} in parity, M2 diffs ${t.m2SemanticDiffs}, accounted ${t.accountedCount}, M1 violations ${t.m1Violations.length}${t.attachmentHashSetIdentical!==void 0?`, attachment hash-set ${t.attachmentHashSetIdentical?"identical":"DIFFERS"}`:""}`),t.detail!==void 0&&e(` ${t.detail}`);for(let i of t.warnings)e(` warn: ${i}`);for(let i of t.discrepancies)e(` ${i.cls}: ${i.path}${i.detail!==void 0?` (${i.detail})`:""}`);for(let i of t.m1Violations)e(` M1 VIOLATION: ${i.path} \u2014 ${i.detail}`)}e((0,Oi.summarizeParityRound)(r))}a(lfe,"printHumanReport");async function ufe(r,e={}){let t=e.out??(_=>console.log(_)),n=Ci.resolve(r.vault);if(!(0,aa.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let i=afe(r,e),s=new ro({token:i,...r.apiBase!==void 0?{apiBase:r.apiBase}:{}}),o=e.transportFactory?.(i,r.apiBase)??s.transport(),{specs:c,warnings:l}=Af(n);for(let _ of l)t(`warn: ${_}`);if(c.length===0)return t("Nothing to check \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let u=r.configDir??".obsidian",f=Ci.join(n,u,"plugins","exocortex",Oi.WATERMARK_STORE_FILENAME),d=new Oi.FileWatermarkStore({read:a(async()=>{try{return await aa.promises.readFile(f,"utf-8")}catch{return null}},"read"),writeAtomic:a(async()=>{throw new Error("exosync-parity: watermark access is read-only by contract")},"writeAtomic")}),p=new Oi.ParityValidator({transport:o,sha1:sfe,localFilesFor:a(_=>cfe(Ci.join(n,_.localPath)),"localFilesFor"),watermarks:{get:a(_=>d.get(_),"get")},yaml:ofe,redact:a(_=>s.redact(_),"redact"),...r.apiBase!==void 0?{baseURL:r.apiBase}:{}});t(`ExoSync parity check: ${c.length} repo(s), vault ${n}`);let h=await p.runRound(c,{trigger:"standalone"});return r.json===!0?t(JSON.stringify(h,null,2)):lfe(h,t),h.vacuous?2:h.ok?0:1}a(ufe,"runExosyncParity");function G$(){return new Le("exosync-parity").description("ExoSync M1/M2 parity report: compare materialized sync units against their remote heads (read-only; RFC 4e4dc453 Phase E)").requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--json","Print the full round record as JSON").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--api-base <url>","GitHub API base (testing)").action(async r=>{try{process.exitCode=await ufe(r)}catch(e){ve.handle(e,{command:"exosync-parity"}),process.exitCode=1}})}a(G$,"exosyncParityCommand");var hi=require("node:fs"),Kx=require("node:crypto"),ti=Se(require("node:path")),wr=Se(it());var ffe="exosync-watermarks.local.json";function W$(r,e,t){let n=Xx(e,t),i=new ro({token:n,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),s=t.transportFactory?.(n,e.apiBase)??i.transport(),{specs:o,warnings:c}=Af(r),l=e.configDir??".obsidian",u=ti.join(r,l,"plugins","exocortex",ffe),f=ti.join(r,l,"plugins","exocortex",wr.CONFLICT_CACHE_STORE_FILENAME),d=new wr.LocalConflictCacheStore({io:ca(f)}),p=ti.join(r,l,"plugins","exocortex",wr.OUTBOX_STORE_FILENAME),h=new wr.LocalOutboxStore({io:ca(p)});return{resolver:new wr.QuarantineResolver({transport:s,watermarkStore:new wr.FileWatermarkStore(ca(u)),localFilesFor:a(y=>fb(ti.join(r,y.localPath)),"localFilesFor"),sha1:Qx,...e.apiBase!==void 0?{baseURL:e.apiBase}:{},redact:a(y=>i.redact(y),"redact"),conflictCache:d,outbox:h}),specs:o,warnings:c}}a(W$,"buildResolver");async function dfe(r,e={}){let t=e.out??(l=>console.log(l)),n=ti.resolve(r.vault);if(!(0,hi.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let{resolver:i,specs:s,warnings:o}=W$(n,r,e);for(let l of o)t(`warn: ${l}`);if(s.length===0)return t("No materialized AssetSpaces with a GitHub source found in this vault."),0;let c=await i.listOpenConflicts(s);if(r.json===!0)return t(JSON.stringify(c,null,2)),0;if(c.length===0)return t("No open conflicts \u2014 nothing to resolve. \u2705"),0;t(`${c.length} open conflict(s):`);for(let l of c){let u=`${l.hasLocal?"local":"(no local)"} vs ${l.hasRemote?"remote":"(no remote)"}`;t(` ${l.repoKey} ${l.path} [${u}]${l.uid?` uid=${l.uid}`:""}`)}return t(""),t("Resolve with: exosync quarantine resolve <path> --take local|remote|file <path> --vault <vault>"),0}a(dfe,"runQuarantineList");async function pfe(r,e,t={}){let n=t.out??(S=>console.log(S)),i=ti.resolve(e.vault);if(!(0,hi.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=(e.take??"").trim();if(s!=="local"&&s!=="remote"&&s!=="file")throw new Error("resolve requires --take local | remote | file (with --file <path> for the merged content)");let o;if(s==="file"){if(e.file===void 0||e.file.length===0)throw new Error("--take file requires --file <path> to the merged content");o={take:"merged",content:await hi.promises.readFile(ti.resolve(e.file),"utf-8")}}else o={take:s};let{resolver:c,specs:l,warnings:u}=W$(i,e,t);for(let S of u)n(`warn: ${S}`);let d=(await c.listOpenConflicts(l)).filter(S=>S.path===r&&(e.repo===void 0||S.repoKey===e.repo));if(d.length===0)return n(`No open conflict for "${r}"${e.repo?` in ${e.repo}`:""} \u2014 run \`exosync quarantine list\` to see the current set.`),1;if(d.length>1){n(`"${r}" conflicts in ${d.length} repos \u2014 disambiguate with --repo <repoKey>:`);for(let S of d)n(` --repo ${S.repoKey}`);return 1}let p=d[0],h=l.find(S=>S.repoKey===p.repoKey),_=await c.resolve(h,p.path,o),y=_.awaitingPush===!0?" \u2014 awaiting push (run `exosync sync` to push it)":_.pushedSha!==void 0?` \u2014 pushed @${_.pushedSha.slice(0,7)}`:" \u2014 remote already matched";return n(`Resolved ${p.path} (${_.resolvedTo}) in ${p.repoKey}${y}.`),_.discardedLocalBackupPath!==void 0&&n(` \u21B3 your discarded local version is preserved at ${h.localPath}/${_.discardedLocalBackupPath}`),0}a(pfe,"runQuarantineResolve");function Yx(r){return r.replace(/\r\n?/g,`
|
|
605
|
+
`).replace(/\n+$/,"")}a(Yx,"normalizeForCompare");function hfe(r,e,t){let n=[...e].sort((o,c)=>o.path.localeCompare(c.path)),i=[],s=[];for(let o of n){let c=Yx(o.content),l=i.find(u=>u.norm===c);if(l!==void 0){s.push({action:"delete",path:o.path,identicalTo:l.path});continue}i.push({path:o.path,norm:c}),i.length===1?s.push({action:"keep",path:o.path,uid:r}):s.push({action:"reuuid",path:o.path,fromUid:r,toUid:t()})}return s}a(hfe,"planDedupGroup");async function mfe(r,e={}){let t=e.out??(f=>console.log(f)),n=ti.resolve(r.vault);if(!(0,hi.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let{specs:i,warnings:s}=Af(n);for(let f of s)t(`warn: ${f}`);let o=[];for(let f of i){let d=ti.join(n,f.localPath);if(!(0,hi.existsSync)(d))continue;let p=fb(d);for(let h of await p.list())if(h.endsWith(".md"))try{o.push({path:ti.join(d,h),content:await p.read(h)})}catch{continue}}let c=(0,wr.findDuplicateUidGroups)(o).map(f=>[f.uid,[...f.paths]]);if(c.length===0)return t("No duplicate uids on disk. \u2705"),0;let l=a(f=>ti.relative(n,f),"rel");if(r.auto===!0){let f=[];for(let[S,w]of c){let T=[],O=new Map;for(let A of w){let x=await hi.promises.readFile(A,"utf-8");T.push({path:A,content:x}),O.set(A,x)}f.push({uid:S,decisions:hfe(S,T,Kx.randomUUID),snap:O})}let d=0,p=0;t(`${c.length} duplicate uid(s) on disk \u2014 zero-loss plan:`);for(let{uid:S,decisions:w}of f){t(` ${S}:`);for(let T of w)T.action==="keep"?t(` KEEP ${l(T.path)} (keeps uid ${S})`):T.action==="reuuid"?(p++,t(` RE-UUID ${l(T.path)} (content differs \u2192 fresh uid; both survive, zero-loss)`)):(d++,t(` DELETE ${l(T.path)} (identical content \u2192 ${l(T.identicalTo)}; zero-loss)`))}if(r.apply!==!0)return t(""),t(`Plan: delete ${d} identical copy(ies), re-uuid ${p} differing variant(s).`),t("DRY-RUN \u2014 nothing changed. Re-run with `--auto --apply` to execute (a deleted copy's content always survives in the kept file; if previously synced it is also recoverable from the git remote)."),1;let h=0,_=0,y=0;for(let{decisions:S,snap:w}of f){for(let T of S){if(T.action!=="delete")continue;let O;try{O=await hi.promises.readFile(T.path,"utf-8")}catch{continue}if(Yx(O)!==Yx(w.get(T.path)??"")){t(` ! skipped delete ${l(T.path)} (changed since scan \u2014 re-run dedup-uids)`),y++;continue}await hi.promises.rm(T.path,{force:!0}),t(` deleted ${l(T.path)} (identical to ${l(T.identicalTo)})`),h++}for(let T of S){if(T.action!=="reuuid")continue;let O;try{O=await hi.promises.readFile(T.path,"utf-8")}catch{continue}if((0,wr.extractAssetUid)(O)!==T.fromUid){t(` ! skipped re-uuid ${l(T.path)} (uid changed since scan \u2014 re-run dedup-uids)`),y++;continue}let A=(0,wr.rewriteAssetUid)(O,T.toUid);A!==O&&(await hi.promises.writeFile(T.path,A,"utf-8"),t(` re-uuid ${l(T.path)} \u2192 uid=${T.toUid} (content differs from kept copy)`),_++)}}return t(`Resolved: deleted ${h} identical copy(ies), re-uuid ${_} differing variant(s).${y>0?` ${y} skipped (re-run).`:""} Run \`exosync sync\` to propagate.`),y>0?1:0}r.apply===!0&&t("Note: --apply only applies with --auto; running in report mode."),t(`${c.length} duplicate uid(s) on disk:`);for(let[f,d]of c){t(` ${f} \u2014 ${d.length} files:`);for(let p of d)t(` ${l(p)}`)}if(r.fix!==!0)return t(""),t("Re-run with --fix to assign a fresh uuid to every duplicate but the first (frontmatter rewrite only \u2014 never renames the file)."),1;let u=0;for(let f of(0,wr.planDuplicateUidFix)(o,Kx.randomUUID))await hi.promises.writeFile(f.path,f.content,"utf-8"),t(` fixed ${l(f.path)} \u2192 uid=${f.toUid}`),u++;return t(`Reassigned ${u} uid(s). Run \`exosync sync\` to propagate.`),0}a(mfe,"runDedupUids");function zx(r){return r.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Machine-readable output").option("--api-base <url>","GitHub API base (testing)")}a(zx,"withQuarantineOptions");function H$(r){let e=new Le("quarantine").description("Inspect and resolve ExoSync conflicts (quarantine resolver; RFC 4e4dc453, finding a0a3d1d6)");zx(e.command("list").description("List open conflicts that need a manual choice")).action(async t=>{try{process.exitCode=await dfe(t)}catch(n){ve.handle(n,{command:"exosync quarantine list"}),process.exitCode=1}}),zx(e.command("resolve <path>").description("Resolve one conflict: --take local | remote | file <path> (merged)").option("--take <choice>","local | remote | file").option("--file <path>","Merged content file (with --take file)").option("--repo <repoKey>","Disambiguate a cross-repo path collision")).action(async(t,n)=>{try{process.exitCode=await pfe(t,n)}catch(i){ve.handle(i,{command:"exosync quarantine resolve"}),process.exitCode=1}}),r.addCommand(e),zx(r.command("dedup-uids").description("Report duplicate exo__Asset_uid on disk (#3477); --fix re-uuids all but the first; --auto zero-loss auto-resolve (identical\u2192delete, differing\u2192re-uuid; dry-run unless --apply)").option("--fix","Assign a fresh uuid to every duplicate but the first").option("--auto","Zero-loss auto-resolve: delete identical copies, re-uuid distinct variants (DRY-RUN unless --apply). Supersedes --fix.").option("--apply","Execute the --auto plan (without it --auto is a dry-run; a deleted copy's content always survives in the kept file, and if previously synced is recoverable from the git remote)")).action(async t=>{try{process.exitCode=await mfe(t)}catch(n){ve.handle(n,{command:"exosync dedup-uids"}),process.exitCode=1}})}a(H$,"registerQuarantineCommands");var Qx=a(async r=>{let e=await z$.webcrypto.subtle.digest("SHA-1",r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),gfe={parse:a(r=>Ln.load(r,{schema:Ln.CORE_SCHEMA}),"parse"),stringify:a(r=>Ln.dump(r,{schema:Ln.CORE_SCHEMA,lineWidth:-1}),"stringify")};function Xx(r,e){if(r.tokenFromGh===!0)return ro.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,n=r.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(n.length===0)throw new Error("A GitHub token is required (private sync units read as 404 and push needs write scope). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return n}a(Xx,"resolveToken");function fb(r){let e=a(i=>Or.join(r,i),"abs"),t=a(async(i,s)=>{let o;try{o=await Cr.promises.readdir(i,{withFileTypes:!0})}catch{return}for(let c of o){let l=Or.join(i,c.name);if(c.isDirectory()){if(c.name===".git")continue;await t(l,s)}else c.isFile()&&s.push(Or.relative(r,l).split(Or.sep).join("/"))}},"walk"),n=a(async(i,s)=>{let o=Or.dirname(i);await Cr.promises.mkdir(o,{recursive:!0});let c=`${i}.local.tmp`;await s(c),await Cr.promises.rename(c,i)},"writeAtomic");return{async list(){let i=[];return(0,Cr.existsSync)(r)&&await t(r,i),i},read:a(i=>Cr.promises.readFile(e(i),"utf-8"),"read"),async write(i,s){await n(e(i),o=>Cr.promises.writeFile(o,s,"utf-8"))},async delete(i){await Cr.promises.rm(e(i),{force:!0})},async readBinary(i){return new Uint8Array(await Cr.promises.readFile(e(i)))},async writeBinary(i,s){let o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);await n(e(i),c=>Cr.promises.writeFile(c,Buffer.from(o)))},async stat(i){try{let s=await Cr.promises.stat(e(i));return{mtimeMs:s.mtimeMs,size:s.size}}catch{return null}}}}a(fb,"nodeLocalFilesPort");function ca(r){return{async read(){try{return await Cr.promises.readFile(r,"utf-8")}catch{return null}},async writeAtomic(e){await Cr.promises.mkdir(Or.dirname(r),{recursive:!0});let t=`${r}.local.tmp`;await Cr.promises.writeFile(t,e,"utf-8"),await Cr.promises.rename(t,r)}}}a(ca,"nodeWatermarkFileIO");function ll(r,e=".obsidian"){let t=Or.join(r,e,"plugins","exocortex",lt.MOUNT_BASE_STORE_FILENAME);return new lt.FileMountBaseStore(ca(t))}a(ll,"nodeMountBaseStore");var yfe=(0,Y$.promisify)(K$.execFile);function _fe(r){return async e=>{if(e.localPath.length===0||e.localPath.startsWith("-"))return null;try{let{stdout:t}=await yfe("git",["-C",r,"submodule","status",e.localPath],{timeout:3e4,maxBuffer:4194304}),n=t.match(/^[ +\-U]?([0-9a-f]{40})\b/m);return n?n[1]:null}catch{return null}}}a(_fe,"nodeLocalBaseShaProvider");function bfe(r){return{async check(e){let t=Or.join(r,e.localPath);if(!(0,Cr.existsSync)(t))return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} does not exist`};let n=0;try{n=(await Cr.promises.readdir(t)).length}catch{return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is not readable`}}return n===0&&e.spaceKind!=="file"?{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is empty (mid-mount?)`}:{fullyMaterialized:!0}}}}a(bfe,"nodeMaterializationCheck");function Sfe(r,e){let t=r.pushedSha!==void 0?` \u2192@${r.pushedSha.slice(0,7)}`:"",n=(r.outboxPushedCount??0)>0?`, pushed ${r.outboxPushedCount} resolved`:"",i=(r.outboxReconflictedCount??0)>0?`, ${r.outboxReconflictedCount} re-conflicted (remote moved)`:"";e(`${r.repoKey}${t}: ${r.status} \u2014 pulled ${r.pulledCount}, pushed ${r.pushedCount}, merged ${r.mergedCount}, quarantined ${r.quarantinedCount}${(r.pushedDeletes?.length??0)>0?`, deleted ${r.pushedDeletes.length}`:""}${n}${i}`),r.detail!==void 0&&e(` ${r.detail}`);for(let s of r.warnings)e(` warn: ${s}`);(r.quarantinedPaths?.length??0)>0&&e(` quarantined (\u2192 exosync quarantine resolve): ${r.quarantinedPaths.join(", ")}`),(r.deferredPaths?.length??0)>0&&e(` deferred (\u2192 full sync): ${r.deferredPaths.join(", ")}`),(r.deferredDeletes?.length??0)>0&&e(` deferred deletes: ${r.deferredDeletes.join(", ")}`),r.timings!==void 0&&(0,lt.totalMs)(r.timings)>0&&e(` ${(0,lt.formatRepoTimings)(r.repoKey,r.timings)}`)}a(Sfe,"printRepoResult");function wfe(r){return r==="conflict"||r==="full-conflict"||r==="retry-exhausted"||r==="busy"||r==="auth-required"||r==="error"}a(wfe,"isFailureStatus");async function Efe(r,e,t={}){let n=t.out??(P=>console.log(P)),i=Or.resolve(e.vault);if(!(0,Cr.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=Xx(e,t),o=new ro({token:s,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),c=t.transportFactory?.(s,e.apiBase)??o.transport(),{specs:l,warnings:u}=Af(i);for(let P of u)n(`warn: ${P}`);if(l.length===0)return n("Nothing to sync \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),2;let f=e.configDir??".obsidian",d=Or.join(i,f,"plugins","exocortex",lt.WATERMARK_STORE_FILENAME),p=Or.join(i,f,"plugins","exocortex",lt.LOCAL_MANIFEST_STORE_FILENAME),h=Or.join(i,f,"plugins","exocortex",lt.CONFLICT_CACHE_STORE_FILENAME),_=new lt.LocalConflictCacheStore({io:ca(h)}),y=Or.join(i,f,"plugins","exocortex",lt.OUTBOX_STORE_FILENAME),S=new lt.LocalOutboxStore({io:ca(y)}),w=_,T=new lt.SyncEngine({transport:c,watermarkStore:new lt.FileWatermarkStore(ca(d)),localManifestStore:new lt.FileLocalManifestStore(ca(p)),mountBaseStore:ll(i,f),localBaseShaProvider:_fe(i),materializationCheck:bfe(i),localFilesFor:a(P=>fb(Or.join(i,P.localPath)),"localFilesFor"),sha1:Qx,redact:a(P=>o.redact(P),"redact"),commitMessage:a((P,V,j=0)=>`exosync: ${V} change(s)${j>0?`, ${j} deletion(s)`:""} (CLI)`,"commitMessage"),mergeLayer:new lt.GatedStructuredMerger(new lt.StructuredMerger(gfe)),quarantine:w,outbox:S,...e.apiBase!==void 0?{baseURL:e.apiBase}:{}});n(`ExoSync ${r}: ${l.length} repo(s), vault ${i}`);let O=(0,lt.orderChildrenFirst)(l),A=e.json===!0?void 0:P=>{n(`[ExoSync] ${P.repoKey}: ${(0,lt.syncProgressPhaseText)(P)}`)},x=await T.syncAll(O,r,A);if(e.json===!0)n(JSON.stringify(x,null,2));else{for(let j of x)Sfe(j,n);let P=x.reduce((j,$)=>({pulled:j.pulled+$.pulledCount,pushed:j.pushed+$.pushedCount,merged:j.merged+$.mergedCount,quarantined:j.quarantined+$.quarantinedCount}),{pulled:0,pushed:0,merged:0,quarantined:0});n(`Summary: ${x.length} repo(s) \u2014 pulled ${P.pulled}, pushed ${P.pushed}, merged ${P.merged}, quarantined ${P.quarantined}`);let V=(0,lt.aggregateTimings)(x);(0,lt.totalMs)(V)>0&&n((0,lt.formatTimingsLine)(V))}return x.some(P=>wfe(P.status))?1:0}a(Efe,"runExosyncSync");function Jx(r){return r.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Print the full per-repo result array as JSON").option("--api-base <url>","GitHub API base (testing)")}a(Jx,"withSyncOptions");function Zx(r){return async e=>{try{process.exitCode=await Efe(r,e)}catch(t){ve.handle(t,{command:`exosync ${r}`}),process.exitCode=1}}}a(Zx,"makeDirectionAction");function Q$(){let r=new Le("exosync").description("ExoSync over the GitHub REST API: sync/pull/push the materialized AssetSpace set (CLI parity with the plugin; RFC 4e4dc453 Phase B). Read-only divergence check: `exosync-parity`.");return Jx(r.command("sync").description("Full pull\u2192merge\u2192push cycle for every materialized repo")).action(Zx("sync")),Jx(r.command("pull").description("Apply remote changes only (nothing leaves the device; local changes re-derive)")).action(Zx("pull")),Jx(r.command("push").description("Send the local delta only (remote changes are pinned to re-derive on the next pull/sync)")).action(Zx("push")),H$(r),r}a(Q$,"exosyncCommand");var vfe=a(r=>{process.stderr.write(`${r}
|
|
606
|
+
`)},"DEFAULT_LOG"),db=class{static{a(this,"HeadlessConfirmGate")}constructor(e){this.yes=e.yes,this.verbose=e.verbose??!1,this.log=e.log??vfe}async confirmApply(e){if(this.verbose){let t=Array.from(e.filesToDestroy.values()).reduce((n,i)=>n+i.length,0);this.log(`[apply-profile] Target: ${e.targetProfileLabel} (${e.targetProfileUid})`),this.log(`[apply-profile] Source: ${e.sourceProfileLabel}`),this.log(`[apply-profile] ${t} files to remove, ${e.assetSpacesBeingTornDown.length} AS to tear down, ${e.assetSpacesBeingMaterialized.length} AS to materialize`)}return this.yes?!0:(this.log("[apply-profile] Refused: --yes flag required for headless mode (Decision #2 safety)."),!1)}};async function Tfe(r,e,t={}){let n=[],i=[],s=t.out??(P=>process.stdout.write(`${P}
|
|
607
607
|
`)),o=t.err??(P=>process.stderr.write(`${P}
|
|
608
|
-
`)),c=a(P=>{n.push(P),s(P)},"out"),l=a(P=>{i.push(P),o(P)},"err");if(!e.vault)throw new ct("--vault is required");let u=(0,J$.resolve)(e.vault);if(!(0,X$.existsSync)(u))throw new Je(u);if(!r||r.length===0)throw new ct("profile-uid argument is required","exocortex apply-profile <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new lb({vaultPath:u,warn:a(P=>l(P),"warn")})).resolveFilter(r);if(d.outcome==="missing-profile")throw new ct(`Profile not found: ${r}`,"Run `exocortex find --class exo__Profile` to list available profiles");if(d.outcome==="error")return l(`[apply-profile] Resolver error: ${d.reason}`),{exitCode:5,stdout:n,stderr:i};if(d.outcome==="degraded")return l(`[apply-profile] Refused: profile resolution degraded \u2014 ${d.reason}. Apply aborted to prevent vault corruption.`),{exitCode:5,stdout:n,stderr:i};if(d.outcome!=="engaged")return l(`[apply-profile] Unexpected resolver outcome: ${d.outcome}`),{exitCode:5,stdout:n,stderr:i};let p=d.result,h=e.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,_=t.applyServiceFactory?.(e,u)??new Tf({vaultPath:u,ref:e.ref??"main",mount:new ei({token:h,mountBaseStore:ll(u)})}),{infos:y,profileLabels:S}=_.scanVault(),w=S.get(r)??r,T;try{T=_.buildDiff({targetProfileUid:r,targetProfileLabel:w,sourceProfileUid:null,sourceProfileLabel:"<unknown>",result:p,infos:y})}catch(P){if(P instanceof wn.TsFloorViolationError)return l(`[apply-profile] Refused: ${P.message}`),{exitCode:5,stdout:n,stderr:i};throw P}if(!await(t.confirmGate??new db({yes:e.yes??!1,verbose:e.verbose??!1,log:a(P=>l(P),"log")})).confirmApply(T.plan))return{exitCode:0,stdout:n,stderr:i};if(T.toDestroy.length===0&&T.toMaterialize.length===0)return c(`[apply-profile] Already in target mount-state for ${w} \u2014 no-op.`),{exitCode:0,stdout:n,stderr:i};let x;try{x=await _.execute(T)}catch(P){return l(`[apply-profile] Execution failed: ${P instanceof Error?P.message:String(P)}`),{exitCode:5,stdout:n,stderr:i}}return c(`[apply-profile] Switched to ${w}: ${x.destroyed.length} AssetSpace(s) torn down, ${x.materialized.length} materialized.`),{exitCode:0,stdout:n,stderr:i}}a(
|
|
608
|
+
`)),c=a(P=>{n.push(P),s(P)},"out"),l=a(P=>{i.push(P),o(P)},"err");if(!e.vault)throw new ct("--vault is required");let u=(0,J$.resolve)(e.vault);if(!(0,X$.existsSync)(u))throw new Je(u);if(!r||r.length===0)throw new ct("profile-uid argument is required","exocortex apply-profile <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new lb({vaultPath:u,warn:a(P=>l(P),"warn")})).resolveFilter(r);if(d.outcome==="missing-profile")throw new ct(`Profile not found: ${r}`,"Run `exocortex find --class exo__Profile` to list available profiles");if(d.outcome==="error")return l(`[apply-profile] Resolver error: ${d.reason}`),{exitCode:5,stdout:n,stderr:i};if(d.outcome==="degraded")return l(`[apply-profile] Refused: profile resolution degraded \u2014 ${d.reason}. Apply aborted to prevent vault corruption.`),{exitCode:5,stdout:n,stderr:i};if(d.outcome!=="engaged")return l(`[apply-profile] Unexpected resolver outcome: ${d.outcome}`),{exitCode:5,stdout:n,stderr:i};let p=d.result,h=e.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,_=t.applyServiceFactory?.(e,u)??new Tf({vaultPath:u,ref:e.ref??"main",mount:new ei({token:h,mountBaseStore:ll(u)})}),{infos:y,profileLabels:S}=_.scanVault(),w=S.get(r)??r,T;try{T=_.buildDiff({targetProfileUid:r,targetProfileLabel:w,sourceProfileUid:null,sourceProfileLabel:"<unknown>",result:p,infos:y})}catch(P){if(P instanceof wn.TsFloorViolationError)return l(`[apply-profile] Refused: ${P.message}`),{exitCode:5,stdout:n,stderr:i};throw P}if(!await(t.confirmGate??new db({yes:e.yes??!1,verbose:e.verbose??!1,log:a(P=>l(P),"log")})).confirmApply(T.plan))return{exitCode:0,stdout:n,stderr:i};if(T.toDestroy.length===0&&T.toMaterialize.length===0)return c(`[apply-profile] Already in target mount-state for ${w} \u2014 no-op.`),{exitCode:0,stdout:n,stderr:i};let x;try{x=await _.execute(T)}catch(P){return l(`[apply-profile] Execution failed: ${P instanceof Error?P.message:String(P)}`),{exitCode:5,stdout:n,stderr:i}}return c(`[apply-profile] Switched to ${w}: ${x.destroyed.length} AssetSpace(s) torn down, ${x.materialized.length} materialized.`),{exitCode:0,stdout:n,stderr:i}}a(Tfe,"runApplyProfile");function Z$(){return new Le("apply-profile").description("Apply the specified Profile (mount-state filesystem mutation). Requires --yes for headless mode.").argument("<profile-uid>","Target Profile UID").requiredOption("--vault <path>","Path to Obsidian vault").option("--yes","Confirm apply (headless mode safety override per RFC 22b50a17 Decision #2)",!1).option("--verbose","Print plan summary to stderr before deciding",!1).option("--ref <branch>","Git ref to pull when materialising AssetSpaces","main").option("--token <pat>","GitHub PAT for private-repo materialisation (or env GITHUB_TOKEN / GH_TOKEN)").action(async(e,t)=>{try{let n=await Tfe(e,t);process.exit(n.exitCode)}catch(n){ve.handle(n)}})}a(Z$,"applyProfileCommand");var If=require("node:path"),ul=require("node:fs"),e6=Se(it());function t6(){return new Le("bootstrap").description("Bootstrap a vault with the SDK floor AssetSpace (exo). Pulls a tarball from a public GitHub repo, extracts \u043A assetspaces/, writes .gitmodules. Only --exo is required \u2014 bootstrap installs only the SDK platform. exocmd (the optional UI-command library) and any other AssetSpace are added afterwards via `exocortex assetspace add`. Example URL: https://github.com/kitelev/exoas-exo.").requiredOption("--vault <path>","Path \u043A target vault").requiredOption("--exo <url>","Public GitHub URL \u0434\u043B\u044F exo TBox AssetSpace (e.g. https://github.com/kitelev/exoas-exo)").option("--ref <branch>","Branch ref \u043A pull from","main").option("--token <pat>","GitHub PAT for private repos (or env GITHUB_TOKEN / GH_TOKEN). Optional \u2014 anonymous for public repos.").option("--json","Emit result as JSON",!1).action(async r=>{try{if(!r.vault)throw new ct("--vault is required");let e=(0,If.resolve)(r.vault);(0,ul.mkdirSync)(e,{recursive:!0});let t=(0,If.join)(e,".gitmodules"),n=(0,If.join)(e,"assetspaces");if((0,ul.existsSync)(t))throw new ct(`Vault ${e} already has .gitmodules \u2014 refusing \u043A re-bootstrap. Use \`assetspace add\` \u0434\u043B\u044F individual AS.`);if((0,ul.existsSync)(n)&&(0,ul.readdirSync)(n).length>0)throw new ct(`Vault ${e}/assetspaces/ already has content \u2014 refusing \u043A re-bootstrap.`);let i=r.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,s=new ei({token:i,mountBaseStore:ll(e)}),o=r.ref??"main",c=[],l=(0,e6.derivePath)(r.exo)??"assetspaces/exo",u=(0,If.join)(e,l);process.stderr.write(`[bootstrap] Pulling ${r.exo}@${o} \u2192 ${l}/...
|
|
609
609
|
`);let f=await s.pullAssetSpace(r.exo,o,u);if(s.ensureGitmodulesEntry(e,l,r.exo),c.push({folder:l,url:r.exo,sha:f.sha,fileCount:f.fileCount}),r.json)process.stdout.write(JSON.stringify({vault:e,materialized:c},null,2)+`
|
|
610
610
|
`);else{process.stdout.write(`
|
|
611
611
|
\u2713 Bootstrap complete
|
|
@@ -617,7 +617,7 @@ Next steps:
|
|
|
617
617
|
`),process.stdout.write(` 2. git add . && git commit -m "feat: bootstrap vault"
|
|
618
618
|
`),process.stdout.write(` 3. (optional) Add the exocmd UI-command library: \`exocortex assetspace add --vault ${e} --url https://github.com/kitelev/exoas-exocmd\`
|
|
619
619
|
`),process.stdout.write(` 4. Add additional AssetSpaces via \`exocortex assetspace add --vault ${e} --url <github-url>\`
|
|
620
|
-
`)}process.exit(0)}catch(e){ve.handle(e)}})}a(t6,"bootstrapCommand");var pb=require("node:path"),r6=require("node:fs"),n6=Se(it());function
|
|
620
|
+
`)}process.exit(0)}catch(e){ve.handle(e)}})}a(t6,"bootstrapCommand");var pb=require("node:path"),r6=require("node:fs"),n6=Se(it());function Afe(r,e){return e!==void 0&&e.length>0?`assetspaces/${e}`:(0,n6.derivePath)(r)??`assetspaces/${ei.deriveFolderName(r)}`}a(Afe,"resolveAddAssetSpacePath");function i6(){return new Le("assetspace-add").description("Phase 6.3: add single AssetSpace \u043A existing vault by public GitHub URL. Pulls tarball, extracts \u043A assetspaces/<folder>/, updates .gitmodules.").requiredOption("--vault <path>","Path \u043A target vault").requiredOption("--url <url>","Public GitHub URL \u0434\u043B\u044F the AssetSpace (e.g. https://github.com/kitelev/exoas-pmbok-ontology)").option("--folder <name>","Local folder name \u043F\u043E\u0434 assetspaces/. Defaults \u043A URL-derived (strips exoas- prefix)").option("--ref <branch>","Branch ref \u043A pull from","main").option("--token <pat>","GitHub PAT for private repos (or env GITHUB_TOKEN / GH_TOKEN). Optional \u2014 anonymous for public repos.").option("--json","Emit result as JSON",!1).action(async r=>{try{if(!r.vault)throw new ct("--vault is required");if(!r.url)throw new ct("--url is required");let e=(0,pb.resolve)(r.vault);if(!(0,r6.existsSync)(e))throw new Je(e);let t=r.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,n=new ei({token:t,mountBaseStore:ll(e)}),i=r.ref??"main",s=Afe(r.url,r.folder),o=(0,pb.join)(e,s);process.stderr.write(`[assetspace-add] Pulling ${r.url}@${i} \u2192 ${s}/...
|
|
621
621
|
`);let c=await n.pullAssetSpace(r.url,i,o),l=n.ensureGitmodulesEntry(e,s,r.url);r.json?process.stdout.write(JSON.stringify({vault:e,folder:s,url:r.url,sha:c.sha,fileCount:c.fileCount,gitmodulesEntryAdded:l.added},null,2)+`
|
|
622
622
|
`):(process.stdout.write(`
|
|
623
623
|
\u2713 AssetSpace added
|
|
@@ -625,14 +625,14 @@ Next steps:
|
|
|
625
625
|
`),process.stdout.write(` URL: ${r.url}
|
|
626
626
|
`),process.stdout.write(` SHA: ${c.sha} (${c.fileCount} files)
|
|
627
627
|
`),process.stdout.write(` .gitmodules: ${l.added?"entry added":"entry already present"}
|
|
628
|
-
`)),process.exit(0)}catch(e){ve.handle(e)}})}a(i6,"assetSpaceAddCommand");var hb=require("node:path"),eR=require("node:fs"),xf=Se(it());function
|
|
628
|
+
`)),process.exit(0)}catch(e){ve.handle(e)}})}a(i6,"assetSpaceAddCommand");var hb=require("node:path"),eR=require("node:fs"),xf=Se(it());function Ife(r){if(r.folder!==void 0&&r.folder.length>0)return r.folder.startsWith("assetspaces/")?r.folder:`assetspaces/${r.folder}`;if(r.url!==void 0&&r.url.length>0)return(0,xf.derivePath)(r.url)??`assetspaces/${ei.deriveFolderName(r.url)}`;throw new ct("either --folder or --url is required","exocortex assetspace-remove --vault <path> (--folder <mount-path> | --url <url>)")}a(Ife,"resolveRemoveAssetSpacePath");async function xfe(r,e={}){let t=[],n=[],i=a(h=>{t.push(h),(e.out??(_=>process.stdout.write(`${_}
|
|
629
629
|
`)))(h)},"out"),s=a(h=>{n.push(h),(e.err??(_=>process.stderr.write(`${_}
|
|
630
|
-
`)))(h)},"err");if(!r.vault)throw new ct("--vault is required");let o=(0,hb.resolve)(r.vault);if(!(0,eR.existsSync)(o))throw new Je(o);let c=
|
|
630
|
+
`)))(h)},"err");if(!r.vault)throw new ct("--vault is required");let o=(0,hb.resolve)(r.vault);if(!(0,eR.existsSync)(o))throw new Je(o);let c=Ife(r),u=(e.scanInfos?.(o)??new Tf({vaultPath:o}).scanVault().infos).find(h=>h.folderName===c);if(u!==void 0&&(0,xf.isTsFloorAssetSpace)(u.uid,u.namespace)||(0,xf.isTsFloorMountPath)(c)){let h=u?.label??c,_=u?`${u.namespace||u.uid}`:"path resolves to a floor namespace";return s(`[assetspace-remove] Refused: \xAB${h}\xBB (${_}) is a TS-floor AssetSpace \u2014 unmounting it would self-brick the runtime (R24). Aborted, no changes made.`),{exitCode:5,stdout:t,stderr:n,removed:!1,folder:c}}let d=(0,eR.existsSync)((0,hb.join)(o,c)),p=e.unmount??((h,_)=>new ei().unmountAssetSpace(h,_));try{p(o,c)}catch(h){return s(`[assetspace-remove] Unmount failed: ${h instanceof Error?h.message:String(h)}`),{exitCode:5,stdout:t,stderr:n,removed:!1,folder:c}}return r.json?i(JSON.stringify({vault:o,folder:c,existedBefore:d,unmounted:!0},null,2)):d?(i(`
|
|
631
631
|
\u2713 AssetSpace unmounted`),i(` Folder: ${c} (removed from vault + .gitmodules)`)):(i(`
|
|
632
|
-
\u2713 AssetSpace already absent \u2014 .gitmodules stanza stripped (no-op)`),i(` Folder: ${c}`)),{exitCode:0,stdout:t,stderr:n,removed:!0,folder:c}}a(
|
|
632
|
+
\u2713 AssetSpace already absent \u2014 .gitmodules stanza stripped (no-op)`),i(` Folder: ${c}`)),{exitCode:0,stdout:t,stderr:n,removed:!0,folder:c}}a(xfe,"runAssetSpaceRemove");function s6(){return new Le("assetspace-remove").description("Unmount a single AssetSpace (inverse of assetspace-add). Strips its .gitmodules stanza and deletes the mount folder. TS-floor AssetSpaces ({exo}) are refused.").requiredOption("--vault <path>","Path to target vault").option("--folder <path>","Vault-relative mount path to unmount (e.g. assetspaces/kitelev/exoas-pmbok-ontology). Takes precedence over --url.").option("--url <url>","Public GitHub URL of the AssetSpace \u2014 derives the canonical mount path (parity with assetspace-add).").option("--json","Emit result as JSON",!1).action(async r=>{try{let e=await xfe(r);process.exit(e.exitCode)}catch(e){ve.handle(e)}})}a(s6,"assetSpaceRemoveCommand");var a6=require("node:path"),c6=require("node:fs");var mb=Se(Qo()),tR=Se(require("path")),Rf=Se(it());var gb=class{static{a(this,"RegistryDependencyResolver")}constructor(e={}){this.warn=e.warn??(()=>{})}async resolve(e,t){let n=await this.scanRegistry(e),i=this.matchSelf(n,t);if(i===null)return{outcome:"self-not-found",selfIdentifier:t,descriptorCount:n.size};let s=new Map;for(let y of n.values())y.dependsOn.length>0&&s.set(y.uid,y.dependsOn);let o=(0,Rf.transitiveDependsOnClosure)([i.uid],s);o.delete(i.uid);let c=[],l=new Set,u=new Set([i.uid]),f=[...i.dependsOn];for(;f.length>0;){let y=f.shift();if(y===void 0||u.has(y))continue;u.add(y),o.has(y)&&!l.has(y)&&(c.push(y),l.add(y));let S=n.get(y);if(S!==void 0)for(let w of S.dependsOn)u.has(w)||f.push(w)}for(let y of o)l.has(y)||(c.push(y),l.add(y));let d=[],p=[];for(let y of c){let S=n.get(y);S===void 0?p.push(y):d.push(S)}let h=d.filter(y=>y.source===null||y.source.length===0),_=d.filter(y=>y.source!==null&&y.source.length>0&&!Rfe(y.source));return{outcome:"resolved",self:i,dependencies:d,missingDescriptors:p,sourceless:h,unsafeSources:_}}matchSelf(e,t){let n=o6(t);if(n!==null)for(let i of e.values()){if(i.source===null)continue;let s=o6(i.source);if(s!==null&&s===n)return i}for(let i of e.values())if(i.namespace!==null&&i.namespace===t)return i;return null}async scanRegistry(e){let t=new Map,n=tR.default.resolve(e);if(!await mb.default.pathExists(n))return this.warn(`[RegistryDependencyResolver] registry path does not exist: ${n}`),t;let i=[n];for(;i.length>0;){let s=i.pop(),o;try{o=await mb.default.readdir(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=tR.default.join(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||c.name==="node_modules"||c.name===".obsidian"||c.name===".exocortex")continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=await this.tryReadFrontmatter(l);if(u===null||!sa(u.exo__Instance_class).some(y=>y===lh))continue;let d=u.exo__Asset_uid;if(typeof d!="string"||d.length===0)continue;let p=typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:null,h=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:null,_=sa(u.exo__AssetSpace_dependsOn);t.has(d)&&this.warn(`[RegistryDependencyResolver] duplicate AssetSpace descriptor for uid=${d} \u2014 last wins (${l})`),t.set(d,{uid:d,namespace:h,source:p,dependsOn:_})}}return t}async tryReadFrontmatter(e){let t;try{t=await mb.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,Rf.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function o6(r){let e=r.trim();if(e.length===0)return null;let t=(0,Rf.derivePath)(e);if(t!==null)return t.replace(/^assetspaces\//,"").toLowerCase();if(!e.includes("://")&&!e.includes("@")){let i=e.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").filter(s=>s.length>0);if(i.length===2)return`${i[0]}/${i[1]}`.toLowerCase()}return null}a(o6,"ownerRepoSlug");function Rfe(r){return typeof r!="string"||r.length===0||/[\s\x00-\x1f]/.test(r)||r.startsWith("-")||/^(ext|file|fd|ftp|ftps)::/i.test(r)?!1:!!(/^https?:\/\/[^\s]+$/i.test(r)||/^ssh:\/\/[^\s]+$/i.test(r)||/^git:\/\/[^\s]+$/i.test(r)||/^[A-Za-z0-9._-]+@[A-Za-z0-9._-]+:[^\s]+$/.test(r))}a(Rfe,"isSafeCloneUrl");async function Cfe(r,e={}){let t=e.out??(l=>process.stdout.write(`${l}
|
|
633
633
|
`)),n=e.err??(l=>process.stderr.write(`${l}
|
|
634
|
-
`));if(!r.registry)throw new ct("--registry <path> is required");if(!r.self)throw new ct("--self <owner/repo | git-url | namespace> is required");let i=(0,a6.resolve)(r.registry);if(!(0,c6.existsSync)(i))throw new ct(`Registry path does not exist: ${i}`,"Clone kitelev/exoas-registry first, then pass --registry <path>");let o=await new gb({warn:a(l=>n(l),"warn")}).resolve(i,r.self),c=r.format??"urls";if(o.outcome==="self-not-found"){let l=`[resolve-deps] self '${r.self}' not found among ${o.descriptorCount} registry descriptor(s) \u2014 validating standalone (no dependencies to materialise).`;return r.strict?(n(`[resolve-deps] STRICT: self '${r.self}' not registered. Add an exo__AssetSpace descriptor to kitelev/exoas-registry.`),c==="json"&&t(JSON.stringify(o,null,2)),{exitCode:2,outcome:o}):(n(l),c==="json"&&t(JSON.stringify(o,null,2)),{exitCode:0,outcome:o})}if(o.missingDescriptors.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.missingDescriptors.length} dangling dependsOn edge(s) (no descriptor in registry): `+o.missingDescriptors.join(", ")),o.sourceless.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.sourceless.length} dependency descriptor(s) have no source URL (cannot clone): `+o.sourceless.map(l=>l.namespace??l.uid).join(", ")),o.unsafeSources.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.unsafeSources.length} dependency source(s) rejected as unsafe git-clone targets (option/transport injection) \u2014 NOT emitted: `+o.unsafeSources.map(l=>`${l.namespace??l.uid}=${l.source}`).join(", ")),c==="json")t(JSON.stringify(o,null,2));else{let l=new Set(o.unsafeSources.map(u=>u.uid));for(let u of o.dependencies)u.source&&u.source.length>0&&!l.has(u.uid)&&t(u.source)}return{exitCode:0,outcome:o}}a(
|
|
635
|
-
`);for(let i=0;i<n.length;i++){u6.lastIndex=0;let s;for(;(s=u6.exec(n[i]))!==null;)t.push({uid:s[1].toLowerCase(),file:r,line:i+1})}return t}a(
|
|
634
|
+
`));if(!r.registry)throw new ct("--registry <path> is required");if(!r.self)throw new ct("--self <owner/repo | git-url | namespace> is required");let i=(0,a6.resolve)(r.registry);if(!(0,c6.existsSync)(i))throw new ct(`Registry path does not exist: ${i}`,"Clone kitelev/exoas-registry first, then pass --registry <path>");let o=await new gb({warn:a(l=>n(l),"warn")}).resolve(i,r.self),c=r.format??"urls";if(o.outcome==="self-not-found"){let l=`[resolve-deps] self '${r.self}' not found among ${o.descriptorCount} registry descriptor(s) \u2014 validating standalone (no dependencies to materialise).`;return r.strict?(n(`[resolve-deps] STRICT: self '${r.self}' not registered. Add an exo__AssetSpace descriptor to kitelev/exoas-registry.`),c==="json"&&t(JSON.stringify(o,null,2)),{exitCode:2,outcome:o}):(n(l),c==="json"&&t(JSON.stringify(o,null,2)),{exitCode:0,outcome:o})}if(o.missingDescriptors.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.missingDescriptors.length} dangling dependsOn edge(s) (no descriptor in registry): `+o.missingDescriptors.join(", ")),o.sourceless.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.sourceless.length} dependency descriptor(s) have no source URL (cannot clone): `+o.sourceless.map(l=>l.namespace??l.uid).join(", ")),o.unsafeSources.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.unsafeSources.length} dependency source(s) rejected as unsafe git-clone targets (option/transport injection) \u2014 NOT emitted: `+o.unsafeSources.map(l=>`${l.namespace??l.uid}=${l.source}`).join(", ")),c==="json")t(JSON.stringify(o,null,2));else{let l=new Set(o.unsafeSources.map(u=>u.uid));for(let u of o.dependencies)u.source&&u.source.length>0&&!l.has(u.uid)&&t(u.source)}return{exitCode:0,outcome:o}}a(Cfe,"runResolveDeps");function l6(){return new Le("resolve-deps").description("Resolve an AssetSpace repo's transitive dependsOn closure from the central registry and print dependency clone URLs (issue #3513). Used by the per-AssetSpace SHACL CI gate to materialise dependent TBox.").requiredOption("--registry <path>","Path to a checked-out central registry (kitelev/exoas-registry)").requiredOption("--self <id>","Identity of the calling repo: an owner/repo slug (e.g. kitelev/exoas-exo, matches GitHub's github.repository), a full git URL, or a bare namespace").option("--format <type>","Output format: urls (one clone URL per line) | json (full diagnostics)","urls").option("--strict","Exit non-zero (2) when self is not registered, instead of validating standalone",!1).action(async r=>{try{let{exitCode:e}=await Cfe(r);process.exit(e)}catch(e){ve.handle(e)}})}a(l6,"resolveDepsCommand");var nc=require("fs"),f6=Se(Qo()),rc=require("path");var Ofe="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}",u6=new RegExp(`@req:(${Ofe})`,"g"),Pfe=["**/*.test.ts","**/*.test.tsx","**/*.spec.ts","**/*.spec.tsx"],Dfe=["**/node_modules/**","**/dist/**","**/.git/**"],Ffe={unit:"unit",component:"component",integration:"integration",e2e:"e2e",guibdd:"gui-bdd",uiacceptance:"ui-acceptance"},d6="ui-acceptance",Lfe=/(^|[\\/])tests[\\/]e2e[\\/]eka-gui[\\/]/;function Nfe(r){return Lfe.test(r)}a(Nfe,"isGuiRunnerSpec");var kfe=new Set(["integration","e2e","gui-bdd",d6]);function yb(r){return r.bindingClasses.includes(d6)}a(yb,"isManuallyVerified");function rR(r){return r.evidence.length-r.evidenceMissing.length>0}a(rR,"hasResolvingEvidence");function _b(r){return r==null?[]:Array.isArray(r)?r.filter(e=>typeof e=="string"):typeof r=="string"?[r]:[]}a(_b,"asStringArray");function Mfe(r){let e=_b(r)[0];if(!e)return null;let t=e.match(/RequirementPriority(P[0-3])\b/);return t?t[1]:null}a(Mfe,"parsePriority");function jfe(r){let e=[];for(let t of _b(r)){let n=t.match(/RequirementBindingClass([A-Za-z0-9]+)/);if(!n)continue;let i=n[1].toLowerCase();e.push(Ffe[i]??i)}return e}a(jfe,"parseBindingClasses");function $fe(r){let e=_b(r)[0];if(!e)return null;let t=e.match(/RequirementStatus([A-Za-z]+)/);return t?t[1]:null}a($fe,"parseStatus");function Ufe(r){return _b(r).map(e=>e.trim()).filter(e=>e.length>0)}a(Ufe,"parseEvidence");async function Bfe(r){let t=await new Zn(r).indexedAssets(),n=[],i=(0,rc.resolve)(r),s=i.endsWith("/")?i:`${i}/`;for(let{path:o,metadata:c}of t){let l=o.split("/");if(l.includes("node_modules")||l.includes(".git")||c.req__Requirement_status===void 0)continue;let u=typeof c.exo__Asset_uid=="string"?c.exo__Asset_uid:o.replace(/^.*\//,"").replace(/\.md$/,""),f=typeof c.exo__Asset_label=="string"?c.exo__Asset_label:u,d=Ufe(c.req__Requirement_evidence),p=(0,rc.dirname)((0,rc.resolve)(r,o)),h=d.filter(_=>{let y=(0,rc.resolve)(p,_);return!(y.startsWith(s)&&(0,nc.existsSync)(y)&&(0,nc.statSync)(y).isFile())});n.push({uid:u,label:f,path:o,priority:Mfe(c.req__Requirement_priority),bindingClasses:jfe(c.req__Requirement_bindingClass),status:$fe(c.req__Requirement_status),evidence:d,evidenceMissing:h})}return n}a(Bfe,"loadRequirements");function Vfe(r,e){let t=[],n=e.split(`
|
|
635
|
+
`);for(let i=0;i<n.length;i++){u6.lastIndex=0;let s;for(;(s=u6.exec(n[i]))!==null;)t.push({uid:s[1].toLowerCase(),file:r,line:i+1})}return t}a(Vfe,"extractReqTags");async function qfe(r,e=Pfe){let t=await Ja(e,{cwd:r,nodir:!0,ignore:Dfe,absolute:!0});t.sort();let n=[];for(let i of t){let s=await f6.default.readFile(i,"utf-8");s.includes("@req:")&&n.push(...Vfe(i,s))}return n}a(qfe,"scanTestTags");function Gfe(r,e){let t=new Map;for(let N of r)t.set(N.uid.toLowerCase(),N);let n=new Map;for(let N of e){let ae=N.uid.toLowerCase(),we=n.get(ae);we?we.push(N):n.set(ae,[N])}let i=a(N=>(n.get(N.uid.toLowerCase())??[]).some(ae=>Nfe(ae.file)),"hasGuiRunnerBinding"),s=[],o=0,c=0;for(let N of r)n.has(N.uid.toLowerCase())?o++:yb(N)?c++:s.push({uid:N.uid,label:N.label,path:N.path});let l=[];for(let N of e)t.has(N.uid.toLowerCase())||l.push(N);let u=[];for(let[N,ae]of n)ae.length>1&&t.has(N)&&u.push({uid:t.get(N).uid,occurrences:ae});let f=[],d=0;for(let N of r){if(N.priority===null){d++;continue}if(N.priority!=="P0"||N.bindingClasses.length===0)continue;N.bindingClasses.some(we=>kfe.has(we))||f.push({uid:N.uid,label:N.label,priority:N.priority,bindingClasses:N.bindingClasses})}let p=0,h=0;for(let N of r)N.priority==="P0"&&(p++,(n.has(N.uid.toLowerCase())||yb(N))&&h++);let _=p-h,y=[],S=0;for(let N of r){if(N.status?.toLowerCase()!=="active")continue;S++;let ae=n.has(N.uid.toLowerCase());if(yb(N)){if(i(N)||rR(N))continue;y.push({uid:N.uid,label:N.label,path:N.path,reason:"active ui-acceptance requirement is not verified \u2014 bind it to an eka-gui GUI-in-CI scenario (@req in tests/e2e/eka-gui/, automated evidence) OR commit + link a req__Requirement_evidence attestation (manual), OR move it to Deprecated. A @req tag in a non-GUI test does not auto-evidence a live-UI acceptance."});continue}ae||y.push({uid:N.uid,label:N.label,path:N.path,reason:"active requirement has no @req binding (and is not ui-acceptance) \u2014 fix the binding or move it to Deprecated"})}let w=[],T=0,O=0,A=0,x=0;for(let N of r)N.evidenceMissing.length>0&&w.push({uid:N.uid,label:N.label,path:N.path,missing:N.evidenceMissing}),yb(N)&&(T++,rR(N)&&O++,i(N)?A++:rR(N)&&x++);let P=T-O,V=r.length,j=V===0?1:(o+c)/V,$=l.length===0&&f.length===0&&y.length===0&&w.length===0,K=p>0&&_===0&&f.length===0&&l.length===0;return{requirementCount:V,tagCount:e.length,bound:o,manuallyVerified:c,coverage:j,orphans:s,dangling:l,duplicates:u,floorViolations:f,danglingEvidence:w,uiAcceptanceTotal:T,uiAcceptanceEvidenced:O,uiAcceptanceAutomated:A,uiAcceptanceManual:x,uiAcceptanceMissingEvidence:P,unknownPriority:d,clean:$,activeTotal:S,activeViolations:y,p0Total:p,p0Bound:h,p0Orphans:_,rampReady:K}}a(Gfe,"auditTraceability");function Wfe(r){return`${(r*100).toFixed(1)}%`}a(Wfe,"formatPercent");function Hfe(r,e="soft"){if(console.log(`Requirements: ${r.requirementCount} | bound: ${r.bound} | ui-acceptance: ${r.manuallyVerified} | coverage: ${Wfe(r.coverage)} | tags: ${r.tagCount}`),console.log(`P0 checklist: ${r.p0Bound}/${r.p0Total} bound | ramp-ready: ${r.rampReady?"yes":"no"} | gate: ${e}`),console.log(`Active requirements: ${r.activeTotal} | invariant violations: ${r.activeViolations.length}`),console.log(`ui-acceptance: ${r.uiAcceptanceTotal} | automated (eka-gui runner): ${r.uiAcceptanceAutomated} | manual (committed evidence): ${r.uiAcceptanceManual} | missing evidence: ${r.uiAcceptanceMissingEvidence}`),r.activeViolations.length>0){console.error(`
|
|
636
636
|
Active-requirement invariant violations (${r.activeViolations.length}) \u2014 an active requirement has no verification binding (HARD, always blocks):`);for(let t of r.activeViolations)console.error(` ${t.uid} ${t.label}
|
|
637
637
|
\u2192 ${t.reason}`)}if(r.dangling.length>0){console.error(`
|
|
638
638
|
Dangling @req tags (${r.dangling.length}) \u2014 uid has no requirement:`);for(let t of r.dangling)console.error(` @req:${t.uid} ${t.file}:${t.line}`)}if(r.floorViolations.length>0){console.error(`
|
|
@@ -643,7 +643,7 @@ Duplicate bindings (${r.duplicates.length}) \u2014 uid claimed by >1 test (warni
|
|
|
643
643
|
Skipped floor check for ${r.unknownPriority} requirement(s) with unparseable priority (fail-open).`),r.clean?e==="hard"&&!r.rampReady?console.error(`
|
|
644
644
|
FAIL (hard gate): ramp not ready \u2014 ${r.p0Orphans} P0 requirement(s) unbound`+(r.p0Total===0?" (no P0 requirements found)":"")+"."):console.log(`
|
|
645
645
|
OK: no hard findings (dangling tags + binding-class floor are clean).`):console.error(`
|
|
646
|
-
FAIL: ${r.dangling.length} dangling + ${r.floorViolations.length} floor violation(s) + ${r.activeViolations.length} active-requirement invariant violation(s) + ${r.danglingEvidence.length} dangling evidence link(s).`)}a(
|
|
646
|
+
FAIL: ${r.dangling.length} dangling + ${r.floorViolations.length} floor violation(s) + ${r.activeViolations.length} active-requirement invariant violation(s) + ${r.danglingEvidence.length} dangling evidence link(s).`)}a(Hfe,"renderText");function zfe(r,e,t){return!r.clean||t&&r.orphans.length>0||e==="hard"&&!r.rampReady}a(zfe,"isHardFail");function p6(){return new Le("audit").description("Audit requirement\u2194test traceability: orphans, dangling @req tags, duplicate bindings, binding-class floor, coverage, P0 ramp-readiness").requiredOption("--reqs <path>","Directory tree containing req__Requirement assets (a vault or a reqs assetspace clone)").option("--tests <path>","Test-corpus root scanned for @req:<uid> tags",".").option("--output <type>","Response format: text|json","text").option("--strict","Also exit 1 on orphan requirements",!1).option("--gate <mode>","Gate mode: soft (warn only on hard findings) | hard (also block when the P0 checklist is not ramp-ready)","soft").action(async r=>{let e=r.output??"text";ve.setFormat(e);let t=r.gate==="hard"?"hard":"soft";try{let n=(0,rc.resolve)(r.reqs);if(!(0,nc.existsSync)(n)||!(0,nc.statSync)(n).isDirectory())throw new Je(n);let i=(0,rc.resolve)(r.tests??".");if(!(0,nc.existsSync)(i)||!(0,nc.statSync)(i).isDirectory())throw new Je(i);let[s,o]=await Promise.all([Bfe(n),qfe(i)]),c=Gfe(s,o);e==="json"?console.log(JSON.stringify({...c,gate:t},null,2)):Hfe(c,t),zfe(c,t,r.strict===!0)&&(process.exitCode=1)}catch(n){ve.handle(n)}})}a(p6,"requirementsAuditCommand");function h6(){let r=new Le("requirements").description("Requirements-management tooling (RFC 0003): traceability checker");return r.addCommand(p6()),r}a(h6,"requirementsCommand");function bb(r){let e=new Le;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"16.187.0"),e.addCommand(a$()),e.addCommand(g$()),e.addCommand(u5()),e.addCommand(h5()),e.addCommand(F5()),e.addCommand(m5()),e.addCommand(w5()),e.addCommand(U5()),e.addCommand(W5()),e.addCommand(e$()),e.addCommand(n$()),e.addCommand(i$()),e.addCommand(L$()),e.addCommand(M$()),e.addCommand(Z$()),e.addCommand(t6()),e.addCommand(i6()),e.addCommand(s6()),e.addCommand(l6()),e.addCommand(G$()),e.addCommand(Q$()),e.addCommand(h6()),e}a(bb,"createProgram");bb().parse();0&&(module.exports={createProgram});
|
|
647
647
|
/*! Bundled license information:
|
|
648
648
|
|
|
649
649
|
reflect-metadata/Reflect.js:
|