@kitelev/exocortex-cli 16.224.4 → 16.224.5

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -17
  2. 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.224.4
2
+ // @kitelev/exocortex-cli v16.224.5
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 AB=Object.create;var fd=Object.defineProperty;var IB=Object.getOwnPropertyDescriptor;var xB=Object.getOwnPropertyNames;var RB=Object.getPrototypeOf,CB=Object.prototype.hasOwnProperty;var a=(n,e)=>fd(n,"name",{value:e,configurable:!0});var et=(n,e)=>()=>(n&&(e=n(n=0)),e);var v=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),pm=(n,e)=>{for(var t in e)fd(n,t,{get:e[t],enumerable:!0})},YC=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xB(e))!CB.call(n,i)&&i!==t&&fd(n,i,{get:()=>e[i],enumerable:!(r=IB(e,i))||r.enumerable});return n};var be=(n,e,t)=>(t=n!=null?AB(RB(n)):{},YC(e||!n||!n.__esModule?fd(t,"default",{value:n,enumerable:!0}):t,n)),hm=n=>YC(fd({},"__esModule",{value:!0}),n);var US=v(()=>{var QC;(function(n){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:l(),r=i(n);typeof t.Reflect<"u"&&(r=i(t.Reflect,r)),e(r,t),typeof t.Reflect>"u"&&(t.Reflect=n);function i(c,u){return function(f,d){Object.defineProperty(c,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 l(){return s()||o()}a(l,"sloppyModeThis")})(function(e,t){var r=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",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,u=!l&&!c,f={create:l?function(){return U(Object.create(null))}:c?function(){return U({__proto__:null})}:function(){return U({})},has:u?function(R,C){return r.call(R,C)}:function(R,C){return C in R},get:u?function(R,C){return r.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,b=ke(),S=We(b);function I(R,C,D,w){if(ce(D)){if(!Ce(R))throw new TypeError;if(!Oe(C))throw new TypeError;return ge(R,C)}else{if(!Ce(R))throw new TypeError;if(!ne(C))throw new TypeError;if(!ne(w)&&!ce(w)&&!ue(w))throw new TypeError;return ue(w)&&(w=void 0),D=Ee(D),ye(R,C,D,w)}}a(I,"decorate"),e("decorate",I);function O(R,C){function D(w,F){if(!ne(w))throw new TypeError;if(!ce(F)&&!Re(F))throw new TypeError;te(R,C,w,F)}return a(D,"decorator"),D}a(O,"metadata"),e("metadata",O);function T(R,C,D,w){if(!ne(D))throw new TypeError;return ce(w)||(w=Ee(w)),te(R,C,D,w)}a(T,"defineMetadata"),e("defineMetadata",T);function E(R,C,D){if(!ne(C))throw new TypeError;return ce(D)||(D=Ee(D)),Q(R,C,D)}a(E,"hasMetadata"),e("hasMetadata",E);function P(R,C,D){if(!ne(C))throw new TypeError;return ce(D)||(D=Ee(D)),se(R,C,D)}a(P,"hasOwnMetadata"),e("hasOwnMetadata",P);function V(R,C,D){if(!ne(C))throw new TypeError;return ce(D)||(D=Ee(D)),J(R,C,D)}a(V,"getMetadata"),e("getMetadata",V);function M(R,C,D){if(!ne(C))throw new TypeError;return ce(D)||(D=Ee(D)),ve(R,C,D)}a(M,"getOwnMetadata"),e("getOwnMetadata",M);function j(R,C){if(!ne(R))throw new TypeError;return ce(C)||(C=Ee(C)),ie(R,C)}a(j,"getMetadataKeys"),e("getMetadataKeys",j);function $(R,C){if(!ne(R))throw new TypeError;return ce(C)||(C=Ee(C)),he(R,C)}a($,"getOwnMetadataKeys"),e("getOwnMetadataKeys",$);function G(R,C,D){if(!ne(C))throw new TypeError;if(ce(D)||(D=Ee(D)),!ne(C))throw new TypeError;ce(D)||(D=Ee(D));var w=je(C,D,!1);return ce(w)?!1:w.OrdinaryDeleteMetadata(R,C,D)}a(G,"deleteMetadata"),e("deleteMetadata",G);function ge(R,C){for(var D=R.length-1;D>=0;--D){var w=R[D],F=w(C);if(!ce(F)&&!ue(F)){if(!Oe(F))throw new TypeError;C=F}}return C}a(ge,"DecorateConstructor");function ye(R,C,D,w){for(var F=R.length-1;F>=0;--F){var X=R[F],H=X(C,D,w);if(!ce(H)&&!ue(H)){if(!ne(H))throw new TypeError;w=H}}return w}a(ye,"DecorateProperty");function Q(R,C,D){var w=se(R,C,D);if(w)return!0;var F=Ne(C);return ue(F)?!1:Q(R,F,D)}a(Q,"OrdinaryHasMetadata");function se(R,C,D){var w=je(C,D,!1);return ce(w)?!1:B(w.OrdinaryHasOwnMetadata(R,C,D))}a(se,"OrdinaryHasOwnMetadata");function J(R,C,D){var w=se(R,C,D);if(w)return ve(R,C,D);var F=Ne(C);if(!ue(F))return J(R,F,D)}a(J,"OrdinaryGetMetadata");function ve(R,C,D){var w=je(C,D,!1);if(!ce(w))return w.OrdinaryGetOwnMetadata(R,C,D)}a(ve,"OrdinaryGetOwnMetadata");function te(R,C,D,w){var F=je(D,w,!0);F.OrdinaryDefineOwnMetadata(R,C,D,w)}a(te,"OrdinaryDefineOwnMetadata");function ie(R,C){var D=he(R,C),w=Ne(R);if(w===null)return D;var F=ie(w,C);if(F.length<=0)return D;if(D.length<=0)return F;for(var X=new h,H=[],q=0,k=D;q<k.length;q++){var N=k[q],z=X.has(N);z||(X.add(N),H.push(N))}for(var K=0,ae=F;K<ae.length;K++){var N=ae[K],z=X.has(N);z||(X.add(N),H.push(N))}return H}a(ie,"OrdinaryMetadataKeys");function he(R,C){var D=je(R,C,!1);return D?D.OrdinaryOwnMetadataKeys(R,C):[]}a(he,"OrdinaryOwnMetadataKeys");function Ue(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(Ue,"Type");function ce(R){return R===void 0}a(ce,"IsUndefined");function ue(R){return R===null}a(ue,"IsNull");function fe(R){return typeof R=="symbol"}a(fe,"IsSymbol");function ne(R){return typeof R=="object"?R!==null:typeof R=="function"}a(ne,"IsObject");function me(R,C){switch(Ue(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",w=ee(R,s);if(w!==void 0){var F=w.call(R,D);if(ne(F))throw new TypeError;return F}return Le(R,D==="default"?"number":D)}a(me,"ToPrimitive");function Le(R,C){if(C==="string"){var D=R.toString;if(xe(D)){var w=D.call(R);if(!ne(w))return w}var F=R.valueOf;if(xe(F)){var w=F.call(R);if(!ne(w))return w}}else{var F=R.valueOf;if(xe(F)){var w=F.call(R);if(!ne(w))return w}var X=R.toString;if(xe(X)){var w=X.call(R);if(!ne(w))return w}}throw new TypeError}a(Le,"OrdinaryToPrimitive");function B(R){return!!R}a(B,"ToBoolean");function oe(R){return""+R}a(oe,"ToString");function Ee(R){var C=me(R,3);return fe(C)?C:oe(C)}a(Ee,"ToPropertyKey");function Ce(R){return Array.isArray?Array.isArray(R):R instanceof Object?R instanceof Array:Object.prototype.toString.call(R)==="[object Array]"}a(Ce,"IsArray");function xe(R){return typeof R=="function"}a(xe,"IsCallable");function Oe(R){return typeof R=="function"}a(Oe,"IsConstructor");function Re(R){switch(Ue(R)){case 3:return!0;case 4:return!0;default:return!1}}a(Re,"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(!xe(D))throw new TypeError;return D}}a(ee,"GetMethod");function _e(R){var C=ee(R,o);if(!xe(C))throw new TypeError;var D=C.call(R);if(!ne(D))throw new TypeError;return D}a(_e,"GetIterator");function Te(R){return R.value}a(Te,"IteratorValue");function Pe(R){var C=R.next();return C.done?!1:C}a(Pe,"IteratorStep");function Me(R){var C=R.return;C&&C.call(R)}a(Me,"IteratorClose");function Ne(R){var C=Object.getPrototypeOf(R);if(typeof R!="function"||R===d||C!==d)return C;var D=R.prototype,w=D&&Object.getPrototypeOf(D);if(w==null||w===Object.prototype)return C;var F=w.constructor;return typeof F!="function"||F===R?C:F}a(Ne,"OrdinaryGetPrototypeOf");function Ge(){var R;!ce(y)&&typeof t.Reflect<"u"&&!(y in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(R=qe(t.Reflect));var C,D,w,F=new _,X={registerProvider:H,getProvider:k,setProvider:z};return X;function H(K){if(!Object.isExtensible(X))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case R===K:break;case ce(C):C=K;break;case C===K:break;case ce(D):D=K;break;case D===K:break;default:w===void 0&&(w=new h),w.add(K);break}}function q(K,ae){if(!ce(C)){if(C.isProviderFor(K,ae))return C;if(!ce(D)){if(D.isProviderFor(K,ae))return C;if(!ce(w))for(var Se=_e(w);;){var De=Pe(Se);if(!De)return;var rt=Te(De);if(rt.isProviderFor(K,ae))return Me(Se),rt}}}if(!ce(R)&&R.isProviderFor(K,ae))return R}function k(K,ae){var Se=F.get(K),De;return ce(Se)||(De=Se.get(ae)),ce(De)&&(De=q(K,ae),ce(De)||(ce(Se)&&(Se=new p,F.set(K,Se)),Se.set(ae,De))),De}function N(K){if(ce(K))throw new TypeError;return C===K||D===K||!ce(w)&&w.has(K)}function z(K,ae,Se){if(!N(Se))throw new Error("Metadata provider not registered.");var De=k(K,ae);if(De!==Se){if(!ce(De))return!1;var rt=F.get(K);ce(rt)&&(rt=new p,F.set(K,rt)),rt.set(ae,Se)}return!0}}a(Ge,"CreateMetadataRegistry");function ke(){var R;return!ce(y)&&ne(t.Reflect)&&Object.isExtensible(t.Reflect)&&(R=t.Reflect[y]),ce(R)&&(R=Ge()),!ce(y)&&ne(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:R}),R}a(ke,"GetOrCreateMetadataRegistry");function We(R){var C=new _,D={isProviderFor:a(function(N,z){var K=C.get(N);return ce(K)?!1:K.has(z)},"isProviderFor"),OrdinaryDefineOwnMetadata:H,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:X,OrdinaryOwnMetadataKeys:q,OrdinaryDeleteMetadata:k};return b.registerProvider(D),D;function w(N,z,K){var ae=C.get(N),Se=!1;if(ce(ae)){if(!K)return;ae=new p,C.set(N,ae),Se=!0}var De=ae.get(z);if(ce(De)){if(!K)return;if(De=new p,ae.set(z,De),!R.setProvider(N,z,D))throw ae.delete(z),Se&&C.delete(N),new Error("Wrong provider for target.")}return De}a(w,"GetOrCreateMetadataMap");function F(N,z,K){var ae=w(z,K,!1);return ce(ae)?!1:B(ae.has(N))}a(F,"OrdinaryHasOwnMetadata");function X(N,z,K){var ae=w(z,K,!1);if(!ce(ae))return ae.get(N)}a(X,"OrdinaryGetOwnMetadata");function H(N,z,K,ae){var Se=w(K,ae,!0);Se.set(N,z)}a(H,"OrdinaryDefineOwnMetadata");function q(N,z){var K=[],ae=w(N,z,!1);if(ce(ae))return K;for(var Se=ae.keys(),De=_e(Se),rt=0;;){var Jr=Pe(De);if(!Jr)return K.length=rt,K;var Cr=Te(Jr);try{K[rt]=Cr}catch(sr){try{Me(De)}finally{throw sr}}rt++}}a(q,"OrdinaryOwnMetadataKeys");function k(N,z,K){var ae=w(z,K,!1);if(ce(ae)||!ae.delete(N))return!1;if(ae.size===0){var Se=C.get(z);ce(Se)||(Se.delete(K),Se.size===0&&C.delete(Se))}return!0}a(k,"OrdinaryDeleteMetadata")}a(We,"CreateMetadataProvider");function qe(R){var C=R.defineMetadata,D=R.hasOwnMetadata,w=R.getOwnMetadata,F=R.getOwnMetadataKeys,X=R.deleteMetadata,H=new _,q={isProviderFor:a(function(k,N){var z=H.get(k);return!ce(z)&&z.has(N)?!0:F(k,N).length?(ce(z)&&(z=new h,H.set(k,z)),z.add(N),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:C,OrdinaryHasOwnMetadata:D,OrdinaryGetOwnMetadata:w,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:X};return q}a(qe,"CreateFallbackProvider");function je(R,C,D){var w=b.getProvider(R,C);if(!ce(w))return w;if(D){if(b.setProvider(R,C,S))return S;throw new Error("Illegal state.")}}a(je,"GetMetadataProvider");function He(){var R={},C=[],D=(function(){function q(k,N,z){this._index=0,this._keys=k,this._values=N,this._selector=z}return a(q,"MapIterator"),q.prototype["@@iterator"]=function(){return this},q.prototype[o]=function(){return this},q.prototype.next=function(){var k=this._index;if(k>=0&&k<this._keys.length){var N=this._selector(this._keys[k],this._values[k]);return k+1>=this._keys.length?(this._index=-1,this._keys=C,this._values=C):this._index++,{value:N,done:!1}}return{value:void 0,done:!0}},q.prototype.throw=function(k){throw this._index>=0&&(this._index=-1,this._keys=C,this._values=C),k},q.prototype.return=function(k){return this._index>=0&&(this._index=-1,this._keys=C,this._values=C),{value:k,done:!0}},q})(),w=(function(){function q(){this._keys=[],this._values=[],this._cacheKey=R,this._cacheIndex=-2}return a(q,"Map"),Object.defineProperty(q.prototype,"size",{get:a(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),q.prototype.has=function(k){return this._find(k,!1)>=0},q.prototype.get=function(k){var N=this._find(k,!1);return N>=0?this._values[N]:void 0},q.prototype.set=function(k,N){var z=this._find(k,!0);return this._values[z]=N,this},q.prototype.delete=function(k){var N=this._find(k,!1);if(N>=0){for(var z=this._keys.length,K=N+1;K<z;K++)this._keys[K-1]=this._keys[K],this._values[K-1]=this._values[K];return this._keys.length--,this._values.length--,Ae(k,this._cacheKey)&&(this._cacheKey=R,this._cacheIndex=-2),!0}return!1},q.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=R,this._cacheIndex=-2},q.prototype.keys=function(){return new D(this._keys,this._values,F)},q.prototype.values=function(){return new D(this._keys,this._values,X)},q.prototype.entries=function(){return new D(this._keys,this._values,H)},q.prototype["@@iterator"]=function(){return this.entries()},q.prototype[o]=function(){return this.entries()},q.prototype._find=function(k,N){if(!Ae(this._cacheKey,k)){this._cacheIndex=-1;for(var z=0;z<this._keys.length;z++)if(Ae(this._keys[z],k)){this._cacheIndex=z;break}}return this._cacheIndex<0&&N&&(this._cacheIndex=this._keys.length,this._keys.push(k),this._values.push(void 0)),this._cacheIndex},q})();return w;function F(q,k){return q}function X(q,k){return k}function H(q,k){return[q,k]}}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=w();return(function(){function k(){this._key=w()}return a(k,"WeakMap"),k.prototype.has=function(N){var z=F(N,!1);return z!==void 0?f.has(z,this._key):!1},k.prototype.get=function(N){var z=F(N,!1);return z!==void 0?f.get(z,this._key):void 0},k.prototype.set=function(N,z){var K=F(N,!0);return K[this._key]=z,this},k.prototype.delete=function(N){var z=F(N,!1);return z!==void 0?delete z[this._key]:!1},k.prototype.clear=function(){this._key=w()},k})();function w(){var k;do k="@@WeakMap@@"+q();while(f.has(C,k));return C[k]=!0,k}function F(k,N){if(!r.call(k,D)){if(!N)return;Object.defineProperty(k,D,{value:f.create()})}return k[D]}function X(k,N){for(var z=0;z<N;++z)k[z]=Math.random()*255|0;return k}function H(k){if(typeof Uint8Array=="function"){var N=new Uint8Array(k);return typeof crypto<"u"?crypto.getRandomValues(N):typeof msCrypto<"u"?msCrypto.getRandomValues(N):X(N,k),N}return X(new Array(k),k)}function q(){var k=H(R);k[6]=k[6]&79|64,k[8]=k[8]&191|128;for(var N="",z=0;z<R;++z){var K=k[z];(z===4||z===6||z===8)&&(N+="-"),K<16&&(N+="0"),N+=K.toString(16).toLowerCase()}return N}}a(L,"CreateWeakMapPolyfill");function U(R){return R.__=void 0,delete R.__,R}a(U,"MakeDictionary")})})(QC||(QC={}))});var dd=v(VS=>{var mm=class extends Error{static{a(this,"CommanderError")}constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},BS=class extends mm{static{a(this,"InvalidArgumentError")}constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};VS.CommanderError=mm;VS.InvalidArgumentError=BS});var gm=v(GS=>{var{InvalidArgumentError:OB}=dd(),qS=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,r)=>{if(!this.argChoices.includes(t))throw new OB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function PB(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}a(PB,"humanReadableArgName");GS.Argument=qS;GS.humanReadableArgName=PB});var zS=v(HS=>{var{humanReadableArgName:DB}=gm(),WS=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),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let r=a(i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,""),"getSortKey");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),r=e._getHelpOption();if(r&&!r.hidden){let i=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);!i&&!s?t.push(r):r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!i&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let i=r.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(r=>DB(r)).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((r,i)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+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(r=>JSON.stringify(r)).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 r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,t,r){return t.length===0?[]:[r.styleTitle(e),...t,""]}groupItems(e,t,r){let i=new Map;return e.forEach(s=>{let o=r(s);i.has(o)||i.set(o,[])}),t.forEach(s=>{let o=r(s);i.has(o)||i.set(o,[]),i.get(o).push(s)}),i}formatHelp(e,t){let r=t.padWidth(e,t),i=t.helpWidth??80;function s(d,p){return t.formatItem(d,r,p,t)}a(s,"callFormatItem");let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],l=t.commandDescription(e);l.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(l),i),""]));let c=t.visibleArguments(e).map(d=>s(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",c,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 AB=Object.create;var fd=Object.defineProperty;var IB=Object.getOwnPropertyDescriptor;var xB=Object.getOwnPropertyNames;var RB=Object.getPrototypeOf,CB=Object.prototype.hasOwnProperty;var a=(n,e)=>fd(n,"name",{value:e,configurable:!0});var et=(n,e)=>()=>(n&&(e=n(n=0)),e);var v=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),pm=(n,e)=>{for(var t in e)fd(n,t,{get:e[t],enumerable:!0})},YC=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of xB(e))!CB.call(n,i)&&i!==t&&fd(n,i,{get:()=>e[i],enumerable:!(r=IB(e,i))||r.enumerable});return n};var be=(n,e,t)=>(t=n!=null?AB(RB(n)):{},YC(e||!n||!n.__esModule?fd(t,"default",{value:n,enumerable:!0}):t,n)),hm=n=>YC(fd({},"__esModule",{value:!0}),n);var US=v(()=>{var QC;(function(n){(function(e){var t=typeof globalThis=="object"?globalThis:typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:l(),r=i(n);typeof t.Reflect<"u"&&(r=i(t.Reflect,r)),e(r,t),typeof t.Reflect>"u"&&(t.Reflect=n);function i(c,u){return function(f,d){Object.defineProperty(c,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 l(){return s()||o()}a(l,"sloppyModeThis")})(function(e,t){var r=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",l=typeof Object.create=="function",c={__proto__:[]}instanceof Array,u=!l&&!c,f={create:l?function(){return U(Object.create(null))}:c?function(){return U({__proto__:null})}:function(){return U({})},has:u?function(R,C){return r.call(R,C)}:function(R,C){return C in R},get:u?function(R,C){return r.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,b=ke(),S=We(b);function I(R,C,D,w){if(ce(D)){if(!Ce(R))throw new TypeError;if(!Oe(C))throw new TypeError;return ge(R,C)}else{if(!Ce(R))throw new TypeError;if(!ne(C))throw new TypeError;if(!ne(w)&&!ce(w)&&!ue(w))throw new TypeError;return ue(w)&&(w=void 0),D=Ee(D),ye(R,C,D,w)}}a(I,"decorate"),e("decorate",I);function O(R,C){function D(w,F){if(!ne(w))throw new TypeError;if(!ce(F)&&!Re(F))throw new TypeError;re(R,C,w,F)}return a(D,"decorator"),D}a(O,"metadata"),e("metadata",O);function T(R,C,D,w){if(!ne(D))throw new TypeError;return ce(w)||(w=Ee(w)),re(R,C,D,w)}a(T,"defineMetadata"),e("defineMetadata",T);function E(R,C,D){if(!ne(C))throw new TypeError;return ce(D)||(D=Ee(D)),Q(R,C,D)}a(E,"hasMetadata"),e("hasMetadata",E);function P(R,C,D){if(!ne(C))throw new TypeError;return ce(D)||(D=Ee(D)),se(R,C,D)}a(P,"hasOwnMetadata"),e("hasOwnMetadata",P);function V(R,C,D){if(!ne(C))throw new TypeError;return ce(D)||(D=Ee(D)),J(R,C,D)}a(V,"getMetadata"),e("getMetadata",V);function M(R,C,D){if(!ne(C))throw new TypeError;return ce(D)||(D=Ee(D)),ve(R,C,D)}a(M,"getOwnMetadata"),e("getOwnMetadata",M);function j(R,C){if(!ne(R))throw new TypeError;return ce(C)||(C=Ee(C)),ie(R,C)}a(j,"getMetadataKeys"),e("getMetadataKeys",j);function $(R,C){if(!ne(R))throw new TypeError;return ce(C)||(C=Ee(C)),he(R,C)}a($,"getOwnMetadataKeys"),e("getOwnMetadataKeys",$);function G(R,C,D){if(!ne(C))throw new TypeError;if(ce(D)||(D=Ee(D)),!ne(C))throw new TypeError;ce(D)||(D=Ee(D));var w=je(C,D,!1);return ce(w)?!1:w.OrdinaryDeleteMetadata(R,C,D)}a(G,"deleteMetadata"),e("deleteMetadata",G);function ge(R,C){for(var D=R.length-1;D>=0;--D){var w=R[D],F=w(C);if(!ce(F)&&!ue(F)){if(!Oe(F))throw new TypeError;C=F}}return C}a(ge,"DecorateConstructor");function ye(R,C,D,w){for(var F=R.length-1;F>=0;--F){var X=R[F],H=X(C,D,w);if(!ce(H)&&!ue(H)){if(!ne(H))throw new TypeError;w=H}}return w}a(ye,"DecorateProperty");function Q(R,C,D){var w=se(R,C,D);if(w)return!0;var F=Ne(C);return ue(F)?!1:Q(R,F,D)}a(Q,"OrdinaryHasMetadata");function se(R,C,D){var w=je(C,D,!1);return ce(w)?!1:B(w.OrdinaryHasOwnMetadata(R,C,D))}a(se,"OrdinaryHasOwnMetadata");function J(R,C,D){var w=se(R,C,D);if(w)return ve(R,C,D);var F=Ne(C);if(!ue(F))return J(R,F,D)}a(J,"OrdinaryGetMetadata");function ve(R,C,D){var w=je(C,D,!1);if(!ce(w))return w.OrdinaryGetOwnMetadata(R,C,D)}a(ve,"OrdinaryGetOwnMetadata");function re(R,C,D,w){var F=je(D,w,!0);F.OrdinaryDefineOwnMetadata(R,C,D,w)}a(re,"OrdinaryDefineOwnMetadata");function ie(R,C){var D=he(R,C),w=Ne(R);if(w===null)return D;var F=ie(w,C);if(F.length<=0)return D;if(D.length<=0)return F;for(var X=new h,H=[],q=0,k=D;q<k.length;q++){var N=k[q],z=X.has(N);z||(X.add(N),H.push(N))}for(var K=0,ae=F;K<ae.length;K++){var N=ae[K],z=X.has(N);z||(X.add(N),H.push(N))}return H}a(ie,"OrdinaryMetadataKeys");function he(R,C){var D=je(R,C,!1);return D?D.OrdinaryOwnMetadataKeys(R,C):[]}a(he,"OrdinaryOwnMetadataKeys");function Ue(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(Ue,"Type");function ce(R){return R===void 0}a(ce,"IsUndefined");function ue(R){return R===null}a(ue,"IsNull");function fe(R){return typeof R=="symbol"}a(fe,"IsSymbol");function ne(R){return typeof R=="object"?R!==null:typeof R=="function"}a(ne,"IsObject");function me(R,C){switch(Ue(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",w=ee(R,s);if(w!==void 0){var F=w.call(R,D);if(ne(F))throw new TypeError;return F}return Le(R,D==="default"?"number":D)}a(me,"ToPrimitive");function Le(R,C){if(C==="string"){var D=R.toString;if(xe(D)){var w=D.call(R);if(!ne(w))return w}var F=R.valueOf;if(xe(F)){var w=F.call(R);if(!ne(w))return w}}else{var F=R.valueOf;if(xe(F)){var w=F.call(R);if(!ne(w))return w}var X=R.toString;if(xe(X)){var w=X.call(R);if(!ne(w))return w}}throw new TypeError}a(Le,"OrdinaryToPrimitive");function B(R){return!!R}a(B,"ToBoolean");function oe(R){return""+R}a(oe,"ToString");function Ee(R){var C=me(R,3);return fe(C)?C:oe(C)}a(Ee,"ToPropertyKey");function Ce(R){return Array.isArray?Array.isArray(R):R instanceof Object?R instanceof Array:Object.prototype.toString.call(R)==="[object Array]"}a(Ce,"IsArray");function xe(R){return typeof R=="function"}a(xe,"IsCallable");function Oe(R){return typeof R=="function"}a(Oe,"IsConstructor");function Re(R){switch(Ue(R)){case 3:return!0;case 4:return!0;default:return!1}}a(Re,"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(!xe(D))throw new TypeError;return D}}a(ee,"GetMethod");function _e(R){var C=ee(R,o);if(!xe(C))throw new TypeError;var D=C.call(R);if(!ne(D))throw new TypeError;return D}a(_e,"GetIterator");function Te(R){return R.value}a(Te,"IteratorValue");function Pe(R){var C=R.next();return C.done?!1:C}a(Pe,"IteratorStep");function Me(R){var C=R.return;C&&C.call(R)}a(Me,"IteratorClose");function Ne(R){var C=Object.getPrototypeOf(R);if(typeof R!="function"||R===d||C!==d)return C;var D=R.prototype,w=D&&Object.getPrototypeOf(D);if(w==null||w===Object.prototype)return C;var F=w.constructor;return typeof F!="function"||F===R?C:F}a(Ne,"OrdinaryGetPrototypeOf");function Ge(){var R;!ce(y)&&typeof t.Reflect<"u"&&!(y in t.Reflect)&&typeof t.Reflect.defineMetadata=="function"&&(R=qe(t.Reflect));var C,D,w,F=new _,X={registerProvider:H,getProvider:k,setProvider:z};return X;function H(K){if(!Object.isExtensible(X))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case R===K:break;case ce(C):C=K;break;case C===K:break;case ce(D):D=K;break;case D===K:break;default:w===void 0&&(w=new h),w.add(K);break}}function q(K,ae){if(!ce(C)){if(C.isProviderFor(K,ae))return C;if(!ce(D)){if(D.isProviderFor(K,ae))return C;if(!ce(w))for(var Se=_e(w);;){var De=Pe(Se);if(!De)return;var rt=Te(De);if(rt.isProviderFor(K,ae))return Me(Se),rt}}}if(!ce(R)&&R.isProviderFor(K,ae))return R}function k(K,ae){var Se=F.get(K),De;return ce(Se)||(De=Se.get(ae)),ce(De)&&(De=q(K,ae),ce(De)||(ce(Se)&&(Se=new p,F.set(K,Se)),Se.set(ae,De))),De}function N(K){if(ce(K))throw new TypeError;return C===K||D===K||!ce(w)&&w.has(K)}function z(K,ae,Se){if(!N(Se))throw new Error("Metadata provider not registered.");var De=k(K,ae);if(De!==Se){if(!ce(De))return!1;var rt=F.get(K);ce(rt)&&(rt=new p,F.set(K,rt)),rt.set(ae,Se)}return!0}}a(Ge,"CreateMetadataRegistry");function ke(){var R;return!ce(y)&&ne(t.Reflect)&&Object.isExtensible(t.Reflect)&&(R=t.Reflect[y]),ce(R)&&(R=Ge()),!ce(y)&&ne(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:R}),R}a(ke,"GetOrCreateMetadataRegistry");function We(R){var C=new _,D={isProviderFor:a(function(N,z){var K=C.get(N);return ce(K)?!1:K.has(z)},"isProviderFor"),OrdinaryDefineOwnMetadata:H,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:X,OrdinaryOwnMetadataKeys:q,OrdinaryDeleteMetadata:k};return b.registerProvider(D),D;function w(N,z,K){var ae=C.get(N),Se=!1;if(ce(ae)){if(!K)return;ae=new p,C.set(N,ae),Se=!0}var De=ae.get(z);if(ce(De)){if(!K)return;if(De=new p,ae.set(z,De),!R.setProvider(N,z,D))throw ae.delete(z),Se&&C.delete(N),new Error("Wrong provider for target.")}return De}a(w,"GetOrCreateMetadataMap");function F(N,z,K){var ae=w(z,K,!1);return ce(ae)?!1:B(ae.has(N))}a(F,"OrdinaryHasOwnMetadata");function X(N,z,K){var ae=w(z,K,!1);if(!ce(ae))return ae.get(N)}a(X,"OrdinaryGetOwnMetadata");function H(N,z,K,ae){var Se=w(K,ae,!0);Se.set(N,z)}a(H,"OrdinaryDefineOwnMetadata");function q(N,z){var K=[],ae=w(N,z,!1);if(ce(ae))return K;for(var Se=ae.keys(),De=_e(Se),rt=0;;){var Jr=Pe(De);if(!Jr)return K.length=rt,K;var Cr=Te(Jr);try{K[rt]=Cr}catch(sr){try{Me(De)}finally{throw sr}}rt++}}a(q,"OrdinaryOwnMetadataKeys");function k(N,z,K){var ae=w(z,K,!1);if(ce(ae)||!ae.delete(N))return!1;if(ae.size===0){var Se=C.get(z);ce(Se)||(Se.delete(K),Se.size===0&&C.delete(Se))}return!0}a(k,"OrdinaryDeleteMetadata")}a(We,"CreateMetadataProvider");function qe(R){var C=R.defineMetadata,D=R.hasOwnMetadata,w=R.getOwnMetadata,F=R.getOwnMetadataKeys,X=R.deleteMetadata,H=new _,q={isProviderFor:a(function(k,N){var z=H.get(k);return!ce(z)&&z.has(N)?!0:F(k,N).length?(ce(z)&&(z=new h,H.set(k,z)),z.add(N),!0):!1},"isProviderFor"),OrdinaryDefineOwnMetadata:C,OrdinaryHasOwnMetadata:D,OrdinaryGetOwnMetadata:w,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:X};return q}a(qe,"CreateFallbackProvider");function je(R,C,D){var w=b.getProvider(R,C);if(!ce(w))return w;if(D){if(b.setProvider(R,C,S))return S;throw new Error("Illegal state.")}}a(je,"GetMetadataProvider");function He(){var R={},C=[],D=(function(){function q(k,N,z){this._index=0,this._keys=k,this._values=N,this._selector=z}return a(q,"MapIterator"),q.prototype["@@iterator"]=function(){return this},q.prototype[o]=function(){return this},q.prototype.next=function(){var k=this._index;if(k>=0&&k<this._keys.length){var N=this._selector(this._keys[k],this._values[k]);return k+1>=this._keys.length?(this._index=-1,this._keys=C,this._values=C):this._index++,{value:N,done:!1}}return{value:void 0,done:!0}},q.prototype.throw=function(k){throw this._index>=0&&(this._index=-1,this._keys=C,this._values=C),k},q.prototype.return=function(k){return this._index>=0&&(this._index=-1,this._keys=C,this._values=C),{value:k,done:!0}},q})(),w=(function(){function q(){this._keys=[],this._values=[],this._cacheKey=R,this._cacheIndex=-2}return a(q,"Map"),Object.defineProperty(q.prototype,"size",{get:a(function(){return this._keys.length},"get"),enumerable:!0,configurable:!0}),q.prototype.has=function(k){return this._find(k,!1)>=0},q.prototype.get=function(k){var N=this._find(k,!1);return N>=0?this._values[N]:void 0},q.prototype.set=function(k,N){var z=this._find(k,!0);return this._values[z]=N,this},q.prototype.delete=function(k){var N=this._find(k,!1);if(N>=0){for(var z=this._keys.length,K=N+1;K<z;K++)this._keys[K-1]=this._keys[K],this._values[K-1]=this._values[K];return this._keys.length--,this._values.length--,Ae(k,this._cacheKey)&&(this._cacheKey=R,this._cacheIndex=-2),!0}return!1},q.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=R,this._cacheIndex=-2},q.prototype.keys=function(){return new D(this._keys,this._values,F)},q.prototype.values=function(){return new D(this._keys,this._values,X)},q.prototype.entries=function(){return new D(this._keys,this._values,H)},q.prototype["@@iterator"]=function(){return this.entries()},q.prototype[o]=function(){return this.entries()},q.prototype._find=function(k,N){if(!Ae(this._cacheKey,k)){this._cacheIndex=-1;for(var z=0;z<this._keys.length;z++)if(Ae(this._keys[z],k)){this._cacheIndex=z;break}}return this._cacheIndex<0&&N&&(this._cacheIndex=this._keys.length,this._keys.push(k),this._values.push(void 0)),this._cacheIndex},q})();return w;function F(q,k){return q}function X(q,k){return k}function H(q,k){return[q,k]}}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=w();return(function(){function k(){this._key=w()}return a(k,"WeakMap"),k.prototype.has=function(N){var z=F(N,!1);return z!==void 0?f.has(z,this._key):!1},k.prototype.get=function(N){var z=F(N,!1);return z!==void 0?f.get(z,this._key):void 0},k.prototype.set=function(N,z){var K=F(N,!0);return K[this._key]=z,this},k.prototype.delete=function(N){var z=F(N,!1);return z!==void 0?delete z[this._key]:!1},k.prototype.clear=function(){this._key=w()},k})();function w(){var k;do k="@@WeakMap@@"+q();while(f.has(C,k));return C[k]=!0,k}function F(k,N){if(!r.call(k,D)){if(!N)return;Object.defineProperty(k,D,{value:f.create()})}return k[D]}function X(k,N){for(var z=0;z<N;++z)k[z]=Math.random()*255|0;return k}function H(k){if(typeof Uint8Array=="function"){var N=new Uint8Array(k);return typeof crypto<"u"?crypto.getRandomValues(N):typeof msCrypto<"u"?msCrypto.getRandomValues(N):X(N,k),N}return X(new Array(k),k)}function q(){var k=H(R);k[6]=k[6]&79|64,k[8]=k[8]&191|128;for(var N="",z=0;z<R;++z){var K=k[z];(z===4||z===6||z===8)&&(N+="-"),K<16&&(N+="0"),N+=K.toString(16).toLowerCase()}return N}}a(L,"CreateWeakMapPolyfill");function U(R){return R.__=void 0,delete R.__,R}a(U,"MakeDictionary")})})(QC||(QC={}))});var dd=v(VS=>{var mm=class extends Error{static{a(this,"CommanderError")}constructor(e,t,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},BS=class extends mm{static{a(this,"InvalidArgumentError")}constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};VS.CommanderError=mm;VS.InvalidArgumentError=BS});var gm=v(GS=>{var{InvalidArgumentError:OB}=dd(),qS=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,r)=>{if(!this.argChoices.includes(t))throw new OB(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(t,r):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function PB(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}a(PB,"humanReadableArgName");GS.Argument=qS;GS.humanReadableArgName=PB});var zS=v(HS=>{var{humanReadableArgName:DB}=gm(),WS=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),r=e._getHelpCommand();return r&&!r._hidden&&t.push(r),this.sortSubcommands&&t.sort((i,s)=>i.name().localeCompare(s.name())),t}compareOptions(e,t){let r=a(i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,""),"getSortKey");return r(e).localeCompare(r(t))}visibleOptions(e){let t=e.options.filter(i=>!i.hidden),r=e._getHelpOption();if(r&&!r.hidden){let i=r.short&&e._findOption(r.short),s=r.long&&e._findOption(r.long);!i&&!s?t.push(r):r.long&&!s?t.push(e.createOption(r.long,r.description)):r.short&&!i&&t.push(e.createOption(r.short,r.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let r=e.parent;r;r=r.parent){let i=r.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(r=>DB(r)).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((r,i)=>Math.max(r,this.displayWidth(t.styleSubcommandTerm(t.subcommandTerm(i)))),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleOptionTerm(t.optionTerm(i)))),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((r,i)=>Math.max(r,this.displayWidth(t.styleArgumentTerm(t.argumentTerm(i)))),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+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(r=>JSON.stringify(r)).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 r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let r=`(${t.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,t,r){return t.length===0?[]:[r.styleTitle(e),...t,""]}groupItems(e,t,r){let i=new Map;return e.forEach(s=>{let o=r(s);i.has(o)||i.set(o,[])}),t.forEach(s=>{let o=r(s);i.has(o)||i.set(o,[]),i.get(o).push(s)}),i}formatHelp(e,t){let r=t.padWidth(e,t),i=t.helpWidth??80;function s(d,p){return t.formatItem(d,r,p,t)}a(s,"callFormatItem");let o=[`${t.styleTitle("Usage:")} ${t.styleUsage(t.commandUsage(e))}`,""],l=t.commandDescription(e);l.length>0&&(o=o.concat([t.boxWrap(t.styleCommandDescription(l),i),""]));let c=t.visibleArguments(e).map(d=>s(t.styleArgumentTerm(t.argumentTerm(d)),t.styleArgumentDescription(t.argumentDescription(d))));if(o=o.concat(this.formatItemList("Arguments:",c,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 XC(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,r,i){let o=" ".repeat(2);if(!r)return o+e;let l=e.padEnd(t+e.length-i.displayWidth(e)),c=2,f=(this.helpWidth??80)-t-c-2,d;return f<this.minWidthToWrap||i.preformatted(r)?d=r:d=i.boxWrap(r,f).replace(/\n/g,`
8
8
  `+" ".repeat(t+c)),o+l+" ".repeat(c)+d.replace(/\n/g,`
9
9
  ${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,s=[];return r.forEach(o=>{let l=o.match(i);if(l===null){s.push("");return}let c=[l.shift()],u=this.displayWidth(c[0]);l.forEach(f=>{let d=this.displayWidth(f);if(u+d<=t){c.push(f),u+=d;return}s.push(c.join(""));let p=f.trimStart();c=[p],u=this.displayWidth(p)}),s.push(c.join(""))}),s.join(`
@@ -31,7 +31,7 @@ Expecting one of '${r.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let
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 nO(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="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]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],i=s[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}a(nO,"incrementNodeInspectorPort");function tw(){if(St.env.NO_COLOR||St.env.FORCE_COLOR==="0"||St.env.FORCE_COLOR==="false")return!1;if(St.env.FORCE_COLOR||St.env.CLICOLOR_FORCE!==void 0)return!0}a(tw,"useColor");rw.Command=ew;rw.useColor=tw});var lO=v(Ai=>{var{Argument:sO}=gm(),{Command:nw}=iO(),{CommanderError:qB,InvalidArgumentError:oO}=dd(),{Help:GB}=zS(),{Option:aO}=XS();Ai.program=new nw;Ai.createCommand=n=>new nw(n);Ai.createOption=(n,e)=>new aO(n,e);Ai.createArgument=(n,e)=>new sO(n,e);Ai.Command=nw;Ai.Option=aO;Ai.Argument=sO;Ai.Help=GB;Ai.CommanderError=qB;Ai.InvalidArgumentError=oO;Ai.InvalidOptionArgumentError=oO});var cO,hhe,mhe,ghe,yhe,_he,bhe,She,Ie,whe,Ehe,vhe,ft=et(()=>{cO=be(lO(),1),{program:hhe,createCommand:mhe,createArgument:ghe,createOption:yhe,CommanderError:_he,InvalidArgumentError:bhe,InvalidOptionArgumentError:She,Command:Ie,Argument:whe,Option:Ehe,Help:vhe}=cO.default});var Al=v(_m=>{"use strict";Object.defineProperty(_m,"__esModule",{value:!0});_m.AssetClass=void 0;var uO;(function(n){n.AREA="ems__Area",n.TASK="ems__Task",n.PROJECT="ems__Project",n.ACTION="ems__Action",n.MEETING="ems__Meeting",n.INITIATIVE="ems__Initiative",n.TASK_PROTOTYPE="ems__TaskPrototype",n.MEETING_PROTOTYPE="ems__MeetingPrototype",n.EVENT_PROTOTYPE="exo__EventPrototype",n.PROJECT_PROTOTYPE="ems__ProjectPrototype",n.EVENT="exo__Event",n.DAILY_NOTE="pn__DailyNote",n.CONCEPT="ims__Concept",n.SESSION_START_EVENT="ems__SessionStartEvent",n.SESSION_END_EVENT="ems__SessionEndEvent",n.PROTOTYPE="exo__Prototype",n.CLASS="exo__Class",n.FLEETING_NOTE="ztlk__FleetingNote",n.WORKFLOW="ems__Workflow",n.WORKFLOW_STATE="ems__WorkflowState",n.WORKFLOW_TRANSITION="ems__WorkflowTransition",n.COMMAND="exocmd__Command",n.PRECONDITION="exocmd__Precondition",n.GROUNDING="exocmd__Grounding",n.COMMAND_BINDING="exocmd__CommandBinding"})(uO||(_m.AssetClass=uO={}))});var Il=v(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.EffortStatus=void 0;var fO;(function(n){n.DRAFT="ems__EffortStatusDraft",n.BACKLOG="ems__EffortStatusBacklog",n.DOING="ems__EffortStatusDoing",n.WAITING="ems__EffortStatusWaiting",n.DONE="ems__EffortStatusDone",n.TRASHED="ems__EffortStatusTrashed"})(fO||(bm.EffortStatus=fO={}))});var iw=v(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.EFFORT_STATUS_OPTIONS=void 0;Sm.EFFORT_STATUS_OPTIONS=[{value:"[[ems__EffortStatusDraft]]",label:"Draft"},{value:"[[ems__EffortStatusBacklog]]",label:"Backlog"},{value:"[[ems__EffortStatusDoing]]",label:"Doing"},{value:"[[ems__EffortStatusWaiting]]",label:"Waiting"},{value:"[[ems__EffortStatusDone]]",label:"Done"},{value:"[[ems__EffortStatusTrashed]]",label:"Trashed"}]});var Sa=v(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.GroundingType=void 0;var dO;(function(n){n.SPARQL_UPDATE="sparql_update",n.PROPERTY_DELETE="property_delete",n.PROPERTY_SET="property_set",n.COMPOSITE="composite",n.SERVICE_CALL="service_call",n.CREATE_INSTANCE="create_instance",n.PROPERTY_APPEND="property_append",n.PROPERTY_INCREMENT="property_increment",n.PROPERTY_SHIFT="property_shift",n.WORKFLOW_TRANSITION="workflow_transition",n.BODY_TEMPLATE="body_template"})(dO||(wm.GroundingType=dO={}))});var pd=v(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.GROUNDING_TYPE_IRI_TO_ENUM=Kn.GROUNDING_TYPE_UID_TO_ENUM=Kn.GROUNDING_TYPE_UIDS=void 0;Kn.resolveGroundingTypeFromIRI=HB;Kn.resolveGroundingTypeFromWikilinkLiteral=zB;var er=Sa();Kn.GROUNDING_TYPE_UIDS={[er.GroundingType.PROPERTY_SET]:"cf3bb923-f1f1-40be-b728-782844402426",[er.GroundingType.PROPERTY_DELETE]:"4bdf1d0b-e9da-4d96-bafe-c5aaef8c2bd5",[er.GroundingType.COMPOSITE]:"8f9a57db-3865-4886-92fb-c5ab7f3c3fa3",[er.GroundingType.SERVICE_CALL]:"9bf9fc99-ac37-4e51-b9f5-bd920099947c",[er.GroundingType.CREATE_INSTANCE]:"4367e2d6-6c92-450a-becb-abce1fb07682",[er.GroundingType.PROPERTY_APPEND]:"572f7e69-a8a1-42f6-8113-5aa65cc4b552",[er.GroundingType.PROPERTY_INCREMENT]:"afc29f90-45eb-4f94-9fe2-2ce738759161",[er.GroundingType.PROPERTY_SHIFT]:"f4e5266f-f3cc-49fd-a5a5-ce1e8b7847a4",[er.GroundingType.SPARQL_UPDATE]:"79c3e709-8d1d-4694-bcc6-b9ff07d59b86",[er.GroundingType.WORKFLOW_TRANSITION]:"5c1a2552-d576-496d-8823-563573dd1e2f",[er.GroundingType.BODY_TEMPLATE]:"6093bfcb-cf9b-4565-86c3-ff74d8bc11c0"};Kn.GROUNDING_TYPE_UID_TO_ENUM=Object.freeze(Object.fromEntries(Object.entries(Kn.GROUNDING_TYPE_UIDS).map(([n,e])=>[e,n])));var Vi="https://exocortex.my/ontology/exocmd#";Kn.GROUNDING_TYPE_IRI_TO_ENUM=Object.freeze({[`${Vi}GroundingTypePropertySet`]:er.GroundingType.PROPERTY_SET,[`${Vi}GroundingTypePropertyDelete`]:er.GroundingType.PROPERTY_DELETE,[`${Vi}GroundingTypeComposite`]:er.GroundingType.COMPOSITE,[`${Vi}GroundingTypeServiceCall`]:er.GroundingType.SERVICE_CALL,[`${Vi}GroundingTypeCreateInstance`]:er.GroundingType.CREATE_INSTANCE,[`${Vi}GroundingTypePropertyAppend`]:er.GroundingType.PROPERTY_APPEND,[`${Vi}GroundingTypePropertyIncrement`]:er.GroundingType.PROPERTY_INCREMENT,[`${Vi}GroundingTypePropertyShift`]:er.GroundingType.PROPERTY_SHIFT,[`${Vi}GroundingTypeSparqlUpdate`]:er.GroundingType.SPARQL_UPDATE,[`${Vi}GroundingTypeWorkflowTransition`]:er.GroundingType.WORKFLOW_TRANSITION,[`${Vi}GroundingTypeBodyTemplate`]:er.GroundingType.BODY_TEMPLATE});var WB=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;function HB(n){let e=Kn.GROUNDING_TYPE_IRI_TO_ENUM[n];if(e!==void 0)return e;let t=n.match(WB);return t?Kn.GROUNDING_TYPE_UID_TO_ENUM[t[1].toLowerCase()]??null:null}a(HB,"resolveGroundingTypeFromIRI");function zB(n){let e=n.match(/^\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\|[^\]]*)?\]\]$/i);return e?Kn.GROUNDING_TYPE_UID_TO_ENUM[e[1].toLowerCase()]??null:null}a(zB,"resolveGroundingTypeFromWikilinkLiteral")});var sw=v(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.CommandBindingStyleProperty=Ii.CommandBindingProperty=Ii.GroundingProperty=Ii.PreconditionProperty=Ii.CommandProperty=void 0;Ii.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"};Ii.PreconditionProperty={SPARQL_ASK:"exocmd__Precondition_sparqlAsk",QUERY:"exocmd__Precondition_query"};Ii.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"};Ii.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"};Ii.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 ow=v(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.STYLE_SOURCE_VALUES=Yn.LABEL_CLASS_VALUES=Yn.COMMAND_VARIANT_VALUES=void 0;Yn.isCommandVariant=KB;Yn.isLabelClass=YB;Yn.isStyleSource=QB;Yn.COMMAND_VARIANT_VALUES=Object.freeze(["primary","secondary","success","warning","danger","muted"]);Yn.LABEL_CLASS_VALUES=Object.freeze(["muted","bold","uppercase","compact"]);Yn.STYLE_SOURCE_VALUES=Object.freeze(["vendor","user"]);function KB(n){return typeof n=="string"&&Yn.COMMAND_VARIANT_VALUES.includes(n)}a(KB,"isCommandVariant");function YB(n){return typeof n=="string"&&Yn.LABEL_CLASS_VALUES.includes(n)}a(YB,"isLabelClass");function QB(n){return typeof n=="string"&&Yn.STYLE_SOURCE_VALUES.includes(n)}a(QB,"isStyleSource")});var pO=v($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.isCommandFrontmatter=XB;$c.isPreconditionFrontmatter=JB;$c.isGroundingFrontmatter=ZB;$c.isCommandBindingFrontmatter=e7;function XB(n){return Em(n,"exocmd__Command")}a(XB,"isCommandFrontmatter");function JB(n){return Em(n,"exocmd__Precondition")}a(JB,"isPreconditionFrontmatter");function ZB(n){return Em(n,"exocmd__Grounding")}a(ZB,"isGroundingFrontmatter");function e7(n){return Em(n,"exocmd__CommandBinding")}a(e7,"isCommandBindingFrontmatter");function Em(n,e){let t=n.exo__Instance_class;if(t==null)return!1;let r=Array.isArray(t)?t:[t];for(let i of r){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/);if((s?s[1]:i)===e)return!0}return!1}a(Em,"hasInstanceClass")});var hO=v(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});aw.parseGroundingDefinitionFromFrontmatter=r7;var t7=pd();function vm(n){if(typeof n!="string")return"";let e=n.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t>=0?e.slice(0,t).trim():e}a(vm,"normalizeGroundingRef");function r7(n,e,t){let r=e.exocmd__Grounding_type,i=(()=>{if(typeof r!="string")return r;let E=(0,t7.resolveGroundingTypeFromWikilinkLiteral)(r);if(E!==null)return E;throw new Error(`[exocmd-grounding-type-literal-form] legacy literal-string '${r}' for exocmd__Grounding_type in fixture ${n}. 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 E=e.exocmd__Grounding_steps;Array.isArray(E)&&(o=E.map(P=>t(vm(P))))}let l=e.exocmd__Grounding_incrementBy,c;if(l!=null&&l!==""){let E=Number.parseInt(String(l),10);Number.isFinite(E)&&(c=E)}let u=e.exocmd__Grounding_targetValueRef,f=u?vm(u):void 0,d=e.exocmd__Grounding_templateRef,p=d?vm(d):void 0,h=e.exocmd__Grounding_cloneTargetBody,_=h===!0||h==="true",y=e.exocmd__Grounding_targetsCreatedInstance,b=y===!0||y==="true",S=e.exocmd__Grounding_omitLabel,I=S===!0||S==="true",O=e.exocmd__Grounding_targetQuery,T=O?vm(O):void 0;return{id:n,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:c,linkBackProperty:e.exocmd__Grounding_linkBackProperty,bodyTemplate:e.exocmd__Grounding_bodyTemplate,templateRef:p,cloneTargetBody:_,targetsCreatedInstance:b,omitLabel:I,targetQuery:T,steps:o}}a(r7,"parseGroundingDefinitionFromFrontmatter")});var mO=v(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.hasPosition=n7;Tm.isFixed=i7;function n7(n){return typeof n.x=="number"&&typeof n.y=="number"}a(n7,"hasPosition");function i7(n){return n.fx!==null&&n.fx!==void 0&&n.fy!==null&&n.fy!==void 0}a(i7,"isFixed")});var gO=v(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.createEmptyGraphData=s7;Am.mergeGraphData=o7;function s7(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}a(s7,"createEmptyGraphData");function o7(n,e){let t=new Map,r=new Set,i=[];for(let s of n.nodes)t.set(s.id,s);for(let s of e.nodes)t.set(s.id,s);for(let s of n.edges){let o=`${s.source}->${s.target}:${s.type}`;r.has(o)||(r.add(o),i.push(s))}for(let s of e.edges){let o=`${s.source}->${s.target}:${s.type}`;r.has(o)||(r.add(o),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(n.version??0,e.version??0)+1}}a(o7,"mergeGraphData")});var lw=v(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.createEdgeId=a7;Im.edgesEqual=l7;function a7(n,e,t,r){let i=r?`|${r}`:"";return`${n}->${e}:${t}${i}`}a(a7,"createEdgeId");function l7(n,e){return n.source===e.source&&n.target===e.target&&n.type===e.type&&n.predicate===e.predicate}a(l7,"edgesEqual")});var cw=v(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.BUILT_IN_EDGE_STYLES=tr.BUILT_IN_NODE_STYLES=tr.DEFAULT_EDGE_STYLE=tr.DEFAULT_NODE_STYLE=tr.RDF_TYPE_PREDICATES=void 0;tr.mergeNodeStyles=c7;tr.mergeEdgeStyles=u7;tr.extractLocalName=f7;tr.isClassType=d7;tr.isTypePredicate=p7;tr.isSubClassPredicate=h7;tr.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"};tr.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};tr.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};tr.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"}};tr.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 c7(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(c7,"mergeNodeStyles");function u7(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(u7,"mergeEdgeStyles");function f7(n){let e=n.lastIndexOf("#"),t=n.lastIndexOf("/"),r=Math.max(e,t);return r>=0?n.substring(r+1):n}a(f7,"extractLocalName");function d7(n){return n===tr.RDF_TYPE_PREDICATES.RDFS_CLASS||n===tr.RDF_TYPE_PREDICATES.OWL_CLASS}a(d7,"isClassType");function p7(n){return n===tr.RDF_TYPE_PREDICATES.RDF_TYPE}a(p7,"isTypePredicate");function h7(n){return n===tr.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}a(h7,"isSubClassPredicate")});var _O=v(yO=>{"use strict";Object.defineProperty(yO,"__esModule",{value:!0})});var ze=v(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.IRI=void 0;var uw=class n{static{a(this,"IRI")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("IRI cannot be empty");if(!n.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 r=["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(!r.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)}}};xm.IRI=uw});var tt=v(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.Literal=void 0;xl.parseLanguageTag=bO;xl.createDirectionalLiteral=g7;xl.createLiteralFromLanguageTag=y7;var m7="http://www.w3.org/2001/XMLSchema#string",hd=class{static{a(this,"Literal")}constructor(e,t,r,i){if(e.length===0)throw new Error("Literal value cannot be empty");if(t&&r)throw new Error("Literal cannot have both datatype and language tag");if(i&&!r)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=r?r.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(),r=e.normalizedDatatype();return t===r}normalizedDatatype(){return!this._datatype||this._datatype.value===m7?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}};xl.Literal=hd;function bO(n){let t=n.lastIndexOf("--");if(t===-1)return{language:n.toLowerCase()};let r=n.substring(t+2),i=n.substring(0,t);return r==="ltr"||r==="rtl"?{language:i.toLowerCase(),direction:r}:{language:n.toLowerCase()}}a(bO,"parseLanguageTag");function g7(n,e,t){return new hd(n,void 0,e,t)}a(g7,"createDirectionalLiteral");function y7(n,e){let{language:t,direction:r}=bO(e);return new hd(n,void 0,t,r)}a(y7,"createLiteralFromLanguageTag")});var Yt=v(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.BlankNode=void 0;var Rm=class n{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${++n.counter}`}static create(){return new n(n.generateId())}};Cm.BlankNode=Rm;Rm.counter=0});var Vt=v(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.Namespace=void 0;var SO=ze(),Je=class n{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 SO.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new SO.IRI(`${this._iri.value}${e}`)}expand(e){let t=e.split(":");if(t.length!==2)return null;let[r,i]=t;return r!==this._prefix?null:this.term(i)}static forPrefix(e){if(!/^[a-z][a-zA-Z0-9]*$/.test(e))return null;let t=n.KNOWN_NAMESPACES.find(r=>r.prefix===e);return t||new n(e,`${n.EXOCORTEX_ONTOLOGY_BASE}${e}#`)}static fromPropertyKey(e){let t=/^([a-z][a-zA-Z0-9]*)__(.+)$/.exec(e);if(!t)return null;let r=n.forPrefix(t[1]);return r?{namespace:r,localName:t[2]}:null}static fromTermIRI(e){if(typeof e!="string"||e.length===0)return null;let t=a(c=>c.length>0&&!c.includes("#")&&!c.includes("/")?c:null,"cleanLocal");for(let c of n.KNOWN_NAMESPACES){let u=c.iri.value;if(e.startsWith(u)){let f=t(e.slice(u.length));return f===null?null:{namespace:c,localName:f}}}if(!e.startsWith(n.EXOCORTEX_ONTOLOGY_BASE))return null;let r=e.slice(n.EXOCORTEX_ONTOLOGY_BASE.length),i=r.indexOf("#");if(i<=0)return null;let s=r.slice(0,i);if(!/^[a-z][a-zA-Z0-9]*$/.test(s))return null;let o=t(r.slice(i+1));if(o===null)return null;let l=n.forPrefix(s);return l?{namespace:l,localName:o}:null}static knownNamespaces(){return n.KNOWN_NAMESPACES}};Om.Namespace=Je;Je.RDF=new Je("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");Je.RDFS=new Je("rdfs","http://www.w3.org/2000/01/rdf-schema#");Je.OWL=new Je("owl","http://www.w3.org/2002/07/owl#");Je.XSD=new Je("xsd","http://www.w3.org/2001/XMLSchema#");Je.SHACL=new Je("sh","http://www.w3.org/ns/shacl#");Je.EXO=new Je("exo","https://exocortex.my/ontology/exo#");Je.EMS=new Je("ems","https://exocortex.my/ontology/ems#");Je.EXOCMD=new Je("exocmd","https://exocortex.my/ontology/exocmd#");Je.IMS=new Je("ims","https://exocortex.my/ontology/ims#");Je.ZTLK=new Je("ztlk","https://exocortex.my/ontology/ztlk#");Je.PTMS=new Je("ptms","https://exocortex.my/ontology/ptms#");Je.LIT=new Je("lit","https://exocortex.my/ontology/lit#");Je.INBOX=new Je("inbox","https://exocortex.my/ontology/inbox#");Je.PMBOK=new Je("pmbok","https://exocortex.my/ontology/pmbok#");Je.EXOCORTEX_ONTOLOGY_BASE="https://exocortex.my/ontology/";Je.KNOWN_NAMESPACES=[Je.EXO,Je.EMS,Je.EXOCMD,Je.IMS,Je.ZTLK,Je.PTMS,Je.LIT,Je.INBOX,Je.PMBOK,Je.RDF,Je.RDFS,Je.OWL,Je.XSD,Je.SHACL]});var Qn=v(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Triple=void 0;var fw=ze(),dw=tt(),pw=Yt(),hw=class{static{a(this,"Triple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}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 fw.IRI&&t instanceof fw.IRI||e instanceof pw.BlankNode&&t instanceof pw.BlankNode||e instanceof dw.Literal&&t instanceof dw.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}>`,r=this.nodeToString(this._object);return`${e} ${t} ${r} .`}nodeToString(e){return e instanceof fw.IRI?`<${e.value}>`:e instanceof pw.BlankNode||e instanceof dw.Literal||this.isQuotedTriple(e)?e.toString():""}};Pm.Triple=hw});var md=v(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.QuotedTriple=void 0;var mw=ze(),gw=tt(),yw=Yt(),_w=class n{static{a(this,"QuotedTriple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}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 mw.IRI&&t instanceof mw.IRI||e instanceof yw.BlankNode&&t instanceof yw.BlankNode||e instanceof gw.Literal&&t instanceof gw.Literal||e instanceof n&&t instanceof n?e.equals(t):!1}get termType(){return"QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,r=this.nodeToString(this._object);return`<< ${e} ${t} ${r} >>`}nodeToString(e){return e instanceof mw.IRI?`<${e.value}>`:e instanceof yw.BlankNode||e instanceof gw.Literal||e instanceof n?e.toString():""}};Dm.QuotedTriple=_w});var wO=v(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.QuotedTriple=gr.Triple=gr.Namespace=gr.BlankNode=gr.createLiteralFromLanguageTag=gr.createDirectionalLiteral=gr.parseLanguageTag=gr.Literal=gr.IRI=void 0;var _7=ze();Object.defineProperty(gr,"IRI",{enumerable:!0,get:a(function(){return _7.IRI},"get")});var Fm=tt();Object.defineProperty(gr,"Literal",{enumerable:!0,get:a(function(){return Fm.Literal},"get")});Object.defineProperty(gr,"parseLanguageTag",{enumerable:!0,get:a(function(){return Fm.parseLanguageTag},"get")});Object.defineProperty(gr,"createDirectionalLiteral",{enumerable:!0,get:a(function(){return Fm.createDirectionalLiteral},"get")});Object.defineProperty(gr,"createLiteralFromLanguageTag",{enumerable:!0,get:a(function(){return Fm.createLiteralFromLanguageTag},"get")});var b7=Yt();Object.defineProperty(gr,"BlankNode",{enumerable:!0,get:a(function(){return b7.BlankNode},"get")});var S7=Vt();Object.defineProperty(gr,"Namespace",{enumerable:!0,get:a(function(){return S7.Namespace},"get")});var w7=Qn();Object.defineProperty(gr,"Triple",{enumerable:!0,get:a(function(){return w7.Triple},"get")});var E7=md();Object.defineProperty(gr,"QuotedTriple",{enumerable:!0,get:a(function(){return E7.QuotedTriple},"get")})});var Lm=v(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.UUID_URL_NAMESPACE=Ri.DEFAULT_LANGUAGE_TAG=Ri.REQUIRED_PROPERTIES=Ri.ALLOWED_PROPERTIES=Ri.Exo003MetadataType=void 0;var xi;(function(n){n.Namespace="namespace",n.Anchor="anchor",n.BlankNode="blank_node",n.Statement="statement",n.Body="body"})(xi||(Ri.Exo003MetadataType=xi={}));Ri.ALLOWED_PROPERTIES={[xi.Namespace]:["metadata","uri","aliases"],[xi.Anchor]:["metadata","uri","aliases"],[xi.BlankNode]:["metadata","uri","aliases"],[xi.Statement]:["metadata","subject","predicate","object","aliases"],[xi.Body]:["metadata","subject","predicate","aliases"]};Ri.REQUIRED_PROPERTIES={[xi.Namespace]:["metadata","uri"],[xi.Anchor]:["metadata","uri"],[xi.BlankNode]:["metadata","uri"],[xi.Statement]:["metadata","subject","predicate","object"],[xi.Body]:["metadata","subject","predicate"]};Ri.DEFAULT_LANGUAGE_TAG="ru";Ri.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var EO=v(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0});bw.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var vO=v(Sw=>{"use strict";Object.defineProperty(Sw,"__esModule",{value:!0});Sw.default="00000000-0000-0000-0000-000000000000"});var TO=v(ww=>{"use strict";Object.defineProperty(ww,"__esModule",{value:!0});ww.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 gd=v(Ew=>{"use strict";Object.defineProperty(Ew,"__esModule",{value:!0});var v7=TO();function T7(n){return typeof n=="string"&&v7.default.test(n)}a(T7,"validate");Ew.default=T7});var yd=v(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0});var A7=gd();function I7(n){if(!(0,A7.default)(n))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(n.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(n.slice(9,13),16))>>>8,e&255,(e=parseInt(n.slice(14,18),16))>>>8,e&255,(e=parseInt(n.slice(19,23),16))>>>8,e&255,(e=parseInt(n.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}a(I7,"parse");vw.default=I7});var wo=v(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});_d.unsafeStringify=void 0;var x7=gd(),tn=[];for(let n=0;n<256;++n)tn.push((n+256).toString(16).slice(1));function AO(n,e=0){return(tn[n[e+0]]+tn[n[e+1]]+tn[n[e+2]]+tn[n[e+3]]+"-"+tn[n[e+4]]+tn[n[e+5]]+"-"+tn[n[e+6]]+tn[n[e+7]]+"-"+tn[n[e+8]]+tn[n[e+9]]+"-"+tn[n[e+10]]+tn[n[e+11]]+tn[n[e+12]]+tn[n[e+13]]+tn[n[e+14]]+tn[n[e+15]]).toLowerCase()}a(AO,"unsafeStringify");_d.unsafeStringify=AO;function R7(n,e=0){let t=AO(n,e);if(!(0,x7.default)(t))throw TypeError("Stringified UUID is invalid");return t}a(R7,"stringify");_d.default=R7});var Mm=v(Tw=>{"use strict";Object.defineProperty(Tw,"__esModule",{value:!0});var C7=require("crypto"),km=new Uint8Array(256),Nm=km.length;function O7(){return Nm>km.length-16&&((0,C7.randomFillSync)(km),Nm=0),km.slice(Nm,Nm+=16)}a(O7,"rng");Tw.default=O7});var Aw=v(Sd=>{"use strict";Object.defineProperty(Sd,"__esModule",{value:!0});Sd.updateV1State=void 0;var IO=Mm(),P7=wo(),bd={};function D7(n,e,t){let r,i=n?._v6??!1;if(n){let s=Object.keys(n);s.length===1&&s[0]==="_v6"&&(n=void 0)}if(n)r=xO(n.random??n.rng?.()??(0,IO.default)(),n.msecs,n.nsecs,n.clockseq,n.node,e,t);else{let s=Date.now(),o=(0,IO.default)();RO(bd,s,o),r=xO(o,bd.msecs,bd.nsecs,i?void 0:bd.clockseq,i?void 0:bd.node,e,t)}return e??(0,P7.unsafeStringify)(r)}a(D7,"v1");function RO(n,e,t){return n.msecs??=-1/0,n.nsecs??=0,e===n.msecs?(n.nsecs++,n.nsecs>=1e4&&(n.node=void 0,n.nsecs=0)):e>n.msecs?n.nsecs=0:e<n.msecs&&(n.node=void 0),n.node||(n.node=t.slice(10,16),n.node[0]|=1,n.clockseq=(t[8]<<8|t[9])&16383),n.msecs=e,n}a(RO,"updateV1State");Sd.updateV1State=RO;function xO(n,e,t,r,i,s,o=0){if(n.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,r??=(n[8]<<8|n[9])&16383,i??=n.slice(10,16),e+=122192928e5;let l=((e&268435455)*1e4+t)%4294967296;s[o++]=l>>>24&255,s[o++]=l>>>16&255,s[o++]=l>>>8&255,s[o++]=l&255;let c=e/4294967296*1e4&268435455;s[o++]=c>>>8&255,s[o++]=c&255,s[o++]=c>>>24&15|16,s[o++]=c>>>16&255,s[o++]=r>>>8|128,s[o++]=r&255;for(let u=0;u<6;++u)s[o++]=i[u];return s}a(xO,"v1Bytes");Sd.default=D7});var xw=v(Iw=>{"use strict";Object.defineProperty(Iw,"__esModule",{value:!0});var F7=yd(),L7=wo();function N7(n){let e=typeof n=="string"?(0,F7.default)(n):n,t=k7(e);return typeof n=="string"?(0,L7.unsafeStringify)(t):t}a(N7,"v1ToV6");Iw.default=N7;function k7(n){return Uint8Array.of((n[6]&15)<<4|n[7]>>4&15,(n[7]&15)<<4|(n[4]&240)>>4,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,(n[1]&15)<<4|(n[2]&240)>>4,96|n[2]&15,n[3],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}a(k7,"_v1ToV6")});var CO=v(Rw=>{"use strict";Object.defineProperty(Rw,"__esModule",{value:!0});var M7=require("crypto");function j7(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,M7.createHash)("md5").update(n).digest()}a(j7,"md5");Rw.default=j7});var wd=v(Eo=>{"use strict";Object.defineProperty(Eo,"__esModule",{value:!0});Eo.URL=Eo.DNS=Eo.stringToBytes=void 0;var OO=yd(),$7=wo();function PO(n){n=unescape(encodeURIComponent(n));let e=new Uint8Array(n.length);for(let t=0;t<n.length;++t)e[t]=n.charCodeAt(t);return e}a(PO,"stringToBytes");Eo.stringToBytes=PO;Eo.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Eo.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function U7(n,e,t,r,i,s){let o=typeof t=="string"?PO(t):t,l=typeof r=="string"?(0,OO.default)(r):r;if(typeof r=="string"&&(r=(0,OO.default)(r)),r?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+o.length);if(c.set(l),c.set(o,l.length),c=e(c),c[6]=c[6]&15|n,c[8]=c[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]=c[u];return i}return(0,$7.unsafeStringify)(c)}a(U7,"v35");Eo.default=U7});var FO=v(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.URL=Rl.DNS=void 0;var B7=CO(),Cw=wd(),DO=wd();Object.defineProperty(Rl,"DNS",{enumerable:!0,get:a(function(){return DO.DNS},"get")});Object.defineProperty(Rl,"URL",{enumerable:!0,get:a(function(){return DO.URL},"get")});function Ow(n,e,t,r){return(0,Cw.default)(48,B7.default,n,e,t,r)}a(Ow,"v3");Ow.DNS=Cw.DNS;Ow.URL=Cw.URL;Rl.default=Ow});var LO=v(Pw=>{"use strict";Object.defineProperty(Pw,"__esModule",{value:!0});var V7=require("crypto");Pw.default={randomUUID:V7.randomUUID}});var kO=v(Dw=>{"use strict";Object.defineProperty(Dw,"__esModule",{value:!0});var NO=LO(),q7=Mm(),G7=wo();function W7(n,e,t){if(NO.default.randomUUID&&!e&&!n)return NO.default.randomUUID();n=n||{};let r=n.random??n.rng?.()??(0,q7.default)();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[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]=r[i];return e}return(0,G7.unsafeStringify)(r)}a(W7,"v4");Dw.default=W7});var MO=v(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});var H7=require("crypto");function z7(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,H7.createHash)("sha1").update(n).digest()}a(z7,"sha1");Fw.default=z7});var $O=v(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.URL=Cl.DNS=void 0;var K7=MO(),Lw=wd(),jO=wd();Object.defineProperty(Cl,"DNS",{enumerable:!0,get:a(function(){return jO.DNS},"get")});Object.defineProperty(Cl,"URL",{enumerable:!0,get:a(function(){return jO.URL},"get")});function Nw(n,e,t,r){return(0,Lw.default)(80,K7.default,n,e,t,r)}a(Nw,"v5");Nw.DNS=Lw.DNS;Nw.URL=Lw.URL;Cl.default=Nw});var UO=v(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});var Y7=wo(),Q7=Aw(),X7=xw();function J7(n,e,t){n??={},t??=0;let r=(0,Q7.default)({...n,_v6:!0},new Uint8Array(16));if(r=(0,X7.default)(r),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]=r[i];return e}return(0,Y7.unsafeStringify)(r)}a(J7,"v6");kw.default=J7});var BO=v(Mw=>{"use strict";Object.defineProperty(Mw,"__esModule",{value:!0});var Z7=yd(),e8=wo();function t8(n){let e=typeof n=="string"?(0,Z7.default)(n):n,t=r8(e);return typeof n=="string"?(0,e8.unsafeStringify)(t):t}a(t8,"v6ToV1");Mw.default=t8;function r8(n){return Uint8Array.of((n[3]&15)<<4|n[4]>>4&15,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|n[6]&15,n[7],(n[1]&15)<<4|(n[2]&240)>>4,(n[2]&15)<<4|(n[3]&240)>>4,16|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}a(r8,"_v6ToV1")});var WO=v(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});Ed.updateV7State=void 0;var VO=Mm(),n8=wo(),jw={};function i8(n,e,t){let r;if(n)r=qO(n.random??n.rng?.()??(0,VO.default)(),n.msecs,n.seq,e,t);else{let i=Date.now(),s=(0,VO.default)();GO(jw,i,s),r=qO(s,jw.msecs,jw.seq,e,t)}return e??(0,n8.unsafeStringify)(r)}a(i8,"v7");function GO(n,e,t){return n.msecs??=-1/0,n.seq??=0,e>n.msecs?(n.seq=t[6]<<23|t[7]<<16|t[8]<<8|t[9],n.msecs=e):(n.seq=n.seq+1|0,n.seq===0&&n.msecs++),n}a(GO,"updateV7State");Ed.updateV7State=GO;function qO(n,e,t,r,i=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return e??=Date.now(),t??=n[6]*127<<24|n[7]<<16|n[8]<<8|n[9],r[i++]=e/1099511627776&255,r[i++]=e/4294967296&255,r[i++]=e/16777216&255,r[i++]=e/65536&255,r[i++]=e/256&255,r[i++]=e&255,r[i++]=112|t>>>28&15,r[i++]=t>>>20&255,r[i++]=128|t>>>14&63,r[i++]=t>>>6&255,r[i++]=t<<2&255|n[10]&3,r[i++]=n[11],r[i++]=n[12],r[i++]=n[13],r[i++]=n[14],r[i++]=n[15],r}a(qO,"v7Bytes");Ed.default=i8});var HO=v($w=>{"use strict";Object.defineProperty($w,"__esModule",{value:!0});var s8=gd();function o8(n){if(!(0,s8.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}a(o8,"version");$w.default=o8});var Ol=v(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.version=vt.validate=vt.v7=vt.v6ToV1=vt.v6=vt.v5=vt.v4=vt.v3=vt.v1ToV6=vt.v1=vt.stringify=vt.parse=vt.NIL=vt.MAX=void 0;var a8=EO();Object.defineProperty(vt,"MAX",{enumerable:!0,get:a(function(){return a8.default},"get")});var l8=vO();Object.defineProperty(vt,"NIL",{enumerable:!0,get:a(function(){return l8.default},"get")});var c8=yd();Object.defineProperty(vt,"parse",{enumerable:!0,get:a(function(){return c8.default},"get")});var u8=wo();Object.defineProperty(vt,"stringify",{enumerable:!0,get:a(function(){return u8.default},"get")});var f8=Aw();Object.defineProperty(vt,"v1",{enumerable:!0,get:a(function(){return f8.default},"get")});var d8=xw();Object.defineProperty(vt,"v1ToV6",{enumerable:!0,get:a(function(){return d8.default},"get")});var p8=FO();Object.defineProperty(vt,"v3",{enumerable:!0,get:a(function(){return p8.default},"get")});var h8=kO();Object.defineProperty(vt,"v4",{enumerable:!0,get:a(function(){return h8.default},"get")});var m8=$O();Object.defineProperty(vt,"v5",{enumerable:!0,get:a(function(){return m8.default},"get")});var g8=UO();Object.defineProperty(vt,"v6",{enumerable:!0,get:a(function(){return g8.default},"get")});var y8=BO();Object.defineProperty(vt,"v6ToV1",{enumerable:!0,get:a(function(){return y8.default},"get")});var _8=WO();Object.defineProperty(vt,"v7",{enumerable:!0,get:a(function(){return _8.default},"get")});var b8=gd();Object.defineProperty(vt,"validate",{enumerable:!0,get:a(function(){return b8.default},"get")});var S8=HO();Object.defineProperty(vt,"version",{enumerable:!0,get:a(function(){return S8.default},"get")})});var Vw=v(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});jm.Exo003UUIDGenerator=void 0;var Uw=Ol(),zO=Lm(),Bw=class{static{a(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,Uw.v5)(e,zO.UUID_URL_NAMESPACE)}static generateAssetUUID(e,t){if(!t||t.trim().length===0)throw new Error("Local identifier cannot be empty");let r=this.generateNamespaceUUID(e);return(0,Uw.v5)(t,r)}static generateFromIRI(e){if(!e||e.trim().length===0)throw new Error("IRI cannot be empty");let{namespace:t,localName:r}=this.splitIRI(e);return r?this.generateAssetUUID(t,r):(0,Uw.v5)(e,zO.UUID_URL_NAMESPACE)}static generateBlankNodeUUID(e,t){if(!e||e.trim().length===0)throw new Error("Blank node ID cannot be empty");let r="urn:exocortex:blank-node:",i=t?`${t}#${e}`:e;return this.generateAssetUUID(r,i)}static generateStatementUUID(e,t,r){if(!e||!t||!r)throw new Error("Subject, predicate, and object cannot be empty");let i="urn:exocortex:statement:",s=`${e} ${t} ${r}`;return this.generateAssetUUID(i,s)}static generateBodyUUID(e,t){let r="urn:exocortex:body:",i=e;return t?.datatype?i+=`^^${t.datatype}`:t?.language&&(i+=`@${t.language}`,t.direction&&(i+=`--${t.direction}`)),this.generateAssetUUID(r,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 r=e.lastIndexOf("/"),i=e.indexOf("://");return r!==-1&&r>i+2&&r<e.length-1?{namespace:e.substring(0,r+1),localName:e.substring(r+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)}};jm.Exo003UUIDGenerator=Bw});var YO=v(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.Exo003Parser=void 0;var Ot=Lm(),vd=Vw(),wa=ze(),$m=tt(),KO=Yt(),w8=Qn(),qw=class{static{a(this,"Exo003Parser")}static parse(e,t){let r=this.validate(e);if(!r.valid)return{success:!1,errors:r.errors};let i=e.metadata;try{return{success:!0,metadata:this.parseByType(e,i),bodyContent:i===Ot.Exo003MetadataType.Body?t:void 0}}catch(s){return{success:!1,errors:[s instanceof Error?s.message:String(s)]}}}static validate(e){let t=[],r=[];if(!e.metadata)return t.push("Missing required property: metadata"),{valid:!1,errors:t,warnings:r};let i=e.metadata;if(!Object.values(Ot.Exo003MetadataType).includes(i))return t.push(`Invalid metadata: ${i}. Valid types: ${Object.values(Ot.Exo003MetadataType).join(", ")}`),{valid:!1,errors:t,warnings:r};let s=i,o=Ot.ALLOWED_PROPERTIES[s],l=Ot.REQUIRED_PROPERTIES[s];for(let c of l)(e[c]===void 0||e[c]===null)&&t.push(`Missing required property: ${c}`);for(let c of Object.keys(e))o.includes(c)||t.push(`Forbidden property for ${s}: ${c}`);switch(s){case Ot.Exo003MetadataType.Namespace:this.validateNamespaceMetadata(e,t);break;case Ot.Exo003MetadataType.Anchor:this.validateAnchorMetadata(e,t);break;case Ot.Exo003MetadataType.BlankNode:this.validateBlankNodeMetadata(e,t);break;case Ot.Exo003MetadataType.Statement:this.validateStatementMetadata(e,t);break;case Ot.Exo003MetadataType.Body:this.validateBodyMetadata(e,t,r);break}return{valid:t.length===0,errors:t,warnings:r}}static parseByType(e,t){let r={metadata:t,aliases:e.aliases};switch(t){case Ot.Exo003MetadataType.Namespace:return{...r,metadata:Ot.Exo003MetadataType.Namespace,uri:e.uri};case Ot.Exo003MetadataType.Anchor:return{...r,metadata:Ot.Exo003MetadataType.Anchor,uri:e.uri};case Ot.Exo003MetadataType.BlankNode:return{...r,metadata:Ot.Exo003MetadataType.BlankNode,uri:e.uri};case Ot.Exo003MetadataType.Statement:return{...r,metadata:Ot.Exo003MetadataType.Statement,subject:e.subject,predicate:e.predicate,object:e.object};case Ot.Exo003MetadataType.Body:return{...r,metadata:Ot.Exo003MetadataType.Body,subject:e.subject,predicate:e.predicate}}}static validateNamespaceMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new wa.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateAnchorMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new wa.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateBlankNodeMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r){let i=r;if(!i.startsWith("_:"))try{new wa.IRI(i)}catch{t.push(`uri is not a valid IRI or blank node identifier: ${String(r)}`)}}}static validateStatementMetadata(e,t){let r=e.subject,i=e.predicate,s=e.object,o=[["subject",r],["predicate",i],["object",s]];for(let[l,c]of o)c&&typeof c!="string"&&t.push(`${l} must be a string`)}static validateBodyMetadata(e,t,r){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,r){let i=t(e.subject),s;if(i.type==="iri")s=new wa.IRI(i.value);else if(i.type==="blank")s=new KO.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 l=new wa.IRI(o.value),c=t(e.object),u;if(c.type==="iri")u=new wa.IRI(c.value);else if(c.type==="blank")u=new KO.BlankNode(c.value);else{let f=r||c.value;if(c.datatype)u=new $m.Literal(f,new wa.IRI(c.datatype));else{let d=c.language||Ot.DEFAULT_LANGUAGE_TAG;u=(0,$m.createDirectionalLiteral)(f,d,c.direction)}}return new w8.Triple(s,l,u)}static toLiteral(e,t,r){if(r?.datatype)return new $m.Literal(t,new wa.IRI(r.datatype));let i=r?.language||Ot.DEFAULT_LANGUAGE_TAG;return(0,$m.createDirectionalLiteral)(t,i,r?.direction)}static isExo003Format(e){let t=e.metadata;return typeof t=="string"&&Object.values(Ot.Exo003MetadataType).includes(t)}static generateUUID(e,t){switch(e.metadata){case Ot.Exo003MetadataType.Namespace:return vd.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ot.Exo003MetadataType.Anchor:return vd.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ot.Exo003MetadataType.BlankNode:return vd.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ot.Exo003MetadataType.Statement:{let r=e;return vd.Exo003UUIDGenerator.generateStatementUUID(r.subject,r.predicate,r.object)}case Ot.Exo003MetadataType.Body:{let r=e;return vd.Exo003UUIDGenerator.generateBodyUUID(r.subject+"|"+r.predicate)}}}};Um.Exo003Parser=qw});var Gw=v(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.Exo003Parser=mn.Exo003UUIDGenerator=mn.UUID_URL_NAMESPACE=mn.DEFAULT_LANGUAGE_TAG=mn.REQUIRED_PROPERTIES=mn.ALLOWED_PROPERTIES=mn.Exo003MetadataType=void 0;var Td=Lm();Object.defineProperty(mn,"Exo003MetadataType",{enumerable:!0,get:a(function(){return Td.Exo003MetadataType},"get")});Object.defineProperty(mn,"ALLOWED_PROPERTIES",{enumerable:!0,get:a(function(){return Td.ALLOWED_PROPERTIES},"get")});Object.defineProperty(mn,"REQUIRED_PROPERTIES",{enumerable:!0,get:a(function(){return Td.REQUIRED_PROPERTIES},"get")});Object.defineProperty(mn,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:a(function(){return Td.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(mn,"UUID_URL_NAMESPACE",{enumerable:!0,get:a(function(){return Td.UUID_URL_NAMESPACE},"get")});var E8=Vw();Object.defineProperty(mn,"Exo003UUIDGenerator",{enumerable:!0,get:a(function(){return E8.Exo003UUIDGenerator},"get")});var v8=YO();Object.defineProperty(mn,"Exo003Parser",{enumerable:!0,get:a(function(){return v8.Exo003Parser},"get")})});var Fs=v(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});Bm.WikiLinkHelpers=void 0;var Ad=class{static{a(this,"WikiLinkHelpers")}static normalize(e){if(!e)return"";let t=e.replace(this.WIKI_LINK_PATTERN,"").trim();if(!t)return"";let r=t.indexOf("|");if(r===-1)return t;let i=t.substring(0,r).trim(),s=t.substring(r+1).trim();return this.UUID_PATTERN.test(i)&&s||i}static normalizeArray(e){return e?(Array.isArray(e)?e:[e]).map(r=>this.normalize(r)).filter(r=>r.length>0):[]}static equals(e,t){return this.normalize(e)===this.normalize(t)}static includes(e,t){let r=this.normalizeArray(e),i=this.normalize(t);return r.includes(i)}static resolveSymbolic(e,t){let r=this.normalize(e);if(!r)return"";if(this.UUID_PATTERN.test(r)){let i=t(r);return i&&i.length>0?i:r}return r}static resolveSymbolicArray(e,t){return e?(Array.isArray(e)?e:[e]).map(i=>this.resolveSymbolic(i,t)).filter(i=>i.length>0):[]}};Bm.WikiLinkHelpers=Ad;Ad.WIKI_LINK_PATTERN=/\[\[|\]\]/g;Ad.UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});var xd=v(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.CommandBindingProperty=Pt.GroundingProperty=Pt.PreconditionProperty=Pt.CommandProperty=Pt.resolveGroundingTypeFromWikilinkLiteral=Pt.resolveGroundingTypeFromIRI=Pt.GROUNDING_TYPE_IRI_TO_ENUM=Pt.GROUNDING_TYPE_UID_TO_ENUM=Pt.GROUNDING_TYPE_UIDS=Pt.GroundingType=Pt.EFFORT_STATUS_OPTIONS=Pt.EffortStatus=Pt.AssetClass=void 0;var T8=Al();Object.defineProperty(Pt,"AssetClass",{enumerable:!0,get:a(function(){return T8.AssetClass},"get")});var A8=Il();Object.defineProperty(Pt,"EffortStatus",{enumerable:!0,get:a(function(){return A8.EffortStatus},"get")});var I8=iw();Object.defineProperty(Pt,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return I8.EFFORT_STATUS_OPTIONS},"get")});var x8=Sa();Object.defineProperty(Pt,"GroundingType",{enumerable:!0,get:a(function(){return x8.GroundingType},"get")});var Id=pd();Object.defineProperty(Pt,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(Pt,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(Pt,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return Id.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(Pt,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return Id.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(Pt,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return Id.resolveGroundingTypeFromWikilinkLiteral},"get")});var Vm=sw();Object.defineProperty(Pt,"CommandProperty",{enumerable:!0,get:a(function(){return Vm.CommandProperty},"get")});Object.defineProperty(Pt,"PreconditionProperty",{enumerable:!0,get:a(function(){return Vm.PreconditionProperty},"get")});Object.defineProperty(Pt,"GroundingProperty",{enumerable:!0,get:a(function(){return Vm.GroundingProperty},"get")});Object.defineProperty(Pt,"CommandBindingProperty",{enumerable:!0,get:a(function(){return Vm.CommandBindingProperty},"get")})});var ZO=v(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.hasClass=Dl;gn.isAreaOrProject=R8;gn.isEffort=C8;gn.hasStatus=O8;gn.isAssetArchived=P8;gn.hasEmptyProperties=D8;gn.needsFolderRepair=F8;gn.getTodayDateString=Ww;gn.isPlannedForToday=L8;gn.hasPlannedStartTimestamp=N8;gn.extractDailyNoteDate=k8;gn.isCurrentDateGteDay=M8;gn.inheritsFromPrototype=JO;gn.isPrototypeClass=$8;var XO=Fs(),Pl=xd();function Dl(n,e){return n?(Array.isArray(n)?n:[n]).some(r=>XO.WikiLinkHelpers.normalize(r)===e):!1}a(Dl,"hasClass");function R8(n){return Dl(n,Pl.AssetClass.AREA)||Dl(n,Pl.AssetClass.PROJECT)}a(R8,"isAreaOrProject");function C8(n){return Dl(n,Pl.AssetClass.TASK)||Dl(n,Pl.AssetClass.PROJECT)||Dl(n,Pl.AssetClass.MEETING)}a(C8,"isEffort");function O8(n,e){if(!n)return!1;let t=Array.isArray(n)?n[0]:n;return t?XO.WikiLinkHelpers.normalize(t)===e:!1}a(O8,"hasStatus");function P8(n){if(n===!0||n===1)return!0;if(typeof n=="string"){let e=n.toLowerCase();return e==="true"||e==="yes"}return!1}a(P8,"isAssetArchived");function D8(n){if(!n||Object.keys(n).length===0)return!1;let e=a(t=>t==null||t==="","isEmptyArrayItem");return Object.values(n).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(D8,"hasEmptyProperties");function F8(n,e){if(!e)return!1;let t=n.replace(/\/$/,""),r=e.replace(/\/$/,"");return t!==r}a(F8,"needsFolderRepair");function Ww(){let n=new Date,e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${r}`}a(Ww,"getTodayDateString");function L8(n){let e=n.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=Ww();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}a(L8,"isPlannedForToday");function N8(n){let e=n.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(N8,"hasPlannedStartTimestamp");function k8(n){let e=n.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]),r=t.match(/\[\[([^\[\]]+)\]\]/);return r?r[1]:t}return null}a(k8,"extractDailyNoteDate");function M8(n){return Ww()>=n}a(M8,"isCurrentDateGteDay");function QO(n){return n?n.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}a(QO,"normalizeWithQuotes");var j8=10;function JO(n,e=j8){let t=n.exo__Class_superClass;if(!t)return!1;let r=new Set,i=[],s=Array.isArray(t)?t:[t];for(let o of s){let l=QO(o);l&&i.push({className:l,depth:0})}for(;i.length>0;){let o=i.shift();if(!o)continue;let{className:l,depth:c}=o;if(c>e)continue;if(l===Pl.AssetClass.PROTOTYPE)return!0;if(r.has(l))continue;r.add(l);let u=`${l}__exo__Class_superClass`,f=n[u];if(f){let d=Array.isArray(f)?f:[f];for(let p of d){let h=QO(p);h&&!r.has(h)&&i.push({className:h,depth:c+1})}}}return!1}a(JO,"inheritsFromPrototype");function $8(n,e){return Dl(n,Pl.AssetClass.CLASS)?JO(e):!1}a($8,"isPrototypeClass")});var eP=v(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.isPrototypeClass=Tt.inheritsFromPrototype=Tt.isCurrentDateGteDay=Tt.extractDailyNoteDate=Tt.hasPlannedStartTimestamp=Tt.isPlannedForToday=Tt.getTodayDateString=Tt.needsFolderRepair=Tt.hasEmptyProperties=Tt.isAssetArchived=Tt.hasStatus=Tt.isEffort=Tt.isAreaOrProject=Tt.hasClass=void 0;var Xn=ZO();Object.defineProperty(Tt,"hasClass",{enumerable:!0,get:a(function(){return Xn.hasClass},"get")});Object.defineProperty(Tt,"isAreaOrProject",{enumerable:!0,get:a(function(){return Xn.isAreaOrProject},"get")});Object.defineProperty(Tt,"isEffort",{enumerable:!0,get:a(function(){return Xn.isEffort},"get")});Object.defineProperty(Tt,"hasStatus",{enumerable:!0,get:a(function(){return Xn.hasStatus},"get")});Object.defineProperty(Tt,"isAssetArchived",{enumerable:!0,get:a(function(){return Xn.isAssetArchived},"get")});Object.defineProperty(Tt,"hasEmptyProperties",{enumerable:!0,get:a(function(){return Xn.hasEmptyProperties},"get")});Object.defineProperty(Tt,"needsFolderRepair",{enumerable:!0,get:a(function(){return Xn.needsFolderRepair},"get")});Object.defineProperty(Tt,"getTodayDateString",{enumerable:!0,get:a(function(){return Xn.getTodayDateString},"get")});Object.defineProperty(Tt,"isPlannedForToday",{enumerable:!0,get:a(function(){return Xn.isPlannedForToday},"get")});Object.defineProperty(Tt,"hasPlannedStartTimestamp",{enumerable:!0,get:a(function(){return Xn.hasPlannedStartTimestamp},"get")});Object.defineProperty(Tt,"extractDailyNoteDate",{enumerable:!0,get:a(function(){return Xn.extractDailyNoteDate},"get")});Object.defineProperty(Tt,"isCurrentDateGteDay",{enumerable:!0,get:a(function(){return Xn.isCurrentDateGteDay},"get")});Object.defineProperty(Tt,"inheritsFromPrototype",{enumerable:!0,get:a(function(){return Xn.inheritsFromPrototype},"get")});Object.defineProperty(Tt,"isPrototypeClass",{enumerable:!0,get:a(function(){return Xn.isPrototypeClass},"get")})});var tP=v(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.TsFloorViolationError=At.CATALOG_KEEP_NAMESPACES=At.PLUGIN_UI_FLOOR=At.SDK_FLOOR=At.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=At.SDK_FLOOR_ASSETSPACE_UIDS=At.TS_FLOOR_AS_UID_SHARED_IDENTITIES=At.TS_FLOOR_AS_UID_EXOCMD=At.TS_FLOOR_AS_UID_EXO=void 0;At.assertTsFloor=U8;At.assertTsFloorReconciled=B8;At.isTsFloorAssetSpace=V8;At.isTsFloorMountPath=q8;At.TS_FLOOR_AS_UID_EXO="49fd2e56-4656-4ca7-a789-f472b16ea260";At.TS_FLOOR_AS_UID_EXOCMD="c9c65b0f-1e01-47c1-a1f9-1bf70b11df6a";At.TS_FLOOR_AS_UID_SHARED_IDENTITIES="0cde1557-6320-4bd0-a7c4-8b72afc38720";At.SDK_FLOOR_ASSETSPACE_UIDS=new Set([At.TS_FLOOR_AS_UID_EXO]);At.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=new Set([At.TS_FLOOR_AS_UID_EXO]);At.SDK_FLOOR=[{uid:At.TS_FLOOR_AS_UID_EXO,namespace:"exo"}];At.PLUGIN_UI_FLOOR=At.SDK_FLOOR;At.CATALOG_KEEP_NAMESPACES=new Set(["registry","profiles"]);var Rd=class extends Error{static{a(this,"TsFloorViolationError")}constructor(e){super(e),this.name="TsFloorViolationError"}};At.TsFloorViolationError=Rd;function U8(n,e){let t=[];for(let r of e)n.has(r)||t.push(r);if(t.length>0)throw new Rd(`Target profile's declared set excludes TS-floor AssetSpace UID(s): ${t.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(U8,"assertTsFloor");function B8(n,e,t){let r=[];for(let i of t)n.has(i.uid)||e.has(i.namespace)||r.push(`${i.namespace} (${i.uid})`);if(r.length>0)throw new Rd(`Target profile's declared set excludes TS-floor AssetSpace(s): ${r.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(B8,"assertTsFloorReconciled");function V8(n,e,t=At.SDK_FLOOR){return t.some(r=>n.length>0&&r.uid===n||e.length>0&&r.namespace===e)}a(V8,"isTsFloorAssetSpace");function q8(n,e=At.SDK_FLOOR){let t=n.replace(/\/+$/,""),r=t.slice(t.lastIndexOf("/")+1),i=r.startsWith("exoas-")?r.slice(6):r;return i.length===0?!1:e.some(s=>s.namespace===i)}a(q8,"isTsFloorMountPath")});var rP=v(Hw=>{"use strict";Object.defineProperty(Hw,"__esModule",{value:!0});Hw.transitiveDependsOnClosure=G8;function G8(n,e){let t=new Set,r=[];for(let i of n)t.has(i)||(t.add(i),r.push(i));for(;r.length>0;){let i=r.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),r.push(o))}return t}a(G8,"transitiveDependsOnClosure")});var zw=v(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.PARKED_ROOT=Jn.DEPENDENCY_KIND_REFERENCE_UID=Jn.DEPENDENCY_KIND_TBOX_UID=void 0;Jn.resolveDependencyKind=iP;Jn.parkedPathFor=H8;Jn.classifyMountTransition=z8;Jn.DEPENDENCY_KIND_TBOX_UID="e1d7fb5c-d334-448d-935b-953b7b033e78";Jn.DEPENDENCY_KIND_REFERENCE_UID="fe529085-5370-4ac0-bbe4-1c7351242dee";var W8="dependencykindreference";function iP(n){let e=Array.isArray(n)?n[0]:n;if(typeof e!="string")return"tbox";let t=e.toLowerCase();return t.includes(Jn.DEPENDENCY_KIND_TBOX_UID)?"tbox":t.includes(Jn.DEPENDENCY_KIND_REFERENCE_UID)||t.includes(W8)?"reference":"tbox"}a(iP,"resolveDependencyKind");Jn.PARKED_ROOT=".exocortex/parked";var nP="assetspaces/";function H8(n){let e=n.split("/");if(n.length===0||!n.startsWith(nP)||e.some(t=>t.length===0||t==="."||t===".."))throw new Error(`parkedPathFor: refusing unsafe mount folder "${n}"`);return`${Jn.PARKED_ROOT}/${n.slice(nP.length)}`}a(H8,"parkedPathFor");function z8(n){let{state:e,inEffectiveSet:t,dependsOnKind:r,canPark:i=!0}=n;switch(e){case"active":return t?"none":i&&iP(r)==="reference"?"park":"destroy";case"parked":return t?"unpark":"none";case"absent":return t?"materialize":"none"}}a(z8,"classifyMountTransition")});var aP=v(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.ParkedAssetIndex=void 0;var sP=zw();function K8(n){let t=n.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim().split("#")[0].trim();return(t.split("/").pop()??t).replace(/\.md$/i,"")}a(K8,"normalizeLinkTarget");function oP(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);return e===null?null:e[1]}a(oP,"frontmatterOf");function Y8(n){let e=oP(n);if(e===null)return!1;let t=e.match(/^exo__Asset_uid:[ \t]*(.+)$/m);return t!==null&&t[1].trim().length>0}a(Y8,"hasAssetUid");function Q8(n){let e=oP(n);if(e===null)return null;let t=e.match(/^exo__Asset_label:[ \t]*(.+)$/m);if(t===null)return null;let r=t[1].trim();return r.length<1?null:r.length>=2&&r.startsWith('"')&&r.endsWith('"')?Kw(r.slice(1,-1).replace(/\\(["\\ntr])/g,(i,s)=>s==="n"?`
32
32
  `:s==="t"?" ":s==="r"?"\r":s)):r.length>=2&&r.startsWith("'")&&r.endsWith("'")?Kw(r.slice(1,-1).replace(/''/g,"'")):Kw(r)}a(Q8,"extractLabel");function Kw(n){return n.length===0?null:n}a(Kw,"orNull");var Yw=class{static{a(this,"ParkedAssetIndex")}constructor(e){this.index=null,this.building=null,this.generation=0,this.reader=e}invalidate(){this.index=null,this.building=null,this.generation+=1}async lookup(e){let t=K8(e);if(t.length===0)return null;let i=(await this.ensureIndex()).get(t);if(i===void 0)return null;let s=X8(i);if(s===null)return null;let o;try{o=await this.reader.read(i)}catch{return null}return Y8(o)?{path:i,assetSpace:s,label:Q8(o)}:null}async ensureIndex(){if(this.index!==null)return this.index;let e=this.generation;this.building===null&&(this.building=this.buildIndex());let t=this.building,r=await t;return e!==this.generation?(this.building===t&&(this.building=null),this.ensureIndex()):(this.index=r,this.building===t&&(this.building=null),r)}async buildIndex(){let e=new Map;return await this.walk(sP.PARKED_ROOT,e),e}async walk(e,t){let r;try{if(!await this.reader.exists(e))return;r=await this.reader.list(e)}catch{return}for(let i of r.files){if(!i.toLowerCase().endsWith(".md"))continue;let s=(i.split("/").pop()??i).replace(/\.md$/i,"");s.length===0||t.has(s)||t.set(s,i)}for(let i of r.folders)(i.split("/").pop()??i).startsWith(".")||await this.walk(i,t)}};qm.ParkedAssetIndex=Yw;function X8(n){let e=`${sP.PARKED_ROOT}/`;if(!n.startsWith(e))return null;let t=n.slice(e.length).split("/");if(t.length<3)return null;let[r,i]=t;return r.length===0||i.length===0?null:`${r}/${i}`}a(X8,"assetSpaceOf")});var Gm=v(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});Cd.PropertyFieldType=void 0;Cd.rangeToFieldType=eV;var rn;(function(n){n.Text="text",n.Number="number",n.Date="date",n.DateTime="datetime",n.Boolean="boolean",n.Reference="reference",n.Enum="enum",n.StatusSelect="status-select",n.SizeSelect="size-select",n.Wikilink="wikilink",n.Timestamp="timestamp",n.Unknown="unknown"})(rn||(Cd.PropertyFieldType=rn={}));var lP="http://www.w3.org/2001/XMLSchema#",J8="https://exocortex.my/ontology/exo#",Z8="https://exocortex.my/ontology/ems#";function eV(n){if(!n)return rn.Unknown;let e=n.trim();if(!e)return rn.Unknown;if(e.startsWith(lP)){let t=e.substring(lP.length);return Qw(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return Qw(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),r=e.substring(t+10);return Qw(r)}return e.startsWith(Z8)||e.startsWith("ems:")?tV(e):e.startsWith(J8)||e.startsWith("exo:")||rV(e)?rn.Reference:rn.Text}a(eV,"rangeToFieldType");function Qw(n){switch(n.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return rn.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 rn.Number;case"date":return rn.Date;case"datetime":case"datetimestamp":return rn.DateTime;case"boolean":return rn.Boolean;case"time":return rn.Timestamp;default:return rn.Text}}a(Qw,"xsdTypeToFieldType");function tV(n){let e=n.toLowerCase();return e.includes("effortstatus")?rn.StatusSelect:e.includes("tasksize")?rn.SizeSelect:rn.Reference}a(tV,"emsTypeToFieldType");function rV(n){let e=n.toLowerCase();return e.includes("exocortex.my/ontology")?!0:["asset","task","project","area","effort","class","property","concept"].some(r=>e.includes(r))}a(rV,"isClassReference")});var Xw=v(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.propertyNameToUri=nV;Od.uriToPropertyName=cP;Od.extractPropertyLabel=iV;function nV(n){return n.replace(/^([a-z]+)__/,"$1:")}a(nV,"propertyNameToUri");function cP(n){if(n.startsWith("http://")||n.startsWith("https://")){let e=n.match(/\/([a-z]+)#([A-Za-z0-9_]+)$/);if(e)return`${e[1]}__${e[2]}`;let t=n.lastIndexOf("#"),r=n.lastIndexOf("/"),i=Math.max(t,r);return i>=0?n.substring(i+1):n}return n.replace(/^([a-z]+):/,"$1__")}a(cP,"uriToPropertyName");function iV(n){let r=(n.includes(":")?cP(n):n).replace(/^[a-z]+__/,"").split("_");return(r.length>1?r.slice(1).join(" "):r[0]).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,s=>s.toUpperCase())}a(iV,"extractPropertyLabel")});var Wm={};pm(Wm,{__assign:()=>Zw,__asyncDelegator:()=>yV,__asyncGenerator:()=>gV,__asyncValues:()=>_V,__await:()=>Pd,__awaiter:()=>uV,__classPrivateFieldGet:()=>EV,__classPrivateFieldSet:()=>vV,__createBinding:()=>dV,__decorate:()=>aV,__exportStar:()=>pV,__extends:()=>sV,__generator:()=>fV,__importDefault:()=>wV,__importStar:()=>SV,__makeTemplateObject:()=>bV,__metadata:()=>cV,__param:()=>lV,__read:()=>uP,__rest:()=>oV,__spread:()=>hV,__spreadArrays:()=>mV,__values:()=>e1});function sV(n,e){Jw(n,e);function t(){this.constructor=n}a(t,"__"),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function oV(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function aV(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(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 lV(n,e){return function(t,r){e(t,r,n)}}function cV(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function uV(n,e,t,r){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 l(f){try{u(r.next(f))}catch(d){o(d)}}a(l,"fulfilled");function c(f){try{u(r.throw(f))}catch(d){o(d)}}a(c,"rejected");function u(f){f.done?s(f.value):i(f.value).then(l,c)}a(u,"step"),u((r=r.apply(n,e||[])).next())})}function fV(n,e){var t={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,i,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(u){return function(f){return c([u,f])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=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(n,t)}catch(f){u=[6,f],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function dV(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function pV(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function e1(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:a(function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function uP(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function hV(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(uP(arguments[e]));return n}function mV(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,l=s.length;o<l;o++,i++)r[i]=s[o];return r}function Pd(n){return this instanceof Pd?(this.v=n,this):new Pd(n)}function gV(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){r[p]&&(i[p]=function(h){return new Promise(function(_,y){s.push([p,h,_,y])>1||l(p,h)})})}function l(p,h){try{c(r[p](h))}catch(_){d(s[0][3],_)}}function c(p){p.value instanceof Pd?Promise.resolve(p.value.v).then(u,f):d(s[0][2],p)}function u(p){l("next",p)}function f(p){l("throw",p)}function d(p,h){p(h),s.shift(),s.length&&l(s[0][0],s[0][1])}}function yV(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(o){return(t=!t)?{value:Pd(n[i](o)),done:i==="return"}:s?s(o):o}:s}}function _V(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof e1=="function"?e1(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(l,c){o=n[s](o),i(l,c,o.done,o.value)})}}function i(s,o,l,c){Promise.resolve(c).then(function(u){s({value:u,done:l})},o)}}function bV(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function SV(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}function wV(n){return n&&n.__esModule?n:{default:n}}function EV(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function vV(n,e,t){if(!e.has(n))throw new TypeError("attempted to set private field on non-instance");return e.set(n,t),t}var Jw,Zw,Hm=et(()=>{Jw=a(function(n,e){return Jw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},Jw(n,e)},"extendStatics");a(sV,"__extends");Zw=a(function(){return Zw=Object.assign||a(function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),Zw.apply(this,arguments)},"__assign");a(oV,"__rest");a(aV,"__decorate");a(lV,"__param");a(cV,"__metadata");a(uV,"__awaiter");a(fV,"__generator");a(dV,"__createBinding");a(pV,"__exportStar");a(e1,"__values");a(uP,"__read");a(hV,"__spread");a(mV,"__spreadArrays");a(Pd,"__await");a(gV,"__asyncGenerator");a(yV,"__asyncDelegator");a(_V,"__asyncValues");a(bV,"__makeTemplateObject");a(SV,"__importStar");a(wV,"__importDefault");a(EV,"__classPrivateFieldGet");a(vV,"__classPrivateFieldSet")});var n1=v(r1=>{"use strict";Object.defineProperty(r1,"__esModule",{value:!0});var t1;(function(n){n[n.Transient=0]="Transient",n[n.Singleton=1]="Singleton",n[n.ResolutionScoped=2]="ResolutionScoped",n[n.ContainerScoped=3]="ContainerScoped"})(t1||(t1={}));r1.default=t1});var fP=v(i1=>{"use strict";Object.defineProperty(i1,"__esModule",{value:!0});var TV=n1();Object.defineProperty(i1,"Lifecycle",{enumerable:!0,get:a(function(){return TV.default},"get")})});var Fl=v(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.defineInjectionTokenMetadata=qi.getParamInfo=qi.INJECTION_TOKEN_METADATA_KEY=void 0;qi.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function AV(n){let e=Reflect.getMetadata("design:paramtypes",n)||[],t=Reflect.getOwnMetadata(qi.INJECTION_TOKEN_METADATA_KEY,n)||{};return Object.keys(t).forEach(r=>{e[+r]=t[r]}),e}a(AV,"getParamInfo");qi.getParamInfo=AV;function IV(n,e){return function(t,r,i){let s=Reflect.getOwnMetadata(qi.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:n,transform:e.transformToken,transformArgs:e.args||[]}:n,Reflect.defineMetadata(qi.INJECTION_TOKEN_METADATA_KEY,s,t)}}a(IV,"defineInjectionTokenMetadata");qi.defineInjectionTokenMetadata=IV});var s1=v(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.isClassProvider=void 0;function xV(n){return!!n.useClass}a(xV,"isClassProvider");zm.isClassProvider=xV});var o1=v(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.isFactoryProvider=void 0;function RV(n){return!!n.useFactory}a(RV,"isFactoryProvider");Km.isFactoryProvider=RV});var Qm=v(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.delay=Uc.DelayedConstructor=void 0;var Ym=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={},r=!1,i,s=a(()=>(r||(i=e(this.wrap()),r=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},r=a(i=>{t[i]=(...s)=>{s[0]=e();let o=Reflect[i];return o(...s)}},"install");return this.reflectMethods.forEach(r),t}};Uc.DelayedConstructor=Ym;function CV(n){if(typeof n>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new Ym(n)}a(CV,"delay");Uc.delay=CV});var Xm=v(Ls=>{"use strict";Object.defineProperty(Ls,"__esModule",{value:!0});Ls.isConstructorToken=Ls.isTransformDescriptor=Ls.isTokenDescriptor=Ls.isNormalToken=void 0;var OV=Qm();function PV(n){return typeof n=="string"||typeof n=="symbol"}a(PV,"isNormalToken");Ls.isNormalToken=PV;function DV(n){return typeof n=="object"&&"token"in n&&"multiple"in n}a(DV,"isTokenDescriptor");Ls.isTokenDescriptor=DV;function FV(n){return typeof n=="object"&&"token"in n&&"transform"in n}a(FV,"isTransformDescriptor");Ls.isTransformDescriptor=FV;function LV(n){return typeof n=="function"||n instanceof OV.DelayedConstructor}a(LV,"isConstructorToken");Ls.isConstructorToken=LV});var a1=v(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.isTokenProvider=void 0;function NV(n){return!!n.useToken}a(NV,"isTokenProvider");Jm.isTokenProvider=NV});var l1=v(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.isValueProvider=void 0;function kV(n){return n.useValue!=null}a(kV,"isValueProvider");Zm.isValueProvider=kV});var c1=v(Ll=>{"use strict";Object.defineProperty(Ll,"__esModule",{value:!0});var MV=s1();Object.defineProperty(Ll,"isClassProvider",{enumerable:!0,get:a(function(){return MV.isClassProvider},"get")});var jV=o1();Object.defineProperty(Ll,"isFactoryProvider",{enumerable:!0,get:a(function(){return jV.isFactoryProvider},"get")});var $V=Xm();Object.defineProperty(Ll,"isNormalToken",{enumerable:!0,get:a(function(){return $V.isNormalToken},"get")});var UV=a1();Object.defineProperty(Ll,"isTokenProvider",{enumerable:!0,get:a(function(){return UV.isTokenProvider},"get")});var BV=l1();Object.defineProperty(Ll,"isValueProvider",{enumerable:!0,get:a(function(){return BV.isValueProvider},"get")})});var dP=v(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.isProvider=void 0;var VV=s1(),qV=l1(),GV=a1(),WV=o1();function HV(n){return VV.isClassProvider(n)||qV.isValueProvider(n)||GV.isTokenProvider(n)||WV.isFactoryProvider(n)}a(HV,"isProvider");eg.isProvider=HV});var d1=v(f1=>{"use strict";Object.defineProperty(f1,"__esModule",{value:!0});var u1=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,[])}};f1.default=u1});var pP=v(h1=>{"use strict";Object.defineProperty(h1,"__esModule",{value:!0});var zV=d1(),p1=class extends zV.default{static{a(this,"Registry")}};h1.default=p1});var hP=v(g1=>{"use strict";Object.defineProperty(g1,"__esModule",{value:!0});var m1=class{static{a(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};g1.default=m1});var y1=v(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.formatErrorCtor=void 0;function KV(n,e){return n===null?`at position #${e}`:`"${n.split(",")[e].trim()}" at position #${e}`}a(KV,"formatDependency");function YV(n,e,t=" "){return[n,...e.message.split(`
33
33
  `).map(r=>t+r)].join(`
34
- `)}a(YV,"composeErrorMessage");function QV(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=KV(r,e);return YV(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}a(QV,"formatErrorCtor");tg.formatErrorCtor=QV});var mP=v(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.isDisposable=void 0;function XV(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}a(XV,"isDisposable");rg.isDisposable=XV});var yP=v(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.PostResolutionInterceptors=Nl.PreResolutionInterceptors=void 0;var gP=d1(),ng=class extends gP.default{static{a(this,"PreResolutionInterceptors")}};Nl.PreResolutionInterceptors=ng;var ig=class extends gP.default{static{a(this,"PostResolutionInterceptors")}};Nl.PostResolutionInterceptors=ig;var _1=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new ng,this.postResolution=new ig}};Nl.default=_1});var Ea=v(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.instance=vo.typeInfo=void 0;var JV=(Hm(),hm(Wm)),Dn=c1(),ZV=dP(),sg=Xm(),eq=pP(),Zn=n1(),og=hP(),tq=y1(),rq=Qm(),nq=mP(),iq=yP();vo.typeInfo=new Map;var b1=class n{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new eq.default,this.interceptors=new iq.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:Zn.default.Transient}){this.ensureNotDisposed();let i;if(ZV.isProvider(t)?i=t:i={useClass:t},Dn.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let l=o.useToken;if(s.includes(l))throw new Error(`Token registration cycle detected! ${[...s,l].join(" -> ")}`);s.push(l);let c=this._registry.get(l);c&&Dn.isTokenProvider(c.provider)?o=c.provider:o=null}}if((r.lifecycle===Zn.default.Singleton||r.lifecycle==Zn.default.ContainerScoped||r.lifecycle==Zn.default.ResolutionScoped)&&(Dn.isValueProvider(i)||Dn.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Zn.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),Dn.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(),Dn.isNormalToken(e)){if(Dn.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Zn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Zn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!Dn.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Zn.default.Singleton})}resolve(e,t=new og.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&Dn.isNormalToken(e)){if(r)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(sg.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 r=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&r.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,r)}}executePostResolutionInterceptor(e,t,r){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,r);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Zn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===Zn.default.Singleton,i=e.options.lifecycle===Zn.default.ContainerScoped,s=r||i,o;return Dn.isValueProvider(e.provider)?o=e.provider.useValue:Dn.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Dn.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Dn.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Zn.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new og.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&Dn.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(l=>this.resolveRegistration(l,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(r=>!Dn.isValueProvider(r.provider)).map(r=>(r.instance=void 0,r)))}createChildContainer(){this.ensureNotDisposed();let e=new n(this);for(let[t,r]of this._registry.entries())r.some(({options:i})=>i.lifecycle===Zn.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===Zn.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,r={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:r})}afterResolution(e,t,r={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:r})}dispose(){return JV.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let r=t.dispose();r&&e.push(r)}),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 rq.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=vo.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 nq.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return sg.isTokenDescriptor(r)?sg.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new og.default,r.isOptional),...r.transformArgs):this.resolve(r.transform).transform(this.resolve(r.token,e,r.isOptional),...r.transformArgs):r.multiple?this.resolveAll(r.token,new og.default,r.isOptional):this.resolve(r.token,e,r.isOptional):sg.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(tq.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};vo.instance=new b1;vo.default=vo.instance});var _P=v(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0});var sq=Fl(),To=Ea(),S1=Xm(),oq=y1();function aq(){return function(n){let e=sq.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return S1.isTokenDescriptor(r)?S1.isTransformDescriptor(r)?r.multiple?To.instance.resolve(r.transform).transform(To.instance.resolveAll(r.token),...r.transformArgs):To.instance.resolve(r.transform).transform(To.instance.resolve(r.token),...r.transformArgs):r.multiple?To.instance.resolveAll(r.token):To.instance.resolve(r.token):S1.isTransformDescriptor(r)?To.instance.resolve(r.transform).transform(To.instance.resolve(r.token),...r.transformArgs):To.instance.resolve(r)}catch(s){let o=i+t.length;throw new Error(oq.formatErrorCtor(n,o,s))}})))}}}}a(aq,"autoInjectable");w1.default=aq});var bP=v(E1=>{"use strict";Object.defineProperty(E1,"__esModule",{value:!0});var lq=Fl();function cq(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return lq.defineInjectionTokenMetadata(t)}a(cq,"inject");E1.default=cq});var ag=v(v1=>{"use strict";Object.defineProperty(v1,"__esModule",{value:!0});var uq=Fl(),fq=Ea(),SP=Ea();function dq(n){return function(e){fq.typeInfo.set(e,uq.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{SP.instance.register(t,e)}):SP.instance.register(n.token,e))}}a(dq,"injectable");v1.default=dq});var wP=v(T1=>{"use strict";Object.defineProperty(T1,"__esModule",{value:!0});var pq=(Hm(),hm(Wm)),hq=Ea();function mq(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=pq.__rest(t,["token","options"]);return hq.instance.register(r,s,i)}),e}}a(mq,"registry");T1.default=mq});var EP=v(A1=>{"use strict";Object.defineProperty(A1,"__esModule",{value:!0});var gq=ag(),yq=Ea();function _q(){return function(n){gq.default()(n),yq.instance.registerSingleton(n)}}a(_q,"singleton");A1.default=_q});var vP=v(I1=>{"use strict";Object.defineProperty(I1,"__esModule",{value:!0});var bq=Fl();function Sq(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return bq.defineInjectionTokenMetadata(t)}a(Sq,"injectAll");I1.default=Sq});var TP=v(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});var wq=Fl();function Eq(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return wq.defineInjectionTokenMetadata(r)}a(Eq,"injectAllWithTransform");x1.default=Eq});var AP=v(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});var vq=Fl();function Tq(n,e,...t){return vq.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}a(Tq,"injectWithTransform");R1.default=Tq});var IP=v(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});var Aq=ag(),Iq=Ea();function xq(n,e){return function(t){Aq.default()(t),Iq.instance.register(e||t,t,{lifecycle:n})}}a(xq,"scoped");C1.default=xq});var xP=v(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var Rq=_P();Object.defineProperty(Gi,"autoInjectable",{enumerable:!0,get:a(function(){return Rq.default},"get")});var Cq=bP();Object.defineProperty(Gi,"inject",{enumerable:!0,get:a(function(){return Cq.default},"get")});var Oq=ag();Object.defineProperty(Gi,"injectable",{enumerable:!0,get:a(function(){return Oq.default},"get")});var Pq=wP();Object.defineProperty(Gi,"registry",{enumerable:!0,get:a(function(){return Pq.default},"get")});var Dq=EP();Object.defineProperty(Gi,"singleton",{enumerable:!0,get:a(function(){return Dq.default},"get")});var Fq=vP();Object.defineProperty(Gi,"injectAll",{enumerable:!0,get:a(function(){return Fq.default},"get")});var Lq=TP();Object.defineProperty(Gi,"injectAllWithTransform",{enumerable:!0,get:a(function(){return Lq.default},"get")});var Nq=AP();Object.defineProperty(Gi,"injectWithTransform",{enumerable:!0,get:a(function(){return Nq.default},"get")});var kq=IP();Object.defineProperty(Gi,"scoped",{enumerable:!0,get:a(function(){return kq.default},"get")})});var RP=v(O1=>{"use strict";Object.defineProperty(O1,"__esModule",{value:!0});function Mq(n){let e;return t=>(e==null&&(e=n(t)),e)}a(Mq,"instanceCachingFactory");O1.default=Mq});var CP=v(P1=>{"use strict";Object.defineProperty(P1,"__esModule",{value:!0});function jq(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}a(jq,"instancePerContainerCachingFactory");P1.default=jq});var OP=v(D1=>{"use strict";Object.defineProperty(D1,"__esModule",{value:!0});function $q(n,e,t,r=!0){let i,s;return o=>{let l=n(o);return(!r||s!==l)&&((s=l)?i=o.resolve(e):i=o.resolve(t)),i}}a($q,"predicateAwareClassFactory");D1.default=$q});var PP=v(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var Uq=RP();Object.defineProperty(Dd,"instanceCachingFactory",{enumerable:!0,get:a(function(){return Uq.default},"get")});var Bq=CP();Object.defineProperty(Dd,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return Bq.default},"get")});var Vq=OP();Object.defineProperty(Dd,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return Vq.default},"get")})});var ut=v(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var F1=(Hm(),hm(Wm));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 qq=fP();Object.defineProperty(va,"Lifecycle",{enumerable:!0,get:a(function(){return qq.Lifecycle},"get")});F1.__exportStar(xP(),va);F1.__exportStar(PP(),va);F1.__exportStar(c1(),va);var Gq=Qm();Object.defineProperty(va,"delay",{enumerable:!0,get:a(function(){return Gq.delay},"get")});var Wq=Ea();Object.defineProperty(va,"container",{enumerable:!0,get:a(function(){return Wq.instance},"get")})});var Fd=v(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.NullLogger=void 0;lg.NullLogger={debug(){},info(){},warn(){},error(){}}});var Vc=v(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.bytesToBase64=FP;Bc.base64ToBytes=LP;Bc.base64ToUtf8=Hq;Bc.utf8ToBase64=zq;var DP=32768;function FP(n){let e="";for(let t=0;t<n.length;t+=DP)e+=String.fromCharCode(...n.subarray(t,t+DP));return btoa(e)}a(FP,"bytesToBase64");function LP(n){let e=n.replace(/\s/g,""),t=e.length%4,r=t===2||t===3?e+"=".repeat(4-t):e,i=atob(r),s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s}a(LP,"base64ToBytes");function Hq(n){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(LP(n))}a(Hq,"base64ToUtf8");function zq(n){return FP(new TextEncoder().encode(n))}a(zq,"utf8ToBase64")});var Ld=v(L1=>{"use strict";Object.defineProperty(L1,"__esModule",{value:!0});L1.iriToObsidianName=Yq;var Kq=Vt();function Yq(n){let e=Kq.Namespace.fromTermIRI(n);if(e)return`${e.namespace.prefix}__${e.localName}`;let t=n.match(/\/([^/]+)\.md$/);return t?t[1]:null}a(Yq,"iriToObsidianName")});var NP=v(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.registerUniversalDefaultLoader=Qq;Ta.clearUniversalDefaultLoader=Xq;Ta.clearUniversalDefault=Jq;Ta.loadUniversalDefault=Zq;Ta.mergePropertyDefaults=eG;Ta.mergeInheritanceRules=tG;var cg=null,Ao,Nd=!1;function Qq(n){cg=n,Ao=void 0,Nd=!1}a(Qq,"registerUniversalDefaultLoader");function Xq(){cg=null,Ao=void 0,Nd=!1}a(Xq,"clearUniversalDefaultLoader");function Jq(){Ao=void 0,Nd=!1}a(Jq,"clearUniversalDefault");async function Zq(){if(Ao!==void 0)return Ao;if(!cg)return Ao=null,null;try{Ao=await cg()??null}catch(n){Nd||(console.warn("[UniversalDefaultTemplateResolver] loader threw, falling back to legacy primitives:",n),Nd=!0),Ao=null}return Ao}a(Zq,"loadUniversalDefault");function eG(n,e){let t=new Map;for(let s of e)t.set(s.propertyName,s);let r=[],i=new Set;for(let s of n){let o=t.get(s.propertyName);o?(r.push(o),i.add(o.propertyName)):r.push(s)}for(let s of e)i.has(s.propertyName)||r.push(s);return r}a(eG,"mergePropertyDefaults");function tG(n,e){let t=new Map;for(let s of e)t.set(s.targetPropertyName,s);let r=[],i=new Set;for(let s of n){let o=t.get(s.targetPropertyName);o?(r.push(o),i.add(o.targetPropertyName)):r.push(s)}for(let s of e)i.has(s.targetPropertyName)||r.push(s);return r}a(tG,"mergeInheritanceRules")});var N1=v((jye,kP)=>{var qc=class{static{a(this,"Wildcard")}constructor(){return rG||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(qc.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(qc.prototype,"termType",{enumerable:!0,value:"Wildcard"});var rG=new qc;kP.exports.Wildcard=qc});var jP=v((Uye,MP)=>{var nG=(function(){var n=a(function(Y,W,Z,le){for(Z=Z||{},le=Y.length;le--;Z[Y[le]]=W);return Z},"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],r=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],o=[1,27],l=[13,16,45,197,224,229,308],c=[28,29,53],u=[28,53],f=[1,42],d=[1,45],p=[1,41],h=[1,44],_=[123,126],y=[1,67],b=[39,45,87],S=[13,16,45,197,224,308],I=[1,87],O=[2,281],T=[1,86],E=[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],M=[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],j=[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],$=[13,16,308],G=[112,132,327,334],ge=[13,16,112,132,308],ye=[1,111],Q=[1,117],se=[112,132,327,328,334],J=[13,16,112,132,308,328],ve=[28,29,45,53,87],te=[1,138],ie=[1,151],he=[1,128],Ue=[1,127],ce=[1,129],ue=[1,140],fe=[1,141],ne=[1,142],me=[1,143],Le=[1,144],B=[1,145],oe=[1,147],Ee=[1,148],Ce=[2,457],xe=[1,158],Oe=[1,159],Re=[1,160],Ae=[1,152],ee=[1,153],_e=[1,156],Te=[1,171],Pe=[1,172],Me=[1,173],Ne=[1,174],Ge=[1,175],ke=[1,176],We=[1,167],qe=[1,168],je=[1,169],He=[1,170],m=[1,157],L=[1,166],U=[1,161],R=[1,162],C=[1,163],D=[1,164],w=[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],H=[6,31,73,81,83,85],q=[2,285],k=[1,199],N=[1,201],z=[6,31,70,73,81,83,85],K=[2,283],ae=[1,207],Se=[1,218],De=[1,223],rt=[1,219],Jr=[1,225],Cr=[1,226],sr=[1,224],aC=[6,63,70,73,81,83,85],lC=[1,236],cC=[2,334],uC=[1,243],fC=[1,241],Zr=[6,193],Wh=[2,349],dC=[2,339],ya=[28,128],pC=[47,48,193,272],Hh=[47,48,193,242,272],Rc=[47,48,193,242,246,272],Cc=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],$r=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],hC=[1,271],mC=[1,270],hr=[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],gC=[1,281],yC=[1,280],Cn=[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],td=[45,89],zh=[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],Kh=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Yh=[31,89],Qh=[48,87],ml=[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],xs=[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],_C=[1,313],Oc=[6,85],bS=[6,31,81,83,85],bC=[2,361],fo=[2,353],gl=[1,343],rd=[31,112,335],po=[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],SS=[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],SC=[6,109,193],yl=[31,112],mr=[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],wS=[1,390],ES=[1,391],_a=[13,16,87,197,308,314],wC=[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],Xh=[1,417],Jh=[1,418],EC=[13,16,48,197,229,308],ba=[6,31,85],vC=[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],vS=[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],_l=[29,31,85,112,159,160,161,163,164],Zh=[1,443],em=[1,444],TC=[1,449],bl=[31,112,193,232,318,335],tm=[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],AC=[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],TS=[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],nd=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],id=[31,45],IC=[1,507],xC=[1,508],RC=[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],rm=[29,31,85,112,159,160,161,163,164,335],Sl=[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],CC=[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],OC=[2,352],AS=[13,16,197,308,314],PC=[1,565],Pc=[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],DC=[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],ho=[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],FC=[13,16,87,308],mo=[2,364],Dc=[29,31,85,112,159,160,161,163,164,193,232,318,335],nm=[31,112,193,232,272,318,335],go=[2,359],LC=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],im=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],NC=[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],kC=[2,347],IS={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(W,Z,le,Be,it,A,Pn){var x=A.length-1;switch(it){case 1:if(A[x-1]=A[x-1]||{},ot.base&&(A[x-1].base=ot.base),ot.base="",A[x-1].prefixes=ot.prefixes,ot.prefixes=null,ot.pathOnly){if(A[x-1].type==="path"||"termType"in A[x-1])return A[x-1];throw new Error("Received full SPARQL query in path only mode")}else if(A[x-1].type==="path"||"termType"in A[x-1])throw new Error("Received only path in full SPARQL mode");if(A[x-1].type==="update"){let Nt={};for(let Kt of A[x-1].updates)if(Kt.updateType==="insert"){let bt={};for(let Rt of Kt.insert)if(Rt.type==="bgp"||Rt.type==="graph")for(let zn of Rt.triples)zn.subject.termType==="BlankNode"&&(bt[zn.subject.value]=!0),zn.predicate.termType==="BlankNode"&&(bt[zn.predicate.value]=!0),zn.object.termType==="BlankNode"&&(bt[zn.object.value]=!0);for(let Rt of Object.keys(bt)){if(Nt[Rt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");Nt[Rt]=!0}}}return A[x-1];case 2:this.$={...A[x-1],...A[x],type:"query"};break;case 4:ot.base=sd(A[x]);break;case 5:ot.prefixes||(ot.prefixes={}),A[x-1]=A[x-1].substr(0,A[x-1].length-1),A[x]=sd(A[x]),ot.prefixes[A[x-1]]=A[x];break;case 6:this.$={...A[x-3],...vl(A[x-2]),...A[x-1],...A[x]};break;case 7:if(!ot.skipValidation&&(LS(A[x-3].variables.map(Kt=>FS(Kt.expression))).some(Kt=>Kt.aggregation==="count"&&!(Kt.expression instanceof sm))||A[x].group)){for(let Kt of A[x-3].variables)if(Kt.termType==="Variable"){if(!A[x].group||!A[x].group.map(bt=>kc(bt)).includes(kc(Kt)))throw Error("Projection of ungrouped variable (?"+kc(Kt)+")")}else if(FS(Kt.expression).length===0){let bt=EB(Kt.expression);for(let Rt of bt)if(!A[x].group||!A[x].group.map||!A[x].group.map(zn=>kc(zn)).includes(kc(Rt)))throw Error("Use of ungrouped variable in projection of operation (?"+kc(Rt)+")")}}let Ps=A[x-1].where.filter(Nt=>Nt.type==="query");if(Ps.length>0){let Nt=A[x-3].variables.filter(bt=>bt.variable&&bt.variable.value).map(bt=>bt.variable.value),Kt=LS(Ps.map(bt=>bt.variables)).map(bt=>bt.value||bt.variable.value);for(let bt of Nt)if(Kt.indexOf(bt)>=0)throw Error("Target id of 'AS' (?"+bt+") already used in subquery")}this.$=or(A[x-3],vl(A[x-2]),A[x-1],A[x]);break;case 8:this.$=or({queryType:"CONSTRUCT",template:A[x-3]},vl(A[x-2]),A[x-1],A[x]);break;case 9:this.$=or({queryType:"CONSTRUCT",template:A[x-2]=A[x-2]?A[x-2].triples:[]},vl(A[x-5]),{where:[{type:"bgp",triples:El([],A[x-2])}]},A[x]);break;case 10:this.$=or({queryType:"DESCRIBE",variables:A[x-3]==="*"?[new sm]:A[x-3]},vl(A[x-2]),A[x-1],A[x]);break;case 11:this.$=or({queryType:"ASK"},vl(A[x-2]),A[x-1],A[x]);break;case 12:this.$=or(A[x-1],{variables:[new sm]});break;case 13:let ud=A[x].map(Nt=>Nt.value||Nt.variable.value),Mc=vB(ud);if(Mc.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Mc[0]+")");this.$=or(A[x-1],{variables:A[x]});break;case 14:this.$=or({queryType:"SELECT"},A[x]&&(A[x-1]=On(A[x]),A[x]={},A[x][A[x-1]]=!0,A[x]));break;case 16:case 27:this.$=Fc(A[x-3],{variable:A[x-1]});break;case 17:case 18:this.$=or(A[x-3],A[x-2],A[x-1],A[x],{type:"query"});break;case 19:case 58:this.$={iri:A[x],named:!!A[x-1]};break;case 20:this.$={where:A[x].patterns};break;case 21:this.$=or(A[x-1],A[x]);break;case 22:this.$=or(A[x-2],A[x-1],A[x]);break;case 23:this.$={group:A[x]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Fc(A[x]);break;case 26:this.$=Fc(A[x-1]);break;case 29:this.$={having:A[x]};break;case 30:this.$={order:A[x]};break;case 32:this.$=Fc(A[x],{descending:!0});break;case 35:this.$={limit:Nc(A[x])};break;case 36:this.$={offset:Nc(A[x])};break;case 37:this.$={limit:Nc(A[x-2]),offset:Nc(A[x])};break;case 38:this.$={limit:Nc(A[x]),offset:Nc(A[x-2])};break;case 39:case 43:this.$={type:"values",values:A[x]};break;case 40:case 84:this.$=A[x-1].map(Nt=>({[A[x-3]]:Nt}));break;case 41:case 85:this.$=A[x-1].map(()=>({}));break;case 42:case 86:var Os=A[x-4].length;A[x-4]=A[x-4].map(xS),this.$=A[x-1].map(function(Nt){if(Nt.length!==Os)throw Error("Inconsistent VALUES length");for(var Kt={},bt=0;bt<Os;bt++)Kt["?"+A[x-4][bt].value]=Nt[bt];return Kt});break;case 44:case 65:case 100:case 126:case 175:this.$=A[x-1];break;case 45:this.$={type:"update",updates:yo(A[x-2],A[x-1])};break;case 46:this.$=or({type:"load",silent:!!A[x-2],source:A[x-1]},A[x]&&{destination:A[x]});break;case 47:this.$={type:On(A[x-2]),silent:!!A[x-1],graph:A[x]};break;case 48:this.$={type:On(A[x-4]),silent:!!A[x-3],source:A[x-2],destination:A[x]};break;case 49:this.$={type:"create",silent:!!A[x-2],graph:{type:"graph",name:A[x]}};break;case 50:this.$={updateType:"insert",insert:zC(A[x])};break;case 51:this.$={updateType:"delete",delete:MS(zC(A[x]))};break;case 52:this.$={updateType:"deletewhere",delete:MS(A[x])};break;case 53:this.$={updateType:"insertdelete",...A[x-4],...A[x-3],...vl(A[x-2],"using"),where:A[x].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=A[x];break;case 55:this.$={delete:MS(A[x-1]),insert:A[x]||[]};break;case 56:this.$={delete:[],insert:A[x]};break;case 59:this.$={graph:A[x]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:A[x]};break;case 64:this.$={[On(A[x])]:!0};break;case 66:this.$=A[x-1]?Rs(A[x],[A[x-1]]):Rs(A[x]);break;case 67:var ld=or(A[x-3]||{triples:[]},{type:"graph",name:A[x-5]});this.$=A[x]?[ld,A[x]]:[ld];break;case 68:case 73:this.$={type:"bgp",triples:Rs(A[x-2],[A[x-1]])};break;case 69:this.$={type:"group",patterns:[A[x-1]]};break;case 70:for(let Nt of A[x-1].filter(Kt=>Kt.type==="bind")){let Kt=A[x-1].indexOf(Nt),bt=new Set;for(let Rt of A[x-1].slice(0,Kt))(Rt.type==="group"||Rt.type==="bgp")&&WC(Rt).forEach(zn=>bt.add(zn));if(bt.has(Nt.variable.value))throw Error("Variable used to bind is already bound (?"+Nt.variable.value+")")}this.$={type:"group",patterns:A[x-1]};break;case 71:this.$=A[x-1]?Rs([A[x-1]],A[x]):Rs(A[x]);break;case 72:this.$=A[x]?[A[x-2],A[x]]:A[x-2];break;case 75:this.$=or(A[x],{type:"optional"});break;case 76:this.$=or(A[x],{type:"minus"});break;case 77:this.$=or(A[x],{type:"graph",name:A[x-1]});break;case 78:this.$=or(A[x],{type:"service",name:A[x-1],silent:!!A[x-2]});break;case 79:this.$={type:"filter",expression:A[x]};break;case 80:this.$={type:"bind",variable:A[x-1],expression:A[x-3]};break;case 89:this.$=ad(A[x]);break;case 90:this.$=void 0;break;case 91:this.$=A[x-1].length?{type:"union",patterns:Rs(A[x-1].map(CS),[CS(A[x])])}:A[x];break;case 95:this.$={...A[x],function:A[x-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:yo(A[x-2],A[x-1]),distinct:!!A[x-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.$=yo(A[x-2],A[x-1]);break;case 101:this.$=Rs(A[x-2],[A[x-1]]);break;case 102:case 112:this.$=kS(A[x].map(Nt=>or(_o(A[x-1]),Nt)));break;case 103:this.$=kS(El(A[x].map(Nt=>or(_o(A[x-1].entity),Nt)),A[x-1].triples));break;case 105:this.$=Rs([A[x-1]],A[x]);break;case 106:this.$=Rs(A[x]);break;case 107:this.$=DS(A[x-1],A[x]);break;case 109:case 237:this.$=ot.factory.namedNode(dB);break;case 110:case 118:this.$=yo(A[x-1],A[x]);break;case 111:this.$=A[x]?{annotation:A[x],object:A[x-1]}:A[x-1];break;case 113:this.$=A[x]?kS(El(A[x].map(Nt=>or(_o(A[x-1].entity),Nt)),A[x-1].triples)):A[x-1].triples;break;case 114:this.$=DS(...A[x-1],A[x]);break;case 116:this.$=DS(...A[x]);break;case 117:case 159:case 163:this.$=[A[x-1],A[x]];break;case 119:this.$=A[x]?{object:A[x-1],annotation:A[x]}:A[x-1];break;case 120:this.$=A[x-1].length?Lc("|",yo(A[x-1],A[x])):A[x];break;case 121:this.$=A[x-1].length?Lc("/",yo(A[x-1],A[x])):A[x];break;case 122:this.$=A[x]?Lc(A[x],[A[x-1]]):A[x-1];break;case 123:this.$=A[x-1]?Lc(A[x-1],[A[x]]):A[x];break;case 125:case 131:this.$=Lc(A[x-1],[A[x]]);break;case 129:this.$=Lc("|",yo(A[x-2],A[x-1]));break;case 132:case 134:this.$=SB(A[x-1]);break;case 133:case 135:this.$=wB(A[x-1]);break;case 140:this.$={entity:A[x],triples:[]};break;case 145:this.$=xS(A[x]);break;case 149:this.$=ot.factory.namedNode(MC);break;case 151:case 153:case 158:case 162:this.$=RS(A[x-1],A[x]);break;case 152:this.$=["||",A[x]];break;case 154:this.$=["&&",A[x]];break;case 156:this.$=en(A[x-1],[A[x-2],A[x]]);break;case 157:this.$=en(A[x-2]?"notin":"in",[A[x-3],A[x]]);break;case 160:this.$=["+",RS(A[x-1],A[x])];break;case 161:var lm=Cs(A[x-1].value.replace("-",""),A[x-1].datatype);this.$=["-",RS(lm,A[x])];break;case 164:this.$=en("UPLUS",[A[x]]);break;case 165:this.$=en(A[x-1],[A[x]]);break;case 166:this.$=en("UMINUS",[A[x]]);break;case 177:this.$=en(On(A[x-1]));break;case 178:this.$=en(On(A[x-3]),[A[x-1]]);break;case 179:this.$=ad(en(On(A[x-3]),[A[x-1]]));break;case 180:this.$=en(On(A[x-5]),[A[x-3],A[x-1]]);break;case 181:this.$=en(On(A[x-7]),[A[x-5],A[x-3],A[x-1]]);break;case 182:this.$=ad(en(On(A[x-7]),[A[x-5],A[x-3],A[x-1]]));break;case 183:this.$=en(On(A[x-1]),A[x]);break;case 184:this.$=en("bound",[xS(A[x-1])]);break;case 185:this.$=en(A[x-1],[]);break;case 186:this.$=en(A[x-3],[A[x-1]]);break;case 187:this.$=en(A[x-2]?"notexists":"exists",[CS(A[x])]);break;case 188:case 189:this.$=Fc(A[x-1],{type:"aggregate",aggregation:On(A[x-4]),distinct:!!A[x-2]});break;case 190:this.$=Fc(A[x-2],{type:"aggregate",aggregation:On(A[x-5]),distinct:!!A[x-3],separator:typeof A[x-1]=="string"?A[x-1]:" "});break;case 192:this.$=Cs(A[x]);break;case 193:this.$=gB(A[x-1],On(A[x].substr(1)));break;case 194:this.$=Cs(A[x-2],A[x]);break;case 195:case 204:this.$=Cs(A[x],jC);break;case 196:case 205:this.$=Cs(A[x],$C);break;case 197:case 206:this.$=Cs(On(A[x]),UC);break;case 200:this.$=Cs(A[x].toLowerCase(),mB);break;case 201:this.$=Cs(A[x].substr(1),jC);break;case 202:this.$=Cs(A[x].substr(1),$C);break;case 203:this.$=Cs(A[x].substr(1).toLowerCase(),UC);break;case 207:case 208:this.$=GC(A[x],1);break;case 209:case 210:this.$=GC(A[x],3);break;case 211:this.$=ot.factory.namedNode(sd(A[x]));break;case 213:var cm=A[x].indexOf(":"),cd=A[x].substr(0,cm),um=ot.prefixes[cd];if(!um)throw new Error("Unknown prefix: "+cd);var Zt=sd(um+A[x].substr(cm+1));this.$=ot.factory.namedNode(Zt);break;case 214:if(A[x]=A[x].substr(0,A[x].length-1),!(A[x]in ot.prefixes))throw new Error("Unknown prefix: "+A[x]);var Zt=sd(ot.prefixes[A[x]]);this.$=ot.factory.namedNode(Zt);break;case 215:this.$=od(A[x].replace(/^(_:)/,""));break;case 216:this.$=od();break;case 217:case 218:case 232:this.$=ad(OS(A[x-3],A[x-2],A[x-1]));break;case 230:case 231:this.$=ad(A[x-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:A[x-1].push(A[x]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[A[x]];break;case 308:A[x-3].push(A[x-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:A[x-2].push(A[x-1]);break}},"anonymous"),table:[n(e,t,{3:1,4:2,10:3}),{1:[3]},n(r,[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}),n([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]},n(l,[2,411],{216:28,217:29}),n(c,[2,249],{18:30}),n(c,[2,251],{22:31}),n(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},n(c,[2,267],{37:46}),n(_,[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},n(b,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),n(e,[2,248]),n(e,[2,245]),n(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]},n([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]}),n(S,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:I,29:O,52:84,53:T,56:85},{19:88,28:I,29:O,52:89,53:T,56:85},n(c,[2,253],{26:90}),{28:[1,91],52:92,53:T},n(E,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(P,[2,263],{34:96}),n(P,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:p,308:h}),n(P,[2,262]),n(V,[2,259]),n(M,[2,143]),n(M,[2,144]),n([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]),n(j,[2,211]),n(j,[2,212]),n(j,[2,213]),n(j,[2,214]),{19:98,28:I,29:O,52:99,53:T,56:85},{6:[2,309],99:100,193:[1,101]},n($,[2,311],{101:102,328:[1,103]}),n(G,[2,317],{104:104,328:[1,105]}),n(ge,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:ye,114:110},{29:ye,114:112},{29:ye,114:113},{118:114,123:[1,115],125:116,126:Q},n(se,[2,315]),n(se,[2,316]),n(J,[2,319]),n(J,[2,320]),n(J,[2,321]),n(_,[2,327]),{13:f,16:d,55:118,307:43,308:h},n(c,[2,12]),n(c,[2,13],{44:66,43:119,45:y,87:p}),n(ve,[2,269]),n(ve,[2,15]),{13:f,16:d,44:136,45:te,46:120,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(b,[2,14]),n(b,[2,274]),n(b,[2,271]),n(b,[2,272]),n(e,[2,4]),{13:[1,177]},n(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},n(l,[2,410]),n([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},n(S,[2,419]),n(H,q,{20:196,59:197,69:198,70:k}),n(c,[2,250]),{29:N,57:200},n($,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(z,K,{23:204,58:205,62:206,63:ae}),n(c,[2,252]),{19:208,28:I,29:O,52:209,53:T,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:Se,55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(aC,[2,265],{56:85,35:227,52:228,19:229,28:I,29:O,53:T}),n(V,[2,260]),n(z,K,{58:205,62:206,23:230,63:ae}),n(c,[2,268]),{6:[2,45]},n(e,t,{10:3,4:231}),{13:f,16:d,55:232,307:43,308:h},n($,[2,312]),{105:233,112:lC,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(G,[2,318]),n($,cC,{108:240,133:242,112:uC,132:fC}),n(ge,[2,323]),{112:[1,244]},{112:[2,325]},n(Zr,[2,50]),n(E,Wh,{135:245,136:246,143:247,144:248,31:dC,112:dC}),n(Zr,[2,51]),n(Zr,[2,52]),n(ya,[2,328],{119:249}),{29:ye,114:250},n(ya,[2,56]),{29:ye,114:251},n(_,[2,59]),n(ve,[2,270]),{47:[1,252]},n(pC,[2,150]),n(Hh,[2,428],{240:253}),n(Rc,[2,430],{244:254}),n(Rc,[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]}),n(Cc,[2,440],{252:264}),n($r,[2,448],{260:265}),{13:f,16:d,44:136,45:te,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,255:154,257:155,264:266,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,255:154,257:155,264:267,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,255:154,257:155,264:268,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n($r,[2,167]),n($r,[2,168]),n($r,[2,169]),n($r,[2,170],{176:269,45:hC,89:mC}),n($r,[2,171]),n($r,[2,172]),n($r,[2,173]),n($r,[2,174]),{13:f,16:d,44:136,45:te,46:272,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(hr,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:gC,89:yC,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(Cn,[2,192],{292:[1,286],293:[1,287]}),n(Cn,[2,195]),n(Cn,[2,196]),n(Cn,[2,197]),n(Cn,[2,198]),n(Cn,[2,199]),n(Cn,[2,200]),{13:f,16:d,44:39,55:40,82:ie,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(td,[2,452]),n(td,[2,453]),n(td,[2,454]),n(td,[2,455]),n(td,[2,456]),{279:[2,458]},n(zh,[2,207]),n(zh,[2,208]),n(zh,[2,209]),n(zh,[2,210]),n(Cn,[2,201]),n(Cn,[2,202]),n(Cn,[2,203]),n(Cn,[2,204]),n(Cn,[2,205]),n(Cn,[2,206]),n(e,[2,5]),n(Kh,[2,297],{88:295}),n(Yh,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(Qh,[2,301]),n(F,[2,43]),n(F,[2,82]),n(F,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(l,[2,412]),n(ml,[2,123]),n(ml,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(xs,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:X,223:312,225:308,226:309,229:_C,307:43,308:h},n(l,i,{215:10,214:314}),n(xs,[2,236]),n(xs,[2,237]),n(Oc,[2,6]),n(bS,[2,287],{60:315,72:316,73:[1,317]}),n(H,[2,286]),{13:f,16:d,45:te,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:w},n([6,31,63,70,73,81,83,85],[2,20]),n(E,bC,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:fo,31:fo,85:fo,112:fo,159:fo,160:fo,161:fo,163:fo,164:fo,41:s}),{13:f,16:d,55:331,307:43,308:h},n($,[2,280]),n(Oc,[2,7]),n(H,q,{59:197,69:198,20:332,70:k}),n(z,[2,284]),{64:[1,333]},n(z,K,{58:205,62:206,23:334,63:ae}),n(c,[2,254]),n(E,Wh,{144:248,30:335,143:336,31:[2,257]}),n(c,[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:gl,307:43,308:h},n(rd,[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:gl,308:h}),n(po,[2,227]),n(po,[2,228]),n(po,[2,229]),{13:f,16:d,44:215,45:Se,55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},{13:f,16:d,44:39,55:40,87:p,139:342,186:352,190:340,195:341,197:gl,307:43,308:h},n(po,[2,146]),n(po,[2,147]),n(po,[2,148]),n(po,[2,149]),{13:f,16:d,44:354,55:355,82:ie,87:p,172:357,237:356,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:358,312:sr,313:353},n(SS,[2,215]),n(SS,[2,216]),n(z,K,{58:205,62:206,23:359,63:ae}),n(P,[2,264]),n(aC,[2,266]),n(Oc,[2,11]),n(r,[2,308],{6:[2,310]}),n(Zr,[2,313],{102:360,120:361,121:[1,362]}),n(Zr,[2,47]),n(Zr,[2,63]),n(Zr,[2,64]),{13:f,16:d,55:363,307:43,308:h},n(Zr,[2,336]),n(Zr,[2,337]),n(Zr,[2,338]),{109:[1,364]},n(SC,[2,60]),{13:f,16:d,55:365,307:43,308:h},n($,[2,335]),{13:f,16:d,55:366,307:43,308:h},{31:[1,367]},n(yl,[2,341],{137:368}),n(yl,[2,340]),{13:f,16:d,44:215,45:Se,55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},{28:[1,370],127:371,128:[1,372]},n(ya,[2,330],{124:373,125:374,126:Q}),n(ya,[2,57]),{44:375,87:p},n(pC,[2,151],{241:376,242:[1,377]}),n(Hh,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:te,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,247:380,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{250:[1,381]},n(mr,[2,432]),n(mr,[2,433]),n(mr,[2,434]),n(mr,[2,435]),n(mr,[2,436]),n(mr,[2,437]),{250:[2,439]},n([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:Pe,299:Me,300:Ne,301:Ge,302:ke}),n(Cc,[2,162],{261:388,262:389,39:wS,338:ES}),n($r,[2,164]),n($r,[2,165]),n($r,[2,166]),n(hr,[2,95]),n(hr,[2,96]),n(mr,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(hr,[2,177]),{13:f,16:d,44:136,45:te,46:395,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,46:396,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,46:397,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,46:398,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,46:399,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(hr,[2,183]),n(hr,[2,98]),n(mr,[2,381],{180:400}),{87:[1,401]},n(hr,[2,185]),{13:f,16:d,44:136,45:te,46:402,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{29:N,57:403},n(Cn,[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:gl,307:43,308:h},n(_a,[2,233]),n(_a,[2,234]),n(_a,[2,235]),n(wC,[2,459],{281:406,325:[1,407]}),n(mr,[2,463],{284:408,325:[1,409]}),n(mr,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:ie,171:413,172:415,173:416,174:Xh,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:Jh},{31:[1,419],89:[1,420]},{29:[1,421]},n(Qh,[2,302]),n(Kh,[2,367],{167:422}),n(Yh,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(Qh,[2,371]),n(ml,[2,122]),n(ml,[2,417]),n(ml,[2,413]),n(ml,[2,414]),n(ml,[2,415]),n(xs,[2,125]),n(xs,[2,127]),n(xs,[2,128]),n(EC,[2,420],{227:426}),n(xs,[2,130]),{13:f,16:d,55:194,197:X,223:427,307:43,308:h},{48:[1,428]},n(ba,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(bS,[2,288]),{64:[1,433]},n(H,[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:te,268:ue,269:fe,270:ne,271:me,273:Le,274:B,276:oe,277:Ee,279:Ce,280:xe,283:Oe,285:Re,308:h,346:L,347:U,348:R,349:C,350:D,351:w}),n(vC,[2,293]),n(vS,[2,92]),n(vS,[2,93]),n(vS,[2,94]),{45:hC,89:mC,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:I,29:O,56:85},{19:438,28:I,29:O,56:85},n(_l,[2,355],{149:439}),n(_l,[2,354]),{13:f,16:d,44:215,45:Zh,55:220,82:ie,87:p,89:De,156:440,172:221,185:441,203:442,231:em,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(P,[2,19]),n(ba,[2,21]),{13:f,16:d,44:450,45:TC,55:323,65:445,66:446,67:447,68:448,87:p,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:w},n(Oc,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(E,[2,386],{31:[2,388]}),n(rd,[2,102]),n(bl,[2,391],{191:452}),n(E,[2,395],{196:453,198:454}),n(E,[2,108]),n(E,[2,109]),n(rd,[2,103]),n(rd,[2,104]),n(rd,[2,390]),{13:f,16:d,44:215,45:Se,48:[1,455],55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(tm,[2,424]),n(AC,[2,136]),n(AC,[2,137]),n(TS,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:p,139:342,195:458,197:gl,307:43,308:h},n(_a,[2,219]),n(_a,[2,220]),n(_a,[2,221]),n(_a,[2,222]),n(_a,[2,223]),n(Oc,[2,10]),n(Zr,[2,46]),n(Zr,[2,314]),{112:lC,122:459},n(Zr,[2,62]),n($,cC,{133:242,108:460,112:uC,132:fC}),n(SC,[2,61]),n(Zr,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(yl,[2,351],{146:463,335:[1,464]}),{29:N,57:465},n(ya,[2,329]),n($,[2,332],{129:466,327:[1,467]}),n(ya,[2,55]),n(ya,[2,331]),{48:[1,468]},n(Hh,[2,429]),{13:f,16:d,44:136,45:te,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(Rc,[2,431]),{13:f,16:d,44:136,45:te,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,243:470,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(Rc,[2,156]),{45:gC,89:yC,179:471},n(Cc,[2,441]),{13:f,16:d,44:136,45:te,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,251:472,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n($r,[2,444],{256:473}),n($r,[2,446],{258:474}),n(mr,[2,442]),n(mr,[2,443]),n($r,[2,449]),{13:f,16:d,44:136,45:te,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,255:154,257:155,259:475,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(mr,[2,450]),n(mr,[2,451]),n(mr,[2,379],{178:476}),n(mr,[2,378]),n([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:te,46:482,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{48:[1,483]},{48:[1,484]},n(hr,[2,187]),n(Cn,[2,194]),{13:f,16:d,44:39,55:40,82:ie,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,320:485},{13:f,16:d,39:[1,487],44:136,45:te,46:488,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,282:486,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(wC,[2,460]),{13:f,16:d,44:136,45:te,46:489,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(mr,[2,464]),{13:f,16:d,44:136,45:te,46:490,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(mr,[2,466]),n(F,[2,40]),n(Kh,[2,298]),n(nd,[2,87]),n(nd,[2,88]),n(nd,[2,89]),n(nd,[2,90]),{13:f,16:d,55:492,82:ie,172:493,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,311:494,312:sr,315:491},n(F,[2,41]),n(Yh,[2,300]),n(id,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:ie,171:497,172:415,173:416,174:Xh,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:Jh},{31:[1,498],89:[1,499]},{29:[1,500]},n(Qh,[2,372]),{13:f,16:d,48:[2,422],55:194,197:X,223:312,226:502,228:501,229:_C,307:43,308:h},n(xs,[2,131]),n(xs,[2,126]),n(ba,[2,22]),n(ba,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:te,55:323,67:321,68:322,74:505,75:506,76:IC,77:320,78:xC,79:509,87:p,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:w},n(vC,[2,294]),n(RC,[2,69]),n(RC,[2,70]),n(H,q,{59:197,69:198,20:511,70:k}),n(z,K,{58:205,62:206,23:512,63:ae}),{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},n(_l,[2,363],{157:524,335:[1,525]}),n(l,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:p}),n(rm,[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:Zh,55:220,82:ie,87:p,89:De,172:221,185:351,203:536,212:534,231:em,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(l,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:p}),n(z,[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:TC,87:p,268:ue,269:fe,270:ne,271:me,273:Le,274:B,276:oe,277:Ee,279:Ce,280:xe,283:Oe,285:Re,308:h,346:L,347:U,348:R,349:C,350:D,351:w}),n(Sl,[2,291]),n(Sl,[2,24]),n(Sl,[2,25]),{13:f,16:d,44:136,45:te,46:539,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(Sl,[2,28]),n(z,K,{58:205,62:206,23:540,63:ae}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(bl,[2,107]),{13:f,16:d,44:215,45:Se,55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(CC,[2,132]),n(tm,[2,425]),n(CC,[2,133]),{13:f,16:d,44:354,55:355,82:ie,87:p,172:357,237:356,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:358,312:sr,313:545},n(Zr,[2,54]),n(Zr,[2,48]),n(yl,[2,342]),{13:f,16:d,44:39,55:40,87:p,139:546,307:43,308:h},n(yl,[2,68]),n(E,[2,350],{31:OC,112:OC}),n(Zr,[2,53]),{13:f,16:d,55:547,307:43,308:h},n($,[2,333]),n(ve,[2,16]),n(Hh,[2,152]),n(Rc,[2,154]),n(Rc,[2,157]),n(Cc,[2,159]),n(Cc,[2,160],{262:389,261:548,39:wS,338:ES}),n(Cc,[2,161],{262:389,261:549,39:wS,338:ES}),n($r,[2,163]),{13:f,16:d,44:136,45:te,46:550,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(hr,[2,178]),n(hr,[2,179]),{13:f,16:d,44:136,45:te,46:551,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,46:552,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,46:553,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{48:[1,554],272:[1,555]},n(hr,[2,184]),n(hr,[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},n(AS,[2,224]),n(AS,[2,225]),n(AS,[2,226]),{31:[1,563],45:PC,94:564},n(F,[2,84]),n(Kh,[2,368]),n(F,[2,85]),n(Yh,[2,370]),n(id,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(ba,[2,35],{83:[1,569]}),n(ba,[2,36],{81:[1,570]}),n(bS,[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:te,76:IC,78:xC,87:p,268:ue,269:fe,270:ne,271:me,273:Le,274:B,276:oe,277:Ee,279:Ce,280:xe,283:Oe,285:Re,308:h,346:L,347:U,348:R,349:C,350:D,351:w}),n(Pc,[2,295]),{45:te,77:572},{45:te,77:573},n(Pc,[2,33]),n(Pc,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},n(_l,[2,356]),n(DC,[2,357],{152:578,335:[1,579]}),n(ho,[2,74]),{29:N,57:580},{29:N,57:581},{13:f,16:d,44:39,55:40,87:p,139:582,307:43,308:h},n(FC,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:te,55:323,67:321,68:322,77:320,79:585,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:w},{45:[1,586]},n(ho,[2,81]),{29:N,57:587},n(_l,[2,73]),n(E,[2,362],{29:mo,31:mo,85:mo,112:mo,159:mo,160:mo,161:mo,163:mo,164:mo}),n(rm,[2,112]),n(Dc,[2,401],{206:588}),n(E,[2,405],{209:589,210:590}),n(E,[2,403]),n(E,[2,404]),n(rm,[2,113]),n(rm,[2,400]),{13:f,16:d,44:215,45:Zh,48:[1,591],55:220,82:ie,87:p,89:De,172:221,185:351,203:536,212:592,231:em,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(tm,[2,426]),n(TS,[2,138]),n(TS,[2,139]),{232:[1,593]},n(Sl,[2,292]),{47:[1,595],48:[1,594]},n(Oc,[2,9]),n(bl,[2,392]),n(bl,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:p,197:gl,308:h}),n(bl,[2,110],{272:[1,598]}),n(nm,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(ya,[2,58]),n($r,[2,445]),n($r,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(hr,[2,99]),n(mr,[2,382]),n([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]),n(hr,[2,188]),n(hr,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:ie,172:493,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,311:494,312:sr,315:611},n(F,[2,42]),n(id,[2,304]),{13:f,16:d,55:414,82:ie,95:612,171:613,172:415,173:416,174:Xh,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:Jh},{31:[1,614],45:PC,94:615},n(xs,[2,129]),n(EC,[2,421]),{82:[1,616]},{82:[1,617]},n(Pc,[2,296]),n(Pc,[2,31]),n(Pc,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(E,bC,{155:330,153:618,154:619,29:go,31:go,85:go,112:go,159:go,160:go,161:go,163:go,164:go}),n(DC,[2,358]),n(ho,[2,75]),n(ho,[2,76]),{29:N,57:620},{13:f,16:d,44:39,55:40,87:p,139:621,307:43,308:h},n(FC,[2,366]),n(ho,[2,79]),{13:f,16:d,44:136,45:te,46:622,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(ho,[2,91],{336:[1,623]}),n([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),n(Dc,[2,117]),{13:f,16:d,44:215,45:Zh,55:220,82:ie,87:p,89:De,172:221,185:351,203:536,211:626,212:627,231:em,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(po,[2,134]),n(tm,[2,427]),n(po,[2,135]),n(Sl,[2,26]),{44:628,87:p},n(bl,[2,106]),n(bl,[2,394]),n(E,[2,396]),n(nm,[2,111]),n(nm,[2,398]),{13:f,16:d,44:39,55:40,87:p,139:342,186:629,190:340,195:341,197:gl,307:43,308:h},n(SS,[2,217]),n(E,Wh,{144:248,140:630,143:631,31:[2,343]}),n(hr,[2,97]),n(mr,[2,380]),n(hr,[2,180]),{13:f,16:d,44:136,45:te,46:632,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:te,46:633,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(hr,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:ie,171:637,172:415,173:416,174:Xh,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:Jh},n(LC,[2,305]),n(F,[2,86]),n(id,[2,374]),n(ba,[2,37]),n(ba,[2,38]),n(_l,[2,72]),n(_l,[2,360]),n(ho,[2,77]),{29:N,57:638},{47:[1,639]},{29:[2,376]},n(Dc,[2,402]),n(Dc,[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}),n(Dc,[2,118],{272:[1,641]}),n(im,[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:qe,305:je,306:He},n(nd,[2,218]),n(id,[2,44]),n(LC,[2,306]),n(ho,[2,78]),{44:651,87:p},n(Dc,[2,116]),n(E,[2,406]),n(im,[2,119]),n(im,[2,408]),n(l,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:p}),n(Sl,[2,27]),n(nm,[2,230]),n(NC,[2,345],{141:653,335:[1,654]}),n(hr,[2,181]),n(hr,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(E,Wh,{144:248,142:657,143:658,31:kC,112:kC}),n(NC,[2,346]),n(ho,[2,80]),n(im,[2,231]),n(yl,[2,67]),n(yl,[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(W,Z){if(Z.recoverable)this.trace(W);else{var le=new Error(W);throw le.hash=Z,le}},"parseError"),parse:a(function(W){var Z=this,le=[0],Be=[],it=[null],A=[],Pn=this.table,x="",Os=0,ld=0,lm=0,cm=2,cd=1,um=A.slice.call(arguments,1),Zt=Object.create(this.lexer),Ps={yy:{}};for(var ud in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ud)&&(Ps.yy[ud]=this.yy[ud]);Zt.setInput(W,Ps.yy),Ps.yy.lexer=Zt,Ps.yy.parser=this,typeof Zt.yylloc>"u"&&(Zt.yylloc={});var Mc=Zt.yylloc;A.push(Mc);var Nt=Zt.options&&Zt.options.ranges;typeof Ps.yy.parseError=="function"?this.parseError=Ps.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Kt(Ds){le.length=le.length-2*Ds,it.length=it.length-Ds,A.length=A.length-Ds}a(Kt,"popStack");for(var bt=a(function(){var Ds;return Ds=Zt.lex()||cd,typeof Ds!="number"&&(Ds=Z.symbols_[Ds]||Ds),Ds},"lex"),Rt,zn,Tl,Ti,Qpe,jS,jc={},fm,bo,KC,dm;;){if(Tl=le[le.length-1],this.defaultActions[Tl]?Ti=this.defaultActions[Tl]:((Rt===null||typeof Rt>"u")&&(Rt=bt()),Ti=Pn[Tl]&&Pn[Tl][Rt]),typeof Ti>"u"||!Ti.length||!Ti[0]){var $S="";dm=[];for(fm in Pn[Tl])this.terminals_[fm]&&fm>cm&&dm.push("'"+this.terminals_[fm]+"'");Zt.showPosition?$S="Parse error on line "+(Os+1)+`:
34
+ `)}a(YV,"composeErrorMessage");function QV(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=KV(r,e);return YV(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}a(QV,"formatErrorCtor");tg.formatErrorCtor=QV});var mP=v(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.isDisposable=void 0;function XV(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}a(XV,"isDisposable");rg.isDisposable=XV});var yP=v(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.PostResolutionInterceptors=Nl.PreResolutionInterceptors=void 0;var gP=d1(),ng=class extends gP.default{static{a(this,"PreResolutionInterceptors")}};Nl.PreResolutionInterceptors=ng;var ig=class extends gP.default{static{a(this,"PostResolutionInterceptors")}};Nl.PostResolutionInterceptors=ig;var _1=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new ng,this.postResolution=new ig}};Nl.default=_1});var Ea=v(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.instance=vo.typeInfo=void 0;var JV=(Hm(),hm(Wm)),Dn=c1(),ZV=dP(),sg=Xm(),eq=pP(),Zn=n1(),og=hP(),tq=y1(),rq=Qm(),nq=mP(),iq=yP();vo.typeInfo=new Map;var b1=class n{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new eq.default,this.interceptors=new iq.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:Zn.default.Transient}){this.ensureNotDisposed();let i;if(ZV.isProvider(t)?i=t:i={useClass:t},Dn.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let l=o.useToken;if(s.includes(l))throw new Error(`Token registration cycle detected! ${[...s,l].join(" -> ")}`);s.push(l);let c=this._registry.get(l);c&&Dn.isTokenProvider(c.provider)?o=c.provider:o=null}}if((r.lifecycle===Zn.default.Singleton||r.lifecycle==Zn.default.ContainerScoped||r.lifecycle==Zn.default.ResolutionScoped)&&(Dn.isValueProvider(i)||Dn.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Zn.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),Dn.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(),Dn.isNormalToken(e)){if(Dn.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Zn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Zn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!Dn.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Zn.default.Singleton})}resolve(e,t=new og.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&Dn.isNormalToken(e)){if(r)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(sg.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 r=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&r.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,r)}}executePostResolutionInterceptor(e,t,r){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,r);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Zn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===Zn.default.Singleton,i=e.options.lifecycle===Zn.default.ContainerScoped,s=r||i,o;return Dn.isValueProvider(e.provider)?o=e.provider.useValue:Dn.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):Dn.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):Dn.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Zn.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new og.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&Dn.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(l=>this.resolveRegistration(l,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(r=>!Dn.isValueProvider(r.provider)).map(r=>(r.instance=void 0,r)))}createChildContainer(){this.ensureNotDisposed();let e=new n(this);for(let[t,r]of this._registry.entries())r.some(({options:i})=>i.lifecycle===Zn.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===Zn.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,r={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:r})}afterResolution(e,t,r={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:r})}dispose(){return JV.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let r=t.dispose();r&&e.push(r)}),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 rq.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=vo.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 nq.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return sg.isTokenDescriptor(r)?sg.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new og.default,r.isOptional),...r.transformArgs):this.resolve(r.transform).transform(this.resolve(r.token,e,r.isOptional),...r.transformArgs):r.multiple?this.resolveAll(r.token,new og.default,r.isOptional):this.resolve(r.token,e,r.isOptional):sg.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(tq.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};vo.instance=new b1;vo.default=vo.instance});var _P=v(w1=>{"use strict";Object.defineProperty(w1,"__esModule",{value:!0});var sq=Fl(),To=Ea(),S1=Xm(),oq=y1();function aq(){return function(n){let e=sq.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return S1.isTokenDescriptor(r)?S1.isTransformDescriptor(r)?r.multiple?To.instance.resolve(r.transform).transform(To.instance.resolveAll(r.token),...r.transformArgs):To.instance.resolve(r.transform).transform(To.instance.resolve(r.token),...r.transformArgs):r.multiple?To.instance.resolveAll(r.token):To.instance.resolve(r.token):S1.isTransformDescriptor(r)?To.instance.resolve(r.transform).transform(To.instance.resolve(r.token),...r.transformArgs):To.instance.resolve(r)}catch(s){let o=i+t.length;throw new Error(oq.formatErrorCtor(n,o,s))}})))}}}}a(aq,"autoInjectable");w1.default=aq});var bP=v(E1=>{"use strict";Object.defineProperty(E1,"__esModule",{value:!0});var lq=Fl();function cq(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return lq.defineInjectionTokenMetadata(t)}a(cq,"inject");E1.default=cq});var ag=v(v1=>{"use strict";Object.defineProperty(v1,"__esModule",{value:!0});var uq=Fl(),fq=Ea(),SP=Ea();function dq(n){return function(e){fq.typeInfo.set(e,uq.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{SP.instance.register(t,e)}):SP.instance.register(n.token,e))}}a(dq,"injectable");v1.default=dq});var wP=v(T1=>{"use strict";Object.defineProperty(T1,"__esModule",{value:!0});var pq=(Hm(),hm(Wm)),hq=Ea();function mq(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=pq.__rest(t,["token","options"]);return hq.instance.register(r,s,i)}),e}}a(mq,"registry");T1.default=mq});var EP=v(A1=>{"use strict";Object.defineProperty(A1,"__esModule",{value:!0});var gq=ag(),yq=Ea();function _q(){return function(n){gq.default()(n),yq.instance.registerSingleton(n)}}a(_q,"singleton");A1.default=_q});var vP=v(I1=>{"use strict";Object.defineProperty(I1,"__esModule",{value:!0});var bq=Fl();function Sq(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return bq.defineInjectionTokenMetadata(t)}a(Sq,"injectAll");I1.default=Sq});var TP=v(x1=>{"use strict";Object.defineProperty(x1,"__esModule",{value:!0});var wq=Fl();function Eq(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return wq.defineInjectionTokenMetadata(r)}a(Eq,"injectAllWithTransform");x1.default=Eq});var AP=v(R1=>{"use strict";Object.defineProperty(R1,"__esModule",{value:!0});var vq=Fl();function Tq(n,e,...t){return vq.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}a(Tq,"injectWithTransform");R1.default=Tq});var IP=v(C1=>{"use strict";Object.defineProperty(C1,"__esModule",{value:!0});var Aq=ag(),Iq=Ea();function xq(n,e){return function(t){Aq.default()(t),Iq.instance.register(e||t,t,{lifecycle:n})}}a(xq,"scoped");C1.default=xq});var xP=v(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});var Rq=_P();Object.defineProperty(Gi,"autoInjectable",{enumerable:!0,get:a(function(){return Rq.default},"get")});var Cq=bP();Object.defineProperty(Gi,"inject",{enumerable:!0,get:a(function(){return Cq.default},"get")});var Oq=ag();Object.defineProperty(Gi,"injectable",{enumerable:!0,get:a(function(){return Oq.default},"get")});var Pq=wP();Object.defineProperty(Gi,"registry",{enumerable:!0,get:a(function(){return Pq.default},"get")});var Dq=EP();Object.defineProperty(Gi,"singleton",{enumerable:!0,get:a(function(){return Dq.default},"get")});var Fq=vP();Object.defineProperty(Gi,"injectAll",{enumerable:!0,get:a(function(){return Fq.default},"get")});var Lq=TP();Object.defineProperty(Gi,"injectAllWithTransform",{enumerable:!0,get:a(function(){return Lq.default},"get")});var Nq=AP();Object.defineProperty(Gi,"injectWithTransform",{enumerable:!0,get:a(function(){return Nq.default},"get")});var kq=IP();Object.defineProperty(Gi,"scoped",{enumerable:!0,get:a(function(){return kq.default},"get")})});var RP=v(O1=>{"use strict";Object.defineProperty(O1,"__esModule",{value:!0});function Mq(n){let e;return t=>(e==null&&(e=n(t)),e)}a(Mq,"instanceCachingFactory");O1.default=Mq});var CP=v(P1=>{"use strict";Object.defineProperty(P1,"__esModule",{value:!0});function jq(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}a(jq,"instancePerContainerCachingFactory");P1.default=jq});var OP=v(D1=>{"use strict";Object.defineProperty(D1,"__esModule",{value:!0});function $q(n,e,t,r=!0){let i,s;return o=>{let l=n(o);return(!r||s!==l)&&((s=l)?i=o.resolve(e):i=o.resolve(t)),i}}a($q,"predicateAwareClassFactory");D1.default=$q});var PP=v(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var Uq=RP();Object.defineProperty(Dd,"instanceCachingFactory",{enumerable:!0,get:a(function(){return Uq.default},"get")});var Bq=CP();Object.defineProperty(Dd,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return Bq.default},"get")});var Vq=OP();Object.defineProperty(Dd,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return Vq.default},"get")})});var ut=v(va=>{"use strict";Object.defineProperty(va,"__esModule",{value:!0});var F1=(Hm(),hm(Wm));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 qq=fP();Object.defineProperty(va,"Lifecycle",{enumerable:!0,get:a(function(){return qq.Lifecycle},"get")});F1.__exportStar(xP(),va);F1.__exportStar(PP(),va);F1.__exportStar(c1(),va);var Gq=Qm();Object.defineProperty(va,"delay",{enumerable:!0,get:a(function(){return Gq.delay},"get")});var Wq=Ea();Object.defineProperty(va,"container",{enumerable:!0,get:a(function(){return Wq.instance},"get")})});var Fd=v(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.NullLogger=void 0;lg.NullLogger={debug(){},info(){},warn(){},error(){}}});var Vc=v(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.bytesToBase64=FP;Bc.base64ToBytes=LP;Bc.base64ToUtf8=Hq;Bc.utf8ToBase64=zq;var DP=32768;function FP(n){let e="";for(let t=0;t<n.length;t+=DP)e+=String.fromCharCode(...n.subarray(t,t+DP));return btoa(e)}a(FP,"bytesToBase64");function LP(n){let e=n.replace(/\s/g,""),t=e.length%4,r=t===2||t===3?e+"=".repeat(4-t):e,i=atob(r),s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s}a(LP,"base64ToBytes");function Hq(n){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(LP(n))}a(Hq,"base64ToUtf8");function zq(n){return FP(new TextEncoder().encode(n))}a(zq,"utf8ToBase64")});var Ld=v(L1=>{"use strict";Object.defineProperty(L1,"__esModule",{value:!0});L1.iriToObsidianName=Yq;var Kq=Vt();function Yq(n){let e=Kq.Namespace.fromTermIRI(n);if(e)return`${e.namespace.prefix}__${e.localName}`;let t=n.match(/\/([^/]+)\.md$/);return t?t[1]:null}a(Yq,"iriToObsidianName")});var NP=v(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.registerUniversalDefaultLoader=Qq;Ta.clearUniversalDefaultLoader=Xq;Ta.clearUniversalDefault=Jq;Ta.loadUniversalDefault=Zq;Ta.mergePropertyDefaults=eG;Ta.mergeInheritanceRules=tG;var cg=null,Ao,Nd=!1;function Qq(n){cg=n,Ao=void 0,Nd=!1}a(Qq,"registerUniversalDefaultLoader");function Xq(){cg=null,Ao=void 0,Nd=!1}a(Xq,"clearUniversalDefaultLoader");function Jq(){Ao=void 0,Nd=!1}a(Jq,"clearUniversalDefault");async function Zq(){if(Ao!==void 0)return Ao;if(!cg)return Ao=null,null;try{Ao=await cg()??null}catch(n){Nd||(console.warn("[UniversalDefaultTemplateResolver] loader threw, falling back to legacy primitives:",n),Nd=!0),Ao=null}return Ao}a(Zq,"loadUniversalDefault");function eG(n,e){let t=new Map;for(let s of e)t.set(s.propertyName,s);let r=[],i=new Set;for(let s of n){let o=t.get(s.propertyName);o?(r.push(o),i.add(o.propertyName)):r.push(s)}for(let s of e)i.has(s.propertyName)||r.push(s);return r}a(eG,"mergePropertyDefaults");function tG(n,e){let t=new Map;for(let s of e)t.set(s.targetPropertyName,s);let r=[],i=new Set;for(let s of n){let o=t.get(s.targetPropertyName);o?(r.push(o),i.add(o.targetPropertyName)):r.push(s)}for(let s of e)i.has(s.targetPropertyName)||r.push(s);return r}a(tG,"mergeInheritanceRules")});var N1=v((jye,kP)=>{var qc=class{static{a(this,"Wildcard")}constructor(){return rG||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(qc.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(qc.prototype,"termType",{enumerable:!0,value:"Wildcard"});var rG=new qc;kP.exports.Wildcard=qc});var jP=v((Uye,MP)=>{var nG=(function(){var n=a(function(Y,W,Z,le){for(Z=Z||{},le=Y.length;le--;Z[Y[le]]=W);return Z},"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],r=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],o=[1,27],l=[13,16,45,197,224,229,308],c=[28,29,53],u=[28,53],f=[1,42],d=[1,45],p=[1,41],h=[1,44],_=[123,126],y=[1,67],b=[39,45,87],S=[13,16,45,197,224,308],I=[1,87],O=[2,281],T=[1,86],E=[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],M=[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],j=[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],$=[13,16,308],G=[112,132,327,334],ge=[13,16,112,132,308],ye=[1,111],Q=[1,117],se=[112,132,327,328,334],J=[13,16,112,132,308,328],ve=[28,29,45,53,87],re=[1,138],ie=[1,151],he=[1,128],Ue=[1,127],ce=[1,129],ue=[1,140],fe=[1,141],ne=[1,142],me=[1,143],Le=[1,144],B=[1,145],oe=[1,147],Ee=[1,148],Ce=[2,457],xe=[1,158],Oe=[1,159],Re=[1,160],Ae=[1,152],ee=[1,153],_e=[1,156],Te=[1,171],Pe=[1,172],Me=[1,173],Ne=[1,174],Ge=[1,175],ke=[1,176],We=[1,167],qe=[1,168],je=[1,169],He=[1,170],m=[1,157],L=[1,166],U=[1,161],R=[1,162],C=[1,163],D=[1,164],w=[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],H=[6,31,73,81,83,85],q=[2,285],k=[1,199],N=[1,201],z=[6,31,70,73,81,83,85],K=[2,283],ae=[1,207],Se=[1,218],De=[1,223],rt=[1,219],Jr=[1,225],Cr=[1,226],sr=[1,224],aC=[6,63,70,73,81,83,85],lC=[1,236],cC=[2,334],uC=[1,243],fC=[1,241],Zr=[6,193],Wh=[2,349],dC=[2,339],ya=[28,128],pC=[47,48,193,272],Hh=[47,48,193,242,272],Rc=[47,48,193,242,246,272],Cc=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],$r=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],hC=[1,271],mC=[1,270],hr=[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],gC=[1,281],yC=[1,280],Cn=[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],td=[45,89],zh=[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],Kh=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Yh=[31,89],Qh=[48,87],ml=[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],xs=[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],_C=[1,313],Oc=[6,85],bS=[6,31,81,83,85],bC=[2,361],fo=[2,353],gl=[1,343],rd=[31,112,335],po=[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],SS=[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],SC=[6,109,193],yl=[31,112],mr=[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],wS=[1,390],ES=[1,391],_a=[13,16,87,197,308,314],wC=[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],Xh=[1,417],Jh=[1,418],EC=[13,16,48,197,229,308],ba=[6,31,85],vC=[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],vS=[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],_l=[29,31,85,112,159,160,161,163,164],Zh=[1,443],em=[1,444],TC=[1,449],bl=[31,112,193,232,318,335],tm=[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],AC=[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],TS=[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],nd=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],id=[31,45],IC=[1,507],xC=[1,508],RC=[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],rm=[29,31,85,112,159,160,161,163,164,335],Sl=[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],CC=[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],OC=[2,352],AS=[13,16,197,308,314],PC=[1,565],Pc=[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],DC=[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],ho=[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],FC=[13,16,87,308],mo=[2,364],Dc=[29,31,85,112,159,160,161,163,164,193,232,318,335],nm=[31,112,193,232,272,318,335],go=[2,359],LC=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],im=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],NC=[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],kC=[2,347],IS={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(W,Z,le,Be,it,A,Pn){var x=A.length-1;switch(it){case 1:if(A[x-1]=A[x-1]||{},ot.base&&(A[x-1].base=ot.base),ot.base="",A[x-1].prefixes=ot.prefixes,ot.prefixes=null,ot.pathOnly){if(A[x-1].type==="path"||"termType"in A[x-1])return A[x-1];throw new Error("Received full SPARQL query in path only mode")}else if(A[x-1].type==="path"||"termType"in A[x-1])throw new Error("Received only path in full SPARQL mode");if(A[x-1].type==="update"){let Nt={};for(let Kt of A[x-1].updates)if(Kt.updateType==="insert"){let bt={};for(let Rt of Kt.insert)if(Rt.type==="bgp"||Rt.type==="graph")for(let zn of Rt.triples)zn.subject.termType==="BlankNode"&&(bt[zn.subject.value]=!0),zn.predicate.termType==="BlankNode"&&(bt[zn.predicate.value]=!0),zn.object.termType==="BlankNode"&&(bt[zn.object.value]=!0);for(let Rt of Object.keys(bt)){if(Nt[Rt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");Nt[Rt]=!0}}}return A[x-1];case 2:this.$={...A[x-1],...A[x],type:"query"};break;case 4:ot.base=sd(A[x]);break;case 5:ot.prefixes||(ot.prefixes={}),A[x-1]=A[x-1].substr(0,A[x-1].length-1),A[x]=sd(A[x]),ot.prefixes[A[x-1]]=A[x];break;case 6:this.$={...A[x-3],...vl(A[x-2]),...A[x-1],...A[x]};break;case 7:if(!ot.skipValidation&&(LS(A[x-3].variables.map(Kt=>FS(Kt.expression))).some(Kt=>Kt.aggregation==="count"&&!(Kt.expression instanceof sm))||A[x].group)){for(let Kt of A[x-3].variables)if(Kt.termType==="Variable"){if(!A[x].group||!A[x].group.map(bt=>kc(bt)).includes(kc(Kt)))throw Error("Projection of ungrouped variable (?"+kc(Kt)+")")}else if(FS(Kt.expression).length===0){let bt=EB(Kt.expression);for(let Rt of bt)if(!A[x].group||!A[x].group.map||!A[x].group.map(zn=>kc(zn)).includes(kc(Rt)))throw Error("Use of ungrouped variable in projection of operation (?"+kc(Rt)+")")}}let Ps=A[x-1].where.filter(Nt=>Nt.type==="query");if(Ps.length>0){let Nt=A[x-3].variables.filter(bt=>bt.variable&&bt.variable.value).map(bt=>bt.variable.value),Kt=LS(Ps.map(bt=>bt.variables)).map(bt=>bt.value||bt.variable.value);for(let bt of Nt)if(Kt.indexOf(bt)>=0)throw Error("Target id of 'AS' (?"+bt+") already used in subquery")}this.$=or(A[x-3],vl(A[x-2]),A[x-1],A[x]);break;case 8:this.$=or({queryType:"CONSTRUCT",template:A[x-3]},vl(A[x-2]),A[x-1],A[x]);break;case 9:this.$=or({queryType:"CONSTRUCT",template:A[x-2]=A[x-2]?A[x-2].triples:[]},vl(A[x-5]),{where:[{type:"bgp",triples:El([],A[x-2])}]},A[x]);break;case 10:this.$=or({queryType:"DESCRIBE",variables:A[x-3]==="*"?[new sm]:A[x-3]},vl(A[x-2]),A[x-1],A[x]);break;case 11:this.$=or({queryType:"ASK"},vl(A[x-2]),A[x-1],A[x]);break;case 12:this.$=or(A[x-1],{variables:[new sm]});break;case 13:let ud=A[x].map(Nt=>Nt.value||Nt.variable.value),Mc=vB(ud);if(Mc.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Mc[0]+")");this.$=or(A[x-1],{variables:A[x]});break;case 14:this.$=or({queryType:"SELECT"},A[x]&&(A[x-1]=On(A[x]),A[x]={},A[x][A[x-1]]=!0,A[x]));break;case 16:case 27:this.$=Fc(A[x-3],{variable:A[x-1]});break;case 17:case 18:this.$=or(A[x-3],A[x-2],A[x-1],A[x],{type:"query"});break;case 19:case 58:this.$={iri:A[x],named:!!A[x-1]};break;case 20:this.$={where:A[x].patterns};break;case 21:this.$=or(A[x-1],A[x]);break;case 22:this.$=or(A[x-2],A[x-1],A[x]);break;case 23:this.$={group:A[x]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Fc(A[x]);break;case 26:this.$=Fc(A[x-1]);break;case 29:this.$={having:A[x]};break;case 30:this.$={order:A[x]};break;case 32:this.$=Fc(A[x],{descending:!0});break;case 35:this.$={limit:Nc(A[x])};break;case 36:this.$={offset:Nc(A[x])};break;case 37:this.$={limit:Nc(A[x-2]),offset:Nc(A[x])};break;case 38:this.$={limit:Nc(A[x]),offset:Nc(A[x-2])};break;case 39:case 43:this.$={type:"values",values:A[x]};break;case 40:case 84:this.$=A[x-1].map(Nt=>({[A[x-3]]:Nt}));break;case 41:case 85:this.$=A[x-1].map(()=>({}));break;case 42:case 86:var Os=A[x-4].length;A[x-4]=A[x-4].map(xS),this.$=A[x-1].map(function(Nt){if(Nt.length!==Os)throw Error("Inconsistent VALUES length");for(var Kt={},bt=0;bt<Os;bt++)Kt["?"+A[x-4][bt].value]=Nt[bt];return Kt});break;case 44:case 65:case 100:case 126:case 175:this.$=A[x-1];break;case 45:this.$={type:"update",updates:yo(A[x-2],A[x-1])};break;case 46:this.$=or({type:"load",silent:!!A[x-2],source:A[x-1]},A[x]&&{destination:A[x]});break;case 47:this.$={type:On(A[x-2]),silent:!!A[x-1],graph:A[x]};break;case 48:this.$={type:On(A[x-4]),silent:!!A[x-3],source:A[x-2],destination:A[x]};break;case 49:this.$={type:"create",silent:!!A[x-2],graph:{type:"graph",name:A[x]}};break;case 50:this.$={updateType:"insert",insert:zC(A[x])};break;case 51:this.$={updateType:"delete",delete:MS(zC(A[x]))};break;case 52:this.$={updateType:"deletewhere",delete:MS(A[x])};break;case 53:this.$={updateType:"insertdelete",...A[x-4],...A[x-3],...vl(A[x-2],"using"),where:A[x].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=A[x];break;case 55:this.$={delete:MS(A[x-1]),insert:A[x]||[]};break;case 56:this.$={delete:[],insert:A[x]};break;case 59:this.$={graph:A[x]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:A[x]};break;case 64:this.$={[On(A[x])]:!0};break;case 66:this.$=A[x-1]?Rs(A[x],[A[x-1]]):Rs(A[x]);break;case 67:var ld=or(A[x-3]||{triples:[]},{type:"graph",name:A[x-5]});this.$=A[x]?[ld,A[x]]:[ld];break;case 68:case 73:this.$={type:"bgp",triples:Rs(A[x-2],[A[x-1]])};break;case 69:this.$={type:"group",patterns:[A[x-1]]};break;case 70:for(let Nt of A[x-1].filter(Kt=>Kt.type==="bind")){let Kt=A[x-1].indexOf(Nt),bt=new Set;for(let Rt of A[x-1].slice(0,Kt))(Rt.type==="group"||Rt.type==="bgp")&&WC(Rt).forEach(zn=>bt.add(zn));if(bt.has(Nt.variable.value))throw Error("Variable used to bind is already bound (?"+Nt.variable.value+")")}this.$={type:"group",patterns:A[x-1]};break;case 71:this.$=A[x-1]?Rs([A[x-1]],A[x]):Rs(A[x]);break;case 72:this.$=A[x]?[A[x-2],A[x]]:A[x-2];break;case 75:this.$=or(A[x],{type:"optional"});break;case 76:this.$=or(A[x],{type:"minus"});break;case 77:this.$=or(A[x],{type:"graph",name:A[x-1]});break;case 78:this.$=or(A[x],{type:"service",name:A[x-1],silent:!!A[x-2]});break;case 79:this.$={type:"filter",expression:A[x]};break;case 80:this.$={type:"bind",variable:A[x-1],expression:A[x-3]};break;case 89:this.$=ad(A[x]);break;case 90:this.$=void 0;break;case 91:this.$=A[x-1].length?{type:"union",patterns:Rs(A[x-1].map(CS),[CS(A[x])])}:A[x];break;case 95:this.$={...A[x],function:A[x-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:yo(A[x-2],A[x-1]),distinct:!!A[x-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.$=yo(A[x-2],A[x-1]);break;case 101:this.$=Rs(A[x-2],[A[x-1]]);break;case 102:case 112:this.$=kS(A[x].map(Nt=>or(_o(A[x-1]),Nt)));break;case 103:this.$=kS(El(A[x].map(Nt=>or(_o(A[x-1].entity),Nt)),A[x-1].triples));break;case 105:this.$=Rs([A[x-1]],A[x]);break;case 106:this.$=Rs(A[x]);break;case 107:this.$=DS(A[x-1],A[x]);break;case 109:case 237:this.$=ot.factory.namedNode(dB);break;case 110:case 118:this.$=yo(A[x-1],A[x]);break;case 111:this.$=A[x]?{annotation:A[x],object:A[x-1]}:A[x-1];break;case 113:this.$=A[x]?kS(El(A[x].map(Nt=>or(_o(A[x-1].entity),Nt)),A[x-1].triples)):A[x-1].triples;break;case 114:this.$=DS(...A[x-1],A[x]);break;case 116:this.$=DS(...A[x]);break;case 117:case 159:case 163:this.$=[A[x-1],A[x]];break;case 119:this.$=A[x]?{object:A[x-1],annotation:A[x]}:A[x-1];break;case 120:this.$=A[x-1].length?Lc("|",yo(A[x-1],A[x])):A[x];break;case 121:this.$=A[x-1].length?Lc("/",yo(A[x-1],A[x])):A[x];break;case 122:this.$=A[x]?Lc(A[x],[A[x-1]]):A[x-1];break;case 123:this.$=A[x-1]?Lc(A[x-1],[A[x]]):A[x];break;case 125:case 131:this.$=Lc(A[x-1],[A[x]]);break;case 129:this.$=Lc("|",yo(A[x-2],A[x-1]));break;case 132:case 134:this.$=SB(A[x-1]);break;case 133:case 135:this.$=wB(A[x-1]);break;case 140:this.$={entity:A[x],triples:[]};break;case 145:this.$=xS(A[x]);break;case 149:this.$=ot.factory.namedNode(MC);break;case 151:case 153:case 158:case 162:this.$=RS(A[x-1],A[x]);break;case 152:this.$=["||",A[x]];break;case 154:this.$=["&&",A[x]];break;case 156:this.$=en(A[x-1],[A[x-2],A[x]]);break;case 157:this.$=en(A[x-2]?"notin":"in",[A[x-3],A[x]]);break;case 160:this.$=["+",RS(A[x-1],A[x])];break;case 161:var lm=Cs(A[x-1].value.replace("-",""),A[x-1].datatype);this.$=["-",RS(lm,A[x])];break;case 164:this.$=en("UPLUS",[A[x]]);break;case 165:this.$=en(A[x-1],[A[x]]);break;case 166:this.$=en("UMINUS",[A[x]]);break;case 177:this.$=en(On(A[x-1]));break;case 178:this.$=en(On(A[x-3]),[A[x-1]]);break;case 179:this.$=ad(en(On(A[x-3]),[A[x-1]]));break;case 180:this.$=en(On(A[x-5]),[A[x-3],A[x-1]]);break;case 181:this.$=en(On(A[x-7]),[A[x-5],A[x-3],A[x-1]]);break;case 182:this.$=ad(en(On(A[x-7]),[A[x-5],A[x-3],A[x-1]]));break;case 183:this.$=en(On(A[x-1]),A[x]);break;case 184:this.$=en("bound",[xS(A[x-1])]);break;case 185:this.$=en(A[x-1],[]);break;case 186:this.$=en(A[x-3],[A[x-1]]);break;case 187:this.$=en(A[x-2]?"notexists":"exists",[CS(A[x])]);break;case 188:case 189:this.$=Fc(A[x-1],{type:"aggregate",aggregation:On(A[x-4]),distinct:!!A[x-2]});break;case 190:this.$=Fc(A[x-2],{type:"aggregate",aggregation:On(A[x-5]),distinct:!!A[x-3],separator:typeof A[x-1]=="string"?A[x-1]:" "});break;case 192:this.$=Cs(A[x]);break;case 193:this.$=gB(A[x-1],On(A[x].substr(1)));break;case 194:this.$=Cs(A[x-2],A[x]);break;case 195:case 204:this.$=Cs(A[x],jC);break;case 196:case 205:this.$=Cs(A[x],$C);break;case 197:case 206:this.$=Cs(On(A[x]),UC);break;case 200:this.$=Cs(A[x].toLowerCase(),mB);break;case 201:this.$=Cs(A[x].substr(1),jC);break;case 202:this.$=Cs(A[x].substr(1),$C);break;case 203:this.$=Cs(A[x].substr(1).toLowerCase(),UC);break;case 207:case 208:this.$=GC(A[x],1);break;case 209:case 210:this.$=GC(A[x],3);break;case 211:this.$=ot.factory.namedNode(sd(A[x]));break;case 213:var cm=A[x].indexOf(":"),cd=A[x].substr(0,cm),um=ot.prefixes[cd];if(!um)throw new Error("Unknown prefix: "+cd);var Zt=sd(um+A[x].substr(cm+1));this.$=ot.factory.namedNode(Zt);break;case 214:if(A[x]=A[x].substr(0,A[x].length-1),!(A[x]in ot.prefixes))throw new Error("Unknown prefix: "+A[x]);var Zt=sd(ot.prefixes[A[x]]);this.$=ot.factory.namedNode(Zt);break;case 215:this.$=od(A[x].replace(/^(_:)/,""));break;case 216:this.$=od();break;case 217:case 218:case 232:this.$=ad(OS(A[x-3],A[x-2],A[x-1]));break;case 230:case 231:this.$=ad(A[x-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:A[x-1].push(A[x]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[A[x]];break;case 308:A[x-3].push(A[x-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:A[x-2].push(A[x-1]);break}},"anonymous"),table:[n(e,t,{3:1,4:2,10:3}),{1:[3]},n(r,[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}),n([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]},n(l,[2,411],{216:28,217:29}),n(c,[2,249],{18:30}),n(c,[2,251],{22:31}),n(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},n(c,[2,267],{37:46}),n(_,[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},n(b,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),n(e,[2,248]),n(e,[2,245]),n(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]},n([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]}),n(S,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:I,29:O,52:84,53:T,56:85},{19:88,28:I,29:O,52:89,53:T,56:85},n(c,[2,253],{26:90}),{28:[1,91],52:92,53:T},n(E,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(P,[2,263],{34:96}),n(P,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:p,308:h}),n(P,[2,262]),n(V,[2,259]),n(M,[2,143]),n(M,[2,144]),n([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]),n(j,[2,211]),n(j,[2,212]),n(j,[2,213]),n(j,[2,214]),{19:98,28:I,29:O,52:99,53:T,56:85},{6:[2,309],99:100,193:[1,101]},n($,[2,311],{101:102,328:[1,103]}),n(G,[2,317],{104:104,328:[1,105]}),n(ge,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:ye,114:110},{29:ye,114:112},{29:ye,114:113},{118:114,123:[1,115],125:116,126:Q},n(se,[2,315]),n(se,[2,316]),n(J,[2,319]),n(J,[2,320]),n(J,[2,321]),n(_,[2,327]),{13:f,16:d,55:118,307:43,308:h},n(c,[2,12]),n(c,[2,13],{44:66,43:119,45:y,87:p}),n(ve,[2,269]),n(ve,[2,15]),{13:f,16:d,44:136,45:re,46:120,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(b,[2,14]),n(b,[2,274]),n(b,[2,271]),n(b,[2,272]),n(e,[2,4]),{13:[1,177]},n(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},n(l,[2,410]),n([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},n(S,[2,419]),n(H,q,{20:196,59:197,69:198,70:k}),n(c,[2,250]),{29:N,57:200},n($,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(z,K,{23:204,58:205,62:206,63:ae}),n(c,[2,252]),{19:208,28:I,29:O,52:209,53:T,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:Se,55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(aC,[2,265],{56:85,35:227,52:228,19:229,28:I,29:O,53:T}),n(V,[2,260]),n(z,K,{58:205,62:206,23:230,63:ae}),n(c,[2,268]),{6:[2,45]},n(e,t,{10:3,4:231}),{13:f,16:d,55:232,307:43,308:h},n($,[2,312]),{105:233,112:lC,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(G,[2,318]),n($,cC,{108:240,133:242,112:uC,132:fC}),n(ge,[2,323]),{112:[1,244]},{112:[2,325]},n(Zr,[2,50]),n(E,Wh,{135:245,136:246,143:247,144:248,31:dC,112:dC}),n(Zr,[2,51]),n(Zr,[2,52]),n(ya,[2,328],{119:249}),{29:ye,114:250},n(ya,[2,56]),{29:ye,114:251},n(_,[2,59]),n(ve,[2,270]),{47:[1,252]},n(pC,[2,150]),n(Hh,[2,428],{240:253}),n(Rc,[2,430],{244:254}),n(Rc,[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]}),n(Cc,[2,440],{252:264}),n($r,[2,448],{260:265}),{13:f,16:d,44:136,45:re,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,255:154,257:155,264:266,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,255:154,257:155,264:267,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,255:154,257:155,264:268,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n($r,[2,167]),n($r,[2,168]),n($r,[2,169]),n($r,[2,170],{176:269,45:hC,89:mC}),n($r,[2,171]),n($r,[2,172]),n($r,[2,173]),n($r,[2,174]),{13:f,16:d,44:136,45:re,46:272,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(hr,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:gC,89:yC,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(Cn,[2,192],{292:[1,286],293:[1,287]}),n(Cn,[2,195]),n(Cn,[2,196]),n(Cn,[2,197]),n(Cn,[2,198]),n(Cn,[2,199]),n(Cn,[2,200]),{13:f,16:d,44:39,55:40,82:ie,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(td,[2,452]),n(td,[2,453]),n(td,[2,454]),n(td,[2,455]),n(td,[2,456]),{279:[2,458]},n(zh,[2,207]),n(zh,[2,208]),n(zh,[2,209]),n(zh,[2,210]),n(Cn,[2,201]),n(Cn,[2,202]),n(Cn,[2,203]),n(Cn,[2,204]),n(Cn,[2,205]),n(Cn,[2,206]),n(e,[2,5]),n(Kh,[2,297],{88:295}),n(Yh,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(Qh,[2,301]),n(F,[2,43]),n(F,[2,82]),n(F,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(l,[2,412]),n(ml,[2,123]),n(ml,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(xs,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:X,223:312,225:308,226:309,229:_C,307:43,308:h},n(l,i,{215:10,214:314}),n(xs,[2,236]),n(xs,[2,237]),n(Oc,[2,6]),n(bS,[2,287],{60:315,72:316,73:[1,317]}),n(H,[2,286]),{13:f,16:d,45:re,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:w},n([6,31,63,70,73,81,83,85],[2,20]),n(E,bC,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:fo,31:fo,85:fo,112:fo,159:fo,160:fo,161:fo,163:fo,164:fo,41:s}),{13:f,16:d,55:331,307:43,308:h},n($,[2,280]),n(Oc,[2,7]),n(H,q,{59:197,69:198,20:332,70:k}),n(z,[2,284]),{64:[1,333]},n(z,K,{58:205,62:206,23:334,63:ae}),n(c,[2,254]),n(E,Wh,{144:248,30:335,143:336,31:[2,257]}),n(c,[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:gl,307:43,308:h},n(rd,[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:gl,308:h}),n(po,[2,227]),n(po,[2,228]),n(po,[2,229]),{13:f,16:d,44:215,45:Se,55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},{13:f,16:d,44:39,55:40,87:p,139:342,186:352,190:340,195:341,197:gl,307:43,308:h},n(po,[2,146]),n(po,[2,147]),n(po,[2,148]),n(po,[2,149]),{13:f,16:d,44:354,55:355,82:ie,87:p,172:357,237:356,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:358,312:sr,313:353},n(SS,[2,215]),n(SS,[2,216]),n(z,K,{58:205,62:206,23:359,63:ae}),n(P,[2,264]),n(aC,[2,266]),n(Oc,[2,11]),n(r,[2,308],{6:[2,310]}),n(Zr,[2,313],{102:360,120:361,121:[1,362]}),n(Zr,[2,47]),n(Zr,[2,63]),n(Zr,[2,64]),{13:f,16:d,55:363,307:43,308:h},n(Zr,[2,336]),n(Zr,[2,337]),n(Zr,[2,338]),{109:[1,364]},n(SC,[2,60]),{13:f,16:d,55:365,307:43,308:h},n($,[2,335]),{13:f,16:d,55:366,307:43,308:h},{31:[1,367]},n(yl,[2,341],{137:368}),n(yl,[2,340]),{13:f,16:d,44:215,45:Se,55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},{28:[1,370],127:371,128:[1,372]},n(ya,[2,330],{124:373,125:374,126:Q}),n(ya,[2,57]),{44:375,87:p},n(pC,[2,151],{241:376,242:[1,377]}),n(Hh,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:re,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,247:380,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{250:[1,381]},n(mr,[2,432]),n(mr,[2,433]),n(mr,[2,434]),n(mr,[2,435]),n(mr,[2,436]),n(mr,[2,437]),{250:[2,439]},n([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:Pe,299:Me,300:Ne,301:Ge,302:ke}),n(Cc,[2,162],{261:388,262:389,39:wS,338:ES}),n($r,[2,164]),n($r,[2,165]),n($r,[2,166]),n(hr,[2,95]),n(hr,[2,96]),n(mr,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(hr,[2,177]),{13:f,16:d,44:136,45:re,46:395,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,46:396,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,46:397,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,46:398,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,46:399,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(hr,[2,183]),n(hr,[2,98]),n(mr,[2,381],{180:400}),{87:[1,401]},n(hr,[2,185]),{13:f,16:d,44:136,45:re,46:402,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{29:N,57:403},n(Cn,[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:gl,307:43,308:h},n(_a,[2,233]),n(_a,[2,234]),n(_a,[2,235]),n(wC,[2,459],{281:406,325:[1,407]}),n(mr,[2,463],{284:408,325:[1,409]}),n(mr,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:ie,171:413,172:415,173:416,174:Xh,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:Jh},{31:[1,419],89:[1,420]},{29:[1,421]},n(Qh,[2,302]),n(Kh,[2,367],{167:422}),n(Yh,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(Qh,[2,371]),n(ml,[2,122]),n(ml,[2,417]),n(ml,[2,413]),n(ml,[2,414]),n(ml,[2,415]),n(xs,[2,125]),n(xs,[2,127]),n(xs,[2,128]),n(EC,[2,420],{227:426}),n(xs,[2,130]),{13:f,16:d,55:194,197:X,223:427,307:43,308:h},{48:[1,428]},n(ba,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(bS,[2,288]),{64:[1,433]},n(H,[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:re,268:ue,269:fe,270:ne,271:me,273:Le,274:B,276:oe,277:Ee,279:Ce,280:xe,283:Oe,285:Re,308:h,346:L,347:U,348:R,349:C,350:D,351:w}),n(vC,[2,293]),n(vS,[2,92]),n(vS,[2,93]),n(vS,[2,94]),{45:hC,89:mC,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:I,29:O,56:85},{19:438,28:I,29:O,56:85},n(_l,[2,355],{149:439}),n(_l,[2,354]),{13:f,16:d,44:215,45:Zh,55:220,82:ie,87:p,89:De,156:440,172:221,185:441,203:442,231:em,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(P,[2,19]),n(ba,[2,21]),{13:f,16:d,44:450,45:TC,55:323,65:445,66:446,67:447,68:448,87:p,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:w},n(Oc,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(E,[2,386],{31:[2,388]}),n(rd,[2,102]),n(bl,[2,391],{191:452}),n(E,[2,395],{196:453,198:454}),n(E,[2,108]),n(E,[2,109]),n(rd,[2,103]),n(rd,[2,104]),n(rd,[2,390]),{13:f,16:d,44:215,45:Se,48:[1,455],55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(tm,[2,424]),n(AC,[2,136]),n(AC,[2,137]),n(TS,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:p,139:342,195:458,197:gl,307:43,308:h},n(_a,[2,219]),n(_a,[2,220]),n(_a,[2,221]),n(_a,[2,222]),n(_a,[2,223]),n(Oc,[2,10]),n(Zr,[2,46]),n(Zr,[2,314]),{112:lC,122:459},n(Zr,[2,62]),n($,cC,{133:242,108:460,112:uC,132:fC}),n(SC,[2,61]),n(Zr,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(yl,[2,351],{146:463,335:[1,464]}),{29:N,57:465},n(ya,[2,329]),n($,[2,332],{129:466,327:[1,467]}),n(ya,[2,55]),n(ya,[2,331]),{48:[1,468]},n(Hh,[2,429]),{13:f,16:d,44:136,45:re,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(Rc,[2,431]),{13:f,16:d,44:136,45:re,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,243:470,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(Rc,[2,156]),{45:gC,89:yC,179:471},n(Cc,[2,441]),{13:f,16:d,44:136,45:re,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,251:472,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n($r,[2,444],{256:473}),n($r,[2,446],{258:474}),n(mr,[2,442]),n(mr,[2,443]),n($r,[2,449]),{13:f,16:d,44:136,45:re,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,255:154,257:155,259:475,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(mr,[2,450]),n(mr,[2,451]),n(mr,[2,379],{178:476}),n(mr,[2,378]),n([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:re,46:482,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{48:[1,483]},{48:[1,484]},n(hr,[2,187]),n(Cn,[2,194]),{13:f,16:d,44:39,55:40,82:ie,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,320:485},{13:f,16:d,39:[1,487],44:136,45:re,46:488,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,282:486,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(wC,[2,460]),{13:f,16:d,44:136,45:re,46:489,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(mr,[2,464]),{13:f,16:d,44:136,45:re,46:490,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(mr,[2,466]),n(F,[2,40]),n(Kh,[2,298]),n(nd,[2,87]),n(nd,[2,88]),n(nd,[2,89]),n(nd,[2,90]),{13:f,16:d,55:492,82:ie,172:493,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,311:494,312:sr,315:491},n(F,[2,41]),n(Yh,[2,300]),n(id,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:ie,171:497,172:415,173:416,174:Xh,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:Jh},{31:[1,498],89:[1,499]},{29:[1,500]},n(Qh,[2,372]),{13:f,16:d,48:[2,422],55:194,197:X,223:312,226:502,228:501,229:_C,307:43,308:h},n(xs,[2,131]),n(xs,[2,126]),n(ba,[2,22]),n(ba,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:re,55:323,67:321,68:322,74:505,75:506,76:IC,77:320,78:xC,79:509,87:p,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:w},n(vC,[2,294]),n(RC,[2,69]),n(RC,[2,70]),n(H,q,{59:197,69:198,20:511,70:k}),n(z,K,{58:205,62:206,23:512,63:ae}),{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},n(_l,[2,363],{157:524,335:[1,525]}),n(l,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:p}),n(rm,[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:Zh,55:220,82:ie,87:p,89:De,172:221,185:351,203:536,212:534,231:em,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(l,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:p}),n(z,[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:TC,87:p,268:ue,269:fe,270:ne,271:me,273:Le,274:B,276:oe,277:Ee,279:Ce,280:xe,283:Oe,285:Re,308:h,346:L,347:U,348:R,349:C,350:D,351:w}),n(Sl,[2,291]),n(Sl,[2,24]),n(Sl,[2,25]),{13:f,16:d,44:136,45:re,46:539,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(Sl,[2,28]),n(z,K,{58:205,62:206,23:540,63:ae}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(bl,[2,107]),{13:f,16:d,44:215,45:Se,55:220,82:ie,87:p,89:De,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:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(CC,[2,132]),n(tm,[2,425]),n(CC,[2,133]),{13:f,16:d,44:354,55:355,82:ie,87:p,172:357,237:356,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:358,312:sr,313:545},n(Zr,[2,54]),n(Zr,[2,48]),n(yl,[2,342]),{13:f,16:d,44:39,55:40,87:p,139:546,307:43,308:h},n(yl,[2,68]),n(E,[2,350],{31:OC,112:OC}),n(Zr,[2,53]),{13:f,16:d,55:547,307:43,308:h},n($,[2,333]),n(ve,[2,16]),n(Hh,[2,152]),n(Rc,[2,154]),n(Rc,[2,157]),n(Cc,[2,159]),n(Cc,[2,160],{262:389,261:548,39:wS,338:ES}),n(Cc,[2,161],{262:389,261:549,39:wS,338:ES}),n($r,[2,163]),{13:f,16:d,44:136,45:re,46:550,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(hr,[2,178]),n(hr,[2,179]),{13:f,16:d,44:136,45:re,46:551,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,46:552,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,46:553,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{48:[1,554],272:[1,555]},n(hr,[2,184]),n(hr,[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},n(AS,[2,224]),n(AS,[2,225]),n(AS,[2,226]),{31:[1,563],45:PC,94:564},n(F,[2,84]),n(Kh,[2,368]),n(F,[2,85]),n(Yh,[2,370]),n(id,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(ba,[2,35],{83:[1,569]}),n(ba,[2,36],{81:[1,570]}),n(bS,[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:re,76:IC,78:xC,87:p,268:ue,269:fe,270:ne,271:me,273:Le,274:B,276:oe,277:Ee,279:Ce,280:xe,283:Oe,285:Re,308:h,346:L,347:U,348:R,349:C,350:D,351:w}),n(Pc,[2,295]),{45:re,77:572},{45:re,77:573},n(Pc,[2,33]),n(Pc,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},n(_l,[2,356]),n(DC,[2,357],{152:578,335:[1,579]}),n(ho,[2,74]),{29:N,57:580},{29:N,57:581},{13:f,16:d,44:39,55:40,87:p,139:582,307:43,308:h},n(FC,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:re,55:323,67:321,68:322,77:320,79:585,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,307:43,308:h,346:L,347:U,348:R,349:C,350:D,351:w},{45:[1,586]},n(ho,[2,81]),{29:N,57:587},n(_l,[2,73]),n(E,[2,362],{29:mo,31:mo,85:mo,112:mo,159:mo,160:mo,161:mo,163:mo,164:mo}),n(rm,[2,112]),n(Dc,[2,401],{206:588}),n(E,[2,405],{209:589,210:590}),n(E,[2,403]),n(E,[2,404]),n(rm,[2,113]),n(rm,[2,400]),{13:f,16:d,44:215,45:Zh,48:[1,591],55:220,82:ie,87:p,89:De,172:221,185:351,203:536,212:592,231:em,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(tm,[2,426]),n(TS,[2,138]),n(TS,[2,139]),{232:[1,593]},n(Sl,[2,292]),{47:[1,595],48:[1,594]},n(Oc,[2,9]),n(bl,[2,392]),n(bl,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:p,197:gl,308:h}),n(bl,[2,110],{272:[1,598]}),n(nm,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(ya,[2,58]),n($r,[2,445]),n($r,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(hr,[2,99]),n(mr,[2,382]),n([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]),n(hr,[2,188]),n(hr,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:ie,172:493,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,311:494,312:sr,315:611},n(F,[2,42]),n(id,[2,304]),{13:f,16:d,55:414,82:ie,95:612,171:613,172:415,173:416,174:Xh,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:Jh},{31:[1,614],45:PC,94:615},n(xs,[2,129]),n(EC,[2,421]),{82:[1,616]},{82:[1,617]},n(Pc,[2,296]),n(Pc,[2,31]),n(Pc,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(E,bC,{155:330,153:618,154:619,29:go,31:go,85:go,112:go,159:go,160:go,161:go,163:go,164:go}),n(DC,[2,358]),n(ho,[2,75]),n(ho,[2,76]),{29:N,57:620},{13:f,16:d,44:39,55:40,87:p,139:621,307:43,308:h},n(FC,[2,366]),n(ho,[2,79]),{13:f,16:d,44:136,45:re,46:622,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(ho,[2,91],{336:[1,623]}),n([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),n(Dc,[2,117]),{13:f,16:d,44:215,45:Zh,55:220,82:ie,87:p,89:De,172:221,185:351,203:536,211:626,212:627,231:em,234:535,236:216,237:222,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,309:Jr,310:Cr,311:217,312:sr},n(po,[2,134]),n(tm,[2,427]),n(po,[2,135]),n(Sl,[2,26]),{44:628,87:p},n(bl,[2,106]),n(bl,[2,394]),n(E,[2,396]),n(nm,[2,111]),n(nm,[2,398]),{13:f,16:d,44:39,55:40,87:p,139:342,186:629,190:340,195:341,197:gl,307:43,308:h},n(SS,[2,217]),n(E,Wh,{144:248,140:630,143:631,31:[2,343]}),n(hr,[2,97]),n(mr,[2,380]),n(hr,[2,180]),{13:f,16:d,44:136,45:re,46:632,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},{13:f,16:d,44:136,45:re,46:633,55:133,67:132,68:134,77:131,82:ie,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:Ue,264:130,265:ce,266:137,267:139,268:ue,269:fe,270:ne,271:me,273:Le,274:B,275:146,276:oe,277:Ee,278:149,279:Ce,280:xe,283:Oe,285:Re,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:m,346:L,347:U,348:R,349:C,350:D,351:w},n(hr,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:ie,171:637,172:415,173:416,174:Xh,255:154,257:155,291:150,294:Ae,295:ee,296:_e,297:Te,298:Pe,299:Me,300:Ne,301:Ge,302:ke,303:We,304:qe,305:je,306:He,307:43,308:h,312:Jh},n(LC,[2,305]),n(F,[2,86]),n(id,[2,374]),n(ba,[2,37]),n(ba,[2,38]),n(_l,[2,72]),n(_l,[2,360]),n(ho,[2,77]),{29:N,57:638},{47:[1,639]},{29:[2,376]},n(Dc,[2,402]),n(Dc,[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}),n(Dc,[2,118],{272:[1,641]}),n(im,[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:qe,305:je,306:He},n(nd,[2,218]),n(id,[2,44]),n(LC,[2,306]),n(ho,[2,78]),{44:651,87:p},n(Dc,[2,116]),n(E,[2,406]),n(im,[2,119]),n(im,[2,408]),n(l,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:p}),n(Sl,[2,27]),n(nm,[2,230]),n(NC,[2,345],{141:653,335:[1,654]}),n(hr,[2,181]),n(hr,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(E,Wh,{144:248,142:657,143:658,31:kC,112:kC}),n(NC,[2,346]),n(ho,[2,80]),n(im,[2,231]),n(yl,[2,67]),n(yl,[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(W,Z){if(Z.recoverable)this.trace(W);else{var le=new Error(W);throw le.hash=Z,le}},"parseError"),parse:a(function(W){var Z=this,le=[0],Be=[],it=[null],A=[],Pn=this.table,x="",Os=0,ld=0,lm=0,cm=2,cd=1,um=A.slice.call(arguments,1),Zt=Object.create(this.lexer),Ps={yy:{}};for(var ud in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ud)&&(Ps.yy[ud]=this.yy[ud]);Zt.setInput(W,Ps.yy),Ps.yy.lexer=Zt,Ps.yy.parser=this,typeof Zt.yylloc>"u"&&(Zt.yylloc={});var Mc=Zt.yylloc;A.push(Mc);var Nt=Zt.options&&Zt.options.ranges;typeof Ps.yy.parseError=="function"?this.parseError=Ps.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Kt(Ds){le.length=le.length-2*Ds,it.length=it.length-Ds,A.length=A.length-Ds}a(Kt,"popStack");for(var bt=a(function(){var Ds;return Ds=Zt.lex()||cd,typeof Ds!="number"&&(Ds=Z.symbols_[Ds]||Ds),Ds},"lex"),Rt,zn,Tl,Ti,Qpe,jS,jc={},fm,bo,KC,dm;;){if(Tl=le[le.length-1],this.defaultActions[Tl]?Ti=this.defaultActions[Tl]:((Rt===null||typeof Rt>"u")&&(Rt=bt()),Ti=Pn[Tl]&&Pn[Tl][Rt]),typeof Ti>"u"||!Ti.length||!Ti[0]){var $S="";dm=[];for(fm in Pn[Tl])this.terminals_[fm]&&fm>cm&&dm.push("'"+this.terminals_[fm]+"'");Zt.showPosition?$S="Parse error on line "+(Os+1)+`:
35
35
  `+Zt.showPosition()+`
36
36
  Expecting `+dm.join(", ")+", got '"+(this.terminals_[Rt]||Rt)+"'":$S="Parse error on line "+(Os+1)+": Unexpected "+(Rt==cd?"end of input":"'"+(this.terminals_[Rt]||Rt)+"'"),this.parseError($S,{text:Zt.match,token:this.terminals_[Rt]||Rt,line:Zt.yylineno,loc:Mc,expected:dm})}if(Ti[0]instanceof Array&&Ti.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Tl+", token: "+Rt);switch(Ti[0]){case 1:le.push(Rt),it.push(Zt.yytext),A.push(Zt.yylloc),le.push(Ti[1]),Rt=null,zn?(Rt=zn,zn=null):(ld=Zt.yyleng,x=Zt.yytext,Os=Zt.yylineno,Mc=Zt.yylloc,lm>0&&lm--);break;case 2:if(bo=this.productions_[Ti[1]][1],jc.$=it[it.length-bo],jc._$={first_line:A[A.length-(bo||1)].first_line,last_line:A[A.length-1].last_line,first_column:A[A.length-(bo||1)].first_column,last_column:A[A.length-1].last_column},Nt&&(jc._$.range=[A[A.length-(bo||1)].range[0],A[A.length-1].range[1]]),jS=this.performAction.apply(jc,[x,ld,Os,Ps.yy,Ti[1],it,A].concat(um)),typeof jS<"u")return jS;bo&&(le=le.slice(0,-1*bo*2),it=it.slice(0,-1*bo),A=A.slice(0,-1*bo)),le.push(this.productions_[Ti[1]][0]),it.push(jc.$),A.push(jc._$),KC=Pn[le[le.length-2]][le[le.length-1]],le.push(KC);break;case 3:return!0}}return!0},"parse")},sm=N1().Wildcard,om="http://www.w3.org/1999/02/22-rdf-syntax-ns#",dB=om+"type",pB=om+"first",hB=om+"rest",MC=om+"nil",am="http://www.w3.org/2001/XMLSchema#",jC=am+"integer",$C=am+"decimal",UC=am+"double",mB=am+"boolean",wl="",BC="",VC="";function On(Y){return Y.toLowerCase()}a(On,"lowercase");function yo(Y,W){return Y.push(W),Y}a(yo,"appendTo");function El(Y,W){return Y.push.apply(Y,W),Y}a(El,"appendAllTo");function or(Y){Y||(Y={});for(var W=1,Z=arguments.length,le;W<Z&&(le=arguments[W]||{});W++)for(var Be in le)Y[Be]=le[Be];return Y}a(or,"extend");function Rs(){for(var Y=[],W=0,Z=arguments.length;W<Z;W++)Y=Y.concat.apply(Y,arguments[W]);return Y}a(Rs,"unionAll");function sd(Y){if(Y[0]==="<"&&(Y=Y.substring(1,Y.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(Y))return Y;if(!ot.base)throw new Error("Cannot resolve relative IRI "+Y+" because no base IRI was set.");switch(wl!==ot.base&&(wl=ot.base,BC=wl.replace(/[^\/:]*$/,""),VC=wl.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),Y[0]){case void 0:return wl;case"#":return wl+Y;case"?":return wl.replace(/(?:\?.*)?$/,Y);case"/":return VC+Y;default:return BC+Y}}a(sd,"resolveIRI");function xS(Y){if(Y){var W=Y[0];if(W==="?"||W==="$")return ot.factory.variable(Y.substr(1))}return Y}a(xS,"toVar");function en(Y,W){return{type:"operation",operator:Y,args:W||[]}}a(en,"operation");function Fc(Y,W){var Z={expression:Y==="*"?new sm:Y};if(W)for(var le in W)Z[le]=W[le];return Z}a(Fc,"expression");function Lc(Y,W){return{type:"path",pathType:Y,items:W}}a(Lc,"path");function RS(Y,W){for(var Z=0,le=W.length,Be;Z<le&&(Be=W[Z]);Z++)Y=en(Be[0],[Y,Be[1]]);return Y}a(RS,"createOperationTree");function vl(Y,W){var Z=[],le=[],Be=Y.length,it,A={};if(!Be)return null;for(var Pn=0;Pn<Be&&(it=Y[Pn]);Pn++)(it.named?le:Z).push(it.iri);return A[W||"from"]={default:Z,named:le},A}a(vl,"groupDatasets");function Nc(Y){return parseInt(Y,10)}a(Nc,"toInt");function CS(Y){return Y.type==="group"&&Y.patterns.length===1?Y.patterns[0]:Y}a(CS,"degroupSingle");function Cs(Y,W){return W&&W.termType!=="NamedNode"&&(W=ot.factory.namedNode(W)),ot.factory.literal(Y,W)}a(Cs,"createTypedLiteral");function gB(Y,W){return ot.factory.literal(Y,W)}a(gB,"createLangLiteral");function OS(Y,W,Z){if(!("termType"in W))throw new Error("Nested triples cannot contain paths");return ot.factory.quad(Y,W,Z)}a(OS,"nestedTriple");function _o(Y,W,Z,le){var Be={};return Y!=null&&(Be.subject=Y),W!=null&&(Be.predicate=W),Z!=null&&(Be.object=Z),le!=null&&(Be.annotations=le),Be}a(_o,"triple");function od(Y){return typeof Y=="string"?Y.startsWith("e_")?ot.factory.blankNode(Y):ot.factory.blankNode("e_"+Y):ot.factory.blankNode("g_"+qC++)}a(od,"blank");var qC=0;ot._resetBlanks=function(){qC=0};var yB=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,_B={"\\":"\\","'":"'",'"':'"',t:" ",b:"\b",n:`
37
37
  `,r:"\r",f:"\f"},bB=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,PS=String.fromCharCode;function GC(Y,W){Y=Y.substring(W,Y.length-W);try{Y=Y.replace(yB,function(Z,le,Be,it){var A;if(le){if(A=parseInt(le,16),isNaN(A))throw new Error;return PS(A)}else if(Be){if(A=parseInt(Be,16),isNaN(A))throw new Error;return A<65535?PS(A):PS(55296+((A-=65536)>>10),56320+(A&1023))}else{var Pn=_B[it];if(!Pn)throw new Error;return Pn}})}catch{return""}if(bB.exec(Y))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+Y);return Y}a(GC,"unescapeString");function SB(Y){var W=od(),Z=W,le=[],Be,it=[];Y.forEach(function(Os){le.push(Os.entity),El(it,Os.triples)});for(var A=0,Pn=0,x=le.length,Be=Array(x*2);A<x;)Be[Pn++]=_o(Z,ot.factory.namedNode(pB),le[A]),Be[Pn++]=_o(Z,ot.factory.namedNode(hB),Z=++A<x?od():ot.factory.namedNode(MC));return{entity:W,triples:El(Be,it)}}a(SB,"createList");function wB(Y){var W=od();return{entity:W,triples:Y.map(function(Z){return or(_o(W),Z)})}}a(wB,"createAnonymousObject");function DS(Y,W,Z){var le=[],Be=[];return W.forEach(function(it){let A=null;it.annotation&&(A=it.annotation,it=it.object),le.push(_o(null,Y,it.entity,A)),El(Be,it.triples)}),Rs(le,Z||[],Be)}a(DS,"objectListToTriples");function Kpe(Y){for(var W=[],Z,le=0,Be;Be=Y[le];le++)switch(Be.type){case"bgp":Be.triples.length&&(Z?El(Z.triples,Be.triples):yo(W,Z=Be));break;default:(!Be.patterns||Be.patterns.length>0)&&(yo(W,Be),Z=null)}return W}a(Kpe,"mergeAdjacentBGPs");function kc(Y){return Y.variable?Y.variable.value:Y.value||Y.expression.value}a(kc,"getExpressionId");function FS(Y){if(!Y)return[];if(Y.type==="aggregate")return[Y];if(Y.type==="operation"){let W=[];for(let Z of Y.args)W.push(...FS(Z));return W}return[]}a(FS,"getAggregatesOfExpression");function EB(Y){let W=new Set,Z=a(function(le){le&&(le.termType==="Variable"?W.add(le):le.type==="operation"&&le.args.forEach(Z))},"visitExpression");return Z(Y),W}a(EB,"getVariablesFromExpression");function LS(Y,W=1,Z=[]){for(let le of Y)W>0&&le instanceof Array?LS(le,W-1,Z):Z.push(le);return Z}a(LS,"flatten");function NS(Y){return Y.termType==="Variable"}a(NS,"isVariable");function WC(Y){if(Y.triples){let W=[];for(let Z of Y.triples)NS(Z.subject)&&W.push(Z.subject.value),NS(Z.predicate)&&W.push(Z.predicate.value),NS(Z.object)&&W.push(Z.object.value);return W}else if(Y.patterns){let W=[];for(let Z of Y.patterns)W.push(...WC(Z));return W}return[]}a(WC,"getBoundVarsFromGroupGraphPattern");function vB(Y){let W=Y.slice().sort(),Z=[];for(let le=0;le<W.length-1;le++)W[le+1]==W[le]&&Z.push(W[le]);return Z}a(vB,"getDuplicatesInArray");function ad(Y){if(!ot.sparqlStar)throw new Error("SPARQL-star support is not enabled");return Y}a(ad,"ensureSparqlStar");function HC(Y,W,Z){for(let le of W){let Be=_o("subject"in le?le.subject:Y,le.predicate,le.object);Z.push(Be),le.annotations&&HC(OS(Y,le.predicate,le.object),le.annotations,Z)}}a(HC,"_applyAnnotations");function kS(Y){if(ot.sparqlStar){let W=[];return Y.forEach(Z=>{let le=_o(Z.subject,Z.predicate,Z.object);W.push(le),Z.annotations&&HC(OS(Z.subject,Z.predicate,Z.object),Z.annotations,W)}),W}return Y}a(kS,"applyAnnotations");function Ype(Y){if(!ot.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return Y}a(Ype,"ensureSparqlStarNestedQuads");function zC(Y){for(let W of Y){if(W.type==="graph"&&W.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(W.type==="bgp"||W.type==="graph"){for(let Z of W.triples)if(Z.subject.termType==="Variable"||Z.predicate.termType==="Variable"||Z.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return Y}a(zC,"ensureNoVariables");function MS(Y){for(let W of Y)if(W.type==="bgp"){for(let Z of W.triples)if(Z.subject.termType==="BlankNode"||Z.predicate.termType==="BlankNode"||Z.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return Y}a(MS,"ensureNoBnodes");var TB=(function(){var Y={EOF:1,parseError:a(function(Z,le){if(this.yy.parser)this.yy.parser.parseError(Z,le);else throw new Error(Z)},"parseError"),setInput:a(function(W,Z){return this.yy=Z||this.yy||{},this._input=W,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 W=this._input[0];this.yytext+=W,this.yyleng++,this.offset++,this.match+=W,this.matched+=W;var Z=W.match(/(?:\r\n?|\n).*/g);return Z?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),W},"input"),unput:a(function(W){var Z=W.length,le=W.split(/(?:\r\n?|\n)/g);this._input=W+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Z),this.offset-=Z;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 it=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-Z},this.options.ranges&&(this.yylloc.range=[it[0],it[0]+this.yyleng-Z]),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).
@@ -68,7 +68,7 @@ ${r}}`}default:throw new bu(`Unsupported operation type for SPARQL generation: $
68
68
  `)}generateTriple(e){let t=this.generateElement(e.subject),r=this.generatePredicate(e.predicate),i=this.generateElement(e.object);return`${t} ${r} ${i}`}generatePredicate(e){return"pathType"in e?this.generatePropertyPath(e):this.generateElement(e)}generatePropertyPath(e){let t=e.items.map(r=>"pathType"in r?`(${this.generatePropertyPath(r)})`:`<${r.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 r=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`;return e.language?r+=`@${e.language}`:e.datatype&&(r+=`^^<${e.datatype}>`),r}case"blank":return`_:${e.value}`;default:throw new bu(`Unknown element type: ${e.type}`)}}generateValues(e,t){let r=" ".repeat(t);if(e.variables.length===0||e.bindings.length===0)return"";if(e.variables.length===1){let o=e.variables[0],l=e.bindings.map(c=>{let u=c[o];return u?this.generateValuesTerm(u):"UNDEF"}).join(" ");return`${r}VALUES ?${o} { ${l} }`}let i=e.variables.map(o=>`?${o}`).join(" "),s=e.bindings.map(o=>`(${e.variables.map(c=>{let u=o[c];return u?this.generateValuesTerm(u):"UNDEF"}).join(" ")})`);return`${r}VALUES (${i}) {
69
69
  ${s.map(o=>`${r} ${o}`).join(`
70
70
  `)}
71
- ${r}}`}generateValuesTerm(e){if(e.type==="iri")return`<${e.value}>`;let r=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;return e.language?r+=`@${e.language}`:e.datatype&&(r+=`^^<${e.datatype}>`),r}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(r=>this.generateExpression(r)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.generateWhereClause(e.pattern,0)} }`;case"in":{let t=this.generateExpression(e.expression),r=e.list.map(i=>this.generateExpression(i)).join(", ");return e.negated?`${t} NOT IN (${r})`:`${t} IN (${r})`}default:throw new bu(`Unknown expression type: ${e.type}`)}}collectVariablesFromOperation(e,t){switch(e.type){case"bgp":for(let r of e.triples)this.collectVariablesFromTriple(r,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 r of e.variables)t.add(r);break;case"project":for(let r of e.variables)t.add(r);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 r of e.variables)t.add(r);for(let r of e.aggregates)t.add(r.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 r of e.operands)this.collectVariablesFromExpression(r,t);break;case"function":case"functionCall":for(let r of e.args)this.collectVariablesFromExpression(r,t);break;case"exists":this.collectVariablesFromOperation(e.pattern,t);break;case"in":this.collectVariablesFromExpression(e.expression,t);for(let r of e.list)this.collectVariablesFromExpression(r,t);break}}};Su.SPARQLGenerator=HE});var Eu=v(ti=>{"use strict";var aW=ti&&ti.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=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(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),lW=ti&&ti.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),W3=ti&&ti.__importStar||(function(){var n=a(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&aW(t,e,r[i]);return lW(t,e),t}})();Object.defineProperty(ti,"__esModule",{value:!0});ti.QueryExecutor=ti.ExoQLQueryExecutor=ti.QueryExecutorError=void 0;var cW=hE(),uW=ry(),fW=FE(),dW=NE(),pW=O3(),hW=D3(),mW=k3(),gW=qE(),yW=j3(),_W=U3(),bW=q3(),SW=G3(),wW=ze(),EW=tt(),vW=Yg(),ln="http://www.w3.org/2001/XMLSchema#",TW=new Set([`${ln}integer`,`${ln}decimal`,`${ln}float`,`${ln}double`,`${ln}nonPositiveInteger`,`${ln}negativeInteger`,`${ln}long`,`${ln}int`,`${ln}short`,`${ln}byte`,`${ln}nonNegativeInteger`,`${ln}unsignedLong`,`${ln}unsignedInt`,`${ln}unsignedShort`,`${ln}unsignedByte`,`${ln}positiveInteger`]),wu=class extends Error{static{a(this,"QueryExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="QueryExecutorError"}};ti.QueryExecutorError=wu;var uy=class{static{a(this,"ExoQLQueryExecutor")}constructor(e,t={}){let r=t.resolveClassHierarchy===!1?e:new bW.ClassHierarchyResolvingStore(e);this.tripleStore=r,this.bgpExecutor=new cW.BGPExecutor(r),this.filterExecutor=new uW.FilterExecutor,this.optionalExecutor=new fW.OptionalExecutor,this.unionExecutor=new dW.UnionExecutor,this.minusExecutor=new pW.MinusExecutor,this.valuesExecutor=new hW.ValuesExecutor,this.aggregateExecutor=new mW.AggregateExecutor,this.constructExecutor=new gW.ConstructExecutor,this.serviceExecutor=new yW.ServiceExecutor(t.serviceConfig),this.graphExecutor=new _W.GraphExecutor(r),this.sparqlGenerator=new SW.SPARQLGenerator,this.filterExecutor.setExistsEvaluator(async(i,s)=>this.evaluateExistsPattern(i,s)),this.filterExecutor.setTripleStore(r)}async evaluateExistsPattern(e,t){for await(let r of this.execute(e))if(t.merge(r)!==null)return!0;return!1}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);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 wu(`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 r=new Set;for(let o of t)for(let l of o.variables())r.add(l);let i=this.collectOperationVariables(e.right);if([...r].some(o=>i.has(o)))for(let o of t){let l=this.substituteVariables(e.right,o);for await(let c of this.execute(l)){let u=o.merge(c);u!==null&&(yield u)}}else{let o=[];for await(let l of this.execute(e.right))o.push(l);for(let l of t)for(let c of o){let u=l.merge(c);u!==null&&(yield u)}}}async*executeLeftJoin(e){let t=[];for await(let o of this.execute(e.left))t.push(o);let r=[];for await(let o of this.execute(e.right))r.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of r)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 r=[];for await(let o of this.execute(e.right))r.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of r)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 r=[];for await(let o of this.execute(e.right))r.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of r)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(()=>W3(Ro())),r=new Set(e.variables);for await(let i of this.execute(e.input)){let s=new t;for(let o of i.variables())if(r.has(o)){let l=i.get(o);l!==void 0&&s.set(o,l)}yield s}}async*executeOrderBy(e){let t=[];for await(let r of this.execute(e.input))t.push(r);t.sort((r,i)=>{for(let s of e.comparators){let o=this.getExpressionValue(s.expression,r),l=this.getExpressionValue(s.expression,i),c=0;if(o===void 0&&l===void 0?c=0:o===void 0?c=1:l===void 0?c=-1:typeof o=="number"&&typeof l=="number"?c=o-l:c=String(o).localeCompare(String(l)),s.descending&&(c=-c),c!==0)return c}return 0});for(let r of t)yield r}async*executeSlice(e){let t=0,r=e.offset??0,i=e.limit;for await(let s of this.execute(e.input)){if(t>=r){if(i!==void 0&&t-r>=i)break;yield s}t++}}async*executeDistinct(e){let t=new Set;for await(let r of this.execute(e.input)){let i=this.getSolutionKey(r);t.has(i)||(t.add(i),yield r)}}async*executeReduced(e){let t=new Set;for await(let r of this.execute(e.input)){let i=this.getSolutionKey(r);t.has(i)||(t.add(i),yield r)}}async*executeGroup(e){let t=[];for await(let i of this.execute(e.input))t.push(i);let r=this.aggregateExecutor.execute(e,t);if(e.having&&e.having.length>0)for(let i of r)e.having.every(o=>this.filterExecutor.evaluateExpression(o,i)===!0)&&(yield i);else for(let i of r)yield i}async*executeExtend(e){let t=e.expression.type!=="aggregate"&&this.filterExecutor.expressionContainsExists(e.expression);for await(let r of this.execute(e.input)){let i=r.clone(),s=t?await this.evaluateExtendExpressionAsync(e.expression,r):this.evaluateExtendExpression(e.expression,r);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 r of this.execute(e.left))t.push(r);for(let r of t){let i=this.substituteVariables(e.right,r);for await(let s of this.execute(i)){let o=r.merge(s);o!==null&&(yield o)}}}substituteVariables(e,t){let r=JSON.parse(JSON.stringify(e));return this.substituteInOperation(r,t)}substituteInOperation(e,t){if(!e||typeof e!="object")return e;let r=e;return e.type==="bgp"&&e.triples?(e.triples=e.triples.map(i=>this.substituteInTriple(i,t)),e):(r.input&&(r.input=this.substituteInOperation(r.input,t)),r.left&&(r.left=this.substituteInOperation(r.left,t)),r.right&&(r.right=this.substituteInOperation(r.right,t)),r.pattern&&(r.pattern=this.substituteInOperation(r.pattern,t)),r.query&&(r.query=this.substituteInOperation(r.query,t)),r.where&&(r.where=this.substituteInOperation(r.where,t)),r.expression&&this.substituteInExpression(r.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 r of e.operands)this.substituteInExpression(r,t);if(e.args)for(let r of e.args)this.substituteInExpression(r,t);if(e.expression&&this.substituteInExpression(e.expression,t),e.list)for(let r of e.list)this.substituteInExpression(r,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 r=t.get(e.value);if(r!=null){let i=r;if(r instanceof wW.IRI||i.termType==="NamedNode")return{type:"iri",value:r.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*(r,i){let s=this.currentGraphContext;this.currentGraphContext=i;try{r.type==="bgp"&&i&&this.tripleStore.matchInGraph?yield*this.executeBGPInGraph(r,i):yield*this.execute(r)}finally{this.currentGraphContext=s}}.bind(this);yield*this.graphExecutor.execute(e,t)}async*executeBGPInGraph(e,t){if(e.triples.length===0){let{SolutionMapping:r}=await Promise.resolve().then(()=>W3(Ro()));yield new r;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 r=t.get(e.name);if(!r)return;if(r instanceof EW.Literal){let i=r.datatype?.value;if(i===`${ln}dayTimeDuration`)try{return vW.DateTimeFunctions.parseDayTimeDuration(r.value)}catch{return r.value}if(i&&TW.has(i)){let s=parseFloat(r.value);if(!Number.isNaN(s))return s}return r.value}return r.value??r.id??String(r)}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 r=e;if(r.type==="bgp"&&r.triples)for(let i of r.triples)this.collectVarsFromElement(i.subject,t),i.predicate?.type!=="path"&&this.collectVarsFromElement(i.predicate,t),this.collectVarsFromElement(i.object,t);if(r.type==="values"&&r.variables)for(let i of r.variables)t.add(i);r.expression&&this.collectVarsFromExpressionTree(r.expression,t),r.type==="extend"&&r.variable&&t.add(r.variable),r.input&&this.collectVarsFromOperation(r.input,t),r.left&&this.collectVarsFromOperation(r.left,t),r.right&&this.collectVarsFromOperation(r.right,t),r.pattern&&this.collectVarsFromOperation(r.pattern,t),r.query&&this.collectVarsFromOperation(r.query,t),r.where&&this.collectVarsFromOperation(r.where,t)}collectVarsFromElement(e,t){if(!e||typeof e!="object")return;let r=e;r.type==="variable"&&t.add(r.value),r.type==="quoted"&&(this.collectVarsFromElement(r.subject,t),this.collectVarsFromElement(r.predicate,t),this.collectVarsFromElement(r.object,t))}collectVarsFromExpressionTree(e,t){if(!e||typeof e!="object")return;let r=e;if(r.type==="variable"&&r.name&&t.add(r.name),r.type==="exists"&&r.pattern&&this.collectVarsFromOperation(r.pattern,t),r.left&&this.collectVarsFromExpressionTree(r.left,t),r.right&&this.collectVarsFromExpressionTree(r.right,t),r.operands)for(let i of r.operands)this.collectVarsFromExpressionTree(i,t);if(r.args)for(let i of r.args)this.collectVarsFromExpressionTree(i,t);if(r.expression&&this.collectVarsFromExpressionTree(r.expression,t),r.list)for(let i of r.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 wu("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 wu("executeAsk requires an ASK operation");for await(let t of this.execute(e.where))return!0;return!1}};ti.ExoQLQueryExecutor=uy;ti.QueryExecutor=uy});var Z3=v(Co=>{"use strict";var AW=Co&&Co.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(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},IW=Co&&Co.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(Co,"__esModule",{value:!0});Co.CommandResolver=void 0;var xW=ut(),RW=Fd(),ar=ze(),Gt=tt(),re=Vt(),H3=Sa(),z3=pd(),CW=Vc(),OW=Ld(),vu=ow(),fy=NP(),PW=Jc(),DW=nu(),FW=Eu(),Hl=10,dy="exo__Asset",LW=Hl+1,K3="08cec529-90eb-4d43-88de-ceecccea12b0",NW=re.Namespace.EXOCMD.term("SubstitutionToken").value,Y3=new Set(["today","tomorrow","todayStart","targetFolder","target","randomUUIDv4","nowTimestamp","nowDate","nowYear","nowMonth","userInputLabel","userInput","targetProperty","targetRefProperty","labelAsArray","groundingTargetClass","targetClassSelf"]);function kW(n,e){return`__SUBSTITUTE__${n}__${e}__`}a(kW,"buildSubstitutionMarker");function MW(n,e,t){let r=(0,CW.utf8ToBase64)(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return`__SUBSTITUTE_P__${n}__${e}__${r}__`}a(MW,"buildParameterisedMarker");var Q3="3f28af98-c031-4718-8ba2-44ad0b012c52",jW=re.Namespace.EXOCMD.term("TokenInvocation").value,X3="29e2c8f8-2d27-4e58-b467-2e85d46f8122",J3="universal-default-template",zE=class{static{a(this,"CommandResolver")}clearUniversalCache(){this._universalCacheReady=!1,this._universalCacheValue=null,(0,fy.clearUniversalDefault)()}constructor(e,t=RW.NullLogger){this.tripleStore=e,this.logger=t,this.cache=new Map,this.multiCache=new Map,this._ancestorDepthCache=new Map,this._legacyPropertyDefaultsWarnedGroundings=new Set,this._fallbackWarnedKeys=new Set,this._universalCacheReady=!1,this._universalCacheValue=null}async resolveForAssetMulti(e,t,r){if(t.length===0)return[];let i=[...t].sort().join(","),s=`${e}::${i}::${r??""}`,o=this.multiCache.get(s);if(o)return o;let l=r?await this.expandPrototypeChain(r):void 0,c=await this.expandClassHierarchy(t),u=new Map;for(let[h,_]of c){let y=await this.resolveForAsset(e,h,l);for(let b of y){let S=this.getBindingPriority(b.binding)===2?_:0,I=u.get(b.binding.id);(!I||S<I.depth)&&u.set(b.binding.id,{rc:b,depth:S})}}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),b=this.getBindingPriority(_.rc.binding);return y!==b?y-b: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 l of e){if(l===dy){t.set(l,new Set);continue}let c=[];try{c=await this.getClassAncestors(l)}catch{c=[]}t.set(l,new Set(c))}let r=a(l=>{for(let c of e)if(c!==l&&t.get(c)?.has(l)&&!t.get(l)?.has(c))return!0;return!1},"isAncestorOfSibling"),i=e.filter(l=>!r(l)),s=new Map,o=a((l,c)=>{let u=s.get(l);(u===void 0||c<u)&&s.set(l,c)},"setMin");for(let l of i){if(o(l,0),this.looksLikeUUID(l))try{let u=await this.resolveLabelByUID(l);u&&o(u,0)}catch{}if(l===dy)continue;let c=[];try{c=await this.getClassAncestorsWithDepth(l)}catch{c=[]}for(let{ref:u,depth:f}of c)o(u,f)}return s.has(dy)||s.set(dy,LW),s}async resolveForAsset(e,t,r){let i=typeof r=="string"?`s:${r}`:r?`c:${r.join("\0")}`:"",s=`${e}:${t}:${i}`,o=this.cache.get(s);if(o)return o;let l=typeof r=="string"?await this.expandPrototypeChain(r):r,c=await this.findBindings(t,l,e),u=[];for(let f of c){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 r=await this.findSubjectByUID(e);if(!r||(await this.tripleStore.match(r,re.Namespace.RDF.term("type"),re.Namespace.EXOCMD.term("Command"))).length===0)return null;let s=await this.getLiteralValue(r,re.Namespace.EXO.term("Asset_label"))??"Unknown Command",o=await this.getLiteralValue(r,re.Namespace.EXOCMD.term("Command_labelTemplate")),l=await this.getLiteralValue(r,re.Namespace.EXOCMD.term("Command_icon")),c=await this.getLiteralValue(r,re.Namespace.EXOCMD.term("Command_confirmMessage")),u=await this.getLiteralValue(r,re.Namespace.EXOCMD.term("Command_successMessage")),f=await this.getLiteralValue(r,re.Namespace.EXOCMD.term("Command_category")),d=await this.getLiteralValue(r,re.Namespace.EXOCMD.term("Command_openInSameTab")),p=d!==null&&String(d).trim().toLowerCase()==="true",h=await this.loadLinkedPrecondition(r),_=await this.loadLinkedGrounding(r,0,t);return _?{id:e,name:s,labelTemplate:o??void 0,icon:l??void 0,precondition:h??void 0,grounding:_,confirmMessage:c??void 0,successMessage:u??void 0,category:f??void 0,openInSameTab:p||void 0}:null}async findBindings(e,t,r){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 l of s){let c=l.subject,u=await this.loadBindingDefinition(c);u&&this.bindingMatches(u,e,i,r)&&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=[],r=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 l=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_uid"));if(!l){this.logger.warn(`[CommandResolver] paletteEnabled command at ${s.value} has no exo__Asset_uid \u2014 skipped`);continue}let c=await this.loadCommand(l);if(!c){this.logger.warn(`[CommandResolver] paletteEnabled command ${l} 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??l;if(r.has(d)){this.logger.warn(`[CommandResolver] duplicate paletteId "${d}" \u2014 first registration wins, dropping ${l}`);continue}r.add(d),t.push({command:c,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 r=e.labelTemplate,i=this.extractPlaceholders(e.labelTemplate);for(let{full:s,body:o}of i){let l=await this.evaluateSelectSnippet(o,t);r=r.replace(s,l)}return r}extractPlaceholders(e){let t=[],r=0;for(;r<e.length;)if(e[r]==="{"){let i=1,s=r+1;for(;s<e.length&&i>0;)e[s]==="{"?i++:e[s]==="}"&&i--,s++;if(i===0){let o=e.slice(r,s),l=e.slice(r+1,s-1);t.push({full:o,body:l})}r=s}else r++;return t}async evaluateSelectSnippet(e,t){try{let r=e.replace(/\$target/g,`<${t}>`),s=new PW.ExoQLParser().parse(r),l=new DW.ExoQLAlgebraTranslator().translate(s),u=await new FW.ExoQLQueryExecutor(this.tripleStore).executeAll(l);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 Gt.Literal||p instanceof ar.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 r=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")),l=await this.getLinkedValue(e,re.Namespace.EXOCMD.term("CommandBinding_targetAsset"));if(!s&&!o&&!l)return null;let c=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:r,commandRef:i,targetClass:s??void 0,targetPrototype:o??void 0,targetAsset:l??void 0,position:c??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 r=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("CommandBinding_style"),void 0);if(r.length>0){let s=r[0].object,o=null;if(s instanceof ar.IRI)o=s;else if(s instanceof Gt.Literal){let l=this.normalizeWikilink(s.value);o=await this.findSubjectByUID(l)}if(o){let l=await this.loadStyleAsset(o);if(l)return l}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 r=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")),l=this.coerceBoolean(o),c=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("CommandBindingStyle_labelClass")),u=c!==null?this.coerceLabelClass(c,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:r,variant:s,showIcon:l,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 r=String(e).trim().toLowerCase();if(r!==""){if(vu.COMMAND_VARIANT_VALUES.includes(r))return r;this.logger.warn(this.capWarning(`CommandBindingStyle variant "${r}" not in whitelist [${vu.COMMAND_VARIANT_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceLabelClass(e,t){if(e==null)return;let r=String(e).trim().toLowerCase();if(r!==""){if(vu.LABEL_CLASS_VALUES.includes(r))return r;this.logger.warn(this.capWarning(`CommandBindingStyle labelClass "${r}" not in whitelist [${vu.LABEL_CLASS_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceStyleSource(e,t){if(e==null)return;let r=String(e).trim().toLowerCase();if(r!==""){if(vu.STYLE_SOURCE_VALUES.includes(r))return r;this.logger.warn(this.capWarning(`CommandBindingStyle source "${r}" not in whitelist [${vu.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,r,i){if(e.targetAsset&&i&&this.matchesReference(e.targetAsset,i))return!0;if(e.targetPrototype&&r){for(let s of r)if(this.matchesReference(e.targetPrototype,s))return!0}return!!(e.targetClass&&t&&this.matchesReference(e.targetClass,t))}matchesReference(e,t){let r=this.normalizeWikilink(e),i=this.normalizeWikilink(t);if(r===i)return!0;let s=this.extractPathBasename(i);if(s&&s===r)return!0;let o=this.extractPathBasename(r);if(o&&o===i)return!0;let l=this.extractAlias(t);if(l&&r===l)return!0;let c=this.extractAlias(e);return!!(c&&c===i)}extractPathBasename(e){let t=e.match(/\/([^/]+)\.md$/);return t?t[1]:null}extractAlias(e){let t=e.replace(/["'[\]]/g,"").trim(),r=t.indexOf("|");return r>=0?t.substring(r+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 r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=await this.resolvePreconditionRef(r[0].object);return i?this.loadPreconditionSubject(i,new Set,0):null}async resolvePreconditionRef(e){if(e instanceof ar.IRI)return e;if(e instanceof Gt.Literal){let t=this.normalizeWikilink(e.value);return await this.findSubjectByUID(t)}return null}async loadPreconditionSubject(e,t,r){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(r>=Hl)return this.brokenPreconditionNode(i??"",s);let o=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("AllPrecondition_preconditions"),void 0),l=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("AnyPrecondition_preconditions"),void 0),c=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("NotPrecondition_precondition"),void 0);if(o.length>0||l.length>0||c.length>0){let p=new Set(t);if(i&&p.add(i),o.length>0||l.length>0){let _=o.length>0?"all":"any",y=o.length>0?o:l,b=[];for(let S of y)b.push(await this.loadChildPrecondition(S.object,p,r+1));return{id:i??"",label:s,composite:{op:_,children:b}}}let h=await this.loadChildPrecondition(c[0].object,p,r+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,r){let i=await this.resolvePreconditionRef(e);if(!i){let l=e instanceof Gt.Literal?this.normalizeWikilink(e.value):"";return this.brokenPreconditionNode(l,"")}let s=await this.loadPreconditionSubject(i,t,r);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 r=t[0].object;if(r instanceof ar.IRI)return await this.getLiteralValue(r,re.Namespace.EXO.term("Asset_uid"))??void 0;if(r instanceof Gt.Literal)return this.normalizeWikilink(r.value)}brokenPreconditionNode(e,t){return{id:e,label:t,broken:!0}}async loadLinkedGrounding(e,t,r){if(t>=Hl)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||!r?.targetClass){let o=await this.resolveGroundingRef(i[0].object);return o?this.loadGroundingDefinition(o,t):null}for(let o of i){let l=await this.resolveGroundingRef(o.object);if(!l)continue;let c=await this.getObsidianName(l,re.Namespace.EXOCMD.term("Grounding_targetPrototype"));if(c&&this.matchesReference(c,r.targetClass))return this.loadGroundingDefinition(l,t)}this.logger.warn(`Command ${e.value}: ${i.length} groundings declared, none matched context.targetClass='${r.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 ar.IRI)return e;if(e instanceof Gt.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>=Hl)return null;let r=await this.getLiteralValue(e,re.Namespace.EXO.term("Asset_uid"));if(!r)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 B=await this.resolveLabelByUID(o);if(!B)return this.logger.warn(`Grounding ${r}: targetProperty wikilink UID '${o}' is not resolvable to exo__Asset_label \u2014 grounding skipped (would otherwise write a UUID-named frontmatter key).`),null;o=B}if(s===H3.GroundingType.SERVICE_CALL){let B=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_serviceId"));B&&(o=B)}let l=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetValueRef")),c=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 B=await this.resolveLabelByUID(u);if(!B)return this.logger.warn(`Grounding ${r}: targetValueSubstitution UID '${u}' is not resolvable to exo__Asset_label (SubstitutionToken instance missing or unlabelled) \u2014 grounding skipped.`),null;f=B}else u&&(f=u);let d=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetValueQuery")),p=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetQuery")),h=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_serviceCallPayload")),_=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_appendExpression")),y=await this.getObsidianWikilinkValue(e,re.Namespace.EXOCMD.term("Grounding_isDefinedBy")),b=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 B=await this.findUidByLabel(S);B&&(S=B)}let I=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_targetPrototype")),O=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_targetFolder")),T=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_linkBackProperty")),E=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_inputSchema")),P=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_incrementBy")),V=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_shiftDelta")),M;if(P!=null&&P!==""){let B=Number.parseInt(String(P),10);Number.isFinite(B)&&(M=B)}let j=await this.resolvePropertyDefaults(e,r),$=await this.resolveInheritanceRules(e,r),G=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_propertyDefaults"));G!==null&&G!==""&&!this._legacyPropertyDefaultsWarnedGroundings.has(r)&&(this.logger.warn(`Grounding ${r}: 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(r));let ge;s===H3.GroundingType.COMPOSITE&&(ge=await this.loadCompositeSteps(e,t+1));let ye;if(E)try{let B=JSON.parse(E);B?.properties&&(ye=Object.entries(B.properties).map(([oe,Ee])=>{let Ce=Ee.type,xe=Ce==="string"?"text":Ce,Oe=Ee.defaultValue!==void 0?Ee.defaultValue:Ee.default,Re={name:oe,type:xe,label:Ee.title??oe,required:Array.isArray(B.required)&&B.required.includes(oe)};return Oe!=null&&(Re.defaultValue=String(Oe)),typeof Ee.targetClassUid=="string"&&(Re.targetClassUid=Ee.targetClassUid),Re}))}catch{}let Q=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_prefillLabelWithDate")),se=Q!==null&&String(Q).trim().toLowerCase()==="true",J=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_labelTemplate")),ve=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_direction")),te;if(ve!=null){let B=String(ve).trim().toLowerCase();B==="forward"||B==="rollback"?te=B:B!==""&&this.logger.warn(`Grounding ${r}: exocmd__Grounding_direction value '${ve}' 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")),he=await this.getObsidianName(e,re.Namespace.EXOCMD.term("Grounding_templateRef")),Ue=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_cloneTargetBody")),ce=Ue!==null&&String(Ue).trim().toLowerCase()==="true",ue=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_targetsCreatedInstance")),fe=ue!==null&&String(ue).trim().toLowerCase()==="true",ne=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("Grounding_omitLabel")),me=ne!==null&&String(ne).trim().toLowerCase()==="true",Le={id:r,label:i,type:s,targetProperty:o??void 0,targetValueRef:l??void 0,targetValueLiteral:c??void 0,targetValueSubstitution:f??void 0,targetValueQuery:d??void 0,targetQuery:p??void 0,serviceCallPayload:h??void 0,appendExpression:_??void 0,sparqlUpdate:b??void 0,steps:ge,targetClass:S??void 0,targetPrototype:I??void 0,targetFolder:O??void 0,linkBackProperty:T??void 0,incrementBy:M,shiftDelta:V??void 0,propertyDefault:j.length>0?j:void 0,inheritanceRule:$.length>0?$:void 0,isDefinedBy:y??void 0,prefillLabelWithDate:se||void 0,labelTemplate:J??void 0,direction:te,bodyTemplate:ie??void 0,templateRef:he??void 0,cloneTargetBody:ce||void 0,targetsCreatedInstance:fe||void 0,omitLabel:me||void 0};return ye&&(Le.inputSchema=ye),Le}async loadCompositeSteps(e,t){if(t>=Hl)return[];let r=await this.tripleStore.match(e,re.Namespace.EXOCMD.term("Grounding_steps"),void 0),i=[];for(let s of r){let o=null;if(s.object instanceof ar.IRI)o=s.object;else if(s.object instanceof Gt.Literal){let c=this.normalizeWikilink(s.object.value);o=await this.findSubjectByUID(c)}if(!o)continue;let l=await this.loadGroundingDefinition(o,t);l&&i.push(l)}return i}async resolvePropertyDefaults(e,t){let r=await this.resolvePropertyDefaultsForSubject(e,t,re.Namespace.EXOCMD.term("Grounding_propertyDefault")),i=await this.getUniversalCache();return i&&i.propertyDefaults.length>0?(0,fy.mergePropertyDefaults)(i.propertyDefaults,r):r}async resolvePropertyDefaultsForSubject(e,t,r){let i=await this.tripleStore.match(e,r,void 0),s=[];for(let o of i){let l=await this.resolveRefTripleObject(o.object);if(!l)continue;let c=await this.getObsidianName(l,re.Namespace.EXOCMD.term("PropertyDefault_property"));if(!c){this.logger.warn(`Grounding ${t}: PropertyDefault asset missing exocmd__PropertyDefault_property \u2014 entry skipped.`);continue}let u=this.looksLikeUUID(c)?await this.resolveLabelByUID(c):c;if(!u){this.logger.warn(`Grounding ${t}: PropertyDefault property UID '${c}' is not resolvable to exo__Asset_label \u2014 entry skipped.`);continue}let f=await this.getObsidianName(l,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,fy.loadUniversalDefault)();if(e)return this._universalCacheValue=e,e;let t=await this.findUniversalSingleton();if(!t)return this._universalCacheValue=null,null;let r=await this.resolvePropertyDefaultsForSubject(t,J3,re.Namespace.EXOCMD.term("Template_propertyDefault")),i=await this.resolveInheritanceRulesForSubject(t,J3,re.Namespace.EXOCMD.term("Template_inheritanceRule"));return this._universalCacheValue={propertyDefaults:r,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),r=[];for(let i of t){let s=!1;if(i.object instanceof ar.IRI)s=i.object.value===e||i.object.value.includes(X3);else if(i.object instanceof Gt.Literal){let o=this.unwrapWikilink(i.object.value);s=o==="exocmd__UniversalDefaultTemplate"||o===X3}s&&i.subject instanceof ar.IRI&&r.push(i.subject)}return r.length===0?null:(r.length===1||(r.sort((i,s)=>i.value.localeCompare(s.value)),this.logger.warn(`Multiple UniversalDefaultTemplate singletons found (${r.length}); selecting deterministically by lexicographic UID order: ${r[0].value}`)),r[0])}async resolveInheritanceRules(e,t){let r=await this.resolveInheritanceRulesForSubject(e,t,re.Namespace.EXOCMD.term("Grounding_inheritanceRule")),i=await this.getUniversalCache();return i&&i.inheritanceRules.length>0?(0,fy.mergeInheritanceRules)(i.inheritanceRules,r):r}async resolveInheritanceRulesForSubject(e,t,r){let i=await this.tripleStore.match(e,r,void 0),s=[],o=t;for(let l of i){let c=await this.resolveRefTripleObject(l.object);if(!c)continue;let u=await this.resolveLabelRef(c,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(c,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(c,re.Namespace.EXOCMD.term("InheritanceRule_targetClassCondition"),void 0),p,h;if(d.length>0){let T=await this.getObsidianName(c,re.Namespace.EXOCMD.term("InheritanceRule_targetClassCondition"));if(!T||!T.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(T)?(h=T,p=await this.resolveLabelByUID(T)??void 0):p=T}let _=await this.tripleStore.match(c,re.Namespace.EXOCMD.term("InheritanceRule_targetClassExclusion"),void 0),y=[],b=[],S=!1;for(let T of _){let E=null;if(T.object instanceof ar.IRI?E=this.iriToObsidianName(T.object.value)??T.object.value:T.object instanceof Gt.Literal&&(E=this.unwrapWikilink(T.object.value)),!E){S=!0;continue}if(this.looksLikeUUID(E)){b.push(E);let P=await this.resolveLabelByUID(E);P&&y.push(P)}else y.push(E)}if(S){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 I=await this.getLiteralValue(c,re.Namespace.EXOCMD.term("InheritanceRule_priority")),O=50;if(I!==null&&I!==""){let T=Number.parseInt(String(I),10);Number.isFinite(T)&&(O=T)}s.push({sourcePropertyName:u,targetPropertyName:f,targetClassCondition:p,targetClassConditionUid:h,targetClassExclusion:y,targetClassExclusionUids:b,priority:O})}return s}async resolveRefTripleObject(e){if(e instanceof ar.IRI)return e;if(e instanceof Gt.Literal){let t=this.normalizeWikilink(e.value);return t?this.findSubjectByUID(t):null}return null}async resolveLabelRef(e,t){let r=await this.getObsidianName(e,t);return r?this.looksLikeUUID(r)?this.resolveLabelByUID(r):r:null}async resolvePropertyDefaultValue(e,t,r){if(!this.looksLikeUUID(e))return`"[[${e}]]"`;let i=await this.findSubjectByUID(e);if(!i){let l=`${t}|${e}`;return this._fallbackWarnedKeys.has(l)||(this._fallbackWarnedKeys.add(l),this.logger.warn(this.capWarning(`Grounding ${t}: PropertyDefault '${r}' \u2192 value asset ${e} not in store; emitting wikilink (a link, not the substituted value).`))),`"[[${e}]]"`}return await this.assetIsTokenInvocation(i)?this.resolveTokenInvocation(i,e,t,r):await this.assetIsSubstitutionToken(i)?this.dispatchSubstitutionToken(i,e,t,r,void 0):(this.logger.debug(`Grounding ${t}: PropertyDefault '${r}' value '${e}' is not a SubstitutionToken \u2014 emitting wikilink form.`),`"[[${e}]]"`)}async dispatchSubstitutionToken(e,t,r,i,s){let o=await this.getLiteralValue(e,re.Namespace.EXOCMD.term("SubstitutionToken_resolver"));if(!o||!o.trim())return this.logger.warn(`Grounding ${r}: PropertyDefault '${i}' references SubstitutionToken '${t}' with no exocmd__SubstitutionToken_resolver \u2014 falling back to wikilink form.`),`"[[${t}]]"`;let l=o.trim();return Y3.has(l)?s!==void 0?MW(l,t,s):kW(l,t):(this.logger.warn(`Grounding ${r}: PropertyDefault '${i}' SubstitutionToken '${t}' declares unknown resolver-id '${l}' \u2014 falling back to wikilink form. Known ids: ${Array.from(Y3).join(", ")}.`),`"[[${t}]]"`)}async resolveTokenInvocation(e,t,r,i){let s=await this.getObsidianName(e,re.Namespace.EXOCMD.term("TokenInvocation_token"));if(!s)return this.logger.warn(`Grounding ${r}: 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 ${r}: PropertyDefault '${i}' TokenInvocation '${t}' references non-UUID token '${s}' \u2014 entry skipped.`),null;let l=await this.findSubjectByUID(s);return l?this.dispatchSubstitutionToken(l,s,r,i,o):(this.logger.warn(`Grounding ${r}: 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 r of t)if(r.object instanceof ar.IRI){if(r.object.value===jW||r.object.value.includes(Q3))return!0}else if(r.object instanceof Gt.Literal){let i=this.unwrapWikilink(r.object.value);if(i==="exocmd__TokenInvocation"||i===Q3)return!0}return!1}async assetIsSubstitutionToken(e){let t=await this.tripleStore.match(e,re.Namespace.EXO.term("Instance_class"),void 0);for(let i of t)if(i.object instanceof ar.IRI){if(i.object.value===NW||i.object.value.includes(K3))return!0}else if(i.object instanceof Gt.Literal){let s=this.unwrapWikilink(i.object.value);if(s==="exocmd__SubstitutionToken"||s===K3)return!0}return(await this.tripleStore.match(e,re.Namespace.EXOCMD.term("SubstitutionToken_resolver"),void 0)).length>0?(this.logger.debug(`Asset ${e.value} classified as SubstitutionToken via its resolver property; exo__Instance_class was absent or unresolved.`),!0):!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 r=t[0].object;if(r instanceof ar.IRI)return(0,z3.resolveGroundingTypeFromIRI)(r.value);if(r instanceof Gt.Literal){let i=r.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,z3.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],r=new Set([this.normalizeWikilink(e).toLowerCase()]),i=e;for(let s=0;s<Hl;s++){let o=this.extractUuidFromRef(i);if(!o)break;let l=null;try{let u=await this.findSubjectByUID(o);if(!u)break;l=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(!l)break;let c=this.normalizeWikilink(l).toLowerCase();if(r.has(c))break;r.add(c),t.push(l),i=l}return t}extractUuidFromRef(e){let t=this.normalizeWikilink(e);if(this.looksLikeUUID(t))return t;let r=this.extractPathBasename(t);return r&&this.looksLikeUUID(r)?r:null}async findSubjectByUID(e){if(this.tripleStore.findSubjectsByUUID){let r=await this.tripleStore.findSubjectsByUUID(e);if(r.length>0)return r[0]}let t=await this.tripleStore.match(void 0,re.Namespace.EXO.term("Asset_uid"),void 0);for(let r of t)if(r.object instanceof Gt.Literal&&r.object.value===e)return r.subject;return null}async getLiteralValue(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;return i instanceof Gt.Literal||i instanceof ar.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(r=>r.ref)}async getClassAncestorsWithDepth(e){let t=this._ancestorDepthCache.get(e);if(t)return t;let r=new Map,i=new Set,s=await this.resolveClassFileIRI(e);if(!s)return[];let o=new Set([e]),l=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_uid"));l&&o.add(l);let c=await this.getLiteralValue(s,re.Namespace.EXO.term("Asset_label"));c&&o.add(c);let u=a((p,h)=>{if(o.has(p))return;let _=r.get(p);(_===void 0||h<_)&&r.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(_>=Hl||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 b of y){let S=b.object;if(!(S instanceof ar.IRI))continue;let I=_+1,O=S.value.startsWith("obsidian://vault/"),T=this.iriToObsidianName(S.value);T&&u(T,I);let E=null;if(O?E=S:T&&(E=await this.resolveClassFileIRI(T)),!E)continue;let P=await this.getLiteralValue(E,re.Namespace.EXO.term("Asset_uid"));P&&u(P,I),i.has(E.value)||f.push({fileIRI:E,depth:I})}}let d=Array.from(r.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 r of t)if(r.object instanceof Gt.Literal&&r.object.value===e&&r.subject instanceof ar.IRI){let i=await this.tripleStore.match(r.subject,re.Namespace.EXO.term("Asset_uid"),void 0);if(i.length>0&&i[0].object instanceof Gt.Literal)return i[0].object.value}return null}async getLinkedUID(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;if(i instanceof ar.IRI){let s=await this.tripleStore.match(i,re.Namespace.EXO.term("Asset_uid"),void 0);return s.length>0&&s[0].object instanceof Gt.Literal?s[0].object.value:i.value.split("/").pop()?.replace(".md","")??null}return i instanceof Gt.Literal?this.normalizeWikilink(i.value):null}async getLinkedUIDs(e,t){let r=await this.tripleStore.match(e,t,void 0),i=[];for(let s of r){let o=s.object;if(o instanceof ar.IRI){let l=await this.tripleStore.match(o,re.Namespace.EXO.term("Asset_uid"),void 0);if(l.length>0&&l[0].object instanceof Gt.Literal)i.push(l[0].object.value);else{let c=o.value.split("/").pop()?.replace(".md","");c&&i.push(c)}}else if(o instanceof Gt.Literal){let l=this.normalizeWikilink(o.value);l&&i.push(l)}}return i}async getLinkedValue(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;return i instanceof Gt.Literal?this.normalizeWikilink(i.value):i instanceof ar.IRI?this.iriToObsidianName(i.value)??i.value:null}async getObsidianName(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;return i instanceof Gt.Literal?this.unwrapWikilink(i.value):i instanceof ar.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 r=t.match(/^\[\[([^\]|]+)\|([^\]]+)\]\]$/);if(r)return r[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 r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;if(i instanceof Gt.Literal)return this.resolveWikilinkAlias(i.value);if(i instanceof ar.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 r=t[1],i=await this.findSubjectByUID(r);if(!i)return e;let s=await this.getLiteralValue(i,re.Namespace.EXO.term("Asset_label"));return s?e.replace(`[[${r}]]`,`[[${r}|${s}]]`):e}iriToObsidianName(e){return(0,OW.iriToObsidianName)(e)}normalizeWikilink(e){let t=e.replace(/["'[\]]/g,"").trim(),r=t.indexOf("|");return r>=0?t.substring(0,r):t}};Co.CommandResolver=zE;Co.CommandResolver=zE=AW([(0,xW.injectable)(),IW("design:paramtypes",[Object,Object])],zE)});var YE=v(KE=>{"use strict";Object.defineProperty(KE,"__esModule",{value:!0});KE.validateExoQLAllowlist=$W;var py=qd();function $W(n){if(!n||typeof n!="object")return;let e=n;if(e.type==="update"){let t=n.updates??[];for(let r of t)if(r?.type==="load")throw new py.ExoQLForbiddenKeywordError("LOAD");throw new py.ExoQLForbiddenKeywordError("UPDATE")}if(e.type==="query"){if(e.from){let t=Array.isArray(e.from.default)&&e.from.default.length>0,r=Array.isArray(e.from.named)&&e.from.named.length>0;if(t||r)throw new py.ExoQLForbiddenKeywordError("FROM")}if(Array.isArray(e.where))for(let t of e.where)hy(t);if(Array.isArray(e.template))for(let t of e.template)hy(t)}}a($W,"validateExoQLAllowlist");function hy(n){if(!n||typeof n!="object")return;if(n.type==="service")throw new py.ExoQLForbiddenKeywordError("SERVICE");if(Array.isArray(n.patterns))for(let t of n.patterns)hy(t);let e=n.where;if(Array.isArray(e))for(let t of e)hy(t)}a(hy,"walkPatternForBannedKeywords")});var QE=v(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.DEFAULT_EVAL_CONFIG=void 0;my.DEFAULT_EVAL_CONFIG=Object.freeze({enabled:!0,maxNestedEvalCount:100,maxAggregateEvalMillis:1e4})});var gy=v(XE=>{"use strict";Object.defineProperty(XE,"__esModule",{value:!0});XE.evaluateWithExoEval=HW;var UW=Jc(),BW=nu(),VW=Eu(),qW=YE(),GW=QE(),WW=qd();async function HW(n,e={}){if(typeof n!="string")throw new TypeError("evaluateWithExoEval: sparql must be a string");let r=new UW.ExoQLParser().parse(n);if((0,qW.validateExoQLAllowlist)(r),!{...GW.DEFAULT_EVAL_CONFIG,...e.config??{}}.enabled)throw new WW.ExoQLEvalDisabledError;let s="queryType"in r&&typeof r.queryType=="string"?r.queryType:"SELECT";if(!e.store)return s==="ASK"?{kind:"ask",result:!1}:s==="CONSTRUCT"?{kind:"construct",triples:[]}:{kind:"select",rows:[]};let l=new BW.ExoQLAlgebraTranslator().translate(r),c=new VW.ExoQLQueryExecutor(e.store);return c.isAskQuery(l)?{kind:"ask",result:await c.executeAsk(l)}:c.isConstructQuery(l)?{kind:"construct",triples:await c.executeConstruct(l)}:{kind:"select",rows:await c.executeAll(l)}}a(HW,"evaluateWithExoEval")});var zi=v(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.DateFormatter=void 0;var JE=class n{static{a(this,"DateFormatter")}static toISOTimestamp(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}static toLocalTimestamp(e){let t=e.getFullYear(),r=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"),l=String(e.getSeconds()).padStart(2,"0");return`${t}-${r}-${i}T${s}:${o}:${l}`}static toDateWikilink(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`"[[${t}-${r}-${i}]]"`}static getTodayWikilink(){return n.toDateWikilink(new Date)}static toDateString(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${i}`}static parseWikilink(e){let r=e.replace(/^["']|["']$/g,"").match(/\[\[(\d{4}-\d{2}-\d{2})\]\]/);return r?r[1]:null}static addDays(e,t){let r=new Date(e);return r.setDate(r.getDate()+t),r}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),n.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[r,i,s]=t,o=new Date(r,i-1,s,0,0,0,0);if(isNaN(o.getTime()))throw new Error(`Invalid date values: ${e}`);return n.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 n.toISOTimestamp(t)}static isISOTimestamp(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e)}};yy.DateFormatter=JE});var Wd=v(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.liveClock=zW;_y.frozenClock=KW;function zW(){return{now:a(()=>new Date,"now")}}a(zW,"liveClock");function KW(n){let e=new Date(n);return{now:a(()=>new Date(e.getTime()),"now")}}a(KW,"frozenClock")});var tD=v(Oo=>{"use strict";var YW=Oo&&Oo.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(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},QW=Oo&&Oo.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},zd;Object.defineProperty(Oo,"__esModule",{value:!0});Oo.PreconditionEvaluator=void 0;var XW=ut(),JW=Jc(),ZW=nu(),eD=Eu(),eH=gy(),Hd=zi(),tH=Wd(),Kd=zd=class{static{a(this,"PreconditionEvaluator")}constructor(e,t,r){this.hostFunctions=new Map,this.askCache=new Map,this.tripleStore=e,this.queryBodyResolver=t,this.clock=r?.clock??(0,tH.liveClock)()}async evaluate(e,t,r){if(!e)return!0;let i=new Map;return await this.evaluateNode(e,t,r,i)==="yes"}async evaluateNode(e,t,r,i){if(e.broken)return"unknown";if(e.composite){let{op:s,children:o}=e.composite;if(o.length===0)return"unknown";let l=await Promise.all(o.map(c=>this.evaluateNode(c,t,r,i)));return s==="all"?l.includes("no")?"no":l.includes("unknown")?"unknown":"yes":l.includes("yes")?"yes":l.includes("unknown")?"unknown":"no"}if(e.not){let s=await this.evaluateNode(e.not,t,r,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,r)?"yes":"no":"yes"}evaluateSparqlAskMemoized(e,t,r){let i=r.get(e);if(i!==void 0)return i;let s=this.evaluateSparqlAsk(e,t);return r.set(e,s),s}async evaluateQueryRef(e,t){if(!this.queryBodyResolver)return!1;try{let r=await this.queryBodyResolver.resolveSparql(e);if(!r)return!1;let i=this.substituteVariables(r,t),s=await(0,eH.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,r){return this.hostFunctions.has(e)?this.evaluateHostFunction(e,t,r):null}invalidateCache(){this.askCache.clear()}compileAsk(e){let t=this.substituteVariables(e,zd.SENTINEL_IRI),i=new JW.ExoQLParser().parse(t),o=new ZW.ExoQLAlgebraTranslator().translate(i);return new eD.ExoQLQueryExecutor(this.tripleStore).isAskQuery(o)?o:null}evaluateHostFunction(e,t,r){let i=this.hostFunctions.get(e);if(!i)return!0;let s=r?{...r,targetIRI:t}:{targetIRI:t};try{return i(s)}catch{return!1}}async evaluateSparqlAsk(e,t){try{let r=zd.TEMPORAL_TOKEN.test(e),i=r?Hd.DateFormatter.toDateString(this.clock.now()):null,s=this.askCache.get(e);if(s===void 0||r&&s.day!==i){let c=this.compileAsk(e);if(!c)return!1;s={day:i,compiled:c},this.askCache.set(e,s)}let o=JSON.parse(JSON.stringify(s.compiled).replaceAll(zd.SENTINEL_IRI,t));return await new eD.ExoQLQueryExecutor(this.tripleStore).executeAsk(o)}catch{return!1}}substituteVariables(e,t){let r=this.clock.now(),i=r.toISOString(),s=r.getFullYear(),o=r.getMonth(),l=r.getDate(),c=r.getDay(),u=Hd.DateFormatter.toDateString(r),f=Hd.DateFormatter.toDateString(new Date(s,o,l-1)),d=(c+6)%7,p=Hd.DateFormatter.toDateString(new Date(s,o,l-d)),h=Hd.DateFormatter.toDateString(new Date(s,o,l-d-7)),_=`${s}-${String(o+1).padStart(2,"0")}-01`,y=o===0?11:o-1,S=`${o===0?s-1:s}-${String(y+1).padStart(2,"0")}-01`,I=`${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,`"${S}"^^xsd:date`).replace(/\$thisYearStart\b/g,`"${I}"^^xsd:date`).replace(/\$today\b/g,`"${u}"^^xsd:date`)}};Oo.PreconditionEvaluator=Kd;Kd.SENTINEL_IRI="urn:exocortex:cache-sentinel:target";Kd.TEMPORAL_TOKEN=/\$(?:now|today|yesterday|thisWeekStart|lastWeekStart|thisMonthStart|lastMonthStart|thisYearStart)\b/;Oo.PreconditionEvaluator=Kd=zd=YW([(0,XW.injectable)(),QW("design:paramtypes",[Object,Object,Object])],Kd)});var rD=v(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.hasUidFilename=Po.hasNonUidFilename=void 0;Po.registerDefaultHostFunctions=iH;var rH=a(n=>{let e=n.assetUid;if(typeof e!="string"||e.trim()==="")return!1;let t=n.fileBasename;return typeof t!="string"?!1:t!==e},"hasNonUidFilename");Po.hasNonUidFilename=rH;var nH=a(n=>{let e=n.assetUid;if(typeof e!="string"||e.trim()==="")return!1;let t=n.fileBasename;return typeof t!="string"?!1:t===e},"hasUidFilename");Po.hasUidFilename=nH;function iH(n){n.registerHostFunction("hasNonUidFilename",Po.hasNonUidFilename),n.registerHostFunction("hasUidFilename",Po.hasUidFilename)}a(iH,"registerDefaultHostFunctions")});var Sy=v(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.liveUidGenerator=sH;by.seededUidGenerator=aH;var ZE=Ol();function sH(){return{next:a(()=>(0,ZE.v4)(),"next")}}a(sH,"liveUidGenerator");var oH="6ba7b810-9dad-11d1-80b4-00c04fd430c8";function aH(n){let e=0,t=(0,ZE.v5)(n,oH);return{next:a(()=>{let r=`${n}#${e}`;return e+=1,(0,ZE.v5)(r,t)},"next")}}a(aH,"seededUidGenerator")});var vy=v(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.registerResolver=lr;Da.getResolver=cH;Da.isResolverModifierAware=uH;Da.getRegisteredResolverIds=fH;Da.clearResolvers=dH;Da.installDefaultResolvers=EH;var lH=zi(),Ey=new Map,ev=new Set;function lr(n,e,t=!1){Ey.set(n,e),t&&ev.add(n)}a(lr,"registerResolver");function cH(n){return Ey.get(n)}a(cH,"getResolver");function uH(n){return ev.has(n)}a(uH,"isResolverModifierAware");function fH(){return Array.from(Ey.keys())}a(fH,"getRegisteredResolverIds");function dH(){Ey.clear(),ev.clear()}a(dH,"clearResolvers");function cn(n){return n<10?`0${n}`:String(n)}a(cn,"pad2");var pH=["January","February","March","April","May","June","July","August","September","October","November","December"],hH=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mH=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],gH=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function yH(n){let e=["th","st","nd","rd"],t=n%100;return`${n}${e[(t-20)%10]||e[t]||e[0]}`}a(yH,"ordinalDay");var _H=/YYYY|YY|MMMM|MMM|MM|M|Do|DD|D|dddd|ddd|HH|H|hh|h|mm|m|ss|s|A|a/g;function bH(n,e){let t=(n.getHours()+11)%12+1;return e.replace(_H,r=>{switch(r){case"YYYY":return String(n.getFullYear());case"YY":return cn(n.getFullYear()%100);case"MMMM":return pH[n.getMonth()];case"MMM":return hH[n.getMonth()];case"MM":return cn(n.getMonth()+1);case"M":return String(n.getMonth()+1);case"Do":return yH(n.getDate());case"DD":return cn(n.getDate());case"D":return String(n.getDate());case"dddd":return mH[n.getDay()];case"ddd":return gH[n.getDay()];case"HH":return cn(n.getHours());case"H":return String(n.getHours());case"hh":return cn(t);case"h":return String(t);case"mm":return cn(n.getMinutes());case"m":return String(n.getMinutes());case"ss":return cn(n.getSeconds());case"s":return String(n.getSeconds());case"A":return n.getHours()<12?"AM":"PM";case"a":return n.getHours()<12?"am":"pm";default:return r}})}a(bH,"formatDate");function nD(n,e,t){let r=n.getDate(),i=new Date(n.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(r,s)),i}a(nD,"addMonthsClamped");function SH(n,e){if(!e)return n;let t=e.match(/^([+-])(\d+)([dwMy])?$/);if(!t)return n;let r=(t[1]==="-"?-1:1)*parseInt(t[2],10),i=t[3]??"d",s=new Date(n.getTime());switch(i){case"d":s.setDate(s.getDate()+r);break;case"w":s.setDate(s.getDate()+r*7);break;case"M":s=nD(s,r,"M");break;case"y":s=nD(s,r,"y");break}return isNaN(s.getTime())?n:s}a(SH,"applyDateOffset");function wH(n){if(!n)return{offset:null,format:null};let e=n.indexOf(":");if(e<0)return{offset:n,format:null};let t=n.slice(0,e),r=n.slice(e+1);return{offset:t||null,format:r||null}}a(wH,"parseDateModifier");function wy(n,e){return(t,r)=>{let{offset:i,format:s}=wH(r),o=new Date;return n!==0&&o.setDate(o.getDate()+n),o=SH(o,i),bH(o,s??e)}}a(wy,"makeDateResolver");function EH(){lr("today",()=>{let n=new Date;return`${n.getFullYear()}-${cn(n.getMonth()+1)}-${cn(n.getDate())}`}),lr("todayStart",()=>lH.DateFormatter.getTodayStartTimestamp()),lr("date",wy(0,"YYYY-MM-DD"),!0),lr("now",wy(0,"YYYY-MM-DDTHH:mm:ss"),!0),lr("tomorrow",wy(1,"YYYY-MM-DD"),!0),lr("yesterday",wy(-1,"YYYY-MM-DD"),!0),lr("target",n=>n.targetIRI?`"[[${n.targetIRI}]]"`:""),lr("targetFolder",n=>{if(!n.targetFilePath)return"";let e=n.targetFilePath.replace(/^\/+/,""),t=e.lastIndexOf("/");return t>=0?e.slice(0,t):""}),lr("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.")}),lr("nowTimestamp",()=>{let n=new Date;return`${n.getFullYear()}-${cn(n.getMonth()+1)}-${cn(n.getDate())}T${cn(n.getHours())}:${cn(n.getMinutes())}:${cn(n.getSeconds())}`}),lr("nowDate",()=>{let n=new Date;return`${n.getFullYear()}-${cn(n.getMonth()+1)}-${cn(n.getDate())}`}),lr("nowYear",()=>String(new Date().getFullYear())),lr("nowMonth",()=>cn(new Date().getMonth()+1)),lr("userInputLabel",n=>{let e=n.userInput?.label;return typeof e=="string"?e:""}),lr("userInput",(n,e)=>{if(!e)return null;let t=n.userInput?.[e];return typeof t=="string"?t:t==null?null:String(t)}),lr("targetProperty",(n,e)=>{if(!e||!n.targetFm)return null;let t=n.targetFm[e];return t==null?null:Array.isArray(t)?t.map(String):String(t)}),lr("targetRefProperty",(n,e)=>{if(!e)return null;let t=e.indexOf("|");if(t<0)return null;let r=e.slice(0,t),i=e.slice(t+1);if(!r||!i)return null;let s=n.targetRefFm?.[r];if(!s)return null;let o=s[i];return o==null?null:Array.isArray(o)?o.length>0?String(o[0]):null:String(o)}),lr("labelAsArray",n=>{let e=n.userInput?.label;return typeof e=="string"&&e.length>0?[e]:[]}),lr("groundingTargetClass",n=>n.groundingTargetClassUid?`"[[${n.groundingTargetClassUid}]]"`:null),lr("targetClassSelf",n=>{if(!n.targetFilePath)return null;let e=n.targetFilePath.replace(/^\/+/,""),r=e.slice(e.lastIndexOf("/")+1).replace(/\.md$/i,"");return r.length>0?`"[[${r}]]"`:null})}a(EH,"installDefaultResolvers")});var rv=v(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.resolveTemplateBody=TH;Ty.stripTemplateFrontmatter=AH;var tv=vy();(0,tv.installDefaultResolvers)();var vH=/\$([A-Za-z][A-Za-z0-9_]*)((?:[+-]\d+[dwMy])?(?::[A-Za-z0-9:./-]+)?)/g;function TH(n,e={}){return n.replace(vH,(t,r,i)=>{let s=(0,tv.getResolver)(r);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,tv.isResolverModifierAware)(r)?o:o+i})}a(TH,"resolveTemplateBody");function AH(n){let e=n.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return e?n.slice(e[0].length):n}a(AH,"stripTemplateFrontmatter")});var xy=v(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.registerOrderSpecLoader=IH;Tu.clearOrderSpecLoader=xH;Tu.loadDefaultSpec=RH;Tu.orderProperties=CH;var Ay=null,Fa,Iy=!1;function IH(n){Ay=n,Fa=void 0,Iy=!1}a(IH,"registerOrderSpecLoader");function xH(){Ay=null,Fa=void 0,Iy=!1}a(xH,"clearOrderSpecLoader");function RH(){if(Fa!==void 0)return Fa;if(!Ay)return Fa=null,null;try{Fa=Ay()}catch(n){Iy||(console.warn("[OrderSpecResolver] loader threw, falling back to insertion order:",n),Iy=!0),Fa=null}return Fa}a(RH,"loadDefaultSpec");function CH(n,e){if(!e||e.head.length===0&&e.tail.length===0)return n;let t=Object.keys(n),r=new Set(e.head),i=new Set(e.tail),s=e.head.filter(u=>Object.prototype.hasOwnProperty.call(n,u)),o=e.tail.filter(u=>Object.prototype.hasOwnProperty.call(n,u)),l=t.filter(u=>!r.has(u)&&!i.has(u));e.middleStrategy==="alphabetical"&&l.sort((u,f)=>u.localeCompare(f));let c={};for(let u of s)c[u]=n[u];for(let u of l)c[u]=n[u];for(let u of o)c[u]=n[u];return c}a(CH,"orderProperties")});var Yd=v(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.STRING_SCALAR_PROPERTIES=void 0;zl.needsYamlQuoting=iD;zl.quoteYamlString=sD;zl.serializeYamlScalar=$H;var OH=/^[-!&*?|>%@`"'#,[\]{}]/,PH=/[\u0000-\u001f\u007f]/,DH=/^(?:true|True|TRUE|false|False|FALSE)$/,FH=/^(?:null|Null|NULL|~)$/,LH=/^[-+]?(?:0b[01_]+|0o[0-7_]+|0x[0-9a-fA-F_]+|[0-9][0-9_]*)$/,NH=/^(?:[-+]?[0-9][0-9_]*(?:\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,kH=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;zl.STRING_SCALAR_PROPERTIES=new Set(["exo__Asset_label","aliases"]);function MH(n){if(n.length<2||!n.startsWith('"')||!n.endsWith('"'))return!1;let e=n.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(MH,"isCompleteDoubleQuotedScalar");function jH(n){return DH.test(n)||FH.test(n)||LH.test(n)||NH.test(n)||kH.test(n)}a(jH,"looksLikeNonStringScalar");function iD(n,e=!1){return n===""?!0:MH(n)?!1:!!(n!==n.trim()||/:(\s|$)/.test(n)||/\s#/.test(n)||OH.test(n)||PH.test(n)||e&&jH(n))}a(iD,"needsYamlQuoting");function sD(n){let e="";for(let t=0;t<n.length;t++){let r=n[t],i=n.charCodeAt(t);r==="\\"?e+="\\\\":r==='"'?e+='\\"':r===`
71
+ ${r}}`}generateValuesTerm(e){if(e.type==="iri")return`<${e.value}>`;let r=`"${e.value.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;return e.language?r+=`@${e.language}`:e.datatype&&(r+=`^^<${e.datatype}>`),r}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(r=>this.generateExpression(r)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.generateWhereClause(e.pattern,0)} }`;case"in":{let t=this.generateExpression(e.expression),r=e.list.map(i=>this.generateExpression(i)).join(", ");return e.negated?`${t} NOT IN (${r})`:`${t} IN (${r})`}default:throw new bu(`Unknown expression type: ${e.type}`)}}collectVariablesFromOperation(e,t){switch(e.type){case"bgp":for(let r of e.triples)this.collectVariablesFromTriple(r,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 r of e.variables)t.add(r);break;case"project":for(let r of e.variables)t.add(r);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 r of e.variables)t.add(r);for(let r of e.aggregates)t.add(r.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 r of e.operands)this.collectVariablesFromExpression(r,t);break;case"function":case"functionCall":for(let r of e.args)this.collectVariablesFromExpression(r,t);break;case"exists":this.collectVariablesFromOperation(e.pattern,t);break;case"in":this.collectVariablesFromExpression(e.expression,t);for(let r of e.list)this.collectVariablesFromExpression(r,t);break}}};Su.SPARQLGenerator=HE});var Eu=v(ti=>{"use strict";var aW=ti&&ti.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=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(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),lW=ti&&ti.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),W3=ti&&ti.__importStar||(function(){var n=a(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&aW(t,e,r[i]);return lW(t,e),t}})();Object.defineProperty(ti,"__esModule",{value:!0});ti.QueryExecutor=ti.ExoQLQueryExecutor=ti.QueryExecutorError=void 0;var cW=hE(),uW=ry(),fW=FE(),dW=NE(),pW=O3(),hW=D3(),mW=k3(),gW=qE(),yW=j3(),_W=U3(),bW=q3(),SW=G3(),wW=ze(),EW=tt(),vW=Yg(),ln="http://www.w3.org/2001/XMLSchema#",TW=new Set([`${ln}integer`,`${ln}decimal`,`${ln}float`,`${ln}double`,`${ln}nonPositiveInteger`,`${ln}negativeInteger`,`${ln}long`,`${ln}int`,`${ln}short`,`${ln}byte`,`${ln}nonNegativeInteger`,`${ln}unsignedLong`,`${ln}unsignedInt`,`${ln}unsignedShort`,`${ln}unsignedByte`,`${ln}positiveInteger`]),wu=class extends Error{static{a(this,"QueryExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="QueryExecutorError"}};ti.QueryExecutorError=wu;var uy=class{static{a(this,"ExoQLQueryExecutor")}constructor(e,t={}){let r=t.resolveClassHierarchy===!1?e:new bW.ClassHierarchyResolvingStore(e);this.tripleStore=r,this.bgpExecutor=new cW.BGPExecutor(r),this.filterExecutor=new uW.FilterExecutor,this.optionalExecutor=new fW.OptionalExecutor,this.unionExecutor=new dW.UnionExecutor,this.minusExecutor=new pW.MinusExecutor,this.valuesExecutor=new hW.ValuesExecutor,this.aggregateExecutor=new mW.AggregateExecutor,this.constructExecutor=new gW.ConstructExecutor,this.serviceExecutor=new yW.ServiceExecutor(t.serviceConfig),this.graphExecutor=new _W.GraphExecutor(r),this.sparqlGenerator=new SW.SPARQLGenerator,this.filterExecutor.setExistsEvaluator(async(i,s)=>this.evaluateExistsPattern(i,s)),this.filterExecutor.setTripleStore(r)}async evaluateExistsPattern(e,t){for await(let r of this.execute(e))if(t.merge(r)!==null)return!0;return!1}async executeAll(e){let t=[];for await(let r of this.execute(e))t.push(r);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 wu(`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 r=new Set;for(let o of t)for(let l of o.variables())r.add(l);let i=this.collectOperationVariables(e.right);if([...r].some(o=>i.has(o)))for(let o of t){let l=this.substituteVariables(e.right,o);for await(let c of this.execute(l)){let u=o.merge(c);u!==null&&(yield u)}}else{let o=[];for await(let l of this.execute(e.right))o.push(l);for(let l of t)for(let c of o){let u=l.merge(c);u!==null&&(yield u)}}}async*executeLeftJoin(e){let t=[];for await(let o of this.execute(e.left))t.push(o);let r=[];for await(let o of this.execute(e.right))r.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of r)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 r=[];for await(let o of this.execute(e.right))r.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of r)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 r=[];for await(let o of this.execute(e.right))r.push(o);async function*i(){for(let o of t)yield o}a(i,"leftGen");async function*s(){for(let o of r)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(()=>W3(Ro())),r=new Set(e.variables);for await(let i of this.execute(e.input)){let s=new t;for(let o of i.variables())if(r.has(o)){let l=i.get(o);l!==void 0&&s.set(o,l)}yield s}}async*executeOrderBy(e){let t=[];for await(let r of this.execute(e.input))t.push(r);t.sort((r,i)=>{for(let s of e.comparators){let o=this.getExpressionValue(s.expression,r),l=this.getExpressionValue(s.expression,i),c=0;if(o===void 0&&l===void 0?c=0:o===void 0?c=1:l===void 0?c=-1:typeof o=="number"&&typeof l=="number"?c=o-l:c=String(o).localeCompare(String(l)),s.descending&&(c=-c),c!==0)return c}return 0});for(let r of t)yield r}async*executeSlice(e){let t=0,r=e.offset??0,i=e.limit;for await(let s of this.execute(e.input)){if(t>=r){if(i!==void 0&&t-r>=i)break;yield s}t++}}async*executeDistinct(e){let t=new Set;for await(let r of this.execute(e.input)){let i=this.getSolutionKey(r);t.has(i)||(t.add(i),yield r)}}async*executeReduced(e){let t=new Set;for await(let r of this.execute(e.input)){let i=this.getSolutionKey(r);t.has(i)||(t.add(i),yield r)}}async*executeGroup(e){let t=[];for await(let i of this.execute(e.input))t.push(i);let r=this.aggregateExecutor.execute(e,t);if(e.having&&e.having.length>0)for(let i of r)e.having.every(o=>this.filterExecutor.evaluateExpression(o,i)===!0)&&(yield i);else for(let i of r)yield i}async*executeExtend(e){let t=e.expression.type!=="aggregate"&&this.filterExecutor.expressionContainsExists(e.expression);for await(let r of this.execute(e.input)){let i=r.clone(),s=t?await this.evaluateExtendExpressionAsync(e.expression,r):this.evaluateExtendExpression(e.expression,r);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 r of this.execute(e.left))t.push(r);for(let r of t){let i=this.substituteVariables(e.right,r);for await(let s of this.execute(i)){let o=r.merge(s);o!==null&&(yield o)}}}substituteVariables(e,t){let r=JSON.parse(JSON.stringify(e));return this.substituteInOperation(r,t)}substituteInOperation(e,t){if(!e||typeof e!="object")return e;let r=e;return e.type==="bgp"&&e.triples?(e.triples=e.triples.map(i=>this.substituteInTriple(i,t)),e):(r.input&&(r.input=this.substituteInOperation(r.input,t)),r.left&&(r.left=this.substituteInOperation(r.left,t)),r.right&&(r.right=this.substituteInOperation(r.right,t)),r.pattern&&(r.pattern=this.substituteInOperation(r.pattern,t)),r.query&&(r.query=this.substituteInOperation(r.query,t)),r.where&&(r.where=this.substituteInOperation(r.where,t)),r.expression&&this.substituteInExpression(r.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 r of e.operands)this.substituteInExpression(r,t);if(e.args)for(let r of e.args)this.substituteInExpression(r,t);if(e.expression&&this.substituteInExpression(e.expression,t),e.list)for(let r of e.list)this.substituteInExpression(r,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 r=t.get(e.value);if(r!=null){let i=r;if(r instanceof wW.IRI||i.termType==="NamedNode")return{type:"iri",value:r.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*(r,i){let s=this.currentGraphContext;this.currentGraphContext=i;try{r.type==="bgp"&&i&&this.tripleStore.matchInGraph?yield*this.executeBGPInGraph(r,i):yield*this.execute(r)}finally{this.currentGraphContext=s}}.bind(this);yield*this.graphExecutor.execute(e,t)}async*executeBGPInGraph(e,t){if(e.triples.length===0){let{SolutionMapping:r}=await Promise.resolve().then(()=>W3(Ro()));yield new r;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 r=t.get(e.name);if(!r)return;if(r instanceof EW.Literal){let i=r.datatype?.value;if(i===`${ln}dayTimeDuration`)try{return vW.DateTimeFunctions.parseDayTimeDuration(r.value)}catch{return r.value}if(i&&TW.has(i)){let s=parseFloat(r.value);if(!Number.isNaN(s))return s}return r.value}return r.value??r.id??String(r)}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 r=e;if(r.type==="bgp"&&r.triples)for(let i of r.triples)this.collectVarsFromElement(i.subject,t),i.predicate?.type!=="path"&&this.collectVarsFromElement(i.predicate,t),this.collectVarsFromElement(i.object,t);if(r.type==="values"&&r.variables)for(let i of r.variables)t.add(i);r.expression&&this.collectVarsFromExpressionTree(r.expression,t),r.type==="extend"&&r.variable&&t.add(r.variable),r.input&&this.collectVarsFromOperation(r.input,t),r.left&&this.collectVarsFromOperation(r.left,t),r.right&&this.collectVarsFromOperation(r.right,t),r.pattern&&this.collectVarsFromOperation(r.pattern,t),r.query&&this.collectVarsFromOperation(r.query,t),r.where&&this.collectVarsFromOperation(r.where,t)}collectVarsFromElement(e,t){if(!e||typeof e!="object")return;let r=e;r.type==="variable"&&t.add(r.value),r.type==="quoted"&&(this.collectVarsFromElement(r.subject,t),this.collectVarsFromElement(r.predicate,t),this.collectVarsFromElement(r.object,t))}collectVarsFromExpressionTree(e,t){if(!e||typeof e!="object")return;let r=e;if(r.type==="variable"&&r.name&&t.add(r.name),r.type==="exists"&&r.pattern&&this.collectVarsFromOperation(r.pattern,t),r.left&&this.collectVarsFromExpressionTree(r.left,t),r.right&&this.collectVarsFromExpressionTree(r.right,t),r.operands)for(let i of r.operands)this.collectVarsFromExpressionTree(i,t);if(r.args)for(let i of r.args)this.collectVarsFromExpressionTree(i,t);if(r.expression&&this.collectVarsFromExpressionTree(r.expression,t),r.list)for(let i of r.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 wu("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 wu("executeAsk requires an ASK operation");for await(let t of this.execute(e.where))return!0;return!1}};ti.ExoQLQueryExecutor=uy;ti.QueryExecutor=uy});var Z3=v(Co=>{"use strict";var AW=Co&&Co.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(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},IW=Co&&Co.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(Co,"__esModule",{value:!0});Co.CommandResolver=void 0;var xW=ut(),RW=Fd(),ar=ze(),Gt=tt(),te=Vt(),H3=Sa(),z3=pd(),CW=Vc(),OW=Ld(),vu=ow(),fy=NP(),PW=Jc(),DW=nu(),FW=Eu(),Hl=10,dy="exo__Asset",LW=Hl+1,K3="08cec529-90eb-4d43-88de-ceecccea12b0",NW=te.Namespace.EXOCMD.term("SubstitutionToken").value,Y3=new Set(["today","tomorrow","todayStart","targetFolder","target","randomUUIDv4","nowTimestamp","nowDate","nowYear","nowMonth","userInputLabel","userInput","targetProperty","targetRefProperty","labelAsArray","groundingTargetClass","targetClassSelf"]);function kW(n,e){return`__SUBSTITUTE__${n}__${e}__`}a(kW,"buildSubstitutionMarker");function MW(n,e,t){let r=(0,CW.utf8ToBase64)(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return`__SUBSTITUTE_P__${n}__${e}__${r}__`}a(MW,"buildParameterisedMarker");var Q3="3f28af98-c031-4718-8ba2-44ad0b012c52",jW=te.Namespace.EXOCMD.term("TokenInvocation").value,X3="29e2c8f8-2d27-4e58-b467-2e85d46f8122",J3="universal-default-template",zE=class{static{a(this,"CommandResolver")}clearUniversalCache(){this._universalCacheReady=!1,this._universalCacheValue=null,(0,fy.clearUniversalDefault)()}constructor(e,t=RW.NullLogger){this.tripleStore=e,this.logger=t,this.cache=new Map,this.multiCache=new Map,this._ancestorDepthCache=new Map,this._legacyPropertyDefaultsWarnedGroundings=new Set,this._fallbackWarnedKeys=new Set,this._universalCacheReady=!1,this._universalCacheValue=null}async resolveForAssetMulti(e,t,r){if(t.length===0)return[];let i=[...t].sort().join(","),s=`${e}::${i}::${r??""}`,o=this.multiCache.get(s);if(o)return o;let l=r?await this.expandPrototypeChain(r):void 0,c=await this.expandClassHierarchy(t),u=new Map;for(let[h,_]of c){let y=await this.resolveForAsset(e,h,l);for(let b of y){let S=this.getBindingPriority(b.binding)===2?_:0,I=u.get(b.binding.id);(!I||S<I.depth)&&u.set(b.binding.id,{rc:b,depth:S})}}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),b=this.getBindingPriority(_.rc.binding);return y!==b?y-b: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 l of e){if(l===dy){t.set(l,new Set);continue}let c=[];try{c=await this.getClassAncestors(l)}catch{c=[]}t.set(l,new Set(c))}let r=a(l=>{for(let c of e)if(c!==l&&t.get(c)?.has(l)&&!t.get(l)?.has(c))return!0;return!1},"isAncestorOfSibling"),i=e.filter(l=>!r(l)),s=new Map,o=a((l,c)=>{let u=s.get(l);(u===void 0||c<u)&&s.set(l,c)},"setMin");for(let l of i){if(o(l,0),this.looksLikeUUID(l))try{let u=await this.resolveLabelByUID(l);u&&o(u,0)}catch{}if(l===dy)continue;let c=[];try{c=await this.getClassAncestorsWithDepth(l)}catch{c=[]}for(let{ref:u,depth:f}of c)o(u,f)}return s.has(dy)||s.set(dy,LW),s}async resolveForAsset(e,t,r){let i=typeof r=="string"?`s:${r}`:r?`c:${r.join("\0")}`:"",s=`${e}:${t}:${i}`,o=this.cache.get(s);if(o)return o;let l=typeof r=="string"?await this.expandPrototypeChain(r):r,c=await this.findBindings(t,l,e),u=[];for(let f of c){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 r=await this.findSubjectByUID(e);if(!r||(await this.tripleStore.match(r,te.Namespace.RDF.term("type"),te.Namespace.EXOCMD.term("Command"))).length===0)return null;let s=await this.getLiteralValue(r,te.Namespace.EXO.term("Asset_label"))??"Unknown Command",o=await this.getLiteralValue(r,te.Namespace.EXOCMD.term("Command_labelTemplate")),l=await this.getLiteralValue(r,te.Namespace.EXOCMD.term("Command_icon")),c=await this.getLiteralValue(r,te.Namespace.EXOCMD.term("Command_confirmMessage")),u=await this.getLiteralValue(r,te.Namespace.EXOCMD.term("Command_successMessage")),f=await this.getLiteralValue(r,te.Namespace.EXOCMD.term("Command_category")),d=await this.getLiteralValue(r,te.Namespace.EXOCMD.term("Command_openInSameTab")),p=d!==null&&String(d).trim().toLowerCase()==="true",h=await this.loadLinkedPrecondition(r),_=await this.loadLinkedGrounding(r,0,t);return _?{id:e,name:s,labelTemplate:o??void 0,icon:l??void 0,precondition:h??void 0,grounding:_,confirmMessage:c??void 0,successMessage:u??void 0,category:f??void 0,openInSameTab:p||void 0}:null}async findBindings(e,t,r){let i=typeof t=="string"?await this.expandPrototypeChain(t):t,s=await this.tripleStore.match(void 0,te.Namespace.RDF.term("type"),te.Namespace.EXOCMD.term("CommandBinding")),o=[];for(let l of s){let c=l.subject,u=await this.loadBindingDefinition(c);u&&this.bindingMatches(u,e,i,r)&&o.push(u)}return o}async findPaletteEnabledCommands(){let e=await this.tripleStore.match(void 0,te.Namespace.RDF.term("type"),te.Namespace.EXOCMD.term("Command")),t=[],r=new Set;for(let i of e){let s=i.subject;if((await this.getLiteralValue(s,te.Namespace.EXOCMD.term("Command_paletteEnabled")))?.toLowerCase()!=="true")continue;let l=await this.getLiteralValue(s,te.Namespace.EXO.term("Asset_uid"));if(!l){this.logger.warn(`[CommandResolver] paletteEnabled command at ${s.value} has no exo__Asset_uid \u2014 skipped`);continue}let c=await this.loadCommand(l);if(!c){this.logger.warn(`[CommandResolver] paletteEnabled command ${l} could not be loaded (missing grounding?) \u2014 skipped`);continue}let u=await this.getLiteralValue(s,te.Namespace.EXOCMD.term("Command_paletteId")),f=await this.getLiteralValue(s,te.Namespace.EXOCMD.term("Command_cliName")),d=u??f??l;if(r.has(d)){this.logger.warn(`[CommandResolver] duplicate paletteId "${d}" \u2014 first registration wins, dropping ${l}`);continue}r.add(d),t.push({command:c,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 r=e.labelTemplate,i=this.extractPlaceholders(e.labelTemplate);for(let{full:s,body:o}of i){let l=await this.evaluateSelectSnippet(o,t);r=r.replace(s,l)}return r}extractPlaceholders(e){let t=[],r=0;for(;r<e.length;)if(e[r]==="{"){let i=1,s=r+1;for(;s<e.length&&i>0;)e[s]==="{"?i++:e[s]==="}"&&i--,s++;if(i===0){let o=e.slice(r,s),l=e.slice(r+1,s-1);t.push({full:o,body:l})}r=s}else r++;return t}async evaluateSelectSnippet(e,t){try{let r=e.replace(/\$target/g,`<${t}>`),s=new PW.ExoQLParser().parse(r),l=new DW.ExoQLAlgebraTranslator().translate(s),u=await new FW.ExoQLQueryExecutor(this.tripleStore).executeAll(l);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 Gt.Literal||p instanceof ar.IRI?p.value:String(p):""}catch{return""}}async loadBindingDefinition(e){let t=await this.getLiteralValue(e,te.Namespace.EXO.term("Asset_uid"));if(!t)return null;let r=await this.getLiteralValue(e,te.Namespace.EXO.term("Asset_label"))??"",i=await this.getLinkedUID(e,te.Namespace.EXOCMD.term("CommandBinding_command"));if(!i)return null;let s=await this.getLinkedValue(e,te.Namespace.EXOCMD.term("CommandBinding_targetClass")),o=await this.getLinkedValue(e,te.Namespace.EXOCMD.term("CommandBinding_targetPrototype")),l=await this.getLinkedValue(e,te.Namespace.EXOCMD.term("CommandBinding_targetAsset"));if(!s&&!o&&!l)return null;let c=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBinding_position")),u=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBinding_order")),f=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBinding_variant")),d=f!==null?this.coerceVariant(f,t):void 0,p=await this.loadLinkedPreconditionFromProperty(e,te.Namespace.EXOCMD.term("CommandBinding_precondition")),h=await this.loadLinkedStyle(e,t),_=await this.getLinkedUIDs(e,te.Namespace.EXOCMD.term("CommandBinding_overrides"));return{id:t,label:r,commandRef:i,targetClass:s??void 0,targetPrototype:o??void 0,targetAsset:l??void 0,position:c??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 r=await this.tripleStore.match(e,te.Namespace.EXOCMD.term("CommandBinding_style"),void 0);if(r.length>0){let s=r[0].object,o=null;if(s instanceof ar.IRI)o=s;else if(s instanceof Gt.Literal){let l=this.normalizeWikilink(s.value);o=await this.findSubjectByUID(l)}if(o){let l=await this.loadStyleAsset(o);if(l)return l}this.logger.warn(this.capWarning(`CommandBinding ${t}: style reference unresolved, falling back to inline variant`))}let i=await this.getLiteralValue(e,te.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,te.Namespace.EXO.term("Asset_uid"));if(!t)return null;let r=await this.getLiteralValue(e,te.Namespace.EXO.term("Asset_label"))??"",i=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBindingStyle_variant")),s=i!==null?this.coerceVariant(i,t):void 0,o=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBindingStyle_showIcon")),l=this.coerceBoolean(o),c=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBindingStyle_labelClass")),u=c!==null?this.coerceLabelClass(c,t):void 0,f=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBindingStyle_ariaLabel")),d=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBindingStyle_tooltip")),p=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBindingStyle_keyboardShortcut")),h=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("CommandBindingStyle_source")),_=h!==null?this.coerceStyleSource(h,t):void 0;return{id:t,label:r,variant:s,showIcon:l,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 r=String(e).trim().toLowerCase();if(r!==""){if(vu.COMMAND_VARIANT_VALUES.includes(r))return r;this.logger.warn(this.capWarning(`CommandBindingStyle variant "${r}" not in whitelist [${vu.COMMAND_VARIANT_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceLabelClass(e,t){if(e==null)return;let r=String(e).trim().toLowerCase();if(r!==""){if(vu.LABEL_CLASS_VALUES.includes(r))return r;this.logger.warn(this.capWarning(`CommandBindingStyle labelClass "${r}" not in whitelist [${vu.LABEL_CLASS_VALUES.join(",")}]; dropped (asset ${t})`))}}coerceStyleSource(e,t){if(e==null)return;let r=String(e).trim().toLowerCase();if(r!==""){if(vu.STYLE_SOURCE_VALUES.includes(r))return r;this.logger.warn(this.capWarning(`CommandBindingStyle source "${r}" not in whitelist [${vu.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,r,i){if(e.targetAsset&&i&&this.matchesReference(e.targetAsset,i))return!0;if(e.targetPrototype&&r){for(let s of r)if(this.matchesReference(e.targetPrototype,s))return!0}return!!(e.targetClass&&t&&this.matchesReference(e.targetClass,t))}matchesReference(e,t){let r=this.normalizeWikilink(e),i=this.normalizeWikilink(t);if(r===i)return!0;let s=this.extractPathBasename(i);if(s&&s===r)return!0;let o=this.extractPathBasename(r);if(o&&o===i)return!0;let l=this.extractAlias(t);if(l&&r===l)return!0;let c=this.extractAlias(e);return!!(c&&c===i)}extractPathBasename(e){let t=e.match(/\/([^/]+)\.md$/);return t?t[1]:null}extractAlias(e){let t=e.replace(/["'[\]]/g,"").trim(),r=t.indexOf("|");return r>=0?t.substring(r+1).trim():null}getBindingPriority(e){return e.targetAsset?0:e.targetPrototype?1:2}async loadLinkedPrecondition(e){return this.loadLinkedPreconditionFromProperty(e,te.Namespace.EXOCMD.term("Command_precondition"))}async loadLinkedPreconditionFromProperty(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=await this.resolvePreconditionRef(r[0].object);return i?this.loadPreconditionSubject(i,new Set,0):null}async resolvePreconditionRef(e){if(e instanceof ar.IRI)return e;if(e instanceof Gt.Literal){let t=this.normalizeWikilink(e.value);return await this.findSubjectByUID(t)}return null}async loadPreconditionSubject(e,t,r){let i=await this.getLiteralValue(e,te.Namespace.EXO.term("Asset_uid")),s=await this.getLiteralValue(e,te.Namespace.EXO.term("Asset_label"))??"";if(i&&t.has(i))return this.brokenPreconditionNode(i,s);if(r>=Hl)return this.brokenPreconditionNode(i??"",s);let o=await this.tripleStore.match(e,te.Namespace.EXOCMD.term("AllPrecondition_preconditions"),void 0),l=await this.tripleStore.match(e,te.Namespace.EXOCMD.term("AnyPrecondition_preconditions"),void 0),c=await this.tripleStore.match(e,te.Namespace.EXOCMD.term("NotPrecondition_precondition"),void 0);if(o.length>0||l.length>0||c.length>0){let p=new Set(t);if(i&&p.add(i),o.length>0||l.length>0){let _=o.length>0?"all":"any",y=o.length>0?o:l,b=[];for(let S of y)b.push(await this.loadChildPrecondition(S.object,p,r+1));return{id:i??"",label:s,composite:{op:_,children:b}}}let h=await this.loadChildPrecondition(c[0].object,p,r+1);return{id:i??"",label:s,not:h}}let u=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Precondition_sparqlAsk")),f=await this.getLiteralValue(e,te.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,r){let i=await this.resolvePreconditionRef(e);if(!i){let l=e instanceof Gt.Literal?this.normalizeWikilink(e.value):"";return this.brokenPreconditionNode(l,"")}let s=await this.loadPreconditionSubject(i,t,r);if(s)return s;let o=await this.getLiteralValue(i,te.Namespace.EXO.term("Asset_uid"));return this.brokenPreconditionNode(o??"","")}async loadPreconditionQueryRef(e){let t=await this.tripleStore.match(e,te.Namespace.EXOCMD.term("Precondition_query"),void 0);if(t.length===0)return;let r=t[0].object;if(r instanceof ar.IRI)return await this.getLiteralValue(r,te.Namespace.EXO.term("Asset_uid"))??void 0;if(r instanceof Gt.Literal)return this.normalizeWikilink(r.value)}brokenPreconditionNode(e,t){return{id:e,label:t,broken:!0}}async loadLinkedGrounding(e,t,r){if(t>=Hl)return null;let i=await this.tripleStore.match(e,te.Namespace.EXOCMD.term("Command_grounding"),void 0);if(i.length===0)return null;if(i.length===1||!r?.targetClass){let o=await this.resolveGroundingRef(i[0].object);return o?this.loadGroundingDefinition(o,t):null}for(let o of i){let l=await this.resolveGroundingRef(o.object);if(!l)continue;let c=await this.getObsidianName(l,te.Namespace.EXOCMD.term("Grounding_targetPrototype"));if(c&&this.matchesReference(c,r.targetClass))return this.loadGroundingDefinition(l,t)}this.logger.warn(`Command ${e.value}: ${i.length} groundings declared, none matched context.targetClass='${r.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 ar.IRI)return e;if(e instanceof Gt.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>=Hl)return null;let r=await this.getLiteralValue(e,te.Namespace.EXO.term("Asset_uid"));if(!r)return null;let i=await this.getLiteralValue(e,te.Namespace.EXO.term("Asset_label"))??"",s=await this.resolveGroundingTypeReference(e);if(!s)return null;let o=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_targetProperty"));if(o&&this.looksLikeUUID(o)){let B=await this.resolveLabelByUID(o);if(!B)return this.logger.warn(`Grounding ${r}: targetProperty wikilink UID '${o}' is not resolvable to exo__Asset_label \u2014 grounding skipped (would otherwise write a UUID-named frontmatter key).`),null;o=B}if(s===H3.GroundingType.SERVICE_CALL){let B=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_serviceId"));B&&(o=B)}let l=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_targetValueRef")),c=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_targetValueLiteral")),u=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_targetValueSubstitution")),f=null;if(u&&this.looksLikeUUID(u)){let B=await this.resolveLabelByUID(u);if(!B)return this.logger.warn(`Grounding ${r}: targetValueSubstitution UID '${u}' is not resolvable to exo__Asset_label (SubstitutionToken instance missing or unlabelled) \u2014 grounding skipped.`),null;f=B}else u&&(f=u);let d=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_targetValueQuery")),p=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_targetQuery")),h=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_serviceCallPayload")),_=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_appendExpression")),y=await this.getObsidianWikilinkValue(e,te.Namespace.EXOCMD.term("Grounding_isDefinedBy")),b=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_sparqlUpdate")),S=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_targetClass"));if(S&&!this.looksLikeUUID(S)){let B=await this.findUidByLabel(S);B&&(S=B)}let I=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_targetPrototype")),O=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_targetFolder")),T=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_linkBackProperty")),E=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_inputSchema")),P=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_incrementBy")),V=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_shiftDelta")),M;if(P!=null&&P!==""){let B=Number.parseInt(String(P),10);Number.isFinite(B)&&(M=B)}let j=await this.resolvePropertyDefaults(e,r),$=await this.resolveInheritanceRules(e,r),G=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_propertyDefaults"));G!==null&&G!==""&&!this._legacyPropertyDefaultsWarnedGroundings.has(r)&&(this.logger.warn(`Grounding ${r}: 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(r));let ge;s===H3.GroundingType.COMPOSITE&&(ge=await this.loadCompositeSteps(e,t+1));let ye;if(E)try{let B=JSON.parse(E);B?.properties&&(ye=Object.entries(B.properties).map(([oe,Ee])=>{let Ce=Ee.type,xe=Ce==="string"?"text":Ce,Oe=Ee.defaultValue!==void 0?Ee.defaultValue:Ee.default,Re={name:oe,type:xe,label:Ee.title??oe,required:Array.isArray(B.required)&&B.required.includes(oe)};return Oe!=null&&(Re.defaultValue=String(Oe)),typeof Ee.targetClassUid=="string"&&(Re.targetClassUid=Ee.targetClassUid),Re}))}catch{}let Q=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_prefillLabelWithDate")),se=Q!==null&&String(Q).trim().toLowerCase()==="true",J=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_labelTemplate")),ve=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_direction")),re;if(ve!=null){let B=String(ve).trim().toLowerCase();B==="forward"||B==="rollback"?re=B:B!==""&&this.logger.warn(`Grounding ${r}: exocmd__Grounding_direction value '${ve}' is not 'forward' or 'rollback' \u2014 treating as undefined (will default to 'forward' at dispatch).`)}let ie=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_bodyTemplate")),he=await this.getObsidianName(e,te.Namespace.EXOCMD.term("Grounding_templateRef")),Ue=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_cloneTargetBody")),ce=Ue!==null&&String(Ue).trim().toLowerCase()==="true",ue=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_targetsCreatedInstance")),fe=ue!==null&&String(ue).trim().toLowerCase()==="true",ne=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("Grounding_omitLabel")),me=ne!==null&&String(ne).trim().toLowerCase()==="true",Le={id:r,label:i,type:s,targetProperty:o??void 0,targetValueRef:l??void 0,targetValueLiteral:c??void 0,targetValueSubstitution:f??void 0,targetValueQuery:d??void 0,targetQuery:p??void 0,serviceCallPayload:h??void 0,appendExpression:_??void 0,sparqlUpdate:b??void 0,steps:ge,targetClass:S??void 0,targetPrototype:I??void 0,targetFolder:O??void 0,linkBackProperty:T??void 0,incrementBy:M,shiftDelta:V??void 0,propertyDefault:j.length>0?j:void 0,inheritanceRule:$.length>0?$:void 0,isDefinedBy:y??void 0,prefillLabelWithDate:se||void 0,labelTemplate:J??void 0,direction:re,bodyTemplate:ie??void 0,templateRef:he??void 0,cloneTargetBody:ce||void 0,targetsCreatedInstance:fe||void 0,omitLabel:me||void 0};return ye&&(Le.inputSchema=ye),Le}async loadCompositeSteps(e,t){if(t>=Hl)return[];let r=await this.tripleStore.match(e,te.Namespace.EXOCMD.term("Grounding_steps"),void 0),i=[];for(let s of r){let o=null;if(s.object instanceof ar.IRI)o=s.object;else if(s.object instanceof Gt.Literal){let c=this.normalizeWikilink(s.object.value);o=await this.findSubjectByUID(c)}if(!o)continue;let l=await this.loadGroundingDefinition(o,t);l&&i.push(l)}return i}async resolvePropertyDefaults(e,t){let r=await this.resolvePropertyDefaultsForSubject(e,t,te.Namespace.EXOCMD.term("Grounding_propertyDefault")),i=await this.getUniversalCache();return i&&i.propertyDefaults.length>0?(0,fy.mergePropertyDefaults)(i.propertyDefaults,r):r}async resolvePropertyDefaultsForSubject(e,t,r){let i=await this.tripleStore.match(e,r,void 0),s=[];for(let o of i){let l=await this.resolveRefTripleObject(o.object);if(!l)continue;let c=await this.getObsidianName(l,te.Namespace.EXOCMD.term("PropertyDefault_property"));if(!c){this.logger.warn(`Grounding ${t}: PropertyDefault asset missing exocmd__PropertyDefault_property \u2014 entry skipped.`);continue}let u=this.looksLikeUUID(c)?await this.resolveLabelByUID(c):c;if(!u){this.logger.warn(`Grounding ${t}: PropertyDefault property UID '${c}' is not resolvable to exo__Asset_label \u2014 entry skipped.`);continue}let f=await this.getObsidianName(l,te.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,fy.loadUniversalDefault)();if(e)return this._universalCacheValue=e,e;let t=await this.findUniversalSingleton();if(!t)return this._universalCacheValue=null,null;let r=await this.resolvePropertyDefaultsForSubject(t,J3,te.Namespace.EXOCMD.term("Template_propertyDefault")),i=await this.resolveInheritanceRulesForSubject(t,J3,te.Namespace.EXOCMD.term("Template_inheritanceRule"));return this._universalCacheValue={propertyDefaults:r,inheritanceRules:i},this._universalCacheValue}async findUniversalSingleton(){let e=te.Namespace.EXOCMD.term("UniversalDefaultTemplate").value,t=await this.tripleStore.match(void 0,te.Namespace.EXO.term("Instance_class"),void 0),r=[];for(let i of t){let s=!1;if(i.object instanceof ar.IRI)s=i.object.value===e||i.object.value.includes(X3);else if(i.object instanceof Gt.Literal){let o=this.unwrapWikilink(i.object.value);s=o==="exocmd__UniversalDefaultTemplate"||o===X3}s&&i.subject instanceof ar.IRI&&r.push(i.subject)}return r.length===0?null:(r.length===1||(r.sort((i,s)=>i.value.localeCompare(s.value)),this.logger.warn(`Multiple UniversalDefaultTemplate singletons found (${r.length}); selecting deterministically by lexicographic UID order: ${r[0].value}`)),r[0])}async resolveInheritanceRules(e,t){let r=await this.resolveInheritanceRulesForSubject(e,t,te.Namespace.EXOCMD.term("Grounding_inheritanceRule")),i=await this.getUniversalCache();return i&&i.inheritanceRules.length>0?(0,fy.mergeInheritanceRules)(i.inheritanceRules,r):r}async resolveInheritanceRulesForSubject(e,t,r){let i=await this.tripleStore.match(e,r,void 0),s=[],o=t;for(let l of i){let c=await this.resolveRefTripleObject(l.object);if(!c)continue;let u=await this.resolveLabelRef(c,te.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(c,te.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(c,te.Namespace.EXOCMD.term("InheritanceRule_targetClassCondition"),void 0),p,h;if(d.length>0){let T=await this.getObsidianName(c,te.Namespace.EXOCMD.term("InheritanceRule_targetClassCondition"));if(!T||!T.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(T)?(h=T,p=await this.resolveLabelByUID(T)??void 0):p=T}let _=await this.tripleStore.match(c,te.Namespace.EXOCMD.term("InheritanceRule_targetClassExclusion"),void 0),y=[],b=[],S=!1;for(let T of _){let E=null;if(T.object instanceof ar.IRI?E=this.iriToObsidianName(T.object.value)??T.object.value:T.object instanceof Gt.Literal&&(E=this.unwrapWikilink(T.object.value)),!E){S=!0;continue}if(this.looksLikeUUID(E)){b.push(E);let P=await this.resolveLabelByUID(E);P&&y.push(P)}else y.push(E)}if(S){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 I=await this.getLiteralValue(c,te.Namespace.EXOCMD.term("InheritanceRule_priority")),O=50;if(I!==null&&I!==""){let T=Number.parseInt(String(I),10);Number.isFinite(T)&&(O=T)}s.push({sourcePropertyName:u,targetPropertyName:f,targetClassCondition:p,targetClassConditionUid:h,targetClassExclusion:y,targetClassExclusionUids:b,priority:O})}return s}async resolveRefTripleObject(e){if(e instanceof ar.IRI)return e;if(e instanceof Gt.Literal){let t=this.normalizeWikilink(e.value);return t?this.findSubjectByUID(t):null}return null}async resolveLabelRef(e,t){let r=await this.getObsidianName(e,t);return r?this.looksLikeUUID(r)?this.resolveLabelByUID(r):r:null}async resolvePropertyDefaultValue(e,t,r){if(!this.looksLikeUUID(e))return`"[[${e}]]"`;let i=await this.findSubjectByUID(e);if(!i){let l=`${t}|${e}`;return this._fallbackWarnedKeys.has(l)||(this._fallbackWarnedKeys.add(l),this.logger.warn(this.capWarning(`Grounding ${t}: PropertyDefault '${r}' \u2192 value asset ${e} not in store; emitting wikilink (a link, not the substituted value).`))),`"[[${e}]]"`}return await this.assetIsTokenInvocation(i)?this.resolveTokenInvocation(i,e,t,r):await this.assetIsSubstitutionToken(i)?this.dispatchSubstitutionToken(i,e,t,r,void 0):(this.logger.debug(`Grounding ${t}: PropertyDefault '${r}' value '${e}' is not a SubstitutionToken \u2014 emitting wikilink form.`),`"[[${e}]]"`)}async dispatchSubstitutionToken(e,t,r,i,s){let o=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("SubstitutionToken_resolver"));if(!o||!o.trim())return this.logger.warn(`Grounding ${r}: PropertyDefault '${i}' references SubstitutionToken '${t}' with no exocmd__SubstitutionToken_resolver \u2014 falling back to wikilink form.`),`"[[${t}]]"`;let l=o.trim();return Y3.has(l)?s!==void 0?MW(l,t,s):kW(l,t):(this.logger.warn(`Grounding ${r}: PropertyDefault '${i}' SubstitutionToken '${t}' declares unknown resolver-id '${l}' \u2014 falling back to wikilink form. Known ids: ${Array.from(Y3).join(", ")}.`),`"[[${t}]]"`)}async resolveTokenInvocation(e,t,r,i){let s=await this.getObsidianName(e,te.Namespace.EXOCMD.term("TokenInvocation_token"));if(!s)return this.logger.warn(`Grounding ${r}: PropertyDefault '${i}' TokenInvocation '${t}' missing exocmd__TokenInvocation_token \u2014 entry skipped.`),null;let o=await this.getLiteralValue(e,te.Namespace.EXOCMD.term("TokenInvocation_parameter"))??"";if(!this.looksLikeUUID(s))return this.logger.warn(`Grounding ${r}: PropertyDefault '${i}' TokenInvocation '${t}' references non-UUID token '${s}' \u2014 entry skipped.`),null;let l=await this.findSubjectByUID(s);return l?this.dispatchSubstitutionToken(l,s,r,i,o):(this.logger.warn(`Grounding ${r}: 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,te.Namespace.EXO.term("Instance_class"),void 0);for(let i of t)if(i.object instanceof ar.IRI){if(i.object.value===jW||i.object.value.includes(Q3))return!0}else if(i.object instanceof Gt.Literal){let s=this.unwrapWikilink(i.object.value);if(s==="exocmd__TokenInvocation"||s===Q3)return!0}return(await this.tripleStore.match(e,te.Namespace.EXOCMD.term("TokenInvocation_token"),void 0)).length>0?(this.logger.debug(`Asset ${e.value} classified as TokenInvocation via its exocmd__TokenInvocation_token property; exo__Instance_class was absent or unresolved.`),!0):!1}async assetIsSubstitutionToken(e){let t=await this.tripleStore.match(e,te.Namespace.EXO.term("Instance_class"),void 0);for(let i of t)if(i.object instanceof ar.IRI){if(i.object.value===NW||i.object.value.includes(K3))return!0}else if(i.object instanceof Gt.Literal){let s=this.unwrapWikilink(i.object.value);if(s==="exocmd__SubstitutionToken"||s===K3)return!0}return(await this.tripleStore.match(e,te.Namespace.EXOCMD.term("SubstitutionToken_resolver"),void 0)).length>0?(this.logger.debug(`Asset ${e.value} classified as SubstitutionToken via its resolver property; exo__Instance_class was absent or unresolved.`),!0):!1}async resolveGroundingTypeReference(e){let t=await this.tripleStore.match(e,te.Namespace.EXOCMD.term("Grounding_type"),void 0);if(t.length===0)return null;let r=t[0].object;if(r instanceof ar.IRI)return(0,z3.resolveGroundingTypeFromIRI)(r.value);if(r instanceof Gt.Literal){let i=r.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,z3.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],r=new Set([this.normalizeWikilink(e).toLowerCase()]),i=e;for(let s=0;s<Hl;s++){let o=this.extractUuidFromRef(i);if(!o)break;let l=null;try{let u=await this.findSubjectByUID(o);if(!u)break;l=await this.getLinkedValue(u,te.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(!l)break;let c=this.normalizeWikilink(l).toLowerCase();if(r.has(c))break;r.add(c),t.push(l),i=l}return t}extractUuidFromRef(e){let t=this.normalizeWikilink(e);if(this.looksLikeUUID(t))return t;let r=this.extractPathBasename(t);return r&&this.looksLikeUUID(r)?r:null}async findSubjectByUID(e){if(this.tripleStore.findSubjectsByUUID){let r=await this.tripleStore.findSubjectsByUUID(e);if(r.length>0)return r[0]}let t=await this.tripleStore.match(void 0,te.Namespace.EXO.term("Asset_uid"),void 0);for(let r of t)if(r.object instanceof Gt.Literal&&r.object.value===e)return r.subject;return null}async getLiteralValue(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;return i instanceof Gt.Literal||i instanceof ar.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,te.Namespace.EXO.term("Asset_label")):null}async getClassAncestors(e){return(await this.getClassAncestorsWithDepth(e)).map(r=>r.ref)}async getClassAncestorsWithDepth(e){let t=this._ancestorDepthCache.get(e);if(t)return t;let r=new Map,i=new Set,s=await this.resolveClassFileIRI(e);if(!s)return[];let o=new Set([e]),l=await this.getLiteralValue(s,te.Namespace.EXO.term("Asset_uid"));l&&o.add(l);let c=await this.getLiteralValue(s,te.Namespace.EXO.term("Asset_label"));c&&o.add(c);let u=a((p,h)=>{if(o.has(p))return;let _=r.get(p);(_===void 0||h<_)&&r.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(_>=Hl||i.has(h.value))continue;i.add(h.value);let y=await this.tripleStore.match(h,te.Namespace.EXO.term("Class_superClass"),void 0);for(let b of y){let S=b.object;if(!(S instanceof ar.IRI))continue;let I=_+1,O=S.value.startsWith("obsidian://vault/"),T=this.iriToObsidianName(S.value);T&&u(T,I);let E=null;if(O?E=S:T&&(E=await this.resolveClassFileIRI(T)),!E)continue;let P=await this.getLiteralValue(E,te.Namespace.EXO.term("Asset_uid"));P&&u(P,I),i.has(E.value)||f.push({fileIRI:E,depth:I})}}let d=Array.from(r.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,te.Namespace.EXO.term("Asset_label"),void 0);for(let r of t)if(r.object instanceof Gt.Literal&&r.object.value===e&&r.subject instanceof ar.IRI){let i=await this.tripleStore.match(r.subject,te.Namespace.EXO.term("Asset_uid"),void 0);if(i.length>0&&i[0].object instanceof Gt.Literal)return i[0].object.value}return null}async getLinkedUID(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;if(i instanceof ar.IRI){let s=await this.tripleStore.match(i,te.Namespace.EXO.term("Asset_uid"),void 0);return s.length>0&&s[0].object instanceof Gt.Literal?s[0].object.value:i.value.split("/").pop()?.replace(".md","")??null}return i instanceof Gt.Literal?this.normalizeWikilink(i.value):null}async getLinkedUIDs(e,t){let r=await this.tripleStore.match(e,t,void 0),i=[];for(let s of r){let o=s.object;if(o instanceof ar.IRI){let l=await this.tripleStore.match(o,te.Namespace.EXO.term("Asset_uid"),void 0);if(l.length>0&&l[0].object instanceof Gt.Literal)i.push(l[0].object.value);else{let c=o.value.split("/").pop()?.replace(".md","");c&&i.push(c)}}else if(o instanceof Gt.Literal){let l=this.normalizeWikilink(o.value);l&&i.push(l)}}return i}async getLinkedValue(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;return i instanceof Gt.Literal?this.normalizeWikilink(i.value):i instanceof ar.IRI?this.iriToObsidianName(i.value)??i.value:null}async getObsidianName(e,t){let r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;return i instanceof Gt.Literal?this.unwrapWikilink(i.value):i instanceof ar.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 r=t.match(/^\[\[([^\]|]+)\|([^\]]+)\]\]$/);if(r)return r[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 r=await this.tripleStore.match(e,t,void 0);if(r.length===0)return null;let i=r[0].object;if(i instanceof Gt.Literal)return this.resolveWikilinkAlias(i.value);if(i instanceof ar.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 r=t[1],i=await this.findSubjectByUID(r);if(!i)return e;let s=await this.getLiteralValue(i,te.Namespace.EXO.term("Asset_label"));return s?e.replace(`[[${r}]]`,`[[${r}|${s}]]`):e}iriToObsidianName(e){return(0,OW.iriToObsidianName)(e)}normalizeWikilink(e){let t=e.replace(/["'[\]]/g,"").trim(),r=t.indexOf("|");return r>=0?t.substring(0,r):t}};Co.CommandResolver=zE;Co.CommandResolver=zE=AW([(0,xW.injectable)(),IW("design:paramtypes",[Object,Object])],zE)});var YE=v(KE=>{"use strict";Object.defineProperty(KE,"__esModule",{value:!0});KE.validateExoQLAllowlist=$W;var py=qd();function $W(n){if(!n||typeof n!="object")return;let e=n;if(e.type==="update"){let t=n.updates??[];for(let r of t)if(r?.type==="load")throw new py.ExoQLForbiddenKeywordError("LOAD");throw new py.ExoQLForbiddenKeywordError("UPDATE")}if(e.type==="query"){if(e.from){let t=Array.isArray(e.from.default)&&e.from.default.length>0,r=Array.isArray(e.from.named)&&e.from.named.length>0;if(t||r)throw new py.ExoQLForbiddenKeywordError("FROM")}if(Array.isArray(e.where))for(let t of e.where)hy(t);if(Array.isArray(e.template))for(let t of e.template)hy(t)}}a($W,"validateExoQLAllowlist");function hy(n){if(!n||typeof n!="object")return;if(n.type==="service")throw new py.ExoQLForbiddenKeywordError("SERVICE");if(Array.isArray(n.patterns))for(let t of n.patterns)hy(t);let e=n.where;if(Array.isArray(e))for(let t of e)hy(t)}a(hy,"walkPatternForBannedKeywords")});var QE=v(my=>{"use strict";Object.defineProperty(my,"__esModule",{value:!0});my.DEFAULT_EVAL_CONFIG=void 0;my.DEFAULT_EVAL_CONFIG=Object.freeze({enabled:!0,maxNestedEvalCount:100,maxAggregateEvalMillis:1e4})});var gy=v(XE=>{"use strict";Object.defineProperty(XE,"__esModule",{value:!0});XE.evaluateWithExoEval=HW;var UW=Jc(),BW=nu(),VW=Eu(),qW=YE(),GW=QE(),WW=qd();async function HW(n,e={}){if(typeof n!="string")throw new TypeError("evaluateWithExoEval: sparql must be a string");let r=new UW.ExoQLParser().parse(n);if((0,qW.validateExoQLAllowlist)(r),!{...GW.DEFAULT_EVAL_CONFIG,...e.config??{}}.enabled)throw new WW.ExoQLEvalDisabledError;let s="queryType"in r&&typeof r.queryType=="string"?r.queryType:"SELECT";if(!e.store)return s==="ASK"?{kind:"ask",result:!1}:s==="CONSTRUCT"?{kind:"construct",triples:[]}:{kind:"select",rows:[]};let l=new BW.ExoQLAlgebraTranslator().translate(r),c=new VW.ExoQLQueryExecutor(e.store);return c.isAskQuery(l)?{kind:"ask",result:await c.executeAsk(l)}:c.isConstructQuery(l)?{kind:"construct",triples:await c.executeConstruct(l)}:{kind:"select",rows:await c.executeAll(l)}}a(HW,"evaluateWithExoEval")});var zi=v(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.DateFormatter=void 0;var JE=class n{static{a(this,"DateFormatter")}static toISOTimestamp(e){return e.toISOString().replace(/\.\d{3}Z$/,"Z")}static toLocalTimestamp(e){let t=e.getFullYear(),r=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"),l=String(e.getSeconds()).padStart(2,"0");return`${t}-${r}-${i}T${s}:${o}:${l}`}static toDateWikilink(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`"[[${t}-${r}-${i}]]"`}static getTodayWikilink(){return n.toDateWikilink(new Date)}static toDateString(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${i}`}static parseWikilink(e){let r=e.replace(/^["']|["']$/g,"").match(/\[\[(\d{4}-\d{2}-\d{2})\]\]/);return r?r[1]:null}static addDays(e,t){let r=new Date(e);return r.setDate(r.getDate()+t),r}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),n.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[r,i,s]=t,o=new Date(r,i-1,s,0,0,0,0);if(isNaN(o.getTime()))throw new Error(`Invalid date values: ${e}`);return n.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 n.toISOTimestamp(t)}static isISOTimestamp(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(e)}};yy.DateFormatter=JE});var Wd=v(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.liveClock=zW;_y.frozenClock=KW;function zW(){return{now:a(()=>new Date,"now")}}a(zW,"liveClock");function KW(n){let e=new Date(n);return{now:a(()=>new Date(e.getTime()),"now")}}a(KW,"frozenClock")});var tD=v(Oo=>{"use strict";var YW=Oo&&Oo.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(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},QW=Oo&&Oo.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},zd;Object.defineProperty(Oo,"__esModule",{value:!0});Oo.PreconditionEvaluator=void 0;var XW=ut(),JW=Jc(),ZW=nu(),eD=Eu(),eH=gy(),Hd=zi(),tH=Wd(),Kd=zd=class{static{a(this,"PreconditionEvaluator")}constructor(e,t,r){this.hostFunctions=new Map,this.askCache=new Map,this.tripleStore=e,this.queryBodyResolver=t,this.clock=r?.clock??(0,tH.liveClock)()}async evaluate(e,t,r){if(!e)return!0;let i=new Map;return await this.evaluateNode(e,t,r,i)==="yes"}async evaluateNode(e,t,r,i){if(e.broken)return"unknown";if(e.composite){let{op:s,children:o}=e.composite;if(o.length===0)return"unknown";let l=await Promise.all(o.map(c=>this.evaluateNode(c,t,r,i)));return s==="all"?l.includes("no")?"no":l.includes("unknown")?"unknown":"yes":l.includes("yes")?"yes":l.includes("unknown")?"unknown":"no"}if(e.not){let s=await this.evaluateNode(e.not,t,r,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,r)?"yes":"no":"yes"}evaluateSparqlAskMemoized(e,t,r){let i=r.get(e);if(i!==void 0)return i;let s=this.evaluateSparqlAsk(e,t);return r.set(e,s),s}async evaluateQueryRef(e,t){if(!this.queryBodyResolver)return!1;try{let r=await this.queryBodyResolver.resolveSparql(e);if(!r)return!1;let i=this.substituteVariables(r,t),s=await(0,eH.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,r){return this.hostFunctions.has(e)?this.evaluateHostFunction(e,t,r):null}invalidateCache(){this.askCache.clear()}compileAsk(e){let t=this.substituteVariables(e,zd.SENTINEL_IRI),i=new JW.ExoQLParser().parse(t),o=new ZW.ExoQLAlgebraTranslator().translate(i);return new eD.ExoQLQueryExecutor(this.tripleStore).isAskQuery(o)?o:null}evaluateHostFunction(e,t,r){let i=this.hostFunctions.get(e);if(!i)return!0;let s=r?{...r,targetIRI:t}:{targetIRI:t};try{return i(s)}catch{return!1}}async evaluateSparqlAsk(e,t){try{let r=zd.TEMPORAL_TOKEN.test(e),i=r?Hd.DateFormatter.toDateString(this.clock.now()):null,s=this.askCache.get(e);if(s===void 0||r&&s.day!==i){let c=this.compileAsk(e);if(!c)return!1;s={day:i,compiled:c},this.askCache.set(e,s)}let o=JSON.parse(JSON.stringify(s.compiled).replaceAll(zd.SENTINEL_IRI,t));return await new eD.ExoQLQueryExecutor(this.tripleStore).executeAsk(o)}catch{return!1}}substituteVariables(e,t){let r=this.clock.now(),i=r.toISOString(),s=r.getFullYear(),o=r.getMonth(),l=r.getDate(),c=r.getDay(),u=Hd.DateFormatter.toDateString(r),f=Hd.DateFormatter.toDateString(new Date(s,o,l-1)),d=(c+6)%7,p=Hd.DateFormatter.toDateString(new Date(s,o,l-d)),h=Hd.DateFormatter.toDateString(new Date(s,o,l-d-7)),_=`${s}-${String(o+1).padStart(2,"0")}-01`,y=o===0?11:o-1,S=`${o===0?s-1:s}-${String(y+1).padStart(2,"0")}-01`,I=`${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,`"${S}"^^xsd:date`).replace(/\$thisYearStart\b/g,`"${I}"^^xsd:date`).replace(/\$today\b/g,`"${u}"^^xsd:date`)}};Oo.PreconditionEvaluator=Kd;Kd.SENTINEL_IRI="urn:exocortex:cache-sentinel:target";Kd.TEMPORAL_TOKEN=/\$(?:now|today|yesterday|thisWeekStart|lastWeekStart|thisMonthStart|lastMonthStart|thisYearStart)\b/;Oo.PreconditionEvaluator=Kd=zd=YW([(0,XW.injectable)(),QW("design:paramtypes",[Object,Object,Object])],Kd)});var rD=v(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.hasUidFilename=Po.hasNonUidFilename=void 0;Po.registerDefaultHostFunctions=iH;var rH=a(n=>{let e=n.assetUid;if(typeof e!="string"||e.trim()==="")return!1;let t=n.fileBasename;return typeof t!="string"?!1:t!==e},"hasNonUidFilename");Po.hasNonUidFilename=rH;var nH=a(n=>{let e=n.assetUid;if(typeof e!="string"||e.trim()==="")return!1;let t=n.fileBasename;return typeof t!="string"?!1:t===e},"hasUidFilename");Po.hasUidFilename=nH;function iH(n){n.registerHostFunction("hasNonUidFilename",Po.hasNonUidFilename),n.registerHostFunction("hasUidFilename",Po.hasUidFilename)}a(iH,"registerDefaultHostFunctions")});var Sy=v(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.liveUidGenerator=sH;by.seededUidGenerator=aH;var ZE=Ol();function sH(){return{next:a(()=>(0,ZE.v4)(),"next")}}a(sH,"liveUidGenerator");var oH="6ba7b810-9dad-11d1-80b4-00c04fd430c8";function aH(n){let e=0,t=(0,ZE.v5)(n,oH);return{next:a(()=>{let r=`${n}#${e}`;return e+=1,(0,ZE.v5)(r,t)},"next")}}a(aH,"seededUidGenerator")});var vy=v(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});Da.registerResolver=lr;Da.getResolver=cH;Da.isResolverModifierAware=uH;Da.getRegisteredResolverIds=fH;Da.clearResolvers=dH;Da.installDefaultResolvers=EH;var lH=zi(),Ey=new Map,ev=new Set;function lr(n,e,t=!1){Ey.set(n,e),t&&ev.add(n)}a(lr,"registerResolver");function cH(n){return Ey.get(n)}a(cH,"getResolver");function uH(n){return ev.has(n)}a(uH,"isResolverModifierAware");function fH(){return Array.from(Ey.keys())}a(fH,"getRegisteredResolverIds");function dH(){Ey.clear(),ev.clear()}a(dH,"clearResolvers");function cn(n){return n<10?`0${n}`:String(n)}a(cn,"pad2");var pH=["January","February","March","April","May","June","July","August","September","October","November","December"],hH=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],mH=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],gH=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function yH(n){let e=["th","st","nd","rd"],t=n%100;return`${n}${e[(t-20)%10]||e[t]||e[0]}`}a(yH,"ordinalDay");var _H=/YYYY|YY|MMMM|MMM|MM|M|Do|DD|D|dddd|ddd|HH|H|hh|h|mm|m|ss|s|A|a/g;function bH(n,e){let t=(n.getHours()+11)%12+1;return e.replace(_H,r=>{switch(r){case"YYYY":return String(n.getFullYear());case"YY":return cn(n.getFullYear()%100);case"MMMM":return pH[n.getMonth()];case"MMM":return hH[n.getMonth()];case"MM":return cn(n.getMonth()+1);case"M":return String(n.getMonth()+1);case"Do":return yH(n.getDate());case"DD":return cn(n.getDate());case"D":return String(n.getDate());case"dddd":return mH[n.getDay()];case"ddd":return gH[n.getDay()];case"HH":return cn(n.getHours());case"H":return String(n.getHours());case"hh":return cn(t);case"h":return String(t);case"mm":return cn(n.getMinutes());case"m":return String(n.getMinutes());case"ss":return cn(n.getSeconds());case"s":return String(n.getSeconds());case"A":return n.getHours()<12?"AM":"PM";case"a":return n.getHours()<12?"am":"pm";default:return r}})}a(bH,"formatDate");function nD(n,e,t){let r=n.getDate(),i=new Date(n.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(r,s)),i}a(nD,"addMonthsClamped");function SH(n,e){if(!e)return n;let t=e.match(/^([+-])(\d+)([dwMy])?$/);if(!t)return n;let r=(t[1]==="-"?-1:1)*parseInt(t[2],10),i=t[3]??"d",s=new Date(n.getTime());switch(i){case"d":s.setDate(s.getDate()+r);break;case"w":s.setDate(s.getDate()+r*7);break;case"M":s=nD(s,r,"M");break;case"y":s=nD(s,r,"y");break}return isNaN(s.getTime())?n:s}a(SH,"applyDateOffset");function wH(n){if(!n)return{offset:null,format:null};let e=n.indexOf(":");if(e<0)return{offset:n,format:null};let t=n.slice(0,e),r=n.slice(e+1);return{offset:t||null,format:r||null}}a(wH,"parseDateModifier");function wy(n,e){return(t,r)=>{let{offset:i,format:s}=wH(r),o=new Date;return n!==0&&o.setDate(o.getDate()+n),o=SH(o,i),bH(o,s??e)}}a(wy,"makeDateResolver");function EH(){lr("today",()=>{let n=new Date;return`${n.getFullYear()}-${cn(n.getMonth()+1)}-${cn(n.getDate())}`}),lr("todayStart",()=>lH.DateFormatter.getTodayStartTimestamp()),lr("date",wy(0,"YYYY-MM-DD"),!0),lr("now",wy(0,"YYYY-MM-DDTHH:mm:ss"),!0),lr("tomorrow",wy(1,"YYYY-MM-DD"),!0),lr("yesterday",wy(-1,"YYYY-MM-DD"),!0),lr("target",n=>n.targetIRI?`"[[${n.targetIRI}]]"`:""),lr("targetFolder",n=>{if(!n.targetFilePath)return"";let e=n.targetFilePath.replace(/^\/+/,""),t=e.lastIndexOf("/");return t>=0?e.slice(0,t):""}),lr("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.")}),lr("nowTimestamp",()=>{let n=new Date;return`${n.getFullYear()}-${cn(n.getMonth()+1)}-${cn(n.getDate())}T${cn(n.getHours())}:${cn(n.getMinutes())}:${cn(n.getSeconds())}`}),lr("nowDate",()=>{let n=new Date;return`${n.getFullYear()}-${cn(n.getMonth()+1)}-${cn(n.getDate())}`}),lr("nowYear",()=>String(new Date().getFullYear())),lr("nowMonth",()=>cn(new Date().getMonth()+1)),lr("userInputLabel",n=>{let e=n.userInput?.label;return typeof e=="string"?e:""}),lr("userInput",(n,e)=>{if(!e)return null;let t=n.userInput?.[e];return typeof t=="string"?t:t==null?null:String(t)}),lr("targetProperty",(n,e)=>{if(!e||!n.targetFm)return null;let t=n.targetFm[e];return t==null?null:Array.isArray(t)?t.map(String):String(t)}),lr("targetRefProperty",(n,e)=>{if(!e)return null;let t=e.indexOf("|");if(t<0)return null;let r=e.slice(0,t),i=e.slice(t+1);if(!r||!i)return null;let s=n.targetRefFm?.[r];if(!s)return null;let o=s[i];return o==null?null:Array.isArray(o)?o.length>0?String(o[0]):null:String(o)}),lr("labelAsArray",n=>{let e=n.userInput?.label;return typeof e=="string"&&e.length>0?[e]:[]}),lr("groundingTargetClass",n=>n.groundingTargetClassUid?`"[[${n.groundingTargetClassUid}]]"`:null),lr("targetClassSelf",n=>{if(!n.targetFilePath)return null;let e=n.targetFilePath.replace(/^\/+/,""),r=e.slice(e.lastIndexOf("/")+1).replace(/\.md$/i,"");return r.length>0?`"[[${r}]]"`:null})}a(EH,"installDefaultResolvers")});var rv=v(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.resolveTemplateBody=TH;Ty.stripTemplateFrontmatter=AH;var tv=vy();(0,tv.installDefaultResolvers)();var vH=/\$([A-Za-z][A-Za-z0-9_]*)((?:[+-]\d+[dwMy])?(?::[A-Za-z0-9:./-]+)?)/g;function TH(n,e={}){return n.replace(vH,(t,r,i)=>{let s=(0,tv.getResolver)(r);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,tv.isResolverModifierAware)(r)?o:o+i})}a(TH,"resolveTemplateBody");function AH(n){let e=n.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return e?n.slice(e[0].length):n}a(AH,"stripTemplateFrontmatter")});var xy=v(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.registerOrderSpecLoader=IH;Tu.clearOrderSpecLoader=xH;Tu.loadDefaultSpec=RH;Tu.orderProperties=CH;var Ay=null,Fa,Iy=!1;function IH(n){Ay=n,Fa=void 0,Iy=!1}a(IH,"registerOrderSpecLoader");function xH(){Ay=null,Fa=void 0,Iy=!1}a(xH,"clearOrderSpecLoader");function RH(){if(Fa!==void 0)return Fa;if(!Ay)return Fa=null,null;try{Fa=Ay()}catch(n){Iy||(console.warn("[OrderSpecResolver] loader threw, falling back to insertion order:",n),Iy=!0),Fa=null}return Fa}a(RH,"loadDefaultSpec");function CH(n,e){if(!e||e.head.length===0&&e.tail.length===0)return n;let t=Object.keys(n),r=new Set(e.head),i=new Set(e.tail),s=e.head.filter(u=>Object.prototype.hasOwnProperty.call(n,u)),o=e.tail.filter(u=>Object.prototype.hasOwnProperty.call(n,u)),l=t.filter(u=>!r.has(u)&&!i.has(u));e.middleStrategy==="alphabetical"&&l.sort((u,f)=>u.localeCompare(f));let c={};for(let u of s)c[u]=n[u];for(let u of l)c[u]=n[u];for(let u of o)c[u]=n[u];return c}a(CH,"orderProperties")});var Yd=v(zl=>{"use strict";Object.defineProperty(zl,"__esModule",{value:!0});zl.STRING_SCALAR_PROPERTIES=void 0;zl.needsYamlQuoting=iD;zl.quoteYamlString=sD;zl.serializeYamlScalar=$H;var OH=/^[-!&*?|>%@`"'#,[\]{}]/,PH=/[\u0000-\u001f\u007f]/,DH=/^(?:true|True|TRUE|false|False|FALSE)$/,FH=/^(?:null|Null|NULL|~)$/,LH=/^[-+]?(?:0b[01_]+|0o[0-7_]+|0x[0-9a-fA-F_]+|[0-9][0-9_]*)$/,NH=/^(?:[-+]?[0-9][0-9_]*(?:\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/,kH=/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;zl.STRING_SCALAR_PROPERTIES=new Set(["exo__Asset_label","aliases"]);function MH(n){if(n.length<2||!n.startsWith('"')||!n.endsWith('"'))return!1;let e=n.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(MH,"isCompleteDoubleQuotedScalar");function jH(n){return DH.test(n)||FH.test(n)||LH.test(n)||NH.test(n)||kH.test(n)}a(jH,"looksLikeNonStringScalar");function iD(n,e=!1){return n===""?!0:MH(n)?!1:!!(n!==n.trim()||/:(\s|$)/.test(n)||/\s#/.test(n)||OH.test(n)||PH.test(n)||e&&jH(n))}a(iD,"needsYamlQuoting");function sD(n){let e="";for(let t=0;t<n.length;t++){let r=n[t],i=n.charCodeAt(t);r==="\\"?e+="\\\\":r==='"'?e+='\\"':r===`
72
72
  `?e+="\\n":r==="\r"?e+="\\r":r===" "?e+="\\t":i<32||i===127?e+="\\x"+i.toString(16).toUpperCase().padStart(2,"0"):e+=r}return`"${e}"`}a(sD,"quoteYamlString");function $H(n,e=!1){return typeof n!="string"?String(n):iD(n,e)?sD(n):n}a($H,"serializeYamlScalar")});var Nn=v(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0});Ry.DI_TOKENS=void 0;Ry.DI_TOKENS={IFileSystemAdapter:Symbol.for("IFileSystemAdapter"),IVaultAdapter:Symbol.for("IVaultAdapter"),IVaultContext:Symbol.for("IVaultContext"),IMultiVaultManager:Symbol.for("IMultiVaultManager"),ILogger:Symbol.for("ILogger"),IEventBus:Symbol.for("IEventBus"),IConfiguration:Symbol.for("IConfiguration"),INotificationService:Symbol.for("INotificationService"),ClassCreationService:Symbol.for("ClassCreationService"),ConceptCreationService:Symbol.for("ConceptCreationService"),GenericAssetCreationService:Symbol.for("GenericAssetCreationService"),TaskStatusService:Symbol.for("TaskStatusService"),EffortStatusWorkflow:Symbol.for("EffortStatusWorkflow"),StatusTimestampService:Symbol.for("StatusTimestampService"),PropertyCleanupService:Symbol.for("PropertyCleanupService"),FolderRepairService:Symbol.for("FolderRepairService"),RenameToUidService:Symbol.for("RenameToUidService"),NoteToRDFConverter:Symbol.for("NoteToRDFConverter"),IVaultSettings:Symbol.for("IVaultSettings"),AreaHierarchyBuilder:Symbol.for("AreaHierarchyBuilder"),ClassHierarchyResolver:Symbol.for("ClassHierarchyResolver")}});var iv=v(Cy=>{"use strict";Object.defineProperty(Cy,"__esModule",{value:!0});Cy.RDFVocabularyMapper=void 0;var yr=Qn(),oD=ze(),Fe=Vt(),nv=class{static{a(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",Fe.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",Fe.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",Fe.Namespace.RDFS.term("subClassOf")],["exo__Property_range",Fe.Namespace.RDFS.term("range")],["exo__Property_domain",Fe.Namespace.RDFS.term("domain")],["exo__Property_superProperty",Fe.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new yr.Triple(Fe.Namespace.EXO.term("Asset"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.RDFS.term("Resource"))),e.push(new yr.Triple(Fe.Namespace.EXO.term("Class"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.RDFS.term("Class"))),e.push(new yr.Triple(Fe.Namespace.EXO.term("Property"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.RDF.term("Property"))),e.push(new yr.Triple(Fe.Namespace.EMS.term("Task"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EMS.term("Project"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EMS.term("Area"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EMS.term("Workflow"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EMS.term("WorkflowState"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EMS.term("WorkflowTransition"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EXOCMD.term("Command"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EXOCMD.term("Precondition"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EXOCMD.term("Grounding"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e.push(new yr.Triple(Fe.Namespace.EXOCMD.term("CommandBinding"),Fe.Namespace.RDFS.term("subClassOf"),Fe.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new yr.Triple(Fe.Namespace.EXO.term("Instance_class"),Fe.Namespace.RDFS.term("subPropertyOf"),Fe.Namespace.RDF.term("type"))),e.push(new yr.Triple(Fe.Namespace.EXO.term("Asset_isDefinedBy"),Fe.Namespace.RDFS.term("subPropertyOf"),Fe.Namespace.RDFS.term("isDefinedBy"))),e.push(new yr.Triple(Fe.Namespace.EXO.term("Class_superClass"),Fe.Namespace.RDFS.term("subPropertyOf"),Fe.Namespace.RDFS.term("subClassOf"))),e.push(new yr.Triple(Fe.Namespace.EXO.term("Property_range"),Fe.Namespace.RDFS.term("subPropertyOf"),Fe.Namespace.RDFS.term("range"))),e.push(new yr.Triple(Fe.Namespace.EXO.term("Property_domain"),Fe.Namespace.RDFS.term("subPropertyOf"),Fe.Namespace.RDFS.term("domain"))),e.push(new yr.Triple(Fe.Namespace.EXO.term("Property_superProperty"),Fe.Namespace.RDFS.term("subPropertyOf"),Fe.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof oD.IRI)s=r;else{let o=r.match(/^(ems|exo|exocmd)__(.+)$/);if(o){let[,l,c]=o;s=(l==="ems"?Fe.Namespace.EMS:l==="exocmd"?Fe.Namespace.EXOCMD:Fe.Namespace.EXO).term(c)}else s=new oD.IRI(r)}return new yr.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};Cy.RDFVocabularyMapper=nv});var Oy=v(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.OBSIDIAN_VAULT_SCHEME=void 0;Do.vaultPathToIRI=UH;Do.iriToVaultPath=BH;Do.OBSIDIAN_VAULT_SCHEME="obsidian://vault/";function UH(n){let e=n.startsWith("./")?n.slice(2):n;return`${Do.OBSIDIAN_VAULT_SCHEME}${encodeURI(e)}`}a(UH,"vaultPathToIRI");function BH(n){if(!n.startsWith(Do.OBSIDIAN_VAULT_SCHEME))return null;let e=n.slice(Do.OBSIDIAN_VAULT_SCHEME.length);try{return decodeURI(e)}catch{return null}}a(BH,"iriToVaultPath")});var Dy=v(Qd=>{"use strict";Object.defineProperty(Qd,"__esModule",{value:!0});Qd.derivePath=aD;Qd.deriveUrl=VH;Qd.deriveLegacyFlatPath=qH;var sv="assetspaces",Py=/^[A-Za-z0-9._-]+$/;function aD(n){if(typeof n!="string")return null;let e=n.trim();if(e.length===0||/^file:\/\//i.test(e))return null;e=e.replace(/\/+$/,""),e=e.replace(/\.git$/i,"");let t=null;if(!e.includes("://")){let o=/^[^/@\s]+@[^/:\s]+:(.+)$/.exec(e);o&&(t=o[1])}if(t===null){let o=e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"");o=o.replace(/^[^/@]+@/,"");let l=o.indexOf("/");if(l<0)return null;t=o.slice(l+1)}let r=t.split("/").filter(o=>o.length>0);if(r.length<2)return null;let i=r[0],s=r[1];return i==="."||i===".."||s==="."||s===".."||!Py.test(i)||!Py.test(s)?null:`${sv}/${i}/${s}`}a(aD,"derivePath");function VH(n){if(typeof n!="string")return null;let e=n.trim();if(e.length===0)return null;e=e.replace(/^\/+/,"").replace(/\/+$/,"");let t=`${sv}/`;if(!e.startsWith(t))return null;let r=e.slice(t.length).split("/").filter(o=>o.length>0);if(r.length<2)return null;let i=r[0],s=r[1];return i==="."||i===".."||s==="."||s===".."||!Py.test(i)||!Py.test(s)?null:`https://github.com/${i}/${s}`}a(VH,"deriveUrl");function qH(n){let e=aD(n);if(e===null)return null;let t=e.split("/")[2];if(t===void 0||t.length===0)return null;let r=t.startsWith("exoas-")?t.slice(6):t;return r.length===0?null:`${sv}/${r}`}a(qH,"deriveLegacyFlatPath")});var Fy=v(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.FILE_SPACE_CLASS_UID=void 0;Ki.frontmatterDeclaresFileSpace=WH;Ki.discoverFileSpaceExclusions=zH;var GH=Dy();Ki.FILE_SPACE_CLASS_UID="aad8913e-5e9f-4047-879d-93cc46befd52";var lD=/\[\[([^\]|]+)(?:\|[^\]]*)?\]\]/g,ov=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function uD(n){let e=Array.isArray(n)?n:[n],t=[];for(let r of e){if(typeof r!="string")continue;lD.lastIndex=0;let i;for(;(i=lD.exec(r))!==null;)t.push(i[1].trim())}return t}a(uD,"wikilinkTargets");function WH(n){return n?uD(n.exo__Instance_class).some(e=>ov.test(e)&&e.toLowerCase()===Ki.FILE_SPACE_CLASS_UID):!1}a(WH,"frontmatterDeclaresFileSpace");function cD(n,e){try{return n.getFrontmatter(e)}catch{return null}}a(cD,"readFrontmatterSafe");function HH(n){let e=n.exo__AssetSpace_source;if(typeof e=="string"&&e.length>0)return e;let t=n.exo__AssetSpace_git;return typeof t=="string"&&t.length>0?t:null}a(HH,"readSource");function zH(n){let e=[],t=[],r=[],i=new Map,s=a((l,c)=>{if(ov.test(l))return l.toLowerCase()===Ki.FILE_SPACE_CLASS_UID;let u=n.getFirstLinkpathDest(l,c);if(u==null)return!1;let f=i.get(u.path);if(f!==void 0)return f;let p=cD(n,u)?.exo__Asset_uid,h=typeof p=="string"&&p.toLowerCase()===Ki.FILE_SPACE_CLASS_UID;return i.set(u.path,h),h},"isFileSpaceClassRef"),o=a(l=>l.some(c=>ov.test(c)&&c.toLowerCase()===Ki.FILE_SPACE_CLASS_UID),"hasUuidFormRef");for(let l of n.getAllFiles()){let c=cD(n,l);if(!c)continue;let u=uD(c.exo__Instance_class);if(!u.some(h=>s(h,l.path)))continue;t.push(l.path),o(u)||r.push(`FileSpace declaration ${l.path} references the class via a label-form link only \u2014 the sync layer will not pick it up; use the UUID-form wikilink [[${Ki.FILE_SPACE_CLASS_UID}]] (UID-canon)`);let f=HH(c);if(f===null){r.push(`FileSpace declaration ${l.path} has no exo__AssetSpace_source/_git \u2014 mount path underivable, content NOT excluded from the index`);continue}let d=(0,GH.derivePath)(f);if(d===null){r.push(`FileSpace declaration ${l.path}: cannot derive mount path from source "${f}" \u2014 content NOT excluded from the index`);continue}let p=`${d}/`;l.path.startsWith(p)&&r.push(`FileSpace declaration ${l.path} lies INSIDE its own mount ${p} \u2014 it will be excluded from the index together with the content; move the declaration outside the mount folder`),e.push(p)}return{prefixes:e,declarationPaths:t,warnings:r}}a(zH,"discoverFileSpaceExclusions")});var Yl=v(Lr=>{"use strict";var KH=Lr&&Lr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var l=n.length-1;l>=0;l--)(o=n[l])&&(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},YH=Lr&&Lr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},fD=Lr&&Lr.__param||function(n,e){return function(t,r){e(t,r,n)}},cv;Object.defineProperty(Lr,"__esModule",{value:!0});Lr.NoteToRDFConverter=Lr.UNPREFIXED_ASSET_FIELDS=void 0;Lr.canonicalYamlKey=ez;Lr.normaliseExcludedFolders=hD;Lr.isPathExcluded=mD;var av=ut(),_r=Qn(),Yi=ze(),yn=tt(),dD=Yt(),rr=Vt(),pD=Nn(),QH=iv(),XH=Fd(),lv=Oy(),ri=Gw(),JH=Fy();Lr.UNPREFIXED_ASSET_FIELDS=new Set(["archived","draft","pinned","aliases"]);var ZH=/^exo__Asset_(.+)$/;function ez(n){let e=ZH.exec(n);return e&&Lr.UNPREFIXED_ASSET_FIELDS.has(e[1])?e[1]:n}a(ez,"canonicalYamlKey");function hD(n){return Array.isArray(n)?n.map(e=>String(e).replace(/\\/g,"/").trim()).filter(e=>e.length>0).map(e=>e.endsWith("/")?e:`${e}/`):[]}a(hD,"normaliseExcludedFolders");function mD(n,e){if(e.length===0)return!1;let t=n.replace(/\\/g,"/");for(let r of e)if(t.startsWith(r))return!0;return!1}a(mD,"isPathExcluded");function tz(n){if(!n)return"";let e=n.replace(/\\/g,"/");for(;e.startsWith("/");)e=e.slice(1);for(;e.endsWith("/");)e=e.slice(0,-1);return e.length>0?`${e}/`:""}a(tz,"normaliseSubjectIriPrefix");var Kl=cv=class{static{a(this,"NoteToRDFConverter")}constructor(e,t=XH.NullLogger,r={}){this.vault=e,this.logger=t,this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.pendingExtraTriples=[],this.vocabularyMapper=new QH.RDFVocabularyMapper,this.subjectIriPrefix=tz(r.subjectIriPrefix),this.emitInstanceClassAsUid=r.emitInstanceClassAsUid??!1}async convertNote(e){return this.convertNoteFromFrontmatter(e,this.vault.getFrontmatter(e))}async convertNoteFromFrontmatter(e,t){if(!t)return[];let r=this.notePathToIRI(e.path),i=rr.Namespace.EXO.term("Asset_filename"),s=new _r.Triple(r,i,new yn.Literal(e.basename));if(ri.Exo003Parser.isExo003Format(t)){let o=await this.convertExo003Note(e,t);return[s,...o]}return this.convertLegacyNote(e,t,s)}async convertLegacyNote(e,t,r){this.pendingExtraTriples=[];let i=[r],s=this.notePathToIRI(e.path),o,l,c,u=!1,f=rr.Namespace.EXO.term("Statement").value;for(let[y,b]of Object.entries(t)){let S=Lr.UNPREFIXED_ASSET_FIELDS.has(y)?`exo__Asset_${y}`:y;if(!this.isExocortexProperty(S))continue;let I=this.propertyKeyToIRI(S),O=Array.isArray(b)?b:[b];for(let T of O)if(!((y==="exo__Asset_label"||Lr.UNPREFIXED_ASSET_FIELDS.has(y))&&(T==null||typeof T=="string"&&T.trim()==="")))if(y==="exo__Instance_class"){let E=this.valueToClassURI(T);i.push(new _r.Triple(s,I,E))}else{let E=await this.valueToRDFObject(T,e,I);if(S==="exo__Statement_subject"&&o===void 0){let P=E.find(V=>V instanceof Yi.IRI);P&&(o=P)}else if(S==="exo__Statement_predicate"&&l===void 0){let P=E.find(V=>V instanceof Yi.IRI);P&&(l=P)}else S==="exo__Statement_object"&&c===void 0&&(c=E[0]);for(let P of E)if(i.push(new _r.Triple(s,I,P)),this.vocabularyMapper.hasMappingFor(y)&&P instanceof Yi.IRI){let V=this.vocabularyMapper.generateMappedTriple(s,y,P);V&&i.push(V)}}if(y==="exo__Instance_class")for(let T of O){let E=this.valueToClassURI(T);if(E instanceof Yi.IRI){let P=rr.Namespace.RDF.term("type");i.push(new _r.Triple(s,P,E)),E.value===f&&(u=!0)}}if(y==="exo__Asset_label"){let T=rr.Namespace.RDFS.term("label");for(let E of O)typeof E=="string"&&E.length>0&&i.push(new _r.Triple(s,T,new yn.Literal(E)))}}let d="exo__Instance_class"in t||"exo__Asset_uid"in t,p=t.exo__Asset_label,h="exo__Asset_label"in t&&p!==null&&p!==void 0&&!(typeof p=="string"&&p.trim()==="")&&!(Array.isArray(p)&&p.length===0);if(d&&!h){let y=rr.Namespace.RDFS.term("label"),b=rr.Namespace.EXO.term("Asset_label"),S=new yn.Literal(e.basename);i.push(new _r.Triple(s,y,S)),i.push(new _r.Triple(s,b,S))}i.push(...this.pendingExtraTriples),this.pendingExtraTriples=[],u&&o&&l&&c&&i.push(new _r.Triple(o,l,c));let _=await this.convertBodyWikilinks(e,s);return i.push(..._),i}async convertExo003Note(e,t){let r=ri.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case ri.Exo003MetadataType.Namespace:break;case ri.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case ri.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case ri.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case ri.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new Yi.IRI(t.uri);return[new _r.Triple(r,rr.Namespace.OWL.term("sameAs"),i),new _r.Triple(i,rr.Namespace.OWL.term("sameAs"),r)]}convertExo003BlankNode(e,t){let r=this.notePathToIRI(e.path),i=t.uri.replace(/[^a-zA-Z0-9_-]/g,"_");return[new _r.Triple(r,rr.Namespace.OWL.term("sameAs"),new dD.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=ri.Exo003Parser.toTriple(t,i);r.push(s);let o=this.notePathToIRI(e.path);r.push(new _r.Triple(o,rr.Namespace.RDF.term("value"),s.subject))}catch{}return r}async convertExo003Body(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),o=this.createExo003ReferenceResolver(e),l=o(t.subject),c=o(t.predicate);if(l.type==="literal")throw new Error("Body subject cannot be a literal");if(c.type!=="iri")throw new Error("Body predicate must be an IRI");let u=l.type==="iri"?new Yi.IRI(l.value):new dD.BlankNode(l.value),f=new Yi.IRI(c.value),d=ri.Exo003Parser.toLiteral(t,s.trim());r.push(new _r.Triple(u,f,d));let p=this.notePathToIRI(e.path);r.push(new _r.Triple(p,rr.Namespace.RDF.term("value"),u))}catch{}return r}createExo003ReferenceResolver(e){return t=>{let r=this.extractWikilink(t),i=r||t,s=this.vault.getFirstLinkpathDest(i,e.path);if(s){let o=this.vault.getFrontmatter(s);if(o&&ri.Exo003Parser.isExo003Format(o)){let l=ri.Exo003Parser.parse(o);if(l.success&&l.metadata){let c=l.metadata;if(c.metadata===ri.Exo003MetadataType.Anchor||c.metadata===ri.Exo003MetadataType.Namespace)return{type:"iri",value:c.uri};if(c.metadata===ri.Exo003MetadataType.BlankNode)return{type:"blank",value:c.uri.replace(/[^a-zA-Z0-9_-]/g,"_")}}}return{type:"iri",value:this.notePathToIRI(s.path).value}}return!r&&t.includes("://")?{type:"iri",value:t}:{type:"literal",value:t}}}async convertVault(e={}){return(await this.convertVaultWithValidation({strict:!1,excludedFolders:e.excludedFolders})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1,o=0,l=0,c=(0,JH.discoverFileSpaceExclusions)(this.vault);for(let y of c.warnings)this.logger.warn(`FileSpace discovery: ${y}`);let u=[...hD(e.excludedFolders),...c.prefixes],f=u.length===0?t:t.filter(y=>!mD(y.path,u)),d=e.onProgress,p=e.progressIntervalFiles&&e.progressIntervalFiles>0?e.progressIntervalFiles:cv.INDEX_PROGRESS_INTERVAL,h=f.length,_=0;for(let y of f){if(_++,d&&_%p===0&&_<h)try{d(_,h)}catch{}try{let b=this.vault.getFrontmatter(y),S=b?this.validateExocortexAsset(b,y.basename):null;if(S){if(s)throw new Error(`Invariant violation in "${y.path}": ${S.message}`);i.push({path:y.path,reason:`Invariant violation: ${S.message}`}),o++,this.logger.info(`Skipping file with invariant violation: ${y.path}`,{code:S.code,property:S.property,reason:S.message});continue}let I=await this.convertNote(y);r.push(...I)}catch(b){let S=b instanceof Error?b.message:String(b);if(s)throw new Error(`Invalid IRI for file "${y.path}": ${S}`);i.push({path:y.path,reason:`Invalid IRI: ${S}`}),l++,this.logger.info(`Skipping file with invalid IRI: ${y.path}`,{reason:S})}}return o>0&&this.logger.warn(`Skipped ${o} file${o===1?"":"s"} with invariant violations during indexing (paths in developer console)`,{count:o}),l>0&&this.logger.warn(`Skipped ${l} file${l===1?"":"s"} with invalid IRI during indexing (paths in developer console)`,{count:l}),{triples:r,skippedFiles:i,summary:{total:f.length,indexed:f.length-i.length,skipped:i.length},fileSpaces:c}}static inferLabelFromBasename(e){return rr.Namespace.fromPropertyKey(e)!==null?e:null}validateExocortexAsset(e,t){let r=a(d=>d==null?!0:typeof d=="string"?d.trim()==="":Array.isArray(d)?d.length===0||d.every(r):!1,"isEmpty");if(!("exo__Instance_class"in e||"exo__Asset_uid"in e))return null;let s=["exo__Asset_uid","exo__Instance_class"];for(let d of s){if(!(d in e))return{code:"MISSING_PROPERTY",property:d,message:`Required property "${d}" is missing`};if(r(e[d]))return{code:"EMPTY_PROPERTY",property:d,message:`Required property "${d}" is empty`}}let o=["ems__Effort_status","ems__Effort_parent","ems__Effort_lockedBy","ems__Effort_lockExpires","exo__Asset_updatedAt","ems__Effort_startTimestamp"];for(let d of o)if(d in e&&r(e[d]))return{code:"EMPTY_OPTIONAL_PROPERTY",property:d,message:`Optional property "${d}" is present but empty`};let l=e.exo__Instance_class,c=Array.isArray(l)?l:[l],u=null,f=!1;for(let d of c){if(typeof d!="string")continue;let p=this.removeQuotes(d),_=(this.extractWikilink(p)??p).trim();/^[a-z][a-zA-Z0-9]*__/.test(_)&&/[\s()]/.test(_)?u||(u={candidate:d}):f=!0}return u&&!f?{code:"INVALID_INSTANCE_CLASS_IRI",property:"exo__Instance_class",message:`Invalid Instance_class IRI: "${u.candidate}"`}:null}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=(0,lv.vaultPathToIRI)(r.path);Yi.IRI.isValidIRI(i)||t.push({path:r.path,reason:`Path "${r.path}" cannot be converted to a valid IRI`})}return t}notePathToIRI(e){return new Yi.IRI((0,lv.vaultPathToIRI)(`${this.subjectIriPrefix}${e}`))}synthesizeWikilinkTargetIRI(e){return new Yi.IRI((0,lv.vaultPathToIRI)(e))}isExocortexProperty(e){return rr.Namespace.fromPropertyKey(e)!==null}propertyKeyToIRI(e){let t=rr.Namespace.fromPropertyKey(e);if(!t)throw new Error(`Invalid property key: ${e}`);return t.namespace.term(t.localName)}emitTypeTripleForEnumInstance(e,t){let r=this.vault.getFrontmatter(t);if(!r)return;let i=r.exo__Instance_class,s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return;let o=this.valueToClassURI(s);o instanceof Yi.IRI&&(this.pendingExtraTriples.push(new _r.Triple(e,rr.Namespace.RDF.term("type"),o)),this.pendingExtraTriples.push(new _r.Triple(e,rr.Namespace.EXO.term("Instance_class"),o)))}async valueToRDFObject(e,t,r){if(typeof e=="string"){let i=this.removeQuotes(e);if(r?.value.endsWith("#TokenInvocation_parameter"))return[new yn.Literal(i)];let s=this.extractWikilink(i);if(s){let o=this.vault.getFirstLinkpathDest(s,t.path);if(o){let c=this.notePathToIRI(o.path),u=s.includes("|")?s.split("|")[0]:s;if(this.isUUID(u)){let d=new yn.Literal(u);if(r?.value.endsWith("#Grounding_targetValueRef")||r?.value.endsWith("#Grounding_targetValueSubstitution")||r?.value.endsWith("#Grounding_targetClass")||r?.value.endsWith("#Grounding_type")||r?.value.endsWith("#PropertyDefault_value"))return[c];let h=this.expandClassValue(o.basename);if(h)return this.emitTypeTripleForEnumInstance(h,o),[h];let _=this.vault.getFrontmatter(o);if(_){let O=_.exo__Asset_label;if(typeof O=="string"){let T=this.expandClassValue(O);if(T)return this.emitTypeTripleForEnumInstance(T,o),[T]}}let y=r?.value.endsWith("#Asset_prototype")||r?.value.endsWith("/Asset_prototype"),S=((typeof process<"u"?process.env:void 0)?.EXOCORTEX_DUAL_STORAGE_PREDICATES??"").split(",").map(O=>O.trim()).filter(Boolean),I=S.length>0&&S.some(O=>r?.value.endsWith(`#${O}`));return y||I?[c,d]:[c]}let f=this.expandClassValue(o.basename);return f?(this.emitTypeTripleForEnumInstance(f,o),[f]):[c]}if(this.isClassReference(s)){let c=this.expandClassValue(s);if(c)return[c]}let l=s.includes("|")?s.split("|")[0]:s;return this.isUUID(l)?[this.synthesizeWikilinkTargetIRI(`${l}.md`)]:[new yn.Literal(i)]}if(this.isClassReference(i)){let o=this.expandClassValue(i);if(o)return[o]}return this.isISO8601DateTime(i)?[new yn.Literal(i,rr.Namespace.XSD.term("dateTime"))]:[new yn.Literal(i)]}return typeof e=="boolean"?[new yn.Literal(e.toString())]:typeof e=="number"?[new yn.Literal(e.toString(),rr.Namespace.XSD.term("decimal"))]:e instanceof Date?[new yn.Literal(e.toISOString(),rr.Namespace.XSD.term("dateTime"))]:[new yn.Literal(String(e))]}isISO8601DateTime(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})?$/.test(e)}removeQuotes(e){let t=e.trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.substring(1,t.length-1):e}extractWikilink(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1];return r.includes("|")?r.split("|")[0]:r}extractWikilinkAlias(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1],i=r.indexOf("|");return i>=0?r.substring(i+1).trim():null}valueToClassURI(e){if(typeof e!="string")return new yn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);if(s)return s;let o=this.extractWikilinkAlias(t);if(o){let l=this.expandClassValue(o);if(l)return l}if(this.isUUID(i)){let l=this.vault.getFirstLinkpathDest(i,"");if(l){let c=this.expandClassValue(l.basename);if(c)return this.emitInstanceClassAsUid?this.notePathToIRI(l.path):c;let u=this.vault.getFrontmatter(l);if(u){let f=u.exo__Asset_label;if(typeof f=="string"){let d=this.expandClassValue(f);if(d)return this.emitInstanceClassAsUid?this.notePathToIRI(l.path):d}}return this.notePathToIRI(l.path)}}return new yn.Literal(t)}isClassReference(e){return/\s/.test(e)?!1:rr.Namespace.fromPropertyKey(e)!==null}isUUID(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)}expandClassValue(e){let t=this.removeQuotes(e),r=rr.Namespace.fromPropertyKey(t);return!r||/[\s()]/.test(r.localName)?null:r.namespace.term(r.localName)}extractBodyContent(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/;return e.replace(t,"")}extractBodyWikilinks(e){let t=new Set,r,i=new RegExp(this.BODY_WIKILINK_PATTERN.source,"g");for(;(r=i.exec(e))!==null;)r[1]&&t.add(r[1]);return Array.from(t)}async convertBodyWikilinks(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),o=this.extractBodyWikilinks(s),l=rr.Namespace.EXO.term("Asset_bodyLink");for(let c of o){let u=this.vault.getFirstLinkpathDest(c,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new _r.Triple(t,l,f))}else if(this.isClassReference(c)){let f=this.expandClassValue(c);f?r.push(new _r.Triple(t,l,f)):r.push(new _r.Triple(t,l,new yn.Literal(c)))}else r.push(new _r.Triple(t,l,new yn.Literal(c)))}}catch{}return r}};Lr.NoteToRDFConverter=Kl;Kl.INDEX_PROGRESS_INTERVAL=200;Kl.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};Kl.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};Kl.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};Lr.NoteToRDFConverter=Kl=cv=KH([(0,av.injectable)(),fD(0,(0,av.inject)(pD.DI_TOKENS.IVaultAdapter)),fD(1,(0,av.inject)(pD.DI_TOKENS.ILogger)),YH("design:paramtypes",[Object,Object,Object])],Kl)});var Ql=v(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly.FrontmatterService=void 0;var gD=xy(),uv=Yd(),fv=Yl(),Xd=class n{static{a(this,"FrontmatterService")}parse(e){let t=e.match(n.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 r={},i=t.content.split(/\r?\n/),s=null,o=null,l=a(()=>{s!==null&&o!==null&&(r[s]=o),s=null,o=null},"flushArray");for(let c of i){let u=/^ {2}- (.*)$/.exec(c);if(u){s!==null&&o!==null&&o.push(u[1].trim());continue}l();let f=/^([^:\s][^:]*):\s*(.*)$/.exec(c);if(!f)continue;let d=f[1].trim(),p=f[2].trim();p===""?(s=d,o=[]):r[d]=p}return l(),r}updateProperty(e,t,r){t=(0,fv.canonicalYamlKey)(n.normalizeIRI(t)),typeof r=="string"&&(r=n.normalizeIRIValue(r));let i=this.parse(e),s=this.serializeValue(t,r);if(!i.exists)return`---
73
73
  ${s}
74
74
  ---
@@ -309,7 +309,7 @@ To resolve:
309
309
  \u2022 Check service initialization parameters
310
310
  \u2022 Verify all required dependencies are available
311
311
  \u2022 Review service logs for detailed error information
312
- \u2022 Contact support if the issue persists`}};Y0.ServiceError=eA});var qN=v(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.ServiceError=Er.ResourceExhaustedError=Er.NotFoundError=Er.PermissionError=Er.StateTransitionError=Er.NetworkError=Er.ValidationError=Er.ApplicationError=Er.ErrorCode=void 0;var jee=Hs();Object.defineProperty(Er,"ErrorCode",{enumerable:!0,get:a(function(){return jee.ErrorCode},"get")});var $ee=zs();Object.defineProperty(Er,"ApplicationError",{enumerable:!0,get:a(function(){return $ee.ApplicationError},"get")});var Uee=kN();Object.defineProperty(Er,"ValidationError",{enumerable:!0,get:a(function(){return Uee.ValidationError},"get")});var Bee=MN();Object.defineProperty(Er,"NetworkError",{enumerable:!0,get:a(function(){return Bee.NetworkError},"get")});var Vee=jN();Object.defineProperty(Er,"StateTransitionError",{enumerable:!0,get:a(function(){return Vee.StateTransitionError},"get")});var qee=$N();Object.defineProperty(Er,"PermissionError",{enumerable:!0,get:a(function(){return qee.PermissionError},"get")});var Gee=UN();Object.defineProperty(Er,"NotFoundError",{enumerable:!0,get:a(function(){return Gee.NotFoundError},"get")});var Wee=BN();Object.defineProperty(Er,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return Wee.ResourceExhaustedError},"get")});var Hee=VN();Object.defineProperty(Er,"ServiceError",{enumerable:!0,get:a(function(){return Hee.ServiceError},"get")})});var rA=v(Q0=>{"use strict";Object.defineProperty(Q0,"__esModule",{value:!0});Q0.ShapeRegistry=void 0;var tA=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}};Q0.ShapeRegistry=tA});var GN=v(Ks=>{"use strict";var zee=Ks&&Ks.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=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(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Kee=Ks&&Ks.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),nA=Ks&&Ks.__importStar||(function(){var n=a(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&zee(t,e,r[i]);return Kee(t,e),t}})();Object.defineProperty(Ks,"__esModule",{value:!0});Ks.ShapeLoader=void 0;var iA=rA(),Ua=ze(),Xu=tt(),qr=Vt(),X0="http://www.w3.org/ns/shacl#",Yee="http://www.w3.org/2001/XMLSchema#",Tve=[["exo__",qr.Namespace.EXO],["ems__",qr.Namespace.EMS],["exocmd__",qr.Namespace.EXOCMD],["ims__",qr.Namespace.IMS],["ztlk__",qr.Namespace.ZTLK],["ptms__",qr.Namespace.PTMS],["lit__",qr.Namespace.LIT],["inbox__",qr.Namespace.INBOX],["pmbok__",qr.Namespace.PMBOK]],Ju=class n{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e){let{readdir:t,readFile:r}=await Promise.resolve().then(()=>nA(require("fs/promises"))),i=await Promise.resolve().then(()=>nA(require("path"))),s=new iA.ShapeRegistry;return await n.scanDir(e,s,{readdir:t,readFile:r,path:i}),s}static async loadFromRDFGraph(e){let t=new iA.ShapeRegistry,r=qr.Namespace.EXO,i=qr.Namespace.RDFS,s=qr.Namespace.RDF,o=await n.buildUidClassIndex(e),[l,c]=await Promise.all([e.match(void 0,s.term("type"),r.term("ObjectProperty")),e.match(void 0,s.term("type"),r.term("Property"))]),u=new Set;for(let f of[...l,...c])f.subject instanceof Ua.IRI&&u.add(f.subject.value);for(let f of u){let d;try{d=new Ua.IRI(f)}catch{continue}let[p,h,_,y,b,S,I,O,T]=await Promise.all([e.match(d,i.term("domain"),void 0),e.match(d,r.term("Property_domain"),void 0),e.match(d,i.term("range"),void 0),e.match(d,r.term("Property_range"),void 0),e.match(d,r.term("Property_cardinality"),void 0),e.match(d,r.term("Property_severity"),void 0),e.match(d,r.term("Asset_label"),void 0),e.match(d,i.term("label"),void 0),e.match(d,r.term("Property_minCount"),void 0)]),E=[...I,...O],P=[...p,...h],V=[..._,...y];if(P.length===0)continue;let M=null;for(let te of E)if(te.object instanceof Xu.Literal&&(M=n.labelToIRI(te.object.value),M))break;if(!M)continue;let j=await Promise.all(P.map(async te=>te.object instanceof Ua.IRI?await n.resolveClassIRI(te.object.value,e,o):null)),$=Array.from(new Set(j.filter(te=>te!==null))),G=await Promise.all(V.map(async te=>{if(te.object instanceof Ua.IRI)return await n.resolveClassIRI(te.object.value,e,o);if(te.object instanceof Xu.Literal){let ie=te.object.value;if(ie.startsWith("http://")||ie.startsWith("https://"))return ie}return null})),ge=Array.from(new Set(G.filter(te=>te!==null))),ye=n.cardinalityFromIRI(b[0]?.object instanceof Ua.IRI?b[0].object.value:void 0),Q=n.severityFromValue(S[0]?.object instanceof Xu.Literal||S[0]?.object instanceof Ua.IRI?S[0].object.value:void 0),se=T[0]?.object,J=se instanceof Xu.Literal?parseInt(se.value,10):NaN,ve=isNaN(J)?void 0:J;t.register({propertyIRI:M,domain:$,range:ge.length>0?ge:void 0,cardinality:ye,severity:Q,minCount:ve})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>nA(require("fs/promises"))),r=await t(e,"utf-8"),i=JSON.parse(r),s=new iA.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static extractUidFromFileIRI(e){let t=n.FILE_IRI_UID_RE.exec(e);return t?t[1].toLowerCase():null}static async buildUidClassIndex(e){let t=qr.Namespace.RDFS,r=qr.Namespace.EXO,[i,s]=await Promise.all([e.match(void 0,t.term("label"),void 0),e.match(void 0,r.term("Asset_label"),void 0)]),o=new Map;for(let l of[...i,...s]){if(!(l.subject instanceof Ua.IRI)||!(l.object instanceof Xu.Literal))continue;let c=n.extractUidFromFileIRI(l.subject.value);if(!c||o.has(c))continue;let u=l.object.value.trim();if(/\s/.test(u))continue;let f=n.labelToIRI(u);f&&o.set(c,f)}return o}static async resolveClassIRI(e,t,r){if(e.startsWith("https://exocortex.my/ontology/")||e.startsWith("http://www.w3.org/"))return e;let i;try{i=new Ua.IRI(e)}catch{return null}let s=qr.Namespace.RDFS,o=qr.Namespace.EXO,[l,c]=await Promise.all([t.match(i,s.term("label"),void 0),t.match(i,o.term("Asset_label"),void 0)]);for(let u of[...l,...c])if(u.object instanceof Xu.Literal){let f=n.labelToIRI(u.object.value);if(f)return f}if(r){let u=n.extractUidFromFileIRI(e);if(u){let f=r.get(u);if(f)return f}}return e}static async scanDir(e,t,r){let i;try{i=await r.readdir(e,{withFileTypes:!0})}catch{return}for(let s of i){let o=r.path.join(e,s.name);if(s.isDirectory())await n.scanDir(o,t,r);else if(s.isFile()&&s.name.endsWith(".md"))try{await n.processFile(o,t,r.readFile,r.path)}catch{}}}static async processFile(e,t,r,i){let s;try{s=await r(e,"utf-8")}catch{return}let o=n.parseFrontmatter(s);if(!o)return;let l="38277bfa-d7f9-4a75-b856-b23276ab0db3",c="9a1cf31c-9d41-4ef3-9023-584a8d087d16";if(!n.asArray(o.exo__Instance_class).some(j=>{let $=n.extractWikilinkRef(j);return $==="exo__Property"||$==="exo__ObjectProperty"||$===l||$===c||$?.includes("|exo__Property")||$?.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 j=i.basename(e,".md");qr.Namespace.fromPropertyKey(j)&&(d=j)}if(!d)return;let h=n.labelToIRI(d);if(!h)return;let _=o.exo__Property_domain,y=o.exo__Property_range,b=o.exo__Property_cardinality,S=o.exo__Property_severity,I=o.exo__Property_minCount,O=n.asArray(_).map(j=>n.wikilinkToIRI(j)).filter(j=>j!==null);if(O.length===0)return;let T=n.asArray(y).map(j=>n.wikilinkToIRI(j)).filter(j=>j!==null),E=n.cardinalityFromLabel(typeof b=="string"?b:void 0),P=n.severityFromValue(typeof S=="string"?S:void 0),V=typeof I=="string"?parseInt(I,10):void 0,M=V!==void 0&&!isNaN(V)?V:void 0;t.register({propertyIRI:h,domain:O,range:T.length>0?T:void 0,cardinality:E,severity:P,minCount:M})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let r=t[1],i={},s=r.split(/\r?\n/),o=null,l=null;for(let c of s){let u=/^ {2}- (.*)$/.exec(c);if(u){o&&l&&l.push(u[1].trim());continue}o&&l&&(i[o]=l,o=null,l=null);let f=/^([^:]+):\s*(.*)$/.exec(c);if(!f)continue;let d=f[1].trim(),p=f[2].trim();p===""?(o=d,l=[]):i[d]=p}return o&&l&&(i[o]=l),i}static labelToIRI(e){let t=qr.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,""),r=/\[\[([^\]]+)\]\]/.exec(t);return r?r[1]:t}static wikilinkToIRI(e){let t=n.extractWikilinkRef(e);if(!t)return null;let r=t.split("|"),i=r.length>1?[r[1],r[0]]:[r[0]];for(let s of i){let o=n.labelToIRI(s.trim());if(o)return o}return t.startsWith("http")?t:t.startsWith("sh:")?X0+t.substring(3):t.startsWith("xsd:")?Yee+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(n.CARDINALITY_SINGLE_UID))return"Single";if(e.includes(n.CARDINALITY_MULTIPLE_UID))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=n.extractWikilinkRef(e)??e,r=t.split("|").pop()??t;if(r.includes("Single"))return"Single";if(r.includes("Multiple"))return"Multiple";if(t.includes(n.CARDINALITY_SINGLE_UID))return"Single";if(t.includes(n.CARDINALITY_MULTIPLE_UID))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===X0+"Violation"?"sh:Violation":e.includes("Warning")||e===X0+"Warning"?"sh:Warning":e.includes("Info")||e===X0+"Info"?"sh:Info":"sh:Violation"}};Ks.ShapeLoader=Ju;Ju.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;Ju.CARDINALITY_SINGLE_UID="c93c4b2f-b43d-4cc9-8dd0-31514d608da2";Ju.CARDINALITY_MULTIPLE_UID="59a37aa7-ffbe-4e0d-ba60-06ae370d880f"});var aA=v(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.ShapeRegistry=void 0;Zu.extractUidFromIRI=oA;Zu.validate=rte;var sA=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(r=>[r.propertyIRI,r])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};Zu.ShapeRegistry=sA;var Qee="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Xee=["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/ns/shacl#","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 Jee(n){return Xee.some(e=>n.startsWith(e))}a(Jee,"isExternalOntologyIRI");var Zee=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function ete(n){return Zee.some(e=>n.startsWith(e))}a(ete,"isXSDDatatypeIRI");var tte=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function oA(n){let e=tte.exec(n);return e?e[1].toLowerCase():null}a(oA,"extractUidFromIRI");function rte(n,e,t,r){let i=new Map,s=new Map;for(let c of n){let{subject:u,predicate:f,object:d}=c;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===Qee){if(_.type==="iri"){let b=i.get(p)??[];b.push(_.value),i.set(p,b);let S=oA(p);if(S){let I=`uid:${S}`,O=i.get(I)??[];O.push(_.value),i.set(I,O)}}}else{let b=s.get(p);b||(b=new Map,s.set(p,b));let S=b.get(h)??[];S.push(_),b.set(h,S)}}let o=[],l=new Set([...i.keys(),...s.keys()]);for(let c of l){if(c.startsWith("uid:"))continue;let u=i.get(c)??[],f=s.get(c)??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:c,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:c,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(Jee(_.value))continue;let y=i.get(_.value)??[];if(y.length===0){let S=oA(_.value);S&&(y=i.get(`uid:${S}`)??[])}if(!d.range.some(S=>y.some(I=>I===S||t.isSubClassOf(I,S)))){let S=y.length===0;o.push({focusNode:c,propertyPath:d.propertyIRI,severity:S?"sh:Warning":d.severity,constraint:"class",message:S?`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(I=>ete(I));if(y.length===0)continue;let b=_.datatype??"http://www.w3.org/2001/XMLSchema#string";y.some(I=>I===b)||o.push({focusNode:c,propertyPath:d.propertyIRI,severity:d.severity,constraint:"datatype",message:d.message??`sh:datatype violation: literal "${_.value}" has datatype <${b}>, expected ${y.join(" | ")}`,actualValue:_.value,expectedRange:y.join(" | ")})}}}}}if(r?.closedWorldMode)for(let c of l){let u=s.get(c)??new Map;for(let f of u.keys())e.hasShape(f)||o.push({focusNode:c,propertyPath:f,severity:"sh:Warning",constraint:"unknown-property",message:`Unknown property: <${f}> has no registered shape`})}return o.sort((c,u)=>{let f=c.focusNode.localeCompare(u.focusNode);return f!==0?f:c.propertyPath.localeCompare(u.propertyPath)}),{conforms:!o.some(c=>c.severity==="sh:Violation"),violations:o}}a(rte,"validate")});var WN=v(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});J0.ApplicationErrorHandler=void 0;var lA=zs(),nte=Hs(),ite=Xl(),cA=class{static{a(this,"ApplicationErrorHandler")}constructor(e={},t,r){this.logger=t,this.notifier=r,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 r=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(r.message),this.callTelemetryHooks("onError",r,t),this.formatError(r)}async executeWithRetry(e,t){let r,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(r=this.ensureApplicationError(s,t),!r.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",r,t),i>=this.retryConfig.maxRetries&&r.retriable&&this.callTelemetryHooks("onRetryExhausted",r,i+1),r;let o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",r,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw r}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof lA.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends lA.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 lA.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=nte.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(`
312
+ \u2022 Contact support if the issue persists`}};Y0.ServiceError=eA});var qN=v(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.ServiceError=Er.ResourceExhaustedError=Er.NotFoundError=Er.PermissionError=Er.StateTransitionError=Er.NetworkError=Er.ValidationError=Er.ApplicationError=Er.ErrorCode=void 0;var jee=Hs();Object.defineProperty(Er,"ErrorCode",{enumerable:!0,get:a(function(){return jee.ErrorCode},"get")});var $ee=zs();Object.defineProperty(Er,"ApplicationError",{enumerable:!0,get:a(function(){return $ee.ApplicationError},"get")});var Uee=kN();Object.defineProperty(Er,"ValidationError",{enumerable:!0,get:a(function(){return Uee.ValidationError},"get")});var Bee=MN();Object.defineProperty(Er,"NetworkError",{enumerable:!0,get:a(function(){return Bee.NetworkError},"get")});var Vee=jN();Object.defineProperty(Er,"StateTransitionError",{enumerable:!0,get:a(function(){return Vee.StateTransitionError},"get")});var qee=$N();Object.defineProperty(Er,"PermissionError",{enumerable:!0,get:a(function(){return qee.PermissionError},"get")});var Gee=UN();Object.defineProperty(Er,"NotFoundError",{enumerable:!0,get:a(function(){return Gee.NotFoundError},"get")});var Wee=BN();Object.defineProperty(Er,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return Wee.ResourceExhaustedError},"get")});var Hee=VN();Object.defineProperty(Er,"ServiceError",{enumerable:!0,get:a(function(){return Hee.ServiceError},"get")})});var rA=v(Q0=>{"use strict";Object.defineProperty(Q0,"__esModule",{value:!0});Q0.ShapeRegistry=void 0;var tA=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}};Q0.ShapeRegistry=tA});var GN=v(Ks=>{"use strict";var zee=Ks&&Ks.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=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(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Kee=Ks&&Ks.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),nA=Ks&&Ks.__importStar||(function(){var n=a(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&zee(t,e,r[i]);return Kee(t,e),t}})();Object.defineProperty(Ks,"__esModule",{value:!0});Ks.ShapeLoader=void 0;var iA=rA(),Ua=ze(),Xu=tt(),qr=Vt(),X0="http://www.w3.org/ns/shacl#",Yee="http://www.w3.org/2001/XMLSchema#",Tve=[["exo__",qr.Namespace.EXO],["ems__",qr.Namespace.EMS],["exocmd__",qr.Namespace.EXOCMD],["ims__",qr.Namespace.IMS],["ztlk__",qr.Namespace.ZTLK],["ptms__",qr.Namespace.PTMS],["lit__",qr.Namespace.LIT],["inbox__",qr.Namespace.INBOX],["pmbok__",qr.Namespace.PMBOK]],Ju=class n{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e){let{readdir:t,readFile:r}=await Promise.resolve().then(()=>nA(require("fs/promises"))),i=await Promise.resolve().then(()=>nA(require("path"))),s=new iA.ShapeRegistry;return await n.scanDir(e,s,{readdir:t,readFile:r,path:i}),s}static async loadFromRDFGraph(e){let t=new iA.ShapeRegistry,r=qr.Namespace.EXO,i=qr.Namespace.RDFS,s=qr.Namespace.RDF,o=await n.buildUidClassIndex(e),[l,c]=await Promise.all([e.match(void 0,s.term("type"),r.term("ObjectProperty")),e.match(void 0,s.term("type"),r.term("Property"))]),u=new Set;for(let f of[...l,...c])f.subject instanceof Ua.IRI&&u.add(f.subject.value);for(let f of u){let d;try{d=new Ua.IRI(f)}catch{continue}let[p,h,_,y,b,S,I,O,T]=await Promise.all([e.match(d,i.term("domain"),void 0),e.match(d,r.term("Property_domain"),void 0),e.match(d,i.term("range"),void 0),e.match(d,r.term("Property_range"),void 0),e.match(d,r.term("Property_cardinality"),void 0),e.match(d,r.term("Property_severity"),void 0),e.match(d,r.term("Asset_label"),void 0),e.match(d,i.term("label"),void 0),e.match(d,r.term("Property_minCount"),void 0)]),E=[...I,...O],P=[...p,...h],V=[..._,...y];if(P.length===0)continue;let M=null;for(let re of E)if(re.object instanceof Xu.Literal&&(M=n.labelToIRI(re.object.value),M))break;if(!M)continue;let j=await Promise.all(P.map(async re=>re.object instanceof Ua.IRI?await n.resolveClassIRI(re.object.value,e,o):null)),$=Array.from(new Set(j.filter(re=>re!==null))),G=await Promise.all(V.map(async re=>{if(re.object instanceof Ua.IRI)return await n.resolveClassIRI(re.object.value,e,o);if(re.object instanceof Xu.Literal){let ie=re.object.value;if(ie.startsWith("http://")||ie.startsWith("https://"))return ie}return null})),ge=Array.from(new Set(G.filter(re=>re!==null))),ye=n.cardinalityFromIRI(b[0]?.object instanceof Ua.IRI?b[0].object.value:void 0),Q=n.severityFromValue(S[0]?.object instanceof Xu.Literal||S[0]?.object instanceof Ua.IRI?S[0].object.value:void 0),se=T[0]?.object,J=se instanceof Xu.Literal?parseInt(se.value,10):NaN,ve=isNaN(J)?void 0:J;t.register({propertyIRI:M,domain:$,range:ge.length>0?ge:void 0,cardinality:ye,severity:Q,minCount:ve})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>nA(require("fs/promises"))),r=await t(e,"utf-8"),i=JSON.parse(r),s=new iA.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static extractUidFromFileIRI(e){let t=n.FILE_IRI_UID_RE.exec(e);return t?t[1].toLowerCase():null}static async buildUidClassIndex(e){let t=qr.Namespace.RDFS,r=qr.Namespace.EXO,[i,s]=await Promise.all([e.match(void 0,t.term("label"),void 0),e.match(void 0,r.term("Asset_label"),void 0)]),o=new Map;for(let l of[...i,...s]){if(!(l.subject instanceof Ua.IRI)||!(l.object instanceof Xu.Literal))continue;let c=n.extractUidFromFileIRI(l.subject.value);if(!c||o.has(c))continue;let u=l.object.value.trim();if(/\s/.test(u))continue;let f=n.labelToIRI(u);f&&o.set(c,f)}return o}static async resolveClassIRI(e,t,r){if(e.startsWith("https://exocortex.my/ontology/")||e.startsWith("http://www.w3.org/"))return e;let i;try{i=new Ua.IRI(e)}catch{return null}let s=qr.Namespace.RDFS,o=qr.Namespace.EXO,[l,c]=await Promise.all([t.match(i,s.term("label"),void 0),t.match(i,o.term("Asset_label"),void 0)]);for(let u of[...l,...c])if(u.object instanceof Xu.Literal){let f=n.labelToIRI(u.object.value);if(f)return f}if(r){let u=n.extractUidFromFileIRI(e);if(u){let f=r.get(u);if(f)return f}}return e}static async scanDir(e,t,r){let i;try{i=await r.readdir(e,{withFileTypes:!0})}catch{return}for(let s of i){let o=r.path.join(e,s.name);if(s.isDirectory())await n.scanDir(o,t,r);else if(s.isFile()&&s.name.endsWith(".md"))try{await n.processFile(o,t,r.readFile,r.path)}catch{}}}static async processFile(e,t,r,i){let s;try{s=await r(e,"utf-8")}catch{return}let o=n.parseFrontmatter(s);if(!o)return;let l="38277bfa-d7f9-4a75-b856-b23276ab0db3",c="9a1cf31c-9d41-4ef3-9023-584a8d087d16";if(!n.asArray(o.exo__Instance_class).some(j=>{let $=n.extractWikilinkRef(j);return $==="exo__Property"||$==="exo__ObjectProperty"||$===l||$===c||$?.includes("|exo__Property")||$?.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 j=i.basename(e,".md");qr.Namespace.fromPropertyKey(j)&&(d=j)}if(!d)return;let h=n.labelToIRI(d);if(!h)return;let _=o.exo__Property_domain,y=o.exo__Property_range,b=o.exo__Property_cardinality,S=o.exo__Property_severity,I=o.exo__Property_minCount,O=n.asArray(_).map(j=>n.wikilinkToIRI(j)).filter(j=>j!==null);if(O.length===0)return;let T=n.asArray(y).map(j=>n.wikilinkToIRI(j)).filter(j=>j!==null),E=n.cardinalityFromLabel(typeof b=="string"?b:void 0),P=n.severityFromValue(typeof S=="string"?S:void 0),V=typeof I=="string"?parseInt(I,10):void 0,M=V!==void 0&&!isNaN(V)?V:void 0;t.register({propertyIRI:h,domain:O,range:T.length>0?T:void 0,cardinality:E,severity:P,minCount:M})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let r=t[1],i={},s=r.split(/\r?\n/),o=null,l=null;for(let c of s){let u=/^ {2}- (.*)$/.exec(c);if(u){o&&l&&l.push(u[1].trim());continue}o&&l&&(i[o]=l,o=null,l=null);let f=/^([^:]+):\s*(.*)$/.exec(c);if(!f)continue;let d=f[1].trim(),p=f[2].trim();p===""?(o=d,l=[]):i[d]=p}return o&&l&&(i[o]=l),i}static labelToIRI(e){let t=qr.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,""),r=/\[\[([^\]]+)\]\]/.exec(t);return r?r[1]:t}static wikilinkToIRI(e){let t=n.extractWikilinkRef(e);if(!t)return null;let r=t.split("|"),i=r.length>1?[r[1],r[0]]:[r[0]];for(let s of i){let o=n.labelToIRI(s.trim());if(o)return o}return t.startsWith("http")?t:t.startsWith("sh:")?X0+t.substring(3):t.startsWith("xsd:")?Yee+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(n.CARDINALITY_SINGLE_UID))return"Single";if(e.includes(n.CARDINALITY_MULTIPLE_UID))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=n.extractWikilinkRef(e)??e,r=t.split("|").pop()??t;if(r.includes("Single"))return"Single";if(r.includes("Multiple"))return"Multiple";if(t.includes(n.CARDINALITY_SINGLE_UID))return"Single";if(t.includes(n.CARDINALITY_MULTIPLE_UID))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===X0+"Violation"?"sh:Violation":e.includes("Warning")||e===X0+"Warning"?"sh:Warning":e.includes("Info")||e===X0+"Info"?"sh:Info":"sh:Violation"}};Ks.ShapeLoader=Ju;Ju.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;Ju.CARDINALITY_SINGLE_UID="c93c4b2f-b43d-4cc9-8dd0-31514d608da2";Ju.CARDINALITY_MULTIPLE_UID="59a37aa7-ffbe-4e0d-ba60-06ae370d880f"});var aA=v(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.ShapeRegistry=void 0;Zu.extractUidFromIRI=oA;Zu.validate=rte;var sA=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(r=>[r.propertyIRI,r])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};Zu.ShapeRegistry=sA;var Qee="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Xee=["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/ns/shacl#","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 Jee(n){return Xee.some(e=>n.startsWith(e))}a(Jee,"isExternalOntologyIRI");var Zee=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function ete(n){return Zee.some(e=>n.startsWith(e))}a(ete,"isXSDDatatypeIRI");var tte=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function oA(n){let e=tte.exec(n);return e?e[1].toLowerCase():null}a(oA,"extractUidFromIRI");function rte(n,e,t,r){let i=new Map,s=new Map;for(let c of n){let{subject:u,predicate:f,object:d}=c;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===Qee){if(_.type==="iri"){let b=i.get(p)??[];b.push(_.value),i.set(p,b);let S=oA(p);if(S){let I=`uid:${S}`,O=i.get(I)??[];O.push(_.value),i.set(I,O)}}}else{let b=s.get(p);b||(b=new Map,s.set(p,b));let S=b.get(h)??[];S.push(_),b.set(h,S)}}let o=[],l=new Set([...i.keys(),...s.keys()]);for(let c of l){if(c.startsWith("uid:"))continue;let u=i.get(c)??[],f=s.get(c)??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:c,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:c,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(Jee(_.value))continue;let y=i.get(_.value)??[];if(y.length===0){let S=oA(_.value);S&&(y=i.get(`uid:${S}`)??[])}if(!d.range.some(S=>y.some(I=>I===S||t.isSubClassOf(I,S)))){let S=y.length===0;o.push({focusNode:c,propertyPath:d.propertyIRI,severity:S?"sh:Warning":d.severity,constraint:"class",message:S?`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(I=>ete(I));if(y.length===0)continue;let b=_.datatype??"http://www.w3.org/2001/XMLSchema#string";y.some(I=>I===b)||o.push({focusNode:c,propertyPath:d.propertyIRI,severity:d.severity,constraint:"datatype",message:d.message??`sh:datatype violation: literal "${_.value}" has datatype <${b}>, expected ${y.join(" | ")}`,actualValue:_.value,expectedRange:y.join(" | ")})}}}}}if(r?.closedWorldMode)for(let c of l){let u=s.get(c)??new Map;for(let f of u.keys())e.hasShape(f)||o.push({focusNode:c,propertyPath:f,severity:"sh:Warning",constraint:"unknown-property",message:`Unknown property: <${f}> has no registered shape`})}return o.sort((c,u)=>{let f=c.focusNode.localeCompare(u.focusNode);return f!==0?f:c.propertyPath.localeCompare(u.propertyPath)}),{conforms:!o.some(c=>c.severity==="sh:Violation"),violations:o}}a(rte,"validate")});var WN=v(J0=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});J0.ApplicationErrorHandler=void 0;var lA=zs(),nte=Hs(),ite=Xl(),cA=class{static{a(this,"ApplicationErrorHandler")}constructor(e={},t,r){this.logger=t,this.notifier=r,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 r=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(r.message),this.callTelemetryHooks("onError",r,t),this.formatError(r)}async executeWithRetry(e,t){let r,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(r=this.ensureApplicationError(s,t),!r.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",r,t),i>=this.retryConfig.maxRetries&&r.retriable&&this.callTelemetryHooks("onRetryExhausted",r,i+1),r;let o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",r,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw r}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof lA.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends lA.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 lA.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=nte.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(`
313
313
  `)}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 r of this.telemetryHooks)try{let i=r[e];i&&i.apply(r,t)}catch(i){ite.LoggingService.error("Error in telemetry hook",i instanceof Error?i:new Error(String(i)))}}};J0.ApplicationErrorHandler=cA});var HN=v(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});Z0.ApplicationErrorHandler=void 0;var ste=WN();Object.defineProperty(Z0,"ApplicationErrorHandler",{enumerable:!0,get:a(function(){return ste.ApplicationErrorHandler},"get")})});var zN=v(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});e_.ClassHierarchy=void 0;var ote="http://www.w3.org/2000/01/rdf-schema#subClassOf",uA=class{static{a(this,"ClassHierarchy")}constructor(e){this.adjacency=new Map;for(let t of e){if(t.predicate.type!=="iri"||t.predicate.value!==ote||t.subject.type!=="iri"||t.object.type!=="iri")continue;let r=t.subject.value,i=t.object.value,s=this.adjacency.get(r);s||(s=new Set,this.adjacency.set(r,s)),s.add(i)}}isSubClassOf(e,t){if(e===t)return!0;let r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(r.has(s))continue;r.add(s);let o=this.adjacency.get(s);if(o)for(let l of o){if(l===t)return!0;r.has(l)||i.push(l)}}return!1}getAncestors(e){let t=new Set,r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(r.has(s))continue;r.add(s);let o=this.adjacency.get(s);if(o)for(let l of o)t.add(l),r.has(l)||i.push(l)}return t}};e_.ClassHierarchy=uA});var fA=v(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_.parseTarball=QN;t_.parseTarballGzip=dte;var ate={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"},lte=new Set(["extendedHeader","globalExtendedHeader","gnuLongFileName","gnuOldLongFileName","gnuLongLinkName"]),KN;function YN(){return KN??(KN=new TextDecoder)}a(YN,"getDecoder");function vp(n,e,t){let r=n.subarray(e,e+t),i=r.indexOf(0);return YN().decode(i===-1?r:r.subarray(0,i))}a(vp,"readString");function cte(n,e,t){let r="";for(let s=0;s<t;s++)r+=String.fromCodePoint(n[e+s]);let i=Number.parseInt(r,8);return Number.isNaN(i)?0:i}a(cte,"readNumber");function ute(n){let e=YN().decode(n),t={};for(let r of e.split(`
314
314
  `)){let i=r.indexOf("=");if(i===-1)continue;let s=r.slice(r.indexOf(" ")+1,i),o=r.slice(i+1);s&&(t[s]=o)}return t}a(ute,"parseExtendedHeaders");function fte(n){let e=n.replace(/\\/g,"/");e=e.replace(/^[a-zA-Z]:\//,""),e=e.replace(/^\/+/,"");let t=e.startsWith("./"),r=e.split("/"),i=[];for(let o of r)o===".."?i.pop():o!=="."&&o!==""&&i.push(o);let s=i.join("/");return t&&!s.startsWith("./")&&(s="./"+s),n.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}a(fte,"sanitizePath");function QN(n){let e=n.byteOffset===0&&n.byteLength===n.buffer.byteLength?n:n.slice(),t=[],r=0,i,s;for(;r+512<=e.byteLength;){let o=vp(e,r,100);if(o.length===0)break;let l=!1;if(i){let h=i.path??i.linkpath;h&&(o=h,l=!0)}let c=cte(e,r+124,12),u=512+512*Math.trunc(c/512)+(c%512?512:0),f=vp(e,r+156,1)||"0",d=ate[f]??f;if(d==="extendedHeader"||d==="globalExtendedHeader"){let h=ute(e.subarray(r+512,r+512+c));d==="extendedHeader"?i=h:(i=void 0,s={...s,...h}),r+=u;continue}if(lte.has(d)){i={path:vp(e,r+512,c)},r+=u;continue}if(!l&&vp(e,r+257,6).startsWith("ustar")){let _=vp(e,r+345,155);_.length>0&&(o=`${_}/${o}`)}o=fte(o);let p=c===0?void 0:e.subarray(r+512,r+512+c);t.push({name:o,type:d,size:c,data:p}),i=void 0,r+=u}return t}a(QN,"parseTarball");async function dte(n){let e=new Uint8Array(n instanceof Uint8Array?n:new Uint8Array(n)),t=new DecompressionStream("gzip"),r=t.writable.getWriter(),[,i]=await Promise.all([r.write(e).then(()=>r.close()),new Response(t.readable).arrayBuffer()]);return QN(new Uint8Array(i))}a(dte,"parseTarballGzip")});var n_=v(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.isBinaryPayload=pA;r_.restCreateCommit=hte;function pA(n){return typeof n!="string"}a(pA,"isBinaryPayload");var pte="https://api.github.com";function XN(n){if(n!==null&&typeof n=="object"&&"object"in n){let e=n.object;if(e!==null&&typeof e=="object"&&"sha"in e){let t=e.sha;return typeof t=="string"?t:void 0}}}a(XN,"readObjectSha");function dA(n){if(n!==null&&typeof n=="object"&&"sha"in n){let e=n.sha;return typeof e=="string"?e:void 0}}a(dA,"readSha");async function hte(n,e){let{owner:t,repo:r,branch:i,files:s,message:o}=e,l=e.deletions??[],c=(e.baseURL??pte).replace(/\/$/,""),u=e.redact??(M=>M);if(typeof t!="string"||t.length===0)throw new Error("restCreateCommit: owner is required");if(typeof r!="string"||r.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&&l.length===0)throw new Error("GitHub createCommit: files map must be non-empty (unless deletions are provided)");let f=new Set;for(let M of l){if(typeof M!="string"||M.length===0)throw new Error("GitHub createCommit: deletion path must be a non-empty string");if(s.has(M))throw new Error(u(`GitHub createCommit: path ${M} is both written and deleted \u2014 ambiguous`));f.add(M)}if(typeof o!="string"||o.length===0)throw new Error("GitHub createCommit: message is required");let d=encodeURIComponent(t),p=encodeURIComponent(r),h=encodeURIComponent(i),_=await n({method:"GET",url:`${c}/repos/${d}/${p}/git/refs/heads/${h}`}),y=XN(_?.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 b=new Map;for(let[M,j]of s){if(!pA(j))continue;let $=await n({method:"POST",url:`${c}/repos/${d}/${p}/git/blobs`,contentType:"application/json",body:JSON.stringify({content:j.base64,encoding:"base64"})}),G=dA($?.json);if(typeof G!="string"||G.length===0)throw new Error(u(`GitHub createCommit: blob create returned no sha for ${M}`));b.set(M,G)}let S=Array.from(s.entries()).map(([M,j])=>pA(j)?{path:M,mode:"100644",type:"blob",sha:b.get(M)}:{path:M,mode:"100644",type:"blob",content:j});for(let M of f)S.push({path:M,mode:"100644",type:"blob",sha:null});let I=await n({method:"POST",url:`${c}/repos/${d}/${p}/git/trees`,contentType:"application/json",body:JSON.stringify({base_tree:y,tree:S})}),O=dA(I?.json);if(typeof O!="string"||O.length===0)throw new Error(u("GitHub createCommit: tree create returned no sha"));let T=await n({method:"POST",url:`${c}/repos/${d}/${p}/git/commits`,contentType:"application/json",body:JSON.stringify({message:o,tree:O,parents:[y]})}),E=dA(T?.json);if(typeof E!="string"||E.length===0)throw new Error(u("GitHub createCommit: commit create returned no sha"));let P=await n({method:"PATCH",url:`${c}/repos/${d}/${p}/git/refs/heads/${h}`,contentType:"application/json",body:JSON.stringify({sha:E,force:!1})}),V=XN(P?.json);if(V!==E)throw new Error(u(`GitHub createCommit: ref update mismatch (expected ${E}, got ${V})`));return E}a(hte,"restCreateCommit")});var ek=v(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.MATERIALIZE_PROGRESS_MIN_FILES=oi.MATERIALIZE_PROGRESS_INTERVAL=void 0;oi.discoverWrapperDir=JN;oi.extractShaFromWrapper=ZN;oi.mountAssetSpaceFiles=yte;oi.escapeGitmodulesRegex=mA;oi.appendGitmodulesEntry=_te;oi.stripGitmodulesEntry=bte;var mte=fA(),hA=new Set(["globalExtendedHeader","extendedHeader"]);function i_(n){let e=n.replace(/\\/g,"/").replace(/\/+/g,"/");for(;e.startsWith("./");)e=e.slice(2);return e}a(i_,"normalizeEntryPath");function JN(n){let e=n.find(s=>!hA.has(s.type)&&i_(s.name).includes("/"));if(e===void 0)throw new Error("discoverWrapperDir: no wrapper-bearing entry in tarball");let t=i_(e.name),r=t.slice(0,t.indexOf("/"));if(r.length===0)throw new Error(`discoverWrapperDir: empty wrapper segment in entry "${e.name}"`);let i=r+"/";for(let s of n){if(hA.has(s.type))continue;let o=i_(s.name);if(!(o===r||o===i)&&!o.startsWith(i))throw new Error(`discoverWrapperDir: entry "${s.name}" not under wrapper "${r}"`)}return r}a(JN,"discoverWrapperDir");function ZN(n){let e=n.match(/-([0-9a-fA-F]{7,40})$/);if(e===null)throw new Error(`extractShaFromWrapper: wrapper "${n}" does not match expected GitHub pattern <owner>-<repo>-<sha>`);return e[1].toLowerCase()}a(ZN,"extractShaFromWrapper");function gte(n,e){let t=e+"/",r=[];for(let i of n){if(i.type==="symbolicLink"||i.type==="hardLink")throw new Error(`${i.type} entry "${i.name}" rejected for security`);if(hA.has(i.type)||i.type==="directory")continue;let s=i_(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(l=>l===".."))throw new Error(`path traversal detected for entry "${i.name}"`);i.data!==void 0&&r.push({relPath:o,content:i.data})}}return r}a(gte,"buildMountFiles");oi.MATERIALIZE_PROGRESS_INTERVAL=200;oi.MATERIALIZE_PROGRESS_MIN_FILES=500;async function yte(n){let{http:e,fs:t,owner:r,repo:i,ref:s,targetPath:o}=n,l=a((b,S)=>{if(n.onProgress!==void 0)try{n.onProgress(b,S)}catch{}},"emit");l("fetch");let c=await e.fetchTarball(r,i,s);l("extract");let u=await(0,mte.parseTarballGzip)(c);if(u.length===0)throw new Error(`tarball empty for ${r}/${i}@${s}`);let f=JN(u),d=ZN(f),p=gte(u,f);l("materialize");let h=p.length,_=n.onProgress!==void 0&&h>oi.MATERIALIZE_PROGRESS_MIN_FILES,y=await t.materialize(o,p,_?b=>{b%oi.MATERIALIZE_PROGRESS_INTERVAL===0&&b<h&&l("materialize",{processed:b,total:h})}:void 0);return{sha:d,fileCount:y}}a(yte,"mountAssetSpaceFiles");function mA(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(mA,"escapeGitmodulesRegex");function _te(n,e,t){let r=new RegExp(`^\\s*\\[submodule\\s+"${mA(e)}"\\]`,"m");if(n.length>0&&r.test(n))return{content:n,added:!1};let i=n.length===0||n.endsWith(`
315
315
  `)?"":`
@@ -317,13 +317,13 @@ To resolve:
317
317
  path = ${e}
318
318
  url = ${t}
319
319
  `;return{content:n+i+s,added:!0}}a(_te,"appendGitmodulesEntry");function bte(n,e){let t=n.split(/\r?\n/),r=[],i=!1,s=new RegExp(`^\\[submodule\\s+"${mA(e)}"\\]\\s*$`);for(let c of t){if(i){if(/^\[.+\]\s*$/.test(c)){i=!1,r.push(c);continue}continue}if(s.test(c)){i=!0;continue}r.push(c)}let o=[],l=!1;for(let c of r){let u=c.trim().length===0;u&&l||(o.push(c),l=u)}return o.join(`
320
- `)}a(bte,"stripGitmodulesEntry")});var ef=v(gA=>{"use strict";Object.defineProperty(gA,"__esModule",{value:!0});gA.gitBlobSha=Ste;async function Ste(n,e){let t=new TextEncoder,r=typeof n=="string"?t.encode(n):n,i=t.encode(`blob ${r.byteLength}\0`),s=new Uint8Array(i.byteLength+r.byteLength);return s.set(i,0),s.set(r,i.byteLength),e(s)}a(Ste,"gitBlobSha")});var Tp=v(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});s_.extractAssetUid=tk;s_.detectChanges=Ete;var wte=ef();function tk(n){let e=/^---\r?\n([\s\S]*?)\r?\n---(?=\r?\n|$)/.exec(n);if(!e)return;let t=/^exo__Asset_uid:[ \t]*["']?([^\s"']+)["']?[ \t]*$/m.exec(e[1]);return t?t[1]:void 0}a(tk,"extractAssetUid");async function Ete(n){let{localFiles:e,cachedEntries:t,watermark:r,actualBaseTreeSha:i,sha1:s}=n;if(r===null)return{kind:"full-conflict",reason:"first-sync"};if(i===null)return{kind:"full-conflict",reason:"base-mismatch",detail:`watermark commit ${r.lastSyncedSha} not resolvable on remote`};if(i!==r.rootTreeSha)return{kind:"full-conflict",reason:"base-mismatch",detail:`stored root tree ${r.rootTreeSha} != actual ${i} at ${r.lastSyncedSha}`};let o=[],l=new Map;for(let[T,E]of e){let P=await(0,wte.gitBlobSha)(E,s);l.set(T,P),o.push({path:T,blobSha:P,uid:typeof E=="string"?tk(E):void 0})}if(t!==void 0)for(let[T,E]of t)l.set(T,E.blobSha),o.push({path:T,blobSha:E.blobSha,uid:E.uid});let c=[],u=[],f=[],d=[],p=new Map;for(let T of o){if(T.uid===void 0)continue;let E=p.get(T.uid)??[];E.push(T.path),p.set(T.uid,E)}let h=new Map;for(let T of r.files){if(T.uid===void 0)continue;let E=h.get(T.uid)??[];E.push(T.path),h.set(T.uid,E)}let _=new Set;for(let[T,E]of p)E.length>1&&_.add(T);for(let[T,E]of h)E.length>1&&_.add(T);for(let T of[..._].sort()){let E=p.get(T)??[],P=E.length>1?`on disk (${E.join(", ")})`:`in the sync base (${(h.get(T)??[]).join(", ")})`;d.push(`duplicate uid ${T} ${P} \u2014 uid identity suppressed for the group; every path matched by path identity (#3477)`)}let y=new Map,b=[];for(let T of r.files)T.uid!==void 0&&!_.has(T.uid)?y.set(T.uid,T):b.push(T);let S=[],I=new Set;for(let T of o){let E=T.uid!==void 0&&!_.has(T.uid)?y.get(T.uid):void 0;T.uid!==void 0&&E!==void 0?(I.add(T.uid),(E.blobSha!==T.blobSha||E.path!==T.path)&&u.push({path:T.path,uid:T.uid,blobSha:T.blobSha,...E.path!==T.path?{basePath:E.path}:{}})):S.push(T)}let O=new Map;for(let T of b)O.set(T.path,T);for(let[T,E]of y)I.has(T)||O.set(E.path,E);for(let T of S){let E=O.get(T.path);E!==void 0?(O.delete(T.path),E.blobSha!==T.blobSha&&u.push({path:T.path,uid:T.uid,blobSha:T.blobSha})):c.push({path:T.path,uid:T.uid,blobSha:T.blobSha})}for(let T of O.values())f.push({path:T.path,uid:T.uid,blobSha:T.blobSha});return{kind:"changes",added:c,modified:u,deleted:f,warnings:d,diskBlobShas:l,duplicateUids:_}}a(Ete,"detectChanges")});var ik=v(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.rewriteAssetUid=rk;Ap.findDuplicateUidGroups=nk;Ap.planDuplicateUidFix=Tte;var vte=Tp();function rk(n,e){let t=/^(---\r?\n)([\s\S]*?)(\r?\n---(?=\r?\n|$))/.exec(n);if(t===null)return n;let r=t[2].replace(/^(exo__Asset_uid:[ \t]*["']?)[^\s"']+(["']?[ \t]*)$/m,`$1${e}$2`);return r===t[2]?n:n.slice(0,t.index)+t[1]+r+t[3]+n.slice(t.index+t[0].length)}a(rk,"rewriteAssetUid");function nk(n){let e=new Map;for(let t of n){let r=(0,vte.extractAssetUid)(t.content);if(r===void 0)continue;let i=e.get(r)??[];i.push(t.path),e.set(r,i)}return[...e.entries()].filter(([,t])=>t.length>1).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>({uid:t,paths:r}))}a(nk,"findDuplicateUidGroups");function Tte(n,e){let t=new Map(n.map(i=>[i.path,i.content])),r=[];for(let i of nk(n)){let s=[...i.paths].sort((o,l)=>o.localeCompare(l));for(let o of s.slice(1)){let l=t.get(o);if(l===void 0)continue;let c=e(),u=rk(l,c);u!==l&&r.push({path:o,fromUid:i.uid,toUid:c,content:u})}}return r}a(Tte,"planDuplicateUidFix")});var tf=v(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.getHeadSha=Ite;cc.getCommitInfo=xte;cc.getTree=Rte;cc.getBlobText=Cte;cc.getBlobBytes=Ote;var sk=Vc(),Ate="https://api.github.com";function Ip(n){return(n??Ate).replace(/\/$/,"")}a(Ip,"api");function lc(n){return n!==null&&typeof n=="object"?n:void 0}a(lc,"asRecord");function Ys(n,e){let r=lc(n)?.[e];return typeof r=="string"?r:void 0}a(Ys,"readString");async function Ite(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/refs/heads/${encodeURIComponent(r)}`}),o=Ys(lc(s?.json)?.object,"sha");if(typeof o!="string"||o.length===0)throw new Error(`ExoSync: missing object.sha for ref heads/${r}`);return o}a(Ite,"getHeadSha");async function xte(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/commits/${encodeURIComponent(r)}`}),o=lc(s?.json),l=Ys(o,"sha"),c=Ys(o?.tree,"sha");if(!l||!c)throw new Error(`ExoSync: malformed commit response for ${r}`);let u=o?.parents,f=Array.isArray(u)?u.map(d=>Ys(d,"sha")).filter(d=>typeof d=="string"):[];return{sha:l,treeSha:c,parents:f}}a(xte,"getCommitInfo");async function Rte(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/trees/${encodeURIComponent(r)}?recursive=1`}),o=lc(s?.json);if(o?.truncated===!0)throw new Error(`ExoSync: tree ${r} is truncated by GitHub (repo too large for recursive listing) \u2014 refusing to diff`);let l=o?.tree;if(!Array.isArray(l))throw new Error(`ExoSync: malformed tree response for ${r}`);let c=[];for(let u of l){let f=lc(u);if(f?.type!=="blob")continue;let d=Ys(f,"path"),p=Ys(f,"sha"),h=typeof f.size=="number"?f.size:void 0;d&&p&&c.push({path:d,blobSha:p,...h!==void 0?{size:h}:{}})}return c}a(Rte,"getTree");async function Cte(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/blobs/${encodeURIComponent(r)}`}),o=lc(s?.json),l=Ys(o,"content");if(typeof l!="string")throw new Error(`ExoSync: malformed blob response for ${r}`);return Ys(o,"encoding")==="utf-8"?l:(0,sk.base64ToUtf8)(l)}a(Cte,"getBlobText");async function Ote(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/blobs/${encodeURIComponent(r)}`}),o=lc(s?.json),l=Ys(o,"content");if(typeof l!="string")throw new Error(`ExoSync: malformed blob response for ${r}`);return Ys(o,"encoding")==="utf-8"?new TextEncoder().encode(l):(0,sk.base64ToBytes)(l)}a(Ote,"getBlobBytes")});var ak=v(yA=>{"use strict";Object.defineProperty(yA,"__esModule",{value:!0});yA.checkParkedStaleness=Dte;var Pte=tf();async function Dte(n,e){let t={repoKey:n.repoKey,localPath:n.localPath},r=e.redact??(o=>o),i=null;try{let l=(await e.watermarks.get(n.repoKey))?.lastSyncedSha??"";l.length>0&&(i=l)}catch(o){return{...t,freshness:"unknown",lastSyncedSha:null,remoteHeadSha:null,reason:`watermark unreadable: ${r(ok(o))}`}}if(i===null)return{...t,freshness:"unknown",lastSyncedSha:null,remoteHeadSha:null,reason:"never synced on this device (no watermark)"};let s;try{s=await(0,Pte.getHeadSha)(e.transport,n.owner,n.repo,n.branch,e.baseURL)}catch(o){return{...t,freshness:"unknown",lastSyncedSha:i,remoteHeadSha:null,reason:`remote unreachable: ${r(ok(o))}`}}return{...t,freshness:s===i?"current":"behind",lastSyncedSha:i,remoteHeadSha:s}}a(Dte,"checkParkedStaleness");function ok(n){return n instanceof Error?n.message:String(n)}a(ok,"errorText")});var SA=v(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.SyncPhaseTimer=nr.SYNC_PHASES=void 0;nr.classifyRestPhase=Fte;nr.emptyTimings=ck;nr.totalMs=o_;nr.addTimings=uk;nr.aggregateTimings=Lte;nr.dominantPhase=Nte;nr.fmtMs=xp;nr.formatTimingsLine=kte;nr.formatRepoTimings=Mte;nr.SYNC_PHASES=["localList","localRead","localWrite","hash","restHead","restCommit","restTree","restBlob","restPush"];function bA(){let n={};for(let e of nr.SYNC_PHASES)n[e]=0;return n}a(bA,"zeroDurations");function lk(){return{filesRead:0,filesHashed:0,filesWritten:0,restCalls:0}}a(lk,"zeroCounts");function Fte(n){if(n.method!=="GET")return"restPush";let e=n.url;return e.includes("/git/blobs/")?"restBlob":e.includes("/git/trees/")?"restTree":e.includes("/git/commits/")?"restCommit":e.includes("/git/refs/")?"restHead":"restCommit"}a(Fte,"classifyRestPhase");var _A=class{static{a(this,"SyncPhaseTimer")}constructor(e){this.now=e,this.durations=bA(),this.counts=lk()}async time(e,t){let r=this.now();try{return await t()}finally{this.durations[e]+=this.now()-r}}bumpRead(){this.counts.filesRead++}bumpHashed(){this.counts.filesHashed++}bumpWritten(){this.counts.filesWritten++}bumpRest(){this.counts.restCalls++}snapshot(){return{durations:{...this.durations},counts:{...this.counts}}}};nr.SyncPhaseTimer=_A;function ck(){return{durations:bA(),counts:lk()}}a(ck,"emptyTimings");function o_(n){let e=0;for(let t of nr.SYNC_PHASES)e+=n.durations[t];return e}a(o_,"totalMs");function uk(n,e){let t=bA();for(let r of nr.SYNC_PHASES)t[r]=n.durations[r]+e.durations[r];return{durations:t,counts:{filesRead:n.counts.filesRead+e.counts.filesRead,filesHashed:n.counts.filesHashed+e.counts.filesHashed,filesWritten:n.counts.filesWritten+e.counts.filesWritten,restCalls:n.counts.restCalls+e.counts.restCalls}}}a(uk,"addTimings");function Lte(n){let e=ck();for(let t of n)t.timings!==void 0&&(e=uk(e,t.timings));return e}a(Lte,"aggregateTimings");function Nte(n){let e=o_(n);if(e<=0)return null;let t=nr.SYNC_PHASES[0],r=-1;for(let i of nr.SYNC_PHASES)n.durations[i]>r&&(r=n.durations[i],t=i);return{phase:t,ms:r,pct:r/e*100}}a(Nte,"dominantPhase");function xp(n){return n>=1e3?`${(n/1e3).toFixed(1)}s`:`${Math.round(n)}ms`}a(xp,"fmtMs");function kte(n){let e=o_(n);if(e<=0)return"";let t=nr.SYNC_PHASES.filter(r=>n.durations[r]>0).sort((r,i)=>n.durations[i]-n.durations[r]).map(r=>`${r} ${xp(n.durations[r])} ${Math.round(n.durations[r]/e*100)}%`);return`\u23F1 ExoSync ${xp(e)} \u2014 ${t.join(" \xB7 ")} (${n.counts.filesHashed} hashed, ${n.counts.filesRead} read, ${n.counts.restCalls} REST)`}a(kte,"formatTimingsLine");function Mte(n,e){let t=nr.SYNC_PHASES.map(r=>`${r}=${xp(e.durations[r])}`);return`[ExoSync timings] ${n}: total ${xp(o_(e))} \u2014 ${t.join(" ")} | hashed ${e.counts.filesHashed} read ${e.counts.filesRead} written ${e.counts.filesWritten} REST ${e.counts.restCalls}`}a(Mte,"formatRepoTimings")});var a_=v(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.LocalOutboxStore=Ba.OUTBOX_REMOTE_ABSENT=Ba.OUTBOX_STORE_FILENAME=void 0;Ba.OUTBOX_STORE_FILENAME="exosync-outbox.local.json";Ba.OUTBOX_REMOTE_ABSENT=" absent";function wA(n,e){return`${n}\0${e}`}a(wA,"outboxKey");function fk(n){if(n===null||typeof n!="object")return!1;let e=n;return typeof e.repoKey=="string"&&typeof e.path=="string"&&typeof e.chosenContent=="string"&&typeof e.baseRemoteSha=="string"}a(fk,"isEntry");var EA=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[wA(e.repoKey,e.path)]={version:1,...e,resolvedAt:e.resolvedAt.length>0?e.resolvedAt:this.now()}})}async remove(e,t){await this.mutate(r=>{delete r.entries[wA(e,t)]})}async list(){let e=await this.read();return Object.values(e.entries).filter(fk)}async listForRepo(e){return(await this.list()).filter(t=>t.repoKey===e)}async has(e,t){let i=(await this.read()).entries[wA(e,t)];return i!==void 0&&fk(i)}async mutate(e){let t=this.writeChain.then(async()=>{let r=await this.read();e(r),await this.io.writeAtomic(JSON.stringify(r,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 r=t.entries;return r===null||typeof r!="object"?{version:1,entries:{}}:{version:1,entries:{...r}}}catch{return{version:1,entries:{}}}}};Ba.LocalOutboxStore=EA});var l_=v(vA=>{"use strict";Object.defineProperty(vA,"__esModule",{value:!0});vA.isAuthError=jte;function jte(n){let e=n instanceof Error?n.message:String(n);return/HTTP 401/.test(e)?!0:/HTTP 403/.test(e)&&!/rate limit/i.test(e)&&!/abuse detection/i.test(e)}a(jte,"isAuthError")});var TA=v(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.scanForSecrets=$te;c_.redactSecrets=Ute;var dk=[{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 $te(n){let e=[];for(let[t,r]of n)for(let{kind:i,re:s}of dk)s.test(r)&&e.push({path:t,kind:i});return e}a($te,"scanForSecrets");function Ute(n){let e=n;for(let{kind:t,re:r}of dk)e=e.replace(new RegExp(r.source,"g"),`[REDACTED:${t}]`);return e}a(Ute,"redactSecrets")});var xA=v(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.caseInsensitiveHeaderGetter=Bte;Va.parseRetryAfterMs=pk;Va.extractRateLimitFields=hk;Va.getRateLimitFields=Vte;Va.attachRateLimitFields=mk;Va.enrichRateLimitError=qte;function Bte(n){let e=new Map;if(n&&typeof n=="object")for(let[t,r]of Object.entries(n))typeof r=="string"&&e.set(t.toLowerCase(),r);return t=>e.get(t.toLowerCase())}a(Bte,"caseInsensitiveHeaderGetter");function IA(n){if(n==null)return;let e=n.trim();if(!/^-?\d+$/.test(e))return;let t=Number(e);return Number.isFinite(t)?t:void 0}a(IA,"parseIntHeader");function pk(n,e=Date.now){if(n==null)return;let t=n.trim();if(t.length===0)return;let r=IA(t);if(r!==void 0)return Math.max(0,r*1e3);let i=Date.parse(t);if(!Number.isNaN(i))return Math.max(0,i-e())}a(pk,"parseRetryAfterMs");function hk(n,e=Date.now){let t={},r=pk(n("retry-after"),e);r!==void 0&&(t.retryAfterMs=r);let i=IA(n("x-ratelimit-reset"));i!==void 0&&(t.rateLimitReset=i);let s=IA(n("x-ratelimit-remaining"));return s!==void 0&&(t.rateLimitRemaining=s),t}a(hk,"extractRateLimitFields");function Vte(n){if(n===null||typeof n!="object")return{};let e=n,t={};return typeof e.retryAfterMs=="number"&&(t.retryAfterMs=e.retryAfterMs),typeof e.rateLimitReset=="number"&&(t.rateLimitReset=e.rateLimitReset),typeof e.rateLimitRemaining=="number"&&(t.rateLimitRemaining=e.rateLimitRemaining),t}a(Vte,"getRateLimitFields");function AA(n,e,t){Object.defineProperty(n,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}a(AA,"defineHidden");function mk(n,e){return e.retryAfterMs!==void 0&&AA(n,"retryAfterMs",e.retryAfterMs),e.rateLimitReset!==void 0&&AA(n,"rateLimitReset",e.rateLimitReset),e.rateLimitRemaining!==void 0&&AA(n,"rateLimitRemaining",e.rateLimitRemaining),n}a(mk,"attachRateLimitFields");function qte(n,e,t=Date.now){return mk(n,hk(e,t))}a(qte,"enrichRateLimitError")});var u_=v(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.DEFAULT_MAX_RETRIES=Ci.MIN_RATE_LIMIT_WAIT_MS=void 0;Ci.isRateLimitError=gk;Ci.createRateLimitBudget=Wte;Ci.withRateLimitBackoff=Kte;var Gte=xA();function gk(n){let e=n instanceof Error?n.message:String(n);return/HTTP 429/.test(e)?!0:/HTTP 403/.test(e)&&(/rate limit/i.test(e)||/abuse detection/i.test(e))}a(gk,"isRateLimitError");Ci.MIN_RATE_LIMIT_WAIT_MS=6e4;Ci.DEFAULT_MAX_RETRIES=6;function Wte(n){let e=!(n>0),t=e?Number.POSITIVE_INFINITY:n;return{reset(){t=e?Number.POSITIVE_INFINITY:n},tryReserve(r){return r<=0?!0:r<=t?(t-=r,!0):!1}}}a(Wte,"createRateLimitBudget");var Hte=a(n=>new Promise(e=>setTimeout(e,n)),"defaultSleep");function zte(n,e,t,r,i,s){let o=(0,Gte.getRateLimitFields)(n);if(typeof o.retryAfterMs=="number"&&o.retryAfterMs>=0)return o.retryAfterMs;if(o.rateLimitRemaining===0&&typeof o.rateLimitReset=="number"){let c=o.rateLimitReset*1e3-s();if(c>0)return c}let l=t*2**e*(1+i());return Math.max(r,l)}a(zte,"computeRateLimitDelay");function Kte(n,e={}){let t=e.maxRetries??Ci.DEFAULT_MAX_RETRIES,r=e.baseDelayMs??1e3,i=Math.max(Ci.MIN_RATE_LIMIT_WAIT_MS,e.minRateLimitWaitMs??Ci.MIN_RATE_LIMIT_WAIT_MS),s=e.budget,o=e.sleep??Hte,l=e.random??Math.random,c=e.now??(()=>Date.now());return async u=>{let f=0;for(;;)try{return await n(u)}catch(d){if(!gk(d)||f>=t)throw d;let p=zte(d,f,r,i,l,c);if(s!==void 0&&!s.tryReserve(p))throw d;f++,await o(p)}}}a(Kte,"withRateLimitBackoff")});var f_=v(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.DEFAULT_MAX_FILE_BYTES=Jo.InMemoryQuarantineStore=void 0;Jo.contentEquals=Yte;Jo.isSyncablePath=Qte;Jo.isFileSpaceSyncablePath=Xte;function Yte(n,e){if(n===void 0||e===void 0||typeof n=="string"&&typeof e=="string")return n===e;if(typeof n=="string"||typeof e=="string"||n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0}a(Yte,"contentEquals");var RA=class{static{a(this,"InMemoryQuarantineStore")}constructor(){this.entries=[]}async quarantine(e){this.entries.push(e)}};Jo.InMemoryQuarantineStore=RA;function Qte(n){return n.endsWith(".md")&&!n.includes(".local.")&&!n.includes(".conflict.")}a(Qte,"isSyncablePath");function Xte(n){return!n.includes(".local.")&&!n.includes(".conflict.")}a(Xte,"isFileSpaceSyncablePath");Jo.DEFAULT_MAX_FILE_BYTES=30*1024*1024});var Ik=v(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.SyncEngine=fn.DEFAULT_LOCAL_MANIFEST_REHASH_MS=fn.DEFAULT_MAX_TOTAL_RATELIMIT_WAIT_MS=fn.DEFAULT_MAX_PUSH_RETRIES=void 0;fn.syncProgressPhaseText=ere;fn.isNonFastForwardError=Ak;fn.orderChildrenFirst=lre;var yk=n_(),_k=SA(),_t=tf(),Qs=Tp(),Jte=Vc(),uc=ef(),CA=a_(),Zte=l_(),bk=TA(),Sk=u_(),Xs=f_();fn.DEFAULT_MAX_PUSH_RETRIES=3;fn.DEFAULT_MAX_TOTAL_RATELIMIT_WAIT_MS=3e5;fn.DEFAULT_LOCAL_MANIFEST_REHASH_MS=720*60*1e3;function ere(n){switch(n.phase){case"reading-local":return n.detail!==void 0?`reading local files ${n.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 n.detail!==void 0?`fetching remote files ${n.detail.done}/${n.detail.total}\u2026`:"fetching remote files\u2026";case"writing-files":return n.detail!==void 0?`writing files ${n.detail.done}\u2026`:"writing files\u2026";case"merging":return"merge layer firing\u2026";default:return n.phase}}a(ere,"syncProgressPhaseText");var wk=25,tre=10,rre=6,nre=500,ire=25;function sre(n){try{return new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return null}}a(sre,"decodeUtf8Strict");function ore(n){return typeof n=="string"?n:{base64:(0,Jte.bytesToBase64)(n)}}a(ore,"toCommitContent");async function Ek(n,e){if(n.readBinary===void 0)throw new Error("LocalFilesPort.readBinary is required for file-mode sync (Phase C)");return n.readBinary(e)}a(Ek,"readBinaryStrict");async function are(n,e,t){if(n.writeBinary===void 0)throw new Error("LocalFilesPort.writeBinary is required for file-mode sync (Phase C)");return n.writeBinary(e,t)}a(are,"writeBinaryStrict");function vk(n){return n.length===0||n.startsWith("/")||n.includes("\\")?!1:n.split("/").every(e=>e.length>0&&e!=="."&&e!=="..")}a(vk,"isSafeRepoRelativePath");function Ak(n){let e=n instanceof Error?n.message:String(n);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(Ak,"isNonFastForwardError");function lre(n){let e=a(t=>t.split("/").filter(r=>r.length>0).length,"depth");return[...n].sort((t,r)=>e(r.localPath)-e(t.localPath))}a(lre,"orderChildrenFirst");function Tk(n,e){let t=new Map(n.map(o=>[o.path,o])),r=new Set,i=[];for(let o of e){r.add(o.path);let l=t.get(o.path);(l===void 0||l.blobSha!==o.blobSha)&&i.push(o)}let s=n.filter(o=>!r.has(o.path));return{changed:i,deleted:s}}a(Tk,"diffTrees");function qa(n){return n instanceof Error?n.message:String(n)}a(qa,"errMsg");function cre(n,e,t){if(t.size===0)return n;let r=new Map(e.files.map(o=>[o.path,o])),i=new Set(n.map(o=>o.path)),s=[];for(let o of n){if(!t.has(o.path)){s.push(o);continue}let l=r.get(o.path);l!==void 0&&s.push(l)}for(let o of t){if(i.has(o))continue;let l=r.get(o);l!==void 0&&s.push(l)}return s}a(cre,"applyWatermarkPins");var OA={mergedFiles:new Map,mergedWrites:[],quarantineEntries:[],resolvedQuarantineEntries:[],mergedCount:0,mergedPaths:[],warnings:[]};function PA(n){return new Map(n.map(e=>[e.path,e.blobSha]))}a(PA,"treeByPath");function d_(n){return[...n.quarantineEntries.map(e=>e.path),...n.resolvedQuarantineEntries.map(e=>e.path)]}a(d_,"quarantinedPathsOf");var DA=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.rateLimitBudget=(0,Sk.createRateLimitBudget)(e.backoff?.maxTotalRateLimitWaitMs??fn.DEFAULT_MAX_TOTAL_RATELIMIT_WAIT_MS),this.transport=this.instrumentTransport((0,Sk.withRateLimitBackoff)(e.transport,{...e.backoff,budget:this.rateLimitBudget,now:this.now})),this.sha1=this.instrumentSha1(e.sha1)}instrumentTransport(e){return async t=>{let r=this.activeTimer;return r===null?e(t):(r.bumpRest(),r.time((0,_k.classifyRestPhase)(t),()=>e(t)))}}instrumentSha1(e){return t=>{let r=this.activeTimer;return r===null?e(t):(r.bumpHashed(),r.time("hash",()=>e(t)))}}instrumentLocalFiles(e){let t=a((l,c)=>{let u=this.activeTimer;return u===null?c():u.time(l,c)},"timed"),r={list:a(()=>t("localList",()=>e.list()),"list"),read:a(l=>(this.activeTimer?.bumpRead(),this.bumpReadProgress(),t("localRead",()=>e.read(l))),"read"),write:a((l,c)=>t("localWrite",()=>(this.activeTimer?.bumpWritten(),this.bumpWriteProgress(),e.write(l,c))),"write"),delete:a(l=>e.delete(l),"delete")},i=e.readBinary?.bind(e);i!==void 0&&(r.readBinary=l=>(this.activeTimer?.bumpRead(),this.bumpReadProgress(),t("localRead",()=>i(l))));let s=e.writeBinary?.bind(e);s!==void 0&&(r.writeBinary=(l,c)=>t("localWrite",()=>(this.activeTimer?.bumpWritten(),this.bumpWriteProgress(),s(l,c))));let o=e.stat?.bind(e);return o!==void 0&&(r.stat=l=>t("localList",()=>o(l))),r}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",r=t?Xs.isFileSpaceSyncablePath:Xs.isSyncablePath,i=this.deps.maxFileBytes??Xs.DEFAULT_MAX_FILE_BYTES;return{fileMode:t,syncable:r,treeFilter:a(s=>r(s.path)&&(!t||s.size===void 0||s.size<=i),"treeFilter")}}async buildFileModeFirstSyncBase(e,t,r,i){let s=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),o=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,s,this.deps.baseURL),l=(await(0,_t.getTree)(this.transport,e.owner,e.repo,o.treeSha,this.deps.baseURL)).filter(r.treeFilter),c=[];for(let u of l){let f=t.get(u.path);f!==void 0&&await(0,uc.gitBlobSha)(f,this.sha1)===u.blobSha&&c.push({path:u.path,blobSha:u.blobSha})}return i.push(`first-sync (file mode): synthetic base from ${c.length} already-identical file(s) at head ${s} \u2014 divergence resolves through the remote-wins layer (D22)`),{lastSyncedSha:s,rootTreeSha:o.treeSha,files:c,spaceKind:"file"}}async syncAll(e,t="sync",r){if(this.opInProgress)return e.map(i=>this.busyResult(i));this.opInProgress=!0,this.rateLimitBudget.reset();try{let i=[];for(let s of e)i.push(await this.syncLocked(s,t,r));return i}finally{this.opInProgress=!1}}async sync(e,t="sync",r){if(this.opInProgress)return this.busyResult(e);this.opInProgress=!0,this.rateLimitBudget.reset();try{return await this.syncLocked(e,t,r)}finally{this.opInProgress=!1}}emitProgress(e,t,r,i){if(e!==void 0)try{e(i===void 0?{repoKey:t,phase:r}:{repoKey:t,phase:r,detail:i})}catch{}}bumpReadProgress(){let e=this.activeLocalIoProgress;e!==null&&(e.reads+=1,e.reads%nre===0&&this.emitProgress(e.emit,e.repoKey,"reading-local",{done:e.reads}))}bumpWriteProgress(){let e=this.activeLocalIoProgress;e!==null&&(e.writes+=1,e.writes%ire===0&&this.emitProgress(e.emit,e.repoKey,"writing-files",{done:e.writes}))}async syncLocked(e,t="sync",r){let i=new _k.SyncPhaseTimer(this.now),s=this.activeTimer;this.activeTimer=i;let o=this.activeLocalIoProgress;this.activeLocalIoProgress=r!==void 0?{emit:r,repoKey:e.repoKey,reads:0,writes:0}:null;let l=[],c=[],u=0,f=0,d=[],p=a((h,_={})=>({repoKey:e.repoKey,status:h,pulledCount:0,pushedCount:0,mergedCount:0,quarantinedCount:0,warnings:l,deferredDeletes:c,...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 l.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 b=this.deps.maxFileBytes??Xs.DEFAULT_MAX_FILE_BYTES;if(t!=="pull"&&this.deps.outbox!==void 0){let ee=await this.flushOutbox(e,l);u=ee.pushed,f=ee.reconflicted}let S=await this.deps.watermarkStore.get(e.repoKey);if(S?.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)"});S!==null&&_.fileMode&&S.spaceKind!=="file"&&(l.push("watermark was written by an ASSET-mode sync \u2014 rebuilding the base through the file-mode first-sync layer (kind flip)"),S=null);let I=this.deps.localManifestStore!==void 0?y.stat?.bind(y):void 0,O=I!==void 0&&S!==null&&!_.fileMode,T=O&&this.deps.localManifestStore!==void 0?await this.deps.localManifestStore.get(e.repoKey):null,E=this.deps.localManifestFullRehashMs??fn.DEFAULT_LOCAL_MANIFEST_REHASH_MS,P=O&&(T===null||this.now()-T.lastFullRehashMs>=E),V=new Map,M=new Set,j=new Map,$=new Map,G=new Map,ge=!1,ye=new Map;if(O&&S!==null)for(let ee of S.files)ye.set(ee.path,ee.blobSha);for(let ee of(await y.list()).filter(_.syncable)){if(_.fileMode){let Pe=await Ek(y,ee);if(Pe.byteLength>b){M.add(ee),l.push(`skipped oversized file ${ee} (${Pe.byteLength} bytes > ${b} cap) \u2014 excluded from sync symmetrically (Phase C size cap)`);continue}V.set(ee,Pe);continue}if(!O||I===void 0){V.set(ee,await y.read(ee));continue}let _e=await I(ee),Te=!P&&_e!==null?T?.files[ee]:void 0;if(_e!==null&&Te!==void 0&&Te.mtimeMs===_e.mtimeMs&&Te.size===_e.size&&Te.blobSha===ye.get(ee)){j.set(ee,{blobSha:Te.blobSha,...Te.uid!==void 0?{uid:Te.uid}:{}}),$.set(ee,Te.blobSha),G.set(ee,_e);continue}ge=!0,V.set(ee,await y.read(ee)),_e!==null&&G.set(ee,_e)}let Q=!1;if(S===null)if(_.fileMode)Q=!0,S=await this.buildFileModeFirstSyncBase(e,V,_,l);else{let ee=await this.bootstrapWatermark(e,V,l,p);if(ee.kind==="settled")return ee.outcome;Q=!0,S=ee.base}let se=S;_.fileMode&&M.size>0&&(S={...S,files:S.files.filter(ee=>!M.has(ee.path))});let J,ve;O&&!P?(J=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),ve=J===S.lastSyncedSha?S.rootTreeSha:await this.resolveBaseTreeSha(e,S)):ve=await this.resolveBaseTreeSha(e,S),this.emitProgress(r,e.repoKey,"detecting");let te=await(0,Qs.detectChanges)({localFiles:V,...O?{cachedEntries:j}:{},watermark:S,actualBaseTreeSha:ve,sha1:this.sha1});if(te.kind==="full-conflict")return p("full-conflict",{detail:`${te.reason}${te.detail?`: ${te.detail}`:""} \u2014 divergence must go through merge/quarantine (A2/A3), not overwrite`});if(l.push(...te.warnings),O&&this.deps.localManifestStore!==void 0){let ee={};for(let[_e,Te]of V){let Pe=G.get(_e),Me=te.diskBlobShas.get(_e);if(Pe===void 0||Me===void 0)continue;let Ne=typeof Te=="string"?(0,Qs.extractAssetUid)(Te):void 0;ee[_e]={mtimeMs:Pe.mtimeMs,size:Pe.size,blobSha:Me,...Ne!==void 0?{uid:Ne}:{}}}for(let[_e,Te]of j){let Pe=G.get(_e);Pe!==void 0&&(ee[_e]={mtimeMs:Pe.mtimeMs,size:Pe.size,blobSha:Te.blobSha,...Te.uid!==void 0?{uid:Te.uid}:{}})}if(T!==null&&Object.keys(T.files).some(_e=>!(_e in ee))&&(ge=!0),ge||P||T===null){let _e={version:1,files:ee,lastFullRehashMs:P||T===null?this.now():T.lastFullRehashMs};await this.deps.localManifestStore.set(e.repoKey,_e)}}let ie=this.pinLocalChanges(te,V,l,c,t);d=[...ie.pushDeletionsAll.keys()];let he=await this.runPushLoop(e,S,ie,V,l,_,Q,M,t,r,J);if(d=[],he.kind!=="done"&&ie.pushDeletionsAll.size>0&&c.push(...ie.pushDeletionsAll.keys()),he.kind==="conflict")return p("conflict",{detail:he.detail});if(he.kind==="retry-exhausted"){l.push(...he.merge.warnings);let ee=await this.buildTerminalQuarantineEntries(e,S,he.pushFiles,he.merge.quarantineEntries,V),_e=[...he.merge.quarantineEntries,...he.merge.resolvedQuarantineEntries,...ee];return await this.flushQuarantine(_e,l),p("retry-exhausted",{detail:he.detail,quarantinedCount:_e.length,..._e.length>0?{quarantinedPaths:_e.map(Te=>Te.path)}:{}})}let{examinedHead:Ue,pushedSha:ce,applyWrites:ue,applyDeletes:fe,pushFiles:ne}=he,me=he.merge;l.push(...me.warnings),l.push(...he.deferredWarnings),c.push(...he.withheldDeletions);let Le=he.deferredPaths.size>0?{deferredPaths:[...he.deferredPaths]}:{},B=he.pushedDeletions.length>0?{pushedDeletes:he.pushedDeletions}:{},oe=await this.flushQuarantine([...me.quarantineEntries,...me.resolvedQuarantineEntries],l);he.secretQuarantineEntries.length>0&&await this.flushQuarantine(he.secretQuarantineEntries,l);let Ee=new Set;if(!oe&&me.resolvedQuarantineEntries.length>0){for(let ee of me.resolvedQuarantineEntries)Ee.add(ee.path);l.push(`quarantine flush failed \u2014 remote-wins apply withheld for ${Ee.size} path(s); local files untouched, conflict re-derives next sync (D18 durability gate)`)}if(ce===void 0&&Ue===S.lastSyncedSha&&ue.length===0&&fe.length===0&&me.mergedWrites.length===0&&me.quarantineEntries.length===0&&me.resolvedQuarantineEntries.length===0&&(S.pinnedPaths?.length??0)===0&&he.alreadyInHead.length===0&&he.deferredPaths.size===0&&!Q)return p("synced");let Ce=ce??Ue,xe=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,Ce,this.deps.baseURL);if(ce!==void 0&&xe.parents[0]!==Ue)return await this.checkRaceWindow(e,S,Ue,xe.parents[0],ne,new Set(he.pushedDeletions),l,_),l.push(`race-window: watermark NOT advanced (pushed commit's parent ${xe.parents[0]} != examined head ${Ue}) \u2014 next sync reconciles the concurrent change`),p("synced",{pushedSha:ce,pushedCount:ne.size,mergedCount:me.mergedCount,quarantinedCount:me.quarantineEntries.length+me.resolvedQuarantineEntries.length,...me.mergedPaths.length>0?{mergedPaths:me.mergedPaths}:{},...d_(me).length>0?{quarantinedPaths:d_(me)}:{},...Le,...B});let{pulledCount:Oe,pinnedPaths:Re,pulledPaths:Ae}=await this.applyRemoteChanges(y,V,[...ue,...me.mergedWrites].filter(ee=>!Ee.has(ee.path)),fe.filter(ee=>!Ee.has(ee.path)),l,$);for(let ee of me.quarantineEntries)Re.add(ee.path);for(let ee of he.deferredPaths)Re.add(ee);for(let ee of Ee)Re.add(ee);if(_.fileMode){for(let ee of M)Re.add(ee);for(let ee of he.remoteOversized)Re.add(ee)}return await this.advanceWatermark(e,Ce,xe.treeSha,V,[...ue,...me.mergedWrites,...he.deferredRemoteChanges],se,Re,te.diskBlobShas,_,M),await this.resolveClearedPins(e,se,Re,l,new Set(me.resolvedQuarantineEntries.map(ee=>ee.path))),p("synced",{pushedSha:ce,pulledCount:Oe,pushedCount:ne.size,mergedCount:me.mergedCount,quarantinedCount:me.quarantineEntries.length+me.resolvedQuarantineEntries.length,...me.mergedPaths.length>0?{mergedPaths:me.mergedPaths}:{},...Ae.length>0?{pulledPaths:Ae}:{},...d_(me).length>0?{quarantinedPaths:d_(me)}:{},...Le,...B})}catch(h){let _=this.deps.redact??(y=>y);return d.length>0&&c.push(...d),(0,Zte.isAuthError)(h)?p("auth-required",{detail:_(`authentication failed: ${qa(h)} \u2014 the PAT is expired, revoked or under-scoped; update it in the per-device secure storage (R8). Never treated as success.`)}):(l.push(`sync failed: ${_(qa(h))}`),p("error",{detail:_(qa(h))}))}finally{this.activeTimer=s,this.activeLocalIoProgress=o}}async flushQuarantine(e,t){if(e.length===0)return!0;let r=this.deps.redact??(s=>s);for(let s of e)t.push(r(`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??(l=>l);return t.push(`quarantine sink failed: ${o(qa(s))} \u2014 files untouched on disk; the conflict re-derives next sync (D17 degradation)`),!1}}async flushOutbox(e,t){let r=this.deps.outbox;if(r===void 0)return{pushed:0,reconflicted:0};let i=await r.listForRepo(e.repoKey);if(i.length===0)return{pushed:0,reconflicted:0};let s=this.deps.redact??(_=>_),o,l;try{({head:o,shaByPath:l}=await this.outboxHeadTreeShas(e))}catch(_){return t.push(`outbox flush deferred (${i.length} resolution(s) awaiting push): ${s(qa(_))}`),{pushed:0,reconflicted:0}}let c=0,u=[];for(let _ of i){let y=l.get(_.path)??CA.OUTBOX_REMOTE_ABSENT,b=y===CA.OUTBOX_REMOTE_ABSENT&&_.baseRemoteSha!==CA.OUTBOX_REMOTE_ABSENT?[...l].filter(([S,I])=>S!==_.path&&I===_.baseRemoteSha).map(([S])=>S):[];if(y!==_.baseRemoteSha&&b.length===0){await r.remove(_.repoKey,_.path),c++,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:b})}if(u.length===0)return{pushed:0,reconflicted:c};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,yk.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(qa(_))}`),{pushed:0,reconflicted:c}}let h=0;for(let{entry:_,stalePaths:y}of u){let b=y.filter(S=>!f.has(S));await this.snapOutboxWatermark(e,_.path,_.chosenContent,b),await this.deps.quarantine?.markResolved?.(_.repoKey,_.path);for(let S of b)await this.deps.quarantine?.markResolved?.(_.repoKey,S);await r.remove(_.repoKey,_.path),h++,b.length>0&&t.push(`consolidated cross-path conflict for ${_.path} \u2014 removed ${b.length} stale remote copy/copies (recoverable in git history)`)}return h>0&&t.push(`pushed ${h} resolved conflict(s)`),{pushed:h,reconflicted:c}}async outboxHeadTreeShas(e){let t=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),r=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,t,this.deps.baseURL),i=await(0,_t.getTree)(this.transport,e.owner,e.repo,r.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,r,i=[]){let s=await this.deps.watermarkStore.get(e.repoKey);if(s===null)return;let o=new Set([t,...i]),l=(s.pinnedPaths??[]).filter(y=>!o.has(y)),c=await(0,uc.gitBlobSha)(r,this.sha1),u=(0,Qs.extractAssetUid)(r),f={path:t,blobSha:c,...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,b)=>b===h?f:y):[...p,f];await this.deps.watermarkStore.set(e.repoKey,{...s,files:_,...l.length>0?{pinnedPaths:l}:{pinnedPaths:void 0}})}async buildTerminalQuarantineEntries(e,t,r,i,s){let o=new Set(i.map(u=>u.path)),l=new Map;try{let u=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),f=(await(0,_t.getTree)(this.transport,e.owner,e.repo,(await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,u,this.deps.baseURL)).treeSha,this.deps.baseURL)).filter(d=>r.has(d.path));for(let d of f)l.set(d.path,await(0,_t.getBlobText)(this.transport,e.owner,e.repo,d.blobSha,this.deps.baseURL))}catch{}let c=[];for(let[u,f]of r){if(o.has(u))continue;let d=s.get(u),p=d??f,h=d!==void 0&&!(0,Xs.contentEquals)(d,f),_=typeof p=="string"?(0,Qs.extractAssetUid)(p):void 0,y=l.get(u);c.push({repoKey:e.repoKey,path:u,..._!==void 0?{uid:_}:{},reason:`non-fast-forward push failed after ${this.deps.maxPushRetries??fn.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 c}async resolveClearedPins(e,t,r,i,s=new Set){let o=this.deps.quarantine;if(o===void 0||o.markResolved===void 0)return;let l=(t.pinnedPaths??[]).filter(c=>!r.has(c)&&!s.has(c));for(let c of l)try{await o.markResolved?.(e.repoKey,c)}catch(u){let f=this.deps.redact??(d=>d);i.push(`quarantine markResolved failed for ${c}: ${f(qa(u))} \u2014 unresolved-count may overcount until the resolver UI reconciles (CQ4)`)}}async resolveBaseTreeSha(e,t){try{return(await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,t.lastSyncedSha,this.deps.baseURL)).treeSha}catch{return null}}pinLocalChanges(e,t,r,i,s){let o=e.modified.filter(p=>p.basePath!==void 0),l=[...e.added,...e.modified.filter(p=>p.basePath===void 0)],c=new Map;if(s==="pull"){for(let p of o)p.basePath!==void 0&&i.push(p.basePath),r.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),r.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&&c.set(p.basePath,p.path);for(let p of e.deleted)c.set(p.path,p.path)}let u=[...l,...o,...e.deleted.map(p=>({...p}))],f=new Set(e.deleted.map(p=>p.path)),d=new Map;for(let p of[...l,...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:c,dupUids:e.duplicateUids}}async runPushLoop(e,t,r,i,s,o,l=!1,c=new Set,u="sync",f,d){let{localChanges:p,localDeletedPaths:h,pushFilesAll:_,pushDeletionsAll:y,dupUids:b}=r,S=this.deps.maxPushRetries??fn.DEFAULT_MAX_PUSH_RETRIES,I=0,O="",T,E=[],P=[],V=new Map,M=new Set,j=[],$=OA,G=[],ge=new Set,ye=[],Q=[],se=new Set,J=[],ve=new Set;for(;;){O=I===0&&d!==void 0&&_.size===0&&y.size===0?d:await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),E=[],P=[],$=OA,G=[],ge=new Set,ye=[],Q=[];let te,ie=new Set,he=(t.pinnedPaths?.length??0)>0;if(O!==t.lastSyncedSha||he||l){this.emitProgress(f,e.repoKey,"pulling-remote");let ue=await this.collectRemoteChanges(e,t,O,o,c,s,se,f);te=ue.headTreeByPath;let fe=this.matchLocalVsRemote(p,h,i,ue.changes,ie,b,ue.headTreeByPath);if(fe.conflicts.length>0){if(u==="sync"&&this.emitProgress(f,e.repoKey,"merging"),u!=="sync"){for(let ne of fe.conflicts){ge.add(ne.local.path),ne.local.basePath!==void 0&&ge.add(ne.local.basePath);for(let me of ne.remotes)ge.add(me.path),me.kind==="change"&&ye.push(me)}Q.push(`${u}-only: ${fe.conflicts.length} conflict(s) deferred to a full Sync (${fe.conflicts.map(ne=>ne.desc).join("; ")}) \u2014 paths pinned, nothing merged`)}else if(o.fileMode)$=this.resolveFileModeConflicts(e,fe.conflicts,i,fe.applyWrites,fe.applyDeletes);else{if(this.deps.mergeLayer===void 0)return{kind:"conflict",detail:`overlapping change on ${fe.conflicts[0].desc} \u2014 merge layer (A2/A3) required; nothing pushed, nothing written`};$=await this.resolveMergeConflicts(e,t,fe.conflicts,i)}if(u==="sync")for(let ne of fe.conflicts)for(let me of ne.remotes)me.path!==ne.local.path&&(ge.add(me.path),me.kind==="change"&&ye.push(me),Q.push(`conflict group ${ne.desc}: remote change at ${me.path} NOT applied \u2014 pinned to re-derive on the next sync (#3477)`))}if(E=fe.applyWrites,P=fe.applyDeletes,u==="push"&&(E.length>0||P.length>0)){for(let ne of E)ge.add(ne.path),ye.push(ne);for(let ne of P)ge.add(ne.path);Q.push(`push-only: ${E.length+P.length} remote change(s) NOT applied \u2014 pinned to re-derive on the next pull/Sync`),E=[],P=[]}}V=u==="pull"?new Map:new Map([...[..._].filter(([ue])=>!ie.has(ue)),...$.mergedFiles]),M=new Set,j=[];for(let[ue,fe]of y){if(ie.has(fe)){j.push(ue);continue}V.has(ue)||M.add(ue)}if((V.size>0||M.size>0)&&te===void 0&&(te=PA(await(0,_t.getTree)(this.transport,e.owner,e.repo,t.rootTreeSha,this.deps.baseURL))),V.size>0&&te!==void 0){for(let[ue,fe]of V){let ne=te.get(ue);ne!==void 0&&ne===await(0,uc.gitBlobSha)(fe,this.sha1)&&(V.delete(ue),G.push(ue))}G.length>0&&s.push(`phantom push skipped: ${G.length} file(s) already identical in remote HEAD (${G.join(", ")}) \u2014 excluded from the commit (#3475)`)}if(M.size>0&&te!==void 0){for(let ue of[...M])te.has(ue)||M.delete(ue);V.size===0&&M.size>=te.size&&(j.push(...M),Q.push(`deletion of ALL ${M.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`),M.clear())}if(V.size===0&&M.size===0)break;let Ue=new Map;for(let[ue,fe]of V)if(typeof fe=="string")Ue.set(ue,fe);else{let ne=sre(fe);ne!==null&&Ue.set(ue,ne)}let ce=(0,bk.scanForSecrets)(Ue);if(ce.length>0){let ue=new Map;for(let fe of ce){let ne=ue.get(fe.path);ne===void 0?ue.set(fe.path,[fe.kind]):ne.includes(fe.kind)||ne.push(fe.kind)}for(let[fe,ne]of ue){if(!ve.has(fe)){ve.add(fe);let me=Ue.get(fe),Le=me!==void 0?(0,bk.redactSecrets)(me):void 0,B=Le!==void 0?(0,Qs.extractAssetUid)(Le):void 0;J.push({repoKey:e.repoKey,path:fe,...B!==void 0?{uid:B}:{},reason:`secret-scan (R5): detected ${ne.join(", ")} \u2014 skipped from the push (the secret is NEVER shipped); a redacted copy is quarantined. REVOKE the credential, then re-sync once it is removed.`,...Le!==void 0?{localContent:Le}:{}})}V.delete(fe)}s.push(`secret-scan (R5): skipped ${ue.size} file(s) with a detected secret from the push \u2014 the rest of the changeset shipped; REVOKE the credential(s): ${[...ue].map(([fe,ne])=>`${fe} (${ne.join(", ")})`).join(", ")}`);for(let[fe,ne]of y)ve.has(ne)&&M.has(fe)&&(M.delete(fe),j.push(fe));if(V.size===0&&M.size===0)break}try{T=await(0,yk.restCreateCommit)(this.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:new Map([...V].map(([ue,fe])=>[ue,ore(fe)])),deletions:[...M],message:this.deps.commitMessage?.(e,V.size,M.size)??`chore(exosync): sync ${V.size} file(s)${M.size>0?`, ${M.size} deletion(s)`:""}`,baseURL:this.deps.baseURL,redact:this.deps.redact});break}catch(ue){if(!Ak(ue))throw ue;if(I++,I>S)return{kind:"retry-exhausted",detail:`non-fast-forward push failed after ${S} retries (D16 cap) \u2014 contended files routed to quarantine (D17)`,pushFiles:V,merge:$};s.push(`non-fast-forward push (attempt ${I}/${S}) \u2014 re-pulling and retrying (D16)`)}}return{kind:"done",examinedHead:O,pushedSha:T,applyWrites:E,applyDeletes:P,pushFiles:V,pushedDeletions:T!==void 0?[...M]:[],withheldDeletions:j,merge:$,remoteOversized:se,alreadyInHead:G,deferredPaths:ge,deferredRemoteChanges:ye,deferredWarnings:Q,secretQuarantineEntries:J}}async resolveMergeConflicts(e,t,r,i){let s=this.deps.mergeLayer;if(s===void 0)return OA;let o=new Map(t.files.map(y=>[y.path,y])),l=new Map,c=[],u=[],f=[],d=[],p=0,h=a(y=>typeof y=="string"?y:void 0,"asText"),_=a((y,b,S)=>{let I=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:b,...S!==void 0?{baseContent:S}:{},...I!==void 0?{localContent:I}:{},...O!==void 0?{remoteContent:O}:{}}},"entry");for(let y of r){let b=o.get(y.local.basePath??y.local.path)??o.get(y.remotes[0]?.path??""),S;if(b!==void 0&&(S=await(0,_t.getBlobText)(this.transport,e.owner,e.repo,b.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(", ")})`,S));continue}let I=y.remotes[0],O=h(i.get(y.local.path)),T=await s.resolve({path:y.local.path,...y.local.uid!==void 0?{uid:y.local.uid}:{},...S!==void 0?{base:S}:{},...O!==void 0?{local:O}:{},...I.kind==="change"&&typeof I.content=="string"?{remote:I.content}:{}});if(T.action==="quarantine"){u.push(_(y,T.reason,S));continue}p++,d.push(y.local.path);for(let P of T.warnings??[])f.push(`merge(${y.local.path}): ${P}`);let E=I.kind==="change"?I.content:void 0;if(T.content!==E&&l.set(y.local.path,T.content),T.content!==i.get(y.local.path)){let P=(0,Qs.extractAssetUid)(T.content)??y.local.uid;c.push({path:y.local.path,kind:"change",content:T.content,blobSha:await(0,uc.gitBlobSha)(T.content,this.sha1),...P!==void 0?{uid:P}:{}})}}return{mergedFiles:l,mergedWrites:c,quarantineEntries:u,resolvedQuarantineEntries:[],mergedCount:p,mergedPaths:d,warnings:f}}resolveFileModeConflicts(e,t,r,i,s){let o=[],l=[];for(let c of t){c.remotes.length>1&&l.push(`file-mode conflict on ${c.local.path} unexpectedly overlaps ${c.remotes.length} remote changes \u2014 resolving against the first`);let u=c.remotes[0],f=r.get(c.local.path);u.kind==="change"?i.push(u):s.push(u),!(c.localIsDelete||f===void 0)&&o.push({repoKey:e.repoKey,path:c.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:l}}async applyRemoteChanges(e,t,r,i,s,o=new Map){let l=0,c=new Set,u=[],f=a(async(h,_)=>{try{return _?await Ek(e,h):await e.read(h)}catch{return}},"tryRead"),d=a(async(h,_)=>{typeof _=="string"?await e.write(h,_):await are(e,h,_)},"writeContent"),p=a(async h=>{let _=await f(h,!1);return _===void 0?!0:await(0,uc.gitBlobSha)(_,this.sha1)===o.get(h)},"cacheHitUnchanged");for(let h of r){if(h.content===void 0)continue;if(!vk(h.path)){s.push(`unsafe remote path skipped on pull-apply: ${h.path}`),c.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`),c.add(h.path);continue}await d(h.path,h.content),l++,u.push(h.path);continue}let y=await f(h.path,typeof(_??h.content)!="string");if(!(0,Xs.contentEquals)(y,_)){s.push(`pull-apply skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 remote change re-derives next sync`),c.add(h.path);continue}await d(h.path,h.content),l++,u.push(h.path)}for(let h of i){if(!vk(h.path)){s.push(`unsafe remote path skipped on pull-delete: ${h.path}`),c.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`),c.add(h.path);continue}await e.delete(h.path),l++,u.push(h.path);continue}if(_!==void 0){let y=await f(h.path,typeof _!="string");if(y!==void 0&&!(0,Xs.contentEquals)(y,_)){s.push(`pull-delete skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 delete-vs-modify re-derives next sync`),c.add(h.path);continue}await e.delete(h.path),l++,u.push(h.path)}}return{pulledCount:l,pinnedPaths:c,pulledPaths:u}}async advanceWatermark(e,t,r,i,s,o,l,c,u,f=new Set){let d=(await(0,_t.getTree)(this.transport,e.owner,e.repo,r,this.deps.baseURL)).filter(h=>u.treeFilter(h)&&!f.has(h.path)),p=cre(await this.buildWatermarkFiles(e,d,i,s,o,c,u),o,l);await this.deps.watermarkStore.set(e.repoKey,{lastSyncedSha:t,rootTreeSha:r,files:p,...l.size>0?{pinnedPaths:[...l]}:{},...u.fileMode?{spaceKind:"file"}:{}})}async tryMountBaseBootstrap(e,t,r,i,s){let o=this.deps.mountBaseStore,l=null;if(o!==void 0)try{l=await o.get(e.repoKey)}catch{return null}let c=!1;if(l===null&&this.deps.localBaseShaProvider!==void 0)try{let b=await this.deps.localBaseShaProvider(e);typeof b=="string"&&b.length>0&&(l=b,c=!0)}catch{}if(l===null||t.startsWith(l))return null;let u=300,f=null;try{let b=t;for(let S=0;S<u;S++){let I=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,b,this.deps.baseURL);if(I.sha===l||I.sha.startsWith(l)){f=I;break}if(I.parents.length===0)break;b=I.parents[0]}}catch{return null}if(f===null)return null;let d;try{d=(await(0,_t.getTree)(this.transport,e.owner,e.repo,f.treeSha,this.deps.baseURL)).filter(b=>(0,Xs.isSyncablePath)(b.path))}catch{return null}let p;try{let b=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,t,this.deps.baseURL);p=PA((await(0,_t.getTree)(this.transport,e.owner,e.repo,b.treeSha,this.deps.baseURL)).filter(S=>(0,Xs.isSyncablePath)(S.path)))}catch{return null}let h=d.filter(b=>!r.has(b.path)&&p.get(b.path)===b.blobSha);if(h.length>0){let b=h.slice(0,3).map(S=>S.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 (${b}); 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 (${b}); 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(b=>({path:b.path,blobSha:b.blobSha})),y={lastSyncedSha:f.sha,rootTreeSha:f.treeSha,files:_};if(c&&o!==void 0)try{await o.set(e.repoKey,f.sha)}catch{}return i.push(c?`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,r,i){let s=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),o=await this.tryMountBaseBootstrap(e,s,t,r,i);if(o!==null)return o;let l=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,s,this.deps.baseURL),c=(await(0,_t.getTree)(this.transport,e.owner,e.repo,l.treeSha,this.deps.baseURL)).filter(p=>(0,Xs.isSyncablePath)(p.path)),u=[],f;for(let p of c){let h=t.get(p.path);if(h===void 0||await(0,uc.gitBlobSha)(h,this.sha1)!==p.blobSha){f===void 0&&(f=p.path);continue}let _=typeof h=="string"?(0,Qs.extractAssetUid)(h):void 0;u.push({path:p.path,blobSha:p.blobSha,..._?{uid:_}:{}})}let d={lastSyncedSha:s,rootTreeSha:l.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`})}:(r.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===c.length?(await this.deps.watermarkStore.set(e.repoKey,d),r.push(`watermark bootstrapped from head ${s} (local tree identical to remote)`),{kind:"settled",outcome:i("synced")}):(r.push(`first-sync (asset mode): local tree (${t.size} files) is a pure superset of remote head ${s} (${c.length} files) \u2014 ${t.size-c.length} local-only addition(s) derive as pushable adds (#3565)`),{kind:"additive-base",base:d})}async collectRemoteChanges(e,t,r,i,s=new Set,o=[],l=new Set,c){let u=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,r,this.deps.baseURL),f=await(0,_t.getTree)(this.transport,e.owner,e.repo,u.treeSha,this.deps.baseURL);if(i.fileMode)for(let M of f)i.syncable(M.path)&&!i.treeFilter(M)&&!l.has(M.path)&&(l.add(M.path),o.push(`skipped oversized REMOTE file ${M.path} (${M.size??"?"} bytes over cap) \u2014 excluded from sync symmetrically (Phase C size cap)`));let d=f.filter(M=>i.treeFilter(M)&&!s.has(M.path)),p=t.files.filter(M=>!l.has(M.path)&&!s.has(M.path)),{changed:h,deleted:_}=Tk(p,d),y=h.length;y>=wk&&this.emitProgress(c,e.repoKey,"fetching-blobs",{done:0,total:y});let b=new Array(h.length),S=0,I=0,O,T=a(async M=>{if(i.fileMode){let $=await(0,_t.getBlobBytes)(this.transport,e.owner,e.repo,M.blobSha,this.deps.baseURL);return{path:M.path,kind:"change",blobSha:M.blobSha,content:$}}let j=await(0,_t.getBlobText)(this.transport,e.owner,e.repo,M.blobSha,this.deps.baseURL);return{path:M.path,kind:"change",blobSha:M.blobSha,content:j,uid:(0,Qs.extractAssetUid)(j)}},"fetchOne"),E=a(async()=>{for(;;){if(O!==void 0)return;let M=S++;if(M>=h.length)return;try{b[M]=await T(h[M])}catch(j){O===void 0&&(O=j);return}I+=1,y>=wk&&I%tre===0&&I<y&&this.emitProgress(c,e.repoKey,"fetching-blobs",{done:I,total:y})}},"worker"),P=Math.min(rre,h.length);if(await Promise.all(Array.from({length:P},()=>E())),O!==void 0)throw O instanceof Error?O:new Error(String(O));let V=b;for(let M of _)V.push({path:M.path,kind:"delete",uid:M.uid});return{changes:V,headTreeByPath:PA(f)}}matchLocalVsRemote(e,t,r,i,s,o=new Set,l){let c=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,b]of f)b>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 b=p.get(y.uid)??[];b.push(y),p.set(y.uid,b)}h.set(y.path,y)}for(let y of e){let b=new Set;if(y.uid!==void 0&&!d.has(y.uid))for(let T of p.get(y.uid)??[])T.kind==="change"&&T.path!==y.path&&(l?.has(y.path)===!0||y.basePath!==void 0&&l?.has(y.basePath)===!0)||b.add(T);let S=h.get(y.path);if(S!==void 0&&b.add(S),y.basePath!==void 0){let T=h.get(y.basePath);T!==void 0&&b.add(T)}let I=[],O=!1;for(let T of b){if(O=t.has(y.path)&&!r.has(y.path),O&&T.kind==="delete"){c.add(T);continue}if(!O&&T.kind==="change"&&T.path===y.path&&T.blobSha===y.blobSha){c.add(T),s.add(y.path);continue}if(T.kind==="delete"&&y.basePath!==void 0&&T.path===y.basePath){let E=h.get(y.path);if(E!==void 0&&E.kind==="change"&&(E.blobSha===y.blobSha||E.uid!==void 0&&E.uid===y.uid)){c.add(T);continue}}if(T.kind==="delete"&&T.path!==y.path&&T.path!==y.basePath&&!r.has(T.path)&&l?.has(T.path)!==!0){c.add(T);continue}I.push(T),c.add(T)}I.length>0&&(u.push({local:y,localIsDelete:O,remotes:I,desc:`${y.uid!==void 0&&!d.has(y.uid)?y.uid:y.path} (local ${O?"delete":"change"} vs remote ${I[0].kind} at ${I[0].path})`}),s.add(y.path))}let _=i.filter(y=>!c.has(y));return{conflicts:u,applyWrites:_.filter(y=>y.kind==="change"),applyDeletes:_.filter(y=>y.kind==="delete")}}async checkRaceWindow(e,t,r,i,s,o,l,c){try{let u=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,i,this.deps.baseURL),f=(await(0,_t.getTree)(this.transport,e.owner,e.repo,u.treeSha,this.deps.baseURL)).filter(c.treeFilter),d=r===t.lastSyncedSha?t.files:(await(0,_t.getTree)(this.transport,e.owner,e.repo,(await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,r,this.deps.baseURL)).treeSha,this.deps.baseURL)).filter(c.treeFilter),{changed:p,deleted:h}=Tk(d,f);for(let _ of p)s.has(_.path)&&l.push(`race-window: concurrent commit ${i} changed ${_.path} between conflict check (head ${r}) and push \u2014 local version won; previous version recoverable from git history`),o.has(_.path)&&l.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)&&l.push(`race-window: concurrent commit ${i} deleted ${_.path}; push re-created it`)}catch(u){let f=this.deps.redact??(d=>d);l.push(`race-window check failed: ${f(qa(u))}`)}}async buildWatermarkFiles(e,t,r,i,s,o,l){if(l.fileMode)return t.map(f=>({path:f.path,blobSha:f.blobSha}));let c=new Map;for(let f of i)f.kind==="change"&&f.blobSha!==void 0&&c.set(f.blobSha,f.uid);for(let[f,d]of r){let p=o?.get(f)??await(0,uc.gitBlobSha)(d,this.sha1);c.set(p,typeof d=="string"?(0,Qs.extractAssetUid)(d):void 0)}for(let f of s.files)c.has(f.blobSha)||c.set(f.blobSha,f.uid);let u=[];for(let f of t){let d;if(c.has(f.blobSha))d=c.get(f.blobSha);else{let p=await(0,_t.getBlobText)(this.transport,e.owner,e.repo,f.blobSha,this.deps.baseURL);d=(0,Qs.extractAssetUid)(p)}u.push({path:f.path,blobSha:f.blobSha,...d?{uid:d}:{}})}return u}};fn.SyncEngine=DA});var Rk=v(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.QuarantineResolver=void 0;Op.backupPathFor=xk;var ure=n_(),p_=tf(),Rp=ef(),Cp=Tp(),fre=a_(),Js="\0absent",FA=class{static{a(this,"QuarantineResolver")}constructor(e){this.deps=e}async listOpenConflicts(e){let t=[];for(let r of e)t.push(...await this.listRepoConflicts(r));return t}async listRepoConflicts(e){if(e.spaceKind==="file")return[];let t=await this.deps.watermarkStore.get(e.repoKey),r=t?.pinnedPaths??[];if(r.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(r=r.filter(y=>!_.has(y)),r.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,r),l=r.some(h=>!o.has(h)),c=new Map,u=!0;if(l)if(s)try{c=await this.remoteTreeShas(e)}catch{u=!1}else c=await this.remoteTreeShas(e);let f=this.deps.localFilesFor(e),d=new Set(await f.list()),p=[];for(let h of r){let _=o.get(h),y,b;if(_!==void 0)b=_.remoteContent!==void 0?await(0,Rp.gitBlobSha)(_.remoteContent,this.deps.sha1):Js,y=_.baseContent!==void 0?await(0,Rp.gitBlobSha)(_.baseContent,this.deps.sha1):i.get(h)??Js;else{if(!u)continue;b=c.get(h)??Js,y=i.get(h)??Js}let S=Js,I;if(d.has(h)&&(I=await f.read(h),S=await(0,Rp.gitBlobSha)(I,this.deps.sha1)),!(S!==b&&S!==y&&b!==y))continue;let T=(I!==void 0?(0,Cp.extractAssetUid)(I):void 0)??_?.uid;p.push({repoKey:e.repoKey,path:h,...T!==void 0?{uid:T}:{},hasLocal:S!==Js,hasRemote:b!==Js})}return p}async cachedRecordsFor(e,t){let r=new Map,i=this.deps.conflictCache;if(i===void 0)return r;for(let s of t){let o=await i.get(e.repoKey,s);o!==null&&r.set(s,o)}return r}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 l;try{l=await s.read(o)}catch{continue}let c=(0,Cp.extractAssetUid)(l);c!==void 0&&t.set(c,(t.get(c)??0)+1)}}let r=0;for(let i of t.values())i>1&&r++;return r}async loadConflict(e,t){let r=this.deps.localFilesFor(e),s=new Set(await r.list()).has(t)?await r.read(t):void 0,o=await this.deps.conflictCache?.get(e.repoKey,t)??null,l,c;if(o!==null)l=o.remoteContent,c=o.baseContent;else{let d=(await this.remoteTreeShas(e)).get(t);l=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{c=await this.blobText(e,h)}catch{c=void 0}}let u=(s!==void 0?(0,Cp.extractAssetUid)(s):void 0)??(l!==void 0?(0,Cp.extractAssetUid)(l):void 0)??o?.uid;return{repoKey:e.repoKey,path:t,...u!==void 0?{uid:u}:{},hasLocal:s!==void 0,hasRemote:l!==void 0,...c!==void 0?{base:c}:{},...s!==void 0?{local:s}:{},...l!==void 0?{remote:l}:{}}}async resolve(e,t,r){let i=this.deps.localFilesFor(e),o=new Set(await i.list()).has(t)?await i.read(t):void 0,l=this.deps.outbox!==void 0,{remote:c,remoteSha:u}=l?await this.remoteForResolve(e,t):await this.liveRemoteForResolve(e,t),f=this.chosenContent(r,o,c),d;r.take!=="local"&&o!==void 0&&o!==f&&(d=xk(t),await i.write(d,o)),f===void 0?await i.delete(t):await i.write(t,f);let h=f===void 0&&c===void 0||f===c;if(l&&this.deps.outbox!==void 0&&!h&&f!==void 0)return await this.deps.outbox.enqueue({repoKey:e.repoKey,path:t,chosenContent:f,resolvedTo:r.take==="merged"?"merged":"local",baseRemoteSha:u===Js?fre.OUTBOX_REMOTE_ABSENT:u,resolvedAt:""}),{repoKey:e.repoKey,path:t,resolvedTo:r.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:r.take,..._!==void 0?{pushedSha:_}:{},...d!==void 0?{discardedLocalBackupPath:d}:{}}}async remoteForResolve(e,t){let r=await this.deps.conflictCache?.get(e.repoKey,t)??null;if(r!==null){let i=r.remoteContent,s=i!==void 0?await(0,Rp.gitBlobSha)(i,this.deps.sha1):Js;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??Js}}chosenContent(e,t,r){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 r;case"merged":return e.content}}async commitChoice(e,t,r){let i=this.deps.commitMessage?.(e,t)??`chore(exosync): resolve conflict for ${t}`;if(r===void 0)throw new Error(`resolve: cannot push an empty resolution for ${t}`);return(0,ure.restCreateCommit)(this.deps.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:new Map([[t,r]]),message:i,...this.deps.baseURL!==void 0?{baseURL:this.deps.baseURL}:{},...this.deps.redact!==void 0?{redact:this.deps.redact}:{}})}async snapWatermark(e,t,r){let i=await this.deps.watermarkStore.get(e.repoKey);if(i===null)return;let s=(i.pinnedPaths??[]).filter(l=>l!==t),o=i.files;if(r===void 0)o=o.filter(l=>l.path!==t);else{let l=await(0,Rp.gitBlobSha)(r,this.deps.sha1),c=(0,Cp.extractAssetUid)(r),u={path:t,blobSha:l,...c!==void 0?{uid:c}:{}},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,p_.getHeadSha)(this.deps.transport,e.owner,e.repo,e.branch,this.deps.baseURL),r=await(0,p_.getCommitInfo)(this.deps.transport,e.owner,e.repo,t,this.deps.baseURL),i=await(0,p_.getTree)(this.deps.transport,e.owner,e.repo,r.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,p_.getBlobText)(this.deps.transport,e.owner,e.repo,t,this.deps.baseURL)}};Op.QuarantineResolver=FA;function xk(n){return`${n}.conflict.local.txt`}a(xk,"backupPathFor")});var Ck=v(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.FileLocalManifestStore=rf.LOCAL_MANIFEST_STORE_FILENAME=void 0;rf.LOCAL_MANIFEST_STORE_FILENAME="exosync-localmanifest.local.json";function dre(n){if(n===null||typeof n!="object")return!1;let e=n;return e.version===1&&typeof e.lastFullRehashMs=="number"&&e.files!==null&&typeof e.files=="object"}a(dre,"isLocalManifestRecord");var LA=class{static{a(this,"FileLocalManifestStore")}constructor(e){this.io=e,this.writeChain=Promise.resolve()}async get(e){let r=(await this.readRepos())[e];return dre(r)?r:null}async set(e,t){let r=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=r.catch(()=>{}),r}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 r=t.repos;return r===null||typeof r!="object"?{}:{...r}}catch{return{}}}};rf.FileLocalManifestStore=LA});var MA=v(kA=>{"use strict";Object.defineProperty(kA,"__esModule",{value:!0});kA.diff3=pre;function Ok(n,e){let t=n.length,r=e.length,i=Array.from({length:t+1},()=>new Int32Array(r+1));for(let c=t-1;c>=0;c--)for(let u=r-1;u>=0;u--)i[c][u]=n[c]===e[u]?i[c+1][u+1]+1:Math.max(i[c+1][u],i[c][u+1]);let s=new Map,o=0,l=0;for(;o<t&&l<r;)n[o]===e[l]?(s.set(o,l),o++,l++):i[o+1][l]>=i[o][l+1]?o++:l++;return s}a(Ok,"lcsMatch");function NA(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}a(NA,"sliceEq");function pre(n,e,t){let r=Ok(n,e),i=Ok(n,t),s=[],o=0,l=0,c=0;for(;;){let u=o;for(;u<n.length&&!(r.has(u)&&i.has(u));)u++;let f=u<n.length?r.get(u):e.length,d=u<n.length?i.get(u):t.length,p=n.slice(o,u),h=e.slice(l,f),_=t.slice(c,d),y=!NA(h,p),b=!NA(_,p);if(!y&&!b)s.push(...p);else if(!y)s.push(..._);else if(!b)s.push(...h);else if(NA(h,_))s.push(...h);else return{ok:!1,conflict:{base:p,local:h,remote:_}};if(u>=n.length)break;s.push(n[u]),o=u+1,l=f+1,c=d+1}return{ok:!0,merged:s}}a(pre,"diff3")});var Dk=v(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.StructuredMerger=void 0;Fp.splitSections=h_;var Pk=MA(),hre=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/,Pp="exo__Instance_class";function Dp(n){if(n===null||typeof n!="object")return!0;if(Array.isArray(n))return n.every(Dp);let e=Object.getPrototypeOf(n);return e!==Object.prototype&&e!==null?!1:Object.values(n).every(Dp)}a(Dp,"isPlainValue");function Ga(n,e){if(n===e)return!0;if(n===null||e===null||n===void 0||e===void 0||typeof n!="object"||typeof e!="object"||Array.isArray(n)!==Array.isArray(e))return!1;if(Array.isArray(n)&&Array.isArray(e))return n.length!==e.length?!1:n.every((s,o)=>Ga(s,e[o]));let t=n,r=e,i=Object.keys(t);return i.length!==Object.keys(r).length?!1:i.every(s=>Ga(t[s],r[s]))}a(Ga,"deepEqual");function fc(n){return typeof n=="string"?`s:${n}`:`j:${JSON.stringify(n)}`}a(fc,"setKey");function Oi(n){return n==null?[]:Array.isArray(n)?n:[n]}a(Oi,"toElements");function mre(n,e,t){let r=new Set(Oi(n).map(fc)),i=Oi(e),s=Oi(t),o=new Set(i.map(fc)),l=new Set(s.map(fc)),c=a(d=>o.has(d)&&l.has(d)||o.has(d)&&!r.has(d)||l.has(d)&&!r.has(d),"keep"),u=[],f=new Set;for(let d of[...i,...s]){let p=fc(d);f.has(p)||!c(p)||(f.add(p),u.push(d))}return u}a(mre,"mergeSet");function gre(n,e,t){let r=[],i=[],s=new Set;for(let l of[...Object.keys(n),...Object.keys(e),...Object.keys(t)])s.has(l)||(s.add(l),i.push(l));let o={};for(let l of i){let c=n[l],u=e[l],f=t[l];if(!Dp(c)||!Dp(u)||!Dp(f))return{ok:!1,reason:`frontmatter key "${l}" contains a non-plain value (Date?) \u2014 the codec must round-trip scalars as strings (CORE_SCHEMA contract)`};if(Array.isArray(c)||Array.isArray(u)||Array.isArray(f)){if(!(l in e)&&!(l in t))continue;let d=mre(c,u,f),p=new Set(Oi(c).map(fc)),h=Oi(u).some(y=>!p.has(fc(y))),_=Oi(f).some(y=>!p.has(fc(y)));h&&_&&!Ga(Oi(u),Oi(f))&&r.push(`both sides added values to multi-valued key "${l}" \u2014 union kept (D20)`),d.length>0&&(o[l]=d);continue}if(Ga(u,f)){u!==void 0&&(o[l]=u);continue}if(Ga(u,c)){f!==void 0&&(o[l]=f);continue}if(Ga(f,c)){u!==void 0&&(o[l]=u);continue}return{ok:!1,reason:`frontmatter key "${l}" changed differently on both sides`}}return{ok:!0,value:o,warnings:r}}a(gre,"mergeFrontmatter");var yre=/^(```|~~~)/,_re=/^#{1,6}\s/;function h_(n){let e=n.split(`
320
+ `)}a(bte,"stripGitmodulesEntry")});var ef=v(gA=>{"use strict";Object.defineProperty(gA,"__esModule",{value:!0});gA.gitBlobSha=Ste;async function Ste(n,e){let t=new TextEncoder,r=typeof n=="string"?t.encode(n):n,i=t.encode(`blob ${r.byteLength}\0`),s=new Uint8Array(i.byteLength+r.byteLength);return s.set(i,0),s.set(r,i.byteLength),e(s)}a(Ste,"gitBlobSha")});var Tp=v(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});s_.extractAssetUid=tk;s_.detectChanges=Ete;var wte=ef();function tk(n){let e=/^---\r?\n([\s\S]*?)\r?\n---(?=\r?\n|$)/.exec(n);if(!e)return;let t=/^exo__Asset_uid:[ \t]*["']?([^\s"']+)["']?[ \t]*$/m.exec(e[1]);return t?t[1]:void 0}a(tk,"extractAssetUid");async function Ete(n){let{localFiles:e,cachedEntries:t,watermark:r,actualBaseTreeSha:i,sha1:s}=n;if(r===null)return{kind:"full-conflict",reason:"first-sync"};if(i===null)return{kind:"full-conflict",reason:"base-mismatch",detail:`watermark commit ${r.lastSyncedSha} not resolvable on remote`};if(i!==r.rootTreeSha)return{kind:"full-conflict",reason:"base-mismatch",detail:`stored root tree ${r.rootTreeSha} != actual ${i} at ${r.lastSyncedSha}`};let o=[],l=new Map;for(let[T,E]of e){let P=await(0,wte.gitBlobSha)(E,s);l.set(T,P),o.push({path:T,blobSha:P,uid:typeof E=="string"?tk(E):void 0})}if(t!==void 0)for(let[T,E]of t)l.set(T,E.blobSha),o.push({path:T,blobSha:E.blobSha,uid:E.uid});let c=[],u=[],f=[],d=[],p=new Map;for(let T of o){if(T.uid===void 0)continue;let E=p.get(T.uid)??[];E.push(T.path),p.set(T.uid,E)}let h=new Map;for(let T of r.files){if(T.uid===void 0)continue;let E=h.get(T.uid)??[];E.push(T.path),h.set(T.uid,E)}let _=new Set;for(let[T,E]of p)E.length>1&&_.add(T);for(let[T,E]of h)E.length>1&&_.add(T);for(let T of[..._].sort()){let E=p.get(T)??[],P=E.length>1?`on disk (${E.join(", ")})`:`in the sync base (${(h.get(T)??[]).join(", ")})`;d.push(`duplicate uid ${T} ${P} \u2014 uid identity suppressed for the group; every path matched by path identity (#3477)`)}let y=new Map,b=[];for(let T of r.files)T.uid!==void 0&&!_.has(T.uid)?y.set(T.uid,T):b.push(T);let S=[],I=new Set;for(let T of o){let E=T.uid!==void 0&&!_.has(T.uid)?y.get(T.uid):void 0;T.uid!==void 0&&E!==void 0?(I.add(T.uid),(E.blobSha!==T.blobSha||E.path!==T.path)&&u.push({path:T.path,uid:T.uid,blobSha:T.blobSha,...E.path!==T.path?{basePath:E.path}:{}})):S.push(T)}let O=new Map;for(let T of b)O.set(T.path,T);for(let[T,E]of y)I.has(T)||O.set(E.path,E);for(let T of S){let E=O.get(T.path);E!==void 0?(O.delete(T.path),E.blobSha!==T.blobSha&&u.push({path:T.path,uid:T.uid,blobSha:T.blobSha})):c.push({path:T.path,uid:T.uid,blobSha:T.blobSha})}for(let T of O.values())f.push({path:T.path,uid:T.uid,blobSha:T.blobSha});return{kind:"changes",added:c,modified:u,deleted:f,warnings:d,diskBlobShas:l,duplicateUids:_}}a(Ete,"detectChanges")});var ik=v(Ap=>{"use strict";Object.defineProperty(Ap,"__esModule",{value:!0});Ap.rewriteAssetUid=rk;Ap.findDuplicateUidGroups=nk;Ap.planDuplicateUidFix=Tte;var vte=Tp();function rk(n,e){let t=/^(---\r?\n)([\s\S]*?)(\r?\n---(?=\r?\n|$))/.exec(n);if(t===null)return n;let r=t[2].replace(/^(exo__Asset_uid:[ \t]*["']?)[^\s"']+(["']?[ \t]*)$/m,`$1${e}$2`);return r===t[2]?n:n.slice(0,t.index)+t[1]+r+t[3]+n.slice(t.index+t[0].length)}a(rk,"rewriteAssetUid");function nk(n){let e=new Map;for(let t of n){let r=(0,vte.extractAssetUid)(t.content);if(r===void 0)continue;let i=e.get(r)??[];i.push(t.path),e.set(r,i)}return[...e.entries()].filter(([,t])=>t.length>1).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>({uid:t,paths:r}))}a(nk,"findDuplicateUidGroups");function Tte(n,e){let t=new Map(n.map(i=>[i.path,i.content])),r=[];for(let i of nk(n)){let s=[...i.paths].sort((o,l)=>o.localeCompare(l));for(let o of s.slice(1)){let l=t.get(o);if(l===void 0)continue;let c=e(),u=rk(l,c);u!==l&&r.push({path:o,fromUid:i.uid,toUid:c,content:u})}}return r}a(Tte,"planDuplicateUidFix")});var tf=v(cc=>{"use strict";Object.defineProperty(cc,"__esModule",{value:!0});cc.getHeadSha=Ite;cc.getCommitInfo=xte;cc.getTree=Rte;cc.getBlobText=Cte;cc.getBlobBytes=Ote;var sk=Vc(),Ate="https://api.github.com";function Ip(n){return(n??Ate).replace(/\/$/,"")}a(Ip,"api");function lc(n){return n!==null&&typeof n=="object"?n:void 0}a(lc,"asRecord");function Ys(n,e){let r=lc(n)?.[e];return typeof r=="string"?r:void 0}a(Ys,"readString");async function Ite(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/refs/heads/${encodeURIComponent(r)}`}),o=Ys(lc(s?.json)?.object,"sha");if(typeof o!="string"||o.length===0)throw new Error(`ExoSync: missing object.sha for ref heads/${r}`);return o}a(Ite,"getHeadSha");async function xte(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/commits/${encodeURIComponent(r)}`}),o=lc(s?.json),l=Ys(o,"sha"),c=Ys(o?.tree,"sha");if(!l||!c)throw new Error(`ExoSync: malformed commit response for ${r}`);let u=o?.parents,f=Array.isArray(u)?u.map(d=>Ys(d,"sha")).filter(d=>typeof d=="string"):[];return{sha:l,treeSha:c,parents:f}}a(xte,"getCommitInfo");async function Rte(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/trees/${encodeURIComponent(r)}?recursive=1`}),o=lc(s?.json);if(o?.truncated===!0)throw new Error(`ExoSync: tree ${r} is truncated by GitHub (repo too large for recursive listing) \u2014 refusing to diff`);let l=o?.tree;if(!Array.isArray(l))throw new Error(`ExoSync: malformed tree response for ${r}`);let c=[];for(let u of l){let f=lc(u);if(f?.type!=="blob")continue;let d=Ys(f,"path"),p=Ys(f,"sha"),h=typeof f.size=="number"?f.size:void 0;d&&p&&c.push({path:d,blobSha:p,...h!==void 0?{size:h}:{}})}return c}a(Rte,"getTree");async function Cte(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/blobs/${encodeURIComponent(r)}`}),o=lc(s?.json),l=Ys(o,"content");if(typeof l!="string")throw new Error(`ExoSync: malformed blob response for ${r}`);return Ys(o,"encoding")==="utf-8"?l:(0,sk.base64ToUtf8)(l)}a(Cte,"getBlobText");async function Ote(n,e,t,r,i){let s=await n({method:"GET",url:`${Ip(i)}/repos/${encodeURIComponent(e)}/${encodeURIComponent(t)}/git/blobs/${encodeURIComponent(r)}`}),o=lc(s?.json),l=Ys(o,"content");if(typeof l!="string")throw new Error(`ExoSync: malformed blob response for ${r}`);return Ys(o,"encoding")==="utf-8"?new TextEncoder().encode(l):(0,sk.base64ToBytes)(l)}a(Ote,"getBlobBytes")});var ak=v(yA=>{"use strict";Object.defineProperty(yA,"__esModule",{value:!0});yA.checkParkedStaleness=Dte;var Pte=tf();async function Dte(n,e){let t={repoKey:n.repoKey,localPath:n.localPath},r=e.redact??(o=>o),i=null;try{let l=(await e.watermarks.get(n.repoKey))?.lastSyncedSha??"";l.length>0&&(i=l)}catch(o){return{...t,freshness:"unknown",lastSyncedSha:null,remoteHeadSha:null,reason:`watermark unreadable: ${r(ok(o))}`}}if(i===null)return{...t,freshness:"unknown",lastSyncedSha:null,remoteHeadSha:null,reason:"never synced on this device (no watermark)"};let s;try{s=await(0,Pte.getHeadSha)(e.transport,n.owner,n.repo,n.branch,e.baseURL)}catch(o){return{...t,freshness:"unknown",lastSyncedSha:i,remoteHeadSha:null,reason:`remote unreachable: ${r(ok(o))}`}}return{...t,freshness:s===i?"current":"behind",lastSyncedSha:i,remoteHeadSha:s}}a(Dte,"checkParkedStaleness");function ok(n){return n instanceof Error?n.message:String(n)}a(ok,"errorText")});var SA=v(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.SyncPhaseTimer=nr.SYNC_PHASES=void 0;nr.classifyRestPhase=Fte;nr.emptyTimings=ck;nr.totalMs=o_;nr.addTimings=uk;nr.aggregateTimings=Lte;nr.dominantPhase=Nte;nr.fmtMs=xp;nr.formatTimingsLine=kte;nr.formatRepoTimings=Mte;nr.SYNC_PHASES=["localList","localRead","localWrite","hash","restHead","restCommit","restTree","restBlob","restPush"];function bA(){let n={};for(let e of nr.SYNC_PHASES)n[e]=0;return n}a(bA,"zeroDurations");function lk(){return{filesRead:0,filesHashed:0,filesWritten:0,restCalls:0}}a(lk,"zeroCounts");function Fte(n){if(n.method!=="GET")return"restPush";let e=n.url;return e.includes("/git/blobs/")?"restBlob":e.includes("/git/trees/")?"restTree":e.includes("/git/commits/")?"restCommit":e.includes("/git/refs/")?"restHead":"restCommit"}a(Fte,"classifyRestPhase");var _A=class{static{a(this,"SyncPhaseTimer")}constructor(e){this.now=e,this.durations=bA(),this.counts=lk()}async time(e,t){let r=this.now();try{return await t()}finally{this.durations[e]+=this.now()-r}}bumpRead(){this.counts.filesRead++}bumpHashed(){this.counts.filesHashed++}bumpWritten(){this.counts.filesWritten++}bumpRest(){this.counts.restCalls++}snapshot(){return{durations:{...this.durations},counts:{...this.counts}}}};nr.SyncPhaseTimer=_A;function ck(){return{durations:bA(),counts:lk()}}a(ck,"emptyTimings");function o_(n){let e=0;for(let t of nr.SYNC_PHASES)e+=n.durations[t];return e}a(o_,"totalMs");function uk(n,e){let t=bA();for(let r of nr.SYNC_PHASES)t[r]=n.durations[r]+e.durations[r];return{durations:t,counts:{filesRead:n.counts.filesRead+e.counts.filesRead,filesHashed:n.counts.filesHashed+e.counts.filesHashed,filesWritten:n.counts.filesWritten+e.counts.filesWritten,restCalls:n.counts.restCalls+e.counts.restCalls}}}a(uk,"addTimings");function Lte(n){let e=ck();for(let t of n)t.timings!==void 0&&(e=uk(e,t.timings));return e}a(Lte,"aggregateTimings");function Nte(n){let e=o_(n);if(e<=0)return null;let t=nr.SYNC_PHASES[0],r=-1;for(let i of nr.SYNC_PHASES)n.durations[i]>r&&(r=n.durations[i],t=i);return{phase:t,ms:r,pct:r/e*100}}a(Nte,"dominantPhase");function xp(n){return n>=1e3?`${(n/1e3).toFixed(1)}s`:`${Math.round(n)}ms`}a(xp,"fmtMs");function kte(n){let e=o_(n);if(e<=0)return"";let t=nr.SYNC_PHASES.filter(r=>n.durations[r]>0).sort((r,i)=>n.durations[i]-n.durations[r]).map(r=>`${r} ${xp(n.durations[r])} ${Math.round(n.durations[r]/e*100)}%`);return`\u23F1 ExoSync ${xp(e)} \u2014 ${t.join(" \xB7 ")} (${n.counts.filesHashed} hashed, ${n.counts.filesRead} read, ${n.counts.restCalls} REST)`}a(kte,"formatTimingsLine");function Mte(n,e){let t=nr.SYNC_PHASES.map(r=>`${r}=${xp(e.durations[r])}`);return`[ExoSync timings] ${n}: total ${xp(o_(e))} \u2014 ${t.join(" ")} | hashed ${e.counts.filesHashed} read ${e.counts.filesRead} written ${e.counts.filesWritten} REST ${e.counts.restCalls}`}a(Mte,"formatRepoTimings")});var a_=v(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.LocalOutboxStore=Ba.OUTBOX_REMOTE_ABSENT=Ba.OUTBOX_STORE_FILENAME=void 0;Ba.OUTBOX_STORE_FILENAME="exosync-outbox.local.json";Ba.OUTBOX_REMOTE_ABSENT=" absent";function wA(n,e){return`${n}\0${e}`}a(wA,"outboxKey");function fk(n){if(n===null||typeof n!="object")return!1;let e=n;return typeof e.repoKey=="string"&&typeof e.path=="string"&&typeof e.chosenContent=="string"&&typeof e.baseRemoteSha=="string"}a(fk,"isEntry");var EA=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[wA(e.repoKey,e.path)]={version:1,...e,resolvedAt:e.resolvedAt.length>0?e.resolvedAt:this.now()}})}async remove(e,t){await this.mutate(r=>{delete r.entries[wA(e,t)]})}async list(){let e=await this.read();return Object.values(e.entries).filter(fk)}async listForRepo(e){return(await this.list()).filter(t=>t.repoKey===e)}async has(e,t){let i=(await this.read()).entries[wA(e,t)];return i!==void 0&&fk(i)}async mutate(e){let t=this.writeChain.then(async()=>{let r=await this.read();e(r),await this.io.writeAtomic(JSON.stringify(r,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 r=t.entries;return r===null||typeof r!="object"?{version:1,entries:{}}:{version:1,entries:{...r}}}catch{return{version:1,entries:{}}}}};Ba.LocalOutboxStore=EA});var l_=v(vA=>{"use strict";Object.defineProperty(vA,"__esModule",{value:!0});vA.isAuthError=jte;function jte(n){let e=n instanceof Error?n.message:String(n);return/HTTP 401/.test(e)?!0:/HTTP 403/.test(e)&&!/rate limit/i.test(e)&&!/abuse detection/i.test(e)}a(jte,"isAuthError")});var TA=v(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.scanForSecrets=$te;c_.redactSecrets=Ute;var dk=[{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 $te(n){let e=[];for(let[t,r]of n)for(let{kind:i,re:s}of dk)s.test(r)&&e.push({path:t,kind:i});return e}a($te,"scanForSecrets");function Ute(n){let e=n;for(let{kind:t,re:r}of dk)e=e.replace(new RegExp(r.source,"g"),`[REDACTED:${t}]`);return e}a(Ute,"redactSecrets")});var xA=v(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.caseInsensitiveHeaderGetter=Bte;Va.parseRetryAfterMs=pk;Va.extractRateLimitFields=hk;Va.getRateLimitFields=Vte;Va.attachRateLimitFields=mk;Va.enrichRateLimitError=qte;function Bte(n){let e=new Map;if(n&&typeof n=="object")for(let[t,r]of Object.entries(n))typeof r=="string"&&e.set(t.toLowerCase(),r);return t=>e.get(t.toLowerCase())}a(Bte,"caseInsensitiveHeaderGetter");function IA(n){if(n==null)return;let e=n.trim();if(!/^-?\d+$/.test(e))return;let t=Number(e);return Number.isFinite(t)?t:void 0}a(IA,"parseIntHeader");function pk(n,e=Date.now){if(n==null)return;let t=n.trim();if(t.length===0)return;let r=IA(t);if(r!==void 0)return Math.max(0,r*1e3);let i=Date.parse(t);if(!Number.isNaN(i))return Math.max(0,i-e())}a(pk,"parseRetryAfterMs");function hk(n,e=Date.now){let t={},r=pk(n("retry-after"),e);r!==void 0&&(t.retryAfterMs=r);let i=IA(n("x-ratelimit-reset"));i!==void 0&&(t.rateLimitReset=i);let s=IA(n("x-ratelimit-remaining"));return s!==void 0&&(t.rateLimitRemaining=s),t}a(hk,"extractRateLimitFields");function Vte(n){if(n===null||typeof n!="object")return{};let e=n,t={};return typeof e.retryAfterMs=="number"&&(t.retryAfterMs=e.retryAfterMs),typeof e.rateLimitReset=="number"&&(t.rateLimitReset=e.rateLimitReset),typeof e.rateLimitRemaining=="number"&&(t.rateLimitRemaining=e.rateLimitRemaining),t}a(Vte,"getRateLimitFields");function AA(n,e,t){Object.defineProperty(n,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}a(AA,"defineHidden");function mk(n,e){return e.retryAfterMs!==void 0&&AA(n,"retryAfterMs",e.retryAfterMs),e.rateLimitReset!==void 0&&AA(n,"rateLimitReset",e.rateLimitReset),e.rateLimitRemaining!==void 0&&AA(n,"rateLimitRemaining",e.rateLimitRemaining),n}a(mk,"attachRateLimitFields");function qte(n,e,t=Date.now){return mk(n,hk(e,t))}a(qte,"enrichRateLimitError")});var u_=v(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.DEFAULT_MAX_RETRIES=Ci.MIN_RATE_LIMIT_WAIT_MS=void 0;Ci.isRateLimitError=gk;Ci.createRateLimitBudget=Wte;Ci.withRateLimitBackoff=Kte;var Gte=xA();function gk(n){let e=n instanceof Error?n.message:String(n);return/HTTP 429/.test(e)?!0:/HTTP 403/.test(e)&&(/rate limit/i.test(e)||/abuse detection/i.test(e))}a(gk,"isRateLimitError");Ci.MIN_RATE_LIMIT_WAIT_MS=6e4;Ci.DEFAULT_MAX_RETRIES=6;function Wte(n){let e=!(n>0),t=e?Number.POSITIVE_INFINITY:n;return{reset(){t=e?Number.POSITIVE_INFINITY:n},tryReserve(r){return r<=0?!0:r<=t?(t-=r,!0):!1}}}a(Wte,"createRateLimitBudget");var Hte=a(n=>new Promise(e=>setTimeout(e,n)),"defaultSleep");function zte(n,e,t,r,i,s){let o=(0,Gte.getRateLimitFields)(n);if(typeof o.retryAfterMs=="number"&&o.retryAfterMs>=0)return o.retryAfterMs;if(o.rateLimitRemaining===0&&typeof o.rateLimitReset=="number"){let c=o.rateLimitReset*1e3-s();if(c>0)return c}let l=t*2**e*(1+i());return Math.max(r,l)}a(zte,"computeRateLimitDelay");function Kte(n,e={}){let t=e.maxRetries??Ci.DEFAULT_MAX_RETRIES,r=e.baseDelayMs??1e3,i=Math.max(Ci.MIN_RATE_LIMIT_WAIT_MS,e.minRateLimitWaitMs??Ci.MIN_RATE_LIMIT_WAIT_MS),s=e.budget,o=e.sleep??Hte,l=e.random??Math.random,c=e.now??(()=>Date.now());return async u=>{let f=0;for(;;)try{return await n(u)}catch(d){if(!gk(d)||f>=t)throw d;let p=zte(d,f,r,i,l,c);if(s!==void 0&&!s.tryReserve(p))throw d;f++,await o(p)}}}a(Kte,"withRateLimitBackoff")});var f_=v(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.DEFAULT_MAX_FILE_BYTES=Jo.InMemoryQuarantineStore=void 0;Jo.contentEquals=Yte;Jo.isSyncablePath=Qte;Jo.isFileSpaceSyncablePath=Xte;function Yte(n,e){if(n===void 0||e===void 0||typeof n=="string"&&typeof e=="string")return n===e;if(typeof n=="string"||typeof e=="string"||n.byteLength!==e.byteLength)return!1;for(let t=0;t<n.byteLength;t++)if(n[t]!==e[t])return!1;return!0}a(Yte,"contentEquals");var RA=class{static{a(this,"InMemoryQuarantineStore")}constructor(){this.entries=[]}async quarantine(e){this.entries.push(e)}};Jo.InMemoryQuarantineStore=RA;function Qte(n){return n.endsWith(".md")&&!n.includes(".local.")&&!n.includes(".conflict.")}a(Qte,"isSyncablePath");function Xte(n){return!n.includes(".local.")&&!n.includes(".conflict.")}a(Xte,"isFileSpaceSyncablePath");Jo.DEFAULT_MAX_FILE_BYTES=30*1024*1024});var Ik=v(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.SyncEngine=fn.DEFAULT_LOCAL_MANIFEST_REHASH_MS=fn.DEFAULT_MAX_TOTAL_RATELIMIT_WAIT_MS=fn.DEFAULT_MAX_PUSH_RETRIES=void 0;fn.syncProgressPhaseText=ere;fn.isNonFastForwardError=Ak;fn.orderChildrenFirst=lre;var yk=n_(),_k=SA(),_t=tf(),Qs=Tp(),Jte=Vc(),uc=ef(),CA=a_(),Zte=l_(),bk=TA(),Sk=u_(),Xs=f_();fn.DEFAULT_MAX_PUSH_RETRIES=3;fn.DEFAULT_MAX_TOTAL_RATELIMIT_WAIT_MS=3e5;fn.DEFAULT_LOCAL_MANIFEST_REHASH_MS=720*60*1e3;function ere(n){switch(n.phase){case"reading-local":return n.detail!==void 0?`reading local files ${n.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 n.detail!==void 0?`fetching remote files ${n.detail.done}/${n.detail.total}\u2026`:"fetching remote files\u2026";case"writing-files":return n.detail!==void 0?`writing files ${n.detail.done}\u2026`:"writing files\u2026";case"merging":return"merge layer firing\u2026";default:return n.phase}}a(ere,"syncProgressPhaseText");var wk=25,tre=10,rre=6,nre=500,ire=25;function sre(n){try{return new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return null}}a(sre,"decodeUtf8Strict");function ore(n){return typeof n=="string"?n:{base64:(0,Jte.bytesToBase64)(n)}}a(ore,"toCommitContent");async function Ek(n,e){if(n.readBinary===void 0)throw new Error("LocalFilesPort.readBinary is required for file-mode sync (Phase C)");return n.readBinary(e)}a(Ek,"readBinaryStrict");async function are(n,e,t){if(n.writeBinary===void 0)throw new Error("LocalFilesPort.writeBinary is required for file-mode sync (Phase C)");return n.writeBinary(e,t)}a(are,"writeBinaryStrict");function vk(n){return n.length===0||n.startsWith("/")||n.includes("\\")?!1:n.split("/").every(e=>e.length>0&&e!=="."&&e!=="..")}a(vk,"isSafeRepoRelativePath");function Ak(n){let e=n instanceof Error?n.message:String(n);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(Ak,"isNonFastForwardError");function lre(n){let e=a(t=>t.split("/").filter(r=>r.length>0).length,"depth");return[...n].sort((t,r)=>e(r.localPath)-e(t.localPath))}a(lre,"orderChildrenFirst");function Tk(n,e){let t=new Map(n.map(o=>[o.path,o])),r=new Set,i=[];for(let o of e){r.add(o.path);let l=t.get(o.path);(l===void 0||l.blobSha!==o.blobSha)&&i.push(o)}let s=n.filter(o=>!r.has(o.path));return{changed:i,deleted:s}}a(Tk,"diffTrees");function qa(n){return n instanceof Error?n.message:String(n)}a(qa,"errMsg");function cre(n,e,t){if(t.size===0)return n;let r=new Map(e.files.map(o=>[o.path,o])),i=new Set(n.map(o=>o.path)),s=[];for(let o of n){if(!t.has(o.path)){s.push(o);continue}let l=r.get(o.path);l!==void 0&&s.push(l)}for(let o of t){if(i.has(o))continue;let l=r.get(o);l!==void 0&&s.push(l)}return s}a(cre,"applyWatermarkPins");var OA={mergedFiles:new Map,mergedWrites:[],quarantineEntries:[],resolvedQuarantineEntries:[],mergedCount:0,mergedPaths:[],warnings:[]};function PA(n){return new Map(n.map(e=>[e.path,e.blobSha]))}a(PA,"treeByPath");function d_(n){return[...n.quarantineEntries.map(e=>e.path),...n.resolvedQuarantineEntries.map(e=>e.path)]}a(d_,"quarantinedPathsOf");var DA=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.rateLimitBudget=(0,Sk.createRateLimitBudget)(e.backoff?.maxTotalRateLimitWaitMs??fn.DEFAULT_MAX_TOTAL_RATELIMIT_WAIT_MS),this.transport=this.instrumentTransport((0,Sk.withRateLimitBackoff)(e.transport,{...e.backoff,budget:this.rateLimitBudget,now:this.now})),this.sha1=this.instrumentSha1(e.sha1)}instrumentTransport(e){return async t=>{let r=this.activeTimer;return r===null?e(t):(r.bumpRest(),r.time((0,_k.classifyRestPhase)(t),()=>e(t)))}}instrumentSha1(e){return t=>{let r=this.activeTimer;return r===null?e(t):(r.bumpHashed(),r.time("hash",()=>e(t)))}}instrumentLocalFiles(e){let t=a((l,c)=>{let u=this.activeTimer;return u===null?c():u.time(l,c)},"timed"),r={list:a(()=>t("localList",()=>e.list()),"list"),read:a(l=>(this.activeTimer?.bumpRead(),this.bumpReadProgress(),t("localRead",()=>e.read(l))),"read"),write:a((l,c)=>t("localWrite",()=>(this.activeTimer?.bumpWritten(),this.bumpWriteProgress(),e.write(l,c))),"write"),delete:a(l=>e.delete(l),"delete")},i=e.readBinary?.bind(e);i!==void 0&&(r.readBinary=l=>(this.activeTimer?.bumpRead(),this.bumpReadProgress(),t("localRead",()=>i(l))));let s=e.writeBinary?.bind(e);s!==void 0&&(r.writeBinary=(l,c)=>t("localWrite",()=>(this.activeTimer?.bumpWritten(),this.bumpWriteProgress(),s(l,c))));let o=e.stat?.bind(e);return o!==void 0&&(r.stat=l=>t("localList",()=>o(l))),r}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",r=t?Xs.isFileSpaceSyncablePath:Xs.isSyncablePath,i=this.deps.maxFileBytes??Xs.DEFAULT_MAX_FILE_BYTES;return{fileMode:t,syncable:r,treeFilter:a(s=>r(s.path)&&(!t||s.size===void 0||s.size<=i),"treeFilter")}}async buildFileModeFirstSyncBase(e,t,r,i){let s=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),o=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,s,this.deps.baseURL),l=(await(0,_t.getTree)(this.transport,e.owner,e.repo,o.treeSha,this.deps.baseURL)).filter(r.treeFilter),c=[];for(let u of l){let f=t.get(u.path);f!==void 0&&await(0,uc.gitBlobSha)(f,this.sha1)===u.blobSha&&c.push({path:u.path,blobSha:u.blobSha})}return i.push(`first-sync (file mode): synthetic base from ${c.length} already-identical file(s) at head ${s} \u2014 divergence resolves through the remote-wins layer (D22)`),{lastSyncedSha:s,rootTreeSha:o.treeSha,files:c,spaceKind:"file"}}async syncAll(e,t="sync",r){if(this.opInProgress)return e.map(i=>this.busyResult(i));this.opInProgress=!0,this.rateLimitBudget.reset();try{let i=[];for(let s of e)i.push(await this.syncLocked(s,t,r));return i}finally{this.opInProgress=!1}}async sync(e,t="sync",r){if(this.opInProgress)return this.busyResult(e);this.opInProgress=!0,this.rateLimitBudget.reset();try{return await this.syncLocked(e,t,r)}finally{this.opInProgress=!1}}emitProgress(e,t,r,i){if(e!==void 0)try{e(i===void 0?{repoKey:t,phase:r}:{repoKey:t,phase:r,detail:i})}catch{}}bumpReadProgress(){let e=this.activeLocalIoProgress;e!==null&&(e.reads+=1,e.reads%nre===0&&this.emitProgress(e.emit,e.repoKey,"reading-local",{done:e.reads}))}bumpWriteProgress(){let e=this.activeLocalIoProgress;e!==null&&(e.writes+=1,e.writes%ire===0&&this.emitProgress(e.emit,e.repoKey,"writing-files",{done:e.writes}))}async syncLocked(e,t="sync",r){let i=new _k.SyncPhaseTimer(this.now),s=this.activeTimer;this.activeTimer=i;let o=this.activeLocalIoProgress;this.activeLocalIoProgress=r!==void 0?{emit:r,repoKey:e.repoKey,reads:0,writes:0}:null;let l=[],c=[],u=0,f=0,d=[],p=a((h,_={})=>({repoKey:e.repoKey,status:h,pulledCount:0,pushedCount:0,mergedCount:0,quarantinedCount:0,warnings:l,deferredDeletes:c,...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 l.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 b=this.deps.maxFileBytes??Xs.DEFAULT_MAX_FILE_BYTES;if(t!=="pull"&&this.deps.outbox!==void 0){let ee=await this.flushOutbox(e,l);u=ee.pushed,f=ee.reconflicted}let S=await this.deps.watermarkStore.get(e.repoKey);if(S?.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)"});S!==null&&_.fileMode&&S.spaceKind!=="file"&&(l.push("watermark was written by an ASSET-mode sync \u2014 rebuilding the base through the file-mode first-sync layer (kind flip)"),S=null);let I=this.deps.localManifestStore!==void 0?y.stat?.bind(y):void 0,O=I!==void 0&&S!==null&&!_.fileMode,T=O&&this.deps.localManifestStore!==void 0?await this.deps.localManifestStore.get(e.repoKey):null,E=this.deps.localManifestFullRehashMs??fn.DEFAULT_LOCAL_MANIFEST_REHASH_MS,P=O&&(T===null||this.now()-T.lastFullRehashMs>=E),V=new Map,M=new Set,j=new Map,$=new Map,G=new Map,ge=!1,ye=new Map;if(O&&S!==null)for(let ee of S.files)ye.set(ee.path,ee.blobSha);for(let ee of(await y.list()).filter(_.syncable)){if(_.fileMode){let Pe=await Ek(y,ee);if(Pe.byteLength>b){M.add(ee),l.push(`skipped oversized file ${ee} (${Pe.byteLength} bytes > ${b} cap) \u2014 excluded from sync symmetrically (Phase C size cap)`);continue}V.set(ee,Pe);continue}if(!O||I===void 0){V.set(ee,await y.read(ee));continue}let _e=await I(ee),Te=!P&&_e!==null?T?.files[ee]:void 0;if(_e!==null&&Te!==void 0&&Te.mtimeMs===_e.mtimeMs&&Te.size===_e.size&&Te.blobSha===ye.get(ee)){j.set(ee,{blobSha:Te.blobSha,...Te.uid!==void 0?{uid:Te.uid}:{}}),$.set(ee,Te.blobSha),G.set(ee,_e);continue}ge=!0,V.set(ee,await y.read(ee)),_e!==null&&G.set(ee,_e)}let Q=!1;if(S===null)if(_.fileMode)Q=!0,S=await this.buildFileModeFirstSyncBase(e,V,_,l);else{let ee=await this.bootstrapWatermark(e,V,l,p);if(ee.kind==="settled")return ee.outcome;Q=!0,S=ee.base}let se=S;_.fileMode&&M.size>0&&(S={...S,files:S.files.filter(ee=>!M.has(ee.path))});let J,ve;O&&!P?(J=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),ve=J===S.lastSyncedSha?S.rootTreeSha:await this.resolveBaseTreeSha(e,S)):ve=await this.resolveBaseTreeSha(e,S),this.emitProgress(r,e.repoKey,"detecting");let re=await(0,Qs.detectChanges)({localFiles:V,...O?{cachedEntries:j}:{},watermark:S,actualBaseTreeSha:ve,sha1:this.sha1});if(re.kind==="full-conflict")return p("full-conflict",{detail:`${re.reason}${re.detail?`: ${re.detail}`:""} \u2014 divergence must go through merge/quarantine (A2/A3), not overwrite`});if(l.push(...re.warnings),O&&this.deps.localManifestStore!==void 0){let ee={};for(let[_e,Te]of V){let Pe=G.get(_e),Me=re.diskBlobShas.get(_e);if(Pe===void 0||Me===void 0)continue;let Ne=typeof Te=="string"?(0,Qs.extractAssetUid)(Te):void 0;ee[_e]={mtimeMs:Pe.mtimeMs,size:Pe.size,blobSha:Me,...Ne!==void 0?{uid:Ne}:{}}}for(let[_e,Te]of j){let Pe=G.get(_e);Pe!==void 0&&(ee[_e]={mtimeMs:Pe.mtimeMs,size:Pe.size,blobSha:Te.blobSha,...Te.uid!==void 0?{uid:Te.uid}:{}})}if(T!==null&&Object.keys(T.files).some(_e=>!(_e in ee))&&(ge=!0),ge||P||T===null){let _e={version:1,files:ee,lastFullRehashMs:P||T===null?this.now():T.lastFullRehashMs};await this.deps.localManifestStore.set(e.repoKey,_e)}}let ie=this.pinLocalChanges(re,V,l,c,t);d=[...ie.pushDeletionsAll.keys()];let he=await this.runPushLoop(e,S,ie,V,l,_,Q,M,t,r,J);if(d=[],he.kind!=="done"&&ie.pushDeletionsAll.size>0&&c.push(...ie.pushDeletionsAll.keys()),he.kind==="conflict")return p("conflict",{detail:he.detail});if(he.kind==="retry-exhausted"){l.push(...he.merge.warnings);let ee=await this.buildTerminalQuarantineEntries(e,S,he.pushFiles,he.merge.quarantineEntries,V),_e=[...he.merge.quarantineEntries,...he.merge.resolvedQuarantineEntries,...ee];return await this.flushQuarantine(_e,l),p("retry-exhausted",{detail:he.detail,quarantinedCount:_e.length,..._e.length>0?{quarantinedPaths:_e.map(Te=>Te.path)}:{}})}let{examinedHead:Ue,pushedSha:ce,applyWrites:ue,applyDeletes:fe,pushFiles:ne}=he,me=he.merge;l.push(...me.warnings),l.push(...he.deferredWarnings),c.push(...he.withheldDeletions);let Le=he.deferredPaths.size>0?{deferredPaths:[...he.deferredPaths]}:{},B=he.pushedDeletions.length>0?{pushedDeletes:he.pushedDeletions}:{},oe=await this.flushQuarantine([...me.quarantineEntries,...me.resolvedQuarantineEntries],l);he.secretQuarantineEntries.length>0&&await this.flushQuarantine(he.secretQuarantineEntries,l);let Ee=new Set;if(!oe&&me.resolvedQuarantineEntries.length>0){for(let ee of me.resolvedQuarantineEntries)Ee.add(ee.path);l.push(`quarantine flush failed \u2014 remote-wins apply withheld for ${Ee.size} path(s); local files untouched, conflict re-derives next sync (D18 durability gate)`)}if(ce===void 0&&Ue===S.lastSyncedSha&&ue.length===0&&fe.length===0&&me.mergedWrites.length===0&&me.quarantineEntries.length===0&&me.resolvedQuarantineEntries.length===0&&(S.pinnedPaths?.length??0)===0&&he.alreadyInHead.length===0&&he.deferredPaths.size===0&&!Q)return p("synced");let Ce=ce??Ue,xe=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,Ce,this.deps.baseURL);if(ce!==void 0&&xe.parents[0]!==Ue)return await this.checkRaceWindow(e,S,Ue,xe.parents[0],ne,new Set(he.pushedDeletions),l,_),l.push(`race-window: watermark NOT advanced (pushed commit's parent ${xe.parents[0]} != examined head ${Ue}) \u2014 next sync reconciles the concurrent change`),p("synced",{pushedSha:ce,pushedCount:ne.size,mergedCount:me.mergedCount,quarantinedCount:me.quarantineEntries.length+me.resolvedQuarantineEntries.length,...me.mergedPaths.length>0?{mergedPaths:me.mergedPaths}:{},...d_(me).length>0?{quarantinedPaths:d_(me)}:{},...Le,...B});let{pulledCount:Oe,pinnedPaths:Re,pulledPaths:Ae}=await this.applyRemoteChanges(y,V,[...ue,...me.mergedWrites].filter(ee=>!Ee.has(ee.path)),fe.filter(ee=>!Ee.has(ee.path)),l,$);for(let ee of me.quarantineEntries)Re.add(ee.path);for(let ee of he.deferredPaths)Re.add(ee);for(let ee of Ee)Re.add(ee);if(_.fileMode){for(let ee of M)Re.add(ee);for(let ee of he.remoteOversized)Re.add(ee)}return await this.advanceWatermark(e,Ce,xe.treeSha,V,[...ue,...me.mergedWrites,...he.deferredRemoteChanges],se,Re,re.diskBlobShas,_,M),await this.resolveClearedPins(e,se,Re,l,new Set(me.resolvedQuarantineEntries.map(ee=>ee.path))),p("synced",{pushedSha:ce,pulledCount:Oe,pushedCount:ne.size,mergedCount:me.mergedCount,quarantinedCount:me.quarantineEntries.length+me.resolvedQuarantineEntries.length,...me.mergedPaths.length>0?{mergedPaths:me.mergedPaths}:{},...Ae.length>0?{pulledPaths:Ae}:{},...d_(me).length>0?{quarantinedPaths:d_(me)}:{},...Le,...B})}catch(h){let _=this.deps.redact??(y=>y);return d.length>0&&c.push(...d),(0,Zte.isAuthError)(h)?p("auth-required",{detail:_(`authentication failed: ${qa(h)} \u2014 the PAT is expired, revoked or under-scoped; update it in the per-device secure storage (R8). Never treated as success.`)}):(l.push(`sync failed: ${_(qa(h))}`),p("error",{detail:_(qa(h))}))}finally{this.activeTimer=s,this.activeLocalIoProgress=o}}async flushQuarantine(e,t){if(e.length===0)return!0;let r=this.deps.redact??(s=>s);for(let s of e)t.push(r(`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??(l=>l);return t.push(`quarantine sink failed: ${o(qa(s))} \u2014 files untouched on disk; the conflict re-derives next sync (D17 degradation)`),!1}}async flushOutbox(e,t){let r=this.deps.outbox;if(r===void 0)return{pushed:0,reconflicted:0};let i=await r.listForRepo(e.repoKey);if(i.length===0)return{pushed:0,reconflicted:0};let s=this.deps.redact??(_=>_),o,l;try{({head:o,shaByPath:l}=await this.outboxHeadTreeShas(e))}catch(_){return t.push(`outbox flush deferred (${i.length} resolution(s) awaiting push): ${s(qa(_))}`),{pushed:0,reconflicted:0}}let c=0,u=[];for(let _ of i){let y=l.get(_.path)??CA.OUTBOX_REMOTE_ABSENT,b=y===CA.OUTBOX_REMOTE_ABSENT&&_.baseRemoteSha!==CA.OUTBOX_REMOTE_ABSENT?[...l].filter(([S,I])=>S!==_.path&&I===_.baseRemoteSha).map(([S])=>S):[];if(y!==_.baseRemoteSha&&b.length===0){await r.remove(_.repoKey,_.path),c++,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:b})}if(u.length===0)return{pushed:0,reconflicted:c};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,yk.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(qa(_))}`),{pushed:0,reconflicted:c}}let h=0;for(let{entry:_,stalePaths:y}of u){let b=y.filter(S=>!f.has(S));await this.snapOutboxWatermark(e,_.path,_.chosenContent,b),await this.deps.quarantine?.markResolved?.(_.repoKey,_.path);for(let S of b)await this.deps.quarantine?.markResolved?.(_.repoKey,S);await r.remove(_.repoKey,_.path),h++,b.length>0&&t.push(`consolidated cross-path conflict for ${_.path} \u2014 removed ${b.length} stale remote copy/copies (recoverable in git history)`)}return h>0&&t.push(`pushed ${h} resolved conflict(s)`),{pushed:h,reconflicted:c}}async outboxHeadTreeShas(e){let t=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),r=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,t,this.deps.baseURL),i=await(0,_t.getTree)(this.transport,e.owner,e.repo,r.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,r,i=[]){let s=await this.deps.watermarkStore.get(e.repoKey);if(s===null)return;let o=new Set([t,...i]),l=(s.pinnedPaths??[]).filter(y=>!o.has(y)),c=await(0,uc.gitBlobSha)(r,this.sha1),u=(0,Qs.extractAssetUid)(r),f={path:t,blobSha:c,...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,b)=>b===h?f:y):[...p,f];await this.deps.watermarkStore.set(e.repoKey,{...s,files:_,...l.length>0?{pinnedPaths:l}:{pinnedPaths:void 0}})}async buildTerminalQuarantineEntries(e,t,r,i,s){let o=new Set(i.map(u=>u.path)),l=new Map;try{let u=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),f=(await(0,_t.getTree)(this.transport,e.owner,e.repo,(await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,u,this.deps.baseURL)).treeSha,this.deps.baseURL)).filter(d=>r.has(d.path));for(let d of f)l.set(d.path,await(0,_t.getBlobText)(this.transport,e.owner,e.repo,d.blobSha,this.deps.baseURL))}catch{}let c=[];for(let[u,f]of r){if(o.has(u))continue;let d=s.get(u),p=d??f,h=d!==void 0&&!(0,Xs.contentEquals)(d,f),_=typeof p=="string"?(0,Qs.extractAssetUid)(p):void 0,y=l.get(u);c.push({repoKey:e.repoKey,path:u,..._!==void 0?{uid:_}:{},reason:`non-fast-forward push failed after ${this.deps.maxPushRetries??fn.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 c}async resolveClearedPins(e,t,r,i,s=new Set){let o=this.deps.quarantine;if(o===void 0||o.markResolved===void 0)return;let l=(t.pinnedPaths??[]).filter(c=>!r.has(c)&&!s.has(c));for(let c of l)try{await o.markResolved?.(e.repoKey,c)}catch(u){let f=this.deps.redact??(d=>d);i.push(`quarantine markResolved failed for ${c}: ${f(qa(u))} \u2014 unresolved-count may overcount until the resolver UI reconciles (CQ4)`)}}async resolveBaseTreeSha(e,t){try{return(await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,t.lastSyncedSha,this.deps.baseURL)).treeSha}catch{return null}}pinLocalChanges(e,t,r,i,s){let o=e.modified.filter(p=>p.basePath!==void 0),l=[...e.added,...e.modified.filter(p=>p.basePath===void 0)],c=new Map;if(s==="pull"){for(let p of o)p.basePath!==void 0&&i.push(p.basePath),r.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),r.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&&c.set(p.basePath,p.path);for(let p of e.deleted)c.set(p.path,p.path)}let u=[...l,...o,...e.deleted.map(p=>({...p}))],f=new Set(e.deleted.map(p=>p.path)),d=new Map;for(let p of[...l,...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:c,dupUids:e.duplicateUids}}async runPushLoop(e,t,r,i,s,o,l=!1,c=new Set,u="sync",f,d){let{localChanges:p,localDeletedPaths:h,pushFilesAll:_,pushDeletionsAll:y,dupUids:b}=r,S=this.deps.maxPushRetries??fn.DEFAULT_MAX_PUSH_RETRIES,I=0,O="",T,E=[],P=[],V=new Map,M=new Set,j=[],$=OA,G=[],ge=new Set,ye=[],Q=[],se=new Set,J=[],ve=new Set;for(;;){O=I===0&&d!==void 0&&_.size===0&&y.size===0?d:await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),E=[],P=[],$=OA,G=[],ge=new Set,ye=[],Q=[];let re,ie=new Set,he=(t.pinnedPaths?.length??0)>0;if(O!==t.lastSyncedSha||he||l){this.emitProgress(f,e.repoKey,"pulling-remote");let ue=await this.collectRemoteChanges(e,t,O,o,c,s,se,f);re=ue.headTreeByPath;let fe=this.matchLocalVsRemote(p,h,i,ue.changes,ie,b,ue.headTreeByPath);if(fe.conflicts.length>0){if(u==="sync"&&this.emitProgress(f,e.repoKey,"merging"),u!=="sync"){for(let ne of fe.conflicts){ge.add(ne.local.path),ne.local.basePath!==void 0&&ge.add(ne.local.basePath);for(let me of ne.remotes)ge.add(me.path),me.kind==="change"&&ye.push(me)}Q.push(`${u}-only: ${fe.conflicts.length} conflict(s) deferred to a full Sync (${fe.conflicts.map(ne=>ne.desc).join("; ")}) \u2014 paths pinned, nothing merged`)}else if(o.fileMode)$=this.resolveFileModeConflicts(e,fe.conflicts,i,fe.applyWrites,fe.applyDeletes);else{if(this.deps.mergeLayer===void 0)return{kind:"conflict",detail:`overlapping change on ${fe.conflicts[0].desc} \u2014 merge layer (A2/A3) required; nothing pushed, nothing written`};$=await this.resolveMergeConflicts(e,t,fe.conflicts,i)}if(u==="sync")for(let ne of fe.conflicts)for(let me of ne.remotes)me.path!==ne.local.path&&(ge.add(me.path),me.kind==="change"&&ye.push(me),Q.push(`conflict group ${ne.desc}: remote change at ${me.path} NOT applied \u2014 pinned to re-derive on the next sync (#3477)`))}if(E=fe.applyWrites,P=fe.applyDeletes,u==="push"&&(E.length>0||P.length>0)){for(let ne of E)ge.add(ne.path),ye.push(ne);for(let ne of P)ge.add(ne.path);Q.push(`push-only: ${E.length+P.length} remote change(s) NOT applied \u2014 pinned to re-derive on the next pull/Sync`),E=[],P=[]}}V=u==="pull"?new Map:new Map([...[..._].filter(([ue])=>!ie.has(ue)),...$.mergedFiles]),M=new Set,j=[];for(let[ue,fe]of y){if(ie.has(fe)){j.push(ue);continue}V.has(ue)||M.add(ue)}if((V.size>0||M.size>0)&&re===void 0&&(re=PA(await(0,_t.getTree)(this.transport,e.owner,e.repo,t.rootTreeSha,this.deps.baseURL))),V.size>0&&re!==void 0){for(let[ue,fe]of V){let ne=re.get(ue);ne!==void 0&&ne===await(0,uc.gitBlobSha)(fe,this.sha1)&&(V.delete(ue),G.push(ue))}G.length>0&&s.push(`phantom push skipped: ${G.length} file(s) already identical in remote HEAD (${G.join(", ")}) \u2014 excluded from the commit (#3475)`)}if(M.size>0&&re!==void 0){for(let ue of[...M])re.has(ue)||M.delete(ue);V.size===0&&M.size>=re.size&&(j.push(...M),Q.push(`deletion of ALL ${M.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`),M.clear())}if(V.size===0&&M.size===0)break;let Ue=new Map;for(let[ue,fe]of V)if(typeof fe=="string")Ue.set(ue,fe);else{let ne=sre(fe);ne!==null&&Ue.set(ue,ne)}let ce=(0,bk.scanForSecrets)(Ue);if(ce.length>0){let ue=new Map;for(let fe of ce){let ne=ue.get(fe.path);ne===void 0?ue.set(fe.path,[fe.kind]):ne.includes(fe.kind)||ne.push(fe.kind)}for(let[fe,ne]of ue){if(!ve.has(fe)){ve.add(fe);let me=Ue.get(fe),Le=me!==void 0?(0,bk.redactSecrets)(me):void 0,B=Le!==void 0?(0,Qs.extractAssetUid)(Le):void 0;J.push({repoKey:e.repoKey,path:fe,...B!==void 0?{uid:B}:{},reason:`secret-scan (R5): detected ${ne.join(", ")} \u2014 skipped from the push (the secret is NEVER shipped); a redacted copy is quarantined. REVOKE the credential, then re-sync once it is removed.`,...Le!==void 0?{localContent:Le}:{}})}V.delete(fe)}s.push(`secret-scan (R5): skipped ${ue.size} file(s) with a detected secret from the push \u2014 the rest of the changeset shipped; REVOKE the credential(s): ${[...ue].map(([fe,ne])=>`${fe} (${ne.join(", ")})`).join(", ")}`);for(let[fe,ne]of y)ve.has(ne)&&M.has(fe)&&(M.delete(fe),j.push(fe));if(V.size===0&&M.size===0)break}try{T=await(0,yk.restCreateCommit)(this.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:new Map([...V].map(([ue,fe])=>[ue,ore(fe)])),deletions:[...M],message:this.deps.commitMessage?.(e,V.size,M.size)??`chore(exosync): sync ${V.size} file(s)${M.size>0?`, ${M.size} deletion(s)`:""}`,baseURL:this.deps.baseURL,redact:this.deps.redact});break}catch(ue){if(!Ak(ue))throw ue;if(I++,I>S)return{kind:"retry-exhausted",detail:`non-fast-forward push failed after ${S} retries (D16 cap) \u2014 contended files routed to quarantine (D17)`,pushFiles:V,merge:$};s.push(`non-fast-forward push (attempt ${I}/${S}) \u2014 re-pulling and retrying (D16)`)}}return{kind:"done",examinedHead:O,pushedSha:T,applyWrites:E,applyDeletes:P,pushFiles:V,pushedDeletions:T!==void 0?[...M]:[],withheldDeletions:j,merge:$,remoteOversized:se,alreadyInHead:G,deferredPaths:ge,deferredRemoteChanges:ye,deferredWarnings:Q,secretQuarantineEntries:J}}async resolveMergeConflicts(e,t,r,i){let s=this.deps.mergeLayer;if(s===void 0)return OA;let o=new Map(t.files.map(y=>[y.path,y])),l=new Map,c=[],u=[],f=[],d=[],p=0,h=a(y=>typeof y=="string"?y:void 0,"asText"),_=a((y,b,S)=>{let I=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:b,...S!==void 0?{baseContent:S}:{},...I!==void 0?{localContent:I}:{},...O!==void 0?{remoteContent:O}:{}}},"entry");for(let y of r){let b=o.get(y.local.basePath??y.local.path)??o.get(y.remotes[0]?.path??""),S;if(b!==void 0&&(S=await(0,_t.getBlobText)(this.transport,e.owner,e.repo,b.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(", ")})`,S));continue}let I=y.remotes[0],O=h(i.get(y.local.path)),T=await s.resolve({path:y.local.path,...y.local.uid!==void 0?{uid:y.local.uid}:{},...S!==void 0?{base:S}:{},...O!==void 0?{local:O}:{},...I.kind==="change"&&typeof I.content=="string"?{remote:I.content}:{}});if(T.action==="quarantine"){u.push(_(y,T.reason,S));continue}p++,d.push(y.local.path);for(let P of T.warnings??[])f.push(`merge(${y.local.path}): ${P}`);let E=I.kind==="change"?I.content:void 0;if(T.content!==E&&l.set(y.local.path,T.content),T.content!==i.get(y.local.path)){let P=(0,Qs.extractAssetUid)(T.content)??y.local.uid;c.push({path:y.local.path,kind:"change",content:T.content,blobSha:await(0,uc.gitBlobSha)(T.content,this.sha1),...P!==void 0?{uid:P}:{}})}}return{mergedFiles:l,mergedWrites:c,quarantineEntries:u,resolvedQuarantineEntries:[],mergedCount:p,mergedPaths:d,warnings:f}}resolveFileModeConflicts(e,t,r,i,s){let o=[],l=[];for(let c of t){c.remotes.length>1&&l.push(`file-mode conflict on ${c.local.path} unexpectedly overlaps ${c.remotes.length} remote changes \u2014 resolving against the first`);let u=c.remotes[0],f=r.get(c.local.path);u.kind==="change"?i.push(u):s.push(u),!(c.localIsDelete||f===void 0)&&o.push({repoKey:e.repoKey,path:c.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:l}}async applyRemoteChanges(e,t,r,i,s,o=new Map){let l=0,c=new Set,u=[],f=a(async(h,_)=>{try{return _?await Ek(e,h):await e.read(h)}catch{return}},"tryRead"),d=a(async(h,_)=>{typeof _=="string"?await e.write(h,_):await are(e,h,_)},"writeContent"),p=a(async h=>{let _=await f(h,!1);return _===void 0?!0:await(0,uc.gitBlobSha)(_,this.sha1)===o.get(h)},"cacheHitUnchanged");for(let h of r){if(h.content===void 0)continue;if(!vk(h.path)){s.push(`unsafe remote path skipped on pull-apply: ${h.path}`),c.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`),c.add(h.path);continue}await d(h.path,h.content),l++,u.push(h.path);continue}let y=await f(h.path,typeof(_??h.content)!="string");if(!(0,Xs.contentEquals)(y,_)){s.push(`pull-apply skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 remote change re-derives next sync`),c.add(h.path);continue}await d(h.path,h.content),l++,u.push(h.path)}for(let h of i){if(!vk(h.path)){s.push(`unsafe remote path skipped on pull-delete: ${h.path}`),c.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`),c.add(h.path);continue}await e.delete(h.path),l++,u.push(h.path);continue}if(_!==void 0){let y=await f(h.path,typeof _!="string");if(y!==void 0&&!(0,Xs.contentEquals)(y,_)){s.push(`pull-delete skipped: ${h.path} changed on disk mid-sync (TOCTOU) \u2014 delete-vs-modify re-derives next sync`),c.add(h.path);continue}await e.delete(h.path),l++,u.push(h.path)}}return{pulledCount:l,pinnedPaths:c,pulledPaths:u}}async advanceWatermark(e,t,r,i,s,o,l,c,u,f=new Set){let d=(await(0,_t.getTree)(this.transport,e.owner,e.repo,r,this.deps.baseURL)).filter(h=>u.treeFilter(h)&&!f.has(h.path)),p=cre(await this.buildWatermarkFiles(e,d,i,s,o,c,u),o,l);await this.deps.watermarkStore.set(e.repoKey,{lastSyncedSha:t,rootTreeSha:r,files:p,...l.size>0?{pinnedPaths:[...l]}:{},...u.fileMode?{spaceKind:"file"}:{}})}async tryMountBaseBootstrap(e,t,r,i,s){let o=this.deps.mountBaseStore,l=null;if(o!==void 0)try{l=await o.get(e.repoKey)}catch{return null}let c=!1;if(l===null&&this.deps.localBaseShaProvider!==void 0)try{let b=await this.deps.localBaseShaProvider(e);typeof b=="string"&&b.length>0&&(l=b,c=!0)}catch{}if(l===null||t.startsWith(l))return null;let u=300,f=null;try{let b=t;for(let S=0;S<u;S++){let I=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,b,this.deps.baseURL);if(I.sha===l||I.sha.startsWith(l)){f=I;break}if(I.parents.length===0)break;b=I.parents[0]}}catch{return null}if(f===null)return null;let d;try{d=(await(0,_t.getTree)(this.transport,e.owner,e.repo,f.treeSha,this.deps.baseURL)).filter(b=>(0,Xs.isSyncablePath)(b.path))}catch{return null}let p;try{let b=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,t,this.deps.baseURL);p=PA((await(0,_t.getTree)(this.transport,e.owner,e.repo,b.treeSha,this.deps.baseURL)).filter(S=>(0,Xs.isSyncablePath)(S.path)))}catch{return null}let h=d.filter(b=>!r.has(b.path)&&p.get(b.path)===b.blobSha);if(h.length>0){let b=h.slice(0,3).map(S=>S.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 (${b}); 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 (${b}); 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(b=>({path:b.path,blobSha:b.blobSha})),y={lastSyncedSha:f.sha,rootTreeSha:f.treeSha,files:_};if(c&&o!==void 0)try{await o.set(e.repoKey,f.sha)}catch{}return i.push(c?`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,r,i){let s=await(0,_t.getHeadSha)(this.transport,e.owner,e.repo,e.branch,this.deps.baseURL),o=await this.tryMountBaseBootstrap(e,s,t,r,i);if(o!==null)return o;let l=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,s,this.deps.baseURL),c=(await(0,_t.getTree)(this.transport,e.owner,e.repo,l.treeSha,this.deps.baseURL)).filter(p=>(0,Xs.isSyncablePath)(p.path)),u=[],f;for(let p of c){let h=t.get(p.path);if(h===void 0||await(0,uc.gitBlobSha)(h,this.sha1)!==p.blobSha){f===void 0&&(f=p.path);continue}let _=typeof h=="string"?(0,Qs.extractAssetUid)(h):void 0;u.push({path:p.path,blobSha:p.blobSha,..._?{uid:_}:{}})}let d={lastSyncedSha:s,rootTreeSha:l.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`})}:(r.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===c.length?(await this.deps.watermarkStore.set(e.repoKey,d),r.push(`watermark bootstrapped from head ${s} (local tree identical to remote)`),{kind:"settled",outcome:i("synced")}):(r.push(`first-sync (asset mode): local tree (${t.size} files) is a pure superset of remote head ${s} (${c.length} files) \u2014 ${t.size-c.length} local-only addition(s) derive as pushable adds (#3565)`),{kind:"additive-base",base:d})}async collectRemoteChanges(e,t,r,i,s=new Set,o=[],l=new Set,c){let u=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,r,this.deps.baseURL),f=await(0,_t.getTree)(this.transport,e.owner,e.repo,u.treeSha,this.deps.baseURL);if(i.fileMode)for(let M of f)i.syncable(M.path)&&!i.treeFilter(M)&&!l.has(M.path)&&(l.add(M.path),o.push(`skipped oversized REMOTE file ${M.path} (${M.size??"?"} bytes over cap) \u2014 excluded from sync symmetrically (Phase C size cap)`));let d=f.filter(M=>i.treeFilter(M)&&!s.has(M.path)),p=t.files.filter(M=>!l.has(M.path)&&!s.has(M.path)),{changed:h,deleted:_}=Tk(p,d),y=h.length;y>=wk&&this.emitProgress(c,e.repoKey,"fetching-blobs",{done:0,total:y});let b=new Array(h.length),S=0,I=0,O,T=a(async M=>{if(i.fileMode){let $=await(0,_t.getBlobBytes)(this.transport,e.owner,e.repo,M.blobSha,this.deps.baseURL);return{path:M.path,kind:"change",blobSha:M.blobSha,content:$}}let j=await(0,_t.getBlobText)(this.transport,e.owner,e.repo,M.blobSha,this.deps.baseURL);return{path:M.path,kind:"change",blobSha:M.blobSha,content:j,uid:(0,Qs.extractAssetUid)(j)}},"fetchOne"),E=a(async()=>{for(;;){if(O!==void 0)return;let M=S++;if(M>=h.length)return;try{b[M]=await T(h[M])}catch(j){O===void 0&&(O=j);return}I+=1,y>=wk&&I%tre===0&&I<y&&this.emitProgress(c,e.repoKey,"fetching-blobs",{done:I,total:y})}},"worker"),P=Math.min(rre,h.length);if(await Promise.all(Array.from({length:P},()=>E())),O!==void 0)throw O instanceof Error?O:new Error(String(O));let V=b;for(let M of _)V.push({path:M.path,kind:"delete",uid:M.uid});return{changes:V,headTreeByPath:PA(f)}}matchLocalVsRemote(e,t,r,i,s,o=new Set,l){let c=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,b]of f)b>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 b=p.get(y.uid)??[];b.push(y),p.set(y.uid,b)}h.set(y.path,y)}for(let y of e){let b=new Set;if(y.uid!==void 0&&!d.has(y.uid))for(let T of p.get(y.uid)??[])T.kind==="change"&&T.path!==y.path&&(l?.has(y.path)===!0||y.basePath!==void 0&&l?.has(y.basePath)===!0)||b.add(T);let S=h.get(y.path);if(S!==void 0&&b.add(S),y.basePath!==void 0){let T=h.get(y.basePath);T!==void 0&&b.add(T)}let I=[],O=!1;for(let T of b){if(O=t.has(y.path)&&!r.has(y.path),O&&T.kind==="delete"){c.add(T);continue}if(!O&&T.kind==="change"&&T.path===y.path&&T.blobSha===y.blobSha){c.add(T),s.add(y.path);continue}if(T.kind==="delete"&&y.basePath!==void 0&&T.path===y.basePath){let E=h.get(y.path);if(E!==void 0&&E.kind==="change"&&(E.blobSha===y.blobSha||E.uid!==void 0&&E.uid===y.uid)){c.add(T);continue}}if(T.kind==="delete"&&T.path!==y.path&&T.path!==y.basePath&&!r.has(T.path)&&l?.has(T.path)!==!0){c.add(T);continue}I.push(T),c.add(T)}I.length>0&&(u.push({local:y,localIsDelete:O,remotes:I,desc:`${y.uid!==void 0&&!d.has(y.uid)?y.uid:y.path} (local ${O?"delete":"change"} vs remote ${I[0].kind} at ${I[0].path})`}),s.add(y.path))}let _=i.filter(y=>!c.has(y));return{conflicts:u,applyWrites:_.filter(y=>y.kind==="change"),applyDeletes:_.filter(y=>y.kind==="delete")}}async checkRaceWindow(e,t,r,i,s,o,l,c){try{let u=await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,i,this.deps.baseURL),f=(await(0,_t.getTree)(this.transport,e.owner,e.repo,u.treeSha,this.deps.baseURL)).filter(c.treeFilter),d=r===t.lastSyncedSha?t.files:(await(0,_t.getTree)(this.transport,e.owner,e.repo,(await(0,_t.getCommitInfo)(this.transport,e.owner,e.repo,r,this.deps.baseURL)).treeSha,this.deps.baseURL)).filter(c.treeFilter),{changed:p,deleted:h}=Tk(d,f);for(let _ of p)s.has(_.path)&&l.push(`race-window: concurrent commit ${i} changed ${_.path} between conflict check (head ${r}) and push \u2014 local version won; previous version recoverable from git history`),o.has(_.path)&&l.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)&&l.push(`race-window: concurrent commit ${i} deleted ${_.path}; push re-created it`)}catch(u){let f=this.deps.redact??(d=>d);l.push(`race-window check failed: ${f(qa(u))}`)}}async buildWatermarkFiles(e,t,r,i,s,o,l){if(l.fileMode)return t.map(f=>({path:f.path,blobSha:f.blobSha}));let c=new Map;for(let f of i)f.kind==="change"&&f.blobSha!==void 0&&c.set(f.blobSha,f.uid);for(let[f,d]of r){let p=o?.get(f)??await(0,uc.gitBlobSha)(d,this.sha1);c.set(p,typeof d=="string"?(0,Qs.extractAssetUid)(d):void 0)}for(let f of s.files)c.has(f.blobSha)||c.set(f.blobSha,f.uid);let u=[];for(let f of t){let d;if(c.has(f.blobSha))d=c.get(f.blobSha);else{let p=await(0,_t.getBlobText)(this.transport,e.owner,e.repo,f.blobSha,this.deps.baseURL);d=(0,Qs.extractAssetUid)(p)}u.push({path:f.path,blobSha:f.blobSha,...d?{uid:d}:{}})}return u}};fn.SyncEngine=DA});var Rk=v(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.QuarantineResolver=void 0;Op.backupPathFor=xk;var ure=n_(),p_=tf(),Rp=ef(),Cp=Tp(),fre=a_(),Js="\0absent",FA=class{static{a(this,"QuarantineResolver")}constructor(e){this.deps=e}async listOpenConflicts(e){let t=[];for(let r of e)t.push(...await this.listRepoConflicts(r));return t}async listRepoConflicts(e){if(e.spaceKind==="file")return[];let t=await this.deps.watermarkStore.get(e.repoKey),r=t?.pinnedPaths??[];if(r.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(r=r.filter(y=>!_.has(y)),r.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,r),l=r.some(h=>!o.has(h)),c=new Map,u=!0;if(l)if(s)try{c=await this.remoteTreeShas(e)}catch{u=!1}else c=await this.remoteTreeShas(e);let f=this.deps.localFilesFor(e),d=new Set(await f.list()),p=[];for(let h of r){let _=o.get(h),y,b;if(_!==void 0)b=_.remoteContent!==void 0?await(0,Rp.gitBlobSha)(_.remoteContent,this.deps.sha1):Js,y=_.baseContent!==void 0?await(0,Rp.gitBlobSha)(_.baseContent,this.deps.sha1):i.get(h)??Js;else{if(!u)continue;b=c.get(h)??Js,y=i.get(h)??Js}let S=Js,I;if(d.has(h)&&(I=await f.read(h),S=await(0,Rp.gitBlobSha)(I,this.deps.sha1)),!(S!==b&&S!==y&&b!==y))continue;let T=(I!==void 0?(0,Cp.extractAssetUid)(I):void 0)??_?.uid;p.push({repoKey:e.repoKey,path:h,...T!==void 0?{uid:T}:{},hasLocal:S!==Js,hasRemote:b!==Js})}return p}async cachedRecordsFor(e,t){let r=new Map,i=this.deps.conflictCache;if(i===void 0)return r;for(let s of t){let o=await i.get(e.repoKey,s);o!==null&&r.set(s,o)}return r}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 l;try{l=await s.read(o)}catch{continue}let c=(0,Cp.extractAssetUid)(l);c!==void 0&&t.set(c,(t.get(c)??0)+1)}}let r=0;for(let i of t.values())i>1&&r++;return r}async loadConflict(e,t){let r=this.deps.localFilesFor(e),s=new Set(await r.list()).has(t)?await r.read(t):void 0,o=await this.deps.conflictCache?.get(e.repoKey,t)??null,l,c;if(o!==null)l=o.remoteContent,c=o.baseContent;else{let d=(await this.remoteTreeShas(e)).get(t);l=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{c=await this.blobText(e,h)}catch{c=void 0}}let u=(s!==void 0?(0,Cp.extractAssetUid)(s):void 0)??(l!==void 0?(0,Cp.extractAssetUid)(l):void 0)??o?.uid;return{repoKey:e.repoKey,path:t,...u!==void 0?{uid:u}:{},hasLocal:s!==void 0,hasRemote:l!==void 0,...c!==void 0?{base:c}:{},...s!==void 0?{local:s}:{},...l!==void 0?{remote:l}:{}}}async resolve(e,t,r){let i=this.deps.localFilesFor(e),o=new Set(await i.list()).has(t)?await i.read(t):void 0,l=this.deps.outbox!==void 0,{remote:c,remoteSha:u}=l?await this.remoteForResolve(e,t):await this.liveRemoteForResolve(e,t),f=this.chosenContent(r,o,c),d;r.take!=="local"&&o!==void 0&&o!==f&&(d=xk(t),await i.write(d,o)),f===void 0?await i.delete(t):await i.write(t,f);let h=f===void 0&&c===void 0||f===c;if(l&&this.deps.outbox!==void 0&&!h&&f!==void 0)return await this.deps.outbox.enqueue({repoKey:e.repoKey,path:t,chosenContent:f,resolvedTo:r.take==="merged"?"merged":"local",baseRemoteSha:u===Js?fre.OUTBOX_REMOTE_ABSENT:u,resolvedAt:""}),{repoKey:e.repoKey,path:t,resolvedTo:r.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:r.take,..._!==void 0?{pushedSha:_}:{},...d!==void 0?{discardedLocalBackupPath:d}:{}}}async remoteForResolve(e,t){let r=await this.deps.conflictCache?.get(e.repoKey,t)??null;if(r!==null){let i=r.remoteContent,s=i!==void 0?await(0,Rp.gitBlobSha)(i,this.deps.sha1):Js;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??Js}}chosenContent(e,t,r){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 r;case"merged":return e.content}}async commitChoice(e,t,r){let i=this.deps.commitMessage?.(e,t)??`chore(exosync): resolve conflict for ${t}`;if(r===void 0)throw new Error(`resolve: cannot push an empty resolution for ${t}`);return(0,ure.restCreateCommit)(this.deps.transport,{owner:e.owner,repo:e.repo,branch:e.branch,files:new Map([[t,r]]),message:i,...this.deps.baseURL!==void 0?{baseURL:this.deps.baseURL}:{},...this.deps.redact!==void 0?{redact:this.deps.redact}:{}})}async snapWatermark(e,t,r){let i=await this.deps.watermarkStore.get(e.repoKey);if(i===null)return;let s=(i.pinnedPaths??[]).filter(l=>l!==t),o=i.files;if(r===void 0)o=o.filter(l=>l.path!==t);else{let l=await(0,Rp.gitBlobSha)(r,this.deps.sha1),c=(0,Cp.extractAssetUid)(r),u={path:t,blobSha:l,...c!==void 0?{uid:c}:{}},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,p_.getHeadSha)(this.deps.transport,e.owner,e.repo,e.branch,this.deps.baseURL),r=await(0,p_.getCommitInfo)(this.deps.transport,e.owner,e.repo,t,this.deps.baseURL),i=await(0,p_.getTree)(this.deps.transport,e.owner,e.repo,r.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,p_.getBlobText)(this.deps.transport,e.owner,e.repo,t,this.deps.baseURL)}};Op.QuarantineResolver=FA;function xk(n){return`${n}.conflict.local.txt`}a(xk,"backupPathFor")});var Ck=v(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.FileLocalManifestStore=rf.LOCAL_MANIFEST_STORE_FILENAME=void 0;rf.LOCAL_MANIFEST_STORE_FILENAME="exosync-localmanifest.local.json";function dre(n){if(n===null||typeof n!="object")return!1;let e=n;return e.version===1&&typeof e.lastFullRehashMs=="number"&&e.files!==null&&typeof e.files=="object"}a(dre,"isLocalManifestRecord");var LA=class{static{a(this,"FileLocalManifestStore")}constructor(e){this.io=e,this.writeChain=Promise.resolve()}async get(e){let r=(await this.readRepos())[e];return dre(r)?r:null}async set(e,t){let r=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=r.catch(()=>{}),r}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 r=t.repos;return r===null||typeof r!="object"?{}:{...r}}catch{return{}}}};rf.FileLocalManifestStore=LA});var MA=v(kA=>{"use strict";Object.defineProperty(kA,"__esModule",{value:!0});kA.diff3=pre;function Ok(n,e){let t=n.length,r=e.length,i=Array.from({length:t+1},()=>new Int32Array(r+1));for(let c=t-1;c>=0;c--)for(let u=r-1;u>=0;u--)i[c][u]=n[c]===e[u]?i[c+1][u+1]+1:Math.max(i[c+1][u],i[c][u+1]);let s=new Map,o=0,l=0;for(;o<t&&l<r;)n[o]===e[l]?(s.set(o,l),o++,l++):i[o+1][l]>=i[o][l+1]?o++:l++;return s}a(Ok,"lcsMatch");function NA(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}a(NA,"sliceEq");function pre(n,e,t){let r=Ok(n,e),i=Ok(n,t),s=[],o=0,l=0,c=0;for(;;){let u=o;for(;u<n.length&&!(r.has(u)&&i.has(u));)u++;let f=u<n.length?r.get(u):e.length,d=u<n.length?i.get(u):t.length,p=n.slice(o,u),h=e.slice(l,f),_=t.slice(c,d),y=!NA(h,p),b=!NA(_,p);if(!y&&!b)s.push(...p);else if(!y)s.push(..._);else if(!b)s.push(...h);else if(NA(h,_))s.push(...h);else return{ok:!1,conflict:{base:p,local:h,remote:_}};if(u>=n.length)break;s.push(n[u]),o=u+1,l=f+1,c=d+1}return{ok:!0,merged:s}}a(pre,"diff3")});var Dk=v(Fp=>{"use strict";Object.defineProperty(Fp,"__esModule",{value:!0});Fp.StructuredMerger=void 0;Fp.splitSections=h_;var Pk=MA(),hre=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/,Pp="exo__Instance_class";function Dp(n){if(n===null||typeof n!="object")return!0;if(Array.isArray(n))return n.every(Dp);let e=Object.getPrototypeOf(n);return e!==Object.prototype&&e!==null?!1:Object.values(n).every(Dp)}a(Dp,"isPlainValue");function Ga(n,e){if(n===e)return!0;if(n===null||e===null||n===void 0||e===void 0||typeof n!="object"||typeof e!="object"||Array.isArray(n)!==Array.isArray(e))return!1;if(Array.isArray(n)&&Array.isArray(e))return n.length!==e.length?!1:n.every((s,o)=>Ga(s,e[o]));let t=n,r=e,i=Object.keys(t);return i.length!==Object.keys(r).length?!1:i.every(s=>Ga(t[s],r[s]))}a(Ga,"deepEqual");function fc(n){return typeof n=="string"?`s:${n}`:`j:${JSON.stringify(n)}`}a(fc,"setKey");function Oi(n){return n==null?[]:Array.isArray(n)?n:[n]}a(Oi,"toElements");function mre(n,e,t){let r=new Set(Oi(n).map(fc)),i=Oi(e),s=Oi(t),o=new Set(i.map(fc)),l=new Set(s.map(fc)),c=a(d=>o.has(d)&&l.has(d)||o.has(d)&&!r.has(d)||l.has(d)&&!r.has(d),"keep"),u=[],f=new Set;for(let d of[...i,...s]){let p=fc(d);f.has(p)||!c(p)||(f.add(p),u.push(d))}return u}a(mre,"mergeSet");function gre(n,e,t){let r=[],i=[],s=new Set;for(let l of[...Object.keys(n),...Object.keys(e),...Object.keys(t)])s.has(l)||(s.add(l),i.push(l));let o={};for(let l of i){let c=n[l],u=e[l],f=t[l];if(!Dp(c)||!Dp(u)||!Dp(f))return{ok:!1,reason:`frontmatter key "${l}" contains a non-plain value (Date?) \u2014 the codec must round-trip scalars as strings (CORE_SCHEMA contract)`};if(Array.isArray(c)||Array.isArray(u)||Array.isArray(f)){if(!(l in e)&&!(l in t))continue;let d=mre(c,u,f),p=new Set(Oi(c).map(fc)),h=Oi(u).some(y=>!p.has(fc(y))),_=Oi(f).some(y=>!p.has(fc(y)));h&&_&&!Ga(Oi(u),Oi(f))&&r.push(`both sides added values to multi-valued key "${l}" \u2014 union kept (D20)`),d.length>0&&(o[l]=d);continue}if(Ga(u,f)){u!==void 0&&(o[l]=u);continue}if(Ga(u,c)){f!==void 0&&(o[l]=f);continue}if(Ga(f,c)){u!==void 0&&(o[l]=u);continue}return{ok:!1,reason:`frontmatter key "${l}" changed differently on both sides`}}return{ok:!0,value:o,warnings:r}}a(gre,"mergeFrontmatter");var yre=/^(```|~~~)/,_re=/^#{1,6}\s/;function h_(n){let e=n.split(`
321
321
  `),t=[],r=null,i="",s=!1,o=a(()=>{r!==null&&t.push({heading:i,text:r.join(`
322
322
  `)})},"flush");for(let l of e){if(yre.test(l.trimStart())&&(s=!s),!s&&_re.test(l)){o(),r=[l],i=l.trim();continue}r===null&&(r=[],i=""),r.push(l)}return o(),t}a(h_,"splitSections");function jA(n){return n.split(/\n{2,}/)}a(jA,"splitParagraphs");function bre(n){return n.join(`
323
323
 
324
- `)}a(bre,"joinParagraphs");function $A(n){let e=new Map,t=new Map,r=[];for(let i of n){let s=e.get(i.heading)??0;e.set(i.heading,s+1);let o=`${i.heading}\0${s}`;t.set(o,i),r.push(o)}return{keyed:t,order:r}}a($A,"keySections");function UA(n){let e=new Map;for(let t of n)e.set(t.heading,(e.get(t.heading)??0)+1);return e}a(UA,"headingCounts");function Sre(n,e,t){if(e===t)return{ok:!0,body:e,warnings:[]};if(e===n)return{ok:!0,body:t,warnings:[]};if(t===n)return{ok:!0,body:e,warnings:[]};let r=[],i=h_(n),s=h_(e),o=h_(t),l=UA(i),c=UA(s),u=UA(o),f=new Set([...l.keys(),...c.keys(),...u.keys()]);for(let Q of f){let se=[l.get(Q)??0,c.get(Q)??0,u.get(Q)??0];if(Math.max(...se)>1&&new Set(se).size>1)return{ok:!1,reason:`duplicate heading "${Q||"(preamble)"}" count differs across versions \u2014 occurrence pairing unstable`}}let d=$A(i),p=$A(s),h=$A(o),_=new Map,y=[],b=new Set;for(let Q of[...d.order,...p.order,...h.order])b.has(Q)||(b.add(Q),y.push(Q));for(let Q of y){let se=Q.slice(0,Q.lastIndexOf("\0")),J=d.keyed.get(Q)?.text,ve=p.keyed.get(Q)?.text,te=h.keyed.get(Q)?.text;if(ve===te){ve!==void 0&&_.set(Q,ve);continue}if(ve===J){te!==void 0&&_.set(Q,te);continue}if(te===J){ve!==void 0&&_.set(Q,ve);continue}if(ve===void 0||te===void 0)return{ok:!1,reason:`section "${se||"(preamble)"}": deleted on one side, modified on the other`};if(J===void 0)return{ok:!1,reason:`section "${se||"(preamble)"}": added differently on both sides`};let ie=(0,Pk.diff3)(jA(J),jA(ve),jA(te));if(ie.ok){_.set(Q,bre(ie.merged));continue}let he=(0,Pk.diff3)(J.split(`
324
+ `)}a(bre,"joinParagraphs");function $A(n){let e=new Map,t=new Map,r=[];for(let i of n){let s=e.get(i.heading)??0;e.set(i.heading,s+1);let o=`${i.heading}\0${s}`;t.set(o,i),r.push(o)}return{keyed:t,order:r}}a($A,"keySections");function UA(n){let e=new Map;for(let t of n)e.set(t.heading,(e.get(t.heading)??0)+1);return e}a(UA,"headingCounts");function Sre(n,e,t){if(e===t)return{ok:!0,body:e,warnings:[]};if(e===n)return{ok:!0,body:t,warnings:[]};if(t===n)return{ok:!0,body:e,warnings:[]};let r=[],i=h_(n),s=h_(e),o=h_(t),l=UA(i),c=UA(s),u=UA(o),f=new Set([...l.keys(),...c.keys(),...u.keys()]);for(let Q of f){let se=[l.get(Q)??0,c.get(Q)??0,u.get(Q)??0];if(Math.max(...se)>1&&new Set(se).size>1)return{ok:!1,reason:`duplicate heading "${Q||"(preamble)"}" count differs across versions \u2014 occurrence pairing unstable`}}let d=$A(i),p=$A(s),h=$A(o),_=new Map,y=[],b=new Set;for(let Q of[...d.order,...p.order,...h.order])b.has(Q)||(b.add(Q),y.push(Q));for(let Q of y){let se=Q.slice(0,Q.lastIndexOf("\0")),J=d.keyed.get(Q)?.text,ve=p.keyed.get(Q)?.text,re=h.keyed.get(Q)?.text;if(ve===re){ve!==void 0&&_.set(Q,ve);continue}if(ve===J){re!==void 0&&_.set(Q,re);continue}if(re===J){ve!==void 0&&_.set(Q,ve);continue}if(ve===void 0||re===void 0)return{ok:!1,reason:`section "${se||"(preamble)"}": deleted on one side, modified on the other`};if(J===void 0)return{ok:!1,reason:`section "${se||"(preamble)"}": added differently on both sides`};let ie=(0,Pk.diff3)(jA(J),jA(ve),jA(re));if(ie.ok){_.set(Q,bre(ie.merged));continue}let he=(0,Pk.diff3)(J.split(`
325
325
  `),ve.split(`
326
- `),te.split(`
326
+ `),re.split(`
327
327
  `));if(!he.ok)return{ok:!1,reason:`section "${se||"(preamble)"}": overlapping paragraph edits`};_.set(Q,he.merged.join(`
328
328
  `))}let S=a(Q=>Q.filter(se=>_.has(se)),"surviving"),I=S(d.order),O=S(p.order),T=S(h.order),E=a((Q,se)=>Q.length===se.length&&Q.every((J,ve)=>J===se[ve]),"sameSeq"),P=O.filter(Q=>I.includes(Q)),V=T.filter(Q=>I.includes(Q)),M=I.filter(Q=>O.includes(Q)),j=I.filter(Q=>T.includes(Q)),$;E(P,M)?$=T:E(V,j)?$=O:($=O,r.push("section order diverged on both sides \u2014 local order kept, remote additions appended"));let G=[],ge=new Set;for(let Q of $)_.has(Q)&&!ge.has(Q)&&(ge.add(Q),G.push(Q));for(let Q of[...O,...T])_.has(Q)&&!ge.has(Q)&&(ge.add(Q),G.push(Q));return{ok:!0,body:G.map(Q=>_.get(Q)).join(`
329
329
  `),warnings:r}}a(Sre,"mergeBody");var BA=class{static{a(this,"StructuredMerger")}constructor(e){this.codec=e}mergeAsset(e){let{path:t,base:r,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(r!==void 0&&i===r)return{status:"merged",content:s,warnings:[]};if(r!==void 0&&s===r)return{status:"merged",content:i,warnings:[]};let o=this.splitDoc(r??""),l=this.splitDoc(i),c=this.splitDoc(s);if(o===null||l===null||c===null)return{status:"conflict",reason:`${t}: unparseable frontmatter on ${o===null?"base":l===null?"local":"remote"} side`};let u=gre(o.frontmatter,l.frontmatter,c.frontmatter);if(!u.ok)return{status:"conflict",reason:`${t}: ${u.reason}`};let f=Oi(o.frontmatter[Pp]),d=Oi(l.frontmatter[Pp]),p=Oi(c.frontmatter[Pp]),h=Oi(u.value[Pp]);if(f.length>0&&d.length>0&&p.length>0&&h.length===0)return{status:"conflict",reason:`${t}: cross-tombstones removed all ${Pp} values \u2014 typeless merge refused`};let _=Sre(o.body,l.body,c.body);if(!_.ok)return{status:"conflict",reason:`${t}: ${_.reason}`};let y=[...u.warnings,..._.warnings];if(Ga(u.value,l.frontmatter)&&_.body===l.body)return{status:"merged",content:i,warnings:y};if(Ga(u.value,c.frontmatter)&&_.body===c.body)return{status:"merged",content:s,warnings:y};let b;try{b=this.codec.stringify(u.value)}catch(I){return{status:"conflict",reason:`${t}: merged frontmatter failed to serialize (${I instanceof Error?I.message:String(I)})`}}return b.endsWith(`
@@ -335,7 +335,7 @@ ${_.body}`,warnings:y}}splitDoc(e){let t=hre.exec(e);if(!t)return{frontmatter:{}
335
335
  `),ge=[..._.values()].map(ye=>ye.blobSha).sort().join(`
336
336
  `);$=G===ge}return o("checked",{filesChecked:E,inParity:T,discrepancies:O,m2SemanticDiffs:M,accountedCount:j,m1Violations:V,headSha:u,...$!==void 0?{attachmentHashSetIdentical:$}:{}})}catch(c){return(0,Fre.isAuthError)(c)?o("auth-required",{detail:s(`authentication failed: ${Wa(c)} \u2014 the PAT is expired, revoked or under-scoped; update it (R8)`)}):jre(c)?(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(Wa(c))})):(i.push(`parity check failed: ${s(Wa(c))}`),o("error",{detail:s(Wa(c))}))}}async readLocalSnapshot(e,t){let r=this.deps.localFilesFor(e),i=t?af.isFileSpaceSyncablePath:af.isSyncablePath,s=this.deps.maxFileBytes??af.DEFAULT_MAX_FILE_BYTES,o=new Map,l=new Map,c=[];if(t&&r.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 r.list())if(i(f))try{if(t){let d=await r.readBinary(f);if(d.byteLength>s){c.push(`local ${f} exceeds the ${s}-byte cap \u2014 excluded symmetrically`);continue}o.set(f,await(0,Kk.gitBlobSha)(d,this.deps.sha1))}else{let d=await r.read(f);if(u.encode(d).byteLength>s){c.push(`local ${f} exceeds the ${s}-byte cap \u2014 excluded symmetrically`);continue}l.set(f,d),o.set(f,await(0,Kk.gitBlobSha)(d,this.deps.sha1))}}catch(d){let p=this.deps.redact??(h=>h);c.push(`local ${f} unreadable (${p(Wa(d))}) \u2014 skipped`)}return{shas:o,texts:l,warnings:c}}async classifyAll(e,t,r,i,s,o,l){let c=[],u=0,f=this.deps.maxSemanticFetchesPerRepo??Nre,d=new Set([...t.shas.keys(),...r.keys()]);for(let p of[...d].sort()){let h=t.shas.get(p),y=r.get(p)?.blobSha,b=i.get(p);if(h!==void 0&&y!==void 0){if(h===y){u++;continue}c.push(await this.classifyContentDiff(e,p,h,y,b,s,o,t,{...l,takeRepoFetch:a(()=>f-- >0,"takeRepoFetch")}));continue}if(h!==void 0){let S;s.has(p)?S={path:p,presence:"local-only",cls:"quarantine-pinned",localSha:h}:b===void 0?S={path:p,presence:"local-only",cls:"pending-local-add",localSha:h}:b===h?S={path:p,presence:"local-only",cls:"pending-remote-delete",localSha:h,detail:"remote deleted it; the local copy is unchanged"}:S={path:p,presence:"local-only",cls:"pending-conflict",localSha:h,detail:"remote deleted it AND the local copy was edited"},c.push(S);continue}if(y!==void 0){let S;s.has(p)?S={path:p,presence:"remote-only",cls:"quarantine-pinned",remoteSha:y}:b===void 0?S={path:p,presence:"remote-only",cls:"pending-remote-add",remoteSha:y}:b===y?S={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"}:S={path:p,presence:"remote-only",cls:"pending-conflict",remoteSha:y,detail:"locally deleted AND the remote copy was edited"},c.push(S)}}return{discrepancies:c,inParity:u,filesChecked:d.size}}async classifyContentDiff(e,t,r,i,s,o,l,c,u){let f={localSha:r,remoteSha:i};if(o.has(t))return{path:t,presence:"both",cls:"quarantine-pinned",...f};if(s!==void 0&&s===r)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(l)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=c.texts.get(t),p;try{p=await(0,Lp.getBlobText)(this.transport,e.owner,e.repo,i,this.deps.baseURL)}catch(_){let y=this.deps.redact??(b=>b);return u.warnings.push(`blob fetch for ${t} failed (${y(Wa(_))}) \u2014 left unverified`),{path:t,presence:"both",cls:"unverified-divergence",...f}}let h=(0,Yk.compareAssetSemantics)(d??"",p,this.deps.yaml);return(0,Yk.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,r,i,s,o){let l=t.snapshot?.dirtyByRepo.get(e.repoKey);if(l===void 0||l.size===0)return[];let c=new Set(o?.mergedPaths??[]),u=new Set(o?.quarantinedPaths??[]),f=[];for(let[d,p]of l)r.shas.get(d)!==p&&i.get(d)?.blobSha!==p&&(c.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 ${r.shas.get(d)?.slice(0,7)??"absent"}, not in head tree, not merged/quarantined/pinned \u2014 possible lost edit`}));return f}escalatePersistentDivergence(e,t,r){for(let i of e){if(i.status!=="checked")continue;let s=r?.find(u=>u.repoKey===i.repoKey);if(s!==void 0&&s.status!=="synced")continue;let o=new Set(s?.deferredDeletes??[]),l=t.repos.find(u=>u.repoKey===i.repoKey&&u.status==="checked");if(l===void 0)continue;let c=new Map(l.discrepancies.filter(u=>Qk.has(u.cls)).map(u=>[u.path,u]));for(let u of i.discrepancies){if(!Qk.has(u.cls)||u.cls==="deferred-local-delete"&&o.has(u.path))continue;let f=c.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`})}}}};Np.ParityValidator=eI;function $re(n){if(n.vacuous)return`ExoSync parity: VACUOUS \u2014 0 of ${n.repos.length} repo(s) checked (errors / never synced)`;let e=n.repos.length-n.checkedRepos,t=e>0?`, ${e} skipped`:"";return n.ok?`ExoSync parity: M1=0, M2=\u2205 (${n.checkedRepos} repo(s) checked${t})`:`ExoSync parity: M1=${n.m1Total}, M2=${n.m2Total} diff(s) (${n.checkedRepos} repo(s) checked${t}) \u2014 see log`}a($re,"summarizeParityRound")});var Zk=v(Jk=>{"use strict";Object.defineProperty(Jk,"__esModule",{value:!0})});var kp=v(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.UID_UNIQUENESS_WHITELIST_CLASS_UIDS=Gr.KNOWN_CHECK_IDS=Gr.CHECK_ID_DAG_ONTOLOGY_IMPORTS=Gr.CHECK_ID_UID_UNIQUENESS=Gr.CHECK_ID_CO_LOCATION=Gr.CHECK_ID_SHACL=void 0;Gr.CHECK_ID_SHACL="f83ffedd-1f05-4ab5-839d-58873c69c4ba";Gr.CHECK_ID_CO_LOCATION="61f95c82-f6fc-4b20-b06d-19f3dc1b1f12";Gr.CHECK_ID_UID_UNIQUENESS="ac10db25-231c-4677-8cac-647d3cf15c64";Gr.CHECK_ID_DAG_ONTOLOGY_IMPORTS="a57f4a6b-a462-4c8d-b958-0dbee4674727";Gr.KNOWN_CHECK_IDS=new Set([Gr.CHECK_ID_SHACL,Gr.CHECK_ID_CO_LOCATION,Gr.CHECK_ID_UID_UNIQUENESS,Gr.CHECK_ID_DAG_ONTOLOGY_IMPORTS]);Gr.UID_UNIQUENESS_WHITELIST_CLASS_UIDS=new Set(["b04e7a3e-6b49-4984-9f8d-b74e9f36818b","2b754a16-cccf-49ee-af69-a18c6d1e3b63"])});var S_=v(Mp=>{"use strict";Object.defineProperty(Mp,"__esModule",{value:!0});Mp.readUid=Ure;Mp.readIsDefinedByRef=Bre;Mp.readInstanceClassRefs=Vre;var eM=Ou();function Ure(n){let e=n.exo__Asset_uid;if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}a(Ure,"readUid");function Bre(n){return(0,eM.extractAssetReference)(n.exo__Asset_isDefinedBy)}a(Bre,"readIsDefinedByRef");function Vre(n){let e=n.exo__Instance_class,t=Array.isArray(e)?e:e==null?[]:[e],r=[];for(let i of t){let s=(0,eM.extractAssetReference)(i);s&&r.push(s)}return r}a(Vre,"readInstanceClassRefs")});var rI=v(tI=>{"use strict";Object.defineProperty(tI,"__esModule",{value:!0});tI.uidUniquenessCheck=Gre;var tM=S_(),qre=kp();function Gre(n){let e=new Map;for(let r of n.assets){let i=(0,tM.readUid)(r.frontmatter);if(!i||(0,tM.readInstanceClassRefs)(r.frontmatter).some(l=>qre.UID_UNIQUENESS_WHITELIST_CLASS_UIDS.has(l)))continue;let o=e.get(i);o?o.push(r.path):e.set(i,[r.path])}let t=[];for(let[r,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 "${r}" \u2014 also at ${s.filter(l=>l!==o).join(", ")}`})}return t}a(Gre,"uidUniquenessCheck")});var iI=v(nI=>{"use strict";Object.defineProperty(nI,"__esModule",{value:!0});nI.coLocationCheck=Kre;var rM=S_(),Wre=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function nM(n){let e=n.lastIndexOf("/");return e<0?"":n.slice(0,e)}a(nM,"dirOf");function Hre(n){let e=n.slice(n.lastIndexOf("/")+1);return e.endsWith(".md")?e.slice(0,-3):e}a(Hre,"baseNameNoExt");function zre(n){return n.split("/").some(e=>e.toLowerCase()==="templates")}a(zre,"isTemplatesPath");function Kre(n){let e=new Map,t=new Map;for(let s of n.assets){let o=(0,rM.readUid)(s.frontmatter);o&&!e.has(o)&&e.set(o,s.path);let l=Hre(s.path);t.has(l)||t.set(l,s.path)}let r=a(s=>Wre.test(s)?e.get(s)??t.get(s):t.get(s)??e.get(s),"resolve"),i=[];for(let s of n.assets){if(s.path.split("/").includes("node_modules")||zre(s.path))continue;let o=(0,rM.readIsDefinedByRef)(s.frontmatter);if(!o||o.startsWith("!"))continue;let l=r(o);if(!l)continue;let c=nM(l),u=nM(s.path);c!==u&&i.push({path:s.path,message:`co-location: isDefinedBy=${o} expects folder "${c}/" but asset is in "${u}/"`})}return i}a(Kre,"coLocationCheck")});var oI=v(sI=>{"use strict";Object.defineProperty(sI,"__esModule",{value:!0});sI.shaclCheck=Yre;async function Yre(n){if(!n.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 n.runShacl()).map(t=>({path:t.focusNode??t.path,message:`SHACL: ${t.message}${t.path?` (path ${t.path})`:""}`}))}a(Yre,"shaclCheck")});var lI=v(aI=>{"use strict";Object.defineProperty(aI,"__esModule",{value:!0});aI.dagOntologyImportsCheck=Qre;async function Qre(n){if(!n.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 n.runDag()]}a(Qre,"dagOntologyImportsCheck")});var cI=v(jp=>{"use strict";Object.defineProperty(jp,"__esModule",{value:!0});jp.CheckRegistry=void 0;jp.createDefaultCheckRegistry=tne;var w_=kp(),Xre=rI(),Jre=iI(),Zre=oI(),ene=lI(),E_=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()]}};jp.CheckRegistry=E_;function tne(){return new E_().register({id:w_.CHECK_ID_UID_UNIQUENESS,label:"uid-uniqueness",run:Xre.uidUniquenessCheck}).register({id:w_.CHECK_ID_CO_LOCATION,label:"co-location",run:Jre.coLocationCheck}).register({id:w_.CHECK_ID_SHACL,label:"shacl",run:Zre.shaclCheck}).register({id:w_.CHECK_ID_DAG_ONTOLOGY_IMPORTS,label:"dag-ontology-imports",run:ene.dagOntologyImportsCheck})}a(tne,"createDefaultCheckRegistry")});var iM=v(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_.VaultCheckRunner=void 0;var rne=cI(),uI=class{static{a(this,"VaultCheckRunner")}constructor(e=new rne.CheckRegistry){this.registry=e}async run(e,t){let r=await e.read();return this.runWithContext(r,t)}async runWithContext(e,t){let r=[];for(let i of t){let s=this.registry.get(i);if(!s){r.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);r.push({checkId:i,label:s.label,status:o.length>0?"fail":"pass",findings:o})}catch(o){r.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:r,ok:r.every(i=>i.status==="pass")}}};v_.VaultCheckRunner=uI});var sM=v(fI=>{"use strict";Object.defineProperty(fI,"__esModule",{value:!0});fI.readEnabledCheckIds=sne;var nne=kp(),ine=Ou();function sne(n){let e=new Set;for(let t of n){let r=(0,ine.extractAssetReference)(t.frontmatter.setting__Setting_key);if(!r||!nne.KNOWN_CHECK_IDS.has(r))continue;let i=t.frontmatter.setting__Setting_value;(i===!0||i==="true")&&e.add(r)}return[...e]}a(sne,"readEnabledCheckIds")});var lM=v(It=>{"use strict";var one=It&&It.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=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(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),oM=It&&It.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&one(e,n,t)};Object.defineProperty(It,"__esModule",{value:!0});It.readInstanceClassRefs=It.readIsDefinedByRef=It.readUid=It.dagOntologyImportsCheck=It.shaclCheck=It.coLocationCheck=It.uidUniquenessCheck=It.readEnabledCheckIds=It.VaultCheckRunner=It.createDefaultCheckRegistry=It.CheckRegistry=void 0;oM(Zk(),It);oM(kp(),It);var aM=cI();Object.defineProperty(It,"CheckRegistry",{enumerable:!0,get:a(function(){return aM.CheckRegistry},"get")});Object.defineProperty(It,"createDefaultCheckRegistry",{enumerable:!0,get:a(function(){return aM.createDefaultCheckRegistry},"get")});var ane=iM();Object.defineProperty(It,"VaultCheckRunner",{enumerable:!0,get:a(function(){return ane.VaultCheckRunner},"get")});var lne=sM();Object.defineProperty(It,"readEnabledCheckIds",{enumerable:!0,get:a(function(){return lne.readEnabledCheckIds},"get")});var cne=rI();Object.defineProperty(It,"uidUniquenessCheck",{enumerable:!0,get:a(function(){return cne.uidUniquenessCheck},"get")});var une=iI();Object.defineProperty(It,"coLocationCheck",{enumerable:!0,get:a(function(){return une.coLocationCheck},"get")});var fne=oI();Object.defineProperty(It,"shaclCheck",{enumerable:!0,get:a(function(){return fne.shaclCheck},"get")});var dne=lI();Object.defineProperty(It,"dagOntologyImportsCheck",{enumerable:!0,get:a(function(){return dne.dagOntologyImportsCheck},"get")});var dI=S_();Object.defineProperty(It,"readUid",{enumerable:!0,get:a(function(){return dI.readUid},"get")});Object.defineProperty(It,"readIsDefinedByRef",{enumerable:!0,get:a(function(){return dI.readIsDefinedByRef},"get")});Object.defineProperty(It,"readInstanceClassRefs",{enumerable:!0,get:a(function(){return dI.readInstanceClassRefs},"get")})});var uM=v(cM=>{"use strict";Object.defineProperty(cM,"__esModule",{value:!0})});var T_=v(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.LEGACY_SETTING_VALUE_PROPS=Wt.LEGACY_SETTING_KEY_PROPS=Wt.SETTING_VALUE_PROP=Wt.SETTING_KEY_PROP=void 0;Wt.coerceSettingValue=pne;Wt.extractKeyRef=hne;Wt.readSettingValueRaw=mne;Wt.renderSettingAssetMarkdown=yne;var fM=Ou();Wt.SETTING_KEY_PROP="setting__Setting_key";Wt.SETTING_VALUE_PROP="setting__Setting_value";Wt.LEGACY_SETTING_KEY_PROPS=["exo__Setting_key"];Wt.LEGACY_SETTING_VALUE_PROPS=["exo__Setting_value"];function pne(n,e){switch(n){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(r=>typeof r=="string");return t.length===e.length?t:void 0}return typeof e=="string"?[e]:void 0}}}a(pne,"coerceSettingValue");function dM(n){let e=n.indexOf("#");return e===-1?n:n.slice(0,e).trim()}a(dM,"stripAnchor");function hne(n){let e=(0,fM.extractAssetReference)(n[Wt.SETTING_KEY_PROP]);if(e)return dM(e);for(let t of Wt.LEGACY_SETTING_KEY_PROPS){let r=(0,fM.extractAssetReference)(n[t]);if(r)return dM(r)}return null}a(hne,"extractKeyRef");function mne(n){if(Wt.SETTING_VALUE_PROP in n)return n[Wt.SETTING_VALUE_PROP];for(let e of Wt.LEGACY_SETTING_VALUE_PROPS)if(e in n)return n[e]}a(mne,"readSettingValueRaw");function gne(n,e){switch(n){case"boolean":return[`${Wt.SETTING_VALUE_PROP}: ${e===!0?"true":"false"}`];case"string":return[`${Wt.SETTING_VALUE_PROP}: ${JSON.stringify(String(e??""))}`];case"stringList":{let t=Array.isArray(e)?e:[];return t.length===0?[`${Wt.SETTING_VALUE_PROP}: []`]:[`${Wt.SETTING_VALUE_PROP}:`,...t.map(r=>` - ${JSON.stringify(r)}`)]}}}a(gne,"renderValueYaml");function yne(n,e,t,r,i){return["---",`exo__Asset_uid: ${n.settingUid}`,`exo__Asset_isDefinedBy: "[[${r}]]"`,`exo__Asset_createdAt: ${i}`,"exo__Instance_class:",` - "[[${t}]]"`,`exo__Asset_label: "Setting: ${n.field}"`,`${Wt.SETTING_KEY_PROP}: "[[${n.keyUid}]]"`,...gne(n.datatype,e),"---","",`Distributable Exocortex setting \`${n.field}\` (${n.datatype}), exported by the Settings Distribution engine (RFC f402002b, M2). Edit \`setting__Setting_value\` here or re-export to overwrite.`,""].join(`
337
337
  `)}a(yne,"renderSettingAssetMarkdown")});var pM=v(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});I_.exportSettings=_ne;I_.importSettings=bne;var A_=T_();function _ne(n,e){return n.declaredKeys().map(t=>({field:t.field,fileName:`${t.settingUid}.md`,content:(0,A_.renderSettingAssetMarkdown)(t,n.readLiveValue(t),n.settingClassUid,e.ontologyUid,e.nowIso)}))}a(_ne,"exportSettings");async function bne(n,e){let t=new Map;for(let s of n.declaredKeys())t.set(s.keyUid,s),t.set(s.keyLabel,s);let r=[],i=[];for(let s of e){let o=(0,A_.extractKeyRef)(s.frontmatter),l=o!==null?t.get(o):void 0;if(l===void 0){i.push({path:s.path,reason:"unknown-key",detail:o??"<no setting key>"});continue}let c=(0,A_.coerceSettingValue)(l.datatype,(0,A_.readSettingValueRaw)(s.frontmatter));if(c===void 0){i.push({path:s.path,reason:"uncoercible",detail:`expected ${l.datatype}`});continue}await n.writeLiveValue(l,c),r.push(l.field)}return{applied:r,skipped:i}}a(bne,"importSettings")});var hM=v($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID=void 0;$p.resolveDistributionOntology=Sne;var pI=T_();$p.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID="ea44f996-64e5-46ce-8953-b13d21ee750d";function Sne(n,e){for(let t of n){if((0,pI.extractKeyRef)(t.frontmatter)!==e)continue;let r=(0,pI.coerceSettingValue)("string",(0,pI.readSettingValueRaw)(t.frontmatter));if(typeof r=="string"){let i=r.trim();if(i.length>0)return i}}return null}a(Sne,"resolveDistributionOntology")});var yM=v(Et=>{"use strict";var wne=Et&&Et.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=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(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Ene=Et&&Et.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&wne(e,n,t)};Object.defineProperty(Et,"__esModule",{value:!0});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;Ene(uM(),Et);var Ha=T_();Object.defineProperty(Et,"SETTING_KEY_PROP",{enumerable:!0,get:a(function(){return Ha.SETTING_KEY_PROP},"get")});Object.defineProperty(Et,"SETTING_VALUE_PROP",{enumerable:!0,get:a(function(){return Ha.SETTING_VALUE_PROP},"get")});Object.defineProperty(Et,"LEGACY_SETTING_KEY_PROPS",{enumerable:!0,get:a(function(){return Ha.LEGACY_SETTING_KEY_PROPS},"get")});Object.defineProperty(Et,"LEGACY_SETTING_VALUE_PROPS",{enumerable:!0,get:a(function(){return Ha.LEGACY_SETTING_VALUE_PROPS},"get")});Object.defineProperty(Et,"coerceSettingValue",{enumerable:!0,get:a(function(){return Ha.coerceSettingValue},"get")});Object.defineProperty(Et,"extractKeyRef",{enumerable:!0,get:a(function(){return Ha.extractKeyRef},"get")});Object.defineProperty(Et,"readSettingValueRaw",{enumerable:!0,get:a(function(){return Ha.readSettingValueRaw},"get")});Object.defineProperty(Et,"renderSettingAssetMarkdown",{enumerable:!0,get:a(function(){return Ha.renderSettingAssetMarkdown},"get")});var mM=pM();Object.defineProperty(Et,"exportSettings",{enumerable:!0,get:a(function(){return mM.exportSettings},"get")});Object.defineProperty(Et,"importSettings",{enumerable:!0,get:a(function(){return mM.importSettings},"get")});var gM=hM();Object.defineProperty(Et,"EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID",{enumerable:!0,get:a(function(){return gM.EXOCORTEX_DISTRIBUTION_ONTOLOGY_KEY_UID},"get")});Object.defineProperty(Et,"resolveDistributionOntology",{enumerable:!0,get:a(function(){return gM.resolveDistributionOntology},"get")})});var hI=v(x_=>{"use strict";Object.defineProperty(x_,"__esModule",{value:!0});x_.DEFAULT_DISPLAY_NAME_SETTINGS=void 0;x_.DEFAULT_DISPLAY_NAME_SETTINGS={defaultTemplate:"{{exo__Asset_label}}",classTemplates:{},projectTBoxNames:!0}});var Bp=v(Up=>{"use strict";Object.defineProperty(Up,"__esModule",{value:!0});Up.isWikilink=mI;Up.ownProperty=R_;Up.resolveKeyPath=vne;function mI(n){return n.startsWith("[[")&&n.endsWith("]]")}a(mI,"isWikilink");function R_(n,e){if(!(n===null||typeof n!="object"))return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0}a(R_,"ownProperty");function vne(n,e,t){let r=e.split("."),i=n;for(let s of r){if(i==null)return;if(Array.isArray(i)){let o=i[0];if(typeof o=="string"&&t&&mI(o)){let l=t(o);if(l){i=R_(l,s);continue}return}}if(typeof i!="object"){if(typeof i=="string"&&t&&mI(i)){let o=t(i);if(o){i=R_(o,s);continue}}return}i=R_(i,s)}return i}a(vne,"resolveKeyPath")});var bM=v(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.PrintNameRuleService=void 0;var _M=Bp(),Tne="exo__DisplayNameSpec",Ane="07eab746-0874-4676-9d98-dbaad1bc6fb8",Ine="exo__PrintedProperty",xne="7d58de40-d941-4a66-88e2-13afc4fdc41d",Rne="exo__PrintedLiteral",Cne="4d5437c9-788e-4a6d-9be0-4af3a84554f4",One=1e3,Pne=300,gI=class{static{a(this,"PrintNameRuleService")}constructor(e,t={},r=void 0){this.vault=e,this.hostFunctions=t,this.host=r,this.rules=new Map,this.classHierarchy=new Map,this.initialized=!1,this.scanDebounceTimer=null}initialize(){this.scanVault(),this.initialized=!0}getTemplateForClass(e,t){if(!this.initialized)return null;let r=this.selectRule(this.rules.get(e),t);if(r)return{template:r.template,priority:r.priority};let i=this.getAncestorClasses(e);for(let s of i){let o=this.selectRule(this.rules.get(s),t);if(o)return{template:o.template,priority:o.priority}}return null}getParticipatingRules(e,t){if(!this.initialized)return[];let r=this.participatingOf(this.rules.get(e),t);if(r.length>0)return r;for(let i of this.getAncestorClasses(e)){let s=this.participatingOf(this.rules.get(i),t);if(s.length>0)return s}return[]}selectRule(e,t){if(!e||e.length===0)return null;for(let r of e)if(this.ruleParticipates(r,t))return r;return null}participatingOf(e,t){if(!e||e.length===0)return[];let r=[];for(let i of e)this.ruleParticipates(i,t)&&r.push({template:i.template,priority:i.priority,sourceFile:i.sourceFile,...i.separator?{separator:i.separator}:{}});return r}ruleParticipates(e,t){return e.matcher?t?this.matcherSatisfied(e.matcher,t):!1:!0}matcherSatisfied(e,t){if(e.kind==="hostFunction"){if(!Object.prototype.hasOwnProperty.call(this.hostFunctions,e.hostFunction))return!1;let s=this.hostFunctions[e.hostFunction];return typeof s!="function"?!1:s(this.host,t)}let r=e.matchKey.includes(".")?(0,_M.resolveKeyPath)(t,e.matchKey,this.createMetadataResolver()):(0,_M.ownProperty)(t,e.matchKey),i=this.extractClassKeys(r);return i.length===0?!1:i.some(s=>e.matchValues.includes(s))}resolveIdentityForms(e){let t=this.extractClassKeys(e);if(t.length===0)return[];let r=new Set(t);for(let i of t){let s=this.vault.resolveLinkpathFrontmatter(i);if(!s)continue;let o=s.exo__Asset_uid,l=s.exo__Asset_label;typeof o=="string"&&o.trim()&&r.add(o.trim()),typeof l=="string"&&l.trim()&&r.add(l.trim())}return[...r]}resolveMatchValues(e){return this.resolveIdentityForms(e)}resolveHostFunctionName(e){let t=e;if(Array.isArray(t)){if(t.length===0)return null;t=t[0]}return typeof t!="string"?null:t.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim()||null}createMetadataResolver(){return e=>{let t=e.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim(),r=t.includes("|")?t.split("|")[0]?.trim()??"":t;if(!r)return null;let i=this.vault.resolveLinkpathFrontmatter(r);return i?{...i}:null}}refresh(){this.scanVault()}scheduleRefresh(){this.scanDebounceTimer!==null&&clearTimeout(this.scanDebounceTimer),this.scanDebounceTimer=setTimeout(()=>{this.scanDebounceTimer=null,this.scanVault()},Pne)}scanVault(){this.rules.clear(),this.classHierarchy.clear();let e=new Map,t=[];for(let r of this.vault.listFrontmatter()){let i=this.cleanClassValue(r.exo__Instance_class);i===Tne||i===Ane?this.collectDisplayNameSpec(r,e):(i===Ine||i===xne||i===Rne||i===Cne)&&this.collectDisplayNamePart(r,t);let s=this.cleanClassValue(r.exo__Class_superClass);if(s&&i){let o=this.cleanClassValue(r.exo__Asset_label)||i,l=this.classHierarchy.get(o);l?l.push(s):this.classHierarchy.set(o,[s])}}this.compileDisplayNameSpecs(e,t)}collectDisplayNameSpec(e,t){let r=typeof e.exo__Asset_uid=="string"?e.exo__Asset_uid.trim():"";if(!r)return;let i=this.resolveIdentityForms(e.exo__DisplayNameSpec_appliesToClass);if(i.length===0)return;let s=e.exo__DisplayNameSpec_priority,o=typeof s=="number"?s:typeof s=="string"&&s.trim()!==""?Number(s):0,l=this.resolvePropertyKey(e.exo__DisplayNameSpec_matchPath),c=this.resolveMatchValues(e.exo__DisplayNameSpec_matchValue),u=l!==null&&c.length>0,f=this.resolveHostFunctionName(e.exo__DisplayNameSpec_matchHostFunction),d=e.exo__DisplayNameSpec_separator,p=typeof d=="string"&&d!==""?d:void 0;t.set(r,{uid:r,classKeys:i,priority:Number.isFinite(o)?o:0,...u?{matchKey:l??void 0,matchValues:c}:{},...f?{hostFunction:f}:{},...p?{separator:p}:{}})}collectDisplayNamePart(e,t){let r=this.cleanClassValue(e.exo__DisplayNamePart_of);if(!r)return;let i=e.exo__DisplayNamePart_order,s=typeof i=="number"?i:typeof i=="string"&&i.trim()!==""?Number(i):NaN;if(!Number.isFinite(s))return;let o=this.resolvePropertyKeyList(e.exo__PrintedProperty_property),l=e.exo__PrintedLiteral_literal,c=typeof l=="string"?l:void 0,u=e.exo__PrintedProperty_format,f=typeof u=="string"&&u.trim()!==""?u.trim():void 0;o?t.push({specUid:r,order:s,propertyKey:o,...f?{format:f}:{}}):c!==void 0&&t.push({specUid:r,order:s,literal:c})}compileDisplayNameSpecs(e,t){let r=new Map;for(let i of t){let s=r.get(i.specUid);s?s.push(i):r.set(i.specUid,[i])}for(let i of e.values()){let s=(r.get(i.uid)??[]).slice().sort((u,f)=>u.order-f.order);if(s.length===0)continue;let o=s.map(u=>u.propertyKey?u.format?`{{${u.propertyKey}::${u.format}}}`:`{{${u.propertyKey}}}`:u.literal??"").join(i.separator??"");if(!o.trim())continue;let l=One+i.priority,c;i.matchKey&&i.matchValues&&i.matchValues.length>0?c={kind:"value",matchKey:i.matchKey,matchValues:i.matchValues}:i.hostFunction&&(c={kind:"hostFunction",hostFunction:i.hostFunction});for(let u of i.classKeys){if(!u)continue;let f={className:u,template:o,priority:l,sourceFile:i.uid,...c?{matcher:c}:{},...i.separator?{separator:i.separator}:{}},d=this.rules.get(u);d?(d.push(f),d.sort((p,h)=>h.priority-p.priority)):this.rules.set(u,[f])}}}resolvePropertyKey(e){return Array.isArray(e)?e.length===0?null:this.resolveSinglePropertyKey(e[0]):this.resolveSinglePropertyKey(e)}resolvePropertyKeyList(e){if(Array.isArray(e)&&e.length>1){let t=e.map(r=>this.resolveSinglePropertyKey(r)).filter(r=>r!==null&&r.length>0);return t.length>0?t.join("|"):null}return this.resolvePropertyKey(e)}resolveSinglePropertyKey(e){if(typeof e!="string")return null;let t=e.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim();if(!t)return null;if(t.includes("|"))return t.split("|").pop()?.trim()||null;let r=t.replace(/\.md$/,"").trim();if(!r)return null;let i=this.vault.resolveLinkpathFrontmatter(r);if(i){let s=i.exo__Asset_label;if(typeof s=="string"&&s.trim())return s.trim()}return r}extractClassKeys(e){let t=e;if(Array.isArray(t)){if(t.length===0)return[];t=t[0]}if(typeof t!="string")return[];let r=t.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim();if(!r)return[];if(r.includes("|")){let[i,s]=r.split("|");return[i.trim().replace(/\.md$/,""),s.trim()].filter(o=>!!o)}return[r.replace(/\.md$/,"")]}getAncestorClasses(e){let t=[],r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(!s||r.has(s))continue;r.add(s);let o=this.classHierarchy.get(s);if(o)for(let l of o)r.has(l)||(t.push(l),i.push(l))}return t}cleanClassValue(e){if(!e)return null;if(Array.isArray(e))return e.length===0?null:this.cleanClassValue(e[0]);if(typeof e!="string")return null;let t=e.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim();return t.includes("|")&&(t=(t.split("|").pop()??t).trim()),t||null}getRulesCount(){let e=0;for(let t of this.rules.values())e+=t.length;return e}};C_.PrintNameRuleService=gI});var yI=v(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.DEFAULT_DISPLAY_NAME_TEMPLATE=Zo.DISPLAY_NAME_PRESETS=Zo.DisplayNameTemplateEngine=void 0;var Dne=Bp(),lf=class n{static{a(this,"DisplayNameTemplateEngine")}constructor(e,t={}){this.template=e,this.options=t}render(e,t,r,i){if(!this.template||this.template.trim()==="")return null;let s=this.options.separator;if(s)return this.renderWithSeparator(s,e,t,r,i);let o=this.renderSegment(this.template,e,t,r,i),l=this.cleanupResult(o);return l===""?null:l}renderSegment(e,t,r,i,s){return e.replace(n.PLACEHOLDER_PATTERN,(o,l)=>{let c=l.trim();return this.resolveValue(c,t,r,i,s)})}renderWithSeparator(e,t,r,i,s){let o=this.template.indexOf("{{"),l=this.template.lastIndexOf("}}");if(o===-1||l===-1||l<o){let y=this.cleanupResult(this.renderSegment(this.template,t,r,i,s));return y===""?null:y}let c=this.template.slice(0,o),u=this.template.slice(o,l+2),f=this.template.slice(l+2),d=[];for(let y of n.splitOutsidePlaceholders(u,e)){let b=this.cleanupResult(this.renderSegment(y,t,r,i,s));b!==""&&d.push(b)}if(d.length===0)return null;let p=this.renderSegment(c,t,r,i,s),h=this.renderSegment(f,t,r,i,s),_=`${p}${d.join(e)}${h}`.trim();return _===""?null:_}static splitOutsidePlaceholders(e,t){if(t.length===0)return[e];let r=[],i="",s=0;for(;s<e.length;){if(e.startsWith("{{",s)){let o=e.indexOf("}}",s+2);if(o!==-1){i+=e.slice(s,o+2),s=o+2;continue}}if(e.startsWith(t,s)){r.push(i),i="",s+=t.length;continue}i+=e[s],s+=1}return r.push(i),r}cleanupResult(e){let t=e;return t=t.replace(/\s+\(\s*\)$/g,""),t=t.replace(/^\(\s*\)\s+/g,""),t==="()"&&(t=""),t=t.replace(/\s+\[\s*\]$/g,""),t=t.replace(/^\[\s*\]\s+/g,""),t==="[]"&&(t=""),t=t.replace(/\s+/g," "),t.trim()}resolveValue(e,t,r,i,s){if(e==="_basename")return r;if(e==="_created")return i?this.formatDate(i):"";let{path:o,format:l}=n.splitKeyAndFormat(e),c=o.includes("|")?o.split("|").map(f=>f.trim()).filter(f=>f.length>0):[o],u="";for(let f of c){let d=this.getNestedValue(t,f,s),p;if(l){let h=n.applyValueFormat(d,l);p=h!==null?h:this.formatValue(d,s)}else p=this.formatValue(d,s);if(p!=="")return p;u=p}return u}static splitKeyAndFormat(e){let t=e.indexOf("::");if(t<=0)return{path:e};let r=e.slice(0,t).trim(),i=e.slice(t+2).trim();return!r||!i?{path:e}:{path:r,format:i}}static applyValueFormat(e,t){let r=e;if(Array.isArray(r)){if(r.length===0)return null;r=r[0]}let i,s,o,l,c,u;if(r instanceof Date){if(Number.isNaN(r.getTime()))return null;let p=a(h=>String(h).padStart(2,"0"),"pad");i=String(r.getUTCFullYear()).padStart(4,"0"),s=p(r.getUTCMonth()+1),o=p(r.getUTCDate()),l=p(r.getUTCHours()),c=p(r.getUTCMinutes()),u=p(r.getUTCSeconds())}else if(typeof r=="string"){let p=/^\s*(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/.exec(r);if(!p)return null;i=p[1],s=p[2],o=p[3],l=p[4],c=p[5],u=p[6]}else return null;let f=!1,d=t.replace(/YYYY|YY|MM|DD|HH|mm|ss/g,p=>{switch(p){case"YYYY":return i;case"YY":return i.slice(-2);case"MM":return s;case"DD":return o;case"HH":return l===void 0&&(f=!0),l??"";case"mm":return c===void 0&&(f=!0),c??"";case"ss":return u===void 0&&(f=!0),u??"";default:return p}});return f?null:d}getNestedValue(e,t,r){return(0,Dne.resolveKeyPath)(e,t,r)}formatWikilinkValue(e,t){let r=e.match(/^\[\[([^\]|]+?)(?:\|([^\]]+))?\]\]$/);if(!r)return e.replace(n.WIKILINK_PATTERN,"").trim();let i=r[1].trim(),s=r[2]?.trim();if(s)return s;if(t){let o=t(e);if(o){let l=o.exo__Asset_label;if(typeof l=="string"&&l.trim())return l.trim()}}return i}formatValue(e,t){if(e==null)return"";if(typeof e=="string")return this.formatWikilinkValue(e,t);if(Array.isArray(e)){if(e.length===0)return"";if(this.options.joinArrayValues){let r=[];for(let i of e){let s=this.formatValue(i,t);s&&!n.UUID_PATTERN.test(s)&&r.push(s)}return r.join(" ")}return this.formatValue(e[0],t)}return typeof e=="object"?JSON.stringify(e):String(e)}formatDate(e){let t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${i}`}getTemplate(){return this.template}isValid(){return!this.template||this.template.trim()===""?!1:/\{\{[^}]+\}\}/.test(this.template)}getPlaceholders(){let e=[],t=/\{\{([^}]+)\}\}/g,r;for(;(r=t.exec(this.template))!==null;)e.push(r[1].trim());return e}};Zo.DisplayNameTemplateEngine=lf;lf.PLACEHOLDER_PATTERN=/\{\{([^}]+)\}\}/g;lf.WIKILINK_PATTERN=/^\[\[|\]\]$/g;lf.UUID_PATTERN=/^[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}$/;Zo.DISPLAY_NAME_PRESETS={default:{name:"Label only (default)",template:"{{exo__Asset_label}}"},labelWithStatus:{name:"Label with status",template:"{{exo__Asset_label}}: {{ems__Effort_status}}"},classPrefix:{name:"Class prefix",template:"[{{exo__Instance_class}}] {{exo__Asset_label}}"},classSuffix:{name:"Class suffix",template:"{{exo__Asset_label}} ({{exo__Instance_class}})"},basenameWithLabel:{name:"Filename with label",template:"{{_basename}} - {{exo__Asset_label}}"},datePrefix:{name:"Date prefix",template:"{{_created}} - {{exo__Asset_label}}"}};Zo.DEFAULT_DISPLAY_NAME_TEMPLATE=Zo.DISPLAY_NAME_PRESETS.classSuffix.template});var SM=v(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.DisplayNameResolver=void 0;Vp.createDefaultResolver=Mne;var Fne=yI(),Lne=Bp(),Nne=hI(),kne=new Set(["8619c4fc-64f1-4869-b17e-e34186cacca9","exo__Class","38277bfa-d7f9-4a75-b856-b23276ab0db3","exo__Property","9a1cf31c-9d41-4ef3-9023-584a8d087d16","exo__ObjectProperty","ae56ca4c-b610-42a4-a25d-058c23673296","exo__DatatypeProperty","84756998-3b4e-4989-91cc-a5d5c23664d4","exo__URLProperty"]),O_=class{static{a(this,"DisplayNameResolver")}constructor(e,t,r){this.settings=e,this.ruleService=t,this.metadataResolver=r}resolve(e){return this.resolveWithProvenance(e).displayName}resolveWithProvenance(e){let{metadata:t,basename:r,createdDate:i}=e,s=this.extractAssetClasses(t),o=this.computeTBoxNamingProjection(s,t);if(o!==null)return{displayName:o,provenance:"tboxProjection"};let{template:l,separator:c,provenance:u}=this.resolveRenderSpec(s,t);return{displayName:new Fne.DisplayNameTemplateEngine(l,c?{separator:c}:{}).render(t,r,i,this.metadataResolver??void 0),provenance:u}}getTemplateForClasses(e,t){return this.resolveRenderSpec(e,t).template}resolveRenderSpec(e,t){if(this.ruleService&&e.length>0){let s=[],o=new Set;for(let l of e)for(let c of this.ruleService.getParticipatingRules(l,t))o.has(c.sourceFile)||(o.add(c.sourceFile),s.push(c));if(s.length>0)return s.sort((l,c)=>c.priority-l.priority||l.sourceFile.localeCompare(c.sourceFile)),s.length===1?{template:s[0].template,...s[0].separator?{separator:s[0].separator}:{},provenance:"spec"}:{...this.composeTemplates(s),provenance:"spec"}}let r=e[0],i=r?(0,Lne.ownProperty)(this.settings.classTemplates,r):void 0;return typeof i=="string"&&i?{template:i,provenance:"classTemplate"}:{template:this.settings.defaultTemplate,provenance:"default"}}composeTemplates(e){let t=new Set,r=new Set,i=[],s=[],o=null,l,c=a((p,h,_)=>{for(let y of p.trim().split(/\s+/))!y||h.has(y)||(h.add(y),_.push(y))},"collect");for(let p of e){let{prefix:h,core:_,suffix:y}=this.splitTemplate(p.template);o===null&&_!==""&&(o=_,l=p.separator),c(h,t,i),c(y,r,s)}let u=o??"",f=i.map(p=>`${p} `).join(""),d=s.length?` ${s.join(" ")}`:"";return{template:`${f}${u}${d}`,...l?{separator:l}:{}}}splitTemplate(e){let t=e.indexOf("{{"),r=e.lastIndexOf("}}");return t===-1||r===-1||r<t?{prefix:e,core:"",suffix:""}:{prefix:e.slice(0,t),core:e.slice(t,r+2),suffix:e.slice(r+2)}}getTemplateForClass(e,t){return this.getTemplateForClasses(e?[e]:[],t)}extractAssetClasses(e){let t=e.exo__Instance_class;if(!t)return[];let r=Array.isArray(t)?t:[t],i=[],s=new Set;for(let o of r){let l=this.cleanClassValue(o);l&&!s.has(l)&&(s.add(l),i.push(l))}return i}cleanClassValue(e){if(typeof e!="string")return null;let t=e.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim();return t.includes("|")&&(t=(t.split("|").pop()??t).trim()),t||null}computeTBoxNamingProjection(e,t){if(this.settings.projectTBoxNames===!1||!this.isTBoxNamingEntity(e))return null;if(this.ruleService){for(let u of e)if(this.ruleService.getParticipatingRules(u,t).length>0)return null}let r=typeof t.exo__Asset_label=="string"?t.exo__Asset_label.trim():"",[i,s]=this.splitPrefixedLabel(r),l=(typeof t.exo__Slugable_slug=="string"?t.exo__Slugable_slug.trim():"")||s;if(!l)return null;let c=this.resolveOntologyShortName(t)??i;return c?`${c}#${l}`:l}isTBoxNamingEntity(e){return e.some(t=>kne.has(t))}resolveOntologyShortName(e){if(!this.metadataResolver)return null;let t=this.firstString(e.exo__Asset_isDefinedBy);if(!t)return null;let i=this.metadataResolver(t)?.exo__Ontology_shortName;return typeof i=="string"&&i.trim()?i.trim():null}splitPrefixedLabel(e){let t=e.indexOf("__");if(t<=0)return[null,null];let r=e.slice(0,t),i=e.slice(t+2);return i?[r,i]:[null,null]}firstString(e){let t=e;if(Array.isArray(t)){if(t.length===0)return null;t=t[0]}return typeof t!="string"?null:t.trim()||null}configuredClassEntries(){return Object.entries(this.settings.classTemplates).filter(e=>typeof e[1]=="string"&&e[1].length>0)}getConfiguredClasses(){return this.configuredClassEntries().map(([e])=>e)}hasClassTemplates(){return this.configuredClassEntries().length>0}};Vp.DisplayNameResolver=O_;async function Mne(){return new O_(Nne.DEFAULT_DISPLAY_NAME_SETTINGS)}a(Mne,"createDefaultResolver")});var xM=v(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.isEffortBlocked=vM;cf.localToday=AM;cf.isEpisodeOngoing=IM;cf.createDisplayMatcherHostFunctions=Vne;var wM=Il(),jne=10,$ne=/^\d{4}-\d{2}-\d{2}$/;function vM(n,e){let t=e.ems__Effort_blocker;if(!t)return!1;let r=TM(String(t)).split("|")[0].trim();if(!r)return!1;let i=n.resolveLinkpathFrontmatter(r);if(!i)return!1;let s=Bne(n,i.ems__Effort_status);return s!==wM.EffortStatus.DONE&&s!==wM.EffortStatus.TRASHED}a(vM,"isEffortBlocked");function TM(n){return n.trim().replace(/^["']/,"").replace(/["']$/,"").replace(/^\[\[/,"").replace(/\]\]$/,"").replace(/\.md$/,"").trim()}a(TM,"unwrapWikilink");var _I=/^ems__EffortStatus[A-Za-z]+$/,Une=/\s+[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Bne(n,e){let t=e;if(t==null)return"";if(Array.isArray(t)){if(t.length!==1)return"";t=t[0]}let r=TM(String(t));if(r==="")return"";if(_I.test(r))return r;let i=r.indexOf("|"),s=i===-1?r:r.slice(0,i).trim();if(i!==-1){let u=r.slice(i+1).trim();if(_I.test(u))return u}let o=s.replace(Une,"").trim();if(_I.test(o))return o;let c=n.resolveLinkpathFrontmatter(s)?.exo__Asset_label;return Array.isArray(c)&&(c=c[0]),typeof c=="string"&&c.trim()?c.trim():s}a(Bne,"resolveStatusLabel");function AM(n=new Date){let e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${r}`}a(AM,"localToday");function EM(n){let e=n;if(Array.isArray(e)){if(e.length===0)return null;e=e[0]}if(e instanceof Date){if(Number.isNaN(e.getTime()))return null;let c=a(u=>String(u).padStart(2,"0"),"pad");return`${String(e.getUTCFullYear()).padStart(4,"0")}-${c(e.getUTCMonth()+1)}-${c(e.getUTCDate())}`}if(typeof e!="string")return null;let r=e.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim().slice(0,jne);if(!$ne.test(r))return null;let[i,s,o]=r.split("-").map(Number),l=new Date(Date.UTC(i,s-1,o));return l.getUTCFullYear()!==i||l.getUTCMonth()!==s-1||l.getUTCDate()!==o?null:r}a(EM,"toDayKey");function IM(n,e=new Date){let t=EM(n.life__Episode_start);if(t===null)return!1;let r=AM(e);if(t>r)return!1;let i=n.life__Episode_end;if(i==null||Array.isArray(i)&&i.length===0||String(i).trim()==="")return!0;let o=EM(i);return o===null?!1:o>=r}a(IM,"isEpisodeOngoing");function Vne(n){return{isEffortBlocked:a((e,t)=>vM(n,t),"isEffortBlocked"),isEpisodeOngoing:a((e,t)=>IM(t),"isEpisodeOngoing")}}a(Vne,"createDisplayMatcherHostFunctions")});var Xe=v(g=>{"use strict";var qne=g&&g.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=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(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),ai=g&&g.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&qne(e,n,t)};Object.defineProperty(g,"__esModule",{value:!0});g.CommandResolver=g.extractPropertyLabel=g.uriToPropertyName=g.propertyNameToUri=g.rangeToFieldType=g.PropertyFieldType=g.ParkedAssetIndex=g.resolveDependencyKind=g.parkedPathFor=g.classifyMountTransition=g.PARKED_ROOT=g.DEPENDENCY_KIND_REFERENCE_UID=g.DEPENDENCY_KIND_TBOX_UID=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.TypeRegistry=g.GraphQueryService=g.FixMissingLabelService=g.ArchiveAssetService=g.GenericAssetCreationService=g.EnumValueResolver=g.ClassHierarchyResolver=g.PropertySchemaResolver=g.orderProperties=g.loadDefaultSpec=g.clearOrderSpecLoader=g.registerOrderSpecLoader=g.StatusTimestampService=g.RenameToUidService=g.PropertyCleanupService=g.LoggingService=g.extractAssetReference=g.FolderRepairService=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.TaskStatusService=g.createTripleStoreRequiredPropertyResolver=g.CommandExecutionFlow=g.stripFrontmatter=g.extractSparqlBlock=g.iriToObsidianName=g.NamedQueryRunner=g.createVaultFrontmatterRefToFrontmatterResolver=g.createVaultFrontmatterRefToFolderResolver=g.createVaultFrontmatterClassLabelResolver=g.ServiceRegistry=g.GroundingExecutor=g.registerDefaultHostFunctions=g.hasUidFilename=g.hasNonUidFilename=g.PreconditionEvaluator=void 0;g.AlgebraTranslator=g.ExoQLAlgebraTranslator=g.DescribeOptionsTransformerError=g.DescribeOptionsTransformer=g.SPARQLParseError=g.SPARQLParser=g.ExoQLParser=g.canonicalYamlKey=g.UNPREFIXED_ASSET_FIELDS=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.STRING_SCALAR_PROPERTIES=g.serializeYamlScalar=g.FrontmatterService=g.SPARQL_PREFIXES=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.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.checkParkedStaleness=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.isWikilink=g.resolveKeyPath=g.DEFAULT_DISPLAY_NAME_TEMPLATE=g.DISPLAY_NAME_PRESETS=g.DisplayNameTemplateEngine=g.createDefaultResolver=g.DisplayNameResolver=g.PrintNameRuleService=g.DEFAULT_DISPLAY_NAME_SETTINGS=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.enrichRateLimitError=g.attachRateLimitFields=g.getRateLimitFields=g.extractRateLimitFields=g.parseRetryAfterMs=g.caseInsensitiveHeaderGetter=g.DEFAULT_MAX_RETRIES=g.MIN_RATE_LIMIT_WAIT_MS=g.createRateLimitBudget=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=g.StructuredMerger=void 0;g.createDisplayMatcherHostFunctions=g.localToday=g.isEpisodeOngoing=g.isEffortBlocked=void 0;ai(Al(),g);ai(Il(),g);var Gne=iw();Object.defineProperty(g,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return Gne.EFFORT_STATUS_OPTIONS},"get")});var Wne=Sa();Object.defineProperty(g,"GroundingType",{enumerable:!0,get:a(function(){return Wne.GroundingType},"get")});var qp=pd();Object.defineProperty(g,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return qp.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(g,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return qp.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(g,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return qp.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(g,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return qp.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(g,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return qp.resolveGroundingTypeFromWikilinkLiteral},"get")});var Gp=sw();Object.defineProperty(g,"CommandProperty",{enumerable:!0,get:a(function(){return Gp.CommandProperty},"get")});Object.defineProperty(g,"PreconditionProperty",{enumerable:!0,get:a(function(){return Gp.PreconditionProperty},"get")});Object.defineProperty(g,"GroundingProperty",{enumerable:!0,get:a(function(){return Gp.GroundingProperty},"get")});Object.defineProperty(g,"CommandBindingProperty",{enumerable:!0,get:a(function(){return Gp.CommandBindingProperty},"get")});Object.defineProperty(g,"CommandBindingStyleProperty",{enumerable:!0,get:a(function(){return Gp.CommandBindingStyleProperty},"get")});var uf=ow();Object.defineProperty(g,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:a(function(){return uf.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(g,"LABEL_CLASS_VALUES",{enumerable:!0,get:a(function(){return uf.LABEL_CLASS_VALUES},"get")});Object.defineProperty(g,"STYLE_SOURCE_VALUES",{enumerable:!0,get:a(function(){return uf.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(g,"isCommandVariant",{enumerable:!0,get:a(function(){return uf.isCommandVariant},"get")});Object.defineProperty(g,"isLabelClass",{enumerable:!0,get:a(function(){return uf.isLabelClass},"get")});Object.defineProperty(g,"isStyleSource",{enumerable:!0,get:a(function(){return uf.isStyleSource},"get")});var P_=pO();Object.defineProperty(g,"isCommandFrontmatter",{enumerable:!0,get:a(function(){return P_.isCommandFrontmatter},"get")});Object.defineProperty(g,"isPreconditionFrontmatter",{enumerable:!0,get:a(function(){return P_.isPreconditionFrontmatter},"get")});Object.defineProperty(g,"isGroundingFrontmatter",{enumerable:!0,get:a(function(){return P_.isGroundingFrontmatter},"get")});Object.defineProperty(g,"isCommandBindingFrontmatter",{enumerable:!0,get:a(function(){return P_.isCommandBindingFrontmatter},"get")});var Hne=hO();Object.defineProperty(g,"parseGroundingDefinitionFromFrontmatter",{enumerable:!0,get:a(function(){return Hne.parseGroundingDefinitionFromFrontmatter},"get")});ai(mO(),g);ai(gO(),g);ai(lw(),g);ai(cw(),g);ai(_O(),g);ai(wO(),g);ai(Gw(),g);ai(eP(),g);var gi=tP();Object.defineProperty(g,"TS_FLOOR_AS_UID_EXO",{enumerable:!0,get:a(function(){return gi.TS_FLOOR_AS_UID_EXO},"get")});Object.defineProperty(g,"TS_FLOOR_AS_UID_EXOCMD",{enumerable:!0,get:a(function(){return gi.TS_FLOOR_AS_UID_EXOCMD},"get")});Object.defineProperty(g,"TS_FLOOR_AS_UID_SHARED_IDENTITIES",{enumerable:!0,get:a(function(){return gi.TS_FLOOR_AS_UID_SHARED_IDENTITIES},"get")});Object.defineProperty(g,"SDK_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return gi.SDK_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(g,"PLUGIN_UI_FLOOR_ASSETSPACE_UIDS",{enumerable:!0,get:a(function(){return gi.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS},"get")});Object.defineProperty(g,"SDK_FLOOR",{enumerable:!0,get:a(function(){return gi.SDK_FLOOR},"get")});Object.defineProperty(g,"PLUGIN_UI_FLOOR",{enumerable:!0,get:a(function(){return gi.PLUGIN_UI_FLOOR},"get")});Object.defineProperty(g,"CATALOG_KEEP_NAMESPACES",{enumerable:!0,get:a(function(){return gi.CATALOG_KEEP_NAMESPACES},"get")});Object.defineProperty(g,"TsFloorViolationError",{enumerable:!0,get:a(function(){return gi.TsFloorViolationError},"get")});Object.defineProperty(g,"assertTsFloor",{enumerable:!0,get:a(function(){return gi.assertTsFloor},"get")});Object.defineProperty(g,"assertTsFloorReconciled",{enumerable:!0,get:a(function(){return gi.assertTsFloorReconciled},"get")});Object.defineProperty(g,"isTsFloorAssetSpace",{enumerable:!0,get:a(function(){return gi.isTsFloorAssetSpace},"get")});Object.defineProperty(g,"isTsFloorMountPath",{enumerable:!0,get:a(function(){return gi.isTsFloorMountPath},"get")});var zne=rP();Object.defineProperty(g,"transitiveDependsOnClosure",{enumerable:!0,get:a(function(){return zne.transitiveDependsOnClosure},"get")});var ff=zw();Object.defineProperty(g,"DEPENDENCY_KIND_TBOX_UID",{enumerable:!0,get:a(function(){return ff.DEPENDENCY_KIND_TBOX_UID},"get")});Object.defineProperty(g,"DEPENDENCY_KIND_REFERENCE_UID",{enumerable:!0,get:a(function(){return ff.DEPENDENCY_KIND_REFERENCE_UID},"get")});Object.defineProperty(g,"PARKED_ROOT",{enumerable:!0,get:a(function(){return ff.PARKED_ROOT},"get")});Object.defineProperty(g,"classifyMountTransition",{enumerable:!0,get:a(function(){return ff.classifyMountTransition},"get")});Object.defineProperty(g,"parkedPathFor",{enumerable:!0,get:a(function(){return ff.parkedPathFor},"get")});Object.defineProperty(g,"resolveDependencyKind",{enumerable:!0,get:a(function(){return ff.resolveDependencyKind},"get")});var Kne=aP();Object.defineProperty(g,"ParkedAssetIndex",{enumerable:!0,get:a(function(){return Kne.ParkedAssetIndex},"get")});var RM=Gm();Object.defineProperty(g,"PropertyFieldType",{enumerable:!0,get:a(function(){return RM.PropertyFieldType},"get")});Object.defineProperty(g,"rangeToFieldType",{enumerable:!0,get:a(function(){return RM.rangeToFieldType},"get")});var bI=Xw();Object.defineProperty(g,"propertyNameToUri",{enumerable:!0,get:a(function(){return bI.propertyNameToUri},"get")});Object.defineProperty(g,"uriToPropertyName",{enumerable:!0,get:a(function(){return bI.uriToPropertyName},"get")});Object.defineProperty(g,"extractPropertyLabel",{enumerable:!0,get:a(function(){return bI.extractPropertyLabel},"get")});var Yne=Z3();Object.defineProperty(g,"CommandResolver",{enumerable:!0,get:a(function(){return Yne.CommandResolver},"get")});var Qne=tD();Object.defineProperty(g,"PreconditionEvaluator",{enumerable:!0,get:a(function(){return Qne.PreconditionEvaluator},"get")});var SI=rD();Object.defineProperty(g,"hasNonUidFilename",{enumerable:!0,get:a(function(){return SI.hasNonUidFilename},"get")});Object.defineProperty(g,"hasUidFilename",{enumerable:!0,get:a(function(){return SI.hasUidFilename},"get")});Object.defineProperty(g,"registerDefaultHostFunctions",{enumerable:!0,get:a(function(){return SI.registerDefaultHostFunctions},"get")});var CM=AD();Object.defineProperty(g,"GroundingExecutor",{enumerable:!0,get:a(function(){return CM.GroundingExecutor},"get")});Object.defineProperty(g,"ServiceRegistry",{enumerable:!0,get:a(function(){return CM.ServiceRegistry},"get")});var Xne=ID();Object.defineProperty(g,"createVaultFrontmatterClassLabelResolver",{enumerable:!0,get:a(function(){return Xne.createVaultFrontmatterClassLabelResolver},"get")});var Jne=xD();Object.defineProperty(g,"createVaultFrontmatterRefToFolderResolver",{enumerable:!0,get:a(function(){return Jne.createVaultFrontmatterRefToFolderResolver},"get")});var Zne=RD();Object.defineProperty(g,"createVaultFrontmatterRefToFrontmatterResolver",{enumerable:!0,get:a(function(){return Zne.createVaultFrontmatterRefToFrontmatterResolver},"get")});var eie=OD();Object.defineProperty(g,"NamedQueryRunner",{enumerable:!0,get:a(function(){return eie.NamedQueryRunner},"get")});var tie=Ld();Object.defineProperty(g,"iriToObsidianName",{enumerable:!0,get:a(function(){return tie.iriToObsidianName},"get")});var OM=PD();Object.defineProperty(g,"extractSparqlBlock",{enumerable:!0,get:a(function(){return OM.extractSparqlBlock},"get")});Object.defineProperty(g,"stripFrontmatter",{enumerable:!0,get:a(function(){return OM.stripFrontmatter},"get")});var rie=FD();Object.defineProperty(g,"CommandExecutionFlow",{enumerable:!0,get:a(function(){return rie.CommandExecutionFlow},"get")});var nie=kD();Object.defineProperty(g,"createTripleStoreRequiredPropertyResolver",{enumerable:!0,get:a(function(){return nie.createTripleStoreRequiredPropertyResolver},"get")});var iie=jv();Object.defineProperty(g,"TaskStatusService",{enumerable:!0,get:a(function(){return iie.TaskStatusService},"get")});var sie=Uv();Object.defineProperty(g,"AreaHierarchyBuilder",{enumerable:!0,get:a(function(){return sie.AreaHierarchyBuilder},"get")});var oie=Hv();Object.defineProperty(g,"ClassCreationService",{enumerable:!0,get:a(function(){return oie.ClassCreationService},"get")});var aie=Kv();Object.defineProperty(g,"ConceptCreationService",{enumerable:!0,get:a(function(){return aie.ConceptCreationService},"get")});var lie=Yy();Object.defineProperty(g,"EffortStatusWorkflow",{enumerable:!0,get:a(function(){return lie.EffortStatusWorkflow},"get")});var cie=rp();Object.defineProperty(g,"WorkflowEngine",{enumerable:!0,get:a(function(){return cie.WorkflowEngine},"get")});var uie=Iv();Object.defineProperty(g,"WorkflowResolver",{enumerable:!0,get:a(function(){return uie.WorkflowResolver},"get")});var Wp=vy();Object.defineProperty(g,"installDefaultResolvers",{enumerable:!0,get:a(function(){return Wp.installDefaultResolvers},"get")});Object.defineProperty(g,"getResolver",{enumerable:!0,get:a(function(){return Wp.getResolver},"get")});Object.defineProperty(g,"registerResolver",{enumerable:!0,get:a(function(){return Wp.registerResolver},"get")});Object.defineProperty(g,"clearResolvers",{enumerable:!0,get:a(function(){return Wp.clearResolvers},"get")});Object.defineProperty(g,"getRegisteredResolverIds",{enumerable:!0,get:a(function(){return Wp.getRegisteredResolverIds},"get")});var PM=rv();Object.defineProperty(g,"resolveTemplateBody",{enumerable:!0,get:a(function(){return PM.resolveTemplateBody},"get")});Object.defineProperty(g,"stripTemplateFrontmatter",{enumerable:!0,get:a(function(){return PM.stripTemplateFrontmatter},"get")});var fie=QD();Object.defineProperty(g,"InstantiationRuleResolver",{enumerable:!0,get:a(function(){return fie.InstantiationRuleResolver},"get")});var die=XD();Object.defineProperty(g,"VisibilityGenerator",{enumerable:!0,get:a(function(){return die.VisibilityGenerator},"get")});var pie=JD();Object.defineProperty(g,"WorkflowCommandAdapter",{enumerable:!0,get:a(function(){return pie.WorkflowCommandAdapter},"get")});var hie=Jy();Object.defineProperty(g,"FolderRepairService",{enumerable:!0,get:a(function(){return hie.FolderRepairService},"get")});var mie=Ou();Object.defineProperty(g,"extractAssetReference",{enumerable:!0,get:a(function(){return mie.extractAssetReference},"get")});var gie=Xl();Object.defineProperty(g,"LoggingService",{enumerable:!0,get:a(function(){return gie.LoggingService},"get")});var yie=rT();Object.defineProperty(g,"PropertyCleanupService",{enumerable:!0,get:a(function(){return yie.PropertyCleanupService},"get")});var _ie=iT();Object.defineProperty(g,"RenameToUidService",{enumerable:!0,get:a(function(){return _ie.RenameToUidService},"get")});var bie=Qy();Object.defineProperty(g,"StatusTimestampService",{enumerable:!0,get:a(function(){return bie.StatusTimestampService},"get")});var D_=xy();Object.defineProperty(g,"registerOrderSpecLoader",{enumerable:!0,get:a(function(){return D_.registerOrderSpecLoader},"get")});Object.defineProperty(g,"clearOrderSpecLoader",{enumerable:!0,get:a(function(){return D_.clearOrderSpecLoader},"get")});Object.defineProperty(g,"loadDefaultSpec",{enumerable:!0,get:a(function(){return D_.loadDefaultSpec},"get")});Object.defineProperty(g,"orderProperties",{enumerable:!0,get:a(function(){return D_.orderProperties},"get")});var Sie=nF();Object.defineProperty(g,"PropertySchemaResolver",{enumerable:!0,get:a(function(){return Sie.PropertySchemaResolver},"get")});var wie=iF();Object.defineProperty(g,"ClassHierarchyResolver",{enumerable:!0,get:a(function(){return wie.ClassHierarchyResolver},"get")});var Eie=sF();Object.defineProperty(g,"EnumValueResolver",{enumerable:!0,get:a(function(){return Eie.EnumValueResolver},"get")});var vie=cT();Object.defineProperty(g,"GenericAssetCreationService",{enumerable:!0,get:a(function(){return vie.GenericAssetCreationService},"get")});var Tie=lF();Object.defineProperty(g,"ArchiveAssetService",{enumerable:!0,get:a(function(){return Tie.ArchiveAssetService},"get")});var Aie=uF();Object.defineProperty(g,"FixMissingLabelService",{enumerable:!0,get:a(function(){return Aie.FixMissingLabelService},"get")});var Iie=fF();Object.defineProperty(g,"GraphQueryService",{enumerable:!0,get:a(function(){return Iie.GraphQueryService},"get")});var xie=pF();Object.defineProperty(g,"TypeRegistry",{enumerable:!0,get:a(function(){return xie.TypeRegistry},"get")});var Rie=hF();Object.defineProperty(g,"SPARQL_PREFIXES",{enumerable:!0,get:a(function(){return Rie.SPARQL_PREFIXES},"get")});var Cie=Ql();Object.defineProperty(g,"FrontmatterService",{enumerable:!0,get:a(function(){return Cie.FrontmatterService},"get")});var DM=Yd();Object.defineProperty(g,"serializeYamlScalar",{enumerable:!0,get:a(function(){return DM.serializeYamlScalar},"get")});Object.defineProperty(g,"STRING_SCALAR_PROPERTIES",{enumerable:!0,get:a(function(){return DM.STRING_SCALAR_PROPERTIES},"get")});var Oie=NL();Object.defineProperty(g,"parseYamlFrontmatterTolerant",{enumerable:!0,get:a(function(){return Oie.parseYamlFrontmatterTolerant},"get")});var Pie=zi();Object.defineProperty(g,"DateFormatter",{enumerable:!0,get:a(function(){return Pie.DateFormatter},"get")});var Die=Fs();Object.defineProperty(g,"WikiLinkHelpers",{enumerable:!0,get:a(function(){return Die.WikiLinkHelpers},"get")});var Fie=Jl();Object.defineProperty(g,"MetadataHelpers",{enumerable:!0,get:a(function(){return Fie.MetadataHelpers},"get")});var Lie=kL();Object.defineProperty(g,"MetadataExtractor",{enumerable:!0,get:a(function(){return Lie.MetadataExtractor},"get")});var Nie=ML();Object.defineProperty(g,"EffortSortingHelpers",{enumerable:!0,get:a(function(){return Nie.EffortSortingHelpers},"get")});var kie=jL();Object.defineProperty(g,"FilenameValidator",{enumerable:!0,get:a(function(){return kie.FilenameValidator},"get")});var Mie=WL();Object.defineProperty(g,"RDFSerializer",{enumerable:!0,get:a(function(){return Mie.RDFSerializer},"get")});var jie=Fd();Object.defineProperty(g,"NullLogger",{enumerable:!0,get:a(function(){return jie.NullLogger},"get")});var wI=Oy();Object.defineProperty(g,"vaultPathToIRI",{enumerable:!0,get:a(function(){return wI.vaultPathToIRI},"get")});Object.defineProperty(g,"iriToVaultPath",{enumerable:!0,get:a(function(){return wI.iriToVaultPath},"get")});Object.defineProperty(g,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:a(function(){return wI.OBSIDIAN_VAULT_SCHEME},"get")});var $ie=Lv();Object.defineProperty(g,"InMemoryTripleStore",{enumerable:!0,get:a(function(){return $ie.InMemoryTripleStore},"get")});var Uie=ze();Object.defineProperty(g,"DomainIRI",{enumerable:!0,get:a(function(){return Uie.IRI},"get")});var Bie=tt();Object.defineProperty(g,"DomainLiteral",{enumerable:!0,get:a(function(){return Bie.Literal},"get")});var Vie=Yt();Object.defineProperty(g,"DomainBlankNode",{enumerable:!0,get:a(function(){return Vie.BlankNode},"get")});var qie=Qn();Object.defineProperty(g,"DomainTriple",{enumerable:!0,get:a(function(){return qie.Triple},"get")});var Gie=iv();Object.defineProperty(g,"RDFVocabularyMapper",{enumerable:!0,get:a(function(){return Gie.RDFVocabularyMapper},"get")});var Wie=HL();Object.defineProperty(g,"RDFSInferenceEngine",{enumerable:!0,get:a(function(){return Wie.RDFSInferenceEngine},"get")});var Hie=a2();Object.defineProperty(g,"NonInheritablePropertyRegistry",{enumerable:!0,get:a(function(){return Hie.NonInheritablePropertyRegistry},"get")});var zie=u2();Object.defineProperty(g,"PropertyCardinalityRegistry",{enumerable:!0,get:a(function(){return zie.PropertyCardinalityRegistry},"get")});var FM=p2();Object.defineProperty(g,"PrototypeChainMaterializer",{enumerable:!0,get:a(function(){return FM.PrototypeChainMaterializer},"get")});Object.defineProperty(g,"INFERRED_GRAPH",{enumerable:!0,get:a(function(){return FM.INFERRED_GRAPH},"get")});var Kie=ZL();Object.defineProperty(g,"IRICanonicalizer",{enumerable:!0,get:a(function(){return Kie.IRICanonicalizer},"get")});var EI=Dy();Object.defineProperty(g,"derivePath",{enumerable:!0,get:a(function(){return EI.derivePath},"get")});Object.defineProperty(g,"deriveUrl",{enumerable:!0,get:a(function(){return EI.deriveUrl},"get")});Object.defineProperty(g,"deriveLegacyFlatPath",{enumerable:!0,get:a(function(){return EI.deriveLegacyFlatPath},"get")});var vI=Fy();Object.defineProperty(g,"discoverFileSpaceExclusions",{enumerable:!0,get:a(function(){return vI.discoverFileSpaceExclusions},"get")});Object.defineProperty(g,"frontmatterDeclaresFileSpace",{enumerable:!0,get:a(function(){return vI.frontmatterDeclaresFileSpace},"get")});Object.defineProperty(g,"FILE_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return vI.FILE_SPACE_CLASS_UID},"get")});var LM=eN();Object.defineProperty(g,"LazyAssetGraphLoader",{enumerable:!0,get:a(function(){return LM.LazyAssetGraphLoader},"get")});Object.defineProperty(g,"MAX_LAZY_DEPTH",{enumerable:!0,get:a(function(){return LM.MAX_LAZY_DEPTH},"get")});var NM=_2();Object.defineProperty(g,"SourceAnnotator",{enumerable:!0,get:a(function(){return NM.SourceAnnotator},"get")});Object.defineProperty(g,"SOURCE_VARIABLE",{enumerable:!0,get:a(function(){return NM.SOURCE_VARIABLE},"get")});var Hp=Yl();Object.defineProperty(g,"NoteToRDFConverter",{enumerable:!0,get:a(function(){return Hp.NoteToRDFConverter},"get")});Object.defineProperty(g,"normaliseExcludedFolders",{enumerable:!0,get:a(function(){return Hp.normaliseExcludedFolders},"get")});Object.defineProperty(g,"isPathExcluded",{enumerable:!0,get:a(function(){return Hp.isPathExcluded},"get")});Object.defineProperty(g,"UNPREFIXED_ASSET_FIELDS",{enumerable:!0,get:a(function(){return Hp.UNPREFIXED_ASSET_FIELDS},"get")});Object.defineProperty(g,"canonicalYamlKey",{enumerable:!0,get:a(function(){return Hp.canonicalYamlKey},"get")});var TI=Jc();Object.defineProperty(g,"ExoQLParser",{enumerable:!0,get:a(function(){return TI.ExoQLParser},"get")});Object.defineProperty(g,"SPARQLParser",{enumerable:!0,get:a(function(){return TI.SPARQLParser},"get")});Object.defineProperty(g,"SPARQLParseError",{enumerable:!0,get:a(function(){return TI.SPARQLParseError},"get")});var kM=Q1();Object.defineProperty(g,"DescribeOptionsTransformer",{enumerable:!0,get:a(function(){return kM.DescribeOptionsTransformer},"get")});Object.defineProperty(g,"DescribeOptionsTransformerError",{enumerable:!0,get:a(function(){return kM.DescribeOptionsTransformerError},"get")});var MM=nu();Object.defineProperty(g,"ExoQLAlgebraTranslator",{enumerable:!0,get:a(function(){return MM.ExoQLAlgebraTranslator},"get")});Object.defineProperty(g,"AlgebraTranslator",{enumerable:!0,get:a(function(){return MM.AlgebraTranslator},"get")});var Yie=tN();Object.defineProperty(g,"AlgebraOptimizer",{enumerable:!0,get:a(function(){return Yie.AlgebraOptimizer},"get")});var Qie=rN();Object.defineProperty(g,"AlgebraSerializer",{enumerable:!0,get:a(function(){return Qie.AlgebraSerializer},"get")});var Xie=hE();Object.defineProperty(g,"BGPExecutor",{enumerable:!0,get:a(function(){return Xie.BGPExecutor},"get")});var Jie=ry();Object.defineProperty(g,"FilterExecutor",{enumerable:!0,get:a(function(){return Jie.FilterExecutor},"get")});var Zie=FE();Object.defineProperty(g,"OptionalExecutor",{enumerable:!0,get:a(function(){return Zie.OptionalExecutor},"get")});var ese=NE();Object.defineProperty(g,"UnionExecutor",{enumerable:!0,get:a(function(){return ese.UnionExecutor},"get")});var tse=qE();Object.defineProperty(g,"ConstructExecutor",{enumerable:!0,get:a(function(){return tse.ConstructExecutor},"get")});var rse=iN();Object.defineProperty(g,"DescribeExecutor",{enumerable:!0,get:a(function(){return rse.DescribeExecutor},"get")});var jM=Eu();Object.defineProperty(g,"ExoQLQueryExecutor",{enumerable:!0,get:a(function(){return jM.ExoQLQueryExecutor},"get")});Object.defineProperty(g,"QueryExecutor",{enumerable:!0,get:a(function(){return jM.QueryExecutor},"get")});var $M=oN();Object.defineProperty(g,"UpdateExecutor",{enumerable:!0,get:a(function(){return $M.UpdateExecutor},"get")});Object.defineProperty(g,"UpdateExecutorError",{enumerable:!0,get:a(function(){return $M.UpdateExecutorError},"get")});var nse=Ro();Object.defineProperty(g,"SolutionMapping",{enumerable:!0,get:a(function(){return nse.SolutionMapping},"get")});var ise=ty();Object.defineProperty(g,"BuiltInFunctions",{enumerable:!0,get:a(function(){return ise.BuiltInFunctions},"get")});var sse=lN();Object.defineProperty(g,"AggregateFunctions",{enumerable:!0,get:a(function(){return sse.AggregateFunctions},"get")});var UM=Pg();Object.defineProperty(g,"CustomAggregateRegistry",{enumerable:!0,get:a(function(){return UM.CustomAggregateRegistry},"get")});Object.defineProperty(g,"CustomAggregateError",{enumerable:!0,get:a(function(){return UM.CustomAggregateError},"get")});var Zs=Fg();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 ose=cN();Object.defineProperty(g,"QueryPlanCache",{enumerable:!0,get:a(function(){return ose.QueryPlanCache},"get")});var BM=uN();Object.defineProperty(g,"SPARQLResultCache",{enumerable:!0,get:a(function(){return BM.SPARQLResultCache},"get")});Object.defineProperty(g,"createSPARQLResultCache",{enumerable:!0,get:a(function(){return BM.createSPARQLResultCache},"get")});var VM=fN();Object.defineProperty(g,"IncrementalIndexer",{enumerable:!0,get:a(function(){return VM.IncrementalIndexer},"get")});Object.defineProperty(g,"createIncrementalIndexer",{enumerable:!0,get:a(function(){return VM.createIncrementalIndexer},"get")});var ase=dN();Object.defineProperty(g,"ResultSerializer",{enumerable:!0,get:a(function(){return ase.ResultSerializer},"get")});var qM=z1();Object.defineProperty(g,"CaseWhenTransformer",{enumerable:!0,get:a(function(){return qM.CaseWhenTransformer},"get")});Object.defineProperty(g,"CaseWhenTransformerError",{enumerable:!0,get:a(function(){return qM.CaseWhenTransformerError},"get")});var lse=eE();Object.defineProperty(g,"VaultPrefixTransformer",{enumerable:!0,get:a(function(){return lse.VaultPrefixTransformer},"get")});var cse=S2();Object.defineProperty(g,"FilterContainsOptimizer",{enumerable:!0,get:a(function(){return cse.FilterContainsOptimizer},"get")});var GM=pN();Object.defineProperty(g,"FileNotFoundError",{enumerable:!0,get:a(function(){return GM.FileNotFoundError},"get")});Object.defineProperty(g,"FileAlreadyExistsError",{enumerable:!0,get:a(function(){return GM.FileAlreadyExistsError},"get")});var AI=Ov();Object.defineProperty(g,"TripleAlreadyExistsError",{enumerable:!0,get:a(function(){return AI.TripleAlreadyExistsError},"get")});Object.defineProperty(g,"TripleNotFoundError",{enumerable:!0,get:a(function(){return AI.TripleNotFoundError},"get")});Object.defineProperty(g,"TransactionError",{enumerable:!0,get:a(function(){return AI.TransactionError},"get")});var WM=Wd();Object.defineProperty(g,"liveClock",{enumerable:!0,get:a(function(){return WM.liveClock},"get")});Object.defineProperty(g,"frozenClock",{enumerable:!0,get:a(function(){return WM.frozenClock},"get")});var HM=Sy();Object.defineProperty(g,"liveUidGenerator",{enumerable:!0,get:a(function(){return HM.liveUidGenerator},"get")});Object.defineProperty(g,"seededUidGenerator",{enumerable:!0,get:a(function(){return HM.seededUidGenerator},"get")});var F_=F2();Object.defineProperty(g,"VaultSettings",{enumerable:!0,get:a(function(){return F_.VaultSettings},"get")});Object.defineProperty(g,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:a(function(){return F_.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(g,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:a(function(){return F_.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(g,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:a(function(){return F_.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var use=Nn();Object.defineProperty(g,"DI_TOKENS",{enumerable:!0,get:a(function(){return use.DI_TOKENS},"get")});var zp=hN();Object.defineProperty(g,"registerCoreServices",{enumerable:!0,get:a(function(){return zp.registerCoreServices},"get")});Object.defineProperty(g,"createChildContainer",{enumerable:!0,get:a(function(){return zp.createChildContainer},"get")});Object.defineProperty(g,"getContainer",{enumerable:!0,get:a(function(){return zp.getContainer},"get")});Object.defineProperty(g,"resetContainer",{enumerable:!0,get:a(function(){return zp.resetContainer},"get")});Object.defineProperty(g,"container",{enumerable:!0,get:a(function(){return zp.container},"get")});var ea=SN();Object.defineProperty(g,"NODE_FLAGS",{enumerable:!0,get:a(function(){return ea.NODE_FLAGS},"get")});Object.defineProperty(g,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return ea.DEFAULT_COLORS},"get")});Object.defineProperty(g,"StringTable",{enumerable:!0,get:a(function(){return ea.StringTable},"get")});Object.defineProperty(g,"CompactGraphStore",{enumerable:!0,get:a(function(){return ea.CompactGraphStore},"get")});Object.defineProperty(g,"MemoryPool",{enumerable:!0,get:a(function(){return ea.MemoryPool},"get")});Object.defineProperty(g,"getGlobalPool",{enumerable:!0,get:a(function(){return ea.getGlobalPool},"get")});Object.defineProperty(g,"resetGlobalPool",{enumerable:!0,get:a(function(){return ea.resetGlobalPool},"get")});Object.defineProperty(g,"StreamingLoader",{enumerable:!0,get:a(function(){return ea.StreamingLoader},"get")});Object.defineProperty(g,"createStreamingSource",{enumerable:!0,get:a(function(){return ea.createStreamingSource},"get")});var zM=wN();Object.defineProperty(g,"ExoQL",{enumerable:!0,get:a(function(){return zM.ExoQL},"get")});Object.defineProperty(g,"ExoQLError",{enumerable:!0,get:a(function(){return zM.ExoQLError},"get")});var Kp=U0();Object.defineProperty(g,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return Kp.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(g,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return Kp.LAYOUT_CLASS_UID},"get")});Object.defineProperty(g,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return Kp.createLayoutFromFrontmatter},"get")});Object.defineProperty(g,"isLayout",{enumerable:!0,get:a(function(){return Kp.isLayout},"get")});Object.defineProperty(g,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return Kp.isLayoutFrontmatter},"get")});var ds=U0();Object.defineProperty(g,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return ds.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return ds.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return ds.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return ds.DAILY_EFFORTS_BY_CLASS_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return ds.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(g,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return ds.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(g,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return ds.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(g,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return ds.isBacklinksTableBlock},"get")});Object.defineProperty(g,"isDailyEffortsByClassBlock",{enumerable:!0,get:a(function(){return ds.isDailyEffortsByClassBlock},"get")});Object.defineProperty(g,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return ds.isLayoutBlockFrontmatter},"get")});Object.defineProperty(g,"isPropertiesBlock",{enumerable:!0,get:a(function(){return ds.isPropertiesBlock},"get")});var za=U0();Object.defineProperty(g,"BUILTIN_DAILY_EFFORTS_VISIBILITY",{enumerable:!0,get:a(function(){return za.BUILTIN_DAILY_EFFORTS_VISIBILITY},"get")});Object.defineProperty(g,"DAILY_EFFORTS_OVERRIDE_KEYS",{enumerable:!0,get:a(function(){return za.DAILY_EFFORTS_OVERRIDE_KEYS},"get")});Object.defineProperty(g,"coerceVisibilityOverride",{enumerable:!0,get:a(function(){return za.coerceVisibilityOverride},"get")});Object.defineProperty(g,"resolveBlockVisibility",{enumerable:!0,get:a(function(){return za.resolveBlockVisibility},"get")});Object.defineProperty(g,"resolveDailyEffortVisibility",{enumerable:!0,get:a(function(){return za.resolveDailyEffortVisibility},"get")});Object.defineProperty(g,"EMS_ACTION_CLASS_UID",{enumerable:!0,get:a(function(){return za.EMS_ACTION_CLASS_UID},"get")});Object.defineProperty(g,"EMS_PROJECT_CLASS_UID",{enumerable:!0,get:a(function(){return za.EMS_PROJECT_CLASS_UID},"get")});Object.defineProperty(g,"partitionDailyEffortsByClass",{enumerable:!0,get:a(function(){return za.partitionDailyEffortsByClass},"get")});var KM=LN();Object.defineProperty(g,"LayoutSelector",{enumerable:!0,get:a(function(){return KM.LayoutSelector},"get")});Object.defineProperty(g,"selectByPriority",{enumerable:!0,get:a(function(){return KM.selectByPriority},"get")});ai(qN(),g);var fse=GN();Object.defineProperty(g,"ShapeLoader",{enumerable:!0,get:a(function(){return fse.ShapeLoader},"get")});var dse=rA();Object.defineProperty(g,"ShapeRegistry",{enumerable:!0,get:a(function(){return dse.ShapeRegistry},"get")});var pse=Vt();Object.defineProperty(g,"Namespace",{enumerable:!0,get:a(function(){return pse.Namespace},"get")});var YM=aA();Object.defineProperty(g,"shaclValidate",{enumerable:!0,get:a(function(){return YM.validate},"get")});Object.defineProperty(g,"ShaclShapeRegistry",{enumerable:!0,get:a(function(){return YM.ShapeRegistry},"get")});ai(HN(),g);var hse=zN();Object.defineProperty(g,"TripleClassHierarchy",{enumerable:!0,get:a(function(){return hse.ClassHierarchy},"get")});var QM=fA();Object.defineProperty(g,"parseTarball",{enumerable:!0,get:a(function(){return QM.parseTarball},"get")});Object.defineProperty(g,"parseTarballGzip",{enumerable:!0,get:a(function(){return QM.parseTarballGzip},"get")});var XM=n_();Object.defineProperty(g,"restCreateCommit",{enumerable:!0,get:a(function(){return XM.restCreateCommit},"get")});Object.defineProperty(g,"isBinaryPayload",{enumerable:!0,get:a(function(){return XM.isBinaryPayload},"get")});var Ka=ek();Object.defineProperty(g,"mountAssetSpaceFiles",{enumerable:!0,get:a(function(){return Ka.mountAssetSpaceFiles},"get")});Object.defineProperty(g,"discoverAssetSpaceWrapperDir",{enumerable:!0,get:a(function(){return Ka.discoverWrapperDir},"get")});Object.defineProperty(g,"extractAssetSpaceSha",{enumerable:!0,get:a(function(){return Ka.extractShaFromWrapper},"get")});Object.defineProperty(g,"appendGitmodulesEntry",{enumerable:!0,get:a(function(){return Ka.appendGitmodulesEntry},"get")});Object.defineProperty(g,"stripGitmodulesEntry",{enumerable:!0,get:a(function(){return Ka.stripGitmodulesEntry},"get")});Object.defineProperty(g,"escapeGitmodulesRegex",{enumerable:!0,get:a(function(){return Ka.escapeGitmodulesRegex},"get")});Object.defineProperty(g,"MATERIALIZE_PROGRESS_INTERVAL",{enumerable:!0,get:a(function(){return Ka.MATERIALIZE_PROGRESS_INTERVAL},"get")});Object.defineProperty(g,"MATERIALIZE_PROGRESS_MIN_FILES",{enumerable:!0,get:a(function(){return Ka.MATERIALIZE_PROGRESS_MIN_FILES},"get")});var JM=Tp();Object.defineProperty(g,"detectChanges",{enumerable:!0,get:a(function(){return JM.detectChanges},"get")});Object.defineProperty(g,"extractAssetUid",{enumerable:!0,get:a(function(){return JM.extractAssetUid},"get")});var mse=ef();Object.defineProperty(g,"gitBlobSha",{enumerable:!0,get:a(function(){return mse.gitBlobSha},"get")});var II=ik();Object.defineProperty(g,"rewriteAssetUid",{enumerable:!0,get:a(function(){return II.rewriteAssetUid},"get")});Object.defineProperty(g,"findDuplicateUidGroups",{enumerable:!0,get:a(function(){return II.findDuplicateUidGroups},"get")});Object.defineProperty(g,"planDuplicateUidFix",{enumerable:!0,get:a(function(){return II.planDuplicateUidFix},"get")});var Yp=tf();Object.defineProperty(g,"getBlobBytes",{enumerable:!0,get:a(function(){return Yp.getBlobBytes},"get")});Object.defineProperty(g,"getBlobText",{enumerable:!0,get:a(function(){return Yp.getBlobText},"get")});Object.defineProperty(g,"getCommitInfo",{enumerable:!0,get:a(function(){return Yp.getCommitInfo},"get")});Object.defineProperty(g,"getHeadSha",{enumerable:!0,get:a(function(){return Yp.getHeadSha},"get")});Object.defineProperty(g,"getTree",{enumerable:!0,get:a(function(){return Yp.getTree},"get")});var gse=ak();Object.defineProperty(g,"checkParkedStaleness",{enumerable:!0,get:a(function(){return gse.checkParkedStaleness},"get")});var df=Ik();Object.defineProperty(g,"DEFAULT_MAX_PUSH_RETRIES",{enumerable:!0,get:a(function(){return df.DEFAULT_MAX_PUSH_RETRIES},"get")});Object.defineProperty(g,"DEFAULT_LOCAL_MANIFEST_REHASH_MS",{enumerable:!0,get:a(function(){return df.DEFAULT_LOCAL_MANIFEST_REHASH_MS},"get")});Object.defineProperty(g,"SyncEngine",{enumerable:!0,get:a(function(){return df.SyncEngine},"get")});Object.defineProperty(g,"isNonFastForwardError",{enumerable:!0,get:a(function(){return df.isNonFastForwardError},"get")});Object.defineProperty(g,"orderChildrenFirst",{enumerable:!0,get:a(function(){return df.orderChildrenFirst},"get")});Object.defineProperty(g,"syncProgressPhaseText",{enumerable:!0,get:a(function(){return df.syncProgressPhaseText},"get")});var ps=SA();Object.defineProperty(g,"SyncPhaseTimer",{enumerable:!0,get:a(function(){return ps.SyncPhaseTimer},"get")});Object.defineProperty(g,"SYNC_PHASES",{enumerable:!0,get:a(function(){return ps.SYNC_PHASES},"get")});Object.defineProperty(g,"classifyRestPhase",{enumerable:!0,get:a(function(){return ps.classifyRestPhase},"get")});Object.defineProperty(g,"emptyTimings",{enumerable:!0,get:a(function(){return ps.emptyTimings},"get")});Object.defineProperty(g,"addTimings",{enumerable:!0,get:a(function(){return ps.addTimings},"get")});Object.defineProperty(g,"aggregateTimings",{enumerable:!0,get:a(function(){return ps.aggregateTimings},"get")});Object.defineProperty(g,"totalMs",{enumerable:!0,get:a(function(){return ps.totalMs},"get")});Object.defineProperty(g,"dominantPhase",{enumerable:!0,get:a(function(){return ps.dominantPhase},"get")});Object.defineProperty(g,"fmtMs",{enumerable:!0,get:a(function(){return ps.fmtMs},"get")});Object.defineProperty(g,"formatTimingsLine",{enumerable:!0,get:a(function(){return ps.formatTimingsLine},"get")});Object.defineProperty(g,"formatRepoTimings",{enumerable:!0,get:a(function(){return ps.formatRepoTimings},"get")});var ZM=Rk();Object.defineProperty(g,"QuarantineResolver",{enumerable:!0,get:a(function(){return ZM.QuarantineResolver},"get")});Object.defineProperty(g,"backupPathFor",{enumerable:!0,get:a(function(){return ZM.backupPathFor},"get")});var Qp=f_();Object.defineProperty(g,"DEFAULT_MAX_FILE_BYTES",{enumerable:!0,get:a(function(){return Qp.DEFAULT_MAX_FILE_BYTES},"get")});Object.defineProperty(g,"InMemoryQuarantineStore",{enumerable:!0,get:a(function(){return Qp.InMemoryQuarantineStore},"get")});Object.defineProperty(g,"contentEquals",{enumerable:!0,get:a(function(){return Qp.contentEquals},"get")});Object.defineProperty(g,"isFileSpaceSyncablePath",{enumerable:!0,get:a(function(){return Qp.isFileSpaceSyncablePath},"get")});Object.defineProperty(g,"isSyncablePath",{enumerable:!0,get:a(function(){return Qp.isSyncablePath},"get")});var ej=Ck();Object.defineProperty(g,"FileLocalManifestStore",{enumerable:!0,get:a(function(){return ej.FileLocalManifestStore},"get")});Object.defineProperty(g,"LOCAL_MANIFEST_STORE_FILENAME",{enumerable:!0,get:a(function(){return ej.LOCAL_MANIFEST_STORE_FILENAME},"get")});var yse=MA();Object.defineProperty(g,"diff3",{enumerable:!0,get:a(function(){return yse.diff3},"get")});var tj=Dk();Object.defineProperty(g,"StructuredMerger",{enumerable:!0,get:a(function(){return tj.StructuredMerger},"get")});Object.defineProperty(g,"splitSections",{enumerable:!0,get:a(function(){return tj.splitSections},"get")});var _se=Fk();Object.defineProperty(g,"MergeShaclGate",{enumerable:!0,get:a(function(){return _se.MergeShaclGate},"get")});var bse=Lk();Object.defineProperty(g,"GatedStructuredMerger",{enumerable:!0,get:a(function(){return bse.GatedStructuredMerger},"get")});var rj=Nk();Object.defineProperty(g,"FileWatermarkStore",{enumerable:!0,get:a(function(){return rj.FileWatermarkStore},"get")});Object.defineProperty(g,"WATERMARK_STORE_FILENAME",{enumerable:!0,get:a(function(){return rj.WATERMARK_STORE_FILENAME},"get")});var nj=kk();Object.defineProperty(g,"FileMountBaseStore",{enumerable:!0,get:a(function(){return nj.FileMountBaseStore},"get")});Object.defineProperty(g,"MOUNT_BASE_STORE_FILENAME",{enumerable:!0,get:a(function(){return nj.MOUNT_BASE_STORE_FILENAME},"get")});var Sse=l_();Object.defineProperty(g,"isAuthError",{enumerable:!0,get:a(function(){return Sse.isAuthError},"get")});var Xp=u_();Object.defineProperty(g,"isRateLimitError",{enumerable:!0,get:a(function(){return Xp.isRateLimitError},"get")});Object.defineProperty(g,"withRateLimitBackoff",{enumerable:!0,get:a(function(){return Xp.withRateLimitBackoff},"get")});Object.defineProperty(g,"createRateLimitBudget",{enumerable:!0,get:a(function(){return Xp.createRateLimitBudget},"get")});Object.defineProperty(g,"MIN_RATE_LIMIT_WAIT_MS",{enumerable:!0,get:a(function(){return Xp.MIN_RATE_LIMIT_WAIT_MS},"get")});Object.defineProperty(g,"DEFAULT_MAX_RETRIES",{enumerable:!0,get:a(function(){return Xp.DEFAULT_MAX_RETRIES},"get")});var pf=xA();Object.defineProperty(g,"caseInsensitiveHeaderGetter",{enumerable:!0,get:a(function(){return pf.caseInsensitiveHeaderGetter},"get")});Object.defineProperty(g,"parseRetryAfterMs",{enumerable:!0,get:a(function(){return pf.parseRetryAfterMs},"get")});Object.defineProperty(g,"extractRateLimitFields",{enumerable:!0,get:a(function(){return pf.extractRateLimitFields},"get")});Object.defineProperty(g,"getRateLimitFields",{enumerable:!0,get:a(function(){return pf.getRateLimitFields},"get")});Object.defineProperty(g,"attachRateLimitFields",{enumerable:!0,get:a(function(){return pf.attachRateLimitFields},"get")});Object.defineProperty(g,"enrichRateLimitError",{enumerable:!0,get:a(function(){return pf.enrichRateLimitError},"get")});var ij=TA();Object.defineProperty(g,"redactSecrets",{enumerable:!0,get:a(function(){return ij.redactSecrets},"get")});Object.defineProperty(g,"scanForSecrets",{enumerable:!0,get:a(function(){return ij.scanForSecrets},"get")});var sj=Mk();Object.defineProperty(g,"LocalConflictCacheStore",{enumerable:!0,get:a(function(){return sj.LocalConflictCacheStore},"get")});Object.defineProperty(g,"CONFLICT_CACHE_STORE_FILENAME",{enumerable:!0,get:a(function(){return sj.CONFLICT_CACHE_STORE_FILENAME},"get")});var xI=a_();Object.defineProperty(g,"LocalOutboxStore",{enumerable:!0,get:a(function(){return xI.LocalOutboxStore},"get")});Object.defineProperty(g,"OUTBOX_STORE_FILENAME",{enumerable:!0,get:a(function(){return xI.OUTBOX_STORE_FILENAME},"get")});Object.defineProperty(g,"OUTBOX_REMOTE_ABSENT",{enumerable:!0,get:a(function(){return xI.OUTBOX_REMOTE_ABSENT},"get")});var Ya=XA();Object.defineProperty(g,"ASSET_SPACE_CLASS_UID",{enumerable:!0,get:a(function(){return Ya.ASSET_SPACE_CLASS_UID},"get")});Object.defineProperty(g,"SYNC_BRANCH",{enumerable:!0,get:a(function(){return Ya.SYNC_BRANCH},"get")});Object.defineProperty(g,"SpaceSpecAccumulator",{enumerable:!0,get:a(function(){return Ya.SpaceSpecAccumulator},"get")});Object.defineProperty(g,"classifySpaceDeclaration",{enumerable:!0,get:a(function(){return Ya.classifySpaceDeclaration},"get")});Object.defineProperty(g,"isAssetSpaceFrontmatter",{enumerable:!0,get:a(function(){return Ya.isAssetSpaceFrontmatter},"get")});Object.defineProperty(g,"isFileSpaceFrontmatter",{enumerable:!0,get:a(function(){return Ya.isFileSpaceFrontmatter},"get")});Object.defineProperty(g,"parseStrictGitHubRepoURL",{enumerable:!0,get:a(function(){return Ya.parseStrictGitHubRepoURL},"get")});Object.defineProperty(g,"readSpaceSource",{enumerable:!0,get:a(function(){return Ya.readSpaceSource},"get")});var oj=Wk();Object.defineProperty(g,"buildAssetSpaceDescriptor",{enumerable:!0,get:a(function(){return oj.buildAssetSpaceDescriptor},"get")});Object.defineProperty(g,"deriveAssetSpaceNamespace",{enumerable:!0,get:a(function(){return oj.deriveAssetSpaceNamespace},"get")});var aj=Xk();Object.defineProperty(g,"ParityValidator",{enumerable:!0,get:a(function(){return aj.ParityValidator},"get")});Object.defineProperty(g,"summarizeParityRound",{enumerable:!0,get:a(function(){return aj.summarizeParityRound},"get")});var lj=ZA();Object.defineProperty(g,"compareAssetSemantics",{enumerable:!0,get:a(function(){return lj.compareAssetSemantics},"get")});Object.defineProperty(g,"isFormatOnlyDrift",{enumerable:!0,get:a(function(){return lj.isFormatOnlyDrift},"get")});ai(lM(),g);ai(yM(),g);var wse=hI();Object.defineProperty(g,"DEFAULT_DISPLAY_NAME_SETTINGS",{enumerable:!0,get:a(function(){return wse.DEFAULT_DISPLAY_NAME_SETTINGS},"get")});var Ese=bM();Object.defineProperty(g,"PrintNameRuleService",{enumerable:!0,get:a(function(){return Ese.PrintNameRuleService},"get")});var cj=SM();Object.defineProperty(g,"DisplayNameResolver",{enumerable:!0,get:a(function(){return cj.DisplayNameResolver},"get")});Object.defineProperty(g,"createDefaultResolver",{enumerable:!0,get:a(function(){return cj.createDefaultResolver},"get")});var RI=yI();Object.defineProperty(g,"DisplayNameTemplateEngine",{enumerable:!0,get:a(function(){return RI.DisplayNameTemplateEngine},"get")});Object.defineProperty(g,"DISPLAY_NAME_PRESETS",{enumerable:!0,get:a(function(){return RI.DISPLAY_NAME_PRESETS},"get")});Object.defineProperty(g,"DEFAULT_DISPLAY_NAME_TEMPLATE",{enumerable:!0,get:a(function(){return RI.DEFAULT_DISPLAY_NAME_TEMPLATE},"get")});var uj=Bp();Object.defineProperty(g,"resolveKeyPath",{enumerable:!0,get:a(function(){return uj.resolveKeyPath},"get")});Object.defineProperty(g,"isWikilink",{enumerable:!0,get:a(function(){return uj.isWikilink},"get")});var L_=xM();Object.defineProperty(g,"isEffortBlocked",{enumerable:!0,get:a(function(){return L_.isEffortBlocked},"get")});Object.defineProperty(g,"isEpisodeOngoing",{enumerable:!0,get:a(function(){return L_.isEpisodeOngoing},"get")});Object.defineProperty(g,"localToday",{enumerable:!0,get:a(function(){return L_.localToday},"get")});Object.defineProperty(g,"createDisplayMatcherHostFunctions",{enumerable:!0,get:a(function(){return L_.createDisplayMatcherHostFunctions},"get")})});var Wr=v(CI=>{"use strict";CI.fromCallback=function(n){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")n.apply(this,e);else return new Promise((t,r)=>{e.push((i,s)=>i!=null?r(i):t(s)),n.apply(this,e)})},"name",{value:n.name})};CI.fromPromise=function(n){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return n.apply(this,e);e.pop(),n.apply(this,e).then(r=>t(null,r),t)},"name",{value:n.name})}});var dj=v((O2e,fj)=>{var Qa=require("constants"),vse=process.cwd,N_=null,Tse=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return N_||(N_=vse.call(process)),N_};try{process.cwd()}catch{}typeof process.chdir=="function"&&(OI=process.chdir,process.chdir=function(n){N_=null,OI.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,OI));var OI;fj.exports=Ase;function Ase(n){Qa.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(n),n.lutimes||t(n),n.chown=s(n.chown),n.fchown=s(n.fchown),n.lchown=s(n.lchown),n.chmod=r(n.chmod),n.fchmod=r(n.fchmod),n.lchmod=r(n.lchmod),n.chownSync=o(n.chownSync),n.fchownSync=o(n.fchownSync),n.lchownSync=o(n.lchownSync),n.chmodSync=i(n.chmodSync),n.fchmodSync=i(n.fchmodSync),n.lchmodSync=i(n.lchmodSync),n.stat=l(n.stat),n.fstat=l(n.fstat),n.lstat=l(n.lstat),n.statSync=c(n.statSync),n.fstatSync=c(n.fstatSync),n.lstatSync=c(n.lstatSync),n.chmod&&!n.lchmod&&(n.lchmod=function(f,d,p){p&&process.nextTick(p)},n.lchmodSync=function(){}),n.chown&&!n.lchown&&(n.lchown=function(f,d,p,h){h&&process.nextTick(h)},n.lchownSync=function(){}),Tse==="win32"&&(n.rename=typeof n.rename!="function"?n.rename:(function(f){function d(p,h,_){var y=Date.now(),b=0;f(p,h,a(function S(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-y<6e4){setTimeout(function(){n.stat(h,function(O,T){O&&O.code==="ENOENT"?f(p,h,S):_(I)})},b),b<100&&(b+=10);return}_&&_(I)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.rename)),n.read=typeof n.read!="function"?n.read:(function(f){function d(p,h,_,y,b,S){var I;if(S&&typeof S=="function"){var O=0;I=a(function(T,E,P){if(T&&T.code==="EAGAIN"&&O<10)return O++,f.call(n,p,h,_,y,b,I);S.apply(this,arguments)},"callback")}return f.call(n,p,h,_,y,b,I)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.read),n.readSync=typeof n.readSync!="function"?n.readSync:(function(f){return function(d,p,h,_,y){for(var b=0;;)try{return f.call(n,d,p,h,_,y)}catch(S){if(S.code==="EAGAIN"&&b<10){b++;continue}throw S}}})(n.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(b){f.close(y,function(S){h&&h(b||S)})})})},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,b){if(y){_&&_(y);return}f.futimes(b,p,h,function(S){f.close(b,function(I){_&&_(S||I)})})})},f.lutimesSync=function(d,p,h){var _=f.openSync(d,Qa.O_SYMLINK),y,b=!0;try{y=f.futimesSync(_,p,h),b=!1}finally{if(b)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 r(f){return f&&function(d,p,h){return f.call(n,d,p,function(_){u(_)&&(_=null),h&&h.apply(this,arguments)})}}a(r,"chmodFix");function i(f){return f&&function(d,p){try{return f.call(n,d,p)}catch(h){if(!u(h))throw h}}}a(i,"chmodFixSync");function s(f){return f&&function(d,p,h,_){return f.call(n,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(n,d,p,h)}catch(_){if(!u(_))throw _}}}a(o,"chownFixSync");function l(f){return f&&function(d,p,h){typeof p=="function"&&(h=p,p=null);function _(y,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),h&&h.apply(this,arguments)}return a(_,"callback"),p?f.call(n,d,p,_):f.call(n,d,_)}}a(l,"statFix");function c(f){return f&&function(d,p){var h=p?f.call(n,d,p):f.call(n,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}a(c,"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(Ase,"patch")});var mj=v((D2e,hj)=>{var pj=require("stream").Stream;hj.exports=Ise;function Ise(n){return{ReadStream:e,WriteStream:t};function e(r,i){if(!(this instanceof e))return new e(r,i);pj.call(this);var s=this;this.path=r,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),l=0,c=o.length;l<c;l++){var u=o[l];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}n.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(r,i){if(!(this instanceof t))return new t(r,i);pj.call(this),this.path=r,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,l=s.length;o<l;o++){var c=s[o];this[c]=i[c]}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=n.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Ise,"legacy")});var yj=v((L2e,gj)=>{"use strict";gj.exports=Rse;var xse=Object.getPrototypeOf||function(n){return n.__proto__};function Rse(n){if(n===null||typeof n!="object")return n;if(n instanceof Object)var e={__proto__:xse(n)};else var e=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}a(Rse,"clone")});var mf=v((k2e,FI)=>{var Xt=require("fs"),Cse=dj(),Ose=mj(),Pse=yj(),k_=require("util"),dn,j_;typeof Symbol=="function"&&typeof Symbol.for=="function"?(dn=Symbol.for("graceful-fs.queue"),j_=Symbol.for("graceful-fs.previous")):(dn="___graceful-fs.queue",j_="___graceful-fs.previous");function Dse(){}a(Dse,"noop");function Sj(n,e){Object.defineProperty(n,dn,{get:a(function(){return e},"get")})}a(Sj,"publishQueue");var dc=Dse;k_.debuglog?dc=k_.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(dc=a(function(){var n=k_.format.apply(k_,arguments);n="GFS4: "+n.split(/\n/).join(`
338
- GFS4: `),console.error(n)},"debug"));Xt[dn]||(_j=global[dn]||[],Sj(Xt,_j),Xt.close=(function(n){function e(t,r){return n.call(Xt,t,function(i){i||bj(),typeof r=="function"&&r.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,j_,{value:n}),e})(Xt.close),Xt.closeSync=(function(n){function e(t){n.apply(Xt,arguments),bj()}return a(e,"closeSync"),Object.defineProperty(e,j_,{value:n}),e})(Xt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){dc(Xt[dn]),require("assert").equal(Xt[dn].length,0)}));var _j;global[dn]||Sj(global,Xt[dn]);FI.exports=PI(Pse(Xt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Xt.__patched&&(FI.exports=PI(Xt),Xt.__patched=!0);function PI(n){Cse(n),n.gracefulify=PI,n.createReadStream=E,n.createWriteStream=P;var e=n.readFile;n.readFile=t;function t(j,$,G){return typeof $=="function"&&(G=$,$=null),ge(j,$,G);function ge(ye,Q,se,J){return e(ye,Q,function(ve){ve&&(ve.code==="EMFILE"||ve.code==="ENFILE")?hf([ge,[ye,Q,se],ve,J||Date.now(),Date.now()]):typeof se=="function"&&se.apply(this,arguments)})}a(ge,"go$readFile")}a(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(j,$,G,ge){return typeof G=="function"&&(ge=G,G=null),ye(j,$,G,ge);function ye(Q,se,J,ve,te){return r(Q,se,J,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?hf([ye,[Q,se,J,ve],ie,te||Date.now(),Date.now()]):typeof ve=="function"&&ve.apply(this,arguments)})}a(ye,"go$writeFile")}a(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=o);function o(j,$,G,ge){return typeof G=="function"&&(ge=G,G=null),ye(j,$,G,ge);function ye(Q,se,J,ve,te){return s(Q,se,J,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?hf([ye,[Q,se,J,ve],ie,te||Date.now(),Date.now()]):typeof ve=="function"&&ve.apply(this,arguments)})}a(ye,"go$appendFile")}a(o,"appendFile");var l=n.copyFile;l&&(n.copyFile=c);function c(j,$,G,ge){return typeof G=="function"&&(ge=G,G=0),ye(j,$,G,ge);function ye(Q,se,J,ve,te){return l(Q,se,J,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?hf([ye,[Q,se,J,ve],ie,te||Date.now(),Date.now()]):typeof ve=="function"&&ve.apply(this,arguments)})}a(ye,"go$copyFile")}a(c,"copyFile");var u=n.readdir;n.readdir=d;var f=/^v[0-5]\./;function d(j,$,G){typeof $=="function"&&(G=$,$=null);var ge=f.test(process.version)?a(function(se,J,ve,te){return u(se,ye(se,J,ve,te))},"go$readdir"):a(function(se,J,ve,te){return u(se,J,ye(se,J,ve,te))},"go$readdir");return ge(j,$,G);function ye(Q,se,J,ve){return function(te,ie){te&&(te.code==="EMFILE"||te.code==="ENFILE")?hf([ge,[Q,se,J],te,ve||Date.now(),Date.now()]):(ie&&ie.sort&&ie.sort(),typeof J=="function"&&J.call(this,te,ie))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var p=Ose(n);S=p.ReadStream,O=p.WriteStream}var h=n.ReadStream;h&&(S.prototype=Object.create(h.prototype),S.prototype.open=I);var _=n.WriteStream;_&&(O.prototype=Object.create(_.prototype),O.prototype.open=T),Object.defineProperty(n,"ReadStream",{get:a(function(){return S},"get"),set:a(function(j){S=j},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:a(function(){return O},"get"),set:a(function(j){O=j},"set"),enumerable:!0,configurable:!0});var y=S;Object.defineProperty(n,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(j){y=j},"set"),enumerable:!0,configurable:!0});var b=O;Object.defineProperty(n,"FileWriteStream",{get:a(function(){return b},"get"),set:a(function(j){b=j},"set"),enumerable:!0,configurable:!0});function S(j,$){return this instanceof S?(h.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}a(S,"ReadStream");function I(){var j=this;M(j.path,j.flags,j.mode,function($,G){$?(j.autoClose&&j.destroy(),j.emit("error",$)):(j.fd=G,j.emit("open",G),j.read())})}a(I,"ReadStream$open");function O(j,$){return this instanceof O?(_.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}a(O,"WriteStream");function T(){var j=this;M(j.path,j.flags,j.mode,function($,G){$?(j.destroy(),j.emit("error",$)):(j.fd=G,j.emit("open",G))})}a(T,"WriteStream$open");function E(j,$){return new n.ReadStream(j,$)}a(E,"createReadStream");function P(j,$){return new n.WriteStream(j,$)}a(P,"createWriteStream");var V=n.open;n.open=M;function M(j,$,G,ge){return typeof G=="function"&&(ge=G,G=null),ye(j,$,G,ge);function ye(Q,se,J,ve,te){return V(Q,se,J,function(ie,he){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?hf([ye,[Q,se,J,ve],ie,te||Date.now(),Date.now()]):typeof ve=="function"&&ve.apply(this,arguments)})}a(ye,"go$open")}return a(M,"open"),n}a(PI,"patch");function hf(n){dc("ENQUEUE",n[0].name,n[1]),Xt[dn].push(n),DI()}a(hf,"enqueue");var M_;function bj(){for(var n=Date.now(),e=0;e<Xt[dn].length;++e)Xt[dn][e].length>2&&(Xt[dn][e][3]=n,Xt[dn][e][4]=n);DI()}a(bj,"resetQueue");function DI(){if(clearTimeout(M_),M_=void 0,Xt[dn].length!==0){var n=Xt[dn].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)dc("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){dc("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,r)}else{var l=Date.now()-s,c=Math.max(s-i,1),u=Math.min(c*1.2,100);l>=u?(dc("RETRY",e.name,t),e.apply(null,t.concat([i]))):Xt[dn].push(n)}M_===void 0&&(M_=setTimeout(DI,0))}}a(DI,"retry")});var jn=v(ta=>{"use strict";var wj=Wr().fromCallback,Mn=mf(),Fse=["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(n=>typeof Mn[n]=="function");Object.assign(ta,Mn);Fse.forEach(n=>{ta[n]=wj(Mn[n])});ta.exists=function(n,e){return typeof e=="function"?Mn.exists(n,e):new Promise(t=>Mn.exists(n,t))};ta.read=function(n,e,t,r,i,s){return typeof s=="function"?Mn.read(n,e,t,r,i,s):new Promise((o,l)=>{Mn.read(n,e,t,r,i,(c,u,f)=>{if(c)return l(c);o({bytesRead:u,buffer:f})})})};ta.write=function(n,e,...t){return typeof t[t.length-1]=="function"?Mn.write(n,e,...t):new Promise((r,i)=>{Mn.write(n,e,...t,(s,o,l)=>{if(s)return i(s);r({bytesWritten:o,buffer:l})})})};ta.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?Mn.readv(n,e,...t):new Promise((r,i)=>{Mn.readv(n,e,...t,(s,o,l)=>{if(s)return i(s);r({bytesRead:o,buffers:l})})})};ta.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?Mn.writev(n,e,...t):new Promise((r,i)=>{Mn.writev(n,e,...t,(s,o,l)=>{if(s)return i(s);r({bytesWritten:o,buffers:l})})})};typeof Mn.realpath.native=="function"?ta.realpath.native=wj(Mn.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var vj=v(($2e,Ej)=>{"use strict";var Lse=require("path");Ej.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Lse.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var xj=v((B2e,LI)=>{"use strict";var Tj=jn(),{checkPath:Aj}=vj(),Ij=a(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");LI.exports.makeDir=async(n,e)=>(Aj(n),Tj.mkdir(n,{mode:Ij(e),recursive:!0}));LI.exports.makeDirSync=(n,e)=>(Aj(n),Tj.mkdirSync(n,{mode:Ij(e),recursive:!0}))});var hs=v((q2e,Rj)=>{"use strict";var Nse=Wr().fromPromise,{makeDir:kse,makeDirSync:NI}=xj(),kI=Nse(kse);Rj.exports={mkdirs:kI,mkdirsSync:NI,mkdirp:kI,mkdirpSync:NI,ensureDir:kI,ensureDirSync:NI}});var Xa=v((G2e,Oj)=>{"use strict";var Mse=Wr().fromPromise,Cj=jn();function jse(n){return Cj.access(n).then(()=>!0).catch(()=>!1)}a(jse,"pathExists");Oj.exports={pathExists:Mse(jse),pathExistsSync:Cj.existsSync}});var MI=v((H2e,Pj)=>{"use strict";var gf=jn(),$se=Wr().fromPromise;async function Use(n,e,t){let r=await gf.open(n,"r+"),i=null;try{await gf.futimes(r,e,t)}finally{try{await gf.close(r)}catch(s){i=s}}if(i)throw i}a(Use,"utimesMillis");function Bse(n,e,t){let r=gf.openSync(n,"r+");return gf.futimesSync(r,e,t),gf.closeSync(r)}a(Bse,"utimesMillisSync");Pj.exports={utimesMillis:$se(Use),utimesMillisSync:Bse}});var pc=v((K2e,Nj)=>{"use strict";var yf=jn(),Hr=require("path"),Dj=Wr().fromPromise;function Vse(n,e,t){let r=t.dereference?i=>yf.stat(i,{bigint:!0}):i=>yf.lstat(i,{bigint:!0});return Promise.all([r(n),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}a(Vse,"getStats");function qse(n,e,t){let r,i=t.dereference?o=>yf.statSync(o,{bigint:!0}):o=>yf.lstatSync(o,{bigint:!0}),s=i(n);try{r=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:r}}a(qse,"getStatsSync");async function Gse(n,e,t,r){let{srcStat:i,destStat:s}=await Vse(n,e,r);if(s){if(Jp(i,s)){let o=Hr.basename(n),l=Hr.basename(e);if(t==="move"&&o!==l&&o.toLowerCase()===l.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 '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&jI(n,e))throw new Error($_(n,e,t));return{srcStat:i,destStat:s}}a(Gse,"checkPaths");function Wse(n,e,t,r){let{srcStat:i,destStat:s}=qse(n,e,r);if(s){if(Jp(i,s)){let o=Hr.basename(n),l=Hr.basename(e);if(t==="move"&&o!==l&&o.toLowerCase()===l.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 '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&jI(n,e))throw new Error($_(n,e,t));return{srcStat:i,destStat:s}}a(Wse,"checkPathsSync");async function Fj(n,e,t,r){let i=Hr.resolve(Hr.dirname(n)),s=Hr.resolve(Hr.dirname(t));if(s===i||s===Hr.parse(s).root)return;let o;try{o=await yf.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(Jp(e,o))throw new Error($_(n,t,r));return Fj(n,e,s,r)}a(Fj,"checkParentPaths");function Lj(n,e,t,r){let i=Hr.resolve(Hr.dirname(n)),s=Hr.resolve(Hr.dirname(t));if(s===i||s===Hr.parse(s).root)return;let o;try{o=yf.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(Jp(e,o))throw new Error($_(n,t,r));return Lj(n,e,s,r)}a(Lj,"checkParentPathsSync");function Jp(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}a(Jp,"areIdentical");function jI(n,e){let t=Hr.resolve(n).split(Hr.sep).filter(i=>i),r=Hr.resolve(e).split(Hr.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}a(jI,"isSrcSubdir");function $_(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}a($_,"errMsg");Nj.exports={checkPaths:Dj(Gse),checkPathsSync:Wse,checkParentPaths:Dj(Fj),checkParentPathsSync:Lj,isSrcSubdir:jI,areIdentical:Jp}});var Mj=v((Q2e,kj)=>{"use strict";async function Hse(n,e){let t=[];for await(let r of n)t.push(e(r).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(r=>r.then(i=>{if(i!==null)throw i})))}a(Hse,"asyncIteratorConcurrentProcess");kj.exports={asyncIteratorConcurrentProcess:Hse}});var Vj=v((J2e,Bj)=>{"use strict";var vn=jn(),Zp=require("path"),{mkdirs:zse}=hs(),{pathExists:Kse}=Xa(),{utimesMillis:Yse}=MI(),eh=pc(),{asyncIteratorConcurrentProcess:Qse}=Mj();async function Xse(n,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;
338
+ GFS4: `),console.error(n)},"debug"));Xt[dn]||(_j=global[dn]||[],Sj(Xt,_j),Xt.close=(function(n){function e(t,r){return n.call(Xt,t,function(i){i||bj(),typeof r=="function"&&r.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,j_,{value:n}),e})(Xt.close),Xt.closeSync=(function(n){function e(t){n.apply(Xt,arguments),bj()}return a(e,"closeSync"),Object.defineProperty(e,j_,{value:n}),e})(Xt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){dc(Xt[dn]),require("assert").equal(Xt[dn].length,0)}));var _j;global[dn]||Sj(global,Xt[dn]);FI.exports=PI(Pse(Xt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Xt.__patched&&(FI.exports=PI(Xt),Xt.__patched=!0);function PI(n){Cse(n),n.gracefulify=PI,n.createReadStream=E,n.createWriteStream=P;var e=n.readFile;n.readFile=t;function t(j,$,G){return typeof $=="function"&&(G=$,$=null),ge(j,$,G);function ge(ye,Q,se,J){return e(ye,Q,function(ve){ve&&(ve.code==="EMFILE"||ve.code==="ENFILE")?hf([ge,[ye,Q,se],ve,J||Date.now(),Date.now()]):typeof se=="function"&&se.apply(this,arguments)})}a(ge,"go$readFile")}a(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(j,$,G,ge){return typeof G=="function"&&(ge=G,G=null),ye(j,$,G,ge);function ye(Q,se,J,ve,re){return r(Q,se,J,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?hf([ye,[Q,se,J,ve],ie,re||Date.now(),Date.now()]):typeof ve=="function"&&ve.apply(this,arguments)})}a(ye,"go$writeFile")}a(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=o);function o(j,$,G,ge){return typeof G=="function"&&(ge=G,G=null),ye(j,$,G,ge);function ye(Q,se,J,ve,re){return s(Q,se,J,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?hf([ye,[Q,se,J,ve],ie,re||Date.now(),Date.now()]):typeof ve=="function"&&ve.apply(this,arguments)})}a(ye,"go$appendFile")}a(o,"appendFile");var l=n.copyFile;l&&(n.copyFile=c);function c(j,$,G,ge){return typeof G=="function"&&(ge=G,G=0),ye(j,$,G,ge);function ye(Q,se,J,ve,re){return l(Q,se,J,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?hf([ye,[Q,se,J,ve],ie,re||Date.now(),Date.now()]):typeof ve=="function"&&ve.apply(this,arguments)})}a(ye,"go$copyFile")}a(c,"copyFile");var u=n.readdir;n.readdir=d;var f=/^v[0-5]\./;function d(j,$,G){typeof $=="function"&&(G=$,$=null);var ge=f.test(process.version)?a(function(se,J,ve,re){return u(se,ye(se,J,ve,re))},"go$readdir"):a(function(se,J,ve,re){return u(se,J,ye(se,J,ve,re))},"go$readdir");return ge(j,$,G);function ye(Q,se,J,ve){return function(re,ie){re&&(re.code==="EMFILE"||re.code==="ENFILE")?hf([ge,[Q,se,J],re,ve||Date.now(),Date.now()]):(ie&&ie.sort&&ie.sort(),typeof J=="function"&&J.call(this,re,ie))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var p=Ose(n);S=p.ReadStream,O=p.WriteStream}var h=n.ReadStream;h&&(S.prototype=Object.create(h.prototype),S.prototype.open=I);var _=n.WriteStream;_&&(O.prototype=Object.create(_.prototype),O.prototype.open=T),Object.defineProperty(n,"ReadStream",{get:a(function(){return S},"get"),set:a(function(j){S=j},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:a(function(){return O},"get"),set:a(function(j){O=j},"set"),enumerable:!0,configurable:!0});var y=S;Object.defineProperty(n,"FileReadStream",{get:a(function(){return y},"get"),set:a(function(j){y=j},"set"),enumerable:!0,configurable:!0});var b=O;Object.defineProperty(n,"FileWriteStream",{get:a(function(){return b},"get"),set:a(function(j){b=j},"set"),enumerable:!0,configurable:!0});function S(j,$){return this instanceof S?(h.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}a(S,"ReadStream");function I(){var j=this;M(j.path,j.flags,j.mode,function($,G){$?(j.autoClose&&j.destroy(),j.emit("error",$)):(j.fd=G,j.emit("open",G),j.read())})}a(I,"ReadStream$open");function O(j,$){return this instanceof O?(_.apply(this,arguments),this):O.apply(Object.create(O.prototype),arguments)}a(O,"WriteStream");function T(){var j=this;M(j.path,j.flags,j.mode,function($,G){$?(j.destroy(),j.emit("error",$)):(j.fd=G,j.emit("open",G))})}a(T,"WriteStream$open");function E(j,$){return new n.ReadStream(j,$)}a(E,"createReadStream");function P(j,$){return new n.WriteStream(j,$)}a(P,"createWriteStream");var V=n.open;n.open=M;function M(j,$,G,ge){return typeof G=="function"&&(ge=G,G=null),ye(j,$,G,ge);function ye(Q,se,J,ve,re){return V(Q,se,J,function(ie,he){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?hf([ye,[Q,se,J,ve],ie,re||Date.now(),Date.now()]):typeof ve=="function"&&ve.apply(this,arguments)})}a(ye,"go$open")}return a(M,"open"),n}a(PI,"patch");function hf(n){dc("ENQUEUE",n[0].name,n[1]),Xt[dn].push(n),DI()}a(hf,"enqueue");var M_;function bj(){for(var n=Date.now(),e=0;e<Xt[dn].length;++e)Xt[dn][e].length>2&&(Xt[dn][e][3]=n,Xt[dn][e][4]=n);DI()}a(bj,"resetQueue");function DI(){if(clearTimeout(M_),M_=void 0,Xt[dn].length!==0){var n=Xt[dn].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)dc("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){dc("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,r)}else{var l=Date.now()-s,c=Math.max(s-i,1),u=Math.min(c*1.2,100);l>=u?(dc("RETRY",e.name,t),e.apply(null,t.concat([i]))):Xt[dn].push(n)}M_===void 0&&(M_=setTimeout(DI,0))}}a(DI,"retry")});var jn=v(ta=>{"use strict";var wj=Wr().fromCallback,Mn=mf(),Fse=["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(n=>typeof Mn[n]=="function");Object.assign(ta,Mn);Fse.forEach(n=>{ta[n]=wj(Mn[n])});ta.exists=function(n,e){return typeof e=="function"?Mn.exists(n,e):new Promise(t=>Mn.exists(n,t))};ta.read=function(n,e,t,r,i,s){return typeof s=="function"?Mn.read(n,e,t,r,i,s):new Promise((o,l)=>{Mn.read(n,e,t,r,i,(c,u,f)=>{if(c)return l(c);o({bytesRead:u,buffer:f})})})};ta.write=function(n,e,...t){return typeof t[t.length-1]=="function"?Mn.write(n,e,...t):new Promise((r,i)=>{Mn.write(n,e,...t,(s,o,l)=>{if(s)return i(s);r({bytesWritten:o,buffer:l})})})};ta.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?Mn.readv(n,e,...t):new Promise((r,i)=>{Mn.readv(n,e,...t,(s,o,l)=>{if(s)return i(s);r({bytesRead:o,buffers:l})})})};ta.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?Mn.writev(n,e,...t):new Promise((r,i)=>{Mn.writev(n,e,...t,(s,o,l)=>{if(s)return i(s);r({bytesWritten:o,buffers:l})})})};typeof Mn.realpath.native=="function"?ta.realpath.native=wj(Mn.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var vj=v(($2e,Ej)=>{"use strict";var Lse=require("path");Ej.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(Lse.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var xj=v((B2e,LI)=>{"use strict";var Tj=jn(),{checkPath:Aj}=vj(),Ij=a(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");LI.exports.makeDir=async(n,e)=>(Aj(n),Tj.mkdir(n,{mode:Ij(e),recursive:!0}));LI.exports.makeDirSync=(n,e)=>(Aj(n),Tj.mkdirSync(n,{mode:Ij(e),recursive:!0}))});var hs=v((q2e,Rj)=>{"use strict";var Nse=Wr().fromPromise,{makeDir:kse,makeDirSync:NI}=xj(),kI=Nse(kse);Rj.exports={mkdirs:kI,mkdirsSync:NI,mkdirp:kI,mkdirpSync:NI,ensureDir:kI,ensureDirSync:NI}});var Xa=v((G2e,Oj)=>{"use strict";var Mse=Wr().fromPromise,Cj=jn();function jse(n){return Cj.access(n).then(()=>!0).catch(()=>!1)}a(jse,"pathExists");Oj.exports={pathExists:Mse(jse),pathExistsSync:Cj.existsSync}});var MI=v((H2e,Pj)=>{"use strict";var gf=jn(),$se=Wr().fromPromise;async function Use(n,e,t){let r=await gf.open(n,"r+"),i=null;try{await gf.futimes(r,e,t)}finally{try{await gf.close(r)}catch(s){i=s}}if(i)throw i}a(Use,"utimesMillis");function Bse(n,e,t){let r=gf.openSync(n,"r+");return gf.futimesSync(r,e,t),gf.closeSync(r)}a(Bse,"utimesMillisSync");Pj.exports={utimesMillis:$se(Use),utimesMillisSync:Bse}});var pc=v((K2e,Nj)=>{"use strict";var yf=jn(),Hr=require("path"),Dj=Wr().fromPromise;function Vse(n,e,t){let r=t.dereference?i=>yf.stat(i,{bigint:!0}):i=>yf.lstat(i,{bigint:!0});return Promise.all([r(n),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}a(Vse,"getStats");function qse(n,e,t){let r,i=t.dereference?o=>yf.statSync(o,{bigint:!0}):o=>yf.lstatSync(o,{bigint:!0}),s=i(n);try{r=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:r}}a(qse,"getStatsSync");async function Gse(n,e,t,r){let{srcStat:i,destStat:s}=await Vse(n,e,r);if(s){if(Jp(i,s)){let o=Hr.basename(n),l=Hr.basename(e);if(t==="move"&&o!==l&&o.toLowerCase()===l.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 '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&jI(n,e))throw new Error($_(n,e,t));return{srcStat:i,destStat:s}}a(Gse,"checkPaths");function Wse(n,e,t,r){let{srcStat:i,destStat:s}=qse(n,e,r);if(s){if(Jp(i,s)){let o=Hr.basename(n),l=Hr.basename(e);if(t==="move"&&o!==l&&o.toLowerCase()===l.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 '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&jI(n,e))throw new Error($_(n,e,t));return{srcStat:i,destStat:s}}a(Wse,"checkPathsSync");async function Fj(n,e,t,r){let i=Hr.resolve(Hr.dirname(n)),s=Hr.resolve(Hr.dirname(t));if(s===i||s===Hr.parse(s).root)return;let o;try{o=await yf.stat(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(Jp(e,o))throw new Error($_(n,t,r));return Fj(n,e,s,r)}a(Fj,"checkParentPaths");function Lj(n,e,t,r){let i=Hr.resolve(Hr.dirname(n)),s=Hr.resolve(Hr.dirname(t));if(s===i||s===Hr.parse(s).root)return;let o;try{o=yf.statSync(s,{bigint:!0})}catch(l){if(l.code==="ENOENT")return;throw l}if(Jp(e,o))throw new Error($_(n,t,r));return Lj(n,e,s,r)}a(Lj,"checkParentPathsSync");function Jp(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}a(Jp,"areIdentical");function jI(n,e){let t=Hr.resolve(n).split(Hr.sep).filter(i=>i),r=Hr.resolve(e).split(Hr.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}a(jI,"isSrcSubdir");function $_(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}a($_,"errMsg");Nj.exports={checkPaths:Dj(Gse),checkPathsSync:Wse,checkParentPaths:Dj(Fj),checkParentPathsSync:Lj,isSrcSubdir:jI,areIdentical:Jp}});var Mj=v((Q2e,kj)=>{"use strict";async function Hse(n,e){let t=[];for await(let r of n)t.push(e(r).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(r=>r.then(i=>{if(i!==null)throw i})))}a(Hse,"asyncIteratorConcurrentProcess");kj.exports={asyncIteratorConcurrentProcess:Hse}});var Vj=v((J2e,Bj)=>{"use strict";var vn=jn(),Zp=require("path"),{mkdirs:zse}=hs(),{pathExists:Kse}=Xa(),{utimesMillis:Yse}=MI(),eh=pc(),{asyncIteratorConcurrentProcess:Qse}=Mj();async function Xse(n,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;
339
339
 
340
340
  see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:r,destStat:i}=await eh.checkPaths(n,e,"copy",t);if(await eh.checkParentPaths(n,r,e,"copy"),!await $j(n,e,t))return;let o=Zp.dirname(e);await Kse(o)||await zse(o),await Uj(i,n,e,t)}a(Xse,"copy");async function $j(n,e,t){return t.filter?t.filter(n,e):!0}a($j,"runFilter");async function Uj(n,e,t,r){let s=await(r.dereference?vn.stat:vn.lstat)(e);if(s.isDirectory())return toe(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Jse(s,n,e,t,r);if(s.isSymbolicLink())return roe(n,e,t,r);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(Uj,"getStatsAndPerformCopy");async function Jse(n,e,t,r,i){if(!e)return jj(n,t,r,i);if(i.overwrite)return await vn.unlink(r),jj(n,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}a(Jse,"onFile");async function jj(n,e,t,r){if(await vn.copyFile(e,t),r.preserveTimestamps){Zse(n.mode)&&await eoe(t,n.mode);let i=await vn.stat(e);await Yse(t,i.atime,i.mtime)}return vn.chmod(t,n.mode)}a(jj,"copyFile");function Zse(n){return(n&128)===0}a(Zse,"fileIsNotWritable");function eoe(n,e){return vn.chmod(n,e|128)}a(eoe,"makeFileWritable");async function toe(n,e,t,r,i){e||await vn.mkdir(r),await Qse(await vn.opendir(t),async s=>{let o=Zp.join(t,s.name),l=Zp.join(r,s.name);if(await $j(o,l,i)){let{destStat:u}=await eh.checkPaths(o,l,"copy",i);await Uj(u,o,l,i)}}),e||await vn.chmod(r,n.mode)}a(toe,"onDir");async function roe(n,e,t,r){let i=await vn.readlink(e);if(r.dereference&&(i=Zp.resolve(process.cwd(),i)),!n)return vn.symlink(i,t);let s=null;try{s=await vn.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return vn.symlink(i,t);throw o}if(r.dereference&&(s=Zp.resolve(process.cwd(),s)),eh.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(eh.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await vn.unlink(t),vn.symlink(i,t)}a(roe,"onLink");Bj.exports=Xse});var zj=v((eAe,Hj)=>{"use strict";var $n=mf(),th=require("path"),noe=hs().mkdirsSync,ioe=MI().utimesMillisSync,rh=pc();function soe(n,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;
341
341
 
@@ -348,15 +348,15 @@ GFS4: `),console.error(n)},"debug"));Xt[dn]||(_j=global[dn]||[],Sj(Xt,_j),Xt.clo
348
348
  `;for(let y=1;y<=s.linesAfter&&!(f+y>=c.length);y++){let b=e(i.buffer,l[f+y],c[f+y],i.position-(l[f]-l[f+y]),h);d+=n.repeat(" ",s.indent)+t((i.line+y+1).toString(),p)+" | "+b.str+`
349
349
  `}return d.replace(/\n$/,"")}return a(r,"makeSnippet"),GI=r,GI}function Bn(){if(c9)return WI;c9=1;let n=oh(),e=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],t=["scalar","sequence","mapping"];function r(s){let o={};return s!==null&&Object.keys(s).forEach(function(l){s[l].forEach(function(c){o[String(c)]=l})}),o}a(r,"compileStyleAliases");function i(s,o){if(o=o||{},Object.keys(o).forEach(function(l){if(e.indexOf(l)===-1)throw new n('Unknown option "'+l+'" 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(l){return l},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=r(o.styleAliases||null),t.indexOf(this.kind)===-1)throw new n('Unknown kind "'+this.kind+'" is specified for "'+s+'" YAML type.')}return a(i,"Type2"),WI=i,WI}function P9(){if(u9)return HI;u9=1;let n=oh(),e=Bn();function t(s,o){let l=[];return s[o].forEach(function(c){let u=l.length;l.forEach(function(f,d){f.tag===c.tag&&f.kind===c.kind&&f.multi===c.multi&&(u=d)}),l[u]=c}),l}a(t,"compileList");function r(){let s={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function o(l){l.multi?(s.multi[l.kind].push(l),s.multi.fallback.push(l)):s[l.kind][l.tag]=s.fallback[l.tag]=l}a(o,"collectType");for(let l=0,c=arguments.length;l<c;l+=1)arguments[l].forEach(o);return s}a(r,"compileMap");function i(s){return this.extend(s)}return a(i,"Schema2"),i.prototype.extend=a(function(o){let l=[],c=[];if(o instanceof e)c.push(o);else if(Array.isArray(o))c=c.concat(o);else if(o&&(Array.isArray(o.implicit)||Array.isArray(o.explicit)))o.implicit&&(l=l.concat(o.implicit)),o.explicit&&(c=c.concat(o.explicit));else throw new n("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");l.forEach(function(f){if(!(f instanceof e))throw new n("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(f.loadKind&&f.loadKind!=="scalar")throw new n("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 n("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),c.forEach(function(f){if(!(f instanceof e))throw new n("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(l),u.explicit=(this.explicit||[]).concat(c),u.compiledImplicit=t(u,"implicit"),u.compiledExplicit=t(u,"explicit"),u.compiledTypeMap=r(u.compiledImplicit,u.compiledExplicit),u},"extend"),HI=i,HI}function D9(){if(f9)return zI;f9=1;let n=Bn();return zI=new n("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(e){return e!==null?e:""},"construct")}),zI}function F9(){if(d9)return KI;d9=1;let n=Bn();return KI=new n("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(e){return e!==null?e:[]},"construct")}),KI}function L9(){if(p9)return YI;p9=1;let n=Bn();return YI=new n("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(e){return e!==null?e:{}},"construct")}),YI}function N9(){if(h9)return QI;h9=1;let n=P9();return QI=new n({explicit:[D9(),F9(),L9()]}),QI}function k9(){if(m9)return XI;m9=1;let n=Bn();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 r(i){return i===null}return a(r,"isNull"),XI=new n("tag:yaml.org,2002:null",{kind:"scalar",resolve:e,construct:t,predicate:r,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"}),XI}function M9(){if(g9)return JI;g9=1;let n=Bn();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 r(i){return Object.prototype.toString.call(i)==="[object Boolean]"}return a(r,"isBoolean"),JI=new n("tag:yaml.org,2002:bool",{kind:"scalar",resolve:e,construct:t,predicate:r,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"}),JI}function j9(){if(y9)return ZI;y9=1;let n=sh(),e=Bn();function t(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}a(t,"isHexCode");function r(u){return u>=48&&u<=55}a(r,"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(!r(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 l(u){return o(u)}a(l,"constructYamlInteger");function c(u){return Object.prototype.toString.call(u)==="[object Number]"&&u%1===0&&!n.isNegativeZero(u)}return a(c,"isInteger"),ZI=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:s,construct:l,predicate:c,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"]}}),ZI}function $9(){if(_9)return ex;_9=1;let n=sh(),e=Bn(),t=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),r=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function i(u){return u===null||!t.test(u)?!1:isFinite(parseFloat(u,10))?!0:r.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 l(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(n.isNegativeZero(u))return"-0.0";let d=u.toString(10);return o.test(d)?d.replace("e",".e"):d}a(l,"representYamlFloat");function c(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||n.isNegativeZero(u))}return a(c,"isFloat"),ex=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:i,construct:s,predicate:c,represent:l,defaultStyle:"lowercase"}),ex}function U9(){return b9||(b9=1,tx=N9().extend({implicit:[k9(),M9(),j9(),$9()]})),tx}function B9(){return S9||(S9=1,rx=U9()),rx}function V9(){if(w9)return nx;w9=1;let n=Bn(),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 r(o){return o===null?!1:e.exec(o)!==null||t.exec(o)!==null}a(r,"resolveYamlTimestamp");function i(o){let l=0,c=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(l=u[7].slice(0,3);l.length<3;)l+="0";l=+l}if(u[9]){let S=+u[10],I=+(u[11]||0);c=(S*60+I)*6e4,u[9]==="-"&&(c=-c)}let b=new Date(Date.UTC(f,d,p,h,_,y,l));return c&&b.setTime(b.getTime()-c),b}a(i,"constructYamlTimestamp");function s(o){return o.toISOString()}return a(s,"representYamlTimestamp"),nx=new n("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:r,construct:i,instanceOf:Date,represent:s}),nx}function q9(){if(E9)return ix;E9=1;let n=Bn();function e(t){return t==="<<"||t===null}return a(e,"resolveYamlMerge"),ix=new n("tag:yaml.org,2002:merge",{kind:"scalar",resolve:e}),ix}function G9(){if(v9)return sx;v9=1;let n=Bn(),e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
350
350
  \r`;function t(o){if(o===null)return!1;let l=0,c=o.length,u=e;for(let f=0;f<c;f++){let d=u.indexOf(o.charAt(f));if(!(d>64)){if(d<0)return!1;l+=6}}return l%8===0}a(t,"resolveYamlBinary");function r(o){let l=o.replace(/[\r\n=]/g,""),c=l.length,u=e,f=0,d=[];for(let h=0;h<c;h++)h%4===0&&h&&(d.push(f>>16&255),d.push(f>>8&255),d.push(f&255)),f=f<<6|u.indexOf(l.charAt(h));let p=c%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(r,"constructYamlBinary");function i(o){let l="",c=0,u=o.length,f=e;for(let p=0;p<u;p++)p%3===0&&p&&(l+=f[c>>18&63],l+=f[c>>12&63],l+=f[c>>6&63],l+=f[c&63]),c=(c<<8)+o[p];let d=u%3;return d===0?(l+=f[c>>18&63],l+=f[c>>12&63],l+=f[c>>6&63],l+=f[c&63]):d===2?(l+=f[c>>10&63],l+=f[c>>4&63],l+=f[c<<2&63],l+=f[64]):d===1&&(l+=f[c>>2&63],l+=f[c<<4&63],l+=f[64],l+=f[64]),l}a(i,"representYamlBinary");function s(o){return Object.prototype.toString.call(o)==="[object Uint8Array]"}return a(s,"isBinary"),sx=new n("tag:yaml.org,2002:binary",{kind:"scalar",resolve:t,construct:r,predicate:s,represent:i}),sx}function W9(){if(T9)return ox;T9=1;let n=Bn(),e=Object.prototype.hasOwnProperty,t=Object.prototype.toString;function r(s){if(s===null)return!0;let o={},l=s;for(let c=0,u=l.length;c<u;c+=1){let f=l[c],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||e.call(o,p))return!1;Object.defineProperty(o,p,{value:!0})}return!0}a(r,"resolveYamlOmap");function i(s){return s!==null?s:[]}return a(i,"constructYamlOmap"),ox=new n("tag:yaml.org,2002:omap",{kind:"sequence",resolve:r,construct:i}),ox}function H9(){if(A9)return ax;A9=1;let n=Bn(),e=Object.prototype.toString;function t(i){if(i===null)return!0;let s=i,o=new Array(s.length);for(let l=0,c=s.length;l<c;l+=1){let u=s[l];if(e.call(u)!=="[object Object]")return!1;let f=Object.keys(u);if(f.length!==1)return!1;o[l]=[f[0],u[f[0]]]}return!0}a(t,"resolveYamlPairs");function r(i){if(i===null)return[];let s=i,o=new Array(s.length);for(let l=0,c=s.length;l<c;l+=1){let u=s[l],f=Object.keys(u);o[l]=[f[0],u[f[0]]]}return o}return a(r,"constructYamlPairs"),ax=new n("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:t,construct:r}),ax}function z9(){if(I9)return lx;I9=1;let n=Bn(),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 r(i){return i!==null?i:{}}return a(r,"constructYamlSet"),lx=new n("tag:yaml.org,2002:set",{kind:"mapping",resolve:t,construct:r}),lx}function fx(){return x9||(x9=1,cx=B9().extend({implicit:[V9(),q9()],explicit:[G9(),W9(),H9(),z9()]})),cx}function xae(){if(R9)return W_;R9=1;let n=sh(),e=oh(),t=Iae(),r=fx(),i=Object.prototype.hasOwnProperty,s=1,o=2,l=3,c=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-]+!)$/,b=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function S(m){return Object.prototype.toString.call(m)}a(S,"_class");function I(m){return m===10||m===13}a(I,"isEol");function O(m){return m===9||m===32}a(O,"isWhiteSpace");function T(m){return m===9||m===32||m===10||m===13}a(T,"isWsOrEol");function E(m){return m===44||m===91||m===93||m===123||m===125}a(E,"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 M(m){return m>=48&&m<=57?m-48:-1}a(M,"fromDecimalCode");function j(m){switch(m){case 48:return"\0";case 97:return"\x07";case 98:return"\b";case 116:return" ";case 9:return" ";case 110:return`
351
- `;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(j,"simpleEscapeSequence");function $(m){return m<=65535?String.fromCharCode(m):String.fromCharCode((m-65536>>10)+55296,(m-65536&1023)+56320)}a($,"charFromCodepoint");function G(m,L,U){L==="__proto__"?Object.defineProperty(m,L,{configurable:!0,enumerable:!0,writable:!0,value:U}):m[L]=U}a(G,"setProperty");let ge=new Array(256),ye=new Array(256);for(let m=0;m<256;m++)ge[m]=j(m)?1:0,ye[m]=j(m);function Q(m,L){this.input=m,this.filename=L.filename||null,this.schema=L.schema||r,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(Q,"State");function se(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(se,"generateError");function J(m,L){throw se(m,L)}a(J,"throwError");function ve(m,L){m.onWarning&&m.onWarning.call(null,se(m,L))}a(ve,"throwWarning");function te(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(te,"storeAnchor");function ie(m){m.anchorMapTransactions.push(Object.create(null))}a(ie,"beginAnchorTransaction");function he(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,w=C.length;D<w;D+=1){let F=C[D];i.call(R,F)||(R[F]=L[F])}}a(he,"commitAnchorTransaction");function Ue(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(Ue,"rollbackAnchorTransaction");function ce(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(ce,"snapshotState");function ue(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(ue,"restoreState");let fe={YAML:a(function(L,U,R){L.version!==null&&J(L,"duplication of %YAML directive"),R.length!==1&&J(L,"YAML directive accepts exactly one argument");let C=/^([0-9]+)\.([0-9]+)$/.exec(R[0]);C===null&&J(L,"ill-formed argument of the YAML directive");let D=parseInt(C[1],10),w=parseInt(C[2],10);D!==1&&J(L,"unacceptable YAML version of the document"),L.version=R[0],L.checkLineBreaks=w<2,w!==1&&w!==2&&ve(L,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(L,U,R){let C;R.length!==2&&J(L,"TAG directive accepts exactly two arguments");let D=R[0];C=R[1],y.test(D)||J(L,"ill-formed tag handle (first argument) of the TAG directive"),i.call(L.tagMap,D)&&J(L,'there is a previously declared suffix for "'+D+'" tag handle'),b.test(C)||J(L,"ill-formed tag prefix (second argument) of the TAG directive");try{C=decodeURIComponent(C)}catch{J(L,"tag prefix is malformed: "+C)}L.tagMap[D]=C},"handleTagDirective")};function ne(m,L,U,R){if(L<U){let C=m.input.slice(L,U);if(R)for(let D=0,w=C.length;D<w;D+=1){let F=C.charCodeAt(D);F===9||F>=32&&F<=1114111||J(m,"expected valid JSON character")}else p.test(C)&&J(m,"the stream contains non-printable characters");m.result+=C}}a(ne,"captureSegment");function me(m,L,U,R){n.isObject(U)||J(m,"cannot merge mappings; the provided source object is unacceptable");let C=Object.keys(U);for(let D=0,w=C.length;D<w;D+=1){let F=C[D];m.maxTotalMergeKeys!==-1&&++m.totalMergeKeys>m.maxTotalMergeKeys&&J(m,"merge keys exceeded maxTotalMergeKeys ("+m.maxTotalMergeKeys+")"),i.call(L,F)||(G(L,F,U[F]),R[F]=!0)}}a(me,"mergeMappings");function Le(m,L,U,R,C,D,w,F,X){if(Array.isArray(C)){C=Array.prototype.slice.call(C);for(let H=0,q=C.length;H<q;H+=1)Array.isArray(C[H])&&J(m,"nested arrays are not supported inside keys"),typeof C=="object"&&S(C[H])==="[object Object]"&&(C[H]="[object Object]")}if(typeof C=="object"&&S(C)==="[object Object]"&&(C="[object Object]"),C=String(C),L===null&&(L={}),R==="tag:yaml.org,2002:merge")if(Array.isArray(D))for(let H=0,q=D.length;H<q;H+=1)me(m,L,D[H],U);else me(m,L,D,U);else!m.json&&!i.call(U,C)&&i.call(L,C)&&(m.line=w||m.line,m.lineStart=F||m.lineStart,m.position=X||m.position,J(m,"duplicated mapping key")),G(L,C,D),delete U[C];return L}a(Le,"storeMappingPair");function B(m){let L=m.input.charCodeAt(m.position);L===10?m.position++:L===13?(m.position++,m.input.charCodeAt(m.position)===10&&m.position++):J(m,"a line break is expected"),m.line+=1,m.lineStart=m.position,m.firstTabInLine=-1}a(B,"readLineBreak");function oe(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(I(C))for(B(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&&ve(m,"deficient indentation"),R}a(oe,"skipSeparationSpace");function Ee(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||T(U)))}a(Ee,"testDocumentSeparator");function Ce(m,L){L===1?m.result+=" ":L>1&&(m.result+=n.repeat(`
352
- `,L-1))}a(Ce,"writeFoldedLines");function xe(m,L,U){let R,C,D,w,F,X,H=m.kind,q=m.result,k=m.input.charCodeAt(m.position);if(T(k)||E(k)||k===35||k===38||k===42||k===33||k===124||k===62||k===39||k===34||k===37||k===64||k===96)return!1;if(k===63||k===45){let N=m.input.charCodeAt(m.position+1);if(T(N)||U&&E(N))return!1}for(m.kind="scalar",m.result="",R=C=m.position,D=!1;k!==0;){if(k===58){let N=m.input.charCodeAt(m.position+1);if(T(N)||U&&E(N))break}else if(k===35){let N=m.input.charCodeAt(m.position-1);if(T(N))break}else{if(m.position===m.lineStart&&Ee(m)||U&&E(k))break;if(I(k))if(w=m.line,F=m.lineStart,X=m.lineIndent,oe(m,!1,-1),m.lineIndent>=L){D=!0,k=m.input.charCodeAt(m.position);continue}else{m.position=C,m.line=w,m.lineStart=F,m.lineIndent=X;break}}D&&(ne(m,R,C,!1),Ce(m,m.line-w),R=C=m.position,D=!1),O(k)||(C=m.position+1),k=m.input.charCodeAt(++m.position)}return ne(m,R,C,!1),m.result?!0:(m.kind=H,m.result=q,!1)}a(xe,"readPlainScalar");function Oe(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(ne(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 I(C)?(ne(m,U,R,!0),Ce(m,oe(m,!1,L)),U=R=m.position):m.position===m.lineStart&&Ee(m)?J(m,"unexpected end of the document within a single quoted scalar"):(m.position++,O(C)||(R=m.position));J(m,"unexpected end of the stream within a single quoted scalar")}a(Oe,"readSingleQuotedScalar");function Re(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 ne(m,U,m.position,!0),m.position++,!0;if(D===92){if(ne(m,U,m.position,!0),D=m.input.charCodeAt(++m.position),I(D))oe(m,!1,L);else if(D<256&&ge[D])m.result+=ye[D],m.position++;else if((C=V(D))>0){let w=C,F=0;for(;w>0;w--)D=m.input.charCodeAt(++m.position),(C=P(D))>=0?F=(F<<4)+C:J(m,"expected hexadecimal character");m.result+=$(F),m.position++}else J(m,"unknown escape sequence");U=R=m.position}else I(D)?(ne(m,U,R,!0),Ce(m,oe(m,!1,L)),U=R=m.position):m.position===m.lineStart&&Ee(m)?J(m,"unexpected end of the document within a double quoted scalar"):(m.position++,O(D)||(R=m.position))}J(m,"unexpected end of the stream within a double quoted scalar")}a(Re,"readDoubleQuotedScalar");function Ae(m,L){let U=!0,R,C,D,w=m.tag,F,X=m.anchor,H,q,k,N,z=Object.create(null),K,ae,Se,De=m.input.charCodeAt(m.position);if(De===91)H=93,N=!1,F=[];else if(De===123)H=125,N=!0,F={};else return!1;for(m.anchor!==null&&te(m,m.anchor,F),De=m.input.charCodeAt(++m.position);De!==0;){if(oe(m,!0,L),De=m.input.charCodeAt(m.position),De===H)return m.position++,m.tag=w,m.anchor=X,m.kind=N?"mapping":"sequence",m.result=F,!0;if(U?De===44&&J(m,"expected the node content, but found ','"):J(m,"missed comma between flow collection entries"),ae=K=Se=null,q=k=!1,De===63){let rt=m.input.charCodeAt(m.position+1);T(rt)&&(q=k=!0,m.position++,oe(m,!0,L))}R=m.line,C=m.lineStart,D=m.position,ke(m,L,s,!1,!0),ae=m.tag,K=m.result,oe(m,!0,L),De=m.input.charCodeAt(m.position),(k||m.line===R)&&De===58&&(q=!0,De=m.input.charCodeAt(++m.position),oe(m,!0,L),ke(m,L,s,!1,!0),Se=m.result),N?Le(m,F,z,ae,K,Se,R,C,D):q?F.push(Le(m,null,z,ae,K,Se,R,C,D)):F.push(K),oe(m,!0,L),De=m.input.charCodeAt(m.position),De===44?(U=!0,De=m.input.charCodeAt(++m.position)):U=!1}J(m,"unexpected end of the stream within a flow collection")}a(Ae,"readFlowCollection");function ee(m,L){let U,R=u,C=!1,D=!1,w=L,F=0,X=!1,H,q=m.input.charCodeAt(m.position);if(q===124)U=!1;else if(q===62)U=!0;else return!1;for(m.kind="scalar",m.result="";q!==0;)if(q=m.input.charCodeAt(++m.position),q===43||q===45)u===R?R=q===43?d:f:J(m,"repeat of a chomping mode identifier");else if((H=M(q))>=0)H===0?J(m,"bad explicit indentation width of a block scalar; it cannot be less than one"):D?J(m,"repeat of an indentation width identifier"):(w=L+H-1,D=!0);else break;if(O(q)){do q=m.input.charCodeAt(++m.position);while(O(q));if(q===35)do q=m.input.charCodeAt(++m.position);while(!I(q)&&q!==0)}for(;q!==0;){for(B(m),m.lineIndent=0,q=m.input.charCodeAt(m.position);(!D||m.lineIndent<w)&&q===32;)m.lineIndent++,q=m.input.charCodeAt(++m.position);if(!D&&m.lineIndent>w&&(w=m.lineIndent),I(q)){F++;continue}if(!D&&w===0&&J(m,"missing indentation for block scalar"),m.lineIndent<w){R===d?m.result+=n.repeat(`
351
+ `;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(j,"simpleEscapeSequence");function $(m){return m<=65535?String.fromCharCode(m):String.fromCharCode((m-65536>>10)+55296,(m-65536&1023)+56320)}a($,"charFromCodepoint");function G(m,L,U){L==="__proto__"?Object.defineProperty(m,L,{configurable:!0,enumerable:!0,writable:!0,value:U}):m[L]=U}a(G,"setProperty");let ge=new Array(256),ye=new Array(256);for(let m=0;m<256;m++)ge[m]=j(m)?1:0,ye[m]=j(m);function Q(m,L){this.input=m,this.filename=L.filename||null,this.schema=L.schema||r,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(Q,"State");function se(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(se,"generateError");function J(m,L){throw se(m,L)}a(J,"throwError");function ve(m,L){m.onWarning&&m.onWarning.call(null,se(m,L))}a(ve,"throwWarning");function re(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(re,"storeAnchor");function ie(m){m.anchorMapTransactions.push(Object.create(null))}a(ie,"beginAnchorTransaction");function he(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,w=C.length;D<w;D+=1){let F=C[D];i.call(R,F)||(R[F]=L[F])}}a(he,"commitAnchorTransaction");function Ue(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(Ue,"rollbackAnchorTransaction");function ce(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(ce,"snapshotState");function ue(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(ue,"restoreState");let fe={YAML:a(function(L,U,R){L.version!==null&&J(L,"duplication of %YAML directive"),R.length!==1&&J(L,"YAML directive accepts exactly one argument");let C=/^([0-9]+)\.([0-9]+)$/.exec(R[0]);C===null&&J(L,"ill-formed argument of the YAML directive");let D=parseInt(C[1],10),w=parseInt(C[2],10);D!==1&&J(L,"unacceptable YAML version of the document"),L.version=R[0],L.checkLineBreaks=w<2,w!==1&&w!==2&&ve(L,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(L,U,R){let C;R.length!==2&&J(L,"TAG directive accepts exactly two arguments");let D=R[0];C=R[1],y.test(D)||J(L,"ill-formed tag handle (first argument) of the TAG directive"),i.call(L.tagMap,D)&&J(L,'there is a previously declared suffix for "'+D+'" tag handle'),b.test(C)||J(L,"ill-formed tag prefix (second argument) of the TAG directive");try{C=decodeURIComponent(C)}catch{J(L,"tag prefix is malformed: "+C)}L.tagMap[D]=C},"handleTagDirective")};function ne(m,L,U,R){if(L<U){let C=m.input.slice(L,U);if(R)for(let D=0,w=C.length;D<w;D+=1){let F=C.charCodeAt(D);F===9||F>=32&&F<=1114111||J(m,"expected valid JSON character")}else p.test(C)&&J(m,"the stream contains non-printable characters");m.result+=C}}a(ne,"captureSegment");function me(m,L,U,R){n.isObject(U)||J(m,"cannot merge mappings; the provided source object is unacceptable");let C=Object.keys(U);for(let D=0,w=C.length;D<w;D+=1){let F=C[D];m.maxTotalMergeKeys!==-1&&++m.totalMergeKeys>m.maxTotalMergeKeys&&J(m,"merge keys exceeded maxTotalMergeKeys ("+m.maxTotalMergeKeys+")"),i.call(L,F)||(G(L,F,U[F]),R[F]=!0)}}a(me,"mergeMappings");function Le(m,L,U,R,C,D,w,F,X){if(Array.isArray(C)){C=Array.prototype.slice.call(C);for(let H=0,q=C.length;H<q;H+=1)Array.isArray(C[H])&&J(m,"nested arrays are not supported inside keys"),typeof C=="object"&&S(C[H])==="[object Object]"&&(C[H]="[object Object]")}if(typeof C=="object"&&S(C)==="[object Object]"&&(C="[object Object]"),C=String(C),L===null&&(L={}),R==="tag:yaml.org,2002:merge")if(Array.isArray(D))for(let H=0,q=D.length;H<q;H+=1)me(m,L,D[H],U);else me(m,L,D,U);else!m.json&&!i.call(U,C)&&i.call(L,C)&&(m.line=w||m.line,m.lineStart=F||m.lineStart,m.position=X||m.position,J(m,"duplicated mapping key")),G(L,C,D),delete U[C];return L}a(Le,"storeMappingPair");function B(m){let L=m.input.charCodeAt(m.position);L===10?m.position++:L===13?(m.position++,m.input.charCodeAt(m.position)===10&&m.position++):J(m,"a line break is expected"),m.line+=1,m.lineStart=m.position,m.firstTabInLine=-1}a(B,"readLineBreak");function oe(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(I(C))for(B(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&&ve(m,"deficient indentation"),R}a(oe,"skipSeparationSpace");function Ee(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||T(U)))}a(Ee,"testDocumentSeparator");function Ce(m,L){L===1?m.result+=" ":L>1&&(m.result+=n.repeat(`
352
+ `,L-1))}a(Ce,"writeFoldedLines");function xe(m,L,U){let R,C,D,w,F,X,H=m.kind,q=m.result,k=m.input.charCodeAt(m.position);if(T(k)||E(k)||k===35||k===38||k===42||k===33||k===124||k===62||k===39||k===34||k===37||k===64||k===96)return!1;if(k===63||k===45){let N=m.input.charCodeAt(m.position+1);if(T(N)||U&&E(N))return!1}for(m.kind="scalar",m.result="",R=C=m.position,D=!1;k!==0;){if(k===58){let N=m.input.charCodeAt(m.position+1);if(T(N)||U&&E(N))break}else if(k===35){let N=m.input.charCodeAt(m.position-1);if(T(N))break}else{if(m.position===m.lineStart&&Ee(m)||U&&E(k))break;if(I(k))if(w=m.line,F=m.lineStart,X=m.lineIndent,oe(m,!1,-1),m.lineIndent>=L){D=!0,k=m.input.charCodeAt(m.position);continue}else{m.position=C,m.line=w,m.lineStart=F,m.lineIndent=X;break}}D&&(ne(m,R,C,!1),Ce(m,m.line-w),R=C=m.position,D=!1),O(k)||(C=m.position+1),k=m.input.charCodeAt(++m.position)}return ne(m,R,C,!1),m.result?!0:(m.kind=H,m.result=q,!1)}a(xe,"readPlainScalar");function Oe(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(ne(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 I(C)?(ne(m,U,R,!0),Ce(m,oe(m,!1,L)),U=R=m.position):m.position===m.lineStart&&Ee(m)?J(m,"unexpected end of the document within a single quoted scalar"):(m.position++,O(C)||(R=m.position));J(m,"unexpected end of the stream within a single quoted scalar")}a(Oe,"readSingleQuotedScalar");function Re(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 ne(m,U,m.position,!0),m.position++,!0;if(D===92){if(ne(m,U,m.position,!0),D=m.input.charCodeAt(++m.position),I(D))oe(m,!1,L);else if(D<256&&ge[D])m.result+=ye[D],m.position++;else if((C=V(D))>0){let w=C,F=0;for(;w>0;w--)D=m.input.charCodeAt(++m.position),(C=P(D))>=0?F=(F<<4)+C:J(m,"expected hexadecimal character");m.result+=$(F),m.position++}else J(m,"unknown escape sequence");U=R=m.position}else I(D)?(ne(m,U,R,!0),Ce(m,oe(m,!1,L)),U=R=m.position):m.position===m.lineStart&&Ee(m)?J(m,"unexpected end of the document within a double quoted scalar"):(m.position++,O(D)||(R=m.position))}J(m,"unexpected end of the stream within a double quoted scalar")}a(Re,"readDoubleQuotedScalar");function Ae(m,L){let U=!0,R,C,D,w=m.tag,F,X=m.anchor,H,q,k,N,z=Object.create(null),K,ae,Se,De=m.input.charCodeAt(m.position);if(De===91)H=93,N=!1,F=[];else if(De===123)H=125,N=!0,F={};else return!1;for(m.anchor!==null&&re(m,m.anchor,F),De=m.input.charCodeAt(++m.position);De!==0;){if(oe(m,!0,L),De=m.input.charCodeAt(m.position),De===H)return m.position++,m.tag=w,m.anchor=X,m.kind=N?"mapping":"sequence",m.result=F,!0;if(U?De===44&&J(m,"expected the node content, but found ','"):J(m,"missed comma between flow collection entries"),ae=K=Se=null,q=k=!1,De===63){let rt=m.input.charCodeAt(m.position+1);T(rt)&&(q=k=!0,m.position++,oe(m,!0,L))}R=m.line,C=m.lineStart,D=m.position,ke(m,L,s,!1,!0),ae=m.tag,K=m.result,oe(m,!0,L),De=m.input.charCodeAt(m.position),(k||m.line===R)&&De===58&&(q=!0,De=m.input.charCodeAt(++m.position),oe(m,!0,L),ke(m,L,s,!1,!0),Se=m.result),N?Le(m,F,z,ae,K,Se,R,C,D):q?F.push(Le(m,null,z,ae,K,Se,R,C,D)):F.push(K),oe(m,!0,L),De=m.input.charCodeAt(m.position),De===44?(U=!0,De=m.input.charCodeAt(++m.position)):U=!1}J(m,"unexpected end of the stream within a flow collection")}a(Ae,"readFlowCollection");function ee(m,L){let U,R=u,C=!1,D=!1,w=L,F=0,X=!1,H,q=m.input.charCodeAt(m.position);if(q===124)U=!1;else if(q===62)U=!0;else return!1;for(m.kind="scalar",m.result="";q!==0;)if(q=m.input.charCodeAt(++m.position),q===43||q===45)u===R?R=q===43?d:f:J(m,"repeat of a chomping mode identifier");else if((H=M(q))>=0)H===0?J(m,"bad explicit indentation width of a block scalar; it cannot be less than one"):D?J(m,"repeat of an indentation width identifier"):(w=L+H-1,D=!0);else break;if(O(q)){do q=m.input.charCodeAt(++m.position);while(O(q));if(q===35)do q=m.input.charCodeAt(++m.position);while(!I(q)&&q!==0)}for(;q!==0;){for(B(m),m.lineIndent=0,q=m.input.charCodeAt(m.position);(!D||m.lineIndent<w)&&q===32;)m.lineIndent++,q=m.input.charCodeAt(++m.position);if(!D&&m.lineIndent>w&&(w=m.lineIndent),I(q)){F++;continue}if(!D&&w===0&&J(m,"missing indentation for block scalar"),m.lineIndent<w){R===d?m.result+=n.repeat(`
353
353
  `,C?1+F:F):R===u&&C&&(m.result+=`
354
354
  `);break}U?O(q)?(X=!0,m.result+=n.repeat(`
355
355
  `,C?1+F:F)):X?(X=!1,m.result+=n.repeat(`
356
356
  `,F+1)):F===0?C&&(m.result+=" "):m.result+=n.repeat(`
357
357
  `,F):m.result+=n.repeat(`
358
- `,C?1+F:F),C=!0,D=!0,F=0;let k=m.position;for(;!I(q)&&q!==0;)q=m.input.charCodeAt(++m.position);ne(m,k,m.position,!1)}return!0}a(ee,"readBlockScalar");function _e(m,L){let U=m.tag,R=m.anchor,C=[],D=!1;if(m.firstTabInLine!==-1)return!1;m.anchor!==null&&te(m,m.anchor,C);let w=m.input.charCodeAt(m.position);for(;w!==0&&(m.firstTabInLine!==-1&&(m.position=m.firstTabInLine,J(m,"tab characters must not be used in indentation")),w===45);){let F=m.input.charCodeAt(m.position+1);if(!T(F))break;if(D=!0,m.position++,oe(m,!0,-1)&&m.lineIndent<=L){C.push(null),w=m.input.charCodeAt(m.position);continue}let X=m.line;if(ke(m,L,l,!1,!0),C.push(m.result),oe(m,!0,-1),w=m.input.charCodeAt(m.position),(m.line===X||m.lineIndent>L)&&w!==0)J(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(_e,"readBlockSequence");function Te(m,L,U){let R,C,D,w,F=m.tag,X=m.anchor,H={},q=Object.create(null),k=null,N=null,z=null,K=!1,ae=!1;if(m.firstTabInLine!==-1)return!1;m.anchor!==null&&te(m,m.anchor,H);let Se=m.input.charCodeAt(m.position);for(;Se!==0;){!K&&m.firstTabInLine!==-1&&(m.position=m.firstTabInLine,J(m,"tab characters must not be used in indentation"));let De=m.input.charCodeAt(m.position+1),rt=m.line;if((Se===63||Se===58)&&T(De))Se===63?(K&&(Le(m,H,q,k,N,null,C,D,w),k=N=z=null),ae=!0,K=!0,R=!0):K?(K=!1,R=!0):J(m,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),m.position+=1,Se=De;else{if(C=m.line,D=m.lineStart,w=m.position,!ke(m,U,o,!1,!0))break;if(m.line===rt){for(Se=m.input.charCodeAt(m.position);O(Se);)Se=m.input.charCodeAt(++m.position);if(Se===58)Se=m.input.charCodeAt(++m.position),T(Se)||J(m,"a whitespace character is expected after the key-value separator within a block mapping"),K&&(Le(m,H,q,k,N,null,C,D,w),k=N=z=null),ae=!0,K=!1,R=!1,k=m.tag,N=m.result;else if(ae)J(m,"can not read an implicit mapping pair; a colon is missed");else return m.tag=F,m.anchor=X,!0}else if(ae)J(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)&&(K&&(C=m.line,D=m.lineStart,w=m.position),ke(m,L,c,!0,R)&&(K?N=m.result:z=m.result),K||(Le(m,H,q,k,N,z,C,D,w),k=N=z=null),oe(m,!0,-1),Se=m.input.charCodeAt(m.position)),(m.line===rt||m.lineIndent>L)&&Se!==0)J(m,"bad indentation of a mapping entry");else if(m.lineIndent<L)break}return K&&Le(m,H,q,k,N,null,C,D,w),ae&&(m.tag=F,m.anchor=X,m.kind="mapping",m.result=H),ae}a(Te,"readBlockMapping");function Pe(m){let L=!1,U=!1,R,C,D=m.input.charCodeAt(m.position);if(D!==33)return!1;m.tag!==null&&J(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 w=m.position;if(L){do D=m.input.charCodeAt(++m.position);while(D!==0&&D!==62);m.position<m.length?(C=m.input.slice(w,m.position),D=m.input.charCodeAt(++m.position)):J(m,"unexpected end of the stream within a verbatim tag")}else{for(;D!==0&&!T(D);)D===33&&(U?J(m,"tag suffix cannot contain exclamation marks"):(R=m.input.slice(w-1,m.position+1),y.test(R)||J(m,"named tag handle cannot contain such characters"),U=!0,w=m.position+1)),D=m.input.charCodeAt(++m.position);C=m.input.slice(w,m.position),_.test(C)&&J(m,"tag suffix cannot contain flow indicator characters")}C&&!b.test(C)&&J(m,"tag name cannot contain such characters: "+C);try{C=decodeURIComponent(C)}catch{J(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:J(m,'undeclared tag handle "'+R+'"'),!0}a(Pe,"readTagProperty");function Me(m){let L=m.input.charCodeAt(m.position);if(L!==38)return!1;m.anchor!==null&&J(m,"duplication of an anchor property"),L=m.input.charCodeAt(++m.position);let U=m.position;for(;L!==0&&!T(L)&&!E(L);)L=m.input.charCodeAt(++m.position);return m.position===U&&J(m,"name of an anchor node must contain at least one character"),m.anchor=m.input.slice(U,m.position),!0}a(Me,"readAnchorProperty");function Ne(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&&!T(L)&&!E(L);)L=m.input.charCodeAt(++m.position);m.position===U&&J(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)||J(m,'unidentified alias "'+R+'"'),m.result=m.anchorMap[R],oe(m,!0,-1),!0}a(Ne,"readAlias");function Ge(m,L,U,R){let C=ce(m);return ie(m),ue(m,L),m.tag=null,m.anchor=null,m.kind=null,m.result=null,Te(m,U,R)&&m.kind==="mapping"?(he(m),!0):(Ue(m),ue(m,C),!1)}a(Ge,"tryReadBlockMappingFromProperty");function ke(m,L,U,R,C){let D,w,F=1,X=!1,H=!1,q=null,k,N,z;m.depth>=m.maxDepth&&J(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 K=D=w=c===U||l===U;if(R&&oe(m,!0,-1)&&(X=!0,m.lineIndent>L?F=1:m.lineIndent===L?F=0:m.lineIndent<L&&(F=-1)),F===1)for(;;){let ae=m.input.charCodeAt(m.position),Se=ce(m);if(X&&(ae===33&&m.tag!==null||ae===38&&m.anchor!==null)||!Pe(m)&&!Me(m))break;q===null&&(q=Se),oe(m,!0,-1)?(X=!0,w=K,m.lineIndent>L?F=1:m.lineIndent===L?F=0:m.lineIndent<L&&(F=-1)):w=!1}if(w&&(w=X||C),F===1||c===U)if(s===U||o===U?N=L:N=L+1,z=m.position-m.lineStart,F===1)if(w&&(_e(m,z)||Te(m,z,N))||Ae(m,N))H=!0;else{let ae=m.input.charCodeAt(m.position);q!==null&&K&&!w&&ae!==124&&ae!==62&&Ge(m,q,q.position-q.lineStart,N)||D&&ee(m,N)||Oe(m,N)||Re(m,N)?H=!0:Ne(m)?(H=!0,(m.tag!==null||m.anchor!==null)&&J(m,"alias node should not have any properties")):xe(m,N,s===U)&&(H=!0,m.tag===null&&(m.tag="?")),m.anchor!==null&&te(m,m.anchor,m.result)}else F===0&&(H=w&&_e(m,z));if(m.tag===null)m.anchor!==null&&te(m,m.anchor,m.result);else if(m.tag==="?"){m.result!==null&&m.kind!=="scalar"&&J(m,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+m.kind+'"');for(let ae=0,Se=m.implicitTypes.length;ae<Se;ae+=1)if(k=m.implicitTypes[ae],k.resolve(m.result)){m.result=k.construct(m.result),m.tag=k.tag,m.anchor!==null&&te(m,m.anchor,m.result);break}}else if(m.tag!=="!"){if(i.call(m.typeMap[m.kind||"fallback"],m.tag))k=m.typeMap[m.kind||"fallback"][m.tag];else{k=null;let ae=m.typeMap.multi[m.kind||"fallback"];for(let Se=0,De=ae.length;Se<De;Se+=1)if(m.tag.slice(0,ae[Se].tag.length)===ae[Se].tag){k=ae[Se];break}}k||J(m,"unknown tag !<"+m.tag+">"),m.result!==null&&k.kind!==m.kind&&J(m,"unacceptable node kind for !<"+m.tag+'> tag; it should be "'+k.kind+'", not "'+m.kind+'"'),k.resolve(m.result,m.tag)?(m.result=k.construct(m.result,m.tag),m.anchor!==null&&te(m,m.anchor,m.result)):J(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||H}a(ke,"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&&(oe(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&&!T(R);)R=m.input.charCodeAt(++m.position);let D=m.input.slice(C,m.position),w=[];for(D.length<1&&J(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&&!I(R));break}if(I(R))break;for(C=m.position;R!==0&&!T(R);)R=m.input.charCodeAt(++m.position);w.push(m.input.slice(C,m.position))}R!==0&&B(m),i.call(fe,D)?fe[D](m,D,w):ve(m,'unknown document directive "'+D+'"')}if(oe(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,oe(m,!0,-1)):U&&J(m,"directives end mark is expected"),ke(m,m.lineIndent-1,c,!1,!0),oe(m,!0,-1),m.checkLineBreaks&&h.test(m.input.slice(L,m.position))&&ve(m,"non-ASCII line breaks are interpreted as content"),m.documents.push(m.result),m.position===m.lineStart&&Ee(m)){m.input.charCodeAt(m.position)===46&&(m.position+=3,oe(m,!0,-1));return}m.position<m.length-1&&J(m,"end of the stream or a document separator is expected")}a(We,"readDocument");function qe(m,L){m=String(m),L=L||{},m.length!==0&&(m.charCodeAt(m.length-1)!==10&&m.charCodeAt(m.length-1)!==13&&(m+=`
359
- `),m.charCodeAt(0)===65279&&(m=m.slice(1)));let U=new Q(m,L),R=m.indexOf("\0");for(R!==-1&&(U.position=R,J(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(qe,"loadDocuments");function je(m,L,U){L!==null&&typeof L=="object"&&typeof U>"u"&&(U=L,L=null);let R=qe(m,U);if(typeof L!="function")return R;for(let C=0,D=R.length;C<D;C+=1)L(R[C])}a(je,"loadAll2");function He(m,L){let U=qe(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"),W_.loadAll=je,W_.load=He,W_}function Rae(){if(C9)return ux;C9=1;let n=sh(),e=oh(),t=fx(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,s=65279,o=9,l=10,c=13,u=32,f=33,d=34,p=35,h=37,_=38,y=39,b=42,S=44,I=45,O=58,T=61,E=62,P=63,V=64,M=91,j=93,$=96,G=123,ge=124,ye=125,Q={};Q[0]="\\0",Q[7]="\\a",Q[8]="\\b",Q[9]="\\t",Q[10]="\\n",Q[11]="\\v",Q[12]="\\f",Q[13]="\\r",Q[27]="\\e",Q[34]='\\"',Q[92]="\\\\",Q[133]="\\N",Q[160]="\\_",Q[8232]="\\L",Q[8233]="\\P";let se=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],J=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ve(w,F){if(F===null)return{};let X={},H=Object.keys(F);for(let q=0,k=H.length;q<k;q+=1){let N=H[q],z=String(F[N]);N.slice(0,2)==="!!"&&(N="tag:yaml.org,2002:"+N.slice(2));let K=w.compiledTypeMap.fallback[N];K&&i.call(K.styleAliases,z)&&(z=K.styleAliases[z]),X[N]=z}return X}a(ve,"compileStyleMap");function te(w){let F,X,H=w.toString(16).toUpperCase();if(w<=255)F="x",X=2;else if(w<=65535)F="u",X=4;else if(w<=4294967295)F="U",X=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+F+n.repeat("0",X-H.length)+H}a(te,"encodeHex");let ie=1,he=2;function Ue(w){this.schema=w.schema||t,this.indent=Math.max(1,w.indent||2),this.noArrayIndent=w.noArrayIndent||!1,this.skipInvalid=w.skipInvalid||!1,this.flowLevel=n.isNothing(w.flowLevel)?-1:w.flowLevel,this.styleMap=ve(this.schema,w.styles||null),this.sortKeys=w.sortKeys||!1,this.lineWidth=w.lineWidth||80,this.noRefs=w.noRefs||!1,this.noCompatMode=w.noCompatMode||!1,this.condenseFlow=w.condenseFlow||!1,this.quotingType=w.quotingType==='"'?he:ie,this.forceQuotes=w.forceQuotes||!1,this.replacer=typeof w.replacer=="function"?w.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}a(Ue,"State");function ce(w,F){let X=n.repeat(" ",F),H=0,q="",k=w.length;for(;H<k;){let N,z=w.indexOf(`
358
+ `,C?1+F:F),C=!0,D=!0,F=0;let k=m.position;for(;!I(q)&&q!==0;)q=m.input.charCodeAt(++m.position);ne(m,k,m.position,!1)}return!0}a(ee,"readBlockScalar");function _e(m,L){let U=m.tag,R=m.anchor,C=[],D=!1;if(m.firstTabInLine!==-1)return!1;m.anchor!==null&&re(m,m.anchor,C);let w=m.input.charCodeAt(m.position);for(;w!==0&&(m.firstTabInLine!==-1&&(m.position=m.firstTabInLine,J(m,"tab characters must not be used in indentation")),w===45);){let F=m.input.charCodeAt(m.position+1);if(!T(F))break;if(D=!0,m.position++,oe(m,!0,-1)&&m.lineIndent<=L){C.push(null),w=m.input.charCodeAt(m.position);continue}let X=m.line;if(ke(m,L,l,!1,!0),C.push(m.result),oe(m,!0,-1),w=m.input.charCodeAt(m.position),(m.line===X||m.lineIndent>L)&&w!==0)J(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(_e,"readBlockSequence");function Te(m,L,U){let R,C,D,w,F=m.tag,X=m.anchor,H={},q=Object.create(null),k=null,N=null,z=null,K=!1,ae=!1;if(m.firstTabInLine!==-1)return!1;m.anchor!==null&&re(m,m.anchor,H);let Se=m.input.charCodeAt(m.position);for(;Se!==0;){!K&&m.firstTabInLine!==-1&&(m.position=m.firstTabInLine,J(m,"tab characters must not be used in indentation"));let De=m.input.charCodeAt(m.position+1),rt=m.line;if((Se===63||Se===58)&&T(De))Se===63?(K&&(Le(m,H,q,k,N,null,C,D,w),k=N=z=null),ae=!0,K=!0,R=!0):K?(K=!1,R=!0):J(m,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),m.position+=1,Se=De;else{if(C=m.line,D=m.lineStart,w=m.position,!ke(m,U,o,!1,!0))break;if(m.line===rt){for(Se=m.input.charCodeAt(m.position);O(Se);)Se=m.input.charCodeAt(++m.position);if(Se===58)Se=m.input.charCodeAt(++m.position),T(Se)||J(m,"a whitespace character is expected after the key-value separator within a block mapping"),K&&(Le(m,H,q,k,N,null,C,D,w),k=N=z=null),ae=!0,K=!1,R=!1,k=m.tag,N=m.result;else if(ae)J(m,"can not read an implicit mapping pair; a colon is missed");else return m.tag=F,m.anchor=X,!0}else if(ae)J(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)&&(K&&(C=m.line,D=m.lineStart,w=m.position),ke(m,L,c,!0,R)&&(K?N=m.result:z=m.result),K||(Le(m,H,q,k,N,z,C,D,w),k=N=z=null),oe(m,!0,-1),Se=m.input.charCodeAt(m.position)),(m.line===rt||m.lineIndent>L)&&Se!==0)J(m,"bad indentation of a mapping entry");else if(m.lineIndent<L)break}return K&&Le(m,H,q,k,N,null,C,D,w),ae&&(m.tag=F,m.anchor=X,m.kind="mapping",m.result=H),ae}a(Te,"readBlockMapping");function Pe(m){let L=!1,U=!1,R,C,D=m.input.charCodeAt(m.position);if(D!==33)return!1;m.tag!==null&&J(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 w=m.position;if(L){do D=m.input.charCodeAt(++m.position);while(D!==0&&D!==62);m.position<m.length?(C=m.input.slice(w,m.position),D=m.input.charCodeAt(++m.position)):J(m,"unexpected end of the stream within a verbatim tag")}else{for(;D!==0&&!T(D);)D===33&&(U?J(m,"tag suffix cannot contain exclamation marks"):(R=m.input.slice(w-1,m.position+1),y.test(R)||J(m,"named tag handle cannot contain such characters"),U=!0,w=m.position+1)),D=m.input.charCodeAt(++m.position);C=m.input.slice(w,m.position),_.test(C)&&J(m,"tag suffix cannot contain flow indicator characters")}C&&!b.test(C)&&J(m,"tag name cannot contain such characters: "+C);try{C=decodeURIComponent(C)}catch{J(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:J(m,'undeclared tag handle "'+R+'"'),!0}a(Pe,"readTagProperty");function Me(m){let L=m.input.charCodeAt(m.position);if(L!==38)return!1;m.anchor!==null&&J(m,"duplication of an anchor property"),L=m.input.charCodeAt(++m.position);let U=m.position;for(;L!==0&&!T(L)&&!E(L);)L=m.input.charCodeAt(++m.position);return m.position===U&&J(m,"name of an anchor node must contain at least one character"),m.anchor=m.input.slice(U,m.position),!0}a(Me,"readAnchorProperty");function Ne(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&&!T(L)&&!E(L);)L=m.input.charCodeAt(++m.position);m.position===U&&J(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)||J(m,'unidentified alias "'+R+'"'),m.result=m.anchorMap[R],oe(m,!0,-1),!0}a(Ne,"readAlias");function Ge(m,L,U,R){let C=ce(m);return ie(m),ue(m,L),m.tag=null,m.anchor=null,m.kind=null,m.result=null,Te(m,U,R)&&m.kind==="mapping"?(he(m),!0):(Ue(m),ue(m,C),!1)}a(Ge,"tryReadBlockMappingFromProperty");function ke(m,L,U,R,C){let D,w,F=1,X=!1,H=!1,q=null,k,N,z;m.depth>=m.maxDepth&&J(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 K=D=w=c===U||l===U;if(R&&oe(m,!0,-1)&&(X=!0,m.lineIndent>L?F=1:m.lineIndent===L?F=0:m.lineIndent<L&&(F=-1)),F===1)for(;;){let ae=m.input.charCodeAt(m.position),Se=ce(m);if(X&&(ae===33&&m.tag!==null||ae===38&&m.anchor!==null)||!Pe(m)&&!Me(m))break;q===null&&(q=Se),oe(m,!0,-1)?(X=!0,w=K,m.lineIndent>L?F=1:m.lineIndent===L?F=0:m.lineIndent<L&&(F=-1)):w=!1}if(w&&(w=X||C),F===1||c===U)if(s===U||o===U?N=L:N=L+1,z=m.position-m.lineStart,F===1)if(w&&(_e(m,z)||Te(m,z,N))||Ae(m,N))H=!0;else{let ae=m.input.charCodeAt(m.position);q!==null&&K&&!w&&ae!==124&&ae!==62&&Ge(m,q,q.position-q.lineStart,N)||D&&ee(m,N)||Oe(m,N)||Re(m,N)?H=!0:Ne(m)?(H=!0,(m.tag!==null||m.anchor!==null)&&J(m,"alias node should not have any properties")):xe(m,N,s===U)&&(H=!0,m.tag===null&&(m.tag="?")),m.anchor!==null&&re(m,m.anchor,m.result)}else F===0&&(H=w&&_e(m,z));if(m.tag===null)m.anchor!==null&&re(m,m.anchor,m.result);else if(m.tag==="?"){m.result!==null&&m.kind!=="scalar"&&J(m,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+m.kind+'"');for(let ae=0,Se=m.implicitTypes.length;ae<Se;ae+=1)if(k=m.implicitTypes[ae],k.resolve(m.result)){m.result=k.construct(m.result),m.tag=k.tag,m.anchor!==null&&re(m,m.anchor,m.result);break}}else if(m.tag!=="!"){if(i.call(m.typeMap[m.kind||"fallback"],m.tag))k=m.typeMap[m.kind||"fallback"][m.tag];else{k=null;let ae=m.typeMap.multi[m.kind||"fallback"];for(let Se=0,De=ae.length;Se<De;Se+=1)if(m.tag.slice(0,ae[Se].tag.length)===ae[Se].tag){k=ae[Se];break}}k||J(m,"unknown tag !<"+m.tag+">"),m.result!==null&&k.kind!==m.kind&&J(m,"unacceptable node kind for !<"+m.tag+'> tag; it should be "'+k.kind+'", not "'+m.kind+'"'),k.resolve(m.result,m.tag)?(m.result=k.construct(m.result,m.tag),m.anchor!==null&&re(m,m.anchor,m.result)):J(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||H}a(ke,"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&&(oe(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&&!T(R);)R=m.input.charCodeAt(++m.position);let D=m.input.slice(C,m.position),w=[];for(D.length<1&&J(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&&!I(R));break}if(I(R))break;for(C=m.position;R!==0&&!T(R);)R=m.input.charCodeAt(++m.position);w.push(m.input.slice(C,m.position))}R!==0&&B(m),i.call(fe,D)?fe[D](m,D,w):ve(m,'unknown document directive "'+D+'"')}if(oe(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,oe(m,!0,-1)):U&&J(m,"directives end mark is expected"),ke(m,m.lineIndent-1,c,!1,!0),oe(m,!0,-1),m.checkLineBreaks&&h.test(m.input.slice(L,m.position))&&ve(m,"non-ASCII line breaks are interpreted as content"),m.documents.push(m.result),m.position===m.lineStart&&Ee(m)){m.input.charCodeAt(m.position)===46&&(m.position+=3,oe(m,!0,-1));return}m.position<m.length-1&&J(m,"end of the stream or a document separator is expected")}a(We,"readDocument");function qe(m,L){m=String(m),L=L||{},m.length!==0&&(m.charCodeAt(m.length-1)!==10&&m.charCodeAt(m.length-1)!==13&&(m+=`
359
+ `),m.charCodeAt(0)===65279&&(m=m.slice(1)));let U=new Q(m,L),R=m.indexOf("\0");for(R!==-1&&(U.position=R,J(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(qe,"loadDocuments");function je(m,L,U){L!==null&&typeof L=="object"&&typeof U>"u"&&(U=L,L=null);let R=qe(m,U);if(typeof L!="function")return R;for(let C=0,D=R.length;C<D;C+=1)L(R[C])}a(je,"loadAll2");function He(m,L){let U=qe(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"),W_.loadAll=je,W_.load=He,W_}function Rae(){if(C9)return ux;C9=1;let n=sh(),e=oh(),t=fx(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,s=65279,o=9,l=10,c=13,u=32,f=33,d=34,p=35,h=37,_=38,y=39,b=42,S=44,I=45,O=58,T=61,E=62,P=63,V=64,M=91,j=93,$=96,G=123,ge=124,ye=125,Q={};Q[0]="\\0",Q[7]="\\a",Q[8]="\\b",Q[9]="\\t",Q[10]="\\n",Q[11]="\\v",Q[12]="\\f",Q[13]="\\r",Q[27]="\\e",Q[34]='\\"',Q[92]="\\\\",Q[133]="\\N",Q[160]="\\_",Q[8232]="\\L",Q[8233]="\\P";let se=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],J=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ve(w,F){if(F===null)return{};let X={},H=Object.keys(F);for(let q=0,k=H.length;q<k;q+=1){let N=H[q],z=String(F[N]);N.slice(0,2)==="!!"&&(N="tag:yaml.org,2002:"+N.slice(2));let K=w.compiledTypeMap.fallback[N];K&&i.call(K.styleAliases,z)&&(z=K.styleAliases[z]),X[N]=z}return X}a(ve,"compileStyleMap");function re(w){let F,X,H=w.toString(16).toUpperCase();if(w<=255)F="x",X=2;else if(w<=65535)F="u",X=4;else if(w<=4294967295)F="U",X=8;else throw new e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+F+n.repeat("0",X-H.length)+H}a(re,"encodeHex");let ie=1,he=2;function Ue(w){this.schema=w.schema||t,this.indent=Math.max(1,w.indent||2),this.noArrayIndent=w.noArrayIndent||!1,this.skipInvalid=w.skipInvalid||!1,this.flowLevel=n.isNothing(w.flowLevel)?-1:w.flowLevel,this.styleMap=ve(this.schema,w.styles||null),this.sortKeys=w.sortKeys||!1,this.lineWidth=w.lineWidth||80,this.noRefs=w.noRefs||!1,this.noCompatMode=w.noCompatMode||!1,this.condenseFlow=w.condenseFlow||!1,this.quotingType=w.quotingType==='"'?he:ie,this.forceQuotes=w.forceQuotes||!1,this.replacer=typeof w.replacer=="function"?w.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}a(Ue,"State");function ce(w,F){let X=n.repeat(" ",F),H=0,q="",k=w.length;for(;H<k;){let N,z=w.indexOf(`
360
360
  `,H);z===-1?(N=w.slice(H),H=k):(N=w.slice(H,z+1),H=z+1),N.length&&N!==`
361
361
  `&&(q+=X),q+=N}return q}a(ce,"indentString");function ue(w,F){return`
362
362
  `+n.repeat(" ",w.indent*F)}a(ue,"generateNextLine");function fe(w,F){for(let X=0,H=w.implicitTypes.length;X<H;X+=1)if(w.implicitTypes[X].resolve(F))return!0;return!1}a(fe,"testImplicitResolving");function ne(w){return w===u||w===o}a(ne,"isWhitespace");function me(w){return w>=32&&w<=126||w>=161&&w<=55295&&w!==8232&&w!==8233||w>=57344&&w<=65533&&w!==s||w>=65536&&w<=1114111}a(me,"isPrintable");function Le(w){return me(w)&&w!==s&&w!==c&&w!==l}a(Le,"isNsCharOrWhitespace");function B(w,F,X){let H=Le(w),q=H&&!ne(w);return(X?H:H&&w!==S&&w!==M&&w!==j&&w!==G&&w!==ye)&&w!==p&&!(F===O&&!q)||Le(F)&&!ne(F)&&w===p||F===O&&q}a(B,"isPlainSafe");function oe(w){return me(w)&&w!==s&&!ne(w)&&w!==I&&w!==P&&w!==O&&w!==S&&w!==M&&w!==j&&w!==G&&w!==ye&&w!==p&&w!==_&&w!==b&&w!==f&&w!==ge&&w!==T&&w!==E&&w!==y&&w!==d&&w!==h&&w!==V&&w!==$}a(oe,"isPlainSafeFirst");function Ee(w){return!ne(w)&&w!==O}a(Ee,"isPlainSafeLast");function Ce(w,F){let X=w.charCodeAt(F),H;return X>=55296&&X<=56319&&F+1<w.length&&(H=w.charCodeAt(F+1),H>=56320&&H<=57343)?(X-55296)*1024+H-56320+65536:X}a(Ce,"codePointAt");function xe(w){return/^\n* /.test(w)}a(xe,"needIndentIndicator");let Oe=1,Re=2,Ae=3,ee=4,_e=5;function Te(w,F,X,H,q,k,N,z){let K,ae=0,Se=null,De=!1,rt=!1,Jr=H!==-1,Cr=-1,sr=oe(Ce(w,0))&&Ee(Ce(w,w.length-1));if(F||N)for(K=0;K<w.length;ae>=65536?K+=2:K++){if(ae=Ce(w,K),!me(ae))return _e;sr=sr&&B(ae,Se,z),Se=ae}else{for(K=0;K<w.length;ae>=65536?K+=2:K++){if(ae=Ce(w,K),ae===l)De=!0,Jr&&(rt=rt||K-Cr-1>H&&w[Cr+1]!==" ",Cr=K);else if(!me(ae))return _e;sr=sr&&B(ae,Se,z),Se=ae}rt=rt||Jr&&K-Cr-1>H&&w[Cr+1]!==" "}return!De&&!rt?sr&&!N&&!q(w)?Oe:k===he?_e:Re:X>9&&xe(w)?_e:N?k===he?_e:Re:rt?ee:Ae}a(Te,"chooseScalarStyle");function Pe(w,F,X,H,q){w.dump=(function(){if(F.length===0)return w.quotingType===he?'""':"''";if(!w.noCompatMode&&(se.indexOf(F)!==-1||J.test(F)))return w.quotingType===he?'"'+F+'"':"'"+F+"'";let k=w.indent*Math.max(1,X),N=w.lineWidth===-1?-1:Math.max(Math.min(w.lineWidth,40),w.lineWidth-k),z=H||w.flowLevel>-1&&X>=w.flowLevel;function K(ae){return fe(w,ae)}switch(a(K,"testAmbiguity"),Te(F,z,w.indent,N,K,w.quotingType,w.forceQuotes&&!H,q)){case Oe:return F;case Re:return"'"+F.replace(/'/g,"''")+"'";case Ae:return"|"+Me(F,w.indent)+Ne(ce(F,k));case ee:return">"+Me(F,w.indent)+Ne(ce(Ge(F,N),k));case _e:return'"'+We(F)+'"';default:throw new e("impossible error: invalid scalar style")}})()}a(Pe,"writeScalar");function Me(w,F){let X=xe(w)?String(F):"",H=w[w.length-1]===`
@@ -370,7 +370,7 @@ GFS4: `),console.error(n)},"debug"));Xt[dn]||(_j=global[dn]||[],Sj(Xt,_j),Xt.clo
370
370
  `:"")+ke(K,F),q=k}return H}a(Ge,"foldString");function ke(w,F){if(w===""||w[0]===" ")return w;let X=/ [^ ]/g,H,q=0,k,N=0,z=0,K="";for(;H=X.exec(w);)z=H.index,z-q>F&&(k=N>q?N:z,K+=`
371
371
  `+w.slice(q,k),q=k+1),N=z;return K+=`
372
372
  `,w.length-q>F&&N>q?K+=w.slice(q,N)+`
373
- `+w.slice(N+1):K+=w.slice(q),K.slice(1)}a(ke,"foldLine");function We(w){let F="",X=0;for(let H=0;H<w.length;X>=65536?H+=2:H++){X=Ce(w,H);let q=Q[X];!q&&me(X)?(F+=w[H],X>=65536&&(F+=w[H+1])):F+=q||te(X)}return F}a(We,"escapeString");function qe(w,F,X){let H="",q=w.tag;for(let k=0,N=X.length;k<N;k+=1){let z=X[k];w.replacer&&(z=w.replacer.call(X,String(k),z)),(U(w,F,z,!1,!1)||typeof z>"u"&&U(w,F,null,!1,!1))&&(H!==""&&(H+=","+(w.condenseFlow?"":" ")),H+=w.dump)}w.tag=q,w.dump="["+H+"]"}a(qe,"writeFlowSequence");function je(w,F,X,H){let q="",k=w.tag;for(let N=0,z=X.length;N<z;N+=1){let K=X[N];w.replacer&&(K=w.replacer.call(X,String(N),K)),(U(w,F+1,K,!0,!0,!1,!0)||typeof K>"u"&&U(w,F+1,null,!0,!0,!1,!0))&&((!H||q!=="")&&(q+=ue(w,F)),w.dump&&l===w.dump.charCodeAt(0)?q+="-":q+="- ",q+=w.dump)}w.tag=k,w.dump=q||"[]"}a(je,"writeBlockSequence");function He(w,F,X){let H="",q=w.tag,k=Object.keys(X);for(let N=0,z=k.length;N<z;N+=1){let K="";H!==""&&(K+=", "),w.condenseFlow&&(K+='"');let ae=k[N],Se=X[ae];w.replacer&&(Se=w.replacer.call(X,ae,Se)),U(w,F,ae,!1,!1)&&(w.dump.length>1024&&(K+="? "),K+=w.dump+(w.condenseFlow?'"':"")+":"+(w.condenseFlow?"":" "),U(w,F,Se,!1,!1)&&(K+=w.dump,H+=K))}w.tag=q,w.dump="{"+H+"}"}a(He,"writeFlowMapping");function m(w,F,X,H){let q="",k=w.tag,N=Object.keys(X);if(w.sortKeys===!0)N.sort();else if(typeof w.sortKeys=="function")N.sort(w.sortKeys);else if(w.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let z=0,K=N.length;z<K;z+=1){let ae="";(!H||q!=="")&&(ae+=ue(w,F));let Se=N[z],De=X[Se];if(w.replacer&&(De=w.replacer.call(X,Se,De)),!U(w,F+1,Se,!0,!0,!0))continue;let rt=w.tag!==null&&w.tag!=="?"||w.dump&&w.dump.length>1024;rt&&(w.dump&&l===w.dump.charCodeAt(0)?ae+="?":ae+="? "),ae+=w.dump,rt&&(ae+=ue(w,F)),U(w,F+1,De,!0,rt)&&(w.dump&&l===w.dump.charCodeAt(0)?ae+=":":ae+=": ",ae+=w.dump,q+=ae)}w.tag=k,w.dump=q||"{}"}a(m,"writeBlockMapping");function L(w,F,X){let H=X?w.explicitTypes:w.implicitTypes;for(let q=0,k=H.length;q<k;q+=1){let N=H[q];if((N.instanceOf||N.predicate)&&(!N.instanceOf||typeof F=="object"&&F instanceof N.instanceOf)&&(!N.predicate||N.predicate(F))){if(X?N.multi&&N.representName?w.tag=N.representName(F):w.tag=N.tag:w.tag="?",N.represent){let z=w.styleMap[N.tag]||N.defaultStyle,K;if(r.call(N.represent)==="[object Function]")K=N.represent(F,z);else if(i.call(N.represent,z))K=N.represent[z](F,z);else throw new e("!<"+N.tag+'> tag resolver accepts not "'+z+'" style');w.dump=K}return!0}}return!1}a(L,"detectType");function U(w,F,X,H,q,k,N){w.tag=null,w.dump=X,L(w,X,!1)||L(w,X,!0);let z=r.call(w.dump),K=H;H&&(H=w.flowLevel<0||w.flowLevel>F);let ae=z==="[object Object]"||z==="[object Array]",Se,De;if(ae&&(Se=w.duplicates.indexOf(X),De=Se!==-1),(w.tag!==null&&w.tag!=="?"||De||w.indent!==2&&F>0)&&(q=!1),De&&w.usedDuplicates[Se])w.dump="*ref_"+Se;else{if(ae&&De&&!w.usedDuplicates[Se]&&(w.usedDuplicates[Se]=!0),z==="[object Object]")H&&Object.keys(w.dump).length!==0?(m(w,F,w.dump,q),De&&(w.dump="&ref_"+Se+w.dump)):(He(w,F,w.dump),De&&(w.dump="&ref_"+Se+" "+w.dump));else if(z==="[object Array]")H&&w.dump.length!==0?(w.noArrayIndent&&!N&&F>0?je(w,F-1,w.dump,q):je(w,F,w.dump,q),De&&(w.dump="&ref_"+Se+w.dump)):(qe(w,F,w.dump),De&&(w.dump="&ref_"+Se+" "+w.dump));else if(z==="[object String]")w.tag!=="?"&&Pe(w,w.dump,F,k,K);else{if(z==="[object Undefined]")return!1;if(w.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+z)}if(w.tag!==null&&w.tag!=="?"){let rt=encodeURI(w.tag[0]==="!"?w.tag.slice(1):w.tag).replace(/!/g,"%21");w.tag[0]==="!"?rt="!"+rt:rt.slice(0,18)==="tag:yaml.org,2002:"?rt="!!"+rt.slice(18):rt="!<"+rt+">",w.dump=rt+" "+w.dump}}return!0}a(U,"writeNode");function R(w,F){let X=[],H=[];C(w,X,H);let q=H.length;for(let k=0;k<q;k+=1)F.duplicates.push(X[H[k]]);F.usedDuplicates=new Array(q)}a(R,"getDuplicateReferences");function C(w,F,X){if(w!==null&&typeof w=="object"){let H=F.indexOf(w);if(H!==-1)X.indexOf(H)===-1&&X.push(H);else if(F.push(w),Array.isArray(w))for(let q=0,k=w.length;q<k;q+=1)C(w[q],F,X);else{let q=Object.keys(w);for(let k=0,N=q.length;k<N;k+=1)C(w[q[k]],F,X)}}}a(C,"inspectNode");function D(w,F){F=F||{};let X=new Ue(F);X.noRefs||R(w,X);let H=w;return X.replacer&&(H=X.replacer.call({"":H},"",H)),U(X,0,H,!0,!0)?X.dump+`
373
+ `+w.slice(N+1):K+=w.slice(q),K.slice(1)}a(ke,"foldLine");function We(w){let F="",X=0;for(let H=0;H<w.length;X>=65536?H+=2:H++){X=Ce(w,H);let q=Q[X];!q&&me(X)?(F+=w[H],X>=65536&&(F+=w[H+1])):F+=q||re(X)}return F}a(We,"escapeString");function qe(w,F,X){let H="",q=w.tag;for(let k=0,N=X.length;k<N;k+=1){let z=X[k];w.replacer&&(z=w.replacer.call(X,String(k),z)),(U(w,F,z,!1,!1)||typeof z>"u"&&U(w,F,null,!1,!1))&&(H!==""&&(H+=","+(w.condenseFlow?"":" ")),H+=w.dump)}w.tag=q,w.dump="["+H+"]"}a(qe,"writeFlowSequence");function je(w,F,X,H){let q="",k=w.tag;for(let N=0,z=X.length;N<z;N+=1){let K=X[N];w.replacer&&(K=w.replacer.call(X,String(N),K)),(U(w,F+1,K,!0,!0,!1,!0)||typeof K>"u"&&U(w,F+1,null,!0,!0,!1,!0))&&((!H||q!=="")&&(q+=ue(w,F)),w.dump&&l===w.dump.charCodeAt(0)?q+="-":q+="- ",q+=w.dump)}w.tag=k,w.dump=q||"[]"}a(je,"writeBlockSequence");function He(w,F,X){let H="",q=w.tag,k=Object.keys(X);for(let N=0,z=k.length;N<z;N+=1){let K="";H!==""&&(K+=", "),w.condenseFlow&&(K+='"');let ae=k[N],Se=X[ae];w.replacer&&(Se=w.replacer.call(X,ae,Se)),U(w,F,ae,!1,!1)&&(w.dump.length>1024&&(K+="? "),K+=w.dump+(w.condenseFlow?'"':"")+":"+(w.condenseFlow?"":" "),U(w,F,Se,!1,!1)&&(K+=w.dump,H+=K))}w.tag=q,w.dump="{"+H+"}"}a(He,"writeFlowMapping");function m(w,F,X,H){let q="",k=w.tag,N=Object.keys(X);if(w.sortKeys===!0)N.sort();else if(typeof w.sortKeys=="function")N.sort(w.sortKeys);else if(w.sortKeys)throw new e("sortKeys must be a boolean or a function");for(let z=0,K=N.length;z<K;z+=1){let ae="";(!H||q!=="")&&(ae+=ue(w,F));let Se=N[z],De=X[Se];if(w.replacer&&(De=w.replacer.call(X,Se,De)),!U(w,F+1,Se,!0,!0,!0))continue;let rt=w.tag!==null&&w.tag!=="?"||w.dump&&w.dump.length>1024;rt&&(w.dump&&l===w.dump.charCodeAt(0)?ae+="?":ae+="? "),ae+=w.dump,rt&&(ae+=ue(w,F)),U(w,F+1,De,!0,rt)&&(w.dump&&l===w.dump.charCodeAt(0)?ae+=":":ae+=": ",ae+=w.dump,q+=ae)}w.tag=k,w.dump=q||"{}"}a(m,"writeBlockMapping");function L(w,F,X){let H=X?w.explicitTypes:w.implicitTypes;for(let q=0,k=H.length;q<k;q+=1){let N=H[q];if((N.instanceOf||N.predicate)&&(!N.instanceOf||typeof F=="object"&&F instanceof N.instanceOf)&&(!N.predicate||N.predicate(F))){if(X?N.multi&&N.representName?w.tag=N.representName(F):w.tag=N.tag:w.tag="?",N.represent){let z=w.styleMap[N.tag]||N.defaultStyle,K;if(r.call(N.represent)==="[object Function]")K=N.represent(F,z);else if(i.call(N.represent,z))K=N.represent[z](F,z);else throw new e("!<"+N.tag+'> tag resolver accepts not "'+z+'" style');w.dump=K}return!0}}return!1}a(L,"detectType");function U(w,F,X,H,q,k,N){w.tag=null,w.dump=X,L(w,X,!1)||L(w,X,!0);let z=r.call(w.dump),K=H;H&&(H=w.flowLevel<0||w.flowLevel>F);let ae=z==="[object Object]"||z==="[object Array]",Se,De;if(ae&&(Se=w.duplicates.indexOf(X),De=Se!==-1),(w.tag!==null&&w.tag!=="?"||De||w.indent!==2&&F>0)&&(q=!1),De&&w.usedDuplicates[Se])w.dump="*ref_"+Se;else{if(ae&&De&&!w.usedDuplicates[Se]&&(w.usedDuplicates[Se]=!0),z==="[object Object]")H&&Object.keys(w.dump).length!==0?(m(w,F,w.dump,q),De&&(w.dump="&ref_"+Se+w.dump)):(He(w,F,w.dump),De&&(w.dump="&ref_"+Se+" "+w.dump));else if(z==="[object Array]")H&&w.dump.length!==0?(w.noArrayIndent&&!N&&F>0?je(w,F-1,w.dump,q):je(w,F,w.dump,q),De&&(w.dump="&ref_"+Se+w.dump)):(qe(w,F,w.dump),De&&(w.dump="&ref_"+Se+" "+w.dump));else if(z==="[object String]")w.tag!=="?"&&Pe(w,w.dump,F,k,K);else{if(z==="[object Undefined]")return!1;if(w.skipInvalid)return!1;throw new e("unacceptable kind of an object to dump "+z)}if(w.tag!==null&&w.tag!=="?"){let rt=encodeURI(w.tag[0]==="!"?w.tag.slice(1):w.tag).replace(/!/g,"%21");w.tag[0]==="!"?rt="!"+rt:rt.slice(0,18)==="tag:yaml.org,2002:"?rt="!!"+rt.slice(18):rt="!<"+rt+">",w.dump=rt+" "+w.dump}}return!0}a(U,"writeNode");function R(w,F){let X=[],H=[];C(w,X,H);let q=H.length;for(let k=0;k<q;k+=1)F.duplicates.push(X[H[k]]);F.usedDuplicates=new Array(q)}a(R,"getDuplicateReferences");function C(w,F,X){if(w!==null&&typeof w=="object"){let H=F.indexOf(w);if(H!==-1)X.indexOf(H)===-1&&X.push(H);else if(F.push(w),Array.isArray(w))for(let q=0,k=w.length;q<k;q+=1)C(w[q],F,X);else{let q=Object.keys(w);for(let k=0,N=q.length;k<N;k+=1)C(w[q[k]],F,X)}}}a(C,"inspectNode");function D(w,F){F=F||{};let X=new Ue(F);X.noRefs||R(w,X);let H=w;return X.replacer&&(H=X.replacer.call({"":H},"",H)),U(X,0,H,!0,!0)?X.dump+`
374
374
  `:""}return a(D,"dump2"),ux.dump=D,ux}function Cae(){if(O9)return Tn;O9=1;let n=xae(),e=Rae();function t(r,i){return function(){throw new Error("Function yaml."+r+" is removed in js-yaml 4. Use yaml."+i+" instead, which is now safe by default.")}}return a(t,"renamed"),Tn.Type=Bn(),Tn.Schema=P9(),Tn.FAILSAFE_SCHEMA=N9(),Tn.JSON_SCHEMA=U9(),Tn.CORE_SCHEMA=B9(),Tn.DEFAULT_SCHEMA=fx(),Tn.load=n.load,Tn.loadAll=n.loadAll,Tn.dump=e.dump,Tn.YAMLException=oh(),Tn.types={binary:G9(),float:$9(),map:L9(),null:k9(),pairs:H9(),set:z9(),timestamp:V9(),bool:M9(),int:j9(),merge:q9(),omap:W9(),seq:F9(),str:D9()},Tn.safeLoad=t("safeLoad","load"),Tn.safeLoadAll=t("safeLoadAll","loadAll"),Tn.safeDump=t("safeDump","dump"),Tn}var Tn,W_,el,o9,qI,a9,GI,l9,WI,c9,HI,u9,zI,f9,KI,d9,YI,p9,QI,h9,XI,m9,JI,g9,ZI,y9,ex,_9,tx,b9,rx,S9,nx,w9,ix,E9,sx,v9,ox,T9,ax,A9,lx,I9,cx,x9,R9,ux,C9,O9,Oae,Pae,kAe,MAe,jAe,$Ae,bf,UAe,Sf,BAe,wf,VAe,qAe,GAe,WAe,HAe,ah=et(()=>{a(Aae,"getDefaultExportFromCjs");Tn={},W_={},el={};a(sh,"requireCommon");a(oh,"requireException");a(Iae,"requireSnippet");a(Bn,"requireType");a(P9,"requireSchema");a(D9,"requireStr");a(F9,"requireSeq");a(L9,"requireMap");a(N9,"requireFailsafe");a(k9,"require_null");a(M9,"requireBool");a(j9,"requireInt");a($9,"requireFloat");a(U9,"requireJson");a(B9,"requireCore");a(V9,"requireTimestamp");a(q9,"requireMerge");a(G9,"requireBinary");a(W9,"requireOmap");a(H9,"requirePairs");a(z9,"requireSet");a(fx,"require_default");a(xae,"requireLoader");ux={};a(Rae,"requireDumper");a(Cae,"requireJsYaml");Oae=Cae(),Pae=Aae(Oae),{Type:kAe,Schema:MAe,FAILSAFE_SCHEMA:jAe,JSON_SCHEMA:$Ae,CORE_SCHEMA:bf,DEFAULT_SCHEMA:UAe,load:Sf,loadAll:BAe,dump:wf,YAMLException:VAe,types:qAe,safeLoad:GAe,safeLoadAll:WAe,safeDump:HAe}=Pae});var dx,K9,Dae,Y9=et(()=>{dx=a((n,e,t)=>{let r=n instanceof RegExp?K9(n,t):n,i=e instanceof RegExp?K9(e,t):e,s=r!==null&&i!=null&&Dae(r,i,t);return s&&{start:s[0],end:s[1],pre:t.slice(0,s[0]),body:t.slice(s[0]+r.length,s[1]),post:t.slice(s[1]+i.length)}},"balanced"),K9=a((n,e)=>{let t=e.match(n);return t?t[0]:null},"maybeMatch"),Dae=a((n,e,t)=>{let r,i,s,o,l,c=t.indexOf(n),u=t.indexOf(e,c+1),f=c;if(c>=0&&u>0){if(n===e)return[c,u];for(r=[],s=t.length;f>=0&&!l;){if(f===c)r.push(f),c=t.indexOf(n,f+1);else if(r.length===1){let d=r.pop();d!==void 0&&(l=[d,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,o=u),u=t.indexOf(e,f+1);f=c<u&&c>=0?c:u}r.length&&o!==void 0&&(l=[s,o])}return l},"range")});function px(n){return isNaN(n)?n.charCodeAt(0):parseInt(n,10)}function Wae(n){return n.replace(jae,Q9).replace($ae,X9).replace(Uae,mx).replace(Bae,J9).replace(Vae,Z9)}function Hae(n){return n.replace(Fae,"\\").replace(Lae,"{").replace(Nae,"}").replace(kae,",").replace(Mae,".")}function e$(n){if(!n)return[""];let e=[],t=dx("{","}",n);if(!t)return n.split(",");let{pre:r,body:i,post:s}=t,o=r.split(",");o[o.length-1]+="{"+i+"}";let l=e$(s);return s.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),e.push.apply(e,o),e}function t$(n,e={}){if(!n)return[];let{max:t=qae,maxLength:r=Gae}=e;return n.slice(0,2)==="{}"&&(n="\\{\\}"+n.slice(2)),hx(Wae(n),t,r,!0).map(Hae)}function zae(n){return"{"+n+"}"}function Kae(n){return/^-?0\d/.test(n)}function Yae(n,e){return n<=e}function Qae(n,e){return n>=e}function lh(n,e,t,r,i,s){let o=[],l=0;for(let c=0;c<n.length;c++)for(let u=0;u<t.length;u++){if(o.length>=r)return o;let f=n[c]+e+t[u];if(!(s&&!f)){if(l+f.length>i)return o;o.push(f),l+=f.length}}return o}function Xae(n,e,t,r){let i=n.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=px(i[0]),l=px(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(px(i[2])),1):1,f=Yae;l<o&&(u*=-1,f=Qae);let p=i.some(Kae),h=0;for(let _=o;f(_,l)&&s.length<t;_+=u){let y;if(e)y=String.fromCharCode(_),y==="\\"&&(y="");else if(y=String(_),p){let b=c-y.length;if(b>0){let S=new Array(b+1).join("0");_<0?y="-"+S+y.slice(1):y=S+y}}if(h+y.length>r)break;s.push(y),h+=y.length}return s}function hx(n,e,t,r){let i=[""],s=!1,o=!0;for(;;){let l=dx("{","}",n);if(!l)return lh(i,n,[""],e,t,s);let c=l.pre;if(/\$$/.test(c)){if(i=lh(i,c+"{"+l.body+"}",[""],e,t,s&&!l.post.length),o=!1,!l.post.length)break;n=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),d=u||f,p=l.body.indexOf(",")>=0;if(!d&&!p){if(l.post.match(/,(?!,).*\}/)){n=l.pre+"{"+l.body+mx+l.post,r=!0;continue}return lh(i,c+"{"+l.body+"}"+l.post,[""],e,t,s)}o&&(s=r&&!d,o=!1);let h;if(d)h=Xae(l.body,f,e,t);else{let _=e$(l.body);if(_.length===1&&_[0]!==void 0&&(_=hx(_[0],e,t,!1).map(zae),_.length===1)){if(i=lh(i,c+_[0],[""],e,t,s&&!l.post.length),!l.post.length)break;n=l.post;continue}let y=s&&!l.post.length&&!c;for(let S=0;y&&S<i.length;S++)i[S]&&(y=!1);h=[];let b=0;e:for(let S=0;S<_.length;S++){let I=hx(_[S],e,t,!1);for(let O=0;O<I.length;O++){let T=I[O];if(!(y&&!T)){if(h.length>=e||b+T.length>t)break e;h.push(T),b+=T.length}}}}if(i=lh(i,c,h,e,t,s&&!l.post.length),!l.post.length)break;n=l.post}return i}var Q9,X9,mx,J9,Z9,Fae,Lae,Nae,kae,Mae,jae,$ae,Uae,Bae,Vae,qae,Gae,r$=et(()=>{Y9();Q9="\0SLASH"+Math.random()+"\0",X9="\0OPEN"+Math.random()+"\0",mx="\0CLOSE"+Math.random()+"\0",J9="\0COMMA"+Math.random()+"\0",Z9="\0PERIOD"+Math.random()+"\0",Fae=new RegExp(Q9,"g"),Lae=new RegExp(X9,"g"),Nae=new RegExp(mx,"g"),kae=new RegExp(J9,"g"),Mae=new RegExp(Z9,"g"),jae=/\\\\/g,$ae=/\\{/g,Uae=/\\}/g,Bae=/\\,/g,Vae=/\\\./g,qae=1e5,Gae=4e6;a(px,"numeric");a(Wae,"escapeBraces");a(Hae,"unescapeBraces");a(e$,"parseCommaParts");a(t$,"expand");a(zae,"embrace");a(Kae,"isPadded");a(Yae,"lte");a(Qae,"gte");a(lh,"combine");a(Xae,"expandSequence");a(hx,"expand_")});var ch,n$=et(()=>{ch=a(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern")});var Jae,uh,Zae,i$,s$,o$=et(()=>{Jae={"[: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]},uh=a(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Zae=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),i$=a(n=>n.join(""),"rangesToString"),s$=a((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,o=!1,l=!1,c=!1,u=!1,f=t,d="";e:for(;s<n.length;){let y=n.charAt(s);if((y==="!"||y==="^")&&s===t+1){u=!0,s++;continue}if(y==="]"&&o&&!c){f=s+1;break}if(o=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[b,[S,I,O]]of Object.entries(Jae))if(n.startsWith(b,s)){if(d)return["$.",!1,n.length-t,!0];s+=b.length,O?i.push(S):r.push(S),l=l||I;continue e}}if(c=!1,d){y>d?r.push(uh(d)+"-"+uh(y)):y===d&&r.push(uh(y)),d="",s++;continue}if(n.startsWith("-]",s+1)){r.push(uh(y+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=y,s+=2;continue}r.push(uh(y)),s++}if(f<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,n.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[Zae(y),!1,f-t,!1]}let p="["+(u?"^":"")+i$(r)+"]",h="["+(u?"":"^")+i$(i)+"]";return[r.length&&i.length?"("+p+"|"+h+")":r.length?p:h,l,f-t,!0]},"parseClass")});var ms,z_=et(()=>{ms=a((n,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?n.replace(/\[([^/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?n.replace(/\[([^/\\{}])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape")});var li,ele,gx,a$,tle,rle,nle,l$,ile,K_,sle,ole,ale,lle,yx,c$,u$,cle,hc,_x=et(()=>{o$();z_();ele=new Set(["!","?","+","*","@"]),gx=a(n=>ele.has(n),"isExtglobType"),a$=a(n=>gx(n.type),"isExtglobAST"),tle=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),rle=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),nle=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),l$=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),ile="(?!(?:^|/)\\.\\.?(?:$|/))",K_="(?!\\.)",sle=new Set(["[","."]),ole=new Set(["..","."]),ale=new Set("().*{}+?[]^$\\!"),lle=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),yx="[^/]",c$=yx+"*?",u$=yx+"+?",cle=0,hc=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#o;#b;#l;#u=!1;#a;#h;#m=!1;id=++cle;get depth(){return(this.#o?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#o?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(e,t,r={}){this.type=e,e&&(this.#n=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?r:this.#e.#a,this.#l=this.#e===this?[]:this.#e.#l,e==="!"&&!this.#e.#u&&this.#l.push(this),this.#b=this.#o?this.#o.#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.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#t.map(e=>String(e)).join("|")+")":this.#h=this.#t.map(e=>String(e)).join("")}#c(){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.#l.pop();){if(e.type!=="!")continue;let t=e,r=t.#o;for(;r;){for(let i=t.#b+1;!r.type&&i<r.#t.length;i++)for(let s of e.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}t=r,r=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof li&&t.#o===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.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#b===0)return!0;let e=this.#o;for(let t=0;t<this.#b;t++){let r=e.#t[t];if(!(r instanceof li&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#t.length:0;return this.#b===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new li(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#i(e,t,r,i,s){let o=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,f=!1;if(t.type===null){let y=r,b="";for(;y<e.length;){let S=e.charAt(y++);if(l||S==="\\"){l=!l,b+=S;continue}if(c){y===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(y===u+2&&f)&&(c=!1),b+=S;continue}else if(S==="["){c=!0,u=y,f=!1,b+=S;continue}if(!i.noext&&gx(S)&&e.charAt(y)==="("&&s<=o){t.push(b),b="";let O=new li(S,t);y=li.#i(e,O,y,i,s+1),t.push(O);continue}b+=S}return t.push(b),y}let d=r+1,p=new li(null,t),h=[],_="";for(;d<e.length;){let y=e.charAt(d++);if(l||y==="\\"){l=!l,_+=y;continue}if(c){d===u+1?(y==="^"||y==="!")&&(f=!0):y==="]"&&!(d===u+2&&f)&&(c=!1),_+=y;continue}else if(y==="["){c=!0,u=d,f=!1,_+=y;continue}if(!i.noext&&gx(y)&&e.charAt(d)==="("&&(s<=o||t&&t.#f(y))){let S=t&&t.#f(y)?0:1;p.push(_),_="";let I=new li(y,p);p.push(I),d=li.#i(e,I,d,i,s+S);continue}if(y==="|"){p.push(_),_="",h.push(p),p=new li(null,t);continue}if(y===")")return _===""&&t.#t.length===0&&(t.#m=!0),p.push(_),_="",t.push(...h,p),d;_+=y}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],d}#y(e){return this.#S(e,rle)}#S(e,t=tle){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null)return!1;let r=e.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#f(r.type,t)}#f(e,t=nle){return!!t.get(this.type)?.includes(e)}#d(e,t){let r=e.#t[0],i=new li(null,r,this.options);i.#t.push(""),r.push(i),this.#T(e,t)}#T(e,t){let r=e.#t[0];this.#t.splice(t,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#o=this);this.#h=void 0}#_(e){return!!l$.get(this.type)?.has(e)}#w(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.type)}#v(e){let t=l$.get(this.type),r=e.#t[0],i=t?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#o=this);this.type=i,this.#h=void 0,this.#m=!1}static fromGlob(e,t={}){let r=new li(null,void 0,t);return li.#i(e,r,0,t,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let l=(this.#a.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,l),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&(this.#g(),this.#c()),!a$(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[_,y,b,S]=typeof h=="string"?li.#A(h,this.#n,c):h.toRegExpSource(e);return this.#n=this.#n||b,this.#r=this.#r||S,_}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&ole.has(this.#t[0]))){let _=sle,y=t&&_.has(u.charAt(0))||u.startsWith("\\.")&&_.has(u.charAt(2))||u.startsWith("\\.\\.")&&_.has(u.charAt(4)),b=!t&&!e&&_.has(u.charAt(0));f=y?ile:b?K_:""}let d="";return this.isEnd()&&this.#e.#u&&this.#o?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,ms(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#E(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,ms(this.toString()),!1,!1]}let o=!r||e||t||!K_?"":this.#E(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let l="";if(this.type==="!"&&this.#m)l=(this.isStart()&&!t?K_:"")+u$;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?K_:"")+c$+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;l=i+s+c}return[l,ms(s),this.#n=!!this.#n,this.#r]}#g(){if(a$(this)){let e=0,t=!1;do{t=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#g(),this.#S(i)?(t=!1,this.#T(i,r)):this.#y(i)?(t=!1,this.#d(i,r)):this.#w(i)&&(t=!1,this.#v(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#g();this.#h=void 0}#E(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=t.toRegExpSource(e);return this.#r=this.#r||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#A(e,t,r=!1){let i=!1,s="",o=!1,l=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(i){i=!1,s+=(ale.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=r&&/^[*]+$/.test(e)?u$:c$,t=!0;continue}else l=!1;if(u==="\\"){c===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=s$(e,c);if(p){s+=f,o=o||d,c+=p-1,t=t||h;continue}}if(u==="?"){s+=yx,t=!0;continue}s+=lle(u)}return[s,ms(e),!!t,o]}};li=hc});var Ef,bx=et(()=>{Ef=a((n,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?n.replace(/[?*()[\]{}]/g,"[$&]"):n.replace(/[?*()[\]\\{}]/g,"\\$&"):e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape")});var Vn,ule,fle,dle,ple,hle,mle,gle,yle,_le,ble,Sle,wle,Ele,vle,Tle,Ale,Ile,xle,p$,h$,m$,f$,Rle,cr,Cle,Ole,Ple,Dle,Fle,Pi,Lle,g$,Nle,kle,d$,Mle,yi,tl=et(()=>{r$();n$();_x();bx();z_();_x();bx();z_();Vn=a((n,e,t={})=>(ch(e),!t.nocomment&&e.charAt(0)==="#"?!1:new yi(e,t).match(n)),"minimatch"),ule=/^\*+([^+@!?*[(]*)$/,fle=a(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),dle=a(n=>e=>e.endsWith(n),"starDotExtTestDot"),ple=a(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),hle=a(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),mle=/^\*+\.\*+$/,gle=a(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),yle=a(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),_le=/^\.\*+$/,ble=a(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),Sle=/^\*+$/,wle=a(n=>n.length!==0&&!n.startsWith("."),"starTest"),Ele=a(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),vle=/^\?+([^+@!?*[(]*)?$/,Tle=a(([n,e=""])=>{let t=p$([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Ale=a(([n,e=""])=>{let t=h$([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Ile=a(([n,e=""])=>{let t=h$([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),xle=a(([n,e=""])=>{let t=p$([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),p$=a(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),h$=a(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),m$=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",f$={win32:{sep:"\\"},posix:{sep:"/"}},Rle=m$==="win32"?f$.win32.sep:f$.posix.sep;Vn.sep=Rle;cr=Symbol("globstar **");Vn.GLOBSTAR=cr;Cle="[^/]",Ole=Cle+"*?",Ple="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Dle="(?:(?!(?:\\/|^)\\.).)*?",Fle=a((n,e={})=>t=>Vn(t,n,e),"filter");Vn.filter=Fle;Pi=a((n,e={})=>Object.assign({},n,e),"ext"),Lle=a(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Vn;let e=Vn;return Object.assign(a((r,i,s={})=>e(r,i,Pi(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,Pi(n,s))}static defaults(i){return e.defaults(Pi(n,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,Pi(n,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,Pi(n,s))}},unescape:a((r,i={})=>e.unescape(r,Pi(n,i)),"unescape"),escape:a((r,i={})=>e.escape(r,Pi(n,i)),"escape"),filter:a((r,i={})=>e.filter(r,Pi(n,i)),"filter"),defaults:a(r=>e.defaults(Pi(n,r)),"defaults"),makeRe:a((r,i={})=>e.makeRe(r,Pi(n,i)),"makeRe"),braceExpand:a((r,i={})=>e.braceExpand(r,Pi(n,i)),"braceExpand"),match:a((r,i,s={})=>e.match(r,i,Pi(n,s)),"match"),sep:e.sep,GLOBSTAR:cr})},"defaults");Vn.defaults=Lle;g$=a((n,e={})=>(ch(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:t$(n,{max:e.braceExpandMax})),"braceExpand");Vn.braceExpand=g$;Nle=a((n,e={})=>new yi(n,e).makeRe(),"makeRe");Vn.makeRe=Nle;kle=a((n,e,t={})=>{let r=new yi(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");Vn.match=kle;d$=/[?*]|[+@!]\(.*?\)|\[|\]/,Mle=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),yi=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={}){ch(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||m$,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[r]===!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 r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!d$.test(s[2]))&&!d$.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)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(c=>this.parse(c))});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 r of e)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[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 r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),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 r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let l=r[i+1],c=r[i+2],u=r[i+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let f=r.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let l=r[o];o===1&&l===""&&r[0]===""||(l==="."||l==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,o=[],l="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(l==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(r&&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(l==="b")return!1;l="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(l==="a")return!1;l="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,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=0,s=0;if(this.isWindows){let l=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),c=!l&&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=c?3:l?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(cr)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let o=t.indexOf(cr,s),l=t.lastIndexOf(cr),[c,u,f]=r?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,l),t.slice(l+1)];if(c.length){let I=e.slice(i,i+c.length);if(!this.#r(I,c,r,0,0))return!1;i+=c.length,s+=c.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let I=e.length-f.length;if(this.#r(e,f,r,I,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(I--,!this.#r(e,f,r,I,0)))return!1;d=f.length+1}}if(!u.length){let I=!!d;for(let O=i;O<e.length-d;O++){let T=String(e[O]);if(I=!0,T==="."||T===".."||!this.options.dot&&T.startsWith("."))return!1}return r||I}let p=[[[],0]],h=p[0],_=0,y=[0];for(let I of u)I===cr?(y.push(_),h=[[],0],p.push(h)):(h[0].push(I),_++);let b=p.length-1,S=e.length-d;for(let I of p)I[1]=S-(y[b--]+I[0].length);return!!this.#n(e,p,i,0,r,0,!!d)}#n(e,t,r,i,s,o,l){let c=t[i];if(!c){for(let d=r;d<e.length;d++){l=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return l}let[u,f]=c;for(;r<=f;){if(this.#r(e.slice(0,r+u.length),u,s,r,0)&&o<this.maxGlobstarRecursion){let h=this.#n(e,t,r+u.length,i+1,s,o+1,l);if(h!==!1)return h}let p=e[r];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;r++}return s||null}#r(e,t,r,i,s){let o,l,c,u;for(o=i,l=s,u=e.length,c=t.length;o<u&&l<c;o++,l++){this.debug("matchOne loop");let f=t[l],d=e[o];if(this.debug(t,f,d),f===!1||f===cr)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&&l===c)return!0;if(o===u)return r;if(l===c)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return g$(this.pattern,this.options)}parse(e){ch(e);let t=this.options;if(e==="**")return cr;if(e==="")return"";let r,i=null;(r=e.match(Sle))?i=t.dot?Ele:wle:(r=e.match(ule))?i=(t.nocase?t.dot?hle:ple:t.dot?dle:fle)(r[1]):(r=e.match(vle))?i=(t.nocase?t.dot?Ale:Tle:t.dot?Ile:xle)(r):(r=e.match(mle))?i=t.dot?yle:gle:(r=e.match(_le))&&(i=ble);let s=hc.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,r=t.noglobstar?Ole:t.dot?Ple:Dle,i=new Set(t.nocase?["i"]:[]),s=e.map(c=>{let u=c.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))i.add(p);return typeof d=="string"?Mle(d):d===cr?cr:d._src});u.forEach((d,p)=>{let h=u[p+1],_=u[p-1];d!==cr||_===cr||(_===void 0?h!==void 0&&h!==cr?u[p+1]="(?:\\/|"+r+"\\/)?"+h:u[p]=r:h===void 0?u[p-1]=_+"(?:\\/|\\/"+r+")?":h!==cr&&(u[p-1]=_+"(?:\\/|\\/"+r+"\\/)"+h,u[p+1]=cr))});let f=u.filter(d=>d!==cr);if(this.partial&&f.length>=1){let d=[];for(let p=1;p<=f.length;p++)d.push(f.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return f.join("/")}).join("|"),[o,l]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+l+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+l+")$"),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 r=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 l=i.length-2;!o&&l>=0;l--)o=i[l];for(let l of s){let c=i;if(r.matchBase&&l.length===1&&(c=[o]),this.matchOne(c,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Vn.defaults(e).Minimatch}};Vn.AST=hc;Vn.Minimatch=yi;Vn.escape=Ef;Vn.unescape=ms});var Q_,pn,fh,jle,Sx,_$,y$,$le,Ule,rl,b$,Y_,Ble,ph,w$=et(()=>{Q_=require("node:diagnostics_channel"),pn=(0,Q_.channel)("lru-cache:metrics"),fh=(0,Q_.tracingChannel)("lru-cache"),jle=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Sx=a(()=>pn.hasSubscribers||fh.hasSubscribers,"R"),_$=new Set,y$=typeof process=="object"&&process?process:{},$le=a((n,e,t,r)=>{typeof y$.emitWarning=="function"?y$.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"k"),Ule=a(n=>!_$.has(n),"H"),rl=a(n=>!!n&&n===Math.floor(n)&&n>0&&isFinite(n),"T"),b$=a(n=>rl(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Y_:null:null,"j"),Y_=class extends Array{static{a(this,"O")}constructor(n){super(n),this.fill(0)}},Ble=class dh{static{a(this,"d")}heap;length;static#e=!1;static create(e){let t=b$(e);if(!t)return[];dh.#e=!0;let r=new dh(e,t);return dh.#e=!1,r}constructor(e,t){if(!dh.#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]}},ph=class S${static{a(this,"d")}#e;#n;#r;#t;#o;#b;#l;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#a;#h;#m;#c;#i;#y;#S;#f;#d;#T;#_;#w;#v;#g;#E;#A;#R;#s;#P;static unsafeExposeInternals(e){return{starts:e.#v,ttls:e.#g,autopurgeTimers:e.#E,sizes:e.#w,keyMap:e.#m,keyList:e.#c,valList:e.#i,next:e.#y,prev:e.#S,get head(){return e.#f},get tail(){return e.#d},free:e.#T,isBackgroundFetch:a(t=>e.#p(t),"isBackgroundFetch"),backgroundFetch:a((t,r,i,s)=>e.#M(t,r,i,s),"backgroundFetch"),moveToTail:a(t=>e.#K(t),"moveToTail"),indexes:a(t=>e.#C(t),"indexes"),rindexes:a(t=>e.#O(t),"rindexes"),isStale:a(t=>e.#I(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#h}get size(){return this.#a}get fetchMethod(){return this.#b}get memoMethod(){return this.#l}get dispose(){return this.#r}get onInsert(){return this.#t}get disposeAfter(){return this.#o}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:c,dispose:u,onInsert:f,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:_=0,maxEntrySize:y=0,sizeCalculation:b,fetchMethod:S,memoMethod:I,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:P,ignoreFetchAbort:V,backgroundFetchSize:M=1,perf:j}=e;if(this.backgroundFetchSize=M,j!==void 0&&typeof j?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=j??jle,t!==0&&!rl(t))throw new TypeError("max option must be a nonnegative integer");let $=t?b$(t):Array;if(!$)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=_,this.maxEntrySize=y||this.#n,this.sizeCalculation=b,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(I!==void 0&&typeof I!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=I,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#b=S,this.#R=!!S,this.#m=new Map,this.#c=Array.from({length:t}).fill(void 0),this.#i=Array.from({length:t}).fill(void 0),this.#y=new $(t),this.#S=new $(t),this.#f=0,this.#d=0,this.#T=Ble.create(t),this.#a=0,this.#h=0,typeof u=="function"&&(this.#r=u),typeof f=="function"&&(this.#t=f),typeof d=="function"?(this.#o=d,this.#_=[]):(this.#o=void 0,this.#_=void 0),this.#A=!!this.#r,this.#P=!!this.#t,this.#s=!!this.#o,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!E,this.allowStaleOnFetchAbort=!!P,this.ignoreFetchAbort=!!V,this.maxEntrySize!==0){if(this.#n!==0&&!rl(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!rl(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!T,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=rl(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!rl(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#D()}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 G="LRU_CACHE_UNBOUNDED";Ule(G)&&(_$.add(G),$le("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,S$))}}getRemainingTTL(e){return this.#m.has(e)?1/0:0}#D(){let e=new Y_(this.#e),t=new Y_(this.#e);this.#g=e,this.#v=t;let r=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#E=r,this.#$=(c,u,f=this.#u.now())=>{t[c]=u!==0?f:0,e[c]=u,i(c,u)},this.#x=c=>{t[c]=e[c]!==0?this.#u.now():0,i(c,e[c])};let i=this.ttlAutopurge?(c,u)=>{if(r?.[c]&&(clearTimeout(r[c]),r[c]=void 0),u&&u!==0&&r){let f=setTimeout(()=>{this.#I(c)?(this.#j(this.#c[c],"expire"),r[c]=void 0):i(c,l(c))},u+1);f.unref&&f.unref(),r[c]=f}}:()=>{};this.#F=(c,u)=>{if(e[u]){let f=e[u],d=t[u];if(!f||!d)return;c.ttl=f,c.start=d,c.now=s||o();let p=c.now-d;c.remainingTTL=f-p}};let s=0,o=a(()=>{let c=this.#u.now();if(this.ttlResolution>0){s=c;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return c},"o");this.getRemainingTTL=c=>{let u=this.#m.get(c);return u===void 0?0:l(u)};let l=a(c=>{let u=e[c],f=t[c];if(!u||!f)return 1/0;let d=(s||o())-f;return u-d},"l");this.#I=c=>{let u=t[c],f=e[c];return!!f&&!!u&&(s||o())-u>f}}#x=a(()=>{},"#R");#F=a(()=>{},"#v");#$=a(()=>{},"#H");#I=a(()=>!1,"#p");#G(){let e=new Y_(this.#e);this.#h=0,this.#w=e,this.#N=t=>{this.#h-=e[t],e[t]=0},this.#U=(t,r,i,s)=>{if(!rl(i)){if(this.#p(r))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!rl(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,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#h>s;)this.#q(!0)}this.#h+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#N=a(e=>{},"#x");#L=a((e,t,r)=>{},"#j");#U=a((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#N");*#C({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#d;this.#B(t)&&((e||!this.#I(t))&&(yield t),t!==this.#f);)t=this.#S[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#f;this.#B(t)&&((e||!this.#I(t))&&(yield t),t!==this.#d);)t=this.#y[t]}#B(e){return e!==void 0&&this.#m.get(this.#c[e])===e}*entries(){for(let e of this.#C())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#p(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*rentries(){for(let e of this.#O())this.#i[e]!==void 0&&this.#c[e]!==void 0&&!this.#p(this.#i[e])&&(yield[this.#c[e],this.#i[e]])}*keys(){for(let e of this.#C()){let t=this.#c[e];t!==void 0&&!this.#p(this.#i[e])&&(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#c[e];t!==void 0&&!this.#p(this.#i[e])&&(yield t)}}*values(){for(let e of this.#C())this.#i[e]!==void 0&&!this.#p(this.#i[e])&&(yield this.#i[e])}*rvalues(){for(let e of this.#O())this.#i[e]!==void 0&&!this.#p(this.#i[e])&&(yield this.#i[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#C()){let i=this.#i[r],s=this.#p(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#c[r],this))return this.#z(this.#c[r],t)}}forEach(e,t=this){for(let r of this.#C()){let i=this.#i[r],s=this.#p(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#c[r],this)}}rforEach(e,t=this){for(let r of this.#O()){let i=this.#i[r],s=this.#p(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#c[r],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#I(t)&&(this.#j(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#m.get(e);if(t===void 0)return;let r=this.#i[t],i=this.#p(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#g&&this.#v){let o=this.#g[t],l=this.#v[t];if(o&&l){let c=o-(this.#u.now()-l);s.ttl=c,s.start=Date.now()}}return this.#w&&(s.size=this.#w[t]),s}dump(){let e=[];for(let t of this.#C({allowStale:!0})){let r=this.#c[t],i=this.#i[t],s=this.#p(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#g&&this.#v){o.ttl=this.#g[t];let l=this.#u.now()-this.#v[t];o.start=Math.floor(Date.now()-l)}this.#w&&(o.size=this.#w[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=this.#u.now()-i}this.#k(t,r.value,r)}}set(e,t,r={}){let{status:i=pn.hasSubscribers?{}:void 0}=r;r.status=i,i&&(i.op="set",i.key=e,t!==void 0&&(i.value=t),i.cache=this);let s=this.#k(e,t,r);return i&&pn.hasSubscribers&&pn.publish(i),s}#k(e,t,r,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:u}=r,f=this.#p(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=r;u&&!f&&(u.value=t);let p=this.#U(e,t,r.size||0,c,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#j(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#a===0?void 0:this.#m.get(e);if(h===void 0)h=this.#a===0?this.#d:this.#T.length!==0?this.#T.pop():this.#a===this.#e?this.#q(!1):this.#a,this.#c[h]=e,this.#i[h]=t,this.#m.set(e,h),this.#y[this.#d]=h,this.#S[h]=this.#d,this.#d=h,this.#a++,this.#L(h,p,u),u&&(u.set="add"),d=!1,this.#P&&!f&&this.#t?.(t,e,"add");else{this.#K(h);let _=this.#i[h];if(t!==_){if(!l)if(this.#p(_)){_!==i&&_.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:y}=_;y!==void 0&&y!==t&&(this.#A&&this.#r?.(y,e,"set"),this.#s&&this.#_?.push([y,e,"set"]))}else this.#A&&this.#r?.(_,e,"set"),this.#s&&this.#_?.push([_,e,"set"]);if(this.#N(h),this.#L(h,p,u),this.#i[h]=t,!f){let y=_&&this.#p(_)?_.__staleWhileFetching:_,b=y===void 0?"add":t!==y?"replace":"update";u&&(u.set=b,y!==void 0&&(u.oldValue=y)),this.#P&&this.onInsert?.(t,e,b)}}else f||(u&&(u.set="update"),this.#P&&this.onInsert?.(t,e,"update"))}if(s!==0&&!this.#g&&this.#D(),this.#g&&(d||this.#$(h,s,o),u&&this.#F(u,h)),!l&&this.#s&&this.#_){let _=this.#_,y;for(;y=_?.shift();)this.#o?.(...y)}return this}pop(){try{for(;this.#a;){let e=this.#i[this.#f];if(this.#q(!0),this.#p(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#_){let e=this.#_,t;for(;t=e?.shift();)this.#o?.(...t)}}}#q(e){let t=this.#f,r=this.#c[t],i=this.#i[t],s=this.#p(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#A||this.#s)&&o!==void 0&&(this.#A&&this.#r?.(o,r,"evict"),this.#s&&this.#_?.push([o,r,"evict"])),this.#N(t),this.#E?.[t]&&(clearTimeout(this.#E[t]),this.#E[t]=void 0),e&&(this.#c[t]=void 0,this.#i[t]=void 0,this.#T.push(t)),this.#a===1?(this.#f=this.#d=0,this.#T.length=0):this.#f=this.#y[t],this.#m.delete(r),this.#a--,t}has(e,t={}){let{status:r=pn.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op="has",r.key=e,r.cache=this);let i=this.#Y(e,t);return pn.hasSubscribers&&pn.publish(r),i}#Y(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,s=this.#m.get(e);if(s!==void 0){let o=this.#i[s];if(this.#p(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#I(s))i&&(i.has="stale",this.#F(i,s));else return r&&this.#x(s),i&&(i.has="hit",this.#F(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{status:r=Sx()?{}:void 0}=t;r&&(r.op="peek",r.key=e,r.cache=this),t.status=r;let i=this.#W(e,t);return pn.hasSubscribers&&pn.publish(r),i}#W(e,t){let{status:r,allowStale:i=this.allowStale}=t,s=this.#m.get(e);if(s===void 0||!i&&this.#I(s)){r&&(r.peek=s===void 0?"miss":"stale");return}let o=this.#i[s],l=this.#p(o)?o.__staleWhileFetching:o;return r&&(l!==void 0?(r.peek="hit",r.value=l):r.peek="miss"),l}#M(e,t,r,i){let s=t===void 0?void 0:this.#i[t];if(this.#p(s))return s;let o=new AbortController,{signal:l}=r;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let c={signal:o.signal,options:r,context:i},u=a((y,b=!1)=>{let{aborted:S}=o.signal,I=r.ignoreFetchAbort&&y!==void 0,O=r.ignoreFetchAbort||!!(r.allowStaleOnFetchAbort&&y!==void 0);if(r.status&&(S&&!b?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,I&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),S&&!I&&!b)return d(o.signal.reason,O);let T=h,E=this.#i[t];return(E===h||E===void 0&&I&&b)&&(y===void 0?T.__staleWhileFetching!==void 0?this.#i[t]=T.__staleWhileFetching:this.#j(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.#k(e,y,c.options,T))),y},"r"),f=a(y=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=y),d(y,!1)),"c"),d=a((y,b)=>{let{aborted:S}=o.signal,I=S&&r.allowStaleOnFetchAbort,O=I||r.allowStaleOnFetchRejection,T=O||r.noDeleteOnFetchRejection,E=h;if(this.#i[t]===h&&(!T||!b&&E.__staleWhileFetching===void 0?this.#j(e,"fetch"):I||(this.#i[t]=E.__staleWhileFetching)),O)return r.status&&E.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),E.__staleWhileFetching;if(E.__returned===E)throw y},"m"),p=a((y,b)=>{let S=this.#b?.(e,s,c);o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(y(void 0),r.allowStaleOnFetchAbort&&(y=a(I=>u(I,!0),"f")))}),S&&S instanceof Promise?S.then(I=>y(I===void 0?void 0:I),b):S!==void 0&&y(S)},"_");r.status&&(r.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.#k(e,_,{...c.options,status:void 0}),t=this.#m.get(e)):this.#i[t]=_,_}#p(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let r=fh.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#H(e,t);return i&&r&&(i.trace=!0,fh.tracePromise(()=>s,i).catch(()=>{})),s}async#H(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:c=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:b=!1,status:S,signal:I}=t;if(S&&(S.op="fetch",S.key=e,b&&(S.forceRefresh=!0),S.cache=this),!this.#R)return S&&(S.fetch="get"),this.#z(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let O={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:l,size:c,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:_,ignoreFetchAbort:h,status:S,signal:I},T=this.#m.get(e);if(T===void 0){S&&(S.fetch="miss");let E=this.#M(e,T,O,y);return E.__returned=E}else{let E=this.#i[T];if(this.#p(E)){let j=r&&E.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",j&&(S.returnedStale=!0)),j?E.__staleWhileFetching:E.__returned=E}let P=this.#I(T);if(!b&&!P)return S&&(S.fetch="hit"),this.#K(T),i&&this.#x(T),S&&this.#F(S,T),E;let V=this.#M(e,T,O,y),M=V.__staleWhileFetching!==void 0&&r;return S&&(S.fetch=P?"stale":"refresh",M&&P&&(S.returnedStale=!0)),M?V.__staleWhileFetching:V.__returned=V}}forceFetch(e,t={}){let r=fh.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#V(e,t);return i&&r&&(i.trace=!0,fh.tracePromise(()=>s,i).catch(()=>{})),s}async#V(e,t={}){let r=await this.#H(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let{status:r=pn.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op="memo",r.key=e,t.context&&(r.context=t.context),r.cache=this);let i=this.#J(e,t);return r&&(r.value=i),pn.hasSubscribers&&pn.publish(r),i}#J(e,t={}){let r=this.#l;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...l}=t;s&&o&&(s.forceRefresh=!0);let c=this.#z(e,l),u=o||c===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=c)),!u)return c;let f=r(e,c,{options:l,context:i});return s&&(s.value=f),this.#k(e,f,l),f}get(e,t={}){let{status:r=pn.hasSubscribers?{}:void 0}=t;t.status=r,r&&(r.op="get",r.key=e,r.cache=this);let i=this.#z(e,t);return r&&(i!==void 0&&(r.value=i),pn.hasSubscribers&&pn.publish(r)),i}#z(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,l=this.#m.get(e);if(l===void 0){o&&(o.get="miss");return}let c=this.#i[l],u=this.#p(c);return o&&this.#F(o,l),this.#I(l)?u?(o&&(o.get="stale-fetching"),r&&c.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),c.__staleWhileFetching):void 0):(s||this.#j(e,"expire"),o&&(o.get="stale"),r?(o&&(o.returnedStale=!0),c):void 0):(o&&(o.get=u?"fetching":"hit"),this.#K(l),i&&this.#x(l),u?c.__staleWhileFetching:c)}#Q(e,t){this.#S[t]=e,this.#y[e]=t}#K(e){e!==this.#d&&(e===this.#f?this.#f=this.#y[e]:this.#Q(this.#S[e],this.#y[e]),this.#Q(this.#d,e),this.#d=e)}delete(e){return this.#j(e,"delete")}#j(e,t){pn.hasSubscribers&&pn.publish({op:"delete",delete:t,key:e,cache:this});let r=!1;if(this.#a!==0){let i=this.#m.get(e);if(i!==void 0)if(this.#E?.[i]&&(clearTimeout(this.#E[i]),this.#E[i]=void 0),r=!0,this.#a===1)this.#X(t);else{this.#N(i);let s=this.#i[i];if(this.#p(s)?s.__abortController.abort(new Error("deleted")):(this.#A||this.#s)&&(this.#A&&this.#r?.(s,e,t),this.#s&&this.#_?.push([s,e,t])),this.#m.delete(e),this.#c[i]=void 0,this.#i[i]=void 0,i===this.#d)this.#d=this.#S[i];else if(i===this.#f)this.#f=this.#y[i];else{let o=this.#S[i];this.#y[o]=this.#y[i];let l=this.#y[i];this.#S[l]=this.#S[i]}this.#a--,this.#T.push(i)}}if(this.#s&&this.#_?.length){let i=this.#_,s;for(;s=i?.shift();)this.#o?.(...s)}return r}clear(){return this.#X("delete")}#X(e){for(let t of this.#O({allowStale:!0})){let r=this.#i[t];if(this.#p(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#c[t];this.#A&&this.#r?.(r,i,e),this.#s&&this.#_?.push([r,i,e])}}if(this.#m.clear(),this.#i.fill(void 0),this.#c.fill(void 0),this.#g&&this.#v){this.#g.fill(0),this.#v.fill(0);for(let t of this.#E??[])t!==void 0&&clearTimeout(t);this.#E?.fill(void 0)}if(this.#w&&this.#w.fill(0),this.#f=0,this.#d=0,this.#T.length=0,this.#h=0,this.#a=0,this.#s&&this.#_){let t=this.#_,r;for(;r=t?.shift();)this.#o?.(...r)}}}});var nb,xx,I$,E$,Vle,qle,Gle,ia,sa,nl,X_,hh,J_,v$,Z_,T$,gs,vf,zr,mh,Tf,Kr,qn,Yr,wx,eb,An,ur,Ex,vx,A$,Tx,to,Ax,tb,gh,mc,_i,yh,Wle,Hle,zle,Kle,rb,Ix,Yle,Qle,il,Rx=et(()=>{nb=require("node:events"),xx=be(require("node:stream"),1),I$=require("node:string_decoder"),E$=typeof process=="object"&&process?process:{stdout:null,stderr:null},Vle=a(n=>!!n&&typeof n=="object"&&(n instanceof il||n instanceof xx.default||qle(n)||Gle(n)),"isStream"),qle=a(n=>!!n&&typeof n=="object"&&n instanceof nb.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==xx.default.Writable.prototype.pipe,"isReadable"),Gle=a(n=>!!n&&typeof n=="object"&&n instanceof nb.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),ia=Symbol("EOF"),sa=Symbol("maybeEmitEnd"),nl=Symbol("emittedEnd"),X_=Symbol("emittingEnd"),hh=Symbol("emittedError"),J_=Symbol("closed"),v$=Symbol("read"),Z_=Symbol("flush"),T$=Symbol("flushChunk"),gs=Symbol("encoding"),vf=Symbol("decoder"),zr=Symbol("flowing"),mh=Symbol("paused"),Tf=Symbol("resume"),Kr=Symbol("buffer"),qn=Symbol("pipes"),Yr=Symbol("bufferLength"),wx=Symbol("bufferPush"),eb=Symbol("bufferShift"),An=Symbol("objectMode"),ur=Symbol("destroyed"),Ex=Symbol("error"),vx=Symbol("emitData"),A$=Symbol("emitEnd"),Tx=Symbol("emitEnd2"),to=Symbol("async"),Ax=Symbol("abort"),tb=Symbol("aborted"),gh=Symbol("signal"),mc=Symbol("dataListeners"),_i=Symbol("discarded"),yh=a(n=>Promise.resolve().then(n),"defer"),Wle=a(n=>n(),"nodefer"),Hle=a(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),zle=a(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),Kle=a(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),rb=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[Tf](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ix=class extends rb{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},Yle=a(n=>!!n.objectMode,"isObjectModeOptions"),Qle=a(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),il=class extends nb.EventEmitter{static{a(this,"Minipass")}[zr]=!1;[mh]=!1;[qn]=[];[Kr]=[];[An];[gs];[to];[vf];[ia]=!1;[nl]=!1;[X_]=!1;[J_]=!1;[hh]=null;[Yr]=0;[ur]=!1;[gh];[tb]=!1;[mc]=0;[_i]=!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");Yle(t)?(this[An]=!0,this[gs]=null):Qle(t)?(this[gs]=t.encoding,this[An]=!1):(this[An]=!1,this[gs]=null),this[to]=!!t.async,this[vf]=this[gs]?new I$.StringDecoder(this[gs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[Kr],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[qn],"get")});let{signal:r}=t;r&&(this[gh]=r,r.aborted?this[Ax]():r.addEventListener("abort",()=>this[Ax]()))}get bufferLength(){return this[Yr]}get encoding(){return this[gs]}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[An]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[to]}set async(e){this[to]=this[to]||!!e}[Ax](){this[tb]=!0,this.emit("abort",this[gh]?.reason),this.destroy(this[gh]?.reason)}get aborted(){return this[tb]}set aborted(e){}write(e,t,r){if(this[tb])return!1;if(this[ia])throw new Error("write after end");if(this[ur])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[to]?yh:Wle;if(!this[An]&&!Buffer.isBuffer(e)){if(Kle(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(zle(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[An]?(this[zr]&&this[Yr]!==0&&this[Z_](!0),this[zr]?this.emit("data",e):this[wx](e),this[Yr]!==0&&this.emit("readable"),r&&i(r),this[zr]):e.length?(typeof e=="string"&&!(t===this[gs]&&!this[vf]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[gs]&&(e=this[vf].write(e)),this[zr]&&this[Yr]!==0&&this[Z_](!0),this[zr]?this.emit("data",e):this[wx](e),this[Yr]!==0&&this.emit("readable"),r&&i(r),this[zr]):(this[Yr]!==0&&this.emit("readable"),r&&i(r),this[zr])}read(e){if(this[ur])return null;if(this[_i]=!1,this[Yr]===0||e===0||e&&e>this[Yr])return this[sa](),null;this[An]&&(e=null),this[Kr].length>1&&!this[An]&&(this[Kr]=[this[gs]?this[Kr].join(""):Buffer.concat(this[Kr],this[Yr])]);let t=this[v$](e||null,this[Kr][0]);return this[sa](),t}[v$](e,t){if(this[An])this[eb]();else{let r=t;e===r.length||e===null?this[eb]():typeof r=="string"?(this[Kr][0]=r.slice(e),t=r.slice(0,e),this[Yr]-=e):(this[Kr][0]=r.subarray(e),t=r.subarray(0,e),this[Yr]-=e)}return this.emit("data",t),!this[Kr].length&&!this[ia]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[ia]=!0,this.writable=!1,(this[zr]||!this[mh])&&this[sa](),this}[Tf](){this[ur]||(!this[mc]&&!this[qn].length&&(this[_i]=!0),this[mh]=!1,this[zr]=!0,this.emit("resume"),this[Kr].length?this[Z_]():this[ia]?this[sa]():this.emit("drain"))}resume(){return this[Tf]()}pause(){this[zr]=!1,this[mh]=!0,this[_i]=!1}get destroyed(){return this[ur]}get flowing(){return this[zr]}get paused(){return this[mh]}[wx](e){this[An]?this[Yr]+=1:this[Yr]+=e.length,this[Kr].push(e)}[eb](){return this[An]?this[Yr]-=1:this[Yr]-=this[Kr][0].length,this[Kr].shift()}[Z_](e=!1){do;while(this[T$](this[eb]())&&this[Kr].length);!e&&!this[Kr].length&&!this[ia]&&this.emit("drain")}[T$](e){return this.emit("data",e),this[zr]}pipe(e,t){if(this[ur])return e;this[_i]=!1;let r=this[nl];return t=t||{},e===E$.stdout||e===E$.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[qn].push(t.proxyErrors?new Ix(this,e,t):new rb(this,e,t)),this[to]?yh(()=>this[Tf]()):this[Tf]()),e}unpipe(e){let t=this[qn].find(r=>r.dest===e);t&&(this[qn].length===1?(this[zr]&&this[mc]===0&&(this[zr]=!1),this[qn]=[]):this[qn].splice(this[qn].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[_i]=!1,this[mc]++,!this[qn].length&&!this[zr]&&this[Tf]();else if(e==="readable"&&this[Yr]!==0)super.emit("readable");else if(Hle(e)&&this[nl])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[hh]){let i=t;this[to]?yh(()=>i.call(this,this[hh])):i.call(this,this[hh])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[mc]=this.listeners("data").length,this[mc]===0&&!this[_i]&&!this[qn].length&&(this[zr]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[mc]=0,!this[_i]&&!this[qn].length&&(this[zr]=!1)),t}get emittedEnd(){return this[nl]}[sa](){!this[X_]&&!this[nl]&&!this[ur]&&this[Kr].length===0&&this[ia]&&(this[X_]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[J_]&&this.emit("close"),this[X_]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==ur&&this[ur])return!1;if(e==="data")return!this[An]&&!r?!1:this[to]?(yh(()=>this[vx](r)),!0):this[vx](r);if(e==="end")return this[A$]();if(e==="close"){if(this[J_]=!0,!this[nl]&&!this[ur])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[hh]=r,super.emit(Ex,r);let s=!this[gh]||this.listeners("error").length?super.emit("error",r):!1;return this[sa](),s}else if(e==="resume"){let s=super.emit("resume");return this[sa](),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[sa](),i}[vx](e){for(let r of this[qn])r.dest.write(e)===!1&&this.pause();let t=this[_i]?!1:super.emit("data",e);return this[sa](),t}[A$](){return this[nl]?!1:(this[nl]=!0,this.readable=!1,this[to]?(yh(()=>this[Tx]()),!0):this[Tx]())}[Tx](){if(this[vf]){let t=this[vf].end();if(t){for(let r of this[qn])r.dest.write(t);this[_i]||super.emit("data",t)}}for(let t of this[qn])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[An]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[An]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[An])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[gs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(ur,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[_i]=!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[ia])return t();let s,o,l=a(d=>{this.off("data",c),this.off("end",u),this.off(ur,f),t(),o(d)},"onerr"),c=a(d=>{this.off("error",l),this.off("end",u),this.off(ur,f),this.pause(),s({value:d,done:!!this[ia]})},"ondata"),u=a(()=>{this.off("error",l),this.off("data",c),this.off(ur,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>l(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(ur,f),this.once("error",l),this.once("end",u),this.once("data",c)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[_i]=!1;let e=!1,t=a(()=>(this.pause(),this.off(Ex,t),this.off(ur,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=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(Ex,t),this.once(ur,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[ur])return e?this.emit("error",e):this.emit(ur),this;this[ur]=!0,this[_i]=!0,this[Kr].length=0,this[Yr]=0;let t=this;return typeof t.close=="function"&&!this[J_]&&t.close(),e?this.emit("error",e):this.emit(ur),this}static get isStream(){return Vle}}});var Af,P$,no,Xle,sl,Jle,bh,D$,F$,Zle,ece,Fi,L$,N$,ro,k$,M$,gc,j$,Di,_h,Cx,x$,Sh,ys,ib,ob,R$,tce,Ox,C$,wh,O$,sb,ab,Px,$$,In,lb,cb,ub,If,xf,Eh,OIe,U$,B$=et(()=>{w$();Af=require("node:path"),P$=require("node:url"),no=require("fs"),Xle=be(require("node:fs"),1),sl=require("node:fs/promises");Rx();Jle=no.realpathSync.native,bh={lstatSync:no.lstatSync,readdir:no.readdir,readdirSync:no.readdirSync,readlinkSync:no.readlinkSync,realpathSync:Jle,promises:{lstat:sl.lstat,readdir:sl.readdir,readlink:sl.readlink,realpath:sl.realpath}},D$=a(n=>!n||n===bh||n===Xle?bh:{...bh,...n,promises:{...bh.promises,...n.promises||{}}},"fsFromOption"),F$=/^\\\\\?\\([a-z]:)\\?$/i,Zle=a(n=>n.replace(/\//g,"\\").replace(F$,"$1\\"),"uncToDrive"),ece=/[\\\/]/,Fi=0,L$=1,N$=2,ro=4,k$=6,M$=8,gc=10,j$=12,Di=15,_h=~Di,Cx=16,x$=32,Sh=64,ys=128,ib=256,ob=512,R$=Sh|ys|ob,tce=1023,Ox=a(n=>n.isFile()?M$:n.isDirectory()?ro:n.isSymbolicLink()?gc:n.isCharacterDevice()?N$:n.isBlockDevice()?k$:n.isSocket()?j$:n.isFIFO()?L$:Fi,"entToType"),C$=new ph({max:2**12}),wh=a(n=>{let e=C$.get(n);if(e)return e;let t=n.normalize("NFKD");return C$.set(n,t),t},"normalize"),O$=new ph({max:2**12}),sb=a(n=>{let e=O$.get(n);if(e)return e;let t=wh(n.toLowerCase());return O$.set(n,t),t},"normalizeNocase"),ab=class extends ph{static{a(this,"ResolveCache")}constructor(){super({max:256})}},Px=class extends ph{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},$$=Symbol("PathScurry setAsCwd"),In=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}#o;get uid(){return this.#o}#b;get gid(){return this.#b}#l;get rdev(){return this.#l}#u;get blksize(){return this.#u}#a;get ino(){return this.#a}#h;get size(){return this.#h}#m;get blocks(){return this.#m}#c;get atimeMs(){return this.#c}#i;get mtimeMs(){return this.#i}#y;get ctimeMs(){return this.#y}#S;get birthtimeMs(){return this.#S}#f;get atime(){return this.#f}#d;get mtime(){return this.#d}#T;get ctime(){return this.#T}#_;get birthtime(){return this.#_}#w;#v;#g;#E;#A;#R;#s;#P;#D;#x;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=Fi,r,i,s,o,l){this.name=e,this.#w=s?sb(e):wh(e),this.#s=t&tce,this.nocase=s,this.roots=i,this.root=r||this,this.#P=o,this.#g=l.fullpath,this.#A=l.relative,this.#R=l.relativePosix,this.parent=l.parent,this.parent?this.#e=this.parent.#e:this.#e=D$(l.fs)}depth(){return this.#v!==void 0?this.#v:this.parent?this.#v=this.parent.depth()+1:this.#v=0}childrenCache(){return this.#P}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 r of e)t=t.child(r);return t}children(){let e=this.#P.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#P.set(this,t),this.#s&=~Cx,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?sb(e):wh(e);for(let c of r)if(c.#w===i)return c;let s=this.parent?this.sep:"",o=this.#g?this.#g+s+e:void 0,l=this.newChild(e,Fi,{...t,parent:this,fullpath:o});return this.canReaddir()||(l.#s|=ys),r.push(l),l}relative(){if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let e=this.name,t=this.parent;if(!t)return this.#A=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#g!==void 0)return this.#g;let e=this.name,t=this.parent;if(!t)return this.#g=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#g=i}fullpathPosix(){if(this.#E!==void 0)return this.#E;if(this.sep==="/")return this.#E=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#E=`//?/${i}`:this.#E=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#E=r}isUnknown(){return(this.#s&Di)===Fi}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.#s&Di)===M$}isDirectory(){return(this.#s&Di)===ro}isCharacterDevice(){return(this.#s&Di)===N$}isBlockDevice(){return(this.#s&Di)===k$}isFIFO(){return(this.#s&Di)===L$}isSocket(){return(this.#s&Di)===j$}isSymbolicLink(){return(this.#s&gc)===gc}lstatCached(){return this.#s&x$?this:void 0}readlinkCached(){return this.#D}realpathCached(){return this.#x}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#D)return!0;if(!this.parent)return!1;let e=this.#s&Di;return!(e!==Fi&&e!==gc||this.#s&ib||this.#s&ys)}calledReaddir(){return!!(this.#s&Cx)}isENOENT(){return!!(this.#s&ys)}isNamed(e){return this.nocase?this.#w===sb(e):this.#w===wh(e)}async readlink(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#D=r}catch(t){this.#O(t.code);return}}readlinkSync(){let e=this.#D;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#D=r}catch(t){this.#O(t.code);return}}#$(e){this.#s|=Cx;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#I()}}#I(){this.#s&ys||(this.#s=(this.#s|ys)&_h,this.#G())}#G(){let e=this.children();e.provisional=0;for(let t of e)t.#I()}#N(){this.#s|=ob,this.#L()}#L(){if(this.#s&Sh)return;let e=this.#s;(e&Di)===ro&&(e&=_h),this.#s=e|Sh,this.#G()}#U(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#I():this.children().provisional=0}#C(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#I()}#O(e=""){let t=this.#s;t|=ib,e==="ENOENT"&&(t|=ys),(e==="EINVAL"||e==="UNKNOWN")&&(t&=_h),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#B(e,t){return this.#q(e,t)||this.#k(e,t)}#k(e,t){let r=Ox(e),i=this.newChild(e.name,r,{parent:this}),s=i.#s&Di;return s!==ro&&s!==gc&&s!==Fi&&(i.#s|=Sh),t.unshift(i),t.provisional++,i}#q(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?sb(e.name):wh(e.name))===i.#w)return this.#Y(e,i,r,t)}}#Y(e,t,r,i){let s=t.name;return t.#s=t.#s&_h|Ox(e),s!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&ys)===0)try{return this.#W(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#C(e.code)}}lstatSync(){if((this.#s&ys)===0)try{return this.#W(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#C(e.code)}}#W(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:l,ctime:c,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:_,mtimeMs:y,nlink:b,rdev:S,size:I,uid:O}=e;this.#f=t,this.#c=r,this.#_=i,this.#S=s,this.#u=o,this.#m=l,this.#T=c,this.#y=u,this.#n=f,this.#b=d,this.#a=p,this.#r=h,this.#d=_,this.#i=y,this.#t=b,this.#l=S,this.#h=I,this.#o=O;let T=Ox(e);this.#s=this.#s&_h|T|x$,T!==Fi&&T!==ro&&T!==gc&&(this.#s|=Sh)}#M=[];#p=!1;#H(e){this.#p=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#p)return;this.#p=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#U(s.code),r.provisional=0;else{for(let l of o)this.#B(l,r);this.#$(r)}this.#H(r.slice(0,r.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 r=a(()=>{},"resolve");this.#V=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#B(i,e);this.#$(e)}catch(i){this.#U(i.code),e.provisional=0}this.#V=void 0,r()}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 r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#B(r,e);this.#$(e)}catch(r){this.#U(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&R$)return!1;let e=Di&this.#s;return e===Fi||e===ro||e===gc}shouldWalk(e,t){return(this.#s&ro)===ro&&!(this.#s&R$)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#x)return this.#x;if(!((ob|ib|ys)&this.#s))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#x=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#x)return this.#x;if(!((ob|ib|ys)&this.#s))try{let e=this.#e.realpathSync(this.fullpath());return this.#x=this.resolve(e)}catch{this.#N()}}[$$](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#A=r.join(this.sep),i.#R=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#A=void 0,i.#R=void 0,i=i.parent}},lb=class n extends In{static{a(this,"PathWin32")}sep="\\";splitSep=ece;constructor(e,t=Fi,r,i,s,o,l){super(e,t,r,i,s,o,l)}newChild(e,t=Fi,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Af.win32.parse(e).root}getRoot(e){if(e=Zle(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new If(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(F$,"$1\\"),e===t}},cb=class n extends In{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=Fi,r,i,s,o,l){super(e,t,r,i,s,o,l)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=Fi,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},ub=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=bh}={}){this.#t=D$(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,P$.fileURLToPath)(e));let l=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(l),this.#e=new ab,this.#n=new ab,this.#r=new Px(s);let c=l.substring(this.rootPath.length).split(r);if(c.length===1&&!c[0]&&c.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=c.length-1,d=t.sep,p=this.rootPath,h=!1;for(let _ of c){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 r=this.#e.get(t);if(r!==void 0)return r;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 r=this.#n.get(t);if(r!==void 0)return r;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 In||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?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 In||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?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 In||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof In||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof In||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof In||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof In||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,l=[];(!s||s(e))&&l.push(r?e:e.fullpath());let c=new Set,u=a((d,p)=>{c.add(d),d.readdirCB((h,_)=>{if(h)return p(h);let y=_.length;if(!y)return p();let b=a(()=>{--y===0&&p()},"next");for(let S of _)(!s||s(S))&&l.push(r?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(I=>I?.isUnknown()?I.lstat():I).then(I=>I?.shouldWalk(c,o)?u(I,b):b()):S.shouldWalk(c,o)?u(S,b):b()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(l)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof In||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,l=[];(!s||s(e))&&l.push(r?e:e.fullpath());let c=new Set([e]);for(let u of c){let f=u.readdirSync();for(let d of f){(!s||s(d))&&l.push(r?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(c,o)&&c.add(p)}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof In||(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 In||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield r?e:e.fullpath());let l=new Set([e]);for(let c of l){let u=c.readdirSync();for(let f of u){(!s||s(f))&&(yield r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(l,o)&&l.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof In||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,l=new il({objectMode:!0});(!s||s(e))&&l.write(r?e:e.fullpath());let c=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&l.end();return}f++,c.add(h);let _=a((b,S,I=!1)=>{if(b)return l.emit("error",b);if(i&&!I){let O=[];for(let T of S)T.isSymbolicLink()&&O.push(T.realpath().then(E=>E?.isUnknown()?E.lstat():E));if(O.length){Promise.all(O).then(()=>_(null,S,!0));return}}for(let O of S)O&&(!s||s(O))&&(l.write(r?O:O.fullpath())||(p=!0));f--;for(let O of S){let T=O.realpathCached()||O;T.shouldWalk(c,o)&&u.push(T)}p&&!l.flowing?l.once("drain",d):y||d()},"onReaddir"),y=!0;h.readdirCB(_,!0),y=!1}},"process");return d(),l}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof In||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,l=new il({objectMode:!0}),c=new Set;(!s||s(e))&&l.write(r?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&l.end();return}f++,c.add(h);let _=h.readdirSync();for(let y of _)(!s||s(y))&&(l.write(r?y:y.fullpath())||(p=!0));f--;for(let y of _){let b=y;if(y.isSymbolicLink()){if(!(i&&(b=y.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(c,o)&&u.push(b)}}p&&!l.flowing&&l.once("drain",d)},"process");return d(),l}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[$$](t)}},If=class extends ub{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Af.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Af.win32.parse(e).root.toUpperCase()}newRoot(e){return new lb(this.rootPath,ro,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},xf=class extends ub{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Af.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new cb(this.rootPath,ro,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},Eh=class extends xf{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},OIe=process.platform==="win32"?lb:cb,U$=process.platform==="win32"?If:process.platform==="darwin"?Eh:xf});var rce,nce,Rf,Dx=et(()=>{tl();rce=a(n=>n.length>=1,"isPatternList"),nce=a(n=>n.length>=1,"isGlobList"),Rf=class n{static{a(this,"Pattern")}#e;#n;#r;length;#t;#o;#b;#l;#u;#a;#h=!0;constructor(e,t,r,i){if(!rce(e))throw new TypeError("empty pattern list");if(!nce(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,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=r,this.#t=i,this.#r===0){if(this.isUNC()){let[s,o,l,c,...u]=this.#e,[f,d,p,h,..._]=this.#n;u[0]===""&&(u.shift(),_.shift());let y=[s,o,l,c,""].join("/"),b=[f,d,p,h,""].join("/");this.#e=[y,...u],this.#n=[b,..._],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[l,...c]=this.#n;o[0]===""&&(o.shift(),c.shift());let u=s+"/",f=l+"/";this.#e=[u,...o],this.#n=[f,...c],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]===cr}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#b=this.#b||(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.#o!==void 0?this.#o:this.hasMore()?(this.#o=new n(this.#e,this.#n,this.#r+1,this.#t),this.#o.#a=this.#a,this.#o.#u=this.#u,this.#o.#l=this.#l,this.#o):this.#o=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.#l!==void 0?this.#l:this.#l=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.#a!==void 0?this.#a:this.#a=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.#h)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}}});var ice,Cf,Fx=et(()=>{tl();Dx();ice=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Cf=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:o=ice}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let l of e)this.add(l)}add(e){let t=new yi(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],s=t.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Rf(i,s,0,this.platform),l=new yi(o.globString(),this.mmopts),c=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(l):this.relative.push(l),c&&(u?this.absoluteChildren.push(l):this.relativeChildren.push(l))}}ignored(e){let t=e.fullpath(),r=`${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(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}}});var Lx,Nx,kx,vh,V$=et(()=>{tl();Lx=class n{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},Nx=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?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)])}},kx=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.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())}},vh=class n{static{a(this,"Processor")}hasWalkedCache;matches=new Nx;subwalks=new kx;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Lx}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),l=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 c,u,f=!1;for(;typeof(c=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(c),s=u,f=!0;if(c=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof c=="string"){let d=c===".."||c===""||c===".";this.matches.add(i.resolve(c),l,d);continue}else if(c===cr){(!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,l,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,l,!0)}}else c instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of r){let l=o.isAbsolute(),c=o.pattern(),u=o.rest();c===cr?i.testGlobstar(s,o,u,l):c instanceof RegExp?i.testRegExp(s,c,u,l):i.testString(s,c,u,l)}return i}testGlobstar(e,t,r,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()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}}});var sce,fb,Th,Ah,q$=et(()=>{Rx();Fx();V$();sce=a((n,e)=>typeof n=="string"?new Cf([n],e):Array.isArray(n)?new Cf(n,e):n,"makeIgnore"),fb=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#r=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#n=sce(r.ignore??[],r),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#o(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 r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}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 r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}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 r=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(r){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,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new vh(this.opts),r)}walkCB2(e,t,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[l,c,u]of r.matches.entries())this.#t(l)||(s++,this.match(l,c,u).then(()=>o()));for(let l of r.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let c=l.readdirCached();l.calledReaddir()?this.walkCB3(l,c,r,o):l.readdirCB((u,f)=>this.walkCB3(l,f,r,o),!0)}o()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[l,c,u]of r.matches.entries())this.#t(l)||(s++,this.match(l,c,u).then(()=>o()));for(let[l,c]of r.subwalks.entries())s++,this.walkCB2(l,c,r.child(),o);o()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new vh(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[l,c,u]of r.matches.entries())this.#t(l)||this.matchSync(l,c,u);for(let l of r.subwalkTargets()){if(this.maxDepth!==1/0&&l.depth()>=this.maxDepth)continue;s++;let c=l.readdirSync();this.walkCB3Sync(l,c,r,o)}o()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[l,c,u]of r.matches.entries())this.#t(l)||this.matchSync(l,c,u);for(let[l,c]of r.subwalks.entries())s++,this.walkCB2Sync(l,c,r.child(),o);o()}},Th=class extends fb{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}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}},Ah=class extends fb{static{a(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new il({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 G$,oce,_s,Mx=et(()=>{tl();G$=require("node:url");B$();Dx();q$();oce=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",_s=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,G$.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(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||oce,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 c=t.platform==="win32"?If:t.platform==="darwin"?Eh:t.platform?xf:U$;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(c=>new yi(c,i)),[o,l]=s.reduce((c,u)=>(c[0].push(...u.set),c[1].push(...u.globParts),c),[[],[]]);this.patterns=o.map((c,u)=>{let f=l[u];if(!f)throw new Error("invalid pattern object");return new Rf(c,f,0,this.platform)})}async walk(){return[...await new Th(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 Th(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 Ah(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 Ah(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 jx,$x=et(()=>{tl();jx=a((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new yi(t,e).hasMagic())return!0;return!1},"hasMagic")});function db(n,e={}){return new _s(n,e).streamSync()}function H$(n,e={}){return new _s(n,e).stream()}function z$(n,e={}){return new _s(n,e).walkSync()}async function W$(n,e={}){return new _s(n,e).walk()}function pb(n,e={}){return new _s(n,e).iterateSync()}function K$(n,e={}){return new _s(n,e).iterate()}var ace,lce,cce,uce,fce,Of,Ux=et(()=>{tl();Mx();$x();tl();Mx();$x();Fx();a(db,"globStreamSync");a(H$,"globStream");a(z$,"globSync");a(W$,"glob_");a(pb,"globIterateSync");a(K$,"globIterate");ace=db,lce=Object.assign(H$,{sync:db}),cce=pb,uce=Object.assign(K$,{sync:pb}),fce=Object.assign(z$,{stream:db,iterate:pb}),Of=Object.assign(W$,{glob:W$,globSync:z$,sync:fce,globStream:H$,stream:lce,globStreamSync:db,streamSync:ace,globIterate:K$,iterate:uce,globIterateSync:pb,iterateSync:cce,Glob:_s,hasMagic:jx,escape:Ef,unescape:ms});Of.glob=Of});async function Q$(n,e,t,r={}){let{dryRun:i=!1,excludeRelPath:s}=r,o=yc.default.join(n,"**/*.md"),l=await Of(o,{nodir:!0,ignore:[yc.default.join(n,".obsidian/**"),yc.default.join(n,".trash/**"),yc.default.join(n,"**/.obsidian/**"),yc.default.join(n,"**/.trash/**")]}),c={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let u of l){let f=yc.default.relative(n,u);if(s&&f===s)continue;c.filesScanned+=1;let d;try{d=await Bx.default.readFile(u,"utf-8")}catch{continue}let{updated:p,replacements:h}=dce(d,e,t);h>0&&(c.filesModified+=1,c.replacements+=h,c.modifiedFiles.push(f),i||await Bx.default.writeFile(u,p,"utf-8"))}return c}function dce(n,e,t){let r=n.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=r[s],l=pce(o,e,t);i+=l.replacements,r[s]=l.updated}return{updated:r.join(""),replacements:i}}function pce(n,e,t){let r=n.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=hce(r[s],e,t);i+=o.replacements,r[s]=o.updated}return{updated:r.join(""),replacements:i}}function hce(n,e,t){let r=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:n.replace(r,(o,l,c)=>l.trim()!==e?o:(i+=1,`[[${t}${c}]]`)),replacements:i}}var Bx,yc,X$=et(()=>{"use strict";Bx=be(na()),yc=be(require("path"));Ux();a(Q$,"rewriteInboundWikilinks");a(dce,"rewriteContent");a(pce,"rewriteProseSegment");a(hce,"replaceWikilinks")});var vr,Jt,J$,mce,Lt,bi=et(()=>{"use strict";vr=be(na()),Jt=be(require("path"));ah();J$=be(Xe());X$();mce=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Lt=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 vr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return vr.default.readFile(t,"utf-8")}async create(e,t){let r=this.resolvePath(e);if(await vr.default.pathExists(r))throw new Error(`File already exists: ${e}`);return await vr.default.ensureDir(Jt.default.dirname(r)),await vr.default.writeFile(r,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let r=this.resolvePath(e.path);if(!await vr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await vr.default.writeFile(r,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await vr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await vr.default.remove(t)}async exists(e){let t=this.resolvePath(e);return vr.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let r=vr.default.statSync(t);if(r.isFile())return this.createFileObject(e);if(r.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let r=Jt.default.relative(this.rootPath,t);e.push(this.createFileObject(r))}}),e}getFrontmatter(e){try{let t=vr.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let r=await this.read(e),i=this.extractFrontmatter(r)||{},s=t(i),o=this.replaceFrontmatter(r,s);await this.modify(e,o)}async rename(e,t){let r=this.resolvePath(e.path),i=this.resolvePath(t);if(!await vr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await vr.default.ensureDir(Jt.default.dirname(i)),await vr.default.move(r,i)}async createFolder(e){let t=this.resolvePath(e);await vr.default.ensureDir(t)}getFirstLinkpathDest(e,t,r){let i=e.split("|")[0].trim();if(!i)return null;if(mce.test(i)){this.uuidIndex===null&&this.buildUuidIndex();let u=i.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let s=Jt.default.dirname(this.resolvePath(t)),o;if(Jt.default.isAbsolute(i)?o=this.resolvePath(i):o=Jt.default.resolve(s,i),i.endsWith(".md")||(o+=".md"),vr.default.existsSync(o)){let u=Jt.default.relative(this.rootPath,o);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let l=i.toLowerCase(),c=this.basenameIndex.get(l);if(c)return this.createFileObject(c);if(r?.allowAliasFallback!==!1){let u=this.aliasIndex.get(l);if(u)return this.createFileObject(u)}return null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=Jt.default.relative(this.rootPath,e),r=Jt.default.basename(e,".md").toLowerCase();this.basenameIndex.has(r)||this.basenameIndex.set(r,t);let i;try{i=vr.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,l=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let c of l){if(typeof c!="string")continue;let u=c.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 r=Jt.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(r){let i=r[1].toLowerCase(),s=Jt.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let r=await this.read(e),i=t(r);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,r){let i=Jt.default.basename(t,".md");await Q$(this.rootPath,r,i,{excludeRelPath:e})}resolvePath(e){if(Jt.default.isAbsolute(e))return e;let t=this.rootPath.replace(/[/\\]+$/,""),r=Jt.default.sep+e;return r===t||r.startsWith(t+Jt.default.sep)?r:Jt.default.join(this.rootPath,e)}createFileObject(e){let t=Jt.default.basename(e),r=Jt.default.basename(e,Jt.default.extname(e)),i=Jt.default.dirname(e);return{path:e,basename:r,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:Jt.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);return r?(0,J$.parseYamlFrontmatterTolerant)(r[1]):null}replaceFrontmatter(e,t){let r=wf(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
375
375
  ${r.trim()}
376
376
  ---`):`---
@@ -567,13 +567,13 @@ ${y}
567
567
  `);return}e.dryRun||(0,zf.writeFileSync)(r,o.content,"utf-8"),process.stdout.write(JSON.stringify({path:i,changed:!0,dryRun:!!e.dryRun,removed:o.removed})+`
568
568
  `)}catch(t){we.handle(t)}})}a(W6,"repairFrontmatterCommand");ft();var H6=require("fs"),z6=require("path"),$i=be(Xe());bi();xt();jt();ir();Nb();var $fe="https://exocortex.my/ontology/find#Alias_sparql",Ufe="https://exocortex.my/ontology/exo#Asset_label";function Kf(n){if(n&&typeof n=="object"&&"value"in n){let e=n.value;return typeof e=="string"?e:String(e)}return String(n)}a(Kf,"nodeValue");async function Bfe(n,e){let t=await n.match(void 0,void 0,void 0),r=[];for(let s of t)Kf(s.predicate)!==Ufe||Kf(s.object)!==e||r.push(Kf(s.subject));if(r.length===0)return null;let i=[];for(let s of r)for(let o of t)Kf(o.predicate)===$fe&&Kf(o.subject)===s&&i.push(Kf(o.object));if(i.length===0)return null;if(i.length>1)throw new nt(`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(Bfe,"resolveAliasFragment");var Vfe=/^([a-z][a-zA-Z0-9]*)__([A-Za-z0-9_]+)$/,qfe="https://exocortex.my/ontology/";function Gfe(n,e){let t=Vfe.exec(e);if(t){let i=`<${qfe}${t[1]}#${t[2]}>`;return n.replace(/\?value\b/g,i)}let r=e.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return n.replace(/\?value\b/g,`"${r}"`)}a(Gfe,"bindValueLiteral");function K6(){return new Ie("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 n=>{we.setFormat("text");try{if(n.sparql&&n.class)throw new nt("--sparql and --class are mutually exclusive","Pass either a raw --sparql query or a find__Alias-backed flag like --class");if(!n.sparql&&!n.class)throw new nt("one of --sparql <query> or --class <value> is required",'exocortex find --class ems__Task OR exocortex find --sparql "SELECT ?path WHERE { ... }"');let e=(0,z6.resolve)(n.vault);if(!(0,H6.existsSync)(e))throw new Qe(e);let t=new Lt(e),i=await new $i.NoteToRDFConverter(t).convertVault(),s=new $i.InMemoryTripleStore;await s.addAll(i);let o;if(n.class){let b=await Bfe(s,"class");if(b===null)throw new nt('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 { ${Gfe(b,n.class)} }`}else o=n.sparql;let l=Fb(o);l=Mf(l);let c=new $i.ExoQLParser,u=Lb(Db(e));u.size>0&&c.setVaultPrefixes(u);let f=c.parse(l),p=new $i.ExoQLAlgebraTranslator().translate(f);p.type!=="construct"&&(p=new $i.AlgebraOptimizer().optimize(p));let _=await new $i.ExoQLQueryExecutor(s).executeAll(p),y="obsidian://vault/";for(let b of _){let I=b.toJSON().path;if(typeof I!="string"||!I.startsWith(y))continue;let O=I.slice(y.length),T;try{T=decodeURIComponent(O)}catch{T=O}process.stdout.write(T+`
569
569
  `)}}catch(e){we.handle(e),process.exit(5)}})}a(K6,"findCommand");ft();var qR=require("fs"),ha=require("path"),Ve=be(Xe());xt();jt();ir();bi();var tU=be(Xe()),Ut=be(J6());var Z6="obsidian://vault/";function dde(n){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 r=t;if(r.startsWith(Z6))r=decodeURI(r.slice(Z6.length));else if(e.test(r)){let i=await n.findFileByUID(r);if(!i)throw new Error(`No vault file found for UID: ${r}`);r=i}if(r.endsWith(".md")||(r=`${r}.md`),!await n.fileExists(r))throw new Error(`Cannot resolve target file for IRI "${t}" (tried "${r}")`);return r}}}a(dde,"createCliPathResolver");var pde=["openFile","sparqlSelect","getActiveFileIRI","getActiveFilePath","trashFile","duplicateFile"],VR=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 eU(n){return{async execute(){throw new VR(n)}}}a(eU,"notImplementedService");function hde(n){return e=>{let t=n.getFirstLinkpathDest(e,"");if(!t||!("basename"in t))return null;let i=n.getFrontmatter(t)?.exo__Asset_label;return typeof i=="string"&&i.length>0?i:null}}a(hde,"createCliClassResolver");function rU(n,e){for(let t of pde)n.register(t,eU(t));for(let t of["updateProperty","removeProperty","setStatus","createAsset"])n.register(t,eU(t));if(e){if(e.fsAdapter){let t=new tU.FrontmatterService,r=dde(e.fsAdapter);n.register("updateProperty",(0,Ut.createUpdatePropertyService)(e.fsAdapter,t,r)),n.register("removeProperty",(0,Ut.createRemovePropertyService)(e.fsAdapter,t,r)),n.register("setStatus",(0,Ut.createSetStatusService)(e.fsAdapter,t,r)),n.register("createAsset",(0,Ut.createCreateAssetService)(e.vaultAdapter,e.fsAdapter,hde(e.vaultAdapter))),n.register("instantiatePrototypeSubtree",(0,Ut.createInstantiatePrototypeSubtreeService)(e.vaultAdapter,e.fsAdapter))}n.register("createRelatedTask",(0,Ut.createCreateRelatedTaskService)(e.vaultAdapter,e.genericAssetCreationService)),n.register("createRelatedProject",(0,Ut.createCreateRelatedProjectService)(e.vaultAdapter,e.genericAssetCreationService)),n.register("archiveAsset",(0,Ut.createArchiveAssetService)(e.vaultAdapter,e.archiveAssetService)),n.register("planForEvening",(0,Ut.createPlanForEveningService)(e.vaultAdapter,e.taskStatusService)),n.register("cleanProperties",(0,Ut.createCleanPropertiesService)(e.vaultAdapter,e.propertyCleanupService)),n.register("renameToUid",(0,Ut.createRenameToUidService)(e.vaultAdapter,e.renameToUidService)),n.register("repairFolder",(0,Ut.createRepairFolderService)(e.vaultAdapter,e.folderRepairService)),n.register("fixMissingLabel",(0,Ut.createFixMissingLabelService)(e.vaultAdapter,e.fixMissingLabelService))}}a(rU,"populateCliServiceRegistry");function mde(n,e){let t=n.getAbstractFileByPath(e),r=t!==null&&"basename"in t?t:null,i=r?n.getFrontmatter(r):null,s=i&&typeof i=="object"?i.exo__Asset_label:void 0;return{uuid:r?.basename??e.replace(/^.*\//,"").replace(/\.md$/,""),path:e,label:typeof s=="string"?s:""}}a(mde,"buildCreatedAsset");var gde=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function yde(){if(process.stdin.isTTY)return[];let n=[];for await(let t of process.stdin)n.push(t);return Buffer.concat(n).toString("utf-8").split(`
570
- `).map(t=>t.trim()).filter(t=>t.length>0)}a(yde,"readStdinLines");function Jb(n){if(n&&typeof n=="object"&&"value"in n){let e=n.value;return typeof e=="string"?e:String(e)}return String(n)}a(Jb,"nodeValue");async function _de(n,e){let t=new Ve.IRI("https://exocortex.my/ontology/exocmd#Command_cliName"),r=await n.match(void 0,t,void 0),i=[];for(let s of r)if(Jb(s.object)===e){let c=Jb(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);c&&i.push(c[1])}if(i.length===0)return null;if(i.length>1)throw new nt(`Ambiguous cliName "${e}" \u2014 resolves to ${i.length} commands: ${i.join(", ")}`,"Use the UUID directly: exocortex apply <uuid> <path>");return i[0]}a(_de,"resolveSlugToUuid");async function bde(n,e){let t=new Ve.IRI("https://exocortex.my/ontology/exocmd#Command_destructive"),r=await n.match(void 0,t,void 0);for(let i of r)if(Jb(i.subject).includes(e)){let o=Jb(i.object);if(o==="true"||o==="True")return!0}return!1}a(bde,"isDestructive");async function Sde(n,e,t,r,i,s,o,l){let c={ok:!1,created:[]},u=(0,ha.resolve)(n,i);if(!(0,qR.existsSync)(u))return console.error(`\u274C Target file not found: ${i}`),c;let f=(0,ha.relative)(n,u);if(f===".."||f.startsWith(`..${ha.sep}`)||(0,ha.isAbsolute)(f))return console.error(`\u274C Target is outside the vault: ${i} (vault: ${n})`),c;let d=new Ve.CommandResolver(e),p=await d.loadCommand(r);if(!p)return console.error(`\u274C Command with UID "${r}" not found.`),c;if(await bde(e,r)&&!s.dryRun&&!s.yes)return console.error(`\u274C Command "${p.name}" is marked destructive. Add --dry-run to preview, or --yes to apply.`),c;let _=(0,Ve.vaultPathToIRI)(f),y=new Lt(n),b=new Ve.FolderRepairService(y),S=new Ve.PreconditionEvaluator(e,void 0,{clock:o});(0,Ve.registerDefaultHostFunctions)(S),S.registerHostFunction("isInWrongFolder",Mb(y,b)),S.registerHostFunction("hasObsoleteProperties",jb(y));let I=y.getAbstractFileByPath(f),O=I!==null&&"basename"in I?I:null,T=O?y.getFrontmatter(O):null,E=T&&typeof T=="object"?T.exo__Asset_uid:void 0,P={targetIRI:_,filePath:f,fileBasename:O?.basename,assetUid:typeof E=="string"?E:void 0};if(!await S.evaluate(p.precondition,_,P))return console.error(`\u274C Precondition not satisfied for "${p.name}" on "${f}".`),c;if(s.dryRun)return s.json||console.log(`\u{1F50D} Dry-run: would apply "${p.name}" to "${f}" (precondition passed).`),{ok:!0,created:[]};let M=new Ve.ServiceRegistry,j=new Ve.GenericAssetCreationService(y).withDeterminism({clock:o,uidGenerator:l}),$=new Ve.ArchiveAssetService(y),G=new Ve.PropertyCleanupService(y),ge=new Ve.FixMissingLabelService(y),ye=new Ve.RenameToUidService(y),Q=new Ve.TaskStatusService(y,new Ve.EffortStatusWorkflow,new Ve.StatusTimestampService(y)),se=new Wn(n);rU(M,{vaultAdapter:y,fsAdapter:se,genericAssetCreationService:j,archiveAssetService:$,taskStatusService:Q,propertyCleanupService:G,fixMissingLabelService:ge,renameToUidService:ye,folderRepairService:b});let J=new Ve.NamedQueryRunner(new $f(e,se),e),ve=new Ve.GroundingExecutor(se,se,M,(0,Ve.createVaultFrontmatterClassLabelResolver)(se),{clock:o,uidGenerator:l,workflowResolver:t,groundingLoader:a(he=>d.loadGroundingByUid(he),"groundingLoader"),templateLoader:a(async he=>{let Ue=await se.findFileByUID(he);return Ue?(0,Ve.stripTemplateFrontmatter)(await se.readFile(Ue)):null},"templateLoader"),namedQueryRunner:J,refToFolder:(0,Ve.createVaultFrontmatterRefToFolderResolver)(se),refToFrontmatter:(0,Ve.createVaultFrontmatterRefToFrontmatterResolver)(se)}),te;if(s.input)try{let he=JSON.parse(s.input);if(typeof he!="object"||he===null||Array.isArray(he))throw new Error("must be a JSON object");te=he}catch(he){let Ue=he instanceof Error?he.message:String(he);return console.error(`\u274C --input: invalid JSON object (${Ue})`),c}let ie=await ve.execute(p.grounding,_,f,te);if(ie.success){let he=[];ie.openPath&&he.push(ie.openPath),ie.createdPaths&&he.push(...ie.createdPaths);let Ue=[],ce=new Set;for(let ue of he)ce.has(ue)||(ce.add(ue),Ue.push(mde(y,ue)));if(!s.json){let ue=p.successMessage??`Applied "${p.name}" to "${f}".`,fe=ie.openPath??ie.createdPaths?.[0],ne=fe?` \u2192 ${fe}`:"";console.log(`\u2705 ${ue}${ne}`)}return{ok:!0,created:Ue}}else return console.error(`\u274C "${p.name}" failed on "${f}": ${ie.error}`),c}a(Sde,"executeOnTarget");function nU(){return new Ie("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 a grounding. Value-setting commands need a value key, e.g. set-planned-start / set-scheduled-date: --input '{"value":"<ISO>"}'; set-label: --input '{"value":"New label"}'. The required key is named in the error if omitted.`).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(n,e,t)=>{we.setFormat("text");try{let r=(0,ha.resolve)(t.vault);if(!(0,qR.existsSync)(r))throw new Qe(r);Wb(r);let i=t.frozenClock?(0,Ve.frozenClock)(t.frozenClock):(0,Ve.liveClock)(),s=t.seed?(0,Ve.seededUidGenerator)(t.seed):(0,Ve.liveUidGenerator)(),o=new Lt(r),c=await new Ve.NoteToRDFConverter(o).convertVault(),u=new Ve.InMemoryTripleStore;await u.addAll(c);let f=new Ve.WorkflowResolver(u),d;if(gde.test(n))d=n;else{let b=await _de(u,n);b||(console.error(`\u274C No command found with UUID or cliName "${n}".`),process.exit(3)),d=b}let p;if(e)p=[e];else if(p=await yde(),p.length===0)throw new nt("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 b of p){let S=await Sde(r,u,f,d,b,t,i,s);S.ok?h++:_++,y.push(...S.created)}if(p.length>1&&!t.json&&console.log(`
570
+ `).map(t=>t.trim()).filter(t=>t.length>0)}a(yde,"readStdinLines");function Jb(n){if(n&&typeof n=="object"&&"value"in n){let e=n.value;return typeof e=="string"?e:String(e)}return String(n)}a(Jb,"nodeValue");async function _de(n,e){let t=new Ve.IRI("https://exocortex.my/ontology/exocmd#Command_cliName"),r=await n.match(void 0,t,void 0),i=[];for(let s of r)if(Jb(s.object)===e){let c=Jb(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);c&&i.push(c[1])}if(i.length===0)return null;if(i.length>1)throw new nt(`Ambiguous cliName "${e}" \u2014 resolves to ${i.length} commands: ${i.join(", ")}`,"Use the UUID directly: exocortex apply <uuid> <path>");return i[0]}a(_de,"resolveSlugToUuid");async function bde(n,e){let t=new Ve.IRI("https://exocortex.my/ontology/exocmd#Command_destructive"),r=await n.match(void 0,t,void 0);for(let i of r)if(Jb(i.subject).includes(e)){let o=Jb(i.object);if(o==="true"||o==="True")return!0}return!1}a(bde,"isDestructive");async function Sde(n,e,t,r,i,s,o,l){let c={ok:!1,created:[]},u=(0,ha.resolve)(n,i);if(!(0,qR.existsSync)(u))return console.error(`\u274C Target file not found: ${i}`),c;let f=(0,ha.relative)(n,u);if(f===".."||f.startsWith(`..${ha.sep}`)||(0,ha.isAbsolute)(f))return console.error(`\u274C Target is outside the vault: ${i} (vault: ${n})`),c;let d=new Ve.CommandResolver(e),p=await d.loadCommand(r);if(!p)return console.error(`\u274C Command with UID "${r}" not found.`),c;if(await bde(e,r)&&!s.dryRun&&!s.yes)return console.error(`\u274C Command "${p.name}" is marked destructive. Add --dry-run to preview, or --yes to apply.`),c;let _=(0,Ve.vaultPathToIRI)(f),y=new Lt(n),b=new Ve.FolderRepairService(y),S=new Ve.PreconditionEvaluator(e,void 0,{clock:o});(0,Ve.registerDefaultHostFunctions)(S),S.registerHostFunction("isInWrongFolder",Mb(y,b)),S.registerHostFunction("hasObsoleteProperties",jb(y));let I=y.getAbstractFileByPath(f),O=I!==null&&"basename"in I?I:null,T=O?y.getFrontmatter(O):null,E=T&&typeof T=="object"?T.exo__Asset_uid:void 0,P={targetIRI:_,filePath:f,fileBasename:O?.basename,assetUid:typeof E=="string"?E:void 0};if(!await S.evaluate(p.precondition,_,P))return console.error(`\u274C Precondition not satisfied for "${p.name}" on "${f}".`),c;if(s.dryRun)return s.json||console.log(`\u{1F50D} Dry-run: would apply "${p.name}" to "${f}" (precondition passed).`),{ok:!0,created:[]};let M=new Ve.ServiceRegistry,j=new Ve.GenericAssetCreationService(y).withDeterminism({clock:o,uidGenerator:l}),$=new Ve.ArchiveAssetService(y),G=new Ve.PropertyCleanupService(y),ge=new Ve.FixMissingLabelService(y),ye=new Ve.RenameToUidService(y),Q=new Ve.TaskStatusService(y,new Ve.EffortStatusWorkflow,new Ve.StatusTimestampService(y)),se=new Wn(n);rU(M,{vaultAdapter:y,fsAdapter:se,genericAssetCreationService:j,archiveAssetService:$,taskStatusService:Q,propertyCleanupService:G,fixMissingLabelService:ge,renameToUidService:ye,folderRepairService:b});let J=new Ve.NamedQueryRunner(new $f(e,se),e),ve=new Ve.GroundingExecutor(se,se,M,(0,Ve.createVaultFrontmatterClassLabelResolver)(se),{clock:o,uidGenerator:l,workflowResolver:t,groundingLoader:a(he=>d.loadGroundingByUid(he),"groundingLoader"),templateLoader:a(async he=>{let Ue=await se.findFileByUID(he);return Ue?(0,Ve.stripTemplateFrontmatter)(await se.readFile(Ue)):null},"templateLoader"),namedQueryRunner:J,refToFolder:(0,Ve.createVaultFrontmatterRefToFolderResolver)(se),refToFrontmatter:(0,Ve.createVaultFrontmatterRefToFrontmatterResolver)(se)}),re;if(s.input)try{let he=JSON.parse(s.input);if(typeof he!="object"||he===null||Array.isArray(he))throw new Error("must be a JSON object");re=he}catch(he){let Ue=he instanceof Error?he.message:String(he);return console.error(`\u274C --input: invalid JSON object (${Ue})`),c}let ie=await ve.execute(p.grounding,_,f,re);if(ie.success){let he=[];ie.openPath&&he.push(ie.openPath),ie.createdPaths&&he.push(...ie.createdPaths);let Ue=[],ce=new Set;for(let ue of he)ce.has(ue)||(ce.add(ue),Ue.push(mde(y,ue)));if(!s.json){let ue=p.successMessage??`Applied "${p.name}" to "${f}".`,fe=ie.openPath??ie.createdPaths?.[0],ne=fe?` \u2192 ${fe}`:"";console.log(`\u2705 ${ue}${ne}`)}return{ok:!0,created:Ue}}else return console.error(`\u274C "${p.name}" failed on "${f}": ${ie.error}`),c}a(Sde,"executeOnTarget");function nU(){return new Ie("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 a grounding. Value-setting commands need a value key, e.g. set-planned-start / set-scheduled-date: --input '{"value":"<ISO>"}'; set-label: --input '{"value":"New label"}'. The required key is named in the error if omitted.`).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(n,e,t)=>{we.setFormat("text");try{let r=(0,ha.resolve)(t.vault);if(!(0,qR.existsSync)(r))throw new Qe(r);Wb(r);let i=t.frozenClock?(0,Ve.frozenClock)(t.frozenClock):(0,Ve.liveClock)(),s=t.seed?(0,Ve.seededUidGenerator)(t.seed):(0,Ve.liveUidGenerator)(),o=new Lt(r),c=await new Ve.NoteToRDFConverter(o).convertVault(),u=new Ve.InMemoryTripleStore;await u.addAll(c);let f=new Ve.WorkflowResolver(u),d;if(gde.test(n))d=n;else{let b=await _de(u,n);b||(console.error(`\u274C No command found with UUID or cliName "${n}".`),process.exit(3)),d=b}let p;if(e)p=[e];else if(p=await yde(),p.length===0)throw new nt("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 b of p){let S=await Sde(r,u,f,d,b,t,i,s);S.ok?h++:_++,y.push(...S.created)}if(p.length>1&&!t.json&&console.log(`
571
571
  \u{1F4CA} Applied to ${h}/${p.length} target(s) (${_} failed).`),t.json){let b={command:n,created:y};e?b.target=e:b.targets=p,process.stdout.write(JSON.stringify(b)+`
572
572
  `)}_>0&&process.exit(5)}catch(r){we.handle(r),process.exit(5)}})}a(nU,"applyCommand");ft();ft();var Zb=require("fs"),WR=be(require("path")),iU=require("path"),sU=be(Xe());xt();jt();var wde=new Set(["templates","09 templates"]);function Ui(n){return n.split("/").some(e=>wde.has(e.toLowerCase()))}a(Ui,"isTemplatesPath");function ao(n){return n.split("/").includes("node_modules")}a(ao,"isNodeModulesPath");var Ede=5;function GR(n,e,t){n[e].length<Ede&&n[e].push(t)}a(GR,"addExample");async function vde(n){let e=new ci(n),t=await e.indexedAssets(),r=[],i={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0},s={"empty-isDefinedBy":[],"bang-prefix":[],unresolvable:[]},o=0;for(let{path:l,metadata:c}of t){if(l.split("/").includes("node_modules")||Ui(l))continue;let u=c.exo__Asset_isDefinedBy,f=(0,sU.extractAssetReference)(u);if(!f){i["empty-isDefinedBy"]++,GR(s,"empty-isDefinedBy",l);continue}if(f.startsWith("!")){i["bang-prefix"]++,GR(s,"bang-prefix",l);continue}let d=await ul(e,f,l);if(!d){i.unresolvable++,GR(s,"unresolvable",l);continue}o++;let p=kR(WR.default.dirname(d)),h=kR(WR.default.dirname(l));p!==h&&r.push({path:l,isDefinedBy:f,expectedFolder:p,actualFolder:h})}return{vaultPath:n,totalFiles:t.length,checked:o,violations:r,skips:i,skipExamples:s}}a(vde,"scanVaultForCoLocation");function oU(){return new Ie("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 n=>{let e=n.output??"text";we.setFormat(e);try{let t=(0,iU.resolve)(n.vault);if(!(0,Zb.existsSync)(t)||!(0,Zb.statSync)(t).isDirectory())throw new Qe(t);let r=await vde(t),i=r.skips["empty-isDefinedBy"]+r.skips["bang-prefix"]+r.skips.unresolvable;if(e==="json")console.log(JSON.stringify({vaultPath:r.vaultPath,totalFiles:r.totalFiles,checked:r.checked,violationCount:r.violations.length,violations:r.violations,skips:r.skips,skipTotal:i,skipExamples:r.skipExamples,clean:r.violations.length===0},null,2));else{if(r.violations.length===0)console.log(`OK ${t}: 0 co-location violations (${r.checked}/${r.totalFiles} checked)`);else{console.error(`FAIL ${t}: ${r.violations.length} co-location violation(s) (${r.checked}/${r.totalFiles} checked):`);for(let s of r.violations)console.error(` ${s.path}
573
573
  isDefinedBy=${s.isDefinedBy} expected=${s.expectedFolder}/ actual=${s.actualFolder}/`)}console.error(`
574
574
  Skipped (fail-open, NOT verified): ${i} \u2014 empty-isDefinedBy=${r.skips["empty-isDefinedBy"]}, bang-prefix=${r.skips["bang-prefix"]}, unresolvable(cross-vault/missing)=${r.skips.unresolvable}`)}r.violations.length>0&&(process.exitCode=1)}catch(t){we.handle(t)}})}a(oU,"auditCoLocationCommand");ft();var tS=require("fs"),yU=require("path"),KR=be(Xe());function aU(n,e){let t=new Map,r=new Map,i=new Set,s=[],o=[],l=0;for(let c of n){if(t.has(c))continue;let u=[],f=a(d=>{t.set(d,l),r.set(d,l),l++,s.push(d),i.add(d),u.push([d,(e.get(d)??new Set).values()])},"pushNode");for(f(c);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];r.set(_,Math.min(r.get(_),r.get(d)))}if(r.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(_)&&r.set(d,Math.min(r.get(d),t.get(_))):f(_)}}}return o}a(aU,"stronglyConnectedComponents");function lU(n,e){return aU(n,e).filter(t=>t.length>=2)}a(lU,"tarjanSCC");function eS(n,e){let t=new Map;for(let r of n){let i=new Set,s=[...e.get(r)??[]];for(;s.length>0;){let o=s.shift();if(!i.has(o)){i.add(o);for(let l of e.get(o)??[])i.has(l)||s.push(l)}}t.set(r,i)}return t}a(eS,"transitiveClosure");function cU(n,e){let t=aU(n,e),r=new Map;t.forEach((s,o)=>{for(let l of s)r.set(l,o)});let i=new Map;for(let[s,o]of e){let l=r.get(s);if(l!==void 0)for(let c of o){let u=r.get(c);if(u===void 0||l===u)continue;let f=i.get(l);f||(f=new Set,i.set(l,f)),f.add(u)}}return{components:t,componentOf:r,condensedEdges:i}}a(cU,"condense");function uU(n,e){let t=eS(n,e),r=new Map;for(let[i,s]of e)for(let o of s){let l=!1;for(let c of s)if(c!==o&&t.get(c)?.has(o)){l=!0;break}if(!l){let c=r.get(i);c||(c=new Set,r.set(i,c)),c.add(o)}}return r}a(uU,"transitiveReduction");function fU(n,e){let t=new Map,r=new Map;for(let p of n)t.set(p,new Map),r.set(p,new Map);for(let p of e){if(p.source===p.target)continue;let h=t.get(p.source),_=r.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(n),s=[],o=[],l=a(p=>{i.delete(p);for(let h of t.get(p).keys())r.get(h)?.delete(p);for(let h of r.get(p).keys())t.get(h)?.delete(p);t.get(p).clear(),r.get(p).clear()},"removeNode"),c=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),l(h),p=!0);for(let h of u())i.has(h)&&r.get(h).size===0&&(s.push(h),l(h),p=!0)}if(i.size>0){let h=null,_=-1/0;for(let y of u()){let b=c(t.get(y))-c(r.get(y));b>_&&(_=b,h=y)}h!==null&&(s.push(h),l(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(fU,"greedyFeedbackArcSet");var dU=/\[\[([^\]]+)\]\]/g;function Tde(n){let e=n.split(`
575
575
  `),t=[],r=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("`"));r===null?o?r=s[1]:t.push(i):s&&s[1][0]===r[0]&&s[1].length>=r.length&&/^[ \t]*(?:`{3,}|~{3,})[ \t]*$/.test(i)&&(r=null)}return t.join(`
576
- `)}a(Tde,"stripFencedCodeBlocks");function pU(n){let e=[],t;for(dU.lastIndex=0;(t=dU.exec(n))!==null;){let r=t[1],i=r.indexOf("|");i!==-1&&(r=r.slice(0,i));let s=r.indexOf("#");s!==-1&&(r=r.slice(0,s));let o=r.trim();o.length>0&&e.push(o)}return e}a(pU,"extractWikilinkTargets");function HR(n){return typeof n=="string"?[n]:Array.isArray(n)?n.flatMap(HR):n!==null&&typeof n=="object"?Object.values(n).flatMap(HR):[]}a(HR,"collectFrontmatterStrings");function Ade(n){let e=n.match(/^---\n[\s\S]*?\n---/);return e?n.slice(e[0].length):n}a(Ade,"bodyOf");function hU(n,e,t){let r=[];for(let[s,o]of Object.entries(n))if(!t?.has(s))for(let l of HR(o))for(let c of pU(l))r.push(c);let i=pU(Tde(Ade(e)));return[...r,...i]}a(hU,"extractFileWikilinkTargets");var Ide=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function mU(n,e){if(e.includes("/")){let r=e.replace(/^\//,""),i=r.endsWith(".md")?r:`${r}.md`;if(await n.hasIndexedPath(i))return i;e=r.slice(r.lastIndexOf("/")+1)}if(e.endsWith(".md")&&(e=e.slice(0,-3)),Ide.test(e)){let r=await n.findFileByUID(e);if(r)return r}let t=await n.findPathsByBasename(e);return t.length===1?t[0]:t.length>1?new Set(t).size===1?t[0]:"ambiguous":null}a(mU,"resolveTargetPath");xt();jt();var xde="\0",Rde="829b9b3b-6fc3-4276-be6a-27d3398c012e",Cde=["exo__Asset_relates","concept__Concept_related","concept__Concept_broader","concept__Concept_synonym","exo__Asset_createdBy"],Ode=5,Pde=10,Dde=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 Fde(n){let e=n.lastIndexOf(".");if(e===-1||e===n.length-1)return!1;let t=n.slice(e+1).toLowerCase();return Dde.has(t)}a(Fde,"nonMarkdownExtension");function zR(n){if(Array.isArray(n)){let e=n.filter(t=>typeof t=="string");return{value:e[0]??null,multiple:e.length>1}}return{value:typeof n=="string"?n:null,multiple:!1}}a(zR,"firstString");function gU(n){let e=Array.isArray(n)?n:n==null?[]:[n],t=[];for(let r of e){let i=(0,KR.extractAssetReference)(r);i&&t.push(i)}return t}a(gU,"asRefList");function qh(n,e,t=Ode){n.length<t&&n.push(e)}a(qh,"pushExample");async function Lde(n,e={}){let t=new ci(n,{cacheContent:!0}),r=await t.indexedAssets(),i=new Set(e.excludePredicates??[]),s=new Map,o=new Map,l=new Map,c=[];for(let B of r){if(ao(B.path)||Ui(B.path)||!gU(B.metadata.exo__Instance_class).includes(Rde))continue;let{value:Ee}=zR(B.metadata.exo__Asset_uid);if(!Ee){c.push(B.path);continue}let{value:Ce}=zR(B.metadata.exo__Asset_label),xe=Ce??B.path,Oe=l.get(Ee);Oe?Oe.push(B.path):l.set(Ee,[B.path]),s.set(B.path,Ee),o.has(Ee)||o.set(Ee,{uid:Ee,label:xe,path:B.path,metadata:B.metadata})}let u=[...l.entries()].filter(([,B])=>B.length>1).map(([B,oe])=>({uid:B,paths:oe})),f=new Map,d={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0,"not-an-ontology":0},p=[],h=0,_=0,y=new Map,b=0,S=a((B,oe)=>{f.set(B,null),d[oe]++,h++,qh(p,`${B} (${oe})`,Pde)},"markNoOntology");for(let B of r){if(ao(B.path)||Ui(B.path))continue;b++;let oe=B.metadata.exo__Asset_isDefinedBy,{value:Ee,multiple:Ce}=zR(oe);Ce&&_++;let xe=(0,KR.extractAssetReference)(Ee);if(!xe){S(B.path,"empty-isDefinedBy");continue}if(xe.startsWith("!")){S(B.path,"bang-prefix");continue}let Oe=await ul(t,xe,B.path);if(!Oe){S(B.path,"unresolvable");continue}let Re=s.get(Oe);if(!Re){S(B.path,"not-an-ontology");continue}f.set(B.path,Re),y.set(Re,(y.get(Re)??0)+1)}let I=[...o.keys()],O=new Map,T=[],E=new Map,P=new Map,V=0;for(let B of I){let oe=o.get(B),Ee=gU(oe.metadata.exo__Ontology_imports),Ce=[],xe=[],Oe=!1;for(let Re of Ee){let Ae=null;if(o.has(Re))Ae=Re;else{let ee=await ul(t,Re,oe.path);Ae=ee?s.get(ee)??null:null}if(Ae===null)xe.push(Re);else if(Ae===B)Oe=!0;else{Ce.push(Ae);let ee=O.get(B);ee||(ee=new Set,O.set(B,ee)),ee.has(Ae)||(ee.add(Ae),V++)}}E.set(B,Ce),P.set(B,xe),Oe&&T.push(B)}let M=lU(I,O),j=eS(I,O),$={total:0,internal:0,crossOntologyValid:0,crossOntologyViolation:0,crossVault:0,noOntology:0},G={broken:0,"dup-basename":0,"non-markdown":0},ge={broken:[],"dup-basename":[],"non-markdown":[]},ye=new Map,Q=new Map,se=new Map,J=new Map,ve=new Map,te=new Map,ie=a(B=>{let oe=o.get(B);return oe?{uid:oe.uid,label:oe.label,path:oe.path}:{uid:B,label:B,path:""}},"toRef");for(let B of r){if(ao(B.path)||Ui(B.path))continue;let oe=f.get(B.path)??null,Ee=hU(B.metadata,B.content??"",i);for(let Ce of Ee){if($.total++,Fde(Ce)){G["non-markdown"]++,qh(ge["non-markdown"],`${B.path} \u2192 ${Ce}`);continue}let xe=await mU(t,Ce);if(xe==="ambiguous"){G["dup-basename"]++,qh(ge["dup-basename"],`${B.path} \u2192 ${Ce}`);continue}if(xe===null){G.broken++,qh(ge.broken,`${B.path} \u2192 ${Ce}`);continue}let Oe=f.get(xe)??s.get(xe)??null;if(oe===null||Oe===null){$.noOntology++;continue}if(oe===Oe){$.internal++,se.set(oe,(se.get(oe)??0)+1);continue}let Re=j.get(oe)?.has(Oe)??!1,Ae=`${oe}${xde}${Oe}`,ee=ye.get(Ae);if(ee?ee.occurrences++:ye.set(Ae,{source:oe,target:Oe,occurrences:1,valid:Re}),J.set(oe,(J.get(oe)??0)+1),ve.set(Oe,(ve.get(Oe)??0)+1),Re)$.crossOntologyValid++;else{$.crossOntologyViolation++,te.set(oe,(te.get(oe)??0)+1);let _e=Q.get(Ae);_e?(_e.occurrences++,qh(_e.examples,B.path)):Q.set(Ae,{source:oe,target:Oe,occurrences:1,examples:[B.path]})}}}let he=[...ye.values()].sort((B,oe)=>oe.occurrences-B.occurrences),Ue=new Map,ce=new Map;for(let B of he)ce.set(B.source,(ce.get(B.source)??0)+1),Ue.set(B.target,(Ue.get(B.target)??0)+1);let ue=I.map(B=>({...ie(B),declaredImports:E.get(B)??[],unresolvedImports:P.get(B)??[],selfImport:T.includes(B),assetCount:y.get(B)??0,inDegree:Ue.get(B)??0,outDegree:ce.get(B)??0,internalLinks:se.get(B)??0,externalLinksOut:J.get(B)??0,externalLinksIn:ve.get(B)??0,violatingOut:te.get(B)??0})).sort((B,oe)=>B.label.localeCompare(oe.label)),fe=[...Q.values()].map(B=>({source:ie(B.source),target:ie(B.target),occurrences:B.occurrences,examples:B.examples})).sort((B,oe)=>oe.occurrences-B.occurrences),ne=[],me=M.length===0,Le=fe.length===0&&$.crossVault===0&&me&&u.length===0;return{vaultPath:n,totalFiles:r.length,scannedFiles:b,ontologies:ue,duplicateOntologyUids:u,declared:{edgeCount:V,sccs:M,acyclic:me},derivedEdges:he,violations:fe,crossVault:ne,linkCounts:$,skips:G,skipExamples:ge,noOntologyAssets:{count:h,byReason:d,examples:p},warnings:{selfImports:T,multipleIsDefinedBy:_,ontologiesWithoutUid:c},clean:Le,...i.size>0?{excludedPredicates:[...i]}:{}}}a(Lde,"scanVaultForOntologyImports");function Nde(n){let e=n.ontologies.map(E=>E.uid),t=new Map;for(let E of n.ontologies)t.set(E.uid,{uid:E.uid,label:E.label,path:E.path});let r=a(E=>t.get(E)??{uid:E,label:E,path:""},"refOf"),i=new Map;for(let E of n.ontologies)E.declaredImports.length>0&&i.set(E.uid,new Set(E.declaredImports));let s=new Map,o=new Map;for(let E of n.derivedEdges){let P=s.get(E.source);P||(P=new Set,s.set(E.source,P)),P.add(E.target),o.set(`${E.source} ${E.target}`,E.occurrences)}let{components:l,componentOf:c}=cU(e,s),u=[],f=new Map,d=0;for(let E of n.derivedEdges){let P=c.get(E.source),V=c.get(E.target);if(P!==void 0&&V!==void 0&&P===V){let j=f.get(P);j||(j=[],f.set(P,j)),j.push({source:E.source,target:E.target,weight:E.occurrences})}else u.push({source:E.source,target:E.target,occurrences:E.occurrences}),E.valid&&d++}let p=a((E,P,V)=>{if(E===P)return!0;let M=[...V.get(E)??[]],j=new Set;for(;M.length>0;){let $=M.shift();if($===P)return!0;if(!j.has($)){j.add($);for(let G of V.get($)??[])M.push(G)}}return!1},"reaches"),h=new Map;for(let[E,P]of i)h.set(E,new Set(P));let _=[],y=[...u].sort((E,P)=>E.source===P.source?E.target.localeCompare(P.target):E.source.localeCompare(P.source));for(let E of y)if(p(E.target,E.source,h))_.push({source:r(E.source),target:r(E.target),occurrences:E.occurrences});else{let P=h.get(E.source);P||(P=new Set,h.set(E.source,P)),P.add(E.target)}let b=uU(e,h),S=[];for(let[E,P]of b)for(let V of P)i.get(E)?.has(V)||S.push({source:r(E),target:r(V),occurrences:o.get(`${E} ${V}`)??0});S.sort((E,P)=>P.occurrences-E.occurrences||E.source.uid.localeCompare(P.source.uid)||E.target.uid.localeCompare(P.target.uid));let I=[];for(let[E,P]of f){let V=l[E],j=fU(V,P).map($=>({source:r($.source),target:r($.target),occurrences:$.weight})).sort(($,G)=>$.occurrences-G.occurrences||$.source.uid.localeCompare(G.source.uid)||$.target.uid.localeCompare(G.target.uid));I.push({ontologies:V.map(r).sort(($,G)=>$.label.localeCompare(G.label)),edgeCount:P.length,occurrenceCount:P.reduce(($,G)=>$+G.weight,0),suggestedCuts:j})}I.sort((E,P)=>P.ontologies.length-E.ontologies.length||P.occurrenceCount-E.occurrenceCount);let O=eS(e,i),T=[];for(let[E,P]of i)for(let V of P){let M=!1;for(let j of P)if(j!==V&&O.get(j)?.has(V)){M=!0;break}M&&T.push({source:r(E),target:r(V),occurrences:o.get(`${E} ${V}`)??0})}return{additions:S,acyclicEdgeCount:u.length,alreadyCovered:d,conflicts:_,intraScc:I,redundantDeclared:T}}a(Nde,"computeImportProposal");function Is(n){return`${n.uid}|${n.label}|${n.path}`}a(Is,"formatRef");function kde(n){let e=n.ontologies.filter(i=>i.declaredImports.length>0||i.unresolvedImports.length>0).length,t=n.clean?console.log:console.error;if(t(`${n.clean?"OK":"FAIL"} ${n.vaultPath}: ontology-imports audit \u2014 ${n.linkCounts.crossOntologyViolation} violating occurrence(s) in ${n.violations.length} pair(s)`),t(`Ontologies: ${n.ontologies.length} (${e} with imports declared), declared graph: ${n.declared.edgeCount} edge(s), `+(n.declared.acyclic?"acyclic":`NOT ACYCLIC \u2014 ${n.declared.sccs.length} SCC(s)`)),n.excludedPredicates&&n.excludedPredicates.length>0&&t(`Structural-only mode (VL#30): excluded ${n.excludedPredicates.length} associative predicate(s) from edge extraction \u2014 ${n.excludedPredicates.join(", ")}`),n.duplicateOntologyUids.length>0){console.error(`
576
+ `)}a(Tde,"stripFencedCodeBlocks");function pU(n){let e=[],t;for(dU.lastIndex=0;(t=dU.exec(n))!==null;){let r=t[1],i=r.indexOf("|");i!==-1&&(r=r.slice(0,i));let s=r.indexOf("#");s!==-1&&(r=r.slice(0,s));let o=r.trim();o.length>0&&e.push(o)}return e}a(pU,"extractWikilinkTargets");function HR(n){return typeof n=="string"?[n]:Array.isArray(n)?n.flatMap(HR):n!==null&&typeof n=="object"?Object.values(n).flatMap(HR):[]}a(HR,"collectFrontmatterStrings");function Ade(n){let e=n.match(/^---\n[\s\S]*?\n---/);return e?n.slice(e[0].length):n}a(Ade,"bodyOf");function hU(n,e,t){let r=[];for(let[s,o]of Object.entries(n))if(!t?.has(s))for(let l of HR(o))for(let c of pU(l))r.push(c);let i=pU(Tde(Ade(e)));return[...r,...i]}a(hU,"extractFileWikilinkTargets");var Ide=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function mU(n,e){if(e.includes("/")){let r=e.replace(/^\//,""),i=r.endsWith(".md")?r:`${r}.md`;if(await n.hasIndexedPath(i))return i;e=r.slice(r.lastIndexOf("/")+1)}if(e.endsWith(".md")&&(e=e.slice(0,-3)),Ide.test(e)){let r=await n.findFileByUID(e);if(r)return r}let t=await n.findPathsByBasename(e);return t.length===1?t[0]:t.length>1?new Set(t).size===1?t[0]:"ambiguous":null}a(mU,"resolveTargetPath");xt();jt();var xde="\0",Rde="829b9b3b-6fc3-4276-be6a-27d3398c012e",Cde=["exo__Asset_relates","concept__Concept_related","concept__Concept_broader","concept__Concept_synonym","exo__Asset_createdBy"],Ode=5,Pde=10,Dde=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 Fde(n){let e=n.lastIndexOf(".");if(e===-1||e===n.length-1)return!1;let t=n.slice(e+1).toLowerCase();return Dde.has(t)}a(Fde,"nonMarkdownExtension");function zR(n){if(Array.isArray(n)){let e=n.filter(t=>typeof t=="string");return{value:e[0]??null,multiple:e.length>1}}return{value:typeof n=="string"?n:null,multiple:!1}}a(zR,"firstString");function gU(n){let e=Array.isArray(n)?n:n==null?[]:[n],t=[];for(let r of e){let i=(0,KR.extractAssetReference)(r);i&&t.push(i)}return t}a(gU,"asRefList");function qh(n,e,t=Ode){n.length<t&&n.push(e)}a(qh,"pushExample");async function Lde(n,e={}){let t=new ci(n,{cacheContent:!0}),r=await t.indexedAssets(),i=new Set(e.excludePredicates??[]),s=new Map,o=new Map,l=new Map,c=[];for(let B of r){if(ao(B.path)||Ui(B.path)||!gU(B.metadata.exo__Instance_class).includes(Rde))continue;let{value:Ee}=zR(B.metadata.exo__Asset_uid);if(!Ee){c.push(B.path);continue}let{value:Ce}=zR(B.metadata.exo__Asset_label),xe=Ce??B.path,Oe=l.get(Ee);Oe?Oe.push(B.path):l.set(Ee,[B.path]),s.set(B.path,Ee),o.has(Ee)||o.set(Ee,{uid:Ee,label:xe,path:B.path,metadata:B.metadata})}let u=[...l.entries()].filter(([,B])=>B.length>1).map(([B,oe])=>({uid:B,paths:oe})),f=new Map,d={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0,"not-an-ontology":0},p=[],h=0,_=0,y=new Map,b=0,S=a((B,oe)=>{f.set(B,null),d[oe]++,h++,qh(p,`${B} (${oe})`,Pde)},"markNoOntology");for(let B of r){if(ao(B.path)||Ui(B.path))continue;b++;let oe=B.metadata.exo__Asset_isDefinedBy,{value:Ee,multiple:Ce}=zR(oe);Ce&&_++;let xe=(0,KR.extractAssetReference)(Ee);if(!xe){S(B.path,"empty-isDefinedBy");continue}if(xe.startsWith("!")){S(B.path,"bang-prefix");continue}let Oe=await ul(t,xe,B.path);if(!Oe){S(B.path,"unresolvable");continue}let Re=s.get(Oe);if(!Re){S(B.path,"not-an-ontology");continue}f.set(B.path,Re),y.set(Re,(y.get(Re)??0)+1)}let I=[...o.keys()],O=new Map,T=[],E=new Map,P=new Map,V=0;for(let B of I){let oe=o.get(B),Ee=gU(oe.metadata.exo__Ontology_imports),Ce=[],xe=[],Oe=!1;for(let Re of Ee){let Ae=null;if(o.has(Re))Ae=Re;else{let ee=await ul(t,Re,oe.path);Ae=ee?s.get(ee)??null:null}if(Ae===null)xe.push(Re);else if(Ae===B)Oe=!0;else{Ce.push(Ae);let ee=O.get(B);ee||(ee=new Set,O.set(B,ee)),ee.has(Ae)||(ee.add(Ae),V++)}}E.set(B,Ce),P.set(B,xe),Oe&&T.push(B)}let M=lU(I,O),j=eS(I,O),$={total:0,internal:0,crossOntologyValid:0,crossOntologyViolation:0,crossVault:0,noOntology:0},G={broken:0,"dup-basename":0,"non-markdown":0},ge={broken:[],"dup-basename":[],"non-markdown":[]},ye=new Map,Q=new Map,se=new Map,J=new Map,ve=new Map,re=new Map,ie=a(B=>{let oe=o.get(B);return oe?{uid:oe.uid,label:oe.label,path:oe.path}:{uid:B,label:B,path:""}},"toRef");for(let B of r){if(ao(B.path)||Ui(B.path))continue;let oe=f.get(B.path)??null,Ee=hU(B.metadata,B.content??"",i);for(let Ce of Ee){if($.total++,Fde(Ce)){G["non-markdown"]++,qh(ge["non-markdown"],`${B.path} \u2192 ${Ce}`);continue}let xe=await mU(t,Ce);if(xe==="ambiguous"){G["dup-basename"]++,qh(ge["dup-basename"],`${B.path} \u2192 ${Ce}`);continue}if(xe===null){G.broken++,qh(ge.broken,`${B.path} \u2192 ${Ce}`);continue}let Oe=f.get(xe)??s.get(xe)??null;if(oe===null||Oe===null){$.noOntology++;continue}if(oe===Oe){$.internal++,se.set(oe,(se.get(oe)??0)+1);continue}let Re=j.get(oe)?.has(Oe)??!1,Ae=`${oe}${xde}${Oe}`,ee=ye.get(Ae);if(ee?ee.occurrences++:ye.set(Ae,{source:oe,target:Oe,occurrences:1,valid:Re}),J.set(oe,(J.get(oe)??0)+1),ve.set(Oe,(ve.get(Oe)??0)+1),Re)$.crossOntologyValid++;else{$.crossOntologyViolation++,re.set(oe,(re.get(oe)??0)+1);let _e=Q.get(Ae);_e?(_e.occurrences++,qh(_e.examples,B.path)):Q.set(Ae,{source:oe,target:Oe,occurrences:1,examples:[B.path]})}}}let he=[...ye.values()].sort((B,oe)=>oe.occurrences-B.occurrences),Ue=new Map,ce=new Map;for(let B of he)ce.set(B.source,(ce.get(B.source)??0)+1),Ue.set(B.target,(Ue.get(B.target)??0)+1);let ue=I.map(B=>({...ie(B),declaredImports:E.get(B)??[],unresolvedImports:P.get(B)??[],selfImport:T.includes(B),assetCount:y.get(B)??0,inDegree:Ue.get(B)??0,outDegree:ce.get(B)??0,internalLinks:se.get(B)??0,externalLinksOut:J.get(B)??0,externalLinksIn:ve.get(B)??0,violatingOut:re.get(B)??0})).sort((B,oe)=>B.label.localeCompare(oe.label)),fe=[...Q.values()].map(B=>({source:ie(B.source),target:ie(B.target),occurrences:B.occurrences,examples:B.examples})).sort((B,oe)=>oe.occurrences-B.occurrences),ne=[],me=M.length===0,Le=fe.length===0&&$.crossVault===0&&me&&u.length===0;return{vaultPath:n,totalFiles:r.length,scannedFiles:b,ontologies:ue,duplicateOntologyUids:u,declared:{edgeCount:V,sccs:M,acyclic:me},derivedEdges:he,violations:fe,crossVault:ne,linkCounts:$,skips:G,skipExamples:ge,noOntologyAssets:{count:h,byReason:d,examples:p},warnings:{selfImports:T,multipleIsDefinedBy:_,ontologiesWithoutUid:c},clean:Le,...i.size>0?{excludedPredicates:[...i]}:{}}}a(Lde,"scanVaultForOntologyImports");function Nde(n){let e=n.ontologies.map(E=>E.uid),t=new Map;for(let E of n.ontologies)t.set(E.uid,{uid:E.uid,label:E.label,path:E.path});let r=a(E=>t.get(E)??{uid:E,label:E,path:""},"refOf"),i=new Map;for(let E of n.ontologies)E.declaredImports.length>0&&i.set(E.uid,new Set(E.declaredImports));let s=new Map,o=new Map;for(let E of n.derivedEdges){let P=s.get(E.source);P||(P=new Set,s.set(E.source,P)),P.add(E.target),o.set(`${E.source} ${E.target}`,E.occurrences)}let{components:l,componentOf:c}=cU(e,s),u=[],f=new Map,d=0;for(let E of n.derivedEdges){let P=c.get(E.source),V=c.get(E.target);if(P!==void 0&&V!==void 0&&P===V){let j=f.get(P);j||(j=[],f.set(P,j)),j.push({source:E.source,target:E.target,weight:E.occurrences})}else u.push({source:E.source,target:E.target,occurrences:E.occurrences}),E.valid&&d++}let p=a((E,P,V)=>{if(E===P)return!0;let M=[...V.get(E)??[]],j=new Set;for(;M.length>0;){let $=M.shift();if($===P)return!0;if(!j.has($)){j.add($);for(let G of V.get($)??[])M.push(G)}}return!1},"reaches"),h=new Map;for(let[E,P]of i)h.set(E,new Set(P));let _=[],y=[...u].sort((E,P)=>E.source===P.source?E.target.localeCompare(P.target):E.source.localeCompare(P.source));for(let E of y)if(p(E.target,E.source,h))_.push({source:r(E.source),target:r(E.target),occurrences:E.occurrences});else{let P=h.get(E.source);P||(P=new Set,h.set(E.source,P)),P.add(E.target)}let b=uU(e,h),S=[];for(let[E,P]of b)for(let V of P)i.get(E)?.has(V)||S.push({source:r(E),target:r(V),occurrences:o.get(`${E} ${V}`)??0});S.sort((E,P)=>P.occurrences-E.occurrences||E.source.uid.localeCompare(P.source.uid)||E.target.uid.localeCompare(P.target.uid));let I=[];for(let[E,P]of f){let V=l[E],j=fU(V,P).map($=>({source:r($.source),target:r($.target),occurrences:$.weight})).sort(($,G)=>$.occurrences-G.occurrences||$.source.uid.localeCompare(G.source.uid)||$.target.uid.localeCompare(G.target.uid));I.push({ontologies:V.map(r).sort(($,G)=>$.label.localeCompare(G.label)),edgeCount:P.length,occurrenceCount:P.reduce(($,G)=>$+G.weight,0),suggestedCuts:j})}I.sort((E,P)=>P.ontologies.length-E.ontologies.length||P.occurrenceCount-E.occurrenceCount);let O=eS(e,i),T=[];for(let[E,P]of i)for(let V of P){let M=!1;for(let j of P)if(j!==V&&O.get(j)?.has(V)){M=!0;break}M&&T.push({source:r(E),target:r(V),occurrences:o.get(`${E} ${V}`)??0})}return{additions:S,acyclicEdgeCount:u.length,alreadyCovered:d,conflicts:_,intraScc:I,redundantDeclared:T}}a(Nde,"computeImportProposal");function Is(n){return`${n.uid}|${n.label}|${n.path}`}a(Is,"formatRef");function kde(n){let e=n.ontologies.filter(i=>i.declaredImports.length>0||i.unresolvedImports.length>0).length,t=n.clean?console.log:console.error;if(t(`${n.clean?"OK":"FAIL"} ${n.vaultPath}: ontology-imports audit \u2014 ${n.linkCounts.crossOntologyViolation} violating occurrence(s) in ${n.violations.length} pair(s)`),t(`Ontologies: ${n.ontologies.length} (${e} with imports declared), declared graph: ${n.declared.edgeCount} edge(s), `+(n.declared.acyclic?"acyclic":`NOT ACYCLIC \u2014 ${n.declared.sccs.length} SCC(s)`)),n.excludedPredicates&&n.excludedPredicates.length>0&&t(`Structural-only mode (VL#30): excluded ${n.excludedPredicates.length} associative predicate(s) from edge extraction \u2014 ${n.excludedPredicates.join(", ")}`),n.duplicateOntologyUids.length>0){console.error(`
577
577
  HARD ERRORS \u2014 duplicate ontology UIDs (R7):`);for(let i of n.duplicateOntologyUids)console.error(` ${i.uid}: ${i.paths.join(", ")}`)}if(!n.declared.acyclic){console.error(`
578
578
  Declared-graph cycles (must be a DAG):`);for(let i of n.declared.sccs)console.error(` SCC[${i.length}]: ${i.map(s=>Is(Mde(n,s))).join(" \u21C4 ")}`)}if(n.violations.length>0){console.error(`
579
579
  Violating pairs (src \u2192 tgt, occurrences desc):`);for(let i of n.violations)console.error(` ${Is(i.source)} \u2192 ${Is(i.target)}: ${i.occurrences}`)}let r=n.ontologies.reduce((i,s)=>i+s.unresolvedImports.length,0);t(`
@@ -636,7 +636,7 @@ Next steps:
636
636
  `).map(r=>r.trim()).filter(r=>r.length>0),t=e[e.length-1];if(t!==void 0)try{return JSON.parse(t)}catch{return}}a(Gpe,"parseLastJsonLine");function sB(n,e){return e.filter(t=>{let r=n[t];return typeof r!="string"||r.trim().length===0})}a(sB,"missingStringFields");var yS=class{constructor(e){this.deps=e}static{a(this,"McpServer")}async handle(e){if(typeof e!="object"||e===null||Array.isArray(e))return{jsonrpc:"2.0",id:null,error:{code:iB,message:"Invalid request: expected a JSON-RPC object"}};let t=e.id,r=t===void 0;if(typeof e.method!="string")return r?null:{jsonrpc:"2.0",id:t??null,error:{code:iB,message:"Invalid request: missing method"}};if(r)return null;let i=t??null;switch(e.method){case"initialize":return{jsonrpc:"2.0",id:i,result:{protocolVersion:Vpe,capabilities:{tools:{}},serverInfo:{name:"exocortex",version:this.deps.version}}};case"ping":return{jsonrpc:"2.0",id:i,result:{}};case"tools/list":return{jsonrpc:"2.0",id:i,result:{tools:nB}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:qpe,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,r=e.arguments??{},i;if(t==="create_asset"){let l=sB(r,["vault","class","label"]);if(l.length>0)return ed(`create_asset: missing required argument(s): ${l.join(", ")}`,!0);let c=eB(r);if(c!==null)return ed(`create_asset: ${c}`,!0);i=tB(r)}else if(t==="create_effort"){let l=sB(r,["vault","command","target"]);if(l.length>0)return ed(`create_effort: missing required argument(s): ${l.join(", ")}`,!0);i=rB(r)}else return ed(`Unknown tool: ${String(t)}`,!0);let s=await this.deps.runCli(i);if(s.exitCode!==0){let l=s.stderr.trim()||s.stdout.trim()||"(no diagnostic output)";return ed(`exocortex-cli exited ${s.exitCode}
637
637
  ${l}`,!0)}let o=Gpe(s.stdout);return ed(o===void 0?s.stdout.trim():JSON.stringify(o))}};var lB=require("child_process");var Wpe=32*1024*1024;function cB(n){return e=>new Promise(t=>{(0,lB.execFile)(process.execPath,[n,...e],{maxBuffer:Wpe},(r,i,s)=>{let o=0;if(r){let l=r.code;o=typeof l=="number"?l:1}t({stdout:i,stderr:s,exitCode:o})})})}a(cB,"createSelfCliRunner");async function Hpe(n,e,t){let r=(0,uB.createInterface)({input:e,crlfDelay:1/0});for await(let i of r){let s=i.trim();if(s.length===0)continue;let o;try{o=JSON.parse(s)}catch{t(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:oB,message:"Parse error: invalid JSON"}})+`
638
638
  `);continue}let l;try{l=await n.handle(o)}catch(c){l={jsonrpc:"2.0",id:typeof o?.id=="string"||typeof o?.id=="number"?o.id:null,error:{code:aB,message:`Internal error: ${c instanceof Error?c.message:String(c)}`}}}l!==null&&t(JSON.stringify(l)+`
639
- `)}}a(Hpe,"runStdioServer");function fB(n){return new Ie("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],r=new yS({runCli:cB(t),version:n??"unknown"});await Hpe(r,process.stdin,i=>process.stdout.write(i))})}a(fB,"mcpCommand");function _S(n){let e=new Ie;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(n??"16.224.4"),e.addCommand(K6()),e.addCommand(nU()),e.addCommand(G5()),e.addCommand(K5()),e.addCommand(g6()),e.addCommand(Y5()),e.addCommand(t6()),e.addCommand(r6()),e.addCommand(v6()),e.addCommand(R6()),e.addCommand(U6()),e.addCommand(B6()),e.addCommand(V6()),e.addCommand(G6()),e.addCommand(W6()),e.addCommand(vU()),e.addCommand(IU()),e.addCommand(BU()),e.addCommand(qU()),e.addCommand(HU()),e.addCommand(zU()),e.addCommand(XU()),e.addCommand(DU()),e.addCommand(jU()),e.addCommand(JU()),e.addCommand(fB(n??"16.224.4")),e}a(_S,"createProgram");_S().parse();0&&(module.exports={createProgram});
639
+ `)}}a(Hpe,"runStdioServer");function fB(n){return new Ie("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],r=new yS({runCli:cB(t),version:n??"unknown"});await Hpe(r,process.stdin,i=>process.stdout.write(i))})}a(fB,"mcpCommand");function _S(n){let e=new Ie;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(n??"16.224.5"),e.addCommand(K6()),e.addCommand(nU()),e.addCommand(G5()),e.addCommand(K5()),e.addCommand(g6()),e.addCommand(Y5()),e.addCommand(t6()),e.addCommand(r6()),e.addCommand(v6()),e.addCommand(R6()),e.addCommand(U6()),e.addCommand(B6()),e.addCommand(V6()),e.addCommand(G6()),e.addCommand(W6()),e.addCommand(vU()),e.addCommand(IU()),e.addCommand(BU()),e.addCommand(qU()),e.addCommand(HU()),e.addCommand(zU()),e.addCommand(XU()),e.addCommand(DU()),e.addCommand(jU()),e.addCommand(JU()),e.addCommand(fB(n??"16.224.5")),e}a(_S,"createProgram");_S().parse();0&&(module.exports={createProgram});
640
640
  /*! Bundled license information:
641
641
 
642
642
  reflect-metadata/Reflect.js: