vault backup: 2026-08-11 02:48:06
This commit is contained in:
1 parent
6b5ab22e81
commit
d0b5a363a3
11 files changed
+1421
-6
No files matched your search
Vendored
+1
@@ -0,0 +1 @@
|
||||
{}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
[
|
||||
"obsidian-git"
|
||||
]
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"file-explorer": true,
|
||||
"global-search": true,
|
||||
"switcher": true,
|
||||
"graph": true,
|
||||
"backlink": true,
|
||||
"canvas": true,
|
||||
"outgoing-link": true,
|
||||
"tag-pane": true,
|
||||
"footnotes": false,
|
||||
"properties": true,
|
||||
"page-preview": true,
|
||||
"daily-notes": true,
|
||||
"templates": true,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": false,
|
||||
"editor-status": true,
|
||||
"bookmarks": true,
|
||||
"markdown-importer": false,
|
||||
"zk-prefixer": false,
|
||||
"random-note": false,
|
||||
"outline": true,
|
||||
"word-count": true,
|
||||
"slides": false,
|
||||
"audio-recorder": false,
|
||||
"workspaces": false,
|
||||
"file-recovery": true,
|
||||
"publish": false,
|
||||
"sync": true,
|
||||
"bases": true,
|
||||
"webviewer": false
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"commitMessage": "vault backup: {{date}}",
|
||||
"autoCommitMessage": "vault backup: {{date}}",
|
||||
"commitMessageScript": "",
|
||||
"commitDateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"autoSaveInterval": 2,
|
||||
"autoPushInterval": 1,
|
||||
"autoPullInterval": 1,
|
||||
"autoPullOnBoot": false,
|
||||
"autoCommitOnlyStaged": false,
|
||||
"disablePush": false,
|
||||
"pullBeforePush": true,
|
||||
"disablePopups": false,
|
||||
"showErrorNotices": true,
|
||||
"disablePopupsForNoChanges": false,
|
||||
"listChangedFilesInMessageBody": false,
|
||||
"showStatusBar": true,
|
||||
"updateSubmodules": false,
|
||||
"syncMethod": "merge",
|
||||
"mergeStrategy": "none",
|
||||
"customMessageOnAutoBackup": false,
|
||||
"autoBackupAfterFileChange": true,
|
||||
"treeStructure": false,
|
||||
"refreshSourceControl": true,
|
||||
"basePath": "",
|
||||
"differentIntervalCommitAndPush": true,
|
||||
"changedFilesInStatusBar": false,
|
||||
"showedMobileNotice": true,
|
||||
"refreshSourceControlTimer": 7000,
|
||||
"showBranchStatusBar": true,
|
||||
"setLastSaveToLastCommit": false,
|
||||
"submoduleRecurseCheckout": false,
|
||||
"gitDir": "",
|
||||
"showFileMenu": true,
|
||||
"authorInHistoryView": "hide",
|
||||
"dateInHistoryView": false,
|
||||
"diffStyle": "split",
|
||||
"hunks": {
|
||||
"showSigns": false,
|
||||
"hunkCommands": false,
|
||||
"statusBar": "disabled"
|
||||
},
|
||||
"lineAuthor": {
|
||||
"show": false,
|
||||
"followMovement": "inactive",
|
||||
"authorDisplay": "initials",
|
||||
"showCommitHash": false,
|
||||
"dateTimeFormatOptions": "date",
|
||||
"dateTimeFormatCustomString": "YYYY-MM-DD HH:mm",
|
||||
"dateTimeTimezone": "viewer-local",
|
||||
"coloringMaxAge": "1y",
|
||||
"colorNew": {
|
||||
"r": 255,
|
||||
"g": 150,
|
||||
"b": 150
|
||||
},
|
||||
"colorOld": {
|
||||
"r": 120,
|
||||
"g": 160,
|
||||
"b": 255
|
||||
},
|
||||
"textColorCss": "var(--text-muted)",
|
||||
"ignoreWhitespace": false,
|
||||
"lastShownAuthorDisplay": "initials",
|
||||
"lastShownDateTimeFormatOptions": "date"
|
||||
}
|
||||
}
|
||||
+415
@@ -0,0 +1,415 @@
|
||||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source visit the plugins github repository (https://github.com/denolehov/obsidian-git)
|
||||
*/
|
||||
|
||||
var TF=Object.create;var vc=Object.defineProperty;var PF=Object.getOwnPropertyDescriptor;var RF=Object.getOwnPropertyNames;var $F=Object.getPrototypeOf,FF=Object.prototype.hasOwnProperty;var yb=t=>{throw TypeError(t)};var IF=(t,e,r)=>e in t?vc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var MF=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var U=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},DF=(t,e)=>{for(var r in e)vc(t,r,{get:e[r],enumerable:!0})},xb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of RF(e))!FF.call(t,n)&&n!==r&&vc(t,n,{get:()=>e[n],enumerable:!(i=PF(e,n))||i.enumerable});return t};var Gt=(t,e,r)=>(r=t!=null?TF($F(t)):{},xb(e||!t||!t.__esModule?vc(r,"default",{value:t,enumerable:!0}):r,t)),OF=t=>xb(vc({},"__esModule",{value:!0}),t);var He=(t,e,r)=>IF(t,typeof e!="symbol"?e+"":e,r),Yp=(t,e,r)=>e.has(t)||yb("Cannot "+r);var F=(t,e,r)=>(Yp(t,e,"read from private field"),r?r.call(t):e.get(t)),ge=(t,e,r)=>e.has(t)?yb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),pe=(t,e,r,i)=>(Yp(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),Ae=(t,e,r)=>(Yp(t,e,"access private method"),r);var kb=U(Cf=>{"use strict";m();Cf.byteLength=NF;Cf.toByteArray=HF;Cf.fromByteArray=jF;var on=[],pi=[],LF=typeof Uint8Array!="undefined"?Uint8Array:Array,Zp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ia=0,Eb=Zp.length;ia<Eb;++ia)on[ia]=Zp[ia],pi[Zp.charCodeAt(ia)]=ia;var ia,Eb;pi[45]=62;pi[95]=63;function Sb(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function NF(t){var e=Sb(t),r=e[0],i=e[1];return(r+i)*3/4-i}function BF(t,e,r){return(e+r)*3/4-r}function HF(t){var e,r=Sb(t),i=r[0],n=r[1],s=new LF(BF(t,i,n)),a=0,o=n>0?i-4:i,l;for(l=0;l<o;l+=4)e=pi[t.charCodeAt(l)]<<18|pi[t.charCodeAt(l+1)]<<12|pi[t.charCodeAt(l+2)]<<6|pi[t.charCodeAt(l+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=pi[t.charCodeAt(l)]<<2|pi[t.charCodeAt(l+1)]>>4,s[a++]=e&255),n===1&&(e=pi[t.charCodeAt(l)]<<10|pi[t.charCodeAt(l+1)]<<4|pi[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}function UF(t){return on[t>>18&63]+on[t>>12&63]+on[t>>6&63]+on[t&63]}function GF(t,e,r){for(var i,n=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(UF(i));return n.join("")}function jF(t){for(var e,r=t.length,i=r%3,n=[],s=16383,a=0,o=r-i;a<o;a+=s)n.push(GF(t,a,a+s>o?o:a+s));return i===1?(e=t[r-1],n.push(on[e>>2]+on[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(on[e>>10]+on[e>>4&63]+on[e<<2&63]+"=")),n.join("")}});var Ab=U(Kp=>{m();Kp.read=function(t,e,r,i,n){var s,a,o=n*8-i-1,l=(1<<o)-1,c=l>>1,u=-7,f=r?n-1:0,d=r?-1:1,h=t[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=s*256+t[e+f],f+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=i;u>0;a=a*256+t[e+f],f+=d,u-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-c}return(h?-1:1)*a*Math.pow(2,s-i)};Kp.write=function(t,e,r,i,n,s){var a,o,l,c=s*8-n-1,u=(1<<c)-1,f=u>>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,p=i?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=u?(o=0,a=u):a+f>=1?(o=(e*l-1)*Math.pow(2,n),a=a+f):(o=e*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;t[r+h]=o&255,h+=p,o/=256,n-=8);for(a=a<<n|o,c+=n;c>0;t[r+h]=a&255,h+=p,a/=256,c-=8);t[r+h-p]|=g*128}});var sm=U(So=>{"use strict";m();var Xp=kb(),xo=Ab(),Cb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;So.Buffer=O;So.SlowBuffer=ZF;So.INSPECT_MAX_BYTES=50;var Tf=2147483647;So.kMaxLength=Tf;O.TYPED_ARRAY_SUPPORT=VF();!O.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function VF(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}});Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function Bn(t){if(t>Tf)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,O.prototype),e}function O(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return tm(t)}return $b(t,e,r)}O.poolSize=8192;function $b(t,e,r){if(typeof t=="string"Line truncated
|
||||
|
||||
If you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment.
|
||||
|
||||
Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=t.code,this.data={message:e}}};me.code="InternalError";var zo=class t extends Pe{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=t.code,this.data={filepath:e}}};zo.code="UnsafeFilepathError";var wi=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};function Sd(t,e){return-(t<e)||+(t>e)}function HE(t,e){return Sd(t.path,e.path)}function UE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}var gn=2**32;function gE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),s=(r-n*1e3)*1e6;return[n,s]}function Wo(t){let[e,r]=gE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=gE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%gn,ctimeNanoseconds:r%gn,mtimeSeconds:i%gn,mtimeNanoseconds:n%gn,dev:t.dev%gn,ino:t.ino%gn,mode:UE(t.mode%gn),uid:t.uid%gn,gid:t.gid%gn,size:t.size>-1?t.size%gn:0}}function CL(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}var vg=null;async function wn(t){return vg===null&&(vg=await PL()),vg?GE(t):TL(t)}function TL(t){return new BE().update(t).digest("hex")}async function GE(t){let e=await crypto.subtle.digest("SHA-1",t);return CL(e)}async function PL(){try{return await GE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(t){}return!1}function RL(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}function $L(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(E.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}var Pg=class t{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(E.isBuffer(e))return t.fromBuffer(e);if(e===null)return new t(null);throw new me("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new me("Index file is empty (.git/index)");let r=new t,i=new wi(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new me(`Invalid dircache magic file number: ${n}`);let s=await wn(e.slice(0,-20)),a=e.slice(-20).toString("hex");if(a!==s)throw new me(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${s}`);let o=i.readUInt32BE();if(o!==2)throw new me(`Unsupported dircache version: ${o}`);let l=i.readUInt32BE(),c=0;for(;!i.eof()&&c<l;){let u={};u.ctimeSeconds=i.readUInt32BE(),u.ctimeNanoseconds=i.readUInt32BE(),u.mtimeSeconds=i.readUInt32BE(),u.mtimeNanoseconds=i.readUInt32BE(),u.dev=i.readUInt32BE(),u.ino=i.readUInt32BE(),u.mode=i.readUInt32BE(),u.uid=i.readUInt32BE(),u.gid=i.readUInt32BE(),u.size=i.readUInt32BE(),u.oid=i.slice(20).toString("hex");let f=i.readUInt16BE();u.flags=RL(f);let d=e.indexOf(0,i.tell()+1)-i.tell();if(d<1)throw new me(`Got a path length of: ${d}`);if(u.path=i.toString("utf8",d),u.path.includes("..\\")||u.path.includes("../"))throw new zo(u.path);let h=8-(i.tell()-12)%8;for(h===0&&(h=8);h--;){let p=i.readUInt8();if(p!==0)throw new me(`Expected 1-8 null characters but got '${p}' after ${u.path}`);if(i.eof())throw new me("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(HE)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,s
Line truncated
|
||||
`)}static async _entryToBuffer(e){let r=E.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=E.alloc(i),s=new wi(n),a=Wo(e);return s.writeUInt32BE(a.ctimeSeconds),s.writeUInt32BE(a.ctimeNanoseconds),s.writeUInt32BE(a.mtimeSeconds),s.writeUInt32BE(a.mtimeNanoseconds),s.writeUInt32BE(a.dev),s.writeUInt32BE(a.ino),s.writeUInt32BE(a.mode),s.writeUInt32BE(a.uid),s.writeUInt32BE(a.gid),s.writeUInt32BE(a.size),s.write(e.oid,20,"hex"),s.writeUInt16BE($L(e)),s.write(e.path,r.length,"utf8"),n}async toObject(){let e=E.alloc(12),r=new wi(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let i=[];for(let o of this.entries)if(i.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&i.push(t._entryToBuffer(l));i=await Promise.all(i);let n=E.concat(i),s=E.concat([e,n]),a=await wn(s);return E.concat([s,E.from(a,"hex")])}};function pd(t,e,r=!0,i=!0){let n=Wo(t),s=Wo(e);return r&&n.mode!==s.mode||n.mtimeSeconds!==s.mtimeSeconds||n.ctimeSeconds!==s.ctimeSeconds||n.uid!==s.uid||n.gid!==s.gid||i&&n.ino!==s.ino||n.size!==s.size}var wg=null,bg=Symbol("IndexCache");function FL(){return{map:new Map,stats:new Map}}async function IL(t,e,r){let[i,n]=await Promise.all([t.lstat(e),t.read(e)]),s=await Pg.from(n);r.map.set(e,s),r.stats.set(e,i)}async function ML(t,e,r){let i=r.stats.get(e);if(i===void 0)return!0;if(i===null)return!1;let n=await t.lstat(e);return n===null?!1:pd(i,n)}var dt=class{static async acquire({fs:e,gitdir:r,cache:i,allowUnmerged:n=!0},s){i[bg]||(i[bg]=FL());let a=`${r}/index`;wg===null&&(wg=new Uc({maxPending:1/0}));let o,l=[];return await wg.acquire(a,async()=>{let c=i[bg];await ML(e,a,c)&&await IL(e,a,c);let u=c.map.get(a);if(l=u.unmergedPaths,l.length&&!n)throw new jc(l);if(o=await s(u),u._dirty){let f=await u.toObject();await e.write(a,f),c.stats.set(a,await e.lstat(a)),u._dirty=!1}}),o}};function md(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function va(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function jE(t){let e=new Map,r=function(n){if(!e.has(n)){let s={type:"tree",fullpath:n,basename:md(n),metadata:{},children:[]};e.set(n,s),s.parent=r(va(n)),s.parent&&s.parent!==s&&s.parent.children.push(s)}return e.get(n)},i=function(n,s){if(!e.has(n)){let a={type:"blob",fullpath:n,basename:md(n),metadata:s,parent:r(va(n)),children:[]};a.parent&&a.parent.children.push(a),e.set(n,a)}return e.get(n)};r(".");for(let n of t)i(n.path,n);return e}function DL(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new me(`Unexpected GitTree entry mode: ${t.toString(8)}`)}var Rg=class{constructor({fs:e,gitdir:r,cache:i}){this.treePromise=dt.acquire({fs:e,gitdir:r,cache:i},async function(s){return jE(s.entries)});let n=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}}}async readdir(e){let r=e._fullpath,n=(await this.treePromise).get(r);if(!n||n.type==="blob")return null;if(n.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let s=n.children.map(a=>a.fullpath);return s.sort(Sd),s}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let i=(await this.treePromise).get(e._fullpath);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=i.type==="tree"?{}:Wo(i.metadata);e._type=i.type==="tree"?"tree":DL(n.mode),e._mode=n.mode,i.type==="tree"?e._stat=void 0:e._stat=n}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let i=(await this.treePromise).get(e._fullpath);e._oid=i.metadata.oid}return e._oid}},kd=Symbol("GitWalkSymbol");function Ea(){let t=Object.create(null);return Object.defineProperty(t,kd,{value:function({fs:e,gitdir:r,cache:i}){return new Rg({fs:e,gitdir:r,cache:i})}}),Object.freeze(t),t}var Ge=class t extends Pe{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};Ge.code="NotFoundError";var _r=class t extends Pe{constructor(e,r,i,n){super(`Object ${e} ${n?`at ${n}`:""}was anticipated to be a ${i} but it is a ${r}.`),this.code=this.name=t.code,this.data={oid:e,actual:r,expected:i,filepath:n}}};_r.code="ObjectTypeError";var As=class t extends Pe{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=t.code,this.data={value:e}}};As.code="InvalidOidError";var Vc=class t extends Pe{constructor(e){super(`Could not find a fetch refspec for remote "${e}". Make sure the config file has an entry like the following:
|
||||
[remote "${e}"]
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
`),this.code=this.name=t.code,this.data={remote:e}}};Vc.code="NoRefspecError";var gd=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(`
|
||||
`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let s=i.slice(1);return this.refs.set(r+"^{}",s),{line:i,ref:r,peeled:s}}else{let s=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,s),{line:i,ref:r,oid:s}}})}return this}static from(e){return new t(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(`
|
||||
`)+`
|
||||
`}},vd=class t{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,s,a]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=n==="*";if(l!==(a==="*"))throw new me("Invalid refspec");return new t({remotePath:i,localPath:s,force:o,matchPrefix:l})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}},$g=class t{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(vd.from(i));return new t(r)}add(e){let r=vd.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let s=i.translate(n);s&&r.push([n,s])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function OL(t,e){let r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(r<i)||+(r>i);return n===0?t.endsWith("^{}")?1:-1:n}function LL(t,e){let r="",i=0,n=-1,s=0,a="\0";for(let o=0;o<=t.length;++o){if(o<t.length)a=t[o];else{if(a==="/")break;a="/"}if(a==="/"){if(!(n===o-1||s===1))if(s===2){if(r.length<2||i!==2||r.at(-1)!=="."||r.at(-2)!=="."){if(r.length>2){let l=r.lastIndexOf("/");l===-1?(r="",i=0):(r=r.slice(0,l),i=r.length-1-r.lastIndexOf("/")),n=o,s=0;continue}else if(r.length!==0){r="",i=0,n=o,s=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,o):r=t.slice(n+1,o),i=o-n-1;n=o,s=0}else a==="."&&s!==-1?++s:s=-1}return r}function NL(t){if(!t.length)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=LL(t,!e),t.length?(r&&(t+="/"),e?`/${t}`:t):e?"/":r?"./":"."}function H(...t){if(t.length===0)return".";let e;for(let r=0;r<t.length;++r){let i=t[r];i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":NL(e)}var BL=t=>{if(typeof t=="number")return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},Hc=t=>{if(typeof t=="boolean")return t;if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},vE={core:{filemode:Hc,bare:Hc,logallrefupdates:Hc,symlinks:Hc,ignorecase:Hc,bigFileThreshold:BL}},HL=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,UL=/^[A-Za-z0-9-.]+$/,GL=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,jL=/^[A-Za-z][A-Za-z-]*$/,VL=/^(.*?)( *[#;].*)$/,zL=t=>{let e=HL.exec(t);if(e!=null){let[r,i]=e.slice(1);return[r,i]}return null},WL=t=>{let e=GL.exec(t);if(e!=null){let[r,i="true"]=e.slice(1),n=qL(i),s=YL(n);return[r,s]}return null},qL=t=>{let e=VL.exec(t);if(e==null)return t;let[r,i]=e.slice(1);return wE(r)&&wE(i)?`${r}${i}`:r},wE=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,YL=t=>t.split("").reduce((e,r,i,n)=>{let s=r==='"'&&n[i-1]!=="\\",a=r==="\\"&&n[i+1]==='"';return s||a?e:e+r},""),bE=t=>t!=null?t.toLowerCase():null,Fg=(t,e,r)=>[bE(t),e,bE(r)].filter(i=>i!=null).join("."),_E=t=>{let e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:Fg(r,n,i),sectionPath:Fg(r,n,null),isSection:!!r}},ZL=(t,e)=>t.reduce((r,i,n)=>e(i)?n:r,-1),Ig=class t{constructor(e){let r=null,i=null;this.parsedConfig=e?e.split(`
|
||||
`).map(n=>{let s=null,a=null,o=n.trim(),l=zL(o),c=l!=null;if(c)[r,i]=l;else{let f=WL(o);f!=null&&([s,a]=f)}let u=Fg(r,i,s);return{line:n,isSection:c,section:r,subsection:i,name:s,value:a,path:u}}):[]}static from(e){return new t(e)}async get(e,r=!1){let i=_E(e).path,n=this.parsedConfig.filter(s=>s.path===i).map(({section:s,name:a,value:o})=>{let l=vE[s]&&vE[s][a];return l?l(o):o});return r?n:n.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(r=>r.isSection&&r.section===e).map(r=>r.subsection)}async deleteSection(e,r){this.parsedConfig=this.parsedConfig.filter(i=>!(i.section===e&&i.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,i=!1){let{section:n,subsection:s,name:a,path:o,sectionPath:l,isSection:c}=_E(e),u=ZL(this.parsedConfig,f=>f.path===o);if(r==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let f=this.parsedConfig[u],d=Object.assign({},f,{name:a,value:r,modified:!0});i?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let f=this.parsedConfig.findIndex(h=>h.path===l),d={section:n,subsection:s,name:a,value:r,modified:!0,path:o};if(UL.test(n)&&jL.test(a))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:n,subsection:s,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:i,name:n,value:s,modified:a=!1})=>a?n!=null&&s!=null?typeof s=="string"&&/[#;]/.test(s)?` ${n} = "${s}"`:` ${n} = ${s}`:i!=null?`[${r} "${i}"]`:`[${r}]`:e).join(`
|
||||
`)}},ht=class{static async get({fs:e,gitdir:r}){let i=await e.read(`${r}/config`,{encoding:"utf8"});return Ig.from(i)}static async save({fs:e,gitdir:r,config:i}){await e.write(`${r}/config`,i.toString(),{encoding:"utf8"})}},dd=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],KL=["config","description","index","shallow","commondir"],_g;async function Ss(t,e){return _g===void 0&&(_g=new Uc),_g.acquire(t,e)}var q=class t{static async updateRemoteRefs({fs:e,gitdir:r,remote:i,refs:n,symrefs:s,tags:a,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let w of n.values())if(!w.match(/[0-9a-f]{40}/))throw new As(w);let u=await ht.get({fs:e,gitdir:r});if(!o){if(o=await u.getall(`remote.${i}.fetch`),o.length===0)throw new Vc(i);o.unshift(`+HEAD:refs/remotes/${i}/HEAD`)}let f=$g.from(o),d=new Map;if(c){let w=await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await t.deleteRefs({fs:e,gitdir:r,refs:w.map(y=>`refs/tags/${y}`)})}if(a){for(let w of n.keys())if(w.startsWith("refs/tags")&&!w.endsWith("^{}")&&!await t.exists({fs:e,gitdir:r,ref:w})){let y=n.get(w);d.set(w,y)}}let h=f.translate([...n.keys()]);for(let[w,y]of h){let b=n.get(w);d.set(y,b)}let p=f.translate([...s.keys()]);for(let[w,y]of p){let b=s.get(w),S=f.translateOne(b);S&&d.set(y,`ref: ${S}`)}let g=[];if(l){for(let w of f.localNamespaces()){let y=(await t.listRefs({fs:e,gitdir:r,filepath:w})).map(b=>`${w}/${b}`);for(let b of y)d.has(b)||g.push(b)}g.length>0&&await t.deleteRefs({fs:e,gitdir:r,refs:g})}for(let[w,y]of d)await Ss(w,async()=>e.write(H(r,w),`${y.trim()}
|
||||
`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new As(n);await Ss(i,async()=>e.write(H(r,i),`${n.trim()}
|
||||
`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await Ss(i,async()=>e.write(H(r,i),`ref: ${n.trim()}
|
||||
`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return t.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(o=>e.rm(H(r,o))));let n=await Ss("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),s=gd.from(n),a=s.refs.size;for(let o of i)s.refs.has(o)&&s.delete(o);s.refs.size<a&&(n=s.toString(),await Ss("packed-refs",async()=>e.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),t.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let s=await t.packedRefs({fs:e,gitdir:r}),a=dd(i).filter(o=>!KL.includes(o));for(let o of a){let l=await Ss(o,async()=>await e.read(`${r}/${o}`,{encoding:"utf8"})||s.get(o));if(l)return t.resolve({fs:e,gitdir:r,ref:l.trim(),depth:n})}throw new Ge(i)}static async exists({fs:e,gitdir:r,ref:i}){try{return await t.expand({fs:e,gitdir:r,ref:i}),!0}catch(n){return!1}}static async expand({fs:e,gitdir:r,ref:i}){if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let n=await t.packedRefs({fs:e,gitdir:r}),s=dd(i);for(let a of s)if(await Ss(a,async()=>e.exists(`${r}/${a}`))||n.has(a))return a;throw new Ge(i)}static async expandAgainstMap({ref:e,map:r}){let i=dd(e);for(let n of i)if(await r.has(n))return n;throw new Ge(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:i=void 0,map:n}){if(i!==void 0&&(i--,i===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:r,depth:i,map:n});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let s=dd(e);for(let a of s){let o=n.get(a);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:a,depth:i,map:n})}throw new Ge(e)}static async packedRefs({fs:e,gitdir:r}){let i=await Ss("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return gd.from(i).refs}static async listRefs({fs:e,gitdir:r,filepath:i}){let n=t.packedRefs({fs:e,gitdir:r}),s=null;try{s=await e.readdirDeep(`${r}/${i}`),s=s.map(a=>a.replace(`${r}/${i}/`,""))}catch(a){s=[]}for(let a of(await n).keys())a.startsWith(i)&&(a=a.replace(i+"/",""),s.includes(a)||s.push(a));return s.sort(OL),s}static async listBranches({fs:e,gitdir:r,remote:i}){return i?t.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${i}`}):t.listRefs({fs:e,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:r}){return(await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"})).filter(n=>!n.endsWith("^{}"))}};function XL(t,e){return Sd(yE(t),yE(e))}function yE(t){return t.mode==="040000"?t.path+"/":t.path}function VE(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new me(`Unexpected GitTree entry mode: ${t}`)}function QL(t){let e=[],r=0;for(;r<t.length;){let i=t.indexOf(32,r);if(i===-1)throw new me(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);let n=t.indexOf(0,r);if(n===-1)throw new me(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let s=t.slice(r,i).toString("utf8");s==="40000"&&(s="040000");let a=VE(s),o=t.slice(i+1,n).toString("utf8");if(o.includes("\\")||o.includes("/"))throw new zo(o);let l=t.slice(n+1,n+21).toString("hex");r=n+21,e.push({mode:s,path:o,oid:l,type:a})}return e}function JL(t){if(typeof t=="number"&&(t=t.toString(8)),t.match(/^0?4.*/))return"040000";if(t.match(/^1006.*/))return"100644";if(t.match(/^1007.*/))return"100755";if(t.match(/^120.*/))return"120000";if(t.match(/^160.*/))return"160000";throw new me(`Could not understand file mode: ${t}`)}function eN(t){return!t.oid&&t.sha&&(t.oid=t.sha),t.mode=JL(t.mode),t.type||(t.type=VE(t.mode)),t}var Mr=class t{constructor(e){if(E.isBuffer(e))this._entries=QL(e);else if(Array.isArray(e))this._entries=e.map(eN);else throw new me("invalid type passed to GitTree constructor");this._entries.sort(HE)}static from(e){return new t(e)}render(){return this._entries.map(e=>`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(`
|
||||
`)}toObject(){let e=[...this._entries];return e.sort(XL),E.concat(e.map(r=>{let i=E.from(r.mode.replace(/^0/,"")),n=E.from(" "),s=E.from(r.path,"utf8"),a=E.from([0]),o=E.from(r.oid,"hex");return E.concat([i,n,s,a,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},Cs=class{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,s=n+r.length,a=new Uint8Array(s);for(let o=0;o<n;o++)a[o]=i.charCodeAt(o);return a.set(r,n),a}static unwrap(e){let r=e.indexOf(32),i=e.indexOf(0),n=e.slice(0,r).toString("utf8"),s=e.slice(r+1,i).toString("utf8"),a=e.length-(i+1);if(parseInt(s)!==a)throw new me(`Length mismatch: expected ${s} bytes but got ${a} instead.`);return{type:n,object:E.from(e.slice(i+1))}}};async function zE({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`,n=await t.read(`${e}/${i}`);return n?{object:n,format:"deflated",source:i}:null}function tN(t,e){let r=new wi(t),i=xE(r);if(i!==e.byteLength)throw new me(`applyDelta expected source buffer to be ${i} bytes but the provided buffer was ${e.length} bytes`);let n=xE(r),s,a=SE(r,e);if(a.byteLength===n)s=a;else{s=E.alloc(n);let o=new wi(s);for(o.copy(a);!r.eof();)o.copy(SE(r,e));let l=o.tell();if(n!==l)throw new me(`applyDelta expected target buffer to be ${n} bytes but the resulting buffer was ${l} bytes`)}return s}function xE(t){let e=0,r=0,i=null;do i=t.readUInt8(),e|=(i&127)<<r,r+=7;while(i&128);return e}function EE(t,e,r){let i=0,n=0;for(;r--;)e&1&&(i|=t.readUInt8()<<n),e>>=1,n+=8;return i}function SE(t,e){let r=t.readUInt8(),i=128,n=15,s=112;if(r&i){let a=EE(t,r&n,4),o=EE(t,(r&s)>>4,3);return o===0&&(o=65536),e.slice(a,a+o)}else return t.slice(r)}function rN(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function WE(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:rN(t)}var wd=class{constructor(e){if(typeof E=="undefined")throw new Error("Missing Buffer dependency");this.stream=WE(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?E.alloc(0):(r&&(r=E.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>iN(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=E.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};function iN(t){return t.reduce((e,r)=>e+r.length,0)}async function nN(t,e){let r=new wd(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new me(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new me(`Invalid packfile version: ${n}`);let s=await r.read(4);if(s=s.readUInt32BE(0),!(s<1))for(;!r.eof()&&s--;){let a=r.tell(),{type:o,length:l,ofs:c,reference:u}=await sN(r),f=new Ug.Inflate;for(;!f.result;){let d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new me(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new me("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-f.strm.avail_in);let h=r.tell();await e({data:f.result,type:o,num:s,offset:a,end:h,reference:u,ofs:c})}}}}async function sN(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let a=4;do e=await t.byte(),i|=(e&127)<<a,a+=7;while(e&128)}let n,s;if(r===6){let a=0;n=0;let o=[];do e=await t.byte(),n|=(e&127)<<a,a+=7,o.push(e);while(e&128);s=E.from(o)}return r===7&&(s=await t.read(20)),{type:r,length:i,ofs:n,referen
Line truncated
|
||||
`,t}function bd(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:mN(n)}}function mN(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=(e==="+"?1:-1)*(Number(r)*60+Number(i)),gN(i)}function gN(t){return t===0?t:-t}var Xr=class t{constructor(e){if(typeof e=="string")this._tag=e;else if(E.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=t.render(e);else throw new me("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new t(e)}static render(e){return`object ${e.object}
|
||||
type ${e.type}
|
||||
tag ${e.tag}
|
||||
tagger ${Mg(e.tagger)}
|
||||
|
||||
${e.message}
|
||||
${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
||||
|
||||
`))}message(){let e=this.withoutSignature();return e.slice(e.indexOf(`
|
||||
|
||||
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(`
|
||||
`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=`
|
||||
`+n.slice(1):r.push(n);let i={};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.tagger&&(i.tagger=bd(i.tagger)),i.committer&&(i.committer=bd(i.committer)),i}withoutSignature(){let e=zn(this._tag);return e.indexOf(`
|
||||
-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(`
|
||||
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
||||
-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return zn(e)}payload(){return this.withoutSignature()+`
|
||||
`}toObject(){return E.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:s}=await r({payload:n,secretKey:i});s=zn(s);let a=n+s;return t.from(a)}};function xg(t){return t.trim().split(`
|
||||
`).map(e=>" "+e).join(`
|
||||
`)+`
|
||||
`}function vN(t){return t.split(`
|
||||
`).map(e=>e.replace(/^ /,"")).join(`
|
||||
`)}var Dr=class t{constructor(e){if(typeof e=="string")this._commit=e;else if(E.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=t.render(e);else throw new me("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let i=t.justHeaders(e),n=t.justMessage(e),s=zn(i+`
|
||||
gpgsig`+xg(r)+`
|
||||
`+n);return new t(s)}static from(e){return new t(e)}toObject(){return E.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return t.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return zn(e.slice(e.indexOf(`
|
||||
|
||||
`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(`
|
||||
|
||||
`))}parseHeaders(){let e=t.justHeaders(this._commit).split(`
|
||||
`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=`
|
||||
`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.author&&(i.author=bd(i.author)),i.committer&&(i.committer=bd(i.committer)),i}static renderHeaders(e){let r="";if(e.tree?r+=`tree ${e.tree}
|
||||
`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||
`,e.parent){if(e.parent.length===void 0)throw new me("commit 'parent' property should be an array");for(let s of e.parent)r+=`parent ${s}
|
||||
`}let i=e.author;r+=`author ${Mg(i)}
|
||||
`;let n=e.committer||e.author;return r+=`committer ${Mg(n)}
|
||||
`,e.gpgsig&&(r+="gpgsig"+xg(e.gpgsig)),r}static render(e){return t.renderHeaders(e)+`
|
||||
`+zn(e.message)}render(){return this._commit}withoutSignature(){let e=zn(this._commit);if(e.indexOf(`
|
||||
gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(`
|
||||
gpgsig`)),i=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
|
||||
`)+28);return zn(r+`
|
||||
`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return vN(e)}static async sign(e,r,i){let n=e.withoutSignature(),s=t.justMessage(e._commit),{signature:a}=await r({payload:n,secretKey:i});a=zn(a);let l=t.justHeaders(e._commit)+`
|
||||
gpgsig`+xg(a)+`
|
||||
`+s;return t.from(l)}};async function Xo({fs:t,cache:e,gitdir:r,oid:i}){if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:Mr.from([]),oid:i};let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Xr.from(s).parse().object,Xo({fs:t,cache:e,gitdir:r,oid:i});if(n==="commit")return i=Dr.from(s).parse().tree,Xo({fs:t,cache:e,gitdir:r,oid:i});if(n!=="tree")throw new _r(i,n,"tree");return{tree:Mr.from(s),oid:i}}var Dg=class{constructor({fs:e,gitdir:r,ref:i,cache:n}){this.fs=e,this.cache=n,this.gitdir=r,this.mapPromise=(async()=>{let a=new Map,o;try{o=await q.resolve({fs:e,gitdir:r,ref:i})}catch(c){c instanceof Ge&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Xo({fs:e,cache:this.cache,gitdir:r,oid:o});return l.type="tree",l.mode="40000",a.set(".",l),a})();let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,cache:n,gitdir:s}=this,a=await this.mapPromise,o=a.get(r);if(!o)throw new Error(`No obj for ${r}`);let l=o.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!=="tree")return null;let{type:c,object:u}=await et({fs:i,cache:n,gitdir:s,oid:l});if(c!==o.type)throw new _r(l,c,o.type);let f=Mr.from(u);for(let d of f)a.set(H(r,d.path),d);return f.entries().map(d=>H(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:i}=r.get(e._fullpath);e._type=i}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:i}=r.get(e._fullpath);e._mode=UE(parseInt(i,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:i,cache:n,gitdir:s}=this,o=r.get(e._fullpath).oid,{type:l,object:c}=await et({fs:i,cache:n,gitdir:s,oid:o});l!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let i=(await this.mapPromise).get(e._fullpath);e._oid=i.oid}return e._oid}};function Kr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,kd,{value:function({fs:r,gitdir:i,cache:n}){return new Dg({fs:r,gitdir:i,ref:t,cache:n})}}),Object.freeze(e),e}var Og=class{constructor({fs:e,dir:r,gitdir:i,cache:n}){this.fs=e,this.cache=n,this.dir=r,this.gitdir=i,this.config=null;let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,dir:n}=this,s=await i.readdir(H(n,r));return s===null?null:s.map(a=>H(r,a))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:r,dir:i}=this,n=await r.lstat(`${i}/${e._fullpath}`);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let s=n.isDirectory()?"tree":"blob";s==="blob"&&!n.isFile()&&!n.isSymbolicLink()&&(s="special"),e._type=s,n=Wo(n),e._mode=n.mode,n.size===-1&&e._actualSize&&(n.size=e._actualSize),e._stat=n}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:i,gitdir:n}=this;if(await e.type()==="tree")e._content=void 0;else{let s;if(await e.mode()>>12===10)s=await r.readlink(`${i}/${e._fullpath}`);else{let o=await(await this._getGitConfig(r,n)).get("core.autocrlf");s=await r.read(`${i}/${e._fullpath}`,{autocrlf:o})}e._actualSize=s.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(s)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:i,gitdir:n,cache:s}=this,a;await dt.acquire({fs:i,gitdir:n,cache:s},async function(o){let l=o.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await r._getGitConfig(i,n)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||pd(c,l,f,d)){let h=await e.content();h===void 0?a=void 0:(a=await wn(Cs.wrap({type:"blob",object:h})),l&&a===l.oid&&(!f||c.mode===l.mode)&&pd(c,l,f,d)&&o.insert({filepath:e._fullpath,stats:c,oid:a}))}else a=l.oid}),e._oid=a}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await ht.get({fs:e,gitdir:r}),this.config)}};function tl(){let t=Object.create(null);return Object.defineProperty(t,kd,{value:function({fs:e,dir:r,gitdir:i,cache:n}){return new Og({fs:e,dir:r,gitdir:i,cache:n})}}),Object.freeze(t),t}function wN(t,e){let r=e-t;return Array.from({length:r},(i,n)=>t+n)}var ZE=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),Lg=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:e<this.value&&(this.value=e))}reset(){th
Line truncated
|
||||
`),i=new TextEncoder().encode(i)}catch(n){}return typeof i!="string"&&(i=E.from(i)),i}catch(i){return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i)}catch(n){await this.mkdir(va(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e)}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=va(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Sd),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let s=e+"/"+n;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((n,s)=>n.concat(s),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return E.isBuffer(i)?i:E.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};function R(t,e){if(e===void 0)throw new Ir(t)}function xN(t){return t.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(t)}async function ie({fsp:t,dotgit:e}){R("fsp",t),R("dotgit",e);let r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(i=>i.trimRight().substr(8)).then(i=>xN(i)?i:H(va(e),i)):e}async function _d(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}async function KE({fs:t,dir:e,gitdir:r=H(e,".git"),commit:i="HEAD",cache:n={}}){try{R("fs",t),R("dir",e),R("gitdir",r);let s=new te(t),a=[Kr({ref:i}),tl(),Ea()],o=[],l=await ie({fsp:s,dotgit:r});await dt.acquire({fs:s,gitdir:l,cache:n},async function(u){o=u.unmergedPaths});let c=await Ps({fs:s,cache:n,dir:e,gitdir:l,trees:a,map:async function(u,[f,d,h]){let p=!await _d(d,h),g=o.includes(u),w=!await _d(h,f);if(p||g)return f?{path:u,mode:await f.mode(),oid:await f.oid(),type:await f.type(),content:await f.content()}:void 0;if(w)return!1;throw new su(u)}});await dt.acquire({fs:s,gitdir:l,cache:n},async function(u){for(let f of c)if(f!==!1){if(!f){await s.rmdir(`${e}/${f.path}`,{recursive:!0}),u.delete({filepath:f.path});continue}if(f.type==="blob"){let d=new TextDecoder().decode(f.content);await s.write(`${e}/${f.path}`,d,{mode:f.mode}),u.insert({filepath:f.path,oid:f.oid,stage:0})}}})}catch(s){throw s.caller="git.abortMerge",s}}var Rs=class{static async isIgnored({fs:e,dir:r,gitdir:i=H(r,".git"),filepath:n}){if(md(n)===".git")return!0;if(n===".")return!1;let s="",a=H(i,"info","exclude");await e.exists(a)&&(s=await e.read(a,"utf8"));let o=[{gitignore:H(r,".gitignore"),filepath:n}],l=n.split("/").filter(Boolean);for(let u=1;u<l.length;u++){let f=l.slice(0,u).join("/"),d=l.slice(u).join("/");o.push({gitignore:H(r,f,".gitignore"),filepath:d})}let c=!1;for(let u of o){let f;try{f=await e.read(u.gitignore,"utf8")}catch(p){if(p.code==="NOENT")continue}let d=kL().add(s);d.add(f);let h=va(u.filepath);if(h!=="."&&d.ignores(h))return!0;c?c=!d.test(u.filepath).unignored:c=d.test(u.filepath).ignored}return c}};async function EN({fs:t,gitdir:e,object:r,format:i,oid:n}){if(i!=="deflated")throw new me("GitObjectStoreLoose expects objects to write to be in deflated format");let s=`objects/${n.slice(0,2)}/${n.slice(2)}`,a=`${e}/${s}`;await t.exists(a)||await t.write(a,r)}var Eg=null;async function XE(t){return Eg===null&&(Eg=kN()),Eg?SN(t):Ug.deflate(t)}async function SN(t){let e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}function kN(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(t){return!1}}async function Or({fs:t,gitdir:e,type:r,object:i,format:n="content",oid:s=void 0,dryRun:a=!1}){return n!=="deflated"&&(n!=="wrapped"&&(i=Cs.wrap({type:r,object:i})),s=await wn(i),i=E.from(await XE(i))),a||await EN({fs:t,gitdir:e,object:i,format:"deflated",oid:s}),s}function QE(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}async function JE({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,cache:n={},force:s=!1,parallel:a=!0}){try{R("fs",t),R("dir",e),R("gitdir",r),R("filepath",i);let o=new te(t),l=await ie({fsp:o,dotgit:r});await dt.acquire({fs:o,gitdir:l,cache:n},async c=>{let f=await(await ht.get({fs:o,gitdir:l})).get("core.autocrlf");return Bg({dir:e,gitdir:l,fs:o,filepath:i,index:c,force:s,parallel:a,autocrlf:f})})}catch(o){throw o.caller="git.add",o}}async function Bg({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:s,para
Line truncated
|
||||
`,author:l,committer:c,signingKey:u})}async function nS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n="refs/notes/commits",oid:s,note:a,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{R("fs",t),R("gitdir",i),R("oid",s),R("note",a),u&&R("onSign",e);let d=new te(t),h=await $s({fs:d,gitdir:i,author:l});if(!h)throw new Xt("author");let p=await _a({fs:d,gitdir:i,author:h,committer:c});if(!p)throw new Xt("committer");let g=await ie({fsp:d,dotgit:i});return await AN({fs:d,cache:f,onSign:e,gitdir:g,ref:n,oid:s,note:a,force:o,author:h,committer:p,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}var CN=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function lu(t,e){if(typeof t!="string")throw new TypeError("Reference name must be a string");return!CN.test(t)&&(!!e||t.includes("/"))}async function sS({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let s=await ht.get({fs:t,gitdir:e});if(!n&&(await s.getSubsections("remote")).includes(r)&&i!==await s.get(`remote.${r}.url`))throw new Ui("remote",r);await s.set(`remote.${r}.url`,i),await s.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await ht.save({fs:t,gitdir:e,config:s})}async function aS({fs:t,dir:e,gitdir:r=H(e,".git"),remote:i,url:n,force:s=!1}){try{R("fs",t),R("gitdir",r),R("remote",i),R("url",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await sS({fs:a,gitdir:o,remote:i,url:n,force:s})}catch(a){throw a.caller="git.addRemote",a}}async function TN({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await q.exists({fs:t,gitdir:i,ref:n}))throw new Ui("tag",n);let f=await q.resolve({fs:t,gitdir:i,ref:l||"HEAD"}),{type:d}=await et({fs:t,cache:e,gitdir:i,oid:f}),h=Xr.from({object:f,type:d,tag:n.replace("refs/tags/",""),tagger:s,message:a,gpgsig:o});c&&(h=await Xr.sign(h,r,c));let p=await Or({fs:t,gitdir:i,type:"tag",object:h.toObject()});await q.writeRef({fs:t,gitdir:i,ref:n,value:p})}async function oS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{R("fs",t),R("gitdir",i),R("ref",n),c&&R("onSign",e);let d=new te(t),h=await ie({fsp:d,dotgit:i}),p=await $s({fs:d,gitdir:h,author:s});if(!p)throw new Xt("tagger");return await TN({fs:d,cache:f,onSign:e,gitdir:h,ref:n,tagger:p,message:a,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function PN({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:s=!1}){if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let a=`refs/heads/${r}`;if(!s&&await q.exists({fs:t,gitdir:e,ref:a}))throw new Ui("branch",r,!1);let o;try{o=await q.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch(l){}o&&await q.writeRef({fs:t,gitdir:e,ref:a,value:o}),n&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function lS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,object:n,checkout:s=!1,force:a=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let o=new te(t),l=await ie({fsp:o,dotgit:r});return await PN({fs:o,gitdir:l,ref:i,object:n,checkout:s,force:a})}catch(o){throw o.caller="git.branch",o}}var cS=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function jg({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:s,remote:a,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0,nonBlocking:p=!1,batchSize:g=100}){let w;if(i)try{w=await q.resolve({fs:t,gitdir:s,ref:"HEAD"})}catch(b){w="0000000000000000000000000000000000000000"}let y;try{y=await q.resolve({fs:t,gitdir:s,ref:o})}catch(b){if(o==="HEAD")throw b;let S=`${a}/${o}`;if(y=await q.resolve({fs:t,gitdir:s,ref:S}),h){let C=await ht.get({fs:t,gitdir:s});await C.set(`branch.${o}.remote`,a),await C.set(`branch.${o}.merge`,`refs/heads/${o}`),await ht.save({fs:t,gitdir:s,config:C})}await q.writeRef({fs:t,gitdir:s,ref:`refs/heads/${o}`,value:y})}if(!c){let b;try{b=await RN({fs:t,cache:e,onProgress:r,dir:n,gitdir:s,ref:o,force:d,filepaths:l})}catch(v){throw v instanceof Ge&&v.data.what===y?new Kc(o,y):v}let S=b.filter(([v])=>v==="conflict").map(([v,x])=>x);if(S.length>0)throw new qc(S);let C=b.filter(([v])=>v==="error").map(([v,x])=>x);if(C.length>0)throw new me(C.join(", "));if(f){i&&await i({previousHead:w,newHead:y,type:l!=null&&l.length>0?"file":"branch"});return}let A=0,k=b.length;if(await dt.acquire({fs:t,gitdir:s,cache:e},async function(v){await Promise.all(b.filter(([x])=>x==="delete"||x==="delete-index").map(async function([x,_]){let P=`${n}/${_}`;x==="delete"&&await t.rm(P),v.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}))}),await dt.acquire({fs:t,gitdir:s,cache:e},async function(v){for(let[x,_]of b)if(x==="rmdir"||x==="rmdir-index"){let P=`${n}/${_}`;try{x==="rmdir"&&await t.rmdir(P),v.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}catch(T){if(T.code==="ENO
Line truncated
|
||||
`,d+=p.conflict.a.join(""),d+=`${"=".repeat(f)}
|
||||
`,d+=p.conflict.b.join(""),d+=`${">".repeat(f)} ${i}
|
||||
`);return{cleanMerge:h,mergedText:d}}async function uS({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),index:n,ourOid:s,baseOid:a,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let p=Kr({ref:s}),g=Kr({ref:a}),w=Kr({ref:o}),y=[],b=[],S=[],C=[],A=await Ps({fs:t,cache:e,dir:r,gitdir:i,trees:[p,g,w],map:async function(k,[v,x,_]){let P=md(k),T=await _d(v,x),M=await _d(_,x);switch(`${T}-${M}`){case"false-false":return{mode:await x.mode(),path:P,oid:await x.oid(),type:await x.type()};case"false-true":return!_&&await v.type()==="tree"?{mode:await v.mode(),path:P,oid:await v.oid(),type:await v.type()}:_?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!v&&await _.type()==="tree"?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:v?{mode:await v.mode(),path:P,oid:await v.oid(),type:await v.type()}:void 0;case"true-true":{if(v&&_&&await v.type()==="tree"&&await _.type()==="tree")return{mode:await v.mode(),path:P,oid:await v.oid(),type:"tree"};if(v&&_&&await v.type()==="blob"&&await _.type()==="blob")return MN({fs:t,gitdir:i,path:P,ours:v,base:x,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async $=>{if($.cleanMerge)d||n.insert({filepath:k,oid:$.mergeResult.oid,stage:0});else if(y.push(k),b.push(k),!d){let D="";x&&await x.type()==="blob"&&(D=await x.oid());let Q=await v.oid(),ye=await _.oid();n.delete({filepath:k}),D&&n.insert({filepath:k,oid:D,stage:1}),n.insert({filepath:k,oid:Q,stage:2}),n.insert({filepath:k,oid:ye,stage:3})}return $.mergeResult});if(x&&!v&&_&&await x.type()==="blob"&&await _.type()==="blob"){if(y.push(k),S.push(k),!d){let $=await x.oid(),D=await _.oid();n.delete({filepath:k}),n.insert({filepath:k,oid:$,stage:1}),n.insert({filepath:k,oid:D,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:P}}if(x&&v&&!_&&await x.type()==="blob"&&await v.type()==="blob"){if(y.push(k),C.push(k),!d){let $=await x.oid(),D=await v.oid();n.delete({filepath:k}),n.insert({filepath:k,oid:$,stage:1}),n.insert({filepath:k,oid:D,stage:2})}return{mode:await v.mode(),oid:await v.oid(),type:"blob",path:P}}if(x&&!v&&!_&&(await x.type()==="blob"||await x.type()==="tree"))return;throw new Yo}}},reduce:y.length!==0&&(!r||d)?void 0:async(k,v)=>{let x=v.filter(Boolean);if(k&&!(k&&k.type==="tree"&&x.length===0&&k.path!==".")){if(x.length>0||k.path==="."&&x.length===0){let P=new Mr(x).toObject(),T=await Or({fs:t,gitdir:i,type:"tree",object:P,dryRun:f});k.oid=T}return k}}});return y.length!==0?(r&&!d&&await Ps({fs:t,cache:e,dir:r,gitdir:i,trees:[Kr({ref:A.oid})],map:async function(k,[v]){let x=`${r}/${k}`;if(await v.type()==="blob"){let _=await v.mode(),P=new TextDecoder().decode(await v.content());await t.write(x,P,{mode:_})}return!0}}),new wa(y,b,S,C)):A.oid}async function MN({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:s,ourName:a,theirName:o,baseName:l,dryRun:c,mergeDriver:u=IN}){let f="blob",d="100755",h="",p="";n&&await n.type()==="blob"&&(d=await n.mode(),h=await n.oid(),p=E.from(await n.content()).toString("utf8"));let g=d===await i.mode()?await s.mode():await i.mode();if(await i.oid()===await s.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};if(await i.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await s.oid(),type:f}};if(await s.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};let w=E.from(await i.content()).toString("utf8"),y=E.from(await s.content()).toString("utf8"),{mergedText:b,cleanMerge:S}=await u({branches:[l,a,o],contents:[p,w,y],path:r}),C=await Or({fs:t,gitdir:e,type:"blob",object:E.from(b,"utf8"),dryRun:c});return{cleanMerge:S,mergeResult:{mode:g,path:r,oid:C,type:f}}}var DN={stage:Ea,workdir:tl},kg;async function Qo(t,e){return kg===void 0&&(kg=new Uc),kg.acquire(t,e)}async function ON(t,e,r,i,n=null){let s=H(r,i),a=await t.lstat(s);if(!a)throw new Ge(s);if(a.isDirectory())throw new me(`${s}: file expected, but found directory`);let o=n?await zE({fs:t,gitdir:e,oid:n}):void 0,l=o?n:void 0;return o||await Qo({fs:t,gitdir:e,currentFilepath:s},async()=>{let c=a.isSymbolicLink()?await t.readlink(s).then(QE):await t.read(s);if(c===null)throw new Ge(s);l=await Or({fs:t,gitdir:e,type:"blob",object:c})}),l}async function LN({fs:t,dir:e,gitdir:r,entries:i}){async function n(s){if(s.type==="tree"){if(!s.oid){let a=await Promise.all(s.children.map(n));s.oid=await fu({fs:t,gitdir:r,tree:a}),s.mode=16384}}else s.type==="blob"&&(s.oid=await ON(t,r,e,s.path,s.oid),s.mode=33188);return s.path=s.path.split("/").pop(),s}return Promise.all(i.map(n))}async function RE({fs:t,dir:e,gitdir:r,treePair:i}){let n=i[1]==="stage",s=i.map(h=>typeof h=="string"?DN[h]():h),a=[],u=await Ps({fs:t,cache:{},dir:e,gitdir:r,trees:s,map:async(h,[p,g])=>{if(!(h==="."||await Rs.isIgnored({fs:t,dir:e,gitdir:r,filepath:h}))&&g)return(!p||await p.oid()!==await g.oid()&&await g.oid()!==void 0)&&a.push([p,g]),{mode:a
Line truncated
|
||||
`).map(a=>n.add(a))}),n}static async write({fs:e,gitdir:r,oids:i}){ma===null&&(ma=new Uc);let n=H(r,"shallow");if(i.size>0){let s=[...i].join(`
|
||||
`)+`
|
||||
`;await ma.acquire(n,async function(){await e.write(n,s,{encoding:"utf8"})})}else await ma.acquire(n,async function(){await e.rm(n)})}};async function UN({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}async function GN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=await t.readdir(H(r,"objects/pack"));s=s.filter(a=>a.endsWith(".idx"));for(let a of s){let o=`${r}/objects/pack/${a}`,l=await Gg({fs:t,cache:e,filename:o,getExternalRefDelta:n});if(l.error)throw new me(l.error);if(l.offsets.has(i))return!0}return!1}async function LE({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=o=>et({fs:t,cache:e,gitdir:r,oid:o}),a=await UN({fs:t,gitdir:r,oid:i});return a||(a=await GN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s})),a}function jN(t){let n="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===n}function pS(t,e){let r=t.map(i=>i.split("=",1)[0]);return e.filter(i=>{let n=i.split("=",1)[0];return r.includes(n)})}var Ad={name:"isomorphic-git",version:"1.37.4",agent:"git/isomorphic-git@1.37.4"},Vo=class{constructor(){this._queue=[]}write(e){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let r=this._waiting;this._waiting=null,r({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(e=>{this._waiting=e})}};function VN(t){let e=t.indexOf("\r"),r=t.indexOf(`
|
||||
`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}function mS(t){let e=new Vo,r="";return(async()=>(await du(t,i=>{for(i=i.toString("utf8"),r+=i;;){let n=VN(r);if(n===-1)break;e.write(r.slice(0,n)),r=r.slice(n)}}),r.length>0&&e.write(r),e.end()))(),e}var xd=class{static demux(e){let r=lt.streamReader(e),i=new Vo,n=new Vo,s=new Vo,a=async function(){let o=await r();if(o===null)return a();if(o===!0){i.end(),s.end(),e.error?n.destroy(e.error):n.end();return}switch(o[0]){case 1:{n.write(o.slice(1));break}case 2:{s.write(o.slice(1));break}case 3:{let l=o.slice(1);s.write(l),i.end(),s.end(),n.destroy(new Error(l.toString("utf8")));return}default:i.write(o)}a()};return a(),{packetlines:i,packfile:n,progress:s}}};async function zN(t){let{packetlines:e,packfile:r,progress:i}=xd.demux(t),n=[],s=[],a=[],o=!1,l=!1;return new Promise((c,u)=>{du(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new As(h)),n.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new As(h)),s.push(h)}else if(d.startsWith("ACK")){let[,h,p]=d.split(" ");a.push({oid:h,status:p}),p||(l=!0)}else d.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))})})}function WN({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:s=null,exclude:a=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(lt.encode(`want ${c}${l}
|
||||
`)),l="";for(let c of i)o.push(lt.encode(`shallow ${c}
|
||||
`));n!==null&&o.push(lt.encode(`deepen ${n}
|
||||
`)),s!==null&&o.push(lt.encode(`deepen-since ${Math.floor(s.valueOf()/1e3)}
|
||||
`));for(let c of a)o.push(lt.encode(`deepen-not ${c}
|
||||
`));o.push(lt.flush());for(let c of r)o.push(lt.encode(`have ${c}
|
||||
`));return o.push(lt.encode(`done
|
||||
`)),o}async function zg({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:p=null,since:g=null,exclude:w=[],relative:y=!1,tags:b=!1,singleBranch:S=!1,headers:C={},prune:A=!1,pruneTags:k=!1}){let v=c||await Is({fs:t,gitdir:l,test:!0}),x=await ht.get({fs:t,gitdir:l}),_=f||v&&await x.get(`branch.${v}.remote`)||"origin",P=d||await x.get(`remote.${_}.url`);if(typeof P=="undefined")throw new Ir("remote OR url");let T=u||v&&await x.get(`branch.${v}.merge`)||c||"HEAD";h===void 0&&(h=await x.get("http.corsProxy"));let M=el.getRemoteHelperFor({url:P}),$=await M.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:P,headers:C,protocolVersion:1}),D=$.auth,Q=$.refs;if(Q.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!$.capabilities.has("shallow"))throw new ks("shallow","depth");if(g!==null&&!$.capabilities.has("deepen-since"))throw new ks("deepen-since","since");if(w.length>0&&!$.capabilities.has("deepen-not"))throw new ks("deepen-not","exclude");if(y===!0&&!$.capabilities.has("deepen-relative"))throw new ks("deepen-relative","relative");let{oid:ye,fullref:de}=q.resolveAgainstMap({ref:T,map:Q});for(let B of Q.keys())B===de||B==="HEAD"||B.startsWith("refs/heads/")||b&&B.startsWith("refs/tags/")||Q.delete(B);let J=pS([...$.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Ad.agent}`]);y&&J.push("deepen-relative");let X=S?[ye]:Q.values(),he=S?[v]:await q.listRefs({fs:t,gitdir:l,filepath:"refs"}),z=[];for(let B of he)try{B=await q.expand({fs:t,gitdir:l,ref:B});let N=await q.resolve({fs:t,gitdir:l,ref:B});await LE({fs:t,cache:e,gitdir:l,oid:N})&&z.push(N)}catch(N){}z=[...new Set(z)];let K=await ya.read({fs:t,gitdir:l}),G=$.capabilities.has("shallow")?[...K]:[],Me=WN({capabilities:J,wants:X,haves:z,shallows:G,depth:p,since:g,exclude:w}),Et=E.from(await yd(Me)),Ht=await M.connect({http:r,onProgress:i,corsProxy:h,service:"git-upload-pack",url:P,auth:D,body:[Et],headers:C}),De=await zN(Ht.body);Ht.headers&&(De.headers=Ht.headers);for(let B of De.shallows)if(!K.has(B))try{let{object:N}=await et({fs:t,cache:e,gitdir:l,oid:B}),ue=new Dr(N),Re=await Promise.all(ue.headers().parent.map(Pr=>LE({fs:t,cache:e,gitdir:l,oid:Pr})));Re.length===0||Re.every(Pr=>Pr)||K.add(B)}catch(N){K.add(B)}for(let B of De.unshallows)K.delete(B);if(await ya.write({fs:t,gitdir:l,oids:K}),S){let B=new Map([[de,ye]]),N=new Map,ue=10,Re=de;for(;ue--;){let vo=$.symrefs.get(Re);if(vo===void 0)break;N.set(Re,vo),Re=vo}let Ut=Q.get(Re);Ut&&B.set(Re,Ut);let{pruned:Pr}=await q.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:B,symrefs:N,tags:b,prune:A});A&&(De.pruned=Pr)}else{let{pruned:B}=await q.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:Q,symrefs:$.symrefs,tags:b,prune:A,pruneTags:k});A&&(De.pruned=B)}if(De.HEAD=$.symrefs.get("HEAD"),De.HEAD===void 0){let{oid:B}=q.resolveAgainstMap({ref:"HEAD",map:Q});for(let[N,ue]of Q.entries())if(N!=="HEAD"&&ue===B){De.HEAD=N;break}}let Rt=de.startsWith("refs/tags")?"tag":"branch";if(De.FETCH_HEAD={oid:ye,description:`${Rt} '${ga(de)}' of ${P}`},i||n){let B=mS(De.progress);du(B,async N=>{if(n&&await n(N),i){let ue=N.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);ue&&await i({phase:ue[1].trim(),loaded:parseInt(ue[2],10),total:parseInt(ue[3],10)})}})}let $t=E.from(await yd(De.packfile));if(Ht.body.error)throw Ht.body.error;let Xe=$t.slice(-20).toString("hex"),re={defaultBranch:De.HEAD,fetchHead:De.FETCH_HEAD.oid,fetchHeadDescription:De.FETCH_HEAD.description};if(De.headers&&(re.headers=De.headers),A&&(re.pruned=De.pruned),Xe!==""&&!jN($t)){re.packfile=`objects/pack/pack-${Xe}.pack`;let B=H(l,re.packfile);await t.write(B,$t);let N=Re=>et({fs:t,cache:e,gitdir:l,oid:Re}),ue=await zc.fromPack({pack:$t,getExternalRefDelta:N,onProgress:i});await t.write(B.replace(/\.pack$/,".idx"),await ue.toBuffer())}return re}async function gS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:H(r,".git"),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let s=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];s=s.map(a=>i+"/"+a);for(let a of s)await t.mkdir(a);await t.write(i+"/config",`[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = false
|
||||
bare = ${e}
|
||||
`+(e?"":` logallrefupdates = true
|
||||
`)+` symlinks = false
|
||||
ignorecase = true
|
||||
`),await t.write(i+"/HEAD",`ref: refs/heads/${n}
|
||||
`)}async function qN({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:p,depth:g,since:w,exclude:y,relative:b,singleBranch:S,noCheckout:C,noTags:A,headers:k,nonBlocking:v,batchSize:x=100}){try{if(await gS({fs:t,gitdir:u}),await sS({fs:t,gitdir:u,remote:p,url:f,force:!1}),d){let T=await ht.get({fs:t,gitdir:u});await T.set("http.corsProxy",d),await ht.save({fs:t,gitdir:u,config:T})}let{defaultBranch:_,fetchHead:P}=await zg({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:u,ref:h,remote:p,corsProxy:d,depth:g,since:w,exclude:y,relative:b,singleBranch:S,headers:k,tags:!A});if(P===null)return;h=h||_,h=h.replace("refs/heads/",""),await jg({fs:t,cache:e,onProgress:i,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:C,nonBlocking:v,batchSize:x})}catch(_){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),_}}async function vS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:c=H(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:p=void 0,since:g=void 0,exclude:w=[],relative:y=!1,singleBranch:b=!1,noCheckout:S=!1,noTags:C=!1,headers:A={},cache:k={},nonBlocking:v=!1,batchSize:x=100}){try{R("fs",t),R("http",e),R("gitdir",c),S||R("dir",l),R("url",u);let _=new te(t),P=await ie({fsp:_,dotgit:c});return await qN({fs:_,cache:k,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:P,url:u,corsProxy:f,ref:d,remote:h,depth:p,since:g,exclude:w,relative:y,singleBranch:b,noCheckout:S,noTags:C,headers:A,nonBlocking:v,batchSize:x})}catch(_){throw _.caller="git.clone",_}}async function wS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:p={}}){try{R("fs",t),l||R("message",n),o&&R("onSign",e);let g=new te(t),w=await ie({fsp:g,dotgit:i});return await cu({fs:g,cache:p,onSign:e,gitdir:w,message:n,author:s,committer:a,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:d,tree:h})}catch(g){throw g.caller="git.commit",g}}async function bS({fs:t,dir:e,gitdir:r=H(e,".git"),fullname:i=!1,test:n=!1}){try{R("fs",t),R("gitdir",r);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await Is({fs:s,gitdir:a,fullname:i,test:n})}catch(s){throw s.caller="git.currentBranch",s}}async function YN({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await q.exists({fs:t,gitdir:e,ref:r}))throw new Ge(r);let n=await q.expand({fs:t,gitdir:e,ref:r}),s=await Is({fs:t,gitdir:e,fullname:!0});if(n===s){let l=await q.resolve({fs:t,gitdir:e,ref:n});await q.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await q.deleteRef({fs:t,gitdir:e,ref:n});let a=ga(r),o=await ht.get({fs:t,gitdir:e});await o.deleteSection("branch",a),await ht.save({fs:t,gitdir:e,config:o})}async function _S({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await YN({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteBranch",n}}async function yS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});await q.deleteRef({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteRef",n}}async function ZN({fs:t,gitdir:e,remote:r}){let i=await ht.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await ht.save({fs:t,gitdir:e,config:i})}async function xS({fs:t,dir:e,gitdir:r=H(e,".git"),remote:i}){try{R("fs",t),R("remote",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await ZN({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.deleteRemote",n}}async function KN({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await q.deleteRef({fs:t,gitdir:e,ref:r})}async function ES({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await KN({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteTag",n}}async function XN({fs:t,gitdir:e,oid:r}){let i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(s=>`${i}${s}`).filter(s=>s.startsWith(r))}async function QN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=[],a=await t.readdir(H(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await Gg({fs:t,cache:e,filename:l,getExternalRefDelta:n});if(c.error)throw new me(c.error);for(let u of c.offsets.keys())u.startsWith(i)&&s.push(u)}return s}async function JN({fs:t,cache:e,gitdir:r,oid:i}){let n=o=>et({fs:t,cache:e,gitdir:r,oid:o}),s=await XN({fs:t,gitdir:r,oid:i}),a=await QN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n});for(let o of a)s.indexOf(o)===-1&&s.push(o);if(s.length===1)return s[0];throw s.length>1?new Wc("oids",i,s):new Ge(`an object matching "${i}"`)}async function SS({fs:t,dir:e,
Line truncated
|
||||
`)),i.push(lt.encode(`agent=${Ad.agent}
|
||||
`)),(r||e||t)&&i.push(lt.delim()),r&&i.push(lt.encode("peel")),e&&i.push(lt.encode("symrefs")),t&&i.push(lt.encode(`ref-prefix ${t}`)),i.push(lt.flush()),i}async function KS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{R("http",t),R("url",s);let d=await Jo.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(d.protocolVersion===1)return OS(d,c,u,f);let h=await oB({prefix:c,symrefs:u,peelTags:f}),p=await Jo.connect({http:t,auth:d.auth,headers:a,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,body:h});return aB(p.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function XS({fs:t,dir:e,gitdir:r=H(e,".git")}){try{R("fs",t),R("gitdir",r);let i=new te(t),n=await ie({fsp:i,dotgit:r});return q.listTags({fs:i,gitdir:n})}catch(i){throw i.caller="git.listTags",i}}function lB(t,e){return t.committer.timestamp-e.committer.timestamp}var cB="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function NE({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===cB)return;let s=i,a,o=await Xo({fs:t,cache:e,gitdir:r,oid:i}),l=o.tree;return n===o.oid?a=o.path:(a=await QS({fs:t,cache:e,gitdir:r,tree:l,fileId:n,oid:s}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function QS({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:s,filepaths:a=[],parentPath:o=""}){let l=i.entries().map(function(c){let u;return c.oid===n?(u=H(o,c.path),a.push(u)):c.type==="tree"&&(u=et({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:f}){return QS({fs:t,cache:e,gitdir:r,tree:Mr.from(f),fileId:n,oid:s,filepaths:a,parentPath:H(o,c.path)})})),u});return await Promise.all(l),a}async function uB({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:s,since:a,force:o,follow:l}){let c=typeof a=="undefined"?void 0:Math.floor(a.valueOf()/1e3),u=[],f=await ya.read({fs:t,gitdir:r}),d=await q.resolve({fs:t,gitdir:r,ref:n}),h=[await vn({fs:t,cache:e,gitdir:r,oid:d})],p,g,w;function y(b){w&&i&&u.push(b)}for(;h.length>0;){let b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(i){let S;try{S=await uu({fs:t,cache:e,gitdir:r,oid:b.commit.tree,filepath:i}),g&&p!==S&&u.push(g),p=S,g=b,w=!0}catch(C){if(C instanceof Ge){let A=l&&p;if(A&&(A=await NE({fs:t,cache:e,gitdir:r,oid:b.commit.tree,fileId:p}),A))if(Array.isArray(A)){if(g){let k=await NE({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:p});if(Array.isArray(k))if(A=A.filter(v=>k.indexOf(v)===-1),A.length===1)A=A[0],i=A,g&&u.push(g);else{A=!1,g&&u.push(g);break}}}else i=A,g&&u.push(g);if(!A){if(w&&p&&(u.push(g),!o))break;if(!o&&!l)throw C}g=b,w=!1}else throw C}}else u.push(b);if(s!==void 0&&u.length===s){y(b);break}if(!f.has(b.oid))for(let S of b.commit.parent){let C=await vn({fs:t,cache:e,gitdir:r,oid:S});h.map(A=>A.oid).includes(C.oid)||h.push(C)}h.length===0&&y(b),h.sort((S,C)=>lB(S.commit,C.commit))}return u}async function JS({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,ref:n="HEAD",depth:s,since:a,force:o,follow:l,cache:c={}}){try{R("fs",t),R("gitdir",r),R("ref",n);let u=new te(t),f=await ie({fsp:u,dotgit:r});return await uB({fs:u,cache:c,gitdir:f,filepath:i,ref:n,depth:s,since:a,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function ek({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,cache:g={},mergeDriver:w,allowUnrelatedHistories:y=!1}){try{R("fs",t),p&&R("onSign",e);let b=new te(t),S=await ie({fsp:b,dotgit:i}),C=await $s({fs:b,gitdir:S,author:d});if(!C&&(!o||!a))throw new Xt("author");let A=await _a({fs:b,gitdir:S,author:C,committer:h});if(!A&&(!o||!a))throw new Xt("committer");return await AS({fs:b,cache:g,dir:r,gitdir:S,ours:n,theirs:s,fastForward:a,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:C,committer:A,signingKey:p,onSign:e,mergeDriver:w,allowUnrelatedHistories:y})}catch(b){throw b.caller="git.merge",b}}var fB={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function tk({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),oids:n}){let s=new BE,a=[];function o(u,f){let d=E.from(u,f);a.push(d),s.update(d)}async function l({stype:u,object:f}){let d=fB[u],h=f.length,p=h>15?128:0,g=h&15;h=h>>>4;let w=(p|d|g).toString(16);for(o(w,"hex");p;)p=h>127?128:0,w=p|h&127,o(Hg(2,w),"hex"),h=h>>>7;o(E.from(await XE(f)))}o("PACK"),o("00000002","hex"),o(Hg(8,n.length),"hex");for(let u of n){let{type:f,object:d}=await et({fs:t,cache:e,gitdir:i,oid:u});await l({write:o,object:d,stype:f})}let c=s.digest();return a.push(c),a}async function dB({fs:t,cache:e,gitdir:r,oids:i,write:n}){let s=await tk({fs:t,cache:e,gitdir:r,oids:i}),a=E.from(await yd(s)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return n?(await t.write(H(r,`objects/pack/${l}`),a),{filename:l}):{filename:l,pack
Line truncated
|
||||
`),n=await i();let s=r.toString("utf8").split(`
|
||||
`);if(n=s.shift(),!n.startsWith("unpack "))throw new ba('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.slice(7)),e.refs={};for(let a of s){if(a.trim()==="")continue;let o=a.slice(0,2),l=a.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);e.refs[u]={ok:o==="ok",error:f}}return e}async function mB({capabilities:t=[],triplets:e=[]}){let r=[],i=`\0 ${t.join(" ")}`;for(let n of e)r.push(lt.encode(`${n.oldoid} ${n.oid} ${n.fullRef}${i}
|
||||
`)),i="";return r.push(lt.flush()),r}async function gB({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:p=!1,delete:g=!1,corsProxy:w,headers:y={}}){let b=u||await Is({fs:t,gitdir:c});if(typeof b=="undefined")throw new Ir("ref");let S=await ht.get({fs:t,gitdir:c});d=d||await S.get(`branch.${b}.pushRemote`)||await S.get("remote.pushDefault")||await S.get(`branch.${b}.remote`)||"origin";let C=h||await S.get(`remote.${d}.pushurl`)||await S.get(`remote.${d}.url`);if(typeof C=="undefined")throw new Ir("remote OR url");let A=f||await S.get(`branch.${b}.merge`);if(typeof C=="undefined")throw new Ir("remoteRef");w===void 0&&(w=await S.get("http.corsProxy"));let k=await q.expand({fs:t,gitdir:c,ref:b}),v=g?"0000000000000000000000000000000000000000":await q.resolve({fs:t,gitdir:c,ref:k}),x=el.getRemoteHelperFor({url:C}),_=await x.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:w,service:"git-receive-pack",url:C,headers:y,protocolVersion:1}),P=_.auth,T;if(!A)T=k;else try{T=await q.expandAgainstMap({ref:A,map:_.refs})}catch(K){if(K instanceof Ge)T=A.startsWith("refs/")?A:`refs/heads/${A}`;else throw K}let M=_.refs.get(T)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:C,localRef:{ref:g?"(delete)":k,oid:v},remoteRef:{ref:T,oid:M}}))throw new Ko;let $=!_.capabilities.has("no-thin"),D=new Set;if(!g){let K=[..._.refs.values()],G=new Set;if(M!=="0000000000000000000000000000000000000000"){let Me=await Wg({fs:t,cache:e,gitdir:c,oids:[v,M]});for(let Et of Me)K.push(Et);$&&(G=await Tg({fs:t,cache:e,gitdir:c,oids:Me}))}if(!K.includes(v)){let Me=await hB({fs:t,cache:e,gitdir:c,start:[v],finish:K});D=await Tg({fs:t,cache:e,gitdir:c,oids:Me})}if($){try{let Me=await q.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:Et}=await q.resolveAgainstMap({ref:Me.replace(`refs/remotes/${d}/`,""),fullref:Me,map:_.refs}),Ht=[Et];for(let De of await Tg({fs:t,cache:e,gitdir:c,oids:Ht}))G.add(De)}catch(Me){}for(let Me of G)D.delete(Me)}if(v===M&&(p=!0),!p){if(k.startsWith("refs/tags")&&M!=="0000000000000000000000000000000000000000")throw new Zo("tag-exists");if(v!=="0000000000000000000000000000000000000000"&&M!=="0000000000000000000000000000000000000000"&&!await US({fs:t,cache:e,gitdir:c,oid:v,ancestor:M,depth:-1}))throw new Zo("not-fast-forward")}}let Q=pS([..._.capabilities],["report-status","side-band-64k",`agent=${Ad.agent}`]),ye=await mB({capabilities:Q,triplets:[{oldoid:M,oid:v,fullRef:T}]}),de=g?[]:await tk({fs:t,cache:e,gitdir:c,oids:[...D]}),J=await x.connect({http:r,onProgress:i,corsProxy:w,service:"git-receive-pack",url:C,auth:P,headers:y,body:[...ye,...de]}),{packfile:X,progress:he}=await xd.demux(J.body);if(n){let K=mS(he);du(K,async G=>{await n(G)})}let z=await pB(X);if(J.headers&&(z.headers=J.headers),d&&z.ok&&z.refs[T].ok&&!k.startsWith("refs/tags")){let K=`refs/remotes/${d}/${T.replace("refs/heads","")}`;g?await q.deleteRef({fs:t,gitdir:c,ref:K}):await q.writeRef({fs:t,gitdir:c,ref:K,value:v})}if(z.ok&&Object.values(z.refs).every(K=>K.ok))return z;{let K=Object.entries(z.refs).filter(([G,Me])=>!Me.ok).map(([G,Me])=>`
|
||||
- ${G}: ${Me.error}`).join("");throw new Jc(K,z)}}async function nk({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,dir:l,gitdir:c=H(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:p=!1,delete:g=!1,corsProxy:w,headers:y={},cache:b={}}){try{R("fs",t),R("http",e),R("gitdir",c);let S=new te(t),C=await ie({fsp:S,dotgit:c});return await gB({fs:S,cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,gitdir:C,ref:u,remoteRef:f,remote:d,url:h,force:p,delete:g,corsProxy:w,headers:y})}catch(S){throw S.caller="git.push",S}}async function sk({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Xr.from(s).parse().object,sk({fs:t,cache:e,gitdir:r,oid:i});if(n!=="blob")throw new _r(i,n,"blob");return{oid:i,blob:new Uint8Array(s)}}async function ak({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){return n!==void 0&&(i=await uu({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await sk({fs:t,cache:e,gitdir:r,oid:i})}async function ok({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,filepath:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await ak({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readBlob",a}}async function qg({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await vn({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readCommit",s}}async function vB({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){let s=await q.resolve({gitdir:r,fs:t,ref:i}),{blob:a}=await ak({fs:t,cache:e,gitdir:r,oid:s,filepath:n});return a}async function lk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i="refs/notes/commits",oid:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("ref",i),R("oid",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await vB({fs:a,cache:s,gitdir:o,ref:i,oid:n})}catch(a){throw a.caller="git.readNote",a}}async function ck({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,format:n="parsed",filepath:s=void 0,encoding:a=void 0,cache:o={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let l=new te(t),c=await ie({fsp:l,dotgit:r});s!==void 0&&(i=await uu({fs:l,cache:o,gitdir:c,oid:i,filepath:s}));let f=await et({fs:l,cache:o,gitdir:c,oid:i,format:n==="parsed"?"content":n});if(f.oid=i,n==="parsed")switch(f.format="parsed",f.type){case"commit":f.object=Dr.from(f.object).parse();break;case"tree":f.object=Mr.from(f.object).entries();break;case"blob":a?f.object=f.object.toString(a):(f.object=new Uint8Array(f.object),f.format="content");break;case"tag":f.object=Xr.from(f.object).parse();break;default:throw new _r(f.oid,f.type,"blob|commit|tag|tree")}else(f.format==="deflated"||f.format==="wrapped")&&(f.type=f.format);return f}catch(l){throw l.caller="git.readObject",l}}async function wB({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if(n!=="tag")throw new _r(i,n,"tag");let a=Xr.from(s);return{oid:i,tag:a.parse(),payload:a.payload()}}async function uk({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await wB({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readTag",s}}async function fk({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,filepath:n=void 0,cache:s={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await rl({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readTree",a}}async function dk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});await dt.acquire({fs:s,gitdir:a,cache:n},async function(o){o.delete({filepath:i})})}catch(s){throw s.caller="git.remove",s}}async function bB({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l}){let c;try{c=await q.resolve({gitdir:i,fs:t,ref:n})}catch(p){if(!(p instanceof Ge))throw p}let f=(await rl({fs:t,cache:e,gitdir:i,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==s);let d=await fu({fs:t,gitdir:i,tree:f});return await cu({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
|
||||
`,author:a,committer:o,signingKey:l})}async function hk({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l,cache:c={}}){try{R("fs",t),R("gitdir",i),R("oid",s);let u=new te(t),f=await ie({fsp:u,dotgit:i}),d=await $s({fs:u,gitdir:f,author:a});if(!d)throw new Xt("author");let h=await _a({fs:u,gitdir:f,author:d,committer:o});if(!h)throw new Xt("committer");return await bB({fs:u,cache:c,onSign:e,gitdir:f,ref:n,oid:s,author:d,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function _B({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!lu(i,!0))throw new Gi(i,Gc.clean(i));if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let s=`refs/heads/${r}`,a=`refs/heads/${i}`;if(await q.exists({fs:t,gitdir:e,ref:a}))throw new Ui("branch",i,!1);let l=await q.resolve({fs:t,gitdir:e,ref:s,depth:1});await q.writeRef({fs:t,gitdir:e,ref:a,value:l}),await q.deleteRef({fs:t,gitdir:e,ref:s});let u=await Is({fs:t,gitdir:e,fullname:!0})===s;(n||u)&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function pk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,oldref:n,checkout:s=!1}){try{R("fs",t),R("gitdir",r),R("ref",i),R("oldref",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await _B({fs:a,gitdir:o,ref:i,oldref:n,checkout:s})}catch(a){throw a.caller="git.renameBranch",a}}async function mk({gitdir:t,type:e,object:r}){return wn(Cs.wrap({type:e,object:r}))}async function gk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,ref:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let a=new te(t),o=await ie({fsp:a,dotgit:r}),l,c;try{l=await q.resolve({fs:a,gitdir:o,ref:n||"HEAD"})}catch(d){if(n)throw d}if(l)try{l=await uu({fs:a,cache:s,gitdir:o,oid:l,filepath:i})}catch(d){l=null}let u={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},f=e&&await a.read(H(e,i));f&&(c=await mk({gitdir:o,type:"blob",object:f}),l===c&&(u=await a.lstat(H(e,i)))),await dt.acquire({fs:a,gitdir:o,cache:s},async function(d){d.delete({filepath:i}),l&&d.insert({filepath:i,stats:u,oid:l})})}catch(a){throw a.caller="git.reset",a}}async function vk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,depth:n}){try{R("fs",t),R("gitdir",r),R("ref",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await q.resolve({fs:s,gitdir:a,ref:i,depth:n})}catch(s){throw s.caller="git.resolveRef",s}}async function wk({fs:t,dir:e,gitdir:r=H(e,".git"),path:i,value:n,append:s=!1}){try{R("fs",t),R("gitdir",r),R("path",i);let a=new te(t),o=await ie({fsp:a,dotgit:r}),l=await ht.get({fs:a,gitdir:o});s?await l.append(i,n):await l.set(i,n),await ht.save({fs:a,gitdir:o,config:l})}catch(a){throw a.caller="git.setConfig",a}}async function bk({fs:t,gitdir:e,commit:r}){let i=Dr.from(r).toObject();return await Or({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}var Ed=class t{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),i=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${i}`}static createStashReflogEntry(e,r,i){let n=e.name.replace(/\s/g,""),s="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),o=t.timezoneOffsetForRefLogEntry;return`${s} ${r} ${n} ${e.email} ${a} ${o} ${i}
|
||||
`}static getStashReflogEntry(e,r=!1){return e.split(`
|
||||
`).filter(s=>s).reverse().map((s,a)=>r?`stash@{${a}}: ${s.split(" ")[1]}`:s)}},xa=class t{constructor({fs:e,dir:r,gitdir:i=H(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:i,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return H(this.gitdir,t.refStash)}get refLogsStashPath(){return H(this.gitdir,t.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await $s({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Xt("author");return this._author}async getStashSHA(e,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:r,parent:i}){return bk({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:i,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let r=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>r.length-1))throw new Gi(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let i=await this.getStashSHA(e,r);return i?vn({fs:this.fs,cache:{},gitdir:this.gitdir,oid:i}):{}}async writeStashRef(e){return q.writeRef({fs:this.fs,gitdir:this.gitdir,ref:t.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let i=await this.getAuthor(),n=Ed.createStashReflogEntry(i,e,r),s=this.refLogsStashPath;await Qo({filepath:s,entry:n},async()=>{let a=await this.fs.exists(s)?await this.fs.read(s,"utf8"):"";await this.fs.write(s,a+n,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return Ed.getStashReflogEntry(r,e)}};async function _k({fs:t,dir:e,gitdir:r,message:i=""}){let n=new xa({fs:t,dir:e,gitdir:r});await n.getAuthor();let s=await Is({fs:t,gitdir:r,fullname:!1}),a=await q.resolve({fs:t,gitdir:r,ref:"HEAD"}),l=(await qg({fs:t,dir:e,gitdir:r,oid:a})).commit.message,c=[a],u=null,f=Kr({ref:"HEAD"}),d=await RE({fs:t,dir:e,gitdir:r,treePair:[Kr({ref:"HEAD"}),"stage"]});if(d){let w=await n.writeStashCommit({message:`stash-Index: WIP on ${s} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(w),u=d,f=Ea()}let h=await RE({fs:t,dir:e,gitdir:r,treePair:[f,"workdir"]});if(h){let w=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${s} - ${new Date().toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(w),u=h}if(!u||!d&&!h)throw new Ge("changes, nothing to stash");let p=(i.trim()||`WIP on ${s}`)+`: ${a.substring(0,7)} ${l}`;return{stashCommit:await n.writeStashCommit({message:p,tree:u,parent:c}),stashMsg:p,branch:s,stashMgr:n}}async function yB({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n,stashMsg:s,branch:a,stashMgr:o}=await _k({fs:t,dir:e,gitdir:r,message:i});return await o.writeStashRef(n),await o.writeStashReflogEntry({stashCommit:n,message:s}),await Vg({fs:t,dir:e,gitdir:r,ref:a,track:!1,force:!0}),n}async function xB({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n}=await _k({fs:t,dir:e,gitdir:r,message:i});return n}async function yk({fs:t,dir:e,gitdir:r,refIdx:i=0}){let s=await new xa({fs:t,dir:e,gitdir:r}).readStashCommit(i),{parent:a=null}=s.commit?s.commit:{};if(!(!a||!Array.isArray(a)))for(let o=0;o<a.length-1;o++){let c=(await vn({fs:t,cache:{},gitdir:r,oid:a[o+1]})).commit.message.startsWith("stash-Index");await fS({fs:t,dir:e,gitdir:r,stashCommit:a[o+1],parentCommit:a[o],wasStaged:c})}}async function xk({fs:t,dir:e,gitdir:r,refIdx:i=0}){let n=new xa({fs:t,dir:e,gitdir:r});if(!(await n.readStashCommit(i)).commit)return;let a=n.refStashPath;await Qo(a,async()=>{await t.exists(a)&&await t.rm(a)});let o=await n.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(i,1);let l=n.refLogsStashPath;await Qo({reflogEntries:o,stashReflogPath:l,stashMgr:n},async()=>{if(o.length){await t.write(l,o.reverse().join(`
|
||||
`)+`
|
||||
`,"utf8");let c=o[o.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(l)})}async function EB({fs:t,dir:e,gitdir:r}){return new xa({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function SB({fs:t,dir:e,gitdir:r}){let i=new xa({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await Qo(n,async()=>{await Promise.all(n.map(async s=>{if(await t.exists(s))return t.rm(s)}))})}async function kB({fs:t,dir:e,gitdir:r,refIdx:i=0}){await yk({fs:t,dir:e,gitdir:r,refIdx:i}),await xk({fs:t,dir:e,gitdir:r,refIdx:i})}async function Ek({fs:t,dir:e,gitdir:r=H(e,".git"),op:i="push",message:n="",refIdx:s=0}){R("fs",t),R("dir",e),R("gitdir",r),R("op",i);let a={push:yB,apply:yk,drop:xk,list:EB,clear:SB,pop:kB,create:xB},o=["apply","drop","pop"];try{let l=new te(t),c=await ie({fsp:l,dotgit:r});["refs","logs","logs/refs"].map(d=>H(c,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});let f=a[i];if(f){if(o.includes(i)&&s<0)throw new Gi(`stash@${s}`,"number that is in range of [0, num of stash pushed]");return await f({fs:l,dir:e,gitdir:c,message:n,refIdx:s})}throw new Error(`To be implemented: ${i}`)}catch(l){throw l.caller="git.stash",l}}async function Sk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});if(await Rs.isIgnored({fs:s,gitdir:a,dir:e,filepath:i}))return"ignored";let l=await AB({fs:s,cache:n,gitdir:a}),c=await kk({fs:s,cache:n,gitdir:a,tree:l,path:i}),u=await dt.acquire({fs:s,gitdir:a,cache:n},async function(w){for(let y of w)if(y.path===i)return y;return null}),f=await s.lstat(H(e,i)),d=c!==null,h=u!==null,p=f!==null,g=async()=>{if(h&&!pd(u,f))return u.oid;{let w=await s.read(H(e,i)),y=await mk({gitdir:a,type:"blob",object:w});return h&&u.oid===y&&f.size!==-1&&dt.acquire({fs:s,gitdir:a,cache:n},async function(b){b.insert({filepath:i,stats:f,oid:y})}),y}};if(!d&&!p&&!h)return"absent";if(!d&&!p&&h)return"*absent";if(!d&&p&&!h)return"*added";if(!d&&p&&h)return await g()===u.oid?"added":"*added";if(d&&!p&&!h)return"deleted";if(d&&!p&&h)return c===u.oid,"*deleted";if(d&&p&&!h)return await g()===c?"*undeleted":"*undeletemodified";if(d&&p&&h){let w=await g();return w===c?w===u.oid?"unmodified":"*unmodified":w===u.oid?"modified":"*modified"}}catch(s){throw s.caller="git.status",s}}async function kk({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let s=n.shift();for(let a of i)if(a.path===s){if(n.length===0)return a.oid;let{type:o,object:l}=await et({fs:t,cache:e,gitdir:r,oid:a.oid});if(o==="tree"){let c=Mr.from(l);return kk({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(o==="blob")throw new _r(a.oid,o,"blob",n.join("/"))}return null}async function AB({fs:t,cache:e,gitdir:r}){let i;try{i=await q.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(s){if(s instanceof Ge)return[]}let{tree:n}=await rl({fs:t,cache:e,gitdir:r,oid:i});return n}async function Ak({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:s,cache:a={},ignored:o=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let l=new te(t),c=await ie({fsp:l,dotgit:r});return await Ps({fs:l,cache:a,dir:e,gitdir:c,trees:[Kr({ref:i}),tl(),Ea()],map:async function(u,[f,d,h]){if(!f&&!h&&d&&!o&&await Rs.isIgnored({fs:l,dir:e,filepath:u})||!n.some(v=>cS(u,v)))return null;if(s&&!s(u))return;let[p,g,w]=await Promise.all([f&&f.type(),d&&d.type(),h&&h.type()]),y=[p,g,w].includes("blob");if((p==="tree"||p==="special")&&!y)return;if(p==="commit")return null;if((g==="tree"||g==="special")&&!y)return;if(w==="commit")return null;if((w==="tree"||w==="special")&&!y)return;let b=p==="blob"?await f.oid():void 0,S=w==="blob"?await h.oid():void 0,C;p!=="blob"&&g==="blob"&&w!=="blob"?C="42":g==="blob"&&(C=await d.oid());let A=[void 0,b,C,S],k=A.map(v=>A.indexOf(v));return k.shift(),[u,...k]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function Ck({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,object:n,force:s=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let a=new te(t);if(i===void 0)throw new Ir("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let o=await ie({fsp:a,dotgit:r}),l=await q.resolve({fs:a,gitdir:o,ref:n||"HEAD"});if(!s&&await q.exists({fs:a,gitdir:o,ref:i}))throw new Ui("tag",i);await q.writeRef({fs:a,gitdir:o,ref:i,value:l})}catch(a){throw a.caller="git.tag",a}}async function Tk({fs:t,dir:e,gitdir:r=H(e,".git"),cache:i={},filepath:n,oid:s,mode:a,add:o,remove:l,force:c}){try{R("fs",t),R("gitdir",r),R("filepath",n);let u=new te(t),f=await ie({fsp:u,dotgit:r});if(l)return await dt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!c){let p=await u.lstat(H(e,n));if(p){if(p.isDirectory())throw new Ts("directory");return}}h.has({filepath:n})&&h.delete({filepath:n})});let d;if(!s){if(d=await u.lstat(H(e,n)),!d)throw new Ge(`file at "${n}" on disk and "remove" not set`);if(d.isDirectory())throw new Ts("directory")}return await dt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!o&&!h.has({filepath:n}))throw new Ge
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NB(t,e){if(t){if(typeof t=="string")return Zk(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Zk(t,e)}}function Zk(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);r<e;r++)i[r]=t[r];return i}function BB(t,e){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var r=[],i=!0,n=!1,s=void 0;try{for(var a=t[Symbol.iterator](),o;!(i=(o=a.next()).done)&&(r.push(o.value),!(e&&r.length===e));i=!0);}catch(l){n=!0,s=l}finally{try{!i&&a.return!=null&&a.return()}finally{if(n)throw s}}return r}}function HB(t){if(Array.isArray(t))return t}var Xk=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?$/,Qk=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?$/,Jk=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,eA=/^rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,tA=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,rA=/^rgba?\(\s*(\d+%)\s+(\d+%)\s+(\d+%)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,iA=/^hsla?\(\s*(\d+)(deg|rad|grad|turn)?\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/;function mu(t,e){return t.indexOf(e)>-1}function UB(t,e,r){var i=t/255,n=e/255,s=r/255,a=Math.max(i,n,s),o=Math.min(i,n,s),l=a-o,c=(a+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=(function(){switch(a){case i:return(n-s)/l%6;case n:return(s-i)/l+2;default:return(i-n)/l+4}})();return[f*60,u*100,c*100]}function GB(t,e,r){var i=t/60,n=e/100,s=r/100,a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(i%2-1)),l=s-a/2,c=(function(){return i<1?[a,o,0]:i<2?[o,a,0]:i<3?[0,a,o]:i<4?[0,o,a]:i<5?[o,0,a]:[a,0,o]})(),u=yr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var jB=(function(){function t(e){var r=yr(e,4),i=r[0],n=r[1],s=r[2],a=r[3];DB(this,t),this.values=[Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(n,10),255),0),Math.max(Math.min(parseInt(s,10),255),0),a==null?1:Math.max(Math.min(parseFloat(a),255),0)]}return OB(t,[{key:"toRgbString",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return a===1?"rgb(".concat(i,", ").concat(n,", ").concat(s,")"):"rgba(".concat(i,", ").concat(n,", ").concat(s,", ").concat(a,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),i=yr(r,4),n=i[0],s=i[1],a=i[2],o=i[3];return o===1?"hsl(".concat(n,", ").concat(s,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(s,"%, ").concat(a,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return i=Number(i).toString(16).padStart(2,"0"),n=Number(n).toString(16).padStart(2,"0"),s=Number(s).toString(16).padStart(2,"0"),a=a<1?parseInt(a*255,10).toString(16).padStart(2,"0"):"","#".concat(i).concat(n).concat(s).concat(a)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3],o=UB(i,n,s),l=yr(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,a]}}]),t})();function sl(t){var e=yr(t,4),r=e[0],i=e[1],n=e[2],s=e[3];return new jB([r,i,n,s])}function rv(t){var e=yr(t,3),r=e[0],i=e[1],n=e[2];return sl([r,i,n,1])}function Id(t){var e=yr(t,4),r=e[0],i=e[1],n=e[2],s=e[3],a=GB(r,i,n),o=yr(a,3),l=o[0],c=o[1],u=o[2];return sl([l,c,u,s])}function nA(t){var e=yr(t,3),r=e[0],i=e[1],n=e[2];return Id([r,i,n,1])}function VB(t){var e=Xk.exec(t)||Qk.exec(t),r=yr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=parseInt(i.length<2?i.repeat(2):i,16),n=parseInt(n.length<2?n.repeat(2):n,16),s=parseInt(s.length<2?s.repeat(2):s,16),a=a&&(parseInt(a.length<2?a.repeat(2):a,16)/255).toPrecision(1)||1,sl([i,n,s,a])}function zB(t){var e=Jk.exec(t)||tA.exec(t)||eA.exec(t)||rA.exec(t),r=yr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=mu(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),n=mu(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),s=mu(s,"%")>0?parseInt(s,10)*255/100:parseInt(s,10),a=a===void 0?1:parseFloat(a)/(mu(a,"%")?100:1),sl([i,n,s,a])}function WB(t){var e=iA.exec(t),r=yr(e,6),i=r[1],n=r[2],s=r[3],a=r[4],o=r[5];return n=n||"deg",i=(0,MB.default)(parseFloat(i),n,"deg"),s=parseFloat(s),a=parseFloat(a),o=o===void 0?1:parseFloat(o)/(mu(o,"%")?100:1),Id([i,s,a,o])}function sA(t){return qk.default[t]?rv(qk.default[t]):Xk.test(t)||Qk.test(t)?VB(t):Jk.test(t)||tA.test(t)||eA.test(t)||rA.test(t)?zB(t):iA.test(t)?WB(t):null}var qB={fromString:sA,fromRgb:rv,fromRgba:sl,fromHsl:nA,fromHsla:Id};Wn.default=qB});var wA=U((n9,vA)=>{m();vA.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=n+1,l=[],c=[],u,f,d=function(){n>=s&&(u=r,f=n,r=i,i=u,n=s,s=f,a=!0,o=n+1)},h=function(g,w,y,b,S){return{startX:g,startY:w,endX:y,endY:b,r:S}},p=function(g,w,y){var b,S,C,A,k;for(w>y?b=l[g-1+o]:b=l[g+1+o],k=C=Math
Line truncated
|
||||
`});X=!1,z=J.length}function De(Rt,$t){var Xe="="+G,re=Rt.indexOf(Xe,$t),B=c(Rt.substring(Rt.indexOf("=",$t)+1,re)).split(" ");return K=B[0],G=B[B.length-1],re+Xe.length-1}for(_&&(_=_.split(" "),K=_[0],G=_[1]),he=0;he<P;he++)D==T?u(K,x,he)?(--he,Me(),D=M):x.charAt(he)==`
|
||||
`?Ht(X):de+=x.charAt(he):D==M?(he+=K.length-1,ye=t.tags[x.charAt(he+1)],Q=ye?x.charAt(he+1):"_v",Q=="="?(he=De(x,he),D=T):(ye&&he++,D=$),X=he):u(G,x,he)?(J.push({tag:Q,n:c(de),otag:K,ctag:G,i:Q=="/"?X-K.length:he+G.length}),de="",he+=G.length-1,D=T,Q=="{"&&(G=="}}"?he++:l(J[J.length-1]))):de+=x.charAt(he);return Ht(X,!0),J};function l(v){v.n.substr(v.n.length-1)==="}"&&(v.n=v.n.substring(0,v.n.length-1))}function c(v){return v.trim?v.trim():v.replace(/^\s*|\s*$/g,"")}function u(v,x,_){if(x.charAt(_)!=v.charAt(0))return!1;for(var P=1,T=v.length;P<T;P++)if(x.charAt(_+P)!=v.charAt(P))return!1;return!0}var f={_t:!0,"\n":!0,$:!0,"/":!0};function d(v,x,_,P){var T=[],M=null,$=null,D=null;for($=_[_.length-1];v.length>0;){if(D=v.shift(),$&&$.tag=="<"&&!(D.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[D.tag]<=t.tags.$||h(D,P))_.push(D),D.nodes=d(v,D.tag,_,P);else if(D.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+D.n);if(M=_.pop(),D.n!=M.n&&!p(D.n,M.n,P))throw new Error("Nesting error: "+M.n+" vs. "+D.n);return M.end=D.i,T}else D.tag==`
|
||||
`&&(D.last=v.length==0||v[0].tag==`
|
||||
`);T.push(D)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return T}function h(v,x){for(var _=0,P=x.length;_<P;_++)if(x[_].o==v.n)return v.tag="#",!0}function p(v,x,_){for(var P=0,T=_.length;P<T;P++)if(_[P].c==v&&_[P].o==x)return!0}function g(v){var x=[];for(var _ in v)x.push('"'+b(_)+'": function(c,p,t,i) {'+v[_]+"}");return"{ "+x.join(",")+" }"}function w(v){var x=[];for(var _ in v.partials)x.push('"'+b(_)+'":{name:"'+b(v.partials[_].name)+'", '+w(v.partials[_])+"}");return"partials: {"+x.join(",")+"}, subs: "+g(v.subs)}t.stringify=function(v,x,_){return"{code: function (c,p,i) { "+t.wrapMain(v.code)+" },"+w(v)+"}"};var y=0;t.generate=function(v,x,_){y=0;var P={code:"",subs:{},partials:{}};return t.walk(v,P),_.asString?this.stringify(P,x,_):this.makeTemplate(P,x,_)},t.wrapMain=function(v){return'var t=this;t.b(i=i||"");'+v+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(v,x,_){var P=this.makePartials(v);return P.code=new Function("c","p","i",this.wrapMain(v.code)),new this.template(P,x,this,_)},t.makePartials=function(v){var x,_={subs:{},partials:v.partials,name:v.name};for(x in _.partials)_.partials[x]=this.makePartials(_.partials[x]);for(x in v.subs)_.subs[x]=new Function("c","p","t","i",v.subs[x]);return _};function b(v){return v.replace(s,"\\\\").replace(r,'\\"').replace(i,"\\n").replace(n,"\\r").replace(a,"\\u2028").replace(o,"\\u2029")}function S(v){return~v.indexOf(".")?"d":"f"}function C(v,x){var _="<"+(x.prefix||""),P=_+v.n+y++;return x.partials[P]={name:v.n,partials:{}},x.code+='t.b(t.rp("'+b(P)+'",c,p,"'+(v.indent||"")+'"));',P}t.codegen={"#":function(v,x){x.code+="if(t.s(t."+S(v.n)+'("'+b(v.n)+'",c,p,1),c,p,0,'+v.i+","+v.end+',"'+v.otag+" "+v.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(v.nodes,x),x.code+="});c.pop();}"},"^":function(v,x){x.code+="if(!t.s(t."+S(v.n)+'("'+b(v.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(v.nodes,x),x.code+="};"},">":C,"<":function(v,x){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(v.nodes,_);var P=x.partials[C(v,x)];P.subs=_.subs,P.partials=_.partials},$:function(v,x){var _={subs:{},code:"",partials:x.partials,prefix:v.n};t.walk(v.nodes,_),x.subs[v.n]=_.code,x.inPartial||(x.code+='t.sub("'+b(v.n)+'",c,p,i);')},"\n":function(v,x){x.code+=k('"\\n"'+(v.last?"":" + i"))},_v:function(v,x){x.code+="t.b(t.v(t."+S(v.n)+'("'+b(v.n)+'",c,p,0)));'},_t:function(v,x){x.code+=k('"'+b(v.text)+'"')},"{":A,"&":A};function A(v,x){x.code+="t.b(t.t(t."+S(v.n)+'("'+b(v.n)+'",c,p,0)));'}function k(v){return"t.b("+v+");"}t.walk=function(v,x){for(var _,P=0,T=v.length;P<T;P++)_=t.codegen[v[P].tag],_&&_(v[P],x);return x},t.parse=function(v,x,_){return _=_||{},d(v,"",[],_.sectionTags||[])},t.cache={},t.cacheKey=function(v,x){return[v,!!x.asString,!!x.disableLambda,x.delimiters,!!x.modelGet].join("||")},t.compile=function(v,x){x=x||{};var _=t.cacheKey(v,x),P=this.cache[_];if(P){var T=P.partials;for(var M in T)delete T[M].instance;return P}return P=this.generate(this.parse(this.scan(v,x.delimiters),v,x),v,x),this.cache[_]=P}})(typeof jw!="undefined"?jw:Hogan)});var iR=U(Vw=>{m();var c4={};(function(t){t.Template=function(d,h,p,g){d=d||{},this.r=d.code||this.r,this.c=p,this.options=g||{},this.text=h||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},t.Template.prototype={r:function(d,h,p){return""},v:u,t:c,render:function(h,p,g){return this.ri([h],p||{},g)},ri:function(d,h,p){return this.r(d,h,p)},ep:function(d,h){var p=this.partials[d],g=h[p.name];if(p.instance&&p.base==g)return p.instance;if(typeof g=="string"){if(!this.c)throw new Error("No compiler available.");g=this.c.compile(g,this.options)}if(!g)return null;if(this.partials[d].base=g,p.subs){h.stackText||(h.stackText={});for(key in p.subs)h.stackText[key]||(h.stackText[key]=this.activeSub!==void 0&&h.stackText[this.activeSub]?h.stackText[this.activeSub]:this.text);g=r(g,p.subs,p.partials,this.stackSubs,this.stackPartials,h.stackText)}return this.partials[d].instance=g,g},rp:function(d,h,p,g){var w=this.ep(d,p);return w?w.ri(h,p,g):""},rs:function(d,h,p){var g=d[d.length-1];if(!f(g)){p(d,h,this);return}for(var w=0;w<g.length;w++)d.push(g[w]),p(d,h,this),d.pop()},s:function(d,h,p,g,w,y,b){var S;return f(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,h,p,g,w,y,b)),S=!!d,!g&&S&&h&&h.push(typeof d=="object"?d:h[h.length-1]),S)},d:function(d,h,p,g){var w,y=d.split("."),b=this.f(y[0],h,p,g),S=this.options.modelGet,C=null;if(d==="."&&f(h[h.length-2]))b=h[h.length-1];else for(var A=1;A<y.length;A++)w=e(y[A],b,S),w!==void 0?(C=b,b=w):b="";return g&&!b?!1:(!g&&typeof b=="function"&&(h.push(C),b=this.mv(b,h,p),h.pop()),b)},f:function(d,h,p,g){for(var w=!1,y=null,b=!1,S=this.options.modelGet,C=h.length-1;C>=0;C--)if(y=h[C],w=e(d,y,S),w!==void 0){b=!0;break}return b?(!g&&typeof w=="function"&&(w=this.mv(w,h,p)),w):g?!1:""},ls:function(d,h,p,g,w,y){var b=this.options.delimiters;return this.options.delimiters=y,this.b(this.ct(c(d.call(h,w,p)),h,g)),this.options.delimiters=b,!1},ct:functio
Line truncated
|
||||
|
||||
PROMPT="$1"
|
||||
TEMP_FILE="$OBSIDIAN_GIT_CREDENTIALS_INPUT"
|
||||
|
||||
cleanup() {
|
||||
rm -f "$TEMP_FILE" "$TEMP_FILE.response"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "$PROMPT" > "$TEMP_FILE"
|
||||
|
||||
while [ ! -e "$TEMP_FILE.response" ]; do
|
||||
if [ ! -e "$TEMP_FILE" ]; then
|
||||
echo "Trigger file got removed: Abort" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
RESPONSE=$(cat "$TEMP_FILE.response")
|
||||
|
||||
echo "$RESPONSE"
|
||||
`,Bk=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];m();m();m();var hu=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],r,e,0,i);if(h[0].oldPos+1>=l&&p+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,w=1/0,y=()=>{for(let b=Math.max(g,-c);b<=Math.min(w,c);b+=2){let S,C=h[b-1],A=h[b+1];C&&(h[b-1]=void 0);let k=!1;if(A){let x=A.oldPos-b;k=A&&0<=x&&x<o}let v=C&&C.oldPos+1<l;if(!k&&!v){h[b]=void 0;continue}if(!v||k&&C.oldPos<A.oldPos?S=this.addToPath(A,!0,!1,0,i):S=this.addToPath(C,!1,!0,1,i),p=this.extractCommon(S,r,e,b,i),S.oldPos+1>=l&&p+1>=o)return a(this.buildValues(S.lastComponent,r,e))||!0;h[b]=S,S.oldPos+1>=l&&(w=Math.min(w,b-1)),p+1>=o&&(g=Math.max(g,b+1))}c++};if(n)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return n(void 0);y()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=y();if(b)return b}}addToPath(e,r,i,n,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:a.count+1,added:r,removed:i,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:r,removed:i,previousComponent:a}}}extractCommon(e,r,i,n,s){let a=r.length,o=i.length,l=e.oldPos,c=l-n,u=0;for(;c+1<a&&l+1<o&&this.equals(i[l+1],r[c+1],s);)c++,l++,u++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,c}equals(e,r,i){return i.comparator?i.comparator(e,r):e===r||!!i.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){let r=[];for(let i=0;i<e.length;i++)e[i]&&r.push(e[i]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,i){let n=[],s;for(;e;)n.push(e),s=e.previousComponent,delete e.previousComponent,e=s;n.reverse();let a=n.length,o=0,l=0,c=0;for(;o<a;o++){let u=n[o];if(u.removed)u.value=this.join(i.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let f=r.slice(l,l+u.count);f=f.map(function(d,h){let p=i[c+h];return p.length>d.length?p:d}),u.value=this.join(f)}else u.value=this.join(r.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return n}};m();var Xg=class extends hu{constructor(){super(...arguments),this.tokenize=RB}equals(e,r,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(`
|
||||
`))&&(e=e.trim()),(!i.newlineIsToken||!r.includes(`
|
||||
`))&&(r=r.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(`
|
||||
`)&&(e=e.slice(0,-1)),r.endsWith(`
|
||||
`)&&(r=r.slice(0,-1))),super.equals(e,r,i)}},PB=new Xg;function Qg(t,e,r){return PB.diff(t,e,r)}function RB(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
|
||||
`));let r=[],i=t.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let n=0;n<i.length;n++){let s=i[n];n%2&&!e.newlineIsToken?r[r.length-1]+=s:r.push(s)}return r}m();function $B(t){for(let e=0;e<t.length;e++)if(t[e]<" "||t[e]>"~"||t[e]==='"'||t[e]==="\\")return!0;return!1}function Os(t){if(!$B(t))return t;let e='"',r=new TextEncoder().encode(t),i=0;for(;i<r.length;){let n=r[i];n===7?e+="\\a":n===8?e+="\\b":n===9?e+="\\t":n===10?e+="\\n":n===11?e+="\\v":n===12?e+="\\f":n===13?e+="\\r":n===34?e+='\\"':n===92?e+="\\\\":n>=32&&n<=126?e+=String.fromCharCode(n):e+="\\"+n.toString(8).padStart(3,"0"),i++}return e+='"',e}var Jg={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function ev(t,e,r,i,n,s,a){let o;a?typeof a=="function"?o={callback:a}:o=a:o={},typeof o.context=="undefined"&&(o.context=4);let l=o.context;if(o.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(o.callback){let{callback:u}=o;Qg(r,i,Object.assign(Object.assign({},o),{callback:f=>{let d=c(f);u(d)}}))}else return c(Qg(r,i,o));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(b){return b.map(function(S){return" "+S})}let d=[],h=0,p=0,g=[],w=1,y=1;for(let b=0;b<u.length;b++){let S=u[b],C=S.lines||FB(S.value);if(S.lines=C,S.added||S.removed){if(!h){let A=u[b-1];h=w,p=y,A&&(g=l>0?f(A.lines.slice(-l)):[],h-=g.length,p-=g.length)}for(let A of C)g.push((S.added?"+":"-")+A);S.added?y+=C.length:w+=C.length}else{if(h)if(C.length<=l*2&&b<u.length-2)for(let A of f(C))g.push(A);else{let A=Math.min(C.length,l);for(let v of f(C.slice(0,A)))g.push(v);let k={oldStart:h,oldLines:w-h+A,newStart:p,newLines:y-p+A,lines:g};d.push(k),h=0,p=0,g=[]}w+=C.length,y+=C.length}}for(let b of d)for(let S=0;S<b.lines.length;S++)b.lines[S].endsWith(`
|
||||
`)?b.lines[S]=b.lines[S].slice(0,-1):(b.lines.splice(S+1,0,"\\ No newline at end of file"),S++);return{oldFileName:t,newFileName:e,oldHeader:n,newHeader:s,hunks:d}}}function Fd(t,e){var r,i,n,s,a,o;if(e||(e=Jg),Array.isArray(t)){if(t.length>1&&!e.includeFileHeaders&&!t.every(u=>u.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(u=>Fd(u,e)).join(`
|
||||
`)}let l=[];if(t.isGit){if(e=Jg,!t.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!t.newFileName)throw new Error("newFileName must be specified for Git patches");let u=t.oldFileName,f=t.newFileName;t.isCreate&&u==="/dev/null"?u=f.replace(/^b\//,"a/"):t.isDelete&&f==="/dev/null"&&(f=u.replace(/^a\//,"b/")),l.push("diff --git "+Os(u)+" "+Os(f)),t.isDelete&&l.push("deleted file mode "+((r=t.oldMode)!==null&&r!==void 0?r:"100644")),t.isCreate&&l.push("new file mode "+((i=t.newMode)!==null&&i!==void 0?i:"100644")),t.oldMode&&t.newMode&&!t.isDelete&&!t.isCreate&&(l.push("old mode "+t.oldMode),l.push("new mode "+t.newMode)),t.isRename&&(l.push("rename from "+Os(((n=t.oldFileName)!==null&&n!==void 0?n:"").replace(/^a\//,""))),l.push("rename to "+Os(((s=t.newFileName)!==null&&s!==void 0?s:"").replace(/^b\//,"")))),t.isCopy&&(l.push("copy from "+Os(((a=t.oldFileName)!==null&&a!==void 0?a:"").replace(/^a\//,""))),l.push("copy to "+Os(((o=t.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,""))))}else e.includeIndex&&t.oldFileName==t.newFileName&&t.oldFileName!==void 0&&l.push("Index: "+t.oldFileName),e.includeUnderline&&l.push("===================================================================");let c=t.hunks.length>0;e.includeFileHeaders&&t.oldFileName!==void 0&&t.newFileName!==void 0&&(!t.isGit||c)&&(l.push("--- "+Os(t.oldFileName)+(t.oldHeader?" "+t.oldHeader:"")),l.push("+++ "+Os(t.newFileName)+(t.newHeader?" "+t.newHeader:"")));for(let u=0;u<t.hunks.length;u++){let f=t.hunks[u],d=f.oldLines===0?f.oldStart-1:f.oldStart,h=f.newLines===0?f.newStart-1:f.newStart;l.push("@@ -"+d+","+f.oldLines+" +"+h+","+f.newLines+" @@");for(let p of f.lines)l.push(p)}return l.join(`
|
||||
`)+`
|
||||
`}function Hk(t,e,r,i,n,s,a){if(typeof a=="function"&&(a={callback:a}),a!=null&&a.callback){let{callback:o}=a;ev(t,e,r,i,n,s,Object.assign(Object.assign({},a),{callback:l=>{o(l?Fd(l,a.headerOptions):void 0)}}))}else{let o=ev(t,e,r,i,n,s,a);return o?Fd(o,a==null?void 0:a.headerOptions):void 0}}function pu(t,e,r,i,n,s){return Hk(t,t,e,r,i,n,s)}function FB(t){let e=t.endsWith(`
|
||||
`),r=t.split(`
|
||||
`).map(i=>i+`
|
||||
`);return e?r.pop():r.push(r.pop().slice(0,-1)),r}var se=Gt(Yg(),1),ka=require("obsidian");m();function Uk(t,e){let r=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:r})}var nl=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};m();var Gk=require("obsidian"),IB={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},tt=class extends Gk.SuggestModal{constructor(e,r){if(super(e.app),this.config={...IB,...r},this.setPlaceholder(this.config.placeholder),this.config.obscure){this.inputEl.type="password";let i=this.containerEl.querySelector(".prompt-input-container");i.addClass("git-obscure-prompt"),i.setAttr("git-is-obscured","true");let n=i==null?void 0:i.createDiv({cls:"search-input-clear-button"});n.style.marginRight="32px",n.id="git-show-password",n.addEventListener("click",()=>{i.getAttr("git-is-obscured")==="true"?(this.inputEl.type="text",i.setAttr("git-is-obscured","false")):(this.inputEl.type="password",i.setAttr("git-is-obscured","true"))})}}openAndGetResult(){return new Promise(e=>{this.resolve=e,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(e=>window.setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,r){this.config.obscure?r.hide():r.setText(e)}onChooseSuggestion(e,r){if(this.resolve){let i;this.config.allowEmpty&&e===" "?i="":e==="..."?i=void 0:i=e,this.resolve(i)}}};m();var oA=Gt(aA(),1),lA=require("child_process"),qn=require("obsidian");function Md(t){throw new Error(`Unexpected object: ${t}`)}function gu(t,e,r){return t===1?`${t} ${e}`:`${t} ${r!=null?r:e+"s"}`}var iv=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function ji(t,e){let r;if(e){if(e.button===0||e.button===1){let i=qn.Keymap.isModEvent(e);r=t.workspace.getLeaf(i)}}else r=t.workspace.getLeaf(!1);return r}function bn(t,e,r,i,n){if(e.button==2){let s=t.vault.getAbstractFileByPath(r);if(s!=null){let a=new qn.Menu;t.workspace.trigger("file-menu",a,s,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}else{let a=new qn.Menu;t.workspace.trigger("obsidian-git:menu",a,r,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}}}function Ls(t){throw new Error("Impossible branch: "+t)}function nv(t){return`rgb(${t.r},${t.g},${t.b})`}function cA(t){var s;let e=(s=oA.fromString(t))==null?void 0:s.toRgbaArray();if(e===void 0)return;let[r,i,n]=e;return{r,g:i,b:n}}function uA(t){return t.diff(qn.moment.unix(0),"seconds")}function fA(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function vu(t,e){return new Proxy(t,{get(r,i){return i==="length"?Math.min(e,r.length):r[i]}})}function dA(t,e,r){return t.length<=e?new Array(e-t.length).fill(r).join("")+t:t.substring(t.length-e)}function hA(t,e){if(e<=0)return t;let r=new Array(e).fill(" ").join(""),i=t.substring(e,t.length);return r+i}function sv(t,e,r){return t<=e&&e<=r}function Yn(t){let[e,...r]=t.split("/");return[e,r.length===0?void 0:r.join("/")]}function _n(t){return t.endsWith("/")?t:t.split("/").last().replace(/\.md$/,"")}function pA(t){return t===1?"1 minute":`${t} minutes`}function YB(t){let e=t.lastIndexOf(".");return t.substring(e+1)}function al(t){if(t.endsWith(".md"))return!1;let e=YB(t);return Bk.includes(e)}function av(t){return(t.startsWith("https://github.com/")||t.startsWith("https://gitlab.com/"))&&(t.endsWith(".git")||(t=t+".git")),t}function ol(t,e){let r=e.vault.getAbstractFileByPath(t);if(!(r instanceof qn.TFile))return!1;try{return!!e.viewRegistry.getTypeByExtension(r.extension)}catch(i){return!0}}function mA({isFolder:t,gitRelativePath:e}){let r="/";return r+=e,t&&(r+="/"),r.replace(/([\\!#*?[\]])/g,String.raw`\$1`).replace(/\s(?=\s*$)/g,String.raw`\ `)}function ll(t,e,r,i){let n=e.target;t.workspace.trigger("hover-link",{event:e,source:r.getViewType(),hoverParent:r,targetEl:n,linktext:i})}function wu(t,e,r={}){return new Promise((i,n)=>{let s=(0,lA.spawn)(t,e,r),a="",o="";s.stdout.on("data",l=>{a+=l.toString()}),s.stderr.on("data",l=>{o+=l.toString()}),s.on("error",l=>{i({error:new Error(l.message),stdout:a,stderr:a,code:1})}),s.on("close",l=>{i({stdout:a,stderr:o,code:l!=null?l:1,error:void 0})})})}m();var gA=require("os"),Dd=require("obsidian"),cl=class{constructor(e){this.plugin=e,this.app=e.app}getRelativeVaultPath(e){return this.plugin.settings.basePath?this.plugin.settings.basePath+"/"+e:e}getRelativeRepoPath(e,r=!0){return r&&this.plugin.settings.basePath.length>0?e.substring(this.plugin.settings.basePath.length+1):e}unload(){}_getTreeStructure(e,r=0){let i=[];for(e=[...e];e.length>0;){let n=e.first(),s=n.path.substring(r);if(s.contains("/")){let a=s.substring(0,s.indexOf("/"))
Line truncated
|
||||
`):n="Too many files to list",e=e+`
|
||||
|
||||
Affected files:
|
||||
`+n}return e}};m();var Ns=require("obsidian"),Od=class{constructor(e,r){this.plugin=r;this.promises={};this.adapter=e.adapter,this.vault=e,this.lastBasePath=this.plugin.settings.basePath,this.promises.readFile=this.readFile.bind(this),this.promises.writeFile=this.writeFile.bind(this),this.promises.readdir=this.readdir.bind(this),this.promises.mkdir=this.mkdir.bind(this),this.promises.rmdir=this.rmdir.bind(this),this.promises.stat=this.stat.bind(this),this.promises.unlink=this.unlink.bind(this),this.promises.lstat=this.lstat.bind(this),this.promises.readlink=this.readlink.bind(this),this.promises.symlink=this.symlink.bind(this)}async readFile(e,r){var i;if(this.maybeLog("Read: "+e+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?(this.maybeLog("Reuse"),this.vault.read(n)):this.adapter.read(e)}else{if(e.endsWith(this.gitDir+"/index"))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(e)):(i=this.index)!=null?i:this.adapter.readBinary(e);let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(n)):this.adapter.readBinary(e)}}async writeFile(e,r){if(this.maybeLog("Write: "+e),typeof r=="string"){let i=this.vault.getAbstractFileByPath(e);return i instanceof Ns.TFile?this.vault.modify(i,r):this.adapter.write(e,r)}else{let i=ZB(r);if(e.endsWith(this.gitDir+"/index"))this.index=i,this.indexmtime=Date.now();else{let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?this.vault.modifyBinary(n,i):this.adapter.writeBinary(e,i)}}}async readdir(e){e==="."&&(e="/");let r=await this.adapter.list(e),i=[...r.files,...r.folders],n;return e!=="/"?n=i.map(s=>(0,Ns.normalizePath)(s.substring(e.length))):n=i,n}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,r){var i,n;return this.adapter.rmdir(e,(n=(i=r==null?void 0:r.options)==null?void 0:i.recursive)!=null?n:!1)}async stat(e){if(e.endsWith(this.gitDir+"/index")){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:this.index.byteLength,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let i=await this.adapter.stat(e);if(i==null)throw{code:"ENOENT"};return this.indexctime=i.ctime,this.indexmtime=i.mtime,{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let r=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),r instanceof Ns.TFile)return this.maybeLog("Reuse stat"),{ctimeMs:r.stat.ctime,mtimeMs:r.stat.mtime,size:r.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let i=await this.adapter.stat(e);if(i)return{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:i.type==="folder"?"directory":i.type,isFile:()=>i.type==="file",isDirectory:()=>i.type==="folder",isSymbolicLink:()=>!1};throw{code:"ENOENT"}}}async unlink(e){return this.adapter.remove(e)}async lstat(e){return this.stat(e)}async readlink(e){throw new Error(`readlink of (${e}) is not implemented.`)}async symlink(e){throw new Error(`symlink of (${e}) is not implemented.`)}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index"),this.index,{ctime:this.indexctime,mtime:this.indexmtime}),this.clearIndex()}clearIndex(){this.index=void 0,this.indexctime=void 0,this.indexmtime=void 0}get gitDir(){return this.plugin.settings.gitDir||".git"}maybeLog(e){}};function ZB(t){return t instanceof ArrayBuffer?t:t.buffer instanceof ArrayBuffer&&t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength).slice().buffer}var xA=Gt(yA(),1),Vi=class extends cl{constructor(r){super(r);this.FILE=0;this.HEAD=1;this.WORKDIR=2;this.STAGE=3;this.status_mapping={"000":" ","003":"AD","020":"??","022":"A ","023":"AM",100:"D ",101:" D",103:"MD",110:"DA",111:" ",113:"MM",120:"DA",121:" M",122:"M ",123:"MM"};this.noticeLength=999999;this.fs=new Od(this.app.vault,this.plugin)}getRepo(){return{fs:this.fs,dir:this.plugin.settings.basePath,gitdir:this.plugin.settings.gitDir||void 0,onAuth:()=>{var r,i;return{username:(r=this.plugin.localStorage.getUsername())!=null?r:void 0,password:(i=this.plugin.localStorage.getPassword())!=null?i:void 0}},onAuthFailure:async()=>{new ka.Notice("Authentication failed. Please try with different credentials");let r=await new tt(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let i=await new tt(this.plugin,{placeholder:"Specify your password/personal access token",obscure:!0}).openAndGetResult();if(i)return this.plugin.localStorage.setUsername(r),this.plugin.localStorage.setPassword(i),{username:r,password:i}}return{cancel:!0}},http:{async request({url:r,method:i,headers:n,body:s}){let a;s&&(a=await JB(s));le
Line truncated
|
||||
|
||||
`);return{message:l[0],author:{name:o.commit.author.name,email:o.commit.author.email},body:l.slice(1).join(`
|
||||
|
||||
`),date:new Date(o.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChangesCount(o.commit.parent.first(),o.oid)).map(c=>({path:c.path,status:c.type,vaultPath:this.getRelativeVaultPath(c.path),hash:o.oid}))},hash:o.oid,refs:[]}}))}updateBasePath(r){return this.getRepo().dir=r,Promise.resolve()}async updateUpstreamBranch(r){let[i,n]=Yn(r),s=await this.branchInfo();await this.wrapFS(se.default.push({...this.getRepo(),remote:i,remoteRef:n})),await this.setConfig(`branch.${s.current}.merge`,`refs/heads/${n}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,i){return this.walkDifference({walkers:[se.default.TREE({ref:r}),se.default.TREE({ref:i})]})}async walkDifference({walkers:r,dir:i}){return await this.wrapFS(se.default.walk({...this.getRepo(),trees:r,map:async function(s,[a,o]){if(!iv(s,i))return null;if(await(a==null?void 0:a.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(a==null?void 0:a.oid()),c=await(o==null?void 0:o.oid()),u="equal";if(l!==c&&(u="M"),l===void 0&&(u="A"),c===void 0&&(u="D"),l===void 0&&c===void 0&&(console.log("Something weird happened:"),console.log(a),console.log(o)),u!=="equal")return{path:s,type:u}}}))}async getStagedFiles(r="."){return(await this.walkDifference({walkers:[se.default.TREE({ref:"HEAD"}),se.default.STAGE()],dir:r})).map(n=>({vaultPath:this.getRelativeVaultPath(n.path),path:n.path}))}async getUnstagedFiles(r="."){let i,n=window.setTimeout(()=>{i=new ka.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let s=this.getRepo(),a=await this.wrapFS(se.default.walk({...s,trees:[se.default.WORKDIR(),se.default.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await se.default.isIgnored({...s,filepath:o})||!iv(o,r))return null;let[u,f]=await Promise.all([l&&l.type(),c&&c.type()]),d=[u,f].includes("blob");if((u==="tree"||u==="special")&&!d)return;if(f==="commit")return null;if((f==="tree"||f==="special")&&!d)return;let h=f==="blob"?await c.oid():void 0,p;return u==="blob"&&f!=="blob"?p="42":u==="blob"&&(p=await l.oid()),p?h?p!==h?{path:o,type:"M"}:null:{path:o,type:"A"}:{path:o,type:"D"}}}));return window.clearTimeout(n),i==null||i.hide(),a}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async getDiffString(r,i=!1,n){let s=this.getRelativeVaultPath(r),a=async(c,[u])=>{if(r==c){let f=await u.oid();return(await se.default.readBlob({...this.getRepo(),oid:f})).blob}};if(n){let c=await(0,se.readBlob)({...this.getRepo(),filepath:r,oid:n}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof se.default.Errors.NotFoundError))throw h}),u=await se.default.readCommit({...this.getRepo(),oid:n}),f=await(0,se.readBlob)({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof se.default.Errors.NotFoundError))throw h});return pu(s,f!=null?f:"",c!=null?c:"")}let o=(await se.default.walk({...this.getRepo(),trees:[se.default.STAGE()],map:a})).first(),l=new TextDecoder().decode(o);if(i){let c=await this.resolveRef("HEAD").then(f=>(0,se.readBlob)({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof se.default.Errors.NotFoundError))throw f});return pu(s,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(s)?c=await this.app.vault.adapter.read(s):c="",pu(s,l,c)}}async getLastCommitTime(){let r=this.getRepo(),i=await this.resolveRef("HEAD"),s=(await se.default.readCommit({...r,oid:i})).commit.committer.timestamp;return new Date(s*1e3)}getFileStatusResult(r){let i=this.status_mapping[`${r[this.HEAD]}${r[this.WORKDIR]}${r[this.STAGE]}`];return{index:i[0]=="?"?"U":i[0],workingDir:i[1]=="?"?"U":i[1],path:r[this.FILE],vaultPath:this.getRelativeVaultPath(r[this.FILE])}}async checkAuthorInfo(){let r=await this.getConfig("user.name"),i=await this.getConfig("user.email");if(!r||!i)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(r,i=!0){if(!this.plugin.settings.disablePopups)return new ka.Notice(r,i?this.noticeLength:void 0)}};async function*QB(t){yield new Uint8Array(t)}async function JB(t){let e=new ReadableStream({async start(i){for await(let n of t)i.enqueue(n);i.close()}});return await new Response(e).arrayBuffer()}m();var w2=Gt(Bd(),1),ei=Gt(require("fs/promises"),1),Zn=require("obsidian"),We=Gt(require("path"),1),Tu=require("path");m();var Zd=Gt(TA(),1);m();var lv=new WeakMap;function pl(...t){let e=new String(t);return lv.set(e,t),e}function _i(t){return t instanceof String&&lv.has(t)}function ml(t){var e;return(e=lv.get(t))!=null?e:[]}var qd=Gt(Bd(),1),nT=require("child_process");var GT=Gt(uv(),1),JT=require("node:path");m();function*PA(t,e){let r=e==="global";for(let i of t)i.isGlobal===r&&(yield i)}var w3=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),b3=new Set(["--get","--get-all"
Line truncated
|
||||
`){return t.split(r).reduce((i,n)=>{let s=e?n.trim():n;return s&&i.push(s),i},[])}function Iv(t,e){return Su(t,!0).map(r=>e(r))}function Mv(t){return(0,Zd.exists)(t,Zd.FOLDER)}function Ei(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function _C(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function Kd(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function yn(t){return Array.isArray(t)?t:[t]}function yC(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function yl(t){return yn(t).map(e=>e instanceof String?e:String(e))}function Qe(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}function yu(t,e){let r=[];for(let i=0,n=t.length;i<n;i++)r.push(e,t[i]);return r}function xu(t){return(Array.isArray(t)?E.concat(t):t).toString("utf-8")}function xC(t,e){let r={};return e.forEach(i=>{t[i]!==void 0&&(r[i]=t[i])}),r}function vv(t=0){return new Promise(e=>setTimeout(e,t))}function wv(t){if(t!==!1)return t}var wl,$a,ku,Xd=Y({"src/lib/utils/util.ts"(){"use strict";Dv(),wl="\0",$a=()=>{},ku=Object.prototype.toString.call.bind(Object.prototype.toString)}});function lr(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function bv(t,e){let r=_i(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function Qd(t){return!!t&&ku(t)==="[object Object]"}function EC(t){return typeof t=="function"}var Au,SC,mt,zd,Jd,Dv=Y({"src/lib/utils/argument-filters.ts"(){"use strict";Xd(),Au=t=>Array.isArray(t),SC=t=>typeof t=="number",mt=t=>typeof t=="string"||_i(t),zd=t=>mt(t)||Array.isArray(t)&&t.every(mt),Jd=t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number"}}),_v,Q3=Y({"src/lib/utils/exit-codes.ts"(){"use strict";_v=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(_v||{})}}),Wd,J3=Y({"src/lib/utils/git-output-streams.ts"(){"use strict";Wd=class kC{constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new kC(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function e8(){throw new Error("LineParser:useMatches not implemented")}var _e,Bs,t8=Y({"src/lib/utils/line-parser.ts"(){"use strict";_e=class{constructor(t,e){this.matches=[],this.useMatches=e8,this.parse=(r,i)=>(this.resetMatches(),this._regExp.every((n,s)=>this.addMatch(n,s,r(s)))?this.useMatches(i,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let i=r&&t.exec(r);return i&&this.pushMatch(e,i),!!i}pushMatch(t,e){this.matches.push(...e.slice(1))}},Bs=class extends _e{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function AC(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...CC},...t.filter(i=>typeof i=="object"&&i));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var CC,r8=Y({"src/lib/utils/simple-git-options.ts"(){"use strict";CC={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Ov(t,e=[]){return Qd(t)?Object.keys(t).reduce((r,i)=>{let n=t[i];if(_i(n))r.push(n);else if(bv(n,["boolean"]))r.push(i+"="+n);else if(Array.isArray(n))for(let s of n)bv(s,["string","number"])||r.push(i+"="+s);else r.push(i);return r},e):e}function xr(t,e=0,r=!1){let i=[];for(let n=0,s=e<0?t.length:e;n<s;n++)"string|number".includes(typeof t[n])&&i.push(String(t[n]));return Ov(Lv(t),i),r||i.push(...i8(t)),i}function i8(t){let e=typeof Ra(t)=="function";return yl(lr(Ra(t,e?1:0),Au,[]))}function Lv(t){let e=EC(Ra(t));return lr(Ra(t,e?1:0),Qd)}function st(t,e=!0){let r=mC(Ra(t));return e||gC(r)?r:void 0}var n8=Y({"src/lib/utils/task-options.ts"(){"use strict";Dv(),Xd()}});function yv(t,e){return t(e.stdOut,e.stdErr)}function Hr(t,e,r,i=!0){return yn(r).forEach(n=>{for(let s=Su(n,i),a=0,o=s.length;a<o;a++){let l=(c=0)=>{if(!(a+c>=o))return s[a+c]};e.some(({parse:c})=>c(l,t))}}),t}var s8=Y({"src/lib/utils/task-parser.ts"(){"use strict";Xd()}}),TC={};St(TC,{ExitCodes:()=>_v,GitOutputStreams:()=>Wd,LineParser:()=>_e,NOOP:()=>$a,NULL:()=>wl,RemoteLineParser:()=>Bs,append:()=>Ei,appendTaskOptions:()=>Ov,asArray:()=>yn,asCamelCase:()=>yC,asFunction:()=>mC,asNumber:()=>Qe,asStringArray:()=>yl,bufferToString:()=>xu,callTaskParser:()=>yv,createInstanceConfig:()=>AC,delay:()=>vv,filterArray:()=>Au,filterFunction:()=>EC,filterHasLength:()=>Jd,filterNumber:()=>SC,filterPlainObject:()=>Qd,filterPrimitives:()=>bv,filterString:()=>mt,filterStringOrStringArray:()=>zd,filterType:()=>lr,first:()=>wC,folderExists:()=>Mv,forEachLineWithContent:()=>Iv,getTrailingOptions:()=>xr,including:()=>_C,isUserFunction:()=>gC,last:()=>Ra,objectToString:()=>ku,orVoid:()=>wv,parseStringResponse:()=>Hr,pick:()=>xC,prefixedArray:()=>yu,remove:()=>Kd,splitOn:()=>vC,toLinesWithContent:()=>Su,trailingFunctionArgument:()=>st,trailingOptionsArgument
Line truncated
|
||||
`)){let l=vC(a,`
|
||||
`);o=l[0],a=l[1]}yield{file:s,key:o,value:a}}}var zC,b8=Y({"src/lib/responses/ConfigList.ts"(){"use strict";ve(),zC=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((t,e)=>Object.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=Ra(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let i=this.addFile(t);Object.hasOwn(i,e)?Array.isArray(i[e])?i[e].push(r):i[e]=[i[e],r]:i[e]=r,this._all=void 0}}}});function fv(t,e){return typeof t=="string"&&Object.hasOwn(Sv,t)?t:e}function _8(t,e,r,i){let n=["config",`--${i}`];return r&&n.push("--add"),n.push(t,e),{commands:n,format:"utf-8",parser(s){return s}}}function y8(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(i){return v8(i,t)}}}function x8(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return g8(r)}}}function E8(){return{addConfig(t,e,...r){return this._runTask(_8(t,e,r[0]===!0,fv(r[1],"local")),st(arguments))},getConfig(t,e){return this._runTask(y8(t,fv(e,void 0)),st(arguments))},listConfig(...t){return this._runTask(x8(fv(t[0],void 0)),st(arguments))}}}var Sv,WC=Y({"src/lib/tasks/config.ts"(){"use strict";b8(),ve(),Sv=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Sv||{})}});function S8(t){return qC.has(t)}var dv,qC,YC=Y({"src/lib/tasks/diff-name-status.ts"(){"use strict";dv=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(dv||{}),qC=new Set(Object.values(dv))}});function k8(...t){return new KC().param(...t)}function A8(t){let e=new Set,r={};return Iv(t,i=>{let[n,s,a]=i.split(wl);e.add(n),(r[n]=r[n]||[]).push({line:Qe(s),path:n,preview:a})}),{paths:e,results:r}}function C8(){return{grep(t){let e=st(arguments),r=xr(arguments);for(let n of ZC)if(r.includes(n))return this._runTask(Nr(`git.grep: use of "${n}" is not supported.`),e);typeof t=="string"&&(t=k8().param(t));let i=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:i,format:"utf-8",parser(n){return A8(n)}},e)}}}var ZC,_u,OA,KC,XC=Y({"src/lib/tasks/grep.ts"(){"use strict";ve(),yt(),ZC=["-h"],_u=Symbol("grepQuery"),KC=class{constructor(){this[OA]=[]}*[(OA=_u,Symbol.iterator)](){for(let t of this[_u])yield t}and(...t){return t.length&&this[_u].push("--and","(",...yu(t,"-e"),")"),this}param(...t){return this[_u].push(...yu(t,"-e")),this}}}}),QC={};St(QC,{ResetMode:()=>Gd,getResetMode:()=>P8,resetTask:()=>T8});function T8(t,e){let r=["reset"];return JC(t)&&r.push(`--${t}`),r.push(...e),Er(r)}function P8(t){if(JC(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function JC(t){return typeof t=="string"&&eT.includes(t)}var Gd,eT,tT=Y({"src/lib/tasks/reset.ts"(){"use strict";ve(),yt(),Gd=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Gd||{}),eT=yl(Object.values(Gd))}});function R8(){return(0,qd.default)("simple-git")}function LA(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(i,...n)=>{t(i,...n),r(i,...n)}:t:(i,...n)=>{t(`%s ${i}`,e,...n),r&&r(i,...n)}}function $8(t,e,{namespace:r}){if(typeof t=="string")return t;let i=e&&e.namespace||"";return i.startsWith(r)?i.substr(r.length+1):i||r}function jv(t,e,r,i=R8()){let n=t&&`[${t}]`||"",s=[],a=typeof e=="string"?i.extend(e):e,o=$8(lr(e,mt),a,i);return c(r);function l(u,f){return Ei(s,jv(t,o.replace(/^[^:]+/,u),f,i))}function c(u){let f=u&&`[${u}]`||"",d=a&&LA(a,f)||$a,h=LA(i,`${n} ${f}`,d);return Object.assign(a?d:h,{label:t,sibling:l,info:h,step:c})}}var rT=Y({"src/lib/git-logger.ts"(){"use strict";ve(),qd.default.formatters.L=t=>String(Jd(t)?t.length:"-"),qd.default.formatters.B=t=>E.isBuffer(t)?t.toString("utf8"):ku(t)}}),iT,F8=Y({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";var t;Hs(),rT(),iT=(t=class{constructor(r="GitExecutor"){this.logLabel=r,this._queue=new Map}withProgress(r){return this._queue.get(r)}createProgress(r){let i=t.getName(r.commands[0]),n=jv(this.logLabel,i);return{task:r,logger:n,name:i}}push(r){let i=this.createProgress(r);return i.logger("Adding task to the queue, commands = %o",r.commands),this._queue.set(r,i),i}fatal(r){for(let[i,{logger:n}]of Array.from(this._queue.entries()))i===r.task?(n.info("Failed %o",r),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",r.message),this.complete(i);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(r){this.withProgress(r)&&this._queue.delete(r)}attempt(r){let i=this.withProgress(r);if(!i)throw new Br(void 0,"TasksPendingQueue: attempt called for an unknown task");return i.logger(
Line truncated
|
||||
`).map(C6).filter(Boolean);e||r.sort(function(n,s){let a=n.split("."),o=s.split(".");if(a.length===1||o.length===1)return A6(Ud(a[0]),Ud(o[0]));for(let l=0,c=Math.max(a.length,o.length);l<c;l++){let u=f2(Ud(a[l]),Ud(o[l]));if(u)return u}return 0});let i=e?r[0]:[...r].reverse().find(n=>n.indexOf(".")>=0);return new lC(r,i)}}}),h2={};St(h2,{addAnnotatedTagTask:()=>$6,addTagTask:()=>R6,tagListTask:()=>P6});function P6(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return d2(r,e)}}}function R6(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function $6(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var F6=Y({"src/lib/tasks/tag.ts"(){"use strict";T6()}}),I6=K3({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(D8(),_t(sT)),{SimpleGitApi:i}=(DH(),_t(HT)),{Scheduler:n}=(OH(),_t(UT)),{adhocExecTask:s,configurationErrorTask:a}=(yt(),_t(Ev)),{asArray:o,filterArray:l,filterPrimitives:c,filterString:u,filterStringOrStringArray:f,filterType:d,getTrailingOptions:h,trailingFunctionArgument:p,trailingOptionsArgument:g}=(ve(),_t(TC)),{applyPatchTask:w}=(NH(),_t(VT)),{branchTask:y,branchLocalTask:b,deleteBranchesTask:S,deleteBranchTask:C}=(ZH(),_t(XT)),{checkIgnoreTask:A}=(JH(),_t(t2)),{checkIsRepoTask:k}=(FC(),_t(PC)),{cleanWithOptionsTask:v,isCleanOptionsArray:x}=(jC(),_t(UC)),{diffSummaryTask:_}=(Kv(),_t(wT)),{fetchTask:P}=(n6(),_t(i2)),{moveTask:T}=(l6(),_t(s2)),{pullTask:M}=(u6(),_t(a2)),{pushTagsTask:$}=(IT(),_t(FT)),{addRemoteTask:D,getRemotesTask:Q,listRemotesTask:ye,remoteTask:de,removeRemoteTask:J}=(b6(),_t(l2)),{getResetMode:X,resetTask:he}=(tT(),_t(QC)),{stashListTask:z}=(y6(),_t(c2)),{addSubModuleTask:K,initSubModuleTask:G,subModuleTask:Me,updateSubModuleTask:Et}=(k6(),_t(u2)),{addAnnotatedTagTask:Ht,addTagTask:De,tagListTask:Rt}=(F6(),_t(h2)),{straightThroughBufferTask:$t,straightThroughStringTask:Xe}=(yt(),_t(Ev));function re(B,N){this._plugins=N,this._executor=new r(B.baseDir,new n(B.maxConcurrentProcesses),N),this._trimmed=B.trimmed}(re.prototype=Object.create(i.prototype)).constructor=re,re.prototype.customBinary=function(B){return this._plugins.reconfigure("binary",B),this},re.prototype.env=function(B,N){return arguments.length===1&&typeof B=="object"?this._executor.env=B:(this._executor.env=this._executor.env||{})[B]=N,this},re.prototype.stashList=function(B){return this._runTask(z(g(arguments)||{},l(B)&&B||[]),p(arguments))},re.prototype.mv=function(B,N){return this._runTask(T(B,N),p(arguments))},re.prototype.checkoutLatestTag=function(B){var N=this;return this.pull(function(){N.tags(function(ue,Re){N.checkout(Re.latest,B)})})},re.prototype.pull=function(B,N,ue,Re){return this._runTask(M(d(B,u),d(N,u),h(arguments)),p(arguments))},re.prototype.fetch=function(B,N){return this._runTask(P(d(B,u),d(N,u),h(arguments)),p(arguments))},re.prototype.silent=function(B){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},re.prototype.tags=function(B,N){return this._runTask(Rt(h(arguments)),p(arguments))},re.prototype.rebase=function(){return this._runTask(Xe(["rebase",...h(arguments)]),p(arguments))},re.prototype.reset=function(B){return this._runTask(he(X(B),h(arguments)),p(arguments))},re.prototype.revert=function(B){let N=p(arguments);return typeof B!="string"?this._runTask(a("Commit must be a string"),N):this._runTask(Xe(["revert",...h(arguments,0,!0),B]),N)},re.prototype.addTag=function(B){let N=typeof B=="string"?De(B):a("Git.addTag requires a tag name");return this._runTask(N,p(arguments))},re.prototype.addAnnotatedTag=function(B,N){return this._runTask(Ht(B,N),p(arguments))},re.prototype.deleteLocalBranch=function(B,N,ue){return this._runTask(C(B,typeof N=="boolean"?N:!1),p(arguments))},re.prototype.deleteLocalBranches=function(B,N,ue){return this._runTask(S(B,typeof N=="boolean"?N:!1),p(arguments))},re.prototype.branch=function(B,N){return this._runTask(y(h(arguments)),p(arguments))},re.prototype.branchLocal=function(B){return this._runTask(b(),p(arguments))},re.prototype.raw=function(B){let N=!Array.isArray(B),ue=[].slice.call(N?arguments:B,0);for(let Ut=0;Ut<ue.length&&N;Ut++)if(!c(ue[Ut])){ue.splice(Ut,ue.length-Ut);break}ue.push(...h(arguments,0,!0));var Re=p(arguments);return ue.length?this._runTask(Xe(ue,this._trimmed),Re):this._runTask(a("Raw: must supply one or more command to execute"),Re)},re.prototype.submoduleAdd=function(B,N,ue){return this._runTask(K(B,N),p(arguments))},re.prototype.submoduleUpdate=function(B,N){return this._runTask(Et(h(arguments,!0)),p(arguments))},re.prototype.submoduleInit=function(B,N){return this._runTask(G(h(arguments,!0)),p(arguments))},re.prototype.subModule=function(B,N){return this._runTask(Me(h(arguments)),p(arguments))},re.prototype.listRemote=function(){return this._runTask(ye(h(arguments)),p(argumen
Line truncated
|
||||
`).some(l=>l.contains(n))||await ei.appendFile(r,n+`
|
||||
`)}catch(r){console.error("Error while adding askpass script to exclude file:",r)}}unload(){var r;(r=this.watchAbortController)==null||r.abort()}async status(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=await this.git.status(i!=null?["--",i]:[]);this.plugin.setPluginState({gitAction:0});let s=n.files.map(a=>{let o=this.formatPath(a);return{path:o.path,from:o.from,index:a.index==="?"?"U":a.index,workingDir:a.working_dir==="?"?"U":a.working_dir,vaultPath:this.getRelativeVaultPath(o.path)}});return{all:s,changed:s.filter(a=>a.workingDir!==" "),staged:s.filter(a=>a.index!==" "&&a.index!="U"),conflicted:n.conflicted.map(a=>this.formatPath({path:a}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let i=this.getRelativeRepoPath(r),s=["-C",We.dirname(i),"rev-parse","HEAD"],a=this.git.raw(s);return a.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),(await a).trim()}async getSubmodulePaths(){return new Promise(r=>{this.git.outputHandler((i,n,s,a)=>{if(!(a.contains("submodule")&&a.contains("foreach")))return;let o="",l=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");n.on("data",c=>{o+=c.toString("utf8")}),n.on("end",()=>{let u=o.split(`
|
||||
`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+Tu.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},i=>this.plugin.displayError(i))})}formatPath(r){function i(n){if(n!=null)return n.startsWith('"')&&n.endsWith('"')?n.substring(1,n.length-1):n}return r.from!=null?{from:i(r.from),path:i(r.path)}:{path:i(r.path)}}async blame(r,i,n){if(r=this.getRelativeRepoPath(r),!await this.isTracked(r))return"untracked";let s=await this.getSubmoduleOfFile(r),a=s?["-C",s.submodule]:[],o=s?s.relativeFilepath:r;a.push("blame","--porcelain"),n&&a.push("-w");let l=`-C${Pd}`;switch(i){case"inactive":break;case"same-commit":a.push("-C",l);break;case"all-commits":a.push("-C","-C",l);break;default:Ls(i)}a.push("--",o);let c=await this.git.raw(a);return J6(c)}async isTracked(r){let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("ls-files","--",s),this.git.raw(n).then(a=>a.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let n=await this.getSubmodulePaths();for(let s of n)await this.git.cwd({path:s,root:!1}).add("-A"),await this.git.cwd({path:s,root:!1}).commit(await this.formatCommitMessage(r))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let i=await this.git.commit(await this.formatCommitMessage(r));return this.app.workspace.trigger("obsidian-git:head-change"),i.summary.changes}async commit({message:r,amend:i}){this.plugin.setPluginState({gitAction:4});let n=(await this.git.commit(await this.formatCommitMessage(r),i?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),n}async stage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.add(["--",r]),this.plugin.setPluginState({gitAction:0})}async stageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.add(r!=null?r:"-A"),this.plugin.setPluginState({gitAction:0})}async unstageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.reset(r!=null?["--",r]:[]),this.plugin.setPluginState({gitAction:0})}async unstage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.reset(["--",r]),this.plugin.setPluginState({gitAction:0})}async discard(r){this.plugin.setPluginState({gitAction:3}),await this.isTracked(r)&&await this.git.checkout(["--",r]),this.plugin.setPluginState({gitAction:0})}async applyPatch(r){let i=We.join(this.relPluginConfigPath,"patch");await this.app.vault.adapter.write(i,r),await this.git.applyPatch(i,{"--cached":null,"--unidiff-zero":null,"--whitespace":"nowarn"}),await this.app.vault.adapter.remove(i)}async getUntrackedPaths(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=[];i!=null&&n.push("--",i);let s=await this.git.clean(Pa.RECURSIVE+Pa.DRY_RUN,n);return this.plugin.setPluginState({gitAction:0}),s.paths}async hashObject(r){r=this.getRelativeRepoPath(r);let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("hash-object","--",s),this.git.raw(n)}async discardAll({dir:r}){return this.discard(r!=null?r:".")}async pull(){this.plugin.setPluginState({gitAction:2});try{this.plugin.settings.updateSubmodules&&await this.git.subModule(["update","--remote","--merge","--recursive"]);let r=await this.branchInfo(),i=await this.git.revparse([r.current]);if(!r.tracking&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring pull of main repo and updating submodules only.");return}await this.git.fetch();let n=await this.git.revparse([r.tracking]);if(i!==n){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{let o=[r.tracking];switch(this.plugin.settings.mergeStrategy!=="none"&&o.push(`--strategy-option=${this.plugin.settings.mergeStrategy}`),this.plugin.settings.syncMethod){case"merge":await this.git.merge(o);break;case"rebase":await this.git.rebase(o)}}catch(o){this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`);return}else if(this.plugin.settings.syncMethod==="reset")try{await this.git.raw(["update-ref",`refs/heads/${r.current}`,n]),await this.unstageAll({})}catch(o){this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`)}this.app.workspace.trigger("obsidian-git:head-change");let s=await this.git.revparse([r.current]);return(await this.git.diff([`${i}..${s}`,"--name-only"])).split(/\r\n|\r|\n/).filter(o=>o.length>0).map(o=>({path:o,workingDir:"P",vaultPath:this.getRelativeVaultPath(o)}))}else return[]}catch(r){this.convertErrors(r)}}async push(){this.plugin.setPluginState({gitAction:5});try{if(this.plugin.settings.updateSubmodules){let a=aw
Line truncated
|
||||
`):[]}async removeRemote(r){await this.git.removeRemote(r)}async updateUpstreamBranch(r){try{await this.git.branch(["--set-upstream-to",r])}catch(i){try{await this.git.branch(["--set-upstream",r])}catch(n){let[s,a]=Yn(r),o=await this.branchInfo();await this.git.push(["--set-upstream",s,`${o.current}:${a}`])}}}updateGitPath(r){return this.setGitInstance()}updateBasePath(r){return this.setGitInstance(!0)}async getDiffString(r,i=!1,n){return i?await this.git.diff(["--cached","--",r]):n?await this.git.show([`${n}`,"--",r]):await this.git.diff(["--",r])}async diff(r,i,n){return await this.git.diff([`${i}..${n}`,"--",r])}async rawCommand(r){let i=r.split(" ");return await this.git.raw(i[0],...i.slice(1))}async getSubmoduleOfFile(r){if(!await this.app.vault.adapter.exists(We.dirname(r)))return;let i=await this.git.raw(["-C",We.dirname(r),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(i=i.trim(),(await this.git.raw(["-C",We.dirname(r),"rev-parse","--show-superproject-working-tree"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message))).trim()==="")return;let a=this.app.vault.adapter.getFullPath(We.normalize(r)),o=We.relative(i,a);return{submodule:i,relativeFilepath:o}}async getLastCommitTime(){try{let r=await this.git.log({n:1});if(r!=null&&r.latest!=null)return new Date(r.latest.date)}catch(r){if(r instanceof Br){if(r.message.contains("does not have any commits yet"))return}else throw r}}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),i=await wu(r||"git",["--version"],{});if(i.error)if(Zn.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${Rd}) of Git for Windows.`);let n=await wu(Rd,["--version"]);if(n.error)return console.error(n.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(i.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(r){if(r instanceof Br){let i=String(r.message);if(i.contains("Could not resolve host")||i.contains("Unable to resolve host")||i.contains("Unable to open connection")||i.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||i.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||i.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new nl(i)}throw r}async isFileTrackedByLFS(r){try{return(await this.git.raw(["check-attr","filter",r])).includes("filter: lfs")}catch(i){let n=i instanceof Error?i.message:String(i);return this.plugin.displayError(`Error checking LFS status: ${n}`),!1}}},b2={hash:"000000",isZeroCommit:!0,summary:""};function J6(t){let r=t.replace(`\r
|
||||
`,`
|
||||
`).split(`
|
||||
`),i={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},n=1;for(let s=0;s<r.length;){if(g2(r[s])){let a=r[s].split(" "),o=e5(a,n,i);for(s++;g2(r[s]);s++){let l=r[s].split(" ");t5(l,i,n)}r5(i.commits.get(o)),n+=1}else if(!(r[s]===""&&s===r.length-1))throw Error(`Expected non-whitespace line or EOF, but found: ${r[s]}`);s++}return i}function e5(t,e,r){let i=t[0];if(r.hashPerLine.push(i),r.originalFileLineNrPerLine.push(parseInt(t[1])),r.finalFileLineNrPerLine.push(parseInt(t[2])),t.length>=4&&r.groupSizePerStartingLine.set(e,parseInt(t[3])),parseInt(t[2])!==e)throw Error(`git-blame output is out of order: ${e} vs ${t[2]}`);return i}function t5(t,e,r){let i=t[0],n=t.slice(1).join(" "),s=e.hashPerLine[r],a=e.commits.get(s)||{hash:s,author:{},committer:{},previous:{}};switch(i){case"summary":a.summary=n;break;case"author":a.author.name=n;break;case"author-mail":a.author.email=v2(n);break;case"author-time":a.author.epochSeconds=parseInt(n);break;case"author-tz":a.author.tz=n;break;case"committer":a.committer.name=n;break;case"committer-mail":a.committer.email=v2(n);break;case"committer-time":a.committer.epochSeconds=parseInt(n);break;case"committer-tz":a.committer.tz=n;break;case"previous":a.previous.commitHash=n;break;case"filename":a.previous.filename=n;break}e.commits.set(s,a)}function r5(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);ew(t.author)&&(t.author=void 0),ew(t.committer)&&(t.committer=void 0),ew(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function ew(t){return!t||Object.keys(t).length===0}function g2(t){return t.length>0&&t[0].trim()===t[0]}function v2(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}m();var q2=require("@codemirror/state");m();var tw=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(e,r){if(e)return this.ensureInitialized(e),r(this.eventsPerFilepath.get(e))}forEachSubscriber(e){this.eventsPerFilepath.forEach(r=>r.forEach(e))}ensureInitialized(e){this.eventsPerFilepath.get(e)||this.eventsPerFilepath.set(e,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(e=>e==null?void 0:e.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},Kn=new tw;m();var ah=require("@codemirror/state"),x2=Gt(rw(),1);function E2(t,e,r){if(!(t===void 0||e===void 0||r===void 0))return`head${t}-obj${e}-path${r}`}var S2=ah.StateEffect.define();function k2(t,e,r){return r.update({effects:S2.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}var xl=ah.StateField.define({create:t=>{},update:(t,e)=>{for(let r of e.effects)if(r.is(S2))return r.value;return i5(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function oh(t){var s;let e=x2.sha256.create();if(!t)return e;let{la:r,key:i,lineOffsetsFromUnsavedChanges:n}=t;e.update(r==="untracked"?"t":"f"),e.update(i);for(let[a,o]of(s=n.entries())!=null?s:[])e.update([a,o]);return e}var Pu={get:void 0,save:void 0};function A2(t,e){Pu.get=t,Pu.save=e}function lh(t){var e,r;return(r=(e=Ru(t.coloringMaxAge))==null?void 0:e.asDays())!=null?r:Ru(pt.lineAuthor.coloringMaxAge).asDays()}function i5(t,e){if(e)return t.changes.empty||t.changes.iterChanges((r,i,n,s)=>{var p;let a=t.startState.doc,{newDoc:o}=t,l=a.lineAt(r).number,c=a.lineAt(i).number,u=o.lineAt(n).number,f=o.lineAt(s).number,d=c-l+1,h=f-u+1;for(let g=u;g<=f;g++){let w=(p=e.lineOffsetsFromUnsavedChanges.get(g))!=null?p:0,y=f===g,b=h-d;y&&(w+=b),e.lineOffsetsFromUnsavedChanges.set(g,w)}}),e}m();function C2(){El=void 0,iw=[],ch=0,fh.clear(),dh.clear(),Sl.clear()}var El,uh=()=>El;function T2(t,e){var n;let r=e.length;if(r<((n=El==null?void 0:El.length)!=null?n:0))return;El={gutter:t,length:r,text:e};let i=zt.plugin.localStorage.getGutterSpacingFallbackLength();r!==i&&zt.plugin.localStorage.setGutterSpacingFallbackLength(r)}var iw=[],n5=15,ch=0;function P2(t){iw[ch]=t,ch=(ch+1)%n5}function R2(){return fA(iw)}var fh=new Map,dh=new Map,Sl=new Set;m();var V2=require("@codemirror/state"),z2=require("@codemirror/view");m();var ow=require("@codemirror/view"),B2=Gt(rw(),1),kl=require("obsidian");m();m();var hh={x:-10,y:-10};function $2(){hh.x===-10&&window.addEventListener("mousedown",t=>{hh.x=t.clientX,hh.y=t.clientY})}function F2(){for(let t of Sl)if(s5(t,hh))return t}function s5(t,e){let{x:r,y:i,width:n,height:s}=t.getBoundingClientRect();return r<=e.x&&e.x<=r+n&&i<=e.y&&e.y<=i+s}var I2="data-commit";function M2(t,e,r){if(e.hasFocus())return;let i=F2();if(!i)return;let n=o5(i);n&&(!n.isZeroCommit&&!n.isWaitingGutter&&a5(n,t),nw("showCommitHash",t),nw("authorDisplay",t),nw("dateTimeFormatOptions",t))}function a5(t,e){e.addItem(r=>r.setTitle("Copy commit hash").setIcon("
Line truncated
|
||||
If turned on, do auto ${n} every ${pA(i.settings.autoSaveInterval)} after stopping file edits.
|
||||
This also prevents auto ${n} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(f=>f.setValue(i.settings.autoBackupAfterFileChange).onChange(async d=>{i.settings.autoBackupAfterFileChange=d,this.refreshDisplayWithDelay(),await i.saveSettings(),i.automaticsManager.reload("commit")})),this.mayDisableSetting(a,i.settings.setLastSaveToLastCommit),a=new j.Setting(r).setName(`Auto ${n} after latest commit`).setDesc(`If turned on, sets last auto ${n} timestamp to the latest commit timestamp. This reduces the frequency of auto ${n} when doing manual commits.`).addToggle(f=>f.setValue(i.settings.setLastSaveToLastCommit).onChange(async d=>{i.settings.setLastSaveToLastCommit=d,await i.saveSettings(),i.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(a,i.settings.autoBackupAfterFileChange),a=new j.Setting(r).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPushInterval"}),f.setPlaceholder(String(pt.autoPushInterval)),f.onChange(async d=>{d!==""?i.settings.autoPushInterval=Number(d):i.settings.autoPushInterval=pt.autoPushInterval,await i.saveSettings(),i.automaticsManager.reload("push")})}),this.mayDisableSetting(a,!i.settings.differentIntervalCommitAndPush),new j.Setting(r).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPullInterval"}),f.setPlaceholder(String(pt.autoPullInterval)),f.onChange(async d=>{d!==""?i.settings.autoPullInterval=Number(d):i.settings.autoPullInterval=pt.autoPullInterval,await i.saveSettings(),i.automaticsManager.reload("pull")})}),new j.Setting(r).setName(`Auto ${n} only staged files`).setDesc(`If turned on, only staged files are committed on ${n}. If turned off, all changed files are committed.`).addToggle(f=>f.setValue(i.settings.autoCommitOnlyStaged).onChange(async d=>{i.settings.autoCommitOnlyStaged=d,await i.saveSettings()})),new j.Setting(r).setName(`Specify custom commit message on auto ${n}`).setDesc("You will get a pop up to specify your message.").addToggle(f=>f.setValue(i.settings.customMessageOnAutoBackup).onChange(async d=>{i.settings.customMessageOnAutoBackup=d,await i.saveSettings(),this.refreshDisplayWithDelay()})),a=new j.Setting(r).setName(`Commit message on auto ${n}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(f=>{f.setPlaceholder(pt.autoCommitMessage).onChange(async d=>{d===""?i.settings.autoCommitMessage=pt.autoCommitMessage:i.settings.autoCommitMessage=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(a,i.settings.customMessageOnAutoBackup),new j.Setting(r).setName("Commit message").setHeading();let c=new j.Setting(r).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message). Leave empty to require manual input on each commit.");c.addTextArea(f=>{c.addButton(d=>{d.setIcon("reset").setTooltip(`Set to default: "${pt.commitMessage}"`).onClick(()=>{f.setValue(pt.commitMessage),f.onChanged()})}),f.setValue(i.settings.commitMessage),f.onChange(async d=>{i.settings.commitMessage=d,await i.saveSettings()})}),j.Platform.isDesktopApp&&new j.Setting(r).setName("Commit message script").setDesc("A script that is run using 'sh -c' to generate the commit message. May be used to generate commit messages using AI tools. Available placeholders: {{hostname}}, {{date}}.").addText(f=>{f.onChange(async d=>{d===""?i.settings.commitMessageScript=pt.commitMessageScript:i.settings.commitMessageScript=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"commitMessageScript"})});let u=new j.Setting(r).setName("{{date}} placeholder format").addMomentFormat(f=>f.setDefaultFormat(i.settings.commitDateFormat).setValue(i.settings.commitDateFormat).onChange(async d=>{i.settings.commitDateFormat=d,await i.saveSettings()}));u.descEl.createSpan({text:` Specify custom date format. E.g. "${Kg}. See `}),u.descEl.createEl("a",{text:"Moment.js documentation",href:Z2,attr:{target:"_blank"}}),u.descEl.createSpan({text:" for more formats."}),new j.Setting(r).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device. Defaults to the OS hostname if not set on desktop.").addText(f=>{var d;return f.setValue((d=i.localStorage.getHostname())!=null?d:"").onChange(h=>{i.localStorage.setHostname(h)})}),new j.Setting(r).setName("Preview commit message").addButton(f=>f.se
Line truncated
|
||||
`)),c.onChange(u=>{i.localStorage.setEnvVars(u.split(`
|
||||
`))})}),i.gitManager instanceof Ce&&new j.Setting(r).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(i.localStorage.getPATHPaths().join(`
|
||||
`)),c.onChange(u=>{i.localStorage.setPATHPaths(u.split(`
|
||||
`))})}),i.gitManager instanceof Ce&&new j.Setting(r).setName("Reload with new environment variables").setDesc("Removing previously added environment variables will not take effect until Obsidian is restarted.").addButton(c=>{c.setButtonText("Reload"),c.setCta(),c.onClick(async()=>{await i.gitManager.setGitInstance()})}),new j.Setting(r).setName("Custom base path (Git repository path)").setDesc(`
|
||||
Sets the relative path to the vault from which the Git binary should be executed.
|
||||
Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows.
|
||||
`).addText(c=>{c.setValue(i.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{i.settings.basePath=u,await i.saveSettings(),i.gitManager.updateBasePath(u||"").catch(f=>i.displayError(f))})}),new j.Setting(r).setName("Custom Git directory path (Instead of '.git')").setDesc('Corresponds to the GIT_DIR environment variable. Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(i.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{i.settings.gitDir=u,await i.saveSettings()})}),new j.Setting(r).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(i.localStorage.getPluginDisabled()).onChange(u=>{i.localStorage.setPluginDisabled(u),u?i.unloadPlugin():i.init({fromReload:!0}).catch(f=>i.displayError(f)),new j.Notice("Obsidian must be restarted for the changes to take affect.")})),new j.Setting(r).setName("Support").setHeading(),new j.Setting(r).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{var f;let u=(f=c.buttonEl.parentElement)==null?void 0:f.createEl("a",{href:"https://ko-fi.com/F1F195IQ5",attr:{target:"_blank"}});u&&(u.createEl("img",{attr:{height:"36",style:"border:0px;height:36px;",src:"https://cdn.ko-fi.com/cdn/kofi3.png?v=3",border:"0",alt:"Buy Me a Coffee at ko-fi.com"}}),c.buttonEl.remove())});let o=r.createDiv();o.setAttr("align","center"),o.setAttr("style","margin: var(--size-4-2)");let l=o.createEl("button");if(l.setText("Copy Debug Information"),l.onclick=async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.plugin.settings,pluginVersion:this.plugin.manifest.version},null,4)),new j.Notice("Debug information copied to clipboard. May contain sensitive information!")},j.Platform.isDesktopApp){let c=r.createDiv();c.setAttr("align","center"),c.setText(`Debugging and logging:
|
||||
You can always see the logs of this and every other plugin by opening the console with`);let u=r.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),j.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(r,i){i&&(r.setDisabled(i),r.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(r){this.settings.lineAuthor.show=r,this.plugin.saveSettings(),r?this.plugin.editorIntegration.activateLineAuthoring():this.plugin.editorIntegration.deactiveLineAuthoring()}async lineAuthorSettingHandler(r,i){this.settings.lineAuthor[r]=i,await this.plugin.saveSettings(),this.plugin.editorIntegration.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let r=this.settings.lineAuthor;r.authorDisplay!=="hide"&&(r.lastShownAuthorDisplay=r.authorDisplay),r.dateTimeFormatOptions!=="hide"&&(r.lastShownDateTimeFormatOptions=r.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let r=new j.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform()||r.setDesc("Only available on desktop currently.").setDisabled(!0),r.descEl.createEl("a",{href:b5,text:"Feature guide and quick examples",attr:{target:"_blank"}}),r.descEl.createEl("br"),r.descEl.createSpan({text:" The commit hash, author name and authoring date can all be individually toggled."}),r.descEl.createEl("br"),r.descEl.createSpan({text:"Hide everything, to only show the age-colored sidebar."}),r.addToggle(i=>i.setValue(this.settings.lineAuthor.show).onChange(n=>{this.configureLineAuthorShowStatus(n),this.refreshDisplayWithDelay()})),this.settings.lineAuthor.show){let i=new j.Setting(this.containerEl).setName("Follow movement and copies across files and commits").addDropdown(l=>{l.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),l.setValue(this.settings.lineAuthor.followMovement),l.onChange(c=>this.lineAuthorSettingHandler("followMovement",c))});if(i.descEl.createSpan({text:"By default (deactivated), each line only shows the newest commit where it was changed."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"With "}),i.descEl.createEl("i",{text:"same commit"}),i.descEl.createSpan({text:", cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"With "}),i.descEl.createEl("i",{text:"all commits"}),i.descEl.createSpan({text:", cut-copy-paste-ing text inbetween multiple commits will be detected."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"It uses "}),i.descEl.createEl("a",{href:"https://git-scm.com/docs/git-blame",text:"git-blame",attr:{target:"_blank"}}),i.descEl.createSpan({text:` and for matches (at least ${Pd} characters) within the same (or all) commit(s), `}),i.descEl.createEl("em",{text:"the originating"}),i.descEl.createSpan({text:" commit's information is shown."}),new j.Setting(this.containerEl).setName("Show commit hash").addToggle(l=>{l.setValue(this.settings.lineAuthor.showCommitHash),l.onChange(c=>this.lineAuthorSettingHandler("showCommitHash",c))}),new j.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(l=>{let c={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};l.addOptions(c),l.setValue(this.settings.lineAuthor.authorDisplay),l.onChange(async u=>this.lineAuthorSettingHandler("authorDisplay",u))}),new j.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(l=>{let c={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};l.addOptions(c),l.setValue(this.settings.lineAuthor.dateTimeFormatOptions),l.onChange(async u=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",u),this.refreshDisplayWithDelay()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let l=new j.Setting(this.containerEl);l.setName("Custom authoring date format").addText(c=>{c.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),c.setPlaceholder("YYYY-MM-DD HH:mm"),c.onChange(async u=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",u),this.setCustomDateTimeDescription(l.descEl,u)})}),this.setCustomDateTimeDescription(l.descEl,this.settings.lineAuthor.dateTimeFormatCustomString)}let n=new j.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(l=>{let c={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};l.addOptions(c),l.setValue(this.settings.lineAuthor.dateTimeTimezone),l.onChange(async u=>this.lineAuthorSettingHandler("dateTimeTimezone",u))});n.d
Line truncated
|
||||
Either your local time-zone (default),
|
||||
the author's time-zone during commit creation or
|
||||
`}),n.descEl.createEl("a",{text:"UTC\xB100:00",href:"https://en.wikipedia.org/wiki/UTC%C2%B100:00"}),n.descEl.createSpan({text:"."});let s=new j.Setting(this.containerEl).setName("Oldest age in coloring");this.setOldestAgeDescription(s.descEl,this.settings.lineAuthor.coloringMaxAge),s.addText(l=>{l.setPlaceholder("1y"),l.setValue(this.settings.lineAuthor.coloringMaxAge),l.onChange(async c=>{let f=Ru(c)!==void 0;this.setOldestAgeDescription(s.descEl,c),f&&(await this.lineAuthorSettingHandler("coloringMaxAge",c),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest");let a=new j.Setting(this.containerEl).setName("Text color").addText(l=>{l.setValue(this.settings.lineAuthor.textColorCss),l.onChange(async c=>{await this.lineAuthorSettingHandler("textColorCss",c)})});a.descEl.empty(),a.descEl.createSpan({text:"The CSS color of the gutter text."}),a.descEl.createEl("br"),a.descEl.createEl("br"),a.descEl.createSpan({text:"It is highly recommended to use "}),a.descEl.createEl("a",{text:"CSS variables",href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties"}),a.descEl.createSpan({text:" defined by themes (e.g. "}),a.descEl.createEl("pre",{text:"var(--text-muted)",attr:{style:"display:inline"}}),a.descEl.createSpan({text:" or "}),a.descEl.createEl("pre",{text:"var(--text-on-accent)",attr:{style:"display:inline"}}),a.descEl.createSpan({text:"), because they automatically adapt to theme changes."}),a.descEl.createEl("br"),a.descEl.createEl("br"),a.descEl.createSpan({text:"See: "}),a.descEl.createEl("a",{text:"List of available CSS variables in Obsidian",href:"https://github.com/obsidian-community/obsidian-theme-template/blob/main/obsidian.css"});let o=new j.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(l=>{l.setValue(this.settings.lineAuthor.ignoreWhitespace),l.onChange(c=>this.lineAuthorSettingHandler("ignoreWhitespace",c))});o.descEl.empty(),o.descEl.createSpan({text:"Whitespace and newlines are interpreted as part of the document and in changes by default (hence not ignored). This makes the last line being shown as 'changed' when a new subsequent line is added, even if the previously last line's text is the same."}),o.descEl.createEl("br"),o.descEl.createSpan({text:"If you don't care about purely-whitespace changes (e.g. list nesting / quote indentation changes), then activating this will provide more meaningful change detection."})}}createColorSetting(r){let i=new j.Setting(this.containerEl).setName("").addText(n=>{let s=fw(r,this.settings.lineAuthor),a=fw(r,pt.lineAuthor);n.setPlaceholder(nv(a)),n.setValue(nv(s)),n.onChange(async o=>{let l=cA(o);if(l!==void 0){let c=r==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(r,l)})});this.lineAuthorColorSettings.set(r,i),this.refreshColorSettingsName(r),this.refreshColorSettingsDesc(r,fw(r,this.settings.lineAuthor))}refreshColorSettingsName(r){let i=this.lineAuthorColorSettings.get(r);if(i){let n=r==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";i.nameEl.setText(`Color for ${n} commits`)}}refreshColorSettingsDesc(r,i){let n=this.lineAuthorColorSettings.get(r);n&&this.colorSettingPreviewDesc(n.descEl,r,this.settings.lineAuthor,i!==void 0)}colorSettingPreviewDesc(r,i,n,s){r.empty(),r.createSpan({text:"Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and named colors (e.g. 'black', 'purple'). Color preview: "});let a=s?mh(i,n):"rgba(127,127,127,0.3)",o=j.moment.unix(j.moment.now()/1e3).format("YYYY-MM-DD"),l=s?`abcdef Author Name ${o}`:"invalid color";r.createEl("div",{text:l,attr:{class:"line-author-settings-preview",style:`background-color: ${a}; width: 30ch;`}})}setCustomDateTimeDescription(r,i){r.empty(),r.createEl("a",{text:"Format string",href:Z2}),r.createSpan({text:" to display the authoring date."}),r.createEl("br");let n=(0,j.moment)().format(i);r.createSpan({text:`Currently: ${n}`})}setOldestAgeDescription(r,i){let n=Ru(i),s=n!==void 0?`${n.asDays()} days`:"invalid!";r.empty(),r.createSpan({text:`The oldest age in the line author coloring. Everything older will have the same color.
|
||||
Smallest valid age is "1d". Currently: ${s}`})}setNonDefaultValue({settingsProperty:r,text:i}){let n=this.plugin.settings[r];pt[r]!==n&&(typeof n=="string"||typeof n=="number"||typeof n=="boolean"?i.setValue(String(n)):i.setValue(JSON.stringify(n)))}refreshDisplayWithDelay(r=80){window.setTimeout(()=>this.display(),r)}};function fw(t,e){return t==="oldest"?e.colorOld:e.colorNew}function Ru(t){let e=j.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}m();var ti=require("obsidian");var wh=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.messages=[];this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),r.registerEvent(r.app.workspace.on("obsidian-git:refreshed",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(e,r){this.messages.push({message:`Git: ${e.slice(0,100)}`,timeout:r}),this.display()}display(){this.messages.length>0&&!this.currentMessage?(this.currentMessage=this.messages.shift(),this.statusBarEl.addClass(this.base+"message"),this.statusBarEl.ariaLabel="",this.statusBarEl.setText(this.currentMessage.message),this.lastMessageTimestamp=Date.now()):this.currentMessage?Date.now()-this.lastMessageTimestamp>=this.currentMessage.timeout&&(this.currentMessage=null,this.lastMessageTimestamp=null):this.displayState()}displayState(){switch((this.statusBarEl.getText().length>3||!this.statusBarEl.hasChildNodes())&&(this.statusBarEl.empty(),this.conflictEl=this.statusBarEl.createDiv(),this.conflictEl.setAttribute("data-tooltip-position","top"),this.conflictEl.style.float="left",this.pausedEl=this.statusBarEl.createDiv(),this.pausedEl.setAttribute("data-tooltip-position","top"),this.pausedEl.style.float="left",this.iconEl=this.statusBarEl.createDiv(),this.iconEl.style.float="left",this.textEl=this.statusBarEl.createDiv(),this.textEl.style.float="right",this.textEl.style.marginLeft="5px"),this.plugin.localStorage.getConflict()?((0,ti.setIcon)(this.conflictEl,"alert-circle"),this.conflictEl.ariaLabel="You have merge conflicts. Resolve them and commit afterwards.",this.conflictEl.style.marginRight="5px",this.conflictEl.addClass(this.base+"conflict")):(this.conflictEl.empty(),this.conflictEl.style.marginRight=""),this.plugin.localStorage.getPausedAutomatics()?((0,ti.setIcon)(this.pausedEl,"pause-circle"),this.pausedEl.ariaLabel="Automatic routines are currently paused.",this.pausedEl.style.marginRight="5px",this.pausedEl.addClass(this.base+"paused")):(this.pausedEl.empty(),this.pausedEl.style.marginRight=""),this.plugin.state.gitAction){case 0:this.displayFromNow();break;case 1:this.statusBarEl.ariaLabel="Checking repository status...",(0,ti.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,ti.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,ti.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,ti.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,ti.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,ti.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var i;let e=this.lastCommitTimestamp,r=this.plugin.state.offlineMode;if(e){let n=(0,ti.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${r?"Offline: ":""}Last Commit: ${n}`,((i=this.unPushedCommits)!=null?i:0)>0&&(this.statusBarEl.ariaLabel+=`
|
||||
(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,ti.setIcon)(this.iconEl,"globe"):(0,ti.setIcon)(this.iconEl,"check"),this.plugin.settings.changedFilesInStatusBar&&this.plugin.cachedStatus&&this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()),this.statusBarEl.addClass(this.base+"idle")}async refreshCommitTimestamp(){this.lastCommitTimestamp=await this.plugin.gitManager.getLastCommitTime(),this.unPushedCommits=await this.plugin.gitManager.getUnpushedCommits()}remove(){this.statusBarEl.remove()}};m();var _h=require("obsidian"),bh=class extends _h.SuggestModal{constructor(r){super(r.app);this.plugin=r;this.resolve=null;this.setPlaceholder("Type your message and select optional the version with the added date.")}openAndGetResult(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>window.setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(r){let i=(0,_h.moment)().format(this.plugin.settings.commitDateFormat);return r==""&&(r="..."),[r,`${i}: ${r}`,`${r}: ${i}`]}renderSuggestion(r,i){i.innerText=r}onChooseSuggestion(r,i){this.resolve&&this.resolve(r)}};m();var K2=require("obsidian"),$u=class{constructor(e){this.plugin=e}saveLastAuto(e,r){r==="backup"?this.plugin.localStorage.setLastAutoBackup(e.toString()):r==="pull"?this.plugin.localStorage.setLastAutoPull(e.toString()):r==="push"&&this.plugin.localStorage.setLastAutoPush(e.toString())}loadLastAuto(){var e,r,i;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((r=this.plugin.localStorage.getLastAutoPull())!=null?r:""),push:new Date((i=this.plugin.localStorage.getLastAutoPush())!=null?i:"")}}async init(){await this.setUpAutoCommitAndSync();let e=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let r=this.diff(this.plugin.settings.autoPushInterval,e.push);this.startAutoPush(r)}if(this.plugin.settings.autoPullInterval>0){let r=this.diff(this.plugin.settings.autoPullInterval,e.pull);this.startAutoPull(r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...e){this.plugin.localStorage.getPausedAutomatics()||(e.contains("commit")&&(this.clearAutoCommitAndSync(),this.plugin.settings.autoSaveInterval>0&&this.startAutoCommitAndSync(this.plugin.settings.autoSaveInterval)),e.contains("push")&&(this.clearAutoPush(),this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0&&this.startAutoPush(this.plugin.settings.autoPushInterval)),e.contains("pull")&&(this.clearAutoPull(),this.plugin.settings.autoPullInterval>0&&this.startAutoPull(this.plugin.settings.autoPullInterval)))}async setUpAutoCommitAndSync(){if(this.plugin.settings.setLastSaveToLastCommit){this.clearAutoCommitAndSync();let e=await this.plugin.gitManager.getLastCommitTime();e&&this.saveLastAuto(e,"backup")}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let e=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let r=this.diff(this.plugin.settings.autoSaveInterval,e.backup);this.startAutoCommitAndSync(r)}}}startAutoCommitAndSync(e){let r=(e!=null?e:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?e===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,K2.debounce)(()=>this.doAutoCommitAndSync(),r,!0):(r>2147483647&&(r=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),r))}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(async()=>{if(this.plugin.settings.setLastSaveToLastCommit){let r=await this.plugin.gitManager.getLastCommitTime();if(r){this.saveLastAuto(r,"backup");let i=this.diff(this.plugin.settings.autoSaveInterval,r);if(i>0)return this.startAutoCommitAndSync(i),!1}}let e=this.plugin.settings.autoCommitOnlyStaged;return this.plugin.settings.differentIntervalCommitAndPush?await this.plugin.commit({fromAuto:!0,onlyStaged:e}):await this.plugin.commitAndSync({fromAutoBackup:!0,onlyStaged:e}),!0},e=>{e!==!1&&(this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync())})}startAutoPull(e){let r=(e!=null?e:this.plugin.settings.autoPullInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPull=window.setTimeout(()=>this.doAutoPull(),r)}doAutoPull(){this.plugin.promiseQueue.addTask(()=>this.plugin.pullChangesFromRemote(),()=>{this.saveLastAuto(new Date,"pull"),this.startAutoPull()})}startAutoPush(e){let r=(e!=null?e:this.plugin.settings.autoPushInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPush=window.setTimeout(()=>this.doAutoPush(),r)}doAutoPush(){this.plugin.promiseQueue.addTask(()=>this.plugin.push(),()=>{this.saveLastAuto(new Date,"push"),this.startAutoPush()})}clearAutoCommitAndSync(){var r;let e=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,e=!0),this.plugin.autoCom
Line truncated
|
||||
`)}static newName(){let e=iP[rP]||1;return iP[rP]=e+1,"\u037C"+e.toString(36)}static mount(e,r,i){let n=e[dw],s=i&&i.nonce;n?s&&n.setNonce(s):n=new hw(e,s),n.mount(Array.isArray(r)?r:[r],e)}},nP=new Map,hw=class{constructor(e,r){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=nP.get(i);if(s)return e[dw]=s;this.sheet=new n.CSSStyleSheet,nP.set(i,this)}else this.styleTag=i.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[dw]=this}mount(e,r){let i=this.sheet,n=0,s=0;for(let a=0;a<e.length;a++){let o=e[a],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),i)for(let c=0;c<o.rules.length;c++)i.insertRule(o.rules[c],n++)}else{for(;s<l;)n+=this.modules[s++].rules.length;n+=o.rules.length,s++}}if(i)r.adoptedStyleSheets.indexOf(this.sheet)<0&&(r.adoptedStyleSheets=[this.sheet,...r.adoptedStyleSheets]);else{let a="";for(let l=0;l<this.modules.length;l++)a+=this.modules[l].getRules()+`
|
||||
`;this.styleTag.textContent=a;let o=r.head||r;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var xP=require("@codemirror/language"),_5=require("@lezer/highlight"),kt=class t{constructor(e,r,i,n){this.fromA=e,this.toA=r,this.fromB=i,this.toB=n}offset(e,r=e){return new t(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}};function Ma(t,e,r,i,n,s){if(t==i)return[];let a=yw(t,e,r,i,n,s),o=xw(t,e+a,r,i,n+a,s);e+=a,r-=o,n+=a,s-=o;let l=r-e,c=s-n;if(!l||!c)return[new kt(e,r,n,s)];if(l>c){let f=t.slice(e,r).indexOf(i.slice(n,s));if(f>-1)return[new kt(e,e+f,n,n),new kt(e+f+c,r,s,s)]}else if(c>l){let f=i.slice(n,s).indexOf(t.slice(e,r));if(f>-1)return[new kt(e,e,n,n+f),new kt(r,r,n+f+l,s)]}if(l==1||c==1)return[new kt(e,r,n,s)];let u=SP(t,e,r,i,n,s);if(u){let[f,d,h]=u;return Ma(t,e,f,i,n,d).concat(Ma(t,f+h,r,i,d+h,s))}return y5(t,e,r,i,n,s)}var Iu=1e9,Mu=0,_w=!1;function y5(t,e,r,i,n,s){let a=r-e,o=s-n;if(Iu<1e9&&Math.min(a,o)>Iu*16||Mu>0&&Date.now()>Mu)return Math.min(a,o)>Iu*64?[new kt(e,r,n,s)]:sP(t,e,r,i,n,s);let l=Math.ceil((a+o)/2);pw.reset(l),mw.reset(l);let c=(h,p)=>t.charCodeAt(e+h)==i.charCodeAt(n+p),u=(h,p)=>t.charCodeAt(r-h-1)==i.charCodeAt(s-p-1),f=(a-o)%2!=0?mw:null,d=f?null:pw;for(let h=0;h<l;h++){if(h>Iu||Mu>0&&!(h&63)&&Date.now()>Mu)return sP(t,e,r,i,n,s);let p=pw.advance(h,a,o,l,f,!1,c)||mw.advance(h,a,o,l,d,!0,u);if(p)return x5(t,e,r,e+p[0],i,n,s,n+p[1])}return[new kt(e,r,n,s)]}var Th=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;r<this.len;r++)this.vec[r]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,r,i,n,s,a,o){for(let l=-e+this.start;l<=e-this.end;l+=2){let c=n+l,u=l==-e||l!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,f=u-l;for(;u<r&&f<i&&o(u,f);)u++,f++;if(this.vec[c]=u,u>r)this.end+=2;else if(f>i)this.start+=2;else if(s){let d=n+(r-i)-l;if(d>=0&&d<this.len&&s.vec[d]!=-1)if(a){let h=s.vec[d];if(h>=r-u)return[h,n+h-d]}else{let h=r-s.vec[d];if(u>=h)return[u,f]}}}return null}},pw=new Th,mw=new Th;function x5(t,e,r,i,n,s,a,o){let l=!1;return!Tl(t,i)&&++i==r&&(l=!0),!Tl(n,o)&&++o==a&&(l=!0),l?[new kt(e,r,s,a)]:Ma(t,e,i,n,s,o).concat(Ma(t,i,r,n,o,a))}function EP(t,e){let r=1,i=Math.min(t,e);for(;r<i;)r=r<<1;return r}function yw(t,e,r,i,n,s){if(e==r||e==s||t.charCodeAt(e)!=i.charCodeAt(n))return 0;let a=EP(r-e,s-n);for(let o=e,l=n;;){let c=o+a,u=l+a;if(c>r||u>s||t.slice(o,c)!=i.slice(l,u)){if(a==1)return o-e-(Tl(t,o)?0:1);a=a>>1}else{if(c==r||u==s)return c-e;o=c,l=u}}}function xw(t,e,r,i,n,s){if(e==r||n==s||t.charCodeAt(r-1)!=i.charCodeAt(s-1))return 0;let a=EP(r-e,s-n);for(let o=r,l=s;;){let c=o-a,u=l-a;if(c<e||u<n||t.slice(c,o)!=i.slice(u,l)){if(a==1)return r-o-(Tl(t,o)?0:1);a=a>>1}else{if(c==e||u==n)return r-c;o=c,l=u}}}function gw(t,e,r,i,n,s,a,o){let l=i.slice(n,s),c=null;for(;;){if(c||a<o)return c;for(let u=e+a;;){Tl(t,u)||u++;let f=u+a;if(Tl(t,f)||(f+=f==u+1?1:-1),f>=r)break;let d=t.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let p=yw(t,f,r,i,n+h+d.length,s),g=xw(t,e,u,i,n,n+h),w=d.length+p+g;(!c||c[2]<w)&&(c=[u-g,n+h-g,w])}u=f}if(o<0)return c;a=a>>1}}function SP(t,e,r,i,n,s){let a=r-e,o=s-n;if(a<o){let l=SP(i,n,s,t,e,r);return l&&[l[1],l[0],l[2]]}return a<4||o*2<a?null:gw(t,e,r,i,n,s,Math.floor(a/4),-1)}function sP(t,e,r,i,n,s){_w=!0;let a=r-e,o=s-n,l;if(a<o){let d=gw(i,n,s,t,e,r,Math.floor(a/6),50);l=d&&[d[1],d[0],d[2]]}else l=gw(t,e,r,i,n,s,Math.floor(o/6),50);if(!l)return[new kt(e,r,n,s)];let[c,u,f]=l;return Ma(t,e,c,i,n,u).concat(Ma(t,c+f,r,i,u+f,s))}function kP(t,e){for(let r=1;r<t.length;r++){let i=t[r-1],n=t[r];i.toA>n.fromA-e&&i.toB>n.fromB-e&&(t[r-1]=new kt(i.fromA,n.toA,i.fromB,n.toB),t.splice(r--,1))}}function E5(t,e,r){for(;;){kP(r,1);let i=!1;for(let n=0;n<r.length;n++){let s=r[n],a,o;(a=yw(t,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=r[n]=new kt(s.fromA+a,s.toA,s.fromB+a,s.toB)),(o=xw(t,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=r[n]=new kt(s.fromA,s.toA-o,s.fromB,s.toB-o));let l=s.toA-s.fromA,c=s.toB-s.fromB;if(l&&c)continue;let u=s.fromA-(n?r[n-1].toA:0),f=(n<r.length-1?r[n+1].fromA:t.length)-s.toA;if(!u||!f)continue;let d=l?t.slice(s.fromA,s.toA):e.slice(s.fromB,s.toB);u<=d.length&&t.slice(s.fromA-u,s.fromA)==d.slice(d.length-u)?(r[n]=new kt(s.fromA-u,s.toA-u,s.fromB-u,s.toB-u),i=!0):f<=d.length&&t.slice(s.toA,s.toA+f)==d.slice(0,f)&&(r[n]=new kt(s.fromA+f,s.toA+f,s.fromB+f,s.toB+f),i=!0)}if(!i)break}return r}function S5(t,e,r){for(let i=0,n=0;n<t.length;n++){let s=t[n],a=s.toA-s.fromA,o=s.toB-s.fromB;if(a&&o||a>3||o>3){let l=n==t.length-1?e.length:t[n+1].fromA,c=s.fromA-i,u=l-s.toA,f=oP(e,s.fromA,c),d=aP(e,s.toA,u),h=s.fromA-f,p=d-s.toA;if((!a||!o)&&h&&p){let g=Math.max(a,o),[w,y,b]=a?[e,s.fromA,s.toA]:[r,s.fromB,s.toB];g>h&&e.slice(f,s.fromA)==w.slice(b-h,b)?(s=t[n]=new kt(f,f+a,s.fromB-h,s.toB-h),f=s.fromA,d=aP(e,s.toA,l-s.toA)):g>p&&e.slice(s.toA,d)==w.slice(y,y+p)&&(s=t[n]=new kt(d-a,d,s.fromB+p,s.toB+p),d=s.
Line truncated
|
||||
`),s=e.split(`
|
||||
`);for(let a of r){let{oldStart:o,oldLines:l,newStart:c,newLines:u}=a,f=Wt.createHunk(o,l,c,u);if(a.oldLines>0){for(let d=o;d<o+l;d++)f.removed.lines.push(n[d-1]);o+l>n.length&&n.last()!=""&&(f.removed.no_nl_at_eof=!0)}if(a.newLines>0){for(let d=c;d<c+u;d++)f.added.lines.push(s[d-1]);c+u>s.length&&s.last()!=""&&(f.added.no_nl_at_eof=!0)}i.push(f)}return i}function Aw(t,e,r){let i=e.lineAt(t.fromA).number,n=t.fromA==t.toA?0:$h(e,t.endA)-i+1,s=r.lineAt(t.fromB).number,a=t.fromB==t.toB?0:$h(r,t.endB)-s+1,o={oldStart:i,oldLines:n,newStart:s,newLines:a};return o.oldLines==0&&(o.oldStart-=1),o.newLines==0&&(o.newStart-=1),o}var OP={scanLimit:1e3,timeout:200};function H5(t,e,r,i){let n=Sw.Text.of(t.split(`
|
||||
`)),s=Sw.Text.of(e.split(`
|
||||
`)),a=r&&i?Xn.updateB(r,n,s,i,OP):Xn.build(n,s,OP),o=[];for(let l=0;l<a.length;l++){let c=a[l],u=Aw(c,n,s);o.push(u)}return{hunks:kw(t,e,o),chunks:a}}function LP(t,e,r,i){return H5(t,e,r,i)}var Rl=require("obsidian");function $h(t,e){let r=t.lineAt(e);return!(r.text.length==0&&r.number==t.lines)?r.number:r.number-1}var zi=class{static hasHunksData(e){let r=e.field(Ur,!1);return!!r&&!r.isDirty}static getHunks(e,r){let i=e.field(Ur);return i?r?i.stagedHunks:i.hunks:[]}static getHunkAtPos(e,r,i){if(!e.field(Ur))return;let s=e.doc.lineAt(r).number,a=this.getHunks(e,i);return Wt.findHunk(s,a)[0]}static getCursorHunk(e,r){if(!e.field(Ur))return;let n=e.selection.main.head;return this.getHunkAtPos(e,n,r)}static getHunk(e,r,i){if(i!=null)return this.getHunkAtPos(e,i,r);if(e.selection.main.empty)return this.getCursorHunk(e,r);let n=e.selection.main.from,s=e.selection.main.to,a=e.doc.lineAt(n).number,o=$h(e.doc,s),l=this.getHunks(e,r),c=Wt.createPartialHunk(l,a,o);if(!c)return;let u=e.field(Ur);if(r){let f=a,d=o;for(let h of u.hunks)a>h.vend&&(f=f-(h.added.count-h.removed.count)),o>h.vend&&(d=d-(h.added.count-h.removed.count));c.added.lines=u.compareText.split(`
|
||||
`).slice(f-1,d),u.compareTextHead?c.removed.lines=u.compareTextHead.split(`
|
||||
`).slice(c.removed.start-1,c.removed.start-1+c.removed.count):c.removed.lines=[]}else c.added.lines=e.doc.toString().split(`
|
||||
`).slice(a-1,o),o===e.doc.lines&&!e.doc.toString().endsWith(`
|
||||
`)&&(c.added.no_nl_at_eof=!0),c.removed.lines=u.compareText.split(`
|
||||
`).slice(c.removed.start-1,c.removed.start-1+c.removed.count),c.removed.start+c.removed.count-1===u.compareText.split(`
|
||||
`).length&&!u.compareText.endsWith(`
|
||||
`)&&(c.removed.no_nl_at_eof=!0);return c}},Ur=Pl.StateField.define({create:t=>{},update:(t,e)=>{let r=t?{...t}:{maxDiffTimeMs:0,hunks:[],stagedHunks:[],chunks:void 0,isDirty:!1},i=!1;for(let n of e.effects)n.is($l)&&(r.compareText=n.value.compareText,r.compareTextHead=n.value.compareTextHead,i=(t==null?void 0:t.compareText)!==n.value.compareText,i&&(r.chunks=void 0)),n.is(Ou)&&NP(r,n.value,e.state);if(r.compareText!==void 0){if(i||e.docChanged){r.isDirty=!0;let n=U5(e,r.compareText,r.chunks,r.maxDiffTimeMs);n&&NP(r,n,e.state)}}else r.compareText=void 0,r.compareTextHead=void 0,r.chunks=void 0,r.hunks=[],r.stagedHunks=[],r.isDirty=!1;return r}});function NP(t,e,r){var n,s;t.hunks=e.hunks,t.chunks=e.chunks,t.isDirty=!1,t.maxDiffTimeMs=Math.max(.95*t.maxDiffTimeMs,e.diffDuration);let i=r.field(Rl.editorInfoField).file;(s=(n=zt.plugin)==null?void 0:n.editorIntegration.signsFeature.changeStatusBar)==null||s.display(t.hunks,i)}var Cw=Pl.StateField.define({create:()=>({debouncer:(0,Rl.debounce)(t=>{let{state:e,compareText:r,previousChunks:i,changeDesc:n}=t,s=BP(e,r,i,n);e.field(Rl.editorEditorField).dispatch({effects:Ou.of(s)})},1e3,!0),maxDiffTimeMs:0}),update:(t,e)=>{var r;for(let i of e.effects)if(i.is(Ou))return t.changeDesc=void 0,t;return!t.changeDesc&&e.changes?t.changeDesc=e.changes:t.changeDesc=(r=t.changeDesc)==null?void 0:r.composeDesc(e.changes),t}});function BP(t,e,r,i){let n=t.doc.toString(),s=performance.now(),{hunks:a,chunks:o}=LP(e,n,r,i),l=performance.now()-s;return{hunks:a,chunks:o,diffDuration:l}}function U5(t,e,r,i){let n=t.state,s=Math.abs(t.changes.length-t.changes.newLength),a=n.field(Cw);if(s>1e3||i>16)a.debouncer({state:n,compareText:e,previousChunks:r,changeDesc:a.changeDesc});else return a.changeDesc=void 0,BP(n,e,r,t.changes)}var $l=Pl.StateEffect.define(),Ou=Pl.StateEffect.define();function HP(t,e){return e.update({effects:$l.of(t)})}m();m();m();var at;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(at||(at={}));var UP={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},GP={LINES:"lines",WORDS:"words",NONE:"none"},jP={WORD:"word",CHAR:"char"},Da;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(Da||(Da={}));m();var G5=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],j5=RegExp("["+G5.join("\\")+"]","g");function VP(t){return t.replace(j5,"\\$&")}function Tw(t){return t&&t.replace(/\\/g,"/")}function zP(t){let e,r,i,n=0;for(e=0,i=t.length;e<i;e++)r=t.charCodeAt(e),n=(n<<5)-n+r,n|=0;return n}function Fh(t){let e=t.length,r=-1/0;for(let i=0;i<e;i++)r=Math.max(r,t[i]);return r}function WP(t,e){let r=t.split(".");return r.length>1?r[r.length-1]:e}function qP(t,e){return e.reduce((r,i)=>r||t.startsWith(i),!1)}var YP=["a/","b/","i/","w/","c/","o/"];function Us(t,e,r){let i=r!==void 0?[...YP,r]:YP,n=e?new RegExp(`^${VP(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,s=""]=n.exec(t)||[],a=i.find(l=>s.indexOf(l)===0);return(a?s.slice(a.length):s).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function V5(t,e){return Us(t,"---",e)}function z5(t,e){return Us(t,"+++",e)}function ZP(t,e={}){let r=[],i=null,n=null,s=null,a=null,o=null,l=null,c=null,u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,p=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,w=/^new file mode (\d{6})/,y=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,S=/^rename from "?(.+)"?/,C=/^rename to "?(.+)"?/,A=/^similarity index (\d+)%/,k=/^dissimilarity index (\d+)%/,v=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,x=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,P=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,T=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,M=/^new file mode (\d{6})/,$=/^deleted file mode (\d{6}),(\d{6})/,D=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,`
|
||||
`).split(`
|
||||
`);function Q(){n!==null&&i!==null&&(i.blocks.push(n),n=null)}function ye(){i!==null&&(!i.oldName&&l!==null&&(i.oldName=l),!i.newName&&c!==null&&(i.newName=c),i.newName&&(r.push(i),i=null)),l=null,c=null}function de(){Q(),ye(),i={blocks:[],deletedLines:0,addedLines:0}}function J(z){Q();let K;i!==null&&((K=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(z))?(i.isCombined=!1,s=parseInt(K[1],10),o=parseInt(K[2],10)):(K=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(z))?(i.isCombined=!0,s=parseInt(K[1],10),a=parseInt(K[2],10),o=parseInt(K[3],10)):(z.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),s=0,o=0,i.isCombined=!1)),n={lines:[],oldStartLine:s,oldStartLine2:a,newStartLine:o,header:z}}function X(z){if(i===null||n===null||s===null||o===null)return;let K={content:z},G=i.isCombined?["+ "," +","++"]:["+"],Me=i.isCombined?["- "," -","--"]:["-"];qP(z,G)?(i.addedLines++,K.type=at.INSERT,K.oldNumber=void 0,K.newNumber=o++):qP(z,Me)?(i.deletedLines++,K.type=at.DELETE,K.oldNumber=s++,K.newNumber=void 0):(K.type=at.CONTEXT,K.oldNumber=s++,K.newNumber=o++),n.lines.push(K)}function he(z,K){let G=K;for(;G<D.length-3;){if(z.startsWith("diff"))return!1;if(D[G].startsWith(u)&&D[G+1].startsWith(f)&&D[G+2].startsWith(d))return!0;G++}return!1}return D.forEach((z,K)=>{if(!z||z.startsWith("*"))return;let G,Me=D[K-1],Et=D[K+1],Ht=D[K+2];if(z.startsWith("diff --git")||z.startsWith("diff --combined")){if(de(),(G=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(z))&&(l=Us(G[1],void 0,e.dstPrefix),c=Us(G[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isGitDiff=!0;return}if(z.startsWith("Binary files")&&!(i!=null&&i.isGitDiff)){if(de(),(G=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(z))&&(l=Us(G[1],void 0,e.dstPrefix),c=Us(G[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isBinary=!0;return}if((!i||!i.isGitDiff&&i&&z.startsWith(u)&&Et.startsWith(f)&&Ht.startsWith(d))&&de(),i!=null&&i.isTooBig)return;if(i&&(typeof e.diffMaxChanges=="number"&&i.addedLines+i.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&z.length>e.diffMaxLineLength)){i.isTooBig=!0,i.addedLines=0,i.deletedLines=0,i.blocks=[],n=null;let Rt=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(r.length):"Diff too big to be displayed";J(Rt);return}if(z.startsWith(u)&&Et.startsWith(f)||z.startsWith(f)&&Me.startsWith(u)){if(i&&!i.oldName&&z.startsWith("--- ")&&(G=V5(z,e.srcPrefix))){i.oldName=G,i.language=WP(i.oldName,i.language);return}if(i&&!i.newName&&z.startsWith("+++ ")&&(G=z5(z,e.dstPrefix))){i.newName=G,i.language=WP(i.newName,i.language);return}}if(i&&(z.startsWith(d)||i.isGitDiff&&i.oldName&&i.newName&&!n)){J(z);return}if(n&&(z.startsWith("+")||z.startsWith("-")||z.startsWith(" "))){X(z);return}let De=!he(z,K);if(i===null)throw new Error("Where is my file !!!");(G=h.exec(z))?i.oldMode=G[1]:(G=p.exec(z))?i.newMode=G[1]:(G=g.exec(z))?(i.deletedFileMode=G[1],i.isDeleted=!0):(G=w.exec(z))?(i.newFileMode=G[1],i.isNew=!0):(G=y.exec(z))?(De&&(i.oldName=G[1]),i.isCopy=!0):(G=b.exec(z))?(De&&(i.newName=G[1]),i.isCopy=!0):(G=S.exec(z))?(De&&(i.oldName=G[1]),i.isRename=!0):(G=C.exec(z))?(De&&(i.newName=G[1]),i.isRename=!0):(G=x.exec(z))?(i.isBinary=!0,i.oldName=Us(G[1],void 0,e.srcPrefix),i.newName=Us(G[2],void 0,e.dstPrefix),J("Binary file")):_.test(z)?(i.isBinary=!0,J(z)):(G=A.exec(z))?i.unchangedPercentage=parseInt(G[1],10):(G=k.exec(z))?i.changedPercentage=parseInt(G[1],10):(G=v.exec(z))?(i.checksumBefore=G[1],i.checksumAfter=G[2],G[3]&&(i.mode=G[3])):(G=P.exec(z))?(i.checksumBefore=[G[2],G[3]],i.checksumAfter=G[1]):(G=T.exec(z))?(i.oldMode=[G[2],G[3]],i.newMode=G[1]):(G=M.exec(z))?(i.newFileMode=G[1],i.isNew=!0):(G=$.exec(z))&&(i.deletedFileMode=G[1],i.isDeleted=!0)}),Q(),ye(),r}m();m();m();m();var Gs=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],r,e,0,i);if(h[0].oldPos+1>=l&&p+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,w=1/0,y=()=>{for(let b=Math.max(g,-c);b<=Math.min(w,c);b+=2){let S,C=h[b-1],A=h[b+1];C&&(h[b-1]=void 0);let k=!1;if(A){let x=A.oldPos-b;k=A&&0<=x&&x<o}let v=C&&C.oldPos+1<l;if(!k&&!v){h[b]=void 0;continue}if(!v||k&&C.oldPos<A.oldPos?S=this.addToPath(A,!0,!1,0,i):S=this.addToPath(C,!1,!0,1,i),p=this.extractCommon(S,r,e,b,i),S.oldPos+1>=l&&p+1>=o)return a(this.buildValues(S.lastComponent,r,e))||!0;h[b]=S,S.oldPos+1>=l&&(w=Math.min(w,b-1)),p+1>
Line truncated
|
||||
`);return this.hoganUtils.render(eR,"wrapper",{colorScheme:Ll(this.config.colorScheme),filesNumber:e.length,files:r})}};m();var Uw=Object.assign(Object.assign({},La),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Nu="generic",tR="line-by-line",n4="icon",s4="tag",Bu=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Uw),r)}render(e){let r=e.map(i=>{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(`
|
||||
`);return this.hoganUtils.render(Nu,"wrapper",{colorScheme:Ll(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(tR,"file-diff"),n=this.hoganUtils.template(Nu,"file-path"),s=this.hoganUtils.template(n4,"file"),a=this.hoganUtils.template(s4,Bl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Na(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return this.hoganUtils.render(Nu,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Jt})}generateFileHtml(e){let r=Dl(Ml(i=>ki(i.content,e.isCombined).content));return e.blocks.map(i=>{let n=this.hoganUtils.render(Nu,"block-header",{CSSLineClass:Jt,blockHeader:e.isTooBig?i.header:js(i.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);n+=u,n+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=ki(l.content,e.isCombined);n+=this.generateSingleLineHtml(e,{type:Jt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,a,o);n+=l,n+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).join(`
|
||||
`)}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s<e.lines.length;s++){let a=e.lines[s];(a.type!==at.INSERT&&n.length||a.type===at.CONTEXT&&i.length>0)&&(r.push([[],i,n]),i=[],n=[]),a.type===at.CONTEXT?r.push([[a],[],[]]):a.type===at.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===at.INSERT&&i.length>0?n.push(a):a.type===at.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=Fh(e.concat(r).map(o=>o.content.length));return n<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?i(e,r):[[e,r]]}processChangedLines(e,r,i,n){let s={right:"",left:""},a=Math.max(i.length,n.length);for(let o=0;o<a;o++){let l=i[o],c=n[o],u=l!==void 0&&c!==void 0?Lh(l.content,c.content,r,this.config):void 0,f=l!==void 0&&l.oldNumber!==void 0?Object.assign(Object.assign({},u!==void 0?{prefix:u.oldLine.prefix,content:u.oldLine.content,type:Jt.DELETE_CHANGES}:Object.assign(Object.assign({},ki(l.content,r)),{type:Ol(l.type)})),{oldNumber:l.oldNumber,newNumber:l.newNumber}):void 0,d=c!==void 0&&c.newNumber!==void 0?Object.assign(Object.assign({},u!==void 0?{prefix:u.newLine.prefix,content:u.newLine.content,type:Jt.INSERT_CHANGES}:Object.assign(Object.assign({},ki(c.content,r)),{type:Ol(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,{left:h,right:p}=this.generateLineHtml(e,f,d);s.left+=h,s.right+=p}return s}generateLineHtml(e,r,i){return{left:this.generateSingleLineHtml(e,r),right:this.generateSingleLineHtml(e,i)}}generateSingleLineHtml(e,r){if(r===void 0)return"";let i=this.hoganUtils.render(tR,"numbers",{oldNumber:r.oldNumber||"",newNumber:r.newNumber||""});return this.hoganUtils.render(Nu,"line",{type:r.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:r.prefix===" "?" ":r.prefix,content:r.content,lineNumber:i,line:r,file:e})}};m();var Gw=Object.assign(Object.assign({},La),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Hu="generic",a4="side-by-side",o4="icon",l4="tag",Uu=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Gw),r)}render(e){let r=e.map(i=>{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(`
|
||||
`);return this.hoganUtils.render(Hu,"wrapper",{colorScheme:Ll(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(a4,"file-diff"),n=this.hoganUtils.template(Hu,"file-path"),s=this.hoganUtils.template(o4,"file"),a=this.hoganUtils.template(l4,Bl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Na(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Hu,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Jt})}}generateFileHtml(e){let r=Dl(Ml(i=>ki(i.content,e.isCombined).content));return e.blocks.map(i=>{let n={left:this.makeHeaderHtml(i.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);n.left+=u,n.right+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=ki(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:Jt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:Jt.CONTEXT,prefix:c,content:u,number:l.newNumber});n.left+=f,n.right+=d});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,a,o);n.left+=l,n.right+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).reduce((i,n)=>({left:i.left+n.left,right:i.right+n.right}),{left:"",right:""})}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s<e.lines.length;s++){let a=e.lines[s];(a.type!==at.INSERT&&n.length||a.type===at.CONTEXT&&i.length>0)&&(r.push([[],i,n]),i=[],n=[]),a.type===at.CONTEXT?r.push([[a],[],[]]):a.type===at.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===at.INSERT&&i.length>0?n.push(a):a.type===at.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=Fh(e.concat(r).map(o=>o.content.length));return n<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?i(e,r):[[e,r]]}makeHeaderHtml(e,r){return this.hoganUtils.render(Hu,"block-header",{CSSLineClass:Jt,blockHeader:r!=null&&r.isTooBig?e:js(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,r,i){let n={right:"",left:""},s=Math.max(r.length,i.length);for(let a=0;a<s;a++){let o=r[a],l=i[a],c=o!==void 0&&l!==void 0?Lh(o.content,l.content,e,this.config):void 0,u=o!==void 0&&o.oldNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.oldLine.prefix,content:c.oldLine.content,type:Jt.DELETE_CHANGES}:Object.assign(Object.assign({},ki(o.content,e)),{type:Ol(o.type)})),{number:o.oldNumber}):void 0,f=l!==void 0&&l.newNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.newLine.prefix,content:c.newLine.content,type:Jt.INSERT_CHANGES}:Object.assign(Object.assign({},ki(l.content,e)),{type:Ol(l.type)})),{number:l.newNumber}):void 0,{left:d,right:h}=this.generateLineHtml(u,f);n.left+=d,n.right+=h}return n}generateLineHtml(e,r){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(r)}}generateSingleHtml(e){let r="d2h-code-side-linenumber",i="d2h-code-side-line";return this.hoganUtils.render(Hu,"line",{type:(e==null?void 0:e.type)||`${Jt.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?r:`${r} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?i:`${i} d2h-code-side-emptyplaceholder`,prefix:(e==null?void 0:e.prefix)===" "?" ":e==null?void 0:e.prefix,content:e==null?void 0:e.content,lineNumber:e==null?void 0:e.number})}};m();var Ww=Gt(zw());m();var At=Gt(zw()),xt={};xt["file-summary-line"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<li class="d2h-file-list-line">'),i.b(`
|
||||
`+r),i.b(' <span class="d2h-file-name-wrapper">'),i.b(`
|
||||
`+r),i.b(i.rp("<fileIcon0",t,e," ")),i.b(' <a href="#'),i.b(i.v(i.f("fileHtmlId",t,e,0))),i.b('" class="d2h-file-name">'),i.b(i.v(i.f("fileName",t,e,0))),i.b("</a>"),i.b(`
|
||||
`+r),i.b(' <span class="d2h-file-stats">'),i.b(`
|
||||
`+r),i.b(' <span class="d2h-lines-added">'),i.b(i.v(i.f("addedLines",t,e,0))),i.b("</span>"),i.b(`
|
||||
`+r),i.b(' <span class="d2h-lines-deleted">'),i.b(i.v(i.f("deletedLines",t,e,0))),i.b("</span>"),i.b(`
|
||||
`+r),i.b(" </span>"),i.b(`
|
||||
`+r),i.b(" </span>"),i.b(`
|
||||
`+r),i.b("</li>"),i.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});xt["file-summary-wrapper"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div class="d2h-file-list-wrapper '),i.b(i.v(i.f("colorScheme",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(' <div class="d2h-file-list-header">'),i.b(`
|
||||
`+r),i.b(' <span class="d2h-file-list-title">Files changed ('),i.b(i.v(i.f("filesNumber",t,e,0))),i.b(")</span>"),i.b(`
|
||||
`+r),i.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),i.b(`
|
||||
`+r),i.b(' <a class="d2h-file-switch d2h-show">show</a>'),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(' <ol class="d2h-file-list">'),i.b(`
|
||||
`+r),i.b(" "),i.b(i.t(i.f("files",t,e,0))),i.b(`
|
||||
`+r),i.b(" </ol>"),i.b(`
|
||||
`+r),i.b("</div>"),i.fl()},partials:{},subs:{}});xt["generic-block-header"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b("<tr>"),i.b(`
|
||||
`+r),i.b(' <td class="'),i.b(i.v(i.f("lineClass",t,e,0))),i.b(" "),i.b(i.v(i.d("CSSLineClass.INFO",t,e,0))),i.b('"></td>'),i.b(`
|
||||
`+r),i.b(' <td class="'),i.b(i.v(i.d("CSSLineClass.INFO",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(' <div class="'),i.b(i.v(i.f("contentClass",t,e,0))),i.b('">'),i.s(i.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(a.t(a.f("blockHeader",n,s,0)))}),t.pop()),i.s(i.f("blockHeader",t,e,1),t,e,1,0,0,"")||i.b(" "),i.b("</div>"),i.b(`
|
||||
`+r),i.b(" </td>"),i.b(`
|
||||
`+r),i.b("</tr>"),i.fl()},partials:{},subs:{}});xt["generic-empty-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b("<tr>"),i.b(`
|
||||
`+r),i.b(' <td class="'),i.b(i.v(i.d("CSSLineClass.INFO",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(' <div class="'),i.b(i.v(i.f("contentClass",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(" File without changes"),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(" </td>"),i.b(`
|
||||
`+r),i.b("</tr>"),i.fl()},partials:{},subs:{}});xt["generic-file-path"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-file-name-wrapper">'),i.b(`
|
||||
`+r),i.b(i.rp("<fileIcon0",t,e," ")),i.b(' <span class="d2h-file-name">'),i.b(i.v(i.f("fileDiffName",t,e,0))),i.b("</span>"),i.b(`
|
||||
`+r),i.b(i.rp("<fileTag1",t,e," ")),i.b("</span>"),i.b(`
|
||||
`+r),i.b('<label class="d2h-file-collapse">'),i.b(`
|
||||
`+r),i.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),i.b(`
|
||||
`+r),i.b(" Viewed"),i.b(`
|
||||
`+r),i.b("</label>"),i.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});xt["generic-line"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b("<tr>"),i.b(`
|
||||
`+r),i.b(' <td class="'),i.b(i.v(i.f("lineClass",t,e,0))),i.b(" "),i.b(i.v(i.f("type",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(" "),i.b(i.t(i.f("lineNumber",t,e,0))),i.b(`
|
||||
`+r),i.b(" </td>"),i.b(`
|
||||
`+r),i.b(' <td class="'),i.b(i.v(i.f("type",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(' <div class="'),i.b(i.v(i.f("contentClass",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.s(i.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' <span class="d2h-code-line-prefix">'),a.b(a.t(a.f("prefix",n,s,0))),a.b("</span>"),a.b(`
|
||||
`+r)}),t.pop()),i.s(i.f("prefix",t,e,1),t,e,1,0,0,"")||(i.b(' <span class="d2h-code-line-prefix"> </span>'),i.b(`
|
||||
`+r)),i.s(i.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' <span class="d2h-code-line-ctn">'),a.b(a.t(a.f("content",n,s,0))),a.b("</span>"),a.b(`
|
||||
`+r)}),t.pop()),i.s(i.f("content",t,e,1),t,e,1,0,0,"")||(i.b(' <span class="d2h-code-line-ctn"><br></span>'),i.b(`
|
||||
`+r)),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(" </td>"),i.b(`
|
||||
`+r),i.b("</tr>"),i.fl()},partials:{},subs:{}});xt["generic-wrapper"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div class="d2h-wrapper '),i.b(i.v(i.f("colorScheme",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(" "),i.b(i.t(i.f("content",t,e,0))),i.b(`
|
||||
`+r),i.b("</div>"),i.fl()},partials:{},subs:{}});xt["icon-file-added"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),i.b(`
|
||||
`+r),i.b(' width="14">'),i.b(`
|
||||
`+r),i.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),i.b(`
|
||||
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});xt["icon-file-changed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),i.b(`
|
||||
`+r),i.b(' viewBox="0 0 14 16" width="14">'),i.b(`
|
||||
`+r),i.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),i.b(`
|
||||
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});xt["icon-file-deleted"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),i.b(`
|
||||
`+r),i.b(' viewBox="0 0 14 16" width="14">'),i.b(`
|
||||
`+r),i.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),i.b(`
|
||||
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});xt["icon-file-renamed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),i.b(`
|
||||
`+r),i.b(' viewBox="0 0 14 16" width="14">'),i.b(`
|
||||
`+r),i.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),i.b(`
|
||||
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});xt["icon-file"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),i.b(`
|
||||
`+r),i.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),i.b(`
|
||||
`+r),i.b("</svg>"),i.fl()},partials:{},subs:{}});xt["line-by-line-file-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div id="'),i.b(i.v(i.f("fileHtmlId",t,e,0))),i.b('" class="d2h-file-wrapper" data-lang="'),i.b(i.v(i.d("file.language",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(' <div class="d2h-file-header">'),i.b(`
|
||||
`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(' <div class="d2h-file-diff">'),i.b(`
|
||||
`+r),i.b(' <div class="d2h-code-wrapper">'),i.b(`
|
||||
`+r),i.b(' <table class="d2h-diff-table">'),i.b(`
|
||||
`+r),i.b(' <tbody class="d2h-diff-tbody">'),i.b(`
|
||||
`+r),i.b(" "),i.b(i.t(i.f("diffs",t,e,0))),i.b(`
|
||||
`+r),i.b(" </tbody>"),i.b(`
|
||||
`+r),i.b(" </table>"),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b("</div>"),i.fl()},partials:{},subs:{}});xt["line-by-line-numbers"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div class="line-num1">'),i.b(i.v(i.f("oldNumber",t,e,0))),i.b("</div>"),i.b(`
|
||||
`+r),i.b('<div class="line-num2">'),i.b(i.v(i.f("newNumber",t,e,0))),i.b("</div>"),i.fl()},partials:{},subs:{}});xt["side-by-side-file-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<div id="'),i.b(i.v(i.f("fileHtmlId",t,e,0))),i.b('" class="d2h-file-wrapper" data-lang="'),i.b(i.v(i.d("file.language",t,e,0))),i.b('">'),i.b(`
|
||||
`+r),i.b(' <div class="d2h-file-header">'),i.b(`
|
||||
`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(' <div class="d2h-files-diff">'),i.b(`
|
||||
`+r),i.b(' <div class="d2h-file-side-diff">'),i.b(`
|
||||
`+r),i.b(' <div class="d2h-code-wrapper">'),i.b(`
|
||||
`+r),i.b(' <table class="d2h-diff-table">'),i.b(`
|
||||
`+r),i.b(' <tbody class="d2h-diff-tbody">'),i.b(`
|
||||
`+r),i.b(" "),i.b(i.t(i.d("diffs.left",t,e,0))),i.b(`
|
||||
`+r),i.b(" </tbody>"),i.b(`
|
||||
`+r),i.b(" </table>"),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(' <div class="d2h-file-side-diff">'),i.b(`
|
||||
`+r),i.b(' <div class="d2h-code-wrapper">'),i.b(`
|
||||
`+r),i.b(' <table class="d2h-diff-table">'),i.b(`
|
||||
`+r),i.b(' <tbody class="d2h-diff-tbody">'),i.b(`
|
||||
`+r),i.b(" "),i.b(i.t(i.d("diffs.right",t,e,0))),i.b(`
|
||||
`+r),i.b(" </tbody>"),i.b(`
|
||||
`+r),i.b(" </table>"),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b(" </div>"),i.b(`
|
||||
`+r),i.b("</div>"),i.fl()},partials:{},subs:{}});xt["tag-file-added"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),i.fl()},partials:{},subs:{}});xt["tag-file-changed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),i.fl()},partials:{},subs:{}});xt["tag-file-deleted"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),i.fl()},partials:{},subs:{}});xt["tag-file-renamed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),i.fl()},partials:{},subs:{}});var Gu=class{constructor({compiledTemplates:e={},rawTemplates:r={}}){let i=Object.entries(r).reduce((n,[s,a])=>{let o=Ww.compile(a,{asString:!1});return Object.assign(Object.assign({},n),{[s]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},xt),e),i)}static compile(e){return Ww.compile(e,{asString:!1})}render(e,r,i,n,s){let a=this.templateKey(e,r);try{return this.preCompiledTemplates[a].render(i,n,s)}catch(o){throw new Error(`Could not find template to render '${a}'`)}}template(e,r){return this.preCompiledTemplates[this.templateKey(e,r)]}templateKey(e,r){return`${e}-${r}`}};var u4=Object.assign(Object.assign(Object.assign({},Uw),Gw),{outputFormat:UP.LINE_BY_LINE,drawFileList:!0});function Hh(t,e={}){let r=Object.assign(Object.assign({},u4),e),i=typeof t=="string"?ZP(t,r):t,n=new Gu(r),{colorScheme:s}=r,a={colorScheme:s},o=r.drawFileList?new Nh(n,a).render(i):"",l=r.outputFormat==="side-by-side"?new Uu(n,r).render(i):new Bu(n,r).render(i);return o+l}var cR=Gt(oR(),1);var Ba=require("obsidian"),qw=ju.StateEffect.define();function Vs(t,e){let r=t.state,i=r.field(Gh),n=r.field(Ur),s=r.doc.lineAt(e!=null?e:r.selection.main.head).number,a=Wt.findHunk(s,n==null?void 0:n.hunks)[0];if(!a)return;let o=r.doc.line(Math.max(1,a.added.start)).from,l=i.has(o);return r.field(Ba.editorEditorField).dispatch({effects:qw.of({pos:o,add:!l})})}var Gh=ju.StateField.define({create:()=>new Set,update(t,e){let r=new Set;for(let i of e.effects)i.is(qw)&&(i.value.add?t.add(i.value.pos):t.delete(i.value.pos));for(let i of t)r.add(e.changes.mapPos(i));return r}}),uR=ju.StateField.define({create:t=>lR(t),update(t,e){return e.docChanged||e.effects.some(r=>r.is($l)||r.is(qw))?lR(e.state):t},provide:t=>Uh.showTooltip.computeN([t],e=>e.field(t))}),fR=Uh.EditorView.baseTheme({".cm-tooltip.git-diff-tooltip":{"z-index":"var(--layer-popover)",backgroundColor:"var(--background-primary-alt)",border:"var(--border-width) solid var(--background-primary-alt)",borderRadius:"var(--radius-s)"},".cm-tooltip.git-diff-tooltip .tooltip-toolbar":{display:"flex",padding:"var(--size-2-1)"}});function lR(t){let e=t.field(Ur);return e?[...t.field(Gh)].map(i=>{let n=t.doc.lineAt(i),s=Wt.findHunk(n.number,e.hunks)[0];if(s)return{pos:i,above:!1,arrow:!1,strictSide:!0,clip:!1,create:()=>f4(s,t,i)}}).filter(i=>i!==void 0):[]}function f4(t,e,r){var g,w;let i=Wt.createPatch("file",[t],"10064",!1).join(`
|
||||
`)+`
|
||||
`,n=Hh(i,{colorScheme:cR.ColorSchemeType.AUTO,diffStyle:"word",drawFileList:!1}),s=new DOMParser().parseFromString(n,"text/html").querySelector(".d2h-file-diff"),a=createDiv();a.addClass("tooltip-toolbar");let o=(y,b)=>{let S=createDiv();return(0,Ba.setIcon)(S,y),S.setAttr("aria-label",b),S.addClass("clickable-icon"),S},l=o("x","Close hunk"),c=o("plus","Stage hunk"),u=o("undo","Reset hunk");a.appendChild(l),a.appendChild(c),a.appendChild(u);let f=createDiv();f.appendChild(a),f.appendChild(s),f.addClass("git-diff-tooltip","git-diff");let d=e.field(Ba.editorEditorField);l.onclick=()=>{Vs(d,r)},c.onclick=()=>{let y=zt.plugin;y&&(y.promiseQueue.addTask(()=>y.hunkActions.stageHunk(r)),Vs(d,r))},u.onclick=()=>{let y=zt.plugin;y&&(y.hunkActions.resetHunk(r),Vs(d,r))};let h=(w=(g=zt.plugin)==null?void 0:g.app.workspace.getActiveViewOfType(Ba.MarkdownView))==null?void 0:w.scope,p=h==null?void 0:h.register(null,"Escape",(y,b)=>{Vs(d,r)});return{dom:f,destroy:()=>{p&&(h==null||h.unregister(p))},update:y=>{r=y.changes.mapPos(r)}}}function dR(t){let e=t.app;t.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let r=t.gitManager.getRelativeVaultPath(".gitignore");await e.vault.adapter.exists(r)||await e.vault.adapter.write(r,"");let i=await e.vault.adapter.read(r),s=await new xh(e,i).openAndGetReslt();s!==void 0&&(await e.vault.adapter.write(r,s),await t.refresh())}}),t.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(Qt.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:Qt.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(bi.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:bi.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;{let n=t.gitManager.getRelativeRepoPath(i.path,!0);t.tools.openDiff({aFile:n,aRef:""})}}}),t.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(r,{file:i})=>{if(i)return X2(r,i,t.gitManager)}}),t.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(r,{file:i})=>{if(i)return Q2(i,t.gitManager)}}),t.addCommand({id:"pull",name:"Pull",callback:()=>t.promiseQueue.addTask(()=>t.pullChangesFromRemote())}),t.addCommand({id:"fetch",name:"Fetch",callback:()=>t.promiseQueue.addTask(()=>t.fetch())}),t.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>t.promiseQueue.addTask(()=>t.switchRemoteBranch())}),t.addCommand({id:"add-to-gitignore",name:"Add file to .gitignore",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.addFileToGitignore(i.path,i instanceof Wi.TFolder).catch(n=>t.displayError(n))}}),t.addCommand({id:"push",name:"Commit-and-sync",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1}))}),t.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>t.promiseQueue.addTask(async()=>{await t.commitAndSync({fromAutoBackup:!1}),window.close()})}),t.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit",name:"Commit all changes",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1}))}),t.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit-smart",name:"Commit",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:i})})}),t.addCommand({id:"commit-staged",name:"Commit staged",checkCallback:function(r){if(r)return!1;t.promiseQueue.addTask(async()=>t.commit({fromAuto:!1,requestCustomMessage:!1}))}}),Wi.Platform.isDesktopApp&&t.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0,amend:!0}))}),t.addCommand({id:"commit-smart-specified-message",name:"Commit with specific message",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:i})})}),t.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",checkCallback:function(r){return r?!1:t.promiseQueue.addTask(()=>t.commit({fromAuto
Line truncated
|
||||
- ${s.map(o=>o.vaultPath).join(`
|
||||
- `)}
|
||||
Please remove them or add to .gitignore.`),!0}return!1}async writeAndOpenFile(e){e!==void 0&&await this.plugin.app.vault.adapter.write(il,e);let r=!1;this.plugin.app.workspace.iterateAllLeaves(i=>{i.getDisplayText()!=""&&il.startsWith(i.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(il,"/",!0)}openDiff({aFile:e,bFile:r,aRef:i,bRef:n,event:s}){var l,c;let a=this.plugin.settings.diffStyle;Hl.Platform.isMobileApp&&(a="git_unified");let o={aFile:e,bFile:r!=null?r:e,aRef:i,bRef:n};a=="split"?(l=ji(this.plugin.app,s))==null||l.setViewState({type:Ms.type,active:!0,state:o}):a=="git_unified"&&((c=ji(this.plugin.app,s))==null||c.setViewState({type:Ds.type,active:!0,state:o}))}async runRawCommand(){let e=this.plugin.gitManager;if(!(e instanceof Ce))return;let i=await new tt(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();i!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let n=new Hl.Notice(`Running '${i}'...`,999999);try{let s=await e.rawCommand(i);s?(n.setMessage(s),window.setTimeout(()=>n.hide(),5e3)):n.hide()}catch(s){throw n.hide(),s}})}};m();var Vh=require("obsidian");var Ha=class extends Vh.ItemView{constructor(r,i){super(r);this.plugin=i;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.contentEl.addClass("git-diff"),this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return Ds.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();return i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3)),`Diff: ${i}`}return Ds.name}getIcon(){return Ds.icon}async setState(r,i){this.state=r,Vh.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await this.refresh()}getState(){return this.state}onClose(){return this.app.workspace.offref(this.gitRefreshRef),this.app.workspace.offref(this.gitViewRefreshRef),super.onClose()}async onOpen(){return await this.refresh(),super.onOpen()}async refresh(){var r;if((r=this.state)!=null&&r.bFile&&!this.gettingDiff&&this.plugin.gitManager){this.gettingDiff=!0;try{let i=await this.plugin.gitManager.getDiffString(this.state.bFile,this.state.aRef=="HEAD",this.state.bRef);this.contentEl.empty();let n=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);if(!i){if(this.plugin.gitManager instanceof Ce&&await this.plugin.gitManager.isTracked(this.state.bFile))i=[`--- ${this.state.aFile}`,`+++ ${this.state.bFile}`,""].join(`
|
||||
`);else if(await this.app.vault.adapter.exists(n)){let s=await this.app.vault.adapter.read(n);i=[...`--- /dev/null
|
||||
+++ ${this.state.bFile}
|
||||
@@ -0,0 +1,${s.split(`
|
||||
`).length} @@`.split(`
|
||||
`),...s.split(`
|
||||
`).map(o=>`+${o}`)].join(`
|
||||
`)}}if(i){let s=this.parser.parseFromString(Hh(i),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(s)}else{let s=this.contentEl.createDiv({cls:"obsidian-git-center"});s.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),s.createEl("br"),s.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};m();var Qn=require("obsidian");var Gl=require("@codemirror/commands");var zh=require("@codemirror/search"),Ul=require("@codemirror/state"),Ci=require("@codemirror/view");var Ua=class extends Qn.ItemView{constructor(r,i){super(r);this.plugin=i;this.refreshing=!1;this.ignoreNextModification=!1;this.navigation=!0,this.registerEvent(this.app.workspace.on("obsidian-git:status-changed",()=>{this.mergeView?this.updateRefEditors().catch(console.error):this.createMergeView().catch(console.error)})),this.intervalRef=window.setInterval(()=>{this.mergeView&&this.updateRefEditors().catch(console.error)},30*1e3),this.registerEvent(this.app.vault.on("modify",n=>{this.state.bRef==null&&n.path===this.state.bFile&&(this.ignoreNextModification?this.ignoreNextModification=!1:this.updateModifiableEditor().catch(console.error))})),this.registerEvent(this.app.vault.on("delete",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("create",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("rename",(n,s)=>{this.state.bRef==null&&(n.path===this.state.bFile||s===this.state.bFile)&&this.createMergeView().catch(console.error)})),this.fileSaveDebouncer=(0,Qn.debounce)(n=>{let s=this.state.bFile;s&&(this.ignoreNextModification=!0,this.plugin.app.vault.adapter.write(this.plugin.gitManager.getRelativeVaultPath(s),n).catch(a=>this.plugin.displayError(a)))},1e3,!1)}getViewType(){return Ms.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3));let n;return this.state.bRef==null?n=" (Working Tree)":this.state.bRef==""?n=" (Index)":n="("+this.state.bRef.substring(0,7)+")",`Diff: ${i} ${n}`}return Ms.name}getIcon(){return Ms.icon}async setState(r,i){this.state=r,Qn.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await super.setState(r,i),await this.createMergeView()}getState(){return this.state}onClose(){return window.clearInterval(this.intervalRef),super.onClose()}async onOpen(){return await this.createMergeView(),super.onOpen()}async gitShow(r,i){try{return await this.plugin.gitManager.show(r,i,!1)}catch(n){if(n instanceof Br&&(n.message.includes("does not exist")||n.message.includes("unknown revision or path")||n.message.includes("exists on disk, but not in")||n.message.includes("fatal: bad object")))return n.message.includes("fatal: bad object")&&this.plugin.displayError(n.message),"";throw n}}async bShouldBeEditable(){if(this.state.bRef!=null)return!1;let r=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);return await this.app.vault.adapter.exists(r)}async updateModifiableEditor(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.b;this.refreshing=!0;let i=await this.app.vault.adapter.read(this.state.bFile);if(i!=r.state.doc.toString()){let n=r.state.update({changes:{from:0,to:r.state.doc.length,insert:i},annotations:[Ul.Transaction.remote.of(!0)]});r.dispatch(n)}this.refreshing=!1}async updateRefEditors(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.a,i=this.mergeView.b;this.refreshing=!0;let n=await this.gitShow(this.state.aRef,this.state.aFile),s;if(this.state.bRef!=null&&(s=await this.gitShow(this.state.bRef,this.state.bFile)),n!=r.state.doc.toString()){let a=r.state.update({changes:{from:0,to:r.state.doc.length,insert:n}});r.dispatch(a)}if(s!=null&&s!=i.state.doc.toString()){let a=i.state.update({changes:{from:0,to:i.state.doc.length,insert:s}});i.dispatch(a)}this.refreshing=!1}renderButtons(r){let i=r.createDiv(),n=i.createDiv();if(n.addClass("clickable-icon"),n.setAttr("aria-label",this.state.bRef==null?"Stage hunk":"Unstage hunk"),(0,Qn.setIcon)(n,this.state.bRef==null?"plus":"minus"),n.onmousedown=async s=>{var p;let a=this.mergeView.b,o=this.mergeView.a,l=Ew(a.state),c=(p=i.parentElement)==null?void 0:p.indexOf(i),u=l.chunks[c],f=Aw(u,o.state.doc,a.state.doc),d=kw(this.mergeView.a.state.doc.toString(),this.mergeView.b.state.doc.toString(),[f])[0],h=Wt.createPatch(this.state.bFile,[d],"100644",this.state.bRef!=null).join(`
|
||||
`)+`
|
||||
`;await this.plugin.gitManager.applyPatch(h),this.plugin.app.workspace.trigger("obsidian-git:refresh")},this.state.bRef==null){let s=i.createDiv();s.addClass("clickable-icon"),s.setAttr("aria-label","Reset hunk"),(0,Qn.setIcon)(s,"undo"),s.onmousedown=a=>{var d;let o=this.mergeView.a,l=this.mergeView.b,c=Ew(l.state),u=(d=i.parentElement)==null?void 0:d.indexOf(i),f=c.chunks[u];if(f){let h=f.fromA,p=f.toA,g=f.fromB,w=f.toB,y=o.state.sliceDoc(h,Math.max(h,p-1));h!=p&&w<=l.state.doc.length&&(y+=o.state.lineBreak),l.dispatch({changes:{from:g,to:Math.min(l.state.doc.length,w),insert:y},userEvent:"revert"})}}}return i.onmousedown=s=>{s.preventDefault(),s.stopPropagation()},i}async createMergeView(){var r,i,n;if((r=this.state)!=null&&r.aFile&&((i=this.state)!=null&&i.bFile)&&!this.refreshing&&this.plugin.gitManager){this.refreshing=!0,(n=this.mergeView)==null||n.destroy();let s=this.containerEl.children[1];s.empty(),this.contentEl.addClass("git-split-diff-view","git-diff"),this.bIsEditable=await this.bShouldBeEditable();let a=await this.gitShow(this.state.aRef,this.state.aFile),o;if(this.state.bRef!=null)o=await this.gitShow(this.state.bRef,this.state.bFile);else{let g=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);await this.app.vault.adapter.exists(g)?o=await this.app.vault.adapter.read(g):o=""}let l=[(0,Ci.lineNumbers)(),(0,zh.highlightSelectionMatches)(),(0,Ci.drawSelection)(),Ci.keymap.of([...Gl.standardKeymap,Gl.indentWithTab]),(0,Gl.history)(),(0,zh.search)(),Ci.EditorView.lineWrapping],c=this,u=Ci.ViewPlugin.define(g=>({update(w){if(w.docChanged&&!w.transactions.some(y=>y.annotation(Ul.Transaction.remote))){let y=g.state.doc.toString();c.fileSaveDebouncer(y)}}})),f={doc:a,extensions:[...l,Ci.EditorView.editable.of(!1),Ul.EditorState.readOnly.of(!0)]},d=[...l];this.bIsEditable?d.push(u):d.push(Ci.EditorView.editable.of(!1),Ul.EditorState.readOnly.of(!0));let h={doc:o,extensions:d};s.addClasses(["cm-s-obsidian","mod-cm6","markdown-source-view","cm-content"]);let p=this.plugin.gitManager instanceof Ce&&(this.state.bRef===void 0||this.state.bRef==="");this.mergeView=new Rh({b:h,a:f,collapseUnchanged:{minSize:6,margin:4},renderRevertControl:p?()=>this.renderButtons(s):void 0,revertControls:p?"a-to-b":void 0,diffConfig:{scanLimit:this.bIsEditable?1e3:1e4},parent:s}),this.refreshing=!1}}};m();var rF=require("obsidian");m();m();m();var hR,pR,mR;typeof window!="undefined"&&((mR=(pR=(hR=window.__svelte)!=null?hR:window.__svelte={}).v)!=null?mR:pR.v=new Set).add("5");m();m();m();var Jn={};var qe=Symbol("uninitialized"),Ti=Symbol("filename");var Wh="http://www.w3.org/1999/xhtml";m();m();m();m();var qh=!0;m();var L=!1;m();var es=Array.isArray,gR=Array.prototype.indexOf,zs=Array.prototype.includes,jl=Array.from,Yw=Object.keys,cr=Object.defineProperty,Gr=Object.getOwnPropertyDescriptor,Zw=Object.getOwnPropertyDescriptors,Kw=Object.prototype,vR=Array.prototype,Vl=Object.getPrototypeOf,Xw=Object.isExtensible;function Qw(t){return typeof t=="function"}var ur=()=>{};function Yh(t){for(var e=0;e<t.length;e++)t[e]()}function Zh(){var t,e,r=new Promise((i,n)=>{t=i,e=n});return{promise:r,resolve:t,reject:e}}m();m();var er=Symbol("$state"),zu=Symbol("legacy props"),bR=Symbol(""),Kh=Symbol("proxy path"),Xh=Symbol("attributes"),Wu=Symbol("class"),Jw=Symbol("style"),qu=Symbol("text"),Ga=Symbol("form reset"),e0=Symbol("hmr anchor"),Ws=new class extends Error{constructor(){super(...arguments);He(this,"name","StaleReactionError");He(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},wR,t0=!!((wR=globalThis.document)!=null&&wR.contentType)&&globalThis.document.contentType.includes("xml");var zl=3,Pi=8;m();m();function _R(t){if(L){let e=new Error(`invariant_violation
|
||||
An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${t}"
|
||||
https://svelte.dev/e/invariant_violation`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/invariant_violation")}function Qh(t){if(L){let e=new Error(`lifecycle_outside_component
|
||||
\`${t}(...)\` can only be used during component initialisation
|
||||
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xR(){if(L){let t=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function r0(){if(L){let t=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function ER(){if(L){let t=new Error(`derived_references_self
|
||||
A derived value cannot reference itself recursively
|
||||
https://svelte.dev/e/derived_references_self`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/derived_references_self")}function i0(t,e,r){if(L){let i=new Error(`each_key_duplicate
|
||||
${r?`Keyed each block has duplicate key \`${r}\` at indexes ${t} and ${e}`:`Keyed each block has duplicate key at indexes ${t} and ${e}`}
|
||||
https://svelte.dev/e/each_key_duplicate`);throw i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function SR(t,e,r){if(L){let i=new Error(`each_key_volatile
|
||||
Keyed each block has key that is not idempotent \u2014 the key for item at index ${t} was \`${e}\` but is now \`${r}\`. Keys must be the same each time for a given item
|
||||
https://svelte.dev/e/each_key_volatile`);throw i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_volatile")}function kR(t){if(L){let e=new Error(`effect_in_teardown
|
||||
\`${t}\` cannot be used inside an effect cleanup function
|
||||
https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function AR(){if(L){let t=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function CR(t){if(L){let e=new Error(`effect_orphan
|
||||
\`${t}\` can only be used inside an effect (e.g. during component initialisation)
|
||||
https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function TR(){if(L){let t=new Error(`effect_update_depth_exceeded
|
||||
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
||||
https://svelte.dev/e/effect_update_depth_exceeded`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function PR(){if(L){let t=new Error(`hydration_failed
|
||||
Failed to hydrate the application
|
||||
https://svelte.dev/e/hydration_failed`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/hydration_failed")}function RR(t){if(L){let e=new Error(`props_invalid_value
|
||||
Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value
|
||||
https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function $R(t){if(L){let e=new Error(`rune_outside_svelte
|
||||
The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
|
||||
https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function FR(){if(L){let t=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function IR(){if(L){let t=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function MR(){if(L){let t=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function DR(){if(L){let t=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}m();m();m();var Sn="font-weight: bold",kn="font-weight: normal";function OR(t){L?console.warn(`%c[svelte] await_reactivity_loss
|
||||
%cDetected reactivity loss when reading \`${t}\`. This happens when state is read in an async function after an earlier \`await\`
|
||||
https://svelte.dev/e/await_reactivity_loss`,Sn,kn):console.warn("https://svelte.dev/e/await_reactivity_loss")}function LR(t,e){L?console.warn(`%c[svelte] await_waterfall
|
||||
%cAn async derived, \`${t}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
|
||||
https://svelte.dev/e/await_waterfall`,Sn,kn):console.warn("https://svelte.dev/e/await_waterfall")}function NR(){L?console.warn(`%c[svelte] derived_inert
|
||||
%cReading a derived belonging to a now-destroyed effect may result in stale values
|
||||
https://svelte.dev/e/derived_inert`,Sn,kn):console.warn("https://svelte.dev/e/derived_inert")}function BR(t,e,r){L?console.warn(`%c[svelte] hydration_attribute_changed
|
||||
%cThe \`${t}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value
|
||||
https://svelte.dev/e/hydration_attribute_changed`,Sn,kn):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function ja(t){L?console.warn(`%c[svelte] hydration_mismatch
|
||||
%c${t?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${t}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
|
||||
https://svelte.dev/e/hydration_mismatch`,Sn,kn):console.warn("https://svelte.dev/e/hydration_mismatch")}function HR(){L?console.warn(`%c[svelte] lifecycle_double_unmount
|
||||
%cTried to unmount a component that was not mounted
|
||||
https://svelte.dev/e/lifecycle_double_unmount`,Sn,kn):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Jh(t){L?console.warn(`%c[svelte] state_proxy_equality_mismatch
|
||||
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results
|
||||
https://svelte.dev/e/state_proxy_equality_mismatch`,Sn,kn):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function UR(){L?console.warn(`%c[svelte] state_proxy_unmount
|
||||
%cTried to unmount a state proxy, rather than a component
|
||||
https://svelte.dev/e/state_proxy_unmount`,Sn,kn):console.warn("https://svelte.dev/e/state_proxy_unmount")}function GR(){L?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Sn,kn):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function jR(t){L?console.warn(`%c[svelte] transition_slide_display
|
||||
%cThe \`slide\` transition does not work correctly for elements with \`display: ${t}\`
|
||||
https://svelte.dev/e/transition_slide_display`,Sn,kn):console.warn("https://svelte.dev/e/transition_slide_display")}var ae=!1;function It(t){ae=t}var be;function je(t){if(t===null)throw ja(),Jn;return be=t}function fr(){return je(rr(be))}function V(t){if(ae){if(rr(be)!==null)throw ja(),Jn;be=t}}function Va(t=1){if(ae){for(var e=t,r=be;e--;)r=rr(r);be=r}}function An(t=!0){for(var e=0,r=be;;){if(r.nodeType===Pi){var i=r.data;if(i==="]"){if(e===0)return r;e-=1}else(i==="["||i==="[!"||i[0]==="["&&!isNaN(Number(i.slice(1))))&&(e+=1)}var n=rr(r);t&&r.remove(),r=n}}function Zu(t){if(!t||t.nodeType!==Pi)throw ja(),Jn;return t.data}m();m();m();m();function ep(t){return t===this.v}function n0(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function tp(t){return!n0(t,this.v)}m();var Ct=!1,ts=!1,qi=!1;m();m();m();var Ku=null;function dr(t,e){return t.label=e,ip(t.v,e),t}function ip(t,e){var r;return(r=t==null?void 0:t[Kh])==null||r.call(t,e),t}m();function Yi(t){let e=new Error,r=h4();return r.length===0?null:(r.unshift(`
|
||||
`),cr(e,"stack",{value:r.join(`
|
||||
`)}),cr(e,"name",{value:t}),e)}function h4(){let t=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=t,!e)return[];let r=e.split(`
|
||||
`),i=[];for(let n=0;n<r.length;n++){let s=r[n],a=s.replaceAll("\\","/");if(s.trim()!=="Error"){if(s.includes("validate_each_keys"))return[];a.includes("svelte/src/internal")||a.includes("node_modules/.vite")||i.push(s)}}return i}function zR(t,e){if(!L)throw new Error("invariant(...) was not guarded by if (DEV)");t||_R(e)}m();var Ee=null;function rs(t){Ee=t}var Cn=null;function Yl(t){Cn=t}var Zi=null;function np(t){Zi=t}function ct(t,e=!1,r){Ee={p:Ee,i:!1,c:null,e:null,s:t,x:null,r:ee,l:ts&&!e?{s:null,u:null,$:[]}:null},L&&(Ee.function=r,Zi=r)}function ut(t){var n;var e=Ee,r=e.e;if(r!==null){e.e=null;for(var i of r)s0(i)}return t!==void 0&&(e.x=t),e.i=!0,Ee=e.p,L&&(Zi=(n=Ee==null?void 0:Ee.function)!=null?n:null),t!=null?t:{}}function Tn(){return!ts||Ee!==null&&Ee.l===null}m();m();var za=[];function WR(){var t=za;za=[],Yh(t)}function Mt(t){if(za.length===0&&!Wa){var e=za;queueMicrotask(()=>{e===za&&WR()})}za.push(t)}function qR(){for(;za.length>0;)WR()}m();var a0=new WeakMap;function sp(t){var e=ee;if(e===null)return le.f|=8388608,t;if(L&&t instanceof Error&&!a0.has(t)&&a0.set(t,p4(t,e)),(e.f&32768)===0&&(e.f&4)===0)throw L&&!e.parent&&t instanceof Error&&YR(t),t;Xi(t,e)}function Xi(t,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0){if((e.f&32768)===0)throw t;try{e.b.error(t);return}catch(r){t=r}}e=e.parent}throw L&&t instanceof Error&&YR(t),t}}function p4(t,e){var a,o,l;let r=Gr(t,"message");if(!(r&&!r.configurable)){for(var i=Qu?" ":" ",n=`
|
||||
${i}in ${((a=e.fn)==null?void 0:a.name)||"<unknown>"}`,s=e.ctx;s!==null;)n+=`
|
||||
${i}in ${(o=s.function)==null?void 0:o[Ti].split("/").pop()}`,s=s.p;return{message:t.message+`
|
||||
${n}
|
||||
`,stack:(l=t.stack)==null?void 0:l.split(`
|
||||
`).filter(c=>!c.includes("svelte/src/internal")).join(`
|
||||
`)}}}function YR(t){let e=a0.get(t);e&&(cr(t,"message",{value:e.message}),cr(t,"stack",{value:e.stack}))}m();m();var m4=-7169;function Ve(t,e){t.f=t.f&m4|e}function Zl(t){(t.f&512)!==0||t.deps===null?Ve(t,1024):Ve(t,4096)}function ZR(t){if(t!==null)for(let e of t)(e.f&2)===0||(e.f&65536)===0||(e.f^=65536,ZR(e.deps))}function ap(t,e,r){(t.f&2048)!==0?e.add(t):(t.f&4096)!==0&&r.add(t),ZR(t.deps),Ve(t,1024)}m();m();m();var KR=!1,op=!1;function o0(t){var e=op;try{return op=!1,[t(),op]}finally{op=e}}m();m();m();m();m();function XR(t){let e=0,r=pr(0),i;return L&&dr(r,"createSubscriber version"),()=>{qs()&&(I(r),ar(()=>(e===0&&(i=Ye(()=>t(()=>Za(r)))),e+=1,()=>{Mt(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Za(r))})})))}}var v4=589824;function d0(t,e,r,i){new l0(t,e,r,i)}var ii,Ju,Fi,Ka,jr,Ii,kr,ni,ns,Xa,Ys,Xl,ef,tf,Pn,up,it,JR,e$,t$,c0,lp,cp,u0,f0,l0=class{constructor(e,r,i,n){ge(this,it);He(this,"parent");He(this,"is_pending",!1);He(this,"transform_error");ge(this,ii);ge(this,Ju,ae?be:null);ge(this,Fi);ge(this,Ka);ge(this,jr);ge(this,Ii,null);ge(this,kr,null);ge(this,ni,null);ge(this,ns,null);ge(this,Xa,0);ge(this,Ys,0);ge(this,Xl,!1);ge(this,ef,new Set);ge(this,tf,new Set);ge(this,Pn,null);ge(this,up,XR(()=>(pe(this,Pn,pr(F(this,Xa))),L&&dr(F(this,Pn),"$effect.pending()"),()=>{pe(this,Pn,null)})));var s,a;pe(this,ii,e),pe(this,Fi,r),pe(this,Ka,o=>{var l=ee;l.b=this,l.f|=128,i(o)}),this.parent=ee.b,this.transform_error=(a=n!=null?n:(s=this.parent)==null?void 0:s.transform_error)!=null?a:(o=>o),pe(this,jr,ai(()=>{if(ae){let o=F(this,Ju);fr();let l=o.data==="[!";if(o.data.startsWith("[?")){let u=JSON.parse(o.data.slice("[?".length));Ae(this,it,e$).call(this,u)}else l?Ae(this,it,t$).call(this):Ae(this,it,JR).call(this)}else Ae(this,it,c0).call(this)},v4)),ae&&pe(this,ii,be)}defer_effect(e){ap(e,F(this,ef),F(this,tf))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!F(this,Fi).pending}update_pending_count(e,r){Ae(this,it,u0).call(this,e,r),pe(this,Xa,F(this,Xa)+e),!(!F(this,Pn)||F(this,Xl))&&(pe(this,Xl,!0),Mt(()=>{pe(this,Xl,!1),F(this,Pn)&&Qi(F(this,Pn),F(this,Xa))}))}get_effect_pending(){return F(this,up).call(this),I(F(this,Pn))}error(e){var r;if(!F(this,Fi).onerror&&!F(this,Fi).failed)throw e;(r=ce)!=null&&r.is_fork?(F(this,Ii)&&ce.skip_effect(F(this,Ii)),F(this,kr)&&ce.skip_effect(F(this,kr)),F(this,ni)&&ce.skip_effect(F(this,ni)),ce.oncommit(()=>{Ae(this,it,f0).call(this,e)})):Ae(this,it,f0).call(this,e)}};ii=new WeakMap,Ju=new WeakMap,Fi=new WeakMap,Ka=new WeakMap,jr=new WeakMap,Ii=new WeakMap,kr=new WeakMap,ni=new WeakMap,ns=new WeakMap,Xa=new WeakMap,Ys=new WeakMap,Xl=new WeakMap,ef=new WeakMap,tf=new WeakMap,Pn=new WeakMap,up=new WeakMap,it=new WeakSet,JR=function(){try{pe(this,Ii,Ot(()=>F(this,Ka).call(this,F(this,ii))))}catch(e){this.error(e)}},e$=function(e){let r=F(this,Fi).failed;r&&pe(this,ni,Ot(()=>{r(F(this,ii),()=>e,()=>()=>{})}))},t$=function(){let e=F(this,Fi).pending;e&&(this.is_pending=!0,pe(this,kr,Ot(()=>e(F(this,ii)))),Mt(()=>{var r=pe(this,ns,document.createDocumentFragment()),i=Bt();r.append(i),pe(this,Ii,Ae(this,it,cp).call(this,()=>Ot(()=>F(this,Ka).call(this,i)))),F(this,Ys)===0&&(F(this,ii).before(r),pe(this,ns,null),Rn(F(this,kr),()=>{pe(this,kr,null)}),Ae(this,it,lp).call(this,ce))}))},c0=function(){try{if(this.is_pending=this.has_pending_snippet(),pe(this,Ys,0),pe(this,Xa,0),pe(this,Ii,Ot(()=>{F(this,Ka).call(this,F(this,ii))})),F(this,Ys)>0){var e=pe(this,ns,document.createDocumentFragment());Ql(F(this,Ii),e);let r=F(this,Fi).pending;pe(this,kr,Ot(()=>r(F(this,ii))))}else Ae(this,it,lp).call(this,ce)}catch(r){this.error(r)}},lp=function(e){this.is_pending=!1,e.transfer_effects(F(this,ef),F(this,tf))},cp=function(e){var r=ee,i=le,n=Ee;Nt(F(this,jr)),Lt(F(this,jr)),rs(F(this,jr).ctx);try{return si.ensure(),e()}catch(s){return sp(s),null}finally{Nt(r),Lt(i),rs(n)}},u0=function(e,r){var i;if(!this.has_pending_snippet()){this.parent&&Ae(i=this.parent,it,u0).call(i,e,r);return}pe(this,Ys,F(this,Ys)+e),F(this,Ys)===0&&(Ae(this,it,lp).call(this,r),F(this,kr)&&Rn(F(this,kr),()=>{pe(this,kr,null)}),F(this,ns)&&(F(this,ii).before(F(this,ns)),pe(this,ns,null)))},f0=function(e){F(this,Ii)&&(vt(F(this,Ii)),pe(this,Ii,null)),F(this,kr)&&(vt(F(this,kr)),pe(this,kr,null)),F(this,ni)&&(vt(F(this,ni)),pe(this,ni,null)),ae&&(je(F(this,Ju)),Va(),je(An()));var r=F(this,Fi).onerror;let i=F(this,Fi).failed;var n=!1,s=!1;let a=()=>{if(n){GR();return}n=!0,s&&DR(),F(this,ni)!==null&&Rn(F(this,ni),()=>{pe(this,ni,null)}),Ae(this,it,cp).call(this,()=>{Ae(this,it,c0).call(this)})},o=l=>{try{s=!0,r==null||r(l,a),s=!1}catch(c){Xi(c,F(this,jr)&&F(this,jr).parent)}i&&pe(this,ni,Ae(this,it,cp).call(this,()=>{try{return Ot(()=>{var c=ee;c.b=this,c.f|=128,i(F(this,ii),()=>l,()=>a)})}catch(c){return Xi(c,F(this,jr).parent),null}}))};Mt(()=>{var l;try{l=this.transform_error(e)}catch(c){Xi(c,F(this,jr)&&F(this,jr).parent);return}l!==null&&typeof l=="object"&&typ
Line truncated
|
||||
`).some(l=>l.startsWith("https://svelte.dev/e/")))throw o;return o!==Jn&&console.warn("Failed to hydrate: ",o),e.recover===!1&&PR(),bp(),fc(r),It(!1),Js(t,e)}finally{It(i),je(n)}}var Ap=new Map;function H$(t,{target:e,anchor:r,props:i={},events:n,context:s,intro:a=!0,transformError:o}){bp();var l=void 0,c=k$(()=>{var u=r!=null?r:e.appendChild(Bt());d0(u,{pending:()=>{}},h=>{ct({});var p=Ee;if(s&&(p.c=s),n&&(i.$$events=n),ae&&tn(h,null),Cp=a,l=t(h,i)||{},Cp=!0,ae&&(ee.nodes.end=be,be===null||be.nodeType!==Pi||be.data!=="]"))throw ja(),Jn;ut()},o);var f=new Set,d=h=>{for(var p=0;p<h.length;p++){var g=h[p];if(!f.has(g)){f.add(g);var w=B$(g);for(let S of[e,document]){var y=Ap.get(S);y===void 0&&(y=new Map,Ap.set(S,y));var b=y.get(g);b===void 0?(S.addEventListener(g,kp,{passive:w}),y.set(g,1)):y.set(g,b+1)}}}};return d(jl(D0)),Sp.add(d),()=>{var w;for(var h of f)for(let y of[e,document]){var p=Ap.get(y),g=p.get(h);--g==0?(y.removeEventListener(h,kp),p.delete(h),p.size===0&&Ap.delete(y)):p.set(h,g)}Sp.delete(d),u!==r&&((w=u.parentNode)==null||w.removeChild(u))}});return B0.set(l,c),l}var B0=new WeakMap;function ds(t,e){let r=B0.get(t);return r?(B0.delete(t),r(e)):(L&&(er in t?UR():HR()),Promise.resolve())}m();m();m();var rn,Dn,fi,lo,df,hf,Tp,hs=class{constructor(e,r=!0){He(this,"anchor");ge(this,rn,new Map);ge(this,Dn,new Map);ge(this,fi,new Map);ge(this,lo,new Set);ge(this,df,!0);ge(this,hf,e=>{if(F(this,rn).has(e)){var r=F(this,rn).get(e),i=F(this,Dn).get(r);if(i)dc(i),F(this,lo).delete(r);else{var n=F(this,fi).get(r);n&&(dc(n.effect),F(this,Dn).set(r,n.effect),F(this,fi).delete(r),L&&(n.fragment.lastChild[e0]=this.anchor),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(let[s,a]of F(this,rn)){if(F(this,rn).delete(s),s===e)break;let o=F(this,fi).get(a);o&&(vt(o.effect),F(this,fi).delete(a))}for(let[s,a]of F(this,Dn)){if(s===r||F(this,lo).has(s))continue;let o=()=>{if(Array.from(F(this,rn).values()).includes(s)){var c=document.createDocumentFragment();Ql(a,c),c.append(Bt()),F(this,fi).set(s,{effect:a,fragment:c})}else vt(a);F(this,lo).delete(s),F(this,Dn).delete(s)};F(this,df)||!i?(F(this,lo).add(s),Rn(a,o,!1)):o()}}});ge(this,Tp,e=>{F(this,rn).delete(e);let r=Array.from(F(this,rn).values());for(let[i,n]of F(this,fi))r.includes(i)||(vt(n.effect),F(this,fi).delete(i))});this.anchor=e,pe(this,df,r)}ensure(e,r){var i=ce,n=_p();if(r&&!F(this,Dn).has(e)&&!F(this,fi).has(e))if(n){var s=document.createDocumentFragment(),a=Bt();s.append(a),F(this,fi).set(e,{effect:Ot(()=>r(a)),fragment:s})}else F(this,Dn).set(e,Ot(()=>r(this.anchor)));if(F(this,rn).set(i,e),n){for(let[o,l]of F(this,Dn))o===e?i.unskip_effect(l):i.skip_effect(l);for(let[o,l]of F(this,fi))o===e?i.unskip_effect(l.effect):i.skip_effect(l.effect);i.oncommit(F(this,hf)),i.ondiscard(F(this,Tp))}else ae&&(this.anchor=be),F(this,hf).call(this,i)}};rn=new WeakMap,Dn=new WeakMap,fi=new WeakMap,lo=new WeakMap,df=new WeakMap,hf=new WeakMap,Tp=new WeakMap;if(L){let t=function(e){if(!(e in globalThis)){let r;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(r!==void 0)return r;$R(e)},set:i=>{r=i}})}};t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function co(t){Ee===null&&Qh("onMount"),ts&&Ee.l!==null?B4(Ee).m.push(t):mr(()=>{let e=Ye(t);if(typeof e=="function")return e})}function B4(t){var r;var e=t.l;return(r=e.u)!=null?r:e.u={a:[],b:[],m:[]}}m();m();var j$=new Map;function V$(t,e){var r=j$.get(t);r||(r=new Set,j$.set(t,r)),r.add(e)}m();m();m();m();m();m();m();m();m();function Fe(t,e,r=!1){var i;ae&&(i=be,fr());var n=new hs(t),s=r?65536:0;function a(o,l){if(ae){var c=Zu(i);if(o!==parseInt(c.substring(1))){var u=An();je(u),n.anchor=u,It(!1),n.ensure(o,l),It(!0);return}}n.ensure(o,l)}ai(()=>{var o=!1;e((l,c=0)=>{o=!0,a(c,l)}),o||a(-1,null)},s)}m();m();m();function di(t,e){return e}function q4(t,e,r){var f;for(var i=[],n=e.length,s,a=e.length,o=0;o<n;o++){let d=e[o];Rn(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=t.outrogroups;U0(t,jl(s.done)),h.delete(s),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=i.length===0&&r!==null;if(l){var c=r,u=c.parentNode;fc(u),u.append(c),t.items.clear()}U0(t,e,!l)}else s={pending:new Set(e),done:new Set},((f=t.outrogroups)!=null?f:t.outrogroups=new Set).add(s)}function U0(t,e,r=!0){var i;if(t.pending.size>0){i=new Set;for(let a of t.pending.values())for(let o of a)i.add(t.items.get(o).e)}for(var n=0;n<e.length;n++){var s=e[n];if(i!=null&&i.has(s)){s.f|=33554432;let a=document.createDocumentFragment();Ql(s,a)}else vt(e[n],r)}}var hc;function hi(t,e,r,i,n,s=null){var a=t,o=new Map,l=(e&4)!==0;if(l){var c=t;a=ae?je(or(c)):c.appendChild(Bt())}ae&&fr();var u=null,f=Qa(()=>{var S=r();return es(S)?S:S==null?[]:jl(S)});L&&dr(f,"{#each ...}");var d,h=new Map,p=!0;function g(S){(b.effect.f&16384)===0&&(b.pending.delete(S),b.fallback=u,Y4(b,d,a,e,i),u!==null&&(d.length===0?(u.f&33554432)===0?dc(u):(u.f^=33554432,mf(u,null,a))
Line truncated
|
||||
\r\f\xA0\v\uFEFF`];function X$(t,e,r){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),r){for(var n of Object.keys(r))if(r[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var o=a+s;(a===0||K$.includes(i[a-1]))&&(o===i.length||K$.includes(i[o]))?i=(a===0?"":i.substring(0,a))+i.substring(o+1):a=o}}return i===""?null:i}m();function wt(t,e,r,i,n,s){var a=t[Wu];if(ae||a!==r||a===void 0){var o=X$(r,i,s);(!ae||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t[Wu]=r}else if(s&&n!==s)for(var l in s){var c=!!s[l];(n==null||c!==!!n[l])&&t.classList.toggle(l,c)}return s}m();m();var uU=Symbol("is custom element"),fU=Symbol("is html"),dU=t0?"link":"LINK";function ke(t,e,r,i){var n=hU(t);if(ae&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===dU)){i||mU(t,e,r!=null?r:"");return}n[e]!==(n[e]=r)&&(e==="loading"&&(t[bR]=r),r==null?t.removeAttribute(e):typeof r!="string"&&pU(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function hU(t){var e,r;return(r=t[e=Xh])!=null?r:t[e]={[uU]:t.nodeName.includes("-"),[fU]:t.namespaceURI===Wh}}var Q$=new Map;function pU(t){var e=t.getAttribute("is")||t.nodeName,r=Q$.get(e);if(r)return r;Q$.set(e,r=[]);for(var i,n=t,s=Element.prototype;s!==n;){i=Zw(n);for(var a in i)i[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&r.push(a);n=Vl(n)}return r}function mU(t,e,r){var i;L&&(e==="srcset"&&gU(t,r)||j0((i=t.getAttribute(e))!=null?i:"",r)||BR(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function j0(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function J$(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function gU(t,e){var r=J$(t.srcset),i=J$(e);return i.length===r.length&&i.every(([n,s],a)=>s===r[a][1]&&(j0(r[a][0],n)||j0(n,r[a][0])))}m();m();m();function W0(t,e,r=e){var i=new WeakSet;$0(t,"input",async n=>{L&&t.type==="checkbox"&&r0();var s=n?t.defaultValue:t.value;if(s=V0(t)?z0(s):s,r(s),ce!==null&&i.add(ce),await Ep(),s!==(s=e())){var a=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=s!=null?s:"",o!==null){var c=t.value.length;a===o&&o===l&&c>l?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=a,t.selectionEnd=Math.min(o,c))}}}),(ae&&t.defaultValue!==t.value||Ye(e)==null&&t.value)&&(r(V0(t)?z0(t.value):t.value),ce!==null&&i.add(ce)),ar(()=>{L&&t.type==="checkbox"&&r0();var n=e();if(t===document.activeElement){var s=Ct?as:ce;if(i.has(s))return}V0(t)&&n===z0(t.value)||t.type==="date"&&!n&&!t.value||n!==t.value&&(t.value=n!=null?n:"")})}function V0(t){var e=t.type;return e==="number"||e==="range"}function z0(t){return t===""?null:+t}m();m();m();m();m();function q0(t,e){return t===e||(t==null?void 0:t[er])===e}function ot(t={},e,r,i){var n=Ee.r,s=ee;return qr(()=>{var a,o;return ar(()=>{a=o,o=(i==null?void 0:i())||[],Ye(()=>{q0(r(...o),t)||(e(t,...o),a&&q0(r(...a),t)&&e(null,...a))})}),()=>{let l=s;for(;l!==n&&l.parent!==null&&l.parent.f&33554432;)l=l.parent;let c=()=>{o&&q0(r(...o),t)&&e(null,...o)},u=l.teardown;l.teardown=()=>{c(),u==null||u()}}}),t}m();m();m();m();m();m();function Di(t,e,r,i){var C,A;var n=!ts||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=i,l=!0,c=void 0,u=()=>a&&n?(c!=null||(c=Zs(i)),I(c)):(l&&(l=!1,o=a?Ye(i):i),o);let f;if(s){var d=er in t||zu in t;f=(A=(C=Gr(t,e))==null?void 0:C.set)!=null?A:d&&e in t?k=>t[e]=k:void 0}var h,p=!1;s?[h,p]=o0(()=>t[e]):h=t[e],h===void 0&&i!==void 0&&(h=u(),f&&(n&&RR(e),f(h)));var g;if(n?g=()=>{var k=t[e];return k===void 0?u():(l=!0,k)}:g=()=>{var k=t[e];return k!==void 0&&(o=void 0),k===void 0?o:k},n&&(r&4)===0)return g;if(f){var w=t.$$legacy;return(function(k,v){return arguments.length>0?((!n||!v||w||p)&&f(v?g():k),k):g()})}var y=!1,b=((r&1)!==0?Zs:Qa)(()=>(y=!1,g()));L&&(b.label=e),s&&I(b);var S=ee;return(function(k,v){if(arguments.length>0){let x=v?I(b):n&&s?Je(k):k;return oe(b,x),y=!0,o!==void 0&&(o=x),k}return oi&&y||(S.f&16384)!==0?b.v:I(b)})}m();m();m();function tF(t){return new Z0(t)}var ps,Oi,Z0=class{constructor(e){ge(this,ps);ge(this,Oi);var s,a;var r=new Map,i=(o,l)=>{var c=qa(l,!1,!1);return r.set(o,c),c};let n=new Proxy({...e.props||{},$$events:{}},{get(o,l){var c;return I((c=r.get(l))!=null?c:i(l,Reflect.get(o,l)))},has(o,l){var c;return l===zu?!0:(I((c=r.get(l))!=null?c:i(l,Reflect.get(o,l))),Reflect.has(o,l))},set(o,l,c){var u;return oe((u=r.get(l))!=null?u:i(l,c),c),Reflect.set(o,l,c)}});pe(this,Oi,(e.hydrate?H0:Js)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover,transformError:e.transformError})),!Ct&&(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&io(),pe(this,ps,n.$$events);for(let o of Object.keys(F(this,Oi)))o==="$set"||o==="$destroy"||o==="$on"||cr(this,o,{get(){return F(this,Oi)[o]},set(l){F(this,Oi)[o]=l},enumerable:!0});F(this,Oi).$set=o=>{Object.assign(n,o)},F(this,Oi).$destroy=()=>{ds(F(this,Oi))}}$set(e){F(this,Oi).$se
Line truncated
|
||||
`:""}${(x=e.log.author)==null?void 0:x.name}
|
||||
${(0,Q0.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)}
|
||||
${e.log.message}`}]),we("click",u,()=>oe(n,!I(n))),fe(t,o),ut()}Pt(["click"]);var WU=xe('<div class="tree-item nav-folder mod-root"></div>'),qU=xe('<main class="git-view"><div class="nav-header"><div class="nav-buttons-container"><div id="layoutChange" class="clickable-icon nav-action-button" aria-label="Change Layout"></div> <div id="refresh" data-icon="refresh-cw" aria-label="Refresh"></div></div></div> <div class="nav-files-container" style="position: relative;"><!> <div id="sentinel"></div> <div style="margin-bottom:40px"></div></div></main>'),YU={hash:"svelte-12n6twc",code:""};function tb(t,e){ct(e,!0),an(t,YU);let r=Di(e,"plugin",15),i=Ne(!1),n=Je([]),s=Ne(void 0),a=Ne(Je(r().settings.treeStructure)),o;mr(()=>{o&&o.empty()}),co(()=>{e.view.registerEvent(e.view.app.workspace.on("obsidian-git:head-change",()=>{c().catch(console.error)}))}),mr(()=>{n.forEach(C=>(0,eb.setIcon)(C,C.getAttr("data-icon")))}),co(()=>{let C=new IntersectionObserver(k=>{k[0].isIntersecting&&!I(i)&&u().catch(console.error)}),A=activeDocument.querySelector("#sentinel");return A&&C.observe(A),()=>{C.disconnect()}}),c().catch(console.error);function l(){c().catch(console.error)}function c(){return uo(this,void 0,void 0,function*(){var C;if(!r().gitReady){oe(s,void 0);return}oe(i,!0);let A=r().gitManager instanceof Ce,k;((C=I(s)===null||I(s)===void 0?void 0:I(s).length)!==null&&C!==void 0?C:0)==0?k=A?50:10:k=I(s).length,oe(s,yield r().gitManager.log(void 0,!1,k),!0),oe(i,!1)})}function u(){return uo(this,void 0,void 0,function*(){var C;if(!r().gitReady||I(s)===void 0)return;oe(i,!0);let k=r().gitManager instanceof Ce?50:10,v=yield r().gitManager.log(void 0,!1,k,(C=I(s).last())===null||C===void 0?void 0:C.hash);I(s).push(...v.slice(1)),oe(i,!1)})}var f=qU(),d=W(f),h=W(d),p=W(h);ot(p,C=>n[0]=C,()=>n==null?void 0:n[0]);var g=ne(p,2);let w;ot(g,C=>n[1]=C,()=>n==null?void 0:n[1]),V(h),V(d);var y=ne(d,2),b=W(y);{var S=C=>{var A=WU();hi(A,21,()=>I(s),di,(k,v)=>{J0(k,{get view(){return e.view},get showTree(){return I(a)},get log(){return I(v)},get plugin(){return r()}})}),V(A),fe(C,A)};Fe(b,C=>{I(s)&&C(S)})}Va(4),V(y),V(f),Ue(()=>{ke(p,"data-icon",I(a)?"list":"folder"),w=wt(g,1,"clickable-icon nav-action-button",null,w,{loading:I(i)})}),we("click",p,()=>{oe(a,!I(a)),(0,eb.setIcon)(n[0],I(a)?"list":"folder"),r(r().settings.treeStructure=I(a),!0),r().saveSettings()}),we("click",g,l),fe(t,f),ut()}Pt(["click"]);var wf=class extends rF.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return bi.type}getDisplayText(){return bi.name}getIcon(){return bi.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=Js(tb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};m();var iF=require("obsidian"),Fp=class extends iF.FuzzySuggestModal{constructor(r,i){super(r.app);this.branches=i;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(r){return r}onChooseItem(r,i){this.resolve(r)}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>window.setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};m();var aF=require("obsidian");m();var po=require("obsidian");m();var bf=require("obsidian");m();var nF=require("obsidian");var pc=class extends nF.Modal{constructor({app:r,path:i,filesToDeleteCount:n,filesToDiscardCount:s}){super(r);this.resolve=null;this.path=i,this.deleteCount=n,this.discardCount=s}openAndGetResult(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let r=this.deleteCount+this.discardCount,{contentEl:i,titleEl:n}=this,s="";this.path!=""&&(r>1?s=`files in "${this.path}"`:s=`"${this.path}"`),n.setText(`${this.discardCount==0?"Delete":"Discard"} ${s}`),this.deleteCount>0&&i.createEl("p").setText(`Are you sure you want to DELETE the ${gu(this.deleteCount,"untracked file")}? They are deleted according to your Obsidian trash settting.`),this.discardCount>0&&i.createEl("p").setText(`Are you sure you want to discard ALL changes in ${gu(this.discardCount,"tracked file")}?`);let a=i.createDiv({cls:"modal-button-container"});if(this.deleteCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`${this.discardCount>0?"Discard":"Delete"} all ${gu(r,"file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("delete"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("delete"),this.close()})}if(this.discardCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`Discard all ${gu(this.discardCount,"tracked file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("discard"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("discard"),this.close()})}let o=a.createEl("button",{text:"Cancel"});o.addEventListener("click",()=>(this.resolve&&this.resolve(!1),this.close())),o.addEventListener("keypress",()=>(this.resolve&&this.resolve(
Line truncated
|
||||
`);n.removed.lines.length>0&&!n.removed.no_nl_at_eof&&(c+=`
|
||||
`),i.replaceRange(c,i.offsetToPos(o),i.offsetToPos(l)),i.setSelection(i.offsetToPos(o))}}async stageHunk(e){if(!await this.plugin.isAllInitialized()||!this.editor)return;let{editor:r}=this.editor,i=zi.getHunk(r.state,!1,e),n=!1;if(i||(i=zi.getHunk(r.state,!0,e),n=!0),!i)return;let s=r.state.field(oF.editorInfoField).file.path,a=Wt.createPatch(s,[i],"100644",n).join(`
|
||||
`)+`
|
||||
`;await this.gitManager.applyPatch(a),this.plugin.app.workspace.trigger("obsidian-git:refresh")}goToHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=zi.getHunks(r.state,!1),s=i.getCursor().line+1,a=Wt.findNearestHunk(s,n,e,!0);if(a==null)return;let o=n[a];if(o){let l=o.added.start-1;i.setCursor(l,0),i.scrollIntoView({from:{line:l,ch:0},to:{line:l+1,ch:0}},!0)}}};m();m();var mo=require("obsidian");var Op=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.lineAuthorInfoProvider){console.warn("Git: undefined lineAuthorInfoProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof mo.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),A2(()=>this.plg.settings.lineAuthor,e=>{this.plg.settings.lineAuthor=e,this.plg.saveSettings()})}conditionallyActivateBySettings(){this.plg.settings.lineAuthor.show&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;O2(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new gh(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),console.log(this.plg.manifest.name+": Enabled line authoring.")}catch(e){console.warn("Git: Error while loading line authoring feature.",e),this.deactivateFeature()}}deactivateFeature(){var e;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.lineAuthorInfoProvider)==null||e.destroy(),this.lineAuthorInfoProvider=void 0,console.log(this.plg.manifest.name+": Disabled line authoring.")}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&mo.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Ce?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(Y2),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.gutterContextMenuEvent=this.createGutterContextMenuHandler(),this.fileOpenEvent=this.createFileOpenEvent(),this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileModificationEvent=this.createVaultFileModificationHandler(),this.headChangeEvent=this.createHeadChangeEvent(),this.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),$2(),this.plg.registerEvent(this.gutterContextMenuEvent),this.plg.registerEvent(this.refreshOnCssChangeEvent),this.plg.registerEvent(this.fileOpenEvent),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileModificationEvent),this.plg.registerEvent(this.headChangeEvent),this.plg.registerEvent(this.fileRenameEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.gutterContextMenuEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.workspace.offref(this.fileOpenEvent),this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.vault.offref(this.fileModificationEvent),this.plg.app.workspace.offref(this.headChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",e=>{var r;(r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e).catch(console.error)})}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return e instanceof mo.TFile&&((i=this.lineAuthorInfoProvider)==null?void 0:i.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var r;return e instanceof mo.TFile&&((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e))})}createHeadChangeEvent(){return this.plg.app.workspace.on("obsidian-git:head-change",()=>{this.refreshLineAuthorViews()})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",M2)}};m();var mc=require("obsidian");m();m();var go=require("@codemirror/state"),Np=require("@codemirror/view");var Lp=class extends Np.GutterMarker{constructor(r,i){super();this.type=r;this.staged=i}toDOM(r){let i=createDiv();return i.className=`git-gutter-marker git-${this.type} ${this.staged?"staged":"unstaged"}`,this.type=="changedelete"&&i.setText("~"),i}},sb=go.StateField.define({create:()=>go.RangeSet.empty,update:(t,e)=>{let r=e.state.field(Ur,!1);if(!r)return go.RangeSet.empty;let i=e.effects
Line truncated
|
||||
`+s),this.app.workspace.trigger("obsidian-git:refresh")}handleFileMenu(r,i,n,s){if(!this.gitReady||!this.settings.showFileMenu||!i)return;let a;if(typeof i=="string"?a=i:a=i.path,n=="file-explorer-context-menu"&&(r.addItem(o=>{o.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof Se.TFile?await this.stageFile(i):(await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof Se.TFile?await this.unstageFile(i):(await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(l=>{this.addFileToGitignore(a,i instanceof Se.TFolder).catch(c=>this.displayError(c))})})),n=="git-source-control"){r.addItem(l=>{l.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(c=>{this.addFileToGitignore(a,i instanceof Se.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;s==="obsidian-git:menu"&&o instanceof Se.FileSystemAdapter&&(r.addItem(l=>{l.setTitle("Open in default app").setIcon("arrow-up-right").setSection("action").onClick(c=>{this.app.openWithDefaultApp(a)})}),r.addItem(l=>{l.setTitle("Show in system explorer").setIcon("arrow-up-right").setSection("action").onClick(c=>{window.electron.shell.showItemInFolder(pF.join(o.getBasePath(),a))})}))}}async migrateSettings(){this.settings.mergeOnPull!=null&&(this.settings.syncMethod=this.settings.mergeOnPull?"merge":"rebase",this.settings.mergeOnPull=void 0,await this.saveSettings()),this.settings.autoCommitMessage===void 0&&(this.settings.autoCommitMessage=this.settings.commitMessage,await this.saveSettings()),this.settings.gitPath!=null&&(this.localStorage.setGitPath(this.settings.gitPath),this.settings.gitPath=void 0,await this.saveSettings()),this.settings.username!=null&&(this.localStorage.setPassword(this.settings.username),this.settings.username=void 0,await this.saveSettings())}unloadPlugin(){var r,i;this.gitReady=!1,this.editorIntegration.onUnloadPlugin(),this.automaticsManager.unload(),(r=this.branchBar)==null||r.remove(),(i=this.statusBar)==null||i.remove(),this.statusBar=void 0,this.branchBar=void 0,this.gitManager.unload(),this.promiseQueue.clear();for(let n of this.intervalsToClear)window.clearInterval(n);this.intervalsToClear=[],this.debRefresh.cancel()}onunload(){this.unloadPlugin(),console.log("unloading "+this.manifest.name+" plugin")}async loadSettings(){let r=await this.loadData();r==null&&(r={showedMobileNotice:!0}),this.settings=Uk(pt,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return Se.Platform.isDesktopApp}async init({fromReload:r=!1}){var i;if(this.settings.showStatusBar&&!this.statusBar){let n=this.addStatusBarItem();this.statusBar=new wh(n,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return(s=this.statusBar)==null?void 0:s.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Ce(this),await this.gitManager.setGitInstance()):this.gitManager=new Vi(this);let n=await this.gitManager.checkRequirements(),s=this.localStorage.getPausedAutomatics();switch(n){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new Se.Notice("Can't find a valid git repository. Please create one via the given command or clone an existing repo.",1e4);break;case"valid":if(this.gitReady=!0,this.setPluginState({gitAction:0}),Se.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let a=this.addStatusBarItem();this.branchBar=new Mp(a,this),this.intervalsToClear.push(window.setInterval(()=>{var o;(o=this.branchBar)==null?void 0:o.display().catch(console.error)},6e4))}await((i=this.branchBar)==null?void 0:i.display()),this.editorIntegration.onReady(),this.app.workspace.trigger("obsidian-git:refresh"),this.app.workspace.trigger("obsidian-git:head-change"),!r&&this.settings.autoPullOnBoot&&!s&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),s||await this.automaticsManager.init(),s&&new Se.Notice("Automatic routines are currently paused.");break;default:this.log("Something weird happened. The 'checkRequirements' result is "+n)}}catch(n){this.displayError(n),console.error(n)}}async createNewRepo(){try{await this.gitManager.init(),new Se.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let i=await new tt(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(i){let n="Vault Root",s=await new tt(this,{options:this.gitManager instanceof Vi?[n]:[],placeholder:"Enter direc
Line truncated
|
||||
# Additional Instructions
|
||||
I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text.
|
||||
|
||||
\`\`\`diff
|
||||
<<<<<<< HEAD
|
||||
File changes in local repository
|
||||
=======
|
||||
File changes in remote repository
|
||||
>>>>>>> origin/main
|
||||
\`\`\``]),await this.tools.writeAndOpenFile(i==null?void 0:i.join(`
|
||||
`))}async editRemotes(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new tt(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(n){let s=await this.gitManager.getRemoteUrl(n),o=await new tt(this,{initialValue:s,placeholder:"Enter remote URL"}).openAndGetResult();if(o)return await this.gitManager.setRemote(n,av(o)),n}}async selectRemoteBranch(){let r=await this.gitManager.getRemotes(),i;r.length===0&&(i=await this.editRemotes(),i==null&&(r=await this.gitManager.getRemotes()));let n=new tt(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),s=i!=null?i:await n.openAndGetResult();if(s){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(s);let a=await this.gitManager.getRemoteBranches(s),l=await new tt(this,{options:a,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult();return l==null?void 0:l.startsWith(s+"/")?l:`${s}/${l}`}}async removeRemote(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new tt(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();n&&await this.gitManager.removeRemote(n)}onActiveLeafChange(r){var a,o;let i=r==null?void 0:r.view;if(!(i!=null&&i.getState().file)&&!(i instanceof Ha||i instanceof Ua))return;let n=this.app.workspace.getLeavesOfType(Qt.type).first(),s=this.app.workspace.getLeavesOfType(bi.type).first();if((a=n==null?void 0:n.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||a.removeClass("is-active"),(o=s==null?void 0:s.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||o.removeClass("is-active"),(r==null?void 0:r.view)instanceof Ha||(r==null?void 0:r.view)instanceof Ua){let c=r.view.state.bFile.replace(/["\\]/g,"\\$&");this.lastDiffViewState=r.view.getState();let u;n&&r.view.state.aRef=="HEAD"?u=n.view.containerEl.querySelector(`div.staged div.tree-item-self[data-path="${c}"]`):n&&r.view.state.aRef==""?u=n.view.containerEl.querySelector(`div.changes div.tree-item-self[data-path="${c}"]`):s&&(u=s.view.containerEl.querySelector(`div.tree-item-self[data-path='${c}']`)),u==null||u.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(r){this.state.offlineMode?this.log("Encountered network error, but already in offline mode"):this.displayError("Git: Going into offline mode. Future network errors will no longer be displayed.",2e3),this.setPluginState({gitAction:0,offlineMode:!0})}displayMessage(r,i=4*1e3){var n;(n=this.statusBar)==null||n.displayMessage(r.toLowerCase(),i),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!r.startsWith("No changes"))&&new Se.Notice(r,5*1e3),this.log(r)}displayError(r,i=10*1e3){var s;if(r instanceof hF.Errors.UserCanceledError){new Se.Notice("Aborted");return}let n;r instanceof Error?n=r:n=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new Se.Notice(n.message,i),console.error(`${this.manifest.id}:`,n.stack),(s=this.statusBar)==null||s.displayMessage(n.message.toLowerCase(),i)}log(...r){console.log(`${this.manifest.id}:`,...r)}};
|
||||
/*! Bundled license information:
|
||||
|
||||
ieee754/index.js:
|
||||
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||
|
||||
buffer/index.js:
|
||||
(*!
|
||||
* The buffer module from node.js, for the browser.
|
||||
*
|
||||
* @author Feross Aboukhadijeh <https://feross.org>
|
||||
* @license MIT
|
||||
*)
|
||||
|
||||
safe-buffer/index.js:
|
||||
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||
|
||||
crc-32/crc32.js:
|
||||
(*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
|
||||
|
||||
isomorphic-git/index.cjs:
|
||||
(*!
|
||||
* This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements.
|
||||
* SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
* Copyright (c) James Prevett and other ZenFS contributors.
|
||||
*)
|
||||
|
||||
js-sha256/src/sha256.js:
|
||||
(**
|
||||
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
||||
*
|
||||
* @version 0.11.1
|
||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||
* @copyright Chen, Yi-Cyuan 2014-2025
|
||||
* @license MIT
|
||||
*)
|
||||
*/
|
||||
|
||||
/* nosourcemap */
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"author": "Vinzent",
|
||||
"authorUrl": "https://github.com/Vinzent03",
|
||||
"id": "obsidian-git",
|
||||
"name": "Git",
|
||||
"description": "Integrate Git version control with automatic backup and other advanced features.",
|
||||
"isDesktopOnly": false,
|
||||
"fundingUrl": "https://ko-fi.com/vinzent",
|
||||
"version": "2.38.6"
|
||||
}
|
||||
+705
@@ -0,0 +1,705 @@
|
||||
@keyframes loading {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="git-view"] .button-border {
|
||||
border: 2px solid var(--interactive-accent);
|
||||
border-radius: var(--radius-s);
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="git-view"] .view-content {
|
||||
padding-left: 0;
|
||||
padding-top: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="git-history-view"] .view-content {
|
||||
padding-left: 0;
|
||||
padding-top: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.loading {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.loading > svg {
|
||||
animation: 2s linear infinite loading;
|
||||
transform-origin: 50% 50%;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.obsidian-git-center {
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.obsidian-git-textarea {
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.obsidian-git-disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.obsidian-git-center-button {
|
||||
display: block;
|
||||
margin: 20px auto;
|
||||
}
|
||||
|
||||
.tooltip.mod-left {
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.tooltip.mod-right {
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
/* Limits the scrollbar to the view body */
|
||||
.git-view {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Re-enable wrapping of nav buttns to prevent overflow on smaller screens #*/
|
||||
.workspace-drawer .git-view .nav-buttons-container {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.git-tools {
|
||||
display: flex;
|
||||
margin-left: auto;
|
||||
}
|
||||
.git-tools .type {
|
||||
padding-left: var(--size-2-1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 11px;
|
||||
}
|
||||
|
||||
.git-tools .type[data-type="M"] {
|
||||
color: orange;
|
||||
}
|
||||
.git-tools .type[data-type="D"] {
|
||||
color: red;
|
||||
}
|
||||
.git-tools .buttons {
|
||||
display: flex;
|
||||
}
|
||||
.git-tools .buttons > * {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="git-view"] .tree-item-self,
|
||||
.workspace-leaf-content[data-type="git-history-view"] .tree-item-self {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="git-view"]
|
||||
.tree-item-self:hover
|
||||
.clickable-icon,
|
||||
.workspace-leaf-content[data-type="git-history-view"]
|
||||
.tree-item-self:hover
|
||||
.clickable-icon {
|
||||
color: var(--icon-color-hover);
|
||||
}
|
||||
|
||||
/* Highlight an item as active if it's diff is currently opened */
|
||||
.is-active .git-tools .buttons > * {
|
||||
color: var(--nav-item-color-active);
|
||||
}
|
||||
|
||||
.git-author {
|
||||
color: var(--text-accent);
|
||||
}
|
||||
|
||||
.git-date {
|
||||
color: var(--text-accent);
|
||||
}
|
||||
|
||||
.git-ref {
|
||||
color: var(--text-accent);
|
||||
}
|
||||
|
||||
/* ====== diff2html ======
|
||||
The following styles are adapted from the obsidian-version-history plugin by
|
||||
@kometenstaub https://github.com/kometenstaub/obsidian-version-history-diff/blob/main/src/styles.scss
|
||||
which itself is adapted from the diff2html library with the following original license:
|
||||
|
||||
https://github.com/rtfpessoa/diff2html/blob/master/LICENSE.md
|
||||
|
||||
Copyright 2014-2016 Rodrigo Fernandes https://rtfpessoa.github.io/
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
||||
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
.theme-dark,
|
||||
.theme-light {
|
||||
--git-delete-bg: #ff475040;
|
||||
--git-delete-hl: #96050a75;
|
||||
--git-insert-bg: #68d36840;
|
||||
--git-insert-hl: #23c02350;
|
||||
--git-change-bg: #ffd55840;
|
||||
--git-selected: #3572b0;
|
||||
|
||||
--git-delete: #cc3333;
|
||||
--git-insert: #399839;
|
||||
--git-change: #d0b44c;
|
||||
--git-move: #3572b0;
|
||||
}
|
||||
|
||||
.git-diff {
|
||||
.d2h-d-none {
|
||||
display: none;
|
||||
}
|
||||
.d2h-wrapper {
|
||||
text-align: left;
|
||||
border-radius: 0.25em;
|
||||
overflow: auto;
|
||||
}
|
||||
.d2h-file-header.d2h-file-header {
|
||||
background-color: var(--background-secondary);
|
||||
border-bottom: 1px solid var(--background-modifier-border);
|
||||
font-family:
|
||||
Source Sans Pro,
|
||||
Helvetica Neue,
|
||||
Helvetica,
|
||||
Arial,
|
||||
sans-serif;
|
||||
height: 35px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.d2h-file-header,
|
||||
.d2h-file-stats {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
.d2h-file-header {
|
||||
display: none;
|
||||
}
|
||||
.d2h-file-stats {
|
||||
font-size: 14px;
|
||||
margin-left: auto;
|
||||
}
|
||||
.d2h-lines-added {
|
||||
border: 1px solid var(--color-green);
|
||||
border-radius: 5px 0 0 5px;
|
||||
color: var(--color-green);
|
||||
padding: 2px;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.d2h-lines-deleted {
|
||||
border: 1px solid var(--color-red);
|
||||
border-radius: 0 5px 5px 0;
|
||||
color: var(--color-red);
|
||||
margin-left: 1px;
|
||||
padding: 2px;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.d2h-file-name-wrapper {
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
font-size: 15px;
|
||||
width: 100%;
|
||||
}
|
||||
.d2h-file-name {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--text-normal);
|
||||
font-size: var(--h5-size);
|
||||
}
|
||||
.d2h-file-wrapper {
|
||||
border: 1px solid var(--background-secondary-alt);
|
||||
border-radius: 3px;
|
||||
margin-bottom: 1em;
|
||||
max-height: 100%;
|
||||
}
|
||||
.d2h-file-collapse {
|
||||
-webkit-box-pack: end;
|
||||
-ms-flex-pack: end;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
border: 1px solid var(--background-secondary-alt);
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
justify-content: flex-end;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
.d2h-file-collapse.d2h-selected {
|
||||
background-color: var(--git-selected);
|
||||
}
|
||||
.d2h-file-collapse-input {
|
||||
margin: 0 4px 0 0;
|
||||
}
|
||||
.d2h-diff-table {
|
||||
border-collapse: collapse;
|
||||
font-family: var(--font-monospace);
|
||||
font-size: var(--code-size);
|
||||
width: 100%;
|
||||
}
|
||||
.d2h-files-diff {
|
||||
width: 100%;
|
||||
}
|
||||
.d2h-file-diff {
|
||||
/*
|
||||
overflow-y: scroll;
|
||||
*/
|
||||
border-radius: 5px;
|
||||
font-size: var(--font-text-size);
|
||||
line-height: var(--line-height-normal);
|
||||
}
|
||||
.d2h-file-side-diff {
|
||||
display: inline-block;
|
||||
margin-bottom: -8px;
|
||||
margin-right: -4px;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
width: 50%;
|
||||
}
|
||||
.d2h-code-line {
|
||||
padding-left: 6em;
|
||||
padding-right: 1.5em;
|
||||
}
|
||||
.d2h-code-line,
|
||||
.d2h-code-side-line {
|
||||
display: inline-block;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
.d2h-code-side-line {
|
||||
/* needed to be changed */
|
||||
padding-left: 0.5em;
|
||||
padding-right: 0.5em;
|
||||
}
|
||||
.d2h-code-line-ctn {
|
||||
word-wrap: normal;
|
||||
background: none;
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
-webkit-user-select: text;
|
||||
-moz-user-select: text;
|
||||
-ms-user-select: text;
|
||||
user-select: text;
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
/* only works for line-by-line */
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.d2h-code-line del,
|
||||
.d2h-code-side-line del {
|
||||
background-color: var(--git-delete-hl);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
.d2h-code-line del,
|
||||
.d2h-code-line ins,
|
||||
.d2h-code-side-line del,
|
||||
.d2h-code-side-line ins {
|
||||
border-radius: 0.2em;
|
||||
display: inline-block;
|
||||
margin-top: -1px;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.d2h-code-line ins,
|
||||
.d2h-code-side-line ins {
|
||||
background-color: var(--git-insert-hl);
|
||||
text-align: left;
|
||||
}
|
||||
.d2h-code-line-prefix {
|
||||
word-wrap: normal;
|
||||
background: none;
|
||||
display: inline;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
}
|
||||
.line-num1 {
|
||||
float: left;
|
||||
}
|
||||
.line-num1,
|
||||
.line-num2 {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
/*
|
||||
padding: 0 0.5em;
|
||||
*/
|
||||
text-overflow: ellipsis;
|
||||
width: 2.5em;
|
||||
padding-left: 0;
|
||||
}
|
||||
.line-num2 {
|
||||
float: right;
|
||||
}
|
||||
.d2h-code-linenumber {
|
||||
background-color: var(--background-primary);
|
||||
border: solid var(--background-modifier-border);
|
||||
border-width: 0 1px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
color: var(--text-faint);
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
text-align: right;
|
||||
width: 5.5em;
|
||||
}
|
||||
.d2h-code-linenumber:after {
|
||||
content: "\200b";
|
||||
}
|
||||
.d2h-code-side-linenumber {
|
||||
background-color: var(--background-primary);
|
||||
border: solid var(--background-modifier-border);
|
||||
border-width: 0 1px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
color: var(--text-faint);
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
padding: 0 0.5em;
|
||||
text-align: right;
|
||||
text-overflow: ellipsis;
|
||||
width: 4em;
|
||||
/* needed to be changed */
|
||||
display: table-cell;
|
||||
position: relative;
|
||||
}
|
||||
.d2h-code-side-linenumber:after {
|
||||
content: "\200b";
|
||||
}
|
||||
.d2h-code-side-emptyplaceholder,
|
||||
.d2h-emptyplaceholder {
|
||||
background-color: var(--background-primary);
|
||||
border-color: var(--background-modifier-border);
|
||||
}
|
||||
.d2h-code-line-prefix,
|
||||
.d2h-code-linenumber,
|
||||
.d2h-code-side-linenumber,
|
||||
.d2h-emptyplaceholder {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.d2h-code-linenumber,
|
||||
.d2h-code-side-linenumber {
|
||||
direction: rtl;
|
||||
}
|
||||
.d2h-del {
|
||||
background-color: var(--git-delete-bg);
|
||||
border-color: var(--git-delete-hl);
|
||||
}
|
||||
.d2h-ins {
|
||||
background-color: var(--git-insert-bg);
|
||||
border-color: var(--git-insert-hl);
|
||||
}
|
||||
.d2h-info {
|
||||
background-color: var(--background-primary);
|
||||
border-color: var(--background-modifier-border);
|
||||
color: var(--text-faint);
|
||||
}
|
||||
.d2h-del,
|
||||
.d2h-ins,
|
||||
.d2h-file-diff .d2h-change {
|
||||
color: var(--text-normal);
|
||||
}
|
||||
.d2h-file-diff .d2h-del.d2h-change {
|
||||
background-color: var(--git-change-bg);
|
||||
}
|
||||
.d2h-file-diff .d2h-ins.d2h-change {
|
||||
background-color: var(--git-insert-bg);
|
||||
}
|
||||
.d2h-file-list-wrapper {
|
||||
a {
|
||||
text-decoration: none;
|
||||
cursor: default;
|
||||
-webkit-user-drag: none;
|
||||
}
|
||||
|
||||
svg {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.d2h-file-list-header {
|
||||
text-align: left;
|
||||
}
|
||||
.d2h-file-list-title {
|
||||
display: none;
|
||||
}
|
||||
.d2h-file-list-line {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
text-align: left;
|
||||
}
|
||||
.d2h-file-list {
|
||||
}
|
||||
.d2h-file-list > li {
|
||||
border-bottom: 1px solid var(--background-modifier-border);
|
||||
margin: 0;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.d2h-file-list > li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
.d2h-file-switch {
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
font-size: 10px;
|
||||
}
|
||||
.d2h-icon {
|
||||
fill: currentColor;
|
||||
margin-right: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.d2h-deleted {
|
||||
color: var(--git-delete);
|
||||
}
|
||||
.d2h-added {
|
||||
color: var(--git-insert);
|
||||
}
|
||||
.d2h-changed {
|
||||
color: var(--git-change);
|
||||
}
|
||||
.d2h-moved {
|
||||
color: var(--git-move);
|
||||
}
|
||||
.d2h-tag {
|
||||
background-color: var(--background-secondary);
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
font-size: 10px;
|
||||
margin-left: 5px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
.d2h-deleted-tag {
|
||||
border: 1px solid var(--git-delete);
|
||||
}
|
||||
.d2h-added-tag {
|
||||
border: 1px solid var(--git-insert);
|
||||
}
|
||||
.d2h-changed-tag {
|
||||
border: 1px solid var(--git-change);
|
||||
}
|
||||
.d2h-moved-tag {
|
||||
border: 1px solid var(--git-move);
|
||||
}
|
||||
|
||||
/* needed for line-by-line*/
|
||||
|
||||
.d2h-diff-tbody {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* My additions */
|
||||
.cm-merge-revert {
|
||||
width: 4em;
|
||||
}
|
||||
/* Ensure that merge revert markers are positioned correctly */
|
||||
.cm-merge-revert > * {
|
||||
position: absolute;
|
||||
background-color: var(--background-secondary);
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
/* ====================== Line Authoring Information ====================== */
|
||||
|
||||
.cm-gutterElement.obs-git-blame-gutter {
|
||||
/* Add background color to spacing inbetween and around the gutter for better aesthetics */
|
||||
border-width: 0px 2px 0.2px;
|
||||
border-style: solid;
|
||||
border-color: var(--background-secondary);
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
|
||||
.cm-gutterElement.obs-git-blame-gutter > div,
|
||||
.line-author-settings-preview {
|
||||
/* delegate text color to settings */
|
||||
color: var(--obs-git-gutter-text);
|
||||
font-family: monospace;
|
||||
height: 100%; /* ensure, that age-based background color occupies entire parent */
|
||||
text-align: right;
|
||||
padding: 0px 6px;
|
||||
white-space: pre; /* Keep spaces and do not collapse them. */
|
||||
}
|
||||
|
||||
@media (max-width: 800px) {
|
||||
/* hide git blame gutter not to superpose text */
|
||||
.cm-gutterElement.obs-git-blame-gutter {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.git-unified-diff-view,
|
||||
.git-split-diff-view .cm-deletedLine .cm-changedText {
|
||||
background-color: #ee443330;
|
||||
}
|
||||
|
||||
.git-unified-diff-view,
|
||||
.git-split-diff-view .cm-insertedLine .cm-changedText {
|
||||
background-color: #22bb2230;
|
||||
}
|
||||
|
||||
.git-obscure-prompt[git-is-obscured="true"] #git-show-password:after {
|
||||
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-eye"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg>');
|
||||
}
|
||||
|
||||
.git-obscure-prompt[git-is-obscured="false"] #git-show-password:after {
|
||||
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-eye-off"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"></path><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"></path><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"></path><path d="m2 2 20 20"></path></svg>');
|
||||
}
|
||||
|
||||
/* Override styling of Codemirror merge view "collapsed lines" indicator */
|
||||
.git-split-diff-view .ͼ2 .cm-collapsedLines {
|
||||
background: var(--interactive-normal);
|
||||
border-radius: var(--radius-m);
|
||||
color: var(--text-accent);
|
||||
font-size: var(--font-small);
|
||||
padding: var(--size-4-1) var(--size-4-1);
|
||||
}
|
||||
.git-split-diff-view .ͼ2 .cm-collapsedLines:hover {
|
||||
background: var(--interactive-hover);
|
||||
color: var(--text-accent-hover);
|
||||
}
|
||||
|
||||
.git-signs-gutter {
|
||||
.cm-gutterElement {
|
||||
display: grid;
|
||||
|
||||
/* Needed to align the sign properly for different line heigts. Such as
|
||||
* when having a heading or list item.
|
||||
*/
|
||||
padding-top: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.git-gutter-marker:hover {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.git-gutter-marker.git-add {
|
||||
background-color: var(--color-green);
|
||||
justify-self: center;
|
||||
height: inherit;
|
||||
width: 0.2rem;
|
||||
}
|
||||
|
||||
.git-gutter-marker.git-change {
|
||||
background-color: var(--color-yellow);
|
||||
justify-self: center;
|
||||
height: inherit;
|
||||
width: 0.2rem;
|
||||
}
|
||||
|
||||
.git-gutter-marker.git-changedelete {
|
||||
color: var(--color-yellow);
|
||||
font-weight: var(--font-bold);
|
||||
font-size: 1rem;
|
||||
justify-self: center;
|
||||
height: inherit;
|
||||
}
|
||||
|
||||
.git-gutter-marker.git-delete {
|
||||
background-color: var(--color-red);
|
||||
height: 0.2rem;
|
||||
width: 0.8rem;
|
||||
align-self: end;
|
||||
}
|
||||
|
||||
.git-gutter-marker.git-topdelete {
|
||||
background-color: var(--color-red);
|
||||
height: 0.2rem;
|
||||
width: 0.8rem;
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
div:hover > .git-gutter-marker.git-change {
|
||||
width: 0.6rem;
|
||||
}
|
||||
|
||||
div:hover > .git-gutter-marker.git-add {
|
||||
width: 0.6rem;
|
||||
}
|
||||
|
||||
div:hover > .git-gutter-marker.git-delete {
|
||||
height: 0.6rem;
|
||||
}
|
||||
|
||||
div:hover > .git-gutter-marker.git-topdelete {
|
||||
height: 0.6rem;
|
||||
}
|
||||
|
||||
div:hover > .git-gutter-marker.git-changedelete {
|
||||
font-weight: var(--font-bold);
|
||||
}
|
||||
|
||||
.git-gutter-marker.staged {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Prevent shifting of the editor when git signs gutter is the only gutter present */
|
||||
.cm-gutters.cm-gutters-before:has(> .git-signs-gutter:only-child) {
|
||||
margin-inline-end: 0;
|
||||
.git-signs-gutter {
|
||||
margin-inline-start: -1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.git-changes-status-bar-colored {
|
||||
.git-add {
|
||||
color: var(--color-green);
|
||||
}
|
||||
.git-change {
|
||||
color: var(--color-yellow);
|
||||
}
|
||||
.git-delete {
|
||||
color: var(--color-red);
|
||||
}
|
||||
}
|
||||
|
||||
.git-changes-status-bar .git-add {
|
||||
margin-right: 0.3em;
|
||||
}
|
||||
|
||||
.git-changes-status-bar .git-change {
|
||||
margin-right: 0.3em;
|
||||
}
|
||||
Vendored
+186
@@ -0,0 +1,186 @@
|
||||
{
|
||||
"main": {
|
||||
"id": "2e47f96e78ad8672",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "9212b385be8df823",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "9509a7d26a8fa404",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "empty",
|
||||
"state": {},
|
||||
"icon": "lucide-file",
|
||||
"title": "New tab"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
},
|
||||
"left": {
|
||||
"id": "a9b97f1153943349",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "6f4d1b67ca58ebd5",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "8b1f73d5e9e1906e",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "file-explorer",
|
||||
"state": {
|
||||
"sortOrder": "alphabetical",
|
||||
"autoReveal": false,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-folder-closed",
|
||||
"title": "Files"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "3e351327a4795509",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "search",
|
||||
"state": {
|
||||
"query": "",
|
||||
"matchingCase": false,
|
||||
"explainSearch": false,
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical"
|
||||
},
|
||||
"icon": "lucide-search",
|
||||
"title": "Search"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "d0d63005e5345dc0",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "bookmarks",
|
||||
"state": {
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-bookmark",
|
||||
"title": "Bookmarks"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300
|
||||
},
|
||||
"right": {
|
||||
"id": "e0388e7d9921b893",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "a421dc79a37ccabb",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "8d439bd70fd4490d",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
"showSearch": false,
|
||||
"searchQuery": "",
|
||||
"backlinkCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
},
|
||||
"icon": "links-coming-in",
|
||||
"title": "Backlinks"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "0d453c368e5f4723",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
},
|
||||
"icon": "links-going-out",
|
||||
"title": "Outgoing links"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "5bee4ef9d6cd53e7",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "tag",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"useHierarchy": true,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-tags",
|
||||
"title": "Tags"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "43e17f8f8c33f815",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "all-properties",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-archive",
|
||||
"title": "All properties"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "4ee735694c63294b",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"followCursor": false,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-list",
|
||||
"title": "Outline"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300,
|
||||
"collapsed": true
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
"switcher:Open quick switcher": false,
|
||||
"graph:Open graph view": false,
|
||||
"canvas:Create new canvas": false,
|
||||
"daily-notes:Open today's daily note": false,
|
||||
"templates:Insert template": false,
|
||||
"command-palette:Open command palette": false,
|
||||
"bases:Create new base": false
|
||||
}
|
||||
},
|
||||
"active": "9509a7d26a8fa404",
|
||||
"lastOpenFiles": []
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
views:
|
||||
- type: table
|
||||
name: Table
|
||||
@@ -1,3 +0,0 @@
|
||||
views:
|
||||
- type: table
|
||||
name: Table
|
||||
Reference in new issue
Block a user