first commit

This commit is contained in:
admin committed 2026-11-05 14:35:04 +08:00
commit 669f49b1d6
342 files changed
+320811

No files matched your search

+4459
View File
File diff suppressed because it is too large. Load diff
+10
View File
@@ -0,0 +1,10 @@
{
"id": "calendar",
"name": "Calendar",
"description": "Calendar view of your daily notes",
"version": "1.5.10",
"author": "Liam Cain",
"authorUrl": "https://github.com/liamcain/",
"isDesktopOnly": false,
"minAppVersion": "0.9.11"
}
+15
View File
@@ -0,0 +1,15 @@
{
"tabManagerState": {
"openTabs": [
{
"tabId": "tab-1790230906647-bdp9fo0",
"conversationId": "conv-1790230972593-xkxrhxtlt"
},
{
"tabId": "tab-1792499072703-j0vs5hc",
"conversationId": "conv-1792499091640-puj4m9hak"
}
],
"activeTabId": "tab-1792499072703-j0vs5hc"
}
}
+104585
View File
File diff suppressed because it is too large. Load diff
+10
View File
@@ -0,0 +1,10 @@
{
"id": "realclaudian",
"name": "Claudian",
"version": "2.0.24",
"minAppVersion": "1.7.2",
"description": "Embeds Claude Code, Codex, and other coding agents as AI collaborators in your vault. Your vault becomes their working directory, giving them capabilities for file reads and writes, search, bash commands, and multi-step workflows.",
"author": "Yishen Tu",
"authorUrl": "https://github.com/YishenTu",
"isDesktopOnly": true
}
File diff suppressed because it is too large. Load diff
+76
View File
@@ -0,0 +1,76 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
"use strict";var Ee=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var pt=Object.getOwnPropertyNames;var gt=Object.prototype.hasOwnProperty;var mt=(l,i)=>{for(var e in i)Ee(l,e,{get:i[e],enumerable:!0})},ft=(l,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of pt(i))!gt.call(l,r)&&r!==e&&Ee(l,r,{get:()=>i[r],enumerable:!(t=ht(i,r))||t.enumerable});return l};var _t=l=>ft(Ee({},"__esModule",{value:!0}),l);var Pt={};mt(Pt,{default:()=>Te});module.exports=_t(Pt);var ut=require("obsidian");var Fe={vocabularyBooks:[],showDefinitionOnHover:!0,enableAutoHighlight:!0,highlightStyle:"underline",enableMasteredFeature:!0,showMasteredInSidebar:!0,blurDefinitions:!1,ttsTemplate:"https://dict.youdao.com/dictvoice?audio={{word}}&type=2",aiDictionary:{apiUrl:"",apiKey:"",model:"",prompt:`Please provide a concise definition for the word "{{word}}" based on this context:
Sentence: {{sentence}}
Format:
1) Part of speech
2) English definition
3) Chinese translation
4) Example sentence (use the original sentence if appropriate)`,extraParams:"{}"},autoLayoutEnabled:!0,cardWidth:260,cardHeight:120,highlightMode:"all",highlightPaths:"",fileNodeParseMode:"filename-with-alias",enableSectionTabs:!0,enableSelectionTranslate:!1,translateTargetLang:"zh-CN",translatePrompt:`Translate the following text to {{to}}. Only return the translation, no explanation.
Text: {{text}}`};var U=class{constructor(){this.root=new te}addWord(i,e){let t=this.root,r=i.toLowerCase();for(let a of r)t.children.has(a)||t.children.set(a,new te),t=t.children.get(a);t.isEndOfWord=!0,t.payload=e,t.word=i}findAllMatches(i){let e=[],t=i.toLowerCase();for(let r=0;r<t.length;r++){let a=this.root,s=r;for(;s<t.length&&a.children.has(t[s]);)if(a=a.children.get(t[s]),s++,a.isEndOfWord){let o=t[r],n=t[s-1],c=ze(o)||r===0||!Ve(t[r-1]),u=ze(n)||s===t.length||!Ve(t[s]);c&&u&&e.push({word:a.word||t.substring(r,s),from:r,to:s,payload:a.payload})}}return e}clear(){this.root=new te}},te=class{constructor(){this.children=new Map,this.isEndOfWord=!1,this.payload=null,this.word=null}};function Ve(l){return/[a-z0-9\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/iu.test(l)}function ze(l){return/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(l)}function R(l,i="var(--color-accent)"){return l?{1:"var(--color-red)",2:"var(--color-orange)",3:"var(--color-yellow)",4:"var(--color-green)",5:"var(--color-cyan)",6:"var(--color-purple)",red:"var(--color-red)",orange:"var(--color-orange)",yellow:"var(--color-yellow)",green:"var(--color-green)",cyan:"var(--color-cyan)",blue:"var(--color-blue)",purple:"var(--color-purple)",pink:"var(--color-pink)",gray:"var(--color-base-60)",grey:"var(--color-base-60)",white:"var(--color-base-00)",black:"var(--color-base-100)"}[l.toLowerCase()]||l:i}function Be(l,i=.1){return l.startsWith("var(--color-")?`color-mix(in srgb, ${l} ${i*100}%, transparent)`:l.startsWith("#")||l.startsWith("rgb")||l.startsWith("hsl")?`color-mix(in srgb, ${l} ${i*100}%, transparent)`:l}var Ce=null;function vt(l,i){if(!l||!i)return null;let e=encodeURIComponent(i.trim());return l.split("{{word}}").join(e)}async function he(l,i){let e=vt(l.settings.ttsTemplate,i);if(e)try{Ce||(Ce=new Audio);let t=Ce;t.src=e,await t.play()}catch(t){console.warn("HiWords TTS play failed:",t)}}function Re(l){let i=l.trim();return i.includes("...")?{isPattern:!0,parts:i.split("...").map(t=>t.trim()).filter(t=>t.length>0),original:i}:{isPattern:!1,parts:[i],original:i}}function bt(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pe(l,i,e=0){let t=[];if(i.length===0)return t;if(i.length===1){let o=new RegExp(`\\b${bt(i[0])}\\b`,"gi"),n;for(;(n=o.exec(l))!==null;)t.push({from:e+n.index,to:e+n.index+n[0].length,matchedText:n[0],segments:[{from:e+n.index,to:e+n.index+n[0].length}]});return t}let r=l.toLowerCase(),a=i.map(o=>o.toLowerCase()),s=0;for(;s<l.length;){let o=r.indexOf(a[0],s);if(o===-1)break;if(!Oe(l,o,o+i[0].length)){s=o+1;continue}let n=[];n.push({from:e+o,to:e+o+i[0].length});let c=o+i[0].length,u=!0;for(let h=1;h<i.length;h++){let p=wt(l,c),m=l.substring(c,p).toLowerCase().indexOf(a[h]);if(m===-1){u=!1;break}let v=c+m;if(!Oe(l,v,v+i[h].length)){u=!1;break}n.push({from:e+v,to:e+v+i[h].length}),c=v+i[h].length}if(u){let h=o,p=c;t.push({from:e+h,to:e+p,matchedText:l.substring(h,p),segments:n})}s=o+1}return t}function wt(l,i){let e=[".",",","!","?",";",":",`
`],t=l.length;for(let r of e){let a=l.indexOf(r,i);a!==-1&&a<t&&(t=a)}return t}function Oe(l,i,e){let t=i>0?l[i-1]:" ",r=e<l.length?l[e]:" ",a=h=>/[a-z0-9\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/iu.test(h),s=h=>/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(h),o=l[i],n=l[e-1],c=s(o)||!a(t),u=s(n)||!a(r);return c&&u}function Se(l,i){let e=i.highlightMode||"all";if(e==="all")return!0;let r=(i.highlightPaths||"").split(",").map(o=>o.trim()).filter(o=>o.length>0);if(r.length===0)return e==="exclude";let a=l.replace(/^\/+|\/+$/g,""),s=r.some(o=>{let n=o.replace(/^\/+|\/+$/g,"");return a===n||a.startsWith(n+"/")});return e==="exclude"?!s:e==="include"?s:!0}function ge(l){let i=l.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,t=window.innerWidth||document.documentElement.clientWidth;return i.bottom>0&&i.right>0&&i.top<e&&i.left<t}function xe(l){return!l.closest('.workspace-leaf-content[data-type="hover-editor"]')&&!l.closest('.workspace-leaf-content[data-type="file-explorer"]')&&!l.closest('.workspace-leaf-content[data-type="outline"]')&&!l.closest('.workspace-leaf-content[data-type="backlink"]')&&!l.closest('.workspace-leaf-content[data-type="tag"]')&&!l.closest('.workspace-leaf-content[data-type="search"]')&&!l.closest(".hover-popover")&&!l.closest(".popover")&&!l.closest(".suggestion-container")&&!l.closest(".modal")&&!l.closest(".workspace-split.mod-right-split")&&!l.closest(".workspace-split.mod-left-split")}function qe(l){l.querySelectorAll(".hi-words-highlight").forEach(e=>{var r;let t=document.createTextNode(e.textContent||"");(r=e.parentNode)==null||r.replaceChild(t,e)}),l.normalize()}function j(l){let i=new U,e=l.getAllWordsForHighlight();for(let t of e){let r=l.getDefinition(t);r&&i.addWord(t,r)}return i}function Ge(l){let i=null,e=["pre","code","a","button","input","textarea","select",".math",".cm-inline-code",".internal-embed",".file-embed",".hi-words-tooltip"].join(","),t=(r,a)=>{let s=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,{acceptNode:u=>{let h=u.parentElement,p=h!=null?h:null;return!p||p.closest(e)||p.closest(".hi-words-highlight")||!u.nodeValue||!u.nodeValue.trim()?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),o=l.settings.highlightStyle||"underline",n=[],c=s.nextNode();for(;c;)n.push(c),c=s.nextNode();for(let u of n){let h=u.nodeValue||"";if(!h)continue;let p=a.findAllMatches(h);if(!p||p.length===0)continue;p.sort((_,b)=>_.from-b.from||b.to-b.from-(_.to-_.from));let g=[],f=0;for(let _ of p)_.from>=f&&(g.push(_),f=_.to);if(g.length===0)continue;let m=document.createDocumentFragment(),v=0;for(let _ of g){_.from>v&&m.appendChild(document.createTextNode(h.slice(v,_.from)));let b=_.payload,y=R(b==null?void 0:b.color,"var(--color-base-60)"),T=document.createElement("span");T.className="hi-words-highlight",T.setAttribute("data-word",_.word),b!=null&&b.definition&&T.setAttribute("data-definition",b.definition),y&&T.setAttribute("data-color",y),T.setAttribute("data-style",o),y&&T.setAttribute("style",`--word-highlight-color: ${y}`),T.textContent=h.slice(_.from,_.to),m.appendChild(T),v=_.to}v<h.length&&m.appendChild(document.createTextNode(h.slice(v))),u.parentNode&&u.parentNode.replaceChild(m,u)}};l.registerMarkdownPostProcessor((r,a)=>{try{if(!l.settings.enableAutoHighlight)return;let s=a==null?void 0:a.sourcePath;if(s&&!l.shouldHighlightFile(s)||!xe(r))return;let o=j(l.vocabularyManager);i=t,t(r,o)}catch(s){console.error("\u9605\u8BFB\u6A21\u5F0F\u9AD8\u4EAE\u5904\u7406\u5931\u8D25:",s)}}),l._refreshReadingModeHighlighter=()=>{yt(l,i)}}function yt(l,i){if(!(!l.settings.enableAutoHighlight||!i))try{let e=j(l.vocabularyManager);document.querySelectorAll(".markdown-preview-view .markdown-preview-sizer").forEach(r=>{let a=r;xe(a)&&ge(a)&&(qe(a),i(a,e))})}catch(e){console.error("\u5237\u65B0\u9605\u8BFB\u6A21\u5F0F\u9AD8\u4EAE\u5931\u8D25:",e)}}function Ue(l){let i=new WeakSet,e=null,t=(n,c)=>{if(!i.has(n)){i.add(n);try{$e(n,c,l.settings.highlightStyle||"underline")}catch(u){console.error("PDF \u6587\u672C\u5C42\u9AD8\u4EAE\u5904\u7406\u5931\u8D25:",u)}}},r=()=>{e&&window.clearTimeout(e),e=window.setTimeout(()=>{if(!l.settings.enableAutoHighlight)return;let n=l.app.workspace.getActiveFile();if(n&&!l.shouldHighlightFile(n.path))return;let c=j(l.vocabularyManager);document.querySelectorAll(".textLayer").forEach(h=>{h.closest(".pdf-container, .mod-pdf")&&t(h,c)}),e=null},300)},a=()=>{let n=new MutationObserver(c=>{let u=!1;c.forEach(h=>{h.addedNodes.forEach(p=>{if(p.nodeType===Node.ELEMENT_NODE){let g=p;(g.classList.contains("textLayer")||g.querySelector(".textLayer"))&&(u=!0),g.classList.contains("page")&&g.closest(".pdf-container, .mod-pdf")&&(u=!0)}})}),u&&r()});return n.observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}),n};l.registerEvent(l.app.workspace.on("layout-change",()=>{setTimeout(()=>{r()},500)})),l.registerEvent(l.app.workspace.on("active-leaf-change",n Line truncated
---`);if(e!==-1)return i.slice(e+4).replace(/^\r?\n/,"")}return i}parseSections(i){if(!i)return[];let e=i.split(/\n\s*---\s*\n/),t=[];for(let r of e){let a=r.trim();if(!a)continue;let s=a.split(`
`),n=s[0].trim().match(/^\*\*(.+?)\*\*$/);if(n){t.push({title:n[1].trim(),content:s.slice(1).join(`
`).trim()});continue}t.push({title:t.length===0?"\u91CA\u4E49":`\u5185\u5BB9 ${t.length+1}`,content:a})}return t}async parseCanvasFile(i){var e,t;try{let r=await this.app.vault.cachedRead(i),a=JSON.parse(r),s=(t=(e=this.settings)==null?void 0:e.masteredDetection)!=null?t:"group",o=s==="group"?a.nodes.find(c=>c.type==="group"&&(c.label==="Mastered"||c.label==="\u5DF2\u638C\u63E1")):void 0,n=[];for(let c of a.nodes)if(c.type==="text"&&c.text){let u=this.parseTextNode(c,i.path);u&&(s==="group"?o&&this.isNodeInGroup(c,o)&&(u.mastered=!0):s==="color"&&c.color==="4"&&(u.mastered=!0),n.push(u))}else if(c.type==="file"&&c.file){let u=await this.parseFileNode(c,i.path);u&&(s==="group"?o&&this.isNodeInGroup(c,o)&&(u.mastered=!0):s==="color"&&c.color==="4"&&(u.mastered=!0),n.push(u))}return n}catch(r){return console.error(`Failed to parse canvas file ${i.path}:`,r),[]}}parseFromText(i,e,t){if(!i)return null;i=this.removeFrontmatter(i).trim();let r="",a=[],s="";try{let o=i.split(`
`);if(o.length===0||(r=o[0].replace(/^#+\s*/,"").trim(),r=this.removeMarkdownFormatting(r),!r))return null;if(o.length>1){let p=-1,g=-1;for(let f=1;f<o.length;f++){let m=o[f].trim();if(m.startsWith("*")&&m.endsWith("*")&&m.length>2&&!m.startsWith("**")&&!m.endsWith("**")){let _=m.slice(1,-1).split(",").map(b=>b.trim()).filter(b=>b);a.push(..._),p=f}else if(m!==""){g=f;break}}if(g>0&&g<o.length){for(;g<o.length&&o[g].trim()==="";)g++;g<o.length&&(s=o.slice(g).join(`
`).trim())}else p===-1&&(s=o.slice(1).join(`
`).trim())}if(!r)return null;let n=Re(r),c=s,u;return s&&s.includes(`
---
`)&&(u=this.parseSections(s),u.length>0&&(s=u[0].content)),{word:n.isPattern?n.original:r.toLowerCase(),aliases:a.length>0?a:void 0,definition:s,rawDefinition:c||s,sections:u,source:t,nodeId:e.id,color:e.color,isPattern:n.isPattern,patternParts:n.isPattern?n.parts:void 0}}catch(o){return console.error(`\u89E3\u6790\u8282\u70B9\u6587\u672C\u65F6\u51FA\u9519: ${o}`),null}}parseTextNode(i,e){return i.text?this.parseFromText(i.text,i,e):null}async parseFileNode(i,e){var t;try{let r=i.file;if(!r)return null;let a=this.app.vault.getAbstractFileByPath(r);if(!(a instanceof Ke.TFile)||a.extension!=="md")return null;let s=((t=this.settings)==null?void 0:t.fileNodeParseMode)||"filename-with-alias",o=a.basename;if(s==="filename")return{word:o,aliases:[],definition:"",source:e,nodeId:i.id,color:i.color,mastered:!1};let n=await this.app.vault.cachedRead(a);if(s==="content")return this.parseFromText(n,i,e);if(s==="filename-with-alias"){let c=this.parseFromText(n,i,e);if(c&&c.word){let u=c.word,h=c.aliases||[],p=u!==o?[u,...h]:h;return{...c,word:o,aliases:p}}return{word:o,aliases:[],definition:"",source:e,nodeId:i.id,color:i.color,mastered:!1}}return null}catch(r){return console.error("\u89E3\u6790\u6587\u4EF6\u8282\u70B9\u5931\u8D25:",r),null}}static isCanvasFile(i){return i.extension==="canvas"}async validateCanvasFile(i){var e;try{let t=await this.app.vault.cachedRead(i),r=(e=t==null?void 0:t.trim())!=null?e:"";if(r==="")return!0;let a=JSON.parse(r),s=!("nodes"in a)||Array.isArray(a.nodes),o=!("edges"in a)||Array.isArray(a.edges);return s&&o}catch(t){return!0}}isNodeInGroup(i,e){let t=typeof i.x=="number"?i.x:0,r=typeof i.y=="number"?i.y:0,a=typeof i.width=="number"?i.width:200,s=typeof i.height=="number"?i.height:60,o=typeof e.x=="number"?e.x:0,n=typeof e.y=="number"?e.y:0,c=typeof e.width=="number"?e.width:300,u=typeof e.height=="number"?e.height:150,h=t,p=t+a,g=r,f=r+s,m=o,v=o+c,_=n,b=n+u;if(!(h>=m&&p<=v&&g>=_&&f<=b)){if(h<v&&p>m&&g<b&&f>_){let P=Math.max(h,m),F=Math.min(p,v),V=Math.max(g,_),E=Math.min(f,b),M=(F-P)*(E-V),W=a*s;return M>=W*.5}return!1}return!0}};var Ct=50,St=50,Ye=260,Qe=120,Je=20,Xe=3,me=24,fe=12,ie=2;function q(l,i,e){var o,n;if(!i.autoLayoutEnabled)return;let t=(o=i.cardWidth)!=null?o:Ye,r=(n=i.cardHeight)!=null?n:Qe,a=l.nodes.find(c=>c.type==="group"&&c.label==="Mastered"),s=l.nodes.filter(c=>!(c.type==="group"||a&&e.isNodeInGroup(c,a)));if(s.length!==0)for(let c=0;c<s.length;c++){let u=s[c],h=c%Xe,p=Math.floor(c/Xe);u.x=Ct+h*(t+Je),u.y=St+p*(r+Je),u.width=t,u.height=r}}function ke(l,i,e,t){var u,h;let r=(u=e.cardWidth)!=null?u:Ye,a=(h=e.cardHeight)!=null?h:Qe,s=l.nodes.filter(p=>p.type!=="group"&&t.isNodeInGroup(p,i));if(s.length===0)return;for(let p=0;p<s.length;p++){let g=s[p],f=p%ie,m=Math.floor(p/ie);g.x=i.x+me+f*(r+fe),g.y=i.y+me+m*(a+fe),g.width=r,g.height=a}let o=Math.ceil(s.length/ie),n=me*2+ie*r+(ie-1)*fe,c=me*2+o*a+(o-1)*fe;i.width=Math.max(i.width,n),i.height=Math.max(i.height,c)}var ae=class{constructor(i,e){this.app=i,this.settings=e}updateSettings(i){this.settings=i}genHex16(){let i=new Uint8Array(8);return(window.crypto||window.msCrypto).getRandomValues(i),Array.from(i,e=>e.toString(16).padStart(2,"0")).join("")}async addWordToCanvas(i,e,t,r,a){try{let s=this.app.vault.getAbstractFileByPath(i);if(!s||!(s instanceof re.TFile)||!k.isCanvasFile(s))return console.error(`\u65E0\u6548\u7684 Canvas \u6587\u4EF6: ${i}`),null;a&&(a=a.filter(c=>c&&c.trim().length>0),a.length===0&&(a=void 0));let o=new k(this.app,this.settings),n="";return await this.app.vault.process(s,c=>{var M,W;let u=JSON.parse(c||'{"nodes":[],"edges":[]}');Array.isArray(u.nodes)||(u.nodes=[]);let h=this.genHex16();n=h;let p=(M=this.settings.cardWidth)!=null?M:260,g=(W=this.settings.cardHeight)!=null?W:120,f=20,m=24,v=(C,x)=>typeof C=="number"?C:x,_=C=>({x:v(C.x,0),y:v(C.y,0),w:v(C.width,200),h:v(C.height,60)}),b=(C,x,A,O)=>C<A+O&&C+x>A,y=u.nodes.find(C=>C.type==="group"&&C.label&&(C.label==="Mastered"||C.label==="\u5DF2\u638C\u63E1")),T=y?_(y):void 0,P=0,F=0;if(u.nodes.length>0){let C;for(let x=u.nodes.length-1;x>=0;x--){let A=u.nodes[x];if(A.type!=="group"){if(T){let O=_(A),L=b(O.x,O.w,T.x,T.w),ee=b(O.y,O.h,T.y,T.h);if(L&&ee)continue}C=A;break}}if(C){let x=_(C);P=x.x,F=x.y+x.h+f}}T&&b(P,p,T.x,T.w)&&(P=T.x+T.w+m);let V=e;a&&a.length>0&&(V=`${e}
*${a.join(", ")}*`),t&&(V=`${V}
${t}`);let E={id:h,type:"text",x:P,y:F,width:p,height:g,text:V,color:r!==void 0?r.toString():void 0};return u.nodes.push(E),q(u,this.settings,o),JSON.stringify(u)}),n}catch(s){return console.error(`\u6DFB\u52A0\u8BCD\u6C47\u5230 Canvas \u5931\u8D25: ${s}`),null}}async updateWordInCanvas(i,e,t,r,a,s){try{let o=this.app.vault.getAbstractFileByPath(i);if(!o||!(o instanceof re.TFile)||!k.isCanvasFile(o))return console.error(`\u65E0\u6548\u7684 Canvas \u6587\u4EF6: ${i}`),!1;s&&(s=s.filter(u=>u&&u.trim().length>0),s.length===0&&(s=void 0));let n=!1,c=new k(this.app);return await this.app.vault.process(o,u=>{let h=JSON.parse(u||'{"nodes":[],"edges":[]}');Array.isArray(h.nodes)||(h.nodes=[]);let p=h.nodes.findIndex(f=>f.id===e);if(p===-1)return console.error(`\u672A\u627E\u5230\u8282\u70B9: ${e}`),JSON.stringify(h);let g=t;return s&&s.length>0&&(g=`${t}
*${s.join(", ")}*`),r&&(g=`${g}
${r}`),h.nodes[p].text=g,a!==void 0&&(h.nodes[p].color=a.toString()),q(h,this.settings,c),n=!0,JSON.stringify(h)}),n}catch(o){return console.error(`\u66F4\u65B0 Canvas \u4E2D\u7684\u8BCD\u6C47\u5931\u8D25: ${o}`),!1}}async deleteWordFromCanvas(i,e){try{let t=this.app.vault.getAbstractFileByPath(i);if(!t||!(t instanceof re.TFile)||!k.isCanvasFile(t))return console.error(`\u65E0\u6548\u7684 Canvas \u6587\u4EF6: ${i}`),!1;let r=!1,a=new k(this.app);return await this.app.vault.process(t,s=>{let o=JSON.parse(s||'{"nodes":[],"edges":[]}');Array.isArray(o.nodes)||(o.nodes=[]);let n=o.nodes.findIndex(c=>c.id===e);return n===-1?(console.warn(`\u672A\u627E\u5230\u8981\u5220\u9664\u7684\u8282\u70B9: ${e}`),JSON.stringify(o)):(o.nodes.splice(n,1),q(o,this.settings,a),r=!0,JSON.stringify(o))}),r}catch(t){return console.error(`\u4ECE Canvas \u4E2D\u5220\u9664\u8BCD\u6C47\u5931\u8D25: ${t}`),!1}}async setNodeColor(i,e,t){try{let r=this.app.vault.getAbstractFileByPath(i);if(!r||!(r instanceof re.TFile)||!k.isCanvasFile(r))return console.error(`\u65E0\u6548\u7684 Canvas \u6587\u4EF6: ${i}`),!1;let a=!1,s=new k(this.app,this.settings);return await this.app.vault.process(r,o=>{let n=JSON.parse(o||'{"nodes":[],"edges":[]}');Array.isArray(n.nodes)||(n.nodes=[]);let c=n.nodes.findIndex(u=>u.id===e);return c===-1?(console.error(`\u672A\u627E\u5230\u8282\u70B9: ${e}`),JSON.stringify(n)):(t!==void 0?n.nodes[c].color=t.toString():delete n.nodes[c].color,q(n,this.settings,s),a=!0,JSON.stringify(n))}),a}catch(r){return console.error(`\u8BBE\u7F6E\u8282\u70B9\u989C\u8272\u5931\u8D25: ${r}`),!1}}};var Ae=require("obsidian");var se=class{constructor(i,e){this.MASTERED_GROUP_LABEL="Mastered";this.MASTERED_GROUP_COLOR="4";this.app=i,this.canvasParser=new k(i),this.settings=e}updateSettings(i){this.settings=i}genHex16(){let i=new Uint8Array(8);return(window.crypto||window.msCrypto).getRandomValues(i),Array.from(i,e=>e.toString(16).padStart(2,"0")).join("")}async ensureMasteredGroup(i){try{let e=await this.loadCanvas(i);if(!e)return null;let t=e.nodes.find(r=>r.type==="group"&&r.label===this.MASTERED_GROUP_LABEL);if(!t){let r=this.genHex16();return await this.modifyCanvas(i,a=>{let s=this.createMasteredGroup(a);s.id=r,a.nodes.push(s)}),r}return t.id}catch(e){return null}}async moveToMasteredGroup(i,e){try{let t=await this.ensureMasteredGroup(i);return t?await this.modifyCanvas(i,r=>{let a=r.nodes.find(n=>n.id===e),s=r.nodes.find(n=>n.id===t);if(!(!a||!s||!this.moveNodeToGroupOptimizedSync(a,s,r)))try{this.settings&&(ke(r,s,this.settings,this.canvasParser),q(r,this.settings,this.canvasParser))}catch(n){}}):!1}catch(t){return!1}}async removeFromMasteredGroup(i,e){try{return await this.modifyCanvas(i,t=>{let r=t.nodes.find(s=>s.id===e);if(!(!r||!t.nodes.find(s=>s.type==="group"&&s.label===this.MASTERED_GROUP_LABEL))){this.moveNodeOutOfGroupSync(r,t);try{this.settings&&q(t,this.settings,this.canvasParser)}catch(s){}}})}catch(t){return!1}}async isNodeInMasteredGroup(i,e){try{let t=await this.loadCanvas(i);if(!t)return!1;let r=t.nodes.find(s=>s.id===e);if(!r)return!1;let a=t.nodes.find(s=>s.type==="group"&&s.label===this.MASTERED_GROUP_LABEL);return a?this.canvasParser.isNodeInGroup(r,a):!1}catch(t){return!1}}createMasteredGroup(i){let e=this.genHex16(),{x:t,y:r}=this.calculateMasteredGroupPosition(i);return{id:e,type:"group",x:t,y:r,width:400,height:200,color:this.MASTERED_GROUP_COLOR,label:this.MASTERED_GROUP_LABEL}}calculateMasteredGroupPosition(i){let e=i.nodes.filter(p=>p.type==="text"||p.type==="group");if(e.length===0)return{x:50,y:50};let t=Math.min(...e.map(p=>p.x)),r=Math.max(...e.map(p=>p.x+(p.width||200))),a=Math.min(...e.map(p=>p.y)),s=Math.max(...e.map(p=>p.y+(p.height||100))),o=800,n=600,c=50,u=r+c,h=a;return u+o>3e3&&(u=t,h=s+c),{x:u,y:h}}moveNodeToGroupOptimizedSync(i,e,t){try{return i.width=i.width||260,i.height=i.height||120,i.x=Math.max(e.x+24,e.x),i.y=Math.max(e.y+24,e.y),!0}catch(r){return!1}}moveNodeOutOfGroupSync(i,e){let t=e.nodes.find(h=>h.type==="group"&&h.label===this.MASTERED_GROUP_LABEL),r=e.nodes.filter(h=>h.type!=="text"||h.id===i.id?!1:t?!this.canvasParser.isNodeInGroup(h,t):!0),a=50,s=20,o=i.width||260,n=i.height||120;if(r.length===0){i.x=a,i.y=s;return}let c=Math.min(...r.map(h=>h.x),a),u=Math.max(...r.map(h=>h.y+(h.height||n)),0);if(i.x=c,i.y=u+s,t){let h=t.y+t.height;i.y<h+s&&(i.y=h+s)}}getGroupMembers(i,e,t){return e.nodes.filter(r=>r.id!==i.id&&r.id!==t&&r.type!=="group"&&this.canvasParser.isNodeInGroup(r,i))}async loadCanvas(i){try{let e=this.app.vault.getAbstractFileByPath(i);if(!(e instanceof Ae.TFile))return null;let t=await this.app.vault.cachedRead(e);return JSON.parse(t)}catch(e){return null}}async modifyCanvas(i,e){try{let t=this.app.vault.getAbstractFileByPath(i);return t instanceof Ae.TFile?(await this.app.vault.process(t,r=>{let a=JSON.parse(r);return e(a),JSON.stringify(a)}),!0):!1}catch(t){return!1}}};var oe=class{constructor(i,e){this.definitions=new Map;this.wordDefinitionCache=new Map;this.al Line truncated
*${t.aliases.join(", ")}*`),t.definition&&(n+=`
`+t.definition),o.text=n,JSON.stringify(s)})}catch(a){throw console.error("\u4FDD\u5B58 Canvas \u6587\u4EF6\u5931\u8D25:",a),a}}async getAllWordDefinitions(){let i=[];for(let e of this.definitions.values())i.push(...e);for(let e of this.memoryOnlyWords.values())i.push(...e);return i}async getWordDefinitionsByBook(i){let e=this.definitions.get(i)||[],t=this.memoryOnlyWords.get(i)||[];return[...e,...t]}async getUnmasteredWords(){this.cacheValid||this.rebuildCache();let i=[];for(let e of this.allWordsCache){let t=this.wordDefinitionCache.get(e);t&&!t.mastered&&i.push(e)}return i}async getMasteredWords(){this.cacheValid||this.rebuildCache();let i=[];for(let e of this.allWordsCache){let t=this.wordDefinitionCache.get(e);t&&t.mastered&&i.push(e)}return i}isWordMastered(i){let e=this.wordDefinitionCache.get(i.toLowerCase());return(e==null?void 0:e.mastered)===!0}};var D=require("obsidian");var st=require("obsidian");var Ze={plugin_name:"HiWords",settings:{vocabulary_books:"Word books",add_vocabulary_book:"Add word book",remove_vocabulary_book:"Remove",show_definition_on_hover:"Show definition on hover",show_definition_on_hover_desc:"Show word definition when hovering over highlighted words",enable_auto_highlight:"Enable auto highlight",enable_auto_highlight_desc:"Automatically highlight words from vocabulary books while reading",highlight_style:"Highlight style",highlight_style_desc:"Choose how words are highlighted in text",enable_section_tabs:"Enable section tabs",enable_section_tabs_desc:"Render multi-section definitions as tabs in the sidebar card and hover popover",style_underline:"Underline",style_background:"Background",style_bold:"Bold",style_dotted:"Dotted underline",style_wavy:"Wavy underline",save_settings:"Save settings",no_vocabulary_books:"No vocabulary books yet. Please add a Canvas file as a vocabulary book.",path:"Path",reload_book:"Reload this word book",statistics:"Statistics",total_books:"Total word books: {0}",enabled_books:"Enabled word books: {0}",total_words:"Total words: {0}",enable_mastered_feature:"Enable mastered feature",enable_mastered_feature_desc:"Mark mastered words to stop highlighting them. Sidebar shows grouped words",mastered_detection:"Mastered detection mode",mastered_detection_desc:"Choose how to detect 'mastered': by group or by color (green = 4)",mode_group:"Group mode",mode_color:"Color mode (green = 4)",blur_definitions:"Blur content",blur_definitions_desc:"Blur content by default, reveal on hover. Great for learning\u2014recall before seeing the answer",tts_template:"TTS template",tts_template_desc:"Use {{word}} as placeholder, e.g. https://dict.youdao.com/dictvoice?audio={{word}}&type=2",ai_dictionary:"AI Assistant",ai_api_url:"API URL",ai_api_url_desc:"Full API endpoint (e.g., .../v1/chat/completions)",ai_api_key:"API Key",ai_api_key_desc:"Your AI API key",ai_model:"Model ID",ai_model_desc:"AI model identifier (e.g., gpt-4o-mini, deepseek-chat)",ai_prompt:"Custom Prompt",ai_prompt_desc:"Use {{word}} and {{sentence}} as placeholders. The AI will use this prompt to generate definitions",ai_test_connection:"Test AI connection",ai_test_connection_desc:"Send a small test request to verify your API URL, key, and model",ai_extra_params:"Extra Request Parameters",ai_extra_params_desc:"Add custom JSON parameters to AI request body (Advanced)",ai_extra_params_placeholder:`{
"temperature": 0.7,
"top_p": 0.9
}`,auto_layout:"Canvas auto layout",enable_auto_layout:"Enable auto layout",enable_auto_layout_desc:"Automatically normalize layout after add/update/delete and group changes",card_size:"Card size",card_size_desc:"Default card size (Width \xD7 Height, default: 260 \xD7 120)",grid_gaps:"Grid gaps",grid_gaps_desc:"Horizontal/vertical gaps for the left grid",left_padding:"Left padding & min X",left_padding_desc:"Left padding from Mastered group and minimum X for the left area",columns_auto:"Auto columns",columns_auto_desc:"Auto determine columns (bounded by max columns)",columns:"Fixed columns / Max columns",columns_desc:"Specify fixed columns and max columns (effective when auto columns off)",group_inner_layout:"Group inner layout",group_inner_layout_desc:"Inner padding, gaps and columns for nodes inside groups",highlight_scope:"Highlight scope",highlight_mode:"Highlight mode",highlight_mode_desc:"Choose the scope mode for word highlighting",mode_all:"All files",mode_exclude:"Exclude specified paths",mode_include:"Only specified paths",highlight_paths:"File paths",highlight_paths_desc:"Separate multiple paths with commas, supports folder paths (including subfolders)",highlight_paths_placeholder:"e.g.: Archive, Templates, Private/Diary",file_node_parse_mode:"File node parse mode",file_node_parse_mode_desc:"Choose how to parse file cards in Canvas",mode_filename:"Filename only",mode_content:"File content only",mode_filename_with_alias:"Filename as word, content as alias",selection_translate:"Selection Translate",enable_selection_translate:"Enable selection translate",enable_selection_translate_desc:"Show translation popup when text is selected",translate_target_lang:"Target language",translate_target_lang_desc:"Target language code (e.g. zh-CN, en, ja)",translate_prompt:"Translation prompt",translate_prompt_desc:"AI translation prompt template. Use {{text}} and {{to}} as placeholders"},sidebar:{title:"HiWords",empty_state:"No words found. Add words to your vocabulary books to see them here.",source_prefix:"From: ",found:"Found",words:"words",no_definition:"No definition available.",vocabulary_book:"Words",mastered:"Mastered",no_learning_words:"No words to learn",no_mastered_words:"No mastered words"},commands:{refresh_vocabulary:"Refresh vocabulary",add_word:"HiWords: Add word",edit_word:"HiWords: Edit word",show_sidebar:"Show HiWords sidebar",add_selected_word:"Add word"},notices:{enter_word_first:"Please enter a word first",definition_fetched:"Definition fetched successfully",definition_fetch_failed:"Failed to fetch definition. Please check your network or try another word",vocabulary_refreshed:"Vocabulary books refreshed",word_added:"Word added to vocabulary book",word_exists:"Word already exists in vocabulary book",error_adding_word:"Error adding word to vocabulary book",select_book_required:"Please select a vocabulary book",adding_word:"Adding word to vocabulary book...",updating_word:"Updating word...",word_added_success:'Word "{0}" successfully added to vocabulary book',word_updated_success:'Word "{0}" successfully updated',add_word_failed:"Failed to add word, please check the vocabulary book file",update_word_failed:"Failed to update word, please check the vocabulary book file",error_processing_word:"Error processing word",no_canvas_files:"No Canvas files found",book_already_exists:"This vocabulary book already exists",invalid_canvas_file:"Invalid Canvas file",book_added:"Added vocabulary book: {0}",book_reloaded:"Reloaded vocabulary book: {0}",book_removed:"Removed vocabulary book: {0}",testing_ai_connection:"Testing AI connection...",ai_connection_success:"AI connection successful",ai_connection_failed:"AI connection test failed",deleting_word:"Deleting word...",word_deleted:"Word deleted",delete_word_failed:"Failed to delete word, please check the vocabulary book file",error_deleting_word:"Error occurred while deleting word",mastered_feature_disabled:"Mastered feature is not enabled",update_word_status_failed:"Failed to update word status",move_to_mastered_group_failed:"Failed to move to mastered group",word_marked_as_mastered:'"{0}" marked as mastered',mark_mastered_failed:"Failed to mark as mastered, please try again",remove_from_mastered_group_failed:"Failed to remove from mastered group",word_unmarked_as_mastered:'"{0}" unmarked as mastered',no_text_selected:"Please select text to add as a word",word_required:"Please enter a word",unmark_mastered_failed:"Failed to unmark as mastered, please try again",batch_marked_success:"Successfully marked {0} words as mastered",book_path_updated:"Vocabulary book path updated: {0}"},modals:{auto_fill_definition:"AI Define",word_label:"Word",word_placeholder:"Enter word to add...",definition_label:"Definition",book_label:"Vocabulary book",select_book:"Select a vocabulary book",color_label:"Card color",color_gray:"Gray",color_red:"Red",color_orange:"Orange",color_yellow:"Yellow",color_green:"Green",color_blue:"Blue",color_purple:"Purple",aliases_label:"Aliases ( Line truncated
This action cannot be undone.`},actions:{expand:"Expand",collapse:"Collapse",mark_mastered:"Mark mastered",unmark_mastered:"Unmark mastered"},translate:{text_empty:"Translation text cannot be empty",translating:"Translating...",failed:"Translation failed, please try again",ai_not_configured:"AI translation not configured. Please set up API in settings",invalid_response:"Translation service returned an invalid response"},ai_errors:{word_empty:"Word cannot be empty",api_key_not_configured:"API Key is not configured. Please set it in the plugin settings",api_url_required:"API URL is required. Please set it in the plugin settings",model_required:"Model ID is required. Please set it in the plugin settings",prompt_required:"Custom prompt is required. Please set it in the plugin settings",invalid_api_url:"Invalid API URL format. Please check the URL in plugin settings",prompt_missing_word_placeholder:"Prompt must contain {{word}} placeholder",invalid_response:"API returned an invalid response format",api_key_invalid:"\u274C API Key is invalid or expired. Please check plugin settings",rate_limit:"\u23F1\uFE0F API rate limit exceeded. Please try again later",server_error:"\u{1F527} API service is temporarily unavailable. Please try again later",network_error:"\u{1F310} Network connection failed. Please check your network settings",request_failed:"AI dictionary request failed",invalid_json_format:"Invalid JSON format, please check syntax"}};var et={plugin_name:"HiWords",settings:{vocabulary_books:"\u5355\u8BCD\u672C",add_vocabulary_book:"\u6DFB\u52A0\u5355\u8BCD\u672C",remove_vocabulary_book:"\u79FB\u9664",show_definition_on_hover:"\u60AC\u505C\u663E\u793A\u91CA\u4E49",show_definition_on_hover_desc:"\u9F20\u6807\u60AC\u505C\u5728\u9AD8\u4EAE\u8BCD\u6C47\u4E0A\u65F6\u663E\u793A\u5B9A\u4E49",enable_auto_highlight:"\u542F\u7528\u81EA\u52A8\u9AD8\u4EAE",enable_auto_highlight_desc:"\u5728\u9605\u8BFB\u65F6\u81EA\u52A8\u9AD8\u4EAE\u751F\u8BCD\u672C\u4E2D\u7684\u8BCD\u6C47",highlight_style:"\u9AD8\u4EAE\u6837\u5F0F",highlight_style_desc:"\u9009\u62E9\u5355\u8BCD\u5728\u6587\u672C\u4E2D\u7684\u9AD8\u4EAE\u663E\u793A\u65B9\u5F0F",enable_section_tabs:"\u542F\u7528\u5206\u533A Tab \u663E\u793A",enable_section_tabs_desc:"\u5C06\u4F7F\u7528 --- \u5206\u9694\u3001**\u6807\u9898** \u6807\u8BB0\u7684\u591A\u6BB5\u91CA\u4E49\u6E32\u67D3\u4E3A\u4FA7\u8FB9\u680F\u548C\u60AC\u505C\u5F39\u7A97\u4E2D\u7684\u6807\u7B7E\u9875",style_underline:"\u4E0B\u5212\u7EBF",style_background:"\u80CC\u666F\u9AD8\u4EAE",style_bold:"\u7C97\u4F53",style_dotted:"\u70B9\u72B6\u4E0B\u5212\u7EBF",style_wavy:"\u6CE2\u6D6A\u7EBF",save_settings:"\u4FDD\u5B58\u8BBE\u7F6E",no_vocabulary_books:"\u6682\u65E0\u5355\u8BCD\u672C\uFF0C\u8BF7\u6DFB\u52A0 Canvas \u6587\u4EF6\u4F5C\u4E3A\u5355\u8BCD\u672C",path:"\u8DEF\u5F84",reload_book:"\u91CD\u65B0\u89E3\u6790\u8BE5\u5355\u8BCD\u672C",statistics:"\u7EDF\u8BA1\u4FE1\u606F",total_books:"\u603B\u5355\u8BCD\u672C\u6570\u91CF: {0}",enabled_books:"\u5DF2\u542F\u7528\u5355\u8BCD\u672C: {0}",total_words:"\u603B\u8BCD\u6C47\u6570\u91CF: {0}",enable_mastered_feature:"\u542F\u7528\u5DF2\u638C\u63E1\u529F\u80FD",enable_mastered_feature_desc:"\u6807\u8BB0\u5DF2\u638C\u63E1\u5355\u8BCD\u4EE5\u505C\u6B62\u9AD8\u4EAE\u663E\u793A\u3002\u4FA7\u8FB9\u680F\u663E\u793A\u5206\u7EC4\u5355\u8BCD",mastered_detection:"\u5DF2\u638C\u63E1\u5224\u5B9A\u6A21\u5F0F",mastered_detection_desc:"\u9009\u62E9\u7528\u4E8E\u5224\u5B9A\u201C\u5DF2\u638C\u63E1\u201D\u7684\u65B9\u5F0F\uFF1A\u5206\u7EC4\u6216\u989C\u8272\uFF08\u7EFF\u8272=4\uFF09",mode_group:"\u5206\u7EC4\u6A21\u5F0F",mode_color:"\u989C\u8272\u6A21\u5F0F\uFF08\u7EFF\u8272=4\uFF09",blur_definitions:"\u6A21\u7CCA\u5185\u5BB9",blur_definitions_desc:"\u9ED8\u8BA4\u6A21\u7CCA\u663E\u793A\u5185\u5BB9\uFF0C\u9F20\u6807\u60AC\u505C\u65F6\u663E\u793A\u6E05\u6670\u5185\u5BB9\u3002\u9002\u5408\u5B66\u4E60\u65F6\u5148\u56DE\u5FC6\u518D\u67E5\u770B\u7B54\u6848",tts_template:"\u53D1\u97F3\u5730\u5740\u6A21\u677F",tts_template_desc:"\u4F7F\u7528 {{word}} \u4F5C\u4E3A\u5360\u4F4D\u7B26\uFF0C\u4F8B\u5982\uFF1Ahttps://dict.youdao.com/dictvoice?audio={{word}}&type=2",ai_dictionary:"AI \u52A9\u624B",ai_api_url:"API \u5730\u5740",ai_api_url_desc:"\u5B8C\u6574\u7684 API \u7AEF\u70B9\u5730\u5740\uFF08\u5982\uFF1A.../v1/chat/completions\uFF09",ai_api_key:"API Key",ai_api_key_desc:"\u4F60\u7684 AI API \u5BC6\u94A5",ai_model:"\u6A21\u578B ID",ai_model_desc:"AI \u6A21\u578B\u6807\u8BC6\u7B26 (\u4F8B\u5982: gpt-4o-mini, deepseek-chat)",ai_prompt:"\u81EA\u5B9A\u4E49\u63D0\u793A\u8BCD",ai_prompt_desc:"\u4F7F\u7528 {{word}} \u548C {{sentence}} \u4F5C\u4E3A\u5360\u4F4D\u7B26\u3002AI \u5C06\u4F7F\u7528\u6B64\u63D0\u793A\u8BCD\u751F\u6210\u91CA\u4E49",ai_test_connection:"\u6D4B\u8BD5 AI \u8FDE\u63A5",ai_test_connection_desc:"\u53D1\u9001\u4E00\u4E2A\u8F7B\u91CF\u6D4B\u8BD5\u8BF7\u6C42\uFF0C\u9A8C\u8BC1 API \u5730\u5740\u3001Key \u548C\u6A21\u578B\u662F\u5426\u53EF\u7528",ai_extra_params:"\u989D\u5916\u8BF7\u6C42\u53C2\u6570",ai_ Line truncated
"temperature": 0.7,
"top_p": 0.9
}`,auto_layout:"\u767D\u677F\u81EA\u52A8\u5E03\u5C40",enable_auto_layout:"\u542F\u7528\u81EA\u52A8\u5E03\u5C40",enable_auto_layout_desc:"\u5728\u6DFB\u52A0/\u66F4\u65B0/\u5220\u9664\u8282\u70B9\u548C\u5206\u7EC4\u53D8\u66F4\u540E\u81EA\u52A8\u89C4\u8303\u5316\u5E03\u5C40",card_size:"\u5361\u7247\u5C3A\u5BF8",card_size_desc:"\u9ED8\u8BA4\u5361\u7247\u5C3A\u5BF8\uFF08\u5BBD \xD7 \u9AD8\uFF0C\u9ED8\u8BA4\uFF1A260 \xD7 120\uFF09",grid_gaps:"\u7F51\u683C\u95F4\u8DDD",grid_gaps_desc:"\u5DE6\u4FA7\u533A\u57DF\u7F51\u683C\u7684\u6C34\u5E73/\u5782\u76F4\u95F4\u8DDD",left_padding:"\u5DE6\u4FA7\u7559\u767D\u4E0E\u6700\u5C0FX",left_padding_desc:"Mastered \u5206\u7EC4\u5DE6\u4FA7\u7684\u7559\u767D\u4E0E\u5DE6\u4FA7\u533A\u57DF\u7684\u6700\u5C0F X \u4F4D\u7F6E",columns_auto:"\u81EA\u52A8\u5217\u6570",columns_auto_desc:"\u6839\u636E\u5185\u5BB9\u81EA\u9002\u5E94\u5217\u6570\uFF08\u53D7\u6700\u5927\u5217\u6570\u9650\u5236\uFF09",columns:"\u56FA\u5B9A\u5217\u6570/\u6700\u5927\u5217\u6570",columns_desc:"\u6307\u5B9A\u56FA\u5B9A\u5217\u6570\u4E0E\u6700\u5927\u5217\u6570\uFF08\u5F53\u5173\u95ED\u81EA\u52A8\u5217\u6570\u65F6\u751F\u6548\uFF09",group_inner_layout:"\u5206\u7EC4\u5185\u5E03\u5C40",group_inner_layout_desc:"\u5206\u7EC4\u5185\u90E8\u7684\u5185\u8FB9\u8DDD\u3001\u95F4\u8DDD\u4E0E\u5217\u6570\u8BBE\u7F6E",highlight_scope:"\u9AD8\u4EAE\u8303\u56F4",highlight_mode:"\u9AD8\u4EAE\u6A21\u5F0F",highlight_mode_desc:"\u9009\u62E9\u9AD8\u4EAE\u5355\u8BCD\u7684\u8303\u56F4\u6A21\u5F0F",mode_all:"\u5168\u90E8\u6587\u4EF6\u9AD8\u4EAE",mode_exclude:"\u6392\u9664\u6307\u5B9A\u8DEF\u5F84",mode_include:"\u4EC5\u6307\u5B9A\u8DEF\u5F84\u9AD8\u4EAE",highlight_paths:"\u6587\u4EF6\u8DEF\u5F84",highlight_paths_desc:"\u591A\u4E2A\u8DEF\u5F84\u7528\u9017\u53F7\u5206\u9694\uFF0C\u652F\u6301\u6587\u4EF6\u5939\u8DEF\u5F84\uFF08\u5305\u62EC\u5B50\u6587\u4EF6\u5939\uFF09",highlight_paths_placeholder:"\u4F8B\u5982\uFF1AArchive, Templates, Private/Diary",file_node_parse_mode:"\u6587\u4EF6\u8282\u70B9\u89E3\u6790\u6A21\u5F0F",file_node_parse_mode_desc:"\u9009\u62E9\u5982\u4F55\u89E3\u6790 Canvas \u4E2D\u7684\u6587\u4EF6\u5361\u7247",mode_filename:"\u4EC5\u6587\u4EF6\u540D",mode_content:"\u4EC5\u6587\u4EF6\u5185\u5BB9",mode_filename_with_alias:"\u6587\u4EF6\u540D\u4F5C\u4E3A\u4E3B\u8BCD\uFF0C\u5185\u5BB9\u4F5C\u4E3A\u522B\u540D",selection_translate:"\u5212\u8BCD\u7FFB\u8BD1",enable_selection_translate:"\u542F\u7528\u5212\u8BCD\u7FFB\u8BD1",enable_selection_translate_desc:"\u9009\u4E2D\u6587\u672C\u540E\u81EA\u52A8\u5F39\u51FA\u7FFB\u8BD1\u6D6E\u7A97",translate_target_lang:"\u76EE\u6807\u8BED\u8A00",translate_target_lang_desc:"\u7FFB\u8BD1\u7684\u76EE\u6807\u8BED\u8A00\u4EE3\u7801\uFF08\u5982 zh-CN\u3001en\u3001ja\uFF09",translate_prompt:"\u7FFB\u8BD1\u63D0\u793A\u8BCD",translate_prompt_desc:"AI \u7FFB\u8BD1\u7684\u63D0\u793A\u8BCD\u6A21\u677F\uFF0C\u4F7F\u7528 {{text}} \u548C {{to}} \u4F5C\u4E3A\u5360\u4F4D\u7B26"},sidebar:{title:"HiWords",empty_state:"\u672A\u627E\u5230\u5355\u8BCD\u3002\u6DFB\u52A0\u5355\u8BCD\u5230\u60A8\u7684\u751F\u8BCD\u672C\u4EE5\u5728\u6B64\u5904\u67E5\u770B\u3002",source_prefix:"\u6765\u81EA: ",found:"\u53D1\u73B0",words:"\u4E2A\u751F\u8BCD",no_definition:"\u6682\u65E0\u5B9A\u4E49",vocabulary_book:"\u8BCD\u6C47",mastered:"\u5DF2\u638C\u63E1",no_learning_words:"\u6CA1\u6709\u5F85\u5B66\u4E60\u7684\u5355\u8BCD",no_mastered_words:"\u6CA1\u6709\u5DF2\u638C\u63E1\u7684\u5355\u8BCD"},commands:{refresh_vocabulary:"\u5237\u65B0\u751F\u8BCD\u672C",add_word:"HiWords: \u6DFB\u52A0\u5355\u8BCD",edit_word:"HiWords: \u7F16\u8F91\u5355\u8BCD",show_sidebar:"\u663E\u793A HiWords \u4FA7\u8FB9\u680F",add_selected_word:"\u6DFB\u52A0\u5355\u8BCD"},notices:{enter_word_first:"\u8BF7\u5148\u8F93\u5165\u5355\u8BCD",definition_fetched:"\u91CA\u4E49\u83B7\u53D6\u6210\u529F",definition_fetch_failed:"\u83B7\u53D6\u91CA\u4E49\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u5C1D\u8BD5\u5176\u4ED6\u5355\u8BCD",vocabulary_refreshed:"\u751F\u8BCD\u672C\u5DF2\u5237\u65B0",word_added:"\u5355\u8BCD\u5DF2\u6DFB\u52A0\u5230\u751F\u8BCD\u672C",word_exists:"\u5355\u8BCD\u5DF2\u5B58\u5728\u4E8E\u751F\u8BCD\u672C\u4E2D",error_adding_word:"\u6DFB\u52A0\u5355\u8BCD\u5230\u751F\u8BCD\u672C\u65F6\u51FA\u9519",select_book_required:"\u8BF7\u9009\u62E9\u751F\u8BCD\u672C",adding_word:"\u6B63\u5728\u6DFB\u52A0\u8BCD\u6C47\u5230\u751F\u8BCD\u672C...",updating_word:"\u6B63\u5728\u66F4\u65B0\u8BCD\u6C47...",word_added_success:'\u8BCD\u6C47 "{0}" \u5DF2\u6210\u529F\u6DFB\u52A0\u5230\u751F\u8BCD\u672C',word_updated_success:'\u8BCD\u6C47 "{0}" \u5DF2\u6210\u529F\u66F4\u65B0',add_word_failed:"\u6DFB\u52A0\u8BCD\u6C47\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u751F\u8BCD\u672C\u6587\u4EF6",update_word_failed:"\u66F4\u65B0\u8BCD\u6C47\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u751F\u8BCD\u672C\u6587\u4EF6",error_processing_word:"\u5904\u7406\u8BCD\u6C47\u65F6\u51FA\u9519",no_canvas_files:"\u672A\u627E\u5230 Canvas \u6587\u4EF6",book_already_exists:"\u8BE5\u751F\u8BCD\u672C\u5DF2\u5B58\u57 Line truncated
\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002`},actions:{expand:"\u5C55\u5F00",collapse:"\u6536\u8D77",mark_mastered:"\u5DF2\u638C\u63E1",unmark_mastered:"\u5FD8\u8BB0\u4E86"},translate:{text_empty:"\u7FFB\u8BD1\u6587\u672C\u4E0D\u80FD\u4E3A\u7A7A",translating:"\u7FFB\u8BD1\u4E2D...",failed:"\u7FFB\u8BD1\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",ai_not_configured:"AI \u7FFB\u8BD1\u672A\u914D\u7F6E\uFF0C\u8BF7\u5728\u8BBE\u7F6E\u4E2D\u586B\u5199 API \u4FE1\u606F",invalid_response:"\u7FFB\u8BD1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u54CD\u5E94"},ai_errors:{word_empty:"\u5355\u8BCD\u4E0D\u80FD\u4E3A\u7A7A",api_key_not_configured:"API Key \u672A\u914D\u7F6E,\u8BF7\u5728\u63D2\u4EF6\u8BBE\u7F6E\u4E2D\u586B\u5199",api_url_required:"API \u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A,\u8BF7\u5728\u63D2\u4EF6\u8BBE\u7F6E\u4E2D\u586B\u5199",model_required:"\u6A21\u578B ID \u4E0D\u80FD\u4E3A\u7A7A,\u8BF7\u5728\u63D2\u4EF6\u8BBE\u7F6E\u4E2D\u586B\u5199",prompt_required:"\u81EA\u5B9A\u4E49\u63D0\u793A\u8BCD\u4E0D\u80FD\u4E3A\u7A7A,\u8BF7\u5728\u63D2\u4EF6\u8BBE\u7F6E\u4E2D\u586B\u5199",invalid_api_url:"API \u5730\u5740\u683C\u5F0F\u65E0\u6548,\u8BF7\u68C0\u67E5\u63D2\u4EF6\u8BBE\u7F6E\u4E2D\u7684 URL",prompt_missing_word_placeholder:"\u63D0\u793A\u8BCD\u5FC5\u987B\u5305\u542B {{word}} \u5360\u4F4D\u7B26",invalid_response:"API \u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u54CD\u5E94\u683C\u5F0F",api_key_invalid:"\u274C API Key \u65E0\u6548\u6216\u5DF2\u8FC7\u671F,\u8BF7\u68C0\u67E5\u63D2\u4EF6\u8BBE\u7F6E",rate_limit:"\u23F1\uFE0F API \u8BF7\u6C42\u9891\u7387\u8D85\u9650,\u8BF7\u7A0D\u540E\u518D\u8BD5",server_error:"\u{1F527} API \u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528,\u8BF7\u7A0D\u540E\u518D\u8BD5",network_error:"\u{1F310} \u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25,\u8BF7\u68C0\u67E5\u7F51\u7EDC\u8BBE\u7F6E",request_failed:"AI \u8BCD\u5178\u8BF7\u6C42\u5931\u8D25",invalid_json_format:"JSON \u683C\u5F0F\u65E0\u6548\uFF0C\u8BF7\u68C0\u67E5\u8BED\u6CD5"}};var tt={plugin_name:"HiWords",settings:{vocabulary_books:"Libros de palabras",add_vocabulary_book:"Agregar libro de palabras",remove_vocabulary_book:"Eliminar",show_definition_on_hover:"Mostrar definici\xF3n al pasar el cursor",show_definition_on_hover_desc:"Mostrar la definici\xF3n al pasar el cursor sobre palabras resaltadas",enable_auto_highlight:"Habilitar resaltado autom\xE1tico",enable_auto_highlight_desc:"Resaltar autom\xE1ticamente palabras de los libros mientras lees",highlight_style:"Estilo de resaltado",highlight_style_desc:"Elige c\xF3mo se resaltan las palabras en el texto",enable_section_tabs:"Activar pesta\xF1as de secciones",enable_section_tabs_desc:"Renderiza definiciones con varias secciones como pesta\xF1as en la barra lateral y en la vista emergente",style_underline:"Subrayado",style_background:"Fondo",style_bold:"Negrita",style_dotted:"Subrayado punteado",style_wavy:"Subrayado ondulado",save_settings:"Guardar ajustes",no_vocabulary_books:"A\xFAn no hay libros. Agrega un archivo Canvas como libro de palabras.",path:"Ruta",reload_book:"Recargar este libro",statistics:"Estad\xEDsticas",total_books:"Libros totales: {0}",enabled_books:"Libros habilitados: {0}",total_words:"Palabras totales: {0}",enable_mastered_feature:"Habilitar funci\xF3n de dominadas",enable_mastered_feature_desc:"Marca palabras dominadas para dejar de resaltarlas. La barra lateral muestra grupos",blur_definitions:"Difuminar contenido",blur_definitions_desc:"Difuminar por defecto, mostrar al pasar el cursor. Ideal para recordar antes de ver la respuesta",tts_template:"Plantilla TTS",tts_template_desc:"Usar {{word}} como marcador de posici\xF3n, ej. https://dict.youdao.com/dictvoice?audio={{word}}&type=2",ai_dictionary:"Asistente AI",ai_api_url:"URL de API",ai_api_url_desc:"Punto final de API (detecta autom\xE1ticamente: OpenAI, Claude, Gemini)",ai_api_key:"Clave API",ai_api_key_desc:"Tu clave de API de AI",ai_model:"Modelo",ai_model_desc:"Nombre del modelo de AI (ej., gpt-4o-mini, deepseek-chat)",ai_prompt:"Prompt personalizado",ai_prompt_desc:"Usar {{word}} y {{sentence}} como marcadores de posici\xF3n. La AI usar\xE1 este prompt para generar definiciones",ai_extra_params:"Par\xE1metros extra de la solicitud",ai_extra_params_desc:"A\xF1ade par\xE1metros JSON personalizados al cuerpo de la solicitud de IA (avanzado)",ai_extra_params_placeholder:`{
"temperature": 0.7,
"top_p": 0.9
}`,auto_layout:"Dise\xF1o autom\xE1tico del lienzo",enable_auto_layout:"Habilitar dise\xF1o autom\xE1tico",enable_auto_layout_desc:"Normalizar autom\xE1ticamente el dise\xF1o despu\xE9s de agregar/actualizar/eliminar y cambios de grupo",card_size:"Tama\xF1o de tarjeta",card_size_desc:"Tama\xF1o de tarjeta predeterminado (Ancho \xD7 Alto, predeterminado: 260 \xD7 120)",grid_gaps:"Espacios de la cuadr\xEDcula",grid_gaps_desc:"Espacios horizontal/vertical para la cuadr\xEDcula izquierda",left_padding:"Relleno izquierdo y X m\xEDnima",left_padding_desc:"Relleno izquierdo desde el grupo Mastered y X m\xEDnima para el \xE1rea izquierda",columns_auto:"Columnas autom\xE1ticas",columns_auto_desc:"Determinar columnas autom\xE1ticamente (limitado por columnas m\xE1ximas)",columns:"Columnas fijas / M\xE1ximo de columnas",columns_desc:"Especificar columnas fijas y m\xE1ximo de columnas (efectivo cuando auto est\xE1 desactivado)",group_inner_layout:"Dise\xF1o interno del grupo",group_inner_layout_desc:"Relleno interno, espacios y columnas para nodos dentro de grupos",highlight_scope:"\xC1mbito de resaltado",highlight_mode:"Modo de resaltado",highlight_mode_desc:"Elegir el modo de \xE1mbito para el resaltado de palabras",mode_all:"Todos los archivos",mode_exclude:"Excluir rutas especificadas",mode_include:"Solo rutas especificadas",highlight_paths:"Rutas de archivo",highlight_paths_desc:"Separar m\xFAltiples rutas con comas, admite rutas de carpetas (incluidas subcarpetas)",highlight_paths_placeholder:"ej.: Archive, Templates, Private/Diary",file_node_parse_mode:"Modo de an\xE1lisis de nodo de archivo",file_node_parse_mode_desc:"Elegir c\xF3mo analizar tarjetas de archivo en Canvas",mode_filename:"Solo nombre de archivo",mode_content:"Solo contenido de archivo",mode_filename_with_alias:"Nombre de archivo como palabra, contenido como alias",selection_translate:"Traducci\xF3n por selecci\xF3n",enable_selection_translate:"Activar traducci\xF3n por selecci\xF3n",enable_selection_translate_desc:"Mostrar ventana emergente de traducci\xF3n al seleccionar texto",translate_target_lang:"Idioma de destino",translate_target_lang_desc:"C\xF3digo del idioma de destino (ej. zh-CN, en, ja)",translate_prompt:"Prompt de traducci\xF3n",translate_prompt_desc:"Plantilla de prompt para traducci\xF3n IA. Use {{text}} y {{to}} como marcadores"},sidebar:{title:"HiWords",empty_state:"No se encontraron palabras. Agrega palabras a tus libros para verlas aqu\xED.",source_prefix:"De: ",found:"Encontradas",words:"palabras",no_definition:"Sin definici\xF3n disponible.",vocabulary_book:"Palabras",mastered:"Dominadas",no_learning_words:"No hay palabras para aprender",no_mastered_words:"No hay palabras dominadas"},commands:{refresh_vocabulary:"Actualizar vocabulario",add_word:"HiWords: Agregar palabra",edit_word:"HiWords: Editar palabra",show_sidebar:"Mostrar barra lateral de HiWords",add_selected_word:"Agregar palabra"},notices:{vocabulary_refreshed:"Libros actualizados",word_added:"Palabra agregada al libro",word_exists:"La palabra ya existe en el libro",error_adding_word:"Error al agregar palabra al libro",select_book_required:"Selecciona un libro de palabras",adding_word:"Agregando palabra al libro...",updating_word:"Actualizando palabra...",word_added_success:'La palabra "{0}" se agreg\xF3 correctamente',word_updated_success:'La palabra "{0}" se actualiz\xF3 correctamente',add_word_failed:"No se pudo agregar la palabra, revisa el archivo del libro",update_word_failed:"No se pudo actualizar la palabra, revisa el archivo del libro",error_processing_word:"Error al procesar la palabra",no_canvas_files:"No se encontraron archivos Canvas",book_already_exists:"Este libro ya existe",invalid_canvas_file:"Archivo Canvas no v\xE1lido",book_added:"Libro agregado: {0}",book_reloaded:"Libro recargado: {0}",book_removed:"Libro eliminado: {0}",deleting_word:"Eliminando palabra...",word_deleted:"Palabra eliminada",delete_word_failed:"No se pudo eliminar la palabra, revisa el archivo del libro",error_deleting_word:"Ocurri\xF3 un error al eliminar la palabra",mastered_feature_disabled:"La funci\xF3n de dominadas no est\xE1 habilitada",update_word_status_failed:"No se pudo actualizar el estado de la palabra",move_to_mastered_group_failed:"No se pudo mover al grupo de dominadas",word_marked_as_mastered:'"{0}" marcada como dominada',mark_mastered_failed:"No se pudo marcar como dominada, int\xE9ntalo de nuevo",remove_from_mastered_group_failed:"No se pudo quitar del grupo de dominadas",word_unmarked_as_mastered:'"{0}" ya no est\xE1 marcada como dominada',no_text_selected:"Por favor, selecciona primero una palabra para agregar",word_required:"Por favor, ingresa una palabra",unmark_mastered_failed:"No se pudo desmarcar, int\xE9ntalo de nuevo",batch_marked_success:"Se marcaron correctamente {0} palabras como dominadas",book_path_updated:"Ruta del libro actualizada: {0}",new_notice:"Nuevo aviso"},modals:{auto_fill_definition:"Definir con AI",word_label:"Palabra",word_placehold Line truncated
Esta acci\xF3n no se puede deshacer.`},actions:{expand:"Expandir",collapse:"Contraer",mark_mastered:"Marcar como dominado",unmark_mastered:"Desmarcar dominado"},translate:{text_empty:"El texto de traducci\xF3n no puede estar vac\xEDo",translating:"Traduciendo...",failed:"La traducci\xF3n fall\xF3, int\xE9ntelo de nuevo",ai_not_configured:"Traducci\xF3n IA no configurada. Configure la API en los ajustes",invalid_response:"El servicio de traducci\xF3n devolvi\xF3 una respuesta no v\xE1lida"},ai_errors:{word_empty:"La palabra no puede estar vac\xEDa",api_key_not_configured:"La clave API no est\xE1 configurada. Por favor, config\xFArela en los ajustes del plugin",invalid_response:"La API devolvi\xF3 un formato de respuesta no v\xE1lido",api_key_invalid:"\u274C La clave API no es v\xE1lida o ha caducado. Por favor, verifique la configuraci\xF3n del plugin",rate_limit:"\u23F1\uFE0F L\xEDmite de tasa de API excedido. Por favor, int\xE9ntelo de nuevo m\xE1s tarde",server_error:"\u{1F527} El servicio API no est\xE1 disponible temporalmente. Por favor, int\xE9ntelo de nuevo m\xE1s tarde",network_error:"\u{1F310} Fallo en la conexi\xF3n de red. Por favor, verifique su configuraci\xF3n de red",request_failed:"Solicitud al diccionario AI fall\xF3",invalid_json_format:"Formato JSON no v\xE1lido, por favor revise la sintaxis"}};var it={plugin_name:"HiWords",settings:{vocabulary_books:"Livres de mots",add_vocabulary_book:"Ajouter un livre",remove_vocabulary_book:"Supprimer",show_definition_on_hover:"Afficher la d\xE9finition au survol",show_definition_on_hover_desc:"Afficher la d\xE9finition en survolant les mots surlign\xE9s",enable_auto_highlight:"Activer le surlignage auto",enable_auto_highlight_desc:"Surligner automatiquement les mots des livres pendant la lecture",highlight_style:"Style de surlignage",highlight_style_desc:"Choisissez la fa\xE7on dont les mots sont surlign\xE9s",enable_section_tabs:"Activer les onglets de section",enable_section_tabs_desc:"Affiche les d\xE9finitions multi-sections sous forme d'onglets dans la barre lat\xE9rale et l'infobulle",style_underline:"Soulign\xE9",style_background:"Fond",style_bold:"Gras",style_dotted:"Soulign\xE9 en pointill\xE9s",style_wavy:"Soulign\xE9 ondul\xE9",save_settings:"Enregistrer les r\xE9glages",no_vocabulary_books:"Aucun livre pour l'instant. Ajoutez un fichier Canvas comme livre de mots.",path:"Chemin",reload_book:"Recharger ce livre",statistics:"Statistiques",total_books:"Livres au total : {0}",enabled_books:"Livres activ\xE9s : {0}",total_words:"Mots au total : {0}",enable_mastered_feature:"Activer la fonction ma\xEEtris\xE9",enable_mastered_feature_desc:"Marquer les mots ma\xEEtris\xE9s pour arr\xEAter de les surligner. La barre lat\xE9rale affiche les groupes",blur_definitions:"Flouter le contenu",blur_definitions_desc:"Flouter par d\xE9faut, r\xE9v\xE9ler au survol. Id\xE9al pour m\xE9moriser avant de voir la r\xE9ponse",tts_template:"Mod\xE8le TTS",tts_template_desc:"Utiliser {{word}} comme espace r\xE9serv\xE9, ex. https://dict.youdao.com/dictvoice?audio={{word}}&type=2",ai_dictionary:"Assistant IA",ai_api_url:"URL de l'API",ai_api_url_desc:"Point de terminaison de l'API (d\xE9tecte automatiquement : OpenAI, Claude, Gemini)",ai_api_key:"Cl\xE9 API",ai_api_key_desc:"Votre cl\xE9 API IA",ai_model:"Mod\xE8le",ai_model_desc:"Nom du mod\xE8le IA (ex., gpt-4o-mini, deepseek-chat)",ai_prompt:"Prompt personnalis\xE9",ai_prompt_desc:"Utiliser {{word}} et {{sentence}} comme espaces r\xE9serv\xE9s. L'IA utilisera ce prompt pour g\xE9n\xE9rer des d\xE9finitions",ai_extra_params:"Param\xE8tres suppl\xE9mentaires de la requ\xEAte",ai_extra_params_desc:"Ajouter des param\xE8tres JSON personnalis\xE9s au corps de la requ\xEAte IA (avanc\xE9)",ai_extra_params_placeholder:`{
"temperature": 0.7,
"top_p": 0.9
}`,auto_layout:"Disposition auto du canevas",enable_auto_layout:"Activer la disposition automatique",enable_auto_layout_desc:"Normaliser automatiquement la disposition apr\xE8s ajout/mise \xE0 jour/suppression et changements de groupe",card_size:"Taille de carte",card_size_desc:"Taille de carte par d\xE9faut (Largeur \xD7 Hauteur, par d\xE9faut : 260 \xD7 120)",grid_gaps:"Espacement de la grille",grid_gaps_desc:"Espacement horizontal/vertical pour la grille de gauche",left_padding:"Marge gauche et X min",left_padding_desc:"Marge gauche depuis le groupe Mastered et X minimale pour la zone gauche",columns_auto:"Colonnes auto",columns_auto_desc:"D\xE9terminer automatiquement les colonnes (limit\xE9 par le max)",columns:"Colonnes fixes / Colonnes max",columns_desc:"Sp\xE9cifier colonnes fixes et max (quand auto est d\xE9sactiv\xE9)",group_inner_layout:"Disposition interne du groupe",group_inner_layout_desc:"Marge interne, espacements et colonnes pour les n\u0153uds dans les groupes",highlight_scope:"Port\xE9e de surbrillance",highlight_mode:"Mode de surbrillance",highlight_mode_desc:"Choisir le mode de port\xE9e pour la surbrillance des mots",mode_all:"Tous les fichiers",mode_exclude:"Exclure les chemins sp\xE9cifi\xE9s",mode_include:"Uniquement les chemins sp\xE9cifi\xE9s",highlight_paths:"Chemins de fichiers",highlight_paths_desc:"S\xE9parer plusieurs chemins par des virgules, prend en charge les chemins de dossiers (y compris les sous-dossiers)",highlight_paths_placeholder:"ex : Archive, Templates, Private/Diary",file_node_parse_mode:"Mode d'analyse de noeud de fichier",file_node_parse_mode_desc:"Choisir comment analyser les cartes de fichiers dans Canvas",mode_filename:"Nom de fichier uniquement",mode_content:"Contenu de fichier uniquement",mode_filename_with_alias:"Nom de fichier comme mot, contenu comme alias",selection_translate:"Traduction par s\xE9lection",enable_selection_translate:"Activer la traduction par s\xE9lection",enable_selection_translate_desc:"Afficher une fen\xEAtre de traduction lors de la s\xE9lection de texte",translate_target_lang:"Langue cible",translate_target_lang_desc:"Code de la langue cible (ex. zh-CN, en, ja)",translate_prompt:"Prompt de traduction",translate_prompt_desc:"Mod\xE8le de prompt pour la traduction IA. Utilisez {{text}} et {{to}} comme marqueurs"},sidebar:{title:"HiWords",empty_state:"Aucun mot trouv\xE9. Ajoutez des mots \xE0 vos livres pour les voir ici.",source_prefix:"De : ",found:"Trouv\xE9s",words:"mots",no_definition:"Aucune d\xE9finition disponible.",vocabulary_book:"Mots",mastered:"Ma\xEEtris\xE9s",no_learning_words:"Aucun mot \xE0 apprendre",no_mastered_words:"Aucun mot ma\xEEtris\xE9"},commands:{refresh_vocabulary:"Actualiser le vocabulaire",add_word:"HiWords : Ajouter un mot",edit_word:"HiWords : \xC9diter un mot",show_sidebar:"Afficher la barre lat\xE9rale HiWords",add_selected_word:"Ajouter un mot"},notices:{vocabulary_refreshed:"Livres actualis\xE9s",word_added:"Mot ajout\xE9 au livre",word_exists:"Le mot existe d\xE9j\xE0 dans le livre",error_adding_word:"Erreur lors de l'ajout du mot au livre",select_book_required:"Veuillez s\xE9lectionner un livre de mots",adding_word:"Ajout du mot au livre...",updating_word:"Mise \xE0 jour du mot...",word_added_success:'Le mot "{0}" a \xE9t\xE9 ajout\xE9 avec succ\xE8s',word_updated_success:'Le mot "{0}" a \xE9t\xE9 mis \xE0 jour avec succ\xE8s',add_word_failed:"\xC9chec de l'ajout du mot, v\xE9rifiez le fichier du livre",update_word_failed:"\xC9chec de la mise \xE0 jour, v\xE9rifiez le fichier du livre",error_processing_word:"Erreur lors du traitement du mot",no_canvas_files:"Aucun fichier Canvas trouv\xE9",book_already_exists:"Ce livre existe d\xE9j\xE0",invalid_canvas_file:"Fichier Canvas invalide",book_added:"Livre ajout\xE9 : {0}",book_reloaded:"Livre recharg\xE9 : {0}",book_removed:"Livre supprim\xE9 : {0}",deleting_word:"Suppression du mot...",word_deleted:"Mot supprim\xE9",delete_word_failed:"\xC9chec de la suppression du mot, v\xE9rifiez le fichier du livre",error_deleting_word:"Une erreur est survenue lors de la suppression du mot",mastered_feature_disabled:"La fonction ma\xEEtris\xE9 n'est pas activ\xE9e",update_word_status_failed:"\xC9chec de la mise \xE0 jour du statut du mot",move_to_mastered_group_failed:"\xC9chec du d\xE9placement vers le groupe ma\xEEtris\xE9",word_marked_as_mastered:'"{0}" marqu\xE9 comme ma\xEEtris\xE9',mark_mastered_failed:"\xC9chec du marquage, veuillez r\xE9essayer",remove_from_mastered_group_failed:"\xC9chec du retrait du groupe ma\xEEtris\xE9",word_unmarked_as_mastered:'"{0}" retir\xE9 du statut ma\xEEtris\xE9',no_text_selected:"Veuillez d'abord s\xE9lectionner un mot \xE0 ajouter",word_required:"Veuillez entrer un mot",unmark_mastered_failed:"\xC9chec de la suppression de la marque, veuillez r\xE9essayer",batch_marked_success:"{0} mots marqu\xE9s comme ma\xEEtris\xE9s avec succ\xE8s",book_path_updated:"Chemin du livre mis \xE0 jour : {0}",new_notice:"Nouvelle notification" Line truncated
Cette action est irr\xE9versible.`},actions:{expand:"D\xE9ployer",collapse:"Replier",mark_mastered:"Marquer comme ma\xEEtris\xE9",unmark_mastered:"Retirer le statut ma\xEEtris\xE9"},translate:{text_empty:"Le texte de traduction ne peut pas \xEAtre vide",translating:"Traduction en cours...",failed:"La traduction a \xE9chou\xE9, veuillez r\xE9essayer",ai_not_configured:"Traduction IA non configur\xE9e. Configurez l'API dans les param\xE8tres",invalid_response:"Le service de traduction a renvoy\xE9 une r\xE9ponse non valide"},ai_errors:{word_empty:"Le mot ne peut pas \xEAtre vide",api_key_not_configured:"La cl\xE9 API n'est pas configur\xE9e. Veuillez la d\xE9finir dans les param\xE8tres du plugin",invalid_response:"L'API a renvoy\xE9 un format de r\xE9ponse invalide",api_key_invalid:"\u274C La cl\xE9 API est invalide ou expir\xE9e. Veuillez v\xE9rifier les param\xE8tres du plugin",rate_limit:"\u23F1\uFE0F Limite de d\xE9bit de l'API d\xE9pass\xE9e. Veuillez r\xE9essayer plus tard",server_error:"\u{1F527} Le service API est temporairement indisponible. Veuillez r\xE9essayer plus tard",network_error:"\u{1F310} \xC9chec de la connexion r\xE9seau. Veuillez v\xE9rifier vos param\xE8tres r\xE9seau",request_failed:"La requ\xEAte au dictionnaire IA a \xE9chou\xE9",invalid_json_format:"Format JSON invalide, veuillez v\xE9rifier la syntaxe"}};var rt={plugin_name:"HiWords",settings:{vocabulary_books:"W\xF6rterb\xFCcher",add_vocabulary_book:"W\xF6rterbuch hinzuf\xFCgen",remove_vocabulary_book:"Entfernen",show_definition_on_hover:"Definition beim Hover anzeigen",show_definition_on_hover_desc:"Definition anzeigen, wenn der Mauszeiger \xFCber hervorgehobene W\xF6rter f\xE4hrt",enable_auto_highlight:"Automatisches Hervorheben aktivieren",enable_auto_highlight_desc:"W\xF6rter aus den W\xF6rterb\xFCchern beim Lesen automatisch hervorheben",highlight_style:"Hervorhebungsstil",highlight_style_desc:"W\xE4hlen Sie, wie W\xF6rter im Text hervorgehoben werden",enable_section_tabs:"Abschnitt-Tabs aktivieren",enable_section_tabs_desc:"Mehrteilige Definitionen als Tabs in der Seitenleiste und im Hover-Popup anzeigen",style_underline:"Unterstreichen",style_background:"Hintergrund",style_bold:"Fett",style_dotted:"Gepunktete Unterstreichung",style_wavy:"Wellenf\xF6rmige Unterstreichung",save_settings:"Einstellungen speichern",no_vocabulary_books:"Noch keine W\xF6rterb\xFCcher. F\xFCgen Sie eine Canvas-Datei als W\xF6rterbuch hinzu.",path:"Pfad",reload_book:"Dieses W\xF6rterbuch neu laden",statistics:"Statistiken",total_books:"Gesamtzahl der W\xF6rterb\xFCcher: {0}",enabled_books:"Aktivierte W\xF6rterb\xFCcher: {0}",total_words:"Gesamtzahl der W\xF6rter: {0}",enable_mastered_feature:"Funktion 'Gemeistert' aktivieren",enable_mastered_feature_desc:"Gemeisterte W\xF6rter markieren, um sie nicht mehr hervorzuheben. Seitenleiste zeigt Gruppen",blur_definitions:"Inhalt verwischen",blur_definitions_desc:"Standardm\xE4\xDFig verwischen, beim Hover anzeigen. Ideal zum Erinnern vor dem Anzeigen der Antwort",tts_template:"TTS-Vorlage",tts_template_desc:"{{word}} als Platzhalter verwenden, z.B. https://dict.youdao.com/dictvoice?audio={{word}}&type=2",ai_dictionary:"KI-Assistent",ai_api_url:"API-URL",ai_api_url_desc:"API-Endpunkt (erkennt automatisch: OpenAI, Claude, Gemini)",ai_api_key:"API-Schl\xFCssel",ai_api_key_desc:"Ihr KI-API-Schl\xFCssel",ai_model:"Modell",ai_model_desc:"KI-Modellname (z.B. gpt-4o-mini, deepseek-chat)",ai_prompt:"Benutzerdefinierter Prompt",ai_prompt_desc:"{{word}} und {{sentence}} als Platzhalter verwenden. Die KI wird diesen Prompt verwenden, um Definitionen zu generieren",ai_extra_params:"Zus\xE4tzliche Anfrageparameter",ai_extra_params_desc:"Benutzerdefinierte JSON-Parameter zum Anfrage-Body der KI hinzuf\xFCgen (fortgeschritten)",ai_extra_params_placeholder:`{
"temperature": 0.7,
"top_p": 0.9
}`,auto_layout:"Automatisches Canvas-Layout",enable_auto_layout:"Automatisches Layout aktivieren",enable_auto_layout_desc:"Layout nach Hinzuf\xFCgen/Aktualisieren/L\xF6schen und Gruppen\xE4nderungen automatisch normalisieren",card_size:"Kartengr\xF6\xDFe",card_size_desc:"Standard-Kartengr\xF6\xDFe (Breite \xD7 H\xF6he, Standard: 260 \xD7 120)",grid_gaps:"Gitterabst\xE4nde",grid_gaps_desc:"Horizontale/vertikale Abst\xE4nde f\xFCr das linke Gitter",left_padding:"Linker Innenabstand & min. X",left_padding_desc:"Linker Abstand zur Gruppe 'Mastered' und minimale X-Position f\xFCr den linken Bereich",columns_auto:"Automatische Spalten",columns_auto_desc:"Spalten automatisch bestimmen (begrenzt durch maximale Spalten)",columns:"Feste Spalten / Maximale Spalten",columns_desc:"Feste Spalten und Maximalspalten angeben (wirksam, wenn auto aus)",group_inner_layout:"Inneres Gruppenlayout",group_inner_layout_desc:"Innenabstand, Abst\xE4nde und Spalten f\xFCr Knoten in Gruppen",highlight_scope:"Hervorhebungsbereich",highlight_mode:"Hervorhebungsmodus",highlight_mode_desc:"W\xE4hlen Sie den Bereichsmodus f\xFCr die Wort-Hervorhebung",mode_all:"Alle Dateien",mode_exclude:"Angegebene Pfade ausschlie\xDFen",mode_include:"Nur angegebene Pfade",highlight_paths:"Dateipfade",highlight_paths_desc:"Mehrere Pfade durch Kommas trennen, unterst\xFCtzt Ordnerpfade (einschlie\xDFlich Unterordner)",highlight_paths_placeholder:"z.B.: Archive, Templates, Private/Diary",file_node_parse_mode:"Dateiknoten-Analysemodus",file_node_parse_mode_desc:"W\xE4hlen Sie, wie Dateikarten in Canvas analysiert werden",mode_filename:"Nur Dateiname",mode_content:"Nur Dateiinhalt",mode_filename_with_alias:"Dateiname als Wort, Inhalt als Alias",selection_translate:"Auswahl\xFCbersetzung",enable_selection_translate:"Auswahl\xFCbersetzung aktivieren",enable_selection_translate_desc:"\xDCbersetzungs-Popup anzeigen, wenn Text ausgew\xE4hlt wird",translate_target_lang:"Zielsprache",translate_target_lang_desc:"Zielsprachcode (z.B. zh-CN, en, ja)",translate_prompt:"\xDCbersetzungs-Prompt",translate_prompt_desc:"KI-\xDCbersetzungs-Prompt-Vorlage. Verwenden Sie {{text}} und {{to}} als Platzhalter"},sidebar:{title:"HiWords",empty_state:"Keine W\xF6rter gefunden. F\xFCgen Sie W\xF6rter zu Ihren W\xF6rterb\xFCchern hinzu, um sie hier zu sehen.",source_prefix:"Von: ",found:"Gefunden",words:"W\xF6rter",no_definition:"Keine Definition verf\xFCgbar.",vocabulary_book:"W\xF6rter",mastered:"Gemeistert",no_learning_words:"Keine zu lernenden W\xF6rter",no_mastered_words:"Keine gemeisterten W\xF6rter"},commands:{refresh_vocabulary:"Vokabular aktualisieren",add_word:"HiWords: Wort hinzuf\xFCgen",edit_word:"HiWords: Wort bearbeiten",show_sidebar:"HiWords-Seitenleiste anzeigen",add_selected_word:"Wort hinzuf\xFCgen"},notices:{vocabulary_refreshed:"W\xF6rterb\xFCcher aktualisiert",word_added:"Wort zum W\xF6rterbuch hinzugef\xFCgt",word_exists:"Wort existiert bereits im W\xF6rterbuch",error_adding_word:"Fehler beim Hinzuf\xFCgen des Wortes zum W\xF6rterbuch",select_book_required:"Bitte w\xE4hlen Sie ein W\xF6rterbuch aus",adding_word:"Wort wird zum W\xF6rterbuch hinzugef\xFCgt...",updating_word:"Wort wird aktualisiert...",word_added_success:'Wort "{0}" erfolgreich hinzugef\xFCgt',word_updated_success:'Wort "{0}" erfolgreich aktualisiert',add_word_failed:"Hinzuf\xFCgen des Wortes fehlgeschlagen, pr\xFCfen Sie die Datei",update_word_failed:"Aktualisieren des Wortes fehlgeschlagen, pr\xFCfen Sie die Datei",error_processing_word:"Fehler bei der Verarbeitung des Wortes",no_canvas_files:"Keine Canvas-Dateien gefunden",book_already_exists:"Dieses W\xF6rterbuch existiert bereits",invalid_canvas_file:"Ung\xFCltige Canvas-Datei",book_added:"W\xF6rterbuch hinzugef\xFCgt: {0}",book_reloaded:"W\xF6rterbuch neu geladen: {0}",book_removed:"W\xF6rterbuch entfernt: {0}",deleting_word:"Wort wird gel\xF6scht...",word_deleted:"Wort gel\xF6scht",delete_word_failed:"L\xF6schen des Wortes fehlgeschlagen, pr\xFCfen Sie die Datei",error_deleting_word:"Beim L\xF6schen des Wortes ist ein Fehler aufgetreten",mastered_feature_disabled:"Funktion 'Gemeistert' ist nicht aktiviert",update_word_status_failed:"Aktualisieren des Wortstatus fehlgeschlagen",move_to_mastered_group_failed:"Verschieben in die Gruppe 'Gemeistert' fehlgeschlagen",word_marked_as_mastered:'"{0}" als gemeistert markiert',mark_mastered_failed:"Als gemeistert markieren fehlgeschlagen, bitte erneut versuchen",remove_from_mastered_group_failed:"Entfernen aus der Gruppe 'Gemeistert' fehlgeschlagen",word_unmarked_as_mastered:'"{0}" nicht mehr als gemeistert markiert',no_text_selected:"Bitte w\xE4hlen Sie zuerst ein Wort aus",word_required:"Bitte geben Sie ein Wort ein",unmark_mastered_failed:"Markierung konnte nicht entfernt werden, bitte erneut versuchen",batch_marked_success:"{0} W\xF6rter erfolgreich als gemeistert markiert",book_path_updated:"W\xF6rterbuchpfad aktualisiert: {0}",new_notice:"Neue Benachrichtigung"},modals:{auto_fill_definition:"KI-De Line truncated
Diese Aktion kann nicht r\xFCckg\xE4ngig gemacht werden.`},actions:{expand:"Erweitern",collapse:"Einklappen",mark_mastered:"Als beherrscht markieren",unmark_mastered:"Beherrschung aufheben"},translate:{text_empty:"Der \xDCbersetzungstext darf nicht leer sein",translating:"\xDCbersetzen...",failed:"\xDCbersetzung fehlgeschlagen, bitte erneut versuchen",ai_not_configured:"KI-\xDCbersetzung nicht konfiguriert. Bitte API in den Einstellungen einrichten",invalid_response:"Der \xDCbersetzungsdienst hat eine ung\xFCltige Antwort zur\xFCckgegeben"},ai_errors:{word_empty:"Das Wort darf nicht leer sein",api_key_not_configured:"API-Schl\xFCssel ist nicht konfiguriert. Bitte in den Plugin-Einstellungen festlegen",invalid_response:"Die API hat ein ung\xFCltiges Antwortformat zur\xFCckgegeben",api_key_invalid:"\u274C API-Schl\xFCssel ist ung\xFCltig oder abgelaufen. Bitte \xFCberpr\xFCfen Sie die Plugin-Einstellungen",rate_limit:"\u23F1\uFE0F API-Ratenlimit \xFCberschritten. Bitte versuchen Sie es sp\xE4ter erneut",server_error:"\u{1F527} API-Dienst ist vor\xFCbergehend nicht verf\xFCgbar. Bitte versuchen Sie es sp\xE4ter erneut",network_error:"\u{1F310} Netzwerkverbindung fehlgeschlagen. Bitte \xFCberpr\xFCfen Sie Ihre Netzwerkeinstellungen",request_failed:"KI-W\xF6rterbuch-Anfrage fehlgeschlagen",invalid_json_format:"Ung\xFCltiges JSON-Format, bitte pr\xFCfen Sie die Syntax"}};var at={plugin_name:"HiWords",settings:{vocabulary_books:"\u5358\u8A9E\u5E33",add_vocabulary_book:"\u5358\u8A9E\u5E33\u3092\u8FFD\u52A0",remove_vocabulary_book:"\u524A\u9664",show_definition_on_hover:"\u30DB\u30D0\u30FC\u3067\u5B9A\u7FA9\u3092\u8868\u793A",show_definition_on_hover_desc:"\u5F37\u8ABF\u8868\u793A\u3055\u308C\u305F\u5358\u8A9E\u306B\u30DE\u30A6\u30B9\u3092\u4E57\u305B\u308B\u3068\u5B9A\u7FA9\u3092\u8868\u793A\u3057\u307E\u3059",enable_auto_highlight:"\u81EA\u52D5\u30CF\u30A4\u30E9\u30A4\u30C8\u3092\u6709\u52B9\u5316",enable_auto_highlight_desc:"\u8AAD\u66F8\u4E2D\u306B\u5358\u8A9E\u5E33\u306E\u5358\u8A9E\u3092\u81EA\u52D5\u7684\u306B\u30CF\u30A4\u30E9\u30A4\u30C8\u3057\u307E\u3059",highlight_style:"\u30CF\u30A4\u30E9\u30A4\u30C8\u30B9\u30BF\u30A4\u30EB",highlight_style_desc:"\u30C6\u30AD\u30B9\u30C8\u4E2D\u306E\u5358\u8A9E\u306E\u30CF\u30A4\u30E9\u30A4\u30C8\u65B9\u6CD5\u3092\u9078\u629E",enable_section_tabs:"\u30BB\u30AF\u30B7\u30E7\u30F3\u30BF\u30D6\u3092\u6709\u52B9\u5316",enable_section_tabs_desc:"\u8907\u6570\u30BB\u30AF\u30B7\u30E7\u30F3\u306E\u5B9A\u7FA9\u3092\u30B5\u30A4\u30C9\u30D0\u30FC\u3068\u30DB\u30D0\u30FC\u30DD\u30C3\u30D7\u30AA\u30FC\u30D0\u30FC\u3067\u30BF\u30D6\u8868\u793A\u3057\u307E\u3059",style_underline:"\u4E0B\u7DDA",style_background:"\u80CC\u666F",style_bold:"\u592A\u5B57",style_dotted:"\u70B9\u7DDA\u306E\u4E0B\u7DDA",style_wavy:"\u6CE2\u7DDA\u306E\u4E0B\u7DDA",save_settings:"\u8A2D\u5B9A\u3092\u4FDD\u5B58",no_vocabulary_books:"\u5358\u8A9E\u5E33\u304C\u307E\u3060\u3042\u308A\u307E\u305B\u3093\u3002Canvas \u30D5\u30A1\u30A4\u30EB\u3092\u5358\u8A9E\u5E33\u3068\u3057\u3066\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",path:"\u30D1\u30B9",reload_book:"\u3053\u306E\u5358\u8A9E\u5E33\u3092\u518D\u8AAD\u307F\u8FBC\u307F",statistics:"\u7D71\u8A08",total_books:"\u5358\u8A9E\u5E33\u306E\u5408\u8A08: {0}",enabled_books:"\u6709\u52B9\u306A\u5358\u8A9E\u5E33: {0}",total_words:"\u5358\u8A9E\u306E\u5408\u8A08: {0}",enable_mastered_feature:"\u7FD2\u5F97\u6E08\u307F\u6A5F\u80FD\u3092\u6709\u52B9\u5316",enable_mastered_feature_desc:"\u7FD2\u5F97\u6E08\u307F\u306E\u5358\u8A9E\u3092\u30DE\u30FC\u30AF\u3057\u3066\u30CF\u30A4\u30E9\u30A4\u30C8\u3092\u505C\u6B62\u3002\u30B5\u30A4\u30C9\u30D0\u30FC\u306B\u30B0\u30EB\u30FC\u30D7\u8868\u793A",blur_definitions:"\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u307C\u304B\u3059",blur_definitions_desc:"\u30C7\u30D5\u30A9\u30EB\u30C8\u3067\u307C\u304B\u3057\u3001\u30DB\u30D0\u30FC\u6642\u306B\u8868\u793A\u3002\u5B66\u7FD2\u6642\u306B\u7B54\u3048\u3092\u898B\u308B\u524D\u306B\u601D\u3044\u51FA\u3059\u306E\u306B\u6700\u9069",tts_template:"TTS\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8",tts_template_desc:"{{word}}\u3092\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u3068\u3057\u3066\u4F7F\u7528\u3001\u4F8B\uFF1Ahttps://dict.youdao.com/dictvoice?audio={{word}}&type=2",ai_dictionary:"AI\u30A2\u30B7\u30B9\u30BF\u30F3\u30C8",ai_api_url:"API URL",ai_api_url_desc:"API\u30A8\u30F3\u30C9\u30DD\u30A4\u30F3\u30C8\uFF08\u81EA\u52D5\u691C\u51FA\uFF1AOpenAI\u3001Claude\u3001Gemini\uFF09",ai_api_key:"API\u30AD\u30FC",ai_api_key_desc:"\u3042\u306A\u305F\u306EAI API\u30AD\u30FC",ai_model:"\u30E2\u30C7\u30EB",ai_model_desc:"AI\u30E2\u30C7\u30EB\u540D\uFF08\u4F8B\uFF1Agpt-4o-mini\u3001deepseek-chat\uFF09",ai_prompt:"\u30AB\u30B9\u30BF\u30E0\u30D7\u30ED\u30F3\u30D7\u30C8",ai_prompt_desc:"{{word}}\u3068{{sentence}}\u3092\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u3068\u3057\u3066\u4F7F\u7528\u3002AI\u306F\u3053\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u4F7F\u7528\u3057\u3066\u5B9A\u7FA9\u3092\u751F\u6210\u3057 Line truncated
"temperature": 0.7,
"top_p": 0.9
}`,auto_layout:"\u30AD\u30E3\u30F3\u30D0\u30B9\u81EA\u52D5\u30EC\u30A4\u30A2\u30A6\u30C8",enable_auto_layout:"\u81EA\u52D5\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u6709\u52B9\u5316",enable_auto_layout_desc:"\u8FFD\u52A0/\u66F4\u65B0/\u524A\u9664\u304A\u3088\u3073\u30B0\u30EB\u30FC\u30D7\u5909\u66F4\u5F8C\u306B\u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u81EA\u52D5\u6B63\u898F\u5316",card_size:"\u30AB\u30FC\u30C9\u30B5\u30A4\u30BA",card_size_desc:"\u30C7\u30D5\u30A9\u30EB\u30C8\u30AB\u30FC\u30C9\u30B5\u30A4\u30BA\uFF08\u5E45 \xD7 \u9AD8\u3055\u3001\u30C7\u30D5\u30A9\u30EB\u30C8\uFF1A260 \xD7 120\uFF09",grid_gaps:"\u30B0\u30EA\u30C3\u30C9\u9593\u9694",grid_gaps_desc:"\u5DE6\u30B0\u30EA\u30C3\u30C9\u306E\u6C34\u5E73/\u5782\u76F4\u9593\u9694",left_padding:"\u5DE6\u4F59\u767D\u3068\u6700\u5C0F X",left_padding_desc:"Mastered \u30B0\u30EB\u30FC\u30D7\u304B\u3089\u306E\u5DE6\u4F59\u767D\u3068\u5DE6\u30A8\u30EA\u30A2\u306E\u6700\u5C0F X",columns_auto:"\u81EA\u52D5\u30AB\u30E9\u30E0",columns_auto_desc:"\u30AB\u30E9\u30E0\u6570\u3092\u81EA\u52D5\u6C7A\u5B9A\uFF08\u6700\u5927\u30AB\u30E9\u30E0\u6570\u3067\u5236\u9650\uFF09",columns:"\u56FA\u5B9A\u30AB\u30E9\u30E0 / \u6700\u5927\u30AB\u30E9\u30E0",columns_desc:"\u56FA\u5B9A\u30AB\u30E9\u30E0\u3068\u6700\u5927\u30AB\u30E9\u30E0\u3092\u6307\u5B9A\uFF08\u81EA\u52D5\u304C\u30AA\u30D5\u306E\u6642\u306B\u6709\u52B9\uFF09",group_inner_layout:"\u30B0\u30EB\u30FC\u30D7\u5185\u90E8\u30EC\u30A4\u30A2\u30A6\u30C8",group_inner_layout_desc:"\u30B0\u30EB\u30FC\u30D7\u5185\u30CE\u30FC\u30C9\u306E\u5185\u5074\u4F59\u767D\u3001\u9593\u9694\u3001\u30AB\u30E9\u30E0\u8A2D\u5B9A",highlight_scope:"\u30CF\u30A4\u30E9\u30A4\u30C8\u7BC4\u56F2",highlight_mode:"\u30CF\u30A4\u30E9\u30A4\u30C8\u30E2\u30FC\u30C9",highlight_mode_desc:"\u5358\u8A9E\u30CF\u30A4\u30E9\u30A4\u30C8\u306E\u7BC4\u56F2\u30E2\u30FC\u30C9\u3092\u9078\u629E",mode_all:"\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB",mode_exclude:"\u6307\u5B9A\u30D1\u30B9\u3092\u9664\u5916",mode_include:"\u6307\u5B9A\u30D1\u30B9\u306E\u307F",highlight_paths:"\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9",highlight_paths_desc:"\u8907\u6570\u306E\u30D1\u30B9\u3092\u30AB\u30F3\u30DE\u3067\u533A\u5207\u308A\u3001\u30D5\u30A9\u30EB\u30C0\u30D1\u30B9\u3092\u30B5\u30DD\u30FC\u30C8\uFF08\u30B5\u30D6\u30D5\u30A9\u30EB\u30C0\u3092\u542B\u3080\uFF09",highlight_paths_placeholder:"\u4F8B\uFF1AArchive, Templates, Private/Diary",file_node_parse_mode:"\u30D5\u30A1\u30A4\u30EB\u30CE\u30FC\u30C9\u89E3\u6790\u30E2\u30FC\u30C9",file_node_parse_mode_desc:"Canvas \u5185\u306E\u30D5\u30A1\u30A4\u30EB\u30AB\u30FC\u30C9\u306E\u89E3\u6790\u65B9\u6CD5\u3092\u9078\u629E",mode_filename:"\u30D5\u30A1\u30A4\u30EB\u540D\u306E\u307F",mode_content:"\u30D5\u30A1\u30A4\u30EB\u5185\u5BB9\u306E\u307F",mode_filename_with_alias:"\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5358\u8A9E\u3001\u5185\u5BB9\u3092\u30A8\u30A4\u30EA\u30A2\u30B9\u3068\u3057\u3066",selection_translate:"\u9078\u629E\u7FFB\u8A33",enable_selection_translate:"\u9078\u629E\u7FFB\u8A33\u3092\u6709\u52B9\u306B\u3059\u308B",enable_selection_translate_desc:"\u30C6\u30AD\u30B9\u30C8\u3092\u9078\u629E\u3059\u308B\u3068\u7FFB\u8A33\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7\u3092\u8868\u793A",translate_target_lang:"\u30BF\u30FC\u30B2\u30C3\u30C8\u8A00\u8A9E",translate_target_lang_desc:"\u30BF\u30FC\u30B2\u30C3\u30C8\u8A00\u8A9E\u30B3\u30FC\u30C9\uFF08\u4F8B\uFF1Azh-CN\u3001en\u3001ja\uFF09",translate_prompt:"\u7FFB\u8A33\u30D7\u30ED\u30F3\u30D7\u30C8",translate_prompt_desc:"AI\u7FFB\u8A33\u306E\u30D7\u30ED\u30F3\u30D7\u30C8\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3002{{text}}\u3068{{to}}\u3092\u30D7\u30EC\u30FC\u30B9\u30DB\u30EB\u30C0\u30FC\u3068\u3057\u3066\u4F7F\u7528"},sidebar:{title:"HiWords",empty_state:"\u5358\u8A9E\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u5358\u8A9E\u5E33\u306B\u8FFD\u52A0\u3059\u308B\u3068\u3053\u3053\u306B\u8868\u793A\u3055\u308C\u307E\u3059\u3002",source_prefix:"\u51FA\u5178: ",found:"\u898B\u3064\u304B\u3063\u305F",words:"\u5358\u8A9E",no_definition:"\u5B9A\u7FA9\u306F\u3042\u308A\u307E\u305B\u3093\u3002",vocabulary_book:"\u5358\u8A9E",mastered:"\u7FD2\u5F97\u6E08\u307F",no_learning_words:"\u5B66\u7FD2\u3059\u308B\u5358\u8A9E\u306F\u3042\u308A\u307E\u305B\u3093",no_mastered_words:"\u7FD2\u5F97\u6E08\u307F\u306E\u5358\u8A9E\u306F\u3042\u308A\u307E\u305B\u3093"},commands:{refresh_vocabulary:"\u5358\u8A9E\u5E33\u3092\u66F4\u65B0",add_word:"HiWords: \u5358\u8A9E\u3092\u8FFD\u52A0",edit_word:"HiWords: \u5358\u8A9E\u3092\u7DE8\u96C6",show_sidebar:"HiWords \u30B5\u30A4\u30C9\u30D0\u30FC\u3092\u8868\u793A",add_selected_word:"\u5358\u8A9E\u3092\u8FFD\u52A0"},notices:{vocabulary_refreshed:"\u5358\u8A9E\u5E33\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F",word_added:"\u5358\u8A9E\u3092\u5358\u8A9E\u5E33\u306B\u8FFD\u52A0\u3057\u307E\u3057\u305F",word_exists:"\u5358\u8A9E\u306F\u3059\u3067\u306B\u5358\u8A9E\u5E33\u306B\u5B58\u5728\u3057\u307E\u3059",error_adding_word:"\u5358\u8A9E\u306E\u8FFD\u52A0\u4E2D\u306B\u30A8\u30E9\u30FC\u304 Line truncated
\u3053\u306E\u64CD\u4F5C\u306F\u5143\u306B\u623B\u305B\u307E\u305B\u3093\u3002`},actions:{expand:"\u5C55\u958B",collapse:"\u6298\u308A\u305F\u305F\u3080",mark_mastered:"\u7FD2\u5F97\u6E08\u307F\u306B\u3059\u308B",unmark_mastered:"\u7FD2\u5F97\u6E08\u307F\u3092\u89E3\u9664"},translate:{text_empty:"\u7FFB\u8A33\u30C6\u30AD\u30B9\u30C8\u306F\u7A7A\u306B\u3067\u304D\u307E\u305B\u3093",translating:"\u7FFB\u8A33\u4E2D...",failed:"\u7FFB\u8A33\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044",ai_not_configured:"AI\u7FFB\u8A33\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u8A2D\u5B9A\u3067API\u3092\u69CB\u6210\u3057\u3066\u304F\u3060\u3055\u3044",invalid_response:"\u7FFB\u8A33\u30B5\u30FC\u30D3\u30B9\u304C\u7121\u52B9\u306A\u30EC\u30B9\u30DD\u30F3\u30B9\u3092\u8FD4\u3057\u307E\u3057\u305F"},ai_errors:{word_empty:"\u5358\u8A9E\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044",api_key_not_configured:"API\u30AD\u30FC\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u30D7\u30E9\u30B0\u30A4\u30F3\u8A2D\u5B9A\u3067\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",invalid_response:"API\u304C\u7121\u52B9\u306A\u5FDC\u7B54\u5F62\u5F0F\u3092\u8FD4\u3057\u307E\u3057\u305F",api_key_invalid:"\u274C API\u30AD\u30FC\u304C\u7121\u52B9\u307E\u305F\u306F\u671F\u9650\u5207\u308C\u3067\u3059\u3002\u30D7\u30E9\u30B0\u30A4\u30F3\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",rate_limit:"\u23F1\uFE0F API\u30EC\u30FC\u30C8\u5236\u9650\u3092\u8D85\u3048\u307E\u3057\u305F\u3002\u5F8C\u3067\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044",server_error:"\u{1F527} API\u30B5\u30FC\u30D3\u30B9\u304C\u4E00\u6642\u7684\u306B\u5229\u7528\u3067\u304D\u307E\u305B\u3093\u3002\u5F8C\u3067\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044",network_error:"\u{1F310} \u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u8A2D\u5B9A\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044",request_failed:"AI\u8F9E\u66F8\u30EA\u30AF\u30A8\u30B9\u30C8\u304C\u5931\u6557\u3057\u307E\u3057\u305F",invalid_json_format:"JSON \u5F62\u5F0F\u304C\u7121\u52B9\u3067\u3059\u3002\u69CB\u6587\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044"}};var xt={en:Ze,zh:et,es:tt,fr:it,de:rt,ja:at},We=class l{constructor(){this.app=null}static getInstance(){return l.instance||(l.instance=new l),l.instance}setApp(i){this.app=i}getCurrentLocale(){let i=(0,st.getLanguage)();return i.startsWith("zh")?"zh":i.startsWith("es")?"es":i.startsWith("fr")?"fr":i.startsWith("de")?"de":i.startsWith("ja")||i.startsWith("jp")?"ja":"en"}t(i){let e=this.getCurrentLocale(),t=xt[e],r=i.split("."),a=t;for(let s of r)if(a&&a[s]!==void 0)a=a[s];else return console.warn(`\u7FFB\u8BD1\u952E ${i} \u4E0D\u5B58\u5728\u4E8E ${e} \u8BED\u8A00\u5305\u4E2D`),i;return a}},Pe=We.getInstance(),d=l=>Pe.t(l);var ne=class{constructor(i,e){this.plugin=i,this.vocabularyManager=e,this.masteredGroupManager=new se(i.app,i.settings)}updateSettings(){this.masteredGroupManager.updateSettings(this.plugin.settings)}get isEnabled(){return this.plugin.settings.enableMasteredFeature}async markWordAsMastered(i,e,t){var r;if(!this.isEnabled)return new D.Notice(d("notices.mastered_feature_disabled")),!1;try{let a=(r=this.plugin.settings.masteredDetection)!=null?r:"group";if(!await this.updateWordMasteredStatus(i,e,!0))return new D.Notice(d("notices.update_word_status_failed")),!1;if(a==="group"){if(!await this.masteredGroupManager.moveToMasteredGroup(i,e))return await this.updateWordMasteredStatus(i,e,!1),new D.Notice(d("notices.move_to_mastered_group_failed")),!1}else if(!await this.vocabularyManager.setNodeColor(i,e,4))return await this.updateWordMasteredStatus(i,e,!1),new D.Notice(d("notices.update_word_status_failed")),!1;return this.plugin.refreshHighlighter(),this.plugin.app.workspace.trigger("hi-words:mastered-changed"),new D.Notice(d("notices.word_marked_as_mastered").replace("{0}",t)),!0}catch(a){return console.error("\u6807\u8BB0\u5DF2\u638C\u63E1\u5931\u8D25:",a),new D.Notice(d("notices.mark_mastered_failed")),!1}}async unmarkWordAsMastered(i,e,t){var r;if(!this.isEnabled)return new D.Notice(d("notices.mastered_feature_disabled")),!1;try{let a=(r=this.plugin.settings.masteredDetection)!=null?r:"group";if(!await this.updateWordMasteredStatus(i,e,!1))return new D.Notice(d("notices.update_word_status_failed")),!1;if(a==="group"){if(!await this.masteredGroupManager.removeFromMasteredGroup(i,e))return await this.updateWordMasteredStatus(i,e,!0),new D.Notice(d("notices.remove_from_mastered_group_failed")),!1}else if(!await this.vocabularyManager.setNodeColor(i,e,void 0))return await this.updateWordMasteredStatus(i,e,!0),new D.Notice(d("notices.update_word_status_failed")),!1;return this.plugin.refreshHighlighter(),this.plugin.app.workspace.trigger("hi-words:mastered-changed"),new D.Notice(d("n Line truncated
`)}),t.trim()||document.querySelectorAll(".pdf-container, .mod-pdf").forEach(a=>{let s=a.textContent||"";s.trim()&&(t+=s+`
`)}),t.trim()}catch(e){return console.error("PDF \u6587\u672C\u63D0\u53D6\u5931\u8D25:",e),""}}buildSearchRegex(e){let t=this.escapeRegExp(e),r=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u.test(e),a=r?`${t}`:`\\b${t}\\b`,s=r?"giu":"gi";return new RegExp(a,s)}bindInternalLinksAndTags(e,t,r){e.querySelectorAll("a.internal-link").forEach(a=>{var n;let s=a,o=(s.getAttribute("href")||((n=s.dataset)==null?void 0:n.href)||"").trim();o&&(s.addEventListener("mouseover",c=>{this.app.workspace.trigger("hover-link",{event:c,source:"hi-words",hoverParent:r,target:s,linktext:o,sourcePath:t})}),s.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),this.app.workspace.openLinkText(o,t)}))}),e.querySelectorAll("a.tag").forEach(a=>{let s=a,o=(s.getAttribute("href")||s.textContent||"").trim();o&&s.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.openOrUpdateSearch(o.startsWith("#")?o:`#${o}`)})})}openOrUpdateSearch(e){var t;try{let r=this.app.workspace.getLeavesOfType("search");if(r.length>0){let a=r[0].view;(t=a.setQuery)==null||t.call(a,e),this.app.workspace.revealLeaf(r[0]);return}new H.Notice(d("notices.enable_search_plugin")||"\u8BF7\u5148\u542F\u7528\u6838\u5FC3\u641C\u7D22\u63D2\u4EF6")}catch(r){console.error("\u6253\u5F00\u641C\u7D22\u5931\u8D25:",r)}}async navigateToSource(e){try{let t=this.app.vault.getAbstractFileByPath(e.source);t instanceof H.TFile&&(t.extension==="canvas"?await this.app.workspace.openLinkText(t.path,""):(await this.app.workspace.openLinkText(t.path,""),setTimeout(()=>{var a;let r=this.app.workspace.getActiveViewOfType(H.MarkdownView);if(r&&((a=r.file)==null?void 0:a.path)===t.path){let s=r.editor,n=s.getValue().toLowerCase().indexOf(e.word.toLowerCase());if(n!==-1){let c=s.offsetToPos(n);s.setCursor(c),s.scrollIntoView({from:c,to:c},!0)}}},100)))}catch(t){console.error("\u5BFC\u822A\u5230\u6E90\u6587\u4EF6\u5931\u8D25:",t)}}refresh(){this.currentFile=null,this.scheduleUpdate(0)}};var I=require("obsidian");var Y=class Y extends I.Component{constructor(e){super();this.activeTooltip=null;this.vocabularyManager=null;this.masteredService=null;this.eventHandlers={};this.currentTargetEl=null;this.hoverIntentTimer=null;this.lastShowTs=0;this.currentTooltipComponent=null;this.app=e.app,this.plugin=e,this.eventHandlers={mouseover:t=>this.handleMouseOver(t),mouseout:t=>this.handleMouseOut(t),scroll:(()=>this.removeTooltip()).bind(this),resize:(()=>this.removeTooltip()).bind(this)},this.registerEvents()}bindInternalLinksAndTags(e,t,r){e.querySelectorAll("a.internal-link").forEach(a=>{var n;let s=a,o=(s.getAttribute("href")||((n=s.dataset)==null?void 0:n.href)||"").trim();o&&(s.addEventListener("mouseover",c=>{this.app.workspace.trigger("hover-link",{event:c,source:"hi-words",hoverParent:r,target:s,linktext:o,sourcePath:t})}),s.addEventListener("click",c=>{c.preventDefault(),c.stopPropagation(),this.app.workspace.openLinkText(o,t),this.removeTooltip()}))}),e.querySelectorAll("a.tag").forEach(a=>{let s=a,o=(s.getAttribute("href")||s.textContent||"").trim();o&&s.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this.openOrUpdateSearch(o.startsWith("#")?o:`#${o}`),this.removeTooltip()})})}openOrUpdateSearch(e){var t;try{let r=this.app.workspace.getLeavesOfType("search");if(r.length>0){let a=r[0].view;(t=a.setQuery)==null||t.call(a,e),this.app.workspace.revealLeaf(r[0]);return}new I.Notice(d("notices.enable_search_plugin")||"\u8BF7\u5148\u542F\u7528\u6838\u5FC3\u641C\u7D22\u63D2\u4EF6")}catch(r){console.error("\u6253\u5F00\u641C\u7D22\u5931\u8D25:",r)}}setVocabularyManager(e){this.vocabularyManager=e}setMasteredService(e){this.masteredService=e}registerEvents(){this.registerDomEvent(document,"mouseover",this.eventHandlers.mouseover),this.registerDomEvent(document,"mouseout",this.eventHandlers.mouseout),this.registerDomEvent(window,"scroll",this.eventHandlers.scroll,{passive:!0}),this.registerDomEvent(window,"resize",this.eventHandlers.resize)}handleMouseOut(e){clearTimeout(this.tooltipHideTimeout),this.hoverIntentTimer!==null&&(clearTimeout(this.hoverIntentTimer),this.hoverIntentTimer=null);let t=e.target,r=e.relatedTarget;r&&this.activeTooltip&&(r===this.activeTooltip||this.activeTooltip.contains(r))||t&&r&&t.classList.contains("hi-words-highlight")&&r.classList.contains("hi-words-highlight")||t&&this.activeTooltip&&this.activeTooltip.contains(t)&&r&&r.classList.contains("hi-words-highlight")||(this.tooltipHideTimeout=window.setTimeout(()=>{this.removeTooltip()},80))}async renderSectionContent(e,t,r){var a,s;if(e.empty(),!t||t.trim()===""){e.textContent=d("sidebar.no_definition");return}try{let o=this.app.workspace.getActiveViewOfType(I.MarkdownView),n=o&&((a=o.file)==null?void 0:a.path)||((s=this.app.workspace.getActiveFile())==null?void 0:s.path)||"";this.currentTooltipComponent&&(this.removeChild(this.currentTooltipComponent),this.currentTooltipComponent=null);let c=new I.Component;this.addChild(c),this.currentTooltipComp Line truncated
Text: {{text}}`,a.addEventListener("blur",async()=>{this.plugin.settings.translatePrompt=a.value,await this.plugin.saveSettings()})}addAutoLayoutSettings(){let{containerEl:e}=this;new w.Setting(e).setName(d("settings.auto_layout")).setHeading(),new w.Setting(e).setName(d("settings.enable_auto_layout")).setDesc(d("settings.enable_auto_layout_desc")).addToggle(t=>{var r;return t.setValue((r=this.plugin.settings.autoLayoutEnabled)!=null?r:!0).onChange(async a=>{this.plugin.settings.autoLayoutEnabled=a,await this.plugin.saveSettings()})}),new w.Setting(e).setName(d("settings.card_size")||"Card size").setDesc(d("settings.card_size_desc")||"Default width and height for canvas cards").addText(t=>{var r;return t.setPlaceholder("260").setValue(String((r=this.plugin.settings.cardWidth)!=null?r:260)).onChange(async a=>{let s=parseInt(a);!isNaN(s)&&s>0&&(this.plugin.settings.cardWidth=s,await this.plugin.saveSettings())})}).addText(t=>{var r;return t.setPlaceholder("120").setValue(String((r=this.plugin.settings.cardHeight)!=null?r:120)).onChange(async a=>{let s=parseInt(a);!isNaN(s)&&s>0&&(this.plugin.settings.cardHeight=s,await this.plugin.saveSettings())})})}display(){let{containerEl:e}=this;e.empty(),this.addVocabularyBooksSection(),this.addFileNodeParseModeSettings(),this.addHighlightingSection(),this.addLearningFeaturesSection(),this.addSelectionTranslateSection(),this.addAutoLayoutSettings()}addHighlightingSection(){let{containerEl:e}=this;new w.Setting(e).setName(d("settings.enable_auto_highlight")||"Highlighting").setHeading(),new w.Setting(e).setName(d("settings.enable_auto_highlight")).setDesc(d("settings.enable_auto_highlight_desc")).addToggle(t=>t.setValue(this.plugin.settings.enableAutoHighlight).onChange(async r=>{this.plugin.settings.enableAutoHighlight=r,await this.plugin.saveSettings(),this.plugin.refreshHighlighter()})),new w.Setting(e).setName(d("settings.show_definition_on_hover")).setDesc(d("settings.show_definition_on_hover_desc")).addToggle(t=>t.setValue(this.plugin.settings.showDefinitionOnHover).onChange(async r=>{this.plugin.settings.showDefinitionOnHover=r,await this.plugin.saveSettings()})),new w.Setting(e).setName(d("settings.enable_section_tabs")).setDesc(d("settings.enable_section_tabs_desc")).addToggle(t=>{var r;return t.setValue((r=this.plugin.settings.enableSectionTabs)!=null?r:!0).onChange(async a=>{this.plugin.settings.enableSectionTabs=a,await this.plugin.saveSettings(),this.plugin.app.workspace.trigger("hi-words:settings-changed")})}),new w.Setting(e).setName(d("settings.highlight_style")).setDesc(d("settings.highlight_style_desc")).addDropdown(t=>t.addOption("underline",d("settings.style_underline")).addOption("background",d("settings.style_background")).addOption("bold",d("settings.style_bold")).addOption("dotted",d("settings.style_dotted")).addOption("wavy",d("settings.style_wavy")).setValue(this.plugin.settings.highlightStyle).onChange(async r=>{this.plugin.settings.highlightStyle=r,await this.plugin.saveSettings(),this.plugin.refreshHighlighter()})),this.addHighlightScopeSettings()}ensureAIDictionaryConfig(){this.plugin.settings.aiDictionary||(this.plugin.settings.aiDictionary={apiUrl:"",apiKey:"",model:"",prompt:""})}async testAIConnection(){if(this.isTestingAIConnection)return;this.ensureAIDictionaryConfig(),this.isTestingAIConnection=!0;let e=new w.Notice(d("notices.testing_ai_connection")||"Testing AI connection...",0);try{let r=await new G(this.plugin.settings.aiDictionary).fetchDefinition("test","This is a test sentence for checking the AI connection.");if(e.hide(),!r.trim())throw new Error(d("ai_errors.invalid_response"));new w.Notice(d("notices.ai_connection_success")||"AI connection successful",5e3)}catch(t){e.hide(),console.error("AI connection test failed:",t);let r=t instanceof Error?t.message:d("notices.ai_connection_failed")||"AI connection test failed";new w.Notice(r,6e3)}finally{this.isTestingAIConnection=!1}}addLearningFeaturesSection(){var h,p;let{containerEl:e}=this;new w.Setting(e).setName(d("settings.enable_mastered_feature")||"Learning Features").setHeading(),new w.Setting(e).setName(d("settings.enable_mastered_feature")).setDesc(d("settings.enable_mastered_feature_desc")).addToggle(g=>g.setValue(this.plugin.settings.enableMasteredFeature).onChange(async f=>{this.plugin.settings.enableMasteredFeature=f,this.plugin.settings.showMasteredInSidebar=f,await this.plugin.saveSettings(),this.plugin.refreshHighlighter(),this.plugin.app.workspace.trigger("hi-words:mastered-changed"),this.display()}));let t=new w.Setting(e).setName(d("settings.mastered_detection")||"Mastered detection mode").setDesc(d("settings.mastered_detection_desc")||'Choose how to detect "mastered": by group or by color (green = 4)');t.addDropdown(g=>{var f;return g.addOption("group",d("settings.mode_group")||"Group mode").addOption("color",d("settings.mode_color")||"Color mode (green = 4)").setValue((f=this.plugin.settings.masteredDetection)!=null?f:"group").onChange(async m=>{var v;this.plug Line truncated
Sentence: {{sentence}}
Format:
1) Part of speech
2) English definition
3) Chinese translation
4) Example sentence (use the original sentence if appropriate)`;s.placeholder=o,s.value=((h=this.plugin.settings.aiDictionary)==null?void 0:h.prompt)||o,s.rows=6,s.addEventListener("blur",async()=>{this.ensureAIDictionaryConfig(),this.plugin.settings.aiDictionary.prompt=s.value,await this.plugin.saveSettings()});let n=new w.Setting(e).setName(d("settings.ai_extra_params")||"Extra Request Parameters").setDesc(d("settings.ai_extra_params_desc")||"Add custom JSON parameters to AI request body (Advanced)");n.settingEl.addClass("hi-words-setting-textarea"),n.controlEl.empty();let u=n.controlEl.createDiv({cls:"hi-words-textarea-container"}).createEl("textarea",{cls:"hi-words-json-editor"});u.placeholder=d("settings.ai_extra_params_placeholder")||`{
"temperature": 0.7,
"top_p": 0.9
}`,u.value=((p=this.plugin.settings.aiDictionary)==null?void 0:p.extraParams)||"{}",u.rows=6,u.addEventListener("blur",async()=>{let g=u.value.trim();try{g&&g!=="{}"&&JSON.parse(g),this.ensureAIDictionaryConfig(),this.plugin.settings.aiDictionary.extraParams=g||"{}",await this.plugin.saveSettings(),u.removeClass("hi-words-json-error")}catch(f){u.addClass("hi-words-json-error"),new w.Notice(d("ai_errors.invalid_json_format")||"Invalid JSON format, please check syntax")}}),new w.Setting(e).setName(d("settings.ai_test_connection")||"Test AI connection").setDesc(d("settings.ai_test_connection_desc")||"Send a small test request to verify your API URL, key, and model").addButton(g=>g.setButtonText(d("settings.ai_test_connection")||"Test AI connection").setCta().onClick(async()=>{await this.testAIConnection()}))}addVocabularyBooksSection(){let{containerEl:e}=this,t=e.createDiv({cls:"hi-words-add-book-container"});t.addEventListener("click",()=>this.showCanvasFilePicker());let r=t.createSpan({text:d("settings.add_vocabulary_book"),cls:"hi-words-add-book-label"}),a=t.createDiv({cls:"clickable-icon hi-words-add-book-icon"});(0,w.setIcon)(a,"plus-circle"),a.setAttribute("aria-label",d("settings.add_vocabulary_book")),this.displayVocabularyBooks(),this.displayStats()}async showCanvasFilePicker(){let e=this.app.vault.getFiles().filter(r=>r.extension==="canvas");if(e.length===0){new w.Notice(d("notices.no_canvas_files"));return}new Ie(this.app,e,async r=>{await this.addVocabularyBook(r)}).open()}async addVocabularyBook(e){if(this.plugin.settings.vocabularyBooks.some(o=>o.path===e.path)){new w.Notice(d("notices.book_already_exists"));return}if(!await new k(this.app,this.plugin.settings).validateCanvasFile(e)){new w.Notice(d("notices.invalid_canvas_file"));return}let s={path:e.path,name:e.basename,enabled:!0};this.plugin.settings.vocabularyBooks.push(s),await this.plugin.saveSettings(),await this.plugin.vocabularyManager.loadVocabularyBook(s),this.plugin.refreshHighlighter(),new w.Notice(d("notices.book_added").replace("{0}",s.name)),this.display()}displayVocabularyBooks(){let{containerEl:e}=this;if(this.plugin.settings.vocabularyBooks.length===0){e.createEl("p",{text:d("settings.no_vocabulary_books"),cls:"setting-item-description"});return}this.plugin.settings.vocabularyBooks.forEach((t,r)=>{let a=new w.Setting(e).setName(t.name).setDesc(`${d("settings.path")}: ${t.path}`),s=a.controlEl.createDiv({cls:"hi-words-book-icons"}),o=s.createDiv({cls:"clickable-icon"});(0,w.setIcon)(o,"refresh-cw"),o.setAttribute("aria-label",d("settings.reload_book")),o.addEventListener("click",async()=>{await this.plugin.vocabularyManager.reloadVocabularyBook(t.path),this.plugin.refreshHighlighter(),new w.Notice(d("notices.book_reloaded").replace("{0}",t.name))});let n=s.createDiv({cls:"clickable-icon mod-warning"});(0,w.setIcon)(n,"trash"),n.setAttribute("aria-label",d("settings.remove_vocabulary_book")),n.addEventListener("click",async()=>{this.plugin.settings.vocabularyBooks.splice(r,1),await this.plugin.saveSettings(),await this.plugin.vocabularyManager.loadAllVocabularyBooks(),this.plugin.refreshHighlighter(),new w.Notice(d("notices.book_removed").replace("{0}",t.name)),this.display()}),a.addToggle(c=>c.setValue(t.enabled).onChange(async u=>{t.enabled=u,await this.plugin.saveSettings(),u?await this.plugin.vocabularyManager.loadVocabularyBook(t):await this.plugin.vocabularyManager.loadAllVocabularyBooks(),this.plugin.refreshHighlighter()}))})}displayStats(){let{containerEl:e}=this,t=this.plugin.vocabularyManager.getStats(),r=e.createEl("div",{cls:"hi-words-stats"}),a=r.createEl("div",{cls:"stat-item"});a.createEl("div",{cls:"stat-value",text:t.totalBooks.toString()}),a.createEl("div",{cls:"stat-label",text:d("settings.total_books").split(":")[0]});let s=r.createEl("div",{cls:"stat-item"});s.createEl("div",{cls:"stat-value",text:t.enabledBooks.toString()}),s.createEl("div",{cls:"stat-label",text:d("settings.enabled_books").split(":")[0]});let o=r.createEl("div",{cls:"stat-item"});o.createEl("div",{cls:"stat-value",text:t.totalWords.toString()}),o.createEl("div",{cls:"stat-label",text:d("settings.total_words").split(":")[0]})}},Ie=class extends w.FuzzySuggestModal{constructor(i,e,t){super(i),this.files=e,this.onSelect=t,this.setPlaceholder(d("modals.select_canvas_file"))}getItems(){return this.files}getItemText(i){return i.path}onChooseItem(i,e){this.onSelect(i)}};var N=require("obsidian");var dt=require("obsidian");var ve=class{constructor(i){this.cache=new Map;this.CACHE_TTL=1800*1e3;this.abortController=null;this.settings=i}updateSettings(i){this.settings=i}async translate(i){if(!(i!=null&&i.trim()))throw new Error(d("translate.text_empty"));let e=i.trim(),t=`ai:${e}`,r=this.cache.get(t);if(r&&Date.now()-r.timestamp<this.CACHE_TTL)return r.content;let a;return a=await this.translateWithAI(e),this.cache.set(t,{content:a,timestamp:Date.now()}),a}abort(){this.abortController&&(this.abortController.abort(),this.abortController=null)}async tr Line truncated
Text: {{text}}`).replace(/\{\{text\}\}/g,i).replace(/\{\{to\}\}/g,t),s=e.apiUrl,o=this.detectAPIType(s),n,c={"Content-Type":"application/json"},u=s;switch(o){case"claude":n={model:e.model,messages:[{role:"user",content:a}],max_tokens:1024},c["x-api-key"]=e.apiKey,c["anthropic-version"]="2023-06-01";break;case"gemini":n={contents:[{parts:[{text:a}]}]},u.includes(":generateContent")||(u=`${u.replace(/\/$/,"")}/models/${e.model}:generateContent`),u=`${u}?key=${e.apiKey}`;break;default:n={model:e.model,messages:[{role:"user",content:a}],temperature:.3,max_tokens:500},c.Authorization=`Bearer ${e.apiKey}`;break}let h=await(0,dt.requestUrl)({url:u,method:"POST",headers:c,body:JSON.stringify(n)});if(h.status>=400)throw new Error(`HTTP ${h.status}: ${h.text}`);let p=h.json,g;switch(o){case"claude":g=(v=(m=p==null?void 0:p.content)==null?void 0:m[0])==null?void 0:v.text;break;case"gemini":g=(P=(T=(y=(b=(_=p==null?void 0:p.candidates)==null?void 0:_[0])==null?void 0:b.content)==null?void 0:y.parts)==null?void 0:T[0])==null?void 0:P.text;break;default:g=(E=(V=(F=p==null?void 0:p.choices)==null?void 0:F[0])==null?void 0:V.message)==null?void 0:E.content;break}if(!g)throw new Error(d("translate.invalid_response"));let f=g.replace(/<think>[\s\S]*?<\/think>/gi,"").trim();return f||(f=g.trim()),f}detectAPIType(i){let e=i.toLowerCase();return e.includes("anthropic")?"claude":e.includes("googleapis")||e.includes("generativelanguage")?"gemini":"openai"}clearCache(){this.cache.clear()}};function ct(l,i){if(!l||i<0||i>l.length)return"";let e=/[.!?。!?\n]/,t=i;for(;t>0;){let s=l[t-1];if(e.test(s))break;t--}let r=i;for(;r<l.length;){let s=l[r];if(e.test(s)){r++;break}r++}return l.substring(t,r).trim()}function Z(l){try{let i=l.getCursor(),e=l.getValue(),t=0;for(let r=0;r<i.line;r++)t+=l.getLine(r).length+1;return t+=i.ch,ct(e,t)}catch(i){return console.error("Failed to extract sentence from editor (multiline):",i),""}}function be(l){if(!l||l.rangeCount===0)return"";try{let i=l.getRangeAt(0),e=l.toString().trim();if(!e)return"";let t=i.startContainer;if(t.nodeType===Node.ELEMENT_NODE){let n=t.childNodes[i.startOffset];n&&n.nodeType===Node.TEXT_NODE&&(t=n)}let r=Mt(t);if(!r)return"";let a=r.textContent||"",s=Wt(r,t,i.startOffset,e);if(s===-1)return"";let o=s+Math.floor(e.length/2);return ct(a,o)}catch(i){return console.error("Failed to extract sentence from selection:",i),""}}function Mt(l){var t,r;let i=l;i.nodeType===Node.TEXT_NODE&&(i=i.parentNode);let e=null;for(;i&&i.nodeType!==Node.DOCUMENT_NODE;){if(i.nodeType===Node.ELEMENT_NODE){let a=i,s=(t=a.tagName)==null?void 0:t.toLowerCase();if(s==="p"||s==="li"||s==="blockquote")return a;if(s==="div"){let o=((r=a.textContent)==null?void 0:r.length)||0;o>0&&o<5e3&&(e=a)}if(a.classList.contains("textLayer"))return a;if(a.classList.contains("page")&&a.closest(".pdf-container")){let o=a.querySelector(".textLayer");if(o)return o}}i=i.parentNode}return e}function Wt(l,i,e,t){var n;let r=document.createTreeWalker(l,NodeFilter.SHOW_TEXT,null),a=0,s;for(;s=r.nextNode();){if(s===i||s.contains(i))return a+e;a+=((n=s.textContent)==null?void 0:n.length)||0}return(l.textContent||"").indexOf(t)}var we=class we extends N.Component{constructor(e){super();this.activePopover=null;this.debounceTimer=null;this.currentTranslateText="";this.isTranslating=!1;this.plugin=e,this.translationService=new ve(e.settings)}onload(){this.registerDomEvent(document,"mouseup",e=>{this.handleMouseUp(e)}),this.registerDomEvent(document,"mousedown",e=>{this.activePopover&&!this.activePopover.contains(e.target)&&this.removePopover()}),this.registerDomEvent(window,"scroll",()=>this.removePopover(),{passive:!0}),this.registerDomEvent(window,"resize",()=>this.removePopover()),this.registerDomEvent(document,"keydown",e=>{e.key==="Escape"&&this.activePopover&&this.removePopover()})}updateSettings(){this.translationService.updateSettings(this.plugin.settings)}handleMouseUp(e){this.plugin.settings.enableSelectionTranslate&&(this.activePopover&&this.activePopover.contains(e.target)||(this.debounceTimer!==null&&clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{this.debounceTimer=null,this.tryShowPopover(e)},we.DEBOUNCE_MS)))}tryShowPopover(e){var n;let t=this.getSelectedText();if(!t||t.length===0||t.length>500)return;let r=e.target;if((n=r==null?void 0:r.closest)!=null&&n.call(r,".hi-words-highlight")||this.currentTranslateText===t&&this.activePopover)return;this.currentTranslateText=t;let a=window.getSelection();if(!a||a.rangeCount===0)return;let o=a.getRangeAt(0).getBoundingClientRect();o.width<2&&o.height<2||this.showPopover(t,o,e)}getSelectedText(){let e=this.plugin.app.workspace.getActiveViewOfType(N.MarkdownView),t=e==null?void 0:e.editor,r=e==null?void 0:e.getMode();if(t&&r==="source")return t.getSelection().trim();let a=window.getSelection();return(a==null?void 0:a.toString().trim())||""}getSentence(){let e=this.plugin.app.workspace.getActiveViewOfType(N.MarkdownView),t=e==null?void 0:e.editor, Line truncated
/* nosourcemap */
+11
View File
@@ -0,0 +1,11 @@
{
"id": "hi-words",
"name": "HiWords",
"version": "0.5.7",
"minAppVersion": "1.8.0",
"description": "Effortlessly grow your vocabulary as you read, with automatic highlighting and translation of unfamiliar words.",
"author": "Kai",
"authorUrl": "https://github.com/CatMuse",
"fundingUrl": "https://ko-fi.com/catmuse",
"isDesktopOnly": false
}
File diff suppressed because it is too large. Load diff
+415
View File
@@ -0,0 +1,415 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source visit the plugins github repository (https://github.com/denolehov/obsidian-git)
*/
"use strict";var GO=Object.create;var Yc=Object.defineProperty;var UO=Object.getOwnPropertyDescriptor;var jO=Object.getOwnPropertyNames;var zO=Object.getPrototypeOf,VO=Object.prototype.hasOwnProperty;var ax=r=>{throw TypeError(r)};var WO=(r,e,t)=>e in r?Yc(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var qO=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var G=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},YO=(r,e)=>{for(var t in e)Yc(r,t,{get:e[t],enumerable:!0})},lx=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jO(e))!VO.call(r,i)&&i!==t&&Yc(r,i,{get:()=>e[i],enumerable:!(n=UO(e,i))||n.enumerable});return r};var nt=(r,e,t)=>(t=r!=null?GO(zO(r)):{},lx(e||!r||!r.__esModule?Yc(t,"default",{value:r,enumerable:!0}):t,r)),KO=r=>lx(Yc({},"__esModule",{value:!0}),r);var Xe=(r,e,t)=>WO(r,typeof e!="symbol"?e+"":e,t),gg=(r,e,t)=>e.has(r)||ax("Cannot "+t);var O=(r,e,t)=>(gg(r,e,"read from private field"),t?t.call(r):e.get(r)),Re=(r,e,t)=>e.has(r)?ax("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Se=(r,e,t,n)=>(gg(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),me=(r,e,t)=>(gg(r,e,"access private method"),t);var fx=G(yd=>{"use strict";g();yd.byteLength=XO;yd.toByteArray=JO;yd.fromByteArray=rF;var Ni=[],Vn=[],ZO=typeof Uint8Array!="undefined"?Uint8Array:Array,wg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(jo=0,cx=wg.length;jo<cx;++jo)Ni[jo]=wg[jo],Vn[wg.charCodeAt(jo)]=jo;var jo,cx;Vn[45]=62;Vn[95]=63;function ux(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function XO(r){var e=ux(r),t=e[0],n=e[1];return(t+n)*3/4-n}function QO(r,e,t){return(e+t)*3/4-t}function JO(r){var e,t=ux(r),n=t[0],i=t[1],s=new ZO(QO(r,n,i)),o=0,a=i>0?n-4:n,l;for(l=0;l<a;l+=4)e=Vn[r.charCodeAt(l)]<<18|Vn[r.charCodeAt(l+1)]<<12|Vn[r.charCodeAt(l+2)]<<6|Vn[r.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Vn[r.charCodeAt(l)]<<2|Vn[r.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Vn[r.charCodeAt(l)]<<10|Vn[r.charCodeAt(l+1)]<<4|Vn[r.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function eF(r){return Ni[r>>18&63]+Ni[r>>12&63]+Ni[r>>6&63]+Ni[r&63]}function tF(r,e,t){for(var n,i=[],s=e;s<t;s+=3)n=(r[s]<<16&16711680)+(r[s+1]<<8&65280)+(r[s+2]&255),i.push(eF(n));return i.join("")}function rF(r){for(var e,t=r.length,n=t%3,i=[],s=16383,o=0,a=t-n;o<a;o+=s)i.push(tF(r,o,o+s>a?a:o+s));return n===1?(e=r[t-1],i.push(Ni[e>>2]+Ni[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],i.push(Ni[e>>10]+Ni[e>>4&63]+Ni[e<<2&63]+"=")),i.join("")}});var dx=G(vg=>{g();vg.read=function(r,e,t,n,i){var s,o,a=i*8-n-1,l=(1<<a)-1,c=l>>1,u=-7,f=t?i-1:0,d=t?-1:1,h=r[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=a;u>0;s=s*256+r[e+f],f+=d,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=n;u>0;o=o*256+r[e+f],f+=d,u-=8);if(s===0)s=1-c;else{if(s===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-c}return(h?-1:1)*o*Math.pow(2,s-n)};vg.write=function(r,e,t,n,i,s){var o,a,l,c=s*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:s-1,p=n?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(o++,l/=2),o+f>=u?(a=0,o=u):o+f>=1?(a=(e*l-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;r[t+h]=a&255,h+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;r[t+h]=o&255,h+=p,o/=256,c-=8);r[t+h-p]|=m*128}});var Cg=G(il=>{"use strict";g();var bg=fx(),rl=dx(),hx=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;il.Buffer=L;il.SlowBuffer=lF;il.INSPECT_MAX_BYTES=50;var _d=2147483647;il.kMaxLength=_d;L.TYPED_ARRAY_SUPPORT=nF();!L.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 nF(){try{let r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch(r){return!1}}Object.defineProperty(L.prototype,"parent",{enumerable:!0,get:function(){if(L.isBuffer(this))return this.buffer}});Object.defineProperty(L.prototype,"offset",{enumerable:!0,get:function(){if(L.isBuffer(this))return this.byteOffset}});function ws(r){if(r>_d)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,L.prototype),e}function L(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Eg(r)}return wx(r,e,t)}L.poolSize=8192;function wx(r,e,t){if(typeoLine truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kG(r,e){if(r){if(typeof r=="string")return pT(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return pT(r,e)}}function pT(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function AG(r,e){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(r)))){var t=[],n=!0,i=!1,s=void 0;try{for(var o=r[Symbol.iterator](),a;!(n=(a=o.next()).done)&&(t.push(a.value),!(e&&t.length===e));n=!0);}catch(l){i=!0,s=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw s}}return t}}function CG(r){if(Array.isArray(r))return r}var gT=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?$/,wT=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?$/,vT=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,bT=/^rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,yT=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,_T=/^rgba?\(\s*(\d+%)\s+(\d+%)\s+(\d+%)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,xT=/^hsla?\(\s*(\d+)(deg|rad|grad|turn)?\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/;function Ju(r,e){return r.indexOf(e)>-1}function TG(r,e,t){var n=r/255,i=e/255,s=t/255,o=Math.max(n,i,s),a=Math.min(n,i,s),l=o-a,c=(o+a)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=(function(){switch(o){case n:return(i-s)/l%6;case i:return(s-n)/l+2;default:return(n-i)/l+4}})();return[f*60,u*100,c*100]}function RG(r,e,t){var n=r/60,i=e/100,s=t/100,o=(1-Math.abs(2*s-1))*i,a=o*(1-Math.abs(n%2-1)),l=s-o/2,c=(function(){return n<1?[o,a,0]:n<2?[a,o,0]:n<3?[0,o,a]:n<4?[0,a,o]:n<5?[a,0,o]:[o,0,a]})(),u=Mr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var $G=(function(){function r(e){var t=Mr(e,4),n=t[0],i=t[1],s=t[2],o=t[3];xG(this,r),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(s,10),255),0),o==null?1:Math.max(Math.min(parseFloat(o),255),0)]}return EG(r,[{key:"toRgbString",value:function(){var t=Mr(this.values,4),n=t[0],i=t[1],s=t[2],o=t[3];return o===1?"rgb(".concat(n,", ").concat(i,", ").concat(s,")"):"rgba(".concat(n,", ").concat(i,", ").concat(s,", ").concat(o,")")}},{key:"toHslString",value:function(){var t=this.toHslaArray(),n=Mr(t,4),i=n[0],s=n[1],o=n[2],a=n[3];return a===1?"hsl(".concat(i,", ").concat(s,"%, ").concat(o,"%)"):"hsla(".concat(i,", ").concat(s,"%, ").concat(o,"%, ").concat(a,")")}},{key:"toHexString",value:function(){var t=Mr(this.values,4),n=t[0],i=t[1],s=t[2],o=t[3];return n=Number(n).toString(16).padStart(2,"0"),i=Number(i).toString(16).padStart(2,"0"),s=Number(s).toString(16).padStart(2,"0"),o=o<1?parseInt(o*255,10).toString(16).padStart(2,"0"):"","#".concat(n).concat(i).concat(s).concat(o)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var t=Mr(this.values,4),n=t[0],i=t[1],s=t[2],o=t[3],a=TG(n,i,s),l=Mr(a,3),c=l[0],u=l[1],f=l[2];return[c,u,f,o]}}]),r})();function jl(r){var e=Mr(r,4),t=e[0],n=e[1],i=e[2],s=e[3];return new $G([t,n,i,s])}function O0(r){var e=Mr(r,3),t=e[0],n=e[1],i=e[2];return jl([t,n,i,1])}function $h(r){var e=Mr(r,4),t=e[0],n=e[1],i=e[2],s=e[3],o=RG(t,n,i),a=Mr(o,3),l=a[0],c=a[1],u=a[2];return jl([l,c,u,s])}function ET(r){var e=Mr(r,3),t=e[0],n=e[1],i=e[2];return $h([t,n,i,1])}function PG(r){var e=gT.exec(r)||wT.exec(r),t=Mr(e,5),n=t[1],i=t[2],s=t[3],o=t[4];return n=parseInt(n.length<2?n.repeat(2):n,16),i=parseInt(i.length<2?i.repeat(2):i,16),s=parseInt(s.length<2?s.repeat(2):s,16),o=o&&(parseInt(o.length<2?o.repeat(2):o,16)/255).toPrecision(1)||1,jl([n,i,s,o])}function IG(r){var e=vT.exec(r)||yT.exec(r)||bT.exec(r)||_T.exec(r),t=Mr(e,5),n=t[1],i=t[2],s=t[3],o=t[4];return n=Ju(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),i=Ju(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),s=Ju(s,"%")>0?parseInt(s,10)*255/100:parseInt(s,10),o=o===void 0?1:parseFloat(o)/(Ju(o,"%")?100:1),jl([n,i,s,o])}function OG(r){var e=xT.exec(r),t=Mr(e,6),n=t[1],i=t[2],s=t[3],o=t[4],a=t[5];return i=i||"deg",n=(0,_G.default)(parseFloat(n),i,"deg"),s=parseFloat(s),o=parseFloat(o),a=a===void 0?1:parseFloat(a)/(Ju(a,"%")?100:1),$h([n,s,o,a])}function ST(r){return dT.default[r]?O0(dT.default[r]):gT.test(r)||wT.test(r)?PG(r):vT.test(r)||yT.test(r)||bT.test(r)||_T.test(r)?IG(r):xT.test(r)?OG(r):null}var FG={fromString:ST,fromRgb:O0,fromRgba:jl,fromHsl:ET,fromHsla:$h};As.default=FG});var DT=G((rK,MT)=>{g();MT.exports=function(r,e){var t=r,n=e,i=t.length,s=n.length,o=!1,a=i+1,l=[],c=[],u,f,d=function(){i>=s&&(u=t,f=i,t=n,n=u,i=s,s=f,o=!0,a=i+1)},h=function(m,w,y,v,A){return{startX:m,startY:w,endX:y,endY:v,r:A}},p=function(m,w,y){var v,A,C,S,T;for(w>y?v=l[m-1+a]:v=l[m+1+a],T=C=Math Line truncated
`});fe=!1,Y=oe.length}function tt(j,Ce){var z="="+U,we=j.indexOf(z,Ce),ee=c(j.substring(j.indexOf("=",Ce)+1,we)).split(" ");return J=ee[0],U=ee[ee.length-1],we+z.length-1}for(E&&(E=E.split(" "),J=E[0],U=E[1]),Z=0;Z<k;Z++)P==$?u(J,x,Z)?(--Z,et(),P=M):x.charAt(Z)==`
`?vt(fe):Q+=x.charAt(Z):P==M?(Z+=J.length-1,_e=r.tags[x.charAt(Z+1)],F=_e?x.charAt(Z+1):"_v",F=="="?(Z=tt(x,Z),P=$):(_e&&Z++,P=D),fe=Z):u(U,x,Z)?(oe.push({tag:F,n:c(Q),otag:J,ctag:U,i:F=="/"?fe-J.length:Z+U.length}),Q="",Z+=U.length-1,P=$,F=="{"&&(U=="}}"?Z++:l(oe[oe.length-1]))):Q+=x.charAt(Z);return vt(fe,!0),oe};function l(b){b.n.substr(b.n.length-1)==="}"&&(b.n=b.n.substring(0,b.n.length-1))}function c(b){return b.trim?b.trim():b.replace(/^\s*|\s*$/g,"")}function u(b,x,E){if(x.charAt(E)!=b.charAt(0))return!1;for(var k=1,$=b.length;k<$;k++)if(x.charAt(E+k)!=b.charAt(k))return!1;return!0}var f={_t:!0,"\n":!0,$:!0,"/":!0};function d(b,x,E,k){var $=[],M=null,D=null,P=null;for(D=E[E.length-1];b.length>0;){if(P=b.shift(),D&&D.tag=="<"&&!(P.tag in f))throw new Error("Illegal content in < super tag.");if(r.tags[P.tag]<=r.tags.$||h(P,k))E.push(P),P.nodes=d(b,P.tag,E,k);else if(P.tag=="/"){if(E.length===0)throw new Error("Closing tag without opener: /"+P.n);if(M=E.pop(),P.n!=M.n&&!p(P.n,M.n,k))throw new Error("Nesting error: "+M.n+" vs. "+P.n);return M.end=P.i,$}else P.tag==`
`&&(P.last=b.length==0||b[0].tag==`
`);$.push(P)}if(E.length>0)throw new Error("missing closing tag: "+E.pop().n);return $}function h(b,x){for(var E=0,k=x.length;E<k;E++)if(x[E].o==b.n)return b.tag="#",!0}function p(b,x,E){for(var k=0,$=E.length;k<$;k++)if(E[k].c==b&&E[k].o==x)return!0}function m(b){var x=[];for(var E in b)x.push('"'+v(E)+'": function(c,p,t,i) {'+b[E]+"}");return"{ "+x.join(",")+" }"}function w(b){var x=[];for(var E in b.partials)x.push('"'+v(E)+'":{name:"'+v(b.partials[E].name)+'", '+w(b.partials[E])+"}");return"partials: {"+x.join(",")+"}, subs: "+m(b.subs)}r.stringify=function(b,x,E){return"{code: function (c,p,i) { "+r.wrapMain(b.code)+" },"+w(b)+"}"};var y=0;r.generate=function(b,x,E){y=0;var k={code:"",subs:{},partials:{}};return r.walk(b,k),E.asString?this.stringify(k,x,E):this.makeTemplate(k,x,E)},r.wrapMain=function(b){return'var t=this;t.b(i=i||"");'+b+"return t.fl();"},r.template=r.Template,r.makeTemplate=function(b,x,E){var k=this.makePartials(b);return k.code=new Function("c","p","i",this.wrapMain(b.code)),new this.template(k,x,this,E)},r.makePartials=function(b){var x,E={subs:{},partials:b.partials,name:b.name};for(x in E.partials)E.partials[x]=this.makePartials(E.partials[x]);for(x in b.subs)E.subs[x]=new Function("c","p","t","i",b.subs[x]);return E};function v(b){return b.replace(s,"\\\\").replace(t,'\\"').replace(n,"\\n").replace(i,"\\r").replace(o,"\\u2028").replace(a,"\\u2029")}function A(b){return~b.indexOf(".")?"d":"f"}function C(b,x){var E="<"+(x.prefix||""),k=E+b.n+y++;return x.partials[k]={name:b.n,partials:{}},x.code+='t.b(t.rp("'+v(k)+'",c,p,"'+(b.indent||"")+'"));',k}r.codegen={"#":function(b,x){x.code+="if(t.s(t."+A(b.n)+'("'+v(b.n)+'",c,p,1),c,p,0,'+b.i+","+b.end+',"'+b.otag+" "+b.ctag+'")){t.rs(c,p,function(c,p,t){',r.walk(b.nodes,x),x.code+="});c.pop();}"},"^":function(b,x){x.code+="if(!t.s(t."+A(b.n)+'("'+v(b.n)+'",c,p,1),c,p,1,0,0,"")){',r.walk(b.nodes,x),x.code+="};"},">":C,"<":function(b,x){var E={partials:{},code:"",subs:{},inPartial:!0};r.walk(b.nodes,E);var k=x.partials[C(b,x)];k.subs=E.subs,k.partials=E.partials},$:function(b,x){var E={subs:{},code:"",partials:x.partials,prefix:b.n};r.walk(b.nodes,E),x.subs[b.n]=E.code,x.inPartial||(x.code+='t.sub("'+v(b.n)+'",c,p,i);')},"\n":function(b,x){x.code+=T('"\\n"'+(b.last?"":" + i"))},_v:function(b,x){x.code+="t.b(t.v(t."+A(b.n)+'("'+v(b.n)+'",c,p,0)));'},_t:function(b,x){x.code+=T('"'+v(b.text)+'"')},"{":S,"&":S};function S(b,x){x.code+="t.b(t.t(t."+A(b.n)+'("'+v(b.n)+'",c,p,0)));'}function T(b){return"t.b("+b+");"}r.walk=function(b,x){for(var E,k=0,$=b.length;k<$;k++)E=r.codegen[b[k].tag],E&&E(b[k],x);return x},r.parse=function(b,x,E){return E=E||{},d(b,"",[],E.sectionTags||[])},r.cache={},r.cacheKey=function(b,x){return[b,!!x.asString,!!x.disableLambda,x.delimiters,!!x.modelGet].join("||")},r.compile=function(b,x){x=x||{};var E=r.cacheKey(b,x),k=this.cache[E];if(k){var $=k.partials;for(var M in $)delete $[M].instance;return k}return k=this.generate(this.parse(this.scan(b,x.delimiters),b,x),b,x),this.cache[E]=k}})(typeof dy!="undefined"?dy:Hogan)});var qP=G(hy=>{g();var h9={};(function(r){r.Template=function(d,h,p,m){d=d||{},this.r=d.code||this.r,this.c=p,this.options=m||{},this.text=h||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},r.Template.prototype={r:function(d,h,p){return""},v:u,t:c,render:function(h,p,m){return this.ri([h],p||{},m)},ri:function(d,h,p){return this.r(d,h,p)},ep:function(d,h){var p=this.partials[d],m=h[p.name];if(p.instance&&p.base==m)return p.instance;if(typeof m=="string"){if(!this.c)throw new Error("No compiler available.");m=this.c.compile(m,this.options)}if(!m)return null;if(this.partials[d].base=m,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);m=t(m,p.subs,p.partials,this.stackSubs,this.stackPartials,h.stackText)}return this.partials[d].instance=m,m},rp:function(d,h,p,m){var w=this.ep(d,p);return w?w.ri(h,p,m):""},rs:function(d,h,p){var m=d[d.length-1];if(!f(m)){p(d,h,this);return}for(var w=0;w<m.length;w++)d.push(m[w]),p(d,h,this),d.pop()},s:function(d,h,p,m,w,y,v){var A;return f(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,h,p,m,w,y,v)),A=!!d,!m&&A&&h&&h.push(typeof d=="object"?d:h[h.length-1]),A)},d:function(d,h,p,m){var w,y=d.split("."),v=this.f(y[0],h,p,m),A=this.options.modelGet,C=null;if(d==="."&&f(h[h.length-2]))v=h[h.length-1];else for(var S=1;S<y.length;S++)w=e(y[S],v,A),w!==void 0?(C=v,v=w):v="";return m&&!v?!1:(!m&&typeof v=="function"&&(h.push(C),v=this.mv(v,h,p),h.pop()),v)},f:function(d,h,p,m){for(var w=!1,y=null,v=!1,A=this.options.modelGet,C=h.length-1;C>=0;C--)if(y=h[C],w=e(d,y,A),w!==void 0){v=!0;break}return v?(!m&&typeof w=="function"&&(w=this.mv(w,h,p)),w):m?!1:""},ls:function(d,h,p,m,w,y){var v=this.options.delimiters;return this.options.delimiters=y,this.b(this.ct(c(d.call(h,w,p)),h,m)),this.options.delimiters=v,!1},ct:functio Line truncated
If you're using an application that depends on isomorphic-git, please report this error to that application's developers.
If you're a developer and you believe this is a bug in isomorphic-git, please file an issue at https://github.com/isomorphic-git/isomorphic-git/issues with a minimal reproduction, version and environment details, and this error message: ${e}`),this.code=this.name=r.code,this.data={message:e}}};be.code="InternalError";var ia=class r extends Me{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=r.code,this.data={filepath:e}}};ia.code="UnsafeFilepathError";var Kn=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let t=this.buffer.slice(this._start,this._start+e);return this._start+=e,t}toString(e,t){let n=this.buffer.toString(e,this._start,this._start+t);return this._start+=t,n}write(e,t,n){let i=this.buffer.write(e,this._start,t,n);return this._start+=t,i}copy(e,t,n){let i=e.copy(this.buffer,this._start,t,n);return this._start+=i,i}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let t=this.buffer.writeUInt8(e,this._start);return this._start+=1,t}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let t=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,t}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let t=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,t}},Kk=/[\ud800-￿]/;function Zk(r,e,t){if(t<55296||t>57343)return!1;if(t<56320){let i=e+1<r.length?r.charCodeAt(e+1):0;return i<56320||i>57343}let n=e>0?r.charCodeAt(e-1):0;return n<55296||n>56319}function mh(r,e){if(!Kk.test(r)&&!Kk.test(e))return-(r<e)||+(r>e);let t=Math.min(r.length,e.length);for(let n=0;n<t;n++){let i=r.charCodeAt(n),s=e.charCodeAt(n);if(i!==s){if(Zk(r,n,i)&&(i=65533),Zk(e,n,s)&&(s=65533),i===s)continue;return i>=55296&&s>=55296&&(i+=i>=57344?-2048:8192,s+=s>=57344?-2048:8192),i<s?-1:1}}return r.length<e.length?-1:r.length>e.length?1:0}function AA(r,e){return mh(r.path,e.path)}function CA(r){let e=r>0?r>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let t=r&511;return t&73?t=493:t=420,e!==8&&(t=0),(e<<12)+t}var qi=2**32;function Xk(r,e,t,n){if(r!==void 0&&e!==void 0)return[r,e];t===void 0&&(t=n.valueOf());let i=Math.floor(t/1e3),s=Math.floor((t-i*1e3)*1e6);return[i,s]}function ao(r){let[e,t]=Xk(r.ctimeSeconds,r.ctimeNanoseconds,r.ctimeMs,r.ctime),[n,i]=Xk(r.mtimeSeconds,r.mtimeNanoseconds,r.mtimeMs,r.mtime);return{ctimeSeconds:e%qi,ctimeNanoseconds:t%qi,mtimeSeconds:n%qi,mtimeNanoseconds:i%qi,dev:r.dev%qi,ino:r.ino%qi,mode:CA(r.mode%qi),uid:r.uid%qi,gid:r.gid%qi,size:r.size>-1?r.size%qi:0}}function NN(r){let e="";for(let t of new Uint8Array(r))t<16&&(e+="0"),e+=t.toString(16);return e}var Ww=null;async function mi(r){return Ww===null&&(Ww=await HN()),Ww?TA(r):BN(r)}function BN(r){return new yv.default().update(r).digest("hex")}async function TA(r){let e=await crypto.subtle.digest("SHA-1",r);return NN(e)}async function HN(){try{return await TA(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(r){}return!1}function GN(r){return{assumeValid:!!(r&32768),extended:!!(r&16384),stage:(r&12288)>>12,nameLength:r&4095,skipWorktree:!1,intentToAdd:!1}}var rv=16384,nv=8192;function iv(r){return!!(r.flags.skipWorktree||r.flags.intentToAdd)}function UN(r){let e=r.flags;return e.extended=iv(r),e.nameLength=Math.min(_.from(r.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}function jN(r){return(r.flags.skipWorktree?rv:0)+(r.flags.intentToAdd?nv:0)}var sv=class r{constructor(e,t){this._dirty=!1,this._unmergedPaths=t||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let t=this._entries.get(e.path);t||(this._entries.set(e.path,e),t=e),t.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(_.isBuffer(e))return r.fromBuffer(e);if(e===null)return new r(null);throw new be("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new be("Index file is empty (.git/index)");let t=new r,n=new Kn(e),i=n.toString("utf8",4);if(i!=="DIRC")throw new be(`Invalid dircache magic file number: ${i}`);let s=await mi(e.slice(0,-20)),o=e.slice(-20).toString("hex");if(o!==s)throw new be(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${s}`);let a=n.readUInt32BE();if(a!==2&&a!==3)throw new be(`Unsupported dircache version: ${a}`);let l=n.readUInt32BE(),c=0;for(;!n.eof()&&c<l;){let u={};u.ctimeSeconds=n.readUInt32BE(),u.ctimeNanoseconds=n.readUInt32BE(),u.mtimeSeconds=n.readUInt32BE(),u.mtimeNanoseconds=n.readUInt32BE(),u.dev=n.readUInt32BE(),u.ino=n.readUInt32BE(),u.mode=n.readUInt32BE(),u.uid=n.readUInt32BE(),u.gid=n.readUInt32BE(),u.size=n.readUInt32BE(),u.oid=n.slice(20).toString("hex");let f=n.readUInt16BE();if(u.flags=GN(f),u Line truncated
`)}static async _entryToBuffer(e){let t=_.from(e.path),n=iv(e),i=Math.ceil((62+(n?2:0)+t.length+1)/8)*8,s=_.alloc(i),o=new Kn(s),a=ao(e);return o.writeUInt32BE(a.ctimeSeconds),o.writeUInt32BE(a.ctimeNanoseconds),o.writeUInt32BE(a.mtimeSeconds),o.writeUInt32BE(a.mtimeNanoseconds),o.writeUInt32BE(a.dev),o.writeUInt32BE(a.ino),o.writeUInt32BE(a.mode),o.writeUInt32BE(a.uid),o.writeUInt32BE(a.gid),o.writeUInt32BE(a.size),o.write(e.oid,20,"hex"),o.writeUInt16BE(UN(e)),n&&o.writeUInt16BE(jN(e)),o.write(e.path,t.length,"utf8"),s}async toObject(){let e=_.alloc(12),t=new Kn(e);t.write("DIRC",4,"utf8"),t.writeUInt32BE(this.entriesFlat.some(iv)?3:2),t.writeUInt32BE(this.entriesFlat.length);let n=[];for(let a of this.entries)if(n.push(r._entryToBuffer(a)),a.stages.length>1)for(let l of a.stages)l&&l!==a&&n.push(r._entryToBuffer(l));n=await Promise.all(n);let i=_.concat(n),s=_.concat([e,i]),o=await mi(s);return _.concat([s,_.from(o,"hex")])}};function nh(r,e,t=!0,n=!0){let i=ao(r),s=ao(e);return t&&i.mode!==s.mode||i.mtimeSeconds!==s.mtimeSeconds||i.mtimeNanoseconds!==s.mtimeNanoseconds||i.ctimeSeconds!==s.ctimeSeconds||i.ctimeNanoseconds!==s.ctimeNanoseconds||i.uid!==s.uid||i.gid!==s.gid||n&&i.ino!==s.ino||i.size!==s.size}var qw;function zN(){return qw===void 0&&(qw=new xA.default({maxPending:1/0})),qw}function ir(r,e){return zN().acquire(r,e)}var Yw=Symbol("IndexCache");function VN(){return{map:new Map,stats:new Map}}async function WN(r,e,t){let[n,i]=await Promise.all([r.lstat(e),r.read(e)]),s=await sv.from(i);t.map.set(e,s),t.stats.set(e,n)}async function qN(r,e,t){let n=t.stats.get(e);if(n===void 0)return!0;if(n===null)return!1;let i=await r.lstat(e);if(i===null)return!1;if(nh(n,i))return!0;let s=ao(n),o=ao(i);return s.mtimeNanoseconds!==o.mtimeNanoseconds||s.ctimeNanoseconds!==o.ctimeNanoseconds}var Ct=class{static async acquire({fs:e,gitdir:t,cache:n,allowUnmerged:i=!0},s){n[Yw]||(n[Yw]=VN());let o=`${t}/index`,a,l=[];return await ir(o,async()=>{let c=n[Yw];await qN(e,o,c)&&await WN(e,o,c);let u=c.map.get(o);if(l=u.unmergedPaths,l.length&&!i)throw new _u(l);if(a=await s(u),u._dirty){let f=await u.toObject();await e.write(o,f),c.stats.set(o,await e.lstat(o)),u._dirty=!1}}),a}};function ih(r){let e=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\"));return e>-1&&(r=r.slice(e+1)),r}function sa(r){let e=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\"));return e===-1?".":e===0?"/":r.slice(0,e)}function RA(r){let e=new Map,t=function(i){if(!e.has(i)){let s={type:"tree",fullpath:i,basename:ih(i),metadata:{},children:[]};e.set(i,s),s.parent=t(sa(i)),s.parent&&s.parent!==s&&s.parent.children.push(s)}return e.get(i)},n=function(i,s){if(!e.has(i)){let o={type:"blob",fullpath:i,basename:ih(i),metadata:s,parent:t(sa(i)),children:[]};o.parent&&o.parent.children.push(o),e.set(i,o)}return e.get(i)};t(".");for(let i of r)n(i.path,i);return e}function YN(r){switch(r){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new be(`Unexpected GitTree entry mode: ${r.toString(8)}`)}var ov=class{constructor({fs:e,gitdir:t,cache:n}){this.treePromise=Ct.acquire({fs:e,gitdir:t,cache:n},async function(s){return RA(s.entries)});let i=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,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 t=e._fullpath,i=(await this.treePromise).get(t);if(!i||i.type==="blob")return null;if(i.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${t}'`);let s=i.children.map(o=>o.fullpath);return s.sort(mh),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 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"?{}:ao(n.metadata);e._type=n.type==="tree"?"tree":YN(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}},gh=Symbol("GitWalkSymbol");function lo(){let r=Object.create(null);return Object.defineProperty(r,gh,{value:function({fs:e,gitdir:t,cache:n}){return new ov({fs:e,gitdir:t,cache:n})}}),Object.freeze(r),r}var Be=class r extends Me{constructor(e){super(`Could not find ${e}.`),this.code=this.name=r.code,this.data={what:e}}};Be.code="NotFoundError";var sr=class r extends Me{constructor(e,t,n,i){super(`Object ${e} ${i?`at ${i}`:""}was anticipated to be a ${n} but it is a ${t}.`),this.code=this.name=r.code,this.data={oid:e,actual:t,expected:n,filepath:i}}};sr.code="ObjectTypeError";var co=class r extends Me{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),t Line truncated
[remote "${e}"]
fetch = +refs/heads/*:refs/remotes/origin/*
`),this.code=this.name=r.code,this.data={remote:e}}};xu.code="NoRefspecError";var sh=class r{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let t=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 s=n.slice(1);return this.refs.set(t+"^{}",s),{line:n,ref:t,peeled:s}}else{let s=n.slice(0,i);return t=n.slice(i+1),this.refs.set(t,s),{line:n,ref:t,oid:s}}})}return this}static from(e){return new r(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(t=>t.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(`
`)+`
`}},oh=class r{constructor({remotePath:e,localPath:t,force:n,matchPrefix:i}){Object.assign(this,{remotePath:e,localPath:t,force:n,matchPrefix:i})}static from(e){let[t,n,i,s,o]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),a=t==="+",l=i==="*";if(l!==(o==="*"))throw new be("Invalid refspec");return new r({remotePath:n,localPath:s,force:a,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}},av=class r{constructor(e=[]){this.rules=e}static from(e){let t=[];for(let n of e)t.push(oh.from(n));return new r(t)}add(e){let t=oh.from(e);this.rules.push(t)}translate(e){let t=[];for(let n of this.rules)for(let i of e){let s=n.translate(i);s&&t.push([i,s])}return t}translateOne(e){let t=null;for(let n of this.rules){let i=n.translate(e);i&&(t=i)}return t}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function KN(r,e){let t=r.replace(/\^\{\}$/,""),n=e.replace(/\^\{\}$/,""),i=-(t<n)||+(t>n);return i===0?r.endsWith("^{}")?1:-1:i}var ZN=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function Al(r,e){if(typeof r!="string")throw new TypeError("Reference name must be a string");return!ZN.test(r)&&(!!e||r.includes("/"))}function XN(r,e){let t="",n=0,i=-1,s=0,o="\0";for(let a=0;a<=r.length;++a){if(a<r.length)o=r[a];else{if(o==="/")break;o="/"}if(o==="/"){if(!(i===a-1||s===1))if(s===2){if(t.length<2||n!==2||t.at(-1)!=="."||t.at(-2)!=="."){if(t.length>2){let l=t.lastIndexOf("/");l===-1?(t="",n=0):(t=t.slice(0,l),n=t.length-1-t.lastIndexOf("/")),i=a,s=0;continue}else if(t.length!==0){t="",n=0,i=a,s=0;continue}}e&&(t+=t.length>0?"/..":"..",n=2)}else t.length>0?t+="/"+r.slice(i+1,a):t=r.slice(i+1,a),n=a-i-1;i=a,s=0}else o==="."&&s!==-1?++s:s=-1}return t}function QN(r){return r.length>=2&&/^[a-zA-Z]:/.test(r)?r.slice(0,2):null}function JN(r){if(!r.length)return".";r=r.replace(/\\/g,"/");let e=QN(r),t=r[0]==="/"||e!==null&&r[2]==="/",n=r.at(-1)==="/",i=e?r.slice(2):r,s=XN(i,!t);if(!s.length){let o=e?t?e+"/":e:t?"/":".";return n&&!t?o+"/":o}return n&&(s+="/"),e?t?`${e}/${s}`:`${e}${s}`:t?`/${s}`:s}function B(...r){if(r.length===0)return".";let e;for(let t=0;t<r.length;++t){let n=r[t].replace(/\\/g,"/");n.length!==0&&(/^[a-zA-Z]:\//.test(n)||e===void 0?e=n:e+="/"+n)}return e===void 0?".":JN(e)}var eB=r=>{if(typeof r=="number")return r;r=r.toLowerCase();let e=parseInt(r);return r.endsWith("k")&&(e*=1024),r.endsWith("m")&&(e*=1024*1024),r.endsWith("g")&&(e*=1024*1024*1024),e},wu=r=>{if(typeof r=="boolean")return r;if(r=r.trim().toLowerCase(),r==="true"||r==="yes"||r==="on")return!0;if(r==="false"||r==="no"||r==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${r}`)},Qk={core:{filemode:wu,bare:wu,logallrefupdates:wu,symlinks:wu,ignorecase:wu,bigFileThreshold:eB}},tB=/^\[([A-Za-z0-9-.]+)(?:[ \t]+"((?:[^"\\]|\\.)*)")?\][ \t]*(?:[#;].*)?$/,rB=/^[A-Za-z0-9-.]+$/,nB=/^([A-Za-z][A-Za-z0-9-]*)(?:\s*=\s*(.*))?$/,iB=/^[A-Za-z][A-Za-z0-9-]*$/,sB=r=>{let e=tB.exec(r);if(e!=null){let[t,n]=e.slice(1);return[t,n&&n.replace(/\\(.)/g,"$1")]}return null},oB=r=>{let e=nB.exec(r);if(e!=null){let[t,n="true"]=e.slice(1);return[t,aB(n)]}return null},Jk=new Map([["t"," "],["b","\b"],["n",`
`],["\\","\\"],['"','"']]),aB=r=>{let e="",t="",n=!1;for(let i=0;i<r.length;i++){let s=r[i];if(!n&&/[ \t\r\v\f]/.test(s)){e!==""&&(t+=s);continue}if(!n&&(s==="#"||s===";"))break;e+=t,t="",s==="\\"&&Jk.has(r[i+1])?e+=Jk.get(r[++i]):s==='"'?n=!n:e+=s}return e},lB=r=>{if(typeof r!="string")return r;let e=r.startsWith(" ")||r.endsWith(" ")||/[#;]/.test(r)?'"':"",t=r.replace(/[\\"\n\t]/g,n=>n===`
`?"\\n":n===" "?"\\t":`\\${n}`);return`${e}${t}${e}`},eA=r=>r!=null?r.toLowerCase():null,lv=(r,e,t)=>[eA(r),e,eA(t)].filter(n=>n!=null).join("."),tA=r=>{let e=r.split("."),t=e.shift(),n=e.pop(),i=e.length?e.join("."):void 0;return{section:t,subsection:i,name:n,path:lv(t,i,n),sectionPath:lv(t,i,null),isSection:!!t}},cB=(r,e)=>r.reduce((t,n,i)=>e(n)?i:t,-1),cv=class r{constructor(e){let t=null,n=null;this.parsedConfig=e?e.split(`
`).map(i=>{let s=null,o=null,a=i.trim(),l=sB(a),c=l!=null;if(c)[t,n]=l;else{let f=oB(a);f!=null&&([s,o]=f)}let u=lv(t,n,s);return{line:i,isSection:c,section:t,subsection:n,name:s,value:o,path:u}}):[]}static from(e){return new r(e)}async get(e,t=!1){let n=tA(e).path,i=this.parsedConfig.filter(s=>s.path===n).map(({section:s,name:o,value:a})=>{let l=Qk[s]&&Qk[s][o];return l?l(a):a});return t?i:i.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(t=>t.isSection&&t.section===e).map(t=>t.subsection)}async deleteSection(e,t){this.parsedConfig=this.parsedConfig.filter(n=>!(n.section===e&&n.subsection===t))}async append(e,t){return this.set(e,t,!0)}async set(e,t,n=!1){let{section:i,subsection:s,name:o,path:a,sectionPath:l,isSection:c}=tA(e),u=cB(this.parsedConfig,f=>f.path===a);if(t==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let f=this.parsedConfig[u],d=Object.assign({},f,{name:o,value:t,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:s,name:o,value:t,modified:!0,path:a};if(rB.test(i)&&iB.test(o))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:i,subsection:s,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:t,subsection:n,name:i,value:s,modified:o=!1})=>o?i!=null&&s!=null?` ${i} = ${lB(s)}`:n!=null?`[${t} "${n}"]`:`[${t}]`:e).join(`
`)}},Tt=class{static async get({fs:e,gitdir:t}){let n=await e.read(`${t}/config`,{encoding:"utf8"});return cv.from(n)}static async save({fs:e,gitdir:t,config:n}){await e.write(`${t}/config`,n.toString(),{encoding:"utf8"})}},vu=r=>[`${r}`,`refs/${r}`,`refs/tags/${r}`,`refs/heads/${r}`,`refs/remotes/${r}`,`refs/remotes/${r}/HEAD`],uv=["config","description","index","shallow","commondir"];function ta(r){if(uv.includes(r))throw new _n(r,`refs/heads/${r}`);if(!Al(r,!0))throw new _n(r,na.default.clean(r))}var q=class r{static async updateRemoteRefs({fs:e,gitdir:t,remote:n,refs:i,symrefs:s,tags:o,refspecs:a=void 0,prune:l=!1,pruneTags:c=!1}){for(let y of i.values())if(!y.match(/[0-9a-f]{40}/))throw new co(y);let u=await Tt.get({fs:e,gitdir:t});if(!a){if(a=await u.getall(`remote.${n}.fetch`),a.length===0)throw new xu(n);a.unshift(`+HEAD:refs/remotes/${n}/HEAD`)}let f=av.from(a),d=new Map,h=f.translate([...i.keys()]),p=[];for(let[y,v]of f.translate([...s.keys()])){let A=f.translateOne(s.get(y));A&&(ta(A),p.push([v,`ref: ${A}`]))}let m=o?[...i.keys()].filter(y=>y.startsWith("refs/tags")&&!y.endsWith("^{}")):[];for(let[,y]of h)ta(y);for(let[y]of p)ta(y);if(m.forEach(ta),c){let y=await r.listRefs({fs:e,gitdir:t,filepath:"refs/tags"});await r.deleteRefs({fs:e,gitdir:t,refs:y.map(v=>`refs/tags/${v}`)})}for(let y of m)if(!await r.exists({fs:e,gitdir:t,ref:y})){let v=i.get(y);d.set(y,v)}for(let[y,v]of h){let A=i.get(y);d.set(v,A)}for(let[y,v]of p)d.set(y,v);let w=[];if(l){for(let y of f.localNamespaces()){let v=(await r.listRefs({fs:e,gitdir:t,filepath:y})).map(A=>`${y}/${A}`);for(let A of v)d.has(A)||w.push(A)}w.length>0&&await r.deleteRefs({fs:e,gitdir:t,refs:w})}for(let[y,v]of d)await ir(y,async()=>e.write(B(t,y),`${v.trim()}
`,"utf8"));return{pruned:w}}static async writeRef({fs:e,gitdir:t,ref:n,value:i}){if(ta(n),!i.match(/[0-9a-f]{40}/))throw new co(i);await ir(n,async()=>e.write(B(t,n),`${i.trim()}
`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:t,ref:n,value:i}){ta(n),await ir(n,async()=>e.write(B(t,n),`ref: ${i.trim()}
`,"utf8"))}static async deleteRef({fs:e,gitdir:t,ref:n}){return r.deleteRefs({fs:e,gitdir:t,refs:[n]})}static async deleteRefs({fs:e,gitdir:t,refs:n}){n.forEach(ta),await Promise.all(n.map(a=>e.rm(B(t,a))));let i=await ir("packed-refs",async()=>e.read(`${t}/packed-refs`,{encoding:"utf8"})),s=sh.from(i),o=s.refs.size;for(let a of n)s.refs.has(a)&&s.delete(a);s.refs.size<o&&(i=s.toString(),await ir("packed-refs",async()=>e.write(`${t}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:t,ref:n,depth:i=void 0,visited:s=new Set}){if(i!==void 0&&(i--,i===-1))return n;if(n.startsWith("ref: "))return n=n.slice(5),r.resolve({fs:e,gitdir:t,ref:n,depth:i,visited:s});if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let o=await r.packedRefs({fs:e,gitdir:t}),a=vu(n).filter(l=>!uv.includes(l));for(let l of a){let c=await ir(l,async()=>await e.read(`${t}/${l}`,{encoding:"utf8"})||o.get(l));if(c){if(s.has(l))throw new be(`Circular reference detected while resolving ref "${l}"`);return s.add(l),r.resolve({fs:e,gitdir:t,ref:c.trim(),depth:i,visited:s})}}throw new Be(n)}static async isUnbornBranch({fs:e,gitdir:t,ref:n}){let i;try{i=await r.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2})}catch(s){if(s instanceof Be)return!1;throw s}return i.startsWith("refs/heads/")?n==="HEAD"||vu(n).includes(i):!1}static async exists({fs:e,gitdir:t,ref:n}){try{return await r.expand({fs:e,gitdir:t,ref:n}),!0}catch(i){if(i instanceof Be)return!1;throw i}}static async expand({fs:e,gitdir:t,ref:n}){if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let i=await r.packedRefs({fs:e,gitdir:t}),s=vu(n).filter(o=>!uv.includes(o));for(let o of s)if(await ir(o,async()=>e.exists(`${t}/${o}`))||i.has(o))return o;throw new Be(n)}static async expandAgainstMap({ref:e,map:t}){let n=vu(e);for(let i of n)if(await t.has(i))return i;throw new Be(e)}static resolveAgainstMap({ref:e,fullref:t=e,depth:n=void 0,map:i}){if(n!==void 0&&(n--,n===-1))return{fullref:t,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),r.resolveAgainstMap({ref:e,fullref:t,depth:n,map:i});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:t,oid:e};let s=vu(e);for(let o of s){let a=i.get(o);if(a)return r.resolveAgainstMap({ref:a.trim(),fullref:o,depth:n,map:i})}throw new Be(e)}static async packedRefs({fs:e,gitdir:t}){let n=await ir("packed-refs",async()=>e.read(`${t}/packed-refs`,{encoding:"utf8"}));return sh.from(n).refs}static async listRefs({fs:e,gitdir:t,filepath:n}){let i=await r.packedRefs({fs:e,gitdir:t}),s=null;try{s=await e.readdirDeep(`${t}/${n}`),s=s.map(o=>o.replace(`${t}/${n}/`,""))}catch(o){s=[]}for(let o of i.keys())o.startsWith(n)&&(o=o.replace(n+"/",""),s.includes(o)||s.push(o));return s.sort(KN),s}static async listBranches({fs:e,gitdir:t,remote:n}){return n?r.listRefs({fs:e,gitdir:t,filepath:`refs/remotes/${n}`}):r.listRefs({fs:e,gitdir:t,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:t}){return(await r.listRefs({fs:e,gitdir:t,filepath:"refs/tags"})).filter(i=>!i.endsWith("^{}"))}};function uB(r,e){return mh(rA(r),rA(e))}function rA(r){return r.mode==="040000"?r.path+"/":r.path}function $A(r){switch(r){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new be(`Unexpected GitTree entry mode: ${r}`)}function fB(r){let e=[],t=0;for(;t<r.length;){let n=r.indexOf(32,t);if(n===-1)throw new be(`GitTree: Error parsing buffer at byte location ${t}: Could not find the next space character.`);let i=r.indexOf(0,t);if(i===-1)throw new be(`GitTree: Error parsing buffer at byte location ${t}: Could not find the next null character.`);let s=r.slice(t,n).toString("utf8");s==="40000"&&(s="040000");let o=$A(s),a=r.slice(n+1,i).toString("utf8"),l=a.replace(/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/g,""),u=l.split(":")[0].toLowerCase().replace(/[. ]+$/,"");if(a.includes("\\")||a.includes("/")||l==="."||l===".."||u===".git"||/^\.?git~[1-9]$/.test(u))throw new ia(a);let f=r.slice(i+1,i+21).toString("hex");t=i+21,e.push({mode:s,path:a,oid:f,type:o})}return e}function dB(r){if(typeof r=="number"&&(r=r.toString(8)),r.match(/^0?4.*/))return"040000";if(r.match(/^1006.*/))return"100644";if(r.match(/^1007.*/))return"100755";if(r.match(/^120.*/))return"120000";if(r.match(/^160.*/))return"160000";throw new be(`Could not understand file mode: ${r}`)}function hB(r){return!r.oid&&r.sha&&(r.oid=r.sha),r.mode=dB(r.mode),r.type||(r.type=$A(r.mode)),r}var Zr=class r{constructor(e){if(_.isBuffer(e))this._entries=fB(e);else if(Array.isArray(e))this._entries=e.map(hB);else throw new be("invalid type passed to GitTree constructor");this._entries.sort(AA)}static from(e){return new r(e)}render(){return this._entries.map(e=>`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(`
`)}toObject(){let e=[...this._entries];return e.sort(uB),_.concat(e.map(t=>{let n=_.from(t.mode.replace(/^0/,"")),i=_.from(" "),s=_.from(t.path,"utf8"),o=_.from([0]),a=_.from(t.oid,"hex");return _.concat([n,i,s,o,a])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},Ss=class{static wrap({type:e,object:t}){let n=`${e} ${t.length}\0`,i=n.length,s=i+t.length,o=new Uint8Array(s);for(let a=0;a<i;a++)o[a]=n.charCodeAt(a);return o.set(t,i),o}static unwrap(e){let t=e.indexOf(32),n=e.indexOf(0),i=e.slice(0,t).toString("utf8"),s=e.slice(t+1,n).toString("utf8"),o=e.length-(n+1);if(parseInt(s)!==o)throw new be(`Length mismatch: expected ${s} bytes but got ${o} instead.`);return{type:i,object:_.from(e.slice(n+1))}}};async function PA({fs:r,gitdir:e,oid:t}){let n=`objects/${t.slice(0,2)}/${t.slice(2)}`,i=await r.read(`${e}/${n}`);return i?{object:i,format:"deflated",source:n}:null}function IA(r,e){let t=new Kn(r),n=nA(t);if(n!==e.byteLength)throw new be(`applyDelta expected source buffer to be ${n} bytes but the provided buffer was ${e.length} bytes`);let i=nA(t),s,o=sA(t,e);if(o.byteLength===i)s=o;else{let a=[o],l=o.byteLength;for(;!t.eof();){let c=sA(t,e);a.push(c),l+=c.byteLength}if(i!==l)throw new be(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${l} bytes`);s=_.concat(a,i)}return s}function nA(r){let e=0,t=0,n=null;do n=r.readUInt8(),e|=(n&127)<<t,t+=7;while(n&128);return e}function iA(r,e,t){let n=0,i=0;for(;t--;)e&1&&(n|=r.readUInt8()<<i),e>>=1,i+=8;return n}function sA(r,e){let t=r.readUInt8(),n=128,i=15,s=112;if(t&n){let o=iA(r,t&i,4),a=iA(r,(t&s)>>4,3);return a===0&&(a=65536),e.slice(o,o+a)}else return r.slice(t)}function pB(r){let e=[r];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function OA(r){return r[Symbol.asyncIterator]?r[Symbol.asyncIterator]():r[Symbol.iterator]?r[Symbol.iterator]():r.next?r:pB(r)}var ah=class{constructor(e){if(typeof _=="undefined")throw new Error("Missing Buffer dependency");this.stream=OA(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:t}=await this.stream.next();return e&&(this._ended=!0,!t)?_.alloc(0):(t&&(t=_.from(t)),t)}_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 t=[this.buffer];for(;this.cursor+e>mB(t);){let n=await this._next();if(this._ended)break;t.push(n)}this.buffer=_.concat(t)}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 mB(r){return r.reduce((e,t)=>e+t.length,0)}async function gB(r,e){let t=new ah(r),n=await t.read(4);if(n=n.toString("utf8"),n!=="PACK")throw new be(`Invalid PACK header '${n}'`);let i=await t.read(4);if(i=i.readUInt32BE(0),i!==2)throw new be(`Invalid packfile version: ${i}`);let s=await t.read(4);if(s=s.readUInt32BE(0),!(s<1))for(;!t.eof()&&s--;){let o=t.tell(),{type:a,length:l,ofs:c,reference:u}=await wB(t),f=new ph.default.Inflate;for(;!f.result;){let d=await t.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new be(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new be("Inflated object size is different from that stated in packfile.");await t.undo(),await t.read(d.length-f.strm.avail_in);let h=t.tell();await e({data:f.result,type:a,num:s,offset:o,end:h,reference:u,ofs:c})}}}}async function wB(r){let e=await r.byte(),t=e>>4&7,n=e&15;if(e&128){let o=4;do e=await r.byte(),n|=(e&127)<<o,o+=7;while(e&128)}let i,s;if(t===6){let o=0;i=0;let a=[];do e=await r.byte(),i|=(e&127)<<o,o+=7,a.push(e);while(e&128);s=_.from(a)}return t===7&&(s=await r.read(20)),{type:t,l Line truncated
`,r}function lh(r){let[,e,t,n,i]=r.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:t,timestamp:Number(n),timezoneOffset:$B(i)}}function $B(r){let[,e,t,n]=r.match(/(\+|-)(\d\d)(\d\d)/);return n=(e==="+"?1:-1)*(Number(t)*60+Number(n)),PB(n)}function PB(r){return r===0?r:-r}var Xr=class r{constructor(e){if(typeof e=="string")this._tag=e;else if(_.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=r.render(e);else throw new be("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new r(e)}static render(e){return`object ${e.object}
type ${e.type}
tag ${e.tag}
tagger ${dv(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(`
`),t=[];for(let s of e)s[0]===" "?t[t.length-1]+=`
`+s.slice(1):t.push(s);let n={},i=new Set;for(let s of t){let o=s.slice(0,s.indexOf(" ")),a=s.slice(s.indexOf(" ")+1);i.has(o)||(i.add(o),n[o]=a)}return n.tagger&&(n.tagger=lh(n.tagger)),n.committer&&(n.committer=lh(n.committer)),n}withoutSignature(){let e=Es(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 Es(e)}payload(){return this.withoutSignature()+`
`}toObject(){return _.from(this._tag,"utf8")}static async sign(e,t,n){let i=e.payload(),{signature:s}=await t({payload:i,secretKey:n});s=Es(s);let o=i+s;return r.from(o)}};function Zw(r){return r.trim().split(`
`).map(e=>" "+e).join(`
`)+`
`}function IB(r){return r.split(`
`).map(e=>e.replace(/^ /,"")).join(`
`)}var Qr=class r{constructor(e){if(typeof e=="string")this._commit=e;else if(_.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=r.render(e);else throw new be("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:t}){let n=r.justHeaders(e),i=r.justMessage(e),s=Es(n+`
gpgsig`+Zw(t)+`
`+i);return new r(s)}static from(e){return new r(e)}toObject(){return _.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return r.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return Es(e.slice(e.indexOf(`
`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(`
`))}parseHeaders(){let e=r.justHeaders(this._commit).split(`
`),t=[];for(let l of e)l[0]===" "?t[t.length-1]+=`
`+l.slice(1):t.push(l);let n={parent:[]},i=l=>l.slice(0,l.indexOf(" ")),s=l=>l.slice(l.indexOf(" ")+1);if(t.length===0||i(t[0])!=="tree")throw new gi("tree as the first commit header",i(t[0]||""));n.tree=s(t[0]);let o=1;for(;o<t.length&&i(t[o])==="parent";)n.parent.push(s(t[o])),o++;let a=new Set(["tree","parent"]);for(;o<t.length;o++){let l=i(t[o]);a.has(l)||(a.add(l),n[l]=s(t[o]))}return n.author&&(n.author=lh(n.author)),n.committer&&(n.committer=lh(n.committer)),n}static renderHeaders(e){let t="";if(e.tree?t+=`tree ${e.tree}
`:t+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
`,e.parent){if(e.parent.length===void 0)throw new be("commit 'parent' property should be an array");for(let s of e.parent)t+=`parent ${s}
`}let n=e.author;t+=`author ${dv(n)}
`;let i=e.committer||e.author;return t+=`committer ${dv(i)}
`,e.gpgsig&&(t+="gpgsig"+Zw(e.gpgsig)),t}static render(e){return r.renderHeaders(e)+`
`+Es(e.message)}render(){return this._commit}withoutSignature(){let e=Es(this._commit);if(e.indexOf(`
gpgsig`)===-1)return e;let t=e.slice(0,e.indexOf(`
gpgsig`)),n=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
`)+28);return Es(t+`
`+n)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return IB(e)}static async sign(e,t,n){let i=e.withoutSignature(),s=r.justMessage(e._commit),{signature:o}=await t({payload:i,secretKey:n});o=Es(o);let l=r.justHeaders(e._commit)+`
gpgsig`+Zw(o)+`
`+s;return r.from(l)}};async function Ol({fs:r,cache:e,gitdir:t,oid:n}){if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:Zr.from([]),oid:n};let{type:i,object:s}=await pt({fs:r,cache:e,gitdir:t,oid:n});if(i==="tag")return n=Xr.from(s).parse().object,Ol({fs:r,cache:e,gitdir:t,oid:n});if(i==="commit")return n=Qr.from(s).parse().tree,Ol({fs:r,cache:e,gitdir:t,oid:n});if(i!=="tree")throw new sr(n,i,"tree");return{tree:Zr.from(s),oid:n}}var hv=class{constructor({fs:e,gitdir:t,ref:n,cache:i}){this.fs=e,this.cache=i,this.gitdir=t,this.mapPromise=(async()=>{let o=new Map,a;try{a=await q.resolve({fs:e,gitdir:t,ref:n})}catch(c){if(c instanceof Be&&await q.isUnbornBranch({fs:e,gitdir:t,ref:n}))a="4b825dc642cb6eb9a060e54bf8d69288fbee4904";else throw c}let l=await Ol({fs:e,cache:this.cache,gitdir:t,oid:a});return l.type="tree",l.mode="40000",o.set(".",l),o})();let s=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let t=e._fullpath,{fs:n,cache:i,gitdir:s}=this,o=await this.mapPromise,a=o.get(t);if(!a)throw new Error(`No obj for ${t}`);let l=a.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(a)}`);if(a.type!=="tree")return null;let{type:c,object:u}=await pt({fs:n,cache:i,gitdir:s,oid:l});if(c!==a.type)throw new sr(l,c,a.type);let f=Zr.from(u);for(let d of f)o.set(B(t,d.path),d);return f.entries().map(d=>B(t,d.path))}async type(e){if(e._type===!1){let t=await this.mapPromise,{type:n}=t.get(e._fullpath);e._type=n}return e._type}async mode(e){if(e._mode===!1){let t=await this.mapPromise,{mode:n}=t.get(e._fullpath);e._mode=CA(parseInt(n,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let t=await this.mapPromise,{fs:n,cache:i,gitdir:s}=this,a=t.get(e._fullpath).oid,{type:l,object:c}=await pt({fs:n,cache:i,gitdir:s,oid:a});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 mr({ref:r="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,gh,{value:function({fs:t,gitdir:n,cache:i}){return new hv({fs:t,gitdir:n,ref:r,cache:i})}}),Object.freeze(e),e}var pv=class{constructor({fs:e,dir:t,gitdir:n,cache:i,refresh:s=!0}){this.fs=e,this.cache=i,this.dir=t,this.gitdir=n,this.refresh=s,this.refreshQueue=[],this.flushed=!1,this.config=null;let o=this;this.ConstructEntry=class{constructor(l){this._fullpath=l,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return o.type(this)}async mode(){return o.mode(this)}async stat(){return o.stat(this)}async content(){return o.content(this)}async oid(){return o.oid(this)}}}async readdir(e){if(await e.type()!=="tree")return null;let t=e._fullpath,{fs:n,dir:i}=this,s=await n.readdir(B(i,t));return s===null?null:s.map(o=>B(t,o))}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:t,dir:n}=this,i=await t.lstat(`${n}/${e._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let s=i.isDirectory()?"tree":"blob";s==="blob"&&!i.isFile()&&!i.isSymbolicLink()&&(s="special"),e._type=s,i=ao(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:t,dir:n,gitdir:i}=this;if(await e.type()==="tree")e._content=void 0;else{let s;if(await e.mode()>>12===10)s=await t.readlink(`${n}/${e._fullpath}`);else{let a=await(await this._getGitConfig(t,i)).get("core.autocrlf");s=await t.read(`${n}/${e._fullpath}`,{autocrlf:a})}e._actualSize=s.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(s)}}return e._content}async oid(e){if(e._oid===!1){let t=this,{fs:n,gitdir:i,cache:s}=this,o;await Ct.acquire({fs:n,gitdir:i,cache:s},async function(a){let l=a.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await t._getGitConfig(n,i)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||nh(c,l,f,d)){let h=await e.content();h===void 0?o=void 0:(o=await mi(Ss.wrap({type:"blob",object:h})),t.refresh&&l&&!l.flags.intentToAdd&&o===l.oid&&(!f||c.mode===l.mode)&&nh(c,l,f,d)&&(t.flushed?a.insert({filepath:e._fullpath,stats:c,oid:o}):t.refreshQueue.push({filepath:e._fullpath,stage:l,stats:c,oid:o})))}else o=l.oid}),e._oid=o}return e._oid}async flush(){let{fs:e,gitdir:t,cache:n,refreshQueue:i}=this;this.refreshQueue=[],this.flushed=!0,i.length!==0&&await Ct.acquire({fs:e,gitdir:t,cache:n},async s=>{for(let{filepath:o,stage:a,stats:l,oid:c}of i)s.entriesMap.get(o)===a&&s.insert({filepath:o,stats:l,oid:c})})}async _getGitConfig(e,t){return this.config?this. Line truncated
`),n=new TextEncoder().encode(n)}catch(i){}return typeof n!="string"&&(n=_.from(n)),n}async write(e,t,n={}){try{await this._writeFile(e,t,n)}catch(i){await this.mkdir(sa(e)),await this._writeFile(e,t,n)}}async mkdir(e){await LA(this._mkdir,e)}async rm(e){try{await this._unlink(e)}catch(t){if(t.code!=="ENOENT")throw t}}async rmdir(e,t){try{t&&t.recursive?await this._rm(e,t):await this._rmdir(e)}catch(n){if(n.code!=="ENOENT")throw n}}async readdir(e){let t;try{t=await this._readdir(e)}catch(n){if(n.code==="ENOTDIR")return null;if(bu(n))return[];throw n}return t.sort(mh),t}async readdirDeep(e){let t=await this._readdir(e);return(await Promise.all(t.map(async i=>{let s=e+"/"+i;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((i,s)=>i.concat(s),[])}async lstat(e){try{return await this._lstat(e)}catch(t){if(bu(t))return null;throw t}}async readlink(e,t={encoding:"buffer"}){try{let n=await this._readlink(e,t);return _.isBuffer(n)?n:_.from(n)}catch(n){if(bu(n))return null;throw n}}async writelink(e,t){return this._symlink(t.toString("utf8"),e)}};function I(r,e){if(e===void 0)throw new Kr(r)}function LB(r){return r.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(r)}async function le({fsp:r,dotgit:e}){I("fsp",r),I("dotgit",e);let t=await r._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return t.isDirectory()?e:t.isFile()?r._readFile(e,"utf8").then(n=>n.trimRight().substr(8)).then(n=>LB(n)?n:B(sa(e),n)):e}async function ch(r,e){return!r&&!e?!1:r&&!e||!r&&e?!0:!(await r.type()==="tree"&&await e.type()==="tree"||await r.type()===await e.type()&&await r.mode()===await e.mode()&&await r.oid()===await e.oid())}async function NB({fs:r,dir:e,gitdir:t=B(e,".git"),commit:n="HEAD",cache:i={}}){try{I("fs",r),I("dir",e),I("gitdir",t);let s=new re(r),o=[mr({ref:n}),Dl(),lo()],a=[],l=await le({fsp:s,dotgit:t});await Ct.acquire({fs:s,gitdir:l,cache:i},async function(u){a=u.unmergedPaths});let c=await vi({fs:s,cache:i,dir:e,gitdir:l,trees:o,map:async function(u,[f,d,h]){let p=!await ch(d,h),m=a.includes(u),w=!await ch(h,f);if(p||m)return f?{path:u,mode:await f.mode(),oid:await f.oid(),type:await f.type(),content:await f.content()}:void 0;if(w)return!1;throw new Lu(u)}});await Ct.acquire({fs:s,gitdir:l,cache:i},async function(u){for(let f of c)if(f!==!1){if(!f){await s.rmdir(`${e}/${f.path}`,{recursive:!0}),u.delete({filepath:f.path});continue}if(f.type==="blob"){let d=new TextDecoder().decode(f.content);await s.write(`${e}/${f.path}`,d,{mode:f.mode}),u.insert({filepath:f.path,oid:f.oid,stage:0})}}})}catch(s){throw s.caller="git.abortMerge",s}}var uo=class{static async isIgnored({fs:e,dir:t,gitdir:n=B(t,".git"),filepath:i}){if(ih(i)===".git")return!0;if(i===".")return!1;let s="",o=B(n,"info","exclude");await e.exists(o)&&(s=await e.read(o,"utf8"));let a=[{gitignore:B(t,".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("/");a.push({gitignore:B(t,f,".gitignore"),filepath:d})}let c=!1;for(let[u,f]of a.entries()){let d=await e.read(f.gitignore,"utf8"),h=(0,SA.default)();u===0&&h.add(s),h.add(d);let p=sa(f.filepath);if(p!=="."&&h.ignores(p))return!0;c?c=!h.test(f.filepath).unignored:c=h.test(f.filepath).ignored}return c}};async function BB({fs:r,gitdir:e,object:t,format:n,oid:i}){if(n!=="deflated")throw new be("GitObjectStoreLoose expects objects to write to be in deflated format");let s=`objects/${i.slice(0,2)}/${i.slice(2)}`,o=`${e}/${s}`;await r.exists(o)||await r.write(o,t)}var Xw=null;async function NA(r){return Xw===null&&(Xw=GB()),Xw?HB(r):ph.default.deflate(r)}async function HB(r){let e=new CompressionStream("deflate"),t=new Blob([r]).stream().pipeThrough(e);return new Uint8Array(await new Response(t).arrayBuffer())}function GB(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(r){return!1}}async function Jr({fs:r,gitdir:e,type:t,object:n,format:i="content",oid:s=void 0,dryRun:o=!1}){return i!=="deflated"&&(i!=="wrapped"&&(n=Ss.wrap({type:t,object:n})),s=await mi(n),n=_.from(await NA(n))),o||await BB({fs:r,gitdir:e,object:n,format:"deflated",oid:s}),s}function BA(r){let e;for(;~(e=r.indexOf(92));)r[e]=47;return r}async function UB({fs:r,dir:e,gitdir:t=B(e,".git"),filepath:n,cache:i={},force:s=!1,parallel:o=!0}){try{I("fs",r),I("dir",e),I("gitdir",t),I("filepath",n);let a=new re(r),l=await le({fsp:a,dotgit:t});await Ct.acquire({fs:a,gitdir:l,cache:i},async c=>{let f=await(await Tt.get({fs:a,gitdir:l})).get("core.autocrlf");return wv({dir:e,gitdir:l,fs:a,filepath:n,index:c,force:s,parallel:o,autocrlf:f})})}catch(a){throw a.caller="git.add",a}}function jB(r,e){if(r.has({filepath:e}))return!0;let t=`${e}/`;for(let n of r.entriesMap.keys())if(n.startsWith(t))return!0;return!1}async function wv({dir:r,gitdir:e,fs:t,filepath:n,index:i,force:s,parallel:o,autocrlf:a}){n=Array.isArray(n)?n:[n];let l=n.map(async d=>{if(!s&&!jB(i,d)&&await uo.isIgnored({fs:t,dir:r,gitdir:e,filepath: Line truncated
`,author:l,committer:c,signingKey:u})}async function YB({fs:r,onSign:e,dir:t,gitdir:n=B(t,".git"),ref:i="refs/notes/commits",oid:s,note:o,force:a,author:l,committer:c,signingKey:u,cache:f={}}){try{I("fs",r),I("gitdir",n),I("oid",s),I("note",o),u&&I("onSign",e);let d=new re(r),h=await fo({fs:d,gitdir:n,author:l});if(!h)throw new gr("author");let p=await la({fs:d,gitdir:n,author:h,committer:c});if(!p)throw new gr("committer");let m=await le({fsp:d,dotgit:n});return await qB({fs:d,cache:f,onSign:e,gitdir:m,ref:i,oid:s,note:o,force:a,author:h,committer:p,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}async function zA({fs:r,gitdir:e,remote:t,url:n,force:i}){if(!Al(t,!0))throw new _n(t,na.default.clean(t));let s=await Tt.get({fs:r,gitdir:e});if(!i&&(await s.getSubsections("remote")).includes(t)&&n!==await s.get(`remote.${t}.url`))throw new wi("remote",t);await s.set(`remote.${t}.url`,n),await s.set(`remote.${t}.fetch`,`+refs/heads/*:refs/remotes/${t}/*`),await Tt.save({fs:r,gitdir:e,config:s})}async function KB({fs:r,dir:e,gitdir:t=B(e,".git"),remote:n,url:i,force:s=!1}){try{I("fs",r),I("gitdir",t),I("remote",n),I("url",i);let o=new re(r),a=await le({fsp:o,dotgit:t});return await zA({fs:o,gitdir:a,remote:n,url:i,force:s})}catch(o){throw o.caller="git.addRemote",o}}async function ZB({fs:r,cache:e,onSign:t,gitdir:n,ref:i,tagger:s,message:o=i,gpgsig:a,object:l,signingKey:c,force:u=!1}){if(i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`,!u&&await q.exists({fs:r,gitdir:n,ref:i}))throw new wi("tag",i);let f=await q.resolve({fs:r,gitdir:n,ref:l||"HEAD"}),{type:d}=await pt({fs:r,cache:e,gitdir:n,oid:f}),h=Xr.from({object:f,type:d,tag:i.replace("refs/tags/",""),tagger:s,message:o,gpgsig:a});c&&(h=await Xr.sign(h,t,c));let p=await Jr({fs:r,gitdir:n,type:"tag",object:h.toObject()});await q.writeRef({fs:r,gitdir:n,ref:i,value:p})}async function XB({fs:r,onSign:e,dir:t,gitdir:n=B(t,".git"),ref:i,tagger:s,message:o=i,gpgsig:a,object:l,signingKey:c,force:u=!1,cache:f={}}){try{I("fs",r),I("gitdir",n),I("ref",i),c&&I("onSign",e);let d=new re(r),h=await le({fsp:d,dotgit:n}),p=await fo({fs:d,gitdir:h,author:s});if(!p)throw new gr("tagger");return await ZB({fs:d,cache:f,onSign:e,gitdir:h,ref:i,tagger:p,message:o,gpgsig:a,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function QB({fs:r,gitdir:e,ref:t,object:n,checkout:i=!1,force:s=!1}){if(!Al(t,!0))throw new _n(t,na.default.clean(t));let o=`refs/heads/${t}`;if(!s&&await q.exists({fs:r,gitdir:e,ref:o}))throw new wi("branch",t,!1);let a;try{a=await q.resolve({fs:r,gitdir:e,ref:n||"HEAD"})}catch(l){if(!(l instanceof Be))throw l}a&&(a=(await Gu({fs:r,cache:{},gitdir:e,oid:a})).oid,await q.writeRef({fs:r,gitdir:e,ref:o,value:a})),i&&await q.writeSymbolicRef({fs:r,gitdir:e,ref:"HEAD",value:o})}async function JB({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n,object:i,checkout:s=!1,force:o=!1}){try{I("fs",r),I("gitdir",t),I("ref",n);let a=new re(r),l=await le({fsp:a,dotgit:t});return await QB({fs:a,gitdir:l,ref:n,object:i,checkout:s,force:o})}catch(a){throw a.caller="git.branch",a}}async function Hu(r,e,t){let n=t.split("/");n.pop();let i=e;for(let s of n){if(s===""||s===".")continue;i=`${i}/${s}`;let o=await r.lstat(i);if(o&&o.isSymbolicLink())throw new ia(t)}}var xv=(r,e)=>{if(r==="."||e==null||e.length===0||e===".")return!0;let t=e.endsWith("/")?e.slice(0,-1):e;return t==="."?!0:t.length>=r.length?t===r||t.startsWith(`${r}/`):r.startsWith(`${t}/`)};async function Ev({fs:r,cache:e,onProgress:t,onPostCheckout:n,dir:i,gitdir:s,remote:o,ref:a,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0,restoreFromIndex:p=!1,nonBlocking:m=!1,batchSize:w=100}){let y;if(n)try{y=await q.resolve({fs:r,gitdir:s,ref:"HEAD"})}catch(A){y="0000000000000000000000000000000000000000"}let v;try{v=await q.resolve({fs:r,gitdir:s,ref:a})}catch(A){if(a==="HEAD"||!(A instanceof Be))throw A;let C=`${o}/${a}`;if(v=await q.resolve({fs:r,gitdir:s,ref:C}),h){let S=await Tt.get({fs:r,gitdir:s});await S.set(`branch.${a}.remote`,o),await S.set(`branch.${a}.merge`,`refs/heads/${a}`),await Tt.save({fs:r,gitdir:s,config:S})}await q.writeRef({fs:r,gitdir:s,ref:`refs/heads/${a}`,value:v})}if(!u)try{v=(await Gu({fs:r,cache:e,gitdir:s,oid:v})).oid}catch(A){throw A instanceof Be?new Tl(a,A.data.what):A}if(!c){let A;try{A=await eH({fs:r,cache:e,onProgress:t,dir:i,gitdir:s,ref:a,force:d,filepaths:l,restoreFromIndex:p})}catch(x){throw x instanceof Be&&x.data.what===v?new Tl(a,v):x}let C=A.filter(([x])=>x==="conflict").map(([x,E])=>E);if(C.length>0)throw new ku(C);let S=A.filter(([x])=>x==="error").map(([x,E])=>E);if(S.length>0)throw new be(S.join(", "));if(f){n&&await n({previousHead:y,newHead:v,type:l!=null&&l.length>0?"file":"branch"});return}let T=0,b=A.length;if(await Ct.acquire({fs:r,gitdir:s,cache:e},async function(x){await Promise.all(A.filter(([E])=>E==="delete"||E==="delete-index").map(async function([E,k]){let $=`${i}/${k}`;E==="delete"&&await r.rm($),x.delete({filepath:k}) 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 WA({fs:r,cache:e,dir:t,gitdir:n=B(t,".git"),index:i,ourOid:s,baseOid:o,theirOid:a,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let p=mr({ref:s}),m=mr({ref:o}),w=mr({ref:a}),y=[],v=[],A=[],C=[],S=await vi({fs:r,cache:e,dir:t,gitdir:n,trees:[p,m,w],map:async function(T,[b,x,E]){let k=ih(T),$=await ch(b,x),M=await ch(E,x);switch(`${$}-${M}`){case"false-false":return{mode:await x.mode(),path:k,oid:await x.oid(),type:await x.type()};case"false-true":return!E&&await b.type()==="tree"?{mode:await b.mode(),path:k,oid:await b.oid(),type:await b.type()}:E?{mode:await E.mode(),path:k,oid:await E.oid(),type:await E.type()}:void 0;case"true-false":return!b&&await E.type()==="tree"?{mode:await E.mode(),path:k,oid:await E.oid(),type:await E.type()}:b?{mode:await b.mode(),path:k,oid:await b.oid(),type:await b.type()}:void 0;case"true-true":{if(b&&E&&await b.type()==="tree"&&await E.type()==="tree")return{mode:await b.mode(),path:k,oid:await b.oid(),type:"tree"};if(b&&E&&await b.type()==="blob"&&await E.type()==="blob")return iH({fs:r,gitdir:n,path:k,ours:b,base:x,theirs:E,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async D=>{if(D.cleanMerge)d||i.insert({filepath:T,oid:D.mergeResult.oid,stage:0});else if(y.push(T),v.push(T),!d){let P="";x&&await x.type()==="blob"&&(P=await x.oid());let F=await b.oid(),_e=await E.oid();i.delete({filepath:T}),P&&i.insert({filepath:T,oid:P,stage:1}),i.insert({filepath:T,oid:F,stage:2}),i.insert({filepath:T,oid:_e,stage:3})}return D.mergeResult});if(x&&!b&&E&&await x.type()==="blob"&&await E.type()==="blob"){if(y.push(T),A.push(T),!d){let D=await x.oid(),P=await E.oid();i.delete({filepath:T}),i.insert({filepath:T,oid:D,stage:1}),i.insert({filepath:T,oid:P,stage:3})}return{mode:await E.mode(),oid:await E.oid(),type:"blob",path:k}}if(x&&b&&!E&&await x.type()==="blob"&&await b.type()==="blob"){if(y.push(T),C.push(T),!d){let D=await x.oid(),P=await b.oid();i.delete({filepath:T}),i.insert({filepath:T,oid:D,stage:1}),i.insert({filepath:T,oid:P,stage:2})}return{mode:await b.mode(),oid:await b.oid(),type:"blob",path:k}}if(x&&!b&&!E&&(await x.type()==="blob"||await x.type()==="tree"))return;throw new $l}}},reduce:y.length!==0&&(!t||d)?void 0:async(T,b)=>{let x=b.filter(Boolean);if(T&&!(T&&T.type==="tree"&&x.length===0&&T.path!==".")){if(x.length>0||T.path==="."&&x.length===0){let k=new Zr(x).toObject(),$=await Jr({fs:r,gitdir:n,type:"tree",object:k,dryRun:f});T.oid=$}return T}}});return y.length!==0?(t&&!d&&await vi({fs:r,cache:e,dir:t,gitdir:n,trees:[mr({ref:S.oid})],map:async function(T,[b]){let x=`${t}/${T}`;if(await b.type()==="blob"){let E=await b.mode(),k=await b.content();await r.write(x,k,{mode:E})}return!0}}),new oa(y,v,A,C)):S.oid}async function iH({fs:r,gitdir:e,path:t,ours:n,base:i,theirs:s,ourName:o,theirName:a,baseName:l,dryRun:c,mergeDriver:u=nH}){let f="blob",d="100755",h="",p="";i&&await i.type()==="blob"&&(d=await i.mode(),h=await i.oid(),p=_.from(await i.content()).toString("utf8"));let m=d===await n.mode()?await s.mode():await n.mode();if(await n.oid()===await s.oid())return{cleanMerge:!0,mergeResult:{mode:m,path:t,oid:await n.oid(),type:f}};if(await n.oid()===h)return{cleanMerge:!0,mergeResult:{mode:m,path:t,oid:await s.oid(),type:f}};if(await s.oid()===h)return{cleanMerge:!0,mergeResult:{mode:m,path:t,oid:await n.oid(),type:f}};let w=_.from(await n.content()).toString("utf8"),y=_.from(await s.content()).toString("utf8"),{mergedText:v,cleanMerge:A}=await u({branches:[l,o,a],contents:[p,w,y],path:t}),C=await Jr({fs:r,gitdir:e,type:"blob",object:_.from(v,"utf8"),dryRun:c});return{cleanMerge:A,mergeResult:{mode:m,path:t,oid:C,type:f}}}var sH={stage:lo,workdir:Dl};async function oH(r,e,t,n,i=null){let s=B(t,n),o=await r.lstat(s);if(!o)throw new Be(s);if(o.isDirectory())throw new be(`${s}: file expected, but found directory`);let a=i?await PA({fs:r,gitdir:e,oid:i}):void 0,l=a?i:void 0;return a||await ir(s,async()=>{let c=o.isSymbolicLink()?await r.readlink(s).then(BA):await r.read(s);if(c===null)throw new Be(s);l=await Jr({fs:r,gitdir:e,type:"blob",object:c})}),l}async function aH({fs:r,dir:e,gitdir:t,entries:n}){async function i(s){if(s.type==="tree"){if(!s.oid){let o=await Promise.all(s.children.map(i));s.oid=await ju({fs:r,gitdir:t,tree:o}),s.mode=16384}}else s.type==="blob"&&(s.oid=await oH(r,t,e,s.path,s.oid),s.mode=33188);return s.path=s.path.split("/").pop(),s}return Promise.all(n.map(i))}async function fA({fs:r,dir:e,gitdir:t,treePair:n}){let i=n[1]==="stage",s=n.map(h=>typeof h=="string"?sH[h]():h),o=[],u=await vi({fs:r,cache:{},dir:e,gitdir:t,trees:s,map:async(h,[p,m])=>{if(!(h==="."||await uo.isIgnored({fs:r,dir:e,gitdir:t,filepath:h}))&&m)return(!p||await p.oid()!==await m.oid()&&await m.oid()!==void 0)&&o.push([p,m]),{mode:await m.mode(),path:h,oid:await m.oid(),type:await m.type()}},reduce:async(h,p)=>(p=p.filter(Boolean),h?(h.children=p,h):p.length>0?p Line truncated
`).map(o=>i.add(o))}),i}static async write({fs:e,gitdir:t,oids:n}){let i=B(t,"shallow");if(n.size>0){let s=[...n].join(`
`)+`
`;await ir(i,async function(){await e.write(i,s,{encoding:"utf8"})})}else await ir(i,async function(){await e.rm(i)})}};function fh({config:r,onAuth:e}){return e&&(async(t,n)=>{let i=n.username||await r.get(`credential.${t}.username`);return e(t,i?{...n,username:i}:n)})}function gH(r){let i="5041434b"+"00000002"+"00000000";return r.slice(0,12).toString("hex")===i}function KA(r,e){let t=r.map(n=>n.split("=",1)[0]);return e.filter(n=>{let i=n.split("=",1)[0];return t.includes(i)})}var vh={name:"isomorphic-git",version:"1.44.10",agent:"git/isomorphic-git@1.44.10"},kl=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 t=this._waiting;this._waiting=null,t({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 wH(r){let e=r.indexOf("\r"),t=r.indexOf(`
`);return e===-1&&t===-1?-1:e===-1?t+1:t===-1?e+1:t===e+1?t+1:Math.min(e,t)+1}function ZA(r){let e=new kl,t="";return(async()=>(await zu(r,n=>{for(n=n.toString("utf8"),t+=n;;){let i=wH(t);if(i===-1||i===t.length&&t[i-1]==="\r")break;e.write(t.slice(0,i)),t=t.slice(i)}}),t.length>0&&e.write(t),e.end()))(),e}var dh=class{static demux(e){let t=At.streamReader(e),n=new kl,i=new kl,s=new kl,o=async function(){let a=await t();if(a===null)return o();if(a===!0){n.end(),s.end(),e.error?i.destroy(e.error):i.end();return}switch(a[0]){case 1:{i.write(a.slice(1));break}case 2:{s.write(a.slice(1));break}case 3:{let l=a.slice(1);s.write(l),n.end(),s.end(),i.destroy(new Error(l.toString("utf8")));return}default:n.write(a)}o()};return o(),{packetlines:n,packfile:i,progress:s}}};async function vH(r){let{packetlines:e,packfile:t,progress:n}=dh.demux(r),i=[],s=[],o=[],a=!1,l=!1;return new Promise((c,u)=>{zu(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new co(h)),i.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new co(h)),s.push(h)}else if(d.startsWith("ACK")){let[,h,p]=d.split(" ");o.push({oid:h,status:p}),p||(l=!0)}else d.startsWith("NAK")?(a=!0,l=!0):(l=!0,a=!0);l&&(r.error?u(r.error):c({shallows:i,unshallows:s,acks:o,nak:a,packfile:t,progress:n}))}).finally(()=>{l||(r.error?u(r.error):c({shallows:i,unshallows:s,acks:o,nak:a,packfile:t,progress:n}))})})}function bH({capabilities:r=[],wants:e=[],haves:t=[],shallows:n=[],depth:i=null,since:s=null,exclude:o=[]}){let a=[];e=[...new Set(e)];let l=` ${r.join(" ")}`;for(let c of e)a.push(At.encode(`want ${c}${l}
`)),l="";for(let c of n)a.push(At.encode(`shallow ${c}
`));i!==null&&a.push(At.encode(`deepen ${i}
`)),s!==null&&a.push(At.encode(`deepen-since ${Math.floor(s.valueOf()/1e3)}
`));for(let c of o)a.push(At.encode(`deepen-not ${c}
`));a.push(At.flush());for(let c of t)a.push(At.encode(`have ${c}
`));return a.push(At.encode(`done
`)),a}async function Sv({fs:r,cache:e,http:t,onProgress:n,onMessage:i,onAuth:s,onAuthSuccess:o,onAuthFailure:a,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:p=null,since:m=null,exclude:w=[],relative:y=!1,tags:v=!1,singleBranch:A=!1,headers:C={},prune:S=!1,pruneTags:T=!1}){let b=c||await po({fs:r,gitdir:l,test:!0}),x=await Tt.get({fs:r,gitdir:l}),E=f||b&&await x.get(`branch.${b}.remote`)||"origin",k=d||await x.get(`remote.${E}.url`);if(typeof k=="undefined")throw new Kr("remote OR url");let $=u||b&&await x.get(`branch.${b}.merge`)||c||"HEAD";h===void 0&&(h=await x.get("http.corsProxy"));let M=Ml.getRemoteHelperFor({url:k}),D=await M.discover({http:t,onAuth:fh({config:x,onAuth:s}),onAuthSuccess:o,onAuthFailure:fh({config:x,onAuth:a}),corsProxy:h,service:"git-upload-pack",url:k,headers:C,protocolVersion:1}),P=D.auth,F=D.refs;if(F.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!D.capabilities.has("shallow"))throw new oo("shallow","depth");if(m!==null&&!D.capabilities.has("deepen-since"))throw new oo("deepen-since","since");if(w.length>0&&!D.capabilities.has("deepen-not"))throw new oo("deepen-not","exclude");if(y===!0&&!D.capabilities.has("deepen-relative"))throw new oo("deepen-relative","relative");let{oid:_e,fullref:Q}=q.resolveAgainstMap({ref:$,map:F});for(let ee of F.keys())ee===Q||ee==="HEAD"||ee.startsWith("refs/heads/")||v&&ee.startsWith("refs/tags/")||F.delete(ee);let oe=KA([...D.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${vh.agent}`]);y&&oe.push("deepen-relative");let fe=A?[_e]:F.values(),Z=A?[b]:await q.listRefs({fs:r,gitdir:l,filepath:"refs"}),Y=[];for(let ee of Z)try{ee=await q.expand({fs:r,gitdir:l,ref:ee});let Oe=await q.resolve({fs:r,gitdir:l,ref:ee});await vv({fs:r,cache:e,gitdir:l,oid:Oe})&&Y.push(Oe)}catch(Oe){}Y=[...new Set(Y)];let J=await ho.read({fs:r,gitdir:l}),U=D.capabilities.has("shallow")?[...J]:[],et=bH({capabilities:oe,wants:fe,haves:Y,shallows:U,depth:p,since:m,exclude:w}),se=_.from(await uh(et)),vt=await M.connect({http:t,onProgress:n,corsProxy:h,service:"git-upload-pack",url:k,auth:P,body:[se],headers:C}),tt=await vH(vt.body);vt.headers&&(tt.headers=vt.headers);for(let ee of tt.shallows)if(!J.has(ee))try{let{object:Oe}=await pt({fs:r,cache:e,gitdir:l,oid:ee}),Te=new Qr(Oe),bt=await Promise.all(Te.headers().parent.map(Vr=>vv({fs:r,cache:e,gitdir:l,oid:Vr})));bt.length===0||bt.every(Vr=>Vr)||J.add(ee)}catch(Oe){J.add(ee)}for(let ee of tt.unshallows)J.delete(ee);if(await ho.write({fs:r,gitdir:l,oids:J}),A){let ee=new Map([[Q,_e]]),Oe=new Map,Te=10,bt=Q;for(;Te--;){let jc=D.symrefs.get(bt);if(jc===void 0)break;Oe.set(bt,jc),bt=jc}let vn=F.get(bt);vn&&ee.set(bt,vn);let{pruned:Vr}=await q.updateRemoteRefs({fs:r,gitdir:l,remote:E,refs:ee,symrefs:Oe,tags:v,prune:S});S&&(tt.pruned=Vr)}else{let{pruned:ee}=await q.updateRemoteRefs({fs:r,gitdir:l,remote:E,refs:F,symrefs:D.symrefs,tags:v,prune:S,pruneTags:T});S&&(tt.pruned=ee)}if(tt.HEAD=D.symrefs.get("HEAD"),tt.HEAD===void 0){let{oid:ee}=q.resolveAgainstMap({ref:"HEAD",map:F});for(let[Oe,Te]of F.entries())if(Oe!=="HEAD"&&Te===ee){tt.HEAD=Oe;break}}let j=Q.startsWith("refs/tags")?"tag":"branch";if(tt.FETCH_HEAD={oid:_e,description:`${j} '${ra(Q)}' of ${k}`},n||i){let ee=ZA(tt.progress);zu(ee,async Oe=>{if(i&&await i(Oe),n){let Te=Oe.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);Te&&await n({phase:Te[1].trim(),loaded:parseInt(Te[2],10),total:parseInt(Te[3],10)})}})}let Ce=_.from(await uh(tt.packfile));if(vt.body.error)throw vt.body.error;let z=Ce.slice(-20).toString("hex"),we={defaultBranch:tt.HEAD,fetchHead:tt.FETCH_HEAD.oid,fetchHeadDescription:tt.FETCH_HEAD.description};if(tt.headers&&(we.headers=tt.headers),S&&(we.pruned=tt.pruned),z!==""&&!gH(Ce)){we.packfile=`objects/pack/pack-${z}.pack`;let ee=B(l,we.packfile);await r.write(ee,Ce);let Oe=bt=>pt({fs:r,cache:e,gitdir:l,oid:bt}),Te=await Eu.fromPack({pack:Ce,getExternalRefDelta:Oe,onProgress:n});await r.write(ee.replace(/\.pack$/,".idx"),await Te.toBuffer())}return we}async function XA({fs:r,bare:e=!1,dir:t,gitdir:n=e?t:B(t,".git"),defaultBranch:i="master"}){if(await r.exists(n+"/config"))return;let s=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];s=s.map(o=>n+"/"+o);for(let o of s)await r.mkdir(o);await r.write(n+"/config",`[core]
repositoryformatversion = 0
filemode = false
bare = ${e}
`+(e?"":` logallrefupdates = true
`)+` symlinks = false
ignorecase = true
`),await r.write(n+"/HEAD",`ref: refs/heads/${i}
`)}async function yH({fs:r,cache:e,http:t,onProgress:n,onMessage:i,onAuth:s,onAuthSuccess:o,onAuthFailure:a,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:p,depth:m,since:w,exclude:y,relative:v,singleBranch:A,noCheckout:C,noTags:S,headers:T,nonBlocking:b,batchSize:x=100}){try{if(await XA({fs:r,gitdir:u}),await zA({fs:r,gitdir:u,remote:p,url:f,force:!1}),d){let $=await Tt.get({fs:r,gitdir:u});await $.set("http.corsProxy",d),await Tt.save({fs:r,gitdir:u,config:$})}let{defaultBranch:E,fetchHead:k}=await Sv({fs:r,cache:e,http:t,onProgress:n,onMessage:i,onAuth:s,onAuthSuccess:o,onAuthFailure:a,gitdir:u,ref:h,remote:p,corsProxy:d,depth:m,since:w,exclude:y,relative:v,singleBranch:A,headers:T,tags:!S});if(k===null)return;h=h||E,h=h.replace("refs/heads/",""),await Ev({fs:r,cache:e,onProgress:n,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:C,nonBlocking:b,batchSize:x})}catch(E){throw await r.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),E}}async function _H({fs:r,http:e,onProgress:t,onMessage:n,onAuth:i,onAuthSuccess:s,onAuthFailure:o,onPostCheckout:a,dir:l,gitdir:c=B(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:p=void 0,since:m=void 0,exclude:w=[],relative:y=!1,singleBranch:v=!1,noCheckout:A=!1,noTags:C=!1,headers:S={},cache:T={},nonBlocking:b=!1,batchSize:x=100}){try{I("fs",r),I("http",e),I("gitdir",c),A||I("dir",l),I("url",u);let E=new re(r),k=await le({fsp:E,dotgit:c});return await yH({fs:E,cache:T,http:e,onProgress:t,onMessage:n,onAuth:i,onAuthSuccess:s,onAuthFailure:o,onPostCheckout:a,dir:l,gitdir:k,url:u,corsProxy:f,ref:d,remote:h,depth:p,since:m,exclude:w,relative:y,singleBranch:v,noCheckout:A,noTags:C,headers:S,nonBlocking:b,batchSize:x})}catch(E){throw E.caller="git.clone",E}}async function xH({fs:r,onSign:e,dir:t,gitdir:n=B(t,".git"),message:i,author:s,committer:o,signingKey:a,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,disallowEmpty:f=!1,ref:d,parent:h,tree:p,cache:m={}}){try{I("fs",r),l||I("message",i),a&&I("onSign",e);let w=new re(r),y=await le({fsp:w,dotgit:n});return await Uu({fs:w,cache:m,onSign:e,gitdir:y,message:i,author:s,committer:o,signingKey:a,amend:l,dryRun:c,noUpdateBranch:u,disallowEmpty:f,ref:d,parent:h,tree:p})}catch(w){throw w.caller="git.commit",w}}async function EH({fs:r,dir:e,gitdir:t=B(e,".git"),fullname:n=!1,test:i=!1}){try{I("fs",r),I("gitdir",t);let s=new re(r),o=await le({fsp:s,dotgit:t});return await po({fs:s,gitdir:o,fullname:n,test:i})}catch(s){throw s.caller="git.currentBranch",s}}async function SH({fs:r,gitdir:e,ref:t}){if(t=t.startsWith("refs/heads/")?t:`refs/heads/${t}`,!await q.exists({fs:r,gitdir:e,ref:t}))throw new Be(t);let i=await q.expand({fs:r,gitdir:e,ref:t}),s=await po({fs:r,gitdir:e,fullname:!0});if(i===s){let l=await q.resolve({fs:r,gitdir:e,ref:i});await q.writeRef({fs:r,gitdir:e,ref:"HEAD",value:l})}await q.deleteRef({fs:r,gitdir:e,ref:i});let o=ra(t),a=await Tt.get({fs:r,gitdir:e});await a.deleteSection("branch",o),await Tt.save({fs:r,gitdir:e,config:a})}async function kH({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n}){try{I("fs",r),I("ref",n);let i=new re(r),s=await le({fsp:i,dotgit:t});return await SH({fs:i,gitdir:s,ref:n})}catch(i){throw i.caller="git.deleteBranch",i}}async function AH({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n}){try{I("fs",r),I("ref",n);let i=new re(r),s=await le({fsp:i,dotgit:t});await q.deleteRef({fs:i,gitdir:s,ref:n})}catch(i){throw i.caller="git.deleteRef",i}}async function CH({fs:r,gitdir:e,remote:t}){let n=await Tt.get({fs:r,gitdir:e});await n.deleteSection("remote",t),await Tt.save({fs:r,gitdir:e,config:n})}async function TH({fs:r,dir:e,gitdir:t=B(e,".git"),remote:n}){try{I("fs",r),I("remote",n);let i=new re(r),s=await le({fsp:i,dotgit:t});return await CH({fs:i,gitdir:s,remote:n})}catch(i){throw i.caller="git.deleteRemote",i}}async function RH({fs:r,gitdir:e,ref:t}){t=t.startsWith("refs/tags/")?t:`refs/tags/${t}`,await q.deleteRef({fs:r,gitdir:e,ref:t})}async function $H({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n}){try{I("fs",r),I("ref",n);let i=new re(r),s=await le({fsp:i,dotgit:t});return await RH({fs:i,gitdir:s,ref:n})}catch(i){throw i.caller="git.deleteTag",i}}async function PH({fs:r,gitdir:e,oid:t}){let n=t.slice(0,2);return(await r.readdir(`${e}/objects/${n}`)).map(s=>`${n}${s}`).filter(s=>s.startsWith(t))}async function IH({fs:r,cache:e,gitdir:t,oid:n,getExternalRefDelta:i}){let s=[],o=await r.readdir(B(t,"objects/pack"));o=o.filter(a=>a.endsWith(".idx"));for(let a of o){let l=`${t}/objects/pack/${a}`,c=await _v({fs:r,cache:e,filename:l,getExternalRefDelta:i});if(c.error)throw new be(c.error);for(let u of c.offsets.keys())u.startsWith(n)&&s.push(u)}return s}async function OH({fs:r,cache:e,gitdir:t,oid:n}){let i=a=>pt({fs:r,cache:e,gitdir:t,oid:a}),s=await PH({fs:r,gitdir:t,oid:n}),o=await IH({fs:r,cache:e,gitdir:t,oid:n,getExternalRefDelta:i});for(let a of o)s.indexOf(a)===-1&&s.push(a);if(s.length===1)return s[0];throw s.length>1?new Su("oids",n,s):new Be(`an object matching "${nLine truncated
`)),n.push(At.encode(`agent=${vh.agent}
`)),(t||e||r)&&n.push(At.delim()),t&&n.push(At.encode("peel")),e&&n.push(At.encode("symrefs")),r&&n.push(At.encode(`ref-prefix ${r}`)),n.push(At.flush()),n}async function l3({http:r,onAuth:e,onAuthSuccess:t,onAuthFailure:n,corsProxy:i,url:s,headers:o={},forPush:a=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{I("http",r),I("url",s);let d=await Fl.discover({http:r,onAuth:e,onAuthSuccess:t,onAuthFailure:n,corsProxy:i,service:a?"git-receive-pack":"git-upload-pack",url:s,headers:o,protocolVersion:l});if(d.protocolVersion===1)return tC(d,c,u,f);let h=await a3({prefix:c,symrefs:u,peelTags:f}),p=await Fl.connect({http:r,auth:d.auth,headers:o,corsProxy:i,service:a?"git-receive-pack":"git-upload-pack",url:s,body:h});return o3(p.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function c3({fs:r,dir:e,gitdir:t=B(e,".git")}){try{I("fs",r),I("gitdir",t);let n=new re(r),i=await le({fsp:n,dotgit:t});return q.listTags({fs:n,gitdir:i})}catch(n){throw n.caller="git.listTags",n}}function u3(r,e){return r.committer.timestamp-e.committer.timestamp}var f3="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function _A({fs:r,cache:e,gitdir:t,oid:n,fileId:i}){if(i===f3)return;let s=n,o,a=await Ol({fs:r,cache:e,gitdir:t,oid:n}),l=a.tree;return i===a.oid?o=a.path:(o=await iC({fs:r,cache:e,gitdir:t,tree:l,fileId:i,oid:s}),Array.isArray(o)&&(o.length===0?o=void 0:o.length===1&&(o=o[0]))),o}async function iC({fs:r,cache:e,gitdir:t,tree:n,fileId:i,oid:s,filepaths:o=[],parentPath:a=""}){let l=n.entries().map(function(c){let u;return c.oid===i?(u=B(a,c.path),o.push(u)):c.type==="tree"&&(u=pt({fs:r,cache:e,gitdir:t,oid:c.oid}).then(function({object:f}){return iC({fs:r,cache:e,gitdir:t,tree:Zr.from(f),fileId:i,oid:s,filepaths:o,parentPath:B(a,c.path)})})),u});return await Promise.all(l),o}async function d3({fs:r,cache:e,gitdir:t,filepath:n,ref:i,depth:s,since:o,author:a,force:l,follow:c,includeChanges:u}){let f=typeof o=="undefined"?void 0:Math.floor(o.valueOf()/1e3),d=a==null?void 0:new RegExp(a,"i"),h=({commit:x})=>d===void 0?!0:x.author?d.test(`${x.author.name} <${x.author.email}>`):!1,p=[],m=x=>{h(x)&&p.push(x)},w=await ho.read({fs:r,gitdir:t}),y=await q.resolve({fs:r,gitdir:t,ref:i}),v=[await Yi({fs:r,cache:e,gitdir:t,oid:y})],A,C,S,T;function b(x){T&&n&&m(x)}for(;v.length>0;){let x=v.pop();if(f!==void 0&&x.commit.committer.timestamp<=f)break;if(n){let E;try{E=await UA({fs:r,cache:e,gitdir:t,oid:x.commit.tree,filepath:n}),S&&(A!==E.oid||C!==E.mode)&&m(S),A=E.oid,C=E.mode,S=x,T=!0}catch(k){if(k instanceof Be){let $=c&&A;if($&&($=await _A({fs:r,cache:e,gitdir:t,oid:x.commit.tree,fileId:A}),$))if(Array.isArray($)){if(S){let M=await _A({fs:r,cache:e,gitdir:t,oid:S.commit.tree,fileId:A});if(Array.isArray(M))if($=$.filter(D=>M.indexOf(D)===-1),$.length===1)$=$[0],n=$,S&&m(S);else{$=!1,S&&m(S);break}}}else n=$,S&&m(S);if(!$){if(T&&A&&(m(S),!l))break;if(!l&&!c)throw k}S=x,T=!1}else throw k}}else m(x);if(s!==void 0&&p.length===s){b(x);break}if(!w.has(x.oid))for(let E of x.commit.parent){let k=await Yi({fs:r,cache:e,gitdir:t,oid:E});v.map($=>$.oid).includes(k.oid)||v.push(k)}v.length===0&&b(x),v.sort((E,k)=>u3(E.commit,k.commit))}if(u)for(let x of p)x.commit.changes=await h3({fs:r,cache:e,gitdir:t,commit:x,shallow:w.has(x.oid)});return p}async function h3({fs:r,cache:e,gitdir:t,commit:n,shallow:i}){let s=i||!n.commit.parent[0]?"4b825dc642cb6eb9a060e54bf8d69288fbee4904":n.commit.parent[0];return vi({fs:r,cache:e,gitdir:t,trees:[mr({ref:n.oid}),mr({ref:s})],map:async(o,[a,l])=>{let[c,u]=await Promise.all([a&&a.type(),l&&l.type()]);if(c==="tree")return u&&u!=="tree"?[null,await l.oid(),o]:void 0;if(u==="tree")return c?[await a.oid(),null,o]:void 0;let[f,d]=await Promise.all([a?a.oid():null,l?l.oid():null]);if(f!==d)return[f,d,o]}})}async function p3({fs:r,dir:e,gitdir:t=B(e,".git"),filepath:n,ref:i="HEAD",depth:s,since:o,author:a,force:l,follow:c,includeChanges:u=!1,cache:f={}}){try{I("fs",r),I("gitdir",t),I("ref",i);let d=new re(r),h=await le({fsp:d,dotgit:t});return await d3({fs:d,cache:f,gitdir:h,filepath:n,ref:i,depth:s,since:o,author:a,force:l,follow:c,includeChanges:u})}catch(d){throw d.caller="git.log",d}}async function m3({fs:r,onSign:e,dir:t,gitdir:n=B(t,".git"),ours:i,theirs:s,fastForward:o=!0,fastForwardOnly:a=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,cache:m={},mergeDriver:w,allowUnrelatedHistories:y=!1}){try{I("fs",r),p&&I("onSign",e);let v=new re(r),A=await le({fsp:v,dotgit:n}),C=await fo({fs:v,gitdir:A,author:d});if(!C&&(!a||!o))throw new gr("author");let S=await la({fs:v,gitdir:A,author:C,committer:h});if(!S&&(!a||!o))throw new gr("committer");return await QA({fs:v,cache:m,dir:t,gitdir:A,ours:i,theirs:s,fastForward:o,fastForwardOnly:a,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:C,committer:S,signingKey:p,onSign:e,mergeDriver:w,allowUnrelatedHistories:y})}catch(v){throw v.caller="git.merge",v}}var g3={commit:16,tree:32,blob:48,tag:64,ofs_d Line truncated
`),i=await n();let s=t.toString("utf8").split(`
`);if(i=s.shift(),!i.startsWith("unpack "))throw new gi('unpack ok" or "unpack [error message]',i);e.ok=i==="unpack ok",e.ok||(e.error=i.slice(7)),e.refs={};for(let o of s){if(o.trim()==="")continue;let a=o.slice(0,2),l=o.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:a==="ok",error:f}}return e}async function x3({capabilities:r=[],triplets:e=[]}){let t=[],n=`\0 ${r.join(" ")}`;for(let i of e)t.push(At.encode(`${i.oldoid} ${i.oid} ${i.fullRef}${n}
`)),n="";return t.push(At.flush()),t}async function E3({fs:r,cache:e,http:t,onProgress:n,onMessage:i,onAuth:s,onAuthSuccess:o,onAuthFailure:a,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:p=!1,delete:m=!1,corsProxy:w,headers:y={},signal:v}){let A=u||await po({fs:r,gitdir:c});if(typeof A=="undefined")throw new Kr("ref");let C=await Tt.get({fs:r,gitdir:c});d=d||await C.get(`branch.${A}.pushRemote`)||await C.get("remote.pushDefault")||await C.get(`branch.${A}.remote`)||"origin";let S=h||await C.get(`remote.${d}.pushurl`)||await C.get(`remote.${d}.url`);if(typeof S=="undefined")throw new Kr("remote OR url");let T=f||await C.get(`branch.${A}.merge`);if(typeof S=="undefined")throw new Kr("remoteRef");w===void 0&&(w=await C.get("http.corsProxy"));let b=await q.expand({fs:r,gitdir:c,ref:A}),x=m?"0000000000000000000000000000000000000000":await q.resolve({fs:r,gitdir:c,ref:b}),E=Ml.getRemoteHelperFor({url:S}),k=await E.discover({http:t,onAuth:fh({config:C,onAuth:s}),onAuthSuccess:o,onAuthFailure:fh({config:C,onAuth:a}),corsProxy:w,service:"git-receive-pack",url:S,headers:y,protocolVersion:1,signal:v}),$=k.auth,M;if(!T)M=b;else try{M=await q.expandAgainstMap({ref:T,map:k.refs})}catch(U){if(U instanceof Be)M=T.startsWith("refs/")?T:`refs/heads/${T}`;else throw U}let D=k.refs.get(M)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:S,localRef:{ref:m?"(delete)":b,oid:x},remoteRef:{ref:M,oid:D}}))throw new Il;let P=!k.capabilities.has("no-thin"),F=new Set;if(!m){let U=[...k.refs.values()],et=new Set;if(D!=="0000000000000000000000000000000000000000"){let se=[];try{se=await kv({fs:r,cache:e,gitdir:c,oids:[x,D]})}catch(vt){se=[]}for(let vt of se)U.push(vt);P&&(et=await tv({fs:r,cache:e,gitdir:c,oids:se}))}if(!U.includes(x)){let se=await y3({fs:r,cache:e,gitdir:c,start:[x],finish:U});F=await tv({fs:r,cache:e,gitdir:c,oids:se})}if(P){try{let se=await q.resolve({fs:r,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:vt}=await q.resolveAgainstMap({ref:se.replace(`refs/remotes/${d}/`,""),fullref:se,map:k.refs}),tt=[vt];for(let j of await tv({fs:r,cache:e,gitdir:c,oids:tt}))et.add(j)}catch(se){}for(let se of et)F.delete(se)}if(x===D&&(p=!0),!p){if(b.startsWith("refs/tags")&&D!=="0000000000000000000000000000000000000000")throw new Pl("tag-exists");if(x!=="0000000000000000000000000000000000000000"&&D!=="0000000000000000000000000000000000000000"&&!await rC({fs:r,cache:e,gitdir:c,oid:x,ancestor:D,depth:-1}))throw new Pl("not-fast-forward")}}let _e=KA([...k.capabilities],["report-status","side-band-64k",`agent=${vh.agent}`]),Q=await x3({capabilities:_e,triplets:[{oldoid:D,oid:x,fullRef:M}]}),oe=m?[]:await sC({fs:r,cache:e,gitdir:c,oids:[...F]}),fe=await E.connect({http:t,onProgress:n,corsProxy:w,service:"git-receive-pack",url:S,auth:$,headers:y,body:[...Q,...oe],signal:v}),{packfile:Z,progress:Y}=await dh.demux(fe.body);if(i){let U=ZA(Y);zu(U,async et=>{await i(et)})}let J=await _3(Z);if(fe.headers&&(J.headers=fe.headers),d&&J.ok&&J.refs[M].ok&&!b.startsWith("refs/tags")){let U=`refs/remotes/${d}/${M.replace("refs/heads/","")}`;m?await q.deleteRef({fs:r,gitdir:c,ref:U}):await q.writeRef({fs:r,gitdir:c,ref:U,value:x})}if(J.ok&&Object.values(J.refs).every(U=>U.ok))return J;{let U=Object.entries(J.refs).filter(([et,se])=>!se.ok).map(([et,se])=>`
- ${et}: ${se.error}`).join("");throw new Iu(U,J)}}async function S3({fs:r,http:e,onProgress:t,onMessage:n,onAuth:i,onAuthSuccess:s,onAuthFailure:o,onPrePush:a,dir:l,gitdir:c=B(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:p=!1,delete:m=!1,corsProxy:w,headers:y={},cache:v={},signal:A}){try{I("fs",r),I("http",e),I("gitdir",c);let C=new re(r),S=await le({fsp:C,dotgit:c});return await E3({fs:C,cache:v,http:e,onProgress:t,onMessage:n,onAuth:i,onAuthSuccess:s,onAuthFailure:o,onPrePush:a,gitdir:S,ref:u,remoteRef:f,remote:d,url:h,force:p,delete:m,corsProxy:w,headers:y,signal:A})}catch(C){throw C.caller="git.push",C}}async function oC({fs:r,cache:e,gitdir:t,oid:n}){let{type:i,object:s}=await pt({fs:r,cache:e,gitdir:t,oid:n});if(i==="tag")return n=Xr.from(s).parse().object,oC({fs:r,cache:e,gitdir:t,oid:n});if(i!=="blob")throw new sr(n,i,"blob");return{oid:n,blob:new Uint8Array(s)}}async function aC({fs:r,cache:e,gitdir:t,oid:n,filepath:i=void 0}){return i!==void 0&&(n=await wh({fs:r,cache:e,gitdir:t,oid:n,filepath:i})),await oC({fs:r,cache:e,gitdir:t,oid:n})}async function Nl({fs:r,dir:e,gitdir:t=B(e,".git"),oid:n,filepath:i,cache:s={}}){try{I("fs",r),I("gitdir",t),I("oid",n);let o=new re(r),a=await le({fsp:o,dotgit:t});return await aC({fs:o,cache:s,gitdir:a,oid:n,filepath:i})}catch(o){throw o.caller="git.readBlob",o}}async function lC({fs:r,dir:e,gitdir:t=B(e,".git"),oid:n,cache:i={}}){try{I("fs",r),I("gitdir",t),I("oid",n);let s=new re(r),o=await le({fsp:s,dotgit:t});return await Yi({fs:s,cache:i,gitdir:o,oid:n})}catch(s){throw s.caller="git.readCommit",s}}async function k3({fs:r,cache:e,gitdir:t,ref:n="refs/notes/commits",oid:i}){let s=await q.resolve({gitdir:t,fs:r,ref:n}),{blob:o}=await aC({fs:r,cache:e,gitdir:t,oid:s,filepath:i});return o}async function A3({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n="refs/notes/commits",oid:i,cache:s={}}){try{I("fs",r),I("gitdir",t),I("ref",n),I("oid",i);let o=new re(r),a=await le({fsp:o,dotgit:t});return await k3({fs:o,cache:s,gitdir:a,ref:n,oid:i})}catch(o){throw o.caller="git.readNote",o}}async function C3({fs:r,dir:e,gitdir:t=B(e,".git"),oid:n,format:i="parsed",filepath:s=void 0,encoding:o=void 0,cache:a={}}){try{I("fs",r),I("gitdir",t),I("oid",n);let l=new re(r),c=await le({fsp:l,dotgit:t});s!==void 0&&(n=await wh({fs:l,cache:a,gitdir:c,oid:n,filepath:s}));let f=await pt({fs:l,cache:a,gitdir:c,oid:n,format:i==="parsed"?"content":i});if(f.oid=n,i==="parsed")switch(f.format="parsed",f.type){case"commit":f.object=Qr.from(f.object).parse();break;case"tree":f.object=Zr.from(f.object).entries();break;case"blob":o?f.object=f.object.toString(o):(f.object=new Uint8Array(f.object),f.format="content");break;case"tag":f.object=Xr.from(f.object).parse();break;default:throw new sr(f.oid,f.type,"blob|commit|tag|tree")}else(f.format==="deflated"||f.format==="wrapped")&&(f.type=f.format);return f}catch(l){throw l.caller="git.readObject",l}}async function T3({fs:r,cache:e,gitdir:t,oid:n}){let{type:i,object:s}=await pt({fs:r,cache:e,gitdir:t,oid:n,format:"content"});if(i!=="tag")throw new sr(n,i,"tag");let o=Xr.from(s);return{oid:n,tag:o.parse(),payload:o.payload()}}async function R3({fs:r,dir:e,gitdir:t=B(e,".git"),oid:n,cache:i={}}){try{I("fs",r),I("gitdir",t),I("oid",n);let s=new re(r),o=await le({fsp:s,dotgit:t});return await T3({fs:s,cache:i,gitdir:o,oid:n})}catch(s){throw s.caller="git.readTag",s}}async function $3({fs:r,dir:e,gitdir:t=B(e,".git"),oid:n,filepath:i=void 0,cache:s={}}){try{I("fs",r),I("gitdir",t),I("oid",n);let o=new re(r),a=await le({fsp:o,dotgit:t});return await Ll({fs:o,cache:s,gitdir:a,oid:n,filepath:i})}catch(o){throw o.caller="git.readTree",o}}async function P3({fs:r,dir:e,gitdir:t=B(e,".git"),filepath:n,cache:i={}}){try{I("fs",r),I("gitdir",t),I("filepath",n);let s=new re(r),o=await le({fsp:s,dotgit:t});await Ct.acquire({fs:s,gitdir:o,cache:i},async function(a){let l=Array.isArray(n)?n:[n];for(let c of l)a.delete({filepath:c})})}catch(s){throw s.caller="git.remove",s}}async function I3({fs:r,cache:e,onSign:t,gitdir:n,ref:i="refs/notes/commits",oid:s,author:o,committer:a,signingKey:l}){let c;try{c=await q.resolve({gitdir:n,fs:r,ref:i})}catch(p){if(!(p instanceof Be))throw p}let f=(await Ll({fs:r,cache:e,gitdir:n,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==s);let d=await ju({fs:r,gitdir:n,tree:f});return await Uu({fs:r,cache:e,onSign:t,gitdir:n,ref:i,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
`,author:o,committer:a,signingKey:l})}async function O3({fs:r,onSign:e,dir:t,gitdir:n=B(t,".git"),ref:i="refs/notes/commits",oid:s,author:o,committer:a,signingKey:l,cache:c={}}){try{I("fs",r),I("gitdir",n),I("oid",s);let u=new re(r),f=await le({fsp:u,dotgit:n}),d=await fo({fs:u,gitdir:f,author:o});if(!d)throw new gr("author");let h=await la({fs:u,gitdir:f,author:d,committer:a});if(!h)throw new gr("committer");return await I3({fs:u,cache:c,onSign:e,gitdir:f,ref:i,oid:s,author:d,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function F3({fs:r,gitdir:e,oldref:t,ref:n,checkout:i=!1}){if(!Al(n,!0))throw new _n(n,na.default.clean(n));if(!Al(t,!0))throw new _n(t,na.default.clean(t));let s=`refs/heads/${t}`,o=`refs/heads/${n}`;if(await q.exists({fs:r,gitdir:e,ref:o}))throw new wi("branch",n,!1);let l=await q.resolve({fs:r,gitdir:e,ref:s,depth:1});await q.writeRef({fs:r,gitdir:e,ref:o,value:l}),await q.deleteRef({fs:r,gitdir:e,ref:s});let u=await po({fs:r,gitdir:e,fullname:!0})===s;(i||u)&&await q.writeSymbolicRef({fs:r,gitdir:e,ref:"HEAD",value:o})}async function M3({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n,oldref:i,checkout:s=!1}){try{I("fs",r),I("gitdir",t),I("ref",n),I("oldref",i);let o=new re(r),a=await le({fsp:o,dotgit:t});return await F3({fs:o,gitdir:a,ref:n,oldref:i,checkout:s})}catch(o){throw o.caller="git.renameBranch",o}}async function cC({gitdir:r,type:e,object:t}){return mi(Ss.wrap({type:e,object:t}))}async function D3({fs:r,dir:e,gitdir:t=B(e,".git"),filepath:n,ref:i,cache:s={}}){try{I("fs",r),I("gitdir",t),I("filepath",n);let o=new re(r),a=await le({fsp:o,dotgit:t}),l,c;try{l=await q.resolve({fs:o,gitdir:a,ref:i||"HEAD"})}catch(d){if(i||!(d instanceof Be))throw d}if(l)try{l=await wh({fs:o,cache:s,gitdir:a,oid:l,filepath:n})}catch(d){if(!(d instanceof Be)&&!(d instanceof ks)&&!(d instanceof sr&&d.data.filepath))throw d;l=null}let u={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},f=e&&await o.read(B(e,n));f&&(c=await cC({gitdir:a,type:"blob",object:f}),l===c&&(u=await o.lstat(B(e,n)))),await Ct.acquire({fs:o,gitdir:a,cache:s},async function(d){d.delete({filepath:n}),l&&d.insert({filepath:n,stats:u,oid:l})})}catch(o){throw o.caller="git.reset",o}}async function L3({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n,depth:i}){try{I("fs",r),I("gitdir",t),I("ref",n);let s=new re(r),o=await le({fsp:s,dotgit:t});return await q.resolve({fs:s,gitdir:o,ref:n,depth:i})}catch(s){throw s.caller="git.resolveRef",s}}async function N3({fs:r,dir:e,gitdir:t=B(e,".git"),path:n,value:i,append:s=!1}){try{I("fs",r),I("gitdir",t),I("path",n);let o=new re(r),a=await le({fsp:o,dotgit:t}),l=await Tt.get({fs:o,gitdir:a});s?await l.append(n,i):await l.set(n,i),await Tt.save({fs:o,gitdir:a,config:l})}catch(o){throw o.caller="git.setConfig",o}}async function uC({fs:r,gitdir:e,commit:t}){let n=Qr.from(t).toObject();return await Jr({fs:r,gitdir:e,type:"commit",object:n,format:"content"})}var hh=class r{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),n=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${t.toString().padStart(2,"0")}${n}`}static createStashReflogEntry(e,t,n){let i=e.name.replace(/\s/g,""),s="0000000000000000000000000000000000000000",o=Math.floor(Date.now()/1e3),a=r.timezoneOffsetForRefLogEntry;return`${s} ${t} ${i} ${e.email} ${o} ${a} ${n}
`}static getStashReflogEntry(e,t=!1){return e.split(`
`).filter(s=>s).reverse().map((s,o)=>t?`stash@{${o}}: ${s.split(" ")[1]}`:s)}},ca=class r{constructor({fs:e,dir:t,gitdir:n=B(t,".git")}){Object.assign(this,{fs:e,dir:t,gitdir:n,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return B(this.gitdir,r.refStash)}get refLogsStashPath(){return B(this.gitdir,r.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await fo({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new gr("author");return this._author}async getStashSHA(e,t){return await this.fs.exists(this.refStashPath)?(t||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:t,parent:n}){return uC({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:t,parent:n,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let t=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>t.length-1))throw new _n(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let n=await this.getStashSHA(e,t);return n?Yi({fs:this.fs,cache:{},gitdir:this.gitdir,oid:n}):{}}async writeStashRef(e){return q.writeRef({fs:this.fs,gitdir:this.gitdir,ref:r.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:t}){let n=await this.getAuthor(),i=hh.createStashReflogEntry(n,e,t),s=this.refLogsStashPath;await ir(s,async()=>{let o=await this.fs.exists(s)?await this.fs.read(s,"utf8"):"";await this.fs.write(s,o+i,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let t=await this.fs.read(this.refLogsStashPath,"utf8");return hh.getStashReflogEntry(t,e)}};async function fC({fs:r,dir:e,gitdir:t,message:n=""}){let i=new ca({fs:r,dir:e,gitdir:t});await i.getAuthor();let s=await po({fs:r,gitdir:t,fullname:!1}),o=await q.resolve({fs:r,gitdir:t,ref:"HEAD"}),l=(await lC({fs:r,dir:e,gitdir:t,oid:o})).commit.message,c=[o],u=null,f=mr({ref:"HEAD"}),d=await fA({fs:r,dir:e,gitdir:t,treePair:[mr({ref:"HEAD"}),"stage"]});if(d){let w=await i.writeStashCommit({message:`stash-Index: WIP on ${s} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(w),u=d,f=lo()}let h=await fA({fs:r,dir:e,gitdir:t,treePair:[f,"workdir"]});if(h){let w=await i.writeStashCommit({message:`stash-WorkDir: WIP on ${s} - ${new Date().toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(w),u=h}if(!u||!d&&!h)throw new Be("changes, nothing to stash");let p=(n.trim()||`WIP on ${s}`)+`: ${o.substring(0,7)} ${l}`;return{stashCommit:await i.writeStashCommit({message:p,tree:u,parent:c}),stashMsg:p,branch:s,stashMgr:i}}async function B3({fs:r,dir:e,gitdir:t,message:n=""}){let{stashCommit:i,stashMsg:s,branch:o,stashMgr:a}=await fC({fs:r,dir:e,gitdir:t,message:n});return await a.writeStashRef(i),await a.writeStashReflogEntry({stashCommit:i,message:s}),await VA({fs:r,dir:e,gitdir:t,ref:o,track:!1,force:!0}),i}async function H3({fs:r,dir:e,gitdir:t,message:n=""}){let{stashCommit:i}=await fC({fs:r,dir:e,gitdir:t,message:n});return i}async function dC({fs:r,dir:e,gitdir:t,refIdx:n=0}){let s=await new ca({fs:r,dir:e,gitdir:t}).readStashCommit(n),{parent:o=null}=s.commit?s.commit:{};if(!(!o||!Array.isArray(o)))for(let a=0;a<o.length-1;a++){let c=(await Yi({fs:r,cache:{},gitdir:t,oid:o[a+1]})).commit.message.startsWith("stash-Index");await qA({fs:r,dir:e,gitdir:t,stashCommit:o[a+1],parentCommit:o[a],wasStaged:c})}}async function hC({fs:r,dir:e,gitdir:t,refIdx:n=0}){let i=new ca({fs:r,dir:e,gitdir:t});if(!(await i.readStashCommit(n)).commit)return;let o=i.refStashPath;await ir(o,async()=>{await r.exists(o)&&await r.rm(o)});let a=await i.readStashReflogs({parsed:!1});if(!a.length)return;a.splice(n,1);let l=i.refLogsStashPath;await ir(l,async()=>{if(a.length){await r.write(l,a.reverse().join(`
`)+`
`,"utf8");let c=a[a.length-1].split(" ")[1];await i.writeStashRef(c)}else await r.rm(l)})}async function G3({fs:r,dir:e,gitdir:t}){return new ca({fs:r,dir:e,gitdir:t}).readStashReflogs({parsed:!0})}async function U3({fs:r,dir:e,gitdir:t}){let n=new ca({fs:r,dir:e,gitdir:t}),i=[n.refStashPath,n.refLogsStashPath];await ir(i,async()=>{await Promise.all(i.map(async s=>{if(await r.exists(s))return r.rm(s)}))})}async function j3({fs:r,dir:e,gitdir:t,refIdx:n=0}){await dC({fs:r,dir:e,gitdir:t,refIdx:n}),await hC({fs:r,dir:e,gitdir:t,refIdx:n})}async function z3({fs:r,dir:e,gitdir:t=B(e,".git"),op:n="push",message:i="",refIdx:s=0}){I("fs",r),I("dir",e),I("gitdir",t),I("op",n);let o={push:B3,apply:dC,drop:hC,list:G3,clear:U3,pop:j3,create:H3},a=["apply","drop","pop"];try{let l=new re(r),c=await le({fsp:l,dotgit:t});["refs","logs","logs/refs"].map(d=>B(c,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});let f=o[n];if(f){if(a.includes(n)&&s<0)throw new _n(`stash@${s}`,"number that is in range of [0, num of stash pushed]");return await f({fs:l,dir:e,gitdir:c,message:i,refIdx:s})}throw new Error(`To be implemented: ${n}`)}catch(l){throw l.caller="git.stash",l}}async function V3({fs:r,dir:e,gitdir:t=B(e,".git"),filepath:n,cache:i={},refresh:s=!0}){try{I("fs",r),I("gitdir",t),I("filepath",n);let o=new re(r),a=await le({fsp:o,dotgit:t}),l=await q3({fs:o,cache:i,gitdir:a}),c=await pC({fs:o,cache:i,gitdir:a,tree:l,path:n}),u=await Ct.acquire({fs:o,gitdir:a,cache:i},async function(w){for(let y of w)if(y.path===n)return y;return null});if(c===null&&u===null&&await uo.isIgnored({fs:o,gitdir:a,dir:e,filepath:n}))return"ignored";let f=await o.lstat(B(e,n)),d=c!==null,h=u!==null,p=f!==null&&(d||h||await W3({fs:o,dir:e,filepath:n})),m=async()=>{if(h&&!nh(u,f))return u.oid;{let y=await(await Tt.get({fs:o,gitdir:a})).get("core.autocrlf"),v=await o.read(B(e,n),{autocrlf:y}),A=await cC({gitdir:a,type:"blob",object:v});return s&&h&&!u.flags.intentToAdd&&u.oid===A&&f.size!==-1&&await Ct.acquire({fs:o,gitdir:a,cache:i},async function(C){C.insert({filepath:n,stats:f,oid:A})}),A}};if(!d&&!p&&!h)return"absent";if(!d&&!p&&h)return"*absent";if(!d&&p&&!h)return"*added";if(!d&&p&&h)return await m()===u.oid?"added":"*added";if(d&&!p&&!h)return"deleted";if(d&&!p&&h)return c===u.oid,"*deleted";if(d&&p&&!h)return await m()===c?"*undeleted":"*undeletemodified";if(d&&p&&h){let w=await m();return w===c?w===u.oid?"unmodified":"*unmodified":w===u.oid?"modified":"*modified"}}catch(o){throw o.caller="git.status",o}}async function W3({fs:r,dir:e,filepath:t}){let n=t.replace(/\\/g,"/").split("/").filter(s=>s!==""&&s!=="."),i=e;for(let s of n){let o;try{o=await r._readdir(i)}catch(a){if(a.code==="ENOENT"||a.code==="ENOTDIR")return!1;throw a}if(!o.some(a=>a.normalize()===s.normalize()))return!1;i=B(i,s)}return!0}async function pC({fs:r,cache:e,gitdir:t,tree:n,path:i}){typeof i=="string"&&(i=i.split("/"));let s=i.shift();for(let o of n)if(o.path===s){if(i.length===0)return o.oid;let{type:a,object:l}=await pt({fs:r,cache:e,gitdir:t,oid:o.oid});if(a==="tree"){let c=Zr.from(l);return pC({fs:r,cache:e,gitdir:t,tree:c,path:i})}if(a==="blob")throw new sr(o.oid,a,"blob",i.join("/"))}return null}async function q3({fs:r,cache:e,gitdir:t}){let n;try{n=await q.resolve({fs:r,gitdir:t,ref:"HEAD"})}catch(s){if(s instanceof Be)return[];throw s}let{tree:i}=await Ll({fs:r,cache:e,gitdir:t,oid:n});return i}async function Y3({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n="HEAD",filepaths:i=["."],filter:s,cache:o={},ignored:a=!1,refresh:l=!0}){try{I("fs",r),I("gitdir",t),I("ref",n);let c=new re(r),u=await le({fsp:c,dotgit:t});return await vi({fs:c,cache:o,dir:e,gitdir:u,trees:[mr({ref:n}),Dl({refresh:l}),lo()],map:async function(f,[d,h,p]){if(!d&&!p&&h&&!a&&await uo.isIgnored({fs:c,dir:e,filepath:f})||!i.some(x=>xv(f,x)))return null;if(s&&!s(f))return;let[m,w,y]=await Promise.all([d&&d.type(),h&&h.type(),p&&p.type()]),v=[m,w,y].includes("blob");if((m==="tree"||m==="special")&&!v)return;if(m==="commit")return null;if((w==="tree"||w==="special")&&!v)return;if(y==="commit")return null;if((y==="tree"||y==="special")&&!v)return;let A=m==="blob"?await d.oid():void 0,C=y==="blob"?await p.oid():void 0,S;m!=="blob"&&w==="blob"&&y!=="blob"?S="42":w==="blob"&&(S=await h.oid());let T=[void 0,A,S,C],b=T.map(x=>T.indexOf(x));return b.shift(),[f,...b]}})}catch(c){throw c.caller="git.statusMatrix",c}}async function K3({fs:r,dir:e,gitdir:t=B(e,".git"),ref:n,object:i,force:s=!1}){try{I("fs",r),I("gitdir",t),I("ref",n);let o=new re(r);if(n===void 0)throw new Kr("ref");n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`;let a=await le({fsp:o,dotgit:t}),l=await q.resolve({fs:o,gitdir:a,ref:i||"HEAD"});if(!s&&await q.exists({fs:o,gitdir:a,ref:n}))throw new wi("tag",n);await q.writeRef({fs:o,gitdir:a,ref:n,value:l})}catch(o){throw o.caller="git.tag",o}}async function Z3({fs:r,dir:e,gitdir:t=B(e,".git"),cache:n={},filepath:i,oid:s,mode:o,add:a,remove:l,force:c}){try{I("fs",r),I("gitdir",t),I("filepath",i) Line truncated
if ! command -v curl >/dev/null 2>&1; then
echo "Obsidian Git authentication requires curl" >&2
exit 1
fi
printf '%s\\n%s' "$OBSIDIAN_GIT_ASKPASS_TOKEN" "$1" | curl -q \\
--silent --show-error --fail --noproxy '*' --proto '=http' \\
--max-time 600 --data-binary @- \\
--header 'Content-Type: application/octet-stream' \\
"http://127.0.0.1:$OBSIDIAN_GIT_ASKPASS_PORT/askpass"
`,wC=["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"];g();g();g();var Vu=class{diff(e,t,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(s,n)),l=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,l,n,i)}diffWithOptionsObj(e,t,n,i){var s;let o=v=>{if(v=this.postProcess(v,n),i){setTimeout(function(){i(v)},0);return}else return v},a=t.length,l=e.length,c=1,u=a+l;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));let f=(s=n.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],t,e,0,n);if(h[0].oldPos+1>=l&&p+1>=a)return o(this.buildValues(h[0].lastComponent,t,e));let m=-1/0,w=1/0,y=()=>{for(let v=Math.max(m,-c);v<=Math.min(w,c);v+=2){let A,C=h[v-1],S=h[v+1];C&&(h[v-1]=void 0);let T=!1;if(S){let x=S.oldPos-v;T=S&&0<=x&&x<a}let b=C&&C.oldPos+1<l;if(!T&&!b){h[v]=void 0;continue}if(!b||T&&C.oldPos<S.oldPos?A=this.addToPath(S,!0,!1,0,n):A=this.addToPath(C,!1,!0,1,n),p=this.extractCommon(A,t,e,v,n),A.oldPos+1>=l&&p+1>=a)return o(this.buildValues(A.lastComponent,t,e))||!0;h[v]=A,A.oldPos+1>=l&&(w=Math.min(w,v-1)),p+1>=a&&(m=Math.max(m,v+1))}c++};if(i)(function v(){setTimeout(function(){if(c>u||Date.now()>d)return i(void 0);y()||v()},0)})();else for(;c<=u&&Date.now()<=d;){let v=y();if(v)return v}}addToPath(e,t,n,i,s){let o=e.lastComponent;return o&&!s.oneChangePerToken&&o.added===t&&o.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,i,s){let o=t.length,a=n.length,l=e.oldPos,c=l-i,u=0;for(;c+1<o&&l+1<a&&this.equals(n[l+1],t[c+1],s);)c++,l++,u++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join("")}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let i=[],s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();let o=i.length,a=0,l=0,c=0;for(;a<o;a++){let u=i[a];if(u.removed)u.value=this.join(n.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let f=t.slice(l,l+u.count);f=f.map(function(d,h){let p=n[c+h];return p.length>d.length?p:d}),u.value=this.join(f)}else u.value=this.join(t.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return i}};g();var Rv=class extends Vu{constructor(){super(...arguments),this.tokenize=l8}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
`)&&(e=e.slice(0,-1)),t.endsWith(`
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}},a8=new Rv;function $v(r,e,t){return a8.diff(r,e,t)}function l8(r,e){e.stripTrailingCr&&(r=r.replace(/\r\n/g,`
`));let t=[],n=r.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let i=0;i<n.length;i++){let s=n[i];i%2&&!e.newlineIsToken?t[t.length-1]+=s:t.push(s)}return t}g();function c8(r){for(let e=0;e<r.length;e++)if(r[e]<" "||r[e]>"~"||r[e]==='"'||r[e]==="\\")return!0;return!1}function vo(r){if(!c8(r))return r;let e='"',t=new TextEncoder().encode(r),n=0;for(;n<t.length;){let i=t[n];i===7?e+="\\a":i===8?e+="\\b":i===9?e+="\\t":i===10?e+="\\n":i===11?e+="\\v":i===12?e+="\\f":i===13?e+="\\r":i===34?e+='\\"':i===92?e+="\\\\":i>=32&&i<=126?e+=String.fromCharCode(i):e+="\\"+i.toString(8).padStart(3,"0"),n++}return e+='"',e}var Pv={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Iv(r,e,t,n,i,s,o){let a;o?typeof o=="function"?a={callback:o}:a=o:a={},typeof a.context=="undefined"&&(a.context=4);let l=a.context;if(a.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(a.callback){let{callback:u}=a;$v(t,n,Object.assign(Object.assign({},a),{callback:f=>{let d=c(f);u(d)}}))}else return c($v(t,n,a));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(v){return v.map(function(A){return" "+A})}let d=[],h=0,p=0,m=[],w=1,y=1;for(let v=0;v<u.length;v++){let A=u[v],C=A.lines||u8(A.value);if(A.lines=C,A.added||A.removed){if(!h){let S=u[v-1];h=w,p=y,S&&(m=l>0?f(S.lines.slice(-l)):[],h-=m.length,p-=m.length)}for(let S of C)m.push((A.added?"+":"-")+S);A.added?y+=C.length:w+=C.length}else{if(h)if(C.length<=l*2&&v<u.length-2)for(let S of f(C))m.push(S);else{let S=Math.min(C.length,l);for(let b of f(C.slice(0,S)))m.push(b);let T={oldStart:h,oldLines:w-h+S,newStart:p,newLines:y-p+S,lines:m};d.push(T),h=0,p=0,m=[]}w+=C.length,y+=C.length}}for(let v of d)for(let A=0;A<v.lines.length;A++)v.lines[A].endsWith(`
`)?v.lines[A]=v.lines[A].slice(0,-1):(v.lines.splice(A+1,0,"\\ No newline at end of file"),A++);return{oldFileName:r,newFileName:e,oldHeader:i,newHeader:s,hunks:d}}}function Eh(r,e){var t,n,i,s,o,a;if(e||(e=Pv),Array.isArray(r)){if(r.length>1&&!e.includeFileHeaders&&!r.every(u=>u.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return r.map(u=>Eh(u,e)).join(`
`)}let l=[];if(r.isGit){if(e=Pv,!r.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!r.newFileName)throw new Error("newFileName must be specified for Git patches");let u=r.oldFileName,f=r.newFileName;r.isCreate&&u==="/dev/null"?u=f.replace(/^b\//,"a/"):r.isDelete&&f==="/dev/null"&&(f=u.replace(/^a\//,"b/")),l.push("diff --git "+vo(u)+" "+vo(f)),r.isDelete&&l.push("deleted file mode "+((t=r.oldMode)!==null&&t!==void 0?t:"100644")),r.isCreate&&l.push("new file mode "+((n=r.newMode)!==null&&n!==void 0?n:"100644")),r.oldMode&&r.newMode&&!r.isDelete&&!r.isCreate&&(l.push("old mode "+r.oldMode),l.push("new mode "+r.newMode)),r.isRename&&(l.push("rename from "+vo(((i=r.oldFileName)!==null&&i!==void 0?i:"").replace(/^a\//,""))),l.push("rename to "+vo(((s=r.newFileName)!==null&&s!==void 0?s:"").replace(/^b\//,"")))),r.isCopy&&(l.push("copy from "+vo(((o=r.oldFileName)!==null&&o!==void 0?o:"").replace(/^a\//,""))),l.push("copy to "+vo(((a=r.newFileName)!==null&&a!==void 0?a:"").replace(/^b\//,""))))}else e.includeIndex&&r.oldFileName==r.newFileName&&r.oldFileName!==void 0&&l.push("Index: "+r.oldFileName),e.includeUnderline&&l.push("===================================================================");let c=r.hunks.length>0;e.includeFileHeaders&&r.oldFileName!==void 0&&r.newFileName!==void 0&&(!r.isGit||c)&&(l.push("--- "+vo(r.oldFileName)+(r.oldHeader?" "+r.oldHeader:"")),l.push("+++ "+vo(r.newFileName)+(r.newHeader?" "+r.newHeader:"")));for(let u=0;u<r.hunks.length;u++){let f=r.hunks[u],d=f.oldLines===0?f.oldStart-1:f.oldStart,h=f.newLines===0?f.newStart-1:f.newStart;l.push("@@ -"+d+","+f.oldLines+" +"+h+","+f.newLines+" @@");for(let p of f.lines)l.push(p)}return l.join(`
`)+`
`}function vC(r,e,t,n,i,s,o){if(typeof o=="function"&&(o={callback:o}),o!=null&&o.callback){let{callback:a}=o;Iv(r,e,t,n,i,s,Object.assign(Object.assign({},o),{callback:l=>{a(l?Eh(l,o.headerOptions):void 0)}}))}else{let a=Iv(r,e,t,n,i,s,o);return a?Eh(a,o==null?void 0:o.headerOptions):void 0}}function Wu(r,e,t,n,i,s){return vC(r,r,e,t,n,i,s)}function u8(r){let e=r.endsWith(`
`),t=r.split(`
`).map(n=>n+`
`);return e?t.pop():t.push(t.pop().slice(0,-1)),t}g();var f8=nt(Vw(),1),EC=nt(Qg(),1),SC=nt(Jg(),1),d8=nt(ew(),1),h8=nt(rw(),1),p8=nt(Lw(),1);var De=class r extends Error{constructor(e){super(e),this.caller=""}toJSON(){let e=this;return{code:e.code,data:e.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let t=new r(e.message),n=t;return n.code=e.code,n.data=e.data,t.caller=e.caller,t.stack=e.stack,t}get isIsomorphicGitError(){return!0}},Sh=class r extends De{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=r.code,this.data={filepaths:e}}};Sh.code="UnmergedPathsError";var Zn=class r extends De{constructor(e){super(`An internal error caused this command to fail.
If you're using an application that depends on isomorphic-git, please report this error to that application's developers.
If you're a developer and you believe this is a bug in isomorphic-git, please file an issue at https://github.com/isomorphic-git/isomorphic-git/issues with a minimal reproduction, version and environment details, and this error message: ${e}`),this.code=this.name=r.code,this.data={message:e}}};Zn.code="InternalError";var kh=class r extends De{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=r.code,this.data={filepath:e}}};kh.code="UnsafeFilepathError";var qu=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let t=this.buffer.slice(this._start,this._start+e);return this._start+=e,t}toString(e,t){let n=this.buffer.toString(e,this._start,this._start+t);return this._start+=t,n}write(e,t,n){let i=this.buffer.write(e,this._start,t,n);return this._start+=t,i}copy(e,t,n){let i=e.copy(this.buffer,this._start,t,n);return this._start+=i,i}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let t=this.buffer.writeUInt8(e,this._start);return this._start+=1,t}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let t=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,t}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let t=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,t}},bC=/[\ud800-￿]/;function yC(r,e,t){if(t<55296||t>57343)return!1;if(t<56320){let i=e+1<r.length?r.charCodeAt(e+1):0;return i<56320||i>57343}let n=e>0?r.charCodeAt(e-1):0;return n<55296||n>56319}function m8(r,e){if(!bC.test(r)&&!bC.test(e))return-(r<e)||+(r>e);let t=Math.min(r.length,e.length);for(let n=0;n<t;n++){let i=r.charCodeAt(n),s=e.charCodeAt(n);if(i!==s){if(yC(r,n,i)&&(i=65533),yC(e,n,s)&&(s=65533),i===s)continue;return i>=55296&&s>=55296&&(i+=i>=57344?-2048:8192,s+=s>=57344?-2048:8192),i<s?-1:1}}return r.length<e.length?-1:r.length>e.length?1:0}function g8(r,e){return m8(r.path,e.path)}function w8(r){let e=r>0?r>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let t=r&511;return t&73?t=493:t=420,e!==8&&(t=0),(e<<12)+t}var Ki=2**32;function _C(r,e,t,n){if(r!==void 0&&e!==void 0)return[r,e];t===void 0&&(t=n.valueOf());let i=Math.floor(t/1e3),s=Math.floor((t-i*1e3)*1e6);return[i,s]}function Bl(r){let[e,t]=_C(r.ctimeSeconds,r.ctimeNanoseconds,r.ctimeMs,r.ctime),[n,i]=_C(r.mtimeSeconds,r.mtimeNanoseconds,r.mtimeMs,r.mtime);return{ctimeSeconds:e%Ki,ctimeNanoseconds:t%Ki,mtimeSeconds:n%Ki,mtimeNanoseconds:i%Ki,dev:r.dev%Ki,ino:r.ino%Ki,mode:w8(r.mode%Ki),uid:r.uid%Ki,gid:r.gid%Ki,size:r.size>-1?r.size%Ki:0}}function v8(r){let e="";for(let t of new Uint8Array(r))t<16&&(e+="0"),e+=t.toString(16);return e}var Ov=null;async function xC(r){return Ov===null&&(Ov=await y8()),Ov?kC(r):b8(r)}function b8(r){return new EC.default().update(r).digest("hex")}async function kC(r){let e=await crypto.subtle.digest("SHA-1",r);return v8(e)}async function y8(){try{return await kC(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(r){}return!1}function _8(r){return{assumeValid:!!(r&32768),extended:!!(r&16384),stage:(r&12288)>>12,nameLength:r&4095,skipWorktree:!1,intentToAdd:!1}}var Dv=16384,Lv=8192;function Nv(r){return!!(r.flags.skipWorktree||r.flags.intentToAdd)}function x8(r){let e=r.flags;return e.extended=Nv(r),e.nameLength=Math.min(_.from(r.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}function E8(r){return(r.flags.skipWorktree?Dv:0)+(r.flags.intentToAdd?Lv:0)}var Bv=class r{constructor(e,t){this._dirty=!1,this._unmergedPaths=t||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let t=this._entries.get(e.path);t||(this._entries.set(e.path,e),t=e),t.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(_.isBuffer(e))return r.fromBuffer(e);if(e===null)return new r(null);throw new Zn("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new Zn("Index file is empty (.git/index)");let t=new r,n=new qu(e),i=n.toString("utf8",4);if(i!=="DIRC")throw new Zn(`Invalid dircache magic file number: ${i}`);let s=await xC(e.slice(0,-20)),o=e.slice(-20).toString("hex");if(o!==s)throw new Zn(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${s}`);let a=n.readUInt32BE();if(a!==2&&a!==3)throw new Zn(`Unsupported dircache version: ${a}`);let l=n.readUInt32BE(),c=0;for(;!n.eof()&&c<l;){let u={};u.ctimeSeconds=n.readUInt32BE(),u.ctimeNanoseconds=n.readUInt32BE(),u.mtimeSeconds=n.readUInt32BE(),u.mtimeNanoseconds=n.readUInt32BE(),u.dev=n.readUInt32BE(),u.ino=n.readUInt32BE(),u.mode=n.readUInt32BE(),u.uid=n.readUInt32BE(),u.gid=n.readUInt32BE(),u.size=n.readUInt32BE(),u.oid=n.slice(20).toString("hex");let f=n.readUInt16BE();if(u.flags=_8(f),u Line truncated
`)}static async _entryToBuffer(e){let t=_.from(e.path),n=Nv(e),i=Math.ceil((62+(n?2:0)+t.length+1)/8)*8,s=_.alloc(i),o=new qu(s),a=Bl(e);return o.writeUInt32BE(a.ctimeSeconds),o.writeUInt32BE(a.ctimeNanoseconds),o.writeUInt32BE(a.mtimeSeconds),o.writeUInt32BE(a.mtimeNanoseconds),o.writeUInt32BE(a.dev),o.writeUInt32BE(a.ino),o.writeUInt32BE(a.mode),o.writeUInt32BE(a.uid),o.writeUInt32BE(a.gid),o.writeUInt32BE(a.size),o.write(e.oid,20,"hex"),o.writeUInt16BE(x8(e)),n&&o.writeUInt16BE(E8(e)),o.write(e.path,t.length,"utf8"),s}async toObject(){let e=_.alloc(12),t=new qu(e);t.write("DIRC",4,"utf8"),t.writeUInt32BE(this.entriesFlat.some(Nv)?3:2),t.writeUInt32BE(this.entriesFlat.length);let n=[];for(let a of this.entries)if(n.push(r._entryToBuffer(a)),a.stages.length>1)for(let l of a.stages)l&&l!==a&&n.push(r._entryToBuffer(l));n=await Promise.all(n);let i=_.concat(n),s=_.concat([e,i]),o=await xC(s);return _.concat([s,_.from(o,"hex")])}};function S8(r,e,t=!0,n=!0){let i=Bl(r),s=Bl(e);return t&&i.mode!==s.mode||i.mtimeSeconds!==s.mtimeSeconds||i.mtimeNanoseconds!==s.mtimeNanoseconds||i.ctimeSeconds!==s.ctimeSeconds||i.ctimeNanoseconds!==s.ctimeNanoseconds||i.uid!==s.uid||i.gid!==s.gid||n&&i.ino!==s.ino||i.size!==s.size}var Fv;function k8(){return Fv===void 0&&(Fv=new SC.default({maxPending:1/0})),Fv}function A8(r,e){return k8().acquire(r,e)}var Mv=Symbol("IndexCache");function C8(){return{map:new Map,stats:new Map}}async function T8(r,e,t){let[n,i]=await Promise.all([r.lstat(e),r.read(e)]),s=await Bv.from(i);t.map.set(e,s),t.stats.set(e,n)}async function R8(r,e,t){let n=t.stats.get(e);if(n===void 0)return!0;if(n===null)return!1;let i=await r.lstat(e);if(i===null)return!1;if(S8(n,i))return!0;let s=Bl(n),o=Bl(i);return s.mtimeNanoseconds!==o.mtimeNanoseconds||s.ctimeNanoseconds!==o.ctimeNanoseconds}var Ah=class{static async acquire({fs:e,gitdir:t,cache:n,allowUnmerged:i=!0},s){n[Mv]||(n[Mv]=C8());let o=`${t}/index`,a,l=[];return await A8(o,async()=>{let c=n[Mv];await R8(e,o,c)&&await T8(e,o,c);let u=c.map.get(o);if(l=u.unmergedPaths,l.length&&!i)throw new Sh(l);if(a=await s(u),u._dirty){let f=await u.toObject();await e.write(o,f),c.stats.set(o,await e.lstat(o)),u._dirty=!1}}),a}},Hv=class r extends De{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=r.code,this.data={value:e}}};Hv.code="InvalidOidError";var Gv=class r extends De{constructor(e,t){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${t}".)`),this.code=this.name=r.code,this.data={ref:e,suggestion:t}}};Gv.code="InvalidRefNameError";var Uv=class r extends De{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=r.code,this.data={remote:e}}};Uv.code="NoRefspecError";var jv=class r extends De{constructor(e){super(`Could not find ${e}.`),this.code=this.name=r.code,this.data={what:e}}};jv.code="NotFoundError";var zv=class r extends De{constructor(e,t,n){super(`HTTP Error: ${e} ${t}`),this.code=this.name=r.code,this.data={statusCode:e,statusMessage:t,response:n}}};zv.code="HttpError";var Vv=class r extends De{constructor(e,t){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=r.code,this.data={preview:e,response:t}}};Vv.code="SmartHttpError";var Wv=class r extends De{constructor(){super("The operation was canceled."),this.code=this.name=r.code,this.data={}}};Wv.code="UserCanceledError";var qv=class r extends De{constructor(){super("Empty response from git server."),this.code=this.name=r.code,this.data={}}};qv.code="EmptyServerResponseError";var Yv=class r extends De{constructor(e,t){super(`Expected "${e}" but received "${t}".`),this.code=this.name=r.code,this.data={expected:e,actual:t}}};Yv.code="ParseError";var Kv=class r extends De{constructor(e,t,n){super(`Git remote "${e}" uses an unrecognized transport protocol: "${t}"`),this.code=this.name=r.code,this.data={url:e,transport:t,suggestion:n}}};Kv.code="UnknownTransportError";var Zv=class r extends De{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=r.code,this.data={url:e}}};Zv.code="UrlParseError";var Xv=class r extends De{constructor(e,t,n,i){super(`Object ${e} ${i?`at ${i}`:""}was anticipated to be a ${n} but it is a ${t}.`),this.code=this.name=r.code,this.data={oid:e,actual:t,expected:n,filepath:i}}};Xv.code="ObjectTypeError";var Qv=class r extends De{constructor(e){super(`Invalid compressed buffer: ${e}`),this.code=this.name=r.code,this.data={message:e}}};Qv.code="DecompressionError";var vY=32*1024*1024;var Jv=class r extends De{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=r.code,this.data={role:e}}};Jv.code="MissingNameError";var e0=class r extends De{constructor(e,t,n=!0){super(`Failed to create ${e} at ${t} because it already exists.${n?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=r.code,this.data={noun:e,where:t,canForce:n}}};e0.code="AlreadyExistsError";var t0=class r extends De{constructor(e,t,n){super(`Found multiple ${e} matching "${t}" (${n.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=r.code,this.data={nouns:e,short:t,matches:n}}};t0.code="AmbiguousError";var r0=class r extends De{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=r.code,this.data={filepaths:e}}};r0.code="CheckoutConflictError";var n0=class r extends De{constructor(e){super(`Your local changes to the following files would be overwritten by cherry-pick: ${e.join(", ")}`),this.code=this.name=r.code,this.data={filepaths:e}}};n0.code="CherryPickLocalChangesError";var i0=class r extends De{constructor(e,t){super(`Cannot cherry-pick merge commit ${e}. Merge commits have ${t} parents and require specifying which parent to use as the base.`),this.code=this.name=r.code,this.data={oid:e,parentCount:t}}};i0.code="CherryPickMergeCommitError";var s0=class r extends De{constructor(e){super(`Cannot cherry-pick root commit ${e}. Root commits have no parents.`),this.code=this.name=r.code,this.data={oid:e}}};s0.code="CherryPickRootCommitError";var o0=class r extends De{constructor(e,t){super(`Failed to checkout "${e}" because commit ${t} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=r.code,this.data={ref:e,oid:t}}};o0.code="CommitNotFetchedError";var a0=class r extends De{constructor(){super("Cannot create an empty commit when disallowEmpty is true."),this.code=this.name=r.code,this.data={}}};a0.code="EmptyCommitError";var l0=class r extends De{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=r.code,this.data={}}};l0.code="FastForwardError";var c0=class r extends De{constructor(e,t){super(`One or more branches were not updated: ${e}`),this.code=this.name=r.code,this.data={prettyDetails:e,result:t}}};c0.code="GitPushError";var u0=class r extends De{constructor(e){let t="invalid filepath";e==="leading-slash"||e==="trailing-slash"?t='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(t='"filepath" should not be a directory.'),super(t),this.code=this.name=r.code,this.data={reason:e}}};u0.code="InvalidFilepathError";var f0=class r extends De{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=r.code,this.data={depth:e}}};f0.code="MaxDepthError";var d0=class r extends De{constructor(){super("Merges Line truncated
`),n=new TextEncoder().encode(n)}catch(i){}return typeof n!="string"&&(n=_.from(n)),n}async write(e,t,n={}){try{await this._writeFile(e,t,n)}catch(i){await this.mkdir(IC(e)),await this._writeFile(e,t,n)}}async mkdir(e){await OC(this._mkdir,e)}async rm(e){try{await this._unlink(e)}catch(t){if(t.code!=="ENOENT")throw t}}async rmdir(e,t){try{t&&t.recursive?await this._rm(e,t):await this._rmdir(e)}catch(n){if(n.code!=="ENOENT")throw n}}async readdir(e){let t;try{t=await this._readdir(e)}catch(n){if(n.code==="ENOTDIR")return null;if(Yu(n))return[];throw n}return t.sort($8),t}async readdirDeep(e){let t=await this._readdir(e);return(await Promise.all(t.map(async i=>{let s=e+"/"+i;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((i,s)=>i.concat(s),[])}async lstat(e){try{return await this._lstat(e)}catch(t){if(Yu(t))return null;throw t}}async readlink(e,t={encoding:"buffer"}){try{let n=await this._readlink(e,t);return _.isBuffer(n)?n:_.from(n)}catch(n){if(Yu(n))return null;throw n}}async writelink(e,t){return this._symlink(t.toString("utf8"),e)}};var bi=require("obsidian");g();function FC(r,e){let{autoCommitOnlyStaged:t,...n}=e,i=Object.assign({},r.lineAuthor,e.lineAuthor),s=Object.assign({},r,n,{lineAuthor:i});return t&&(s.autoCommitGlobMode="include",s.autoCommitGlobs=""),s}var Hl=class extends Error{constructor(t){super("No network connection available");this.originalError=t}},Xn=class extends Error{constructor(t,n){super("Git operation stopped because of merge conflicts");this.files=t;this.cause=n;this.name="GitConflictError"}};g();var MC=require("obsidian"),L8={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},_t=class extends MC.SuggestModal{constructor(e,t){if(super(e.app),this.config={...L8,...t},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 git-show-password"});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=>window.setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,t){this.config.obscure?t.hide():t.setText(e)}onChooseSuggestion(e,t){if(this.resolve){let n;this.config.allowEmpty&&e===" "?n="":e==="..."?n=void 0:n=e,this.resolve(n)}}};g();var oT=nt(sT(),1);function aT(r){return r.split(`
`).map(e=>e.trim()).filter(e=>e.length>0)}function bG(r){return r.replace(/\\.|[()]/g,e=>e.length===1?`\\${e}`:e)}function yG(r){let e=r.map(t=>({matches:(0,oT.default)(bG(t.replace(/\/+$/,"")||t),{dot:!0,nobrace:!0,noext:!0,nonegate:!0,posix:!0}),directoryOnly:t.endsWith("/"),literalDirectory:!t.includes("*")&&!t.includes("?")&&!t.includes("[")}));return t=>{let n=t.split("/");return e.some(({matches:i,directoryOnly:s,literalDirectory:o})=>{if(!s&&i(t))return!0;if(!o)return!1;for(let a=1;a<n.length;a++)if(i(n.slice(0,a).join("/")))return!0;return!1})}}function P0(r){if(r.mode==="include"&&r.globs.length===0)return()=>!1;let e=yG(r.globs);return t=>r.mode==="include"?e(t):!e(t)}g();var AT=nt(kT(),1),CT=require("child_process"),Cs=require("obsidian");function ef(r,e,t){return r===1?`${r} ${e}`:`${r} ${t!=null?t:e+"s"}`}var F0=(r,e)=>r==="."||e==null||e.length===0||e==="."?!0:e.length>=r.length?e.startsWith(r):r.startsWith(e);function En(r,e){let t;if(e){if(e.button===0||e.button===1){let n=Cs.Keymap.isModEvent(e);t=r.workspace.getLeaf(n)}}else t=r.workspace.getLeaf(!1);return t}function Ar(r){return r.getRoot().side==="left"?"right":"left"}function Zi(r,e,t,n,i){if(e.button==2){let s=r.vault.getAbstractFileByPath(t);if(s!=null){let o=new Cs.Menu;r.workspace.trigger("file-menu",o,s,i,n),o.showAtPosition({x:e.pageX,y:e.pageY})}else{let o=new Cs.Menu;r.workspace.trigger("obsidian-git:menu",o,t,i,n),o.showAtPosition({x:e.pageX,y:e.pageY})}}}function bo(r){throw new Error(`Impossible branch: ${String(r)}`)}function M0(r){return`rgb(${r.r},${r.g},${r.b})`}function TT(r){var s;let e=(s=AT.fromString(r))==null?void 0:s.toRgbaArray();if(e===void 0)return;let[t,n,i]=e;return{r:t,g:n,b:i}}function RT(r){return r.diff(Cs.moment.unix(0),"seconds")}function $T(r){if(r.length!==0)return r.slice().sort()[Math.floor(r.length/2)]}function tf(r,e){return new Proxy(r,{get(t,n){return n==="length"?Math.min(e,t.length):t[n]}})}function PT(r,e,t){return r.length<=e?new Array(e-r.length).fill(t).join("")+r:r.substring(r.length-e)}function IT(r,e){if(e<=0)return r;let t=new Array(e).fill(" ").join(""),n=r.substring(e,r.length);return t+n}function D0(r,e,t){return r<=e&&e<=t}function yo(r){let[e,...t]=r.split("/");return[e!=null?e:"",t.length===0?void 0:t.join("/")]}function Qn(r){return r.endsWith("/")?r:r.split("/").last().replace(/\.md$/,"")}function MG(r){let e=r.lastIndexOf(".");return r.substring(e+1)}function ua(r){if(r.endsWith(".md"))return!1;let e=MG(r);return wC.includes(e)}function L0(r){return(r.startsWith("https://github.com/")||r.startsWith("https://gitlab.com/"))&&(r.endsWith(".git")||(r=r+".git")),r}function zl(r,e){let t=e.vault.getAbstractFileByPath(r);if(!(t instanceof Cs.TFile))return!1;try{return!!e.viewRegistry.getTypeByExtension(t.extension)}catch(n){return!0}}function OT({isFolder:r,gitRelativePath:e}){let t="/";return t+=e,r&&(t+="/"),t.replace(/([\\!#*?[\]])/g,String.raw`\$1`).replace(/\s(?=\s*$)/g,String.raw`\ `)}function Vl(r,e,t,n){let i=e.target;r.workspace.trigger("hover-link",{event:e,source:t.getViewType(),hoverParent:t,targetEl:i,linktext:n})}function rf(r,e,t={}){return new Promise((n,i)=>{let s=(0,CT.spawn)(r,e,t),o="",a="";s.stdout.on("data",l=>{o+=l.toString()}),s.stderr.on("data",l=>{a+=l.toString()}),s.on("error",l=>{n({error:new Error(l.message),stdout:o,stderr:a,code:1})}),s.on("close",l=>{n({stdout:o,stderr:a,code:l!=null?l:1,error:void 0})})})}g();var FT=require("os"),Ih=require("obsidian");var Wl=class{constructor(e){this.plugin=e,this.app=e.app}async withGitOperation(e,t){var n;this.plugin.setPluginState({operation:e});try{return await t()}finally{(n=this.plugin.statusBar)==null||n.clearProgress(!1),this.plugin.setPluginState({operation:0})}}getRelativeVaultPath(e){return this.plugin.settings.basePath?e===""||e==="."?this.plugin.settings.basePath:this.plugin.settings.basePath+"/"+e:e}getRelativeRepoPath(e,t=!0){if(t){let n=this.plugin.settings.basePath;if(n&&n.length>0){if(e.startsWith(n+"/"))return e.substring(n.length+1);if(e===n)return""}}return e}getVaultPathspec(){}isPathInsideVault(e){let t=this.getVaultPathspec();return t==null||e===t||e.startsWith(t+"/")}unload(){}simplify(e){var t,n,i,s;for(let o of e){for(;;){let a=((t=o.children)==null?void 0:t.length)==1,l=((i=(n=o.children)==null?void 0:n.first())==null?void 0:i.data)==null;if(!(o.children!=null&&a&&l))break;let c=o.children.first();o.title+="/"+c.title,o.data=c.data,o.path=c.path,o.vaultPath=c.vaultPath,o.children=c.children}o.children!=null&&this.simplify(o.children),(s=o.children)==null||s.sort((a,l)=>{let c=(l.data==null?1:0)-(a.data==null?1:0);return c!=0?c:a.title.localeCompare(l.title)})}return e.sort((o,a)=>{let l=(a.data==null?1:0)-(o.data==null?1:0);return l!=0?l:o.title.localeCompare(a.title)})}getTreeStructure(e,t="repository"){let n=new Map;for(let a of e){let c=(t==="vault"?a.vaultPath:a.path).split("/"),u=n,f="";for(let d=0;d<c.length;d++){let h=c[d];f=f?f+"/"+h:h;let p=d===c.length-1,m=u.get(h);if(!m){let w= Line truncated
`),n.stagedOutsideVault>0&&(i+=`${i?`
`:""}${n.stagedOutsideVault} staged file${n.stagedOutsideVault===1?"":"s"} outside the vault`)):i="Too many files to list",e=e+`
Affected files:
`+i}return e}};g();var or=require("obsidian"),Oh={uid:0,gid:0,ino:0,dev:0},Fh=class extends Error{constructor(t){super(`File not found: ${t}`);this.code="ENOENT";this.name="FileNotFoundError"}},Mh=class{constructor(e,t){this.plugin=t;this.adapter=e.adapter,this.vault=e,this.lastBasePath=this.plugin.settings.basePath,this.promises={readFile:this.readFile.bind(this),writeFile:this.writeFile.bind(this),readdir:this.readdir.bind(this),mkdir:this.mkdir.bind(this),rmdir:this.rmdir.bind(this),stat:this.stat.bind(this),unlink:this.unlink.bind(this),lstat:this.lstat.bind(this),readlink:this.readlink.bind(this),symlink:this.symlink.bind(this)}}async readFile(e,t){var i;if(e===void 0)return;if(e=(0,or.normalizePath)(e),this.maybeLog("Read: "+e+JSON.stringify(t)),(typeof t=="string"?t:t==null?void 0:t.encoding)==="utf8"){let s=this.vault.getAbstractFileByPath(e);return s instanceof or.TFile?(this.maybeLog("Reuse"),this.vault.read(s)):this.adapter.read(e)}else{if(this.isIndexPath(e))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(e)):(i=this.index)!=null?i:this.adapter.readBinary(e);let s=this.vault.getAbstractFileByPath(e);return s instanceof or.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(s)):this.adapter.readBinary(e)}}async writeFile(e,t){var n;if(this.maybeLog("Write: "+e),e=(0,or.normalizePath)(e),typeof t=="string"){let i=this.vault.getAbstractFileByPath(e);if(i instanceof or.TFile)return this.vault.modify(i,t);if(!this.isHiddenPath(e))await this.vault.create(e,t);else return this.adapter.write(e,t)}else{let i=DG(t);if(this.isIndexPath(e)){this.index=i;let s=Date.now();(n=this.indexctime)!=null||(this.indexctime=s),this.indexmtime=s}else{let s=this.vault.getAbstractFileByPath(e);if(s instanceof or.TFile)return this.vault.modifyBinary(s,i);if(!this.isHiddenPath(e))await this.vault.createBinary(e,i);else return this.adapter.writeBinary(e,i)}}}async readdir(e){e=(0,or.normalizePath)(e),this.maybeLog("ReadDir: "+e),e==="."&&(e="/");let t=await this.adapter.list(e),n=[...t.files,...t.folders],i;return e!=="/"?i=n.map(s=>(0,or.normalizePath)(s.substring(e.length))):i=n,i}async mkdir(e){if(e=(0,or.normalizePath)(e),!(e==="."||e==="/")){if(!this.isHiddenPath(e)){if(this.vault.getFolderByPath(e))return;await this.vault.createFolder(e);return}return this.adapter.mkdir(e)}}async rmdir(e,t){var n,i;if(e=(0,or.normalizePath)(e),this.maybeLog("Rmdir: "+e+JSON.stringify(t)),!this.isHiddenPath(e)){let s=this.vault.getAbstractFileByPath(e);if(s instanceof or.TFolder){await this.vault.delete(s,(t==null?void 0:t.recursive)===!0||((n=t==null?void 0:t.options)==null?void 0:n.recursive)===!0);return}}return this.adapter.rmdir(e,(t==null?void 0:t.recursive)===!0||((i=t==null?void 0:t.options)==null?void 0:i.recursive)===!0)}async stat(e){if(e=(0,or.normalizePath)(e),this.isIndexPath(e)){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{...Oh,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 new Fh(e);return this.indexctime=n.ctime,this.indexmtime=n.mtime,{...Oh,ctimeMs:n.ctime,mtimeMs:n.mtime,size:n.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let t=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),t instanceof or.TFile)return this.maybeLog("Reuse stat"),{...Oh,ctimeMs:t.stat.ctime,mtimeMs:t.stat.mtime,size:t.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let n=await this.adapter.stat(e);if(n)return{...Oh,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 new Fh(e)}}async unlink(e){if(e=(0,or.normalizePath)(e),!this.isHiddenPath(e)){let t=this.vault.getAbstractFileByPath(e);if(t instanceof or.TFile)return this.vault.delete(t)}return this.adapter.remove(e)}async lstat(e){return this.stat(e)}readlink(e){return Promise.reject(new Error(`readlink of (${e}) is not implemented.`))}symlink(e){return Promise.reject(new Error(`symlink of (${e}) is not implemented.`))}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.getIndexPath(),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"}getIndexPath(){return this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index")}isIndexPath(e){return e===this.getIndexPath()}isHiddenPath(e){return e.startsWith(this.gitDir)?!0:e.split("/").some(t=>t.startsWith(".")&&t!==".")}maybeLog(e){}};function DG(r){return r instanceof ArrayBuffer?r:r.buffer instanceof ArrayBuffer&&r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:new Uint8 Line truncated
`);l.push({message:(c=f[0])!=null?c:"",author:{name:u.commit.author.name,email:u.commit.author.email},body:f.slice(1).join(`
`),date:new Date(u.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChanges(u.commit.parent.first(),u.oid,o)).map(d=>({path:d.path,status:d.type,vaultPath:this.getRelativeVaultPath(d.path),hash:u.oid}))},hash:u.oid,refs:[]})}return l}updateBasePath(t){return this.getRepo().dir=t,Promise.resolve()}getGitDirPath(){return(0,bi.normalizePath)(this.getRelativeVaultPath(this.plugin.settings.gitDir||".git"))}async getConflictedFiles(){let t=Ah.acquire({fs:new Ch(this.fs),gitdir:this.getGitDirPath(),cache:{}},i=>i.unmergedPaths),n=await this.wrapFS(t);if(!Array.isArray(n)||!n.every(i=>typeof i=="string"))throw new TypeError("isomorphic-git returned invalid unmerged paths");return n}getMergeStatePath(t){return(0,bi.normalizePath)(`${this.getGitDirPath()}/${t}`)}async isMergeInProgress(){return this.app.vault.adapter.exists(this.getMergeStatePath(Dr.MERGE_HEAD))}async getMergeHeads(){let t=this.getMergeStatePath(Dr.MERGE_HEAD);return await this.app.vault.adapter.exists(t)?(await this.app.vault.adapter.read(t)).split(/\r?\n/).map(n=>n.trim()).filter(n=>n.length>0):[]}async writeMergeState({ours:t,theirs:n,message:i}){let s=this.app.vault.adapter;await s.write(this.getMergeStatePath(Dr.ORIGINAL_HEAD),`${t}
`),await s.write(this.getMergeStatePath(Dr.MERGE_MESSAGE),`${i}
`),await s.write(this.getMergeStatePath(Dr.MERGE_MODE),""),await s.write(this.getMergeStatePath(Dr.MERGE_HEAD),`${n}
`)}async clearMergeState(){let t=this.app.vault.adapter;for(let n of[Dr.MERGE_HEAD,Dr.MERGE_MESSAGE,Dr.MERGE_MODE]){let i=this.getMergeStatePath(n);await t.exists(i)&&await t.remove(i)}}async updateUpstreamBranch(t){let[n,i]=yo(t),s=await this.branchInfo();await this.wrapFS(ge.push({...this.getRepo(),remote:n,remoteRef:i})),this.app.workspace.trigger("obsidian-git:refs-changed"),await this.setConfig(`branch.${s.current}.merge`,`refs/heads/${i}`)}updateGitPath(t){return Promise.resolve()}async getCommittedFilesCount(t){let{commit:n}=await this.wrapFS(ge.readCommit({...this.getRepo(),oid:t})),i=n.parent[0];return i?await this.getFileChangesCount(i,t):(await this.wrapFS(ge.listFiles({...this.getRepo(),ref:t}))).length}async getFileChangesCount(t,n,i){return(await this.getFileChanges(t,n,i)).length}async getFileChanges(t,n,i){return this.walkDifference({cache:i,walkers:[ge.TREE({ref:t}),ge.TREE({ref:n})]})}async walkDifference({walkers:t,dir:n,cache:i}){return this.wrapFS(N0({...this.getRepo(),trees:t,cache:i,map:async(s,[o,a])=>{if(!F0(s,n))return null;let l=await(o==null?void 0:o.type()),c=await(a==null?void 0:a.type());if(l==="tree"||c==="tree"){if(s!=="."&&l===c){let m=await(o==null?void 0:o.oid());if(m!==void 0&&m===await(a==null?void 0:a.oid()))return null}return}let[u,f,d,h]=await Promise.all([o==null?void 0:o.oid(),a==null?void 0:a.oid(),o==null?void 0:o.mode(),a==null?void 0:a.mode()]),p="equal";if((u!==f||d!==h)&&(p="M"),u===void 0&&(p="A"),f===void 0&&(p="D"),u===void 0&&f===void 0&&this.plugin.warn("Missing object IDs in both Git trees while comparing file:",s),p!=="equal")return{path:s,type:p}}}))}async getStagedForMessage(){try{await this.resolveRef("HEAD")}catch(n){if(n instanceof Fr.NotFoundError)return super.getStagedForMessage();throw n}return{staged:(await this.getStagedFiles()).map(({path:n,vaultPath:i,type:s})=>({path:n,vaultPath:i,index:s,workingDir:" "})),stagedOutsideVault:0}}async getStagedFiles(t="."){return(await this.walkDifference({walkers:[ge.TREE({ref:"HEAD"}),ge.STAGE()],dir:t})).map(i=>({vaultPath:this.getRelativeVaultPath(i.path),path:i.path,type:i.type}))}async getUnstagedFiles(t="."){let n,i=window.setTimeout(()=>{n=new bi.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let s=this.getRepo(),o=await this.wrapFS(N0({...s,trees:[ge.WORKDIR(),ge.STAGE()],map:async function(a,[l,c]){if(!c&&l&&await ge.isIgnored({...s,filepath:a})||!F0(a,t))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:a,type:"M"}:null:{path:a,type:"A"}:{path:a,type:"D"}}}));return window.clearTimeout(i),n==null||n.hide(),o}catch(s){throw window.clearTimeout(i),n==null||n.hide(),s}}async getDiffString(t,n=!1,i){let s=this.getRelativeVaultPath(t),o=async(c,[u])=>{if(t==c){let f=await u.oid();return(await ge.readBlob({...this.getRepo(),oid:f})).blob}};if(i){let c=await Nl({...this.getRepo(),filepath:t,oid:i}).then(p=>new TextDecoder().decode(p.blob)).catch(p=>{if(!(p instanceof ge.Errors.NotFoundError))throw p}),f=(await ge.readCommit({...this.getRepo(),oid:i})).commit.parent.first(),d;return f&&(d=await Nl({...this.getRepo(),filepath:t,oid:f}).then(p=>new TextDecoder().decode(p.blob)).catch(p=>{if(!(p instanceof ge.Errors.NotFoundError))throw p})),Wu(s,d!=null?d:"",c!=null?c:"")}let a=(await N0({...this.getRepo(),trees:[ge.STAGE()],map:o})).first(),l=new TextDecoder().decode(a);if(n){let c=await this.resolveRef("HEAD").then(f=>Nl({...this.getRepo(),filepath:t,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof ge.Errors.NotFoundError))throw f});return Wu(s,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(s)?c=await this.app.vault.adapter.read(s):c="",Wu(s,l,c)}}async show(t,n,i=!0){let s=this.getRelativeRepoPath(n,i),{blob:o}=await Nl({...this.getRepo(),oid:t,filepath:s});return new TextDecoder().decode(o)}async getLastCommitTime(){let t=this.getRepo(),n=await this.resolveRef("HEAD"),s=(await ge.readCommit({...t,oid:n})).commit.committer.timestamp;return new Date(s*1e3)}getFileStatusResult(t){var s,o;let n=`${t[this.HEAD]}${t[this.WORKDIR]}${t[this.STAGE]}`,i=this.status_mapping[n];if(i===void 0)throw new Error(`Unsupported status matrix row: ${n}`);return{index:i[0]=="?"?"U":(s=i[0])!=null?s:" ",workingDir:i[1]=="?"?"U":(o=i[1])!=null?o:" ",path:t[this.FILE],vaultPath:this.getRelativeVaultPath(t[this.FILE])}}async checkAuthorInfo(){let t=await this.getConfig("user.name"),n=await this.getConfig("user.email");if(!t||!n)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(t,n=!0){if(!this.plugin.settings.disablePopups)return new bi.Notice(t,n?this.noticeLength:void 0)}};Dr.MERGE_HEAD="MERGE_HEAD",Dr.MERGE_MESSAGE="MERGE_ Line truncated
`){return r.split(t).reduce((n,i)=>{let s=e?i.trim():i;return s&&n.push(s),n},[])}function hb(r,e){return tp(r,!0).map(t=>e(t))}function _R(r){return(0,Qh.exists)(r,Qh.FOLDER)}function yi(r,e){return Array.isArray(r)?r.includes(e)||r.push(e):r.add(e),e}function HU(r,e){return Array.isArray(r)&&!r.includes(e)&&r.push(e),r}function pb(r,e){if(Array.isArray(r)){let t=r.indexOf(e);t>=0&&r.splice(t,1)}else r.delete(e);return e}var mb=Object.prototype.toString.call.bind(Object.prototype.toString);function An(r){return Array.isArray(r)?r:[r]}function xR(r){return r.replace(/[\s-]+(.)/g,(e,t)=>t.toUpperCase())}function lf(r){return An(r).map(e=>e instanceof String?e:String(e))}function mt(r,e=0){if(r==null)return e;let t=parseInt(r,10);return Number.isNaN(t)?e:t}function Vh(r,e){let t=[];for(let n=0,i=r.length;n<i;n++)t.push(e,r[n]);return t}function Wh(r){return(Array.isArray(r)?_.concat(r):r).toString("utf-8")}function GU(r){return r?_.isBuffer(r)?r.length:_.byteLength(r):0}function UU(r,e){let t={};return e.forEach(n=>{r[n]!==void 0&&(t[n]=r[n])}),t}function eR(r=0){return new Promise(e=>setTimeout(e,r))}function tR(r){if(r!==!1)return r}function xt(r,e,t){return e(r)?r:arguments.length>2?t:void 0}var rp=r=>Array.isArray(r);function Y0(r,e){let t=Xi(r)?"string":typeof r;return/number|string|boolean/.test(t)&&(!e||!e.includes(t))}var it=r=>typeof r=="string"||Xi(r),jU=r=>it(r)||_.isBuffer(r),qh=r=>it(r)||Array.isArray(r)&&r.every(it);function gb(r){return!!r&&mb(r)==="[object Object]"}function zU(r){return typeof r=="function"}var ER=r=>r==null||"number|boolean|function".includes(typeof r)?!1:typeof r.length=="number",np=(r=>(r[r.SUCCESS=0]="SUCCESS",r[r.ERROR=1]="ERROR",r[r.NOT_FOUND=-2]="NOT_FOUND",r[r.UNCLEAN=128]="UNCLEAN",r))(np||{}),Yh=class r{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new r(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}};function VU(){throw new Error("LineParser:useMatches not implemented")}var ke=class{constructor(e,t){this.matches=[],this.useMatches=VU,this.parse=(n,i)=>(this.resetMatches(),this._regExp.every((s,o)=>this.addMatch(s,o,n(o)))?this.useMatches(i,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){let i=n&&e.exec(n);return i&&this.pushMatch(t,i),!!i}pushMatch(e,t){this.matches.push(...t.slice(1))}},xo=class extends ke{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}},WU={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1};function qU(...r){let e=process.cwd(),t=Object.assign({baseDir:e,...WU},...r.filter(n=>typeof n=="object"&&n));return t.baseDir=t.baseDir||e,t.trimmed=t.trimmed===!0,t}function SR(r,e=[]){return gb(r)?Object.keys(r).reduce((t,n)=>{let i=r[n];if(Xi(i))t.push(i);else if(Y0(i,["boolean"]))t.push(n+"="+i);else if(Array.isArray(i))for(let s of i)Y0(s,["string","number"])||t.push(n+"="+s);else t.push(n);return t},e):e}function ze(r,e=0,t=!1){let n=[];for(let i=0,s=e<0?r.length:e;i<s;i++)"string|number".includes(typeof r[i])&&n.push(String(r[i]));return SR(wb(r),n),t||n.push(...YU(r)),n}function YU(r){let e=typeof Jl(r)=="function";return lf(xt(Jl(r,e?1:0),rp,[]))}function wb(r){let e=zU(Jl(r));return xt(Jl(r,e?1:0),gb)}function ce(r,e=!0){let t=DU(Jl(r));return e||LU(t)?t:void 0}function rR(r,e){return r(e.stdOut,e.stdErr)}function Cn(r,e,t,n=!0){return An(t).forEach(i=>{for(let s=tp(i,n),o=0,a=s.length;o<a;o++){let l=(c=0)=>{if(!(o+c>=a))return s[o+c]};e.some(({parse:c})=>c(l,r))}}),r}var vb=({exitCode:r},e,t,n)=>{if(r===np.UNCLEAN&&QU(e))return t(_.from("false"));n(e)},kR=r=>r.trim()==="true";function KU(r){switch(r){case"bare":return XU();case"root":return ZU()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:vb,parser:kR}}function ZU(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:vb,parser(r){return/^\.(git)?$/.test(r.trim())}}}function XU(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:vb,parser:kR}}function QU(r){return/(Not a git repository|Kein Git-Repository)/i.test(String(r))}var K0=class{constructor(e){this.paths=[],this.files=[],this.folders=[],this.dryRun=e}},JU=/^[a-z]+\s*/i,e4=/^[a-z]+\s+[a-z]+\s*/i,t4=/\/$/;function r4(r,e){let t=new K0(r),n=r?e4:JU;return tp(e).forEach(i=>{let s=i.replace(n,"");t.paths.push(s),(t4.test(s)?t.folders:t.files).push(s)}),t}var AR=[];function n4(r){return{commands:AR,format:"empty",parser:r}}function Gt(r){return{commands:AR,format:"empty",parser(){throw typeof r=="string"?new q0(r):r}}}function Et(r,e=!1){return{commands:r,format:"utf-8",parser(t){return e?String(t).trim():t}}}function CR(r){return{commands:r,format:"buffer",parser(e){return e}}}function i4(r){return r.format==="buffer"}function nR(r){return r.format==="empty"||!r.commands.length}var s4="Git clean interactive mode is not suppo Line truncated
`)){let l=NU(o,`
`);a=l[0],o=l[1]}yield{file:s,key:a,value:o}}}var $R=(r=>(r.system="system",r.global="global",r.local="local",r.worktree="worktree",r))($R||{});function G0(r,e){return typeof r=="string"&&Object.hasOwn($R,r)?r:e}function v4(r,e,t,n){let i=["config",`--${n}`];return t&&i.push("--add"),i.push(r,e),{commands:i,format:"utf-8",parser(s){return s}}}function b4(r,e){let t=["config","--null","--show-origin","--get-all",r];return e&&t.splice(1,0,`--${e}`),{commands:t,format:"utf-8",parser(n){return g4(n,r)}}}function y4(r){let e=["config","--list","--show-origin","--null"];return r&&e.push(`--${r}`),{commands:e,format:"utf-8",parser(t){return m4(t)}}}function _4(){return{addConfig(r,e,...t){return this._runTask(v4(r,e,t[0]===!0,G0(t[1],"local")),ce(arguments))},getConfig(r,e){return this._runTask(b4(r,G0(e,void 0)),ce(arguments))},listConfig(...r){return this._runTask(y4(G0(r[0],void 0)),ce(arguments))}}}var PR=(r=>(r.ADDED="A",r.COPIED="C",r.DELETED="D",r.MODIFIED="M",r.RENAMED="R",r.CHANGED="T",r.UNMERGED="U",r.UNKNOWN="X",r.BROKEN="B",r))(PR||{}),x4=new Set(Object.values(PR));function E4(r){return x4.has(r)}var iR,S4=["-h"],Uh=Symbol("grepQuery"),X0=class{constructor(){this[iR]=[]}*[(iR=Uh,Symbol.iterator)](){for(let e of this[Uh])yield e}and(...e){return e.length&&this[Uh].push("--and","(",...Vh(e,"-e"),")"),this}param(...e){return this[Uh].push(...Vh(e,"-e")),this}};function k4(...r){return new X0().param(...r)}function A4(r){let e=new Set,t={};return hb(r,n=>{let[i,s,o]=n.split(zh);e.add(i),(t[i]=t[i]||[]).push({line:mt(s),path:i,preview:o})}),{paths:e,results:t}}function C4(){return{grep(r){let e=ce(arguments),t=ze(arguments);for(let i of S4)if(t.includes(i))return this._runTask(Gt(`git.grep: use of "${i}" is not supported.`),e);typeof r=="string"&&(r=k4().param(r));let n=["grep","--null","-n","--full-name",...t,...r];return this._runTask({commands:n,format:"utf-8",parser(i){return A4(i)}},e)}}}var IR=(r=>(r.MIXED="mixed",r.SOFT="soft",r.HARD="hard",r.MERGE="merge",r.KEEP="keep",r))(IR||{}),T4=lf(Object.values(IR));function R4(r,e){let t=["reset"];return OR(r)&&t.push(`--${r}`),t.push(...e),Et(t)}function $4(r){if(OR(r))return r;switch(typeof r){case"string":case"undefined":return"soft"}}function OR(r){return typeof r=="string"&&T4.includes(r)}Jh.default.formatters.L=r=>String(ER(r)?r.length:"-");Jh.default.formatters.B=r=>_.isBuffer(r)?r.toString("utf8"):mb(r);function P4(){return(0,Jh.default)("simple-git")}function sR(r,e,t){return!e||!String(e).replace(/\s*/,"")?t?(n,...i)=>{r(n,...i),t(n,...i)}:r:(n,...i)=>{r(`%s ${n}`,e,...i),t&&t(n,...i)}}function I4(r,e,{namespace:t}){if(typeof r=="string")return r;let n=e&&e.namespace||"";return n.startsWith(t)?n.substr(t.length+1):n||t}function ec(r,e,t,n=P4()){let i=r&&`[${r}]`||"",s=[],o=typeof e=="string"?n.extend(e):e,a=I4(xt(e,it),o,n);return c(t);function l(u,f){return yi(s,ec(r,a.replace(/^[^:]+/,u),f,n))}function c(u){let f=u&&`[${u}]`||"",d=o&&sR(o,f)||ep,h=sR(n,`${i} ${f}`,d);return Object.assign(o?d:h,{label:r,sibling:l,info:h,step:c})}}var FR=class Q0{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=Q0.getName(e.commands[0]),n=ec(this.logLabel,t);return{task:e,logger:n,name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new vr(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++Q0.counter}`}};FR.counter=0;var O4=FR,J0=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new O4}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}async attemptTask(e){let t=await this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:i}=this._queue.attempt(e);return await(nR(e)?this.attemptEmptyTask(e,i):this.attemptRemoteTask(e,i))}catch(i){throw this.onFatalException(e,i)}finally{n(),t()}}onFatalException(e,t){let n=t instanceof vr?Object.assign(t,{task:e}):new vr(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}async attemptRemoteTask(e,t){let n=this._plugins.exec("spawn.binary","",t Line truncated
`).map(S5).filter(Boolean);e||t.sort(function(i,s){let o=i.split("."),a=s.split(".");if(o.length===1||a.length===1)return E5(jh(o[0]),jh(a[0]));for(let l=0,c=Math.max(o.length,a.length);l<c;l++){let u=e$(jh(o[l]),jh(a[l]));if(u)return u}return 0});let n=e?t[0]:[...t].reverse().find(i=>i.indexOf(".")>=0);return new ub(t,n)};function E5(r,e){let t=Number.isNaN(r),n=Number.isNaN(e);return t!==n?t?1:-1:t?e$(r,e):0}function e$(r,e){return r===e?0:r>e?1:-1}function S5(r){return r.trim()}function jh(r){return typeof r=="string"&&parseInt(r.replace(/^\D+/g,""),10)||0}function k5(r=[]){let e=r.some(t=>/^--sort=/.test(t));return{format:"utf-8",commands:["tag","-l",...r],parser(t){return x5(t,e)}}}function A5(r){return{format:"utf-8",commands:["tag",r],parser(){return{name:r}}}}function C5(r,e){return{format:"utf-8",commands:["tag","-a","-m",e,r],parser(){return{name:r}}}}function xe(r,e){this._plugins=e,this._executor=new eb(r.baseDir,new ab(r.maxConcurrentProcesses),e),this._trimmed=r.trimmed}(xe.prototype=Object.create(Xh.prototype)).constructor=xe;xe.prototype.customBinary=function(r){return this._plugins.reconfigure("binary",r),this};xe.prototype.env=function(r,e){return arguments.length===1&&typeof r=="object"?this._executor.env=r:(this._executor.env=this._executor.env||{})[r]=e,this};xe.prototype.stashList=function(r){return this._runTask(v5(wb(arguments)||{},rp(r)&&r||[]),ce(arguments))};xe.prototype.mv=function(r,e){return this._runTask(c5(r,e),ce(arguments))};xe.prototype.checkoutLatestTag=function(r){var e=this;return this.pull(function(){e.tags(function(t,n){e.checkout(n.latest,r)})})};xe.prototype.pull=function(r,e,t,n){return this._runTask(u5(xt(r,it),xt(e,it),ze(arguments)),ce(arguments))};xe.prototype.fetch=function(r,e){return this._runTask(o5(xt(r,it),xt(e,it),ze(arguments)),ce(arguments))};xe.prototype.tags=function(r,e){return this._runTask(k5(ze(arguments)),ce(arguments))};xe.prototype.rebase=function(){return this._runTask(Et(["rebase",...ze(arguments)]),ce(arguments))};xe.prototype.reset=function(r){return this._runTask(R4($4(r),ze(arguments)),ce(arguments))};xe.prototype.revert=function(r){let e=ce(arguments);return typeof r!="string"?this._runTask(Gt("Commit must be a string"),e):this._runTask(Et(["revert",...ze(arguments,0,!0),r]),e)};xe.prototype.addTag=function(r){let e=typeof r=="string"?A5(r):Gt("Git.addTag requires a tag name");return this._runTask(e,ce(arguments))};xe.prototype.addAnnotatedTag=function(r,e){return this._runTask(C5(r,e),ce(arguments))};xe.prototype.deleteLocalBranch=function(r,e,t){return this._runTask(J6(r,typeof e=="boolean"?e:!1),ce(arguments))};xe.prototype.deleteLocalBranches=function(r,e,t){return this._runTask(Q6(r,typeof e=="boolean"?e:!1),ce(arguments))};xe.prototype.branch=function(r,e){return this._runTask(Z6(ze(arguments)),ce(arguments))};xe.prototype.branchLocal=function(r){return this._runTask(X6(),ce(arguments))};xe.prototype.raw=function(r){let e=!Array.isArray(r),t=[].slice.call(e?arguments:r,0);for(let i=0;i<t.length&&e;i++)if(!Y0(t[i])){t.splice(i,t.length-i);break}t.push(...ze(arguments,0,!0));var n=ce(arguments);return t.length?this._runTask(Et(t,this._trimmed),n):this._runTask(Gt("Raw: must supply one or more command to execute"),n)};xe.prototype.submoduleAdd=function(r,e,t){return this._runTask(b5(r,e),ce(arguments))};xe.prototype.submoduleUpdate=function(r,e){return this._runTask(_5(ze(arguments,!0)),ce(arguments))};xe.prototype.submoduleInit=function(r,e){return this._runTask(y5(ze(arguments,!0)),ce(arguments))};xe.prototype.subModule=function(r,e){return this._runTask(ip(ze(arguments)),ce(arguments))};xe.prototype.listRemote=function(){return this._runTask(m5(ze(arguments)),ce(arguments))};xe.prototype.addRemote=function(r,e,t){return this._runTask(h5(r,e,ze(arguments)),ce(arguments))};xe.prototype.removeRemote=function(r,e){return this._runTask(w5(r),ce(arguments))};xe.prototype.getRemotes=function(r,e){return this._runTask(p5(r===!0),ce(arguments))};xe.prototype.remote=function(r,e){return this._runTask(g5(ze(arguments)),ce(arguments))};xe.prototype.tag=function(r,e){let t=ze(arguments);return t[0]!=="tag"&&t.unshift("tag"),this._runTask(Et(t),ce(arguments))};xe.prototype.updateServerInfo=function(r){return this._runTask(Et(["update-server-info"]),ce(arguments))};xe.prototype.pushTags=function(r,e){let t=R6({remote:xt(r,it)},ze(arguments));return this._runTask(t,ce(arguments))};xe.prototype.rm=function(r){return this._runTask(Et(["rm","-f",...An(r)]),ce(arguments))};xe.prototype.rmKeepLocal=function(r){return this._runTask(Et(["rm","--cached",...An(r)]),ce(arguments))};xe.prototype.catFile=function(r,e){return this._catFile("utf-8",arguments)};xe.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)};xe.prototype._catFile=function(r,e){var t=ce(e),n=["cat-file"],i=e[0];if(typeof i=="string")return this._runTask(Gt("Git.catFile: options must be supplied as an array of strings"),t);Array.isArray(i)&&n.push.apply(n,i);let s Line truncated
`),a=s.slice(0,o);if(o<0||!/^[0-9a-f]{64}$/.test(a)||!(0,op.timingSafeEqual)(_.from(a),_.from(this.token))){this.respond(t,403);return}let l=s.slice(o+1),c=this.promptQueue,u;this.promptQueue=new Promise(f=>{u=f});try{await c,!this.stopped&&!t.destroyed&&await this.showPrompt(l,t)}finally{u()}}async showPrompt(e,t){let n=e.length>60?new s$.Notice(e,999999):null,i=new _t(this.plugin,{allowEmpty:!0,obscure:!e.includes("Username for"),placeholder:e.length>60?"Enter a response to the message.":e});this.activeModal=i;let s=()=>{t.writableEnded||i.close()};t.once("close",s);try{let o=await i.openAndGetResult();if(this.stopped||t.destroyed)return;o===void 0?this.respond(t,409):this.respond(t,200,`${o}
`)}finally{t.off("close",s),n==null||n.hide(),this.activeModal===i&&(this.activeModal=void 0)}}respond(e,t,n=""){e.destroyed||e.writableEnded||(e.writeHead(t,{"Cache-Control":"no-store","Content-Type":"text/plain; charset=utf-8","X-Content-Type-Options":"nosniff"}),e.end(n))}};var Ze=class extends Wl{constructor(t){super(t);this.unloaded=!1;this.useDefaultWindowsGitPath=!1}async setGitInstance(t=!1){var i,s;if(this.unloaded)return;(i=this.askpassServer)==null||i.stop(),this.askpassServer=void 0;let n=await this.isGitInstalled();if(!this.unloaded&&n){let o=this.app.vault.adapter,a=o.getBasePath(),l=a;this.plugin.settings.basePath&&(await o.exists((0,Eo.normalizePath)(this.plugin.settings.basePath))?l=Fe.join(a,this.plugin.settings.basePath):t||new Eo.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=l;let c=this.plugin.localStorage.getPATHPaths(),u=this.plugin.localStorage.getEnvVars(),f=this.plugin.settings.gitDir,d={...process.env};if(c.length>0){let C=c.join(Fe.delimiter)+Fe.delimiter+d.PATH;d.PATH=C}f&&(d.GIT_DIR=f,d.GIT_WORK_TREE=l);for(let C of u){let[S,T]=C.split("=");S!==void 0&&(d[S]=T)}this.git=n$({baseDir:l,binary:this.plugin.localStorage.getGitPath()||(this.useDefaultWindowsGitPath?xh:void 0),config:["core.quotepath=off"],allowEnvironment:[...Object.keys(d),"GIT_ASKPASS","SSH_ASKPASS","SSH_ASKPASS_REQUIRE","OBSIDIAN_GIT_ASKPASS_PORT","OBSIDIAN_GIT_ASKPASS_TOKEN","OBSIDIAN_GIT"],progress:C=>{var S;(S=this.plugin.statusBar)==null||S.displayProgress(this.toGitProgress(C))},unsafe:{allowAbbreviatedOptions:!0,allowUnsafeCustomBinary:!0,allowUnsafeEditor:!0,allowUnsafeAskPass:!0,allowUnsafeConfigEnvCount:!0,allowUnsafeConfigPaths:!0,allowUnsafeCredentialHelper:!0,allowUnsafeGitProxy:!0,allowUnsafeGpgProgram:!0,allowUnsafeHooksPath:!0,allowUnsafeMergeDriver:!0,allowUnsafeSshCommand:!0,allowUnsafePager:!0,allowUnsafeDiffTextConv:!0,allowUnsafeCommandBinaries:!0,allowUnsafeExec:!0,allowUnsafeInclude:!0,allowUnsafeSubmodule:!0,allowUnsafeUrlRewrite:!0}});let h="simple-git",p=",",w=((s=localStorage.debug)!=null?s:"").split(p);if(!w.includes(h)&&!w.includes(`-${h}`)&&(w.push(h),l$.default.enable(w.join(p))),await this.git.env(d).checkIsRepo()){let C=await this.git.revparse("--show-cdup"),S=(0,uf.resolve)(l+uf.sep+C);this.absoluteRepoPath=S,await this.git.cwd(S)}if(this.unloaded)return;let y=Fe.join(a,this.app.vault.configDir,"plugins","obsidian-git"),v=Fe.join(y,Tv),A=Fe.join(y,".git_credentials_input");if(await Tn.rm(A,{force:!0}),await Tn.rm(`${A}.response`,{force:!0}),this.unloaded)return;if(d.SSH_ASKPASS==null){if(!await this.startAskpass(v,d))return;d.SSH_ASKPASS=v,d.GIT_ASKPASS==null&&(d.GIT_ASKPASS=v),d.SSH_ASKPASS_REQUIRE="force"}if(this.unloaded)return;d.OBSIDIAN_GIT="1",this.git=this.git.env(d)}}toGitProgress(t){return{action:this.getProgressAction(t.method),stage:t.stage,progress:t.progress,processed:t.processed,total:t.total}}getProgressAction(t){switch(t){case"fetch":return"Fetching";case"push":return"Pushing";case"pull":return"Pulling";case"checkout":return"Checking out";default:return t?t.charAt(0).toUpperCase()+t.slice(1):"Working"}}getRelativeVaultPath(t){let i=this.app.vault.adapter.getBasePath(),s=Fe.join(this.absoluteRepoPath,t),o=Fe.relative(i,s);return Eo.Platform.isWin&&(o=o.replace(/\\/g,"/")),o}getRelativeRepoPath(t,n=!0){if(n){let s=this.plugin.app.vault.adapter.getBasePath(),o=this.absoluteRepoPath,a=Fe.join(s,t),l=Fe.relative(o,a);return Eo.Platform.isWin&&(l=l.replace(/\\/g,"/")),l}return t}getVaultPathspec(){if(!this.plugin.settings.limitToVault)return;let t=this.app.vault.adapter,n=Fe.resolve(t.getBasePath()),i=Fe.resolve(this.absoluteRepoPath),s=Fe.relative(i,n);if(!(s===""||s===".."||s.startsWith(".."+Fe.sep)||Fe.isAbsolute(s)))return s.split(Fe.sep).join("/")}async countPathsOutsideVault(t){return(await this.git.raw([...t,"-z"])).split("\0").filter(i=>i&&!this.isPathInsideVault(i)).length}get relPluginConfigPath(){return Fe.join(this.app.vault.configDir,"plugins","obsidian-git")}async startAskpass(t,n){var a;if(await this.addAskPassScriptToExclude(),this.unloaded||(await Tn.writeFile(t,gC),await Tn.chmod(t,493),this.unloaded))return!1;let i=new sp(this.plugin);(a=this.askpassServer)==null||a.stop(),this.askpassServer=i;let s,o;try{({port:s,token:o}=await i.start())}catch(l){if(this.unloaded||this.askpassServer!==i)return!1;throw l}return this.unloaded||this.askpassServer!==i?(i.stop(),!1):(n.OBSIDIAN_GIT_ASKPASS_PORT=`${s}`,n.OBSIDIAN_GIT_ASKPASS_TOKEN=o,!0)}async addAskPassScriptToExclude(){try{if(!await this.git.checkIsRepo())return;let t=await this.git.revparse(["--path-format=absolute","--git-path","info/exclude"]),n=Fe.join(this.app.vault.configDir,"plugins","obsidian-git",Tv),i=this.getRelativeRepoPath(n,!0);(await Tn.readFile(t,"utf-8")).split(`
`).some(l=>l.contains(i))||await Tn.appendFile(t,i+`
`)}catch(t){console.error("Error while adding askpass script to exclude file:",t)}}unload(){var t;this.unloaded=!0,(t=this.askpassServer)==null||t.stop(),this.askpassServer=void 0}async status(t){var u;let n=(u=t==null?void 0:t.path)!=null?u:this.getVaultPathspec(),[i,s,o]=await Promise.all([this.git.status(n!=null?["--",n]:[]),this.getVaultPathspec()==null?0:this.countPathsOutsideVault(["diff","--cached","--name-only","--diff-filter=ACDMRT"]),this.getVaultPathspec()==null?0:this.countPathsOutsideVault(["diff","--name-only","--diff-filter=U"])]),a=i.files.map(f=>{let d=this.formatPath(f);return{path:d.path,from:d.from,index:f.index==="?"?"U":f.index,workingDir:f.working_dir==="?"?"U":f.working_dir,vaultPath:this.getRelativeVaultPath(d.path)}}),l=i.conflicted.map(f=>this.formatPath({path:f}).path),c=new Set(l);return{all:a,changed:a.filter(f=>f.workingDir!==" "&&!c.has(f.path)),staged:a.filter(f=>f.index!==" "&&f.index!="U"),conflicted:l,stagedOutsideVault:s,conflictedOutsideVault:o}}async selectAutoCommitFiles(t,n){if(n.mode==="exclude"&&n.globs.length===0)return{files:t.changed,selection:n};if(n.mode==="include"&&n.globs.length===0)return{files:[],selection:n};let i=async a=>{let l=await this.git.status(["--untracked-files=all","--",...a]),c=new Set(l.conflicted.map(u=>this.formatPath({path:u}).path));return l.files.map(u=>{let f=this.formatPath(u);return{path:f.path,from:f.from,vaultPath:this.getRelativeVaultPath(f.path),index:u.index==="?"?"U":u.index,workingDir:u.working_dir==="?"?"U":u.working_dir}}).filter(u=>u.workingDir!==" "&&!c.has(u.path))};if(n.mode==="exclude")return{files:await i([".",...n.globs.map(l=>`:(exclude,glob)${l}`)]),selection:n};let s=new Map,o=[];for(let a of n.globs){let l=await i([`:(glob)${a}`]);if(l.length!==0){o.push(a);for(let c of l)s.set(c.path,c)}}return{files:[...s.values()],selection:{mode:"include",globs:o}}}async isMergeInProgress(){let t=await this.git.revparse(["--git-path","MERGE_HEAD"]),n=Fe.resolve(this.absoluteRepoPath,t.trim());try{return await Tn.access(n),!0}catch(i){if(i instanceof Error&&"code"in i&&i.code==="ENOENT")return!1;throw i}}async submoduleAwareHeadRevisonInContainingDirectory(t){let n=this.getRelativeRepoPath(t),s=["-C",Fe.dirname(n),"rev-parse","HEAD"],o=this.git.raw(s);return o.catch(a=>console.warn("obsidian-git: rev-parse error:",a)),(await o).trim()}async getSubmodulePaths(){return new Promise(t=>{this.git.outputHandler((n,i,s,o)=>{if(!(o.contains("submodule")&&o.contains("foreach")))return;let a="",l=this.absoluteRepoPath;i.on("data",c=>{a+=c.toString("utf8")}),i.on("end",()=>{let u=a.split(`
`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+uf.sep}).filter(f=>!!f).filter(f=>{if(this.getVaultPathspec()==null)return!0;let d=this.app.vault.adapter,h=Fe.relative(Fe.resolve(d.getBasePath()),Fe.resolve(f));return!(h===".."||h.startsWith(".."+Fe.sep)||Fe.isAbsolute(h))});u.reverse(),t(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},n=>this.plugin.displayError(n))})}formatPath(t){function n(i){if(i!=null)return i.startsWith('"')&&i.endsWith('"')?i.substring(1,i.length-1):i}return t.from!=null?{from:n(t.from),path:n(t.path)}:{path:n(t.path)}}async blame(t,n,i){if(t=this.getRelativeRepoPath(t),!await this.isTracked(t))return"untracked";let s=await this.getSubmoduleOfFile(t),o=s?["-C",s.submodule]:[],a=s?s.relativeFilepath:t;o.push("blame","--porcelain"),i&&o.push("-w");let l=`-C${_h}`;switch(n){case"inactive":break;case"same-commit":o.push("-C",l);break;case"all-commits":o.push("-C","-C",l);break;default:bo(n)}o.push("--",a);let c=await this.git.raw(o);return X5(c)}async isTracked(t){let n=await this.getSubmoduleOfFile(t),i=n?["-C",n.submodule]:[],s=n?n.relativeFilepath:t;return i.push("ls-files","--",s),this.git.raw(i).then(o=>o.trim()!=="")}async commitAll({message:t,status:n,unstagedFiles:i,selection:s,amend:o}){return this.withGitOperation(2,async()=>{if(this.plugin.settings.updateSubmodules){let l=await this.getSubmodulePaths();for(let c of l)await this.git.cwd({path:c,root:!1}).add("-A"),await this.git.cwd({path:c,root:!1}).commit(await this.formatCommitMessage(t))}if((s==null?void 0:s.mode)==="include")i==null&&(s=(await this.selectAutoCommitFiles(n!=null?n:await this.status(),s)).selection),s.globs.length>0&&await this.git.add(["-A","--",...s.globs.map(l=>`:(glob)${l}`)]);else if(s!=null&&s.globs.length)await this.git.add(["-A","--",".",...s.globs.map(l=>`:(exclude,glob)${l}`)]);else{let l=this.getVaultPathspec();await this.git.add(l==null?"-A":["-A","--",l])}let a=await this.git.commit(await this.formatCommitMessage(t),o?["--amend"]:[]);return this.app.workspace.trigger("obsidian-git:head-change"),this.app.workspace.trigger("obsidian-git:refs-changed"),this.getCommittedFilesCount(a.summary.changes)})}async commit({message:t,amend:n}){return this.withGitOperation(2,async()=>{try{let i=await this.git.commit(await this.formatCommitMessage(t),n?["--amend"]:[]);return this.app.workspace.trigger("obsidian-git:head-change"),this.app.workspace.trigger("obsidian-git:refs-changed"),this.getCommittedFilesCount(i.summary.changes)}catch(i){return this.throwConflictError(i)}})}async getCommittedFilesCount(t){return t!==0?t:(await this.git.diffSummary(["HEAD^1","HEAD"])).changed}async stage(t,n){t=this.getRelativeRepoPath(t,n),await this.git.add(["--",t])}async stageAll({dir:t}){let n=t!=null?t:this.getVaultPathspec();await this.git.add(n==null?"-A":["-A","--",n])}async unstageAll({dir:t}){let n=t!=null?t:this.getVaultPathspec();await this.git.reset(n!=null?["--",n]:[])}async unstage(t,n){t=this.getRelativeRepoPath(t,n),await this.git.reset(["--",t])}async discard(t){await this.isTracked(t)&&await this.git.checkout(["--progress","--",t])}async applyPatch(t){let n=Fe.join(this.relPluginConfigPath,"patch");await this.app.vault.adapter.write(n,t),await this.git.applyPatch(n,{"--cached":null,"--unidiff-zero":null,"--whitespace":"nowarn"}),await this.app.vault.adapter.remove(n)}async getUntrackedPaths(t){var o;let n=(o=t==null?void 0:t.path)!=null?o:this.getVaultPathspec(),i=[];return n!=null&&i.push("--",n),(await this.git.clean(cf.RECURSIVE+cf.DRY_RUN,i)).paths}async hashObject(t){t=this.getRelativeRepoPath(t);let n=await this.getSubmoduleOfFile(t),i=n?["-C",n.submodule]:[],s=n?n.relativeFilepath:t;return i.push("hash-object","--",s),this.git.raw(i)}async discardAll({dir:t}){var n;return this.discard((n=t!=null?t:this.getVaultPathspec())!=null?n:".")}async pull(){return this.withGitOperation(1,async()=>{try{if(this.plugin.settings.updateSubmodules){let s=["update","--remote","--merge","--recursive"],o=this.getVaultPathspec();o!=null&&s.push("--",o),await this.git.subModule(s)}let t=await this.branchInfo();if(!t.current)throw new Error("No current branch found. Cannot pull.");let n=await this.git.revparse([t.current]);if(!t.tracking)return this.plugin.log(this.plugin.settings.updateSubmodules?"No tracking branch found. Ignoring pull of main repo and updated submodules only.":"No tracking branch found. Ignoring pull."),{status:"skipped",reason:"no-upstream"};await this.git.fetch(),this.app.workspace.trigger("obsidian-git:refs-changed");let i=await this.git.revparse([t.tracking]);if(n!==i){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{let c=[t.tracking];switch(this.plugin.settings.mergeStrategy!=="none"&&c.push(`--strategy-option=${this.plugin.settings.mergeStrategy}`),this.plugin.settings.syncMethod){case"merge":await this.git.merge(c);break;case"rebase":{this.plugin.settings.rebaseAutoStash==="enabled Line truncated
`)){let[a,l]=o.split("\0");if(!(a!=null&&a.startsWith("refs/heads/")))continue;let c=a.slice(11);s.push(c),c===t&&(i=l||void 0)}return{current:t,tracking:i,branches:s}}async getRemoteUrl(t){try{return await this.git.remote(["get-url",t])||void 0}catch(n){if(String(n).contains(t))return;throw n}}async log(t,n=!0,i,s){let o;t&&(o=this.getRelativeRepoPath(t,n));let a={file:o,maxCount:i,"--diff-merges":"first-parent","--name-status":null};return s&&(a[s]=null),(await this.git.log(a)).all.map(c=>{var u,f,d,h;return{...c,author:{name:c.author_name,email:c.author_email},refs:c.refs.split(", ").filter(p=>p.length>0),diff:{...c.diff,files:(f=(u=c.diff)==null?void 0:u.files.map(p=>{let m="from"in p?p.from:void 0;return{...p,status:"status"in p?p.status:"M",path:p.file,hash:c.hash,vaultPath:this.getRelativeVaultPath(p.file),fromPath:m,fromVaultPath:m!=null?this.getRelativeVaultPath(m):void 0,binary:p.binary}}))!=null?f:[]},fileName:(h=(d=c.diff)==null?void 0:d.files.first())==null?void 0:h.file}})}async show(t,n,i=!0){let s=this.getRelativeRepoPath(n,i);return this.git.show(["--textconv",t+":"+s])}async getLocalBranchUpstream(t){try{let i=(await this.git.raw(["rev-parse","--abbrev-ref",`${t}@{upstream}`])).trim();return i.length>0?i:void 0}catch(n){return}}getAvailableLocalBranchName(t,n,i){let s=t;if(!i.includes(s))return s;let o=`${t}-${n}`,a=o,l=0;for(;i.includes(a);)l+=1,a=`${o}-${l}`;return a}async checkout(t,n){return this.withGitOperation(5,async()=>{if(n){let i=`${n}/${t}`,s=await this.branchInfo();if(s.branches.includes(t)&&await this.getLocalBranchUpstream(t)===i)await this.git.checkout(t);else{let l=this.getAvailableLocalBranchName(t,n,s.branches);await this.git.checkout(["-b",l,i])}}else await this.git.checkout(t);if(this.plugin.settings.submoduleRecurseCheckout){let i=await this.getSubmodulePaths();for(let s of i){let o=await this.git.cwd({path:s,root:!1}).branch();Object.keys(o.branches).includes(t)&&await this.git.cwd({path:s,root:!1}).checkout(t)}}this.app.workspace.trigger("obsidian-git:refs-changed")})}async createBranch(t){await this.git.checkout(["-b",t]),this.app.workspace.trigger("obsidian-git:refs-changed")}async deleteBranch(t,n){await this.git.branch([n?"-D":"-d",t]),this.app.workspace.trigger("obsidian-git:refs-changed")}async branchIsMerged(t){return!(await this.git.branch(["--no-merged"])).all.contains(t)}async init(){await this.git.init(!1)}async clone(t,n,i){await this.git.clone(t,Fe.join(this.app.vault.adapter.getBasePath(),n),i?["--depth",`${i}`]:[]),await this.setGitInstance()}async setConfig(t,n){n==null?await this.getConfig(t,"local")!==void 0&&await this.git.raw(["config","--local","--unset-all",t]):await this.git.addConfig(t,n,!1,"local")}async getConfig(t,n="local"){var s;return(s=(await this.git.getConfig(t.toLowerCase(),n=="all"?void 0:n)).value)!=null?s:void 0}async fetch(t){return this.withGitOperation(4,async()=>{await this.git.fetch(t!=null?[t]:[]),this.app.workspace.trigger("obsidian-git:refs-changed")})}async setRemote(t,n){(await this.getRemotes()).includes(t)?await this.git.remote(["set-url",t,n]):await this.git.remote(["add",t,n])}async getRemoteBranches(t){let n=await this.git.branch(["-r","--list",`${t}*`]),i=[];for(let s in n.branches)i.push(n.branches[s].name);return i}async getRemotes(){let t=await this.git.remote([]);return t?t.trim().split(`
`):[]}async removeRemote(t){await this.git.removeRemote(t),this.app.workspace.trigger("obsidian-git:refs-changed")}async updateUpstreamBranch(t){try{await this.git.branch(["--set-upstream-to",t])}catch(n){try{await this.git.branch(["--set-upstream",t])}catch(i){let[s,o]=yo(t),a=await this.branchInfo();await this.git.push(["--set-upstream",s,`${a.current}:${o}`]),this.app.workspace.trigger("obsidian-git:refs-changed")}}}updateGitPath(t){return this.setGitInstance()}updateBasePath(t){return this.setGitInstance(!0)}async getDiffString(t,n=!1,i){return n?await this.git.diff(["--cached","--",t]):i?await this.git.show([`${i}`,"--",t]):await this.git.diff(["--",t])}async diff(t,n,i){return await this.git.diff([`${n}..${i}`,"--",t])}async rawCommand(t){let n=t.split(" "),i=n[0];if(i===void 0)return"";let s=await this.git.raw(i,...n.slice(1));return this.app.workspace.trigger("obsidian-git:refs-changed"),s}async getSubmoduleOfFile(t){if(!await this.app.vault.adapter.exists(Fe.dirname(t)))return;let n=await this.git.raw(["-C",Fe.dirname(t),"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",Fe.dirname(t),"rev-parse","--show-superproject-working-tree"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message))).trim()==="")return;let o=this.app.vault.adapter.getFullPath(Fe.normalize(t)),a=Fe.relative(n,o);return{submodule:n,relativeFilepath:a}}async getLastCommitTime(){try{let t=await this.git.log({n:1});if(t!=null&&t.latest!=null)return new Date(t.latest.date)}catch(t){if(t instanceof vr){if(t.message.contains("does not have any commits yet"))return}else throw t}}async isGitInstalled(){let t=this.plugin.localStorage.getGitPath(),n=await rf(t||"git",["--version"],{});if(n.error)if(Eo.Platform.isWin&&!t){this.plugin.log(`Git not found in PATH. Checking standard installation path(${xh}) of Git for Windows.`);let i=await rf(xh,["--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(t){if(t instanceof vr){let n=String(t.message);if(n.contains("Could not resolve host")||n.contains("Unable to resolve host")||n.contains("Unable to open connection")||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 Hl(n)}throw t}async isFileTrackedByLFS(t){try{return(await this.git.raw(["check-attr","filter",t])).includes("filter: lfs")}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(`Error checking LFS status: ${i}`)}}},c$={hash:"000000",isZeroCommit:!0,summary:""};function X5(r){let t=r.replaceAll(`\r
`,`
`).split(`
`),n={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},i=1;for(let s=0;s<t.length;){let o=t[s];if(o$(o)){let a=o.split(" "),l=Q5(a,i,n);for(s++;o$(t[s]);s++){let c=t[s].split(" ");J5(c,n,i)}ej(n.commits.get(l)),i+=1}else if(!(o===""&&s===t.length-1))throw Error(`Expected non-whitespace line or EOF, but found: ${o}`);s++}return n}function Q5(r,e,t){let n=r[0],i=r[1],s=r[2];if(n===void 0||i===void 0||s===void 0)throw Error(`Invalid git-blame line info: ${r.join(" ")}`);if(t.hashPerLine.push(n),t.originalFileLineNrPerLine.push(parseInt(i)),t.finalFileLineNrPerLine.push(parseInt(s)),r.length>=4&&t.groupSizePerStartingLine.set(e,parseInt(r[3])),parseInt(s)!==e)throw Error(`git-blame output is out of order: ${e} vs ${s}`);return n}function J5(r,e,t){let n=r[0],i=r.slice(1).join(" "),s=e.hashPerLine[t];if(s===void 0)throw Error(`No commit hash found for git-blame line ${t}`);let o=e.commits.get(s)||{hash:s,author:{},committer:{},previous:{}};switch(n){case"summary":o.summary=i;break;case"author":o.author.name=i;break;case"author-mail":o.author.email=a$(i);break;case"author-time":o.author.epochSeconds=parseInt(i);break;case"author-tz":o.author.tz=i;break;case"committer":o.committer.name=i;break;case"committer-mail":o.committer.email=a$(i);break;case"committer-time":o.committer.epochSeconds=parseInt(i);break;case"committer-tz":o.committer.tz=i;break;case"previous":o.previous.commitHash=i;break;case"filename":o.previous.filename=i;break;case void 0:break}e.commits.set(s,o)}function ej(r){if(r.summary===void 0)throw Error(`Summary not provided for commit: ${r.hash}`);xb(r.author)&&(r.author=void 0),xb(r.committer)&&(r.committer=void 0),xb(r.previous)&&(r.previous=void 0),r.isZeroCommit=!!r.hash.match(/^0*$/)}function xb(r){return!r||Object.keys(r).length===0}function o$(r){return r===void 0?!1:r.length>0&&r[0].trim()===r[0]}function a$(r){let e=r.startsWith("<")?r.substring(1):r;return e.endsWith(">")?e.substring(0,e.length-1):e}g();var N$=require("@codemirror/state");g();var Eb=class{constructor(){this.eventsPerFilepath=new Map;this.init()}ifFilepathDefinedTransformSubscribers(e,t){if(e)return this.ensureInitialized(e),t(this.eventsPerFilepath.get(e))}forEachSubscriber(e){this.eventsPerFilepath.forEach(t=>t.forEach(e))}ensureInitialized(e){this.eventsPerFilepath.get(e)||this.eventsPerFilepath.set(e,new Set)}init(){this.removeStalesSubscribersTimer===void 0&&this.startRemoveStalesSubscribersInterval()}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(e=>e==null?void 0:e.removeIfStale()),6e4)}clear(){this.removeStalesSubscribersTimer!==void 0&&(window.clearInterval(this.removeStalesSubscribersTimer),this.removeStalesSubscribersTimer=void 0),this.eventsPerFilepath.clear()}},Jn=new Eb;g();var fp=require("@codemirror/state");g();g();g();var tj="input is invalid type",u$="finalize already called",rj=typeof ArrayBuffer!="undefined",Sb=function(r){var e=typeof r;if(e==="string")return[r,!0];if(Array.isArray(r))return[r,!1];if(rj&&r){if(r.constructor===ArrayBuffer)return[new Uint8Array(r),!1];if(ArrayBuffer.isView(r))return[r,!1]}throw new Error(tj)};var ne="0123456789abcdef".split(""),nj=[-2147483648,8388608,32768,128],_i=[24,16,8,0],ap=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],lp=["hex","array","digest","arrayBuffer"],ar=[],f$=function(r,e){return function(t){return new lr(e,!0).update(t)[r]()}},h$=function(r){var e=f$("hex",r);e.create=function(){return new lr(r)},e.update=function(i){return e.create().update(i)};for(var t=0;t<lp.length;++t){var n=lp[t];e[n]=f$(n,r)}return e},d$=function(r,e){return function(t,n){return new cp(t,e,!0).update(n)[r]()}},p$=function(r){var e=d$("hex",r);e.create=function(i){return new cp(i,r)},e.update=function(i,s){return e.create(i).update(s)};for(var t=0;t<lp.length;++t){var n=lp[t];e[n]=d$(n,r)}return e};function lr(r,e){e?(ar[0]=ar[16]=ar[1]=ar[2]=ar[3]=ar[4]=ar[5]=ar[6]=ar[7]=ar[8]=ar[9]=ar[10]=ar[11]=ar[12]=ar[13]=ar[14]=ar[15]=0,this.blocks=ar):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=31441 Line truncated
**/*.tmp`}},this.toggle(`Specify custom commit message on auto ${s}`,"customMessageOnAutoBackup","Shows a prompt to specify your message."),{name:`Commit message on auto ${s}`,desc:"Placeholders: {{date}}, {{hostname}}, {{numFiles}}, and {{files}}.",control:{type:"textarea",key:"autoCommitMessage",defaultValue:en.autoCommitMessage,disabled:()=>this.settings.customMessageOnAutoBackup}}]},{type:"page",name:"Commit",desc:"Commit messages and placeholders.",visible:t,items:[this.toggle("Stage all changes when nothing is staged","autoStageOnEmptyIndex","When using Commit with nothing staged, stage and commit all changes. Commit all changes and Commit-and-sync are unaffected."),{name:"Commit message on manual commit",desc:"Placeholders: {{date}}, {{hostname}}, {{numFiles}}, and {{files}}. Leave empty to require manual input.",render:o=>{o.addTextArea(a=>{a.setValue(this.settings.commitMessage),a.onChange(async l=>{this.settings.commitMessage=l,await this.plugin.saveSettings()}),o.addButton(l=>l.setIcon("reset").setTooltip(`Set to default: "${en.commitMessage}"`).onClick(()=>{a.setValue(en.commitMessage),a.onChanged()}))})}},{name:"Commit message script",desc:"Run with 'sh -c' to generate a commit message. Placeholders: {{hostname}}, {{date}}.",visible:()=>Ve.Platform.isDesktopApp,control:{type:"text",key:"commitMessageScript"}},{name:"{{date}} placeholder format",render:o=>{o.addMomentFormat(a=>a.setDefaultFormat(this.settings.commitDateFormat).setValue(this.settings.commitDateFormat).onChange(async l=>{await this.setControlValue("commitDateFormat",l)})),o.descEl.createSpan({text:`Example: ${Cv}. See `}),o.descEl.createEl("a",{text:"Moment.js documentation",href:H$,attr:{target:"_blank"}}),o.descEl.createSpan({text:" for more formats."})}},{name:"{{hostname}} placeholder replacement",desc:"Set a hostname for this device. Defaults to the OS hostname on desktop.",render:o=>{o.addText(a=>{var l;return a.setValue((l=this.plugin.localStorage.getHostname())!=null?l:"").onChange(c=>this.plugin.localStorage.setHostname(c))})}},{name:"Preview commit message",render:o=>{o.addButton(a=>a.setButtonText("Preview").onClick(async()=>{let l=await this.plugin.gitManager.formatCommitMessage(this.settings.commitMessage);new Ve.Notice(l)}))}},this.toggle("List filenames affected by commit in the commit body","listChangedFilesInMessageBody")]},{type:"page",name:"Sync",desc:"Pull, merge, and commit-and-sync behavior.",visible:t,items:[{type:"group",heading:"Pull",items:[{...this.dropdown("Merge strategy","syncMethod",{merge:"Merge",rebase:"Rebase",reset:"Other sync service (update HEAD only)"},"How to integrate remote commits."),visible:n},{...this.dropdown("Auto-stash changes when rebasing","rebaseAutoStash",{enabled:"Enabled",disabled:"Disabled","git-config":"Use Git configuration"},"Stash local changes before rebasing and restore them afterward. Restoring may produce conflicts."),visible:()=>n()&&this.settings.syncMethod==="rebase"},this.dropdown("Merge strategy on conflicts","mergeStrategy",{none:"None (Git default)",ours:"Our changes",theirs:"Their changes"},"Choose which side to favor when pulling remote changes."),this.toggle("Pull on startup","autoPullOnBoot","Automatically pull commits when Obsidian starts.")]},{type:"group",heading:"Commit-and-sync",items:[{name:"Push on commit-and-sync",desc:"Push after committing. Disabling turns commit-and-sync into a local commit, with an optional pull.",render:o=>{o.addToggle(a=>a.setValue(!this.settings.disablePush).onChange(async l=>{this.settings.disablePush=!l,await this.plugin.saveSettings(),this.refreshDomState()}))}},this.toggle("Pull on commit-and-sync","pullBeforePush","Pull commits as part of commit-and-sync."),{...this.toggle("Squash commits before push","squashCommitsBeforePush","Combine local unpushed commits into one before pushing. No force-push is needed."),visible:n}]}]},{type:"page",name:"Editor",desc:"Merge conflict resolution, hunk controls, and line author information.",visible:t,items:[this.dropdown("Show merge conflict resolution","conflictResolutionMode",{both:"Both editing modes","live-preview":"Live Preview only",source:"Source mode only",disabled:"Disabled"},"Choose where conflict highlights and resolution buttons appear."),{type:"group",heading:"Hunk management",visible:n,items:[this.toggle("Signs","hunks.showSigns","Show colored change markers in the editor and stage, reset, or preview hunks."),this.toggle("Hunk commands","hunks.hunkCommands","Commands to stage and reset hunks and navigate between them."),this.dropdown("Show line changes in the status bar","hunks.statusBar",{disabled:"Disabled",colored:"Colored",monochrome:"Monochrome"})]},{type:"page",name:"Line author information",desc:"Commit hash, author, date, and age coloring next to each line.",visible:n,page:()=>new Mb(this)}]},{type:"page",name:"Views",desc:"History, source control, and diff views.",items:[{type:"group",heading:"Source control view",items:[this.toggle("Automatically refresh source Line truncated
`)).onChange(l=>this.plugin.localStorage.setEnvVars(l.split(`
`))))}},{name:"Additional PATH environment variable paths",desc:"One path per line.",visible:n,render:o=>{o.addTextArea(a=>a.setValue(this.plugin.localStorage.getPATHPaths().join(`
`)).onChange(l=>this.plugin.localStorage.setPATHPaths(l.split(`
`))))}},{name:"Reload with new environment variables",desc:"Removing previous variables requires an Obsidian restart.",visible:n,render:o=>{o.addButton(a=>a.setButtonText("Reload").setCta().onClick(async()=>this.plugin.reloadGitManager()))}},{name:"Repository folder within the vault",desc:"Choose the folder containing the Git repository. Leave empty when the repository is at the root.",control:{type:"folder",key:"basePath",includeRoot:!1,validate:o=>{if(o!==""){if(o=="/")return"Leave empty when the repository is at the root.";if(!this.app.vault.getFolderByPath(o))return"Choose an existing folder in this vault."}}}},{name:"Custom Git directory path (instead of .git)",desc:"Resolved from the custom base path or vault root. Restart Obsidian to apply. Use backslashes on Windows.",control:{type:"text",key:"gitDir",placeholder:".git"}},{name:"Disable on this device",desc:"This setting is not synced.",render:o=>{o.addToggle(a=>a.setValue(this.plugin.localStorage.getPluginDisabled()).onChange(l=>{this.plugin.localStorage.setPluginDisabled(l),l?this.plugin.unloadPlugin():this.plugin.init({fromReload:!0}).catch(c=>this.plugin.displayError(c)),new Ve.Notice("Obsidian must be restarted for the change to take effect.")}))}},{type:"group",heading:"Debugging",items:[{name:"Copy debug information",desc:"May contain sensitive settings.",render:o=>{o.addButton(a=>a.setButtonText("Copy").onClick(async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.settings,pluginVersion:this.plugin.manifest.version},null,4)),new Ve.Notice("Debug information copied to clipboard. May contain sensitive information!")}))}},{name:"Debugging and logging",desc:Ve.Platform.isDesktopApp?`Open the developer console with ${Ve.Platform.isMacOS?"CMD (\u2318) + OPTION (\u2325) + I":"CTRL + SHIFT + I"}.`:"",visible:()=>Ve.Platform.isDesktopApp}]}]},{heading:"Support",type:"group",items:[{name:"Donate",desc:"Support continued development of the plugin.",render:o=>{o.addButton(a=>{var c;let l=(c=a.buttonEl.parentElement)==null?void 0:c.createEl("a",{href:"https://ko-fi.com/F1F195IQ5",attr:{target:"_blank"}});l==null||l.createEl("img",{attr:{height:"36",style:"border:0px;height:36px;",src:"https://cdn.ko-fi.com/cdn/kofi3.png?v=3",border:"0",alt:"Buy Me a Coffee at ko-fi.com"}}),a.buttonEl.remove()})}}]}]}configureLineAuthorShowStatus(t){this.settings.lineAuthor.show=t,this.plugin.saveSettings(),t?this.plugin.editorIntegration.activateLineAuthoring():this.plugin.editorIntegration.deactiveLineAuthoring()}async lineAuthorSettingHandler(t,n){this.settings.lineAuthor[t]=n,await this.plugin.saveSettings(),this.plugin.editorIntegration.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let t=this.settings.lineAuthor;t.authorDisplay!=="hide"&&(t.lastShownAuthorDisplay=t.authorDisplay),t.dateTimeFormatOptions!=="hide"&&(t.lastShownDateTimeFormatOptions=t.dateTimeFormatOptions)}renderLineAuthorSettings(t){t.empty(),this.lineAuthorColorSettings.clear();let n=new Ve.Setting(t).setName("Show commit authoring information next to each line");if(this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform()||n.setDesc("Only available on desktop currently.").setDisabled(!0),n.descEl.createEl("a",{href:yj,text:"Feature guide and quick examples",attr:{target:"_blank"}}),n.descEl.createEl("br"),n.descEl.createSpan({text:" The commit hash, author name and authoring date can all be individually toggled."}),n.descEl.createEl("br"),n.descEl.createSpan({text:"Hide everything, to only show the age-colored sidebar."}),n.addToggle(i=>i.setValue(this.settings.lineAuthor.show).onChange(s=>{this.configureLineAuthorShowStatus(s),this.refreshLineAuthorPage(t)})),this.settings.lineAuthor.show){let i=new Ve.Setting(t).setName("Follow movement and copies across files and commits").addDropdown(c=>{c.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),c.setValue(this.settings.lineAuthor.followMovement),c.onChange(u=>this.lineAuthorSettingHandler("followMovement",u))});if(i.descEl.createSpan({text:"By default (deactivated), each line only shows the newest commit where it was changed."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"With "}),i.descEl.createEl("i",{text:"same commit"}),i.descEl.createSpan({text:", cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"With "}),i.descEl.createEl("i",{text:"all commits"}),i.descEl.createSpan({text:", cut-copy-paste-ing text inbetween multiple commits will be detected."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"It uses "}),i.descEl.createEl("a",{href:"https://git-scm.com/docs/git-blame",text:"git-blame",attr:{target:"_blank"}}),i.descEl.createSpan({text:` and for matches (at least ${_h} characters) within the same (or all) commit(s), `}),i.descEl.createEl("em",{text:"th Line truncated
Either your local time-zone (default),
the author's time-zone during commit creation or
`}),s.descEl.createEl("a",{text:"UTC\xB100:00",href:"https://en.wikipedia.org/wiki/UTC%C2%B100:00"}),s.descEl.createSpan({text:"."});let o=new Ve.Setting(t).setName("Oldest age in coloring");this.setOldestAgeDescription(o.descEl,this.settings.lineAuthor.coloringMaxAge),o.addText(c=>{c.setPlaceholder("1y"),c.setValue(this.settings.lineAuthor.coloringMaxAge),c.onChange(async u=>{let d=ff(u)!==void 0;this.setOldestAgeDescription(o.descEl,u),d&&(await this.lineAuthorSettingHandler("coloringMaxAge",u),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest",t),this.createColorSetting("oldest",t);let a=new Ve.Setting(t).setName("Text color").addText(c=>{c.setValue(this.settings.lineAuthor.textColorCss),c.onChange(async u=>{await this.lineAuthorSettingHandler("textColorCss",u)})});a.descEl.empty(),a.descEl.createSpan({text:"The CSS color of the gutter text."}),a.descEl.createEl("br"),a.descEl.createEl("br"),a.descEl.createSpan({text:"It is highly recommended to use "}),a.descEl.createEl("a",{text:"CSS variables",href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties"}),a.descEl.createSpan({text:" defined by themes (e.g. "}),a.descEl.createEl("pre",{text:"var(--text-muted)",attr:{style:"display:inline"}}),a.descEl.createSpan({text:" or "}),a.descEl.createEl("pre",{text:"var(--text-on-accent)",attr:{style:"display:inline"}}),a.descEl.createSpan({text:"), because they automatically adapt to theme changes."}),a.descEl.createEl("br"),a.descEl.createEl("br"),a.descEl.createSpan({text:"See: "}),a.descEl.createEl("a",{text:"List of available CSS variables in Obsidian",href:"https://github.com/obsidian-community/obsidian-theme-template/blob/main/obsidian.css"});let l=new Ve.Setting(t).setName("Ignore whitespace and newlines in changes").addToggle(c=>{c.setValue(this.settings.lineAuthor.ignoreWhitespace),c.onChange(u=>this.lineAuthorSettingHandler("ignoreWhitespace",u))});l.descEl.empty(),l.descEl.createSpan({text:"Whitespace and newlines are interpreted as part of the document and in changes by default (hence not ignored). This makes the last line being shown as 'changed' when a new subsequent line is added, even if the previously last line's text is the same."}),l.descEl.createEl("br"),l.descEl.createSpan({text:"If you don't care about purely-whitespace changes (e.g. list nesting / quote indentation changes), then activating this will provide more meaningful change detection."})}}createColorSetting(t,n){let i=new Ve.Setting(n).setName("").addText(s=>{let o=Fb(t,this.settings.lineAuthor),a=Fb(t,en.lineAuthor);s.setPlaceholder(M0(a)),s.setValue(M0(o)),s.onChange(async l=>{let c=TT(l);if(c!==void 0){let u=t==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(u,c)}this.refreshColorSettingsDesc(t,c)})});this.lineAuthorColorSettings.set(t,i),this.refreshColorSettingsName(t),this.refreshColorSettingsDesc(t,Fb(t,this.settings.lineAuthor))}refreshColorSettingsName(t){let n=this.lineAuthorColorSettings.get(t);if(n){let i=t==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";n.nameEl.setText(`Color for ${i} commits`)}}refreshColorSettingsDesc(t,n){let i=this.lineAuthorColorSettings.get(t);i&&this.colorSettingPreviewDesc(i.descEl,t,this.settings.lineAuthor,n!==void 0)}colorSettingPreviewDesc(t,n,i,s){t.empty(),t.createSpan({text:"Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and named colors (e.g. 'black', 'purple'). Color preview: "});let o=s?yp(n,i):"rgba(127,127,127,0.3)",a=Ve.moment.unix(Ve.moment.now()/1e3).format("YYYY-MM-DD"),l=s?`abcdef Author Name ${a}`:"invalid color";t.createDiv({text:l,cls:"line-author-settings-preview",attr:{style:`background-color: ${o}; width: 30ch;`}})}setCustomDateTimeDescription(t,n){t.empty(),t.createEl("a",{text:"Format string",href:H$}),t.createSpan({text:" to display the authoring date."}),t.createEl("br");let i=(0,Ve.moment)().format(n);t.createSpan({text:`Currently: ${i}`})}setOldestAgeDescription(t,n){let i=ff(n),s=i!==void 0?`${i.asDays()} days`:"invalid!";t.empty(),t.createSpan({text:`The oldest age in the line author coloring. Everything older will have the same color.
Smallest valid age is "1d". Currently: ${s}`})}refreshLineAuthorPage(t){window.clearTimeout(this.lineAuthorRefreshTimer),this.lineAuthorRefreshTimer=window.setTimeout(()=>{this.lineAuthorRefreshTimer=void 0,t.isConnected&&this.renderLineAuthorSettings(t)},80)}cancelLineAuthorRefresh(){window.clearTimeout(this.lineAuthorRefreshTimer),this.lineAuthorRefreshTimer=void 0,this.lineAuthorColorSettings.clear()}},Mb=class extends Ve.SettingPage{constructor(t){super();this.tab=t;this.title="Line author information"}display(){this.tab.renderLineAuthorSettings(this.containerEl)}hide(){this.tab.cancelLineAuthorRefresh(),super.hide()}};function Fb(r,e){return r==="oldest"?e.colorOld:e.colorNew}function ff(r){let e=Ve.moment.duration("P"+r.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}g();var Lr=require("obsidian");var Ep=class{constructor(e,t){this.statusBarEl=e;this.plugin=t;this.messages=[];this.currentMessage=null;this.lastMessageTimestamp=null;this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),t.registerEvent(t.app.workspace.on("obsidian-git:refreshed",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(e,t){this.messages.push({message:`Git: ${e.slice(0,100)}`,timeout:t}),this.display()}displayProgress(e){this.progress=e,this.display()}clearProgress(e=!0){this.progress=void 0,e&&this.display()}display(){this.progress?this.displayState():this.messages.length>0&&!this.currentMessage?(this.currentMessage=this.messages.shift(),this.statusBarEl.addClass(this.base+"message"),this.statusBarEl.ariaLabel="",this.statusBarEl.setText(this.currentMessage.message),this.lastMessageTimestamp=Date.now()):this.currentMessage?Date.now()-this.lastMessageTimestamp>=this.currentMessage.timeout&&(this.currentMessage=null,this.lastMessageTimestamp=null):this.displayState()}displayState(){if((this.statusBarEl.getText().length>3||!this.statusBarEl.hasChildNodes())&&(this.statusBarEl.empty(),this.conflictEl=this.statusBarEl.createDiv({cls:this.base+"conflict-indicator"}),this.conflictEl.setAttribute("data-tooltip-position","top"),this.conflictEl.setAttribute("role","button"),this.conflictEl.onclick=()=>this.plugin.openMergeConflictHelp(),this.conflictEl.onkeydown=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.plugin.openMergeConflictHelp())},this.pausedEl=this.statusBarEl.createDiv({cls:this.base+"paused-indicator"}),this.pausedEl.setAttribute("data-tooltip-position","top"),this.iconEl=this.statusBarEl.createDiv({cls:this.base+"icon"}),this.textEl=this.statusBarEl.createDiv({cls:this.base+"text"})),this.plugin.state.mergeInProgress?((0,Lr.setIcon)(this.conflictEl,"git-merge"),this.conflictEl.ariaLabel="Merge in progress. Select for help resolving and finishing the merge.",this.conflictEl.tabIndex=0,this.conflictEl.addClass(this.base+"conflict")):(this.conflictEl.empty(),this.conflictEl.tabIndex=-1,this.conflictEl.removeClass(this.base+"conflict")),this.plugin.localStorage.getPausedAutomatics()?((0,Lr.setIcon)(this.pausedEl,"pause-circle"),this.pausedEl.ariaLabel="Automatic routines are currently paused.",this.pausedEl.addClass(this.base+"paused")):(this.pausedEl.empty(),this.pausedEl.removeClass(this.base+"paused")),this.progress){this.statusBarEl.ariaLabel=this.getProgressTooltip("Git operation in progress..."),(0,Lr.setIcon)(this.iconEl,this.getProgressIcon()),this.displayProgressText(),this.statusBarEl.addClass(this.base+"progress"),this.addMergeHelpToTooltip();return}switch(this.plugin.state.operation){case 0:this.displayFromNow();break;case 2:this.statusBarEl.ariaLabel="Committing changes...",(0,Lr.setIcon)(this.iconEl,"git-commit"),this.textEl.empty(),this.statusBarEl.addClass(this.base+"commit");break;case 3:this.statusBarEl.ariaLabel=this.getProgressTooltip("Pushing changes..."),(0,Lr.setIcon)(this.iconEl,"upload"),this.displayProgressText(),this.statusBarEl.addClass(this.base+"push");break;case 1:this.statusBarEl.ariaLabel=this.getProgressTooltip("Pulling changes..."),(0,Lr.setIcon)(this.iconEl,"download"),this.displayProgressText(),this.statusBarEl.addClass(this.base+"pull");break;case 4:this.statusBarEl.ariaLabel=this.getProgressTooltip("Fetching from remote..."),(0,Lr.setIcon)(this.iconEl,"download"),this.displayProgressText(),this.statusBarEl.addClass(this.base+"fetch");break;case 5:this.statusBarEl.ariaLabel=this.getProgressTooltip("Checking out branch..."),(0,Lr.setIcon)(this.iconEl,"git-branch"),this.displayProgressText(),this.statusBarEl.addClass(this.base+"checkout");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,Lr.setIcon)(this.iconEl,"alert-triangle"),this.textEl.empty(),this.statusBarEl.addClass(this.base+"failed-init");break}this.addMergeHelpToTooltip()}addMergeHelpToTooltip(){if(!this.plugin.state.mergeInProgress)return;let e="Merge in progress. Select the merge icon for help resolving and finishing it.",t=this.statusBarEl.ariaLabel;this.statusBarEl.ariaLabel=t?`${e}
${t}`:e}displayProgressText(){this.progress?this.textEl.setText(this.getCompactProgressText()):this.textEl.empty()}getProgressTooltip(e){if(!this.progress)return e;let t=this.progress.stage?`${this.progress.stage}: `:"";if(this.progress.progress===void 0)return this.progress.stage?`${this.progress.action}: ${this.progress.stage}...`:`${this.progress.action}...`;let n=this.progress.processed!==void 0&&this.progress.total!==void 0?` (${this.progress.processed}/${this.progress.total})`:"";return`${this.progress.action}: ${t}${Math.round(this.progress.progress)}%${n}`}getCompactProgressText(){return this.progress?this.progress.progress===void 0?`${this.progress.action}...`:`${this.progress.action} ${Math.round(this.progress.progress)}%`:""}getProgressIcon(){var e;switch((e=this.progress)==null?void 0:e.action){case"Fetching":case"Pulling":return"download";case"Pushing":return"upload";case"Checking out":return"git-branch";default:return"git-pull-request"}}displayFromNow(){var n;if(!this.plugin.gitReady){this.statusBarEl.ariaLabel="Git is not ready",(0,Lr.setIcon)(this.iconEl,"alert-triangle"),this.textEl.empty(),this.statusBarEl.addClass(this.base+"failed-init");return}let e=this.lastCommitTimestamp,t=this.plugin.state.offlineMode;if(e){let i=(0,Lr.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${t?"Offline: ":""}Last Commit: ${i}`,((n=this.unPushedCommits)!=null?n:0)>0&&(this.statusBarEl.ariaLabel+=`
(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=t?"Git is offline":"Git is ready";t?(0,Lr.setIcon)(this.iconEl,"globe"):(0,Lr.setIcon)(this.iconEl,"check"),this.plugin.settings.changedFilesInStatusBar&&this.plugin.cachedStatus?this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()):this.textEl.empty(),this.statusBarEl.addClass(this.base+"idle")}async refreshCommitTimestamp(){this.lastCommitTimestamp=await this.plugin.gitManager.getLastCommitTime(),this.unPushedCommits=await this.plugin.getUnpushedCommits()}remove(){this.statusBarEl.remove()}};g();var G$=require("obsidian"),hf=class{constructor(e){this.plugin=e}saveLastAuto(e,t){t==="backup"?this.plugin.localStorage.setLastAutoBackup(e.toString()):t==="pull"?this.plugin.localStorage.setLastAutoPull(e.toString()):t==="push"&&this.plugin.localStorage.setLastAutoPush(e.toString())}loadLastAuto(){var e,t,n;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((t=this.plugin.localStorage.getLastAutoPull())!=null?t:""),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 t=this.diff(this.plugin.settings.autoPushInterval,e.push);this.startAutoPush(t)}if(this.plugin.settings.autoPullInterval>0){let t=this.diff(this.plugin.settings.autoPullInterval,e.pull);this.startAutoPull(t)}}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 t=this.diff(this.plugin.settings.autoSaveInterval,e.backup);this.startAutoCommitAndSync(t)}}}get isAutomaticsDisabled(){return!this.plugin.gitReady||this.plugin.localStorage.getPausedAutomatics()}startAutoCommitAndSync(e){var t,n;if(!this.isAutomaticsDisabled)if(this.plugin.settings.autoBackupAfterFileChange)e===0?this.doAutoCommitAndSync():(n=(t=this.plugin).autoCommitDebouncer)!=null||(t.autoCommitDebouncer=(0,G$.debounce)(()=>this.doAutoCommitAndSync(),this.plugin.settings.autoSaveInterval*6e4,!0));else{let i=(e!=null?e:this.plugin.settings.autoSaveInterval)*6e4;i>2147483647&&(i=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),i)}}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(async()=>{if(this.plugin.settings.setLastSaveToLastCommit){let e=await this.plugin.gitManager.getLastCommitTime();if(e){this.saveLastAuto(e,"backup");let t=this.diff(this.plugin.settings.autoSaveInterval,e);if(t>0)return this.startAutoCommitAndSync(t),!1}}return this.plugin.settings.differentIntervalCommitAndPush?await this.plugin.gitActions.commit({fromAuto:!0,mode:"all"}):await this.plugin.gitActions.commitAndSync({fromAutoBackup:!0,mode:"all"}),!0},e=>{e!==!1&&(this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync())})}startAutoPull(e){if(this.isAutomaticsDisabled)return;let t=(e!=null?e:this.plugin.settings.autoPullInterval)*6e4;t>2147483647&&(t=2147483647),this.timeoutIDPull=window.setTimeout(()=>this.doAutoPull(),t)}doAutoPull(){this.plugin.promiseQueue.addTask(()=>this.plugin.gitActions.pullChangesFromRemote(),()=>{this.saveLastAuto(new Date,"pull"),this.startAutoPull()})}startAutoPush(e){if(this.isAutomaticsDisabled)return;let t=(e!=null?e:this.plugin.settings.autoPushInterval)*6e4;t>2147483647&&(t=2147483647),this.timeoutIDPush=window.setTimeout(()=>this.doAutoPush(),t)}doAutoPush(){this.plugin.promiseQueue.addTask(()=>this.plugin.gitActions.push(),()=>{this.saveLastAuto(new Date,"push"),this.startAutoPush()})}clearAutoCommitAndSync(){var t;let e=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,e=!0),this.plugin.autoCommitDebouncer&&((t=this.plugin.autoCommitDebouncer)==null||t.cancel(),this.plugin.autoCommitDebouncer=void 0,e=!0),e}clearAutoPull(){return this.timeoutIDPull?(window.clearTimeout(this.timeoutIDPull),this.timeoutIDPull=void 0,!0):!1}clearAutoPush(){return this.timeoutIDPush?(window.clearTimeout(this.timeoutIDPush),this Line truncated
`)}static newName(){let e=q$[W$]||1;return q$[W$]=e+1,"\u037C"+e.toString(36)}static mount(e,t,n){let i=e[Db],s=n&&n.nonce;i?s&&i.setNonce(s):i=new Lb(e,s),i.mount(Array.isArray(t)?t:[t],e)}},Y$=new Map,Lb=class{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=Y$.get(n);if(s)return e[Db]=s;this.sheet=new i.CSSStyleSheet,Y$.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Db]=this}mount(e,t){let n=this.sheet,i=0,s=0,o=!1;for(let a=0;a<e.length;a++){let l=e[a],c=this.modules.indexOf(l);if(c<s&&c>-1&&(this.modules.splice(c,1),o=!0,s--,c=-1),c==-1){if(this.modules.splice(s++,0,l),o=!0,n)for(let u=0;u<l.rules.length;u++)n.insertRule(l.rules[u],i++)}else{for(;s<c;)i+=this.modules[s++].rules.length;i+=l.rules.length,s++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{if(o){let l="";for(let c=0;c<this.modules.length;c++)l+=this.modules[c].getRules()+`
`;this.styleTag.textContent=l}let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var dP=require("@codemirror/language"),Ej=require("@lezer/highlight"),Ut=class r{constructor(e,t,n,i){this.fromA=e,this.toA=t,this.fromB=n,this.toB=i}offset(e,t=e){return new r(this.fromA+e,this.toA+e,this.fromB+t,this.toB+t)}};function ma(r,e,t,n,i,s){if(r==n)return[];let o=Vb(r,e,t,n,i,s),a=Wb(r,e+o,t,n,i+o,s);e+=o,t-=a,i+=o,s-=a;let l=t-e,c=s-i;if(!l||!c)return[new Ut(e,t,i,s)];if(l>c){let f=r.slice(e,t).indexOf(n.slice(i,s));if(f>-1)return[new Ut(e,e+f,i,i),new Ut(e+f+c,t,s,s)]}else if(c>l){let f=n.slice(i,s).indexOf(r.slice(e,t));if(f>-1)return[new Ut(e,e,i,i+f),new Ut(t,t,i+f+l,s)]}if(l==1||c==1)return[new Ut(e,t,i,s)];let u=pP(r,e,t,n,i,s);if(u){let[f,d,h]=u;return ma(r,e,f,n,i,d).concat(ma(r,f+h,t,n,d+h,s))}return Sj(r,e,t,n,i,s)}var mf=1e9,gf=0,zb=!1;function Sj(r,e,t,n,i,s){let o=t-e,a=s-i;if(mf<1e9&&Math.min(o,a)>mf*16||gf>0&&Date.now()>gf)return Math.min(o,a)>mf*64?[new Ut(e,t,i,s)]:K$(r,e,t,n,i,s);let l=Math.ceil((o+a)/2);Nb.reset(l),Bb.reset(l);let c=(h,p)=>r.charCodeAt(e+h)==n.charCodeAt(i+p),u=(h,p)=>r.charCodeAt(t-h-1)==n.charCodeAt(s-p-1),f=(o-a)%2!=0?Bb:null,d=f?null:Nb;for(let h=0;h<l;h++){if(h>mf||gf>0&&!(h&63)&&Date.now()>gf)return K$(r,e,t,n,i,s);let p=Nb.advance(h,o,a,l,f,!1,c)||Bb.advance(h,o,a,l,d,!0,u);if(p)return kj(r,e,t,e+p[0],n,i,s,i+p[1])}return[new Ut(e,t,i,s)]}var $p=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let t=0;t<this.len;t++)this.vec[t]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,i,s,o,a){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<t&&f<n&&a(u,f);)u++,f++;if(this.vec[c]=u,u>t)this.end+=2;else if(f>n)this.start+=2;else if(s){let d=i+(t-n)-l;if(d>=0&&d<this.len&&s.vec[d]!=-1)if(o){let h=s.vec[d];if(h>=t-u)return[h,i+h-d]}else{let h=t-s.vec[d];if(u>=h)return[u,f]}}}return null}},Nb=new $p,Bb=new $p;function kj(r,e,t,n,i,s,o,a){let l=!1;return!ac(r,n)&&++n==t&&(l=!0),!ac(i,a)&&++a==o&&(l=!0),l?[new Ut(e,t,s,o)]:ma(r,e,n,i,s,a).concat(ma(r,n,t,i,a,o))}function hP(r,e){let t=1,n=Math.min(r,e);for(;t<n;)t=t<<1;return t}function Vb(r,e,t,n,i,s){if(e==t||e==s||r.charCodeAt(e)!=n.charCodeAt(i))return 0;let o=hP(t-e,s-i);for(let a=e,l=i;;){let c=a+o,u=l+o;if(c>t||u>s||r.slice(a,c)!=n.slice(l,u)){if(o==1)return a-e-(ac(r,a)?0:1);o=o>>1}else{if(c==t||u==s)return c-e;a=c,l=u}}}function Wb(r,e,t,n,i,s){if(e==t||i==s||r.charCodeAt(t-1)!=n.charCodeAt(s-1))return 0;let o=hP(t-e,s-i);for(let a=t,l=s;;){let c=a-o,u=l-o;if(c<e||u<i||r.slice(c,a)!=n.slice(u,l)){if(o==1)return t-a-(ac(r,a)?0:1);o=o>>1}else{if(c==e||u==i)return t-c;a=c,l=u}}}function Hb(r,e,t,n,i,s,o,a){let l=n.slice(i,s),c=null;for(;;){if(c||o<a)return c;for(let u=e+o;;){ac(r,u)||u++;let f=u+o;if(ac(r,f)||(f+=f==u+1?1:-1),f>=t)break;let d=r.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let p=Vb(r,f,t,n,i+h+d.length,s),m=Wb(r,e,u,n,i,i+h),w=d.length+p+m;(!c||c[2]<w)&&(c=[u-m,i+h-m,w])}u=f}if(a<0)return c;o=o>>1}}function pP(r,e,t,n,i,s){let o=t-e,a=s-i;if(o<a){let l=pP(n,i,s,r,e,t);return l&&[l[1],l[0],l[2]]}return o<4||a*2<o?null:Hb(r,e,t,n,i,s,Math.floor(o/4),-1)}function K$(r,e,t,n,i,s){zb=!0;let o=t-e,a=s-i,l;if(o<a){let d=Hb(n,i,s,r,e,t,Math.floor(o/6),50);l=d&&[d[1],d[0],d[2]]}else l=Hb(r,e,t,n,i,s,Math.floor(a/6),50);if(!l)return[new Ut(e,t,i,s)];let[c,u,f]=l;return ma(r,e,c,n,i,u).concat(ma(r,c+f,t,n,u+f,s))}function mP(r,e){for(let t=1;t<r.length;t++){let n=r[t-1],i=r[t];n.toA>i.fromA-e&&n.toB>i.fromB-e&&(r[t-1]=new Ut(n.fromA,i.toA,n.fromB,i.toB),r.splice(t--,1))}}function Aj(r,e,t){for(;;){mP(t,1);let n=!1;for(let i=0;i<t.length;i++){let s=t[i],o,a;(o=Vb(r,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=t[i]=new Ut(s.fromA+o,s.toA,s.fromB+o,s.toB)),(a=Wb(r,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=t[i]=new Ut(s.fromA,s.toA-a,s.fromB,s.toB-a));let l=s.toA-s.fromA,c=s.toB-s.fromB;if(l&&c)continue;let u=s.fromA-(i?t[i-1].toA:0),f=(i<t.length-1?t[i+1].fromA:r.length)-s.toA;if(!u||!f)continue;let d=l?r.slice(s.fromA,s.toA):e.slice(s.fromB,s.toB);u<=d.length&&r.slice(s.fromA-u,s.fromA)==d.slice(d.length-u)?(t[i]=new Ut(s.fromA-u,s.toA-u,s.fromB-u,s.toB-u),n=!0):f<=d.length&&r.slice(s.toA,s.toA+f)==d.slice(0,f)&&(t[i]=new Ut(s.fromA+f,s.toA+f,s.fromB+f,s.toB+f),n=!0)}if(!n)break}return t}function Cj(r,e,t){for(let n=0,i=0;i<r.length;i++){let s=r[i],o=s.toA-s.fromA,a=s.toB-s.fromB;if(o&&a||o>3||a>3){let l=i==r.length-1?e.length:r[i+1].fromA,c=s.fromA-n,u=l-s.toA,f=X$(e,s.fromA,c),d=Z$(e,s.toA,u),h=s.fromA-f,p=d-s.toA;if((!o||!a)&&h&&p){let m=Math.max(o,a),[w,y,v]=o?[e,s.fromA,s.toA]:[t,s.fromB,s.toB];m>h&&e.slice(f,s.fromA)==w.slice(v-h,v)?(s=r[i]=new Ut(f,f+o,s.fromB-h,s.toB-h),f=s.fromA,d=Z$(e,s.toA,l-s.toA)):m>p&&e.slice(s.toA,d)==w.slice(y,y+p)&&(s=r[i]=new Ut(d-o,d,s.fromB+p,s.toB+p),d=s. Line truncated
`),s=e.split(`
`);for(let o of t){let{oldStart:a,oldLines:l,newStart:c,newLines:u}=o,f=cr.createHunk(a,l,c,u);if(o.oldLines>0){for(let d=a;d<a+l;d++)f.removed.lines.push(i[d-1]);a+l>i.length&&i.last()!=""&&(f.removed.no_nl_at_eof=!0)}if(o.newLines>0){for(let d=c;d<c+u;d++)f.added.lines.push(s[d-1]);c+u>s.length&&s.last()!=""&&(f.added.no_nl_at_eof=!0)}n.push(f)}return n}function Zb(r,e,t){let n=e.lineAt(r.fromA).number,i=r.fromA==r.toA?0:Op(e,r.endA)-n+1,s=t.lineAt(r.fromB).number,o=r.fromB==r.toB?0:Op(t,r.endB)-s+1,a={oldStart:n,oldLines:i,newStart:s,newLines:o};return a.oldLines==0&&(a.oldStart-=1),a.newLines==0&&(a.newStart-=1),a}var AP={scanLimit:1e3,timeout:200};function jj(r,e,t,n){let i=Yb.Text.of(r.split(`
`)),s=Yb.Text.of(e.split(`
`)),o=t&&n?Ps.updateB(t,i,s,n,AP):Ps.build(i,s,AP),a=[];for(let l=0;l<o.length;l++){let c=o[l],u=Zb(c,i,s);a.push(u)}return{hunks:Kb(r,e,a),chunks:o}}function CP(r,e,t,n){return jj(r,e,t,n)}var Is=require("obsidian"),xi=class{static hasHunksData(e){let t=e.field(on,!1);return!!t&&!t.isDirty}static getHunks(e,t){let n=e.field(on);return n?t?n.stagedHunks:n.hunks:[]}static getHunkAtPos(e,t,n){if(!e.field(on))return;let s=e.doc.lineAt(t).number,o=this.getHunks(e,n);return cr.findHunk(s,o)[0]}static getCursorHunk(e,t){if(!e.field(on))return;let i=e.selection.main.head;return this.getHunkAtPos(e,i,t)}static getHunk(e,t,n){if(n!=null)return this.getHunkAtPos(e,n,t);if(e.selection.main.empty)return this.getCursorHunk(e,t);let i=e.selection.main.from,s=e.selection.main.to,o=e.doc.lineAt(i).number,a=Op(e.doc,s),l=this.getHunks(e,t),c=cr.createPartialHunk(l,o,a);if(!c)return;let u=e.field(on);if(t){let f=o,d=a;for(let h of u.hunks)o>h.vend&&(f=f-(h.added.count-h.removed.count)),a>h.vend&&(d=d-(h.added.count-h.removed.count));c.added.lines=u.compareText.split(`
`).slice(f-1,d),u.compareTextHead?c.removed.lines=u.compareTextHead.split(`
`).slice(c.removed.start-1,c.removed.start-1+c.removed.count):c.removed.lines=[]}else c.added.lines=e.doc.toString().split(`
`).slice(o-1,a),a===e.doc.lines&&!e.doc.toString().endsWith(`
`)&&(c.added.no_nl_at_eof=!0),c.removed.lines=u.compareText.split(`
`).slice(c.removed.start-1,c.removed.start-1+c.removed.count),c.removed.start+c.removed.count-1===u.compareText.split(`
`).length&&!u.compareText.endsWith(`
`)&&(c.removed.no_nl_at_eof=!0);return c}},on=lc.StateField.define({create:r=>{},update:(r,e)=>{var i,s,o,a;let t=r?{...r}:{maxDiffTimeMs:0,hunks:[],stagedHunks:[],chunks:void 0,isDirty:!1},n=!1;for(let l of e.effects)if(l.is(cc)&&(t.compareText=l.value.compareText,t.compareTextHead=l.value.compareTextHead,n=(r==null?void 0:r.compareText)!==l.value.compareText,n&&(t.chunks=void 0,t.changeDesc=void 0)),l.is(Fp)){let c=(i=e.startState.field(vf,!1))==null?void 0:i.revision;if(l.value.revision!==c)continue;TP(t,l.value.result,e.state),t.changeDesc=void 0}if(e.docChanged&&(!t.changeDesc||t.changeDesc.newLength===e.changes.length||((s=Pt.plugin)==null||s.warn("Hunk changes belong to different document histories. Recomputing the full diff."),t.chunks=void 0),t.changeDesc=zj(t.changeDesc,e.changes)),t.compareText!==void 0){if(n||e.docChanged){t.isDirty=!0;let l=Vj(e,t.compareText,t.chunks,t.changeDesc,t.maxDiffTimeMs);l&&(TP(t,l,e.state),t.changeDesc=void 0)}}else{t.compareText=void 0,t.compareTextHead=void 0,t.chunks=void 0,t.hunks=[],t.stagedHunks=[],t.isDirty=!1;let l=e.state.field(Is.editorInfoField).file;(a=(o=Pt.plugin)==null?void 0:o.editorIntegration.signsFeature.changeStatusBar)==null||a.display(t.hunks,l)}return t}});function TP(r,e,t){var i,s;r.hunks=e.hunks,r.chunks=e.chunks,r.isDirty=!1,r.maxDiffTimeMs=Math.max(.95*r.maxDiffTimeMs,e.diffDuration);let n=t.field(Is.editorInfoField).file;(s=(i=Pt.plugin)==null?void 0:i.editorIntegration.signsFeature.changeStatusBar)==null||s.display(r.hunks,n)}var vf=lc.StateField.define({create:r=>{var e,t;return{debouncer:(0,Is.debounce)(n=>{let{state:i,compareText:s,previousChunks:o,changeDesc:a,revision:l}=n,c=i.field(Is.editorEditorField,!1);if(!c)return;let u=c.state.field(vf,!1);if((u==null?void 0:u.revision)!==l)return;let f=RP(i,s,o,a);c.dispatch({effects:Fp.of({result:f,revision:l})})},1e3,!0),revision:{},filePath:(t=(e=r.field(Is.editorInfoField,!1))==null?void 0:e.file)==null?void 0:t.path}},update:(r,e)=>{var n,i;let t=(i=(n=e.state.field(Is.editorInfoField,!1))==null?void 0:n.file)==null?void 0:i.path;return e.docChanged||t!==r.filePath?{...r,revision:{},filePath:t}:r}});function zj(r,e){return!r||r.newLength!==e.length?e:r.composeDesc(e)}function RP(r,e,t,n){let i=r.doc.toString(),s=performance.now(),{hunks:o,chunks:a}=CP(e,i,t,n),l=performance.now()-s;return{hunks:o,chunks:a,diffDuration:l}}function Vj(r,e,t,n,i){let s=r.state,o=Math.abs(r.changes.length-r.changes.newLength),a=s.field(vf);if(o>1e3||i>16){a.debouncer({state:s,compareText:e,previousChunks:t,changeDesc:n,revision:a.revision});return}else return RP(s,e,t,n)}var cc=lc.StateEffect.define(),Fp=lc.StateEffect.define();function $P(r,e){return e.update({effects:cc.of(r)})}g();g();g();var St;(function(r){r.INSERT="insert",r.DELETE="delete",r.CONTEXT="context"})(St||(St={}));var PP={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},IP={LINES:"lines",WORDS:"words",NONE:"none"},OP={WORD:"word",CHAR:"char"},ga;(function(r){r.AUTO="auto",r.DARK="dark",r.LIGHT="light"})(ga||(ga={}));g();var Wj=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],qj=RegExp("["+Wj.join("\\")+"]","g");function FP(r){return r.replace(qj,"\\$&")}function Xb(r){return r&&r.replace(/\\/g,"/")}function MP(r){let e,t,n,i=0;for(e=0,n=r.length;e<n;e++)t=r.charCodeAt(e),i=(i<<5)-i+t,i|=0;return i}function Mp(r){let e=r.length,t=-1/0;for(let n=0;n<e;n++)t=Math.max(t,r[n]);return t}function DP(r,e){let t=r.split(".");return t.length>1?t[t.length-1]:e}function LP(r,e){return e.reduce((t,n)=>t||r.startsWith(n),!1)}var NP=["a/","b/","i/","w/","c/","o/"];function So(r,e,t){let n=t!==void 0?[...NP,t]:NP,i=e?new RegExp(`^${FP(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,s=""]=i.exec(r)||[],o=n.find(l=>s.indexOf(l)===0);return(o?s.slice(o.length):s).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function Yj(r,e){return So(r,"---",e)}function Kj(r,e){return So(r,"+++",e)}function BP(r,e={}){let t=[],n=null,i=null,s=null,o=null,a=null,l=null,c=null,u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,p=/^new mode (\d{6})/,m=/^deleted file mode (\d{6})/,w=/^new file mode (\d{6})/,y=/^copy from "?(.+)"?/,v=/^copy to "?(.+)"?/,A=/^rename from "?(.+)"?/,C=/^rename to "?(.+)"?/,S=/^similarity index (\d+)%/,T=/^dissimilarity index (\d+)%/,b=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,x=/^Binary files (.*) and (.*) differ/,E=/^GIT binary patch/,k=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,$=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,M=/^new file mode (\d{6})/,D=/^deleted file mode (\d{6}),(\d{6})/,P=r.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,`
`).split(`
`);function F(){i!==null&&n!==null&&(n.blocks.push(i),i=null)}function _e(){n!==null&&(!n.oldName&&l!==null&&(n.oldName=l),!n.newName&&c!==null&&(n.newName=c),n.newName&&(t.push(n),n=null)),l=null,c=null}function Q(){F(),_e(),n={blocks:[],deletedLines:0,addedLines:0}}function oe(Y){F();let J;n!==null&&((J=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(Y))?(n.isCombined=!1,s=parseInt(J[1],10),a=parseInt(J[2],10)):(J=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(Y))?(n.isCombined=!0,s=parseInt(J[1],10),o=parseInt(J[2],10),a=parseInt(J[3],10)):(Y.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),s=0,a=0,n.isCombined=!1)),i={lines:[],oldStartLine:s,oldStartLine2:o,newStartLine:a,header:Y}}function fe(Y){if(n===null||i===null||s===null||a===null)return;let J={content:Y},U=n.isCombined?["+ "," +","++"]:["+"],et=n.isCombined?["- "," -","--"]:["-"];LP(Y,U)?(n.addedLines++,J.type=St.INSERT,J.oldNumber=void 0,J.newNumber=a++):LP(Y,et)?(n.deletedLines++,J.type=St.DELETE,J.oldNumber=s++,J.newNumber=void 0):(J.type=St.CONTEXT,J.oldNumber=s++,J.newNumber=a++),i.lines.push(J)}function Z(Y,J){let U=J;for(;U<P.length-3;){if(Y.startsWith("diff"))return!1;if(P[U].startsWith(u)&&P[U+1].startsWith(f)&&P[U+2].startsWith(d))return!0;U++}return!1}return P.forEach((Y,J)=>{if(!Y||Y.startsWith("*"))return;let U,et=P[J-1],se=P[J+1],vt=P[J+2];if(Y.startsWith("diff --git")||Y.startsWith("diff --combined")){if(Q(),(U=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(Y))&&(l=So(U[1],void 0,e.dstPrefix),c=So(U[2],void 0,e.srcPrefix)),n===null)throw new Error("Where is my file !!!");n.isGitDiff=!0;return}if(Y.startsWith("Binary files")&&!(n!=null&&n.isGitDiff)){if(Q(),(U=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(Y))&&(l=So(U[1],void 0,e.dstPrefix),c=So(U[2],void 0,e.srcPrefix)),n===null)throw new Error("Where is my file !!!");n.isBinary=!0;return}if((!n||!n.isGitDiff&&n&&Y.startsWith(u)&&se.startsWith(f)&&vt.startsWith(d))&&Q(),n!=null&&n.isTooBig)return;if(n&&(typeof e.diffMaxChanges=="number"&&n.addedLines+n.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&Y.length>e.diffMaxLineLength)){n.isTooBig=!0,n.addedLines=0,n.deletedLines=0,n.blocks=[],i=null;let j=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(t.length):"Diff too big to be displayed";oe(j);return}if(Y.startsWith(u)&&se.startsWith(f)||Y.startsWith(f)&&et.startsWith(u)){if(n&&!n.oldName&&Y.startsWith("--- ")&&(U=Yj(Y,e.srcPrefix))){n.oldName=U,n.language=DP(n.oldName,n.language);return}if(n&&!n.newName&&Y.startsWith("+++ ")&&(U=Kj(Y,e.dstPrefix))){n.newName=U,n.language=DP(n.newName,n.language);return}}if(n&&(Y.startsWith(d)||n.isGitDiff&&n.oldName&&n.newName&&!i)){oe(Y);return}if(i&&(Y.startsWith("+")||Y.startsWith("-")||Y.startsWith(" "))){fe(Y);return}let tt=!Z(Y,J);if(n===null)throw new Error("Where is my file !!!");(U=h.exec(Y))?n.oldMode=U[1]:(U=p.exec(Y))?n.newMode=U[1]:(U=m.exec(Y))?(n.deletedFileMode=U[1],n.isDeleted=!0):(U=w.exec(Y))?(n.newFileMode=U[1],n.isNew=!0):(U=y.exec(Y))?(tt&&(n.oldName=U[1]),n.isCopy=!0):(U=v.exec(Y))?(tt&&(n.newName=U[1]),n.isCopy=!0):(U=A.exec(Y))?(tt&&(n.oldName=U[1]),n.isRename=!0):(U=C.exec(Y))?(tt&&(n.newName=U[1]),n.isRename=!0):(U=x.exec(Y))?(n.isBinary=!0,n.oldName=So(U[1],void 0,e.srcPrefix),n.newName=So(U[2],void 0,e.dstPrefix),oe("Binary file")):E.test(Y)?(n.isBinary=!0,oe(Y)):(U=S.exec(Y))?n.unchangedPercentage=parseInt(U[1],10):(U=T.exec(Y))?n.changedPercentage=parseInt(U[1],10):(U=b.exec(Y))?(n.checksumBefore=U[1],n.checksumAfter=U[2],U[3]&&(n.mode=U[3])):(U=k.exec(Y))?(n.checksumBefore=[U[2],U[3]],n.checksumAfter=U[1]):(U=$.exec(Y))?(n.oldMode=[U[2],U[3]],n.newMode=U[1]):(U=M.exec(Y))?(n.newFileMode=U[1],n.isNew=!0):(U=D.exec(Y))&&(n.deletedFileMode=U[1],n.isDeleted=!0)}),F(),_e(),t}g();g();g();g();var ko=class{diff(e,t,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(e,n),o=this.castInput(t,n),a=this.removeEmpty(this.tokenize(s,n)),l=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,l,n,i)}diffWithOptionsObj(e,t,n,i){var s;let o=v=>{if(v=this.postProcess(v,n),i){setTimeout(function(){i(v)},0);return}else return v},a=t.length,l=e.length,c=1,u=a+l;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));let f=(s=n.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],t,e,0,n);if(h[0].oldPos+1>=l&&p+1>=a)return o(this.buildValues(h[0].lastComponent,t,e));let m=-1/0,w=1/0,y=()=>{for(let v=Math.max(m,-c);v<=Math.min(w,c);v+=2){let A,C=h[v-1],S=h[v+1];C&&(h[v-1]=void 0);let T=!1;if(S){let x=S.oldPos-v;T=S&&0<=x&&x<a}let b=C&&C.oldPos+1<l;if(!T&&!b){h[v]=void 0;continue}if(!b||T&&C.oldPos<S.oldPos?A=this.addToPath(S,!0,!1,0,n):A=this.addToPath(C,!1,!0,1,n),p=this.extractCommon(A,t,e,v,n),A.oldPos+1>=l&&p+1>=a)return o(this.buildValues(A.lastComponent,t,e))||!0;h[v]=A,A.oldPos+1>=l&&(w=Math.min(w,v-1)),p+1>= Line truncated
`);return this.hoganUtils.render(zP,"wrapper",{colorScheme:mc(this.config.colorScheme),filesNumber:e.length,files:t})}};g();var uy=Object.assign(Object.assign({},va),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),yf="generic",VP="line-by-line",l9="icon",c9="tag",_f=class{constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},uy),t)}render(e){let t=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(yf,"wrapper",{colorScheme:mc(this.config.colorScheme),content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let n=this.hoganUtils.template(VP,"file-diff"),i=this.hoganUtils.template(yf,"file-path"),s=this.hoganUtils.template(l9,"file"),o=this.hoganUtils.template(c9,wc(e));return n.render({file:e,fileHtmlId:gc(e),diffs:t,filePath:i.render({fileDiffName:ba(e)},{fileIcon:s,fileTag:o})})}generateEmptyDiff(){return this.hoganUtils.render(yf,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:br})}generateFileHtml(e){let t=hc(dc(n=>ti(n.content,e.isCombined).content));return e.blocks.map(n=>{let i=this.hoganUtils.render(yf,"block-header",{CSSLineClass:br,blockHeader:e.isTooBig?n.header:Ao(n.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(n).forEach(([s,o,a])=>{if(o.length&&a.length&&!s.length)this.applyRematchMatching(o,a,t).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);i+=u,i+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=ti(l.content,e.isCombined);i+=this.generateSingleLineHtml(e,{type:br.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(o.length||a.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,o,a);i+=l,i+=c}else console.error("Unknown state reached while processing groups of lines",s,o,a)}),i}).join(`
`)}applyLineGroupping(e){let t=[],n=[],i=[];for(let s=0;s<e.lines.length;s++){let o=e.lines[s];(o.type!==St.INSERT&&i.length||o.type===St.CONTEXT&&n.length>0)&&(t.push([[],n,i]),n=[],i=[]),o.type===St.CONTEXT?t.push([[o],[],[]]):o.type===St.INSERT&&n.length===0?t.push([[],[],[o]]):o.type===St.INSERT&&n.length>0?i.push(o):o.type===St.DELETE&&n.push(o)}return(n.length||i.length)&&(t.push([[],n,i]),n=[],i=[]),t}applyRematchMatching(e,t,n){let i=e.length*t.length,s=Mp(e.concat(t).map(a=>a.content.length));return i<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?n(e,t):[[e,t]]}processChangedLines(e,t,n,i){let s={right:"",left:""},o=Math.max(n.length,i.length);for(let a=0;a<o;a++){let l=n[a],c=i[a],u=l!==void 0&&c!==void 0?Hp(l.content,c.content,t,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:br.DELETE_CHANGES}:Object.assign(Object.assign({},ti(l.content,t)),{type:pc(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:br.INSERT_CHANGES}:Object.assign(Object.assign({},ti(c.content,t)),{type:pc(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,{left:h,right:p}=this.generateLineHtml(e,f,d);s.left+=h,s.right+=p}return s}generateLineHtml(e,t,n){return{left:this.generateSingleLineHtml(e,t),right:this.generateSingleLineHtml(e,n)}}generateSingleLineHtml(e,t){if(t===void 0)return"";let n=this.hoganUtils.render(VP,"numbers",{oldNumber:t.oldNumber||"",newNumber:t.newNumber||""});return this.hoganUtils.render(yf,"line",{type:t.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:t.prefix===" "?"&nbsp;":t.prefix,content:t.content,lineNumber:n,line:t,file:e})}};g();var fy=Object.assign(Object.assign({},va),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),xf="generic",u9="side-by-side",f9="icon",d9="tag",Ef=class{constructor(e,t={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},fy),t)}render(e){let t=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(xf,"wrapper",{colorScheme:mc(this.config.colorScheme),content:t})}makeFileDiffHtml(e,t){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let n=this.hoganUtils.template(u9,"file-diff"),i=this.hoganUtils.template(xf,"file-path"),s=this.hoganUtils.template(f9,"file"),o=this.hoganUtils.template(d9,wc(e));return n.render({file:e,fileHtmlId:gc(e),diffs:t,filePath:i.render({fileDiffName:ba(e)},{fileIcon:s,fileTag:o})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(xf,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:br})}}generateFileHtml(e){let t=hc(dc(n=>ti(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(([s,o,a])=>{if(o.length&&a.length&&!s.length)this.applyRematchMatching(o,a,t).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);i.left+=u,i.right+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=ti(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:br.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:br.CONTEXT,prefix:c,content:u,number:l.newNumber});i.left+=f,i.right+=d});else if(o.length||a.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,o,a);i.left+=l,i.right+=c}else console.error("Unknown state reached while processing groups of lines",s,o,a)}),i}).reduce((n,i)=>({left:n.left+i.left,right:n.right+i.right}),{left:"",right:""})}applyLineGroupping(e){let t=[],n=[],i=[];for(let s=0;s<e.lines.length;s++){let o=e.lines[s];(o.type!==St.INSERT&&i.length||o.type===St.CONTEXT&&n.length>0)&&(t.push([[],n,i]),n=[],i=[]),o.type===St.CONTEXT?t.push([[o],[],[]]):o.type===St.INSERT&&n.length===0?t.push([[],[],[o]]):o.type===St.INSERT&&n.length>0?i.push(o):o.type===St.DELETE&&n.push(o)}return(n.length||i.length)&&(t.push([[],n,i]),n=[],i=[]),t}applyRematchMatching(e,t,n){let i=e.length*t.length,s=Mp(e.concat(t).map(a=>a.content.length));return i<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?n(e,t):[[e,t]]}makeHeaderHtml(e,t){return this.hoganUtils.render(xf,"block-header",{CSSLineClass:br,blockHeader:t!=null&&t.isTooBig?e:Ao(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,t,n){let i={right:"",left:""},s=Math.max(t.length,n.length);for(let o=0;o<s;o++){let a=t[o],l=n[o],c=a!==void 0&&l!==void 0?Hp(a.content,l.content,e,this.config):void 0,u=a!==void 0&&a.oldNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.oldLine.prefix,content:c.oldLine.content,type:br.DELETE_CHANGES}:Object.assign(Object.assign({},ti(a.content,e)),{type:pc(a.type)})),{number:a.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:br.INSERT_CHANGES}:Object.assign(Object.assign({},ti(l.content,e)),{type:pc(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,t){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(t)}}generateSingleHtml(e){let t="d2h-code-side-linenumber",n="d2h-code-side-line";return this.hoganUtils.render(xf,"line",{type:(e==null?void 0:e.type)||`${br.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?t:`${t} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?n:`${n} d2h-code-side-emptyplaceholder`,prefix:(e==null?void 0:e.prefix)===" "?"&nbsp;":e==null?void 0:e.prefix,content:e==null?void 0:e.content,lineNumber:e==null?void 0:e.number})}};g();var my=nt(py());g();var jt=nt(py()),Lt={};Lt["file-summary-line"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<li class="d2h-file-list-line">'),n.b(`
`+t),n.b(' <span class="d2h-file-name-wrapper">'),n.b(`
`+t),n.b(n.rp("<fileIcon0",r,e," ")),n.b(' <a href="#'),n.b(n.v(n.f("fileHtmlId",r,e,0))),n.b('" class="d2h-file-name">'),n.b(n.v(n.f("fileName",r,e,0))),n.b("</a>"),n.b(`
`+t),n.b(' <span class="d2h-file-stats">'),n.b(`
`+t),n.b(' <span class="d2h-lines-added">'),n.b(n.v(n.f("addedLines",r,e,0))),n.b("</span>"),n.b(`
`+t),n.b(' <span class="d2h-lines-deleted">'),n.b(n.v(n.f("deletedLines",r,e,0))),n.b("</span>"),n.b(`
`+t),n.b(" </span>"),n.b(`
`+t),n.b(" </span>"),n.b(`
`+t),n.b("</li>"),n.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});Lt["file-summary-wrapper"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<div class="d2h-file-list-wrapper '),n.b(n.v(n.f("colorScheme",r,e,0))),n.b('">'),n.b(`
`+t),n.b(' <div class="d2h-file-list-header">'),n.b(`
`+t),n.b(' <span class="d2h-file-list-title">Files changed ('),n.b(n.v(n.f("filesNumber",r,e,0))),n.b(")</span>"),n.b(`
`+t),n.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),n.b(`
`+t),n.b(' <a class="d2h-file-switch d2h-show">show</a>'),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(' <ol class="d2h-file-list">'),n.b(`
`+t),n.b(" "),n.b(n.t(n.f("files",r,e,0))),n.b(`
`+t),n.b(" </ol>"),n.b(`
`+t),n.b("</div>"),n.fl()},partials:{},subs:{}});Lt["generic-block-header"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b("<tr>"),n.b(`
`+t),n.b(' <td class="'),n.b(n.v(n.f("lineClass",r,e,0))),n.b(" "),n.b(n.v(n.d("CSSLineClass.INFO",r,e,0))),n.b('"></td>'),n.b(`
`+t),n.b(' <td class="'),n.b(n.v(n.d("CSSLineClass.INFO",r,e,0))),n.b('">'),n.b(`
`+t),n.b(' <div class="'),n.b(n.v(n.f("contentClass",r,e,0))),n.b('">'),n.s(n.f("blockHeader",r,e,1),r,e,0,156,173,"{{ }}")&&(n.rs(r,e,function(i,s,o){o.b(o.t(o.f("blockHeader",i,s,0)))}),r.pop()),n.s(n.f("blockHeader",r,e,1),r,e,1,0,0,"")||n.b("&nbsp;"),n.b("</div>"),n.b(`
`+t),n.b(" </td>"),n.b(`
`+t),n.b("</tr>"),n.fl()},partials:{},subs:{}});Lt["generic-empty-diff"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b("<tr>"),n.b(`
`+t),n.b(' <td class="'),n.b(n.v(n.d("CSSLineClass.INFO",r,e,0))),n.b('">'),n.b(`
`+t),n.b(' <div class="'),n.b(n.v(n.f("contentClass",r,e,0))),n.b('">'),n.b(`
`+t),n.b(" File without changes"),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(" </td>"),n.b(`
`+t),n.b("</tr>"),n.fl()},partials:{},subs:{}});Lt["generic-file-path"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<span class="d2h-file-name-wrapper">'),n.b(`
`+t),n.b(n.rp("<fileIcon0",r,e," ")),n.b(' <span class="d2h-file-name">'),n.b(n.v(n.f("fileDiffName",r,e,0))),n.b("</span>"),n.b(`
`+t),n.b(n.rp("<fileTag1",r,e," ")),n.b("</span>"),n.b(`
`+t),n.b('<label class="d2h-file-collapse">'),n.b(`
`+t),n.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),n.b(`
`+t),n.b(" Viewed"),n.b(`
`+t),n.b("</label>"),n.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});Lt["generic-line"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b("<tr>"),n.b(`
`+t),n.b(' <td class="'),n.b(n.v(n.f("lineClass",r,e,0))),n.b(" "),n.b(n.v(n.f("type",r,e,0))),n.b('">'),n.b(`
`+t),n.b(" "),n.b(n.t(n.f("lineNumber",r,e,0))),n.b(`
`+t),n.b(" </td>"),n.b(`
`+t),n.b(' <td class="'),n.b(n.v(n.f("type",r,e,0))),n.b('">'),n.b(`
`+t),n.b(' <div class="'),n.b(n.v(n.f("contentClass",r,e,0))),n.b('">'),n.b(`
`+t),n.s(n.f("prefix",r,e,1),r,e,0,162,238,"{{ }}")&&(n.rs(r,e,function(i,s,o){o.b(' <span class="d2h-code-line-prefix">'),o.b(o.t(o.f("prefix",i,s,0))),o.b("</span>"),o.b(`
`+t)}),r.pop()),n.s(n.f("prefix",r,e,1),r,e,1,0,0,"")||(n.b(' <span class="d2h-code-line-prefix">&nbsp;</span>'),n.b(`
`+t)),n.s(n.f("content",r,e,1),r,e,0,371,445,"{{ }}")&&(n.rs(r,e,function(i,s,o){o.b(' <span class="d2h-code-line-ctn">'),o.b(o.t(o.f("content",i,s,0))),o.b("</span>"),o.b(`
`+t)}),r.pop()),n.s(n.f("content",r,e,1),r,e,1,0,0,"")||(n.b(' <span class="d2h-code-line-ctn"><br></span>'),n.b(`
`+t)),n.b(" </div>"),n.b(`
`+t),n.b(" </td>"),n.b(`
`+t),n.b("</tr>"),n.fl()},partials:{},subs:{}});Lt["generic-wrapper"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<div class="d2h-wrapper '),n.b(n.v(n.f("colorScheme",r,e,0))),n.b('">'),n.b(`
`+t),n.b(" "),n.b(n.t(n.f("content",r,e,0))),n.b(`
`+t),n.b("</div>"),n.fl()},partials:{},subs:{}});Lt["icon-file-added"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),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(`
`+t),n.b(' width="14">'),n.b(`
`+t),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(`
`+t),n.b("</svg>"),n.fl()},partials:{},subs:{}});Lt["icon-file-changed"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),n.b(`
`+t),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
`+t),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(`
`+t),n.b("</svg>"),n.fl()},partials:{},subs:{}});Lt["icon-file-deleted"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),n.b(`
`+t),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
`+t),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(`
`+t),n.b("</svg>"),n.fl()},partials:{},subs:{}});Lt["icon-file-renamed"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),n.b(`
`+t),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
`+t),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(`
`+t),n.b("</svg>"),n.fl()},partials:{},subs:{}});Lt["icon-file"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),n.b(`
`+t),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(`
`+t),n.b("</svg>"),n.fl()},partials:{},subs:{}});Lt["line-by-line-file-diff"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<div id="'),n.b(n.v(n.f("fileHtmlId",r,e,0))),n.b('" class="d2h-file-wrapper" data-lang="'),n.b(n.v(n.d("file.language",r,e,0))),n.b('">'),n.b(`
`+t),n.b(' <div class="d2h-file-header">'),n.b(`
`+t),n.b(" "),n.b(n.t(n.f("filePath",r,e,0))),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(' <div class="d2h-file-diff">'),n.b(`
`+t),n.b(' <div class="d2h-code-wrapper">'),n.b(`
`+t),n.b(' <table class="d2h-diff-table">'),n.b(`
`+t),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
`+t),n.b(" "),n.b(n.t(n.f("diffs",r,e,0))),n.b(`
`+t),n.b(" </tbody>"),n.b(`
`+t),n.b(" </table>"),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b("</div>"),n.fl()},partials:{},subs:{}});Lt["line-by-line-numbers"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<div class="line-num1">'),n.b(n.v(n.f("oldNumber",r,e,0))),n.b("</div>"),n.b(`
`+t),n.b('<div class="line-num2">'),n.b(n.v(n.f("newNumber",r,e,0))),n.b("</div>"),n.fl()},partials:{},subs:{}});Lt["side-by-side-file-diff"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<div id="'),n.b(n.v(n.f("fileHtmlId",r,e,0))),n.b('" class="d2h-file-wrapper" data-lang="'),n.b(n.v(n.d("file.language",r,e,0))),n.b('">'),n.b(`
`+t),n.b(' <div class="d2h-file-header">'),n.b(`
`+t),n.b(" "),n.b(n.t(n.f("filePath",r,e,0))),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(' <div class="d2h-files-diff">'),n.b(`
`+t),n.b(' <div class="d2h-file-side-diff">'),n.b(`
`+t),n.b(' <div class="d2h-code-wrapper">'),n.b(`
`+t),n.b(' <table class="d2h-diff-table">'),n.b(`
`+t),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
`+t),n.b(" "),n.b(n.t(n.d("diffs.left",r,e,0))),n.b(`
`+t),n.b(" </tbody>"),n.b(`
`+t),n.b(" </table>"),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(' <div class="d2h-file-side-diff">'),n.b(`
`+t),n.b(' <div class="d2h-code-wrapper">'),n.b(`
`+t),n.b(' <table class="d2h-diff-table">'),n.b(`
`+t),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
`+t),n.b(" "),n.b(n.t(n.d("diffs.right",r,e,0))),n.b(`
`+t),n.b(" </tbody>"),n.b(`
`+t),n.b(" </table>"),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b(" </div>"),n.b(`
`+t),n.b("</div>"),n.fl()},partials:{},subs:{}});Lt["tag-file-added"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),n.fl()},partials:{},subs:{}});Lt["tag-file-changed"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),n.fl()},partials:{},subs:{}});Lt["tag-file-deleted"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),n.fl()},partials:{},subs:{}});Lt["tag-file-renamed"]=new jt.Template({code:function(r,e,t){var n=this;return n.b(t=t||""),n.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),n.fl()},partials:{},subs:{}});var Sf=class{constructor({compiledTemplates:e={},rawTemplates:t={}}){let n=Object.entries(t).reduce((i,[s,o])=>{let a=my.compile(o,{asString:!1});return Object.assign(Object.assign({},i),{[s]:a})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},Lt),e),n)}static compile(e){return my.compile(e,{asString:!1})}render(e,t,n,i,s){let o=this.templateKey(e,t);try{return this.preCompiledTemplates[o].render(n,i,s)}catch(a){throw new Error(`Could not find template to render '${o}'`)}}template(e,t){return this.preCompiledTemplates[this.templateKey(e,t)]}templateKey(e,t){return`${e}-${t}`}};var p9=Object.assign(Object.assign(Object.assign({},uy),fy),{outputFormat:PP.LINE_BY_LINE,drawFileList:!0});function jp(r,e={}){let t=Object.assign(Object.assign({},p9),e),n=typeof r=="string"?BP(r,t):r,i=new Sf(t),{colorScheme:s}=t,o={colorScheme:s},a=t.drawFileList?new Gp(i,o).render(n):"",l=t.outputFormat==="side-by-side"?new Ef(i,t).render(n):new _f(i,t).render(n);return a+l}var JP=nt(XP(),1);var ya=require("obsidian"),gy=kf.StateEffect.define();function Co(r,e){let t=r.state,n=t.field(Vp),i=t.field(on),s=t.doc.lineAt(e!=null?e:t.selection.main.head).number,o=cr.findHunk(s,i==null?void 0:i.hunks)[0];if(!o)return;let a=t.doc.line(Math.max(1,o.added.start)).from,l=n.has(a);return t.field(ya.editorEditorField).dispatch({effects:gy.of({pos:a,add:!l})})}var Vp=kf.StateField.define({create:()=>new Set,update(r,e){let t=new Set;for(let n of e.effects)n.is(gy)&&(n.value.add?r.add(n.value.pos):r.delete(n.value.pos));for(let n of r)t.add(e.changes.mapPos(n));return t}}),e2=kf.StateField.define({create:r=>QP(r),update(r,e){return e.docChanged||e.effects.some(t=>t.is(cc)||t.is(gy))?QP(e.state):r},provide:r=>zp.showTooltip.computeN([r],e=>e.field(r))}),t2=zp.EditorView.baseTheme({".cm-tooltip.git-diff-tooltip":{"z-index":"var(--layer-popover)",backgroundColor:"var(--background-primary-alt)",border:"var(--border-width) solid var(--background-primary-alt)",borderRadius:"var(--radius-s)"},".cm-tooltip.git-diff-tooltip .tooltip-toolbar":{display:"flex",padding:"var(--size-2-1)"}});function QP(r){let e=r.field(on);return e?[...r.field(Vp)].map(n=>{let i=r.doc.lineAt(n),s=cr.findHunk(i.number,e.hunks)[0];if(s)return{pos:n,above:!1,arrow:!1,strictSide:!0,clip:!1,create:()=>m9(s,r,n)}}).filter(n=>n!==void 0):[]}function m9(r,e,t){var m,w;let n=cr.createPatch("file",[r],"10064",!1).join(`
`)+`
`,i=jp(n,{colorScheme:JP.ColorSchemeType.AUTO,diffStyle:"word",drawFileList:!1}),s=new DOMParser().parseFromString(i,"text/html").querySelector(".d2h-file-diff"),o=createDiv();o.addClass("tooltip-toolbar");let a=(y,v)=>{let A=createDiv();return(0,ya.setIcon)(A,y),A.setAttr("aria-label",v),A.addClass("clickable-icon"),A},l=a("x","Close hunk"),c=a("plus","Stage hunk"),u=a("undo","Reset hunk");o.appendChild(l),o.appendChild(c),o.appendChild(u);let f=createDiv();f.appendChild(o),f.appendChild(s),f.addClass("git-diff-tooltip","git-diff");let d=e.field(ya.editorEditorField);l.onclick=()=>{Co(d,t)},c.onclick=()=>{let y=Pt.plugin;y&&(y.promiseQueue.addTask(()=>y.hunkActions.stageHunk(t)),Co(d,t))},u.onclick=()=>{let y=Pt.plugin;y&&(y.hunkActions.resetHunk(t),Co(d,t))};let h=(w=(m=Pt.plugin)==null?void 0:m.app.workspace.getActiveViewOfType(ya.MarkdownView))==null?void 0:w.scope,p=h==null?void 0:h.register(null,"Escape",(y,v)=>{Co(d,t)});return{dom:f,destroy:()=>{p&&(h==null||h.unregister(p))},update:y=>{t=y.changes.mapPos(t)}}}function r2(r){let e=r.app;r.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let t=r.gitManager.getRelativeVaultPath(".gitignore");await e.vault.adapter.exists(t)||await e.vault.adapter.write(t,"");let n=await e.vault.adapter.read(t),s=await new Sp(e,n).openAndGetReslt();s!==void 0&&(await e.vault.adapter.write(t,s),await r.refresh())}}),r.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var i;let t=e.workspace.getLeavesOfType(wr.type),n;t.length===0?(n=(i=e.workspace.getRightLeaf(!1))!=null?i:e.workspace.getLeaf(),await n.setViewState({type:wr.type})):n=t.first(),await e.workspace.revealLeaf(n),e.workspace.trigger("obsidian-git:refresh")}}),r.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var i;let t=e.workspace.getLeavesOfType(tn.type),n;t.length===0?(n=(i=e.workspace.getRightLeaf(!1))!=null?i:e.workspace.getLeaf(),await n.setViewState({type:tn.type})):n=t.first(),await e.workspace.revealLeaf(n),e.workspace.trigger("obsidian-git:refresh")}}),r.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:t=>{let n=e.workspace.getActiveFile();if(t)return n!==null;{let i=r.gitManager.getRelativeRepoPath(n.path,!0);return r.tools.openDiff({aFile:i,aRef:""}),!0}}}),r.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(t,{file:n})=>{if(n)return U$(t,n,r.gitManager)}}),r.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(t,{file:n})=>{if(n)return j$(n,r.gitManager)}}),r.addCommand({id:"pull",name:"Pull",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.pullChangesFromRemote())}),r.addCommand({id:"fetch",name:"Fetch",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.fetch())}),r.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.switchRemoteBranch())}),r.addCommand({id:"add-to-gitignore",name:"Add file to .gitignore",checkCallback:t=>{let n=e.workspace.getActiveFile();return t?n!==null:(r.promiseQueue.addTask(()=>r.gitActions.addFileToGitignore(n.path,n instanceof Af.TFolder)),!0)}}),r.addCommand({id:"push",name:"Commit-and-sync",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commitAndSync({fromAutoBackup:!1}))}),r.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>r.promiseQueue.addTask(async()=>{await r.gitActions.commitAndSync({fromAutoBackup:!1}),window.close()})}),r.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commitAndSync({fromAutoBackup:!1,requestCustomMessage:!0}))}),r.addCommand({id:"commit",name:"Commit all changes",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commit({fromAuto:!1,mode:"all"}))}),r.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commit({fromAuto:!1,requestCustomMessage:!0,mode:"all"}))}),r.addCommand({id:"commit-smart",name:"Commit",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commit({fromAuto:!1,requestCustomMessage:!1,mode:"smart"}))}),r.addCommand({id:"commit-staged",name:"Commit staged",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commit({fromAuto:!1,requestCustomMessage:!1,mode:"staged"}))}),r.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commit({fromAuto:!1,requestCustomMessage:!0,mode:"staged",amend:!0}))}),r.addCommand({id:"commit-smart-specified-message",name:"Commit with specific message",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commit({fromAuto:!1,requestCustomMessage:!0,mode:"smart"}))}),r.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",callback:()=>r.promiseQueue.addTask(()=>r.gitActions.commit({fromAuto:!1,requestCusto Line truncated
- ${s.map(a=>a.vaultPath).join(`
- `)}
Please remove them or add to .gitignore.`),!0}return!1}openDiff({aFile:e,bFile:t,aRef:n,bRef:i,event:s}){var l,c;let o=this.plugin.settings.diffStyle;Yp.Platform.isMobileApp&&(o="git_unified");let a={aFile:e,bFile:t!=null?t:e,aRef:n,bRef:i};o=="split"?(l=En(this.plugin.app,s))==null||l.setViewState({type:go.type,active:!0,state:a}):o=="git_unified"&&((c=En(this.plugin.app,s))==null||c.setViewState({type:wo.type,active:!0,state:a}))}async openFileAtCommit(e,t){let n={file:e,ref:t};await this.plugin.app.workspace.getLeaf("tab").setViewState({type:mo.type,active:!0,state:n})}async runRawCommand(){if(!(this.plugin.gitManager instanceof Ze))return;let t=await new _t(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();t!==void 0&&this.plugin.promiseQueue.addTask(()=>this.plugin.gitActions.runRawCommand(t))}};g();var Kp=require("obsidian");var _a=class extends Kp.ItemView{constructor(t,n){super(t);this.plugin=n;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.contentEl.addClass("git-diff"),this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return wo.type}getDisplayText(){var t;if(((t=this.state)==null?void 0:t.bFile)!=null){let n=this.state.bFile.split("/").last();return n!=null&&n.endsWith(".md")&&(n=n.slice(0,-3)),`Diff: ${n}`}return wo.name}getIcon(){return wo.icon}async setState(t,n){this.state=t,Kp.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 t;if((t=this.state)!=null&&t.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 Ze&&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 s=await this.app.vault.adapter.read(i);n=[...`--- /dev/null
+++ ${this.state.bFile}
@@ -0,0 +1,${s.split(`
`).length} @@`.split(`
`),...s.split(`
`).map(a=>`+${a}`)].join(`
`)}}if(n){let s=this.parser.parseFromString(jp(n),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(s)}else{let s=this.contentEl.createDiv({cls:"obsidian-git-center"});s.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),s.createEl("br"),s.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};g();var Os=require("obsidian");var bc=require("@codemirror/commands");var Xp=require("@codemirror/search"),vc=require("@codemirror/state"),Ei=require("@codemirror/view");g();var Zp=require("obsidian"),wy=require("@codemirror/view");function g9(r){return r.selection.ranges.filter(e=>!e.empty).map(e=>r.sliceDoc(e.from,e.to)).join(r.lineBreak)}function w9(r){r.dispatch({...r.state.replaceSelection(""),userEvent:"delete.cut"})}function i2(r,e){r.dispatch({...r.state.replaceSelection(e),scrollIntoView:!0,userEvent:"input.paste"})}async function s2(r){if(!r&&navigator.clipboard.read){let e=await navigator.clipboard.read();for(let t of e)if(t.types.includes("text/html")){let n=await(await t.getType("text/html")).text();return(0,Zp.htmlToMarkdown)(n)}}return navigator.clipboard.readText()}var o2=wy.EditorView.domEventHandlers({contextmenu(r,e){r.preventDefault();let t=g9(e.state),n=!e.state.readOnly&&e.state.facet(wy.EditorView.editable),i=Zp.Menu.forEvent(r);return i.addItem(s=>s.setTitle("Cut").setIcon("scissors").setDisabled(!n||t.length===0).onClick(async()=>{await navigator.clipboard.writeText(t),w9(e)})),i.addItem(s=>s.setTitle("Copy").setIcon("copy").setDisabled(t.length===0).onClick(()=>navigator.clipboard.writeText(t))),i.addItem(s=>s.setTitle("Paste").setIcon("clipboard-paste").setDisabled(!n).onClick(async()=>i2(e,await s2(!1)))),i.addItem(s=>s.setTitle("Paste as plain text").setIcon("clipboard-type").setDisabled(!n).onClick(async()=>i2(e,await s2(!0)))),i.addItem(s=>s.setTitle("Select all").setIcon("scan").onClick(()=>e.dispatch({selection:{anchor:0,head:e.state.doc.length}}))),i.showAtMouseEvent(r),!0}});var a2=Ei.EditorView.theme({"& .cm-content":{caretColor:"transparent !important"},"&.cm-focused .cm-cursor, & .cm-dropCursor":{display:"none !important"}}),v9=10;function b9(r,e){let t=Number.isInteger(r)&&r>0?r:en.diffTimeout;return e?t:t*v9}var xa=class extends Os.ItemView{constructor(t,n){super(t);this.plugin=n;this.refreshing=!1;this.indexUnmerged=!1;this.ignoreNextModification=!1;this.navigation=!0,this.registerEvent(this.app.workspace.on("obsidian-git:status-changed",()=>{!this.mergeView||this.indexUnmerged?this.createMergeView().catch(console.error):this.updateRefEditors().catch(console.error)})),this.intervalRef=window.setInterval(()=>{this.mergeView&&this.updateRefEditors().catch(console.error)},30*1e3),this.registerEvent(this.app.vault.on("modify",i=>{this.isWorkingTreeBFile(i.path)&&(this.ignoreNextModification?this.ignoreNextModification=!1:this.updateModifiableEditor().catch(console.error))})),this.registerEvent(this.app.vault.on("delete",i=>{this.isWorkingTreeBFile(i.path)&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("create",i=>{this.isWorkingTreeBFile(i.path)&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("rename",(i,s)=>{(this.isWorkingTreeBFile(i.path)||this.isWorkingTreeBFile(s))&&this.createMergeView().catch(console.error)})),this.fileSaveDebouncer=(0,Os.debounce)(i=>{let s=this.state.bFile;s&&(this.ignoreNextModification=!0,this.plugin.app.vault.adapter.write(this.plugin.gitManager.getRelativeVaultPath(s),i).catch(o=>this.plugin.displayError(o)))},1e3,!1)}isWorkingTreeBFile(t){var n;return((n=this.state)==null?void 0:n.bFile)==null||this.state.bRef!=null||!this.plugin.gitManager?!1:t===this.plugin.gitManager.getRelativeVaultPath(this.state.bFile)}getViewType(){return go.type}getDisplayText(){var t;if(((t=this.state)==null?void 0:t.bFile)!=null){let n=this.state.bFile.split("/").last();n!=null&&n.endsWith(".md")&&(n=n.slice(0,-3));let i;return this.state.bRef==null?i=" (Working Tree)":this.state.bRef==""?i=" (Index)":i="("+this.state.bRef.substring(0,7)+")",`Diff: ${n} ${i}`}return go.name}getIcon(){return go.icon}async setState(t,n){this.state=t,Os.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await super.setState(t,n),await this.createMergeView()}getState(){return this.state}onClose(){return window.clearInterval(this.intervalRef),super.onClose()}async onOpen(){return await this.createMergeView(),super.onOpen()}async gitShow(t,n){try{return await this.plugin.gitManager.show(t,n,!1)}catch(i){if(i instanceof vr){if(t===""&&i.message.includes("is in the index, but not at stage 0")){this.indexUnmerged=!0;try{return await this.plugin.gitManager.show(":2",n,!1)}catch(s){if(s instanceof vr&&s.message.includes("is in the index, but not at stage 2"))return"";throw s}}if(i.message.includes("does not exist")||i.message.includes("unknown revision or path")||i.message.includes("exists on disk, but not in")||i.message.includes("fatal: Line truncated
`)+`
`;await this.plugin.gitManager.applyPatch(h),this.plugin.app.workspace.trigger("obsidian-git:refresh")},this.state.bRef==null){let s=n.createDiv();s.addClass("clickable-icon"),s.setAttr("aria-label","Reset hunk"),(0,Os.setIcon)(s,"undo"),s.onmousedown=o=>{var d;let a=this.mergeView.a,l=this.mergeView.b,c=qb(l.state),u=(d=n.parentElement)==null?void 0:d.indexOf(n),f=c.chunks[u];if(f){let h=f.fromA,p=f.toA,m=f.fromB,w=f.toB,y=a.state.sliceDoc(h,Math.max(h,p-1));h!=p&&w<=l.state.doc.length&&(y+=a.state.lineBreak),l.dispatch({changes:{from:m,to:Math.min(l.state.doc.length,w),insert:y},userEvent:"revert"})}}}return n.onmousedown=s=>{s.preventDefault(),s.stopPropagation()},n}async createMergeView(){var t,n,i;if((t=this.state)!=null&&t.aFile&&((n=this.state)!=null&&n.bFile)&&!this.refreshing&&this.plugin.gitManager){this.refreshing=!0;try{(i=this.mergeView)==null||i.destroy();let s=this.containerEl.children[1];s.empty(),this.contentEl.addClass("git-split-diff-view","git-diff"),this.bIsEditable=await this.bShouldBeEditable(),this.indexUnmerged=!1;let o=await this.gitShow(this.state.aRef,this.state.aFile),a;if(this.state.bRef!=null)a=await this.gitShow(this.state.bRef,this.state.bFile);else{let p=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);await this.app.vault.adapter.exists(p)?a=await this.app.vault.adapter.read(p):a=""}let l=[(0,Ei.lineNumbers)(),(0,Xp.highlightSelectionMatches)(),(0,Ei.drawSelection)(),Ei.keymap.of([...bc.standardKeymap,bc.indentWithTab]),(0,bc.history)(),(0,Xp.search)(),Ei.EditorView.lineWrapping,o2],c=Ei.ViewPlugin.define(p=>({update:m=>{if(m.docChanged&&!m.transactions.some(w=>w.annotation(vc.Transaction.remote))){let w=p.state.doc.toString();this.fileSaveDebouncer(w)}}})),u={doc:o,extensions:[...l,vc.EditorState.readOnly.of(!0),a2]},f=[...l];this.bIsEditable?f.push(c):f.push(vc.EditorState.readOnly.of(!0),a2);let d={doc:a,extensions:f};s.addClasses(["cm-s-obsidian","mod-cm6","markdown-source-view","cm-content"]);let h=this.plugin.gitManager instanceof Ze&&!this.indexUnmerged&&(this.state.bRef===void 0||this.state.bRef==="");this.mergeView=new Ip({b:d,a:u,collapseUnchanged:{minSize:6,margin:4},renderRevertControl:h?()=>this.renderButtons(s):void 0,revertControls:h?"a-to-b":void 0,diffConfig:{timeout:b9(this.plugin.settings.diffTimeout,this.bIsEditable)},parent:s})}finally{this.refreshing=!1}}}};g();var ZI=require("obsidian");g();g();g();var l2,c2,u2;typeof window!="undefined"&&((u2=(c2=(l2=window.__svelte)!=null?l2:window.__svelte={}).v)!=null?u2:c2.v=new Set).add("5");g();g();g();var Rn={};var lt=Symbol("uninitialized"),ni=Symbol("filename");var Qp="http://www.w3.org/1999/xhtml";g();g();g();g();var Jp=!0;g();var N=!1;g();var Fs=Array.isArray,f2=Array.prototype.indexOf,Ms=Array.prototype.includes,yc=Array.from,vy=Object.keys,ur=Object.defineProperty,an=Object.getOwnPropertyDescriptor,by=Object.getOwnPropertyDescriptors,yy=Object.prototype,d2=Array.prototype,_c=Object.getPrototypeOf,_y=Object.isExtensible;function xy(r){return typeof r=="function"}var Cr=()=>{};function em(r){for(var e=0;e<r.length;e++)r[e]()}function tm(){var r,e,t=new Promise((n,i)=>{r=n,e=i});return{promise:t,resolve:r,reject:e}}g();g();var Nr=Symbol("$state"),rm=Symbol("component"),Tf=Symbol("legacy props"),p2=Symbol(""),nm=Symbol("proxy path"),im=Symbol("attributes"),Rf=Symbol("class"),Ey=Symbol("style"),$f=Symbol("text"),Ea=Symbol("form reset"),Sy=Symbol("hmr anchor"),Ds=new class extends Error{constructor(){super(...arguments);Xe(this,"name","StaleReactionError");Xe(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},h2,ky=!!((h2=globalThis.document)!=null&&h2.contentType)&&globalThis.document.contentType.includes("xml");var xc=3,ii=8;g();g();g();g();var Ls="font-weight: bold",Ns="font-weight: normal";function m2(r){N?console.warn(`%c[svelte] await_reactivity_loss
%cDetected reactivity loss when reading \`${r}\`. This happens when state is read in an async function after an earlier \`await\`
https://svelte.dev/e/await_reactivity_loss`,Ls,Ns):console.warn("https://svelte.dev/e/await_reactivity_loss")}function g2(r,e){N?console.warn(`%c[svelte] await_waterfall
%cAn async derived, \`${r}\` (${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`,Ls,Ns):console.warn("https://svelte.dev/e/await_waterfall")}function w2(){N?console.warn(`%c[svelte] derived_inert
%cReading a derived belonging to a now-destroyed effect may result in stale values
https://svelte.dev/e/derived_inert`,Ls,Ns):console.warn("https://svelte.dev/e/derived_inert")}function v2(r,e,t){N?console.warn(`%c[svelte] hydration_attribute_changed
%cThe \`${r}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${t}\`, will be ignored in favour of the server value
https://svelte.dev/e/hydration_attribute_changed`,Ls,Ns):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Sa(r){N?console.warn(`%c[svelte] hydration_mismatch
%c${r?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${r}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/hydration_mismatch`,Ls,Ns):console.warn("https://svelte.dev/e/hydration_mismatch")}function b2(){N?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,Ls,Ns):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function sm(r){N?console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${r}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,Ls,Ns):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function y2(){N?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Ls,Ns):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function _2(r){N?console.warn(`%c[svelte] transition_slide_display
%cThe \`slide\` transition does not work correctly for elements with \`display: ${r}\`
https://svelte.dev/e/transition_slide_display`,Ls,Ns):console.warn("https://svelte.dev/e/transition_slide_display")}var ue=!1;function Zt(r){ue=r}var Ee;function st(r){if(r===null)throw Sa(),Rn;return Ee=r}function Tr(){return st(yr(Ee))}function V(r){if(ue){if(yr(Ee)!==null)throw Sa(),Rn;Ee=r}}function ka(r=1){if(ue){for(var e=r,t=Ee;e--;)t=yr(t);Ee=t}}function rs(r=!0){for(var e=0,t=Ee;;){if(t.nodeType===ii){var n=t.data;if(n==="]"){if(e===0)return t;e-=1}else(n==="["||n==="[!"||n[0]==="["&&!isNaN(Number(n.slice(1))))&&(e+=1)}var i=yr(t);r&&t.remove(),t=i}}function Aa(r){if(!r||r.nodeType!==ii)throw Sa(),Rn;return r.data}g();g();g();g();function om(r){return r===this.v}function Ay(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function am(r){return!Ay(r,this.v)}g();g();function x2(r){if(N){let e=new Error(`invariant_violation
An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${r}"
https://svelte.dev/e/invariant_violation`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/invariant_violation")}function lm(r){if(N){let e=new Error(`lifecycle_outside_component
\`${r}(...)\` 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 S2(){if(N){let r=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 r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function Cy(){if(N){let r=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 r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function k2(){if(N){let r=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/derived_references_self")}function Ty(r,e,t){if(N){let n=new Error(`each_key_duplicate
${t?`Keyed each block has duplicate key \`${t}\` at indexes ${r} and ${e}`:`Keyed each block has duplicate key at indexes ${r} and ${e}`}
https://svelte.dev/e/each_key_duplicate`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function A2(r,e,t){if(N){let n=new Error(`each_key_volatile
Keyed each block has key that is not idempotent \u2014 the key for item at index ${r} was \`${e}\` but is now \`${t}\`. Keys must be the same each time for a given item
https://svelte.dev/e/each_key_volatile`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_volatile")}function C2(r){if(N){let e=new Error(`effect_in_teardown
\`${r}\` 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 T2(){if(N){let r=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 r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function R2(r){if(N){let e=new Error(`effect_orphan
\`${r}\` 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 $2(){if(N){let r=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 r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function P2(){if(N){let r=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/hydration_failed")}function I2(r){if(N){let e=new Error(`props_invalid_value
Cannot do \`bind:${r}={undefined}\` when \`${r}\` 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 O2(r){if(N){let e=new Error(`rune_outside_svelte
The \`${r}\` 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 F2(){if(N){let r=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 r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function M2(){if(N){let r=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function D2(){if(N){let r=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 r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function L2(){if(N){let r=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw r.name="Svelte error",r}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}g();var Xt=!1,Bs=!1,Si=!1;g();g();g();var If=null;function Rr(r,e){return r.label=e,um(r.v,e),r}function um(r,e){var t;return(t=r==null?void 0:r[nm])==null||t.call(r,e),r}g();function ki(r){let e=new Error,t=_9();return t.length===0?null:(t.unshift(`
`),ur(e,"stack",{value:t.join(`
`)}),ur(e,"name",{value:r}),e)}function _9(){let r=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=r,!e)return[];let t=e.split(`
`),n=[];for(let i=0;i<t.length;i++){let s=t[i],o=s.replaceAll("\\","/");if(s.trim()!=="Error"){if(s.includes("validate_each_keys"))return[];o.includes("svelte/src/internal")||o.includes("node_modules/.vite")||n.push(s)}}return n}function B2(r,e){if(!N)throw new Error("invariant(...) was not guarded by if (DEV)");r||x2(e)}g();g();var Pe=null;function Hs(r){Pe=r}var Ai=null;function kc(r){Ai=r}var Ci=null;function fm(r){Ci=r}function gt(r,e=!1,t){Pe={p:Pe,i:!1,c:null,e:null,s:r,x:null,r:ie,l:Bs&&!e?{s:null,u:null,$:[]}:null},N&&(Pe.function=t,Ci=t)}function wt(r){var i;var e=Pe,t=e.e;if(t!==null){e.e=null;for(var n of t)Ry(n)}return r!==void 0&&(e.x=r),e.i=!0,Pe=e.p,N&&(Ci=(i=Pe==null?void 0:Pe.function)!=null?i:null),Of(r)}function Of(r={}){return ur(r,rm,{value:!0}),r}function ns(){return!Bs||Pe!==null&&Pe.l===null}g();g();var Ca=[];function H2(){var r=Ca;Ca=[],em(r)}function Nt(r){if(Ca.length===0&&!Ta){var e=Ca;queueMicrotask(()=>{e===Ca&&H2()})}Ca.push(r)}function G2(){for(;Ca.length>0;)H2()}g();g();var x9=-7169;function ot(r,e){r.f=r.f&x9|e}function Ac(r){(r.f&512)!==0||r.deps===null?ot(r,1024):ot(r,4096)}function dm(r,e){(r.f&2048)!==0?e.set(r,2048):(r.f&4096)!==0&&e.get(r)!==2048&&e.set(r,4096),ot(r,1024)}g();function U2(r){return`{${r.toString().replace(/^async \(\) => /,"").replace(/^\(/,"").replace(/\$\.get\((.+?)\)/g,(e,t)=>t).replace(/\$\.track_reactivity_loss\((.+?)\)\(\)/g,(e,t)=>t).replace(/\)$/,"")}}`}g();g();g();function $y(r){ue&&dr(r)!==null&&Cc(r)}var j2=!1;function Py(){j2||(j2=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(let t of r.target.elements)(e=t[Ea])==null||e.call(t)})},{capture:!0}))}function Br(r){var e=he,t=ie;Jt(null),er(null);try{return r()}finally{Jt(e),er(t)}}function Iy(r,e,t,n=t){r.addEventListener(e,()=>Br(t));let i=r[Ea];i?r[Ea]=()=>{i(),n(!0)}:r[Ea]=()=>n(!0),Py()}g();function hm(r,e,t,n){let i=ns()?Ro:Pa;var s=r.filter(h=>!h.settled),o=e.map(i);if(N&&o.forEach((h,p)=>{h.label=e[p].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(m,w)=>w)}),t.length===0&&s.length===0){n(o);return}var a=ie,l=z2(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(h=>h.promise)):null;function u(h){if((a.f&16384)===0){l();try{n([...o,...h])}catch(p){cn(p,a)}Tc()}}var f=Oy();if(t.length===0){c.then(()=>u([])).finally(f);return}function d(){Promise.all(t.map(h=>My(h))).then(u).catch(h=>cn(h,a)).finally(f)}c?c.then(()=>{if((a.f&16384)!==0){f();return}l(),d(),Tc()}):d()}function z2(){var r=ie,e=he,t=Pe,n=ve;if(N)var i=Ai;return function(o=!0){er(r),Jt(e),Hs(t),o&&(r.f&16384)===0&&(n==null||n.activate(),n==null||n.apply()),N&&(Fy(null),kc(i))}}var E9=!1;function Tc(r=!0){var e;E9=!1,er(null),Jt(null),Hs(null),r&&((e=ve)==null||e.deactivate()),N&&(Fy(null),kc(null))}function Oy(){var r=ie,e=r.b,t=ve,n=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(n,r),()=>{e==null||e.update_pending_count(-1,t),t.decrement(n,r)}}var un=null;function Fy(r){un=r}var Mf=new Set;function Ro(r){var e=2050;ie!==null&&(ie.f|=524288);let t={ctx:Pe,deps:null,effects:null,equals:om,f:e,fn:r,reactions:null,rv:0,v:lt,wv:0,parent:ie,ac:null};return N&&Si&&(t.created=ki("created at")),t}var Rc=Symbol("obsolete");function My(r,e,t){let n=ie;n===null&&S2();var i=void 0,s=$r(lt);N&&(s.label=e!=null?e:U2(r));var o=!he,a=new Set;return q2(()=>{var h,p;var l=ie;N&&(un={effect:l,effect_deps:new Set,warned:!1});var c=tm();i=c.promise;try{Promise.resolve(r()).then(c.resolve,m=>{m!==Ds&&c.reject(m)}).finally(Tc)}catch(m){c.reject(m),Tc()}if(N){if(un){if(l.deps!==null)for(let m=0;m<Gr;m+=1)un.effect_deps.add(l.deps[m]);if(hr!==null)for(let m=0;m<hr.length;m+=1)un.effect_deps.add(hr[m])}un=null}var u=ve;if(o){if((l.f&32768)!==0)var f=Oy();if((h=n.b)!=null&&h.is_rendered())(p=u.async_deriveds.get(l))==null||p.reject(Rc);else for(let m of a.values())m.reject(Rc);a.add(c),u.async_deriveds.set(l,c)}let d=(m,w=void 0)=>{N&&(un=null),f==null||f(),a.delete(c),w!==Rc&&(u.activate(),w?(s.f|=8388608,Ri(s,w)):((s.f&8388608)!==0&&(s.f^=8388608),N&&t!==void 0&&!s.equals(m)&&(Mf.add(s),setTimeout(()=>{Mf.has(s)&&(l.f&16384)===0&&(g2(s.label,t),Mf.delete(s))})),Ri(s,m)),u.deactivate())};c.promise.then(d,m=>d(null,m||"unknown"))}),Sr(()=>{for(let l of a)l.reject(Rc)}),N&&(s.f|=4194304),new Promise(l=>{function c(u){function f(){u===i?l(s):c(i)}u.then(f,f)}c(i)})}function He(r){let e=Ro(r);return Xt||gm(e),e}function Pa(r){let e=Ro(r);return e.equals=am,e}function V2(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Rt(e[t])}}var Dy=[];function Df(r){var e,t=ie,n=r.parent;if(!Pn&&n!==null&&r.v!==lt&&(n.f&24576)!==0)return w2(),r.v;if(er(n),N){let i=Ia;pm(new Set);try{Ms.call(Dy,r)&&k2(),Dy.push(r),V2(r),e=mm(r)}finally{er(t),pm(i),Dy.pop()}}else try{V2(r),e=mm(r)}finally{er(t)}return e}function Ly(r){var t,n,i;var e=Df(r);if(!r.equals(e)&&(r.wv=$c(),(!((t=ve)!=null&&t.is_ Line truncated
${n}in ${((o=e.fn)==null?void 0:o.name)||"<unknown>"}`,s=e.ctx;s!==null;)i+=`
${n}in ${(a=s.function)==null?void 0:a[ni].split("/").pop()}`,s=s.p;return{message:r.message+`
${i}
`,stack:(l=r.stack)==null?void 0:l.split(`
`).filter(c=>!c.includes("svelte/src/internal")).join(`
`)}}}function dI(r){let e=Qy.get(r);e&&(ur(r,"message",{value:e.message}),ur(r,"stack",{value:e.stack}))}function pI(r){ie===null&&(he===null&&R2(r),T2()),Pn&&C2(r)}function F9(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Pi(r,e){var o,a;var t=ie;if(N)for(;t!==null&&(t.f&131072)!==0;)t=t.parent;t!==null&&(t.f&8192)!==0&&(r|=8192);var n={ctx:Pe,deps:null,nodes:null,f:r|2048|512,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};N&&(n.component_function=Ci),(o=ve)==null||o.register_created_effect(n);var i=n;if((r&4)!==0)Oc!==null?Oc.push(n):In.ensure().schedule(n);else if(e!==null){try{is(n)}catch(l){throw Rt(n),l}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&(i.f&524288)===0&&(i=i.first,(r&16)!==0&&(r&65536)!==0&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=t,t!==null&&F9(i,t),he!==null&&(he.f&2)!==0&&(r&64)===0)){var s=he;((a=s.effects)!=null?a:s.effects=[]).push(i)}return n}function To(){return he!==null&&!Ur}function Sr(r){let e=Pi(8,null);return ot(e,1024),e.teardown=r,e}function tr(r){var i;pI("$effect"),N&&ur(r,"name",{value:"$effect"});var e=ie.f,t=!he&&(e&32)!==0&&Pe!==null&&!Pe.i;if(t){var n=Pe;((i=n.e)!=null?i:n.e=[]).push(r)}else return Ry(r)}function Ry(r){return Pi(1048580,r)}function t_(r){In.ensure();let e=Pi(524352,r);return()=>{Rt(e)}}function mI(r){In.ensure();let e=Pi(524352,r);return(t={})=>new Promise(n=>{t.outro?ls(e,()=>{Rt(e),n(void 0)}):(Rt(e),n(void 0))})}function jr(r){return Pi(4,r)}function q2(r){return Pi(4718592,r)}function kr(r,e=0){return Pi(8|e,r)}function Ue(r,e=[],t=[],n=[]){hm(n,e,t,i=>{Pi(8,()=>{r(...i.map(R))})})}function Mn(r,e=0){var t=Pi(16|e,r);return N&&(t.dev_stack=Ai),t}function r_(r,e=0){var t=Pi(16777216|e,r);return N&&(t.dev_stack=Ai),t}function Wt(r){return Pi(524320,r)}function n_(r){var e=r.teardown;if(e!==null){let t=Pn,n=he;Jy(!0),Jt(null);try{e.call(null)}catch(i){cn(i,r.parent)}finally{Jy(t),Jt(n)}}}function Lf(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){let i=t.ac;i!==null&&Br(()=>{i.abort(Ds)});var n=t.next;(t.f&64)!==0?t.parent=null:Rt(t,e),t=n}}function gI(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&32)===0&&Rt(e),e=t}}function Rt(r,e=!0){var t=!1;(e||(r.f&262144)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(wI(r.nodes.start,r.nodes.end),t=!0),r.f|=33554432,Lf(r,e&&!t),Oa(r,0);var n=r.nodes&&r.nodes.t;if(n!==null)for(let s of n)s.stop();n_(r),r.f^=33554432,r.f|=16384;var i=r.parent;i!==null&&i.first!==null&&qy(r),N&&(r.component_function=null),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=r.b=null}function wI(r,e){for(;r!==null;){var t=r===e?null:yr(r);r.remove(),r=t}}function qy(r){var e=r.parent,t=r.prev,n=r.next;t!==null&&(t.next=n),n!==null&&(n.prev=t),e!==null&&(e.first===r&&(e.first=n),e.last===r&&(e.last=t))}function ls(r,e,t=!0){var n=[];r.f|=256,vI(r,n,!0);var i=()=>{t&&Rt(r),e&&e()},s=n.length;if(s>0){var o=()=>--s||i();for(var a of n)a.out(o)}else i()}function vI(r,e,t){if((r.f&8192)===0){r.f^=8192;var n=r.nodes&&r.nodes.t;if(n!==null)for(let a of n)(a.is_global||t)&&e.push(a);for(var i=r.first;i!==null;){var s=i.next;if((i.f&64)===0){var o=(i.f&65536)!==0||(i.f&32)!==0&&(r.f&16)!==0;vI(i,e,o?t:!1)}i=s}}}function Bc(r){r.f&=-257,bI(r,!0)}function bI(r,e){if((r.f&256)===0&&(r.f&8192)!==0){r.f^=8192,(r.f&1024)===0&&(ot(r,2048),In.ensure().schedule(r));for(var t=r.first;t!==null;){var n=t.next,i=(t.f&65536)!==0||(t.f&32)!==0;bI(t,i?e:!1),t=n}var s=r.nodes&&r.nodes.t;if(s!==null)for(let o of s)(o.is_global||e)&&o.in()}}function Hc(r,e){if(r.nodes)for(var t=r.nodes.start,n=r.nodes.end;t!==null;){var i=t===n?null:yr(t);e.append(t),t=i}}g();var yI=null;var Pn=!1;function Jy(r){Pn=r}var he=null,Ur=!1;function Jt(r){he=r}var ie=null;function er(r){ie=r}var dn=null;function gm(r){he!==null&&(!Xt&&(he.f&2097152)!==0||(he.f&2)!==0)&&(dn!=null?dn:dn=new Set).add(r)}var hr=null,Gr=0,On=null;function oI(r){On=r}var xI=1,Ba=0,Oo=Ba;function Zy(r){Oo=r}function $c(){return++xI}function Io(r){var e=r.f;if((e&2048)!==0)return!0;if((e&4096)!==0){for(var t=r.deps,n=t.length,i=0;i<n;i++){var s=t[i];if(Io(s)&&Ly(s),s.wv>r.wv)return!0}(e&512)!==0&&zt===null&&ot(r,1024)}return!1}function EI(r,e,t=!0){var n=r.reactions;if(n!==null&&!(!Xt&&dn!==null&&dn.has(r)))for(var i=0;i<n.length;i++){var s=n[i];(s.f&2)!==0?EI(s,e,!1):e===s&&(t?ot(s,2048):(s.f&1024)!==0&&ot(s,4096),Uf(s))}}function mm(r){var e=hr,t=Gr,n=On,i=he,s=dn,o=Pe,a=Ur,l=Oo,c=r.f;hr=null,Gr=0,On=null,he=(c&96)===0?r:null,dn=null,Hs(r.ctx),Ur=!1,Oo=++Ba,r.ac!==null&&(Br(()=>{r.ac.abort(Ds)}),r.ac=null);try{r.f|=2097152;var u=r.fn,f=u();r.f|=32768;var d=_I(r);if(ns()&&On!==null&&!Ur&&d!==null&&(r.f&6146)===0)for(var h=0;h<On.length;h++)EI(On[h],r);if(i!==null&&i!==r){if(Ba++,i.deps!==null)for(let p=0;p<t;p+=1)i.deps[p].rv=Ba;if(e!==null)for(let p of e)p.rv=Ba;On!==null&&(n===null?n=On:n.push(...On))}return(r.f&8388608)!==0&&(r.f^=8388608),f}catch(p){return _I(r),fI(p)}finally{r. Line truncated
`).some(l=>l.startsWith("https://svelte.dev/e/")))throw a;return a!==Rn&&console.warn("Failed to hydrate: ",a),e.recover===!1&&P2(),_m(),Cc(t),Zt(!1),Do(r,e)}finally{Zt(n),st(i)}}var Rm=new Map;function MI(r,{target:e,anchor:t,props:n={},events:i,context:s,intro:o=!0,transformError:a}){_m();var l=void 0,c=mI(()=>{var u=t!=null?t:e.appendChild(Vt());m_(u,{pending:()=>{}},h=>{gt({});var p=Pe;if(s&&(p.c=s),i&&(n.$$events=i),ue&&Ii(h,null),$m=o,l=r(h,n)||Of(),$m=!0,ue&&(ie.nodes.end=Ee,Ee===null||Ee.nodeType!==ii||Ee.data!=="]"))throw Sa(),Rn;wt()},a);var f=new Set,d=h=>{for(var p=0;p<h.length;p++){var m=h[p];if(!f.has(m)){f.add(m);var w=RI(m);for(let A of[e,document]){var y=Rm.get(A);y===void 0&&(y=new Map,Rm.set(A,y));var v=y.get(m);v===void 0?(A.addEventListener(m,Am,{passive:w}),y.set(m,1)):y.set(m,v+1)}}}};return d(yc(o_)),km.add(d),()=>{var w;for(var h of f)for(let y of[e,document]){var p=Rm.get(y),m=p.get(h);--m==0?(y.removeEventListener(h,Am),p.delete(h),p.size===0&&Rm.delete(y)):p.set(h,m)}km.delete(d),u!==t&&((w=u.parentNode)==null||w.removeChild(u))}});return g_.set(l,c),l}var g_=new WeakMap;function Ws(r,e){let t=g_.get(r);return t?(g_.delete(r),t(e)):(N&&b2(),Promise.resolve())}g();g();g();var Oi,fs,Bn,ja,Yf,Kf,Pm,qs=class{constructor(e,t=!0){Xe(this,"anchor");Re(this,Oi,new Map);Re(this,fs,new Map);Re(this,Bn,new Map);Re(this,ja,new Set);Re(this,Yf,!0);Re(this,Kf,e=>{if(O(this,Oi).has(e)){var t=O(this,Oi).get(e),n=O(this,fs).get(t);if(n)Bc(n),O(this,ja).delete(t);else{var i=O(this,Bn).get(t);i&&(Bc(i.effect),O(this,fs).set(t,i.effect),O(this,Bn).delete(t),N&&(i.fragment.lastChild[Sy]=this.anchor),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(let[s,o]of O(this,Oi)){if(O(this,Oi).delete(s),s===e)break;let a=O(this,Bn).get(o);a&&(Rt(a.effect),O(this,Bn).delete(o))}for(let[s,o]of O(this,fs)){if(s===t||O(this,ja).has(s))continue;let a=()=>{if(Array.from(O(this,Oi).values()).includes(s)){var c=document.createDocumentFragment();Hc(o,c),c.append(Vt()),O(this,Bn).set(s,{effect:o,fragment:c})}else Rt(o);O(this,ja).delete(s),O(this,fs).delete(s)};O(this,Yf)||!n?(O(this,ja).add(s),ls(o,a,!1)):a()}}});Re(this,Pm,e=>{O(this,Oi).delete(e);let t=Array.from(O(this,Oi).values());for(let[n,i]of O(this,Bn))t.includes(n)||(Rt(i.effect),O(this,Bn).delete(n))});this.anchor=e,Se(this,Yf,t)}ensure(e,t){var n=ve,i=xm();if(t&&!O(this,fs).has(e)&&!O(this,Bn).has(e))if(i){var s=document.createDocumentFragment(),o=Vt();s.append(o),O(this,Bn).set(e,{effect:Wt(()=>t(o)),fragment:s})}else O(this,fs).set(e,Wt(()=>t(this.anchor)));if(O(this,Oi).set(n,e),i){for(let[a,l]of O(this,fs))a===e?n.unskip_effect(l):n.skip_effect(l);for(let[a,l]of O(this,Bn))a===e?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(O(this,Kf)),n.ondiscard(O(this,Pm))}else ue&&(this.anchor=Ee),O(this,Kf).call(this,n)}};Oi=new WeakMap,fs=new WeakMap,Bn=new WeakMap,ja=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,Pm=new WeakMap;if(N){let r=function(e){if(!(e in globalThis)){let t;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(t!==void 0)return t;O2(e)},set:n=>{t=n}})}};r("$state"),r("$effect"),r("$derived"),r("$inspect"),r("$props"),r("$bindable")}function za(r){Pe===null&&lm("onMount"),Bs&&Pe.l!==null?q9(Pe).m.push(r):tr(()=>{let e=ct(r);if(typeof e=="function")return e})}function q9(r){var t;var e=r.l;return(t=e.u)!=null?t:e.u={a:[],b:[],m:[]}}g();g();var NI=new Map;function BI(r,e){var t=NI.get(r);t||(t=new Set,NI.set(r,t)),t.add(e)}g();g();g();g();g();g();g();g();g();function Ae(r,e,t=!1){var n;ue&&(n=Ee,Tr());var i=new qs(r),s=t?65536:0;function o(a,l){if(ue){var c=Aa(n);if(a!==parseInt(c.substring(1))){var u=rs();st(u),i.anchor=u,Zt(!1),i.ensure(a,l),Zt(!0);return}}i.ensure(a,l)}Mn(()=>{var a=!1;e((l,c=0)=>{a=!0,o(c,l)}),a||o(-1,null)},s)}g();g();g();function mn(r,e){return e}function tz(r,e,t){var f;for(var n=[],i=e.length,s,o=e.length,a=0;a<i;a++){let d=e[a];ls(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=r.outrogroups;v_(r,yc(s.done)),h.delete(s),h.size===0&&(r.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=n.length===0&&t!==null&&r.pending.size===0;if(l){var c=t,u=c.parentNode;Cc(u),u.append(c),r.items.clear()}v_(r,e,!l)}else s={pending:new Set(e),done:new Set},((f=r.outrogroups)!=null?f:r.outrogroups=new Set).add(s)}function v_(r,e,t=!0){var n;if(r.pending.size>0){n=new Set;for(let o of r.pending.values())for(let a of o)n.add(r.items.get(a).e)}for(var i=0;i<e.length;i++){var s=e[i];if(n!=null&&n.has(s)){s.f|=33554432;let o=document.createDocumentFragment();Hc(s,o)}else Rt(e[i],t)}}var Lo;function gn(r,e,t,n,i,s=null){var o=r,a=new Map,l=(e&4)!==0;if(l){var c=r;o=ue?st(dr(c)):c.appendChild(Vt())}ue&&Tr();var u=null,f=Pa(()=>{var v=t();return Fs(v)?v:v==null?[]:yc(v)});N&&Rr(f,"{#each ...}");var d=new Map,h=!0;function p(v){if((y.effect.f&16384)===0){y.pending.delete(v);var A=R(f);y.fallback=u,rz(y,A,o,e,n),u!==null&&(A.length===0?(u.f&33554432)===0?Bc(u):(u.f^=3355 Line truncated
\r\f\xA0\v\uFEFF`];function WI(r,e,t){var n=r==null?"":""+r;if(e&&(n=n?n+" "+e:e),t){for(var i of Object.keys(t))if(t[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,o=0;(o=n.indexOf(i,o))>=0;){var a=o+s;(o===0||VI.includes(n[o-1]))&&(a===n.length||VI.includes(n[a]))?n=(o===0?"":n.substring(0,o))+n.substring(a+1):o=a}}return n===""?null:n}g();function dt(r,e,t,n,i,s){var o=r[Rf];if(ue||o!==t||o===void 0){var a=WI(t,n,s);(!ue||a!==r.getAttribute("class"))&&(a==null?r.removeAttribute("class"):e?r.className=a:r.setAttribute("class",a)),r[Rf]=t}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&r.classList.toggle(l,c)}return s}g();g();var bz=Symbol("is custom element"),yz=Symbol("is html"),_z=ky?"link":"LINK";function ye(r,e,t,n){var i=xz(r);if(ue&&(i[e]=r.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&r.nodeName===_z)){n||Sz(r,e,t!=null?t:"");return}var s=i[e];s!==(i[e]=t)&&(e==="loading"&&(r[p2]=t),t==null?r.removeAttribute(e):typeof t!="string"&&Ez(r).has(e)?r[e]=t:ue&&(typeof t=="number"||typeof t=="boolean")&&s===String(t)||r.setAttribute(e,t))}function xz(r){var e,t;return(t=r[e=im])!=null?t:r[e]={[bz]:r.nodeName.includes("-"),[yz]:r.namespaceURI===Qp}}var qI=new Map;function Ez(r){var e=r.getAttribute("is")||r.nodeName,t=qI.get(e);if(t)return t;qI.set(e,t=new Set);for(var n,i=r,s=Element.prototype;s!==i;){n=by(i);for(var o in n)n[o].set&&o!=="innerHTML"&&o!=="textContent"&&o!=="innerText"&&t.add(o);i=_c(i)}return t}function Sz(r,e,t){var n;N&&(e==="srcset"&&kz(r,t)||y_((n=r.getAttribute(e))!=null?n:"",t)||v2(e,r.outerHTML.replace(r.innerHTML,r.innerHTML&&"..."),String(t)))}function y_(r,e){return r===e?!0:new URL(r,document.baseURI).href===new URL(e,document.baseURI).href}function YI(r){return r.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function kz(r,e){var t=YI(r.srcset),n=YI(e);return n.length===t.length&&n.every(([i,s],o)=>s===t[o][1]&&(y_(t[o][0],i)||y_(i,t[o][0])))}g();g();g();function E_(r,e,t=e){var n=new WeakSet;Iy(r,"input",async i=>{N&&r.type==="checkbox"&&Cy();var s=i?r.defaultValue:r.value;if(s=__(r)?x_(s):s,t(s),ve!==null&&n.add(ve),await Sm(),s!==(s=e())){var o=r.selectionStart,a=r.selectionEnd,l=r.value.length;if(r.value=s!=null?s:"",a!==null){var c=r.value.length;o===a&&a===l&&c>l?(r.selectionStart=c,r.selectionEnd=c):(r.selectionStart=o,r.selectionEnd=Math.min(a,c))}}}),(ue&&r.defaultValue!==r.value||ct(e)==null&&r.value)&&(t(__(r)?x_(r.value):r.value),ve!==null&&n.add(ve)),kr(()=>{N&&r.type==="checkbox"&&Cy();var i=e();if(r===document.activeElement){var s=Xt?oi:ve;if(n.has(s))return}__(r)&&i===x_(r.value)||r.type==="date"&&!i&&!r.value||i!==r.value&&(r.value=i!=null?i:"")})}function __(r){var e=r.type;return e==="number"||e==="range"}function x_(r){return r===""?null:+r}g();g();g();g();g();function S_(r,e){return r===e||(r==null?void 0:r[Nr])===e}function rt(r=Of(),e,t,n){var i=Pe.r,s=ie;return jr(()=>{var o,a;return kr(()=>{o=a,a=(n==null?void 0:n())||[],ct(()=>{S_(t(...a),r)||(e(r,...a),o&&S_(t(...o),r)&&e(null,...o))})}),()=>{let l=s;for(;l!==i&&l.parent!==null&&l.parent.f&33554432;)l=l.parent;let c=()=>{a&&S_(t(...a),r)&&e(null,...a)},u=l.teardown;l.teardown=()=>{c(),u==null||u()}}}),r}g();g();g();g();g();g();g();g();g();var Fm=!1;function A_(r){var e=Fm;try{return Fm=!1,[r(),Fm]}finally{Fm=e}}function Gn(r,e,t,n){var C,S;var i=!Bs||(t&2)!==0,s=(t&8)!==0,o=(t&16)!==0,a=n,l=!0,c=void 0,u=()=>o&&i?(c!=null||(c=Ro(n)),R(c)):(l&&(l=!1,a=o?ct(n):n),a);let f;if(s){var d=Nr in r||Tf in r;f=(S=(C=an(r,e))==null?void 0:C.set)!=null?S:d&&e in r?T=>r[e]=T:void 0}var h,p=!1;s?[h,p]=A_(()=>r[e]):h=r[e],h===void 0&&n!==void 0&&(h=u(),f&&(i&&I2(e),f(h)));var m;if(i?m=()=>{var T=r[e];return T===void 0?u():(l=!0,T)}:m=()=>{var T=r[e];return T!==void 0&&(a=void 0),T===void 0?a:T},i&&(t&4)===0)return m;if(f){var w=r.$$legacy;return(function(T,b){return arguments.length>0?((!i||!b||w||p)&&f(b?m():T),T):m()})}var y=!1,v=((t&1)!==0?Ro:Pa)(()=>(y=!1,m()));N&&(v.label=e),s&&R(v);var A=ie;return(function(T,b){if(arguments.length>0){let x=b?R(v):i&&s?at(T):T;return X(v,x),y=!0,a!==void 0&&(a=x),T}return Pn&&y||(A.f&16384)!==0?v.v:R(v)})}g();g();g();function KI(r){return new C_(r)}var Ys,ui,C_=class{constructor(e){Re(this,Ys);Re(this,ui);var s,o;var t=new Map,n=(a,l)=>{var c=Da(l,!1,!1);return t.set(a,c),c};let i=new Proxy({...e.props||{},$$events:{}},{get(a,l){var c;return R((c=t.get(l))!=null?c:n(l,Reflect.get(a,l)))},has(a,l){var c;return l===Tf?!0:(R((c=t.get(l))!=null?c:n(l,Reflect.get(a,l))),Reflect.has(a,l))},set(a,l,c){var u;return X((u=t.get(l))!=null?u:n(l,c),c),Reflect.set(a,l,c)}});Se(this,ui,(e.hydrate?w_:Do)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover,transformError:e.transformError})),!Xt&&(!((o=e==null?void 0:e.props)!=null&&o.$$host)||e.sync===!1)&&Po(),Se(this,Ys,i.$$events);for(let a of Object.keys(O(this,ui)))a==="$set"||a==="$destroy"||a==="$on"||ur(this,a,{get(){return O(t Line truncated
${(0,td.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)}
${e.log.message}
${e.log.body?`
`+e.log.body:""}`}),s=Ie(!0),o=Ie(at({}));function a(E){let k=E.author.name;return e.plugin.settings.authorInHistoryView=="full"?k:e.plugin.settings.authorInHistoryView=="initials"?k.split(" ").filter(M=>M.length>0).map(M=>M[0].toUpperCase()).join(""):""}var l=tV(),c=W(l);let u;var f=W(c),d=W(f);let h;var p=K(d,2),m=W(p);{var w=E=>{var k=Xz(),$=Ye(k,!0);Ue(M=>Ke($,M),[()=>e.log.refs.join(", ")]),te(E,k)};Ae(m,E=>{e.log.refs.length>0&&E(w)})}var y=K(m,2);{var v=E=>{var k=Qz(),$=Ye(k,!0);Ue(M=>Ke($,M),[()=>a(e.log)]),te(E,k)};Ae(y,E=>{var k;e.plugin.settings.authorInHistoryView!="hide"&&((k=e.log.author)!=null&&k.name)&&E(v)})}var A=K(y,2);{var C=E=>{var k=Jz(),$=Ye(k,!0);Ue(M=>Ke($,M),[()=>(0,td.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)]),te(E,k)};Ae(A,E=>{e.plugin.settings.dateInHistoryView&&E(C)})}var S=K(A,2),T=Ye(S,!0);V(p),V(f),Qf(f,()=>E=>{(0,td.setTooltip)(E,R(i),{placement:R(n),classes:["obsidian-git-commit-tooltip"]})});var b=K(f,2);{var x=E=>{var k=eV(),$=W(k);{var M=P=>{ed(P,{get hierarchy(){return R(t)},get plugin(){return e.plugin},get view(){return e.view},topLevel:!0,get closed(){return R(o)},set closed(F){X(o,F,!0)}})},D=P=>{var F=Vs(),_e=Fn(F);gn(_e,17,()=>e.log.diff.files,mn,(Q,oe)=>{Jf(Q,{get view(){return e.view},get diff(){return R(oe)}})}),te(P,F)};Ae($,P=>{e.showTree?P(M):P(D,-1)})}V(k),ci(3,k,()=>Di,()=>({duration:150})),te(E,k)};Ae(b,E=>{R(s)||E(x)})}V(c),V(l),Ue(()=>{u=dt(c,1,"tree-item nav-folder",null,u,{"is-collapsed":R(s)}),ye(f,"aria-label",R(i)),h=dt(d,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,h,{"is-collapsed":R(s)}),Ke(T,e.log.message)}),de("click",f,()=>X(s,!R(s))),te(r,l),wt()}Ot(["click"]);var nV=pe('<div class="tree-item nav-folder mod-root"></div>'),iV=pe('<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>'),sV={hash:"svelte-12n6twc",code:""};function I_(r,e){gt(e,!0),Hn(r,sV);let t=Gn(e,"plugin",15),n=Ie(!1),i=at([]),s=Ie(void 0),o=Ie(at(t().settings.treeStructure)),a,l=Mm(u);tr(()=>{a&&a.empty()}),za(()=>{let S=e.view.app.workspace.on("obsidian-git:refs-changed",()=>{l().catch(console.error)});return()=>e.view.app.workspace.offref(S)}),tr(()=>{i.forEach(S=>(0,P_.setIcon)(S,S.getAttr("data-icon")))}),za(()=>{let S=new IntersectionObserver(b=>{var x;(x=b[0])!=null&&x.isIntersecting&&!R(n)&&f().catch(console.error)}),T=activeDocument.querySelector("#sentinel");return T&&S.observe(T),()=>{S.disconnect()}}),l().catch(console.error);function c(){l().catch(console.error)}async function u(){var b,x;if(!t().gitReady){X(s,void 0);return}X(n,!0);let S=t().gitManager instanceof Ze,T;((x=(b=R(s))==null?void 0:b.length)!=null?x:0)==0?T=S?50:10:T=R(s).length;try{X(s,await t().gitManager.log(void 0,!1,T),!0)}finally{X(n,!1)}}async function f(){var x;if(!t().gitReady||R(s)===void 0)return;X(n,!0);let T=t().gitManager instanceof Ze?50:10,b=await t().gitManager.log(void 0,!1,T,(x=R(s).last())==null?void 0:x.hash);R(s).push(...b.slice(1)),X(n,!1)}var d=iV(),h=W(d),p=W(h),m=W(p);rt(m,S=>i[0]=S,()=>i==null?void 0:i[0]);var w=K(m,2);let y;rt(w,S=>i[1]=S,()=>i==null?void 0:i[1]),V(p),V(h);var v=K(h,2),A=W(v);{var C=S=>{var T=nV();gn(T,21,()=>R(s),mn,(b,x)=>{$_(b,{get view(){return e.view},get showTree(){return R(o)},get log(){return R(x)},get plugin(){return t()}})}),V(T),te(S,T)};Ae(A,S=>{R(s)&&S(C)})}ka(4),V(v),V(d),Ue(()=>{ye(m,"data-icon",R(o)?"list":"folder"),y=dt(w,1,"clickable-icon nav-action-button",null,y,{loading:R(n)})}),de("click",m,()=>{X(o,!R(o)),(0,P_.setIcon)(i[0],R(o)?"list":"folder"),t(t().settings.treeStructure=R(o),!0),t().saveSettings()}),de("click",w,c),te(r,d),wt()}Ot(["click"]);var rd=class extends ZI.ItemView{constructor(e,t){super(e),this.plugin=t,this.hoverPopover=null}getViewType(){return tn.type}getDisplayText(){return tn.name}getIcon(){return tn.icon}async onClose(){return this._view&&await Ws(this._view),super.onClose()}async reload(){this._view&&await Ws(this._view),this._view=Do(I_,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}async onOpen(){return await this.reload(),super.onOpen()}};g();var XI=require("@codemirror/commands"),QI=require("@codemirror/search"),O_=require("@codemirror/state"),hs=require("@codemirror/view"),JI=require("obsidian");var oV=hs.EditorView.theme({"&":{height:"100%"},".cm-scroller":{overflow:"auto"},"& .cm-content":{caretColor:"transparent !important"},"&.cm-focused .cm-cursor, & .cm-dropCursor":{display:"none !important"}}),nd=class extends JI.ItemView{constructor(t,n){super(t);this.plugin=n;this.navigation=!0,this.contentEl.addClass("git-read-only-file-view","cm-s-obsidian","mod-cm6","markdown-source-view"),this.registerEvenLine truncated
.repository-missing.svelte-5wq9p > .git-commit-msg:where(.svelte-5wq9p),
.repository-missing.svelte-5wq9p > .nav-files-container:where(.svelte-5wq9p) {display:none;}.repository-notice.svelte-5wq9p {flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-4-3);padding:var(--size-4-6);text-align:center;}.repository-notice.svelte-5wq9p p:where(.svelte-5wq9p) {margin:0;color:var(--text-muted);}.repository-actions.svelte-5wq9p {display:flex;flex-wrap:wrap;justify-content:center;gap:var(--size-4-2);}.commit-action-group.svelte-5wq9p {display:inline-flex;flex:0 0 auto;gap:0;overflow:hidden;border:1px solid var(--background-modifier-border);border-radius:var(--radius-s);}.commit-action-group.svelte-5wq9p .nav-action-button:where(.svelte-5wq9p) {margin:0;border-radius:0;}.commit-action-group.svelte-5wq9p .nav-action-button:where(.svelte-5wq9p) + .nav-action-button:where(.svelte-5wq9p) {border-left:1px solid var(--background-modifier-border);}.commit-action-group.svelte-5wq9p #commit-menu:where(.svelte-5wq9p) {width:var(--size-4-5);padding-right:0;padding-left:0;}.merge-status.svelte-5wq9p {color:var(--text-warning);}.commit-msg-input.svelte-5wq9p {width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field);}.git-commit-msg.svelte-5wq9p {position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto;}.conflicts.svelte-5wq9p {--nav-indentation-guide-color: var(--text-warning);--collapse-icon-color: var(--text-warning);--collapse-icon-color-collapsed: var(--text-warning);}.conflicts.svelte-5wq9p > .nav-folder-title:where(.svelte-5wq9p) {color:var(--text-warning);}.conflicts.svelte-5wq9p .nav-folder-collapse-indicator:where(.svelte-5wq9p) {color:var(--text-warning);}.conflicts.svelte-5wq9p .nav-folder-collapse-indicator:where(.svelte-5wq9p) svg:where(.svelte-5wq9p) {color:var(--text-warning);}.conflicts.svelte-5wq9p .topLevel .nav-folder-collapse-indicator {color:var(--text-warning);}.conflicts.svelte-5wq9p .topLevel .nav-folder-collapse-indicator svg {color:var(--text-warning);}.conflicts.svelte-5wq9p .tree-item-children:where(.svelte-5wq9p) {border-inline-start-color:var(--text-warning);}main.svelte-5wq9p .git-tools:where(.svelte-5wq9p) .files-count:where(.svelte-5wq9p) {padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center;}.nav-folder-title.svelte-5wq9p {align-items:center;}.git-commit-msg-clear-button.svelte-5wq9p {position:absolute;background:transparent;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:-4px;right:2px;bottom:0px;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0 0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color 0.15s ease-in-out;}.git-commit-msg-clear-button.svelte-5wq9p:after {content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;mask-image:url("data:image/svg+xml,<svg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM3.8705 3.09766L6.00003 5.22718L8.12955 3.09766L8.9024 3.8705L6.77287 6.00003L8.9024 8.12955L8.12955 8.9024L6.00003 6.77287L3.8705 8.9024L3.09766 8.12955L5.22718 6.00003L3.09766 3.8705L3.8705 3.09766Z' fill='currentColor'/></svg>");mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,<svg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM3.8705 3.09766L6.00003 5.22718L8.12955 3.09766L8.9024 3.8705L6.77287 6.00003L8.9024 8.12955L8.12955 8.9024L6.00003 6.77287L3.8705 8.9024L3.09766 8.12955L5.22718 6.00003L3.09766 3.8705L3.8705 3.09766Z' fill='currentColor'/></svg>");-webkit-mask-repeat:no-repeat;}`};function D_(r,e){gt(e,!0),Hn(r,MV);let t=Gn(e,"plugin",7),n=Gn(e,"view",7),i=Ie(!1),s=Ie(!1),o=Ie(!1),a=Ie(!1),l=Ie(void 0),c=Ie(at([])),u=He(()=>t().settings.commitMessage),f=at([]),d=Ie(void 0),h=Ie(void 0),p=Ie(void 0),m=Ie(void 0),w=Ie(!0),y=Ie(!0),v=Ie(!0),A=Ie(!0),C=Ie(at({})),S=Promise.resolve(),T=He(()=>{var H,ae;return[...(ae=(H=R(l))==null?void 0:H.conflicted)!=null?ae:[]].sort(($e,ht)=>{let qt=R(C)[$e]===0?0:1,jn=R(C)[ht]===0?0:1;return qt!==jn?qt-jn:$e.localeCompare(ht)})}),b=Ie(0),x=Ie(at({})),E=Ie(at({})),k=Ie(at({})),$=Ie(at({})),M=He(()=>{var H,ae,$e,ht;return((ae=(H=R(l))==null?void 0:H.staged.length)!=null?ae:0)+((ht=($e=R(l))==null?void 0:$e.stagedOutsideVault)!=null?ht:0)}),D=He(()=>{var H,ae;return(ae=(H=R(l))==null?void 0:H.changed.length)!=null?ae:0}),P=He(()=>{var H,ae,$e,ht;return((ae=(H=R(l))==null?void 0:H.conflicted.length)!=null?ae:0)+((ht=($e=R(l))==null?void 0:$e.conflictedOutsideVault)!=null?ht:0)>0}),F=He(()=>R(M)+R(D)>0),_e=He(()=>!J("smart")),Q=H Line truncated
`);i.removed.lines.length>0&&!i.removed.no_nl_at_eof&&(c+=`
`),n.replaceRange(c,n.offsetToPos(a),n.offsetToPos(l)),n.setSelection(n.offsetToPos(a))}}async stageHunk(e){if(!this.editor)return;let{editor:t}=this.editor,n=xi.getHunk(t.state,!1,e),i=!1;if(n||(n=xi.getHunk(t.state,!0,e),i=!0),!n)return;let s=t.state.field(nO.editorInfoField).file.path,o=cr.createPatch(s,[n],"100644",i).join(`
`)+`
`;await this.plugin.gitActions.applyPatch(o)}goToHunk(e){if(!this.editor)return;let{editor:t,obEditor:n}=this.editor,i=xi.getHunks(t.state,!1),s=n.getCursor().line+1,o=cr.findNearestHunk(s,i,e,!0);if(o==null)return;let a=i[o];if(a){let l=a.added.start-1;n.setCursor(l,0),n.scrollIntoView({from:{line:l,ch:0},to:{line:l+1,ch:0}},!0)}}};g();g();var qa=require("obsidian");var Um=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.lineAuthorInfoProvider){this.plg.warn("undefined lineAuthorInfoProvider. Unexpected situation.");return}let t=e==null?void 0:e.view;!(t instanceof qa.MarkdownView)||t.file==null||(t==null?void 0:t.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(t.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),v$(()=>this.plg.settings.lineAuthor,e=>{this.plg.settings.lineAuthor=e,this.plg.saveSettings()})}conditionallyActivateBySettings(){this.plg.settings.lineAuthor.show&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;T$(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new _p(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions()}catch(e){this.plg.warn("Error while loading line authoring feature.",e),this.deactivateFeature()}}deactivateFeature(){var e;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.lineAuthorInfoProvider)==null||e.destroy(),this.lineAuthorInfoProvider=void 0}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&qa.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Ze?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(B$),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.gutterContextMenuEvent=this.createGutterContextMenuHandler(),this.fileOpenEvent=this.createFileOpenEvent(),this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileModificationEvent=this.createVaultFileModificationHandler(),this.headChangeEvent=this.createHeadChangeEvent(),this.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),E$(),this.plg.registerEvent(this.gutterContextMenuEvent),this.plg.registerEvent(this.refreshOnCssChangeEvent),this.plg.registerEvent(this.fileOpenEvent),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileModificationEvent),this.plg.registerEvent(this.headChangeEvent),this.plg.registerEvent(this.fileRenameEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.gutterContextMenuEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.workspace.offref(this.fileOpenEvent),this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.vault.offref(this.fileModificationEvent),this.plg.app.workspace.offref(this.headChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",e=>{var t;e&&((t=this.lineAuthorInfoProvider)==null||t.trackChanged(e).catch(console.error))})}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,t)=>{var n;return e instanceof qa.TFile&&((n=this.lineAuthorInfoProvider)==null?void 0:n.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var t;return e instanceof qa.TFile&&((t=this.lineAuthorInfoProvider)==null?void 0:t.trackChanged(e))})}createHeadChangeEvent(){return this.plg.app.workspace.on("obsidian-git:head-change",()=>{this.refreshLineAuthorViews()})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",A$)}};g();var Uc=require("obsidian");g();g();var Ya=require("@codemirror/state"),zm=require("@codemirror/view");var jm=class extends zm.GutterMarker{constructor(t,n){super();this.type=t;this.staged=n}toDOM(t){let n=createDiv();return n.className=`git-gutter-marker git-${this.type} ${this.staged?"staged":"unstaged"}`,this.type=="changedelete"&&n.setText("~"),n}},L_=Ya.StateField.define({create:()=>Ya.RangeSet.empty,update:(r,e)=>{let t=e.state.field(on,!1);if(!t)return Ya.RangeSet.empty;let n=e.effects.some(s=>s.is(Fp)),i=e.effects.some(s=>s.is(cc));if(n||i||(e.docChanged||r.size==0)&&t.isDirty==!1){let s=new Set,o=iO(e,t.hunks,!1,s),a=iO(e,t.stagedHunks,!0,s);return r=Ya.RangeSet.of([...o,...a],!0),r}else e.docChanged&&(r=r.map(e.changes));retur Line truncated
`,t),i=n===-1?r.length:n;if(e.push({from:t,to:i,text:r.slice(t,i)}),n===-1)break;t=n+1}return e}function Km(r){let e=BV(r),t=[];for(let n=0;n<e.length;n++){let i=e[n];if(!lO.test(i.text))continue;let s=-1,o=-1;for(let d=n+1;d<e.length;d++){let h=e[d];if(LV.test(h.text)){o=d;break}s===-1&&DV.test(h.text)&&(s=d)}if(o===-1)continue;let a=-1;for(let d=o+1;d<e.length;d++){let h=e[d];if(NV.test(h.text)){a=d;break}if(lO.test(h.text))break}if(a===-1)continue;let l=e[o],c=e[a],u=s!==-1?e[s]:void 0,f=[{from:i.from,to:i.to}];u!==void 0&&f.push({from:u.from,to:u.to}),f.push({from:l.from,to:l.to},{from:c.from,to:c.to}),t.push({from:i.from,to:c.to<r.length?c.to+1:c.to,ours:r.slice(i.to+1,u!==void 0?u.from:l.from),theirs:r.slice(l.to+1,c.from),base:u!==void 0?r.slice(u.to+1,l.from):void 0,markers:f,oursRange:{from:i.to+1,to:u!==void 0?u.from:l.from},baseRange:u!==void 0?{from:u.to+1,to:l.from}:void 0,theirsRange:{from:l.to+1,to:c.from}}),n=a}return t}function N_(r,e){switch(e){case"ours":return r.ours;case"theirs":return r.theirs;case"base":if(r.base===void 0)throw new Error("Cannot keep the base of a two-way conflict");return r.base;case"both":return r.ours+r.theirs}}function cO(r,e,t){r.dispatch({changes:{from:e.from,to:e.to,insert:N_(e,t)}}),r.focus()}function uO(r,e){let t=Km(r.state.doc.toString());r.dispatch({changes:t.map(n=>({from:n.from,to:n.to,insert:N_(n,e)}))}),r.focus()}var HV=["ours","base","theirs","both"],j_=ud.Facet.define({combine:r=>{var e;return(e=r[0])!=null?e:"both"}});function fO(r){var i;let e=r.facet(j_),t=(i=r.field(Zs.editorLivePreviewField,!1))!=null?i:!1;if(e==="disabled"||e==="source"&&t||e==="live-preview"&&!t)return[];let n=r.doc.toString();return n.includes("<<<<<<<")?Km(n):[]}var ps=ud.StateField.define({create:fO,update:(r,e)=>e.docChanged||e.reconfigured||e.startState.field(Zs.editorLivePreviewField,!1)!==e.state.field(Zs.editorLivePreviewField,!1)?fO(e.state):r});function hO(r,e,t){for(let n of HV){let i=e[n];if(i===void 0)continue;new Zs.ButtonComponent(r).setButtonText(i).onClick(o=>{o.preventDefault(),t(n)}).buttonEl.addClass("clickable-icon","nav-action-button",`git-conflict-choose-${n}`)}}var H_=class extends wn.WidgetType{constructor(t){super();this.block=t}eq(t){return t.block.from===this.block.from&&t.block.to===this.block.to&&t.block.ours===this.block.ours&&t.block.theirs===this.block.theirs&&t.block.base===this.block.base}toDOM(t){let n=createDiv({cls:"git-conflict-actions-group git-conflict-actions-widget"}),i={ours:"Keep ours",theirs:"Keep theirs",both:"Keep both"};return this.block.base!==void 0&&(i.base="Keep base"),hO(n,i,s=>cO(t,this.block,s)),n}};function pO(r,e){var i;let t=(i=e.state.field(ps,!1))!=null?i:[];r.createSpan({cls:"git-conflict-panel-label",text:`${t.length} conflict${t.length===1?"":"s"} in file`});let n={ours:"Keep all ours",theirs:"Keep all theirs",both:"Keep both"};t.every(s=>s.base!==void 0)&&(n.base="Keep all base"),hO(r.createDiv({cls:"git-conflict-actions-group"}),n,s=>uO(e,s))}var G_=class extends wn.WidgetType{constructor(t,n){super();this.count=t;this.hasBase=n}eq(t){return t.count===this.count&&t.hasBase===this.hasBase}toDOM(t){let n=createDiv({cls:"git-conflict-panel"});return pO(n,t),n}};function B_(r,e,t,n){if(t.from>=t.to)return;let i=e.doc.lineAt(t.from).number,s=e.doc.lineAt(t.to-1).number;for(let o=i;o<=s;o++)r.push(wn.Decoration.line({class:n}).range(e.doc.line(o).from))}function dO(r){var n;let e=(n=r.field(ps,!1))!=null?n:[],t=[];Zs.Platform.isMobile&&e.length>0&&t.push(wn.Decoration.widget({widget:new G_(e.length,e.every(i=>i.base!==void 0)),block:!0,side:-1}).range(0));for(let i of e){let s=i.markers[0];for(let[o,a]of i.markers.entries()){let l=o===0?" git-conflict-marker-ours":o===i.markers.length-1?" git-conflict-marker-theirs":"";t.push(wn.Decoration.line({class:`git-conflict-marker-line${l}`}).range(a.from),wn.Decoration.mark({class:`git-conflict-marker${l}`}).range(a.from,a.to))}t.push(wn.Decoration.widget({widget:new H_(i),side:1}).range(s.to)),B_(t,r,i.oursRange,"git-conflict-ours-line"),i.baseRange!==void 0&&B_(t,r,i.baseRange,"git-conflict-base-line"),B_(t,r,i.theirsRange,"git-conflict-theirs-line")}return wn.Decoration.set(t,!0)}var GV=ud.StateField.define({create:r=>dO(r),update:(r,e)=>e.docChanged||e.reconfigured||e.startState.field(ps)!==e.state.field(ps)?dO(e.state):r,provide:r=>wn.EditorView.decorations.from(r)}),U_=class{constructor(e){this.view=e;this.dom=createDiv({cls:"git-conflict-panel"});this.top=!0;this.render()}update(e){(e.docChanged||e.transactions.some(t=>t.reconfigured)||e.startState.field(ps)!==e.state.field(ps))&&this.render()}render(){var t;this.dom.empty(),((t=this.view.state.field(ps,!1))!=null?t:[]).length!==0&&pO(this.dom,this.view)}},UV=r=>new U_(r),jV=wn.showPanel.compute([ps],r=>!Zs.Platform.isMobile&&r.field(ps).length>0?UV:null),mO=[ps,GV,jV];g();var gO=require("@codemirror/state"),Zm=require("obsidian");var z_=class{constructor(e){this.state=e;this.subscribeMe()}notifyLineAuthoring(e,t){if( Line truncated
`+i)})}async createNewRepo(){let e=await Li(this.plugin,async()=>(await this.plugin.gitManager.init(),await this.plugin.init({fromReload:!0}),{status:"initialized"}));return e.status==="success"&&this.reportInitRepositoryResult(e.value),e}reportInitRepositoryResult(e){if(e.status==="initialized"){this.plugin.displayMessage("Initialized new repo");return}}async deleteRepository(){let e=await Li(this.plugin,async()=>{let t=this.plugin.settings.basePath?`${this.plugin.settings.basePath}/.git`:".git";return await this.plugin.app.vault.adapter.exists(t)?await new _t(this.plugin,{options:["NO","YES"],placeholder:"Do you really want to delete the repository (.git directory)? This action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"?(await this.plugin.app.vault.adapter.rmdir(t,!0),{status:"deleted"}):{status:"cancelled"}:{status:"not-found"}});return e.status==="success"&&(this.reportDeleteRepositoryResult(e.value),e.value.status==="deleted"&&(this.plugin.unloadPlugin(),await this.plugin.init({fromReload:!0}))),e}reportDeleteRepositoryResult(e){switch(e.status){case"deleted":this.plugin.displayMessage("Successfully deleted repository. Reloading plugin...");return;case"not-found":this.plugin.displayMessage("No repository found");return;case"cancelled":return}}async cloneNewRepo(){let e=await Li(this.plugin,()=>this.performCloneNewRepo());return e.status==="success"&&this.reportCloneRepositoryResult(e.value),e}async performCloneNewRepo(){let e=await new _t(this.plugin,{placeholder:"Enter remote URL"}).openAndGetResult();if(!e)return{status:"cancelled",reason:"no-url"};let t="Vault Root",n=await new _t(this.plugin,{options:this.plugin.gitManager instanceof Ts?[t]:[],placeholder:"Enter directory for clone. It needs to be empty or not existent.",allowEmpty:this.plugin.gitManager instanceof Ts}).openAndGetResult();if(n===void 0)return{status:"cancelled",reason:"no-directory"};if(n===t&&(n="."),n=(0,Un.normalizePath)(n),n==="/"&&(n="."),n==="."){let l=await new _t(this.plugin,{options:["NO","YES"],placeholder:`Does your remote repo contain a ${this.plugin.app.vault.configDir} directory at the root?`,onlySelection:!0}).openAndGetResult();if(l===void 0)return{status:"cancelled",reason:"safety-declined"};if(l==="YES"){let c="DELETE ALL YOUR LOCAL CONFIG AND PLUGINS";if(!(await new _t(this.plugin,{options:["Abort clone",c],placeholder:`To avoid conflicts, the local ${this.plugin.app.vault.configDir} directory needs to be deleted.`,onlySelection:!0}).openAndGetResult()===c))return{status:"cancelled",reason:"safety-declined"};await this.plugin.app.vault.adapter.rmdir(this.plugin.app.vault.configDir,!0)}}let i=await new _t(this.plugin,{placeholder:"Specify depth of clone. Leave empty for full clone.",allowEmpty:!0}).openAndGetResult();if(i===void 0)return{status:"cancelled",reason:"no-depth"};let s;if(i!==""&&(s=parseInt(i),isNaN(s)))return{status:"invalid",reason:"depth"};new Un.Notice(`Cloning new repo into "${n}"`);let o=this.plugin.settings.basePath,a=n!==".";a&&(this.plugin.settings.basePath=n);try{return await this.plugin.gitManager.clone(L0(e),n,s),a&&await this.plugin.saveSettings(),{status:"cloned"}}catch(l){throw this.plugin.settings.basePath=o,await this.plugin.saveSettings(),l}}reportCloneRepositoryResult(e){switch(e.status){case"cloned":this.plugin.displayMessage("Cloned new repo."),this.plugin.displayMessage("Please restart Obsidian");return;case"cancelled":{switch(e.reason){case"safety-declined":case"no-depth":this.plugin.displayMessage("Aborted clone");return;case"no-url":case"no-directory":return}return}case"invalid":if(e.reason==="depth"){this.plugin.displayMessage("Invalid depth. Aborting clone.");return}}}runReadyGitAction(e){return Li(this.plugin,async()=>await this.plugin.isAllInitialized()?e():{status:"skipped",reason:"not-ready"})}async listChangedFiles(){let e=await this.runReadyGitAction(async()=>{let t=await this.plugin.updateCachedStatus(),n=t.changed.length+t.staged.length;return n>500?{status:"blocked",reason:"too-many-changes",files:n}:(new tg(this.plugin,t.all).open(),{status:"displayed"})});return e.status==="success"&&this.reportListChangedFilesResult(e.value),e}reportListChangedFilesResult(e){switch(e.status){case"displayed":case"skipped":return;case"blocked":if(e.reason==="too-many-changes"){this.plugin.displayError("Too many changes to display");return}}}async pullChangesFromRemote(){let e=await this.pull();if(e.status!=="success")return;let t=e.value;t.status!=="skipped"&&(this.reportPullResult(t),this.plugin.app.workspace.trigger("obsidian-git:refresh"))}reportPullResult(e){switch(e.status){case"updated":{let t=e.files.length+e.outsideVault,n=e.outsideVault>0?` (${e.files.length} in the vault, ${e.outsideVault} outside)`:"";this.plugin.displayMessage(`Pulled ${t} ${t==1?"file":"files"} from remote${n}`),this.plugin.lastPulledFiles=e.files;return}case"up-to-date":this.plugin.displayMessage("Pull: Everything is up-to-date");return;case"skipped":switch(e.reason){case"not-re Line truncated
Use set upstream branch command to set it manually if desired.`),!1;new Un.Notice("No upstream branch is set. Please select one.");let e=await this.performSetUpstreamBranch();return this.reportSetUpstreamResult(e),e.status==="updated"}async isPushRemoteSet(){if(this.plugin.settings.updateSubmodules||await this.canAutoSetupPushRemote())return!0;if(!(await this.plugin.gitManager.branchInfo()).tracking){new Un.Notice("No upstream branch is set. Please select one.");let e=await this.performSetUpstreamBranch();return this.reportSetUpstreamResult(e),e.status==="updated"}return!0}async setUpstreamBranch(){let e=await this.runReadyGitAction(async()=>this.performSetUpstreamBranch());return e.status==="success"&&this.reportSetUpstreamResult(e.value),e}async performSetUpstreamBranch(){let e=await this.selectRemoteBranch();return e==null?{status:"cancelled"}:(await this.plugin.gitManager.updateUpstreamBranch(e),{status:"updated",branch:e})}reportSetUpstreamResult(e){switch(e.status){case"updated":this.plugin.displayMessage(`Set upstream branch to ${e.branch}`);return;case"cancelled":this.plugin.displayError("Aborted. No upstream-branch is set!",1e4);return;case"skipped":return}}async discardFile(e){let t=await this.runReadyGitAction(async()=>{let n=e.workingDir==="U",i=await new fd({app:this.plugin.app,filesToDeleteCount:n?1:0,filesToDiscardCount:n?0:1,path:e.vaultPath}).openAndGetResult();if(i===!1)return{status:"cancelled"};if(i==="delete"){let s=this.plugin.app.vault.getAbstractFileByPath(e.vaultPath);s?await this.plugin.app.fileManager.trashFile(s):await this.plugin.app.vault.adapter.remove(e.vaultPath)}else await this.plugin.gitManager.discard(e.path);return this.plugin.app.workspace.trigger("obsidian-git:refresh"),{status:"discarded",target:"file"}});return t.status==="success"&&this.reportDiscardResult(t.value,!1),t}async discardAll(e){let t=await this.runReadyGitAction(async()=>{let n=await this.plugin.gitManager.status({path:e}),i=0,s=0;for(let a of n.changed)a.workingDir=="U"?i++:s++;if(i+s==0)return{status:"skipped",reason:"no-changes"};let o=await new fd({app:this.plugin.app,filesToDeleteCount:i,filesToDiscardCount:s,path:e!=null?e:""}).openAndGetResult();if(o===!1)return{status:"cancelled"};if(await this.plugin.gitManager.discardAll({dir:e,status:n}),o==="delete"){let a=await this.plugin.gitManager.getUntrackedPaths({path:e,status:n});for(let l of a){let c=this.plugin.gitManager.getRelativeVaultPath(l),u=this.plugin.app.vault.getAbstractFileByPath(c);u?await this.plugin.app.fileManager.trashFile(u):l.endsWith("/")?await this.plugin.app.vault.adapter.rmdir(c,!0):await this.plugin.app.vault.adapter.remove(c)}}return this.plugin.app.workspace.trigger("obsidian-git:refresh"),{status:"discarded",target:o==="delete"?"all":"tracked"}});return t.status==="success"&&this.reportDiscardResult(t.value,e===void 0),t}reportDiscardResult(e,t){switch(e.status){case"discarded":if(!t||e.target==="file")return;this.plugin.displayMessage(e.target==="all"?"Discarded all files.":"Discarded all changes in tracked files.");return;case"cancelled":case"skipped":return}}async editRemotes(){let e=await this.runReadyGitAction(async()=>this.performEditRemotes());return e.status==="success"&&this.reportEditRemoteResult(e.value),e}async performEditRemotes(){let e=await this.plugin.gitManager.getRemotes(),t=await new _t(this.plugin,{options:e,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(!t)return{status:"cancelled"};let n=await this.plugin.gitManager.getRemoteUrl(t),i=await new _t(this.plugin,{initialValue:n,placeholder:"Enter remote URL"}).openAndGetResult();return i?(await this.plugin.gitManager.setRemote(t,L0(i)),{status:"updated",remote:t}):{status:"cancelled"}}reportEditRemoteResult(e){switch(e.status){case"updated":case"cancelled":case"skipped":return}}async selectRemoteBranch(){let e=await this.plugin.gitManager.getRemotes(),t;if(e.length===0){let s=await this.performEditRemotes();s.status==="updated"&&(t=s.remote),t==null&&(e=await this.plugin.gitManager.getRemotes())}let n=new _t(this.plugin,{options:e,placeholder:"Select or create a new remote by typing its name and selecting it"}),i=t!=null?t:await n.openAndGetResult();if(i){this.plugin.displayMessage("Fetching remote branches"),await this.plugin.gitManager.fetch(i);let s=await this.plugin.gitManager.getRemoteBranches(i),a=await new _t(this.plugin,{options:s,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult();return a==null?void 0:a.startsWith(i+"/")?a:`${i}/${a}`}}async removeRemote(){let e=await this.runReadyGitAction(async()=>{let t=await this.plugin.gitManager.getRemotes(),n=await new _t(this.plugin,{options:t,placeholder:"Select a remote"}).openAndGetResult();return n?(await this.plugin.gitManager.removeRemote(n),{status:"removed",remote:n}):{status:"cancelled"}});return e.status==="success"&&this.reportRemoveRemoteResult(e.value),e}reportRemoveRemoteResult(e Line truncated
/*! Bundled license information:
ieee754/index.js:
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
buffer/index.js:
(*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*)
safe-buffer/index.js:
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
crc-32/crc32.js:
(*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
isomorphic-git/index.js:
isomorphic-git/managers/index.js:
isomorphic-git/models/index.js:
(*!
* This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements.
* SPDX-License-Identifier: LGPL-3.0-or-later
* Copyright (c) James Prevett and other ZenFS contributors.
*
* Windows support added:
* - Backslashes are normalised to forward slashes before processing.
* - Drive-letter prefixes (e.g. "C:") are detected and preserved through
* normalisation, so absolute Windows paths are handled correctly.
* - An absolute argument passed to join() resets the accumulated path,
* matching Node behaviour and handling worktree gitdir paths properly.
*
* Limitation: UNC paths (e.g. \\server\share) are not supported. The leading
* backslashes are normalised to forward slashes and then collapsed by
* normalizeString, losing the UNC root. Git on Windows works with
* drive-letter paths, so this is not expected to be a practical issue.
*)
*/
/* nosourcemap */
+11
View File
@@ -0,0 +1,11 @@
{
"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.43.0",
"minAppVersion": "1.13.0"
}
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
if ! command -v curl >/dev/null 2>&1; then
echo "Obsidian Git authentication requires curl" >&2
exit 1
fi
printf '%s\n%s' "$OBSIDIAN_GIT_ASKPASS_TOKEN" "$1" | curl -q \
--silent --show-error --fail --noproxy '*' --proto '=http' \
--max-time 600 --data-binary @- \
--header 'Content-Type: application/octet-stream' \
"http://127.0.0.1:$OBSIDIAN_GIT_ASKPASS_PORT/askpass"
+937
View File
@@ -0,0 +1,937 @@
@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;
}
.tooltip.obsidian-git-commit-tooltip {
text-align: start;
white-space: pre-wrap;
max-width: min(480px, 90vw);
}
.obsidian-git-statusbar-conflict-indicator,
.obsidian-git-statusbar-paused-indicator,
.obsidian-git-statusbar-icon {
float: left;
}
.obsidian-git-statusbar-text {
float: right;
margin-left: 5px;
}
.obsidian-git-statusbar-conflict {
cursor: pointer;
margin-right: 5px;
}
.obsidian-git-statusbar-paused {
margin-right: 5px;
}
/* Limits the scrollbar to the view body */
.git-view {
display: flex;
flex-direction: column;
position: relative;
height: 100%;
}
/* Re-enable wrapping of nav buttns to prevent overflow on smaller screens #*/
.workspace-drawer .git-view .nav-buttons-container {
flex-wrap: wrap;
}
.git-tools {
display: flex;
margin-left: auto;
}
.git-tools .type {
padding-left: var(--size-2-1);
display: flex;
align-items: center;
justify-content: center;
width: 11px;
}
.git-tools .type[data-type="M"] {
color: orange;
}
.git-tools .type[data-type="D"] {
color: red;
}
.git-tools .buttons {
display: flex;
}
.git-tools .buttons > * {
padding: 0;
height: auto;
}
.workspace-leaf-content[data-type="git-view"] .tree-item-self,
.workspace-leaf-content[data-type="git-history-view"] .tree-item-self {
align-items: center;
}
.workspace-leaf-content[data-type="git-view"]
.tree-item-self:hover
.clickable-icon,
.workspace-leaf-content[data-type="git-history-view"]
.tree-item-self:hover
.clickable-icon {
color: var(--icon-color-hover);
}
/* Highlight an item as active if it's diff is currently opened */
.is-active .git-tools .buttons > * {
color: var(--nav-item-color-active);
}
.git-author {
color: var(--text-accent);
}
.git-date {
color: var(--text-accent);
}
.git-ref {
color: var(--text-accent);
}
.obsidian-git-merge-help ol {
padding-inline-start: var(--size-4-6);
}
.obsidian-git-merge-help-resolved {
padding: var(--size-4-3);
border-inline-start: 2px solid var(--color-green);
background-color: var(--background-secondary);
}
/* ====== diff2html ======
The following styles are adapted from the obsidian-version-history plugin by
@kometenstaub https://github.com/kometenstaub/obsidian-version-history-diff/blob/main/src/styles.scss
which itself is adapted from the diff2html library with the following original license:
https://github.com/rtfpessoa/diff2html/blob/master/LICENSE.md
Copyright 2014-2016 Rodrigo Fernandes https://rtfpessoa.github.io/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
.theme-dark,
.theme-light {
--git-delete-bg: #ff475040;
--git-delete-hl: #96050a75;
--git-insert-bg: #68d36840;
--git-insert-hl: #23c02350;
--git-change-bg: #ffd55840;
--git-selected: #3572b0;
--git-delete: #cc3333;
--git-insert: #399839;
--git-change: #d0b44c;
--git-move: #3572b0;
--git-conflict-ours: var(--color-cyan);
--git-conflict-theirs: var(--color-blue);
--git-conflict-ours-bg: color-mix(
in oklch,
var(--git-conflict-ours) 10%,
transparent
);
--git-conflict-theirs-bg: color-mix(
in oklch,
var(--git-conflict-theirs) 10%,
transparent
);
--git-conflict-ours-header-bg: color-mix(
in oklch,
var(--git-conflict-ours) 25%,
transparent
);
--git-conflict-theirs-header-bg: color-mix(
in oklch,
var(--git-conflict-theirs) 25%,
transparent
);
--git-conflict-ours-button-bg: color-mix(
in oklab,
var(--git-conflict-ours) 25%,
var(--interactive-normal)
);
--git-conflict-theirs-button-bg: color-mix(
in oklab,
var(--git-conflict-theirs) 25%,
var(--interactive-normal)
);
--git-conflict-base-button-bg: color-mix(
in oklab,
var(--color-purple) 15%,
var(--interactive-normal)
);
--git-conflict-base-bg: color-mix(
in oklch,
var(--color-purple) 4%,
transparent
);
}
.git-diff {
.d2h-d-none {
display: none;
}
.d2h-wrapper {
text-align: left;
border-radius: 0.25em;
overflow: auto;
}
.d2h-file-header.d2h-file-header {
background-color: var(--background-secondary);
border-bottom: 1px solid var(--background-modifier-border);
font-family:
Source Sans Pro,
Helvetica Neue,
Helvetica,
Arial,
sans-serif;
height: 35px;
padding: 5px 10px;
}
.d2h-file-header,
.d2h-file-stats {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.d2h-file-header {
display: none;
}
.d2h-file-stats {
font-size: 14px;
margin-left: auto;
}
.d2h-lines-added {
border: 1px solid var(--color-green);
border-radius: 5px 0 0 5px;
color: var(--color-green);
padding: 2px;
text-align: right;
vertical-align: middle;
}
.d2h-lines-deleted {
border: 1px solid var(--color-red);
border-radius: 0 5px 5px 0;
color: var(--color-red);
margin-left: 1px;
padding: 2px;
text-align: left;
vertical-align: middle;
}
.d2h-file-name-wrapper {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
font-size: 15px;
width: 100%;
}
.d2h-file-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--text-normal);
font-size: var(--h5-size);
}
.d2h-file-wrapper {
border: 1px solid var(--background-secondary-alt);
border-radius: 3px;
margin-bottom: 1em;
max-height: 100%;
}
.d2h-file-collapse {
-webkit-box-pack: end;
-ms-flex-pack: end;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border: 1px solid var(--background-secondary-alt);
border-radius: 3px;
cursor: pointer;
display: none;
font-size: 12px;
justify-content: flex-end;
padding: 4px 8px;
}
.d2h-file-collapse.d2h-selected {
background-color: var(--git-selected);
}
.d2h-file-collapse-input {
margin: 0 4px 0 0;
}
.d2h-diff-table {
border-collapse: collapse;
font-family: var(--font-monospace);
font-size: var(--code-size);
width: 100%;
}
.d2h-files-diff {
width: 100%;
}
.d2h-file-diff {
/*
overflow-y: scroll;
*/
border-radius: 5px;
font-size: var(--font-text-size);
line-height: var(--line-height-normal);
}
.d2h-file-side-diff {
display: inline-block;
margin-bottom: -8px;
margin-right: -4px;
overflow-x: scroll;
overflow-y: hidden;
width: 50%;
}
.d2h-code-line {
padding-left: 6em;
padding-right: 1.5em;
}
.d2h-code-line,
.d2h-code-side-line {
display: inline-block;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
width: 100%;
}
.d2h-code-side-line {
/* needed to be changed */
padding-left: 0.5em;
padding-right: 0.5em;
}
.d2h-code-line-ctn {
word-wrap: normal;
background: none;
display: inline-block;
padding: 0;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
vertical-align: middle;
width: 100%;
/* only works for line-by-line */
white-space: pre-wrap;
}
.d2h-code-line del,
.d2h-code-side-line del {
background-color: var(--git-delete-hl);
color: var(--text-normal);
}
.d2h-code-line del,
.d2h-code-line ins,
.d2h-code-side-line del,
.d2h-code-side-line ins {
border-radius: 0.2em;
display: inline-block;
margin-top: -1px;
text-decoration: none;
vertical-align: middle;
}
.d2h-code-line ins,
.d2h-code-side-line ins {
background-color: var(--git-insert-hl);
text-align: left;
}
.d2h-code-line-prefix {
word-wrap: normal;
background: none;
display: inline;
padding: 0;
white-space: pre;
}
.line-num1 {
float: left;
}
.line-num1,
.line-num2 {
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
/*
padding: 0 0.5em;
*/
text-overflow: ellipsis;
width: 2.5em;
padding-left: 0;
}
.line-num2 {
float: right;
}
.d2h-code-linenumber {
background-color: var(--background-primary);
border: solid var(--background-modifier-border);
border-width: 0 1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: var(--text-faint);
cursor: pointer;
display: inline-block;
position: absolute;
text-align: right;
width: 5.5em;
}
.d2h-code-linenumber:after {
content: "\200b";
}
.d2h-code-side-linenumber {
background-color: var(--background-primary);
border: solid var(--background-modifier-border);
border-width: 0 1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: var(--text-faint);
cursor: pointer;
overflow: hidden;
padding: 0 0.5em;
text-align: right;
text-overflow: ellipsis;
width: 4em;
/* needed to be changed */
display: table-cell;
position: relative;
}
.d2h-code-side-linenumber:after {
content: "\200b";
}
.d2h-code-side-emptyplaceholder,
.d2h-emptyplaceholder {
background-color: var(--background-primary);
border-color: var(--background-modifier-border);
}
.d2h-code-line-prefix,
.d2h-code-linenumber,
.d2h-code-side-linenumber,
.d2h-emptyplaceholder {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.d2h-code-linenumber,
.d2h-code-side-linenumber {
direction: rtl;
}
.d2h-del {
background-color: var(--git-delete-bg);
border-color: var(--git-delete-hl);
}
.d2h-ins {
background-color: var(--git-insert-bg);
border-color: var(--git-insert-hl);
}
.d2h-info {
background-color: var(--background-primary);
border-color: var(--background-modifier-border);
color: var(--text-faint);
}
.d2h-del,
.d2h-ins,
.d2h-file-diff .d2h-change {
color: var(--text-normal);
}
.d2h-file-diff .d2h-del.d2h-change {
background-color: var(--git-change-bg);
}
.d2h-file-diff .d2h-ins.d2h-change {
background-color: var(--git-insert-bg);
}
.d2h-file-list-wrapper {
a {
text-decoration: none;
cursor: default;
-webkit-user-drag: none;
}
svg {
display: none;
}
}
.d2h-file-list-header {
text-align: left;
}
.d2h-file-list-title {
display: none;
}
.d2h-file-list-line {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
text-align: left;
}
.d2h-file-list {
}
.d2h-file-list > li {
border-bottom: 1px solid var(--background-modifier-border);
margin: 0;
padding: 5px 10px;
}
.d2h-file-list > li:last-child {
border-bottom: none;
}
.d2h-file-switch {
cursor: pointer;
display: none;
font-size: 10px;
}
.d2h-icon {
fill: currentColor;
margin-right: 10px;
vertical-align: middle;
}
.d2h-deleted {
color: var(--git-delete);
}
.d2h-added {
color: var(--git-insert);
}
.d2h-changed {
color: var(--git-change);
}
.d2h-moved {
color: var(--git-move);
}
.d2h-tag {
background-color: var(--background-secondary);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
font-size: 10px;
margin-left: 5px;
padding: 0 2px;
}
.d2h-deleted-tag {
border: 1px solid var(--git-delete);
}
.d2h-added-tag {
border: 1px solid var(--git-insert);
}
.d2h-changed-tag {
border: 1px solid var(--git-change);
}
.d2h-moved-tag {
border: 1px solid var(--git-move);
}
/* needed for line-by-line*/
.d2h-diff-tbody {
position: relative;
}
/* My additions */
.cm-merge-revert {
width: 4em;
}
/* Ensure that merge revert markers are positioned correctly */
.cm-merge-revert > * {
position: absolute;
background-color: var(--background-secondary);
display: flex;
}
}
/* ====================== Line Authoring Information ====================== */
.markdown-source-view.mod-cm6 .cm-gutters.obsidian-git-line-author-gutters {
margin-left: unset;
}
.cm-gutterElement.obs-git-blame-gutter {
/* Add background color to spacing inbetween and around the gutter for better aesthetics */
border-width: 0px 2px 0.2px;
border-style: solid;
border-color: var(--background-secondary);
background-color: var(--background-secondary);
}
.cm-gutterElement.obs-git-blame-gutter > div,
.line-author-settings-preview {
/* delegate text color to settings */
color: var(--obs-git-gutter-text);
font-family: monospace;
height: 100%; /* ensure, that age-based background color occupies entire parent */
text-align: right;
padding: 0px 6px;
white-space: pre; /* Keep spaces and do not collapse them. */
}
@media (max-width: 800px) {
/* hide git blame gutter not to superpose text */
.cm-gutterElement.obs-git-blame-gutter {
display: none;
}
}
.git-unified-diff-view,
.git-split-diff-view .cm-deletedLine .cm-changedText {
background-color: #ee443330;
}
.git-unified-diff-view,
.git-split-diff-view .cm-insertedLine .cm-changedText {
background-color: #22bb2230;
}
.git-obscure-prompt .git-show-password {
margin-right: 32px;
}
.git-obscure-prompt[git-is-obscured="true"] #git-show-password:after {
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-eye"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg>');
}
.git-obscure-prompt[git-is-obscured="false"] #git-show-password:after {
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-eye-off"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"></path><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"></path><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"></path><path d="m2 2 20 20"></path></svg>');
}
/* Override styling of Codemirror merge view "collapsed lines" indicator */
.git-split-diff-view .ͼ2 .cm-collapsedLines {
background: var(--interactive-normal);
border-radius: var(--radius-m);
color: var(--text-accent);
font-size: var(--font-small);
padding: var(--size-4-1) var(--size-4-1);
}
.git-split-diff-view .ͼ2 .cm-collapsedLines:hover {
background: var(--interactive-hover);
color: var(--text-accent-hover);
}
.git-signs-gutter {
.cm-gutterElement {
display: grid;
/* Needed to align the sign properly for different line heigts. Such as
* when having a heading or list item.
*/
padding-top: 0 !important;
}
}
.git-gutter-marker:hover {
border-radius: 2px;
}
.git-gutter-marker.git-add {
background-color: var(--color-green);
justify-self: center;
height: inherit;
width: 0.2rem;
}
.git-gutter-marker.git-change {
background-color: var(--color-yellow);
justify-self: center;
height: inherit;
width: 0.2rem;
}
.git-gutter-marker.git-changedelete {
color: var(--color-yellow);
font-weight: var(--font-bold);
font-size: 1rem;
justify-self: center;
height: inherit;
}
.git-gutter-marker.git-delete {
background-color: var(--color-red);
height: 0.2rem;
width: 0.8rem;
align-self: end;
}
.git-gutter-marker.git-topdelete {
background-color: var(--color-red);
height: 0.2rem;
width: 0.8rem;
align-self: start;
}
div:hover > .git-gutter-marker.git-change {
width: 0.6rem;
}
div:hover > .git-gutter-marker.git-add {
width: 0.6rem;
}
div:hover > .git-gutter-marker.git-delete {
height: 0.6rem;
}
div:hover > .git-gutter-marker.git-topdelete {
height: 0.6rem;
}
div:hover > .git-gutter-marker.git-changedelete {
font-weight: var(--font-bold);
}
.git-gutter-marker.staged {
opacity: 0.5;
}
/* Prevent shifting of the editor when git signs gutter is the only gutter present */
.cm-gutters.cm-gutters-before:has(> .git-signs-gutter:only-child) {
margin-inline-end: 0;
.git-signs-gutter {
margin-inline-start: -1rem;
}
}
.git-changes-status-bar-colored {
.git-add {
color: var(--color-green);
}
.git-change {
color: var(--color-yellow);
}
.git-delete {
color: var(--color-red);
}
}
.git-changes-status-bar .git-add {
margin-right: 0.3em;
}
.git-changes-status-bar .git-change {
margin-right: 0.3em;
}
.cm-line.git-conflict-marker-line {
display: flex !important;
align-items: center;
background-color: var(--background-modifier-hover);
}
.cm-line.git-conflict-marker-line.HyperMD-quote {
/* The closing Git marker (`>>>>>>>`) is parsed by Live Preview as nested
* Markdown blockquotes. Obsidian marks these layout rules as important, so
* the conflict marker must use important as well to undo that styling. */
text-indent: 0 !important;
padding-inline-start: 0 !important;
border-inline-start: none !important;
}
.git-conflict-marker {
background-color: transparent;
}
.markdown-source-view.mod-cm6
.cm-line.git-conflict-marker-line.git-conflict-marker-ours {
background-color: var(--git-conflict-ours-header-bg);
}
.markdown-source-view.mod-cm6
.cm-line.git-conflict-marker-line.git-conflict-marker-theirs {
background-color: var(--git-conflict-theirs-header-bg);
}
.git-conflict-panel {
display: flex;
align-items: center;
gap: var(--size-2-2);
padding: var(--size-2-2) var(--size-4-2);
background-color: var(--background-secondary);
border-bottom: 1px solid var(--background-modifier-border);
}
.git-conflict-panel-label {
color: var(--text-muted);
font-size: var(--font-ui-smaller);
margin-inline-end: auto;
}
.is-mobile .git-conflict-panel {
flex-direction: column;
align-items: stretch;
}
.is-mobile .git-conflict-panel .git-conflict-actions-group {
flex-wrap: wrap;
}
.is-mobile .git-conflict-panel .nav-action-button {
flex: 1 1 auto;
}
.git-conflict-actions-group {
display: inline-flex;
gap: 0;
overflow: hidden;
border: 1px solid var(--background-modifier-border);
border-radius: var(--radius-s);
.nav-action-button {
margin: 0;
border-radius: 0;
font-weight: bold;
padding: var(--size-2-3);
}
.nav-action-button + .nav-action-button {
border-left: 1px solid var(--background-modifier-border);
}
}
.git-conflict-actions-group .git-conflict-choose-ours {
background-color: var(--git-conflict-ours-button-bg);
color: var(--text-normal);
}
.git-conflict-actions-group .git-conflict-choose-theirs {
background-color: var(--git-conflict-theirs-button-bg);
color: var(--text-normal);
}
.git-conflict-actions-group .git-conflict-choose-base {
background-color: var(--git-conflict-base-button-bg);
color: var(--text-normal);
}
.git-conflict-actions-group .git-conflict-choose-both {
background-color: var(--interactive-normal);
color: var(--text-normal);
}
.git-conflict-actions-widget {
flex: none;
margin-left: var(--size-2-2);
border-radius: 0;
}
.cm-line.git-conflict-ours-line {
background-color: var(--git-conflict-ours-bg);
}
.cm-line.git-conflict-theirs-line {
background-color: var(--git-conflict-theirs-bg);
}
.cm-line.git-conflict-base-line {
background-color: var(--git-conflict-base-bg);
}
.cm-line.git-conflict-marker-line::after {
content: "";
flex: 1;
margin-left: var(--size-2-2);
}
.cm-line.git-conflict-marker-line .git-conflict-actions-widget {
order: 2;
}
.is-mobile .cm-line.git-conflict-marker-line {
flex-wrap: wrap;
}
.is-mobile .cm-line.git-conflict-marker-line::after {
display: none;
}
.is-mobile .cm-line.git-conflict-marker-line .git-conflict-actions-widget {
flex: 0 0 100%;
margin: var(--size-2-1) 0 0;
}
.is-mobile .git-conflict-actions-widget {
flex-wrap: wrap;
}
.is-mobile .git-conflict-actions-widget .nav-action-button {
flex: 1 1 auto;
}
@@ -0,0 +1 @@
data.json
+235
View File
@@ -0,0 +1,235 @@
(()=>{var __webpack_modules__={66339:(e,t,r)=>{"use strict";var i=r(67526),n=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/t.hp=l,t.IS=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return d(e,t,r)}function d(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),i=a(r),n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(ArrayBuffer.isView(e))return p(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(j(e,SharedArrayBuffer)||e&&j(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,r);var n=function(e){if(l.isBuffer(e)){var t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||H(e.length)?a(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),a(e<0?0:0|f(e))}function p(e){for(var t=e.length<0?0:0|f(e.length),r=a(t),i=0;i<t;i+=1)r[i]=255&e[i];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,l.prototype),i}function f(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(n)return i?-1:q(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,r);case"utf8":case"utf-8":return B(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function y(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,i,n){var o,s=1,a=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function d(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){var c=-1;for(o=r;o<a;o++)if(d(e,o)===d(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){for(var u=!0,p=0;p<l;p++)if(d(e,o+p)!==d(t,p)){u=!1;break}if(u)return o}return-1}function w(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;var o=t.length;i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(t.substr(2*s,2),16);if(H(a))retuLine truncated
/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
const i=r(24605);t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u16=e=>new Uint16Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/2));t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));if(t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const n=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function o(e){(0,i.bytes)(e);let t="";for(let r=0;r<e.length;r++)t+=n[e[r]];return t}t.bytesToHex=o;const s=48,a=57,l=65,d=70,c=97,u=102;function p(e){return e>=s&&e<=a?e-s:e>=l&&e<=d?e-(l-10):e>=c&&e<=u?e-(c-10):void 0}function h(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){const r=p(e.charCodeAt(n)),o=p(e.charCodeAt(n+1));if(void 0===r||void 0===o){const t=e[n]+e[n+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+n)}i[t]=16*r+o}return i}function f(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}t.hexToBytes=h,t.hexToNumber=f,t.bytesToNumberBE=function(e){return f(o(e))},t.numberToBytesBE=function(e,t){return h(e.toString(16).padStart(2*t,"0"))};function m(e){if("string"!=typeof e)throw new Error("string expected, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,i){let n=Date.now();for(let o=0;o<e;o++){i(o);const e=Date.now()-n;e>=0&&e<r||(await(0,t.nextTick)(),n+=e)}},t.utf8ToBytes=m,t.bytesToUtf8=function(e){return(new TextDecoder).decode(e)},t.toBytes=function(e){if("string"==typeof e)e=m(e);else{if(!(0,i.isBytes)(e))throw new Error("Uint8Array expected, got "+typeof e);e=e.slice()}return e},t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];(0,i.bytes)(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){const n=e[t];r.set(n,i),i+=n.length}return r},t.checkOpts=function(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign(e,t)},t.equalBytes=function(e,t){if(e.length!==t.length)return!1;let r=0;for(let i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r};t.Hash=class{};function g(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);const n=BigInt(32),o=BigInt(4294967295),s=Number(r>>n&o),a=Number(r&o),l=i?4:0,d=i?0:4;e.setUint32(t+l,s,i),e.setUint32(t+d,a,i)}t.wrapCipher=(e,t)=>(Object.assign(t,e),t),t.setBigUint64=g,t.u64Lengths=function(e,r){const i=new Uint8Array(16),n=(0,t.createView)(i);return g(n,0,BigInt(r?r.length:0),!0),g(n,8,BigInt(e.length),!0),i}},68489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.gcm=t.ctr=t.cbc=t.utils=t.managedNonce=t.getWebcryptoSubtle=t.randomBytes=void 0;const i=r(25297);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return i.randomBytes}}),Object.defineProperty(t,"getWebcryptoSubtle",{enumerable:!0,get:function(){return i.getWebcryptoSubtle}});const n=r(36527),o=r(24605);t.managedNonce=function(e){return(0,o.number)(e.nonceLength),(t,...r)=>({encrypt:(o,...s)=>{const{nonceLength:a}=e,l=(0,i.randomBytes)(a),d=e(t,l,...r).encrypt(o,...s),c=(0,n.concatBytes)(l,d);return d.fill(0),c},decrypt:(i,...n)=>{const{nonceLength:o}=e,s=i.subarray(0,o),a=i.subarray(o);return e(t,s,...r).decrypt(a,...n)}})},t.utils={async encrypt(e,t,r,n){const o=(0,i.getWebcryptoSubtle)(),s=await o.importKey("raw",e,t,!0,["encrypt"]),a=await o.encrypt(r,s,n);return new Uint8Array(a)},async decrypt(e,t,r,n){const o=(0,i.getWebcryptoSubtle)(),s=await o.importKey("raw",e,t,!0,["decrypt"]),a=await o.decrypt(r,s,n);return new Uint8Array(a)}};const s="AES-CBC",a="AES-CTR",l="AES-GCM";function d(e){return(r,i,n)=>{(0,o.bytes)(r),(0,o.bytes)(i);const d={name:e,length:8*r.length},c=function(e,t,r){if(e===s)return{name:s,iv:t};if(e===a)return{name:a,counter:t,length:64};if(e===l)return r?{name:l,iv:t,additionalData:r}:{name:l,iv:t};throw new Error("unknown aes block mode")}(e,i,n);return{encrypt:e=>((0,o.bytes)(e),t.utils.encrypt(r,d,c,e)),decrypt:e=>((0,o.bytes)(e),t.utils.decrypt(r,d,c,e))}}}t.cbc=d(s),t.ctr=d(a),t.gcm=d(l)},67557:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function i(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function n(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function o(e,...t){if(!n(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Line truncated
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=void 0,t.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name},t.byteSwap32=function(e){for(let r=0;r<e.length;r++)e[r]=(0,t.byteSwap)(e[r])},t.bytesToHex=function(e){(0,n.bytes)(e);let t="";for(let r=0;r<e.length;r++)t+=o[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){const r=a(e.charCodeAt(n)),o=a(e.charCodeAt(n+1));if(void 0===r||void 0===o){const t=e[n]+e[n+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+n)}i[t]=16*r+o}return i},t.asyncLoop=async function(e,r,i){let n=Date.now();for(let o=0;o<e;o++){i(o);const e=Date.now()-n;e>=0&&e<r||(await(0,t.nextTick)(),n+=e)}},t.utf8ToBytes=l,t.toBytes=d,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];(0,n.bytes)(i),t+=i.length}const r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){const n=e[t];r.set(n,i),i+=n.length}return r},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==c.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(d(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(i.crypto&&"function"==typeof i.crypto.getRandomValues)return i.crypto.getRandomValues(new Uint8Array(e));if(i.crypto&&"function"==typeof i.crypto.randomBytes)return i.crypto.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")};const i=r(25145),n=r(67557);t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.rotr=(e,t)=>e<<32-t|e>>>t;t.rotl=(e,t)=>e<<t|e>>>32-t>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];t.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,t.byteSwapIfBE=t.isLE?e=>e:e=>(0,t.byteSwap)(e);const o=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));const s={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function a(e){return e>=s._0&&e<=s._9?e-s._0:e>=s._A&&e<=s._F?e-(s._A-10):e>=s._a&&e<=s._f?e-(s._a-10):void 0}function l(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function d(e){return"string"==typeof e&&(e=l(e)),(0,n.bytes)(e),e}t.nextTick=async()=>{};t.Hash=class{clone(){return this._cloneInto()}};const c={}.toString},87568:(e,t,r)=>{var i=t;i.bignum=r(72344),i.define=r(47363).define,i.base=r(9673),i.constants=r(22153),i.decoders=r(22853),i.encoders=r(24669)},47363:(e,t,r)=>{var i=r(87568),n=r(56698);function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(e){var t;try{t=r(18950).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return n(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},o.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i.decoders[e])),this.decoders[e]},o.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},o.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(i.encoders[e])),this.encoders[e]},o.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},47227:(e,t,r)=>{var i=r(56698),n=r(9673).Reporter,o=r(48287).Buffer;function s(e,t){n.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return e instanceof a||(e=new a(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}i(s,n),t.t=s,s.prototype.save=function(){return{offset:this.offset,Line truncated
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/const i=r(67526),n=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return d(e,t,r)}function d(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let i=a(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(J(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,r);const n=function(e){if(l.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?a(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),a(e<0?0:0|f(e))}function p(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,l.prototype),i}function f(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(n)return i?-1:W(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function y(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,i,n){let o,s=1,a=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function d(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){let i=-1;for(o=r;o<a;o++)if(d(e,o)===d(t,-1===i?0:o-i)){if(-1==Line truncated
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
t.read=function(e,t,r,i,n){var o,s,a=8*n-i-1,l=(1<<a)-1,d=l>>1,c=-7,u=r?n-1:0,p=r?-1:1,h=e[t+u];for(u+=p,o=h&(1<<-c)-1,h>>=-c,c+=a;c>0;o=256*o+e[t+u],u+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+e[t+u],u+=p,c-=8);if(0===o)o=1-d;else{if(o===l)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,i),o-=d}return(h?-1:1)*s*Math.pow(2,o-i)},t.write=function(e,t,r,i,n,o){var s,a,l,d=8*o-n-1,c=(1<<d)-1,u=c>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:o-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+u>=1?p/l:p*Math.pow(2,1-u))*l>=2&&(s++,l/=2),s+u>=c?(a=0,s=c):s+u>=1?(a=(t*l-1)*Math.pow(2,n),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,n),s=0));n>=8;e[r+h]=255&a,h+=f,a/=256,n-=8);for(s=s<<n|a,d+=n;d>0;e[r+h]=255&s,h+=f,s/=256,d-=8);e[r+h-f]|=128*m}},56698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},20311:e=>{"use strict";e.exports=function(e,t,r,i,n,o,s,a){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[r,i,n,o,s,a],c=0;(l=new Error(t.replace(/%s/g,(function(){return d[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},47244:(e,t,r)=>{"use strict";var i=r(49092)(),n=r(38075)("Object.prototype.toString"),o=function(e){return!(i&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===n(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==n(e)&&"[object Function]"===n(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},69600:e=>{"use strict";var t,r,i=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},n((function(){throw 42}),null,t)}catch(e){e!==r&&(n=null)}else n=null;var o=/^\s*class\b/,s=function(e){try{var t=i.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(i.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,d="function"==typeof Symbol&&!!Symbol.toStringTag,c=!(0 in[,]),u=function(){return!1};if("object"==typeof document){var p=document.all;l.call(p)===l.call(document.all)&&(u=function(e){if((c||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=n?function(e){if(u(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{n(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(u(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(d)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},48184:(e,t,r)=>{"use strict";var i,n=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(49092)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===n.call(e);if(!l)return!1;if(void 0===i){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();i=!!t&&l(t)}return l(e)===i}},88997:e=>{"use strict";e.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},35680:(e,t,r)=>{"use strict";var i=r(25767);e.exports=function(e){return!!i(e)}},64634:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},37260:(e,t,r)=>{var i=r(25747);e.exports=function(e,t){t=t||{};var r=i.decode(e,t);if(!r)return null;var n=r.payload;if("string"==typeof n)try{var o=JSON.parse(n);null!==o&&"object"==typeof o&&(n=o)}catch(e){}return!0===t.complete?{header:r.header,payload:n,signature:r.signature}:n}},44040:(e,t,r)=>{e.exports={decode:r(37260),verify:r(91691),sign:r(37651),JsonWebTokenError:r(81741),NotBeforeError:r(13726),TokenExpiredError:r(18980)}},81741:e=>{var t=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};(t.prototype=Object.create(Error.prototype)).constructor=t,e.exports=t},13726:(e,t,r)=>{var i=r(81741),n=function(e,t){i.call(this,e),this.name="NotBeforeError",this.date=t};(n.prototype=Object.create(i.prototype)).constructor=n,e.exports=n},18980:(e,t,r)=>{var i=r(81741),n=function(e,t){i.call(this,e),this.Line truncated
/*!
localForage -- Offline Storage, Improved
Version 1.10.0
https://localforage.github.io/localForage
(c) 2013-2017 Mozilla, Apache License 2.0
*/
e.exports=function e(t,r,i){function n(s,a){if(!r[s]){if(!t[s]){if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var d=r[s]={exports:{}};t[s][0].call(d.exports,(function(e){var r=t[s][1][e];return n(r||e)}),d,d.exports,e,t,r,i)}return r[s].exports}for(var o=void 0,s=0;s<i.length;s++)n(i[s]);return n}({1:[function(e,t,i){(function(e){"use strict";var r,i,n=e.MutationObserver||e.WebKitMutationObserver;if(n){var o=0,s=new n(c),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),r=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var l=new e.MessageChannel;l.port1.onmessage=c,r=function(){l.port2.postMessage(0)}}var d=[];function c(){var e,t;i=!0;for(var r=d.length;r;){for(t=d,d=[],e=-1;++e<r;)t[e]();r=d.length}i=!1}function u(e){1!==d.push(e)||i||r()}t.exports=u}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){"use strict";var i=e(1);function n(){}var o={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function d(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==n&&h(this,e)}function c(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function u(e,t,r){i((function(){var i;try{i=t(r)}catch(t){return o.reject(e,t)}i===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,i)}))}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var r=!1;function i(t){r||(r=!0,o.reject(e,t))}function n(t){r||(r=!0,o.resolve(e,t))}function s(){t(n,i)}var a=f(s);"error"===a.status&&i(a.value)}function f(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}function m(e){return e instanceof this?e:o.resolve(new this(n),e)}function g(e){var t=new this(n);return o.reject(t,e)}function y(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,i=!1;if(!r)return this.resolve([]);for(var s=new Array(r),a=0,l=-1,d=new this(n);++l<r;)c(e[l],l);return d;function c(e,n){function l(e){s[n]=e,++a!==r||i||(i=!0,o.resolve(d,s))}t.resolve(e).then(l,(function(e){i||(i=!0,o.reject(d,e))}))}}function v(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,i=!1;if(!r)return this.resolve([]);for(var s=-1,a=new this(n);++s<r;)l(e[s]);return a;function l(e){t.resolve(e).then((function(e){i||(i=!0,o.resolve(a,e))}),(function(e){i||(i=!0,o.reject(a,e))}))}}t.exports=d,d.prototype.catch=function(e){return this.then(null,e)},d.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===s)return this;var r=new this.constructor(n);return this.state!==l?u(r,this.state===a?e:t,this.outcome):this.queue.push(new c(r,e,t)),r},c.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){u(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){o.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){u(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=f(p,t);if("error"===r.status)return o.reject(e,r.value);var i=r.value;if(i)h(e,i);else{e.state=a,e.outcome=t;for(var n=-1,s=e.queue.length;++n<s;)e.queue[n].callFulfilled(t)}return e},o.reject=function(e,t){e.state=s,e.outcome=t;for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callRejected(t);return e},d.resolve=m,d.reject=g,d.all=y,d.race=v},{1:1}],3:[function(e,t,i){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,r){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}var s=o();function Line truncated
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/e=r.nmd(e),function(){var n,o="Expected a function",s="__lodash_hash_undefined__",a="__lodash_placeholder__",l=16,d=32,c=64,u=128,p=256,h=1/0,f=9007199254740991,m=NaN,g=4294967295,y=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",l],["flip",512],["partial",d],["partialRight",c],["rearg",p]],v="[object Arguments]",b="[object Array]",w="[object Boolean]",_="[object Date]",x="[object Error]",S="[object Function]",k="[object GeneratorFunction]",E="[object Map]",T="[object Number]",B="[object Object]",C="[object Promise]",I="[object RegExp]",A="[object Set]",F="[object String]",M="[object Symbol]",D="[object WeakMap]",R="[object ArrayBuffer]",P="[object DataView]",O="[object Float32Array]",z="[object Float64Array]",N="[object Int8Array]",q="[object Int16Array]",U="[object Int32Array]",L="[object Uint8Array]",j="[object Uint8ClampedArray]",H="[object Uint16Array]",$="[object Uint32Array]",G=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,K=/(__e\(.*?\)|\b__t\)) \+\n'';/g,V=/&(?:amp|lt|gt|quot|#39);/g,J=/[&<>"']/g,Y=RegExp(V.source),Q=RegExp(J.source),Z=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,re=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(ne.source),se=/^\s+/,ae=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,de=/\{\n\/\* \[wrapped with (.+)\] \*/,ce=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pe=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,me=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,_e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xe=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,ke="\\ud800-\\udfff",Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Te="\\u2700-\\u27bf",Be="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Ie="\\ufe0e\\ufe0f",Ae="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Fe="['’]",Me="["+ke+"]",De="["+Ae+"]",Re="["+Ee+"]",Pe="\\d+",Oe="["+Te+"]",ze="["+Be+"]",Ne="[^"+ke+Ae+Pe+Te+Be+Ce+"]",qe="\\ud83c[\\udffb-\\udfff]",Ue="[^"+ke+"]",Le="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Ce+"]",$e="\\u200d",Ge="(?:"+ze+"|"+Ne+")",We="(?:"+He+"|"+Ne+")",Ke="(?:['’](?:d|ll|m|re|s|t|ve))?",Ve="(?:['’](?:D|LL|M|RE|S|T|VE))?",Je="(?:"+Re+"|"+qe+")"+"?",Ye="["+Ie+"]?",Qe=Ye+Je+("(?:"+$e+"(?:"+[Ue,Le,je].join("|")+")"+Ye+Je+")*"),Ze="(?:"+[Oe,Le,je].join("|")+")"+Qe,Xe="(?:"+[Ue+Re+"?",Re,Le,je,Me].join("|")+")",et=RegExp(Fe,"g"),tt=RegExp(Re,"g"),rt=RegExp(qe+"(?="+qe+")|"+Xe+Qe,"g"),it=RegExp([He+"?"+ze+"+"+Ke+"(?="+[De,He,"$"].join("|")+")",We+"+"+Ve+"(?="+[De,He+Ge,"$"].join("|")+")",He+"?"+Ge+"+"+Ke,He+"+"+Ve,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,Ze].join("|"),"g"),nt=RegExp("["+$e+ke+Ee+Ie+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,st=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,lt={};lt[O]=lt[z]=lt[N]=lt[q]=lt[U]=lt[L]=lt[j]=lt[H]=lt[$]=!0,lt[v]=lt[b]=lt[R]=lt[w]=lt[P]=lt[_]=lt[x]=lt[S]=lt[E]=lt[T]=lt[B]=lt[I]=lt[A]=lt[F]=lt[D]=!1;var dt={};dt[v]=dt[b]=dt[R]=dt[P]=dt[w]=dt[_]=dt[O]=dt[z]=dt[N]=dt[q]=dt[U]=dt[E]=dt[T]=dt[B]=dt[I]=dt[A]=dt[F]=dt[M]=dt[L]=dt[j]=dt[H]=dt[$]=!0,dt[x]=dt[S]=dt[D]=!1;var ct={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,pt=parseInt,ht="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ft="object"==typeof self&&self&&self.Object===Object&&self,mt=ht||ft||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&e&&!e.nodeType&&e,vt=yt&&yt.exports===gt,bt=vt&&ht.process,wt=function(){try{var e=yt&&yt.require&&yt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),_t=wt&&wt.isArrayBuffer,xt=wt&&wt.isDate,St=wt&&wt.isMap,kt=wt&&wt.isRegExp,Et=wt&&wt.isSet,Tt=wt&&wt.isTypedArray;function Bt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Ct(e,t,r,i){for(var n=-1,o=null==e?0:e.length;++n<o;){var s=e[n];t(i,s,r(s),e)}return i}function It(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););return e}function At(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Ft(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(!t(e[r],r,e))return!1;return!0}functiLine truncated
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
e.exports=r(81813)},86049:(e,t,r)=>{"use strict";
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/var i,n,o,s=r(7598),a=r(57975).extname,l=/^\s*([^;\s]*)(?:;|\s|$)/,d=/^text\//i;function c(e){if(!e||"string"!=typeof e)return!1;var t=l.exec(e),r=t&&s[t[1].toLowerCase()];return r&&r.charset?r.charset:!(!t||!d.test(t[1]))&&"UTF-8"}t.charset=c,t.charsets={lookup:c},t.contentType=function(e){if(!e||"string"!=typeof e)return!1;var r=-1===e.indexOf("/")?t.lookup(e):e;if(!r)return!1;if(-1===r.indexOf("charset")){var i=t.charset(r);i&&(r+="; charset="+i.toLowerCase())}return r},t.extension=function(e){if(!e||"string"!=typeof e)return!1;var r=l.exec(e),i=r&&t.extensions[r[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},t.extensions=Object.create(null),t.lookup=function(e){if(!e||"string"!=typeof e)return!1;var r=a("x."+e).toLowerCase().substr(1);if(!r)return!1;return t.types[r]||!1},t.types=Object.create(null),i=t.extensions,n=t.types,o=["nginx","apache",void 0,"iana"],Object.keys(s).forEach((function(e){var t=s[e],r=t.extensions;if(r&&r.length){i[e]=r;for(var a=0;a<r.length;a++){var l=r[a];if(n[l]){var d=o.indexOf(s[n[l]].source),c=o.indexOf(t.source);if("application/octet-stream"!==n[l]&&(d>c||d===c&&"application/"===n[l].substr(0,12)))continue}n[l]=e}}}))},43349:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},64367:(e,t)=>{"use strict";var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),o=n>>8,s=255&n;o?r.push(o,s):r.push(s)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}},6585:e=>{var t=1e3,r=60*t,i=60*r,n=24*i,o=7*n,s=365.25*n;function a(e,t,r,i){var n=t>=1.5*r;return Math.round(e/r)+" "+i+(n?"s":"")}e.exports=function(e,l){l=l||{};var d=typeof e;if("string"===d&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var l=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*s;case"weeks":case"week":case"w":return l*o;case"days":case"day":case"d":return l*n;case"hours":case"hour":case"hrs":case"hr":case"h":return l*i;case"minutes":case"minute":case"mins":case"min":case"m":return l*r;case"seconds":case"second":case"secs":case"sec":case"s":return l*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(e);if("number"===d&&isFinite(e))return l.long?function(e){var o=Math.abs(e);if(o>=n)return a(e,o,n,"day");if(o>=i)return a(e,o,i,"hour");if(o>=r)return a(e,o,r,"minute");if(o>=t)return a(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=n)return Math.round(e/n)+"d";if(o>=i)return Math.round(e/i)+"h";if(o>=r)return Math.round(e/r)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},43092:(e,t,r)=>{"use strict";var i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();e.exports=t=i.fetch,i.fetch&&(t.default=i.fetch.bind(i)),t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response},58859:(e,t,r)=>{var i="function"==typeof Map&&Map.prototype,n=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=i&&n&&"function"==typeof n.get?n.get:null,s=i&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,d=a&&l&&"function"==typeof l.get?l.get:null,c=a&&Set.prototype.forEach,u="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,m=Object.prototype.toString,g=Function.prototype.toString,y=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,_=String.prototype.toLowerCase,x=RegExp.prototype.test,S=Array.prototype.concat,k=Array.prototype.join,E=Array.prototype.slice,T=Math.floor,B="function"==typeof BigInt?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,A="function"==typeof Symbol&&"object"==typeof Symbol.iterator,F="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Line truncated
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
var i=r(48287),n=i.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(o(i,t),t.Buffer=s),s.prototype=Object.create(n.prototype),o(n,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},93904:(e,t,r)=>{const i=Symbol("SemVer ANY");class n{static get ANY(){return i}constructor(e,t){if(t=o(t),e instanceof n){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),d("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===i?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=i}toString(){return this.value}test(e){if(d("Comparator.test",e,this.options.loose),this.semver===i||e===i)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new u(e.value,t).test(this.value):""===e.operator?""===e.value||new u(this.value,t).test(e.semver):(!(t=o(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=n;const o=r(98587),{safeRe:s,t:a}=r(99718),l=r(72111),d=r(57272),c=r(53908),u=r(78311)},78311:(e,t,r)=>{const i=/\s+/g;class n{constructor(e,t){if(t=s(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(i," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!y(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&m)|(this.options.loose&&g))+":"+e,r=o.get(t);if(r)return r;const i=this.options.loose,n=i?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(n,A(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],p),l("comparator trim",e),e=e.replace(c[u.TILDETRIM],h),l("tilde trim",e),e=e.replace(c[u.CARETTRIM],f),l("caret trim",e);let s=e.split(" ").map((e=>w(e,this.options))).join(" ").split(/\s+/).map((e=>I(e,this.options)));i&&(s=s.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE]))))),l("range list",s);const d=new Map,v=s.map((e=>new a(e,this.options)));for(const e of v){if(y(e))return[e];d.set(e.value,e)}d.size>1&&d.has("")&&d.delete("");const b=[...d.values()];return o.set(t,b),b}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>b(r,t)&&e.set.some((e=>b(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new d(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(F(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const o=new(r(68794)),s=r(98587),a=r(93904),l=r(57272),d=r(53908),{safeRe:c,t:u,comparatorTrimReplace:p,tildeTrimReplace:h,caretTrimReplace:f}=r(99718),{FLAG_INCLUDE_PRERELEASE:m,FLAG_LOOSE:gLine truncated
/*!
* XRegExp Unicode Base 5.1.1
* <xregexp.com>
* Steven Levithan (c) 2008-present MIT License
*/t.default=function(e){var t={},r={},i=e._dec,n=e._hex,o=e._pad4;function s(e){return e.replace(/[- _]+/g,"").toLowerCase()}function a(e){var t=/^\\[xu](.+)/.exec(e);return t?i(t[1]):e.charCodeAt("\\"===e[0]?1:0)}function l(r){var i,s,l;return t[r]["b!"]||(t[r]["b!"]=(i=t[r].bmp,s="",l=-1,(0,u.default)(e).call(e,i,/(\\x..|\\u....|\\?[\s\S])(?:-(\\x..|\\u....|\\?[\s\S]))?/,(function(e){var t=a(e[1]);t>l+1&&(s+="\\u".concat(o(n(l+1))),t>l+2&&(s+="-\\u".concat(o(n(t-1))))),l=a(e[2]||e[1])})),l<65535&&(s+="\\u".concat(o(n(l+1))),l<65534&&(s+="-\\uFFFF")),s))}function d(e,r){var i=r?"a!":"a=";return t[e][i]||(t[e][i]=function(e,r){var i,n,o=t[e],s="";return o.bmp&&!o.isBmpLast&&(s=(0,p.default)(i="[".concat(o.bmp,"]")).call(i,o.astral?"|":"")),o.astral&&(s+=o.astral),o.isBmpLast&&o.bmp&&(s+=(0,p.default)(n="".concat(o.astral?"|":"","[")).call(n,o.bmp,"]")),r?"(?:(?!".concat(s,")(?:[\ud800-\udbff][\udc00-\udfff]|[\0-￿]))"):"(?:".concat(s,")")}(e,r))}e.addToken(/\\([pP])(?:{(\^?)(?:(\w+)=)?([^}]*)}|([A-Za-z]))/,(function(e,i,n){var o="Unknown Unicode token ",a=(0,c.default)(e,6),u=a[0],f=a[1],m=a[2],g=a[3],y=a[4],v=a[5],b="P"===f||!!m,w=-1!==(0,h.default)(n).call(n,"A"),_=s(v||y),x=t[_];if("P"===f&&m)throw new SyntaxError("Invalid double negation "+u);if(!t.hasOwnProperty(_))throw new SyntaxError(o+u);if(g&&(!r[g]||!r[g][_]))throw new SyntaxError(o+u);if(x.inverseOf){var S;if(_=s(x.inverseOf),!t.hasOwnProperty(_))throw new ReferenceError((0,p.default)(S="".concat("Unicode token missing data "+u," -> ")).call(S,x.inverseOf));x=t[_],b=!b}if(!x.bmp&&!w)throw new SyntaxError("Astral mode required for Unicode token "+u);if(w){if("class"===i)throw new SyntaxError("Astral mode does not support Unicode tokens within character classes");return d(_,b)}return"class"===i?b?l(_):x.bmp:"".concat((b?"[^":"[")+x.bmp,"]")}),{scope:"all",optionalFlags:"A",leadChar:"\\"}),e.addUnicodeData=function(i,n){n&&(r[n]={});var o,a=f(i);try{for(a.s();!(o=a.n()).done;){var l=o.value;if(!l.name)throw new Error("Unicode token requires name");if(!(l.inverseOf||l.bmp||l.astral))throw new Error("Unicode token has no character data "+l.name);var d=s(l.name);if(t[d]=l,n&&(r[n][d]=!0),l.alias){var c=s(l.alias);t[c]=l,n&&(r[n][c]=!0)}}}catch(e){a.e(e)}finally{a.f()}e.cache.flush("patterns")},e._getUnicodeProperty=function(e){var r=s(e);return t[r]}},e.exports=t.default},47884:(e,t,r)=>{"use strict";var i=r(53930),n=r(5946);i(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(4311));
/*!
* XRegExp Unicode Categories 5.1.1
* <xregexp.com>
* Steven Levithan (c) 2010-present MIT License
* Unicode data by Mathias Bynens <mathiasbynens.be>
*/t.default=function(e){if(!e.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Categories");e.addUnicodeData(o.default)},e.exports=t.default},59749:(e,t,r)=>{"use strict";var i=r(53930),n=r(5946);i(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(88477));
/*!
* XRegExp Unicode Properties 5.1.1
* <xregexp.com>
* Steven Levithan (c) 2012-present MIT License
* Unicode data by Mathias Bynens <mathiasbynens.be>
*/t.default=function(e){if(!e.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Properties");var t=o.default;t.push({name:"Assigned",inverseOf:"Cn"}),e.addUnicodeData(t)},e.exports=t.default},50302:(e,t,r)=>{"use strict";var i=r(53930),n=r(5946);i(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(5142));
/*!
* XRegExp Unicode Scripts 5.1.1
* <xregexp.com>
* Steven Levithan (c) 2010-present MIT License
* Unicode data by Mathias Bynens <mathiasbynens.be>
*/t.default=function(e){if(!e.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Scripts");e.addUnicodeData(o.default,"Script")},e.exports=t.default},53050:(e,t,r)=>{"use strict";var i=r(53930),n=r(5946);i(t,"__esModule",{value:!0}),t.default=void 0;var o=n(r(56011)),s=n(r(26692)),a=n(r(87409)),l=n(r(77801)),d=n(r(47884)),c=n(r(59749)),u=n(r(50302));(0,s.default)(o.default),(0,a.default)(o.default),(0,l.default)(o.default),(0,d.default)(o.default),(0,c.default)(o.default),(0,u.default)(o.default);var p=o.default;t.default=p,e.exports=t.default},56011:(e,t,r)=>{"use strict";var i=r(18979),n=r(49763),o=r(16781),s=r(62222),a=r(66615),l=r(53930),d=r(5946);l(t,"__esModule",{value:!0}),t.default=void 0;var c=d(r(34875)),u=d(r(52730)),p=d(r(129)),h=d(r(18979)),f=d(r(36586)),m=d(r(64007)),g=d(r(86226)),y=d(r(27681)),v=d(r(11393));function b(e,t){var r=void 0!==o&&s(e)||e["@@iterator"];if(!r){if(a(e)||(r=function(e,t){var r;if(!e)return;if("string"==typeof e)return w(e,t);var o=i(r=Object.prototype.toString.call(e)).call(r,8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return n(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return w(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var l=0,d=function(){};return{s:d,n:function(){return l>=e.length?{done:!0}:{done:!1,value:e[l++]}},e:function(e){throw e},f:d}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var c,u=!0,p=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return u=e.done,e},e:function(e){p=!0,c=e},f:function(){try{u||null==r.return||r.return()}finally{if(p)throw c}}}}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}
/*!
* XRegExp 5.1.1
* <xregexp.com>
* Steven Levithan (c) 2007-present MIT License
*/var _="xregexp",x={astral:!1,namespacing:!0},S={},k={},E={},T=[],B="default",C="class",I={default:/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|\(\?(?:[:=!]|<[=!])|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,class:/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u(?:[\dA-Fa-f]{4}|{[\dA-Fa-f]+})|c[A-Za-z]|[\s\S])|[\s\S]/},A=/\$(?:\{([^\}]+)\}|<([^>]+)>|(\d\d?|[\s\S]?))/g,F=void 0===/()??/.exec("")[1],M=void 0!==(0,u.default)(/x/);function D(e){var t=!0;try{if(new RegExp("",e),"y"===e){".."===".a".replace(new RegExp("a","gy"),".")&&(t=!1)}}catch(e){t=!1}return t}var R=D("d"),P=D("s"),O=D("u"),z=D("y"),N={d:R,g:!0,i:!0,m:!0,s:P,u:O,y:z},q=P?/[^dgimsuy]+/g:/[^dgimuy]+/g;function U(e,t,r,i,n){var o;if(e[_]={captureNames:t},n)return e;if(e.__proto__)e.__proto__=ee.prototype;else for(var s in ee.prototype)e[s]=ee.prototype[s];return e[_].source=r,e[_].flags=i?(0,p.default)(o=i.split("")).call(o).join(""):i,e}function L(e){return e.replace(/([\s\S])(?=[\s\S]*\1)/g,"")}function j(e,t){var r;if(!ee.isRegExp(e))throw new TypeError("Type RegExp expected");var i=e[_]||{},n=function(e){return M?(0,u.default)(e):/\/([a-z]*)$/i.exec(RegExp.prototype.toString.call(e))[1]}(e),o="",s="",a=null,l=null;return(t=t||{}).removeG&&(s+="g"),t.removeY&&(s+="y"),s&&(n=n.replace(new RegExp("[".concat(s,"]+"),"g"),"")),t.addG&&(o+="g"),t.addY&&(o+="y"),o&&(n=L(n+o)),t.isInternalOnly||(void 0!==i.source&&(a=i.source),null!=(0,u.default)(i)&&(l=o?L((0,u.default)(i)+o):(0,u.default)(i))),e=U(new RegExp(t.source||e.source,n),function(e){return!(!e[_]||!e[_].captureNames)}(e)?(0,h.default)(r=i.captureNames).call(r,0):null,a,l,t.isInternalOnly)}function H(e){return(0,f.default)(e,16)}function $(e,t,r){var i=e.index+e[0].length,n=e.input[e.index-1],o=e.input[i];return/^[()|]$/.test(n)||/^[()|]$/.test(o)||0===e.index||i===e.input.length||/\(\?(?:[:=!]|<[=!])$/.test(e.input.substring(e.index-4,e.index))||function(e,t,r){var i=-1!==(0,m.default)(r).call(r,"x")?/^(?:\s|#[^#\n]*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/;return i.test((0,h.default)(e).call(e,t))}(e.input,i,r)?"":"(?:)"}function G(e){return(0,f.default)(e,10).toString(16)}function W(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function K(e){if(null==e)throw new TypeError("Cannot convert null or undefined to object");return e}function V(e){for(;e.length<4;)e="0".concat(e);return e}function J(e){var t={};return W(e,"String")?((0,g.default)(ee).call(ee,e,/[^\s,]+/,(function(e){t[e]=!0})),t):e}function Y(e){if(!/^[\w$]$/.test(e))throw new Error("Flag must be a single character A-Za-z0-9_$");N[e]=!0}function Q(e,t,r,i,n){for(var o,s,a=T.length,l=e[r],d=null;a--;)if(!((s=T[a]).leadChar&&s.leadChar!==l||s.scope!==i&&"all"!==s.scope||s.flag&&-1===(0,m.default)(t).call(t,s.flag))&&(o=ee.exec(e,s.regex,r,"sticky"))){d={matchLength:o[0].length,output:s.handler.call(n,o,i,t),reparse:s.reparse};break}return d}function Z(e){x.astral=e}function X(e){x.namespacing=e}function ee(e,t){if(ee.isRegExp(e)){if(void 0!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return j(e)}if(e=void 0===e?"":String(e),t=void 0===t?"":String(t),ee.isInstalled("astral")&&-1===(0,m.default)(t).call(t,"A")&&(t+="A"),E[e]||(E[e]={}),!E[e][t]){for(var r,i={hasNamedCapture:!1,captureNames:[]},n=B,o="",s=0,a=function(e,t){if(L(t)!==t)throw new SyntaxError("Invalid duplicate regex flag ".concat(t));e=e.replace(/^\(\?([\w$]+)\)/,(function(e,r){if(/[dgy]/.test(r))throw new SyntaxError("Cannot use flags dgy in mode modifier ".concat(e));return t=L(t+r),""}));var r,i=b(t);try{for(i.s();!(r=i.n()).done;){var n=r.value;if(!N[n])throw new SyntaxError("Unknown regex flag ".concat(n))}}catch(e){i.e(e)}finally{i.f()}return{pattern:e,flags:t}}(e,t),l=a.pattern,d=(0,u.default)(a);s<l.length;){do{(r=Q(l,d,s,n,i))&&r.reparse&&(l=(0,h.default)(l).call(l,0,s)+r.output+(0,h.default)(l).call(l,s+r.matchLength))}while(r&&r.reparse);if(r)o+=r.output,s+=r.matchLength||1;else{var p=ee.exec(l,I[n],s,"sticky"),f=(0,c.default)(p,1)[0];o+=f,s+=f.length,"["===f&&n===B?n=C:"]"===f&&n===C&&(n=B)}}E[e][t]={pattern:o.replace(/(?:\(\?:\))+/g,"(?:)"),flags:d.replace(q,""),captures:i.hasNamedCapture?i.captureNames:null}}var g=E[e][t];return U(new RegExp(g.pattern,(0,u.default)(g)),g.captures,e,t)}ee.prototype=/(?:)/,ee.version="5.1.1",ee._clipDuplicates=L,ee._hasNativeFlag=D,ee._dec=H,ee._hex=G,ee._pad4=V,ee.addToken=function(e,t,r){var i=(r=r||{}).optionalFlags;if(r.flag&&Y(r.flag),i){var n,o=b(i=i.split(""));try{for(o.s();!(n=o.n()).done;){Y(n.value)}}catch(e){o.e(e)}finally{o.f()}}T.push({regex:j(e,{addG:!0,addY:z,isInternalOnly:!0}),handler:t,scope:r.scope||B,flag:r.flag,reparse:r.reparse,leadChar:r.leadChar}),ee.cache.flush("patterns")},ee.cache=function(e,t){return k[e]||(k[e]={}),k[e][t]||(k[e][t]=ee(e,t))},ee.cache.flush=function(e){"patterns"===e?E={}:k={}},ee.escape=function(e){return String(K(e)).rLine truncated
/**
* @license lucide v0.416.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const v=(e,t,r=[])=>{const i=document.createElementNS("http://www.w3.org/2000/svg",e);return Object.keys(t).forEach((e=>{i.setAttribute(e,String(t[e]))})),r.length&&r.forEach((e=>{const t=v(...e);i.appendChild(t)})),i};var b=([e,t,r])=>v(e,t,r);
/**
* @license lucide v0.416.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const w={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"},_=["svg",w,[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}]]],x=["svg",w,[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"}],["path",{d:"M16 16h5v5"}]]],S=["svg",w,[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]]],k=require("obsidian");let E=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[e]];return t};const T="uwxv4ofkrmc4zzf",B="3729fc1c-0af2-4bec-9376-d7ac4f0ff806",C="https://login.microsoftonline.com/common",I="application/octet-stream",A="remotely-save",F="remotely-save-cb-onedrive",M="remotely-save-cb-dropbox",D=6912e6,R="_debug_remotely_save/",P="remotely-save-cb-pro",O="cli-RcskZDNbskll95WHJ3rNa8G34YlD3DML3cmwGOpEpbpvm82rIVGWmQMKJ60NjjGJKB6H_fOeHicW9W0H",z="573787634452-5301p7h0r85rpc03hbnrn5k9qqt3bulf.apps.googleusercontent.com",N="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",q="remotely-save-cb-box",U="o0ohclnln6xf7fpd1pnomqpl42v0w3hl",L="oDrcpdgifz24NJMN6OmgC2kvYCChbYMX",j="remotely-save-cb-pcloud",H="zrDphYT1giQ",$="TqjVEEaXlsHwCOczzm0R9SBmxf2y",G="remotely-save-cb-yandexdisk",W="01d8aee92915469dba50b70965d77323",K="71da4965f9124deab95444df46afa651",V="remotely-save-cb-koofr",J="LUOCNJ27DECBGKZRG22RHPBAMVK3CUWF",Y="WJH6XQF2AXK6UINDM2T3STD7OAYCX6H4ZL3T4KPYSTW4R5AKI4W26Q6C76WZQ5DT",Q="remotely-save-cb-onedrivefull";function Z(e,t,r){var i;if(void 0===r&&(r={}),!t.codes){t.codes={};for(var n=0;n<t.chars.length;++n)t.codes[t.chars[n]]=n}if(!r.loose&&e.length*t.bits&7)throw new SyntaxError("Invalid padding");for(var o=e.length;"="===e[o-1];)if(--o,!(r.loose||(e.length-o)*t.bits&7))throw new SyntaxError("Invalid padding");for(var s=new(null!=(i=r.out)?i:Uint8Array)(o*t.bits/8|0),a=0,l=0,d=0,c=0;c<o;++c){var u=t.codes[e[c]];if(void 0===u)throw new SyntaxError("Invalid character "+e[c]);l=l<<t.bits|u,(a+=t.bits)>=8&&(a-=8,s[d++]=255&l>>a)}if(a>=t.bits||255&l<<8-a)throw new SyntaxError("Unexpected end of data");return s}function X(e,t,r){void 0===r&&(r={});for(var i=r.pad,n=void 0===i||i,o=(1<<t.bits)-1,s="",a=0,l=0,d=0;d<e.length;++d)for(l=l<<8|255&e[d],a+=8;a>t.bits;)a-=t.bits,s+=t.chars[o&l>>a];if(a&&(s+=t.chars[o&l<<t.bits-a]),n)for(;s.length*t.bits&7;)s+="=";return s}var ee={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bits:5},te={chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bits:6},re=function(e,t){return void 0===t&&(t={}),Z(t.loose?e.toUpperCase().replace(/0/g,"O").replace(/1/g,"L").replace(/8/g,"B"):e,ee,t)},ie=function(e,t){return Z(e,te,t)},ne=function(e,t){return X(e,te,t)};const oe="https://remotelysave.com";console.debug(`remotelysave official website: ${oe}`);const se={accessToken:"",accessTokenExpiresInMs:0,accessTokenExpiresAtTimeMs:0,refreshToken:"",enabledProFeatures:[],email:""},ae=e=>r(void 0,void 0,void 0,(function*(){const t=O,i=E(128),n=yield function(e){return r(this,void 0,void 0,(function*(){if(void 0===e||""===e)return"";try{return ne(new Uint8Array(yield crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e))),{pad:!1})}catch(e){return""}}))}(i);let o=`${oe}/oauth2/authorize?response_type=code&client_id=${t}&token_access_type=offline&code_challenge_method=S256&code_challenge=${n}&scope=pro.list.read`;return e&&(o+=`&redirect_uri=obsidian://${P}`),{authUrl:o,codeVerifier:i,codeChallenge:n}})),le=(e,t,i)=>r(void 0,void 0,void 0,(function*(){const r=O;try{const i={code:t,grant_type:"authorization_code",code_verifier:e,client_id:r,scope:"pro.list.read"},n=yield fetch(`${oe}/api/v1/oauth2/token`,{method:"POST",body:new URLSearchParams(i)});return yield n.json()}catch(e){console.error(e),void 0!==i&&(yield i(e))}})),de=(e,t,i)=>r(void 0,void 0,void 0,(function*(){if(void 0!==t.error)throw Error(`remotely save account auth failed, please auth again: ${t.error}`);e.accessToken=t.access_token,e.accessTokenExpiresAtTimeMs=Date.now()+1e3*t.expires_in-3e5,e.accessTokenExpiresInMs=1e3*t.expires_in,e.refreshToken=t.refresh_token||e.refreshToken,e.credentialsShouldBeDeletedAtTimeMs=Date.now()+D,yield null==i?void 0:i(),console.info("finish updating local info of Remotely Save official website token")})),ce=(e,t)=>r(void 0,void 0,void 0,(function*(){var i,n,o;const s=Date.now();if(void 0!==e.accessToken&&""!==e.accessToken&&e.accessTokenExpiresAtTimeMs>s&&(null!==(i=e.credentialsShouldBeDeletedAtTimeMs)&&void 0!==i?i:s+1e6)>s)return e.accessToken;console.debug(`currently, accessToken=${e.accessToken}, accessTokenExpiresAtTimeMs=${e.accessTokenExpiresAtTimeMs}, credentialsShouldBeDeletedAtTimeMs=${e.credentialsShoLine truncated
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Gh={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},Wh=200,Kh=200,Vh=299,Jh=302,Yh=400,Qh=499,Zh=500,Xh=500,ef=599,tf=[Gh.OPENID_SCOPE,Gh.PROFILE_SCOPE,Gh.OFFLINE_ACCESS_SCOPE],rf=[...tf,Gh.EMAIL_SCOPE],nf="Content-Type",of="Retry-After",sf="X-AnchorMailbox",af="x-ms-request-id",lf="x-ms-httpver",df={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},cf="access_token",uf="xms_cc",pf={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},hf={PLAIN:"plain",S256:"S256"},ff={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},mf="authorization_code",gf="password",yf="refresh_token",vf="device_code",bf="MSSTS",wf="ADFS",_f="Generic",xf="-",Sf=".",kf={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Ef="appmetadata",Tf="1",Bf="authority-metadata",Cf=86400,If="config",Af="cache",Ff="network",Mf="hardcoded_values",Df={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},Rf={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},Pf=60,Of=3600,zf="throttling",Nf="retry-after, h429",qf="invalid_grant",Uf="client_mismatch",Lf="username",jf="password",Hf=200,$f=400,Gf="1",Wf="3",Kf="4",Vf="2",Jf="4",Yf="5",Qf="0",Zf="1",Xf="2",em="3",tm="4",rm="AZURE_POD_IDENTITY_AUTHORITY_HOST",im="IDENTITY_ENDPOINT",nm="IMDS_ENDPOINT",om="MSI_ENDPOINT",sm="user-assigned-client-id",am="user-assigned-resource-id",lm="user-assigned-object-id",dm="get",cm="post",um={SUCCESS:Wh,SUCCESS_RANGE_START:Kh,SUCCESS_RANGE_END:Vh,SERVER_ERROR:Zh},pm="sha256",hm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",fm="msal.js.node",mm="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",gm="authorization_pending",ym="http://",vm="localhost",bm=62,wm=371,_m=671,xm=871,Sm=872,km="RS256",Em="PS256",Tm="x5t#S256",Bm="x5t",Cm="x5c",Im="aud",Am="exp",Fm="iss",Mm="sub",Dm="nbf",Rm="jti",Pm=100,Om=5e3,zm="unexpected_error",Nm="post_request_failed",qm={[zm]:"Unexpected error in authentication.",[Nm]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};class Um extends Error{constructor(e,t,r){super(t?`${e}: ${t}`:e),Object.setPrototypeOf(this,Um.prototype),this.errorCode=e||Gh.EMPTY_STRING,this.errorMessage=t||Gh.EMPTY_STRING,this.subError=r||Gh.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function Lm(e){const{skus:t,libraryName:r,libraryVersion:i,extensionName:n,extensionVersion:o}=e,s=new Map([[0,[r,i]],[2,[n,o]]]);let a=[];if(t?.length){if(a=t.split(","),a.length<4)return t}else a=Array.from({length:4},(()=>"|"));return s.forEach(((e,t)=>{2===e.length&&e[0]?.length&&e[1]?.length&&function(e){const{skuArr:t,index:r,skuName:i,skuVersion:n}=e;if(r>=t.length)return;t[r]=[i,n].join("|")}({skuArr:a,index:t,skuName:e[0],skuVersion:e[1]})})),a.join(",")}class jm{constructor(e,t){this.cacheOutcome=Qf,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||Gh.EMPTY_STRING,this.wrapperVer=e.wrapperVer||Gh.EMPTY_STRING,this.telemetryCacheKey=Df.CACHE_KEY+xf+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Df.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorLine truncated
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Hm="client_id",$m="response_type",Gm="token_type",Wm="req_cnf",Km="return_spa_code",Vm="x-client-xtra-sku";
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Jm extends Um{constructor(e,t,r,i,n){super(e,t,r),this.name="ServerError",this.errorNo=i,this.status=n,Object.setPrototypeOf(this,Jm.prototype)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
var Ym;!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose",e[e.Trace=4]="Trace"}(Ym||(Ym={}));class Qm{constructor(e,t,r){this.level=Ym.Info;const i=e||Qm.createDefaultLoggerOptions();this.localCallback=i.loggerCallback||(()=>{}),this.piiLoggingEnabled=i.piiLoggingEnabled||!1,this.level="number"==typeof i.logLevel?i.logLevel:Ym.Info,this.correlationId=i.correlationId||Gh.EMPTY_STRING,this.packageName=t||Gh.EMPTY_STRING,this.packageVersion=r||Gh.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ym.Info}}clone(e,t,r){return new Qm({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)}logMessage(e,t){if(t.logLevel>this.level||!this.piiLoggingEnabled&&t.containsPii)return;const r=`${`[${(new Date).toUTCString()}] : [${t.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${Ym[t.logLevel]} - ${e}`;this.executeCallback(t.logLevel,r,t.containsPii||!1)}executeCallback(e,t,r){this.localCallback&&this.localCallback(e,t,r)}error(e,t){this.logMessage(e,{logLevel:Ym.Error,containsPii:!1,correlationId:t||Gh.EMPTY_STRING})}errorPii(e,t){this.logMessage(e,{logLevel:Ym.Error,containsPii:!0,correlationId:t||Gh.EMPTY_STRING})}warning(e,t){this.logMessage(e,{logLevel:Ym.Warning,containsPii:!1,correlationId:t||Gh.EMPTY_STRING})}warningPii(e,t){this.logMessage(e,{logLevel:Ym.Warning,containsPii:!0,correlationId:t||Gh.EMPTY_STRING})}info(e,t){this.logMessage(e,{logLevel:Ym.Info,containsPii:!1,correlationId:t||Gh.EMPTY_STRING})}infoPii(e,t){this.logMessage(e,{logLevel:Ym.Info,containsPii:!0,correlationId:t||Gh.EMPTY_STRING})}verbose(e,t){this.logMessage(e,{logLevel:Ym.Verbose,containsPii:!1,correlationId:t||Gh.EMPTY_STRING})}verbosePii(e,t){this.logMessage(e,{logLevel:Ym.Verbose,containsPii:!0,correlationId:t||Gh.EMPTY_STRING})}trace(e,t){this.logMessage(e,{logLevel:Ym.Trace,containsPii:!1,correlationId:t||Gh.EMPTY_STRING})}tracePii(e,t){this.logMessage(e,{logLevel:Ym.Trace,containsPii:!0,correlationId:t||Gh.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Zm=0,Xm=1,eg=2,tg=3;
/*! @azure/msal-common v14.15.0 2024-09-20 */
const rg="redirect_uri_empty",ig="claims_request_parsing_error",ng="authority_uri_insecure",og="url_parse_error",sg="empty_url_error",ag="empty_input_scopes_error",lg="invalid_prompt_value",dg="invalid_claims",cg="token_request_empty",ug="logout_request_empty",pg="invalid_code_challenge_method",hg="pkce_params_missing",fg="invalid_cloud_discovery_metadata",mg="invalid_authority_metadata",gg="untrusted_authority",yg="missing_ssh_jwk",vg="missing_ssh_kid",bg="missing_nonce_authentication_header",wg="invalid_authentication_header",_g="cannot_set_OIDCOptions",xg="cannot_allow_native_broker",Sg="authority_mismatch",kg={[rg]:"A redirect URI is required for all calls, and none has been set.",[ig]:"Could not parse the given claims request object.",[ng]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[og]:"URL could not be parsed into appropriate segments.",[sg]:"URL was empty or null.",[ag]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[lg]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[dg]:"Given claims parameter must be a stringified JSON object.",[cg]:"Token request was empty and not found in cache.",[ug]:"The logout request was null or undefined.",[pg]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[hg]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[fg]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[mg]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[gg]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[yg]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[vg]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[bg]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[wg]:"Invalid authentication header provided",[_g]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[xg]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[Sg]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."};class Eg extends Um{constructor(e){super(e,kg[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,Eg.prototype)}}function Tg(e){return new Eg(e)}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Bg{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0}static startsWith(e,t){return 0===e.indexOf(t)}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},r=e.split("&"),i=e=>decodeURIComponent(e.replace(/\+/g," "));return r.forEach((e=>{if(e.trim()){const[r,n]=e.split(/=(.+)/g,2);r&&n&&(t[i(r)]=i(n))}})),t}static trimArrayEntries(e){return e.map((e=>e.trim()))}static removeEmptyStringsFromArray(e){return e.filter((e=>!!e))}static jsonParseHelper(e){try{return JSON.parse(e)}catch(e){return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Cg="client_info_decoding_error",Ig="client_info_empty_error",Ag="token_parsing_error",Fg="null_or_empty_token",Mg="endpoints_resolution_error",Dg="network_error",Rg="openid_config_error",Pg="hash_not_deserialized",Og="invalid_state",zg="state_mismatch",Ng="state_not_found",qg="nonce_mismatch",Ug="auth_time_not_found",Lg="max_age_transpired",jg="multiple_matching_tokens",Hg="multiple_matching_accounts",$g="multiple_matching_appMetadata",Gg="request_cannot_be_made",Wg="cannot_remove_empty_scope",Kg="cannot_append_scopeset",Vg="empty_input_scopeset",Jg="device_code_polling_cancelled",Yg="device_code_expired",Qg="device_code_unknown_error",Zg="no_account_in_silent_request",Xg="invalid_cache_record",ey="invalid_cache_environment",ty="no_account_found",ry="no_crypto_object",iy="unexpected_credential_type",ny="invalid_assertion",oy="invalid_client_credential",sy="token_refresh_required",ay="user_timeout_reached",ly="token_claims_cnf_required_for_signedjwt",dy="authorization_code_missing_from_server_response",cy="binding_key_not_removed",uy="end_session_endpoint_not_supported",py="key_id_missing",hy="no_network_connectivity",fy="user_canceled",my="missing_tenant_id_error",gy="method_not_implemented",yy="nested_app_auth_bridge_disabled",vy={[Cg]:"The client info could not be parsed/decoded correctly",[Ig]:"The client info was empty",[Ag]:"Token cannot be parsed",[Fg]:"The token is null or empty",[Mg]:"Endpoints cannot be resolved",[Dg]:"Network request failed",[Rg]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[Pg]:"The hash parameters could not be deserialized",[Og]:"State was not the expected format",[zg]:"State mismatch error",[Ng]:"State not found",[qg]:"Nonce mismatch error",[Ug]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[Lg]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[jg]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[Hg]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[$g]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[Gg]:"Token request cannot be made without authorization code or refresh token.",[Wg]:"Cannot remove null or empty scope from ScopeSet",[Kg]:"Cannot append ScopeSet",[Vg]:"Empty input ScopeSet cannot be processed",[Jg]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[Yg]:"Device code is expired.",[Qg]:"Device code stopped polling for unknown reasons.",[Zg]:"Please pass an account object, silent flow is not supported without account information",[Xg]:"Cache record object was null or undefined.",[ey]:"Invalid environment when attempting to create cache entry",[ty]:"No account found in cache for given key.",[ry]:"No crypto object detected.",[iy]:"Unexpected credential type.",[ny]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[oy]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[sy]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[ay]:"User defined timeout for device code polling reached",[ly]:"Cannot generate a POP jwt if the token_claims are not populated",[dy]:"Server response does not contain an authorization code to proceed",[cy]:"Could not remove the credential's binding key from storage.",[uy]:"The provided authority does not support logout",[py]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[hy]:"No network connectivity. Check your internet connection.",[fy]:"User cancelled the flow.",[my]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[gy]:"This method has not been implemented",[yy]:"The nested app auth bridge is disabled"};class by extends Um{constructor(e,t){super(e,t?`${vy[e]}: ${t}`:vy[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,by.prototype)}}function wy(e,t){return new by(e,t)}function _y(e){if(!e||e.indexOf("=")<0)return null;try{const t=
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){return e.startsWith("#/")?e.substring(2):e.startsWith("#")||e.startsWith("?")?e.substring(1):e}(e),r=Object.fromEntries(new URLSearchParams(t));if(r.code||r.error||r.error_description||r.state)return r}catch(e){throw wy(Pg)}return null}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class xy{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Tg(sg);e.includes("#")||(this._urlString=xy.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return Bg.endsWith(t,"?")?t=t.slice(0,-1):Bg.endsWith(t,"?/")&&(t=t.slice(0,-2)),Bg.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch(e){throw Tg(og)}if(!e.HostNameAndPort||!e.PathSegments)throw Tg(og);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw Tg(ng)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return xy.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),r=t.PathSegments;return!e||0===r.length||r[0]!==df.COMMON&&r[0]!==df.ORGANIZATIONS||(r[0]=e),xy.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw Tg(og);const r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let i=r.AbsolutePath.split("/");return i=i.filter((e=>e&&e.length>0)),r.PathSegments=i,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw Tg(og);return r[2]}static getAbsoluteUrl(e,t){if(e[0]===Gh.FORWARD_SLASH){const r=new xy(t).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new xy(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!_y(e)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Sy={"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},ky={tenant_discovery_endpoint:"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},Ey=new Set;function Ty(e,t,r,i){if(i?.trace(`getAliasesFromMetadata called with source: ${r}`),e&&t){const n=By(t,e);if(n)return i?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${r}, returning aliases`),n.aliases;i?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${r}`)}return null}function By(e,t){for(let r=0;r<e.length;r++){const i=e[r];if(i.aliases.includes(t))return i}return null}ky.metadata.forEach((e=>{e.aliases.forEach((e=>{Ey.add(e)}))}));
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Cy="AAD",Iy="OIDC",Ay="none";
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Fy="refreshTokenClientExecutePostToTokenEndpoint",My="authorizationCodeClientExecutePostToTokenEndpoint",Dy="refreshTokenClientExecuteTokenRequest",Ry="refreshTokenClientAcquireToken",Py="refreshTokenClientAcquireTokenWithCachedRefreshToken",Oy="refreshTokenClientAcquireTokenByRefreshToken",zy="refreshTokenClientCreateTokenRequestBody",Ny="silentFlowClientAcquireCachedToken",qy="silentFlowClientGenerateResultFromCacheRecord",Uy="getAuthCodeUrl",Ly="updateTokenEndpointAuthority",jy="authClientAcquireToken",Hy="authClientExecuteTokenRequest",$y="authClientCreateTokenRequestBody",Gy="authClientCreateQueryString",Wy="popTokenGenerateCnf",Ky="popTokenGenerateKid",Vy="handleServerTokenResponse",Jy="authorityFactoryCreateDiscoveredInstance",Yy="authorityResolveEndpointsAsync",Qy="authorityGetCloudDiscoveryMetadataFromNetwork",Zy="authorityUpdateCloudDiscoveryMetadata",Xy="authorityGetEndpointMetadataFromNetwork",ev="authorityUpdateEndpointMetadata",tv="authorityUpdateMetadataWithRegionalInformation",rv="regionDiscoveryDetectRegion",iv="regionDiscoveryGetRegionFromIMDS",nv="regionDiscoveryGetCurrentVersion",ov="cacheManagerGetRefreshToken",sv=(new Map([["acquireTokenByCode","ATByCode"],["acquireTokenByRefreshToken","ATByRT"],["acquireTokenSilent","ATS"],["acquireTokenSilentAsync","ATSAsync"],["acquireTokenPopup","ATPopup"],["acquireTokenRedirect","ATRedirect"],["cryptoOptsGetPublicKeyThumbprint","CryptoGetPKThumb"],["cryptoOptsSignJwt","CryptoSignJwt"],["silentCacheClientAcquireToken","SltCacheClientAT"],["silentIframeClientAcquireToken","SltIframeClientAT"],["silentRefreshClientAcquireToken","SltRClientAT"],["ssoSilent","SsoSlt"],["standardInteractionClientGetDiscoveredAuthority","StdIntClientGetDiscAuth"],["fetchAccountIdWithNativeBroker","FetchAccIdWithNtvBroker"],["nativeInteractionClientAcquireToken","NtvIntClientAT"],["baseClientCreateTokenRequestHeaders","BaseClientCreateTReqHead"],[Fy,"RTClientExecPost"],[My,"AuthCodeClientExecPost"],["brokerHandshake","BrokerHandshake"],["acquireTokenByRefreshTokenInBroker","ATByRTInBroker"],["acquireTokenByBroker","ATByBroker"],[Dy,"RTClientExecTReq"],[Ry,"RTClientAT"],[Py,"RTClientATWithCachedRT"],[Oy,"RTClientATByRT"],[zy,"RTClientCreateTReqBody"],["acquireTokenFromCache","ATFromCache"],[Ny,"SltFlowClientATCached"],[qy,"SltFlowClientGenResFromCache"],["acquireTokenBySilentIframe","ATBySltIframe"],["initializeBaseRequest","InitBaseReq"],["initializeSilentRequest","InitSltReq"],["initializeClientApplication","InitClientApplication"],["silentIframeClientTokenHelper","SIClientTHelper"],["silentHandlerInitiateAuthRequest","SHandlerInitAuthReq"],["silentHandlerMonitorIframeForHash","SltHandlerMonitorIframeForHash"],["silentHandlerLoadFrame","SHandlerLoadFrame"],["silentHandlerLoadFrameSync","SHandlerLoadFrameSync"],["standardInteractionClientCreateAuthCodeClient","StdIntClientCreateAuthCodeClient"],["standardInteractionClientGetClientConfiguration","StdIntClientGetClientConf"],["standardInteractionClientInitializeAuthorizationRequest","StdIntClientInitAuthReq"],["standardInteractionClientInitializeAuthorizationCodeRequest","StdIntClientInitAuthCodeReq"],[Uy,"GetAuthCodeUrl"],["handleCodeResponseFromServer","HandleCodeResFromServer"],["handleCodeResponse","HandleCodeResp"],[Ly,"UpdTEndpointAuth"],[jy,"AuthClientAT"],[Hy,"AuthClientExecTReq"],[$y,"AuthClientCreateTReqBody"],[Gy,"AuthClientCreateQueryStr"],[Wy,"PopTGenCnf"],[Ky,"PopTGenKid"],[Vy,"HandleServerTRes"],["deserializeResponse","DeserializeRes"],[Jy,"AuthFactCreateDiscInst"],[Yy,"AuthResolveEndpointsAsync"],["authorityResolveEndpointsFromLocalSources","AuthResolveEndpointsFromLocal"],[Qy,"AuthGetCDMetaFromNet"],[Zy,"AuthUpdCDMeta"],[Xy,"AuthUpdCDMetaFromNet"],[ev,"AuthUpdEndpointMeta"],[tv,"AuthUpdMetaWithRegInfo"],[rv,"RegDiscDetectReg"],[iv,"RegDiscGetRegFromIMDS"],[nv,"RegDiscGetCurrentVer"],["acquireTokenByCodeAsync","ATByCodeAsync"],["getEndpointMetadataFromNetwork","GetEndpointMetaFromNet"],["getCloudDiscoveryMetadataFromNetworkMeasurement","GetCDMetaFromNet"],["handleRedirectPromise","HandleRedirectPromise"],["handleNativeRedirectPromise","HandleNtvRedirectPromise"],["updateCloudDiscoveryMetadataMeasurement","UpdateCDMeta"],["usernamePasswordClientAcquireToken","UserPassClientAT"],["nativeMessageHandlerHandshake","NtvMsgHandlerHandshake"],["nativeGenerateAuthResult","NtvGenAuthRes"],["removeHiddenIframe","RemoveHiddenIframe"],["clearTokensAndKeysWithClaims","ClearTAndKeysWithClaims"],[ov,"CacheManagerGetRT"],["generatePkceCodes","GenPkceCodes"],["generateCodeVerifier","GenCodeVerifier"],["generateCodeChallengeFromVerifier","GenCodeChallengeFromVerifier"],["sha256Digest","Sha256Digest"],["getRandomValues","GetRandomValues"]]),new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status","multiMatchedAT","multiMatchedID","multiMatchedRT"]),(e,t,r,i,n)=>(...o)=>{r.trace(`Executing function ${t}`);const s=i?.startMeasurement(Line truncated
/*! @azure/msal-common v14.15.0 2024-09-20 */
class av{constructor(e,t,r,i){this.networkInterface=e,this.logger=t,this.performanceClient=r,this.correlationId=i}async detectRegion(e,t){this.performanceClient?.addQueueMeasurement(rv,this.correlationId);let r=e;if(r)t.region_source=Wf;else{const e=av.IMDS_OPTIONS;try{const i=await sv(this.getRegionFromIMDS.bind(this),iv,this.logger,this.performanceClient,this.correlationId)(Gh.IMDS_VERSION,e);if(i.status===Hf&&(r=i.body,t.region_source=Kf),i.status===$f){const i=await sv(this.getCurrentVersion.bind(this),nv,this.logger,this.performanceClient,this.correlationId)(e);if(!i)return t.region_source=Gf,null;const n=await sv(this.getRegionFromIMDS.bind(this),iv,this.logger,this.performanceClient,this.correlationId)(i,e);n.status===Hf&&(r=n.body,t.region_source=Kf)}}catch(e){return t.region_source=Gf,null}}return r||(t.region_source=Gf),r||null}async getRegionFromIMDS(e,t){return this.performanceClient?.addQueueMeasurement(iv,this.correlationId),this.networkInterface.sendGetRequestAsync(`${Gh.IMDS_ENDPOINT}?api-version=${e}&format=text`,t,Gh.IMDS_TIMEOUT)}async getCurrentVersion(e){this.performanceClient?.addQueueMeasurement(nv,this.correlationId);try{const t=await this.networkInterface.sendGetRequestAsync(`${Gh.IMDS_ENDPOINT}?format=json`,e);return t.status===$f&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?t.body["newest-versions"][0]:null}catch(e){return null}}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function lv(e,t){const r=function(e){if(!e)throw wy(Fg);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw wy(Ag);return t[2]}(e);try{const e=t(r);return JSON.parse(e)}catch(e){throw wy(Ag)}}function dv(e,t){if(0===t||Date.now()-3e5>e+t)throw wy(Lg)}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function cv(){return Math.round((new Date).getTime()/1e3)}function uv(e,t){const r=Number(e)||0;return cv()+t>r}function pv(e,t){return new Promise((r=>setTimeout((()=>r(t)),e)))}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function hv(e){return[vv(e),bv(e),wv(e),_v(e),xv(e)].join(xf).toLowerCase()}function fv(e){return e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")}function mv(e){return!!e&&(fv(e)&&e.hasOwnProperty("realm")&&e.hasOwnProperty("target")&&(e.credentialType===kf.ACCESS_TOKEN||e.credentialType===kf.ACCESS_TOKEN_WITH_AUTH_SCHEME))}function gv(e){return!!e&&(fv(e)&&e.hasOwnProperty("realm")&&e.credentialType===kf.ID_TOKEN)}function yv(e){return!!e&&(fv(e)&&e.credentialType===kf.REFRESH_TOKEN)}function vv(e){return[e.homeAccountId,e.environment].join(xf).toLowerCase()}function bv(e){const t=e.credentialType===kf.REFRESH_TOKEN&&e.familyId||e.clientId;return[e.credentialType,t,e.realm||""].join(xf).toLowerCase()}function wv(e){return(e.target||"").toLowerCase()}function _v(e){return(e.requestedClaimsHash||"").toLowerCase()}function xv(e){return e.tokenType&&e.tokenType.toLowerCase()!==Rf.BEARER.toLowerCase()?e.tokenType.toLowerCase():""}function Sv(e,t){return!!t&&(0===e.indexOf(Ef)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"))}function kv(){return cv()+Cf}function Ev(e,t,r){e.authorization_endpoint=t.authorization_endpoint,e.token_endpoint=t.token_endpoint,e.end_session_endpoint=t.end_session_endpoint,e.issuer=t.issuer,e.endpointsFromNetwork=r,e.jwks_uri=t.jwks_uri}function Tv(e,t,r){e.aliases=t.aliases,e.preferred_cache=t.preferred_cache,e.preferred_network=t.preferred_network,e.aliasesFromNetwork=r}function Bv(e){return e.expiresAt<=cv()}av.IMDS_OPTIONS={headers:{Metadata:"true"}};
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Cv{constructor(e,t,r,i,n,o,s,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=i,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=n,this.performanceClient=s,this.correlationId=o,this.managedIdentity=a||!1,this.regionDiscovery=new av(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(Gh.CIAM_AUTH_URL))return tg;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case Gh.ADFS:return Xm;case Gh.DSTS:return eg}return Zm}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new xy(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw wy(Mg)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw wy(Mg)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw wy(Mg)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw wy(uy);return this.replacePath(this.metadata.end_session_endpoint)}throw wy(Mg)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw wy(Mg)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw wy(Mg)}canReplaceTenant(e){return 1===e.PathSegments.length&&!Cv.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Zm&&this.protocolMode===Cy}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new xy(this.metadata.canonical_authority).getUrlComponents(),i=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(((e,n)=>{let o=i[n];if(0===n&&this.canReplaceTenant(r)){const e=new xy(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];o!==e&&(this.logger.verbose(`Replacing tenant domain name ${o} with id ${e}`),o=e)}e!==o&&(t=t.replace(`/${o}/`,`/${e}/`))})),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Xm||this.protocolMode!==Cy&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){this.performanceClient?.addQueueMeasurement(Yy,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await sv(this.updateCloudDiscoveryMetadata.bind(this),Zy,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await sv(this.updateEndpointMetadata.bind(this),ev,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:r}),this.performanceClient?.addFields({cloudDiscoverySource:t,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:kv(),jwks_uri:""}),e}updateCachedMetadata(e,t,r){t!==Af&&r?.source!==Af&&(e.expiresAt=kv(),e.canonical_authority=this.canonicalAuthority);const i=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(i,e),this.metadata=e}async updateEndpointMetadata(e){this.performanceClient?.addQueueMeasurement(ev,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===Mf&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&t.metadata){Ev(e,await sv(this.updateMetadataWithRegionalInformation.bind(this),tv,this.logger,this.performanceClient,this.correlationId)(t.metadata),!1),e.canonical_authority=this.canonicalAuthority}returnLine truncated
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")}(r.body);return i?r.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(e){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${e}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in Sy?Sy[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){this.performanceClient?.addQueueMeasurement(tv,this.correlationId);const t=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(t){if(t!==Gh.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=Vf,this.regionDiscoveryMetadata.region_used=t,Cv.replaceWithRegionalInformation(e,t);const r=await sv(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),rv,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(r)return this.regionDiscoveryMetadata.region_outcome=Jf,this.regionDiscoveryMetadata.region_used=r,Cv.replaceWithRegionalInformation(e,r);this.regionDiscoveryMetadata.region_outcome=Yf}return e}async updateCloudDiscoveryMetadata(e){this.performanceClient?.addQueueMeasurement(Zy,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const r=await sv(this.getCloudDiscoveryMetadataFromNetwork.bind(this),Qy,this.logger,this.performanceClient,this.correlationId)();if(r)return Tv(e,r,!0),Ff;throw Tg(gg)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||Gh.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||Gh.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||Gh.NOT_APPLICABLE}`);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),Tv(e,t,!1),If;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const t=(r=this.hostnameAndPort,By(ky.metadata,r));if(t)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),Tv(e,t,!1),Mf;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}var r;const i=Bv(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!i?(this.logger.verbose("Found cloud discovery metadata in the cache."),Af):(i&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===tg)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),Cv.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=By(JSON.parse(this.authorityOptions.cloudDiscoveryMetadata).metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),e)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),e;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),Tg(fg)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),Cv.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(Qy,this.correlationId);const e=`${Gh.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let r=null;try{const i=await this.networkInterface.sendGetRequestAsync(e,t);let n,o;if(
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}(i.body))n=i.body,o=n.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${n.tenant_discovery_endpoint}`);else{if(!
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){return e.hasOwnProperty("error")&&e.hasOwnProperty("error_description")}(i.body))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${i.status}`),n=i.body,n.error===Gh.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${n.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${n.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),o=[]}this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),r=By(o,this.hostnameAndPort)}catch(e){if(e instanceof Um)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.\nError: ${e.errorCode}\nError Description: ${e.errorMessage}`);else{const t=e;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: ${t.name}\nError Description: ${t.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=Cv.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter((e=>e&&xy.getDomainFromUrl(e).toLowerCase()===this.hostnameAndPort)).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==Ay){const e=t.tenant?t.tenant:Gh.DEFAULT_COMMON_TENANT;r=`${t.azureCloudInstance}/${e}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return Gh.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw wy(Mg)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Ey.has(e)}static isPublicCloudAuthority(e){return Gh.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const i=new xy(e);i.validateAsUri();const n=i.getUrlComponents();let o=`${t}.${n.HostNameAndPort}`;this.isPublicCloudAuthority(n.HostNameAndPort)&&(o=`${t}.${Gh.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const s=xy.constructAuthorityUriFromObject({...i.getUrlComponents(),HostNameAndPort:o}).urlString;return r?`${s}?${r}`:s}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=Cv.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=Cv.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=Cv.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const r=new xy(e).getUrlComponents();if(0===r.PathSegments.length&&r.HostNameAndPort.endsWith(Gh.CIAM_AUTH_URL)){t=`${t}${r.HostNameAndPort.split(".")[0]}${Gh.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}function Iv(e){return e.endsWith(Gh.FORWARD_SLASH)?e:`${e}${Gh.FORWARD_SLASH}`}Cv.reservedTenantDomains=new Set(["{tenant}","{tenantid}",df.COMMON,df.CONSUMERS,df.ORGANIZATIONS]);
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Av={createNewGuid:()=>{throw wy(gy)},base64Decode:()=>{throw wy(gy)},base64Encode:()=>{throw wy(gy)},base64UrlEncode:()=>{throw wy(gy)},encodeKid:()=>{throw wy(gy)},async getPublicKeyThumbprint(){throw wy(gy)},async removeTokenBindingKey(){throw wy(gy)},async clearKeystore(){throw wy(gy)},async signJwt(){throw wy(gy)},async hashString(){throw wy(gy)}},Fv="@azure/msal-common",Mv="14.15.0";
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Dv{constructor(e){const t=e?Bg.trimArrayEntries([...e]):[],r=t?Bg.removeEmptyStringsFromArray(t):[];this.validateInputScopes(r),this.scopes=new Set,r.forEach((e=>this.scopes.add(e)))}static fromString(e){const t=(e||Gh.EMPTY_STRING).split(" ");return new Dv(t)}static createSearchScopes(e){const t=new Dv(e);return t.containsOnlyOIDCScopes()?t.removeScope(Gh.OFFLINE_ACCESS_SCOPE):t.removeOIDCScopes(),t}validateInputScopes(e){if(!e||e.length<1)throw Tg(ag)}containsScope(e){const t=this.printScopesLowerCase().split(" "),r=new Dv(t);return!!e&&r.scopes.has(e.toLowerCase())}containsScopeSet(e){return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((e=>this.containsScope(e))))}containsOnlyOIDCScopes(){let e=0;return rf.forEach((t=>{this.containsScope(t)&&(e+=1)})),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach((e=>this.appendScope(e)))}catch(e){throw wy(Kg)}}removeScope(e){if(!e)throw wy(Wg);this.scopes.delete(e.trim())}removeOIDCScopes(){rf.forEach((e=>{this.scopes.delete(e)}))}unionScopeSets(e){if(!e)throw wy(Vg);const t=new Set;return e.scopes.forEach((e=>t.add(e.toLowerCase()))),this.scopes.forEach((e=>t.add(e.toLowerCase()))),t}intersectingScopeSets(e){if(!e)throw wy(Vg);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),r=e.getScopeCount(),i=this.getScopeCount();return t.size<i+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach((t=>e.push(t))),e}printScopes(){if(this.scopes){return this.asArray().join(" ")}return Gh.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function Rv(e,t){if(!e)throw wy(Ig);try{const r=t(e);return JSON.parse(r)}catch(e){throw wy(Cg)}}function Pv(e){if(!e)throw wy(Cg);const t=e.split(Sf,2);return{uid:t[0],utid:t.length<2?Gh.EMPTY_STRING:t[1]}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function Ov(e,t){return!!e&&!!t&&e===t.split(".")[1]}function zv(e,t,r,i){if(i){const{oid:t,sub:r,tid:n,name:o,tfp:s,acr:a}=i,l=n||s||a||"";return{tenantId:l,localAccountId:t||r||"",name:o,isHomeTenant:Ov(l,e)}}return{tenantId:r,localAccountId:t,isHomeTenant:Ov(r,e)}}function Nv(e,t,r,i){let n=e;if(t){const{isHomeTenant:r,...i}=t;n={...e,...i}}if(r){const{isHomeTenant:t,...o}=zv(e.homeAccountId,e.localAccountId,e.tenantId,r);return n={...n,...o,idTokenClaims:r,idToken:i},n}return n}
/*! @azure/msal-common v14.15.0 2024-09-20 */
function qv(e){if(e){return e.tid||e.tfp||e.acr||null}return null}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Uv{generateAccountId(){return[this.homeAccountId,this.environment].join(xf).toLowerCase()}generateAccountKey(){return Uv.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map((e=>[e.tenantId,e])))}}isSingleTenant(){return!this.tenantProfiles}static generateAccountCacheKey(e){const t=e.homeAccountId.split(".")[1];return[e.homeAccountId,e.environment||"",t||e.tenantId||""].join(xf).toLowerCase()}static createAccount(e,t,r){const i=new Uv;let n;t.authorityType===Xm?i.authorityType=wf:t.protocolMode===Cy?i.authorityType=bf:i.authorityType=_f,e.clientInfo&&r&&(n=Rv(e.clientInfo,r)),i.clientInfo=e.clientInfo,i.homeAccountId=e.homeAccountId,i.nativeAccountId=e.nativeAccountId;const o=e.environment||t&&t.getPreferredCache();if(!o)throw wy(ey);i.environment=o,i.realm=n?.utid||qv(e.idTokenClaims)||"",i.localAccountId=n?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";const s=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,a=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null;if(i.username=s||a||"",i.name=e.idTokenClaims?.name||"",i.cloudGraphHostName=e.cloudGraphHostName,i.msGraphHost=e.msGraphHost,e.tenantProfiles)i.tenantProfiles=e.tenantProfiles;else{const t=zv(e.homeAccountId,i.localAccountId,i.realm,e.idTokenClaims);i.tenantProfiles=[t]}return i}static createFromAccountInfo(e,t,r){const i=new Uv;return i.authorityType=e.authorityType||_f,i.homeAccountId=e.homeAccountId,i.localAccountId=e.localAccountId,i.nativeAccountId=e.nativeAccountId,i.realm=e.tenantId,i.environment=e.environment,i.username=e.username,i.name=e.name,i.cloudGraphHostName=t,i.msGraphHost=r,i.tenantProfiles=Array.from(e.tenantProfiles?.values()||[]),i}static generateHomeAccountId(e,t,r,i,n){if(t!==Xm&&t!==eg){if(e)try{const t=Rv(e,i.base64Decode);if(t.uid&&t.utid)return`${t.uid}.${t.utid}`}catch(e){}r.warning("No client info in response")}return n?.sub||""}static isAccountEntity(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))}static accountInfoIsEqual(e,t,r){if(!e||!t)return!1;let i=!0;if(r){const r=e.idTokenClaims||{},n=t.idTokenClaims||{};i=r.iat===n.iat&&r.nonce===n.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&i}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Lv="cache_quota_exceeded",jv="cache_error_unknown",Hv={[Lv]:"Exceeded cache storage capacity.",[jv]:"Unexpected error occurred when using cache storage."};class $v extends Error{constructor(e,t){const r=t||(Hv[e]?Hv[e]:Hv[jv]);super(`${e}: ${r}`),Object.setPrototypeOf(this,$v.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Gv{constructor(e,t,r,i){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(Fv,Mv),this.staticAuthorityOptions=i}getAllAccounts(e){return this.buildTenantProfiles(this.getAccountsFilteredBy(e||{}),e)}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);if(t.length>1){return t.sort((e=>e.idTokenClaims?-1:1))[0]}return 1===t.length?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}buildTenantProfiles(e,t){return e.flatMap((e=>this.getTenantProfilesFromAccountEntity(e,t?.tenantId,t)))}getTenantedAccountInfoByFilter(e,t,r,i){let n,o=null;if(i&&!this.tenantProfileMatchesFilter(r,i))return null;const s=this.getIdToken(e,t,r.tenantId);return s&&(n=lv(s.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(n,i))?null:(o=Nv(e,r,n,s?.secret),o)}getTenantProfilesFromAccountEntity(e,t,r){const i=e.getAccountInfo();let n=i.tenantProfiles||new Map;const o=this.getTokenKeys();if(t){const e=n.get(t);if(!e)return[];n=new Map([[t,e]])}const s=[];return n.forEach((e=>{const t=this.getTenantedAccountInfoByFilter(i,o,e,r);t&&s.push(t)})),s}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId))&&((!t.name||e.name===t.name)&&(void 0===t.isHomeTenant||e.isHomeTenant===t.isHomeTenant))}idTokenClaimsMatchTenantProfileFilter(e,t){if(t){if(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId))return!1;if(t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint))return!1;if(t.username&&!this.matchUsername(e.preferred_username,t.username))return!1;if(t.name&&!this.matchName(e,t.name))return!1;if(t.sid&&!this.matchSid(e,t.sid))return!1}return!0}async saveCacheRecord(e,t,r){if(!e)throw wy(Xg);try{e.account&&this.setAccount(e.account),e.idToken&&!1!==t?.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken&&!1!==t?.accessToken&&await this.saveAccessToken(e.accessToken),e.refreshToken&&!1!==t?.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata)}catch(e){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed"),e instanceof Error?(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e.message}`,r),"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||e.message.includes("exceeded the quota")?(this.commonLogger?.error("CacheManager.saveCacheRecord: exceeded storage quota",r),new $v(Lv)):new $v(e.name,e.message)):(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e}`,r),new $v(jv))}}async saveAccessToken(e){const t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},r=this.getTokenKeys(),i=Dv.fromString(e.target),n=[];r.accessToken.forEach((e=>{if(!this.accessTokenKeyMatchesFilter(e,t,!1))return;const r=this.getAccessTokenCredential(e);if(r&&this.credentialMatchesFilter(r,t)){Dv.fromString(r.target).intersectingScopeSets(i)&&n.push(this.removeAccessToken(e))}})),await Promise.all(n),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),r=[];return t.forEach((t=>{if(!this.isAccountKey(t,e.homeAccountId))return;const i=this.getAccount(t,this.commonLogger);if(!i)return;if(e.homeAccountId&&!this.matchHomeAccountId(i,e.homeAccountId))return;if(e.username&&!this.matchUsername(i.username,e.username))return;if(e.environment&&!this.matchEnvironment(i,e.environment))return;if(e.realm&&!this.matchRealm(i,e.realm))return;if(e.nativeAccountId&&!this.matchNativeAccountId(i,e.nativeAccountId))return;if(e.authorityType&&!this.matchAuthorityType(i,e.authorityType))return;const n={localAccountId:e?.localAccountId,name:e?.name},o=i.tenantProfiles?.filter((e=>this.tenantProfileMatchesFilter(e,n)));o&&0===o.length||r.push(i)})),r}isAccountKey(e,t,r){return!(e.split(xf).length<3)&&(!(t&&!e.toLowerCase().includes(t.toLowerCase()))&&!(r&&!e.toLowerCase().includes(r.toLowerCase())))}isCredentialKey(e){if(e.split(xf).length<6)return!1;const t=e.toLowerCase();if(-1===t.indexOf(kf.ID_TOKEN.toLowerCase())&&-1===t.indexOf(kf.ACCESS_TOKEN.toLowerCase())&&-1===t.indexOf(kf.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())&&-1===t.indexOf(kf.REFRESH_TOKEN.toLowerCase()))return!1;if(t.indexOf(kf.REFRESH_TOKEN.toLowerCase())>-1){const e=`${kf.REFRESH_TOKEN}${xf}${this.clientId}${xf}`,r=`${kf.REFRESH_TOKEN}${xf}${Tf}${xf}`;if(-1===t.indexOf(e.toLowerCase())&&-1===t.indexOf(r.toLowerCase()))return!1}else if(-1===t.indexOf(this.clientId.toLowerCase()))return!1;return!0}credentialMatchesFilter(e,t){if(t.clientId&&!this.matchClientId(e,t.clientId))return!1;if(t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash))return!1;if("string"==typeof t.homeAccountId&&!this.matchHomeAccountId(e,t.homeAccountId))return!1;if(t.environment&&!this.matchEnvironment(e,t.environment))return!1;if(t.realmLine truncated
/*! @azure/msal-common v14.15.0 2024-09-20 */
const Kv={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1},Vv={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ym.Info,correlationId:Gh.EMPTY_STRING},Jv={claimsBasedCachingEnabled:!1},Yv={async sendGetRequestAsync(){throw wy(gy)},async sendPostRequestAsync(){throw wy(gy)}},Qv={sku:Gh.SKU,version:Mv,cpu:Gh.EMPTY_STRING,os:Gh.EMPTY_STRING},Zv={clientSecret:Gh.EMPTY_STRING,clientAssertion:void 0},Xv={azureCloudInstance:Ay,tenant:`${Gh.DEFAULT_COMMON_TENANT}`},eb={application:{appName:"",appVersion:""}};function tb(e){return e.authOptions.authority.options.protocolMode===Iy}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class rb{static generateThrottlingStorageKey(e){return`${zf}.${JSON.stringify(e)}`}static preProcess(e,t){const r=rb.generateThrottlingStorageKey(t),i=e.getThrottlingCache(r);if(i){if(i.throttleTime<Date.now())return void e.removeItem(r);throw new Jm(i.errorCodes?.join(" ")||Gh.EMPTY_STRING,i.errorMessage,i.subError)}}static postProcess(e,t,r){if(rb.checkResponseStatus(r)||rb.checkResponseForRetryAfter(r)){const i={throttleTime:rb.calculateThrottleTime(parseInt(r.headers[of])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(rb.generateThrottlingStorageKey(t),i)}}static checkResponseStatus(e){return 429===e.status||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return!!e.headers&&(e.headers.hasOwnProperty(of)&&(e.status<200||e.status>=300))}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||Pf),r+Of))}static removeThrottle(e,t,r,i){const n={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:i,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},o=this.generateThrottlingStorageKey(n);e.removeItem(o)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class ib{constructor(e,t){this.networkClient=e,this.cacheManager=t}async sendPostRequest(e,t,r){let i;rb.preProcess(this.cacheManager,e);try{i=await this.networkClient.sendPostRequestAsync(t,r)}catch(e){throw e instanceof Um?e:wy(Dg)}return rb.postProcess(this.cacheManager,e,i),i}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const nb="home_account_id",ob="UPN";
/*! @azure/msal-common v14.15.0 2024-09-20 */
class sb{static validateRedirectUri(e){if(!e)throw Tg(rg)}static validatePrompt(e){const t=[];for(const e in pf)t.push(pf[e]);if(t.indexOf(e)<0)throw Tg(lg)}static validateClaims(e){try{JSON.parse(e)}catch(e){throw Tg(dg)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw Tg(hg);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([hf.PLAIN,hf.S256].indexOf(e)<0)throw Tg(pg)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class ab{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set($m,encodeURIComponent(Gh.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set($m,encodeURIComponent(`${Gh.TOKEN_RESPONSE_TYPE} ${Gh.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set("response_mode",encodeURIComponent(e||ff.QUERY))}addNativeBroker(){this.parameters.set("nativebroker",encodeURIComponent("1"))}addScopes(e,t=!0,r=tf){!t||r.includes("openid")||e.includes("openid")||r.push("openid");const i=t?[...e||[],...r]:e||[],n=new Dv(i);this.parameters.set("scope",encodeURIComponent(n.printScopes()))}addClientId(e){this.parameters.set(Hm,encodeURIComponent(e))}addRedirectUri(e){sb.validateRedirectUri(e),this.parameters.set("redirect_uri",encodeURIComponent(e))}addPostLogoutRedirectUri(e){sb.validateRedirectUri(e),this.parameters.set("post_logout_redirect_uri",encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set("id_token_hint",encodeURIComponent(e))}addDomainHint(e){this.parameters.set("domain_hint",encodeURIComponent(e))}addLoginHint(e){this.parameters.set("login_hint",encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(sf,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(sf,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set("sid",encodeURIComponent(e))}addClaims(e,t){const r=this.addClientCapabilitiesToClaims(e,t);sb.validateClaims(r),this.parameters.set("claims",encodeURIComponent(r))}addCorrelationId(e){this.parameters.set("client-request-id",encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set("x-client-SKU",e.sku),this.parameters.set("x-client-VER",e.version),e.os&&this.parameters.set("x-client-OS",e.os),e.cpu&&this.parameters.set("x-client-CPU",e.cpu)}addApplicationTelemetry(e){e?.appName&&this.parameters.set("x-app-name",e.appName),e?.appVersion&&this.parameters.set("x-app-ver",e.appVersion)}addPrompt(e){sb.validatePrompt(e),this.parameters.set("prompt",encodeURIComponent(e))}addState(e){e&&this.parameters.set("state",encodeURIComponent(e))}addNonce(e){this.parameters.set("nonce",encodeURIComponent(e))}addCodeChallengeParams(e,t){if(sb.validateCodeChallengeParams(e,t),!e||!t)throw Tg(hg);this.parameters.set("code_challenge",encodeURIComponent(e)),this.parameters.set("code_challenge_method",encodeURIComponent(t))}addAuthorizationCode(e){this.parameters.set("code",encodeURIComponent(e))}addDeviceCode(e){this.parameters.set("device_code",encodeURIComponent(e))}addRefreshToken(e){this.parameters.set("refresh_token",encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set("code_verifier",encodeURIComponent(e))}addClientSecret(e){this.parameters.set("client_secret",encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set("client_assertion",encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set("client_assertion_type",encodeURIComponent(e))}addOboAssertion(e){this.parameters.set("assertion",encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set("requested_token_use",encodeURIComponent(e))}addGrantType(e){this.parameters.set("grant_type",encodeURIComponent(e))}addClientInfo(){this.parameters.set("client_info","1")}addExtraQueryParameters(e){Object.entries(e).forEach((([e,t])=>{!this.parameters.has(e)&&t&&this.parameters.set(e,t)}))}addClientCapabilitiesToClaims(e,t){let r;if(e)try{r=JSON.parse(e)}catch(e){throw Tg(dg)}else r={};return t&&t.length>0&&(r.hasOwnProperty(cf)||(r[cf]={}),r[cf][uf]={values:t}),JSON.stringify(r)}addUsername(e){this.parameters.set(Lf,encodeURIComponent(e))}addPassword(e){this.parameters.set(jf,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(Gm,Rf.POP),this.parameters.set(Wm,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(Gm,Rf.SSH),this.parameters.set(Wm,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set("x-client-current-telemetry",e.generateCurrentRequestHeaderValue()),this.parameters.set("x-client-last-telemetry",e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set("x-ms-lib-capability",Nf)}addLogoutHint(e){this.parameters.set("logout_hint",encodeURIComponent(e))}createQueryString(){const e=new Array;return this.parameters.forEach(((t,r)=>{e.push(`${r}=${t}`)})),e.join("&")}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
async function lb(e,t,r,i,n,o,s){s?.addQueueMeasurement(Jy,o);const a=Cv.transformCIAMAuthority(Iv(e)),l=new Cv(a,t,r,i,n,o,s);try{return await sv(l.resolveEndpointsAsync.bind(l),Yy,n,s,o)(),l}catch(e){throw wy(Mg)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class db{constructor(e,t){this.config=function({authOptions:e,systemOptions:t,loggerOptions:r,cacheOptions:i,storageInterface:n,networkInterface:o,cryptoInterface:s,clientCredentials:a,libraryInfo:l,telemetry:d,serverTelemetryManager:c,persistencePlugin:u,serializableCache:p}){const h={...Vv,...r};return{authOptions:(f=e,{clientCapabilities:[],azureCloudOptions:Xv,skipAuthorityMetadataCache:!1,instanceAware:!1,...f}),systemOptions:{...Kv,...t},loggerOptions:h,cacheOptions:{...Jv,...i},storageInterface:n||new Wv(e.clientId,Av,new Qm(h)),networkInterface:o||Yv,cryptoInterface:s||Av,clientCredentials:a||Zv,libraryInfo:{...Qv,...l},telemetry:{...eb,...d},serverTelemetryManager:c||null,persistencePlugin:u||null,serializableCache:p||null};var f}(e),this.logger=new Qm(this.config.loggerOptions,Fv,Mv),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new ib(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[nf]=Gh.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case nb:try{const r=Pv(e.credential);t[sf]=`Oid:${r.uid}@${r.utid}`}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case ob:t[sf]=`UPN: ${e.credential}`}return t}async executePostToTokenEndpoint(e,t,r,i,n,o){o&&this.performanceClient?.addQueueMeasurement(o,n);const s=await this.networkManager.sendPostRequest(i,e,{body:t,headers:r});return this.performanceClient?.addFields({refreshTokenSize:s.body.refresh_token?.length||0,httpVerToken:s.headers?.[lf]||""},n),this.config.serverTelemetryManager&&s.status<500&&429!==s.status&&this.config.serverTelemetryManager.clearTelemetryCache(),s}async updateAuthority(e,t){this.performanceClient?.addQueueMeasurement(Ly,t);const r=`https://${e}/${this.authority.tenant}/`,i=await lb(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=i}createTokenQueryParameters(e){const t=new ab;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const cb="no_tokens_found",ub="native_account_unavailable",pb="refresh_token_expired",hb="bad_token",fb=["interaction_required","consent_required","login_required",hb],mb=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],gb={[cb]:"No refresh token found in the cache. Please sign-in.",[ub]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[pb]:"Refresh token has expired.",[hb]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class yb extends Um{constructor(e,t,r,i,n,o,s,a){super(e,t,r),Object.setPrototypeOf(this,yb.prototype),this.timestamp=i||Gh.EMPTY_STRING,this.traceId=n||Gh.EMPTY_STRING,this.correlationId=o||Gh.EMPTY_STRING,this.claims=s||Gh.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=a}}function vb(e,t,r){const i=!!e&&fb.indexOf(e)>-1,n=!!r&&mb.indexOf(r)>-1,o=!!t&&fb.some((e=>t.indexOf(e)>-1));return i||o||n}function bb(e){return new yb(e,gb[e])}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class wb{static setRequestState(e,t,r){const i=wb.generateLibraryState(e,r);return t?`${i}${Gh.RESOURCE_DELIM}${t}`:i}static generateLibraryState(e,t){if(!e)throw wy(ry);const r={id:e.createNewGuid()};t&&(r.meta=t);const i=JSON.stringify(r);return e.base64Encode(i)}static parseRequestState(e,t){if(!e)throw wy(ry);if(!t)throw wy(Og);try{const r=t.split(Gh.RESOURCE_DELIM),i=r[0],n=r.length>1?r.slice(1).join(Gh.RESOURCE_DELIM):Gh.EMPTY_STRING,o=e.base64Decode(i),s=JSON.parse(o);return{userRequestState:n||Gh.EMPTY_STRING,libraryState:s}}catch(e){throw wy(Og)}}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
const _b="sw";class xb{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){this.performanceClient?.addQueueMeasurement(Wy,e.correlationId);const r=await sv(this.generateKid.bind(this),Wy,t,this.performanceClient,e.correlationId)(e),i=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:i}}async generateKid(e){this.performanceClient?.addQueueMeasurement(Ky,e.correlationId);return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:_b}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,i){const{resourceRequestMethod:n,resourceRequestUri:o,shrClaims:s,shrNonce:a,shrOptions:l}=r,d=o?new xy(o):void 0,c=d?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:cv(),m:n?.toUpperCase(),u:c?.HostNameAndPort,nonce:a||this.cryptoUtils.createNewGuid(),p:c?.AbsolutePath,q:c?.QueryString?[[],c.QueryString]:void 0,client_claims:s||void 0,...i},t,l,r.correlationId)}}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Sb{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}class kb{constructor(e,t,r,i,n,o,s){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=i,this.serializableCache=n,this.persistencePlugin=o,this.performanceClient=s}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?wy(Ng,"Cached State"):wy(Ng,"Server State");let r,i;try{r=decodeURIComponent(e.state)}catch(t){throw wy(Og,e.state)}try{i=decodeURIComponent(t)}catch(t){throw wy(Og,e.state)}if(r!==i)throw wy(zg);if(e.error||e.error_description||e.suberror){const t=
/*! @azure/msal-common v14.15.0 2024-09-20 */
function(e){const t="code=",r=e.error_uri?.lastIndexOf(t);return r&&r>=0?e.error_uri?.substring(r+5):void 0}(e);if(vb(e.error,e.error_description,e.suberror))throw new yb(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",t);throw new Jm(e.error||"",e.error_description,e.suberror,t)}}validateTokenResponse(e,t){if(e.error||e.error_description||e.suberror){const r=`Error(s): ${e.error_codes||Gh.NOT_AVAILABLE} - Timestamp: ${e.timestamp||Gh.NOT_AVAILABLE} - Description: ${e.error_description||Gh.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||Gh.NOT_AVAILABLE} - Trace ID: ${e.trace_id||Gh.NOT_AVAILABLE}`,i=e.error_codes?.length?e.error_codes[0]:void 0,n=new Jm(e.error,r,e.suberror,i,e.status);if(t&&e.status&&e.status>=Xh&&e.status<=ef)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.\n${n}`);if(t&&e.status&&e.status>=Yh&&e.status<=Qh)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.\n${n}`);if(vb(e.error,e.error_description,e.suberror))throw new yb(e.error,e.error_description,e.suberror,e.timestamp||Gh.EMPTY_STRING,e.trace_id||Gh.EMPTY_STRING,e.correlation_id||Gh.EMPTY_STRING,e.claims||Gh.EMPTY_STRING,i);throw n}}async handleServerTokenResponse(e,t,r,i,n,o,s,a,l){let d,c;if(this.performanceClient?.addQueueMeasurement(Vy,e.correlation_id),e.id_token){if(d=lv(e.id_token||Gh.EMPTY_STRING,this.cryptoObj.base64Decode),n&&n.nonce&&d.nonce!==n.nonce)throw wy(qg);if(i.maxAge||0===i.maxAge){const e=d.auth_time;if(!e)throw wy(Ug);dv(e,i.maxAge)}}this.homeAccountIdentifier=Uv.generateHomeAccountId(e.client_info||Gh.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,d),n&&n.state&&(c=wb.parseRequestState(this.cryptoObj,n.state)),e.key_id=e.key_id||i.sshKid||void 0;const u=this.generateCacheRecord(e,t,r,i,d,o,n);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),p=new Sb(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),s&&!a&&u.account){const e=u.account.generateAccountKey();if(!this.cacheStorage.getAccount(e,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await kb.generateAuthenticationResult(this.cryptoObj,t,u,!1,i,d,c,void 0,l)}await this.cacheStorage.saveCacheRecord(u,i.storeInCache,i.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(p))}return kb.generateAuthenticationResult(this.cryptoObj,t,u,!1,i,d,c,e,l)}generateCacheRecord(e,t,r,i,n,o,s){const a=t.getPreferredCache();if(!a)throw wy(ey);const l=qv(n);let d,c;var u,p,h,f,m;e.id_token&&n&&(u=this.homeAccountIdentifier,p=a,h=e.id_token,f=this.clientId,m=l||"",d={credentialType:kf.ID_TOKEN,homeAccountId:u,environment:p,clientId:f,secret:h,realm:m},c=function(e,t,r,i,n,o,s,a,l,d,c){c?.verbose("setCachedAccount called");const u=e.getAccountKeys().find((e=>e.startsWith(r)));let p=null;u&&(p=e.getAccount(u,c));const h=p||Uv.createAccount({homeAccountId:r,idTokenClaims:n,clientInfo:o,environment:s,cloudGraphHostName:l?.cloud_graph_host_name,msGraphHost:l?.msgraph_host,nativeAccountId:d},t,i),f=h.tenantProfiles||[],m=a||h.realm;if(m&&!f.find((e=>e.tenantId===m))){const e=zv(r,h.localAccountId,m,n);f.push(e)}return h.tenantProfiles=f,h}(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,n,e.client_info,a,l,s,void 0,this.logger));let g=null;if(e.access_token){const n=e.scope?Dv.fromString(e.scope):new Dv(i.scopes||[]),s=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,d=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,c=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,u=r+s,p=u+d,h=c&&c>0?r+c:void 0;g=function(e,t,r,i,n,o,s,a,l,d,c,u,p,h,f){const m={homeAccountId:e,credentialType:kf.ACCESS_TOKEN,secret:r,cachedAt:cv().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:t,clientId:i,realm:n,target:o,tokenType:c||Rf.BEARER};if(u&&(m.userAssertionHash=u),d&&(m.refreshOn=d.toString()),h&&(m.requestedClaims=h,m.requestedClaimsHash=f),m.tokenType?.toLowerCase()!==Rf.BEARER.toLowerCase())switch(m.credentialType=kf.ACCESS_TOKEN_WITH_AUTH_SCHEME,m.tokenType){case Rf.POP:const e=lv(r,l);if(!e?.cnf?.kid)throw wy(ly);m.keyId=e.cnf.kid;break;case Rf.SSH:m.keyId=p}return m}(this.homeAccountIdentifier,a,e.access_token,this.clientId,l||t.tenant||"",n.printScopes(),u,p,this.cryptoObj.base64Decode,h,e.token_type,o,e.key_id,i.claims,i.requestedClaimsHash)}let y=null;if(e.refresh_token){let t;if(e.refresh_token_expires_in){t=r+("string"==typeof e.refresh_tLine truncated
/*! @azure/msal-common v14.15.0 2024-09-20 */
async function Eb(e,t,r){if("string"==typeof e)return e;return e({clientId:t,tokenEndpoint:r})}
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Tb extends db{constructor(e,t){super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async getAuthCodeUrl(e){this.performanceClient?.addQueueMeasurement(Uy,e.correlationId);const t=await sv(this.createAuthCodeUrlQueryString.bind(this),Gy,this.logger,this.performanceClient,e.correlationId)(e);return xy.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){if(this.performanceClient?.addQueueMeasurement(jy,e.correlationId),!e.code)throw wy(Gg);const r=cv(),i=await sv(this.executeTokenRequest.bind(this),Hy,this.logger,this.performanceClient,e.correlationId)(this.authority,e),n=i.headers?.[af],o=new kb(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return o.validateTokenResponse(i.body),sv(o.handleServerTokenResponse.bind(o),Vy,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,r,e,t,void 0,void 0,void 0,n)}handleFragmentResponse(e,t){if(new kb(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw wy(dy);return e}getLogoutUri(e){if(!e)throw Tg(ug);const t=this.createLogoutUrlQueryString(e);return xy.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement(Hy,t.correlationId);const r=this.createTokenQueryParameters(t),i=xy.appendQueryString(e.tokenEndpoint,r),n=await sv(this.createTokenRequestBody.bind(this),$y,this.logger,this.performanceClient,t.correlationId)(t);let o;if(t.clientInfo)try{const e=Rv(t.clientInfo,this.cryptoUtils.base64Decode);o={credential:`${e.uid}${Sf}${e.utid}`,type:nb}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}const s=this.createTokenRequestHeaders(o||t.ccsCredential),a={clientId:t.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return sv(this.executePostToTokenEndpoint.bind(this),My,this.logger,this.performanceClient,t.correlationId)(i,n,s,a,t.correlationId,My)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement($y,e.correlationId);const t=new ab;if(t.addClientId(e.tokenBodyParameters?.[Hm]||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):sb.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!tb(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const r=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await Eb(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(r.assertionType)}if(t.addGrantType(mf),t.addClientInfo(),e.authenticationScheme===Rf.POP){const r=new xb(this.cryptoUtils,this.performanceClient);let i;if(e.popKid)i=this.cryptoUtils.encodeKid(e.popKid);else{i=(await sv(r.generateCnf.bind(r),Wy,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}t.addPopToken(i)}else if(e.authenticationScheme===Rf.SSH){if(!e.sshJwk)throw Tg(yg);t.addSshJwk(e.sshJwk)}const r=e.correlationId||this.config.cryptoInterface.createNewGuid();let i;if(t.addCorrelationId(r),(!Bg.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.clientInfo)try{const t=Rv(e.clientInfo,this.cryptoUtils.base64Decode);i={credential:`${t.uid}${Sf}${t.utid}`,type:nb}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else i=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&i)switch(i.type){case nb:try{const e=Pv(i.credential);t.addCcsOid(e)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case ob:t.addCcsUpn(i.credential)}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),!e.enableSpaAuthorizationCode||e.tokenBodyParameters&&e.tokenBodyParameters[Km]||t.addExtraQueryParameters({[Km]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){this.performanceClient?.addQueueMeasurement(Gy,e.correlationId);const t=new ab;t.addClientId(e.extraQueryParameters?.[Hm]||this.config.authOptions.clientId);const r=[...e.scopes||[Line truncated
/*! @azure/msal-common v14.15.0 2024-09-20 */
class Cb extends db{constructor(e,t){super(e,t)}async acquireToken(e){try{const[t,r]=await this.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...tf]});if(r===tm){this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");new Bb(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch((()=>{}))}return t}catch(t){if(t instanceof by&&t.errorCode===sy){return new Bb(this.config,this.performanceClient).acquireTokenByRefreshToken(e)}throw t}}async acquireCachedToken(e){this.performanceClient?.addQueueMeasurement(Ny,e.correlationId);let t=Qf;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Bg.isEmptyObj(e.claims))throw this.setCacheOutcome(Zf,e.correlationId),wy(sy);if(!e.account)throw wy(Zg);const r=e.account.tenantId||function(e){const t=new xy(e).getUrlComponents(),r=t.PathSegments.slice(-1)[0]?.toLowerCase();switch(r){case df.COMMON:case df.ORGANIZATIONS:case df.CONSUMERS:return;default:return r}}(e.authority),i=this.cacheManager.getTokenKeys(),n=this.cacheManager.getAccessToken(e.account,e,i,r,this.performanceClient,e.correlationId);if(!n)throw this.setCacheOutcome(Xf,e.correlationId),wy(sy);if(o=n.cachedAt,Number(o)>cv()||uv(n.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(em,e.correlationId),wy(sy);var o;n.refreshOn&&uv(n.refreshOn,0)&&(t=tm);const s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account),accessToken:n,idToken:this.cacheManager.getIdToken(e.account,i,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await sv(this.generateResultFromCacheRecord.bind(this),qy,this.logger,this.performanceClient,e.correlationId)(a,e),t]}setCacheOutcome(e,t){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},t),e!==Qf&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){let r;if(this.performanceClient?.addQueueMeasurement(qy,t.correlationId),e.idToken&&(r=lv(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||0===t.maxAge){const e=r?.auth_time;if(!e)throw wy(Ug);dv(e,t.maxAge)}return kb.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Ib{static getNetworkResponse(e,t,r){return{headers:e,body:t,status:r}}static urlToHttpOptions(e){const t={protocol:e.protocol,hostname:e.hostname&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:`${e.pathname||""}${e.search||""}`,href:e.href};return""!==e.port&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`),t}}var Ab=__webpack_require__(35265),Fb=__webpack_require__(70440),Mb=__webpack_require__(48287).Buffer;
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Db{constructor(e,t){this.proxyUrl=e||"",this.customAgentOptions=t||{}}async sendGetRequestAsync(e,t,r){return this.proxyUrl?Rb(e,this.proxyUrl,dm,t,this.customAgentOptions,r):Pb(e,dm,t,this.customAgentOptions,r)}async sendPostRequestAsync(e,t){return this.proxyUrl?Rb(e,this.proxyUrl,cm,t,this.customAgentOptions):Pb(e,cm,t,this.customAgentOptions)}}const Rb=(e,t,r,i,n,o)=>{const s=new URL(e),a=new URL(t),l=i?.headers||{},d={host:a.hostname,port:a.port,method:"CONNECT",path:s.hostname,headers:l};n&&Object.keys(n).length&&(d.agent=new Ab.Agent(n));let c="";if(r===cm){const e=i?.body||"";c=`Content-Type: application/x-www-form-urlencoded\r\nContent-Length: ${e.length}\r\n\r\n${e}`}else o&&(d.timeout=o);const u=`${r.toUpperCase()} ${s.href} HTTP/1.1\r\nHost: ${s.host}\r\nConnection: close\r\n`+c+"\r\n";return new Promise(((e,t)=>{const r=Ab.request(d);o&&r.on("timeout",(()=>{r.destroy(),t(new Error("Request time out"))})),r.end(),r.on("connect",((i,n)=>{const o=i?.statusCode||um.SERVER_ERROR;(o<um.SUCCESS_RANGE_START||o>um.SUCCESS_RANGE_END)&&(r.destroy(),n.destroy(),t(new Error(`Error connecting to proxy. Http status code: ${i.statusCode}. Http status message: ${i?.statusMessage||"Unknown"}`))),n.write(u);const s=[];n.on("data",(e=>{s.push(e)})),n.on("end",(()=>{const t=Mb.concat([...s]).toString().split("\r\n"),i=parseInt(t[0].split(" ")[1]),n=t[0].split(" ").slice(2).join(" "),o=t[t.length-1],a=t.slice(1,t.length-2),l=new Map;a.forEach((e=>{const t=e.split(new RegExp(/:\s(.*)/s)),r=t[0];let i=t[1];try{const e=JSON.parse(i);e&&"object"==typeof e&&(i=e)}catch(e){}l.set(r,i)}));const d=Object.fromEntries(l),c=Ib.getNetworkResponse(d,Ob(i,n,d,o),i);(i<Kh||i>Vh)&&c.body.error!==gm&&r.destroy(),e(c)})),n.on("error",(e=>{r.destroy(),n.destroy(),t(new Error(e.toString()))}))})),r.on("error",(e=>{r.destroy(),t(new Error(e.toString()))}))}))},Pb=(e,t,r,i,n)=>{const o=t===cm,s=r?.body||"",a=new URL(e),l={method:t,headers:r?.headers||{},...Ib.urlToHttpOptions(a)};return i&&Object.keys(i).length&&(l.agent=new Fb.Agent(i)),o?l.headers={...l.headers,"Content-Length":s.length}:n&&(l.timeout=n),new Promise(((e,t)=>{let r;r="http:"===l.protocol?Ab.request(l):Fb.request(l),o&&r.write(s),n&&r.on("timeout",(()=>{r.destroy(),t(new Error("Request time out"))})),r.end(),r.on("response",(t=>{const i=t.headers,n=t.statusCode,o=t.statusMessage,s=[];t.on("data",(e=>{s.push(e)})),t.on("end",(()=>{const t=Mb.concat([...s]).toString(),a=i,l=Ib.getNetworkResponse(a,Ob(n,o,a,t),n);(n<Kh||n>Vh)&&l.body.error!==gm&&r.destroy(),e(l)}))})),r.on("error",(e=>{r.destroy(),t(new Error(e.toString()))}))}))},Ob=(e,t,r,i)=>{let n;try{n=JSON.parse(i)}catch(i){let o,s;e>=Yh&&e<=Qh?(o="client_error",s="A client"):e>=Xh&&e<=ef?(o="server_error",s="A server"):(o="unknown_error",s="An unknown"),n={error:o,error_description:`${s} error occured.\nHttp status code: ${e}\nHttp status message: ${t||"Unknown"}\nHeaders: ${JSON.stringify(r)}`}}return n},zb="invalid_file_extension",Nb="invalid_file_path",qb="invalid_managed_identity_id_type",Ub="invalid_secret",Lb="missing_client_id",jb="network_unavailable",Hb="platform_not_supported",$b="unable_to_create_azure_arc",Gb="unable_to_create_cloud_shell",Wb="unable_to_create_source",Kb="unable_to_read_secret_file",Vb="user_assigned_not_available_at_runtime",Jb="www_authenticate_header_missing",Yb="www_authenticate_header_unsupported_format",Qb={[rm]:"azure_pod_identity_authority_host_url_malformed",[im]:"identity_endpoint_url_malformed",[nm]:"imds_endpoint_url_malformed",[om]:"msi_endpoint_url_malformed"},Zb={[zb]:"The file path in the WWW-Authenticate header does not contain a .key file.",[Nb]:"The file path in the WWW-Authenticate header is not in a valid Windows or Linux Format.",[qb]:"More than one ManagedIdentityIdType was provided.",[Ub]:"The secret in the file on the file path in the WWW-Authenticate header is greater than 4096 bytes.",[Hb]:"The platform is not supported by Azure Arc. Azure Arc only supports Windows and Linux.",[Lb]:"A ManagedIdentityId id was not provided.",[Qb.AZURE_POD_IDENTITY_AUTHORITY_HOST]:`The Managed Identity's '${rm}' environment variable is malformed.`,[Qb.IDENTITY_ENDPOINT]:`The Managed Identity's '${im}' environment variable is malformed.`,[Qb.IMDS_ENDPOINT]:`The Managed Identity's '${nm}' environment variable is malformed.`,[Qb.MSI_ENDPOINT]:`The Managed Identity's '${om}' environment variable is malformed.`,[jb]:"Authentication unavailable. The request to the managed identity endpoint timed out.",[$b]:"Azure Arc Managed Identities can only be system assigned.",[Gb]:"Cloud Shell Managed Identities can only be system assigned.",[Wb]:"Unable to create a Managed Identity source based on environment variables.",[Kb]:"Unable to read the secret file.",[Vb]:"Service Fabric user assigned managed identity ClientId or ResourceId is not configurable at runtime.",[Jb]:"A 401 response was received form the Azure Arc Managed Identity, but the www-authenticate header is missing.",[Yb]:"A 40Line truncated
/*! @azure/msal-node v2.15.0 2024-10-03 */
const tw={code:"invalid_loopback_server_address_type",desc:"Loopback server address is not type string. This is unexpected."},rw={code:"unable_to_load_redirectUrl",desc:"Loopback server callback was invoked without a url. This is unexpected."},iw={code:"no_auth_code_in_response",desc:"No auth code found in the server response. Please check your network trace to determine what happened."},nw={code:"no_loopback_server_exists",desc:"No loopback server exists yet."},ow={code:"loopback_server_already_exists",desc:"Loopback server already exists. Cannot create another."},sw={code:"loopback_server_timeout",desc:"Timed out waiting for auth code listener to be registered."},aw={code:"state_not_found",desc:"State not found. Please verify that the request originated from msal."},lw={code:"thumbprint_missing_from_client_certificate",desc:"Client certificate does not contain a SHA-1 or SHA-256 thumbprint."};class dw extends Um{constructor(e,t){super(e,t),this.name="NodeAuthError"}static createInvalidLoopbackAddressTypeError(){return new dw(tw.code,`${tw.desc}`)}static createUnableToLoadRedirectUrlError(){return new dw(rw.code,`${rw.desc}`)}static createNoAuthCodeInResponseError(){return new dw(iw.code,`${iw.desc}`)}static createNoLoopbackServerExistsError(){return new dw(nw.code,`${nw.desc}`)}static createLoopbackServerAlreadyExistsError(){return new dw(ow.code,`${ow.desc}`)}static createLoopbackServerTimeoutError(){return new dw(sw.code,`${sw.desc}`)}static createStateNotFoundError(){return new dw(aw.code,aw.desc)}static createThumbprintMissingError(){return new dw(lw.code,lw.desc)}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
const cw={clientId:Gh.EMPTY_STRING,authority:Gh.DEFAULT_AUTHORITY,clientSecret:Gh.EMPTY_STRING,clientAssertion:Gh.EMPTY_STRING,clientCertificate:{thumbprint:Gh.EMPTY_STRING,thumbprintSha256:Gh.EMPTY_STRING,privateKey:Gh.EMPTY_STRING,x5c:Gh.EMPTY_STRING},knownAuthorities:[],cloudDiscoveryMetadata:Gh.EMPTY_STRING,authorityMetadata:Gh.EMPTY_STRING,clientCapabilities:[],protocolMode:Cy,azureCloudOptions:{azureCloudInstance:Ay,tenant:Gh.EMPTY_STRING},skipAuthorityMetadataCache:!1},uw={claimsBasedCachingEnabled:!1},pw={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Ym.Info},hw={loggerOptions:pw,networkClient:new Db,proxyUrl:Gh.EMPTY_STRING,customAgentOptions:{},disableInternalRetries:!1},fw={application:{appName:Gh.EMPTY_STRING,appVersion:Gh.EMPTY_STRING}};var mw,gw=new Uint8Array(16);function yw(){if(!mw&&!(mw="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mw(gw)}const vw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;const bw=function(e){return"string"==typeof e&&vw.test(e)};for(var ww=[],_w=0;_w<256;++_w)ww.push((_w+256).toString(16).substr(1));const xw=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(ww[e[t+0]]+ww[e[t+1]]+ww[e[t+2]]+ww[e[t+3]]+"-"+ww[e[t+4]]+ww[e[t+5]]+"-"+ww[e[t+6]]+ww[e[t+7]]+"-"+ww[e[t+8]]+ww[e[t+9]]+"-"+ww[e[t+10]]+ww[e[t+11]]+ww[e[t+12]]+ww[e[t+13]]+ww[e[t+14]]+ww[e[t+15]]).toLowerCase();if(!bw(r))throw TypeError("Stringified UUID is invalid");return r};const Sw=function(e,t,r){var i=(e=e||{}).random||(e.rng||yw)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){r=r||0;for(var n=0;n<16;++n)t[r+n]=i[n];return t}return xw(i)};
/*! @azure/msal-node v2.15.0 2024-10-03 */
class kw{generateGuid(){return Sw()}isGuid(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}}var Ew=__webpack_require__(48287).Buffer;
/*! @azure/msal-node v2.15.0 2024-10-03 */class Tw{static base64Encode(e,t){return Ew.from(e,t).toString("base64")}static base64EncodeUrl(e,t){return Tw.base64Encode(e,t).replace(/=/g,Gh.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")}static base64Decode(e){return Ew.from(e,"base64").toString("utf8")}static base64DecodeUrl(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";return Tw.base64Decode(t)}}var Bw=__webpack_require__(91565);
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Cw{sha256(e){return Bw.createHash(pm).update(e).digest()}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Iw{constructor(){this.hashUtils=new Cw}async generatePkceCodes(){const e=this.generateCodeVerifier();return{verifier:e,challenge:this.generateCodeChallengeFromVerifier(e)}}generateCodeVerifier(){const e=[],t=256-256%hm.length;for(;e.length<=32;){const r=Bw.randomBytes(1)[0];if(r>=t)continue;const i=r%hm.length;e.push(hm[i])}const r=e.join(Gh.EMPTY_STRING);return Tw.base64EncodeUrl(r)}generateCodeChallengeFromVerifier(e){return Tw.base64EncodeUrl(this.hashUtils.sha256(e).toString("base64"),"base64")}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Aw{constructor(){this.pkceGenerator=new Iw,this.guidGenerator=new kw,this.hashUtils=new Cw}base64UrlEncode(){throw new Error("Method not implemented.")}encodeKid(){throw new Error("Method not implemented.")}createNewGuid(){return this.guidGenerator.generateGuid()}base64Encode(e){return Tw.base64Encode(e)}base64Decode(e){return Tw.base64Decode(e)}generatePkceCodes(){return this.pkceGenerator.generatePkceCodes()}getPublicKeyThumbprint(){throw new Error("Method not implemented.")}removeTokenBindingKey(){throw new Error("Method not implemented.")}clearKeystore(){throw new Error("Method not implemented.")}signJwt(){throw new Error("Method not implemented.")}async hashString(e){return Tw.base64EncodeUrl(this.hashUtils.sha256(e).toString("base64"),"base64")}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Fw{static deserializeJSONBlob(e){return e?JSON.parse(e):{}}static deserializeAccounts(e){const t={};return e&&Object.keys(e).map((function(r){const i=e[r],n={homeAccountId:i.home_account_id,environment:i.environment,realm:i.realm,localAccountId:i.local_account_id,username:i.username,authorityType:i.authority_type,name:i.name,clientInfo:i.client_info,lastModificationTime:i.last_modification_time,lastModificationApp:i.last_modification_app,tenantProfiles:i.tenantProfiles?.map((e=>JSON.parse(e)))},o=new Uv;Gv.toObject(o,n),t[r]=o})),t}static deserializeIdTokens(e){const t={};return e&&Object.keys(e).map((function(r){const i=e[r],n={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm};t[r]=n})),t}static deserializeAccessTokens(e){const t={};return e&&Object.keys(e).map((function(r){const i=e[r],n={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,realm:i.realm,target:i.target,cachedAt:i.cached_at,expiresOn:i.expires_on,extendedExpiresOn:i.extended_expires_on,refreshOn:i.refresh_on,keyId:i.key_id,tokenType:i.token_type,requestedClaims:i.requestedClaims,requestedClaimsHash:i.requestedClaimsHash,userAssertionHash:i.userAssertionHash};t[r]=n})),t}static deserializeRefreshTokens(e){const t={};return e&&Object.keys(e).map((function(r){const i=e[r],n={homeAccountId:i.home_account_id,environment:i.environment,credentialType:i.credential_type,clientId:i.client_id,secret:i.secret,familyId:i.family_id,target:i.target,realm:i.realm};t[r]=n})),t}static deserializeAppMetadata(e){const t={};return e&&Object.keys(e).map((function(r){const i=e[r];t[r]={clientId:i.client_id,environment:i.environment,familyId:i.family_id}})),t}static deserializeAllCache(e){return{accounts:e.Account?this.deserializeAccounts(e.Account):{},idTokens:e.IdToken?this.deserializeIdTokens(e.IdToken):{},accessTokens:e.AccessToken?this.deserializeAccessTokens(e.AccessToken):{},refreshTokens:e.RefreshToken?this.deserializeRefreshTokens(e.RefreshToken):{},appMetadata:e.AppMetadata?this.deserializeAppMetadata(e.AppMetadata):{}}}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Mw{static serializeJSONBlob(e){return JSON.stringify(e)}static serializeAccounts(e){const t={};return Object.keys(e).map((function(r){const i=e[r];t[r]={home_account_id:i.homeAccountId,environment:i.environment,realm:i.realm,local_account_id:i.localAccountId,username:i.username,authority_type:i.authorityType,name:i.name,client_info:i.clientInfo,last_modification_time:i.lastModificationTime,last_modification_app:i.lastModificationApp,tenantProfiles:i.tenantProfiles?.map((e=>JSON.stringify(e)))}})),t}static serializeIdTokens(e){const t={};return Object.keys(e).map((function(r){const i=e[r];t[r]={home_account_id:i.homeAccountId,environment:i.environment,credential_type:i.credentialType,client_id:i.clientId,secret:i.secret,realm:i.realm}})),t}static serializeAccessTokens(e){const t={};return Object.keys(e).map((function(r){const i=e[r];t[r]={home_account_id:i.homeAccountId,environment:i.environment,credential_type:i.credentialType,client_id:i.clientId,secret:i.secret,realm:i.realm,target:i.target,cached_at:i.cachedAt,expires_on:i.expiresOn,extended_expires_on:i.extendedExpiresOn,refresh_on:i.refreshOn,key_id:i.keyId,token_type:i.tokenType,requestedClaims:i.requestedClaims,requestedClaimsHash:i.requestedClaimsHash,userAssertionHash:i.userAssertionHash}})),t}static serializeRefreshTokens(e){const t={};return Object.keys(e).map((function(r){const i=e[r];t[r]={home_account_id:i.homeAccountId,environment:i.environment,credential_type:i.credentialType,client_id:i.clientId,secret:i.secret,family_id:i.familyId,target:i.target,realm:i.realm}})),t}static serializeAppMetadata(e){const t={};return Object.keys(e).map((function(r){const i=e[r];t[r]={client_id:i.clientId,environment:i.environment,family_id:i.familyId}})),t}static serializeAllCache(e){return{Account:this.serializeAccounts(e.accounts),IdToken:this.serializeIdTokens(e.idTokens),AccessToken:this.serializeAccessTokens(e.accessTokens),RefreshToken:this.serializeRefreshTokens(e.refreshTokens),AppMetadata:this.serializeAppMetadata(e.appMetadata)}}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Dw extends Gv{constructor(e,t,r,i){super(t,r,e,i),this.cache={},this.changeEmitters=[],this.logger=e}registerChangeEmitter(e){this.changeEmitters.push(e)}emitChange(){this.changeEmitters.forEach((e=>e.call(null)))}cacheToInMemoryCache(e){const t={accounts:{},idTokens:{},accessTokens:{},refreshTokens:{},appMetadata:{}};for(const r in e){const i=e[r];if("object"==typeof i)if(i instanceof Uv)t.accounts[r]=i;else if(gv(i))t.idTokens[r]=i;else if(mv(i))t.accessTokens[r]=i;else if(yv(i))t.refreshTokens[r]=i;else{if(!Sv(r,i))continue;t.appMetadata[r]=i}}return t}inMemoryCacheToCache(e){let t=this.getCache();return t={...t,...e.accounts,...e.idTokens,...e.accessTokens,...e.refreshTokens,...e.appMetadata},t}getInMemoryCache(){this.logger.trace("Getting in-memory cache");return this.cacheToInMemoryCache(this.getCache())}setInMemoryCache(e){this.logger.trace("Setting in-memory cache");const t=this.inMemoryCacheToCache(e);this.setCache(t),this.emitChange()}getCache(){return this.logger.trace("Getting cache key-value store"),this.cache}setCache(e){this.logger.trace("Setting cache key value store"),this.cache=e,this.emitChange()}getItem(e){this.logger.tracePii(`Item key: ${e}`);return this.getCache()[e]}setItem(e,t){this.logger.tracePii(`Item key: ${e}`);const r=this.getCache();r[e]=t,this.setCache(r)}getAccountKeys(){const e=this.getInMemoryCache();return Object.keys(e.accounts)}getTokenKeys(){const e=this.getInMemoryCache();return{idToken:Object.keys(e.idTokens),accessToken:Object.keys(e.accessTokens),refreshToken:Object.keys(e.refreshTokens)}}getAccount(e){const t=this.getCachedAccountEntity(e);return t&&Uv.isAccountEntity(t)?this.updateOutdatedCachedAccount(e,t):null}getCachedAccountEntity(e){return this.getItem(e)?Object.assign(new Uv,this.getItem(e)):null}setAccount(e){const t=e.generateAccountKey();this.setItem(t,e)}getIdTokenCredential(e){const t=this.getItem(e);return gv(t)?t:null}setIdTokenCredential(e){const t=hv(e);this.setItem(t,e)}getAccessTokenCredential(e){const t=this.getItem(e);return mv(t)?t:null}setAccessTokenCredential(e){const t=hv(e);this.setItem(t,e)}getRefreshTokenCredential(e){const t=this.getItem(e);return yv(t)?t:null}setRefreshTokenCredential(e){const t=hv(e);this.setItem(t,e)}getAppMetadata(e){const t=this.getItem(e);return Sv(e,t)?t:null}setAppMetadata(e){const t=function({environment:e,clientId:t}){return[Ef,e,t].join(xf).toLowerCase()}(e);this.setItem(t,e)}getServerTelemetry(e){const t=this.getItem(e);return t&&function(e,t){const r=0===e.indexOf(Df.CACHE_KEY);let i=!0;return t&&(i=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&i}(e,t)?t:null}setServerTelemetry(e,t){this.setItem(e,t)}getAuthorityMetadata(e){const t=this.getItem(e);return t&&function(e,t){return!!t&&0===e.indexOf(Bf)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri")}(e,t)?t:null}getAuthorityMetadataKeys(){return this.getKeys().filter((e=>this.isAuthorityMetadata(e)))}setAuthorityMetadata(e,t){this.setItem(e,t)}getThrottlingCache(e){const t=this.getItem(e);return t&&function(e,t){let r=!1;e&&(r=0===e.indexOf(zf));let i=!0;return t&&(i=t.hasOwnProperty("throttleTime")),r&&i}(e,t)?t:null}setThrottlingCache(e,t){this.setItem(e,t)}removeItem(e){this.logger.tracePii(`Item key: ${e}`);let t=!1;const r=this.getCache();return r[e]&&(delete r[e],t=!0),t&&(this.setCache(r),this.emitChange()),t}removeOutdatedAccount(e){this.removeItem(e)}containsKey(e){return this.getKeys().includes(e)}getKeys(){this.logger.trace("Retrieving all cache keys");const e=this.getCache();return[...Object.keys(e)]}async clear(){this.logger.trace("Clearing cache entries created by MSAL");this.getKeys().forEach((e=>{this.removeItem(e)})),this.emitChange()}static generateInMemoryCache(e){return Fw.deserializeAllCache(Fw.deserializeJSONBlob(e))}static generateJsonCache(e){return Mw.serializeAllCache(e)}updateCredentialCacheKey(e,t){const r=hv(t);if(e!==r){const i=this.getItem(e);if(i)return this.removeItem(e),this.setItem(r,i),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
const Rw={},Pw={},Ow={},zw={},Nw={};class qw{constructor(e,t,r){this.cacheHasChanged=!1,this.storage=e,this.storage.registerChangeEmitter(this.handleChangeEvent.bind(this)),r&&(this.persistence=r),this.logger=t}hasChanged(){return this.cacheHasChanged}serialize(){this.logger.trace("Serializing in-memory cache");let e=Mw.serializeAllCache(this.storage.getInMemoryCache());return this.cacheSnapshot?(this.logger.trace("Reading cache snapshot from disk"),e=this.mergeState(JSON.parse(this.cacheSnapshot),e)):this.logger.trace("No cache snapshot to merge"),this.cacheHasChanged=!1,JSON.stringify(e)}deserialize(e){if(this.logger.trace("Deserializing JSON to in-memory cache"),this.cacheSnapshot=e,this.cacheSnapshot){this.logger.trace("Reading cache snapshot from disk");const e=Fw.deserializeAllCache(this.overlayDefaults(JSON.parse(this.cacheSnapshot)));this.storage.setInMemoryCache(e)}else this.logger.trace("No cache snapshot to deserialize")}getKVStore(){return this.storage.getCache()}async getAllAccounts(){let e;this.logger.trace("getAllAccounts called");try{return this.persistence&&(e=new Sb(this,!0),await this.persistence.beforeCacheAccess(e)),this.storage.getAllAccounts()}finally{this.persistence&&e&&await this.persistence.afterCacheAccess(e)}}async getAccountByHomeId(e){const t=await this.getAllAccounts();return e&&t&&t.length&&t.filter((t=>t.homeAccountId===e))[0]||null}async getAccountByLocalId(e){const t=await this.getAllAccounts();return e&&t&&t.length&&t.filter((t=>t.localAccountId===e))[0]||null}async removeAccount(e){let t;this.logger.trace("removeAccount called");try{this.persistence&&(t=new Sb(this,!0),await this.persistence.beforeCacheAccess(t)),await this.storage.removeAccount(Uv.generateAccountCacheKey(e))}finally{this.persistence&&t&&await this.persistence.afterCacheAccess(t)}}handleChangeEvent(){this.cacheHasChanged=!0}mergeState(e,t){this.logger.trace("Merging in-memory cache with cache snapshot");const r=this.mergeRemovals(e,t);return this.mergeUpdates(r,t)}mergeUpdates(e,t){return Object.keys(t).forEach((r=>{const i=t[r];if(e.hasOwnProperty(r)){const t=null!==i,n="object"==typeof i,o=!Array.isArray(i),s=void 0!==e[r]&&null!==e[r];t&&n&&o&&s?this.mergeUpdates(e[r],i):e[r]=i}else null!==i&&(e[r]=i)})),e}mergeRemovals(e,t){this.logger.trace("Remove updated entries in cache");const r=e.Account?this.mergeRemovalsDict(e.Account,t.Account):e.Account,i=e.AccessToken?this.mergeRemovalsDict(e.AccessToken,t.AccessToken):e.AccessToken,n=e.RefreshToken?this.mergeRemovalsDict(e.RefreshToken,t.RefreshToken):e.RefreshToken,o=e.IdToken?this.mergeRemovalsDict(e.IdToken,t.IdToken):e.IdToken,s=e.AppMetadata?this.mergeRemovalsDict(e.AppMetadata,t.AppMetadata):e.AppMetadata;return{...e,Account:r,AccessToken:i,RefreshToken:n,IdToken:o,AppMetadata:s}}mergeRemovalsDict(e,t){const r={...e};return Object.keys(e).forEach((e=>{t&&t.hasOwnProperty(e)||delete r[e]})),r}overlayDefaults(e){return this.logger.trace("Overlaying input cache with the default cache"),{Account:{...Rw,...e.Account},IdToken:{...Pw,...e.IdToken},AccessToken:{...Ow,...e.AccessToken},RefreshToken:{...zw,...e.RefreshToken},AppMetadata:{...Nw,...e.AppMetadata}}}}var Uw=__webpack_require__(44040);
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Lw{static fromAssertion(e){const t=new Lw;return t.jwt=e,t}static fromCertificate(e,t,r){const i=new Lw;return i.privateKey=t,i.thumbprint=e,i.useSha256=!1,r&&(i.publicCertificate=this.parseCertificate(r)),i}static fromCertificateWithSha256Thumbprint(e,t,r){const i=new Lw;return i.privateKey=t,i.thumbprint=e,i.useSha256=!0,r&&(i.publicCertificate=this.parseCertificate(r)),i}getJwt(e,t,r){if(this.privateKey&&this.thumbprint)return this.jwt&&!this.isExpired()&&t===this.issuer&&r===this.jwtAudience?this.jwt:this.createJwt(e,t,r);if(this.jwt)return this.jwt;throw wy(ny)}createJwt(e,t,r){this.issuer=t,this.jwtAudience=r;const i=cv();this.expirationTime=i+600;const n={alg:this.useSha256?Em:km},o=this.useSha256?Tm:Bm;Object.assign(n,{[o]:Tw.base64EncodeUrl(this.thumbprint,"hex")}),this.publicCertificate&&Object.assign(n,{[Cm]:this.publicCertificate});const s={[Im]:this.jwtAudience,[Am]:this.expirationTime,[Fm]:this.issuer,[Mm]:this.issuer,[Dm]:i,[Rm]:e.createNewGuid()};return this.jwt=Uw.sign(s,this.privateKey,{header:n}),this.jwt}isExpired(){return this.expirationTime<cv()}static parseCertificate(e){const t=/-----BEGIN CERTIFICATE-----\r*\n(.+?)\r*\n-----END CERTIFICATE-----/gs,r=[];let i;for(;null!==(i=t.exec(e));)r.push(i[1].replace(/\r*\n/g,Gh.EMPTY_STRING));return r}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
const jw="2.15.0";
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Hw extends db{constructor(e){super(e)}async acquireToken(e){this.logger.info("in acquireToken call in username-password client");const t=cv(),r=await this.executeTokenRequest(this.authority,e),i=new kb(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);i.validateTokenResponse(r.body);return i.handleServerTokenResponse(r.body,this.authority,t,e)}async executeTokenRequest(e,t){const r=this.createTokenQueryParameters(t),i=xy.appendQueryString(e.tokenEndpoint,r),n=await this.createTokenRequestBody(t),o=this.createTokenRequestHeaders({credential:t.username,type:ob}),s={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return this.executePostToTokenEndpoint(i,n,o,s,t.correlationId)}async createTokenRequestBody(e){const t=new ab;t.addClientId(this.config.authOptions.clientId),t.addUsername(e.username),t.addPassword(e.password),t.addScopes(e.scopes),t.addResponseTypeForTokenAndIdToken(),t.addGrantType(gf),t.addClientInfo(),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&t.addServerTelemetry(this.serverTelemetryManager);const r=e.correlationId||this.config.cryptoInterface.createNewGuid();t.addCorrelationId(r),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret);const i=this.config.clientCredentials.clientAssertion;return i&&(t.addClientAssertion(await Eb(i.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(i.assertionType)),(!Bg.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.username&&t.addCcsUpn(e.username),t.createQueryString()}}var $w=__webpack_require__(65606);
/*! @azure/msal-node v2.15.0 2024-10-03 */class Gw{constructor(e){this.config=function({auth:e,broker:t,cache:r,system:i,telemetry:n}){const o={...hw,networkClient:new Db(i?.proxyUrl,i?.customAgentOptions),loggerOptions:i?.loggerOptions||pw,disableInternalRetries:i?.disableInternalRetries||!1};if(e.clientCertificate&&!e.clientCertificate.thumbprint&&!e.clientCertificate.thumbprintSha256)throw dw.createStateNotFoundError();return{auth:{...cw,...e},broker:{...t},cache:{...uw,...r},system:{...o,...i},telemetry:{...fw,...n}}}(e),this.cryptoProvider=new Aw,this.logger=new Qm(this.config.system.loggerOptions,"@azure/msal-node",jw),this.storage=new Dw(this.logger,this.config.auth.clientId,this.cryptoProvider,function(e){const t=e.cloudDiscoveryMetadata;let r;if(t)try{r=JSON.parse(t)}catch(e){throw Tg(fg)}return{canonicalAuthority:e.authority?Iv(e.authority):void 0,knownAuthorities:e.knownAuthorities,cloudDiscoveryMetadata:r}}(this.config.auth)),this.tokenCache=new qw(this.storage,this.logger,this.config.cache.cachePlugin)}async getAuthCodeUrl(e){this.logger.info("getAuthCodeUrl called",e.correlationId);const t={...e,...await this.initializeBaseRequest(e),responseMode:e.responseMode||ff.QUERY,authenticationScheme:Rf.BEARER},r=await this.buildOauthClientConfiguration(t.authority,t.correlationId,void 0,void 0,e.azureCloudOptions),i=new Tb(r);return this.logger.verbose("Auth code client created",t.correlationId),i.getAuthCodeUrl(t)}async acquireTokenByCode(e,t){this.logger.info("acquireTokenByCode called"),e.state&&t&&(this.logger.info("acquireTokenByCode - validating state"),this.validateState(e.state,t.state||""),t={...t,state:""});const r={...e,...await this.initializeBaseRequest(e),authenticationScheme:Rf.BEARER},i=this.initializeServerTelemetryManager(xm,r.correlationId);try{const n=await this.buildOauthClientConfiguration(r.authority,r.correlationId,i,void 0,e.azureCloudOptions),o=new Tb(n);return this.logger.verbose("Auth code client created",r.correlationId),await o.acquireToken(r,t)}catch(e){throw e instanceof Um&&e.setCorrelationId(r.correlationId),i.cacheFailedRequest(e),e}}async acquireTokenByRefreshToken(e){this.logger.info("acquireTokenByRefreshToken called",e.correlationId);const t={...e,...await this.initializeBaseRequest(e),authenticationScheme:Rf.BEARER},r=this.initializeServerTelemetryManager(Sm,t.correlationId);try{const i=await this.buildOauthClientConfiguration(t.authority,t.correlationId,r,void 0,e.azureCloudOptions),n=new Bb(i);return this.logger.verbose("Refresh token client created",t.correlationId),await n.acquireToken(t)}catch(e){throw e instanceof Um&&e.setCorrelationId(t.correlationId),r.cacheFailedRequest(e),e}}async acquireTokenSilent(e){const t={...e,...await this.initializeBaseRequest(e),forceRefresh:e.forceRefresh||!1},r=this.initializeServerTelemetryManager(bm,t.correlationId,t.forceRefresh);try{const i=await this.buildOauthClientConfiguration(t.authority,t.correlationId,r,void 0,e.azureCloudOptions),n=new Cb(i);return this.logger.verbose("Silent flow client created",t.correlationId),await n.acquireToken(t)}catch(e){throw e instanceof Um&&e.setCorrelationId(t.correlationId),r.cacheFailedRequest(e),e}}async acquireTokenByUsernamePassword(e){this.logger.info("acquireTokenByUsernamePassword called",e.correlationId);const t={...e,...await this.initializeBaseRequest(e)},r=this.initializeServerTelemetryManager(wm,t.correlationId);try{const i=await this.buildOauthClientConfiguration(t.authority,t.correlationId,r,void 0,e.azureCloudOptions),n=new Hw(i);return this.logger.verbose("Username password client created",t.correlationId),await n.acquireToken(t)}catch(e){throw e instanceof Um&&e.setCorrelationId(t.correlationId),r.cacheFailedRequest(e),e}}getTokenCache(){return this.logger.info("getTokenCache called"),this.tokenCache}validateState(e,t){if(!e)throw dw.createStateNotFoundError();if(e!==t)throw wy(zg)}getLogger(){return this.logger}setLogger(e){this.logger=e}async buildOauthClientConfiguration(e,t,r,i,n){this.logger.verbose("buildOauthClientConfiguration called",t);const o=n||this.config.auth.azureCloudOptions,s=await this.createAuthority(e,t,i,o);this.logger.info(`Building oauth client configuration with the following authority: ${s.tokenEndpoint}.`,t),r?.updateRegionDiscoveryMetadata(s.regionDiscoveryMetadata);return{authOptions:{clientId:this.config.auth.clientId,authority:s,clientCapabilities:this.config.auth.clientCapabilities},loggerOptions:{logLevel:this.config.system.loggerOptions.logLevel,loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,correlationId:t},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.cryptoProvider,networkInterface:this.config.system.networkClient,storageInterface:this.storage,serverTelemetryManager:r,clientCredentials:{clientSecret:this.clientSecret,clientAssertion:await this.getClientAssertion(s)},libraryInfo:{sku:fm,vLine truncated
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Ww{async listenForAuthCode(e,t){if(this.server)throw dw.createLoopbackServerAlreadyExistsError();return new Promise(((r,i)=>{this.server=Ab.createServer(((n,o)=>{const s=n.url;if(!s)return o.end(t||"Error occurred loading redirectUrl"),void i(dw.createUnableToLoadRedirectUrlError());if(s===Gh.FORWARD_SLASH)return void o.end(e||"Auth code was successfully acquired. You can close this window now.");const a=this.getRedirectUri(),l=_y(new URL(s,a).search)||{};l.code&&(o.writeHead(Jh,{location:a}),o.end()),l.error&&o.end(t||`Error occurred: ${l.error}`),r(l)})),this.server.listen(0,"127.0.0.1")}))}getRedirectUri(){if(!this.server||!this.server.listening)throw dw.createNoLoopbackServerExistsError();const e=this.server.address();if(!e||"string"==typeof e||!e.port)throw this.closeServer(),dw.createInvalidLoopbackAddressTypeError();const t=e&&e.port;return`${ym}${vm}:${t}`}closeServer(){this.server&&(this.server.close(),"function"==typeof this.server.closeAllConnections&&this.server.closeAllConnections(),this.server.unref(),this.server=void 0)}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Kw extends db{constructor(e){super(e)}async acquireToken(e){const t=await this.getDeviceCode(e);e.deviceCodeCallback(t);const r=cv(),i=await this.acquireTokenWithDeviceCode(e,t),n=new kb(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return n.validateTokenResponse(i),n.handleServerTokenResponse(i,this.authority,r,e)}async getDeviceCode(e){const t=this.createExtraQueryParameters(e),r=xy.appendQueryString(this.authority.deviceCodeEndpoint,t),i=this.createQueryString(e),n=this.createTokenRequestHeaders(),o={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return this.executePostRequestToDeviceCodeEndpoint(r,i,n,o)}createExtraQueryParameters(e){const t=new ab;return e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()}async executePostRequestToDeviceCodeEndpoint(e,t,r,i){const{body:{user_code:n,device_code:o,verification_uri:s,expires_in:a,interval:l,message:d}}=await this.networkManager.sendPostRequest(i,e,{body:t,headers:r});return{userCode:n,deviceCode:o,verificationUri:s,expiresIn:a,interval:l,message:d}}createQueryString(e){const t=new ab;return t.addScopes(e.scopes),t.addClientId(this.config.authOptions.clientId),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),t.createQueryString()}continuePolling(e,t,r){if(r)throw this.logger.error("Token request cancelled by setting DeviceCodeRequest.cancel = true"),wy(Jg);if(t&&t<e&&cv()>t)throw this.logger.error(`User defined timeout for device code polling reached. The timeout was set for ${t}`),wy(ay);if(cv()>e)throw t&&this.logger.verbose(`User specified timeout ignored as the device code has expired before the timeout elapsed. The user specified timeout was set for ${t}`),this.logger.error(`Device code expired. Expiration time of device code was ${e}`),wy(Yg);return!0}async acquireTokenWithDeviceCode(e,t){const r=this.createTokenQueryParameters(e),i=xy.appendQueryString(this.authority.tokenEndpoint,r),n=this.createTokenRequestBody(e,t),o=this.createTokenRequestHeaders(),s=e.timeout?cv()+e.timeout:void 0,a=cv()+t.expiresIn,l=1e3*t.interval;for(;this.continuePolling(a,s,e.cancel);){const t={clientId:this.config.authOptions.clientId,authority:e.authority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},r=await this.executePostToTokenEndpoint(i,n,o,t,e.correlationId);if(!r.body||!r.body.error)return this.logger.verbose("Authorization completed successfully. Polling stopped."),r.body;if(r.body.error!==Gh.AUTHORIZATION_PENDING)throw this.logger.info("Unexpected error in polling from the server"),d=Nm,c=r.body.error,new Um(d,c?`${qm[d]} ${c}`:qm[d]);this.logger.info("Authorization pending. Continue polling."),await pv(l)}var d,c;throw this.logger.error("Polling stopped for unknown reasons."),wy(Qg)}createTokenRequestBody(e,t){const r=new ab;r.addScopes(e.scopes),r.addClientId(this.config.authOptions.clientId),r.addGrantType(vf),r.addDeviceCode(t.deviceCode);const i=e.correlationId||this.config.cryptoInterface.createNewGuid();return r.addCorrelationId(i),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),(!Bg.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),r.createQueryString()}}
/*! @azure/msal-node v2.15.0 2024-10-03 */
class Vw extends Gw{constructor(e){super(e),this.config.broker.nativeBrokerPlugin&&(this.config.broker.nativeBrokerPlugin.isBrokerAvailable?(this.nativeBrokerPlugin=this.config.broker.nativeBrokerPlugin,this.nativeBrokerPlugin.setLogger(this.config.system.loggerOptions)):this.logger.warning("NativeBroker implementation was provided but the broker is unavailable.")),this.skus=jm.makeExtraSkuString({libraryName:fm,libraryVersion:jw})}async acquireTokenByDeviceCode(e){this.logger.info("acquireTokenByDeviceCode called",e.correlationId);const t=Object.assign(e,await this.initializeBaseRequest(e)),r=this.initializeServerTelemetryManager(_m,t.correlationId);try{const i=await this.buildOauthClientConfiguration(t.authority,t.correlationId,r,void 0,e.azureCloudOptions),n=new Kw(i);return this.logger.verbose("Device code client created",t.correlationId),await n.acquireToken(t)}catch(e){throw e instanceof Um&&e.setCorrelationId(t.correlationId),r.cacheFailedRequest(e),e}}async acquireTokenInteractive(e){const t=e.correlationId||this.cryptoProvider.createNewGuid();this.logger.trace("acquireTokenInteractive called",t);const{openBrowser:r,successTemplate:i,errorTemplate:n,windowHandle:o,loopbackClient:s,...a}=e;if(this.nativeBrokerPlugin){const r={...a,clientId:this.config.auth.clientId,scopes:e.scopes||tf,redirectUri:`${ym}${vm}`,authority:e.authority||this.config.auth.authority,correlationId:t,extraParameters:{...a.extraQueryParameters,...a.tokenQueryParameters,[Vm]:this.skus},accountId:a.account?.nativeAccountId};return this.nativeBrokerPlugin.acquireTokenInteractive(r,o)}const{verifier:l,challenge:d}=await this.cryptoProvider.generatePkceCodes(),c=s||new Ww;let u={},p=null;try{const o=c.listenForAuthCode(i,n).then((e=>{u=e})).catch((e=>{p=e})),s=await this.waitForRedirectUri(c),h={...a,correlationId:t,scopes:e.scopes||tf,redirectUri:s,responseMode:ff.QUERY,codeChallenge:d,codeChallengeMethod:hf.S256},f=await this.getAuthCodeUrl(h);if(await r(f),await o,p)throw p;if(u.error)throw new Jm(u.error,u.error_description,u.suberror);if(!u.code)throw dw.createNoAuthCodeInResponseError();const m=u.client_info,g={code:u.code,codeVerifier:l,clientInfo:m||Gh.EMPTY_STRING,...h};return await this.acquireTokenByCode(g)}finally{c.closeServer()}}async acquireTokenSilent(e){const t=e.correlationId||this.cryptoProvider.createNewGuid();if(this.logger.trace("acquireTokenSilent called",t),this.nativeBrokerPlugin){const r={...e,clientId:this.config.auth.clientId,scopes:e.scopes||tf,redirectUri:`${ym}${vm}`,authority:e.authority||this.config.auth.authority,correlationId:t,extraParameters:{...e.tokenQueryParameters,[Vm]:this.skus},accountId:e.account.nativeAccountId,forceRefresh:e.forceRefresh||!1};return this.nativeBrokerPlugin.acquireTokenSilent(r)}return super.acquireTokenSilent(e)}async signOut(e){if(this.nativeBrokerPlugin&&e.account.nativeAccountId){const t={clientId:this.config.auth.clientId,accountId:e.account.nativeAccountId,correlationId:e.correlationId||this.cryptoProvider.createNewGuid()};await this.nativeBrokerPlugin.signOut(t)}await this.getTokenCache().removeAccount(e.account)}async getAllAccounts(){if(this.nativeBrokerPlugin){const e=this.cryptoProvider.createNewGuid();return this.nativeBrokerPlugin.getAllAccounts(this.config.auth.clientId,e)}return this.getTokenCache().getAllAccounts()}async waitForRedirectUri(e){return new Promise(((t,r)=>{let i=0;const n=setInterval((()=>{if(Om/Pm<i)return clearInterval(n),void r(dw.createLoopbackServerTimeoutError());try{const r=e.getRedirectUri();return clearInterval(n),void t(r)}catch(e){return e instanceof Um&&e.errorCode===nw.code?void i++:(clearInterval(n),void r(e))}}),Pm)}))}}__webpack_require__(65606);
/*! @azure/msal-node v2.15.0 2024-10-03 */
/*! @azure/msal-node v2.15.0 2024-10-03 */
const Jw="client_id",Yw="object_id",Qw="mi_res_id";class Zw{constructor(e,t,r,i){this.logger=e,this.nodeStorage=t,this.networkClient=r,this.cryptoProvider=i}async getServerTokenResponseAsync(e,t,r,i){return this.getServerTokenResponse(e)}getServerTokenResponse(e){let t,r;e.body.expires_on&&(r=e.body.expires_on-cv(),r>7200&&(t=r/2));return{status:e.status,access_token:e.body.access_token,expires_in:r,scope:e.body.resource,token_type:e.body.token_type,refresh_in:t,correlation_id:e.body.correlation_id||e.body.correlationId,error:"string"==typeof e.body.error?e.body.error:e.body.error?.code,error_description:e.body.message||("string"==typeof e.body.error?e.body.error_description:e.body.error?.message),error_codes:e.body.error_codes,timestamp:e.body.timestamp,trace_id:e.body.trace_id}}async acquireTokenWithManagedIdentity(e,t,r,i){const n=this.createRequest(e.resource,t),o=n.headers;o[nf]=Gh.URL_FORM_CONTENT_TYPE;const s={headers:o};Object.keys(n.bodyParameters).length&&(s.body=n.computeParametersBodyString());const a=cv();let l;try{l=n.httpMethod===cm?await this.networkClient.sendPostRequestAsync(n.computeUri(),s):await this.networkClient.sendGetRequestAsync(n.computeUri(),s)}catch(e){throw e instanceof Um?e:wy(Dg)}const d=new kb(t.id,this.nodeStorage,this.cryptoProvider,this.logger,null,null),c=await this.getServerTokenResponseAsync(l,this.networkClient,n,s);return d.validateTokenResponse(c,i),d.handleServerTokenResponse(c,r,a,e)}getManagedIdentityUserAssignedIdQueryParameterKey(e){switch(e){case sm:return this.logger.info("[Managed Identity] Adding user assigned client id to the request."),Jw;case am:return this.logger.info("[Managed Identity] Adding user assigned resource id to the request."),Qw;case lm:return this.logger.info("[Managed Identity] Adding user assigned object id to the request."),Yw;default:throw ew(qb)}}}Zw.getValidatedEnvVariableUrlString=(e,t,r,i)=>{try{return new xy(t).urlString}catch(t){throw i.info(`[Managed Identity] ${r} managed identity is unavailable because the '${e}' environment variable is malformed.`),ew(Qb[e])}};__webpack_require__(65606);
/*! @azure/msal-node v2.15.0 2024-10-03 */__webpack_require__(23313);var Xw=__webpack_require__(65606);
/*! @azure/msal-node v2.15.0 2024-10-03 */
Xw.env.ProgramData,Xw.env.ProgramFiles;__webpack_require__(65606);
/*! @azure/msal-node v2.15.0 2024-10-03 */__webpack_require__(65606);
/*! @azure/msal-node v2.15.0 2024-10-03 */__webpack_require__(65606);
/*! @azure/msal-node v2.15.0 2024-10-03 */const e_="1.0.0",t_=!k.Platform.isAndroidApp&&(0,k.requireApiVersion)("0.13.26")||k.Platform.isAndroidApp&&(0,k.requireApiVersion)("0.14.6"),r_=["User.Read","Files.ReadWrite","offline_access"],i_=`obsidian://${Q}`,n_={accessToken:"",clientID:B,authority:C,refreshToken:"",accessTokenExpiresInSeconds:0,accessTokenExpiresAtTime:0,deltaLink:"",username:"",credentialsShouldBeDeletedAtTime:0,emptyFile:"skip",kind:"onedrivefull"};const o_=(e,t)=>{const r=`/drive/root:/${t}`;let i=e;return"/"===e||""===e?r:(i.endsWith("/")&&(i=i.slice(0,i.length-1)),i.startsWith("/")?(console.warn(`why the path ${i} starts with '/'? but we just go on.`),i=`${r}${i}`):i=`${r}/${i}`,i)},s_=(e,t)=>{var r,i,n;let o="";const s=`/drive/root:/${t}`,a=`/drive/root:/${encodeURIComponent(t)}`;if(void 0===e.parentReference||null===e.parentReference||void 0===e.parentReference.path||null===e.parentReference.path)throw Error("x.parentReference.path is undefinded or null");const l=`${null===(r=e.parentReference)||void 0===r?void 0:r.path}/${e.name}`,d=l.startsWith(s),c=l.startsWith(a);if(d)o=l.substring(s.length+1);else{if(!c)throw Error(`we meet file/folder and do not know how to deal with it:\n${(e=>{var t,r,i;return null===(t=e.parentReference)||void 0===t||t.path,e.name,`parentPath="${null!==(i=null===(r=e.parentReference)||void 0===r?void 0:r.path)&&void 0!==i?i:"(no parentReference or path)"}", selfName="${e.name}"`})(e)}`);o=l.substring(a.length+1)}const u="folder"in e;u&&(o=`${o}/`);const p=null===(i=null==e?void 0:e.fileSystemInfo)||void 0===i?void 0:i.lastModifiedDateTime;if(null==p)throw Error(`onedrive cannot parse mtime: ${JSON.stringify(e,null,2)}`);let h=null===(n=null==e?void 0:e.fileSystemInfo)||void 0===n?void 0:n.createdDateTime;null==h&&(h=p);return{key:o,keyRaw:o,mtimeSvr:Date.parse(p),mtimeCli:Date.parse(p),ctimeCli:Date.parse(h),size:u?0:e.size,sizeRaw:u?0:e.size,synthesizedFile:!1}};class a_{constructor(e,t){this.onedriveFullConfig=e,this.saveUpdatedConfigFunc=t}getAccessToken(){return r(this,void 0,void 0,(function*(){if(""===this.onedriveFullConfig.accessToken||""===this.onedriveFullConfig.refreshToken)throw Error("The user has not manually auth yet.");const e=Date.now();if(this.onedriveFullConfig.accessTokenExpiresAtTime>e)return this.onedriveFullConfig.accessToken;{const o=yield(t=this.onedriveFullConfig.clientID,i=this.onedriveFullConfig.authority,n=this.onedriveFullConfig.refreshToken,r(void 0,void 0,void 0,(function*(){try{const e=yield(0,k.request)({url:`${i}/oauth2/v2.0/token`,method:"POST",contentType:"application/x-www-form-urlencoded",body:new URLSearchParams({tenant:"consumers",client_id:t,scope:r_.join(" "),refresh_token:n,grant_type:"refresh_token"}).toString()}),r=JSON.parse(e);return r.error,r}catch(e){throw console.error(e),e}})));if(void 0!==o.error){const e=o;throw Error(`Error while refreshing accessToken: ${e.error}, ${e.error_codes}: ${e.error_description}`)}const s=o;return this.onedriveFullConfig.accessToken=s.access_token,this.onedriveFullConfig.refreshToken=s.refresh_token,this.onedriveFullConfig.accessTokenExpiresInSeconds=s.expires_in,this.onedriveFullConfig.accessTokenExpiresAtTime=e+1e3*s.expires_in-12e4,yield this.saveUpdatedConfigFunc(),console.info("Onedrive accessToken updated"),this.onedriveFullConfig.accessToken}var t,i,n}))}}const l_=e=>{const t=m()(e);return t.accessToken="x",t.accessTokenExpiresInSeconds=1,t.accessTokenExpiresAtTime=1,t};class d_ extends Mp{constructor(e,t,r){super(),this.kind="onedrivefull",this.onedriveFullConfig=e,this.remoteBaseDir=this.onedriveFullConfig.remoteBaseDir||t||"",this.vaultFolderExists=!1,this.saveUpdatedConfigFunc=r,this.authGetter=new a_(e,r),this.foldersCreatedBefore=new Set}_init(){return r(this,void 0,void 0,(function*(){if(""===this.onedriveFullConfig.accessToken||""===this.onedriveFullConfig.refreshToken)throw Error("The user has not manually auth yet.");if(this.vaultFolderExists);else{const e=yield this._getJson("/drive/root/children");this.vaultFolderExists=e.value.filter((e=>e.name===this.remoteBaseDir)).length>0,this.vaultFolderExists||(console.info(`remote does not have folder /${this.remoteBaseDir}`),yield this._postJson("/drive/root/children",{name:`${this.remoteBaseDir}`,folder:{},"@microsoft.graph.conflictBehavior":"replace"}),console.info(`remote folder /${this.remoteBaseDir} created`),this.vaultFolderExists=!0)}}))}_buildUrl(e){let t="";if(e.startsWith("http://")||e.startsWith("https://"))t=e;else{t=`https://graph.microsoft.com/v1.0${encodeURI(e)}`}return t=t.replace(/#/g,"%23"),t}_getJson(e){return r(this,void 0,void 0,(function*(){const t=this._buildUrl(e);return console.debug(`getJson, theUrl=${t}`),JSON.parse(yield(0,k.request)({url:t,method:"GET",contentType:"application/json",headers:{Authorization:`Bearer ${yield this.authGetter.getAccessToken()}`,"Cache-Control":"no-cache"}}))}))}_postJson(e,t){return r(this,void 0,void 0,(function*(){const r=this._buildUrl(e);return console.debug(Line truncated
/**
* @license lucide v0.416.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
const oH=["svg",w,[["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"}],["circle",{cx:"12",cy:"12",r:"3"}]]],sH=["svg",w,[["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",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["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",{d:"m2 2 20 20"}]]];class aH extends k.Modal{constructor(e,t,r){super(e),this.plugin=t,this.newRemotePrefix=r}onOpen(){const{contentEl:e}=this,t=(e,t)=>this.plugin.i18n.t(e,t);e.createEl("h2",{text:t("modal_remoteprefix_azureblobstorage_title")}),t("modal_remoteprefix_azureblobstorage_shortdesc").split("\n").forEach(((t,r)=>{e.createEl("p",{text:t})})),e.createEl("p",{text:t("modal_remoteprefix_azureblobstorage_tosave",{prefix:this.newRemotePrefix})}),new k.Setting(e).addButton((e=>{e.setButtonText(t("modal_remoteprefix_azureblobstorage_secondconfirm_change")),e.onClick((()=>r(this,void 0,void 0,(function*(){this.plugin.settings.azureblobstorage.remotePrefix=this.newRemotePrefix,yield this.plugin.saveSettings(),new k.Notice(t("modal_remoteprefix_azureblobstorage_notice")),this.close()})))),e.setClass("remoteprefix-azureblobstorage-second-confirm")})).addButton((e=>{e.setButtonText(t("goback")),e.onClick((()=>{this.close()}))}))}onClose(){const{contentEl:e}=this;e.empty()}}class lH extends k.Modal{constructor(e,t,r,i,n,o){super(e),this.plugin=t,this.authDiv=r,this.revokeAuthDiv=i,this.revokeAuthSetting=n,this.t=o}onOpen(){return r(this,void 0,void 0,(function*(){const{contentEl:e}=this,t=this.t,i=(()=>{const e=new lh.OAuthConfig({clientId:U,clientSecret:L});return new lh.BoxOAuth({config:e}).getAuthorizeUrl({redirectUri:`obsidian://${q}`})})(),n=e.createDiv();n.createDiv({text:Qp(t("modal_boxauth_tutorial"))}),n.createEl("button",{text:t("modal_boxauth_copybutton")},(e=>{e.onclick=()=>r(this,void 0,void 0,(function*(){yield navigator.clipboard.writeText(i),new k.Notice(t("modal_boxauth_copynotice"))}))})),e.createEl("p").createEl("a",{href:i,text:i})}))}onClose(){const{contentEl:e}=this;e.empty()}}class dH extends k.Modal{constructor(e,t,r,i,n){super(e),this.plugin=t,this.authDiv=r,this.revokeAuthDiv=i,this.t=n}onOpen(){return r(this,void 0,void 0,(function*(){const e=this.t,{contentEl:t}=this;t.createEl("p",{text:e("modal_boxrevokeauth_step1")});const i="https://app.box.com/account/security";t.createEl("p").createEl("a",{href:i,text:i}),t.createEl("p",{text:e("modal_boxrevokeauth_step2")}),new k.Setting(t).setName(e("modal_boxrevokeauth_clean")).setDesc(e("modal_boxrevokeauth_clean_desc")).addButton((t=>r(this,void 0,void 0,(function*(){t.setButtonText(e("modal_boxrevokeauth_clean_button")),t.onClick((()=>r(this,void 0,void 0,(function*(){try{this.plugin.settings.box=m()(bh),yield this.plugin.saveSettings(),this.authDiv.toggleClass("box-auth-button-hide",""!==this.plugin.settings.box.refreshToken),this.revokeAuthDiv.toggleClass("box-revoke-auth-button-hide",""===this.plugin.settings.box.refreshToken),new k.Notice(e("modal_boxrevokeauth_clean_notice")),this.close()}catch(t){console.error(t),new k.Notice(e("modal_boxrevokeauth_clean_fail"))}}))))}))))}))}onClose(){const{contentEl:e}=this;e.empty()}}class cH extends k.Modal{constructor(e,t,r,i,n){super(e),this.plugin=t,this.t=r,this.files=i,this.fsLocal=n}onOpen(){return r(this,void 0,void 0,(function*(){const e=this.t,{contentEl:t}=this;t.createEl("p",{text:e("modal_cleardupfiles_warning")}),t.createEl("pre").createEl("code",{text:this.files.join("\n")}),new k.Setting(t).addButton((t=>{t.setButtonText(e("modal_cleardupfiles_warning_confirm")),t.onClick((()=>r(this,void 0,void 0,(function*(){var t,i;yield(t=this.files,i=this.fsLocal,r(void 0,void 0,void 0,(function*(){yield Promise.all(t.map((e=>r(void 0,void 0,void 0,(function*(){return yield i.rm(e)})))))}))),new k.Notice(e("modal_cleardupfiles_warning_finished")),this.close()}))))})).addButton((t=>{t.setButtonText(e("goback")),t.onClick((()=>{this.close()}))}))}))}onClose(){const{contentEl:e}=this;e.empty()}}const uH=(e,t,i,n)=>{new k.Setting(e).setName(t("settings_cleardupfiles")).setDesc(Qp(t("settings_cleardupfiles_desc"))).addButton((e=>r(void 0,void 0,void 0,(function*(){e.setButtonText(t("settings_cleardupfiles_button")),e.onClick((()=>r(void 0,void 0,void 0,(function*(){var e,o,s;const a=new Cj(i.vault,null!==(e=n.settings.syncConfigDir)&&void 0!==e&&e,null!==(o=n.settings.syncBookmarks)&&void 0!==o&&o,i.vault.configDir,n.manifest.id,void 0,null!==(s=n.settings.deleteToWhere)&&void 0!==s?s:"system"),l=yield(e=>r(void 0,void 0,void 0,(function*(){const t=yield e.walk();t.sort(((e,t)=>-(e.keyRaw.length-t.keyRaw.length)));const r=new Set,i=new Set;for(const{keyRaw:e}of t){if(e.endsWith("/"))continue;e.includes("dup")&&r.add(e);const t=K_(e);r.has(t)&&i.add(t)}return[...i]})))(a);new cH(i,n,t,l,a).open()}))))}))))};class pH extends k.Modal{construcLine truncated
/* nosourcemap */
+11
View File
@@ -0,0 +1,11 @@
{
"id": "remotely-save",
"name": "Remotely Save",
"version": "0.5.25",
"minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears",
"authorUrl": "https://github.com/fyears",
"isDesktopOnly": false,
"fundingUrl": "https://remotelysave.com"
}
+244
View File
@@ -0,0 +1,244 @@
/* set the styles */
.password-second-confirm {
font-weight: bold;
}
.password-disclaimer {
font-weight: bold;
}
.encryptionmethod-second-confirm {
font-weight: bold;
}
.settings-auth-related {
border-top: 1px solid var(--background-modifier-border);
padding-top: 18px;
}
.settings-percentage-custom-hide {
display: none;
}
.settings-encryption-method-hide {
display: none;
}
.s3-disclaimer {
font-weight: bold;
}
.s3-hide {
display: none;
}
.dropbox-disclaimer {
font-weight: bold;
}
.dropbox-hide {
display: none;
}
.dropbox-auth-button-hide {
display: none;
}
.dropbox-revoke-auth-button-hide {
display: none;
}
.onedrive-disclaimer {
font-weight: bold;
}
.onedrive-hide {
display: none;
}
.onedrive-auth-button-hide {
display: none;
}
.onedrive-revoke-auth-button-hide {
display: none;
}
.onedrivefull-allow-to-use-hide {
display: none;
}
.onedrivefull-disclaimer {
font-weight: bold;
}
.onedrivefull-hide {
display: none;
}
.onedrivefull-auth-button-hide {
display: none;
}
.onedrivefull-revoke-auth-button-hide {
display: none;
}
.webdav-disclaimer {
font-weight: bold;
}
.webdav-hide {
display: none;
}
.webdav-customheaders-textarea {
font-family: monospace;
}
.webdis-disclaimer {
font-weight: bold;
}
.webdis-hide {
display: none;
}
.googledrive-disclaimer {
font-weight: bold;
}
.googledrive-hide {
display: none;
}
.googledrive-allow-to-use-hide {
display: none;
}
.googledrive-auth-button-hide {
display: none;
}
.googledrive-revoke-auth-button-hide {
display: none;
}
.box-disclaimer {
font-weight: bold;
}
.box-hide {
display: none;
}
.box-allow-to-use-hide {
display: none;
}
.box-auth-button-hide {
display: none;
}
.box-revoke-auth-button-hide {
display: none;
}
.pcloud-disclaimer {
font-weight: bold;
}
.pcloud-hide {
display: none;
}
.pcloud-allow-to-use-hide {
display: none;
}
.pcloud-auth-button-hide {
display: none;
}
.pcloud-revoke-auth-button-hide {
display: none;
}
.yandexdisk-disclaimer {
font-weight: bold;
}
.yandexdisk-hide {
display: none;
}
.yandexdisk-allow-to-use-hide {
display: none;
}
.yandexdisk-auth-button-hide {
display: none;
}
.yandexdisk-revoke-auth-button-hide {
display: none;
}
.koofr-disclaimer {
font-weight: bold;
}
.koofr-hide {
display: none;
}
.koofr-allow-to-use-hide {
display: none;
}
.koofr-auth-button-hide {
display: none;
}
.koofr-revoke-auth-button-hide {
display: none;
}
.azureblobstorage-disclaimer {
font-weight: bold;
}
.azureblobstorage-hide {
display: none;
}
.azureblobstorage-allow-to-use-hide {
display: none;
}
.qrcode-img {
width: 350px;
height: 350px;
}
.ignorepaths-textarea {
font-family: monospace;
}
.onlyallowpaths-textarea {
font-family: monospace;
}
.logtohttpserver-warning {
color: red;
font-weight: bolder;
}
.setting-need-wrapping .setting-item-control {
/* flex-wrap: wrap; */
display: grid;
}
.pro-disclaimer {
font-weight: bold;
}
.pro-hide {
display: none;
}
.pro-auth-button-hide {
display: none;
}
.pro-revoke-auth-button-hide {
display: none;
}