remove obsidian config
This commit is contained in:
1 parent
7260cac8bd
commit
66f580ffc4
10 files changed
-1410
No files matched your search
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"promptDelete": false,
|
||||
"useTab": false,
|
||||
"autoPairBrackets": false,
|
||||
"autoPairMarkdown": false
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"theme": "obsidian",
|
||||
"accentColor": "#dc9b90",
|
||||
"interfaceFontFamily": ""
|
||||
}
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
[
|
||||
"obsidian-git"
|
||||
]
|
||||
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
{
|
||||
"file-explorer": true,
|
||||
"global-search": true,
|
||||
"switcher": false,
|
||||
"graph": true,
|
||||
"backlink": true,
|
||||
"canvas": false,
|
||||
"outgoing-link": true,
|
||||
"tag-pane": true,
|
||||
"footnotes": false,
|
||||
"properties": true,
|
||||
"page-preview": true,
|
||||
"daily-notes": false,
|
||||
"templates": false,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": true,
|
||||
"editor-status": true,
|
||||
"bookmarks": true,
|
||||
"markdown-importer": false,
|
||||
"zk-prefixer": false,
|
||||
"random-note": false,
|
||||
"outline": true,
|
||||
"word-count": false,
|
||||
"slides": false,
|
||||
"audio-recorder": false,
|
||||
"workspaces": false,
|
||||
"file-recovery": true,
|
||||
"publish": false,
|
||||
"sync": false,
|
||||
"bases": false
|
||||
}
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"collapse-filter": true,
|
||||
"search": "",
|
||||
"showTags": false,
|
||||
"showAttachments": false,
|
||||
"hideUnresolved": false,
|
||||
"showOrphans": true,
|
||||
"collapse-color-groups": true,
|
||||
"colorGroups": [],
|
||||
"collapse-display": true,
|
||||
"showArrow": false,
|
||||
"textFadeMultiplier": 0,
|
||||
"nodeSizeMultiplier": 1,
|
||||
"lineSizeMultiplier": 1,
|
||||
"collapse-forces": true,
|
||||
"centerStrength": 0.518713248970312,
|
||||
"repelStrength": 10,
|
||||
"linkStrength": 1,
|
||||
"linkDistance": 250,
|
||||
"scale": 0.2961231273247782,
|
||||
"close": true
|
||||
}
|
||||
-62
@@ -1,62 +0,0 @@
|
||||
{
|
||||
"commitMessage": "vault backup: {{date}}",
|
||||
"autoCommitMessage": "vault backup: {{date}}",
|
||||
"commitMessageScript": "",
|
||||
"commitDateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||
"autoSaveInterval": 1,
|
||||
"autoPushInterval": 0,
|
||||
"autoPullInterval": 0,
|
||||
"autoPullOnBoot": true,
|
||||
"autoCommitOnlyStaged": false,
|
||||
"disablePush": false,
|
||||
"pullBeforePush": true,
|
||||
"disablePopups": true,
|
||||
"showErrorNotices": true,
|
||||
"disablePopupsForNoChanges": false,
|
||||
"listChangedFilesInMessageBody": false,
|
||||
"showStatusBar": true,
|
||||
"updateSubmodules": false,
|
||||
"syncMethod": "merge",
|
||||
"customMessageOnAutoBackup": false,
|
||||
"autoBackupAfterFileChange": false,
|
||||
"treeStructure": false,
|
||||
"refreshSourceControl": false,
|
||||
"basePath": "",
|
||||
"differentIntervalCommitAndPush": false,
|
||||
"changedFilesInStatusBar": false,
|
||||
"showedMobileNotice": true,
|
||||
"refreshSourceControlTimer": 7000,
|
||||
"showBranchStatusBar": true,
|
||||
"setLastSaveToLastCommit": false,
|
||||
"submoduleRecurseCheckout": false,
|
||||
"gitDir": "",
|
||||
"showFileMenu": true,
|
||||
"authorInHistoryView": "hide",
|
||||
"dateInHistoryView": false,
|
||||
"diffStyle": "split",
|
||||
"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,
|
||||
"gutterSpacingFallbackLength": 5,
|
||||
"lastShownAuthorDisplay": "initials",
|
||||
"lastShownDateTimeFormatOptions": "date"
|
||||
}
|
||||
}
|
||||
-426
@@ -1,426 +0,0 @@
|
||||
/*
|
||||
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 X5=Object.create;var wl=Object.defineProperty;var K5=Object.getOwnPropertyDescriptor;var Z5=Object.getOwnPropertyNames;var J5=Object.getPrototypeOf,Q5=Object.prototype.hasOwnProperty;var by=t=>{throw TypeError(t)};var eI=(t,e,r)=>e in t?wl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var tI=(t,e)=>()=>(t&&(e=t(t=0)),e);var M=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),rI=(t,e)=>{for(var r in e)wl(t,r,{get:e[r],enumerable:!0})},_y=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Z5(e))!Q5.call(t,i)&&i!==r&&wl(t,i,{get:()=>e[i],enumerable:!(n=K5(e,i))||n.enumerable});return t};var Ot=(t,e,r)=>(r=t!=null?X5(J5(t)):{},_y(e||!t||!t.__esModule?wl(r,"default",{value:t,enumerable:!0}):r,t)),nI=t=>_y(wl({},"__esModule",{value:!0}),t);var vt=(t,e,r)=>eI(t,typeof e!="symbol"?e+"":e,r),wp=(t,e,r)=>e.has(t)||by("Cannot "+r);var ue=(t,e,r)=>(wp(t,e,"read from private field"),r?r.call(t):e.get(t)),yt=(t,e,r)=>e.has(t)?by("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),It=(t,e,r,n)=>(wp(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),di=(t,e,r)=>(wp(t,e,"access private method"),r);var Ey=M(Iu=>{"use strict";m();Iu.byteLength=aI;Iu.toByteArray=oI;Iu.fromByteArray=uI;var Mn=[],qr=[],iI=typeof Uint8Array!="undefined"?Uint8Array:Array,bp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ra=0,xy=bp.length;Ra<xy;++Ra)Mn[Ra]=bp[Ra],qr[bp.charCodeAt(Ra)]=Ra;var Ra,xy;qr[45]=62;qr[95]=63;function Sy(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 n=r===e?0:4-r%4;return[r,n]}function aI(t){var e=Sy(t),r=e[0],n=e[1];return(r+n)*3/4-n}function sI(t,e,r){return(e+r)*3/4-r}function oI(t){var e,r=Sy(t),n=r[0],i=r[1],a=new iI(sI(t,n,i)),s=0,o=i>0?n-4:n,l;for(l=0;l<o;l+=4)e=qr[t.charCodeAt(l)]<<18|qr[t.charCodeAt(l+1)]<<12|qr[t.charCodeAt(l+2)]<<6|qr[t.charCodeAt(l+3)],a[s++]=e>>16&255,a[s++]=e>>8&255,a[s++]=e&255;return i===2&&(e=qr[t.charCodeAt(l)]<<2|qr[t.charCodeAt(l+1)]>>4,a[s++]=e&255),i===1&&(e=qr[t.charCodeAt(l)]<<10|qr[t.charCodeAt(l+1)]<<4|qr[t.charCodeAt(l+2)]>>2,a[s++]=e>>8&255,a[s++]=e&255),a}function lI(t){return Mn[t>>18&63]+Mn[t>>12&63]+Mn[t>>6&63]+Mn[t&63]}function cI(t,e,r){for(var n,i=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),i.push(lI(n));return i.join("")}function uI(t){for(var e,r=t.length,n=r%3,i=[],a=16383,s=0,o=r-n;s<o;s+=a)i.push(cI(t,s,s+a>o?o:s+a));return n===1?(e=t[r-1],i.push(Mn[e>>2]+Mn[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Mn[e>>10]+Mn[e>>4&63]+Mn[e<<2&63]+"=")),i.join("")}});var Ay=M(_p=>{m();_p.read=function(t,e,r,n,i){var a,s,o=i*8-n-1,l=(1<<o)-1,c=l>>1,u=-7,f=r?i-1:0,d=r?-1:1,h=t[e+f];for(f+=d,a=h&(1<<-u)-1,h>>=-u,u+=o;u>0;a=a*256+t[e+f],f+=d,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=s*256+t[e+f],f+=d,u-=8);if(a===0)a=1-c;else{if(a===l)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-c}return(h?-1:1)*s*Math.pow(2,a-n)};_p.write=function(t,e,r,n,i,a){var s,o,l,c=a*8-i-1,u=(1<<c)-1,f=u>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?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,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=u?(o=0,s=u):s+f>=1?(o=(e*l-1)*Math.pow(2,i),s=s+f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+h]=o&255,h+=p,o/=256,i-=8);for(s=s<<i|o,c+=i;c>0;t[r+h]=s&255,h+=p,s/=256,c-=8);t[r+h-p]|=g*128}});var Rp=M(Ls=>{"use strict";m();var xp=Ey(),$s=Ay(),ky=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ls.Buffer=O;Ls.SlowBuffer=gI;Ls.INSPECT_MAX_BYTES=50;var Fu=2147483647;Ls.kMaxLength=Fu;O.TYPED_ARRAY_SUPPORT=fI();!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 fI(){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 hi(t){if(t>Fu)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 kp(t)}return Ry(t,e,r)}O.poolSize=8192;function Ry(t,e,r){if(typeof t=="string")return hI(t,e);if(ArrayBuffer.isView(t))return pI(t);if(t==null)throw new TypeError(Line truncated
|
||||
`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),n=Math.ceil((62+r.length+1)/8)*8,i=Buffer.alloc(n),a=new Kr(i),s=io(e);return a.writeUInt32BE(s.ctimeSeconds),a.writeUInt32BE(s.ctimeNanoseconds),a.writeUInt32BE(s.mtimeSeconds),a.writeUInt32BE(s.mtimeNanoseconds),a.writeUInt32BE(s.dev),a.writeUInt32BE(s.ino),a.writeUInt32BE(s.mode),a.writeUInt32BE(s.uid),a.writeUInt32BE(s.gid),a.writeUInt32BE(s.size),a.write(e.oid,20,"hex"),a.writeUInt16BE(J8(e)),a.write(e.path,r.length,"utf8"),i}async toObject(){let e=Buffer.alloc(12),r=new Kr(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let n=[];for(let o of this.entries)if(n.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&n.push(t._entryToBuffer(l));n=await Promise.all(n);let i=Buffer.concat(n),a=Buffer.concat([e,i]),s=await bi(a);return Buffer.concat([a,Buffer.from(s,"hex")])}};function Tf(t,e,r=!0,n=!0){let i=io(t),a=io(e);return r&&i.mode!==a.mode||i.mtimeSeconds!==a.mtimeSeconds||i.ctimeSeconds!==a.ctimeSeconds||i.uid!==a.uid||i.gid!==a.gid||n&&i.ino!==a.ino||i.size!==a.size}var Bm=null,Hm=Symbol("IndexCache");function Q8(){return{map:new Map,stats:new Map}}async function e4(t,e,r){let[n,i]=await Promise.all([t.lstat(e),t.read(e)]),a=await Zm.from(i);r.map.set(e,a),r.stats.set(e,n)}async function t4(t,e,r){let n=r.stats.get(e);if(n===void 0)return!0;if(n===null)return!1;let i=await t.lstat(e);return i===null?!1:Tf(n,i)}var ct=class{static async acquire({fs:e,gitdir:r,cache:n,allowUnmerged:i=!0},a){n[Hm]||(n[Hm]=Q8());let s=`${r}/index`;Bm===null&&(Bm=new zl({maxPending:1/0}));let o,l=[];return await Bm.acquire(s,async()=>{let c=n[Hm];await t4(e,s,c)&&await e4(e,s,c);let u=c.map.get(s);if(l=u.unmergedPaths,l.length&&!i)throw new Vl(l);if(o=await a(u),u._dirty){let f=await u.toObject();await e.write(s,f),c.stats.set(s,await e.lstat(s)),u._dirty=!1}}),o}};function Cf(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function ao(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function $x(t){let e=new Map,r=function(i){if(!e.has(i)){let a={type:"tree",fullpath:i,basename:Cf(i),metadata:{},children:[]};e.set(i,a),a.parent=r(ao(i)),a.parent&&a.parent!==a&&a.parent.children.push(a)}return e.get(i)},n=function(i,a){if(!e.has(i)){let s={type:"blob",fullpath:i,basename:Cf(i),metadata:a,parent:r(ao(i)),children:[]};s.parent&&s.parent.children.push(s),e.set(i,s)}return e.get(i)};r(".");for(let i of t)n(i.path,i);return e}function r4(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 pe(`Unexpected GitTree entry mode: ${t.toString(8)}`)}var Jm=class{constructor({fs:e,gitdir:r,cache:n}){this.treePromise=ct.acquire({fs:e,gitdir:r,cache:n},async function(a){return $x(a.entries)});let i=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(e){let r=e._fullpath,i=(await this.treePromise).get(r);if(!i||i.type==="blob")return null;if(i.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let a=i.children.map(s=>s.fullpath);return a.sort(Lf),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 n=(await this.treePromise).get(e._fullpath);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let i=n.type==="tree"?{}:io(n.metadata);e._type=n.type==="tree"?"tree":r4(i.mode),e._mode=i.mode,n.type==="tree"?e._stat=void 0:e._stat=i}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let n=(await this.treePromise).get(e._fullpath);e._oid=n.metadata.oid}return e._oid}},jf=Symbol("GitWalkSymbol");function Ya(){let t=Object.create(null);return Object.defineProperty(t,jf,{value:function({fs:e,gitdir:r,cache:n}){return new Jm({fs:e,gitdir:r,cache:n})}}),Object.freeze(t),t}var je=class t extends Ae{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};je.code="NotFoundError";var tr=class t extends Ae{constructor(e,r,n,i){super(`Object ${e} ${i?`at ${i}`:""}was anticipated to be a ${n} but it is a ${r}.`),this.code=this.name=t.code,this.data={oid:e,actual:r,expected:n,filepath:i}}};tr.code="ObjectTypeError";var Qi=class t extends Ae{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=t.code,this.data={value:e}}};Qi.code="InvalidOidError";var ql=class t extends Ae{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}}};ql.code="NoRefspecError";var Pf=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(`
|
||||
`).map(n=>{if(/^\s*#/.test(n))return{line:n,comment:!0};let i=n.indexOf(" ");if(n.startsWith("^")){let a=n.slice(1);return this.refs.set(r+"^{}",a),{line:n,ref:r,peeled:a}}else{let a=n.slice(0,i);return r=n.slice(i+1),this.refs.set(r,a),{line:n,ref:r,oid:a}}})}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(`
|
||||
`)+`
|
||||
`}},Rf=class t{constructor({remotePath:e,localPath:r,force:n,matchPrefix:i}){Object.assign(this,{remotePath:e,localPath:r,force:n,matchPrefix:i})}static from(e){let[r,n,i,a,s]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=i==="*";if(l!==(s==="*"))throw new pe("Invalid refspec");return new t({remotePath:n,localPath:a,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}},Qm=class t{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let n of e)r.push(Rf.from(n));return new t(r)}add(e){let r=Rf.from(e);this.rules.push(r)}translate(e){let r=[];for(let n of this.rules)for(let i of e){let a=n.translate(i);a&&r.push([i,a])}return r}translateOne(e){let r=null;for(let n of this.rules){let i=n.translate(e);i&&(r=i)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function n4(t,e){let r=t.replace(/\^\{\}$/,""),n=e.replace(/\^\{\}$/,""),i=-(r<n)||+(r>n);return i===0?t.endsWith("^{}")?1:-1:i}var i4=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},Gl=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}`)},ux={core:{filemode:Gl,bare:Gl,logallrefupdates:Gl,symlinks:Gl,ignorecase:Gl,bigFileThreshold:i4}},a4=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,s4=/^[A-Za-z0-9-.]+$/,o4=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,l4=/^[A-Za-z][A-Za-z-]*$/,c4=/^(.*?)( *[#;].*)$/,u4=t=>{let e=a4.exec(t);if(e!=null){let[r,n]=e.slice(1);return[r,n]}return null},f4=t=>{let e=o4.exec(t);if(e!=null){let[r,n="true"]=e.slice(1),i=d4(n),a=h4(i);return[r,a]}return null},d4=t=>{let e=c4.exec(t);if(e==null)return t;let[r,n]=e.slice(1);return fx(r)&&fx(n)?`${r}${n}`:r},fx=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,h4=t=>t.split("").reduce((e,r,n,i)=>{let a=r==='"'&&i[n-1]!=="\\",s=r==="\\"&&i[n+1]==='"';return a||s?e:e+r},""),dx=t=>t!=null?t.toLowerCase():null,eg=(t,e,r)=>[dx(t),e,dx(r)].filter(n=>n!=null).join("."),hx=t=>{let e=t.split("."),r=e.shift(),n=e.pop(),i=e.length?e.join("."):void 0;return{section:r,subsection:i,name:n,path:eg(r,i,n),sectionPath:eg(r,i,null),isSection:!!r}},p4=(t,e)=>t.reduce((r,n,i)=>e(n)?i:r,-1),tg=class t{constructor(e){let r=null,n=null;this.parsedConfig=e?e.split(`
|
||||
`).map(i=>{let a=null,s=null,o=i.trim(),l=u4(o),c=l!=null;if(c)[r,n]=l;else{let f=f4(o);f!=null&&([a,s]=f)}let u=eg(r,n,a);return{line:i,isSection:c,section:r,subsection:n,name:a,value:s,path:u}}):[]}static from(e){return new t(e)}async get(e,r=!1){let n=hx(e).path,i=this.parsedConfig.filter(a=>a.path===n).map(({section:a,name:s,value:o})=>{let l=ux[a]&&ux[a][s];return l?l(o):o});return r?i:i.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(n=>!(n.section===e&&n.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,n=!1){let{section:i,subsection:a,name:s,path:o,sectionPath:l,isSection:c}=hx(e),u=p4(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:s,value:r,modified:!0});n?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let f=this.parsedConfig.findIndex(h=>h.path===l),d={section:i,subsection:a,name:s,value:r,modified:!0,path:o};if(s4.test(i)&&l4.test(s))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:i,subsection:a,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:n,name:i,value:a,modified:s=!1})=>s?i!=null&&a!=null?typeof a=="string"&&/[#;]/.test(a)?` ${i} = "${a}"`:` ${i} = ${a}`:n!=null?`[${r} "${n}"]`:`[${r}]`:e).join(`
|
||||
`)}},nt=class{static async get({fs:e,gitdir:r}){let n=await e.read(`${r}/config`,{encoding:"utf8"});return tg.from(n)}static async save({fs:e,gitdir:r,config:n}){await e.write(`${r}/config`,n.toString(),{encoding:"utf8"})}},Af=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],m4=["config","description","index","shallow","commondir"],Um;async function Zi(t,e){return Um===void 0&&(Um=new zl),Um.acquire(t,e)}var V=class t{static async updateRemoteRefs({fs:e,gitdir:r,remote:n,refs:i,symrefs:a,tags:s,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let v of i.values())if(!v.match(/[0-9a-f]{40}/))throw new Qi(v);let u=await nt.get({fs:e,gitdir:r});if(!o){if(o=await u.getall(`remote.${n}.fetch`),o.length===0)throw new ql(n);o.unshift(`+HEAD:refs/remotes/${n}/HEAD`)}let f=Qm.from(o),d=new Map;if(c){let v=await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await t.deleteRefs({fs:e,gitdir:r,refs:v.map(y=>`refs/tags/${y}`)})}if(s){for(let v of i.keys())if(v.startsWith("refs/tags")&&!v.endsWith("^{}")&&!await t.exists({fs:e,gitdir:r,ref:v})){let y=i.get(v);d.set(v,y)}}let h=f.translate([...i.keys()]);for(let[v,y]of h){let b=i.get(v);d.set(y,b)}let p=f.translate([...a.keys()]);for(let[v,y]of p){let b=a.get(v),E=f.translateOne(b);E&&d.set(y,`ref: ${E}`)}let g=[];if(l){for(let v of f.localNamespaces()){let y=(await t.listRefs({fs:e,gitdir:r,filepath:v})).map(b=>`${v}/${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[v,y]of d)await Zi(v,async()=>e.write(F.join(r,v),`${y.trim()}
|
||||
`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:r,ref:n,value:i}){if(!i.match(/[0-9a-f]{40}/))throw new Qi(i);await Zi(n,async()=>e.write(F.join(r,n),`${i.trim()}
|
||||
`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:n,value:i}){await Zi(n,async()=>e.write(F.join(r,n),`ref: ${i.trim()}
|
||||
`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:n}){return t.deleteRefs({fs:e,gitdir:r,refs:[n]})}static async deleteRefs({fs:e,gitdir:r,refs:n}){await Promise.all(n.map(o=>e.rm(F.join(r,o))));let i=await Zi("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),a=Pf.from(i),s=a.refs.size;for(let o of n)a.refs.has(o)&&a.delete(o);a.refs.size<s&&(i=a.toString(),await Zi("packed-refs",async()=>e.write(`${r}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:n,depth:i=void 0}){if(i!==void 0&&(i--,i===-1))return n;if(n.startsWith("ref: "))return n=n.slice(5),t.resolve({fs:e,gitdir:r,ref:n,depth:i});if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let a=await t.packedRefs({fs:e,gitdir:r}),s=Af(n).filter(o=>!m4.includes(o));for(let o of s){let l=await Zi(o,async()=>await e.read(`${r}/${o}`,{encoding:"utf8"})||a.get(o));if(l)return t.resolve({fs:e,gitdir:r,ref:l.trim(),depth:i})}throw new je(n)}static async exists({fs:e,gitdir:r,ref:n}){try{return await t.expand({fs:e,gitdir:r,ref:n}),!0}catch(i){return!1}}static async expand({fs:e,gitdir:r,ref:n}){if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let i=await t.packedRefs({fs:e,gitdir:r}),a=Af(n);for(let s of a)if(await Zi(s,async()=>e.exists(`${r}/${s}`))||i.has(s))return s;throw new je(n)}static async expandAgainstMap({ref:e,map:r}){let n=Af(e);for(let i of n)if(await r.has(i))return i;throw new je(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:n=void 0,map:i}){if(n!==void 0&&(n--,n===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:r,depth:n,map:i});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let a=Af(e);for(let s of a){let o=i.get(s);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:s,depth:n,map:i})}throw new je(e)}static async packedRefs({fs:e,gitdir:r}){let n=await Zi("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return Pf.from(n).refs}static async listRefs({fs:e,gitdir:r,filepath:n}){let i=t.packedRefs({fs:e,gitdir:r}),a=null;try{a=await e.readdirDeep(`${r}/${n}`),a=a.map(s=>s.replace(`${r}/${n}/`,""))}catch(s){a=[]}for(let s of(await i).keys())s.startsWith(n)&&(s=s.replace(n+"/",""),a.includes(s)||a.push(s));return a.sort(n4),a}static async listBranches({fs:e,gitdir:r,remote:n}){return n?t.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${n}`}):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(i=>!i.endsWith("^{}"))}};function g4(t,e){return Lf(px(t),px(e))}function px(t){return t.mode==="040000"?t.path+"/":t.path}function Dx(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 pe(`Unexpected GitTree entry mode: ${t}`)}function v4(t){let e=[],r=0;for(;r<t.length;){let n=t.indexOf(32,r);if(n===-1)throw new pe(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);let i=t.indexOf(0,r);if(i===-1)throw new pe(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let a=t.slice(r,n).toString("utf8");a==="40000"&&(a="040000");let s=Dx(a),o=t.slice(n+1,i).toString("utf8");if(o.includes("\\")||o.includes("/"))throw new no(o);let l=t.slice(i+1,i+21).toString("hex");r=i+21,e.push({mode:a,path:o,oid:l,type:s})}return e}function y4(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 pe(`Could not understand file mode: ${t}`)}function w4(t){return!t.oid&&t.sha&&(t.oid=t.sha),t.mode=y4(t.mode),t.type||(t.type=Dx(t.mode)),t}var hr=class t{constructor(e){if(Buffer.isBuffer(e))this._entries=v4(e);else if(Array.isArray(e))this._entries=e.map(w4);else throw new pe("invalid type passed to GitTree constructor");this._entries.sort(Ox)}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(g4),Buffer.concat(e.map(r=>{let n=Buffer.from(r.mode.replace(/^0/,"")),i=Buffer.from(" "),a=Buffer.from(r.path,"utf8"),s=Buffer.from([0]),o=Buffer.from(r.oid,"hex");return Buffer.concat([n,i,a,s,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},ea=class{static wrap({type:e,object:r}){return Buffer.concat([Buffer.from(`${e} ${r.byteLength.toString()}\0`),Buffer.from(r)])}static unwrap(e){let r=e.indexOf(32),n=e.indexOf(0),i=e.slice(0,r).toString("utf8"),a=e.slice(r+1,n).toString("utf8"),s=e.length-(n+1);if(parseInt(a)!==s)throw new pe(`Length mismatch: expected ${a} bytes but got ${s} instead.`);return{type:i,object:Buffer.from(e.slice(n+1))}}};async function Lx({fs:t,gitdir:e,oid:r}){let n=`objects/${r.slice(0,2)}/${r.slice(2)}`,i=await t.read(`${e}/${n}`);return i?{object:i,format:"deflated",source:n}:null}function b4(t,e){let r=new Kr(t),n=mx(r);if(n!==e.byteLength)throw new pe(`applyDelta expected source buffer to be ${n} bytes but the provided buffer was ${e.length} bytes`);let i=mx(r),a,s=vx(r,e);if(s.byteLength===i)a=s;else{a=Buffer.alloc(i);let o=new Kr(a);for(o.copy(s);!r.eof();)o.copy(vx(r,e));let l=o.tell();if(i!==l)throw new pe(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${l} bytes`)}return a}function mx(t){let e=0,r=0,n=null;do n=t.readUInt8(),e|=(n&127)<<r,r+=7;while(n&128);return e}function gx(t,e,r){let n=0,i=0;for(;r--;)e&1&&(n|=t.readUInt8()<<i),e>>=1,i+=8;return n}function vx(t,e){let r=t.readUInt8(),n=128,i=15,a=112;if(r&n){let s=gx(t,r&i,4),o=gx(t,(r&a)>>4,3);return o===0&&(o=65536),e.slice(s,s+o)}else return t.slice(r)}function _4(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function jx(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:_4(t)}var Mf=class{constructor(e){if(typeof Buffer=="undefined")throw new Error("Missing Buffer dependency");this.stream=jx(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)?Buffer.alloc(0):(r&&(r=Buffer.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>x4(r);){let n=await this._next();if(this._ended)break;r.push(n)}this.buffer=Buffer.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 x4(t){return t.reduce((e,r)=>e+r.length,0)}async function S4(t,e){let r=new Mf(t),n=await r.read(4);if(n=n.toString("utf8"),n!=="PACK")throw new pe(`Invalid PACK header '${n}'`);let i=await r.read(4);if(i=i.readUInt32BE(0),i!==2)throw new pe(`Invalid packfile version: ${i}`);let a=await r.read(4);if(a=a.readUInt32BE(0),!(a<1))for(;!r.eof()&&a--;){let s=r.tell(),{type:o,length:l,ofs:c,reference:u}=await E4(r),f=new cg.Inflate;for(;!f.result;){let d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new pe(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new pe("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:a,offset:s,end:h,reference:u,ofs:c})}}}}async function E4(t){let e=await t.byte(),r=e>>4&7,n=e&15;if(e&128){let s=4;do e=await t.byte(),n|=(e&127)<<s,s+=7;while(e&128)}let i,a;if(r===6){let s=0;i=0;let o=[];do e=await t.byte(),i|=(e&127)<<s,s+=7,o.push(e);while(e&128);a=Buffer.from(o)}return r===7&&(a=await t.read(20)),{typ
Line truncated
|
||||
`,t}function Of(t){let[,e,r,n,i]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(n),timezoneOffset:F4(i)}}function F4(t){let[,e,r,n]=t.match(/(\+|-)(\d\d)(\d\d)/);return n=(e==="+"?1:-1)*(Number(r)*60+Number(n)),$4(n)}function $4(t){return t===0?t:-t}var Mr=class t{constructor(e){if(typeof e=="string")this._tag=e;else if(Buffer.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=t.render(e);else throw new pe("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 ${rg(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 i of e)i[0]===" "?r[r.length-1]+=`
|
||||
`+i.slice(1):r.push(i);let n={};for(let i of r){let a=i.slice(0,i.indexOf(" ")),s=i.slice(i.indexOf(" ")+1);Array.isArray(n[a])?n[a].push(s):n[a]=s}return n.tagger&&(n.tagger=Of(n.tagger)),n.committer&&(n.committer=Of(n.committer)),n}withoutSignature(){let e=wi(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 wi(e)}payload(){return this.withoutSignature()+`
|
||||
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,n){let i=e.payload(),{signature:a}=await r({payload:i,secretKey:n});a=wi(a);let s=i+a;return t.from(s)}};function zm(t){return t.trim().split(`
|
||||
`).map(e=>" "+e).join(`
|
||||
`)+`
|
||||
`}function D4(t){return t.split(`
|
||||
`).map(e=>e.replace(/^ /,"")).join(`
|
||||
`)}var pr=class t{constructor(e){if(typeof e=="string")this._commit=e;else if(Buffer.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=t.render(e);else throw new pe("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let n=t.justHeaders(e),i=t.justMessage(e),a=wi(n+`
|
||||
gpgsig`+zm(r)+`
|
||||
`+i);return new t(a)}static from(e){return new t(e)}toObject(){return Buffer.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 wi(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 i of e)i[0]===" "?r[r.length-1]+=`
|
||||
`+i.slice(1):r.push(i);let n={parent:[]};for(let i of r){let a=i.slice(0,i.indexOf(" ")),s=i.slice(i.indexOf(" ")+1);Array.isArray(n[a])?n[a].push(s):n[a]=s}return n.author&&(n.author=Of(n.author)),n.committer&&(n.committer=Of(n.committer)),n}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 pe("commit 'parent' property should be an array");for(let a of e.parent)r+=`parent ${a}
|
||||
`}let n=e.author;r+=`author ${rg(n)}
|
||||
`;let i=e.committer||e.author;return r+=`committer ${rg(i)}
|
||||
`,e.gpgsig&&(r+="gpgsig"+zm(e.gpgsig)),r}static render(e){return t.renderHeaders(e)+`
|
||||
`+wi(e.message)}render(){return this._commit}withoutSignature(){let e=wi(this._commit);if(e.indexOf(`
|
||||
gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(`
|
||||
gpgsig`)),n=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
|
||||
`)+28);return wi(r+`
|
||||
`+n)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return D4(e)}static async sign(e,r,n){let i=e.withoutSignature(),a=t.justMessage(e._commit),{signature:s}=await r({payload:i,secretKey:n});s=wi(s);let l=t.justHeaders(e._commit)+`
|
||||
gpgsig`+zm(s)+`
|
||||
`+a;return t.from(l)}};async function fo({fs:t,cache:e,gitdir:r,oid:n}){if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:hr.from([]),oid:n};let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:r,oid:n});if(i==="tag")return n=Mr.from(a).parse().object,fo({fs:t,cache:e,gitdir:r,oid:n});if(i==="commit")return n=pr.from(a).parse().tree,fo({fs:t,cache:e,gitdir:r,oid:n});if(i!=="tree")throw new tr(n,i,"tree");return{tree:hr.from(a),oid:n}}var ng=class{constructor({fs:e,gitdir:r,ref:n,cache:i}){this.fs=e,this.cache=i,this.gitdir=r,this.mapPromise=(async()=>{let s=new Map,o;try{o=await V.resolve({fs:e,gitdir:r,ref:n})}catch(c){c instanceof je&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await fo({fs:e,cache:this.cache,gitdir:r,oid:o});return l.type="tree",l.mode="40000",s.set(".",l),s})();let a=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 a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:n,cache:i,gitdir:a}=this,s=await this.mapPromise,o=s.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 Ge({fs:n,cache:i,gitdir:a,oid:l});if(c!==o.type)throw new tr(l,c,o.type);let f=hr.from(u);for(let d of f)s.set(F.join(r,d.path),d);return f.entries().map(d=>F.join(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:n}=r.get(e._fullpath);e._type=n}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:n}=r.get(e._fullpath);e._mode=Ix(parseInt(n,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:n,cache:i,gitdir:a}=this,o=r.get(e._fullpath).oid,{type:l,object:c}=await Ge({fs:n,cache:i,gitdir:a,oid:o});l!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let n=(await this.mapPromise).get(e._fullpath);e._oid=n.oid}return e._oid}};function Rr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,jf,{value:function({fs:r,gitdir:n,cache:i}){return new ng({fs:r,gitdir:n,ref:t,cache:i})}}),Object.freeze(e),e}var ig=class{constructor({fs:e,dir:r,gitdir:n,cache:i}){this.fs=e,this.cache=i,this.dir=r,this.gitdir=n,this.config=null;let a=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 a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:n,dir:i}=this,a=await n.readdir(F.join(i,r));return a===null?null:a.map(s=>F.join(r,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{fs:r,dir:n}=this,i=await r.lstat(`${n}/${e._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let a=i.isDirectory()?"tree":"blob";a==="blob"&&!i.isFile()&&!i.isSymbolicLink()&&(a="special"),e._type=a,i=io(i),e._mode=i.mode,i.size===-1&&e._actualSize&&(i.size=e._actualSize),e._stat=i}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:n,gitdir:i}=this;if(await e.type()==="tree")e._content=void 0;else{let s=await(await this._getGitConfig(r,i)).get("core.autocrlf"),o=await r.read(`${n}/${e._fullpath}`,{autocrlf:s});e._actualSize=o.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(o)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:n,gitdir:i,cache:a}=this,s;await ct.acquire({fs:n,gitdir:i,cache:a},async function(o){let l=o.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await r._getGitConfig(n,i)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||Tf(c,l,f,d)){let h=await e.content();h===void 0?s=void 0:(s=await bi(ea.wrap({type:"blob",object:h})),l&&s===l.oid&&(!f||c.mode===l.mode)&&Tf(c,l,f,d)&&o.insert({filepath:e._fullpath,stats:c,oid:s}))}else s=l.oid}),e._oid=s}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await nt.get({fs:e,gitdir:r}),this.config)}};function yo(){let t=Object.create(null);return Object.defineProperty(t,jf,{value:function({fs:e,dir:r,gitdir:n,cache:i}){return new ig({fs:e,dir:r,gitdir:n,cache:i})}}),Object.freeze(t),t}function L4(t,e){let r=e-t;return Array.from({length:r},(n,i)=>t+i)}var Hx=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),ag=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:e<this.value&&(this.value=e))}reset(){this.value=null}};function*j4(t){let e=new ag,r,n=[],i=t.lengt
Line truncated
|
||||
`),n=new TextEncoder().encode(n)}catch(i){}return typeof n!="string"&&(n=Buffer.from(n)),n}catch(n){return null}}async write(e,r,n={}){try{await this._writeFile(e,r,n);return}catch(i){await this.mkdir(ao(e)),await this._writeFile(e,r,n)}}async mkdir(e,r=!1){try{await this._mkdir(e);return}catch(n){if(n===null||n.code==="EEXIST")return;if(r)throw n;if(n.code==="ENOENT"){let i=ao(e);if(i==="."||i==="/"||i===e)throw n;await this.mkdir(i),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(n){if(n.code!=="ENOENT")throw n}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Lf),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async i=>{let a=e+"/"+i;return(await this._stat(a)).isDirectory()?this.readdirDeep(a):a}))).reduce((i,a)=>i.concat(a),[])}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 n=await this._readlink(e,r);return Buffer.isBuffer(n)?n:Buffer.from(n)}catch(n){if(n.code==="ENOENT"||(n.code||"").includes("ENS"))return null;throw n}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};function P(t,e){if(e===void 0)throw new dr(t)}async function If(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 Ux({fs:t,dir:e,gitdir:r=F.join(e,".git"),commit:n="HEAD",cache:i={}}){try{P("fs",t),P("dir",e),P("gitdir",r);let a=new Q(t),s=[Rr({ref:n}),yo(),Ya()],o=[];await ct.acquire({fs:a,gitdir:r,cache:i},async function(c){o=c.unmergedPaths});let l=await ra({fs:a,cache:i,dir:e,gitdir:r,trees:s,map:async function(c,[u,f,d]){let h=!await If(f,d),p=o.includes(c),g=!await If(d,u);if(h||p)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(g)return!1;throw new ac(c)}});await ct.acquire({fs:a,gitdir:r,cache:i},async function(c){for(let u of l)if(u!==!1){if(!u){await a.rmdir(`${e}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){let f=new TextDecoder().decode(u.content);await a.write(`${e}/${u.path}`,f,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(a){throw a.caller="git.abortMerge",a}}var na=class{static async isIgnored({fs:e,dir:r,gitdir:n=F.join(r,".git"),filepath:i}){if(Cf(i)===".git")return!0;if(i===".")return!1;let a="",s=F.join(n,"info","exclude");await e.exists(s)&&(a=await e.read(s,"utf8"));let o=[{gitignore:F.join(r,".gitignore"),filepath:i}],l=i.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:F.join(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=q8().add(a);d.add(f);let h=ao(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 H4({fs:t,gitdir:e,object:r,format:n,oid:i}){if(n!=="deflated")throw new pe("GitObjectStoreLoose expects objects to write to be in deflated format");let a=`objects/${i.slice(0,2)}/${i.slice(2)}`,s=`${e}/${a}`;await t.exists(s)||await t.write(s,r)}var Vm=null;async function Gx(t){return Vm===null&&(Vm=G4()),Vm?U4(t):cg.deflate(t)}async function U4(t){let e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}function G4(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(t){return!1}}async function mr({fs:t,gitdir:e,type:r,object:n,format:i="content",oid:a=void 0,dryRun:s=!1}){return i!=="deflated"&&(i!=="wrapped"&&(n=ea.wrap({type:r,object:n})),a=await bi(n),n=Buffer.from(await Gx(n))),s||await H4({fs:t,gitdir:e,object:n,format:"deflated",oid:a}),a}function zx(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}async function Vx({fs:t,dir:e,gitdir:r=F.join(e,".git"),filepath:n,cache:i={},force:a=!1,parallel:s=!0}){try{P("fs",t),P("dir",e),P("gitdir",r),P("filepath",n);let o=new Q(t);await ct.acquire({fs:o,gitdir:r,cache:i},async l=>{let u=await(await nt.get({fs:o,gitdir:r})).get("core.autocrlf");return og({dir:e,gitdir:r,fs:o,filepath:n,index:l,force:a,parallel:s,autocrlf:u})})}catch(o){throw o.caller="git.add",o}}async function og({dir:t,gitdir:e,fs:r,filepath:n,index:i,force:a,parallel:s,autocrlf:o}){n=Array.isArray(n)?n:[n];let l=n.map(async d=>{if(!a&&await na.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let h=await r.lstat(F.join(t,d));if(!h)throw new je(d);if(h.isDirectory()){let p=await r.readdir(F.join(t,d));if(s){let g=p.map(v=>og({dir:t,gitdir:e,fs:r,filepath:[F.join(d,v)],inde
Line truncated
|
||||
`,author:l,committer:c,signingKey:u})}async function Kx({fs:t,onSign:e,dir:r,gitdir:n=F.join(r,".git"),ref:i="refs/notes/commits",oid:a,note:s,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{P("fs",t),P("gitdir",n),P("oid",a),P("note",s),u&&P("onSign",e);let d=new Q(t),h=await ia({fs:d,gitdir:n,author:l});if(!h)throw new zt("author");let p=await ho({fs:d,gitdir:n,author:h,committer:c});if(!p)throw new zt("committer");return await z4({fs:new Q(d),cache:f,onSign:e,gitdir:n,ref:i,oid:a,note:s,force:o,author:h,committer:p,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}async function Zx({fs:t,gitdir:e,remote:r,url:n,force:i}){if(r!==zn.clean(r))throw new mn(r,zn.clean(r));let a=await nt.get({fs:t,gitdir:e});if(!i&&(await a.getSubsections("remote")).includes(r)&&n!==await a.get(`remote.${r}.url`))throw new pn("remote",r);await a.set(`remote.${r}.url`,n),await a.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await nt.save({fs:t,gitdir:e,config:a})}async function Jx({fs:t,dir:e,gitdir:r=F.join(e,".git"),remote:n,url:i,force:a=!1}){try{return P("fs",t),P("gitdir",r),P("remote",n),P("url",i),await Zx({fs:new Q(t),gitdir:r,remote:n,url:i,force:a})}catch(s){throw s.caller="git.addRemote",s}}async function V4({fs:t,cache:e,onSign:r,gitdir:n,ref:i,tagger:a,message:s=i,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`,!u&&await V.exists({fs:t,gitdir:n,ref:i}))throw new pn("tag",i);let f=await V.resolve({fs:t,gitdir:n,ref:l||"HEAD"}),{type:d}=await Ge({fs:t,cache:e,gitdir:n,oid:f}),h=Mr.from({object:f,type:d,tag:i.replace("refs/tags/",""),tagger:a,message:s,gpgsig:o});c&&(h=await Mr.sign(h,r,c));let p=await mr({fs:t,gitdir:n,type:"tag",object:h.toObject()});await V.writeRef({fs:t,gitdir:n,ref:i,value:p})}async function Qx({fs:t,onSign:e,dir:r,gitdir:n=F.join(r,".git"),ref:i,tagger:a,message:s=i,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{P("fs",t),P("gitdir",n),P("ref",i),c&&P("onSign",e);let d=new Q(t),h=await ia({fs:d,gitdir:n,author:a});if(!h)throw new zt("tagger");return await V4({fs:d,cache:f,onSign:e,gitdir:n,ref:i,tagger:h,message:s,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function q4({fs:t,gitdir:e,ref:r,object:n,checkout:i=!1,force:a=!1}){if(r!==zn.clean(r))throw new mn(r,zn.clean(r));let s=`refs/heads/${r}`;if(!a&&await V.exists({fs:t,gitdir:e,ref:s}))throw new pn("branch",r,!1);let o;try{o=await V.resolve({fs:t,gitdir:e,ref:n||"HEAD"})}catch(l){}o&&await V.writeRef({fs:t,gitdir:e,ref:s,value:o}),i&&await V.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}async function eS({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n,object:i,checkout:a=!1,force:s=!1}){try{return P("fs",t),P("gitdir",r),P("ref",n),await q4({fs:new Q(t),gitdir:r,ref:n,object:i,checkout:a,force:s})}catch(o){throw o.caller="git.branch",o}}var tS=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function fg({fs:t,cache:e,onProgress:r,onPostCheckout:n,dir:i,gitdir:a,remote:s,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0,nonBlocking:p=!1,batchSize:g=100}){let v;if(n)try{v=await V.resolve({fs:t,gitdir:a,ref:"HEAD"})}catch(b){v="0000000000000000000000000000000000000000"}let y;try{y=await V.resolve({fs:t,gitdir:a,ref:o})}catch(b){if(o==="HEAD")throw b;let E=`${s}/${o}`;if(y=await V.resolve({fs:t,gitdir:a,ref:E}),h){let S=await nt.get({fs:t,gitdir:a});await S.set(`branch.${o}.remote`,s),await S.set(`branch.${o}.merge`,`refs/heads/${o}`),await nt.save({fs:t,gitdir:a,config:S})}await V.writeRef({fs:t,gitdir:a,ref:`refs/heads/${o}`,value:y})}if(!c){let b;try{b=await W4({fs:t,cache:e,onProgress:r,dir:i,gitdir:a,ref:o,force:d,filepaths:l})}catch(w){throw w instanceof je&&w.data.what===y?new Kl(o,y):w}let E=b.filter(([w])=>w==="conflict").map(([w,x])=>x);if(E.length>0)throw new Xl(E);let S=b.filter(([w])=>w==="error").map(([w,x])=>x);if(S.length>0)throw new pe(S.join(", "));if(f){n&&await n({previousHead:v,newHead:y,type:l!=null&&l.length>0?"file":"branch"});return}let A=0,k=b.length;if(await ct.acquire({fs:t,gitdir:a,cache:e},async function(w){await Promise.all(b.filter(([x])=>x==="delete"||x==="delete-index").map(async function([x,_]){let T=`${i}/${_}`;x==="delete"&&await t.rm(T),w.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}))}),await ct.acquire({fs:t,gitdir:a,cache:e},async function(w){for(let[x,_]of b)if(x==="rmdir"||x==="rmdir-index"){let T=`${i}/${_}`;try{x==="rmdir"&&await t.rmdir(T),w.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}catch(C){if(C.code==="ENOTEMPTY")console.log(`Did not delete ${_} because directory is not empty`);else throw C}}}),await Promise.all(b.filter(([w])=>w==="mkdir"||w==="mkdir-index").map(async function([w,x]){let _=`${i}/${x}`;await t.mkdir(_),r&&await r({phase:"Updating workdir",loaded:++A,total:k})})),p){let w=b.filter(([_])=>_==
Line truncated
|
||||
`).map(s=>i.add(s))}),i}static async write({fs:e,gitdir:r,oids:n}){Ga===null&&(Ga=new zl);let i=F.join(r,"shallow");if(n.size>0){let a=[...n].join(`
|
||||
`)+`
|
||||
`;await Ga.acquire(i,async function(){await e.write(i,a,{encoding:"utf8"})})}else await Ga.acquire(i,async function(){await e.rm(i)})}};async function Q4({fs:t,gitdir:e,oid:r}){let n=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${n}`)}async function eD({fs:t,cache:e,gitdir:r,oid:n,getExternalRefDelta:i}){let a=await t.readdir(F.join(r,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(let s of a){let o=`${r}/objects/pack/${s}`,l=await ug({fs:t,cache:e,filename:o,getExternalRefDelta:i});if(l.error)throw new pe(l.error);if(l.offsets.has(n))return!0}return!1}async function Cx({fs:t,cache:e,gitdir:r,oid:n,format:i="content"}){let a=o=>Ge({fs:t,cache:e,gitdir:r,oid:o}),s=await Q4({fs:t,gitdir:r,oid:n});return s||(s=await eD({fs:t,cache:e,gitdir:r,oid:n,getExternalRefDelta:a})),s}function tD(t){let i="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===i}function nS(t,e){let r=t.map(n=>n.split("=",1)[0]);return e.filter(n=>{let i=n.split("=",1)[0];return r.includes(i)})}var Bf={name:"isomorphic-git",version:"1.32.2",agent:"git/[email protected]"},ro=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 rD(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 iS(t){let e=new ro,r="";return(async()=>(await uc(t,n=>{for(n=n.toString("utf8"),r+=n;;){let i=rD(r);if(i===-1)break;e.write(r.slice(0,i)),r=r.slice(i)}}),r.length>0&&e.write(r),e.end()))(),e}var $f=class{static demux(e){let r=Qe.streamReader(e),n=new ro,i=new ro,a=new ro,s=async function(){let o=await r();if(o===null)return s();if(o===!0){n.end(),a.end(),e.error?i.destroy(e.error):i.end();return}switch(o[0]){case 1:{i.write(o.slice(1));break}case 2:{a.write(o.slice(1));break}case 3:{let l=o.slice(1);a.write(l),n.end(),a.end(),i.destroy(new Error(l.toString("utf8")));return}default:n.write(o)}s()};return s(),{packetlines:n,packfile:i,progress:a}}};async function nD(t){let{packetlines:e,packfile:r,progress:n}=$f.demux(t),i=[],a=[],s=[],o=!1,l=!1;return new Promise((c,u)=>{uc(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Qi(h)),i.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Qi(h)),a.push(h)}else if(d.startsWith("ACK")){let[,h,p]=d.split(" ");s.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:i,unshallows:a,acks:s,nak:o,packfile:r,progress:n}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:i,unshallows:a,acks:s,nak:o,packfile:r,progress:n}))})})}function iD({capabilities:t=[],wants:e=[],haves:r=[],shallows:n=[],depth:i=null,since:a=null,exclude:s=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(Qe.encode(`want ${c}${l}
|
||||
`)),l="";for(let c of n)o.push(Qe.encode(`shallow ${c}
|
||||
`));i!==null&&o.push(Qe.encode(`deepen ${i}
|
||||
`)),a!==null&&o.push(Qe.encode(`deepen-since ${Math.floor(a.valueOf()/1e3)}
|
||||
`));for(let c of s)o.push(Qe.encode(`deepen-not ${c}
|
||||
`));o.push(Qe.flush());for(let c of r)o.push(Qe.encode(`have ${c}
|
||||
`));return o.push(Qe.encode(`done
|
||||
`)),o}async function hg({fs:t,cache:e,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:p=null,since:g=null,exclude:v=[],relative:y=!1,tags:b=!1,singleBranch:E=!1,headers:S={},prune:A=!1,pruneTags:k=!1}){let w=c||await sa({fs:t,gitdir:l,test:!0}),x=await nt.get({fs:t,gitdir:l}),_=f||w&&await x.get(`branch.${w}.remote`)||"origin",T=d||await x.get(`remote.${_}.url`);if(typeof T=="undefined")throw new dr("remote OR url");let C=u||w&&await x.get(`branch.${w}.merge`)||c||"HEAD";h===void 0&&(h=await x.get("http.corsProxy"));let I=go.getRemoteHelperFor({url:T}),L=await I.discover({http:r,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:T,headers:S,protocolVersion:1}),$=L.auth,J=L.refs;if(J.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!L.capabilities.has("shallow"))throw new Ji("shallow","depth");if(g!==null&&!L.capabilities.has("deepen-since"))throw new Ji("deepen-since","since");if(v.length>0&&!L.capabilities.has("deepen-not"))throw new Ji("deepen-not","exclude");if(y===!0&&!L.capabilities.has("deepen-relative"))throw new Ji("deepen-relative","relative");let{oid:de,fullref:le}=V.resolveAgainstMap({ref:C,map:J});for(let U of J.keys())U===le||U==="HEAD"||U.startsWith("refs/heads/")||b&&U.startsWith("refs/tags/")||J.delete(U);let ce=nS([...L.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Bf.agent}`]);y&&ce.push("deepen-relative");let Te=E?[de]:J.values(),ne=E?[w]:await V.listRefs({fs:t,gitdir:l,filepath:"refs"}),N=[];for(let U of ne)try{U=await V.expand({fs:t,gitdir:l,ref:U});let Je=await V.resolve({fs:t,gitdir:l,ref:U});await Cx({fs:t,cache:e,gitdir:l,oid:Je})&&N.push(Je)}catch(Je){}N=[...new Set(N)];let W=await qa.read({fs:t,gitdir:l}),B=L.capabilities.has("shallow")?[...W]:[],$e=iD({capabilities:ce,wants:Te,haves:N,shallows:B,depth:p,since:g,exclude:v}),lr=Buffer.from(await Ff($e)),Ut=await I.connect({http:r,onProgress:n,corsProxy:h,service:"git-upload-pack",url:T,auth:$,body:[lr],headers:S}),X=await nD(Ut.body);Ut.headers&&(X.headers=Ut.headers);for(let U of X.shallows)if(!W.has(U))try{let{object:Je}=await Ge({fs:t,cache:e,gitdir:l,oid:U}),j=new pr(Je),Z=await Promise.all(j.headers().parent.map(We=>Cx({fs:t,cache:e,gitdir:l,oid:We})));Z.length===0||Z.every(We=>We)||W.add(U)}catch(Je){W.add(U)}for(let U of X.unshallows)W.delete(U);if(await qa.write({fs:t,gitdir:l,oids:W}),E){let U=new Map([[le,de]]),Je=new Map,j=10,Z=le;for(;j--;){let Rt=L.symrefs.get(Z);if(Rt===void 0)break;Je.set(Z,Rt),Z=Rt}let Se=J.get(Z);Se&&U.set(Z,Se);let{pruned:We}=await V.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:U,symrefs:Je,tags:b,prune:A});A&&(X.pruned=We)}else{let{pruned:U}=await V.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:J,symrefs:L.symrefs,tags:b,prune:A,pruneTags:k});A&&(X.pruned=U)}if(X.HEAD=L.symrefs.get("HEAD"),X.HEAD===void 0){let{oid:U}=V.resolveAgainstMap({ref:"HEAD",map:J});for(let[Je,j]of J.entries())if(Je!=="HEAD"&&j===U){X.HEAD=Je;break}}let Oe=le.startsWith("refs/tags")?"tag":"branch";if(X.FETCH_HEAD={oid:de,description:`${Oe} '${za(le)}' of ${T}`},n||i){let U=iS(X.progress);uc(U,async Je=>{if(i&&await i(Je),n){let j=Je.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);j&&await n({phase:j[1].trim(),loaded:parseInt(j[2],10),total:parseInt(j[3],10)})}})}let De=Buffer.from(await Ff(X.packfile));if(Ut.body.error)throw Ut.body.error;let Pt=De.slice(-20).toString("hex"),Le={defaultBranch:X.HEAD,fetchHead:X.FETCH_HEAD.oid,fetchHeadDescription:X.FETCH_HEAD.description};if(X.headers&&(Le.headers=X.headers),A&&(Le.pruned=X.pruned),Pt!==""&&!tD(De)){Le.packfile=`objects/pack/pack-${Pt}.pack`;let U=F.join(l,Le.packfile);await t.write(U,De);let Je=Z=>Ge({fs:t,cache:e,gitdir:l,oid:Z}),j=await Wl.fromPack({pack:De,getExternalRefDelta:Je,onProgress:n});await t.write(U.replace(/\.pack$/,".idx"),await j.toBuffer())}return Le}async function aS({fs:t,bare:e=!1,dir:r,gitdir:n=e?r:F.join(r,".git"),defaultBranch:i="master"}){if(await t.exists(n+"/config"))return;let a=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];a=a.map(s=>n+"/"+s);for(let s of a)await t.mkdir(s);await t.write(n+"/config",`[core]
|
||||
repositoryformatversion = 0
|
||||
filemode = false
|
||||
bare = ${e}
|
||||
`+(e?"":` logallrefupdates = true
|
||||
`)+` symlinks = false
|
||||
ignorecase = true
|
||||
`),await t.write(n+"/HEAD",`ref: refs/heads/${i}
|
||||
`)}async function aD({fs:t,cache:e,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:p,depth:g,since:v,exclude:y,relative:b,singleBranch:E,noCheckout:S,noTags:A,headers:k,nonBlocking:w,batchSize:x=100}){try{if(await aS({fs:t,gitdir:u}),await Zx({fs:t,gitdir:u,remote:p,url:f,force:!1}),d){let C=await nt.get({fs:t,gitdir:u});await C.set("http.corsProxy",d),await nt.save({fs:t,gitdir:u,config:C})}let{defaultBranch:_,fetchHead:T}=await hg({fs:t,cache:e,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:u,ref:h,remote:p,corsProxy:d,depth:g,since:v,exclude:y,relative:b,singleBranch:E,headers:k,tags:!A});if(T===null)return;h=h||_,h=h.replace("refs/heads/",""),await fg({fs:t,cache:e,onProgress:n,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:S,nonBlocking:w,batchSize:x})}catch(_){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),_}}async function sS({fs:t,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:o,dir:l,gitdir:c=F.join(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:p=void 0,since:g=void 0,exclude:v=[],relative:y=!1,singleBranch:b=!1,noCheckout:E=!1,noTags:S=!1,headers:A={},cache:k={},nonBlocking:w=!1,batchSize:x=100}){try{return P("fs",t),P("http",e),P("gitdir",c),E||P("dir",l),P("url",u),await aD({fs:new Q(t),cache:k,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:o,dir:l,gitdir:c,url:u,corsProxy:f,ref:d,remote:h,depth:p,since:g,exclude:v,relative:y,singleBranch:b,noCheckout:E,noTags:S,headers:A,nonBlocking:w,batchSize:x})}catch(_){throw _.caller="git.clone",_}}async function oS({fs:t,onSign:e,dir:r,gitdir:n=F.join(r,".git"),message:i,author:a,committer:s,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:p={}}){try{P("fs",t),l||P("message",i),o&&P("onSign",e);let g=new Q(t);return await Nf({fs:g,cache:p,onSign:e,gitdir:n,message:i,author:a,committer:s,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:d,tree:h})}catch(g){throw g.caller="git.commit",g}}async function lS({fs:t,dir:e,gitdir:r=F.join(e,".git"),fullname:n=!1,test:i=!1}){try{return P("fs",t),P("gitdir",r),await sa({fs:new Q(t),gitdir:r,fullname:n,test:i})}catch(a){throw a.caller="git.currentBranch",a}}async function sD({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await V.exists({fs:t,gitdir:e,ref:r}))throw new je(r);let i=await V.expand({fs:t,gitdir:e,ref:r}),a=await sa({fs:t,gitdir:e,fullname:!0});if(i===a){let l=await V.resolve({fs:t,gitdir:e,ref:i});await V.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await V.deleteRef({fs:t,gitdir:e,ref:i});let s=za(r),o=await nt.get({fs:t,gitdir:e});await o.deleteSection("branch",s),await nt.save({fs:t,gitdir:e,config:o})}async function cS({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n}){try{return P("fs",t),P("ref",n),await sD({fs:new Q(t),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteBranch",i}}async function uS({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n}){try{P("fs",t),P("ref",n),await V.deleteRef({fs:new Q(t),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteRef",i}}async function oD({fs:t,gitdir:e,remote:r}){let n=await nt.get({fs:t,gitdir:e});await n.deleteSection("remote",r),await nt.save({fs:t,gitdir:e,config:n})}async function fS({fs:t,dir:e,gitdir:r=F.join(e,".git"),remote:n}){try{return P("fs",t),P("remote",n),await oD({fs:new Q(t),gitdir:r,remote:n})}catch(i){throw i.caller="git.deleteRemote",i}}async function lD({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await V.deleteRef({fs:t,gitdir:e,ref:r})}async function dS({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n}){try{return P("fs",t),P("ref",n),await lD({fs:new Q(t),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteTag",i}}async function cD({fs:t,gitdir:e,oid:r}){let n=r.slice(0,2);return(await t.readdir(`${e}/objects/${n}`)).map(a=>`${n}${a}`).filter(a=>a.startsWith(r))}async function uD({fs:t,cache:e,gitdir:r,oid:n,getExternalRefDelta:i}){let a=[],s=await t.readdir(F.join(r,"objects/pack"));s=s.filter(o=>o.endsWith(".idx"));for(let o of s){let l=`${r}/objects/pack/${o}`,c=await ug({fs:t,cache:e,filename:l,getExternalRefDelta:i});if(c.error)throw new pe(c.error);for(let u of c.offsets.keys())u.startsWith(n)&&a.push(u)}return a}async function fD({fs:t,cache:e,gitdir:r,oid:n}){let i=o=>Ge({fs:t,cache:e,gitdir:r,oid:o}),a=await cD({fs:t,gitdir:r,oid:n}),s=await uD({fs:t,cache:e,gitdir:r,oid:n,getExternalRefDelta:i});for(let o of s)a.indexOf(o)===-1&&a.push(o);if(a.length===1)return a[0];throw a.length>1?new Yl("oids",n,a):new je(`an object matching "${n}"`)}async function hS({fs:t,dir:e,gitdir:r=F.join(e,".git"),oid:n,cache:i={}}){try{return P("fs",t),P("gitdir",r),P("oid",n),await fD({fs:new Q(t),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.expandOid",a}}async function pS({fs:t,dir:e,gitdir:
Line truncated
|
||||
`,d+=p.conflict.a.join(""),d+=`${"=".repeat(f)}
|
||||
`,d+=p.conflict.b.join(""),d+=`${">".repeat(f)} ${n}
|
||||
`);return{cleanMerge:h,mergedText:d}}async function hD({fs:t,cache:e,dir:r,gitdir:n=F.join(r,".git"),index:i,ourOid:a,baseOid:s,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let p=Rr({ref:a}),g=Rr({ref:s}),v=Rr({ref:o}),y=[],b=[],E=[],S=[],A=await ra({fs:t,cache:e,dir:r,gitdir:n,trees:[p,g,v],map:async function(k,[w,x,_]){let T=Cf(k),C=await If(w,x),I=await If(_,x);switch(`${C}-${I}`){case"false-false":return{mode:await x.mode(),path:T,oid:await x.oid(),type:await x.type()};case"false-true":return!_&&await w.type()==="tree"?{mode:await w.mode(),path:T,oid:await w.oid(),type:await w.type()}:_?{mode:await _.mode(),path:T,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!w&&await _.type()==="tree"?{mode:await _.mode(),path:T,oid:await _.oid(),type:await _.type()}:w?{mode:await w.mode(),path:T,oid:await w.oid(),type:await w.type()}:void 0;case"true-true":{if(w&&_&&await w.type()==="tree"&&await _.type()==="tree")return{mode:await w.mode(),path:T,oid:await w.oid(),type:"tree"};if(w&&_&&await w.type()==="blob"&&await _.type()==="blob")return pD({fs:t,gitdir:n,path:T,ours:w,base:x,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async L=>{if(L.cleanMerge)d||i.insert({filepath:k,oid:L.mergeResult.oid,stage:0});else if(y.push(k),b.push(k),!d){let $="";x&&await x.type()==="blob"&&($=await x.oid());let J=await w.oid(),de=await _.oid();i.delete({filepath:k}),$&&i.insert({filepath:k,oid:$,stage:1}),i.insert({filepath:k,oid:J,stage:2}),i.insert({filepath:k,oid:de,stage:3})}return L.mergeResult});if(x&&!w&&_&&await x.type()==="blob"&&await _.type()==="blob"){if(y.push(k),E.push(k),!d){let L=await x.oid(),$=await _.oid();i.delete({filepath:k}),i.insert({filepath:k,oid:L,stage:1}),i.insert({filepath:k,oid:$,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:T}}if(x&&w&&!_&&await x.type()==="blob"&&await w.type()==="blob"){if(y.push(k),S.push(k),!d){let L=await x.oid(),$=await w.oid();i.delete({filepath:k}),i.insert({filepath:k,oid:L,stage:1}),i.insert({filepath:k,oid:$,stage:2})}return{mode:await w.mode(),oid:await w.oid(),type:"blob",path:T}}if(x&&!w&&!_&&(await x.type()==="blob"||await x.type()==="tree"))return;throw new oo}}},reduce:y.length!==0&&(!r||d)?void 0:async(k,w)=>{let x=w.filter(Boolean);if(k&&!(k&&k.type==="tree"&&x.length===0&&k.path!==".")){if(x.length>0||k.path==="."&&x.length===0){let T=new hr(x).toObject(),C=await mr({fs:t,gitdir:n,type:"tree",object:T,dryRun:f});k.oid=C}return k}}});return y.length!==0?(r&&!d&&await ra({fs:t,cache:e,dir:r,gitdir:n,trees:[Rr({ref:A.oid})],map:async function(k,[w]){let x=`${r}/${k}`;if(await w.type()==="blob"){let _=await w.mode(),T=new TextDecoder().decode(await w.content());await t.write(x,T,{mode:_})}return!0}}),new lo(y,b,E,S)):A.oid}async function pD({fs:t,gitdir:e,path:r,ours:n,base:i,theirs:a,ourName:s,theirName:o,baseName:l,dryRun:c,mergeDriver:u=dD}){let f="blob",d="100755",h="",p="";i&&await i.type()==="blob"&&(d=await i.mode(),h=await i.oid(),p=Buffer.from(await i.content()).toString("utf8"));let g=d===await n.mode()?await a.mode():await n.mode();if(await n.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await n.oid(),type:f}};if(await n.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await a.oid(),type:f}};if(await a.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await n.oid(),type:f}};let v=Buffer.from(await n.content()).toString("utf8"),y=Buffer.from(await a.content()).toString("utf8"),{mergedText:b,cleanMerge:E}=await u({branches:[l,s,o],contents:[p,v,y],path:r}),S=await mr({fs:t,gitdir:e,type:"blob",object:Buffer.from(b,"utf8"),dryRun:c});return{cleanMerge:E,mergeResult:{mode:g,path:r,oid:S,type:f}}}async function mS({fs:t,cache:e,dir:r,gitdir:n,ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,onSign:g,mergeDriver:v,allowUnrelatedHistories:y=!1}){i===void 0&&(i=await sa({fs:t,gitdir:n,fullname:!0})),i=await V.expand({fs:t,gitdir:n,ref:i}),a=await V.expand({fs:t,gitdir:n,ref:a});let b=await V.resolve({fs:t,gitdir:n,ref:i}),E=await V.resolve({fs:t,gitdir:n,ref:a}),S=await pg({fs:t,cache:e,gitdir:n,oids:[b,E]});if(S.length!==1)if(S.length===0&&y)S.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new oo;let A=S[0];if(A===E)return{oid:b,alreadyMerged:!0};if(s&&A===b)return!l&&!c&&await V.writeRef({fs:t,gitdir:n,ref:i,value:E}),{oid:E,fastForward:!0};{if(o)throw new Jl;let k=await ct.acquire({fs:t,gitdir:n,cache:e,allowUnmerged:!1},async x=>hD({fs:t,cache:e,dir:r,gitdir:n,index:x,ourOid:b,theirOid:E,baseOid:A,ourName:za(i),baseName:"base",theirName:za(a),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(k instanceof lo)throw k;return f||(f=`Merge branch '${za(a)}' into ${za(i)}`),{oid:await Nf({fs:t,cache:e,gitdir:n,message:f,ref:i,tree:k,parent:[b,E],author:d,committer:h,signi
Line truncated
|
||||
`)),n.push(Qe.encode(`agent=${Bf.agent}
|
||||
`)),(r||e||t)&&n.push(Qe.delim()),r&&n.push(Qe.encode("peel")),e&&n.push(Qe.encode("symrefs")),t&&n.push(Qe.encode(`ref-prefix ${t}`)),n.push(Qe.flush()),n}async function NS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:a,headers:s={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{P("http",t),P("url",a);let d=await mo.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:l});if(d.protocolVersion===1)return AS(d,c,u,f);let h=await xD({prefix:c,symrefs:u,peelTags:f}),p=await mo.connect({http:t,auth:d.auth,headers:s,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,body:h});return _D(p.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function BS({fs:t,dir:e,gitdir:r=F.join(e,".git")}){try{return P("fs",t),P("gitdir",r),V.listTags({fs:new Q(t),gitdir:r})}catch(n){throw n.caller="git.listTags",n}}function SD(t,e){return t.committer.timestamp-e.committer.timestamp}var ED="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function Px({fs:t,cache:e,gitdir:r,oid:n,fileId:i}){if(i===ED)return;let a=n,s,o=await fo({fs:t,cache:e,gitdir:r,oid:n}),l=o.tree;return i===o.oid?s=o.path:(s=await HS({fs:t,cache:e,gitdir:r,tree:l,fileId:i,oid:a}),Array.isArray(s)&&(s.length===0?s=void 0:s.length===1&&(s=s[0]))),s}async function HS({fs:t,cache:e,gitdir:r,tree:n,fileId:i,oid:a,filepaths:s=[],parentPath:o=""}){let l=n.entries().map(function(c){let u;return c.oid===i?(u=F.join(o,c.path),s.push(u)):c.type==="tree"&&(u=Ge({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:f}){return HS({fs:t,cache:e,gitdir:r,tree:hr.from(f),fileId:i,oid:a,filepaths:s,parentPath:F.join(o,c.path)})})),u});return await Promise.all(l),s}async function AD({fs:t,cache:e,gitdir:r,filepath:n,ref:i,depth:a,since:s,force:o,follow:l}){let c=typeof s=="undefined"?void 0:Math.floor(s.valueOf()/1e3),u=[],f=await qa.read({fs:t,gitdir:r}),d=await V.resolve({fs:t,gitdir:r,ref:i}),h=[await po({fs:t,cache:e,gitdir:r,oid:d})],p,g,v;function y(b){v&&n&&u.push(b)}for(;h.length>0;){let b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(n){let E;try{E=await lc({fs:t,cache:e,gitdir:r,oid:b.commit.tree,filepath:n}),g&&p!==E&&u.push(g),p=E,g=b,v=!0}catch(S){if(S instanceof je){let A=l&&p;if(A&&(A=await Px({fs:t,cache:e,gitdir:r,oid:b.commit.tree,fileId:p}),A))if(Array.isArray(A)){if(g){let k=await Px({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:p});if(Array.isArray(k))if(A=A.filter(w=>k.indexOf(w)===-1),A.length===1)A=A[0],n=A,g&&u.push(g);else{A=!1,g&&u.push(g);break}}}else n=A,g&&u.push(g);if(!A){if(v&&p&&(u.push(g),!o))break;if(!o&&!l)throw S}g=b,v=!1}else throw S}}else u.push(b);if(a!==void 0&&u.length===a){y(b);break}if(!f.has(b.oid))for(let E of b.commit.parent){let S=await po({fs:t,cache:e,gitdir:r,oid:E});h.map(A=>A.oid).includes(S.oid)||h.push(S)}h.length===0&&y(b),h.sort((E,S)=>SD(E.commit,S.commit))}return u}async function US({fs:t,dir:e,gitdir:r=F.join(e,".git"),filepath:n,ref:i="HEAD",depth:a,since:s,force:o,follow:l,cache:c={}}){try{return P("fs",t),P("gitdir",r),P("ref",i),await AD({fs:new Q(t),cache:c,gitdir:r,filepath:n,ref:i,depth:a,since:s,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function GS({fs:t,onSign:e,dir:r,gitdir:n=F.join(r,".git"),ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,cache:g={},mergeDriver:v,allowUnrelatedHistories:y=!1}){try{P("fs",t),p&&P("onSign",e);let b=new Q(t),E=await ia({fs:b,gitdir:n,author:d});if(!E&&(!o||!s))throw new zt("author");let S=await ho({fs:b,gitdir:n,author:E,committer:h});if(!S&&(!o||!s))throw new zt("committer");return await mS({fs:b,cache:g,dir:r,gitdir:n,ours:i,theirs:a,fastForward:s,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:E,committer:S,signingKey:p,onSign:e,mergeDriver:v,allowUnrelatedHistories:y})}catch(b){throw b.caller="git.merge",b}}var kD={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function zS({fs:t,cache:e,dir:r,gitdir:n=F.join(r,".git"),oids:i}){let a=new Mx,s=[];function o(u,f){let d=Buffer.from(u,f);s.push(d),a.update(d)}async function l({stype:u,object:f}){let d=kD[u],h=f.length,p=h>15?128:0,g=h&15;h=h>>>4;let v=(p|d|g).toString(16);for(o(v,"hex");p;)p=h>127?128:0,v=p|h&127,o(lg(2,v),"hex"),h=h>>>7;o(Buffer.from(await Gx(f)))}o("PACK"),o("00000002","hex"),o(lg(8,i.length),"hex");for(let u of i){let{type:f,object:d}=await Ge({fs:t,cache:e,gitdir:n,oid:u});await l({write:o,object:d,stype:f})}let c=a.digest();return s.push(c),s}async function TD({fs:t,cache:e,gitdir:r,oids:n,write:i}){let a=await zS({fs:t,cache:e,gitdir:r,oids:n}),s=Buffer.from(await Ff(a)),l=`pack-${s.slice(-20).toString("hex")}.pack`;return i?(await t.write(F.join(r,`objects/pack/${l}`),s),{filename:l}):{filename:l,packfile:new Uint8Array(s)}}async function VS({fs:t,dir:e,gi
Line truncated
|
||||
`),i=await n();let a=r.toString("utf8").split(`
|
||||
`);if(i=a.shift(),!i.startsWith("unpack "))throw new Va('unpack ok" or "unpack [error message]',i);e.ok=i==="unpack ok",e.ok||(e.error=i.slice(7)),e.refs={};for(let s of a){if(s.trim()==="")continue;let o=s.slice(0,2),l=s.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 RD({capabilities:t=[],triplets:e=[]}){let r=[],n=`\0 ${t.join(" ")}`;for(let i of e)r.push(Qe.encode(`${i.oldoid} ${i.oid} ${i.fullRef}${n}
|
||||
`)),n="";return r.push(Qe.flush()),r}async function MD({fs:t,cache:e,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:p=!1,delete:g=!1,corsProxy:v,headers:y={}}){let b=u||await sa({fs:t,gitdir:c});if(typeof b=="undefined")throw new dr("ref");let E=await nt.get({fs:t,gitdir:c});d=d||await E.get(`branch.${b}.pushRemote`)||await E.get("remote.pushDefault")||await E.get(`branch.${b}.remote`)||"origin";let S=h||await E.get(`remote.${d}.pushurl`)||await E.get(`remote.${d}.url`);if(typeof S=="undefined")throw new dr("remote OR url");let A=f||await E.get(`branch.${b}.merge`);if(typeof S=="undefined")throw new dr("remoteRef");v===void 0&&(v=await E.get("http.corsProxy"));let k=await V.expand({fs:t,gitdir:c,ref:b}),w=g?"0000000000000000000000000000000000000000":await V.resolve({fs:t,gitdir:c,ref:k}),x=go.getRemoteHelperFor({url:S}),_=await x.discover({http:r,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:v,service:"git-receive-pack",url:S,headers:y,protocolVersion:1}),T=_.auth,C;if(!A)C=k;else try{C=await V.expandAgainstMap({ref:A,map:_.refs})}catch(W){if(W instanceof je)C=A.startsWith("refs/")?A:`refs/heads/${A}`;else throw W}let I=_.refs.get(C)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:S,localRef:{ref:g?"(delete)":k,oid:w},remoteRef:{ref:C,oid:I}}))throw new uo;let L=!_.capabilities.has("no-thin"),$=new Set;if(!g){let W=[..._.refs.values()],B=new Set;if(I!=="0000000000000000000000000000000000000000"){let $e=await pg({fs:t,cache:e,gitdir:c,oids:[w,I]});for(let lr of $e)W.push(lr);L&&(B=await Xm({fs:t,cache:e,gitdir:c,oids:$e}))}if(!W.includes(w)){let $e=await CD({fs:t,cache:e,gitdir:c,start:[w],finish:W});$=await Xm({fs:t,cache:e,gitdir:c,oids:$e})}if(L){try{let $e=await V.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:lr}=await V.resolveAgainstMap({ref:$e.replace(`refs/remotes/${d}/`,""),fullref:$e,map:_.refs}),Ut=[lr];for(let X of await Xm({fs:t,cache:e,gitdir:c,oids:Ut}))B.add(X)}catch($e){}for(let $e of B)$.delete($e)}if(w===I&&(p=!0),!p){if(k.startsWith("refs/tags")&&I!=="0000000000000000000000000000000000000000")throw new co("tag-exists");if(w!=="0000000000000000000000000000000000000000"&&I!=="0000000000000000000000000000000000000000"&&!await RS({fs:t,cache:e,gitdir:c,oid:w,ancestor:I,depth:-1}))throw new co("not-fast-forward")}}let J=nS([..._.capabilities],["report-status","side-band-64k",`agent=${Bf.agent}`]),de=await RD({capabilities:J,triplets:[{oldoid:I,oid:w,fullRef:C}]}),le=g?[]:await zS({fs:t,cache:e,gitdir:c,oids:[...$]}),ce=await x.connect({http:r,onProgress:n,corsProxy:v,service:"git-receive-pack",url:S,auth:T,headers:y,body:[...de,...le]}),{packfile:Te,progress:ne}=await $f.demux(ce.body);if(i){let W=iS(ne);uc(W,async B=>{await i(B)})}let N=await PD(Te);if(ce.headers&&(N.headers=ce.headers),d&&N.ok&&N.refs[C].ok&&!k.startsWith("refs/tags")){let W=`refs/remotes/${d}/${C.replace("refs/heads","")}`;g?await V.deleteRef({fs:t,gitdir:c,ref:W}):await V.writeRef({fs:t,gitdir:c,ref:W,value:w})}if(N.ok&&Object.values(N.refs).every(W=>W.ok))return N;{let W=Object.entries(N.refs).filter(([B,$e])=>!$e.ok).map(([B,$e])=>`
|
||||
- ${B}: ${$e.error}`).join("");throw new Ql(W,N)}}async function WS({fs:t,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,dir:l,gitdir:c=F.join(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:p=!1,delete:g=!1,corsProxy:v,headers:y={},cache:b={}}){try{return P("fs",t),P("http",e),P("gitdir",c),await MD({fs:new Q(t),cache:b,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:p,delete:g,corsProxy:v,headers:y})}catch(E){throw E.caller="git.push",E}}async function YS({fs:t,cache:e,gitdir:r,oid:n}){let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:r,oid:n});if(i==="tag")return n=Mr.from(a).parse().object,YS({fs:t,cache:e,gitdir:r,oid:n});if(i!=="blob")throw new tr(n,i,"blob");return{oid:n,blob:new Uint8Array(a)}}async function XS({fs:t,cache:e,gitdir:r,oid:n,filepath:i=void 0}){return i!==void 0&&(n=await lc({fs:t,cache:e,gitdir:r,oid:n,filepath:i})),await YS({fs:t,cache:e,gitdir:r,oid:n})}async function KS({fs:t,dir:e,gitdir:r=F.join(e,".git"),oid:n,filepath:i,cache:a={}}){try{return P("fs",t),P("gitdir",r),P("oid",n),await XS({fs:new Q(t),cache:a,gitdir:r,oid:n,filepath:i})}catch(s){throw s.caller="git.readBlob",s}}async function mg({fs:t,dir:e,gitdir:r=F.join(e,".git"),oid:n,cache:i={}}){try{return P("fs",t),P("gitdir",r),P("oid",n),await po({fs:new Q(t),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.readCommit",a}}async function OD({fs:t,cache:e,gitdir:r,ref:n="refs/notes/commits",oid:i}){let a=await V.resolve({gitdir:r,fs:t,ref:n}),{blob:s}=await XS({fs:t,cache:e,gitdir:r,oid:a,filepath:i});return s}async function ZS({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n="refs/notes/commits",oid:i,cache:a={}}){try{return P("fs",t),P("gitdir",r),P("ref",n),P("oid",i),await OD({fs:new Q(t),cache:a,gitdir:r,ref:n,oid:i})}catch(s){throw s.caller="git.readNote",s}}async function JS({fs:t,dir:e,gitdir:r=F.join(e,".git"),oid:n,format:i="parsed",filepath:a=void 0,encoding:s=void 0,cache:o={}}){try{P("fs",t),P("gitdir",r),P("oid",n);let l=new Q(t);a!==void 0&&(n=await lc({fs:l,cache:o,gitdir:r,oid:n,filepath:a}));let u=await Ge({fs:l,cache:o,gitdir:r,oid:n,format:i==="parsed"?"content":i});if(u.oid=n,i==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=pr.from(u.object).parse();break;case"tree":u.object=hr.from(u.object).entries();break;case"blob":s?u.object=u.object.toString(s):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=Mr.from(u.object).parse();break;default:throw new tr(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(l){throw l.caller="git.readObject",l}}async function ID({fs:t,cache:e,gitdir:r,oid:n}){let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:r,oid:n,format:"content"});if(i!=="tag")throw new tr(n,i,"tag");let s=Mr.from(a);return{oid:n,tag:s.parse(),payload:s.payload()}}async function QS({fs:t,dir:e,gitdir:r=F.join(e,".git"),oid:n,cache:i={}}){try{return P("fs",t),P("gitdir",r),P("oid",n),await ID({fs:new Q(t),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.readTag",a}}async function eE({fs:t,dir:e,gitdir:r=F.join(e,".git"),oid:n,filepath:i=void 0,cache:a={}}){try{return P("fs",t),P("gitdir",r),P("oid",n),await wo({fs:new Q(t),cache:a,gitdir:r,oid:n,filepath:i})}catch(s){throw s.caller="git.readTree",s}}async function tE({fs:t,dir:e,gitdir:r=F.join(e,".git"),filepath:n,cache:i={}}){try{P("fs",t),P("gitdir",r),P("filepath",n),await ct.acquire({fs:new Q(t),gitdir:r,cache:i},async function(a){a.delete({filepath:n})})}catch(a){throw a.caller="git.remove",a}}async function FD({fs:t,cache:e,onSign:r,gitdir:n,ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l}){let c;try{c=await V.resolve({gitdir:n,fs:t,ref:i})}catch(p){if(!(p instanceof je))throw p}let f=(await wo({fs:t,gitdir:n,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==a);let d=await cc({fs:t,gitdir:n,tree:f});return await Nf({fs:t,cache:e,onSign:r,gitdir:n,ref:i,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
|
||||
`,author:s,committer:o,signingKey:l})}async function rE({fs:t,onSign:e,dir:r,gitdir:n=F.join(r,".git"),ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l,cache:c={}}){try{P("fs",t),P("gitdir",n),P("oid",a);let u=new Q(t),f=await ia({fs:u,gitdir:n,author:s});if(!f)throw new zt("author");let d=await ho({fs:u,gitdir:n,author:f,committer:o});if(!d)throw new zt("committer");return await FD({fs:u,cache:c,onSign:e,gitdir:n,ref:i,oid:a,author:f,committer:d,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function $D({fs:t,gitdir:e,oldref:r,ref:n,checkout:i=!1}){if(n!==zn.clean(n))throw new mn(n,zn.clean(n));if(r!==zn.clean(r))throw new mn(r,zn.clean(r));let a=`refs/heads/${r}`,s=`refs/heads/${n}`;if(await V.exists({fs:t,gitdir:e,ref:s}))throw new pn("branch",n,!1);let l=await V.resolve({fs:t,gitdir:e,ref:a,depth:1});await V.writeRef({fs:t,gitdir:e,ref:s,value:l}),await V.deleteRef({fs:t,gitdir:e,ref:a});let u=await sa({fs:t,gitdir:e,fullname:!0})===a;(i||u)&&await V.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}async function nE({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n,oldref:i,checkout:a=!1}){try{return P("fs",t),P("gitdir",r),P("ref",n),P("oldref",i),await $D({fs:new Q(t),gitdir:r,ref:n,oldref:i,checkout:a})}catch(s){throw s.caller="git.renameBranch",s}}async function iE({gitdir:t,type:e,object:r}){return bi(ea.wrap({type:e,object:r}))}async function aE({fs:t,dir:e,gitdir:r=F.join(e,".git"),filepath:n,ref:i,cache:a={}}){try{P("fs",t),P("gitdir",r),P("filepath",n);let s=new Q(t),o,l;try{o=await V.resolve({fs:s,gitdir:r,ref:i||"HEAD"})}catch(f){if(i)throw f}if(o)try{o=await lc({fs:s,cache:a,gitdir:r,oid:o,filepath:n})}catch(f){o=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},u=e&&await s.read(F.join(e,n));u&&(l=await iE({gitdir:r,type:"blob",object:u}),o===l&&(c=await s.lstat(F.join(e,n)))),await ct.acquire({fs:s,gitdir:r,cache:a},async function(f){f.delete({filepath:n}),o&&f.insert({filepath:n,stats:c,oid:o})})}catch(s){throw s.caller="git.reset",s}}async function sE({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n,depth:i}){try{return P("fs",t),P("gitdir",r),P("ref",n),await V.resolve({fs:new Q(t),gitdir:r,ref:n,depth:i})}catch(a){throw a.caller="git.resolveRef",a}}async function oE({fs:t,dir:e,gitdir:r=F.join(e,".git"),path:n,value:i,append:a=!1}){try{P("fs",t),P("gitdir",r),P("path",n);let s=new Q(t),o=await nt.get({fs:s,gitdir:r});a?await o.append(n,i):await o.set(n,i),await nt.save({fs:s,gitdir:r,config:o})}catch(s){throw s.caller="git.setConfig",s}}async function lE({fs:t,gitdir:e,commit:r}){let n=pr.from(r).toObject();return await mr({fs:t,gitdir:e,type:"commit",object:n,format:"content"})}var Df=class t{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),n=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${n}`}static createStashReflogEntry(e,r,n){let i=e.name.replace(/\s/g,""),a="0000000000000000000000000000000000000000",s=Math.floor(Date.now()/1e3),o=t.timezoneOffsetForRefLogEntry;return`${a} ${r} ${i} ${e.email} ${s} ${o} ${n}
|
||||
`}static getStashReflogEntry(e,r=!1){return e.split(`
|
||||
`).filter(a=>a).reverse().map((a,s)=>r?`stash@{${s}}: ${a.split(" ")[1]}`:a)}},DD={stage:Ya,workdir:yo},Km;async function vo(t,e){return Km===void 0&&(Km=new zl),Km.acquire(t,e)}async function LD(t,e,r,n,i=null){let a=F.join(r,n),s=await t.lstat(a);if(!s)throw new je(a);if(s.isDirectory())throw new pe(`${a}: file expected, but found directory`);let o=i?await Lx({fs:t,gitdir:e,oid:i}):void 0,l=o?i:void 0;return o||await vo({fs:t,gitdir:e,currentFilepath:a},async()=>{let c=s.isSymbolicLink()?await t.readlink(a).then(zx):await t.read(a);if(c===null)throw new je(a);l=await mr({fs:t,gitdir:e,type:"blob",object:c})}),l}async function jD({fs:t,dir:e,gitdir:r,entries:n}){async function i(a){if(a.type==="tree"){if(!a.oid){let s=await Promise.all(a.children.map(i));a.oid=await cc({fs:t,gitdir:r,tree:s}),a.mode=16384}}else a.type==="blob"&&(a.oid=await LD(t,r,e,a.path,a.oid),a.mode=33188);return a.path=a.path.split("/").pop(),a}return Promise.all(n.map(i))}async function Rx({fs:t,dir:e,gitdir:r,treePair:n}){let i=n[1]==="stage",a=n.map(h=>typeof h=="string"?DD[h]():h),s=[],u=await ra({fs:t,cache:{},dir:e,gitdir:r,trees:a,map:async(h,[p,g])=>{if(!(h==="."||await na.isIgnored({fs:t,dir:e,gitdir:r,filepath:h}))&&g)return(!p||await p.oid()!==await g.oid()&&await g.oid()!==void 0)&&s.push([p,g]),{mode:await g.mode(),path:h,oid:await g.oid(),type:await g.type()}},reduce:async(h,p)=>(p=p.filter(Boolean),h?(h.children=p,h):p.length>0?p:void 0),iterate:async(h,p)=>{let g=[];for(let v of p){let[y,b]=v;i?b&&(await t.exists(`${e}/${b.toString()}`)?g.push(v):s.push([null,b])):y&&(b?g.push(v):s.push([y,null]))}return g.length?Promise.all(g.map(h)):[]}});if(s.length===0||u.length===0)return null;let d=(await jD({fs:t,dir:e,gitdir:r,entries:u})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return cc({fs:t,gitdir:r,tree:d})}async function ND({fs:t,dir:e,gitdir:r,stashCommit:n,parentCommit:i,wasStaged:a}){let s=[],o=[],l=await ra({fs:t,cache:{},dir:e,gitdir:r,trees:[Rr({ref:i}),Rr({ref:n})],map:async(c,[u,f])=>{if(c==="."||await na.isIgnored({fs:t,dir:e,gitdir:r,filepath:c}))return;let d=f?await f.type():await u.type();if(d!=="tree"&&d!=="blob")return;if(!f&&u){let p=d==="tree"?"rmdir":"rm";return d==="tree"&&s.push(c),d==="blob"&&a&&o.push({filepath:c,oid:await u.oid()}),{method:p,filepath:c}}let h=await f.oid();if(!u||await u.oid()!==h)return d==="tree"?{method:"mkdir",filepath:c}:(a&&o.push({filepath:c,oid:h,stats:await t.lstat(F.join(e,c))}),{method:"write",filepath:c,oid:h})}});await vo({fs:t,gitdir:r,dirRemoved:s,ops:l},async()=>{for(let c of l){let u=F.join(e,c.filepath);switch(c.method){case"rmdir":await t.rmdir(u);break;case"mkdir":await t.mkdir(u);break;case"rm":await t.rm(u);break;case"write":if(!s.some(f=>u.startsWith(f))){let{object:f}=await Ge({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,f)}break}}}),await ct.acquire({fs:t,gitdir:r,cache:{}},async c=>{o.forEach(({filepath:u,stats:f,oid:d})=>{c.insert({filepath:u,stats:f,oid:d})})})}var Wa=class t{constructor({fs:e,dir:r,gitdir:n=F.join(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:n,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return F.join(this.gitdir,t.refStash)}get refLogsStashPath(){return F.join(this.gitdir,t.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await ia({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new zt("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:n}){return lE({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:n,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 mn(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let n=await this.getStashSHA(e,r);return n?po({fs:this.fs,cache:{},gitdir:this.gitdir,oid:n}):{}}async writeStashRef(e){return V.writeRef({fs:this.fs,gitdir:this.gitdir,ref:t.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let n=await this.getAuthor(),i=Df.createStashReflogEntry(n,e,r),a=this.refLogsStashPath;await vo({filepath:a,entry:i},async()=>{let s=await this.fs.exists(a)?await this.fs.read(a,"utf8"):"";await this.fs.write(a,s+i,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let n=(await this.fs.read(this.refLogsStashPath)).toString();return Df.getStashReflogEntry(n,e)}};async function BD({fs:t,dir:e,gitdir:r,message:n=""}){let i=new Wa({fs:t,dir:e,gitdir:r});await i.getAuthor();let a=await sa({fs:t,gitdir:r,fullname:!1}),s=await V.resolve({fs:t,gitdir:r,ref:"HEAD"}),l=(await mg({fs:t,dir:e,gitdir:r,oid:s})).commit.message,c=[s],u=null,f=Rr({ref:"H
Line truncated
|
||||
`),"utf8");let c=o[o.length-1].split(" ")[1];await i.writeStashRef(c)}else await t.rm(l)})}async function HD({fs:t,dir:e,gitdir:r}){return new Wa({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function UD({fs:t,dir:e,gitdir:r}){let n=new Wa({fs:t,dir:e,gitdir:r}),i=[n.refStashPath,n.refLogsStashPath];await vo(i,async()=>{await Promise.all(i.map(async a=>{if(await t.exists(a))return t.rm(a)}))})}async function GD({fs:t,dir:e,gitdir:r,refIdx:n=0}){await cE({fs:t,dir:e,gitdir:r,refIdx:n}),await uE({fs:t,dir:e,gitdir:r,refIdx:n})}async function fE({fs:t,dir:e,gitdir:r=F.join(e,".git"),op:n="push",message:i="",refIdx:a=0}){P("fs",t),P("dir",e),P("gitdir",r),P("op",n);let s={push:BD,apply:cE,drop:uE,list:HD,clear:UD,pop:GD},o=["apply","drop","pop"];try{let l=new Q(t);["refs","logs","logs/refs"].map(f=>F.join(r,f)).forEach(async f=>{await l.exists(f)||await l.mkdir(f)});let u=s[n];if(u){if(o.includes(n)&&a<0)throw new mn(`stash@${a}`,"number that is in range of [0, num of stash pushed]");return await u({fs:l,dir:e,gitdir:r,message:i,refIdx:a})}throw new Error(`To be implemented: ${n}`)}catch(l){throw l.caller="git.stash",l}}async function dE({fs:t,dir:e,gitdir:r=F.join(e,".git"),filepath:n,cache:i={}}){try{P("fs",t),P("gitdir",r),P("filepath",n);let a=new Q(t);if(await na.isIgnored({fs:a,gitdir:r,dir:e,filepath:n}))return"ignored";let o=await zD({fs:a,cache:i,gitdir:r}),l=await hE({fs:a,cache:i,gitdir:r,tree:o,path:n}),c=await ct.acquire({fs:a,gitdir:r,cache:i},async function(g){for(let v of g)if(v.path===n)return v;return null}),u=await a.lstat(F.join(e,n)),f=l!==null,d=c!==null,h=u!==null,p=async()=>{if(d&&!Tf(c,u))return c.oid;{let g=await a.read(F.join(e,n)),v=await iE({gitdir:r,type:"blob",object:g});return d&&c.oid===v&&u.size!==-1&&ct.acquire({fs:a,gitdir:r,cache:i},async function(y){y.insert({filepath:n,stats:u,oid:v})}),v}};if(!f&&!h&&!d)return"absent";if(!f&&!h&&d)return"*absent";if(!f&&h&&!d)return"*added";if(!f&&h&&d)return await p()===c.oid?"added":"*added";if(f&&!h&&!d)return"deleted";if(f&&!h&&d)return l===c.oid,"*deleted";if(f&&h&&!d)return await p()===l?"*undeleted":"*undeletemodified";if(f&&h&&d){let g=await p();return g===l?g===c.oid?"unmodified":"*unmodified":g===c.oid?"modified":"*modified"}}catch(a){throw a.caller="git.status",a}}async function hE({fs:t,cache:e,gitdir:r,tree:n,path:i}){typeof i=="string"&&(i=i.split("/"));let a=i.shift();for(let s of n)if(s.path===a){if(i.length===0)return s.oid;let{type:o,object:l}=await Ge({fs:t,cache:e,gitdir:r,oid:s.oid});if(o==="tree"){let c=hr.from(l);return hE({fs:t,cache:e,gitdir:r,tree:c,path:i})}if(o==="blob")throw new tr(s.oid,o,"blob",i.join("/"))}return null}async function zD({fs:t,cache:e,gitdir:r}){let n;try{n=await V.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(a){if(a instanceof je)return[]}let{tree:i}=await wo({fs:t,cache:e,gitdir:r,oid:n});return i}async function pE({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n="HEAD",filepaths:i=["."],filter:a,cache:s={},ignored:o=!1}){try{P("fs",t),P("gitdir",r),P("ref",n);let l=new Q(t);return await ra({fs:l,cache:s,dir:e,gitdir:r,trees:[Rr({ref:n}),yo(),Ya()],map:async function(c,[u,f,d]){if(!u&&!d&&f&&!o&&await na.isIgnored({fs:l,dir:e,filepath:c})||!i.some(k=>tS(c,k)))return null;if(a&&!a(c))return;let[h,p,g]=await Promise.all([u&&u.type(),f&&f.type(),d&&d.type()]),v=[h,p,g].includes("blob");if((h==="tree"||h==="special")&&!v)return;if(h==="commit")return null;if((p==="tree"||p==="special")&&!v)return;if(g==="commit")return null;if((g==="tree"||g==="special")&&!v)return;let y=h==="blob"?await u.oid():void 0,b=g==="blob"?await d.oid():void 0,E;h!=="blob"&&p==="blob"&&g!=="blob"?E="42":p==="blob"&&(E=await f.oid());let S=[void 0,y,E,b],A=S.map(k=>S.indexOf(k));return A.shift(),[c,...A]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function mE({fs:t,dir:e,gitdir:r=F.join(e,".git"),ref:n,object:i,force:a=!1}){try{P("fs",t),P("gitdir",r),P("ref",n);let s=new Q(t);if(n===void 0)throw new dr("ref");n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`;let o=await V.resolve({fs:s,gitdir:r,ref:i||"HEAD"});if(!a&&await V.exists({fs:s,gitdir:r,ref:n}))throw new pn("tag",n);await V.writeRef({fs:s,gitdir:r,ref:n,value:o})}catch(s){throw s.caller="git.tag",s}}async function gE({fs:t,dir:e,gitdir:r=F.join(e,".git"),cache:n={},filepath:i,oid:a,mode:s,add:o,remove:l,force:c}){try{P("fs",t),P("gitdir",r),P("filepath",i);let u=new Q(t);if(l)return await ct.acquire({fs:u,gitdir:r,cache:n},async function(d){if(!c){let h=await u.lstat(F.join(e,i));if(h){if(h.isDirectory())throw new ta("directory");return}}d.has({filepath:i})&&d.delete({filepath:i})});let f;if(!a){if(f=await u.lstat(F.join(e,i)),!f)throw new je(`file at "${i}" on disk and "remove" not set`);if(f.isDirectory())throw new ta("directory")}return await ct.acquire({fs:u,gitdir:r,cache:n},async function(d){if(!o&&!d.has({filepath:i}))throw new je(`file at "${i}" in index and "add" not set`);let h;if(a)h={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,m
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EB(t,e){if(t){if(typeof t=="string")return ST(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 ST(t,e)}}function ST(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function AB(t,e){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,i=!1,a=void 0;try{for(var s=t[Symbol.iterator](),o;!(n=(o=s.next()).done)&&(r.push(o.value),!(e&&r.length===e));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw a}}return r}}function kB(t){if(Array.isArray(t))return t}var AT=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?$/,kT=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?$/,TT=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,CT=/^rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,PT=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,RT=/^rgba?\(\s*(\d+%)\s+(\d+%)\s+(\d+%)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,MT=/^hsla?\(\s*(\d+)(deg|rad|grad|turn)?\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/;function bc(t,e){return t.indexOf(e)>-1}function TB(t,e,r){var n=t/255,i=e/255,a=r/255,s=Math.max(n,i,a),o=Math.min(n,i,a),l=s-o,c=(s+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=function(){switch(s){case n:return(i-a)/l%6;case i:return(a-n)/l+2;default:return(n-i)/l+4}}();return[f*60,u*100,c*100]}function CB(t,e,r){var n=t/60,i=e/100,a=r/100,s=(1-Math.abs(2*a-1))*i,o=s*(1-Math.abs(n%2-1)),l=a-s/2,c=function(){return n<1?[s,o,0]:n<2?[o,s,0]:n<3?[0,s,o]:n<4?[0,o,s]:n<5?[o,0,s]:[s,0,o]}(),u=nr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var PB=function(){function t(e){var r=nr(e,4),n=r[0],i=r[1],a=r[2],s=r[3];_B(this,t),this.values=[Math.max(Math.min(parseInt(n,10),255),0),Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(a,10),255),0),s==null?1:Math.max(Math.min(parseFloat(s),255),0)]}return xB(t,[{key:"toRgbString",value:function(){var r=nr(this.values,4),n=r[0],i=r[1],a=r[2],s=r[3];return s===1?"rgb(".concat(n,", ").concat(i,", ").concat(a,")"):"rgba(".concat(n,", ").concat(i,", ").concat(a,", ").concat(s,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),n=nr(r,4),i=n[0],a=n[1],s=n[2],o=n[3];return o===1?"hsl(".concat(i,", ").concat(a,"%, ").concat(s,"%)"):"hsla(".concat(i,", ").concat(a,"%, ").concat(s,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=nr(this.values,4),n=r[0],i=r[1],a=r[2],s=r[3];return n=Number(n).toString(16).padStart(2,"0"),i=Number(i).toString(16).padStart(2,"0"),a=Number(a).toString(16).padStart(2,"0"),s=s<1?parseInt(s*255,10).toString(16).padStart(2,"0"):"","#".concat(n).concat(i).concat(a).concat(s)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=nr(this.values,4),n=r[0],i=r[1],a=r[2],s=r[3],o=TB(n,i,a),l=nr(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,s]}}]),t}();function Po(t){var e=nr(t,4),r=e[0],n=e[1],i=e[2],a=e[3];return new PB([r,n,i,a])}function u0(t){var e=nr(t,3),r=e[0],n=e[1],i=e[2];return Po([r,n,i,1])}function md(t){var e=nr(t,4),r=e[0],n=e[1],i=e[2],a=e[3],s=CB(r,n,i),o=nr(s,3),l=o[0],c=o[1],u=o[2];return Po([l,c,u,a])}function OT(t){var e=nr(t,3),r=e[0],n=e[1],i=e[2];return md([r,n,i,1])}function RB(t){var e=AT.exec(t)||kT.exec(t),r=nr(e,5),n=r[1],i=r[2],a=r[3],s=r[4];return n=parseInt(n.length<2?n.repeat(2):n,16),i=parseInt(i.length<2?i.repeat(2):i,16),a=parseInt(a.length<2?a.repeat(2):a,16),s=s&&(parseInt(s.length<2?s.repeat(2):s,16)/255).toPrecision(1)||1,Po([n,i,a,s])}function MB(t){var e=TT.exec(t)||PT.exec(t)||CT.exec(t)||RT.exec(t),r=nr(e,5),n=r[1],i=r[2],a=r[3],s=r[4];return n=bc(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),i=bc(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),a=bc(a,"%")>0?parseInt(a,10)*255/100:parseInt(a,10),s=s===void 0?1:parseFloat(s)/(bc(s,"%")?100:1),Po([n,i,a,s])}function OB(t){var e=MT.exec(t),r=nr(e,6),n=r[1],i=r[2],a=r[3],s=r[4],o=r[5];return i=i||"deg",n=(0,bB.default)(parseFloat(n),i,"deg"),a=parseFloat(a),s=parseFloat(s),o=o===void 0?1:parseFloat(o)/(bc(o,"%")?100:1),md([n,a,s,o])}function IT(t){return _T.default[t]?u0(_T.default[t]):AT.test(t)||kT.test(t)?RB(t):TT.test(t)||PT.test(t)||CT.test(t)||RT.test(t)?MB(t):MT.test(t)?OB(t):null}var IB={fromString:IT,fromRgb:u0,fromRgba:Po,fromHsl:OT,fromHsla:md};xi.default=IB});var f0=M((BX,DT)=>{"use strict";m();var $T=Object.prototype.toString;DT.exports=function(e){var r=$T.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&$T.call(e.callee)==="[object Function]"),n}});var VT=M((UX,zT)=>{"
Line truncated
|
||||
`)>=0)return!1;return!0}function Z7(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Wn.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Wn.call(Array(e+1),r)}}function R0(t,e){if(t.length===0)return"";var r=`
|
||||
`+e.prev+e.base;return r+Wn.call(t,","+r)+`
|
||||
`+e.prev}function _d(t,e){var r=P0(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Si(t,i)?e(t[i],t):""}var a=typeof E0=="function"?E0(t):[],s;if(Ro){s={};for(var o=0;o<a.length;o++)s["$"+a[o]]=a[o]}for(var l in t)Si(t,l)&&(r&&String(Number(l))===l&&l<t.length||Ro&&s["$"+l]instanceof Symbol||(UC.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof E0=="function")for(var c=0;c<a.length;c++)GC.call(t,a[c])&&n.push("["+e(a[c])+"]: "+e(t[a[c]],t));return n}});var ZC=M((SK,KC)=>{"use strict";m();var J7=Pc(),Q7=ur(),Ed=function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},e9=function(t,e){if(t){var r=Ed(t,e);return r&&r.value}},t9=function(t,e,r){var n=Ed(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},r9=function(t,e){return t?!!Ed(t,e):!1},n9=function(t,e){if(t)return Ed(t,e,!0)};KC.exports=function(){var e,r={assert:function(n){if(!r.has(n))throw new Q7("Side channel does not contain "+J7(n))},delete:function(n){var i=e&&e.next,a=n9(e,n);return a&&i&&i===a&&(e=void 0),!!a},get:function(n){return e9(e,n)},has:function(n){return r9(e,n)},set:function(n,i){e||(e={next:void 0}),t9(e,n,i)}};return r}});var F0=M((AK,QC)=>{"use strict";m();var i9=Fn(),Rc=xt(),a9=Pc(),s9=ur(),JC=i9("%Map%",!0),o9=Rc("Map.prototype.get",!0),l9=Rc("Map.prototype.set",!0),c9=Rc("Map.prototype.has",!0),u9=Rc("Map.prototype.delete",!0),f9=Rc("Map.prototype.size",!0);QC.exports=!!JC&&function(){var e,r={assert:function(n){if(!r.has(n))throw new s9("Side channel does not contain "+a9(n))},delete:function(n){if(e){var i=u9(e,n);return f9(e)===0&&(e=void 0),i}return!1},get:function(n){if(e)return o9(e,n)},has:function(n){return e?c9(e,n):!1},set:function(n,i){e||(e=new JC),l9(e,n,i)}};return r}});var tP=M((TK,eP)=>{"use strict";m();var d9=Fn(),kd=xt(),h9=Pc(),Ad=F0(),p9=ur(),Mo=d9("%WeakMap%",!0),m9=kd("WeakMap.prototype.get",!0),g9=kd("WeakMap.prototype.set",!0),v9=kd("WeakMap.prototype.has",!0),y9=kd("WeakMap.prototype.delete",!0);eP.exports=Mo?function(){var e,r,n={assert:function(i){if(!n.has(i))throw new p9("Side channel does not contain "+h9(i))},delete:function(i){if(Mo&&i&&(typeof i=="object"||typeof i=="function")){if(e)return y9(e,i)}else if(Ad&&r)return r.delete(i);return!1},get:function(i){return Mo&&i&&(typeof i=="object"||typeof i=="function")&&e?m9(e,i):r&&r.get(i)},has:function(i){return Mo&&i&&(typeof i=="object"||typeof i=="function")&&e?v9(e,i):!!r&&r.has(i)},set:function(i,a){Mo&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new Mo),g9(e,i,a)):Ad&&(r||(r=Ad()),r.set(i,a))}};return n}:Ad});var $0=M((PK,rP)=>{"use strict";m();var w9=ur(),b9=Pc(),_9=ZC(),x9=F0(),S9=tP(),E9=S9||x9||_9;rP.exports=function(){var e,r={assert:function(n){if(!r.has(n))throw new w9("Side channel does not contain "+b9(n))},delete:function(n){return!!e&&e.delete(n)},get:function(n){return e&&e.get(n)},has:function(n){return!!e&&e.has(n)},set:function(n,i){e||(e=E9()),e.set(n,i)}};return r}});var iP=M((MK,nP)=>{"use strict";m();var A9=Yu(),Mc=$0()(),Ei=ur(),D0={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Ei("`O` is not an object");if(typeof e!="string")throw new Ei("`slot` must be a string");if(Mc.assert(t),!D0.has(t,e))throw new Ei("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Ei("`O` is not an object");if(typeof e!="string")throw new Ei("`slot` must be a string");var r=Mc.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Ei("`O` is not an object");if(typeof e!="string")throw new Ei("`slot` must be a string");var r=Mc.get(t);return!!r&&A9(r,"$"+e)},set:function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Ei("`O` is not an object");if(typeof e!="string")throw new Ei("`slot` must be a string");var n=Mc.get(t);n||(n={},Mc.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(D0);nP.exports=D0});var oP=M((IK,sP)=>{"use strict";m();var Oc=iP(),k9=Bu(),aP=typeof StopIteration=="object"?StopIteration:null;sP.exports=function(e){if(!aP)throw new k9("this environment lacks StopIteration");Oc.set(e,"[[Done]]",!1);var r={next:function(){var i=Oc.get(this,"[[Iterator]]"),a=!!Oc.get(i,"[[Done]]");try{return{done:a,value:a?void 0:i.next()}}catch(s){if(Oc.set(i,"[[Done]]",!0),s!==aP)throw s;return{done:!0,value:void 0}}}};return Oc.set(r,"[[Iterator]]",e),r}});var L0=M(($K,cP)=>{"use strict";m();var lP=xt(),T9=lP("String.prototype.valueOf"),C9=function(e){try{return T9(e),!0}catch(r){return!1}},P9=lP("Object.prototype.toString"),R9="[object String]",M9=zi()();cP.exports=function(e){return typeof e=="string"?!0:!e||typeof e!="object"?!1:M9?C9(e):P9(e)===R9}});var N0=M((LK,dP)=>{"use strict";m();var j0=typeof Map=="function"&&Map.prototype?Map:null,O9=typeof Set=="function"&&Set.prototype?Set:null,Td;j0||(Td=function(e){return!1});var fP=j0?Map.prototype.has:null,uP=O9?Set.prototyp
Line truncated
|
||||
`});Te=!1,N=ce.length}function X(Oe,De){var Pt="="+B,Le=Oe.indexOf(Pt,De),U=c(Oe.substring(Oe.indexOf("=",De)+1,Le)).split(" ");return W=U[0],B=U[U.length-1],Le+Pt.length-1}for(_&&(_=_.split(" "),W=_[0],B=_[1]),ne=0;ne<T;ne++)$==C?u(W,x,ne)?(--ne,$e(),$=I):x.charAt(ne)==`
|
||||
`?Ut(Te):le+=x.charAt(ne):$==I?(ne+=W.length-1,de=t.tags[x.charAt(ne+1)],J=de?x.charAt(ne+1):"_v",J=="="?(ne=X(x,ne),$=C):(de&&ne++,$=L),Te=ne):u(B,x,ne)?(ce.push({tag:J,n:c(le),otag:W,ctag:B,i:J=="/"?Te-W.length:ne+B.length}),le="",ne+=B.length-1,$=C,J=="{"&&(B=="}}"?ne++:l(ce[ce.length-1]))):le+=x.charAt(ne);return Ut(Te,!0),ce};function l(w){w.n.substr(w.n.length-1)==="}"&&(w.n=w.n.substring(0,w.n.length-1))}function c(w){return w.trim?w.trim():w.replace(/^\s*|\s*$/g,"")}function u(w,x,_){if(x.charAt(_)!=w.charAt(0))return!1;for(var T=1,C=w.length;T<C;T++)if(x.charAt(_+T)!=w.charAt(T))return!1;return!0}var f={_t:!0,"\n":!0,$:!0,"/":!0};function d(w,x,_,T){var C=[],I=null,L=null,$=null;for(L=_[_.length-1];w.length>0;){if($=w.shift(),L&&L.tag=="<"&&!($.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[$.tag]<=t.tags.$||h($,T))_.push($),$.nodes=d(w,$.tag,_,T);else if($.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+$.n);if(I=_.pop(),$.n!=I.n&&!p($.n,I.n,T))throw new Error("Nesting error: "+I.n+" vs. "+$.n);return I.end=$.i,C}else $.tag==`
|
||||
`&&($.last=w.length==0||w[0].tag==`
|
||||
`);C.push($)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return C}function h(w,x){for(var _=0,T=x.length;_<T;_++)if(x[_].o==w.n)return w.tag="#",!0}function p(w,x,_){for(var T=0,C=_.length;T<C;T++)if(_[T].c==w&&_[T].o==x)return!0}function g(w){var x=[];for(var _ in w)x.push('"'+b(_)+'": function(c,p,t,i) {'+w[_]+"}");return"{ "+x.join(",")+" }"}function v(w){var x=[];for(var _ in w.partials)x.push('"'+b(_)+'":{name:"'+b(w.partials[_].name)+'", '+v(w.partials[_])+"}");return"partials: {"+x.join(",")+"}, subs: "+g(w.subs)}t.stringify=function(w,x,_){return"{code: function (c,p,i) { "+t.wrapMain(w.code)+" },"+v(w)+"}"};var y=0;t.generate=function(w,x,_){y=0;var T={code:"",subs:{},partials:{}};return t.walk(w,T),_.asString?this.stringify(T,x,_):this.makeTemplate(T,x,_)},t.wrapMain=function(w){return'var t=this;t.b(i=i||"");'+w+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(w,x,_){var T=this.makePartials(w);return T.code=new Function("c","p","i",this.wrapMain(w.code)),new this.template(T,x,this,_)},t.makePartials=function(w){var x,_={subs:{},partials:w.partials,name:w.name};for(x in _.partials)_.partials[x]=this.makePartials(_.partials[x]);for(x in w.subs)_.subs[x]=new Function("c","p","t","i",w.subs[x]);return _};function b(w){return w.replace(a,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(i,"\\r").replace(s,"\\u2028").replace(o,"\\u2029")}function E(w){return~w.indexOf(".")?"d":"f"}function S(w,x){var _="<"+(x.prefix||""),T=_+w.n+y++;return x.partials[T]={name:w.n,partials:{}},x.code+='t.b(t.rp("'+b(T)+'",c,p,"'+(w.indent||"")+'"));',T}t.codegen={"#":function(w,x){x.code+="if(t.s(t."+E(w.n)+'("'+b(w.n)+'",c,p,1),c,p,0,'+w.i+","+w.end+',"'+w.otag+" "+w.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(w.nodes,x),x.code+="});c.pop();}"},"^":function(w,x){x.code+="if(!t.s(t."+E(w.n)+'("'+b(w.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(w.nodes,x),x.code+="};"},">":S,"<":function(w,x){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(w.nodes,_);var T=x.partials[S(w,x)];T.subs=_.subs,T.partials=_.partials},$:function(w,x){var _={subs:{},code:"",partials:x.partials,prefix:w.n};t.walk(w.nodes,_),x.subs[w.n]=_.code,x.inPartial||(x.code+='t.sub("'+b(w.n)+'",c,p,i);')},"\n":function(w,x){x.code+=k('"\\n"'+(w.last?"":" + i"))},_v:function(w,x){x.code+="t.b(t.v(t."+E(w.n)+'("'+b(w.n)+'",c,p,0)));'},_t:function(w,x){x.code+=k('"'+b(w.text)+'"')},"{":A,"&":A};function A(w,x){x.code+="t.b(t.t(t."+E(w.n)+'("'+b(w.n)+'",c,p,0)));'}function k(w){return"t.b("+w+");"}t.walk=function(w,x){for(var _,T=0,C=w.length;T<C;T++)_=t.codegen[w[T].tag],_&&_(w[T],x);return x},t.parse=function(w,x,_){return _=_||{},d(w,"",[],_.sectionTags||[])},t.cache={},t.cacheKey=function(w,x){return[w,!!x.asString,!!x.disableLambda,x.delimiters,!!x.modelGet].join("||")},t.compile=function(w,x){x=x||{};var _=t.cacheKey(w,x),T=this.cache[_];if(T){var C=T.partials;for(var I in C)delete C[I].instance;return T}return T=this.generate(this.parse(this.scan(w,x.delimiters),w,x),w,x),this.cache[_]=T}})(typeof Wv!="undefined"?Wv:Hogan)});var _M=M(Yv=>{m();var BU={};(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 v=this.ep(d,p);return v?v.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 v=0;v<g.length;v++)d.push(g[v]),p(d,h,this),d.pop()},s:function(d,h,p,g,v,y,b){var E;return f(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,h,p,g,v,y,b)),E=!!d,!g&&E&&h&&h.push(typeof d=="object"?d:h[h.length-1]),E)},d:function(d,h,p,g){var v,y=d.split("."),b=this.f(y[0],h,p,g),E=this.options.modelGet,S=null;if(d==="."&&f(h[h.length-2]))b=h[h.length-1];else for(var A=1;A<y.length;A++)v=e(y[A],b,E),v!==void 0?(S=b,b=v):b="";return g&&!b?!1:(!g&&typeof b=="function"&&(h.push(S),b=this.mv(b,h,p),h.pop()),b)},f:function(d,h,p,g){for(var v=!1,y=null,b=!1,E=this.options.modelGet,S=h.length-1;S>=0;S--)if(y=h[S],v=e(d,y,E),v!==void 0){b=!0;break}return b?(!g&&typeof v=="function"&&(v=this.mv(v,h,p)),v):g?!1:""},ls:function(d,h,p,g,v){var y=this.options.delimiters;return this.options.delimiters=v,this.b(this.ct(c(d.call(h,g)),h,p)),this.options.delimiters=y,!1},ct:function(d,
Line truncated
|
||||
`){return t.split(r).reduce((n,i)=>{let a=e?i.trim():i;return a&&n.push(a),n},[])}function Bg(t,e){return gc(t,!0).map(r=>e(r))}function Hg(t){return(0,rd.exists)(t,rd.FOLDER)}function Me(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function mA(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function nd(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function Vn(t){return Array.isArray(t)?t:[t]}function gA(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function vA(t){return Vn(t).map(String)}function He(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}function dc(t,e){let r=[];for(let n=0,i=t.length;n<i;n++)r.push(e,t[n]);return r}function hc(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}function yA(t,e){return Object.assign({},...e.map(r=>r in t?{[r]:t[r]}:{}))}function Ag(t=0){return new Promise(e=>setTimeout(e,t))}function kg(t){if(t!==!1)return t}var Ao,Qa,vc,id=q({"src/lib/utils/util.ts"(){"use strict";Ao="\0",Qa=()=>{},vc=Object.prototype.toString.call.bind(Object.prototype.toString)}});function qn(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function Tg(t,e){let r=Kf(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function ad(t){return!!t&&vc(t)==="[object Object]"}function wA(t){return typeof t=="function"}var yc,Vt,bA,Zf,Ug,_A=q({"src/lib/utils/argument-filters.ts"(){"use strict";id(),pc(),yc=t=>Array.isArray(t),Vt=t=>typeof t=="string",bA=t=>Array.isArray(t)&&t.every(Vt),Zf=t=>Vt(t)||Array.isArray(t)&&t.every(Vt),Ug=t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number"}}),Cg,gL=q({"src/lib/utils/exit-codes.ts"(){"use strict";Cg=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(Cg||{})}}),Jf,vL=q({"src/lib/utils/git-output-streams.ts"(){"use strict";Jf=class xA{constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new xA(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),me,oa,yL=q({"src/lib/utils/line-parser.ts"(){"use strict";me=class{constructor(t,e){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((i,a)=>this.addMatch(i,a,r(a)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}useMatches(t,e){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},oa=class extends me{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 SA(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...EA},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var EA,wL=q({"src/lib/utils/simple-git-options.ts"(){"use strict";EA={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Gg(t,e=[]){return ad(t)?Object.keys(t).reduce((r,n)=>{let i=t[n];if(Kf(i))r.push(i);else if(Tg(i,["boolean"]))r.push(n+"="+i);else if(Array.isArray(i))for(let a of i)Tg(a,["string","number"])||r.push(n+"="+a);else r.push(n);return r},e):e}function vr(t,e=0,r=!1){let n=[];for(let i=0,a=e<0?t.length:e;i<a;i++)"string|number".includes(typeof t[i])&&n.push(String(t[i]));return Gg(zg(t),n),r||n.push(...bL(t)),n}function bL(t){let e=typeof Ja(t)=="function";return qn(Ja(t,e?1:0),yc,[])}function zg(t){let e=wA(Ja(t));return qn(Ja(t,e?1:0),ad)}function at(t,e=!0){let r=uA(Ja(t));return e||fA(r)?r:void 0}var _L=q({"src/lib/utils/task-options.ts"(){"use strict";_A(),id(),pc()}});function Pg(t,e){return t(e.stdOut,e.stdErr)}function br(t,e,r,n=!0){return Vn(r).forEach(i=>{for(let a=gc(i,n),s=0,o=a.length;s<o;s++){let l=(c=0)=>{if(!(s+c>=o))return a[s+c]};e.some(({parse:c})=>c(l,t))}}),t}var xL=q({"src/lib/utils/task-parser.ts"(){"use strict";id()}}),AA={};ft(AA,{ExitCodes:()=>Cg,GitOutputStreams:()=>Jf,LineParser:()=>me,NOOP:()=>Qa,NULL:()=>Ao,RemoteLineParser:()=>oa,append:()=>Me,appendTaskOptions:()=>Gg,asArray:()=>Vn,asCamelCase:()=>gA,asFunction:()=>uA,asNumber:()=>He,asStringArray:()=>vA,bufferToString:()=>hc,callTaskParser:()=>Pg,createInstanceConfig:()=>SA,delay:()=>Ag,filterArray:()=>yc,filterFunction:()=>wA,filterHasLength:()=>Ug,filterPlainObject:()=>ad,filterPrimitives:()=>Tg,filterString:()=>Vt,filterStringArray:()=>bA,filterStringOrStringArray:()=>Zf,filterType:()=>qn,first:()=>hA,folderExists:()=>Hg,forEachLineWithContent:()=>Bg,getTrailingOptions:()=>vr,including:()=>mA,isUserFunction:()=>fA,last:()=>Ja,objectToString:()=>vc,orVoid:()=>kg,parseStringResponse:()=>br,pick:()=>yA,prefixedArray:()=>dc,remove:()=>nd,splitOn:()=>dA,toLinesWithContent:()=>gc,trailingFunctionArgument:()=>at,trailingOptionsArgument:()=>
Line truncated
|
||||
`)){let l=dA(s,`
|
||||
`);o=l[0],s=l[1]}yield{file:a,key:o,value:s}}}var UA,DL=q({"src/lib/responses/ConfigList.ts"(){"use strict";he(),UA=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=Ja(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);n.hasOwnProperty(e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function wg(t,e){return typeof t=="string"&&Og.hasOwnProperty(t)?t:e}function LL(t,e,r,n){let i=["config",`--${n}`];return r&&i.push("--add"),i.push(t,e),{commands:i,format:"utf-8",parser(a){return a}}}function jL(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return FL(n,t)}}}function NL(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return IL(r)}}}function BL(){return{addConfig(t,e,...r){return this._runTask(LL(t,e,r[0]===!0,wg(r[1],"local")),at(arguments))},getConfig(t,e){return this._runTask(jL(t,wg(e,void 0)),at(arguments))},listConfig(...t){return this._runTask(NL(wg(t[0],void 0)),at(arguments))}}}var Og,GA=q({"src/lib/tasks/config.ts"(){"use strict";DL(),he(),Og=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Og||{})}});function HL(t){return zA.has(t)}var bg,zA,VA=q({"src/lib/tasks/diff-name-status.ts"(){"use strict";bg=(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))(bg||{}),zA=new Set(Object.values(bg))}});function UL(...t){return new WA().param(...t)}function GL(t){let e=new Set,r={};return Bg(t,n=>{let[i,a,s]=n.split(Ao);e.add(i),(r[i]=r[i]||[]).push({line:He(a),path:i,preview:s})}),{paths:e,results:r}}function zL(){return{grep(t){let e=at(arguments),r=vr(arguments);for(let i of qA)if(r.includes(i))return this._runTask(yr(`git.grep: use of "${i}" is not supported.`),e);typeof t=="string"&&(t=UL().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(i){return GL(i)}},e)}}}var qA,fc,OE,WA,YA=q({"src/lib/tasks/grep.ts"(){"use strict";he(),ut(),qA=["-h"],fc=Symbol("grepQuery"),WA=class{constructor(){this[OE]=[]}*[(OE=fc,Symbol.iterator)](){for(let t of this[fc])yield t}and(...t){return t.length&&this[fc].push("--and","(",...dc(t,"-e"),")"),this}param(...t){return this[fc].push(...dc(t,"-e")),this}}}}),XA={};ft(XA,{ResetMode:()=>Wf,getResetMode:()=>qL,resetTask:()=>VL});function VL(t,e){let r=["reset"];return KA(t)&&r.push(`--${t}`),r.push(...e),rr(r)}function qL(t){if(KA(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function KA(t){return ZA.includes(t)}var Wf,ZA,JA=q({"src/lib/tasks/reset.ts"(){"use strict";ut(),Wf=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Wf||{}),ZA=Array.from(Object.values(Wf))}});function WL(){return(0,Qf.default)("simple-git")}function IE(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...i)=>{t(n,...i),r(n,...i)}:t:(n,...i)=>{t(`%s ${n}`,e,...i),r&&r(n,...i)}}function YL(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function Kg(t,e,r,n=WL()){let i=t&&`[${t}]`||"",a=[],s=typeof e=="string"?n.extend(e):e,o=YL(qn(e,Vt),s,n);return c(r);function l(u,f){return Me(a,Kg(t,o.replace(/^[^:]+/,u),f,n))}function c(u){let f=u&&`[${u}]`||"",d=s&&IE(s,f)||Qa,h=IE(n,`${i} ${f}`,d);return Object.assign(s?d:h,{label:t,sibling:l,info:h,step:c})}}var QA=q({"src/lib/git-logger.ts"(){"use strict";he(),Qf.default.formatters.L=t=>String(Ug(t)?t.length:"-"),Qf.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):vc(t)}}),ek,XL=q({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";var t;la(),QA(),ek=(t=class{constructor(r="GitExecutor"){this.logLabel=r,this._queue=new Map}withProgress(r){return this._queue.get(r)}createProgress(r){let n=t.getName(r.commands[0]),i=Kg(this.logLabel,n);return{task:r,logger:i,name:n}}push(r){let n=this.createProgress(r);return n.logger("Adding task to the queue, commands = %o",r.commands),this._queue.set(r,n),n}fatal(r){for(let[n,{logger:i}]of Array.from(this._queue.entries()))n===r.task?(i.info("Failed %o",r),i("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):i.info("A fatal exception occurred in a previous task, the queue has been purged: %o",r.message),this.complete(n);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 n=this.withProgress(r);if(!n)throw new wr(void 0,"TasksPendingQueue: attempt called for an unknown task");return n.logger("Starting
Line truncated
|
||||
`).map(zN).filter(Boolean);e||r.sort(function(i,a){let s=i.split("."),o=a.split(".");if(s.length===1||o.length===1)return GN(Vf(s[0]),Vf(o[0]));for(let l=0,c=Math.max(s.length,o.length);l<c;l++){let u=oT(Vf(s[l]),Vf(o[l]));if(u)return u}return 0});let n=e?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new nA(r,n)}}}),cT={};ft(cT,{addAnnotatedTagTask:()=>YN,addTagTask:()=>WN,tagListTask:()=>qN});function qN(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return lT(r,e)}}}function WN(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function YN(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var XN=q({"src/lib/tasks/tag.ts"(){"use strict";VN()}}),KN=hL({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(JL(),it(rk)),{SimpleGitApi:n}=(Kj(),it(Dk)),{Scheduler:i}=(Zj(),it(Lk)),{configurationErrorTask:a}=(ut(),it(Mg)),{asArray:s,filterArray:o,filterPrimitives:l,filterString:c,filterStringOrStringArray:u,filterType:f,getTrailingOptions:d,trailingFunctionArgument:h,trailingOptionsArgument:p}=(he(),it(AA)),{applyPatchTask:g}=(Qj(),it(Bk)),{branchTask:v,branchLocalTask:y,deleteBranchesTask:b,deleteBranchTask:E}=(uN(),it(qk)),{checkIgnoreTask:S}=(hN(),it(Xk)),{checkIsRepoTask:A}=(PA(),it(kA)),{cloneTask:k,cloneMirrorTask:w}=(gN(),it(Kk)),{cleanWithOptionsTask:x,isCleanOptionsArray:_}=(BA(),it(jA)),{diffSummaryTask:T}=(n0(),it(mk)),{fetchTask:C}=(_N(),it(Qk)),{moveTask:I}=(AN(),it(tT)),{pullTask:L}=(TN(),it(rT)),{pushTagsTask:$}=(Rk(),it(Pk)),{addRemoteTask:J,getRemotesTask:de,listRemotesTask:le,remoteTask:ce,removeRemoteTask:Te}=(DN(),it(iT)),{getResetMode:ne,resetTask:N}=(JA(),it(XA)),{stashListTask:W}=(jN(),it(aT)),{addSubModuleTask:B,initSubModuleTask:$e,subModuleTask:lr,updateSubModuleTask:Ut}=(UN(),it(sT)),{addAnnotatedTagTask:X,addTagTask:Oe,tagListTask:De}=(XN(),it(cT)),{straightThroughBufferTask:Pt,straightThroughStringTask:Le}=(ut(),it(Mg));function U(j,Z){this._plugins=Z,this._executor=new r(j.baseDir,new i(j.maxConcurrentProcesses),Z),this._trimmed=j.trimmed}(U.prototype=Object.create(n.prototype)).constructor=U,U.prototype.customBinary=function(j){return this._plugins.reconfigure("binary",j),this},U.prototype.env=function(j,Z){return arguments.length===1&&typeof j=="object"?this._executor.env=j:(this._executor.env=this._executor.env||{})[j]=Z,this},U.prototype.stashList=function(j){return this._runTask(W(p(arguments)||{},o(j)&&j||[]),h(arguments))};function Je(j,Z,Se,We){return typeof Se!="string"?a(`git.${j}() requires a string 'repoPath'`):Z(Se,f(We,c),d(arguments))}U.prototype.clone=function(){return this._runTask(Je("clone",k,...arguments),h(arguments))},U.prototype.mirror=function(){return this._runTask(Je("mirror",w,...arguments),h(arguments))},U.prototype.mv=function(j,Z){return this._runTask(I(j,Z),h(arguments))},U.prototype.checkoutLatestTag=function(j){var Z=this;return this.pull(function(){Z.tags(function(Se,We){Z.checkout(We.latest,j)})})},U.prototype.pull=function(j,Z,Se,We){return this._runTask(L(f(j,c),f(Z,c),d(arguments)),h(arguments))},U.prototype.fetch=function(j,Z){return this._runTask(C(f(j,c),f(Z,c),d(arguments)),h(arguments))},U.prototype.silent=function(j){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},U.prototype.tags=function(j,Z){return this._runTask(De(d(arguments)),h(arguments))},U.prototype.rebase=function(){return this._runTask(Le(["rebase",...d(arguments)]),h(arguments))},U.prototype.reset=function(j){return this._runTask(N(ne(j),d(arguments)),h(arguments))},U.prototype.revert=function(j){let Z=h(arguments);return typeof j!="string"?this._runTask(a("Commit must be a string"),Z):this._runTask(Le(["revert",...d(arguments,0,!0),j]),Z)},U.prototype.addTag=function(j){let Z=typeof j=="string"?Oe(j):a("Git.addTag requires a tag name");return this._runTask(Z,h(arguments))},U.prototype.addAnnotatedTag=function(j,Z){return this._runTask(X(j,Z),h(arguments))},U.prototype.deleteLocalBranch=function(j,Z,Se){return this._runTask(E(j,typeof Z=="boolean"?Z:!1),h(arguments))},U.prototype.deleteLocalBranches=function(j,Z,Se){return this._runTask(b(j,typeof Z=="boolean"?Z:!1),h(arguments))},U.prototype.branch=function(j,Z){return this._runTask(v(d(arguments)),h(arguments))},U.prototype.branchLocal=function(j){return this._runTask(y(),h(arguments))},U.prototype.raw=function(j){let Z=!Array.isArray(j),Se=[].slice.call(Z?arguments:j,0);for(let Rt=0;Rt<Se.length&&Z;Rt++)if(!l(Se[Rt])){Se.splice(Rt,Se.length-Rt);break}Se.push(...d(arguments,0,!0));var We=h(arguments);return Se.length?this._runTask(Le(Se,this._trimmed),We):this._runTask(a("Raw: must supply one or more command to execute"),We)},U.prototype.submoduleAdd=function(j,Z,Se){return this._runTask(B(j,Z),h(arguments))},U.prototype.submoduleUpdate=function(j,Z){return this._runTask
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"
|
||||
`,pT=["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();var mT=require("obsidian"),wB={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},ze=class extends mT.SuggestModal{constructor(e,r){if(super(e.app),this.config={...wB,...r},this.setPlaceholder(this.config.placeholder),this.config.obscure){this.inputEl.type="password";let n=this.containerEl.querySelector(".prompt-input-container");n.addClass("git-obscure-prompt"),n.setAttr("git-is-obscured","true");let i=n==null?void 0:n.createDiv({cls:"search-input-clear-button"});i.style.marginRight="32px",i.id="git-show-password",i.addEventListener("click",()=>{n.getAttr("git-is-obscured")==="true"?(this.inputEl.type="text",n.setAttr("git-is-obscured","false")):(this.inputEl.type="password",n.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=>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 n;this.config.allowEmpty&&e===" "?n="":e==="..."?n=void 0:n=e,this.resolve(n)}}};m();function gT(t,e){let r=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:r})}var Co=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};m();var e3=Ot(FT()),t3=require("child_process"),r3=Ot(QR()),Ai=require("obsidian");function Ud(t){throw new Error(`Unexpected object: ${t}`)}function Ic(t,e,r){return t===1?`${t} ${e}`:`${t} ${r!=null?r:e+"s"}`}var pv=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function vn(t,e){let r;if(e){if(e.button===0||e.button===1){let n=Ai.Keymap.isModEvent(e);r=t.workspace.getLeaf(n)}}else r=t.workspace.getLeaf(!1);return r}function Xn(t,e,r,n,i){if(e.button==2){let a=t.vault.getAbstractFileByPath(r);if(a!=null){let s=new Ai.Menu;t.workspace.trigger("file-menu",s,a,i,n),s.showAtPosition({x:e.pageX,y:e.pageY})}else{let s=new Ai.Menu;t.workspace.trigger("obsidian-git:menu",s,r,i,n),s.showAtPosition({x:e.pageX,y:e.pageY})}}}function pa(t){throw new Error("Impossible branch: "+t)}function mv(t){return`rgb(${t.r},${t.g},${t.b})`}function n3(t){var a;let e=(a=e3.fromString(t))==null?void 0:a.toRgbaArray();if(e===void 0)return;let[r,n,i]=e;return{r,g:n,b:i}}function i3(t){return t.diff(Ai.moment.unix(0),"seconds")}function a3(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function s3(t,e){return(0,r3.default)(t,e,{strict:!0})}function Fc(t,e){return new Proxy(t,{get(r,n){return n==="length"?Math.min(e,r.length):r[n]}})}function o3(t,e,r){return t.length<=e?new Array(e-t.length).fill(r).join("")+t:t.substring(t.length-e)}function l3(t,e){if(e<=0)return t;let r=new Array(e).fill(" ").join(""),n=t.substring(e,t.length);return r+n}function gv(t,e,r){return t<=e&&e<=r}function ki(t){let[e,...r]=t.split("/");return[e,r.length===0?void 0:r.join("/")]}function Kn(t){return t.endsWith("/")?t:t.split("/
Line truncated
|
||||
`):i="Too many files to list",e=e+`
|
||||
|
||||
Affected files:
|
||||
`+i}return e}};var Ce=class extends $o{constructor(r){super(r);this.useDefaultWindowsGitPath=!1}async setGitInstance(r=!1){var n;if(await this.isGitInstalled()){let i=this.app.vault.adapter,a=i.getBasePath(),s=a;this.plugin.settings.basePath&&(await i.exists((0,Ti.normalizePath)(this.plugin.settings.basePath))?s=Ve.join(a,this.plugin.settings.basePath):r||new Ti.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=s,this.git=fT({baseDir:s,binary:this.plugin.localStorage.getGitPath()||(this.useDefaultWindowsGitPath?hd:void 0),config:["core.quotepath=off"],unsafe:{allowUnsafeCustomBinary:!0}});let o=this.plugin.localStorage.getPATHPaths(),l=this.plugin.localStorage.getEnvVars(),c=this.plugin.settings.gitDir;if(o.length>0){let v=o.join(":")+":"+process.env.PATH;process.env.PATH=v}c&&(process.env.GIT_DIR=c);for(let v of l){let[y,b]=v.split("=");process.env[y]=b}let u="simple-git",f=",",h=((n=localStorage.debug)!=null?n:"").split(f);if(!h.includes(u)&&!h.includes(`-${u}`)&&(h.push(u),p3.default.enable(h.join(f))),await this.git.checkIsRepo()){let v=await this.git.revparse("--show-cdup"),y=(0,Dc.resolve)(s+Dc.sep+v);this.absoluteRepoPath=y,await this.git.cwd(y)}let p=Ve.join(a,this.app.vault.configDir,"plugins","obsidian-git"),g=Ve.join(p,es);process.env.SSH_ASKPASS==null&&(process.env.SSH_ASKPASS=g),process.env.OBSIDIAN_GIT_CREDENTIALS_INPUT=Ve.join(p,pd),process.env.SSH_ASKPASS==g&&this.askpass().catch(v=>this.plugin.displayError(v))}}getRelativeVaultPath(r){let i=this.app.vault.adapter.getBasePath(),a=Ve.join(this.absoluteRepoPath,r),s=Ve.relative(i,a);return Ti.Platform.isWin&&(s=s.replace(/\\/g,"/")),s}getRelativeRepoPath(r,n=!0){if(n){let a=this.plugin.app.vault.adapter.getBasePath(),s=this.absoluteRepoPath,o=Ve.join(a,r),l=Ve.relative(s,o);return Ti.Platform.isWin&&(l=l.replace(/\\/g,"/")),l}return r}async askpass(){let r=this.app.vault.adapter,n=r.getBasePath(),i=Ve.join(n,this.app.vault.configDir,"plugins","obsidian-git"),a=this.app.vault.configDir+"/plugins/obsidian-git/";await this.addAskPassScriptToExclude(),await Fr.writeFile(Ve.join(i,es),hT),await Fr.chmod(Ve.join(i,es),493),this.watchAbortController=new AbortController;let{signal:s}=this.watchAbortController;try{let o=Fr.watch(i,{signal:s});for await(let l of o){if(l.filename!=pd)continue;let c=a+pd;if(!await r.exists(c))continue;let u=await r.read(c),f;u.length>60&&(f=new Ti.Notice(u,999999));let d=await new ze(this.plugin,{allowEmpty:!0,obscure:!0,placeholder:u.length>60?"Enter a response to the message.":u}).openAndGetResult();f==null||f.hide(),await r.exists(c)&&await r.write(`${c}.response`,d!=null?d:"")}}catch(o){this.plugin.displayError(o),await Fr.rm(Ve.join(i,es),{force:!0}),await Fr.rm(Ve.join(i,`${es}.response`),{force:!0}),await new Promise(l=>setTimeout(l,5e3)),this.plugin.log("Retry watch for ask pass"),await this.askpass()}}async addAskPassScriptToExclude(){try{let r=await this.git.revparse(["--path-format=absolute","--git-path","info/exclude"]),n=Ve.join(this.app.vault.configDir,"plugins","obsidian-git",es),i=this.getRelativeRepoPath(n,!0);(await Fr.readFile(r,"utf-8")).split(`
|
||||
`).some(l=>l.contains(i))||await Fr.appendFile(r,i+`
|
||||
`)}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 n=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let i=await this.git.status(n!=null?["--",n]:[]);this.plugin.setPluginState({gitAction:0});let a=i.files.map(s=>{let o=this.formatPath(s);return{path:o.path,from:o.from,index:s.index==="?"?"U":s.index,workingDir:s.working_dir==="?"?"U":s.working_dir,vaultPath:this.getRelativeVaultPath(o.path)}});return{all:a,changed:a.filter(s=>s.workingDir!==" "),staged:a.filter(s=>s.index!==" "&&s.index!="U"),conflicted:i.conflicted.map(s=>this.formatPath({path:s}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let n=this.getRelativeRepoPath(r),a=["-C",Ve.dirname(n),"rev-parse","HEAD"],s=this.git.raw(a);return s.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),(await s).trim()}async getSubmodulePaths(){return new Promise(r=>{this.git.outputHandler((n,i,a,s)=>{if(!(s.contains("submodule")&&s.contains("foreach")))return;let o="",l=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");i.on("data",c=>{o+=c.toString("utf8")}),i.on("end",()=>{let u=o.split(`
|
||||
`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+Dc.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},n=>this.plugin.displayError(n))})}formatPath(r){function n(i){if(i!=null)return i.startsWith('"')&&i.endsWith('"')?i.substring(1,i.length-1):i}return r.from!=null?{from:n(r.from),path:n(r.path)}:{path:n(r.path)}}async blame(r,n,i){if(r=this.getRelativeRepoPath(r),!await this.isTracked(r))return"untracked";let a=await this.getSubmoduleOfFile(r),s=a?["-C",a.submodule]:[],o=a?a.relativeFilepath:r;s.push("blame","--porcelain"),i&&s.push("-w");let l=`-C${dd}`;switch(n){case"inactive":break;case"same-commit":s.push("-C",l);break;case"all-commits":s.push("-C","-C",l);break;default:pa(n)}s.push("--",o);let c=await this.git.raw(s);return jH(c)}async isTracked(r){let n=await this.getSubmoduleOfFile(r),i=n?["-C",n.submodule]:[],a=n?n.relativeFilepath:r;return i.push("ls-files","--",a),this.git.raw(i).then(s=>s.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let i=await this.getSubmodulePaths();for(let a of i)await this.git.cwd({path:a,root:!1}).add("-A"),await this.git.cwd({path:a,root:!1}).commit(await this.formatCommitMessage(r))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let n=await this.git.commit(await this.formatCommitMessage(r));return this.app.workspace.trigger("obsidian-git:head-change"),n.summary.changes}async commit({message:r,amend:n}){this.plugin.setPluginState({gitAction:4});let i=(await this.git.commit(await this.formatCommitMessage(r),n?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),i}async stage(r,n){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,n),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,n){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,n),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 getUntrackedPaths(r){let n=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let i=["ls-files","--others","--exclude-standard","--directory"];n!=null&&i.push("--",n);let a=await this.git.raw(i);return this.plugin.setPluginState({gitAction:0}),a.split(/\r\n|\r|\n/).filter(s=>s.length>0)}async hashObject(r){r=this.getRelativeRepoPath(r);let n=await this.getSubmoduleOfFile(r),i=n?["-C",n.submodule]:[],a=n?n.relativeFilepath:r;return i.push("hash-object","--",a),this.git.raw(i)}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(),n=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 i=await this.git.revparse([r.tracking]);if(n!==i){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{switch(this.plugin.settings.syncMethod){case"merge":await this.git.merge([r.tracking]);break;case"rebase":await this.git.rebase([r.tracking])}}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}`,i]),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 a=await this.git.revparse([r.current]);return(await this.git.diff([`${n}..${a}`,"--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 s=await this.git.env({...process.env,OBSIDIAN_GIT:1}).subModule(["foreach","--recursive",`tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`]);console.log(s)}let r=
Line truncated
|
||||
`):[]}async removeRemote(r){await this.git.removeRemote(r)}async updateUpstreamBranch(r){try{await this.git.branch(["--set-upstream-to",r])}catch(n){try{await this.git.branch(["--set-upstream",r])}catch(i){let[a,s]=ki(r),o=await this.branchInfo();await this.git.push(["--set-upstream",a,`${o.current}:${s}`])}}}updateGitPath(r){return this.setGitInstance()}updateBasePath(r){return this.setGitInstance(!0)}async getDiffString(r,n=!1,i){return n?await this.git.diff(["--cached","--",r]):i?await this.git.show([`${i}`,"--",r]):await this.git.diff(["--",r])}async diff(r,n,i){return await this.git.diff([`${n}..${i}`,"--",r])}async rawCommand(r){let n=r.split(" ");return await this.git.raw(n[0],...n.slice(1))}async getSubmoduleOfFile(r){if(!await this.app.vault.adapter.exists(Ve.dirname(r)))return;let n=await this.git.raw(["-C",Ve.dirname(r),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(n=n.trim(),(await this.git.raw(["-C",Ve.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 s=this.app.vault.adapter.getFullPath(Ve.normalize(r)),o=Ve.relative(n,s);return{submodule:n,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 wr){if(r.message.contains("does not have any commits yet"))return}else throw r}}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),n=await $c(r||"git",["--version"],{});if(n.error)if(Ti.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${hd}) of Git for Windows.`);let i=await $c(hd,["--version"]);if(i.error)return console.error(i.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(n.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(r){if(r instanceof wr){let n=String(r.message);if(n.contains("Could not resolve host")||n.contains("Unable to resolve host")||n.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||n.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||n.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new Co(n)}throw r}async isFileTrackedByLFS(r){try{return(await this.git.raw(["check-attr","filter",r])).includes("filter: lfs")}catch(n){let i=n instanceof Error?n.message:String(n);return this.plugin.displayError(`Error checking LFS status: ${i}`),!1}}},m3={hash:"000000",isZeroCommit:!0,summary:""};function jH(t){let r=t.replace(`\r
|
||||
`,`
|
||||
`).split(`
|
||||
`),n={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},i=1;for(let a=0;a<r.length;){if(d3(r[a])){let s=r[a].split(" "),o=NH(s,i,n);for(a++;d3(r[a]);a++){let l=r[a].split(" ");BH(l,n,i)}HH(n.commits.get(o)),i+=1}else if(!(r[a]===""&&a===r.length-1))throw Error(`Expected non-whitespace line or EOF, but found: ${r[a]}`);a++}return n}function NH(t,e,r){let n=t[0];if(r.hashPerLine.push(n),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 n}function BH(t,e,r){let n=t[0],i=t.slice(1).join(" "),a=e.hashPerLine[r],s=e.commits.get(a)||{hash:a,author:{},committer:{},previous:{}};switch(n){case"summary":s.summary=i;break;case"author":s.author.name=i;break;case"author-mail":s.author.email=h3(i);break;case"author-time":s.author.epochSeconds=parseInt(i);break;case"author-tz":s.author.tz=i;break;case"committer":s.committer.name=i;break;case"committer-mail":s.committer.email=h3(i);break;case"committer-time":s.committer.epochSeconds=parseInt(i);break;case"committer-tz":s.committer.tz=i;break;case"previous":s.previous.commitHash=i;break;case"filename":s.previous.filename=i;break}e.commits.set(a,s)}function HH(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);yv(t.author)&&(t.author=void 0),yv(t.committer)&&(t.committer=void 0),yv(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function yv(t){return!t||Object.keys(t).length===0}function d3(t){return t.length>0&&t[0].trim()===t[0]}function h3(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}m();var Q3=require("@codemirror/state");m();var O3=require("@codemirror/state"),th=require("obsidian");m();var bv=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()}},Do=new bv;m();var Jd=require("@codemirror/state"),T3=Ot(_v());m();var z=require("obsidian");m();m();function yn(){}yn.prototype={diff:function(e,r){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.callback;typeof i=="function"&&(a=i,i={});var s=this;function o(S){return S=s.postProcess(S,i),a?(setTimeout(function(){a(S)},0),!0):S}e=this.castInput(e,i),r=this.castInput(r,i),e=this.removeEmpty(this.tokenize(e,i)),r=this.removeEmpty(this.tokenize(r,i));var l=r.length,c=e.length,u=1,f=l+c;i.maxEditLength!=null&&(f=Math.min(f,i.maxEditLength));var d=(n=i.timeout)!==null&&n!==void 0?n:1/0,h=Date.now()+d,p=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(p[0],r,e,0,i);if(p[0].oldPos+1>=c&&g+1>=l)return o(g3(s,p[0].lastComponent,r,e,s.useLongestToken));var v=-1/0,y=1/0;function b(){for(var S=Math.max(v,-u);S<=Math.min(y,u);S+=2){var A=void 0,k=p[S-1],w=p[S+1];k&&(p[S-1]=void 0);var x=!1;if(w){var _=w.oldPos-S;x=w&&0<=_&&_<l}var T=k&&k.oldPos+1<c;if(!x&&!T){p[S]=void 0;continue}if(!T||x&&k.oldPos<w.oldPos?A=s.addToPath(w,!0,!1,0,i):A=s.addToPath(k,!1,!0,1,i),g=s.extractCommon(A,r,e,S,i),A.oldPos+1>=c&&g+1>=l)return o(g3(s,A.lastComponent,r,e,s.useLongestToken));p[S]=A,A.oldPos+1>=c&&(y=Math.min(y,S-1)),g+1>=l&&(v=Math.max(v,S+1))}u++}if(a)(function S(){setTimeout(function(){if(u>f||Date.now()>h)return a();b()||S()},0)})();else for(;u<=f&&Date.now()<=h;){var E=b();if(E)return E}},addToPath:function(e,r,n,i,a){var s=e.lastComponent;return s&&!a.oneChangePerToken&&s.added===r&&s.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:s.count+1,added:r,removed:n,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:s}}},extractCommon:function(e,r,n,i,a){for(var s=r.length,o=n.length,l=e.oldPos,c=l-i,u=0;c+1<s&&l+1<o&&this.equals(n[l+1],r[c+1],a);)c++,l++,u++,a.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!a.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,c},equals:function(e,r,n){return n.comparator?n.comparator(e,r):e===r||n.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r},castInput:function(e){return e},tokenize:function(e){return Array.from(e)},join:function(e){return e.join("")},
Line truncated
|
||||
`));var r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var a=n[i];i%2&&!e.newlineIsToken?r[r.length-1]+=a:r.push(a)}return r};Wd.equals=function(t,e,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
|
||||
`))&&(t=t.trim()),(!r.newlineIsToken||!e.includes(`
|
||||
`))&&(e=e.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
|
||||
`)&&(t=t.slice(0,-1)),e.endsWith(`
|
||||
`)&&(e=e.slice(0,-1))),yn.prototype.equals.call(this,t,e,r)};function _3(t,e,r){return Wd.diff(t,e,r)}var VH=new yn;VH.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};var qH=new yn;qH.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};function x3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Vd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x3(Object(r),!0).forEach(function(n){XH(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function WH(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YH(t){var e=WH(t,"string");return typeof e=="symbol"?e:e+""}function Av(t){"@babel/helpers - typeof";return Av=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Av(t)}function XH(t,e,r){return e=YH(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xv(t){return KH(t)||ZH(t)||JH(t)||QH()}function KH(t){if(Array.isArray(t))return kv(t)}function ZH(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function JH(t,e){if(t){if(typeof t=="string")return kv(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 kv(t,e)}}function kv(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function QH(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var jc=new yn;jc.useLongestToken=!0;jc.tokenize=Wd.tokenize;jc.castInput=function(t,e){var r=e.undefinedReplacement,n=e.stringifyReplacer,i=n===void 0?function(a,s){return typeof s=="undefined"?r:s}:n;return typeof t=="string"?t:JSON.stringify(Tv(t,null,null,i),i," ")};jc.equals=function(t,e,r){return yn.prototype.equals.call(jc,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"),r)};function Tv(t,e,r,n,i){e=e||[],r=r||[],n&&(t=n(i,t));var a;for(a=0;a<e.length;a+=1)if(e[a]===t)return r[a];var s;if(Object.prototype.toString.call(t)==="[object Array]"){for(e.push(t),s=new Array(t.length),r.push(s),a=0;a<t.length;a+=1)s[a]=Tv(t[a],e,r,n,i);return e.pop(),r.pop(),s}if(t&&t.toJSON&&(t=t.toJSON()),Av(t)==="object"&&t!==null){e.push(t),s={},r.push(s);var o=[],l;for(l in t)Object.prototype.hasOwnProperty.call(t,l)&&o.push(l);for(o.sort(),a=0;a<o.length;a+=1)l=o[a],s[l]=Tv(t[l],e,r,n,l);e.pop(),r.pop()}else s=t;return s}var Cv=new yn;Cv.tokenize=function(t){return t.slice()};Cv.join=Cv.removeEmpty=function(t){return t};function S3(t,e,r,n,i,a,s){if(s||(s={}),typeof s=="function"&&(s={callback:s}),typeof s.context=="undefined"&&(s.context=4),s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){var o=s,l=o.callback;_3(r,n,Vd(Vd({},s),{},{callback:function(f){var d=c(f);l(d)}}))}else return c(_3(r,n,s));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(x){return x.map(function(_){return" "+_})}for(var d=[],h=0,p=0,g=[],v=1,y=1,b=function(){var _=u[E],T=_.lines||tU(_.value);if(_.lines=T,_.added||_.removed){var C;if(!h){var I=u[E-1];h=v,p=y,I&&(g=s.context>0?f(I.lines.slice(-s.context)):[],h-=g.length,p-=g.length)}(C=g).push.apply(C,xv(T.map(function(le){return(_.added?"+":"-")+le}))),_.added?y+=T.length:v+=T.length}else{if(h)if(T.length<=s.context*2&&E<u.length-2){var L;(L=g).push.apply(L,xv(f(T)))}else{var $,J=Math.min(T.length,s.context);($=g).push.apply($,xv(f(T.slice(0,J))));var de={oldStart:h,oldLines:v-h+J,newStart:p,newLines:y-p+J,lines:g};d.push(de),h=0,p=0,g=[]}v+=T.length,y+=T.length}},E=0;E<u.length;E++)b();for(var S=0,A=d;S<A.length;S++)for(var k=A[S],w=0;w<k.lines.length;w++)k.lines[w].endsWith(`
|
||||
`)?k.lines[w]=k.lines[w].slice(0,-1):(k.lines.splice(w+1,0,"\\ No newline at end of file"),w++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:a,hunks:d}}}function Pv(t){if(Array.isArray(t))return t.map(Pv).join(`
|
||||
`);var e=[];t.oldFileName==t.newFileName&&e.push("Index: "+t.oldFileName),e.push("==================================================================="),e.push("--- "+t.oldFileName+(typeof t.oldHeader=="undefined"?"":" "+t.oldHeader)),e.push("+++ "+t.newFileName+(typeof t.newHeader=="undefined"?"":" "+t.newHeader));for(var r=0;r<t.hunks.length;r++){var n=t.hunks[r];n.oldLines===0&&(n.oldStart-=1),n.newLines===0&&(n.newStart-=1),e.push("@@ -"+n.oldStart+","+n.oldLines+" +"+n.newStart+","+n.newLines+" @@"),e.push.apply(e,n.lines)}return e.join(`
|
||||
`)+`
|
||||
`}function eU(t,e,r,n,i,a,s){var o;if(typeof s=="function"&&(s={callback:s}),(o=s)!==null&&o!==void 0&&o.callback){var c=s,u=c.callback;S3(t,e,r,n,i,a,Vd(Vd({},s),{},{callback:function(d){d?u(Pv(d)):u()}}))}else{var l=S3(t,e,r,n,i,a,s);return l?Pv(l):void 0}}function Yd(t,e,r,n,i,a){return eU(t,t,e,r,n,i,a)}function tU(t){var e=t.endsWith(`
|
||||
`),r=t.split(`
|
||||
`).map(function(n){return n+`
|
||||
`});return e?r.pop():r.push(r.pop().slice(0,-1)),r}var re=Ot(gg()),rs=require("obsidian");m();var ma=require("obsidian"),Xd=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 n;if(this.maybeLog("Read: "+e+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let i=this.vault.getAbstractFileByPath(e);return i instanceof ma.TFile?(this.maybeLog("Reuse"),this.vault.read(i)):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)):(n=this.index)!=null?n:this.adapter.readBinary(e);let i=this.vault.getAbstractFileByPath(e);return i instanceof ma.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(i)):this.adapter.readBinary(e)}}async writeFile(e,r){if(this.maybeLog("Write: "+e),typeof r=="string"){let n=this.vault.getAbstractFileByPath(e);return n instanceof ma.TFile?this.vault.modify(n,r):this.adapter.write(e,r)}else if(e.endsWith(this.gitDir+"/index"))this.index=r,this.indexmtime=Date.now();else{let n=this.vault.getAbstractFileByPath(e);return n instanceof ma.TFile?this.vault.modifyBinary(n,r):this.adapter.writeBinary(e,r)}}async readdir(e){e==="."&&(e="/");let r=await this.adapter.list(e),n=[...r.files,...r.folders],i;return e!=="/"?i=n.map(a=>(0,ma.normalizePath)(a.substring(e.length))):i=n,i}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,r){var n,i;return this.adapter.rmdir(e,(i=(n=r==null?void 0:r.options)==null?void 0:n.recursive)!=null?i:!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 n=await this.adapter.stat(e);if(n==null)throw{code:"ENOENT"};return this.indexctime=n.ctime,this.indexmtime=n.mtime,{ctimeMs:n.ctime,mtimeMs:n.mtime,size:n.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let r=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),r instanceof ma.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 n=await this.adapter.stat(e);if(n)return{ctimeMs:n.ctime,mtimeMs:n.mtime,size:n.size,type:n.type==="folder"?"directory":n.type,isFile:()=>n.type==="file",isDirectory:()=>n.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){}};var wn=class extends $o{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 Xd(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,n;return{username:(r=this.plugin.localStorage.getUsername())!=null?r:void 0,password:(n=this.plugin.localStorage.getPassword())!=null?n:void 0}},onAuthFailure:async()=>{new rs.Notice("Authentication failed. Please try with different credentials");let r=await new ze(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let n=await new ze(this.plugin,{placeholder:"Specify your password/personal access token"}).openAndGetResult();if(n)return this.plugin.localStorage.setUsername(r),this.plugin.localStorage.setPassword(n),{username:r,password:n}}return{cancel:!0}},http:{async request({url:r,method:n,headers:i,body:a}){let s;a&&(s=await iU(a));let o=await(0,rs.requestUrl)({url:r,method:n,headers:i,body:s,throw:!1});return{url:r,method:n,headers:o.headers,body:nU(o.arrayBuffer),statusCode:o.status,statusMessage:o.sta
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[n,i]=ki(r),a=await this.branchInfo();await this.wrapFS(re.default.push({...this.getRepo(),remote:n,remoteRef:i})),await this.setConfig(`branch.${a.current}.merge`,`refs/heads/${i}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,n){return this.walkDifference({walkers:[re.default.TREE({ref:r}),re.default.TREE({ref:n})]})}async walkDifference({walkers:r,dir:n}){return await this.wrapFS(re.default.walk({...this.getRepo(),trees:r,map:async function(a,[s,o]){if(!pv(a,n))return null;if(await(s==null?void 0:s.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(s==null?void 0:s.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(s),console.log(o)),u!=="equal")return{path:a,type:u}}}))}async getStagedFiles(r="."){return(await this.walkDifference({walkers:[re.default.TREE({ref:"HEAD"}),re.default.STAGE()],dir:r})).map(i=>({vaultPath:this.getRelativeVaultPath(i.path),path:i.path}))}async getUnstagedFiles(r="."){let n,i=window.setTimeout(()=>{n=new rs.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let a=this.getRepo(),s=await this.wrapFS(re.default.walk({...a,trees:[re.default.WORKDIR(),re.default.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await re.default.isIgnored({...a,filepath:o})||!pv(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(i),n==null||n.hide(),s}catch(a){throw window.clearTimeout(i),n==null||n.hide(),this.plugin.displayError(a),a}}async getDiffString(r,n=!1,i){let a=this.getRelativeVaultPath(r),s=async(c,[u])=>{if(r==c){let f=await u.oid();return(await re.default.readBlob({...this.getRepo(),oid:f})).blob}};if(i){let c=await(0,re.readBlob)({...this.getRepo(),filepath:r,oid:i}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof re.default.Errors.NotFoundError))throw h}),u=await re.default.readCommit({...this.getRepo(),oid:i}),f=await(0,re.readBlob)({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof re.default.Errors.NotFoundError))throw h});return Yd(a,f!=null?f:"",c!=null?c:"")}let o=(await re.default.walk({...this.getRepo(),trees:[re.default.STAGE()],map:s})).first(),l=new TextDecoder().decode(o);if(n){let c=await this.resolveRef("HEAD").then(f=>(0,re.readBlob)({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof re.default.Errors.NotFoundError))throw f});return Yd(a,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(a)?c=await this.app.vault.adapter.read(a):c="",Yd(a,l,c)}}async getLastCommitTime(){let r=this.getRepo(),n=await this.resolveRef("HEAD"),a=(await re.default.readCommit({...r,oid:n})).commit.committer.timestamp;return new Date(a*1e3)}getFileStatusResult(r){let n=this.status_mapping[`${r[this.HEAD]}${r[this.WORKDIR]}${r[this.STAGE]}`];return{index:n[0]=="?"?"U":n[0],workingDir:n[1]=="?"?"U":n[1],path:r[this.FILE],vaultPath:this.getRelativeVaultPath(r[this.FILE])}}async checkAuthorInfo(){let r=await this.getConfig("user.name"),n=await this.getConfig("user.email");if(!r||!n)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(r,n=!0){if(!this.plugin.settings.disablePopups)return new rs.Notice(r,n?this.noticeLength:void 0)}};async function*nU(t){yield new Uint8Array(t)}async function iU(t){let e=new ReadableStream({async start(n){for await(let i of t)n.enqueue(i);n.close()}});return await new Response(e).arrayBuffer()}var aU="https://momentjs.com/docs/#/parsing/string-format/",sU="https://publish.obsidian.md/git-doc/Line+Authoring",Kd=class extends z.PluginSettingTab{constructor(r,n){super(r,n);this.plugin=n;this.lineAuthorColorSettings=new Map}get settings(){return this.plugin.settings}display(){let{containerEl:r}=this,n=this.plugin,i;n.settings.differentIntervalCommitAndPush?i="commit":i="commit-and-sync";let a=n.gitReady;r.empty(),a||(r.createEl("p",{text:"Git is not ready. When all settings are correct you can configure commit-sync, etc."}),r.createEl("br"));let s;if(a){new z.Setting(r).setName("Automatic").setHeading(),new z.Setting(r).setName("Spli
Line truncated
|
||||
If turned on, do auto ${i} every ${c3(n.settings.autoSaveInterval)} after stopping file edits.
|
||||
This also prevents auto ${i} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(u=>u.setValue(n.settings.autoBackupAfterFileChange).onChange(async f=>{n.settings.autoBackupAfterFileChange=f,this.refreshDisplayWithDelay(),await n.saveSettings(),n.automaticsManager.reload("commit")})),this.mayDisableSetting(s,n.settings.setLastSaveToLastCommit),s=new z.Setting(r).setName(`Auto ${i} after latest commit`).setDesc(`If turned on, sets last auto ${i} timestamp to the latest commit timestamp. This reduces the frequency of auto ${i} when doing manual commits.`).addToggle(u=>u.setValue(n.settings.setLastSaveToLastCommit).onChange(async f=>{n.settings.setLastSaveToLastCommit=f,await n.saveSettings(),n.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(s,n.settings.autoBackupAfterFileChange),s=new z.Setting(r).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(u=>{u.inputEl.type="number",this.setNonDefaultValue({text:u,settingsProperty:"autoPushInterval"}),u.setPlaceholder(String(Xe.autoPushInterval)),u.onChange(async f=>{f!==""?n.settings.autoPushInterval=Number(f):n.settings.autoPushInterval=Xe.autoPushInterval,await n.saveSettings(),n.automaticsManager.reload("push")})}),this.mayDisableSetting(s,!n.settings.differentIntervalCommitAndPush),new z.Setting(r).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(u=>{u.inputEl.type="number",this.setNonDefaultValue({text:u,settingsProperty:"autoPullInterval"}),u.setPlaceholder(String(Xe.autoPullInterval)),u.onChange(async f=>{f!==""?n.settings.autoPullInterval=Number(f):n.settings.autoPullInterval=Xe.autoPullInterval,await n.saveSettings(),n.automaticsManager.reload("pull")})}),new z.Setting(r).setName(`Auto ${i} only staged files`).setDesc(`If turned on, only staged files are committed on ${i}. If turned off, all changed files are committed.`).addToggle(u=>u.setValue(n.settings.autoCommitOnlyStaged).onChange(async f=>{n.settings.autoCommitOnlyStaged=f,await n.saveSettings()})),new z.Setting(r).setName(`Specify custom commit message on auto ${i}`).setDesc("You will get a pop up to specify your message.").addToggle(u=>u.setValue(n.settings.customMessageOnAutoBackup).onChange(async f=>{n.settings.customMessageOnAutoBackup=f,await n.saveSettings(),this.refreshDisplayWithDelay()})),s=new z.Setting(r).setName(`Commit message on auto ${i}`).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(u=>{u.setPlaceholder(Xe.autoCommitMessage).onChange(async f=>{f===""?n.settings.autoCommitMessage=Xe.autoCommitMessage:n.settings.autoCommitMessage=f,await n.saveSettings()}),this.setNonDefaultValue({text:u,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(s,n.settings.customMessageOnAutoBackup),new z.Setting(r).setName("Commit message").setHeading(),new z.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).").addTextArea(u=>{u.setPlaceholder(Xe.commitMessage).onChange(async f=>{f===""?n.settings.commitMessage=Xe.commitMessage:n.settings.commitMessage=f,await n.saveSettings()}),this.setNonDefaultValue({text:u,settingsProperty:"commitMessage"})}),new z.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(u=>{u.onChange(async f=>{f===""?n.settings.commitMessageScript=Xe.commitMessageScript:n.settings.commitMessageScript=f,await n.saveSettings()}),this.setNonDefaultValue({text:u,settingsProperty:"commitMessageScript"})});let c=new z.Setting(r).setName("{{date}} placeholder format").addMomentFormat(u=>u.setDefaultFormat(n.settings.commitDateFormat).setValue(n.settings.commitDateFormat).onChange(async f=>{n.settings.commitDateFormat=f,await n.saveSettings()}));c.descEl.innerHTML=`
|
||||
Specify custom date format. E.g. "${l0}. See <a href="https://momentjs.com">Moment.js</a> for more formats.`,new z.Setting(r).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText(u=>{var f;return u.setValue((f=n.localStorage.getHostname())!=null?f:"").onChange(d=>{n.localStorage.setHostname(d)})}),new z.Setting(r).setName("Preview commit message").addButton(u=>u.setButtonText("Preview").onClick(async()=>{let f=await n.gitManager.formatCommitMessage(n.settings.commitMessage);new z.Notice(`${f}`)})),new z.Setting(r).setName("List filenames affected by commit in the commit body").addToggle(u=>u.setValue(n.settings.listChangedFilesInMessageBody).onChange(async f=>{n.settings.listChangedFilesInMessageBody=f,await n.saveSettings()})),new z.Setting(r).setName("Pull").setHeading(),n.gitManager instanceof Ce&&new z.Setting(r).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(u=>{let f={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};u.addOptions(f),u.setValue(n.settings.syncMethod),u.onChange(async d=>{n.settings.syncMethod=d,await n.saveSettings()})}),new z.Setting(r).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(u=>u.setValue(n.settings.autoPullOnBoot).onChange(async f=>{n.settings.autoPullOnBoot=f,await n.saveSettings()})),new z.Setting(r).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),s=new z.Setting(r).setName("Push on commit-and-sync").setDesc(`Most of the time you want to push after committing. Turning this off turns a commit-and-sync action into commit ${n.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(u=>u.setValue(!n.settings.disablePush).onChange(async f=>{n.settings.disablePush=!f,this.refreshDisplayWithDelay(),await n.saveSettings()})),new z.Setting(r).setName("Pull on commit-and-sync").setDesc(`On commit-and-sync, pull commits as well. Turning this off turns a commit-and-sync action into commit ${n.settings.disablePush?"":"and push "}only.`).addToggle(u=>u.setValue(n.settings.pullBeforePush).onChange(async f=>{n.settings.pullBeforePush=f,this.refreshDisplayWithDelay(),await n.saveSettings()})),n.gitManager instanceof Ce&&(new z.Setting(r).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new z.Setting(r).setName("History view").setHeading(),new z.Setting(r).setName("Show Author").setDesc("Show the author of the commit in the history view.").addDropdown(c=>{let u={hide:"Hide",full:"Full",initials:"Initials"};c.addOptions(u),c.setValue(n.settings.authorInHistoryView),c.onChange(async f=>{n.settings.authorInHistoryView=f,await n.saveSettings(),await n.refresh()})}),new z.Setting(r).setName("Show Date").setDesc("Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date.").addToggle(c=>c.setValue(n.settings.dateInHistoryView).onChange(async u=>{n.settings.dateInHistoryView=u,await n.saveSettings(),await n.refresh()})),new z.Setting(r).setName("Source control view").setHeading(),new z.Setting(r).setName("Automatically refresh source control view on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option.").addToggle(c=>c.setValue(n.settings.refreshSourceControl).onChange(async u=>{n.settings.refreshSourceControl=u,await n.saveSettings()})),new z.Setting(r).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>{c.inputEl.type="number",this.setNonDefaultValue({text:c,settingsProperty:"refreshSourceControlTimer"}),c.setPlaceholder(String(Xe.refreshSourceControlTimer)),c.onChange(async f=>{f!==""&&Number.isInteger(Number(f))?n.settings.refreshSourceControlTimer=Math.max(Number(f),500):n.settings.refreshSourceControlTimer=Xe.refreshSourceControlTimer,await n.saveSettings(),n.setRefreshDebouncer()})}),new z.Setting(r).setName("Miscellaneous").setHeading(),n.gitManager instanceof Ce&&new z.Setting(r).setName("Diff view style").setDesc('Set the style for the diff view. Note that the actual diff in "Split" mode is not generated by Git, but the editor itself instead so it may differ from the diff generated by Git. One advantage of this is that you can edit the text in that view.').addDropdown(c=>{let u={split:"Split",git_unified:"Unified"};c.addOptions(u),c.setValue(n.settings.diffStyle),c.onChange(async f=>{n.settings.diffStyle=f,await n.saveSettings()})}),new z.Setting(r).setName("Disable informative notifications").setDesc("Disable informative notifications for git operations t
Line truncated
|
||||
`)),c.onChange(u=>{n.localStorage.setEnvVars(u.split(`
|
||||
`))})}),n.gitManager instanceof Ce&&new z.Setting(r).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(n.localStorage.getPATHPaths().join(`
|
||||
`)),c.onChange(u=>{n.localStorage.setPATHPaths(u.split(`
|
||||
`))})}),n.gitManager instanceof Ce&&new z.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 n.gitManager.setGitInstance()})}),new z.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(n.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{n.settings.basePath=u,await n.saveSettings(),n.gitManager.updateBasePath(u||"").catch(f=>n.displayError(f))})}),new z.Setting(r).setName("Custom Git directory path (Instead of '.git')").setDesc('Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(n.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{n.settings.gitDir=u,await n.saveSettings()})}),new z.Setting(r).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(n.localStorage.getPluginDisabled()).onChange(u=>{n.localStorage.setPluginDisabled(u),u?n.unloadPlugin():n.init({fromReload:!0}).catch(f=>n.displayError(f)),new z.Notice("Obsidian must be restarted for the changes to take affect.")})),new z.Setting(r).setName("Support").setHeading(),new z.Setting(r).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{c.buttonEl.outerHTML="<a href='https://ko-fi.com/F1F195IQ5' target='_blank'><img 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' /></a>"});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 z.Notice("Debug information copied to clipboard. May contain sensitive information!")},z.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"),z.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(r,n){n&&(r.setDisabled(n),r.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(r){this.settings.lineAuthor.show=r,this.plugin.saveSettings(),r?this.plugin.lineAuthoringFeature.activateFeature():this.plugin.lineAuthoringFeature.deactivateFeature()}async lineAuthorSettingHandler(r,n){this.settings.lineAuthor[r]=n,await this.plugin.saveSettings(),this.plugin.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 z.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform()||r.setDesc("Only available on desktop currently.").setDisabled(!0),r.descEl.innerHTML=`
|
||||
<a href="${sU}">Feature guide and quick examples</a></br>
|
||||
The commit hash, author name and authoring date can all be individually toggled.</br>Hide everything, to only show the age-colored sidebar.`,r.addToggle(n=>n.setValue(this.settings.lineAuthor.show).onChange(i=>{this.configureLineAuthorShowStatus(i),this.refreshDisplayWithDelay()})),this.settings.lineAuthor.show){let n=new z.Setting(this.containerEl).setName("Follow movement and copies across files and commits").setDesc("").addDropdown(a=>{a.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),a.setValue(this.settings.lineAuthor.followMovement),a.onChange(s=>this.lineAuthorSettingHandler("followMovement",s))});if(n.descEl.innerHTML=`
|
||||
By default (deactivated), each line only shows the newest commit where it was changed.
|
||||
<br/>
|
||||
With <i>same commit</i>, cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown.
|
||||
<br/>
|
||||
With <i>all commits</i>, cut-copy-paste-ing text inbetween multiple commits will be detected.
|
||||
<br/>
|
||||
It uses <a href="https://git-scm.com/docs/git-blame">git-blame</a> and
|
||||
for matches (at least ${dd} characters) within the same (or all) commit(s), <em>the originating</em> commit's information is shown.`,new z.Setting(this.containerEl).setName("Show commit hash").addToggle(a=>{a.setValue(this.settings.lineAuthor.showCommitHash),a.onChange(s=>this.lineAuthorSettingHandler("showCommitHash",s))}),new z.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(a=>{let s={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};a.addOptions(s),a.setValue(this.settings.lineAuthor.authorDisplay),a.onChange(async o=>this.lineAuthorSettingHandler("authorDisplay",o))}),new z.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(a=>{let s={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};a.addOptions(s),a.setValue(this.settings.lineAuthor.dateTimeFormatOptions),a.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",o),this.refreshDisplayWithDelay()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let a=new z.Setting(this.containerEl);a.setName("Custom authoring date format").addText(s=>{s.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),s.setPlaceholder("YYYY-MM-DD HH:mm"),s.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",o),a.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(o)})}),a.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(this.settings.lineAuthor.dateTimeFormatCustomString)}new z.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(a=>{let s={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};a.addOptions(s),a.setValue(this.settings.lineAuthor.dateTimeTimezone),a.onChange(async o=>this.lineAuthorSettingHandler("dateTimeTimezone",o))}).descEl.innerHTML=`
|
||||
The time-zone in which the authoring date should be shown.
|
||||
Either your local time-zone (default),
|
||||
the author's time-zone during commit creation or
|
||||
<a href="https://en.wikipedia.org/wiki/UTC%C2%B100:00">UTC\xB100:00</a>.
|
||||
`;let i=new z.Setting(this.containerEl).setName("Oldest age in coloring");i.descEl.innerHTML=this.previewOldestAgeDescriptionHtml(this.settings.lineAuthor.coloringMaxAge)[0],i.addText(a=>{a.setPlaceholder("1y"),a.setValue(this.settings.lineAuthor.coloringMaxAge),a.onChange(async s=>{let[o,l]=this.previewOldestAgeDescriptionHtml(s);i.descEl.innerHTML=o,l&&(await this.lineAuthorSettingHandler("coloringMaxAge",s),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest"),new z.Setting(this.containerEl).setName("Text color").addText(a=>{a.setValue(this.settings.lineAuthor.textColorCss),a.onChange(async s=>{await this.lineAuthorSettingHandler("textColorCss",s)})}).descEl.innerHTML=`
|
||||
The CSS color of the gutter text.<br/>
|
||||
|
||||
It is highly recommended to use
|
||||
<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties">
|
||||
CSS variables</a>
|
||||
defined by themes
|
||||
(e.g. <pre style="display:inline">var(--text-muted)</pre> or
|
||||
<pre style="display:inline">var(--text-on-accent)</pre>,
|
||||
because they automatically adapt to theme changes.<br/>
|
||||
|
||||
See: <a href="https://github.com/obsidian-community/obsidian-theme-template/blob/main/obsidian.css">
|
||||
List of available CSS variables in Obsidian
|
||||
<a/>
|
||||
`,new z.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(a=>{a.setValue(this.settings.lineAuthor.ignoreWhitespace),a.onChange(s=>this.lineAuthorSettingHandler("ignoreWhitespace",s))}).descEl.innerHTML=`
|
||||
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.
|
||||
<br>
|
||||
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 n=new z.Setting(this.containerEl).setName("").addText(i=>{let a=Rv(r,this.settings.lineAuthor),s=Rv(r,Xe.lineAuthor);i.setPlaceholder(mv(s)),i.setValue(mv(a)),i.onChange(async o=>{let l=n3(o);if(l!==void 0){let c=r==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(r,l)})});this.lineAuthorColorSettings.set(r,n),this.refreshColorSettingsName(r),this.refreshColorSettingsDesc(r,Rv(r,this.settings.lineAuthor))}refreshColorSettingsName(r){let n=this.lineAuthorColorSettings.get(r);if(n){let i=r==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";n.nameEl.innerText=`Color for ${i} commits`}}refreshColorSettingsDesc(r,n){let i=this.lineAuthorColorSettings.get(r);i&&(i.descEl.innerHTML=this.colorSettingPreviewDescHtml(r,this.settings.lineAuthor,n!==void 0))}colorSettingPreviewDescHtml(r,n,i){let a=i?Mv(r,n):"rgba(127,127,127,0.3)",s=z.moment.unix(z.moment.now()/1e3).format("YYYY-MM-DD"),o=i?`abcdef Author Name ${s}`:"invalid color";return`Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and
|
||||
named colors (e.g. 'black', 'purple'). Color preview: ${`<div
|
||||
class="line-author-settings-preview"
|
||||
style="background-color: ${a}; width: 30ch;"
|
||||
>${o}</div>`}`}previewCustomDateTimeDescriptionHtml(r){let n=(0,z.moment)().format(r);return`<a href="${aU}">Format string</a> to display the authoring date.</br>Currently: ${n}`}previewOldestAgeDescriptionHtml(r){let n=Zd(r);return[`The oldest age in the line author coloring. Everything older will have the same color.
|
||||
</br>Smallest valid age is "1d". Currently: ${n!==void 0?`${n.asDays()} days`:"invalid!"}`,n]}setNonDefaultValue({settingsProperty:r,text:n}){let i=this.plugin.settings[r];Xe[r]!==i&&(typeof i=="string"||typeof i=="number"||typeof i=="boolean"?n.setValue(String(i)):n.setValue(JSON.stringify(i)))}refreshDisplayWithDelay(r=80){setTimeout(()=>this.display(),r)}};function Rv(t,e){return t==="oldest"?e.colorOld:e.colorNew}function Zd(t){let e=z.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}function C3(t,e,r){if(!(t===void 0||e===void 0||r===void 0))return`head${t}-obj${e}-path${r}`}var P3=Jd.StateEffect.define();function R3(t,e,r){return r.update({effects:P3.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}var Lo=Jd.StateField.define({create:t=>{},update:(t,e)=>{for(let r of e.effects)if(r.is(P3))return r.value;return oU(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function Qd(t){var a;let e=T3.sha256.create();if(!t)return e;let{la:r,key:n,lineOffsetsFromUnsavedChanges:i}=t;e.update(r==="untracked"?"t":"f"),e.update(n);for(let[s,o]of(a=i.entries())!=null?a:[])e.update([s,o]);return e}var Qr={get:void 0,save:void 0};function M3(t,e){Qr.get=t,Qr.save=e}function eh(t){var e,r;return(r=(e=Zd(t.coloringMaxAge))==null?void 0:e.asDays())!=null?r:Zd(Xe.lineAuthor.coloringMaxAge).asDays()}function oU(t,e){if(e)return t.changes.empty||t.changes.iterChanges((r,n,i,a)=>{var p;let s=t.startState.doc,{newDoc:o}=t,l=s.lineAt(r).number,c=s.lineAt(n).number,u=o.lineAt(i).number,f=o.lineAt(a).number,d=c-l+1,h=f-u+1;for(let g=u;g<=f;g++){let v=(p=e.lineOffsetsFromUnsavedChanges.get(g))!=null?p:0,y=f===g,b=h-d;y&&(v+=b),e.lineOffsetsFromUnsavedChanges.set(g,v)}}),e}var Ov=class{constructor(e){this.state=e;this.subscribeMe()}notifyLineAuthoring(e,r){if(this.view===void 0){console.warn(`Git: View is not defined for editor cache key. Unforeseen situation. id: ${e}`);return}let n=this.view.state,i=R3(e,r,n);this.view.dispatch(i)}updateToNewState(e){let r=this.lastSeenPath&&this.filepath!=this.lastSeenPath;return this.state=e,r&&(this.unsubscribeMe(this.lastSeenPath),this.subscribeMe()),this}removeIfStale(){this.view.destroyed&&this.unsubscribeMe(this.lastSeenPath)}subscribeMe(){this.filepath!==void 0&&(Do.ifFilepathDefinedTransformSubscribers(this.filepath,e=>e.add(this)),this.lastSeenPath=this.filepath)}unsubscribeMe(e){Do.ifFilepathDefinedTransformSubscribers(e,r=>r.delete(this))}get filepath(){var e,r;return(r=(e=this.state.field(th.editorInfoField))==null?void 0:e.file)==null?void 0:r.path}get view(){return this.state.field(th.editorEditorField)}},I3=O3.StateField.define({create:t=>new Ov(t),update:(t,e)=>t.updateToNewState(e.state),compare:(t,e)=>t===e});m();function F3(){jo=void 0,Iv=[],rh=0,ih.clear(),ah.clear(),No.clear()}var jo,nh=()=>jo;function $3(t,e){var i;let r=e.length;if(r<((i=jo==null?void 0:jo.length)!=null?i:0))return;jo={gutter:t,length:r,text:e};let n=Qr.get();r!==n.gutterSpacingFallbackLength&&(n.gutterSpacingFallbackLength=r,Qr.save(n))}var Iv=[],lU=15,rh=0;function D3(t){Iv[rh]=t,rh=(rh+1)%lU}function L3(){return a3(Iv)}var ih=new Map,ah=new Map,No=new Set;m();var K3=require("@codemirror/state"),Z3=require("@codemirror/view");m();var Lv=require("@codemirror/view"),q3=Ot(_v()),lh=require("obsidian");m();m();var sh={x:-10,y:-10};function j3(){sh.x===-10&&window.addEventListener("mousedown",t=>{sh.x=t.clientX,sh.y=t.clientY})}function N3(){for(let t of No)if(cU(t,sh))return t}function cU(t,e){let{x:r,y:n,width:i,height:a}=t.getBoundingClientRect();return r<=e.x&&e.x<=r+i&&n<=e.y&&e.y<=n+a}m();var Nc={};var B3="data-commit";function H3(t,e,r){if(e.hasFocus())return;let n=N3();if(!n)return;let i=fU(n);i&&(!i.isZeroCommit&&!i.isWaitingGutter&&uU(i,t),Fv("showCommitHash",t),Fv("authorDisplay",t),Fv("dateTimeFormatOptions",t))}function uU(t,e){e.addItem(r=>r.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick(n=>navigator.clipboard.writeText(t.hash)))}function Fv(t,e){var l,c;let r,n,i=Nc.plugin.settings.lineAuthor,a=i[t],s=typeof a=="boolean"?a:a!=="hide",o=Xe.lineAuthor[t];if(t==="showCommitHash")r="Show commit hash",n=a;else if(t==="authorDisplay"){let u=(l=i.lastShownAuthorDisplay)!=null?l:o;r="Show author "+(s?a:u),n=s?"hide":u}else if(t==="dateTimeFormatOptions"){let u=(c=i.lastShownDateTimeFormatOptions)!=null?c:o;r="Show "+(s?a:u),r+=r.contains("date")?"":" date",n=s?"hide":u}else pa(t);e.addItem(u=>u.setTitle(r).setSection("obs-git-line-author-configure").setChecked(s).onClick(f=>{var d,h;return(h=(d=Nc.plugin)==null?void 0:d.settingsTab)==null?void 0:h.lineAuthorSettingHandler(t,n)}))}function U3(t,e,r){r.setAttr(B3,JSON.stringify({hash:t.hash,isZeroCommit:t.isZeroCommit,isWaitingGutter:e}))}function fU(t){let e=t.getAttr(B3);return e?JSON.parse(e):void 0}m();function Mv(t,e){return t==="oldest"?oh(0,!1,e).color:oh(void 0,!0,e).color}function oh(t,e,r){let n=eh(r),i=Date.now()/1eLine truncated
|
||||
(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,$r.setIcon)(this.iconEl,"globe"):(0,$r.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 ph=require("obsidian"),hh=class extends ph.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=>setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(r){let n=(0,ph.moment)().format(this.plugin.settings.commitDateFormat);return r==""&&(r="..."),[r,`${n}: ${r}`,`${r}: ${n}`]}renderSuggestion(r,n){n.innerText=r}onChooseSuggestion(r,n){this.resolve&&this.resolve(r)}};m();var tM=require("obsidian"),Bc=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,n;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((r=this.plugin.localStorage.getLastAutoPull())!=null?r:""),push:new Date((n=this.plugin.localStorage.getLastAutoPush())!=null?n:"")}}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,tM.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 n=this.diff(this.plugin.settings.autoSaveInterval,r);if(n>0)return this.startAutoCommitAndSync(n),!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.autoCommitDebo
Line truncated
|
||||
- ${a.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(To,e);let r=!1;this.plugin.app.workspace.iterateAllLeaves(n=>{n.getDisplayText()!=""&&To.startsWith(n.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(To,"/",!0)}openDiff({aFile:e,bFile:r,aRef:n,bRef:i,event:a}){var l,c;let s=this.plugin.settings.diffStyle;Ho.Platform.isMobileApp&&(s="git_unified");let o={aFile:e,bFile:r!=null?r:e,aRef:n,bRef:i};s=="split"?(l=vn(this.plugin.app,a))==null||l.setViewState({type:ca.type,active:!0,state:o}):s=="git_unified"&&((c=vn(this.plugin.app,a))==null||c.setViewState({type:ua.type,active:!0,state:o}))}async runRawCommand(){let e=this.plugin.gitManager;if(!(e instanceof Ce))return;let n=await new ze(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();n!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let i=new Ho.Notice(`Running '${n}'...`,999999);try{let a=await e.rawCommand(n);a?(i.setMessage(a),window.setTimeout(()=>i.hide(),5e3)):i.hide()}catch(a){throw i.hide(),a}})}};m();m();m();m();var Ke;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(Ke||(Ke={}));var lM={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},cM={LINES:"lines",WORDS:"words",NONE:"none"},uM={WORD:"word",CHAR:"char"},as;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(as||(as={}));m();var SU=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],EU=RegExp("["+SU.join("\\")+"]","g");function fM(t){return t.replace(EU,"\\$&")}function Hv(t){return t&&t.replace(/\\/g,"/")}function dM(t){let e,r,n,i=0;for(e=0,n=t.length;e<n;e++)r=t.charCodeAt(e),i=(i<<5)-i+r,i|=0;return i}function yh(t){let e=t.length,r=-1/0;for(let n=0;n<e;n++)r=Math.max(r,t[n]);return r}function hM(t,e){let r=t.split(".");return r.length>1?r[r.length-1]:e}function pM(t,e){return e.reduce((r,n)=>r||t.startsWith(n),!1)}var mM=["a/","b/","i/","w/","c/","o/"];function ga(t,e,r){let n=r!==void 0?[...mM,r]:mM,i=e?new RegExp(`^${fM(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,a=""]=i.exec(t)||[],s=n.find(l=>a.indexOf(l)===0);return(s?a.slice(s.length):a).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function AU(t,e){return ga(t,"---",e)}function kU(t,e){return ga(t,"+++",e)}function gM(t,e={}){let r=[],n=null,i=null,a=null,s=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})/,v=/^new file mode (\d{6})/,y=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,E=/^rename from "?(.+)"?/,S=/^rename to "?(.+)"?/,A=/^similarity index (\d+)%/,k=/^dissimilarity index (\d+)%/,w=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,x=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,C=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,I=/^new file mode (\d{6})/,L=/^deleted file mode (\d{6}),(\d{6})/,$=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,`
|
||||
`).split(`
|
||||
`);function J(){i!==null&&n!==null&&(n.blocks.push(i),i=null)}function de(){n!==null&&(!n.oldName&&l!==null&&(n.oldName=l),!n.newName&&c!==null&&(n.newName=c),n.newName&&(r.push(n),n=null)),l=null,c=null}function le(){J(),de(),n={blocks:[],deletedLines:0,addedLines:0}}function ce(N){J();let W;n!==null&&((W=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(N))?(n.isCombined=!1,a=parseInt(W[1],10),o=parseInt(W[2],10)):(W=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(N))?(n.isCombined=!0,a=parseInt(W[1],10),s=parseInt(W[2],10),o=parseInt(W[3],10)):(N.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),a=0,o=0,n.isCombined=!1)),i={lines:[],oldStartLine:a,oldStartLine2:s,newStartLine:o,header:N}}function Te(N){if(n===null||i===null||a===null||o===null)return;let W={content:N},B=n.isCombined?["+ "," +","++"]:["+"],$e=n.isCombined?["- "," -","--"]:["-"];pM(N,B)?(n.addedLines++,W.type=Ke.INSERT,W.oldNumber=void 0,W.newNumber=o++):pM(N,$e)?(n.deletedLines++,W.type=Ke.DELETE,W.oldNumber=a++,W.newNumber=void 0):(W.type=Ke.CONTEXT,W.oldNumber=a++,W.newNumber=o++),i.lines.push(W)}function ne(N,W){let B=W;for(;B<$.length-3;){if(N.startsWith("diff"))return!1;if($[B].startsWith(u)&&$[B+1].startsWith(f)&&$[B+2].startsWith(d))return!0;B++}return!1}return $.forEach((N,W)=>{if(!N||N.startsWith("*"))return;let B,$e=$[W-1],lr=$[W+1],Ut=$[W+2];if(N.startsWith("diff --git")||N.startsWith("diff --combined")){if(le(),(B=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(N))&&(l=ga(B[1],void 0,e.dstPrefix),c=ga(B[2],void 0,e.srcPrefix)),n===null)throw new Error("Where is my file !!!");n.isGitDiff=!0;return}if(N.startsWith("Binary files")&&!(n!=null&&n.isGitDiff)){if(le(),(B=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(N))&&(l=ga(B[1],void 0,e.dstPrefix),c=ga(B[2],void 0,e.srcPrefix)),n===null)throw new Error("Where is my file !!!");n.isBinary=!0;return}if((!n||!n.isGitDiff&&n&&N.startsWith(u)&&lr.startsWith(f)&&Ut.startsWith(d))&&le(),n!=null&&n.isTooBig)return;if(n&&(typeof e.diffMaxChanges=="number"&&n.addedLines+n.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&N.length>e.diffMaxLineLength)){n.isTooBig=!0,n.addedLines=0,n.deletedLines=0,n.blocks=[],i=null;let Oe=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(r.length):"Diff too big to be displayed";ce(Oe);return}if(N.startsWith(u)&&lr.startsWith(f)||N.startsWith(f)&&$e.startsWith(u)){if(n&&!n.oldName&&N.startsWith("--- ")&&(B=AU(N,e.srcPrefix))){n.oldName=B,n.language=hM(n.oldName,n.language);return}if(n&&!n.newName&&N.startsWith("+++ ")&&(B=kU(N,e.dstPrefix))){n.newName=B,n.language=hM(n.newName,n.language);return}}if(n&&(N.startsWith(d)||n.isGitDiff&&n.oldName&&n.newName&&!i)){ce(N);return}if(i&&(N.startsWith("+")||N.startsWith("-")||N.startsWith(" "))){Te(N);return}let X=!ne(N,W);if(n===null)throw new Error("Where is my file !!!");(B=h.exec(N))?n.oldMode=B[1]:(B=p.exec(N))?n.newMode=B[1]:(B=g.exec(N))?(n.deletedFileMode=B[1],n.isDeleted=!0):(B=v.exec(N))?(n.newFileMode=B[1],n.isNew=!0):(B=y.exec(N))?(X&&(n.oldName=B[1]),n.isCopy=!0):(B=b.exec(N))?(X&&(n.newName=B[1]),n.isCopy=!0):(B=E.exec(N))?(X&&(n.oldName=B[1]),n.isRename=!0):(B=S.exec(N))?(X&&(n.newName=B[1]),n.isRename=!0):(B=x.exec(N))?(n.isBinary=!0,n.oldName=ga(B[1],void 0,e.srcPrefix),n.newName=ga(B[2],void 0,e.dstPrefix),ce("Binary file")):_.test(N)?(n.isBinary=!0,ce(N)):(B=A.exec(N))?n.unchangedPercentage=parseInt(B[1],10):(B=k.exec(N))?n.changedPercentage=parseInt(B[1],10):(B=w.exec(N))?(n.checksumBefore=B[1],n.checksumAfter=B[2],B[3]&&(n.mode=B[3])):(B=T.exec(N))?(n.checksumBefore=[B[2],B[3]],n.checksumAfter=B[1]):(B=C.exec(N))?(n.oldMode=[B[2],B[3]],n.newMode=B[1]):(B=I.exec(N))?(n.newFileMode=B[1],n.isNew=!0):(B=L.exec(N))&&(n.deletedFileMode=B[1],n.isDeleted=!0)}),J(),de(),r}m();m();m();function CU(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}function Uo(t){return(e,r)=>{let n=t(e).trim(),i=t(r).trim();return CU(n,i)/(n.length+i.length)}}function Go(t){function e(n,i,a=new Map){let s=1/0,o;for(let l=0;l<n.length;++l)for(let c=0;c<i.length;++c){let u=JSON.stringify([n[l],i[c]]),f;a.has(u)&&(f=a.get(u))||(f=t(n[l],i[c]),a.set(u,f)),f<s&&(s=f,o={indexA:l,indexB:c,score:s})}return o}function r(n,i,a=0,s=new Map){let o=e(n,i,s);if(!o||n.length+i.length<3)return[[n,i]];let l=n.slice(0,o.indexA),c=i.slice(0,o.indexB),u=[n[o.indexA]],f=[i[o.indexB]],d=o.indexA+1,h=o.indexB+1,p=n.slice(d),g=i.slice(h),v=r(l,c,a+1,s),y=r(u,f,a+1,s),b=r(p,g,a+1,s),E=y;return(o.indexA>0||o.indexB>0)&&(E=v.concat(E)),(n.length>d||i.length>h)&&(E=E.concat(b)),E}return r}var Dt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info
Line truncated
|
||||
`);return this.hoganUtils.render(yM,"wrapper",{colorScheme:Vo(this.config.colorScheme),filesNumber:e.length,files:r})}};m();var Vv=Object.assign(Object.assign({},ss),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Gc="generic",wM="line-by-line",$U="icon",DU="tag",zc=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Vv),r)}render(e){let r=e.map(n=>{let i;return n.blocks.length?i=this.generateFileHtml(n):i=this.generateEmptyDiff(),this.makeFileDiffHtml(n,i)}).join(`
|
||||
`);return this.hoganUtils.render(Gc,"wrapper",{colorScheme:Vo(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let n=this.hoganUtils.template(wM,"file-diff"),i=this.hoganUtils.template(Gc,"file-path"),a=this.hoganUtils.template($U,"file"),s=this.hoganUtils.template(DU,Wo(e));return n.render({file:e,fileHtmlId:qo(e),diffs:r,filePath:i.render({fileDiffName:os(e)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return this.hoganUtils.render(Gc,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Dt})}generateFileHtml(e){let r=Go(Uo(n=>en(n.content,e.isCombined).content));return e.blocks.map(n=>{let i=this.hoganUtils.render(Gc,"block-header",{CSSLineClass:Dt,blockHeader:e.isTooBig?n.header:va(n.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(n).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);i+=u,i+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=en(l.content,e.isCombined);i+=this.generateSingleLineHtml(e,{type:Dt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,s,o);i+=l,i+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).join(`
|
||||
`)}applyLineGroupping(e){let r=[],n=[],i=[];for(let a=0;a<e.lines.length;a++){let s=e.lines[a];(s.type!==Ke.INSERT&&i.length||s.type===Ke.CONTEXT&&n.length>0)&&(r.push([[],n,i]),n=[],i=[]),s.type===Ke.CONTEXT?r.push([[s],[],[]]):s.type===Ke.INSERT&&n.length===0?r.push([[],[],[s]]):s.type===Ke.INSERT&&n.length>0?i.push(s):s.type===Ke.DELETE&&n.push(s)}return(n.length||i.length)&&(r.push([[],n,i]),n=[],i=[]),r}applyRematchMatching(e,r,n){let i=e.length*r.length,a=yh(e.concat(r).map(o=>o.content.length));return i<this.config.matchingMaxComparisons&&a<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?n(e,r):[[e,r]]}processChangedLines(e,r,n,i){let a={right:"",left:""},s=Math.max(n.length,i.length);for(let o=0;o<s;o++){let l=n[o],c=i[o],u=l!==void 0&&c!==void 0?wh(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:Dt.DELETE_CHANGES}:Object.assign(Object.assign({},en(l.content,r)),{type:zo(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:Dt.INSERT_CHANGES}:Object.assign(Object.assign({},en(c.content,r)),{type:zo(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,{left:h,right:p}=this.generateLineHtml(e,f,d);a.left+=h,a.right+=p}return a}generateLineHtml(e,r,n){return{left:this.generateSingleLineHtml(e,r),right:this.generateSingleLineHtml(e,n)}}generateSingleLineHtml(e,r){if(r===void 0)return"";let n=this.hoganUtils.render(wM,"numbers",{oldNumber:r.oldNumber||"",newNumber:r.newNumber||""});return this.hoganUtils.render(Gc,"line",{type:r.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:r.prefix===" "?" ":r.prefix,content:r.content,lineNumber:n,line:r,file:e})}};m();var qv=Object.assign(Object.assign({},ss),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Vc="generic",LU="side-by-side",jU="icon",NU="tag",qc=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},qv),r)}render(e){let r=e.map(n=>{let i;return n.blocks.length?i=this.generateFileHtml(n):i=this.generateEmptyDiff(),this.makeFileDiffHtml(n,i)}).join(`
|
||||
`);return this.hoganUtils.render(Vc,"wrapper",{colorScheme:Vo(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let n=this.hoganUtils.template(LU,"file-diff"),i=this.hoganUtils.template(Vc,"file-path"),a=this.hoganUtils.template(jU,"file"),s=this.hoganUtils.template(NU,Wo(e));return n.render({file:e,fileHtmlId:qo(e),diffs:r,filePath:i.render({fileDiffName:os(e)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Vc,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Dt})}}generateFileHtml(e){let r=Go(Uo(n=>en(n.content,e.isCombined).content));return e.blocks.map(n=>{let i={left:this.makeHeaderHtml(n.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(n).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);i.left+=u,i.right+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=en(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:Dt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:Dt.CONTEXT,prefix:c,content:u,number:l.newNumber});i.left+=f,i.right+=d});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,s,o);i.left+=l,i.right+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).reduce((n,i)=>({left:n.left+i.left,right:n.right+i.right}),{left:"",right:""})}applyLineGroupping(e){let r=[],n=[],i=[];for(let a=0;a<e.lines.length;a++){let s=e.lines[a];(s.type!==Ke.INSERT&&i.length||s.type===Ke.CONTEXT&&n.length>0)&&(r.push([[],n,i]),n=[],i=[]),s.type===Ke.CONTEXT?r.push([[s],[],[]]):s.type===Ke.INSERT&&n.length===0?r.push([[],[],[s]]):s.type===Ke.INSERT&&n.length>0?i.push(s):s.type===Ke.DELETE&&n.push(s)}return(n.length||i.length)&&(r.push([[],n,i]),n=[],i=[]),r}applyRematchMatching(e,r,n){let i=e.length*r.length,a=yh(e.concat(r).map(o=>o.content.length));return i<this.config.matchingMaxComparisons&&a<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?n(e,r):[[e,r]]}makeHeaderHtml(e,r){return this.hoganUtils.render(Vc,"block-header",{CSSLineClass:Dt,blockHeader:r!=null&&r.isTooBig?e:va(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,r,n){let i={right:"",left:""},a=Math.max(r.length,n.length);for(let s=0;s<a;s++){let o=r[s],l=n[s],c=o!==void 0&&l!==void 0?wh(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:Dt.DELETE_CHANGES}:Object.assign(Object.assign({},en(o.content,e)),{type:zo(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:Dt.INSERT_CHANGES}:Object.assign(Object.assign({},en(l.content,e)),{type:zo(l.type)})),{number:l.newNumber}):void 0,{left:d,right:h}=this.generateLineHtml(u,f);i.left+=d,i.right+=h}return i}generateLineHtml(e,r){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(r)}}generateSingleHtml(e){let r="d2h-code-side-linenumber",n="d2h-code-side-line";return this.hoganUtils.render(Vc,"line",{type:(e==null?void 0:e.type)||`${Dt.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?r:`${r} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?n:`${n} 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 Kv=Ot(Xv());m();var ht=Ot(Xv()),dt={};dt["file-summary-line"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<li class="d2h-file-list-line">'),n.b(`
|
||||
`+r),n.b(' <span class="d2h-file-name-wrapper">'),n.b(`
|
||||
`+r),n.b(n.rp("<fileIcon0",t,e," ")),n.b(' <a href="#'),n.b(n.v(n.f("fileHtmlId",t,e,0))),n.b('" class="d2h-file-name">'),n.b(n.v(n.f("fileName",t,e,0))),n.b("</a>"),n.b(`
|
||||
`+r),n.b(' <span class="d2h-file-stats">'),n.b(`
|
||||
`+r),n.b(' <span class="d2h-lines-added">'),n.b(n.v(n.f("addedLines",t,e,0))),n.b("</span>"),n.b(`
|
||||
`+r),n.b(' <span class="d2h-lines-deleted">'),n.b(n.v(n.f("deletedLines",t,e,0))),n.b("</span>"),n.b(`
|
||||
`+r),n.b(" </span>"),n.b(`
|
||||
`+r),n.b(" </span>"),n.b(`
|
||||
`+r),n.b("</li>"),n.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});dt["file-summary-wrapper"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div class="d2h-file-list-wrapper '),n.b(n.v(n.f("colorScheme",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(' <div class="d2h-file-list-header">'),n.b(`
|
||||
`+r),n.b(' <span class="d2h-file-list-title">Files changed ('),n.b(n.v(n.f("filesNumber",t,e,0))),n.b(")</span>"),n.b(`
|
||||
`+r),n.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),n.b(`
|
||||
`+r),n.b(' <a class="d2h-file-switch d2h-show">show</a>'),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(' <ol class="d2h-file-list">'),n.b(`
|
||||
`+r),n.b(" "),n.b(n.t(n.f("files",t,e,0))),n.b(`
|
||||
`+r),n.b(" </ol>"),n.b(`
|
||||
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});dt["generic-block-header"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b("<tr>"),n.b(`
|
||||
`+r),n.b(' <td class="'),n.b(n.v(n.f("lineClass",t,e,0))),n.b(" "),n.b(n.v(n.d("CSSLineClass.INFO",t,e,0))),n.b('"></td>'),n.b(`
|
||||
`+r),n.b(' <td class="'),n.b(n.v(n.d("CSSLineClass.INFO",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",t,e,0))),n.b('">'),n.s(n.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(n.rs(t,e,function(i,a,s){s.b(s.t(s.f("blockHeader",i,a,0)))}),t.pop()),n.s(n.f("blockHeader",t,e,1),t,e,1,0,0,"")||n.b(" "),n.b("</div>"),n.b(`
|
||||
`+r),n.b(" </td>"),n.b(`
|
||||
`+r),n.b("</tr>"),n.fl()},partials:{},subs:{}});dt["generic-empty-diff"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b("<tr>"),n.b(`
|
||||
`+r),n.b(' <td class="'),n.b(n.v(n.d("CSSLineClass.INFO",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(" File without changes"),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(" </td>"),n.b(`
|
||||
`+r),n.b("</tr>"),n.fl()},partials:{},subs:{}});dt["generic-file-path"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-file-name-wrapper">'),n.b(`
|
||||
`+r),n.b(n.rp("<fileIcon0",t,e," ")),n.b(' <span class="d2h-file-name">'),n.b(n.v(n.f("fileDiffName",t,e,0))),n.b("</span>"),n.b(`
|
||||
`+r),n.b(n.rp("<fileTag1",t,e," ")),n.b("</span>"),n.b(`
|
||||
`+r),n.b('<label class="d2h-file-collapse">'),n.b(`
|
||||
`+r),n.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),n.b(`
|
||||
`+r),n.b(" Viewed"),n.b(`
|
||||
`+r),n.b("</label>"),n.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});dt["generic-line"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b("<tr>"),n.b(`
|
||||
`+r),n.b(' <td class="'),n.b(n.v(n.f("lineClass",t,e,0))),n.b(" "),n.b(n.v(n.f("type",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(" "),n.b(n.t(n.f("lineNumber",t,e,0))),n.b(`
|
||||
`+r),n.b(" </td>"),n.b(`
|
||||
`+r),n.b(' <td class="'),n.b(n.v(n.f("type",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.s(n.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(n.rs(t,e,function(i,a,s){s.b(' <span class="d2h-code-line-prefix">'),s.b(s.t(s.f("prefix",i,a,0))),s.b("</span>"),s.b(`
|
||||
`+r)}),t.pop()),n.s(n.f("prefix",t,e,1),t,e,1,0,0,"")||(n.b(' <span class="d2h-code-line-prefix"> </span>'),n.b(`
|
||||
`+r)),n.s(n.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(n.rs(t,e,function(i,a,s){s.b(' <span class="d2h-code-line-ctn">'),s.b(s.t(s.f("content",i,a,0))),s.b("</span>"),s.b(`
|
||||
`+r)}),t.pop()),n.s(n.f("content",t,e,1),t,e,1,0,0,"")||(n.b(' <span class="d2h-code-line-ctn"><br></span>'),n.b(`
|
||||
`+r)),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(" </td>"),n.b(`
|
||||
`+r),n.b("</tr>"),n.fl()},partials:{},subs:{}});dt["generic-wrapper"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div class="d2h-wrapper '),n.b(n.v(n.f("colorScheme",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(" "),n.b(n.t(n.f("content",t,e,0))),n.b(`
|
||||
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});dt["icon-file-added"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),n.b(`
|
||||
`+r),n.b(' width="14">'),n.b(`
|
||||
`+r),n.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>'),n.b(`
|
||||
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});dt["icon-file-changed"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),n.b(`
|
||||
`+r),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
|
||||
`+r),n.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>'),n.b(`
|
||||
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});dt["icon-file-deleted"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),n.b(`
|
||||
`+r),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
|
||||
`+r),n.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>'),n.b(`
|
||||
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});dt["icon-file-renamed"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),n.b(`
|
||||
`+r),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
|
||||
`+r),n.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>'),n.b(`
|
||||
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});dt["icon-file"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),n.b(`
|
||||
`+r),n.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>'),n.b(`
|
||||
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});dt["line-by-line-file-diff"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div id="'),n.b(n.v(n.f("fileHtmlId",t,e,0))),n.b('" class="d2h-file-wrapper" data-lang="'),n.b(n.v(n.d("file.language",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(' <div class="d2h-file-header">'),n.b(`
|
||||
`+r),n.b(" "),n.b(n.t(n.f("filePath",t,e,0))),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(' <div class="d2h-file-diff">'),n.b(`
|
||||
`+r),n.b(' <div class="d2h-code-wrapper">'),n.b(`
|
||||
`+r),n.b(' <table class="d2h-diff-table">'),n.b(`
|
||||
`+r),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
|
||||
`+r),n.b(" "),n.b(n.t(n.f("diffs",t,e,0))),n.b(`
|
||||
`+r),n.b(" </tbody>"),n.b(`
|
||||
`+r),n.b(" </table>"),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});dt["line-by-line-numbers"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div class="line-num1">'),n.b(n.v(n.f("oldNumber",t,e,0))),n.b("</div>"),n.b(`
|
||||
`+r),n.b('<div class="line-num2">'),n.b(n.v(n.f("newNumber",t,e,0))),n.b("</div>"),n.fl()},partials:{},subs:{}});dt["side-by-side-file-diff"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div id="'),n.b(n.v(n.f("fileHtmlId",t,e,0))),n.b('" class="d2h-file-wrapper" data-lang="'),n.b(n.v(n.d("file.language",t,e,0))),n.b('">'),n.b(`
|
||||
`+r),n.b(' <div class="d2h-file-header">'),n.b(`
|
||||
`+r),n.b(" "),n.b(n.t(n.f("filePath",t,e,0))),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(' <div class="d2h-files-diff">'),n.b(`
|
||||
`+r),n.b(' <div class="d2h-file-side-diff">'),n.b(`
|
||||
`+r),n.b(' <div class="d2h-code-wrapper">'),n.b(`
|
||||
`+r),n.b(' <table class="d2h-diff-table">'),n.b(`
|
||||
`+r),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
|
||||
`+r),n.b(" "),n.b(n.t(n.d("diffs.left",t,e,0))),n.b(`
|
||||
`+r),n.b(" </tbody>"),n.b(`
|
||||
`+r),n.b(" </table>"),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(' <div class="d2h-file-side-diff">'),n.b(`
|
||||
`+r),n.b(' <div class="d2h-code-wrapper">'),n.b(`
|
||||
`+r),n.b(' <table class="d2h-diff-table">'),n.b(`
|
||||
`+r),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
|
||||
`+r),n.b(" "),n.b(n.t(n.d("diffs.right",t,e,0))),n.b(`
|
||||
`+r),n.b(" </tbody>"),n.b(`
|
||||
`+r),n.b(" </table>"),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b(" </div>"),n.b(`
|
||||
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});dt["tag-file-added"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),n.fl()},partials:{},subs:{}});dt["tag-file-changed"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),n.fl()},partials:{},subs:{}});dt["tag-file-deleted"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),n.fl()},partials:{},subs:{}});dt["tag-file-renamed"]=new ht.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),n.fl()},partials:{},subs:{}});var Wc=class{constructor({compiledTemplates:e={},rawTemplates:r={}}){let n=Object.entries(r).reduce((i,[a,s])=>{let o=Kv.compile(s,{asString:!1});return Object.assign(Object.assign({},i),{[a]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},dt),e),n)}static compile(e){return Kv.compile(e,{asString:!1})}render(e,r,n,i,a){let s=this.templateKey(e,r);try{return this.preCompiledTemplates[s].render(n,i,a)}catch(o){throw new Error(`Could not find template to render '${s}'`)}}template(e,r){return this.preCompiledTemplates[this.templateKey(e,r)]}templateKey(e,r){return`${e}-${r}`}};var HU=Object.assign(Object.assign(Object.assign({},Vv),qv),{outputFormat:lM.LINE_BY_LINE,drawFileList:!0});function SM(t,e={}){let r=Object.assign(Object.assign({},HU),e),n=typeof t=="string"?gM(t,r):t,i=new Wc(r),{colorScheme:a}=r,s={colorScheme:a},o=r.drawFileList?new bh(i,s).render(n):"",l=r.outputFormat==="side-by-side"?new qc(i,r).render(n):new zc(i,r).render(n);return o+l}var xh=require("obsidian");var ls=class extends xh.ItemView{constructor(r,n){super(r);this.plugin=n;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return ua.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let n=this.state.bFile.split("/").last();return n!=null&&n.endsWith(".md")&&(n=n.slice(0,-3)),`Diff: ${n}`}return ua.name}getIcon(){return ua.icon}async setState(r,n){this.state=r,xh.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 n=await this.plugin.gitManager.getDiffString(this.state.bFile,this.state.aRef=="HEAD",this.state.bRef);this.contentEl.empty();let i=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);if(!n){if(this.plugin.gitManager instanceof Ce&&await this.plugin.gitManager.isTracked(this.state.bFile))n=[`--- ${this.state.aFile}`,`+++ ${this.state.bFile}`,""].join(`
|
||||
`);else if(await this.app.vault.adapter.exists(i)){let a=await this.app.vault.adapter.read(i);n=[...`--- /dev/null
|
||||
+++ ${this.state.bFile}
|
||||
@@ -0,0 +1,${a.split(`
|
||||
`).length} @@`.split(`
|
||||
`),...a.split(`
|
||||
`).map(o=>`+${o}`)].join(`
|
||||
`)}}if(n){let a=this.parser.parseFromString(SM(n),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(a)}else{let a=this.contentEl.createDiv({cls:"obsidian-git-center"});a.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),a.createEl("br"),a.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};m();var Qo=require("obsidian");var el=require("@codemirror/commands");m();var Ie=require("@codemirror/view"),ke=require("@codemirror/state");m();var Zv="\u037C",EM=typeof Symbol=="undefined"?"__"+Zv:Symbol.for(Zv),Jv=typeof Symbol=="undefined"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),AM=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{},Sh=class{constructor(e,r){this.rules=[];let{finish:n}=r||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function a(s,o,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&o==null)return l.push(s[0]+";");for(let h in o){let p=o[h];if(/&/.test(h))a(h.split(/,\s*/).map(g=>s.map(v=>g.replace(/&/,v))).reduce((g,v)=>g.concat(v)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");a(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((n&&!f&&!c?s.map(n):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in e)a(i(s),e[s],this.rules)}getRules(){return this.rules.join(`
|
||||
`)}static newName(){let e=AM[EM]||1;return AM[EM]=e+1,Zv+e.toString(36)}static mount(e,r,n){let i=e[Jv],a=n&&n.nonce;i?a&&i.setNonce(a):i=new Qv(e,a),i.mount(Array.isArray(r)?r:[r],e)}},kM=new Map,Qv=class{constructor(e,r){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let a=kM.get(n);if(a)return e[Jv]=a;this.sheet=new i.CSSStyleSheet,kM.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[Jv]=this}mount(e,r){let n=this.sheet,i=0,a=0;for(let s=0;s<e.length;s++){let o=e[s],l=this.modules.indexOf(o);if(l<a&&l>-1&&(this.modules.splice(l,1),a--,l=-1),l==-1){if(this.modules.splice(a++,0,o),n)for(let c=0;c<o.rules.length;c++)n.insertRule(o.rules[c],i++)}else{for(;a<l;)i+=this.modules[a++].rules.length;i+=o.rules.length,a++}}if(n)r.adoptedStyleSheets.indexOf(this.sheet)<0&&(r.adoptedStyleSheets=[this.sheet,...r.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
|
||||
`;this.styleTag.textContent=s;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 zM=require("@codemirror/language"),UU=require("@lezer/highlight"),pt=class t{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}offset(e,r=e){return new t(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}};function us(t,e,r,n,i,a){if(t==n)return[];let s=o1(t,e,r,n,i,a),o=l1(t,e+s,r,n,i+s,a);e+=s,r-=o,i+=s,a-=o;let l=r-e,c=a-i;if(!l||!c)return[new pt(e,r,i,a)];if(l>c){let f=t.slice(e,r).indexOf(n.slice(i,a));if(f>-1)return[new pt(e,e+f,i,i),new pt(e+f+c,r,a,a)]}else if(c>l){let f=n.slice(i,a).indexOf(t.slice(e,r));if(f>-1)return[new pt(e,e,i,i+f),new pt(r,r,i+f+l,a)]}if(l==1||c==1)return[new pt(e,r,i,a)];let u=qM(t,e,r,n,i,a);if(u){let[f,d,h]=u;return us(t,e,f,n,i,d).concat(us(t,f+h,r,n,d+h,a))}return GU(t,e,r,n,i,a)}var Yc=1e9,Xc=0,s1=!1;function GU(t,e,r,n,i,a){let s=r-e,o=a-i;if(Yc<1e9&&Math.min(s,o)>Yc*16||Xc>0&&Date.now()>Xc)return Math.min(s,o)>Yc*64?[new pt(e,r,i,a)]:TM(t,e,r,n,i,a);let l=Math.ceil((s+o)/2);e1.reset(l),t1.reset(l);let c=(h,p)=>t.charCodeAt(e+h)==n.charCodeAt(i+p),u=(h,p)=>t.charCodeAt(r-h-1)==n.charCodeAt(a-p-1),f=(s-o)%2!=0?t1:null,d=f?null:e1;for(let h=0;h<l;h++){if(h>Yc||Xc>0&&!(h&63)&&Date.now()>Xc)return TM(t,e,r,n,i,a);let p=e1.advance(h,s,o,l,f,!1,c)||t1.advance(h,s,o,l,d,!0,u);if(p)return zU(t,e,r,e+p[0],n,i,a,i+p[1])}return[new pt(e,r,i,a)]}var Ch=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,n,i,a,s,o){for(let l=-e+this.start;l<=e-this.end;l+=2){let c=i+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<n&&o(u,f);)u++,f++;if(this.vec[c]=u,u>r)this.end+=2;else if(f>n)this.start+=2;else if(a){let d=i+(r-n)-l;if(d>=0&&d<this.len&&a.vec[d]!=-1)if(s){let h=a.vec[d];if(h>=r-u)return[h,i+h-d]}else{let h=r-a.vec[d];if(u>=h)return[u,f]}}}return null}},e1=new Ch,t1=new Ch;function zU(t,e,r,n,i,a,s,o){let l=!1;return!Ko(t,n)&&++n==r&&(l=!0),!Ko(i,o)&&++o==s&&(l=!0),l?[new pt(e,r,a,s)]:us(t,e,n,i,a,o).concat(us(t,n,r,i,o,s))}function VM(t,e){let r=1,n=Math.min(t,e);for(;r<n;)r=r<<1;return r}function o1(t,e,r,n,i,a){if(e==r||e==a||t.charCodeAt(e)!=n.charCodeAt(i))return 0;let s=VM(r-e,a-i);for(let o=e,l=i;;){let c=o+s,u=l+s;if(c>r||u>a||t.slice(o,c)!=n.slice(l,u)){if(s==1)return o-e-(Ko(t,o)?0:1);s=s>>1}else{if(c==r||u==a)return c-e;o=c,l=u}}}function l1(t,e,r,n,i,a){if(e==r||i==a||t.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let s=VM(r-e,a-i);for(let o=r,l=a;;){let c=o-s,u=l-s;if(c<e||u<i||t.slice(c,o)!=n.slice(u,l)){if(s==1)return r-o-(Ko(t,o)?0:1);s=s>>1}else{if(c==e||u==i)return r-c;o=c,l=u}}}function r1(t,e,r,n,i,a,s,o){let l=n.slice(i,a),c=null;for(;;){if(c||s<o)return c;for(let u=e+s;;){Ko(t,u)||u++;let f=u+s;if(Ko(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=o1(t,f,r,n,i+h+d.length,a),g=l1(t,e,u,n,i,i+h),v=d.length+p+g;(!c||c[2]<v)&&(c=[u-g,i+h-g,v])}u=f}if(o<0)return c;s=s>>1}}function qM(t,e,r,n,i,a){let s=r-e,o=a-i;if(s<o){let l=qM(n,i,a,t,e,r);return l&&[l[1],l[0],l[2]]}return s<4||o*2<s?null:r1(t,e,r,n,i,a,Math.floor(s/4),-1)}function TM(t,e,r,n,i,a){s1=!0;let s=r-e,o=a-i,l;if(s<o){let d=r1(n,i,a,t,e,r,Math.floor(s/6),50);l=d&&[d[1],d[0],d[2]]}else l=r1(t,e,r,n,i,a,Math.floor(o/6),50);if(!l)return[new pt(e,r,i,a)];let[c,u,f]=l;return us(t,e,c,n,i,u).concat(us(t,c+f,r,n,u+f,a))}function WM(t,e){for(let r=1;r<t.length;r++){let n=t[r-1],i=t[r];n.toA>i.fromA-e&&n.toB>i.fromB-e&&(t[r-1]=new pt(n.fromA,i.toA,n.fromB,i.toB),t.splice(r--,1))}}function VU(t,e,r){for(;;){WM(r,1);let n=!1;for(let i=0;i<r.length;i++){let a=r[i],s,o;(s=o1(t,a.fromA,a.toA,e,a.fromB,a.toB))&&(a=r[i]=new pt(a.fromA+s,a.toA,a.fromB+s,a.toB)),(o=l1(t,a.fromA,a.toA,e,a.fromB,a.toB))&&(a=r[i]=new pt(a.fromA,a.toA-o,a.fromB,a.toB-o));let l=a.toA-a.fromA,c=a.toB-a.fromB;if(l&&c)continue;let u=a.fromA-(i?r[i-1].toA:0),f=(i<r.length-1?r[i+1].fromA:t.length)-a.toA;if(!u||!f)continue;let d=l?t.slice(a.fromA,a.toA):e.slice(a.fromB,a.toB);u<=d.length&&t.slice(a.fromA-u,a.fromA)==d.slice(d.length-u)?(r[i]=new pt(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),n=!0):f<=d.length&&t.slice(a.toA,a.toA+f)==d.slice(0,f)&&(r[i]=new pt(a.fromA+f,a.toA+f,a.fromB+f,a.toB+f),n=!0)}if(!n)break}return r}function qU(t,e,r){for(let n=0,i=0;i<t.length;i++){let a=t[i],s=a.toA-a.fromA,o=a.toB-a.fromB;if(s&&o||s>3||o>3){let l=i==t.length-1?e.length:t[i+1].fromA,c=a.fromA-n,u=l-a.toA,f=PM(e,a.fromA,c),d=CM(e,a.toA,u),h=a.fromA-f,p=d-a.toA;if((!s||!o)&&h&&p){let g=Math.max(s,o),[v,y,b]=s?[e,a.fromA,a.toA]:[r,a.fromB,a.toB];g>h&&e.slice(f,a.fromA)==v.slice(b-h,b)?(a=t[i]=new pt(f,f+s,a.fromB-h,a.toB-h),f=a.fromA,d=CM(e,a.toA,l-a.toA)):g>p&&e.slice(a.toA,d)==v.slice(y,y+p)&&(a=t[i]=new pt(d-s,d,a.fromB+p,a.toB+p),d=a.
Line truncated
|
||||
\`${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 mO(){if(D){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 p1(){if(D){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 gO(){if(D){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 vO(t){if(D){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 yO(){if(D){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 wO(t){if(D){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 bO(){if(D){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 _O(){if(D){let t=new Error("flush_sync_in_effect\nCannot use `flushSync` inside an effect\nhttps://svelte.dev/e/flush_sync_in_effect");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/flush_sync_in_effect")}function xO(){if(D){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 SO(t){if(D){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 EO(t){if(D){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 AO(){if(D){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 kO(){if(D){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 TO(){if(D){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")}m();m();m();var hs="font-weight: bold",ps="font-weight: normal";function CO(t){D?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`,hs,ps):console.warn("https://svelte.dev/e/await_reactivity_loss")}function PO(t,e){D?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`,hs,ps):console.warn("https://svelte.dev/e/await_waterfall")}function RO(t,e,r){D?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`,hs,ps):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function ms(t){D?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`,hs,ps):console.warn("https://svelte.dev/e/hydration_mismatch")}function MO(){D?console.warn(`%c[svelte] lifecycle_double_unmount
|
||||
%cTried to unmount a component that was not mounted
|
||||
https://svelte.dev/e/lifecycle_double_unmount`,hs,ps):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Fh(t){D?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`,hs,ps):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function OO(t){D?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`,hs,ps):console.warn("https://svelte.dev/e/transition_slide_display")}var se=!1;function Yt(t){se=t}var ge;function et(t){if(t===null)throw ms(),Ci;return ge=t}function Xt(){return et(jt(ge))}function H(t){if(se){if(jt(ge)!==null)throw ms(),Ci;ge=t}}function il(t=1){if(se){for(var e=t,r=ge;e--;)r=jt(r);ge=r}}function gs(){for(var t=0,e=ge;;){if(e.nodeType===an){var r=e.data;if(r===ds){if(t===0)return e;t-=1}else(r===tl||r===ya)&&(t+=1)}var n=jt(e);e.remove(),e=n}}function $h(t){if(!t||t.nodeType!==an)throw ms(),Ci;return t.data}m();m();m();m();function Dh(t){return t===this.v}function Lh(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function jh(t){return!Lh(t,this.v)}m();var _n=!1,Pi=!1,Qn=!1;m();m();m();var ru=null;function ei(t){let e=Error(),r=e.stack;if(!r)return null;let n=r.split(`
|
||||
`),i=[`
|
||||
`];for(let a=0;a<n.length;a++){let s=n[a];if(s!=="Error"){if(s.includes("validate_each_keys"))return null;s.includes("svelte/src/internal")||i.push(s)}}return i.length===1?null:(qt(e,"stack",{value:i.join(`
|
||||
`)}),qt(e,"name",{value:`${t}Error`}),e)}function sn(t,e){return t.label=e,Nh(t.v,e),t}function Nh(t,e){var r;return(r=t==null?void 0:t[Ih])==null||r.call(t,e),t}m();var ye=null;function ba(t){ye=t}var Mi=null;function Bh(t){Mi=t}var xn=null;function nu(t){xn=t}function tt(t,e=!1,r){ye={p:ye,c:null,e:null,s:t,x:null,l:Pi&&!e?{s:null,u:null,$:[]}:null},D&&(ye.function=r,xn=r)}function rt(t){var i;var e=ye,r=e.e;if(r!==null){e.e=null;for(var n of r)g1(n)}return t!==void 0&&(e.x=t),ye=e.p,D&&(xn=(i=ye==null?void 0:ye.function)!=null?i:null),t!=null?t:{}}function on(){return!Pi||ye!==null&&ye.l===null}m();m();m();var v1=new WeakMap;function y1(t){var e=ee;if(e===null)return oe.f|=8388608,t;if(D&&t instanceof Error&&!v1.has(t)&&v1.set(t,cG(t,e)),e.f&32768)al(t,e);else{if(!(e.f&128))throw!e.parent&&t instanceof Error&&$O(t),t;e.b.error(t)}}function al(t,e){for(;e!==null;){if(e.f&128)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t instanceof Error&&$O(t),t}function cG(t,e){var s,o,l;let r=_r(t,"message");if(!(r&&!r.configurable)){for(var n=iu?" ":" ",i=`
|
||||
${n}in ${((s=e.fn)==null?void 0:s.name)||"<unknown>"}`,a=e.ctx;a!==null;)i+=`
|
||||
${n}in ${(o=a.function)==null?void 0:o[rn].split("/").pop()}`,a=a.p;return{message:t.message+`
|
||||
${i}
|
||||
`,stack:(l=t.stack)==null?void 0:l.split(`
|
||||
`).filter(c=>!c.includes("svelte/src/internal")).join(`
|
||||
`)}}}function $O(t){let e=v1.get(t);e&&(qt(t,"message",{value:e.message}),qt(t,"stack",{value:e.stack}))}m();var au=[],w1=[];function DO(){var t=au;au=[],Jc(t)}function uG(){var t=w1;w1=[],Jc(t)}function Lr(t){au.length===0&&queueMicrotask(DO),au.push(t)}function LO(){au.length>0&&DO(),w1.length>0&&uG()}m();var ane=589952;function Uh(){for(var t=ee.b;t!==null&&!t.has_pending_snippet();)t=t.parent;return t===null&&pO(),t}m();m();var Ii=null;function S1(t){Ii=t}var ou=new Set;function vs(t){var e=2050,r=oe!==null&&oe.f&2?oe:null;ee===null||r!==null&&r.f&256?e|=256:ee.f|=524288;let n={ctx:ye,deps:null,effects:null,equals:Dh,f:e,fn:t,reactions:null,rv:0,v:qe,wv:0,parent:r!=null?r:ee,ac:null};return D&&Qn&&(n.created=ei("CreatedAt")),n}function E1(t,e){let r=ee;r===null&&mO();var n=r.b,i=void 0,a=jr(qe),s=null,o=!oe;return jO(()=>{var h;D&&(Ii=ee);try{var l=t()}catch(p){l=Promise.reject(p)}D&&(Ii=null);var c=()=>l;i=(h=s==null?void 0:s.then(c,c))!=null?h:Promise.resolve(l),s=i;var u=xe,f=n.pending;o&&(n.update_pending_count(1),f||u.increment());let d=(p,g=void 0)=>{s=null,Ii=null,f||u.activate(),g?g!==nl&&(a.f|=8388608,ri(a,g)):(a.f&8388608&&(a.f^=8388608),ri(a,p),D&&e!==void 0&&(ou.add(a),setTimeout(()=>{ou.has(a)&&(PO(a.label,e),ou.delete(a))}))),o&&(n.update_pending_count(-1),f||u.decrement()),Vh()};if(i.then(d,p=>d(null,p||"unknown")),u)return()=>{queueMicrotask(()=>u.neuter())}}),D&&(a.f|=4194304),new Promise(l=>{function c(u){function f(){u===i?l(a):c(i)}u.then(f,f)}c(i)})}function Ct(t){let e=vs(t);return qh(e),e}function ys(t){let e=vs(t);return e.equals=jh,e}function Gh(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)At(e[r])}}var _1=[];function fG(t){for(var e=t.parent;e!==null;){if(!(e.f&2))return e;e=e.parent}return null}function lu(t){var e,r=ee;if(Nt(fG(t)),D){let n=ws;x1(new Set);try{_1.includes(t)&&gO(),_1.push(t),Gh(t),e=zh(t)}finally{Nt(r),x1(n),_1.pop()}}else try{Gh(t),e=zh(t)}finally{Nt(r)}return e}function A1(t){var e=lu(t);if(t.equals(e)||(t.v=e,t.wv=cu()),!Sn)if(_a!==null)_a.set(t,t.v);else{var r=(Fi||t.f&256)&&t.deps!==null?4096:1024;mt(t,r)}}function Wh(t,e,r){let n=on()?vs:ys;if(e.length===0){r(t.map(n));return}var i=xe,a=ee,s=dG(),o=Uh();Promise.all(e.map(l=>E1(l))).then(l=>{i==null||i.activate(),s();try{r([...t.map(n),...l])}catch(c){a.f&16384||al(c,a)}i==null||i.deactivate(),Vh()}).catch(l=>{o.error(l)})}function dG(){var t=ee,e=oe,r=ye;return function(){Nt(t),kt(e),ba(r),D&&S1(null)}}function Vh(){Nt(null),kt(null),ba(null),D&&S1(null)}var uu=new Set,xe=null,fu=null,_a=null,b1=new Set,Kh=[];function BO(){let t=Kh.shift();Kh.length>0&&queueMicrotask(BO),t()}var _s=[],Qh=null,k1=!1,Yh=!1,ol,ll,xa,du,hu,bs,cl,Sa,Ea,ul,pu,mu,An,HO,Xh,T1,Zh=class Zh{constructor(){yt(this,An);vt(this,"current",new Map);yt(this,ol,new Map);yt(this,ll,new Set);yt(this,xa,0);yt(this,du,null);yt(this,hu,!1);yt(this,bs,[]);yt(this,cl,[]);yt(this,Sa,[]);yt(this,Ea,[]);yt(this,ul,[]);yt(this,pu,[]);yt(this,mu,[]);vt(this,"skipped_effects",new Set)}process(e){var a;_s=[],fu=null;var r=null;if(uu.size>1){r=new Map,_a=new Map;for(let[s,o]of this.current)r.set(s,{v:s.v,wv:s.wv}),s.v=o;for(let s of uu)if(s!==this)for(let[o,l]of ue(s,ol))r.has(o)||(r.set(o,{v:o.v,wv:o.wv}),o.v=l)}for(let s of e)di(this,An,HO).call(this,s);if(ue(this,bs).length===0&&ue(this,xa)===0){di(this,An,T1).call(this);var n=ue(this,Sa),i=ue(this,Ea);It(this,Sa,[]),It(this,Ea,[]),It(this,ul,[]),fu=xe,xe=null,NO(n),NO(i),xe===null?xe=this:uu.delete(this),(a=ue(this,du))==null||a.resolve()}else di(this,An,Xh).call(this,ue(this,Sa)),di(this,An,Xh).call(this,ue(this,Ea)),di(this,An,Xh).call(this,ue(this,ul));if(r){for(let[s,{v:o,wv:l}]of r)s.wv<=l&&(s.v=o);_a=null}for(let s of ue(this,bs))$i(s);for(let s of ue(this,cl))$i(s);It(this,bs,[]),It(this,cl,[])}capture(e,r){ue(this,ol).has(e)||ue(this,ol).set(e,r),this.current.set(e,e.v)}activate(){xe=this}deactivate(){xe=null,fu=null;for(let e of b1)if(b1.delete(e),e(),xe!==null)break}neuter(){It(this,hu,!0)}flush(){_s.length>0?C1():di(this,An,T1).call(this),xe===this&&(ue(this,xa)===0&&uu.delete(this),this.deactivate())}increment(){It(this,xa,ue(this,xa)+1)}decrement(){if(It(this,xa,ue(this,xa)-1),ue(this,xa)===0){for(let e of ue(this,pu))mt(e,2048),ii(e);for(let e of ue(this,mu))mt(e,4096),ii(e);It(this,Sa,[]),It(this,Ea,[]),this.flush()}else this.deactivate()}add_callback(e){ue(this,ll).add(e)}settled(){var e;return((e=ue(this,du))!=null?e:It(this,du,dO())).promise}static ensure(){if(xe===null){let e=xe=new Zh;uu.add(xe),Yh||Zh.enqueue(()=>{xe===e&&e.flush()})}return xe}static enqueue(e){Kh.length===0&&queueMicrotask(BO),Kh.unshift(e)}};ol=new WeakMap,ll=new WeakMap,xa=new WeakMap,du=new WeakMap,hu=new WeakMap,bs=new WeakMap,cl=new WeakMap,Sa=new WeakMap,Ea=new WeakMap,ul=new WeakMap,pu=new WeakMap,mu=new WeakMap,An=new WeakSet,HO=function(e){var u;e.f^=1024;for(var r=e.first;r!==null;){var n=r.f,i=(n&96)!==0,a=i&&(n&1024)!==0,s=a||(n&8192)!==0||this.skipped_effects.has(r);if
Line truncated
|
||||
\r\f\xA0\v\uFEFF`];function b5(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var a=i.length,s=0;(s=n.indexOf(i,s))>=0;){var o=s+a;(s===0||w5.includes(n[s-1]))&&(o===n.length||w5.includes(n[o]))?n=(s===0?"":n.substring(0,s))+n.substring(o+1):s=o}}return n===""?null:n}m();function ot(t,e,r,n,i,a){var s=t.__className;if(se||s!==r||s===void 0){var o=b5(r,n,a);(!se||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=r}else if(a&&i!==a)for(var l in a){var c=!!a[l];(i==null||c!==!!i[l])&&t.classList.toggle(l,c)}return a}m();m();var zG=Symbol("class"),VG=Symbol("style"),qG=Symbol("is custom element"),WG=Symbol("is html");function ve(t,e,r,n){var i=YG(t);if(se&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){n||KG(t,e,r!=null?r:"");return}i[e]!==(i[e]=r)&&(e==="loading"&&(t[hO]=r),r==null?t.removeAttribute(e):typeof r!="string"&&XG(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function YG(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[qG]:t.nodeName.includes("-"),[WG]:t.namespaceURI===cO}}var _5=new Map;function XG(t){var e=_5.get(t.nodeName);if(e)return e;_5.set(t.nodeName,e=[]);for(var r,n=t,i=Element.prototype;i!==n;){r=u1(n);for(var a in r)r[a].set&&e.push(a);n=rl(n)}return e}function KG(t,e,r){var n;D&&(e==="srcset"&&ZG(t,r)||K1((n=t.getAttribute(e))!=null?n:"",r)||RO(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function K1(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function x5(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function ZG(t,e){var r=x5(t.srcset),n=x5(e);return n.length===r.length&&n.every(([i,a],s)=>a===r[s][1]&&(K1(r[s][0],i)||K1(i,r[s][0])))}m();m();m();var JG=Oh?()=>performance.now():()=>Date.now(),Cn={tick:t=>(Oh?requestAnimationFrame:ir)(t),now:()=>JG(),tasks:new Set};function S5(){let t=Cn.now();Cn.tasks.forEach(e=>{e.c(t)||(Cn.tasks.delete(e),e.f())}),Cn.tasks.size!==0&&Cn.tick(S5)}function E5(t){let e;return Cn.tasks.size===0&&Cn.tick(S5),{promise:new Promise(r=>{Cn.tasks.add(e={c:t,f:r})}),abort(){Cn.tasks.delete(e)}}}function up(t,e){ks(()=>{t.dispatchEvent(new CustomEvent(e))})}function rz(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("")}function A5(t){let e={},r=t.split(";");for(let n of r){let[i,a]=n.split(":");if(!i||a===void 0)break;let s=rz(i.trim());e[s]=a.trim()}return e}var nz=t=>t;function Pn(t,e,r,n){var E;var i=(t&1)!==0,a=(t&2)!==0,s=i&&a,o=(t&4)!==0,l=s?"both":i?"in":"out",c,u=e.inert,f=e.style.overflow,d,h;function p(){return ks(()=>{var S;return c!=null?c:c=r()(e,(S=n==null?void 0:n())!=null?S:{},{direction:l})})}var g={is_global:o,in(){var S;if(e.inert=u,!i){h==null||h.abort(),(S=h==null?void 0:h.reset)==null||S.call(h);return}a||d==null||d.abort(),up(e,"introstart"),d=Z1(e,p(),h,1,()=>{up(e,"introend"),d==null||d.abort(),d=c=void 0,e.style.overflow=f})},out(S){if(!a){S==null||S(),c=void 0;return}e.inert=!0,up(e,"outrostart"),h=Z1(e,p(),d,0,()=>{up(e,"outroend"),S==null||S()})},stop:()=>{d==null||d.abort(),h==null||h.abort()}},v=ee;if(((E=v.transitions)!=null?E:v.transitions=[]).push(g),i&&op){var y=o;if(!y){for(var b=v.parent;b&&b.f&65536;)for(;(b=b.parent)&&!(b.f&16););y=!b||(b.f&32768)!==0}y&&Tr(()=>{Ue(()=>g.in())})}}function Z1(t,e,r,n,i){var a=n===1;if(h1(e)){var s,o=!1;return Lr(()=>{if(!o){var v=e({direction:a?"in":"out"});s=Z1(t,v,r,n,i)}}),{abort:()=>{o=!0,s==null||s.abort()},deactivate:()=>s.deactivate(),reset:()=>s.reset(),t:()=>s.t()}}if(r==null||r.deactivate(),!(e!=null&&e.duration))return i(),{abort:ir,deactivate:ir,reset:ir,t:()=>n};let{delay:l=0,css:c,tick:u,easing:f=nz}=e;var d=[];if(a&&r===void 0&&(u&&u(0,1),c)){var h=A5(c(0,1));d.push(h,h)}var p=()=>1-n,g=t.animate(d,{duration:l,fill:"forwards"});return g.onfinish=()=>{var _;g.cancel();var v=(_=r==null?void 0:r.t())!=null?_:1-n;r==null||r.abort();var y=n-v,b=e.duration*Math.abs(y),E=[];if(b>0){var S=!1;if(c)for(var A=Math.ceil(b/16.666666666666668),k=0;k<=A;k+=1){var w=v+y*f(k/A),x=A5(c(w,1-w));E.push(x),S||(S=x.overflow==="hidden")}S&&(t.style.overflow="hidden"),p=()=>{var T=g.currentTime;return v+y*f(T/b)},u&&E5(()=>{if(g.playState!=="running")return!1;var T=p();return u(T,1-T),!0})}g=t.animate(E,{duration:b,fill:"forwards"}),g.onfinish=()=>{p=()=>n,u==null||u(n,1-n),i()}},{abort:()=>{g&&(g.cancel(),g.effect=null,g.onfinish=ir)},deactivate:()=>{i=ir},reset:()=>{n===0&&(u==null||u(1,0))},t:()=>p()}}m();m();function ey(t,e,r=e){var n=on(),i=new WeakSet;G1(t,"input",a=>{D&&t.type==="checkbox"&&p1();var s=a?t.defaultValue:t.value;if(s=J1(t)?Q1(s):s,r(s),xe!==null&&i.add(xe),n&&s!==(s=e())){var o=t.selectionStart,l=t.selectionEnd;t.value=s!=null?s:"",l!==null&&(t.selectionStart=o,t.se
Line truncated
|
||||
`:""}${(x=e.log.author)==null?void 0:x.name}
|
||||
${(0,sy.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)}
|
||||
${e.log.message}`},()=>({"is-collapsed":R(i)})]),ae(t,o),rt()}gt(["click"]);function Dz(t,e){e().catch(console.error)}var Lz=(t,e,r,n)=>{ie(e,!R(e)),(0,ly.setIcon)(r[0],R(e)?"list":"folder"),n(n().settings.treeStructure=R(e),!0),n().saveSettings()},jz=fe('<div class="tree-item nav-folder mod-root"></div>'),Nz=fe('<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>'),Bz={hash:"svelte-45h",code:""};function cy(t,e){tt(e,!0),Tn(t,Bz);let r=cn(e,"plugin",15),n=Pe(!1),i=Ne([]),a=Pe(void 0),s=Pe(Ne(r().settings.treeStructure)),o,l;Zt(()=>{l&&l.empty()}),o=e.view.app.workspace.on("obsidian-git:head-change",()=>void c().catch(console.error)),Zt(()=>{i.forEach(S=>(0,ly.setIcon)(S,S.getAttr("data-icon")))}),d5(()=>{e.view.app.workspace.offref(o)}),W1(()=>{let S=new IntersectionObserver(k=>{k[0].isIntersecting&&!R(n)&&u().catch(console.error)}),A=document.querySelector("#sentinel");return A&&S.observe(A),()=>{S.disconnect()}}),c().catch(console.error);function c(){return Ts(this,void 0,void 0,function*(){var S;if(!r().gitReady){ie(a,void 0);return}ie(n,!0);let A=r().gitManager instanceof Ce,k;((S=R(a)===null||R(a)===void 0?void 0:R(a).length)!==null&&S!==void 0?S:0)==0?k=A?50:10:k=R(a).length,ie(a,yield r().gitManager.log(void 0,!1,k),!0),ie(n,!1)})}function u(){return Ts(this,void 0,void 0,function*(){var S;if(!r().gitReady||R(a)===void 0)return;ie(n,!0);let k=r().gitManager instanceof Ce?50:10,w=yield r().gitManager.log(void 0,!1,k,(S=R(a).last())===null||S===void 0?void 0:S.hash);R(a).push(...w.slice(1)),ie(n,!1)})}var f=Nz(),d=G(f),h=G(d),p=G(h);p.__click=[Lz,s,i,r],Ze(p,S=>i[0]=S,()=>i==null?void 0:i[0]);var g=te(p,2);let v;g.__click=[Dz,c],Ze(g,S=>i[1]=S,()=>i==null?void 0:i[1]),H(h),H(d);var y=te(d,2),b=G(y);{var E=S=>{var A=jz();Vr(A,21,()=>R(a),zr,(k,w)=>{oy(k,{get view(){return e.view},get showTree(){return R(s)},get log(){return R(w)},get plugin(){return r()}})}),H(A),ae(S,A)};_e(b,S=>{R(a)&&S(E)})}il(4),H(y),H(f),Fe(S=>{ve(p,"data-icon",R(s)?"list":"folder"),v=ot(g,1,"clickable-icon nav-action-button",null,v,S)},[()=>({loading:R(n)})]),ae(t,f),rt()}gt(["click"]);var Su=class extends C5.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return Zr.type}getDisplayText(){return Zr.name}getIcon(){return Zr.icon}onClose(){return this._view&&ji(this._view),super.onClose()}reload(){this._view&&ji(this._view),this._view=Ta(cy,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};m();var P5=require("obsidian"),pp=class extends P5.FuzzySuggestModal{constructor(r,n){super(r.app);this.branches=n;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(r){return r}onChooseItem(r,n){this.resolve(r)}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};m();var $5=require("obsidian");m();var Ms=require("obsidian");m();var Au=require("obsidian");m();m();var Hz=Ot(R5()),Ca=require("obsidian");function Cs(t,e,r){let n=t.target;app.workspace.trigger("hover-link",{event:t,source:e.getViewType(),hoverParent:e,targetEl:n,linktext:r})}m();var M5=require("obsidian");var gl=class extends M5.Modal{constructor({app:r,path:n,filesToDeleteCount:i,filesToDiscardCount:a}){super(r);this.resolve=null;this.path=n,this.deleteCount=i,this.discardCount=a}openAndGetResult(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let r=this.deleteCount+this.discardCount,{contentEl:n,titleEl:i}=this,a="";this.path!=""&&(r>1?a=`files in "${this.path}"`:a=`"${this.path}"`),i.setText(`${this.discardCount==0?"Delete":"Discard"} ${a}`),this.deleteCount>0&&n.createEl("p").setText(`Are you sure you want to DELETE the ${Ic(this.deleteCount,"untracked file")}? They are deleted according to your Obsidian trash settting.`),this.discardCount>0&&n.createEl("p").setText(`Are you sure you want to discard ALL changes in ${Ic(this.discardCount,"tracked file")}?`);let s=n.createDiv({cls:"modal-button-container"});if(this.deleteCount>0){let l=s.createEl("button",{cls:"mod-warning",text:`${this.discardCount>0?"Discard":"Delete"} all ${Ic(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=s.createEl("button",{cls:"mod-warning",text:`Discard all ${Ic(this.discardCount,"tracked file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("discard"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.res
Line truncated
|
||||
`+a),this.refresh()}handleFileMenu(r,n,i,a){if(!this.gitReady||!this.settings.showFileMenu||!n)return;let s;if(typeof n=="string"?s=n:s=n.path,i=="file-explorer-context-menu"&&(r.addItem(o=>{o.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{n instanceof we.TFile?await this.stageFile(n):(await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(s,!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()=>{n instanceof we.TFile?await this.unstageFile(n):(await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(s,!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(s,n instanceof we.TFolder).catch(c=>this.displayError(c))})})),i=="git-source-control"){r.addItem(l=>{l.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(c=>{this.addFileToGitignore(s,n instanceof we.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;a==="obsidian-git:menu"&&o instanceof we.FileSystemAdapter&&(r.addItem(l=>{l.setTitle("Open in default app").setIcon("arrow-up-right").setSection("action").onClick(c=>{this.app.openWithDefaultApp(s)})}),r.addItem(l=>{l.setTitle("Show in system explorer").setIcon("arrow-up-right").setSection("action").onClick(c=>{window.electron.shell.showItemInFolder(L5.join(o.getBasePath(),s))})}))}}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,n;this.gitReady=!1,this.lineAuthoringFeature.deactivateFeature(),this.automaticsManager.unload(),(r=this.branchBar)==null||r.remove(),(n=this.statusBar)==null||n.remove(),this.statusBar=void 0,this.branchBar=void 0,this.gitManager.unload(),this.promiseQueue.clear();for(let i of this.intervalsToClear)window.clearInterval(i);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=gT(Xe,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return we.Platform.isDesktopApp}async init({fromReload:r=!1}){var n;if(this.settings.showStatusBar&&!this.statusBar){let i=this.addStatusBarItem();this.statusBar=new dh(i,this),this.intervalsToClear.push(window.setInterval(()=>{var a;return(a=this.statusBar)==null?void 0:a.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Ce(this),await this.gitManager.setGitInstance()):this.gitManager=new wn(this);let i=await this.gitManager.checkRequirements(),a=this.localStorage.getPausedAutomatics();switch(i){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new we.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}),we.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let s=this.addStatusBarItem();this.branchBar=new gp(s,this),this.intervalsToClear.push(window.setInterval(()=>{var o;return void((o=this.branchBar)==null?void 0:o.display().catch(console.error))},6e4))}await((n=this.branchBar)==null?void 0:n.display()),this.lineAuthoringFeature.conditionallyActivateBySettings(),this.app.workspace.trigger("obsidian-git:refresh"),this.app.workspace.trigger("obsidian-git:head-change"),!r&&this.settings.autoPullOnBoot&&!a&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),a||await this.automaticsManager.init(),a&&new we.Notice("Automatic routines are currently paused.");break;default:this.log("Something weird happened. The 'checkRequirements' result is "+i)}}catch(i){this.displayError(i),console.error(i)}}async createNewRepo(){try{await this.gitManager.init(),new we.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let n=await new ze(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(n){let i="Vault Root",a=await new ze(this,{options:this.gitManager instanceof wn?[i]:[],placeholder:"E
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(n==null?void 0:n.join(`
|
||||
`))}async editRemotes(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),i=await new ze(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(i){let a=await this.gitManager.getRemoteUrl(i),o=await new ze(this,{initialValue:a,placeholder:"Enter remote URL"}).openAndGetResult();if(o)return await this.gitManager.setRemote(i,vv(o)),i}}async selectRemoteBranch(){let r=await this.gitManager.getRemotes(),n;r.length===0&&(n=await this.editRemotes(),n==null&&(r=await this.gitManager.getRemotes()));let i=new ze(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),a=n!=null?n:await i.openAndGetResult();if(a){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(a);let s=await this.gitManager.getRemoteBranches(a),l=await new ze(this,{options:s,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult();return l==null?void 0:l.startsWith(a+"/")?l:`${a}/${l}`}}async removeRemote(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),i=await new ze(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();i&&await this.gitManager.removeRemote(i)}onActiveLeafChange(r){var s,o;let n=r==null?void 0:r.view;if(!(n!=null&&n.getState().file)&&!(n instanceof ls||n instanceof fs))return;let i=this.app.workspace.getLeavesOfType($t.type).first(),a=this.app.workspace.getLeavesOfType(Zr.type).first();if((s=i==null?void 0:i.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||s.removeClass("is-active"),(o=a==null?void 0:a.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||o.removeClass("is-active"),(r==null?void 0:r.view)instanceof ls||(r==null?void 0:r.view)instanceof fs){let l=r.view.state.bFile;this.lastDiffViewState=r.view.getState();let c;i&&r.view.state.aRef=="HEAD"?c=i.view.containerEl.querySelector(`div.staged div.tree-item-self[data-path='${l}']`):i&&r.view.state.aRef==""?c=i.view.containerEl.querySelector(`div.changes div.tree-item-self[data-path='${l}']`):a&&(c=a.view.containerEl.querySelector(`div.tree-item-self[data-path='${l}']`)),c==null||c.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,n=4*1e3){var i;(i=this.statusBar)==null||i.displayMessage(r.toLowerCase(),n),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!r.startsWith("No changes"))&&new we.Notice(r,5*1e3),this.log(r)}displayError(r,n=10*1e3){var a;if(r instanceof D5.Errors.UserCanceledError){new we.Notice("Aborted");return}let i;r instanceof Error?i=r:i=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new we.Notice(i.message,n),console.error(`${this.manifest.id}:`,i.stack),(a=this.statusBar)==null||a.displayMessage(i.message.toLowerCase(),n)}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 *)
|
||||
|
||||
js-sha256/src/sha256.js:
|
||||
(**
|
||||
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
||||
*
|
||||
* @version 0.9.0
|
||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||
* @copyright Chen, Yi-Cyuan 2014-2017
|
||||
* @license MIT
|
||||
*)
|
||||
|
||||
feather-icons/dist/feather.js:
|
||||
(*!
|
||||
Copyright (c) 2016 Jed Watson.
|
||||
Licensed under the MIT License (MIT), see
|
||||
http://jedwatson.github.io/classnames
|
||||
*)
|
||||
*/
|
||||
|
||||
/* nosourcemap */
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"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.35.2"
|
||||
}
|
||||
-629
@@ -1,629 +0,0 @@
|
||||
@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%;
|
||||
}
|
||||
|
||||
.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 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);
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-d-none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-wrapper {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-header {
|
||||
background-color: var(--background-primary);
|
||||
border-bottom: 1px solid var(--interactive-accent);
|
||||
font-family: var(--font-monospace);
|
||||
height: 35px;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-header,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-stats {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-stats {
|
||||
font-size: 14px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-lines-added {
|
||||
border: 1px solid #b4e2b4;
|
||||
border-radius: 5px 0 0 5px;
|
||||
color: #399839;
|
||||
padding: 2px;
|
||||
text-align: right;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-lines-deleted {
|
||||
border: 1px solid #e9aeae;
|
||||
border-radius: 0 5px 5px 0;
|
||||
color: #c33;
|
||||
margin-left: 1px;
|
||||
padding: 2px;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .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%;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-name {
|
||||
overflow-x: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-wrapper {
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
border-radius: 3px;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .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-modifier-border);
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
font-size: 12px;
|
||||
justify-content: flex-end;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse.d2h-selected {
|
||||
background-color: #c8e1ff;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse-input {
|
||||
margin: 0 4px 0 0;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-diff-table {
|
||||
border-collapse: collapse;
|
||||
font-family: Menlo, Consolas, monospace;
|
||||
font-size: 13px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-files-diff {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-diff {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-side-diff {
|
||||
display: inline-block;
|
||||
margin-bottom: -8px;
|
||||
margin-right: -4px;
|
||||
overflow-x: scroll;
|
||||
overflow-y: hidden;
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line {
|
||||
padding: 0 8em;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line,
|
||||
.workspace-leaf-content[data-type="diff-view"] .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%;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line {
|
||||
padding: 0 4.5em;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .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;
|
||||
white-space: pre;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
||||
.theme-light
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-code-side-line
|
||||
del {
|
||||
background-color: #ffb6ba;
|
||||
}
|
||||
|
||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
||||
.theme-dark
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-code-side-line
|
||||
del {
|
||||
background-color: #8d232881;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins {
|
||||
border-radius: 0.2em;
|
||||
display: inline-block;
|
||||
margin-top: -1px;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
||||
.theme-light
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-code-side-line
|
||||
ins {
|
||||
background-color: #97f295;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
||||
.theme-dark
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-code-side-line
|
||||
ins {
|
||||
background-color: #1d921996;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix {
|
||||
word-wrap: normal;
|
||||
background: none;
|
||||
display: inline;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .line-num1 {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .line-num1,
|
||||
.workspace-leaf-content[data-type="diff-view"] .line-num2 {
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
padding: 0 0.5em;
|
||||
text-overflow: ellipsis;
|
||||
width: 3.5em;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .line-num2 {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .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-muted);
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
text-align: right;
|
||||
width: 7.5em;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber:after {
|
||||
content: "\200b";
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .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-muted);
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
padding: 0 0.5em;
|
||||
position: absolute;
|
||||
text-align: right;
|
||||
text-overflow: ellipsis;
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-diff-tbody tr {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber:after {
|
||||
content: "\200b";
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-emptyplaceholder,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder {
|
||||
background-color: var(--background-primary);
|
||||
border-color: var(--background-modifier-border);
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber,
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber {
|
||||
direction: rtl;
|
||||
}
|
||||
|
||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-del {
|
||||
background-color: #fee8e9;
|
||||
border-color: #e9aeae;
|
||||
}
|
||||
|
||||
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-ins {
|
||||
background-color: #dfd;
|
||||
border-color: #b4e2b4;
|
||||
}
|
||||
|
||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-del {
|
||||
background-color: #521b1d83;
|
||||
border-color: #691d1d73;
|
||||
}
|
||||
|
||||
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-ins {
|
||||
background-color: rgba(30, 71, 30, 0.5);
|
||||
border-color: #13501381;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-info {
|
||||
background-color: var(--background-primary);
|
||||
border-color: var(--background-modifier-border);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.theme-light
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-file-diff
|
||||
.d2h-del.d2h-change {
|
||||
background-color: #fdf2d0;
|
||||
}
|
||||
|
||||
.theme-dark
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-file-diff
|
||||
.d2h-del.d2h-change {
|
||||
background-color: #55492480;
|
||||
}
|
||||
|
||||
.theme-light
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-file-diff
|
||||
.d2h-ins.d2h-change {
|
||||
background-color: #ded;
|
||||
}
|
||||
|
||||
.theme-dark
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-file-diff
|
||||
.d2h-ins.d2h-change {
|
||||
background-color: rgba(37, 78, 37, 0.418);
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a {
|
||||
color: #3572b0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"]
|
||||
.d2h-file-list-wrapper
|
||||
a:visited {
|
||||
color: #3572b0;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-header {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-title {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-line {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list {
|
||||
display: block;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li {
|
||||
border-bottom: 1px solid var(--background-modifier-border);
|
||||
margin: 0;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-file-switch {
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-icon {
|
||||
fill: currentColor;
|
||||
margin-right: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-deleted {
|
||||
color: #c33;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-added {
|
||||
color: #399839;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-changed {
|
||||
color: #d0b44c;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-moved {
|
||||
color: #3572b0;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-tag {
|
||||
background-color: var(--background-primary);
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
font-size: 10px;
|
||||
margin-left: 5px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-deleted-tag {
|
||||
border: 2px solid #c33;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-added-tag {
|
||||
border: 1px solid #399839;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-changed-tag {
|
||||
border: 1px solid #d0b44c;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="diff-view"] .d2h-moved-tag {
|
||||
border: 1px solid #3572b0;
|
||||
}
|
||||
|
||||
/* ====================== 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 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 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);
|
||||
}
|
||||
Vendored
-215
@@ -1,215 +0,0 @@
|
||||
{
|
||||
"main": {
|
||||
"id": "1f8a86ae27094649",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "7e50e890b482753e",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "e36b18dd0ea7f8c6",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "empty",
|
||||
"state": {},
|
||||
"icon": "lucide-file",
|
||||
"title": "New tab"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
},
|
||||
"left": {
|
||||
"id": "6e06aa2d9b5d5fe0",
|
||||
"type": "mobile-drawer",
|
||||
"children": [
|
||||
{
|
||||
"id": "c519fe3d7f1e41a5",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "file-explorer",
|
||||
"state": {
|
||||
"sortOrder": "alphabetical",
|
||||
"autoReveal": false
|
||||
},
|
||||
"icon": "lucide-folder-closed",
|
||||
"title": "Files"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "c5ad7ed997c8604b",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "search",
|
||||
"state": {
|
||||
"query": "",
|
||||
"matchingCase": false,
|
||||
"explainSearch": false,
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical"
|
||||
},
|
||||
"icon": "lucide-search",
|
||||
"title": "Search"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "3b077185f1f396a7",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "tag",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"useHierarchy": true,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-tags",
|
||||
"title": "Tags"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "5a00bf856cbd5b6e",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "all-properties",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-archive",
|
||||
"title": "All properties"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "6185c438a9b9df1f",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "bookmarks",
|
||||
"state": {},
|
||||
"icon": "lucide-bookmark",
|
||||
"title": "Bookmarks"
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 0
|
||||
},
|
||||
"right": {
|
||||
"id": "d168953c11984c95",
|
||||
"type": "mobile-drawer",
|
||||
"children": [
|
||||
{
|
||||
"id": "55460c259cc5208d",
|
||||
"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": "ebf0c19e13771b49",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
},
|
||||
"icon": "links-going-out",
|
||||
"title": "Outgoing links"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "38083d4f18914d01",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"followCursor": false,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-list",
|
||||
"title": "Outline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "9421dd745d6a80f9",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "git-view",
|
||||
"state": {},
|
||||
"icon": "git-pull-request",
|
||||
"title": "Source Control"
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 3
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
"graph:Open graph view": true,
|
||||
"command-palette:Open command palette": false,
|
||||
"obsidian-git:Open Git source control": false
|
||||
}
|
||||
},
|
||||
"active": "e36b18dd0ea7f8c6",
|
||||
"lastOpenFiles": [
|
||||
"sin x = 2.md",
|
||||
"index.md",
|
||||
"Vieta’s Formulas.md",
|
||||
"Vectors.md",
|
||||
"Totient Function.md",
|
||||
"The Basel Problem.md",
|
||||
"Taylor Series Proof.md",
|
||||
"Skip Gram.md",
|
||||
"Rational Root Theorem.md",
|
||||
"Probability of Choosing 2 Coprime Numbers.md",
|
||||
"Poisson Distribution.md",
|
||||
"Pascal’s Triangle and Binomial Coefficients.md",
|
||||
"Matrices.md",
|
||||
"Limits.md",
|
||||
"Leibniz Integral Rule.md",
|
||||
"Laplace Transforms.md",
|
||||
"Hyperbolic Trig.md",
|
||||
"Hockey Stick Identity.md",
|
||||
"Fourier Series in Terms of e.md",
|
||||
"Fourier Series Proof.md",
|
||||
"Fermet Euler Theorem.md",
|
||||
"Fermat’s Little Theorem.md",
|
||||
"Euler's Formula and Complex Trig Functions.md",
|
||||
"Epsilon Delta Definition of a Limit.md",
|
||||
"Deriving the Gamma Function.md",
|
||||
"Derivatives.md",
|
||||
"/Engineering a Lock In",
|
||||
"/Notes/WIP Notes",
|
||||
"/Notes",
|
||||
"Untitled",
|
||||
"Config/settings/vscode_craisin_theme.json",
|
||||
"Config/settings/colors.properties",
|
||||
"Config/pictures/pfp_rounded.png",
|
||||
"Config/pictures/pfp.png",
|
||||
"Config/pictures/backdrops/wallpaper.png",
|
||||
"Config/pictures/backdrops/backdrop_exponential.png",
|
||||
"Config/pictures/backdrops/backdrop_craisin.png",
|
||||
"Config/pictures/backdrops/backdrop_bright_craisin.png",
|
||||
"Books/Mindset/Mindset.pdf",
|
||||
"Books/5 AM Club/The-5-AM-Club.pdf",
|
||||
"Projects",
|
||||
"Notes/WIP Notes"
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user