diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index 722d17a..933d36b 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -2,5 +2,5 @@ "table-editor-obsidian", "obsidian-icon-folder", "obsidian-git", - "obsidian-dictionary-plugin" + "various-complements" ] \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-dictionary-plugin/cache.json b/.obsidian/plugins/obsidian-dictionary-plugin/cache.json deleted file mode 100644 index 9e26dfe..0000000 --- a/.obsidian/plugins/obsidian-dictionary-plugin/cache.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-dictionary-plugin/data.json b/.obsidian/plugins/obsidian-dictionary-plugin/data.json deleted file mode 100644 index 1480ffd..0000000 --- a/.obsidian/plugins/obsidian-dictionary-plugin/data.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "getLangFromFile": true, - "defaultLanguage": "en_US", - "normalLang": "en_US", - "shouldShowSynonymPopover": true, - "shouldShowCustomContextMenu": true, - "apiSettings": { - "en_US": { - "definitionApiName": "Offline Dictionary", - "synonymApiName": "Google" - }, - "hi": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": null - }, - "es": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": "Altervista" - }, - "fr": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": "Altervista" - }, - "ja": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": null - }, - "ru": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": null - }, - "en_GB": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": null - }, - "de": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": "Open Thesaurus" - }, - "it": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": "Altervista" - }, - "ko": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": null - }, - "pt_BR": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": null - }, - "ar": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": null - }, - "tr": { - "definitionApiName": "Free Dictionary API", - "synonymApiName": null - }, - "cn": { - "definitionApiName": "Offline Dictionary", - "synonymApiName": null - } - }, - "partOfSpeechApiName": "Systran API", - "advancedSynonymAnalysis": false, - "useCaching": true, - "folder": "", - "capitalizedFileName": true, - "prefix": "", - "suffix": " ({{lang}})", - "template": "---\n# {{notice}}\naliases: [\"{{word}}\"]\n---\n\n# {{word}}\n\n## {{pronunciationHeader}}\n\n{{phoneticList}}\n\n## {{meaningHeader}}\n\n{{meanings}}\n\n## {{originHeader}}\n\n{{origin}}\n", - "languageSpecificSubFolders": false -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-dictionary-plugin/main.js b/.obsidian/plugins/obsidian-dictionary-plugin/main.js deleted file mode 100644 index 5cb4fe7..0000000 --- a/.obsidian/plugins/obsidian-dictionary-plugin/main.js +++ /dev/null @@ -1,47 +0,0 @@ -/* -THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source visit the plugins github repository (https://github.com/phibr0/obsidian-dictionary) -*/ - -var vr=Object.create;var qe=Object.defineProperty;var xr=Object.getOwnPropertyDescriptor;var wr=Object.getOwnPropertyNames;var br=Object.getPrototypeOf,Sr=Object.prototype.hasOwnProperty;var $t=n=>qe(n,"__esModule",{value:!0});var Ye=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Cr=(n,e)=>{$t(n);for(var t in e)qe(n,t,{get:e[t],enumerable:!0})},jr=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of wr(e))!Sr.call(n,i)&&i!=="default"&&qe(n,i,{get:()=>e[i],enumerable:!(t=xr(e,i))||t.enumerable});return n},G=n=>jr($t(qe(n!=null?vr(br(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var M=(n,e,t)=>new Promise((i,r)=>{var o=l=>{try{s(t.next(l))}catch(c){r(c)}},a=l=>{try{s(t.throw(l))}catch(c){r(c)}},s=l=>l.done?i(l.value):Promise.resolve(l.value).then(o,a);s((t=t.apply(n,e)).next())});var fi=Ye((_a,rt)=>{var $n,Gn,qn,Yn,Jn,Kn,Qn,Xn,Zn,nt,Dt,ei,ti,ni,Ee,ii,ri,oi,ai,si,li,ci,ui,di,it;(function(n){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){n(t(e,t(i)))}):typeof rt=="object"&&typeof rt.exports=="object"?n(t(e,t(rt.exports))):n(t(e));function t(i,r){return i!==e&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(o,a){return i[o]=r?r(o,a):a}}})(function(n){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(i[o]=r[o])};$n=function(i,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(i,r);function o(){this.constructor=i}i.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)},Gn=Object.assign||function(i){for(var r,o=1,a=arguments.length;o=0;u--)(c=i[u])&&(l=(s<3?c(l):s>3?c(r,o,l):c(r,o))||l);return s>3&&l&&Object.defineProperty(r,o,l),l},Jn=function(i,r){return function(o,a){r(o,a,i)}},Kn=function(i,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,r)},Qn=function(i,r,o,a){function s(l){return l instanceof o?l:new o(function(c){c(l)})}return new(o||(o=Promise))(function(l,c){function u(y){try{p(a.next(y))}catch(g){c(g)}}function f(y){try{p(a.throw(y))}catch(g){c(g)}}function p(y){y.done?l(y.value):s(y.value).then(u,f)}p((a=a.apply(i,r||[])).next())})},Xn=function(i,r){var o={label:0,sent:function(){if(l[0]&1)throw l[1];return l[1]},trys:[],ops:[]},a,s,l,c;return c={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function u(p){return function(y){return f([p,y])}}function f(p){if(a)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(o=0)),o;)try{if(a=1,s&&(l=p[0]&2?s.return:p[0]?s.throw||((l=s.return)&&l.call(s),0):s.next)&&!(l=l.call(s,p[1])).done)return l;switch(s=0,l&&(p=[p[0]&2,l.value]),p[0]){case 0:case 1:l=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,s=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(l=o.trys,!(l=l.length>0&&l[l.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!l||p[1]>l[0]&&p[1]=i.length&&(i=void 0),{value:i&&i[a++],done:!i}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},Dt=function(i,r){var o=typeof Symbol=="function"&&i[Symbol.iterator];if(!o)return i;var a=o.call(i),s,l=[],c;try{for(;(r===void 0||r-- >0)&&!(s=a.next()).done;)l.push(s.value)}catch(u){c={error:u}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(c)throw c.error}}return l},ei=function(){for(var i=[],r=0;r1||u(v,m)})})}function u(v,m){try{f(a[v](m))}catch(x){g(l[0][3],x)}}function f(v){v.value instanceof Ee?Promise.resolve(v.value.v).then(p,y):g(l[0][2],v)}function p(v){u("next",v)}function y(v){u("throw",v)}function g(v,m){v(m),l.shift(),l.length&&u(l[0][0],l[0][1])}},ri=function(i){var r,o;return r={},a("next"),a("throw",function(s){throw s}),a("return"),r[Symbol.iterator]=function(){return this},r;function a(s,l){r[s]=i[s]?function(c){return(o=!o)?{value:Ee(i[s](c)),done:s==="return"}:l?l(c):c}:l}},oi=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=i[Symbol.asyncIterator],o;return r?r.call(i):(i=typeof nt=="function"?nt(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(l){o[l]=i[l]&&function(c){return new Promise(function(u,f){c=i[l](c),s(u,f,c.done,c.value)})}}function s(l,c,u,f){Promise.resolve(f).then(function(p){l({value:p,done:u})},c)}},ai=function(i,r){return Object.defineProperty?Object.defineProperty(i,"raw",{value:r}):i.raw=r,i};var t=Object.create?function(i,r){Object.defineProperty(i,"default",{enumerable:!0,value:r})}:function(i,r){i.default=r};si=function(i){if(i&&i.__esModule)return i;var r={};if(i!=null)for(var o in i)o!=="default"&&Object.prototype.hasOwnProperty.call(i,o)&&it(r,i,o);return t(r,i),r},li=function(i){return i&&i.__esModule?i:{default:i}},ci=function(i,r,o,a){if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?i!==r||!a:!r.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?a:o==="a"?a.call(i):a?a.value:r.get(i)},ui=function(i,r,o,a,s){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?i!==r||!s:!r.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?s.call(i,o):s?s.value=o:r.set(i,o),o},di=function(i,r){if(r===null||typeof r!="object"&&typeof r!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof i=="function"?r===i:i.has(r)},n("__extends",$n),n("__assign",Gn),n("__rest",qn),n("__decorate",Yn),n("__param",Jn),n("__metadata",Kn),n("__awaiter",Qn),n("__generator",Xn),n("__exportStar",Zn),n("__createBinding",it),n("__values",nt),n("__read",Dt),n("__spread",ei),n("__spreadArrays",ti),n("__spreadArray",ni),n("__await",Ee),n("__asyncGenerator",ii),n("__asyncDelegator",ri),n("__asyncValues",oi),n("__makeTemplateObject",ai),n("__importStar",si),n("__importDefault",li),n("__classPrivateFieldGet",ci),n("__classPrivateFieldSet",ui),n("__classPrivateFieldIn",di)})});var wi=Ye(($e,It)=>{(function(e,t){typeof $e=="object"&&typeof It=="object"?It.exports=t():typeof define=="function"&&define.amd?define([],t):typeof $e=="object"?$e.feather=t():e.feather=t()})(typeof self!="undefined"?self:$e,function(){return function(n){var e={};function t(i){if(e[i])return e[i].exports;var r=e[i]={i,l:!1,exports:{}};return n[i].call(r.exports,r,r.exports,t),r.l=!0,r.exports}return t.m=n,t.c=e,t.d=function(i,r,o){t.o(i,r)||Object.defineProperty(i,r,{configurable:!1,enumerable:!0,get:o})},t.r=function(i){Object.defineProperty(i,"__esModule",{value:!0})},t.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return t.d(r,"a",r),r},t.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},t.p="",t(t.s=0)}({"./dist/icons.json":function(n){n.exports={activity:'',airplay:'',"alert-circle":'',"alert-octagon":'',"alert-triangle":'',"align-center":'',"align-justify":'',"align-left":'',"align-right":'',anchor:'',aperture:'',archive:'',"arrow-down-circle":'',"arrow-down-left":'',"arrow-down-right":'',"arrow-down":'',"arrow-left-circle":'',"arrow-left":'',"arrow-right-circle":'',"arrow-right":'',"arrow-up-circle":'',"arrow-up-left":'',"arrow-up-right":'',"arrow-up":'',"at-sign":'',award:'',"bar-chart-2":'',"bar-chart":'',"battery-charging":'',battery:'',"bell-off":'',bell:'',bluetooth:'',bold:'',"book-open":'',book:'',bookmark:'',box:'',briefcase:'',calendar:'',"camera-off":'',camera:'',cast:'',"check-circle":'',"check-square":'',check:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"chevrons-down":'',"chevrons-left":'',"chevrons-right":'',"chevrons-up":'',chrome:'',circle:'',clipboard:'',clock:'',"cloud-drizzle":'',"cloud-lightning":'',"cloud-off":'',"cloud-rain":'',"cloud-snow":'',cloud:'',code:'',codepen:'',codesandbox:'',coffee:'',columns:'',command:'',compass:'',copy:'',"corner-down-left":'',"corner-down-right":'',"corner-left-down":'',"corner-left-up":'',"corner-right-down":'',"corner-right-up":'',"corner-up-left":'',"corner-up-right":'',cpu:'',"credit-card":'',crop:'',crosshair:'',database:'',delete:'',disc:'',"divide-circle":'',"divide-square":'',divide:'',"dollar-sign":'',"download-cloud":'',download:'',dribbble:'',droplet:'',"edit-2":'',"edit-3":'',edit:'',"external-link":'',"eye-off":'',eye:'',facebook:'',"fast-forward":'',feather:'',figma:'',"file-minus":'',"file-plus":'',"file-text":'',file:'',film:'',filter:'',flag:'',"folder-minus":'',"folder-plus":'',folder:'',framer:'',frown:'',gift:'',"git-branch":'',"git-commit":'',"git-merge":'',"git-pull-request":'',github:'',gitlab:'',globe:'',grid:'',"hard-drive":'',hash:'',headphones:'',heart:'',"help-circle":'',hexagon:'',home:'',image:'',inbox:'',info:'',instagram:'',italic:'',key:'',layers:'',layout:'',"life-buoy":'',"link-2":'',link:'',linkedin:'',list:'',loader:'',lock:'',"log-in":'',"log-out":'',mail:'',"map-pin":'',map:'',"maximize-2":'',maximize:'',meh:'',menu:'',"message-circle":'',"message-square":'',"mic-off":'',mic:'',"minimize-2":'',minimize:'',"minus-circle":'',"minus-square":'',minus:'',monitor:'',moon:'',"more-horizontal":'',"more-vertical":'',"mouse-pointer":'',move:'',music:'',"navigation-2":'',navigation:'',octagon:'',package:'',paperclip:'',"pause-circle":'',pause:'',"pen-tool":'',percent:'',"phone-call":'',"phone-forwarded":'',"phone-incoming":'',"phone-missed":'',"phone-off":'',"phone-outgoing":'',phone:'',"pie-chart":'',"play-circle":'',play:'',"plus-circle":'',"plus-square":'',plus:'',pocket:'',power:'',printer:'',radio:'',"refresh-ccw":'',"refresh-cw":'',repeat:'',rewind:'',"rotate-ccw":'',"rotate-cw":'',rss:'',save:'',scissors:'',search:'',send:'',server:'',settings:'',"share-2":'',share:'',"shield-off":'',shield:'',"shopping-bag":'',"shopping-cart":'',shuffle:'',sidebar:'',"skip-back":'',"skip-forward":'',slack:'',slash:'',sliders:'',smartphone:'',smile:'',speaker:'',square:'',star:'',"stop-circle":'',sun:'',sunrise:'',sunset:'',table:'',tablet:'',tag:'',target:'',terminal:'',thermometer:'',"thumbs-down":'',"thumbs-up":'',"toggle-left":'',"toggle-right":'',tool:'',"trash-2":'',trash:'',trello:'',"trending-down":'',"trending-up":'',triangle:'',truck:'',tv:'',twitch:'',twitter:'',type:'',umbrella:'',underline:'',unlock:'',"upload-cloud":'',upload:'',"user-check":'',"user-minus":'',"user-plus":'',"user-x":'',user:'',users:'',"video-off":'',video:'',voicemail:'',"volume-1":'',"volume-2":'',"volume-x":'',volume:'',watch:'',"wifi-off":'',wifi:'',wind:'',"x-circle":'',"x-octagon":'',"x-square":'',x:'',youtube:'',"zap-off":'',zap:'',"zoom-in":'',"zoom-out":''}},"./node_modules/classnames/dedupe.js":function(n,e,t){var i,r;(function(){"use strict";var o=function(){function a(){}a.prototype=Object.create(null);function s(v,m){for(var x=m.length,C=0;C1?arguments[1]:void 0,m=v!==void 0,x=0,C=c(p),E,D,j,k;if(m&&(v=i(v,g>2?arguments[2]:void 0,2)),C!=null&&!(y==Array&&a(C)))for(k=C.call(p),D=new y;!(j=k.next()).done;x++)l(D,x,m?o(k,v,[j.value,x],!0):j.value);else for(E=s(p.length),D=new y(E);E>x;x++)l(D,x,m?v(p[x],x):p[x]);return D.length=x,D}},"./node_modules/core-js/internals/array-includes.js":function(n,e,t){var i=t("./node_modules/core-js/internals/to-indexed-object.js"),r=t("./node_modules/core-js/internals/to-length.js"),o=t("./node_modules/core-js/internals/to-absolute-index.js");n.exports=function(a){return function(s,l,c){var u=i(s),f=r(u.length),p=o(c,f),y;if(a&&l!=l){for(;f>p;)if(y=u[p++],y!=y)return!0}else for(;f>p;p++)if((a||p in u)&&u[p]===l)return a||p||0;return!a&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(n,e,t){var i=t("./node_modules/core-js/internals/a-function.js");n.exports=function(r,o,a){if(i(r),o===void 0)return r;switch(a){case 0:return function(){return r.call(o)};case 1:return function(s){return r.call(o,s)};case 2:return function(s,l){return r.call(o,s,l)};case 3:return function(s,l,c){return r.call(o,s,l,c)}}return function(){return r.apply(o,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(n,e,t){var i=t("./node_modules/core-js/internals/an-object.js");n.exports=function(r,o,a,s){try{return s?o(i(a)[0],a[1]):o(a)}catch(c){var l=r.return;throw l!==void 0&&i(l.call(r)),c}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(n,e,t){var i=t("./node_modules/core-js/internals/well-known-symbol.js"),r=i("iterator"),o=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){o=!0}};s[r]=function(){return this},Array.from(s,function(){throw 2})}catch(l){}n.exports=function(l,c){if(!c&&!o)return!1;var u=!1;try{var f={};f[r]=function(){return{next:function(){return{done:u=!0}}}},l(f)}catch(p){}return u}},"./node_modules/core-js/internals/classof-raw.js":function(n,e){var t={}.toString;n.exports=function(i){return t.call(i).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(n,e,t){var i=t("./node_modules/core-js/internals/classof-raw.js"),r=t("./node_modules/core-js/internals/well-known-symbol.js"),o=r("toStringTag"),a=i(function(){return arguments}())=="Arguments",s=function(l,c){try{return l[c]}catch(u){}};n.exports=function(l){var c,u,f;return l===void 0?"Undefined":l===null?"Null":typeof(u=s(c=Object(l),o))=="string"?u:a?i(c):(f=i(c))=="Object"&&typeof c.callee=="function"?"Arguments":f}},"./node_modules/core-js/internals/copy-constructor-properties.js":function(n,e,t){var i=t("./node_modules/core-js/internals/has.js"),r=t("./node_modules/core-js/internals/own-keys.js"),o=t("./node_modules/core-js/internals/object-get-own-property-descriptor.js"),a=t("./node_modules/core-js/internals/object-define-property.js");n.exports=function(s,l){for(var c=r(l),u=a.f,f=o.f,p=0;p",E="java"+x+":",D;for(g.style.display="none",s.appendChild(g),g.src=String(E),D=g.contentWindow.document,D.open(),D.write(m+x+C+"document.F=Object"+m+"/"+x+C),D.close(),y=D.F;v--;)delete y[f][o[v]];return y()};n.exports=Object.create||function(v,m){var x;return v!==null?(p[f]=i(v),x=new p,p[f]=null,x[u]=v):x=y(),m===void 0?x:r(x,m)},a[u]=!0},"./node_modules/core-js/internals/object-define-properties.js":function(n,e,t){var i=t("./node_modules/core-js/internals/descriptors.js"),r=t("./node_modules/core-js/internals/object-define-property.js"),o=t("./node_modules/core-js/internals/an-object.js"),a=t("./node_modules/core-js/internals/object-keys.js");n.exports=i?Object.defineProperties:function(l,c){o(l);for(var u=a(c),f=u.length,p=0,y;f>p;)r.f(l,y=u[p++],c[y]);return l}},"./node_modules/core-js/internals/object-define-property.js":function(n,e,t){var i=t("./node_modules/core-js/internals/descriptors.js"),r=t("./node_modules/core-js/internals/ie8-dom-define.js"),o=t("./node_modules/core-js/internals/an-object.js"),a=t("./node_modules/core-js/internals/to-primitive.js"),s=Object.defineProperty;e.f=i?s:function(c,u,f){if(o(c),u=a(u,!0),o(f),r)try{return s(c,u,f)}catch(p){}if("get"in f||"set"in f)throw TypeError("Accessors not supported");return"value"in f&&(c[u]=f.value),c}},"./node_modules/core-js/internals/object-get-own-property-descriptor.js":function(n,e,t){var i=t("./node_modules/core-js/internals/descriptors.js"),r=t("./node_modules/core-js/internals/object-property-is-enumerable.js"),o=t("./node_modules/core-js/internals/create-property-descriptor.js"),a=t("./node_modules/core-js/internals/to-indexed-object.js"),s=t("./node_modules/core-js/internals/to-primitive.js"),l=t("./node_modules/core-js/internals/has.js"),c=t("./node_modules/core-js/internals/ie8-dom-define.js"),u=Object.getOwnPropertyDescriptor;e.f=i?u:function(p,y){if(p=a(p),y=s(y,!0),c)try{return u(p,y)}catch(g){}if(l(p,y))return o(!r.f.call(p,y),p[y])}},"./node_modules/core-js/internals/object-get-own-property-names.js":function(n,e,t){var i=t("./node_modules/core-js/internals/object-keys-internal.js"),r=t("./node_modules/core-js/internals/enum-bug-keys.js"),o=r.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(s){return i(s,o)}},"./node_modules/core-js/internals/object-get-own-property-symbols.js":function(n,e){e.f=Object.getOwnPropertySymbols},"./node_modules/core-js/internals/object-get-prototype-of.js":function(n,e,t){var i=t("./node_modules/core-js/internals/has.js"),r=t("./node_modules/core-js/internals/to-object.js"),o=t("./node_modules/core-js/internals/shared-key.js"),a=t("./node_modules/core-js/internals/correct-prototype-getter.js"),s=o("IE_PROTO"),l=Object.prototype;n.exports=a?Object.getPrototypeOf:function(c){return c=r(c),i(c,s)?c[s]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?l:null}},"./node_modules/core-js/internals/object-keys-internal.js":function(n,e,t){var i=t("./node_modules/core-js/internals/has.js"),r=t("./node_modules/core-js/internals/to-indexed-object.js"),o=t("./node_modules/core-js/internals/array-includes.js"),a=t("./node_modules/core-js/internals/hidden-keys.js"),s=o(!1);n.exports=function(l,c){var u=r(l),f=0,p=[],y;for(y in u)!i(a,y)&&i(u,y)&&p.push(y);for(;c.length>f;)i(u,y=c[f++])&&(~s(p,y)||p.push(y));return p}},"./node_modules/core-js/internals/object-keys.js":function(n,e,t){var i=t("./node_modules/core-js/internals/object-keys-internal.js"),r=t("./node_modules/core-js/internals/enum-bug-keys.js");n.exports=Object.keys||function(a){return i(a,r)}},"./node_modules/core-js/internals/object-property-is-enumerable.js":function(n,e,t){"use strict";var i={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!i.call({1:2},1);e.f=o?function(s){var l=r(this,s);return!!l&&l.enumerable}:i},"./node_modules/core-js/internals/object-set-prototype-of.js":function(n,e,t){var i=t("./node_modules/core-js/internals/validate-set-prototype-of-arguments.js");n.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,o={},a;try{a=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,a.call(o,[]),r=o instanceof Array}catch(s){}return function(l,c){return i(l,c),r?a.call(l,c):l.__proto__=c,l}}():void 0)},"./node_modules/core-js/internals/own-keys.js":function(n,e,t){var i=t("./node_modules/core-js/internals/global.js"),r=t("./node_modules/core-js/internals/object-get-own-property-names.js"),o=t("./node_modules/core-js/internals/object-get-own-property-symbols.js"),a=t("./node_modules/core-js/internals/an-object.js"),s=i.Reflect;n.exports=s&&s.ownKeys||function(c){var u=r.f(a(c)),f=o.f;return f?u.concat(f(c)):u}},"./node_modules/core-js/internals/path.js":function(n,e,t){n.exports=t("./node_modules/core-js/internals/global.js")},"./node_modules/core-js/internals/redefine.js":function(n,e,t){var i=t("./node_modules/core-js/internals/global.js"),r=t("./node_modules/core-js/internals/shared.js"),o=t("./node_modules/core-js/internals/hide.js"),a=t("./node_modules/core-js/internals/has.js"),s=t("./node_modules/core-js/internals/set-global.js"),l=t("./node_modules/core-js/internals/function-to-string.js"),c=t("./node_modules/core-js/internals/internal-state.js"),u=c.get,f=c.enforce,p=String(l).split("toString");r("inspectSource",function(y){return l.call(y)}),(n.exports=function(y,g,v,m){var x=m?!!m.unsafe:!1,C=m?!!m.enumerable:!1,E=m?!!m.noTargetGet:!1;if(typeof v=="function"&&(typeof g=="string"&&!a(v,"name")&&o(v,"name",g),f(v).source=p.join(typeof g=="string"?g:"")),y===i){C?y[g]=v:s(g,v);return}else x?!E&&y[g]&&(C=!0):delete y[g];C?y[g]=v:o(y,g,v)})(Function.prototype,"toString",function(){return typeof this=="function"&&u(this).source||l.call(this)})},"./node_modules/core-js/internals/require-object-coercible.js":function(n,e){n.exports=function(t){if(t==null)throw TypeError("Can't call method on "+t);return t}},"./node_modules/core-js/internals/set-global.js":function(n,e,t){var i=t("./node_modules/core-js/internals/global.js"),r=t("./node_modules/core-js/internals/hide.js");n.exports=function(o,a){try{r(i,o,a)}catch(s){i[o]=a}return a}},"./node_modules/core-js/internals/set-to-string-tag.js":function(n,e,t){var i=t("./node_modules/core-js/internals/object-define-property.js").f,r=t("./node_modules/core-js/internals/has.js"),o=t("./node_modules/core-js/internals/well-known-symbol.js"),a=o("toStringTag");n.exports=function(s,l,c){s&&!r(s=c?s:s.prototype,a)&&i(s,a,{configurable:!0,value:l})}},"./node_modules/core-js/internals/shared-key.js":function(n,e,t){var i=t("./node_modules/core-js/internals/shared.js"),r=t("./node_modules/core-js/internals/uid.js"),o=i("keys");n.exports=function(a){return o[a]||(o[a]=r(a))}},"./node_modules/core-js/internals/shared.js":function(n,e,t){var i=t("./node_modules/core-js/internals/global.js"),r=t("./node_modules/core-js/internals/set-global.js"),o=t("./node_modules/core-js/internals/is-pure.js"),a="__core-js_shared__",s=i[a]||r(a,{});(n.exports=function(l,c){return s[l]||(s[l]=c!==void 0?c:{})})("versions",[]).push({version:"3.1.3",mode:o?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},"./node_modules/core-js/internals/string-at.js":function(n,e,t){var i=t("./node_modules/core-js/internals/to-integer.js"),r=t("./node_modules/core-js/internals/require-object-coercible.js");n.exports=function(o,a,s){var l=String(r(o)),c=i(a),u=l.length,f,p;return c<0||c>=u?s?"":void 0:(f=l.charCodeAt(c),f<55296||f>56319||c+1===u||(p=l.charCodeAt(c+1))<56320||p>57343?s?l.charAt(c):f:s?l.slice(c,c+2):(f-55296<<10)+(p-56320)+65536)}},"./node_modules/core-js/internals/to-absolute-index.js":function(n,e,t){var i=t("./node_modules/core-js/internals/to-integer.js"),r=Math.max,o=Math.min;n.exports=function(a,s){var l=i(a);return l<0?r(l+s,0):o(l,s)}},"./node_modules/core-js/internals/to-indexed-object.js":function(n,e,t){var i=t("./node_modules/core-js/internals/indexed-object.js"),r=t("./node_modules/core-js/internals/require-object-coercible.js");n.exports=function(o){return i(r(o))}},"./node_modules/core-js/internals/to-integer.js":function(n,e){var t=Math.ceil,i=Math.floor;n.exports=function(r){return isNaN(r=+r)?0:(r>0?i:t)(r)}},"./node_modules/core-js/internals/to-length.js":function(n,e,t){var i=t("./node_modules/core-js/internals/to-integer.js"),r=Math.min;n.exports=function(o){return o>0?r(i(o),9007199254740991):0}},"./node_modules/core-js/internals/to-object.js":function(n,e,t){var i=t("./node_modules/core-js/internals/require-object-coercible.js");n.exports=function(r){return Object(i(r))}},"./node_modules/core-js/internals/to-primitive.js":function(n,e,t){var i=t("./node_modules/core-js/internals/is-object.js");n.exports=function(r,o){if(!i(r))return r;var a,s;if(o&&typeof(a=r.toString)=="function"&&!i(s=a.call(r))||typeof(a=r.valueOf)=="function"&&!i(s=a.call(r))||!o&&typeof(a=r.toString)=="function"&&!i(s=a.call(r)))return s;throw TypeError("Can't convert object to primitive value")}},"./node_modules/core-js/internals/uid.js":function(n,e){var t=0,i=Math.random();n.exports=function(r){return"Symbol(".concat(r===void 0?"":r,")_",(++t+i).toString(36))}},"./node_modules/core-js/internals/validate-set-prototype-of-arguments.js":function(n,e,t){var i=t("./node_modules/core-js/internals/is-object.js"),r=t("./node_modules/core-js/internals/an-object.js");n.exports=function(o,a){if(r(o),!i(a)&&a!==null)throw TypeError("Can't set "+String(a)+" as a prototype")}},"./node_modules/core-js/internals/well-known-symbol.js":function(n,e,t){var i=t("./node_modules/core-js/internals/global.js"),r=t("./node_modules/core-js/internals/shared.js"),o=t("./node_modules/core-js/internals/uid.js"),a=t("./node_modules/core-js/internals/native-symbol.js"),s=i.Symbol,l=r("wks");n.exports=function(c){return l[c]||(l[c]=a&&s[c]||(a?s:o)("Symbol."+c))}},"./node_modules/core-js/modules/es.array.from.js":function(n,e,t){var i=t("./node_modules/core-js/internals/export.js"),r=t("./node_modules/core-js/internals/array-from.js"),o=t("./node_modules/core-js/internals/check-correctness-of-iteration.js"),a=!o(function(s){Array.from(s)});i({target:"Array",stat:!0,forced:a},{from:r})},"./node_modules/core-js/modules/es.string.iterator.js":function(n,e,t){"use strict";var i=t("./node_modules/core-js/internals/string-at.js"),r=t("./node_modules/core-js/internals/internal-state.js"),o=t("./node_modules/core-js/internals/define-iterator.js"),a="String Iterator",s=r.set,l=r.getterFor(a);o(String,"String",function(c){s(this,{type:a,string:String(c),index:0})},function(){var u=l(this),f=u.string,p=u.index,y;return p>=f.length?{value:void 0,done:!0}:(y=i(f,p,!0),u.index+=y.length,{value:y,done:!1})})},"./node_modules/webpack/buildin/global.js":function(n,e){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(i){typeof window=="object"&&(t=window)}n.exports=t},"./src/default-attrs.json":function(n){n.exports={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"}},"./src/icon.js":function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(y){for(var g=1;g2&&arguments[2]!==void 0?arguments[2]:[];u(this,y),this.name=g,this.contents=v,this.tags=m,this.attrs=i({},l.default,{class:"feather feather-"+g})}return r(y,[{key:"toSvg",value:function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=i({},this.attrs,v,{class:(0,a.default)(this.attrs.class,v.class)});return""+this.contents+""}},{key:"toString",value:function(){return this.contents}}]),y}();function p(y){return Object.keys(y).map(function(g){return g+'="'+y[g]+'"'}).join(" ")}e.default=f},"./src/icons.js":function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t("./src/icon.js"),r=c(i),o=t("./dist/icons.json"),a=c(o),s=t("./src/tags.json"),l=c(s);function c(u){return u&&u.__esModule?u:{default:u}}e.default=Object.keys(a.default).map(function(u){return new r.default(u,a.default[u],l.default[u])}).reduce(function(u,f){return u[f.name]=f,u},{})},"./src/index.js":function(n,e,t){"use strict";var i=t("./src/icons.js"),r=c(i),o=t("./src/to-svg.js"),a=c(o),s=t("./src/replace.js"),l=c(s);function c(u){return u&&u.__esModule?u:{default:u}}n.exports={icons:r.default,toSvg:a.default,replace:l.default}},"./src/replace.js":function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(p){for(var y=1;y0&&arguments[0]!==void 0?arguments[0]:{};if(typeof document=="undefined")throw new Error("`feather.replace()` only works in a browser environment.");var y=document.querySelectorAll("[data-feather]");Array.from(y).forEach(function(g){return u(g,p)})}function u(p){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=f(p),v=g["data-feather"];delete g["data-feather"];var m=s.default[v].toSvg(i({},y,g,{class:(0,o.default)(y.class,g.class)})),x=new DOMParser().parseFromString(m,"image/svg+xml"),C=x.querySelector("svg");p.parentNode.replaceChild(C,p)}function f(p){return Array.from(p.attributes).reduce(function(y,g){return y[g.name]=g.value,y},{})}e.default=c},"./src/tags.json":function(n){n.exports={activity:["pulse","health","action","motion"],airplay:["stream","cast","mirroring"],"alert-circle":["warning","alert","danger"],"alert-octagon":["warning","alert","danger"],"alert-triangle":["warning","alert","danger"],"align-center":["text alignment","center"],"align-justify":["text alignment","justified"],"align-left":["text alignment","left"],"align-right":["text alignment","right"],anchor:[],archive:["index","box"],"at-sign":["mention","at","email","message"],award:["achievement","badge"],aperture:["camera","photo"],"bar-chart":["statistics","diagram","graph"],"bar-chart-2":["statistics","diagram","graph"],battery:["power","electricity"],"battery-charging":["power","electricity"],bell:["alarm","notification","sound"],"bell-off":["alarm","notification","silent"],bluetooth:["wireless"],"book-open":["read","library"],book:["read","dictionary","booklet","magazine","library"],bookmark:["read","clip","marker","tag"],box:["cube"],briefcase:["work","bag","baggage","folder"],calendar:["date"],camera:["photo"],cast:["chromecast","airplay"],"chevron-down":["expand"],"chevron-up":["collapse"],circle:["off","zero","record"],clipboard:["copy"],clock:["time","watch","alarm"],"cloud-drizzle":["weather","shower"],"cloud-lightning":["weather","bolt"],"cloud-rain":["weather"],"cloud-snow":["weather","blizzard"],cloud:["weather"],codepen:["logo"],codesandbox:["logo"],code:["source","programming"],coffee:["drink","cup","mug","tea","cafe","hot","beverage"],columns:["layout"],command:["keyboard","cmd","terminal","prompt"],compass:["navigation","safari","travel","direction"],copy:["clone","duplicate"],"corner-down-left":["arrow","return"],"corner-down-right":["arrow"],"corner-left-down":["arrow"],"corner-left-up":["arrow"],"corner-right-down":["arrow"],"corner-right-up":["arrow"],"corner-up-left":["arrow"],"corner-up-right":["arrow"],cpu:["processor","technology"],"credit-card":["purchase","payment","cc"],crop:["photo","image"],crosshair:["aim","target"],database:["storage","memory"],delete:["remove"],disc:["album","cd","dvd","music"],"dollar-sign":["currency","money","payment"],droplet:["water"],edit:["pencil","change"],"edit-2":["pencil","change"],"edit-3":["pencil","change"],eye:["view","watch"],"eye-off":["view","watch","hide","hidden"],"external-link":["outbound"],facebook:["logo","social"],"fast-forward":["music"],figma:["logo","design","tool"],"file-minus":["delete","remove","erase"],"file-plus":["add","create","new"],"file-text":["data","txt","pdf"],film:["movie","video"],filter:["funnel","hopper"],flag:["report"],"folder-minus":["directory"],"folder-plus":["directory"],folder:["directory"],framer:["logo","design","tool"],frown:["emoji","face","bad","sad","emotion"],gift:["present","box","birthday","party"],"git-branch":["code","version control"],"git-commit":["code","version control"],"git-merge":["code","version control"],"git-pull-request":["code","version control"],github:["logo","version control"],gitlab:["logo","version control"],globe:["world","browser","language","translate"],"hard-drive":["computer","server","memory","data"],hash:["hashtag","number","pound"],headphones:["music","audio","sound"],heart:["like","love","emotion"],"help-circle":["question mark"],hexagon:["shape","node.js","logo"],home:["house","living"],image:["picture"],inbox:["email"],instagram:["logo","camera"],key:["password","login","authentication","secure"],layers:["stack"],layout:["window","webpage"],"life-bouy":["help","life ring","support"],link:["chain","url"],"link-2":["chain","url"],linkedin:["logo","social media"],list:["options"],lock:["security","password","secure"],"log-in":["sign in","arrow","enter"],"log-out":["sign out","arrow","exit"],mail:["email","message"],"map-pin":["location","navigation","travel","marker"],map:["location","navigation","travel"],maximize:["fullscreen"],"maximize-2":["fullscreen","arrows","expand"],meh:["emoji","face","neutral","emotion"],menu:["bars","navigation","hamburger"],"message-circle":["comment","chat"],"message-square":["comment","chat"],"mic-off":["record","sound","mute"],mic:["record","sound","listen"],minimize:["exit fullscreen","close"],"minimize-2":["exit fullscreen","arrows","close"],minus:["subtract"],monitor:["tv","screen","display"],moon:["dark","night"],"more-horizontal":["ellipsis"],"more-vertical":["ellipsis"],"mouse-pointer":["arrow","cursor"],move:["arrows"],music:["note"],navigation:["location","travel"],"navigation-2":["location","travel"],octagon:["stop"],package:["box","container"],paperclip:["attachment"],pause:["music","stop"],"pause-circle":["music","audio","stop"],"pen-tool":["vector","drawing"],percent:["discount"],"phone-call":["ring"],"phone-forwarded":["call"],"phone-incoming":["call"],"phone-missed":["call"],"phone-off":["call","mute"],"phone-outgoing":["call"],phone:["call"],play:["music","start"],"pie-chart":["statistics","diagram"],"play-circle":["music","start"],plus:["add","new"],"plus-circle":["add","new"],"plus-square":["add","new"],pocket:["logo","save"],power:["on","off"],printer:["fax","office","device"],radio:["signal"],"refresh-cw":["synchronise","arrows"],"refresh-ccw":["arrows"],repeat:["loop","arrows"],rewind:["music"],"rotate-ccw":["arrow"],"rotate-cw":["arrow"],rss:["feed","subscribe"],save:["floppy disk"],scissors:["cut"],search:["find","magnifier","magnifying glass"],send:["message","mail","email","paper airplane","paper aeroplane"],settings:["cog","edit","gear","preferences"],"share-2":["network","connections"],shield:["security","secure"],"shield-off":["security","insecure"],"shopping-bag":["ecommerce","cart","purchase","store"],"shopping-cart":["ecommerce","cart","purchase","store"],shuffle:["music"],"skip-back":["music"],"skip-forward":["music"],slack:["logo"],slash:["ban","no"],sliders:["settings","controls"],smartphone:["cellphone","device"],smile:["emoji","face","happy","good","emotion"],speaker:["audio","music"],star:["bookmark","favorite","like"],"stop-circle":["media","music"],sun:["brightness","weather","light"],sunrise:["weather","time","morning","day"],sunset:["weather","time","evening","night"],tablet:["device"],tag:["label"],target:["logo","bullseye"],terminal:["code","command line","prompt"],thermometer:["temperature","celsius","fahrenheit","weather"],"thumbs-down":["dislike","bad","emotion"],"thumbs-up":["like","good","emotion"],"toggle-left":["on","off","switch"],"toggle-right":["on","off","switch"],tool:["settings","spanner"],trash:["garbage","delete","remove","bin"],"trash-2":["garbage","delete","remove","bin"],triangle:["delta"],truck:["delivery","van","shipping","transport","lorry"],tv:["television","stream"],twitch:["logo"],twitter:["logo","social"],type:["text"],umbrella:["rain","weather"],unlock:["security"],"user-check":["followed","subscribed"],"user-minus":["delete","remove","unfollow","unsubscribe"],"user-plus":["new","add","create","follow","subscribe"],"user-x":["delete","remove","unfollow","unsubscribe","unavailable"],user:["person","account"],users:["group"],"video-off":["camera","movie","film"],video:["camera","movie","film"],voicemail:["phone"],volume:["music","sound","mute"],"volume-1":["music","sound"],"volume-2":["music","sound"],"volume-x":["music","sound","mute"],watch:["clock","time"],"wifi-off":["disabled"],wifi:["connection","signal","wireless"],wind:["weather","air"],"x-circle":["cancel","close","delete","remove","times","clear"],"x-octagon":["delete","stop","alert","warning","times","clear"],"x-square":["cancel","close","delete","remove","times","clear"],x:["cancel","close","delete","remove","times","clear"],youtube:["logo","video","play"],"zap-off":["flash","camera","lightning"],zap:["flash","camera","lightning"],"zoom-in":["magnifying glass"],"zoom-out":["magnifying glass"]}},"./src/to-svg.js":function(n,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=t("./src/icons.js"),r=o(i);function o(s){return s&&s.__esModule?s:{default:s}}function a(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."),!s)throw new Error("The required `key` (icon name) parameter is missing.");if(!r.default[s])throw new Error("No icon matching '"+s+"'. See the complete list of icons at https://feathericons.com");return r.default[s].toSvg(l)}e.default=a},0:function(n,e,t){t("./node_modules/core-js/es/array/from.js"),n.exports=t("./src/index.js")}})})});var Si=Ye(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.linkedQ=z.openOrSwitch=z.createNewMDNote=z.hoverPreview=z.isInVault=z.getSelectionFromCurrFile=z.getSelectionFromEditor=z.copy=z.getAvailablePathForAttachments=z.base64ToArrayBuffer=z.addFeatherIcon=z.addAllFeatherIcons=z.wait=void 0;var Mt=wi(),xe=require("obsidian");function Yr(n){return M(this,null,function*(){return new Promise(e=>setTimeout(e,n))})}z.wait=Yr;function Jr(n={viewBox:"0 0 24 24",width:"100",height:"100"}){Object.values(Mt.icons).forEach(e=>{let t=e.toSvg(n);(0,xe.addIcon)("feather-"+e.name,t)})}z.addAllFeatherIcons=Jr;function Kr(n,e={viewBox:"0 0 24 24",width:"100",height:"100"}){if(Mt.icons[n])(0,xe.addIcon)(`feather-${n}`,Mt.icons[n].toSvg(e));else throw Error(`This Icon (${n}) doesn't exist in the Feather Library.`)}z.addFeatherIcon=Kr;function Qr(n){let e=window.atob(n),t=e.length,i=new Uint8Array(t);for(let r=0;rnew xe.Notice("Copied to clipboard"),t=i=>{new xe.Notice("Could not copy to clipboard"),console.log({reason:i})}){return M(this,null,function*(){yield navigator.clipboard.writeText(n).then(e,t)})}z.copy=Zr;function eo(n){return n.somethingSelected()?n.getSelection():n.getValue()}z.getSelectionFromEditor=eo;function to(n,e=!0){return M(this,null,function*(){var i;let t=(i=window==null?void 0:window.getSelection())==null?void 0:i.toString();if(t)return t;{let r=n.workspace.getActiveFile();if(r instanceof xe.TFile)return e?yield n.vault.cachedRead(r):yield n.vault.read(r);new xe.Notice("You must be focused on a markdown file.")}})}z.getSelectionFromCurrFile=to;var no=(n,e,t="")=>!!n.metadataCache.getFirstLinkpathDest(e,t);z.isInVault=no;function io(n,e,t){let i=n.target;e.app.workspace.trigger("hover-link",{event:n,source:e.getViewType(),hoverParent:e,targetEl:i,linktext:t})}z.hoverPreview=io;function bi(n,e,t=""){return M(this,null,function*(){let i=n.fileManager.getNewFileParent(t).path;e.endsWith(".md")||(e+=".md");let r=(0,xe.normalizePath)(`${i}${i==="/"?"":"/"}${e}.md`);return yield n.vault.create(r,"")})}z.createNewMDNote=bi;function ro(r,o,a){return M(this,arguments,function*(n,e,t,i={createNewFile:!0}){let{workspace:s}=n,l=s.getActiveFile(),c=n.metadataCache.getFirstLinkpathDest(e,l.path);if(!c)if(i.createNewFile)c=yield bi(n,e,l.path);else return;let u=[];if(s.iterateAllLeaves(f=>{var p,y;f.view instanceof xe.MarkdownView&&((y=(p=f.view)==null?void 0:p.file)==null?void 0:y.basename)===e&&u.push(f)}),u.length>0)s.setActiveLeaf(u[0]);else{let f=n.vault.getConfig("defaultViewMode");yield(t.ctrlKey||t.getModifierState("Meta")?s.splitActiveLeaf():s.getUnpinnedLeaf()).openFile(c,{active:!0,mode:f})}})}z.openOrSwitch=ro;function oo(n,e,t){var i;return e.endsWith(".md")||(e+=".md"),t.endsWith(".md")||(t+=".md"),(i=n[e])==null?void 0:i.hasOwnProperty(t)}z.linkedQ=oo});var Ot=Ye(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.linkedQ=V.openOrSwitch=V.createNewMDNote=V.isInVault=V.hoverPreview=V.getSelectionFromEditor=V.getSelectionFromCurrFile=V.copy=V.wait=V.getAvailablePathForAttachments=V.base64ToArrayBuffer=V.addFeatherIcon=V.addAllFeatherIcons=void 0;var te=Si();Object.defineProperty(V,"addAllFeatherIcons",{enumerable:!0,get:function(){return te.addAllFeatherIcons}});Object.defineProperty(V,"addFeatherIcon",{enumerable:!0,get:function(){return te.addFeatherIcon}});Object.defineProperty(V,"base64ToArrayBuffer",{enumerable:!0,get:function(){return te.base64ToArrayBuffer}});Object.defineProperty(V,"getAvailablePathForAttachments",{enumerable:!0,get:function(){return te.getAvailablePathForAttachments}});Object.defineProperty(V,"wait",{enumerable:!0,get:function(){return te.wait}});Object.defineProperty(V,"copy",{enumerable:!0,get:function(){return te.copy}});Object.defineProperty(V,"getSelectionFromCurrFile",{enumerable:!0,get:function(){return te.getSelectionFromCurrFile}});Object.defineProperty(V,"getSelectionFromEditor",{enumerable:!0,get:function(){return te.getSelectionFromEditor}});Object.defineProperty(V,"hoverPreview",{enumerable:!0,get:function(){return te.hoverPreview}});Object.defineProperty(V,"isInVault",{enumerable:!0,get:function(){return te.isInVault}});Object.defineProperty(V,"createNewMDNote",{enumerable:!0,get:function(){return te.createNewMDNote}});Object.defineProperty(V,"openOrSwitch",{enumerable:!0,get:function(){return te.openOrSwitch}});Object.defineProperty(V,"linkedQ",{enumerable:!0,get:function(){return te.linkedQ}})});Cr(exports,{default:()=>Bt});var le=G(require("obsidian"));function Gt(n,e){let t=-1,i=!1;if(e.toUpperCase()===e)return n.toUpperCase();if(e.toLowerCase()===e)return n.toLowerCase();for(;++tFeather Icons':'Diese Erweiterung verwendet Feather Icons',Clear:"Eingabe l\xF6schen","Change Language":"Sprache \xE4ndern","Change Provider":"API \xE4ndern","Collapse Results":"Ergebnisse ausklappen","Enter a word":"Gebe ein Wort ein",Pronunciation:"Aussprache",Meanings:"Bedeutungen",Origin:"Ursprung","New Note":"Neue Notiz","Match Case":"Match Case","View Error":"Fehler anzeigen",'Copied "{{word}}" to clipboard':'"{{word}}" wurde in die Zwischenablage kopiert',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"Ich kann das Wort nicht finden oder der Server kann nicht erreicht werden. Bitte probiere es in eingigen Minuten nocheinmal.","Definition:":"Definition:","Synonyms:":"Synonyme:","Antonyms:":"Antonyme:","Choose a Definition Provider Service":"API f\xFCr Definitionen ausw\xE4hlen","Choose a Language":"Sprache ausw\xE4hlen","Choose a Synonym Provider Service":"API f\xFCr Synonyme ausw\xE4hlen"};var ft={"Open Dictionary View":"Open Dictionary View","Open Language Switcher":"Open Language Switcher",Dictionary:"Dictionary",Cut:"Cut",Copy:"Copy",Paste:"Paste","Show Synonyms":"Show Synonyms","Look up":"Look up","Reset to default":"Reset to default","Dictionary Settings":"Dictionary Settings",Language:"Language","The Language the Plugin will use to search for Definitions and Pronunciations.":"The Language the Plugin will use to search for Definitions and Pronunciations.","Synonym Suggestions":"Synonym Suggestions","Show synonyms for highlighted words":"Show synonyms for highlighted words","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.","Click ":"Click ",here:"here"," for Privacy Concerns.":" for Privacy Concerns.","Advanced Synonym Search":"Advanced Synonym Search","Show Options in Context Menu":"Show Options in Context Menu","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar.","Click Here":"Click Here","Definition Provider":"Definition Provider","The API the Plugin will use to search for Definitions.":"The API the Plugin will use to search for Definitions.","Synonym Provider":"Synonym Provider","The API the Plugin will use to search for Synonyms.":"The API the Plugin will use to search for Synonyms.","More Information":"More Information","View Information about the API's and the Plugin itself.":"View Information about the API's and the Plugin itself.","More Info":"More Info",Donate:"Donate","If you like this Plugin, consider donating to support continued development:":"If you like this Plugin, consider donating to support continued development:","Local Dictionary Folder":"Local Dictionary Folder","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.","Capitalize File Name":"Capitalize File Name","If you disable this, the names of newly created files will be all lowercase.":"If you disable this, the names of newly created files will be all lowercase.","Filename Prefix and Suffix":"Filename Prefix and Suffix","Here you can add a Prefix and Suffix for your newly created Files.":"Here you can add a Prefix and Suffix for your newly created Files. You can use the {{lang}} variable here.",Prefix:"Prefix",Suffix:"Suffix","Here you can edit the Template for newly created Files.":"Here you can edit the Template for newly created Files.","Click for a List of Variables":"Click for a List of Variables",Template:"Template","Local-Dictionary-Builder Settings":"Local-Dictionary-Builder Settings",Miscellaneous:"Miscellaneous","Caching Settings":"Caching Settings","Use Caching":"Use Caching","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.","Here you can delete all cached Data.":"Here you can delete all cached Data.","You currently have ":"You currently have "," cached Definitions and ":" cached Definitions and "," cached Synonyms.":" cached Synonyms.","Delete Cache":"Delete Cache",Delete:"Delete",Success:"Success","Use Language specific Subfolders":"Use Language specific Subfolders",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"Autogenerated by Obsidian Dictionary Plugin","Yes, overwrite the old File.":"Yes, overwrite the old File.","A existing File with the same Name was found, do you want to overwrite it?":"A existing File with the same Name was found, do you want to overwrite it?","No, keep the old File.":"No, keep the old File.","Meaning {{i}}":"Meaning {{i}}","API Information":"API Information","Definition API's":"Definition API's",Website:"Website","Synonym API's":"Synonym API's","Part of Speech API's":"Part of Speech API's",'This Plugin is using Feather Icons':'This Plugin is using Feather Icons',"Enter a word":"Enter a word",Clear:"Clear","Change Language":"Change Language","Change Provider":"Change Provider","Collapse Results":"Collapse Results",Pronunciation:"Pronunciation",Meanings:"Meanings",Origin:"Origin","New Note":"New Note","View Error":"View Error","Match Case":"Match Case",'Copied "{{word}}" to clipboard':'Copied "{{word}}" to clipboard',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.","Definition:":"Definition:","Synonyms:":"Synonyms:","Antonyms:":"Antonyms:","Choose a Definition Provider Service":"Choose a Definition Provider Service","Choose a Language":"Choose a Language","Choose a Synonym Provider Service":"Choose a Synonym Provider Service"};var Qt={};var Xt={"Open Dictionary View":"Abrir vista de Diccionario","Open Language Switcher":"Abrir Selector de Idioma",Dictionary:"Diccionario",Cut:"Cortar",Copy:"Copiar",Paste:"Pegar","Show Synonyms":"Mostrar Sin\xF3nimos","Look up":"Buscar","Reset to default":"Resetear a configuraci\xF3n por defecto","Dictionary Settings":"Configuraci\xF3n del Diccionario",Language:"Idioma","The Language the Plugin will use to search for Definitions and Pronunciations.":"El Idioma que el Plugin usar\xE1 para buscar Definiciones y Pronunciaciones.","Synonym Suggestions":"Sugerencias de Sin\xF3nimos","Show synonyms for highlighted words":"Mostrar sin\xF3nimos para palabras resaltadas","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"Activar esto habilitar\xE1 al plugin para analizar frases enteras para sugerir mejores sin\xF3nimos bas\xE1ndose en el contexto.","Click ":"Click ",here:"aqu\xED"," for Privacy Concerns.":" for Privacy Concerns.","Advanced Synonym Search":"B\xFAsqueda Avanzada de Sin\xF3nimos","Show Options in Context Menu":"Mostrar opciones en el Men\xFA Contextual","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"Habilitar el Men\xFA Contextual personalizado con opciones para buscar sin\xF3nimos (s\xF3lo si las sugerencias autom\xE1ticas est\xE1n deshabilitadas) y para buscar una definici\xF3n completa en la Barra Lateral.","Click Here":"Clica Aqu\xED","Definition Provider":"Proveedor de Definiciones","The API the Plugin will use to search for Definitions.":"La API que el Plugin utilizar\xE1 para buscar Definiciones.","Synonym Provider":"Proveedor de Sin\xF3nimos","The API the Plugin will use to search for Synonyms.":"La API que el Plugin utilizar\xE1 para buscar Sin\xF3nimos.","More Information":"M\xE1s Informaci\xF3n","View Information about the API's and the Plugin itself.":"Ver informaci\xF3n sobre la API y el propio Plugin.","More Info":"M\xE1s Info",Donate:"Donar","If you like this Plugin, consider donating to support continued development:":"Si te gusta este Plugin, considera donar para apoyar un desarrollo cont\xEDnuo:","Local Dictionary Folder":"Carpeta del Diccionario Local","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"Especifica una Carpeta, donde se encuentran todas las nuevas Notas creadas por el Diccionario. La Carpeta debe existir.","Capitalize File Name":"Capitaliar Nombre de Fichero","If you disable this, the names of newly created files will be all lowercase.":"Si desactivas esto, los nombres de nuevos ficheros estar\xE1n en min\xFAsculas.","Filename Prefix and Suffix":"Prefijo y Sufijo del Nombre del Fichero","Here you can add a Prefix and Suffix for your newly created Files.":"Aqu\xED puedes a\xF1adir un Prefijo y un Sufijo para los nuevos Ficheros creados. Puedes utilizar la variable {{lang}}.",Prefix:"Prefijo",Suffix:"Sufijo","Here you can edit the Template for newly created Files.":"Aqu\xED puedes editar la Plantilla nuevos Ficheros","Click for a List of Variables":"Clica para una Lista de Variables",Template:"Plantilla","Local-Dictionary-Builder Settings":"Configuraci\xF3n del Builder del Diccionario Local",Miscellaneous:"Miscel\xE1neo","Caching Settings":"Cach\xE9 de Configuraciones","Use Caching":"Utilizar Cach\xE9","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"Activar o desactivar Cach\xE9. La memoria Cach\xE9 proporciona una experiencia semi-offline al guardar cada resultado para utilizarlo m\xE1s tarde.","Here you can delete all cached Data.":"Aqu\xED puedes borrar todos los datos en Cach\xE9.","You currently have ":"Actualmente tienes "," cached Definitions and ":" Definiciones y "," cached Synonyms.":" Sin\xF3nimos en Cach\xE9.","Delete Cache":"Borrar Cach\xE9",Delete:"Borrar",Success:"\xC9xito","Use Language specific Subfolders":"Utilizar Subcarpetas por cada Idioma",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'Crear una Subcarpeta por cada Idioma. P.E.: "Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"Autogenerado por Obsidian Dictionary Plugin","Yes, overwrite the old File.":"S\xED, sobreescribir el fichero antig\xFCo.","A existing File with the same Name was found, do you want to overwrite it?":"Se ha encontrado un Fichero con el mismo nombre. \xBFDesea sobreescribirlo?","No, keep the old File.":"No, conservar el Fichero antig\xFCo.","Meaning {{i}}":"Significa {{i}}","API Information":"Informaci\xF3n de la API","Definition API's":"API de Definiciones",Website:"P\xE1gina Web","Synonym API's":"API de Sin\xF3nimos","Part of Speech API's":"Part of Speech API's",'This Plugin is using Feather Icons':'Este Plugin utiliza Feather Icons',"Enter a word":"Introduce una palabra",Clear:"Limpiar","Change Language":"Cambiar Idioma","Change Provider":"Cambiar Proveedor","Collapse Results":"Colapsar Resultados",Pronunciation:"Pronunciaci\xF3n",Meanings:"Significados",Origin:"Etimolog\xEDa","New Note":"Nueva Nota","View Error":"Ver Error","Match Case":"Match Case",'Copied "{{word}}" to clipboard':'"{{word}}" copiada al portapapeles',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"No puedo encontrar la palabra que buscas, o bien no se puede contactar con el servidor. Vuelve a intentarlo dentro de unos minutos.","Definition:":"Definici\xF3n:","Synonyms:":"Sin\xF3nimos:","Antonyms:":"Ant\xF3nimos:","Choose a Definition Provider Service":"Elige un Servicio de Provisi\xF3n de Definiciones","Choose a Language":"Elige un Idioma","Choose a Synonym Provider Service":"Elige un Servicio de Provisi\xF3n de Sin\xF3nimos"};var Zt={};var en={};var tn={};var nn={"Open Dictionary View":"Apri la schermata del dizionario","Open Language Switcher":"Apri le impostazioni della lingua",Dictionary:"Dizionario",Cut:"Taglia",Copy:"Copia",Paste:"Incolla","Show Synonyms":"Mostra i sinonimi","Look up":"Cerca","Reset to default":"Resetta le impostazioni","Dictionary Settings":"Impostazioni del dizionario",Language:"Lingua","The Language the Plugin will use to search for Definitions and Pronunciations.":"La lingua che il plugin utilizzar\xE0 per cercare le definizioni e la pronuncia.","Synonym Suggestions":"Suggerisci sinonimi","Show synonyms for highlighted words":"Mostra i sinonimi per le parole evidenziate","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"Attivando questa opzione il plugin analizzar\xE0 l'intera frase per migliorare il suggerimento dei sinonimi basati sul contesto.","Click ":"Clicca ",here:"qui"," for Privacy Concerns.":" for Privacy Concerns.","Advanced Synonym Search":"Ricerca sinonimi avanzata","Show Options in Context Menu":"Mostra le opzioni nel menu contestuale","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"Abilita i menucontestuali personalizzati con le opzioni di ricerca dei sinonimi (solo se i suggerimenti automatici sono disattivati) e cerca una definizione intera nella barra laterale. Attenzione: questa opzione sovrascriver\xE0 il menu contestuale di default di Obsidian.","Click Here":"Clicca qui","Definition Provider":"Provider di definizioni","The API the Plugin will use to search for Definitions.":"Le API utilizzate dal plugin per cercare le definizioni.","Synonym Provider":"Provider di sinonimi","The API the Plugin will use to search for Synonyms.":"Le API utilizzate dal plugin per cercare i sinonimi.","More Information":"Altre informazioni","View Information about the API's and the Plugin itself.":"Vai alle informazioni riguardanti le API e il plugin.","More Info":"Altre informazioni",Donate:"Dona","If you like this Plugin, consider donating to support continued development:":"Se ti piace il plugin, considera di donare per sostenere lo sviluppo","Local Dictionary Folder":"Cartella locale del dizionario","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"Specifica una cartella dove inserire tutte le note create dal dizionario. Fai attenzione che questa cartella deve gi\xE0 esistere.","Capitalize File Name":"Rendi il nome del file maiuscolo","If you disable this, the names of newly created files will be all lowercase.":"Se disabiliti questa opzione i nomi dei file creati saranno tutti in minuscolo.","Filename Prefix and Suffix":"Suffisso e prefisso del nome del file","Here you can add a Prefix and Suffix for your newly created Files.":"Qui puoi aggiungere un prefisso e un suffisso per i nuovi file creati. Puoi usare la variabile {{lang}} qui.",Prefix:"Prefisso",Suffix:"Suffisso","Here you can edit the Template for newly created Files.":"Qui puoi modificare il template dei nuovi file creati.","Click for a List of Variables":"Clicca per vedere la lista delle variabili",Template:"Template","Local-Dictionary-Builder Settings":"Impostazioni del dizionario locale",Miscellaneous:"Altre","Caching Settings":"Impostazioni di caching","Use Caching":"Usa il caching","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"Attiva o disattiva la cache. La cache fornisce un'esperienza offline tramite il salvataggio di ogni risultato per un uso successivo.","Here you can delete all cached Data.":"Qui puoi cancellare tutti i dati nella cache.","You currently have ":"Al momento ci sono "," cached Definitions and ":" definizioni nella cache e "," cached Synonyms.":" sinonimi nella cache.","Delete Cache":"Cancella la cache",Delete:"Elimina",Success:"Operazione avvenuta con successo","Use Language specific Subfolders":"Usa cartelle specifiche per la lingua",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'Crea cartelle specifiche per ogni lingua, ad esempio "Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"Generate in automatico da Obsidian Dictionary Plugin","Yes, overwrite the old File.":"Si, sovrascrivi i vecchi file.","A existing File with the same Name was found, do you want to overwrite it?":"\xC8 stato trovato un file con lo stesso nome, lo vuoi sovrascrivere?","No, keep the old File.":"No, mantieni il vecchio file.","Meaning {{i}}":"Significato {{i}}","API Information":"Informazioni API","Definition API's":"Definizioni API",Website:"Sito web","Synonym API's":"API dei sinonimi","Part of Speech API's":"API per la parte parlata",'This Plugin is using Feather Icons':'Questo plugin sta usando Feather Icons',"Enter a word":"Inserisci una parola",Clear:"Cancella","Change Language":"Cambia lingua","Change Provider":"Cambia provider","Collapse Results":"Comprimi i risultati",Pronunciation:"Pronuncia",Meanings:"Significati",Origin:"Origini","New Note":"Nuova nota","View Error":"Vedi gli errori","Match Case":"Match Case",'Copied "{{word}}" to clipboard':'"{{word}}" copiato negli appunti',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"Non posso trovare le parole che stai cercando o il server non \xE8 raggiungibile. Riprova tra qualche minuto.","Definition:":"Definizione:","Synonyms:":"Sinonimi:","Antonyms:":"Contrari:","Choose a Definition Provider Service":"Scegli un provider di definizioni","Choose a Language":"Scegli una lingua","Choose a Synonym Provider Service":"Scegli un provider di sinonimi"};var rn={"Open Dictionary View":"\u8F9E\u66F8\u3092\u958B\u304F","Open Language Switcher":"\u8A00\u8A9E\u30B9\u30A4\u30C3\u30C1\u30E3\u30FC\u3092\u958B\u304F",Dictionary:"\u8F9E\u66F8",Cut:"\u30AB\u30C3\u30C8",Copy:"\u30B3\u30D4\u30FC",Paste:"\u30DA\u30FC\u30B9\u30C8","Show Synonyms":"\u540C\u7FA9\u8A9E\u3092\u8868\u793A","Look up":"\u8F9E\u66F8\u3067\u691C\u7D22","Reset to default":"\u30C7\u30D5\u30A9\u30EB\u30C8\u306B\u30EA\u30BB\u30C3\u30C8\u3059\u308B","Dictionary Settings":"\u8F9E\u66F8\u8A2D\u5B9A",Language:"\u8A00\u8A9E","The Language the Plugin will use to search for Definitions and Pronunciations.":"\u8A9E\u7FA9\u3068\u767A\u97F3\u306E\u691C\u7D22\u306B\u4F7F\u7528\u3059\u308B\u8A00\u8A9E\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002","Synonym Suggestions":"\u540C\u7FA9\u8A9E\u306E\u30B5\u30B8\u30A7\u30B9\u30C8","Show synonyms for highlighted words":"\u30CF\u30A4\u30E9\u30A4\u30C8\u3055\u308C\u305F\u5358\u8A9E\u306E\u540C\u7FA9\u8A9E\u3092\u8868\u793A\u3057\u307E\u3059\u3002","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u5316\u3059\u308B\u3068\u3001\u6587\u7AE0\u306E\u5B8C\u5168\u89E3\u6790\u3068\u305D\u306E\u5185\u5BB9\u306B\u57FA\u3065\u3044\u305F\u540C\u7FA9\u8A9E\u306E\u30B5\u30B8\u30A7\u30B9\u30C8\u3092\u884C\u3044\u307E\u3059\u3002","Click ":"\u30AF\u30EA\u30C3\u30AF ",here:"\u3053\u308C"," for Privacy Concerns.":" \u30D7\u30E9\u30A4\u30D0\u30B7\u30FC\u306B\u3064\u3044\u3066","Advanced Synonym Search":"\u9AD8\u5EA6\u306A\u540C\u7FA9\u8A9E\u691C\u7D22","Show Options in Context Menu":"\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30E1\u30CB\u30E5\u30FC\u3067\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u8868\u793A","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"\u30AB\u30B9\u30BF\u30E0\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8\u30E1\u30CB\u30E5\u30FC\u3067\u306E\u540C\u7FA9\u8A9E\u691C\u7D22\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6709\u52B9\u5316\u3057\u307E\u3059\u3002(\u81EA\u52D5\u30B5\u30B8\u30A7\u30B9\u30C8\u304C\u7121\u52B9\u5316\u3055\u308C\u3066\u3044\u308B\u5834\u5408\u306E\u307F)\u30B5\u30A4\u30C9\u30D0\u30FC\u3067\u5B8C\u5168\u306A\u8A9E\u7FA9\u3092\u8ABF\u3079\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002","Click Here":"\u3053\u3053\u3092\u30AF\u30EA\u30C3\u30AF","Definition Provider":"\u8A9E\u7FA9\u30D7\u30ED\u30D0\u30A4\u30C0","The API the Plugin will use to search for Definitions.":"\u30D7\u30E9\u30B0\u30A4\u30F3\u304C\u8A9E\u7FA9\u306E\u691C\u7D22\u306B\u4F7F\u7528\u3059\u308BAPI\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002","Synonym Provider":"\u540C\u7FA9\u8A9E\u30D7\u30ED\u30D0\u30A4\u30C0","The API the Plugin will use to search for Synonyms.":"\u30D7\u30E9\u30B0\u30A4\u30F3\u304C\u540C\u7FA9\u8A9E\u306E\u691C\u7D22\u306B\u4F7F\u7528\u3059\u308BAPI\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002","More Information":"\u8A73\u3057\u3044\u60C5\u5831","View Information about the API's and the Plugin itself.":"API\u3068\u30D7\u30E9\u30B0\u30A4\u30F3\u306B\u3064\u3044\u3066\u306E\u60C5\u5831\u3092\u95B2\u89A7\u3067\u304D\u307E\u3059\u3002","More Info":"\u66F4\u306B\u8A73\u3057\u304F",Donate:"\u5BC4\u4ED8\u3059\u308B","If you like this Plugin, consider donating to support continued development:":"\u3053\u306E\u30D7\u30E9\u30B0\u30A4\u30F3\u304C\u6C17\u306B\u5165\u3063\u305F\u5834\u5408\u306B\u306F\u3001\u7D99\u7D9A\u7684\u306A\u958B\u767A\u306E\u30B5\u30DD\u30FC\u30C8\u306E\u305F\u3081\u306E\u5BC4\u4ED8\u3092\u691C\u8A0E\u3057\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002","Local Dictionary Folder":"\u30ED\u30FC\u30AB\u30EB\u8F9E\u66F8\u30D5\u30A9\u30EB\u30C0","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"\u8F9E\u66F8\u306B\u3088\u308A\u4F5C\u6210\u3055\u308C\u305F\u65B0\u898F\u30CE\u30FC\u30C8\u304C\u914D\u7F6E\u3055\u308C\u308B\u30D5\u30A9\u30EB\u30C0\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002\u3059\u3067\u306B\u5B58\u5728\u3059\u308B\u30D5\u30A9\u30EB\u30C0\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002","Capitalize File Name":"\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5927\u6587\u5B57\u304B\u3089\u59CB\u3081\u3066\u4F5C\u6210\u3059\u308B","If you disable this, the names of newly created files will be all lowercase.":"\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u5316\u3059\u308B\u3068\u65B0\u898F\u4F5C\u6210\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u540D\u306F\u3059\u3079\u3066\u5C0F\u6587\u5B57\u306B\u306A\u308A\u307E\u3059\u3002","Filename Prefix and Suffix":"\u30D5\u30A1\u30A4\u30EB\u540D\u306E\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u3068\u30B5\u30D5\u30A3\u30C3\u30AF\u30B9","Here you can add a Prefix and Suffix for your newly created Files.":"\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306F\u3001\u65B0\u898F\u4F5C\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u306B\u5BFE\u3057\u3066\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9\u307E\u305F\u306F\u30B5\u30D5\u30A3\u30C3\u30AF\u30B9\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002\u3053\u306E\u9805\u76EE\u3067\u306F{{lang}}\u5909\u6570\u3092\u4F7F\u7528\u3067\u304D\u307E\u3059\u3002",Prefix:"\u30D7\u30EC\u30D5\u30A3\u30C3\u30AF\u30B9",Suffix:"\u30B5\u30D5\u30A3\u30C3\u30AF\u30B9","Here you can edit the Template for newly created Files.":"\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306F\u65B0\u898F\u4F5C\u6210\u3055\u308C\u308B\u30D5\u30A1\u30A4\u30EB\u306B\u3064\u3044\u3066\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u7DE8\u96C6\u3067\u304D\u307E\u3059\u3002","Click for a List of Variables":"\u5909\u6570\u306E\u30EA\u30B9\u30C8\u3092\u95B2\u89A7\u3059\u308B",Template:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8","Local-Dictionary-Builder Settings":"\u30ED\u30FC\u30AB\u30EB\u8F9E\u66F8\u30D3\u30EB\u30C0\u30FC\u306E\u8A2D\u5B9A",Miscellaneous:"\u305D\u306E\u4ED6\u306E\u30AA\u30D7\u30B7\u30E7\u30F3","Caching Settings":"\u30AD\u30E3\u30C3\u30B7\u30E5\u306E\u8A2D\u5B9A","Use Caching":"\u30AD\u30E3\u30C3\u30B7\u30E5\u3092\u4F7F\u7528\u3059\u308B","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"\u30AD\u30E3\u30C3\u30B7\u30E5\u306E\u4F7F\u7528\u3092\u9078\u629E\u3067\u304D\u307E\u3059\u3002\u30AD\u30E3\u30C3\u30B7\u30E5\u3092\u6709\u52B9\u5316\u3059\u308B\u3068\u3059\u3079\u3066\u306E\u691C\u7D22\u7D50\u679C\u3092\u4FDD\u5B58\u3057\u3066\u304A\u304D\u3001\u5F8C\u304B\u3089\u30BB\u30DF\u30AA\u30D5\u30E9\u30A4\u30F3\u3067\u306E\u6A5F\u80FD\u63D0\u4F9B\u304C\u53EF\u80FD\u3067\u3059\u3002","Here you can delete all cached Data.":"\u3053\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3059\u3079\u3066\u306E\u30AD\u30E3\u30C3\u30B7\u30E5\u30C7\u30FC\u30BF\u3092\u524A\u9664\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002","You currently have ":"\u73FE\u5728\u3001\u6B21\u306E\u9805\u76EE\u3092\u30AD\u30E3\u30C3\u30B7\u30E5\u3057\u3066\u3044\u307E\u3059: "," cached Definitions and ":" \u8A9E\u7FA9 "," cached Synonyms.":" \u540C\u7FA9\u8A9E","Delete Cache":"\u30AD\u30E3\u30C3\u30B7\u30E5\u306E\u524A\u9664",Delete:"\u524A\u9664\u3059\u308B",Success:"\u6210\u529F\u3057\u307E\u3057\u305F","Use Language specific Subfolders":"\u7279\u5B9A\u8A00\u8A9E\u306E\u30B5\u30D6\u30D5\u30A9\u30EB\u30C0\u3092\u4F7F\u7528\u3059\u308B",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'\u6307\u5B9A\u306E\u8A00\u8A9E\u306B\u3064\u3044\u3066\u306E\u30B5\u30D6\u30D5\u30A9\u30EB\u30C0\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\u4F8B: "Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"Obsidian Dictionary Plugin\u306B\u3088\u3063\u3066\u81EA\u52D5\u751F\u6210\u3055\u308C\u3066\u3044\u307E\u3059","Yes, overwrite the old File.":"\u306F\u3044\u3001\u53E4\u3044\u30D5\u30A1\u30A4\u30EB\u3092\u4E0A\u66F8\u304D\u3057\u307E\u3059\u3002","A existing File with the same Name was found, do you want to overwrite it?":"\u540C\u4E00\u540D\u306E\u65E2\u5B58\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F\u3002\u65B0\u3057\u3044\u5185\u5BB9\u3067\u4E0A\u66F8\u304D\u3057\u307E\u3059\u304B\uFF1F","No, keep the old File.":"\u3044\u3044\u3048\u3001\u53E4\u3044\u30D5\u30A1\u30A4\u30EB\u306F\u4FDD\u5B58\u3057\u3066\u304F\u3060\u3055\u3044\u3002","Meaning {{i}}":"\u610F\u5473 {{i}}","API Information":"API\u306B\u3064\u3044\u3066\u306E\u60C5\u5831","Definition API's":"\u8A9E\u7FA9API",Website:"\u30A6\u30A7\u30D6\u30B5\u30A4\u30C8","Synonym API's":"\u540C\u7FA9\u8A9EAPI","Part of Speech API's":"\u54C1\u8A5EAPI",'This Plugin is using Feather Icons':'\u3053\u306E\u30D7\u30E9\u30B0\u30A4\u30F3\u306FFeather Icons\u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059',"Enter a word":"\u5358\u8A9E\u3092\u5165\u529B",Clear:"\u30AF\u30EA\u30A2","Change Language":"\u8A00\u8A9E\u3092\u5909\u66F4","Change Provider":"\u30D7\u30ED\u30D0\u30A4\u30C0\u3092\u5909\u66F4","Collapse Results":"\u7D50\u679C\u3092\u5C55\u958B",Pronunciation:"\u767A\u97F3",Meanings:"\u610F\u5473",Origin:"\u8A9E\u6E90","New Note":"\u65B0\u898F\u30CE\u30FC\u30C8","View Error":"\u30A8\u30E9\u30FC\u3092\u8868\u793A","Match Case":"\u5927\u6587\u5B57/\u5C0F\u6587\u5B57\u3092\u533A\u5225",'Copied "{{word}}" to clipboard':'"{{word}}"\u3092\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u306B\u30B3\u30D4\u30FC\u3057\u307E\u3057\u305F',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"\u63A2\u3057\u3066\u3044\u308B\u5358\u8A9E\u304C\u898B\u3064\u304B\u3089\u306A\u3044\u304B\u3001\u30B5\u30FC\u30D0\u30FC\u304C\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002\u6570\u5206\u7ACB\u3063\u3066\u304B\u3089\u30EA\u30C8\u30E9\u30A4\u3057\u3066\u304F\u3060\u3055\u3044\u3002","Definition:":"\u8A9E\u7FA9:","Synonyms:":"\u540C\u7FA9\u8A9E:","Antonyms:":"\u53CD\u610F\u8A9E:","Choose a Definition Provider Service":"\u5B9A\u7FA9\u306E\u30D7\u30ED\u30D0\u30A4\u30C0\u30B5\u30FC\u30D3\u30B9\u3092\u9078\u629E","Choose a Language":"\u8A00\u8A9E\u3092\u9078\u629E","Choose a Synonym Provider Service":"\u540C\u7FA9\u8A9E\u306E\u30D7\u30ED\u30D0\u30A4\u30C0\u30B5\u30FC\u30D3\u30B9\u3092\u9078\u629E"};var on={"Open Dictionary View":"\uC0AC\uC804 \uBCF4\uAE30 \uC5F4\uAE30","Open Language Switcher":"\uC5B8\uC5B4 \uC804\uD658 \uC5F4\uAE30",Dictionary:"\uC0AC\uC804",Cut:"\uC798\uB77C\uB0B4\uAE30",Copy:"\uBCF5\uC0AC",Paste:"\uBD99\uC5EC\uB123\uAE30","Show Synonyms":"\uC720\uC758\uC5B4 \uD45C\uC2DC","Look up":"\uCC3E\uAE30","Reset to default":"\uAE30\uBCF8\uAC12\uC73C\uB85C \uC7AC\uC124\uC815","Dictionary Settings":"\uC0AC\uC804 \uC124\uC815",Language:"\uC5B8\uC5B4","The Language the Plugin will use to search for Definitions and Pronunciations.":"\uC0AC\uC804 \uC815\uC758 \uBC0F \uBC1C\uC74C \uAC80\uC0C9\uC744 \uC704\uD55C \uC5B8\uC5B4\uC785\uB2C8\uB2E4.","Synonym Suggestions":"\uC720\uC758\uC5B4 \uC81C\uC548","Show synonyms for highlighted words":"\uAC15\uC870\uB41C \uB2E8\uC5B4\uC758 \uC720\uC758\uC5B4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"\uD65C\uC131\uD654 \uC2DC \uC804\uCCB4 \uBB38\uC7A5\uC744 \uBD84\uC11D\uD558\uC5EC \uCEE8\uD14D\uC2A4\uD2B8\uB97C \uAE30\uBC18\uC73C\uB85C \uC720\uC758\uC5B4\uB97C \uB354 \uC798 \uC81C\uC548\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","Click ":"Click ",here:"here"," for Privacy Concerns.":" for Privacy Concerns.","Advanced Synonym Search":"\uACE0\uAE09 \uC720\uC758\uC5B4 \uAC80\uC0C9","Show Options in Context Menu":"\uC0C1\uD669\uC5D0 \uB9DE\uB294 \uBA54\uB274 \uD45C\uC2DC","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"\uC790\uB3D9 \uC81C\uC548\uC774 \uBE44\uD65C\uC131\uD654\uB41C \uACBD\uC6B0\uC5D0\uB9CC \uB3D9\uC758\uC5B4\uB97C \uAC80\uC0C9\uD558\uACE0 \uC0AC\uC774\uB4DC\uBC14\uC5D0\uC11C \uC804\uCCB4 \uC815\uC758\uB97C \uC870\uD68C\uD558\uB294 \uB9DE\uCDA4 \uCEE8\uD14D\uC2A4\uD2B8 \uBA54\uB274\uB97C \uD65C\uC131\uD654\uD569\uB2C8\uB2E4.","Click Here":"\uC5EC\uAE30\uB97C \uD074\uB9AD\uD558\uC138\uC694.","Definition Provider":"\uC0AC\uC804 \uC815\uC758 \uC81C\uACF5\uC790","The API the Plugin will use to search for Definitions.":"\uC0AC\uC804 \uC815\uC758 \uAC80\uC0C9\uC5D0 \uC0AC\uC6A9\uD560 API","Synonym Provider":"\uC720\uC758\uC5B4 \uC81C\uACF5\uC790","The API the Plugin will use to search for Synonyms.":"\uC720\uC758\uC5B4 \uAC80\uC0C9\uC5D0 \uC0AC\uC6A9\uD560 API","More Information":"More Information","View Information about the API's and the Plugin itself.":"API \uBC0F \uD50C\uB7EC\uADF8\uC778 \uB300\uD55C \uC815\uBCF4\uB97C \uBD05\uB2C8\uB2E4.","More Info":"\uB354\uBCF4\uAE30",Donate:"\uAE30\uBD80","If you like this Plugin, consider donating to support continued development:":"\uC774 \uD50C\uB7EC\uADF8\uC778\uC774 \uB9D8\uC5D0\uB4E0\uB2E4\uBA74 \uC9C0\uC18D\uC801\uC73C\uB85C \uAC1C\uBC1C\uD560 \uC218 \uC788\uB3C4\uB85D \uAE30\uBD80\uD574 \uC8FC\uC138\uC694.","Local Dictionary Folder":"\uB85C\uCEEC \uC0AC\uC804 \uD3F4\uB354","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"\uC0AC\uC804\uC774 \uB9CC\uB4E4\uC5B4\uC9C8 \uD3F4\uB354\uB97C \uC9C0\uC815\uD558\uC138\uC694. \uCC38\uACE0\uB85C \uC774 \uD3F4\uB354\uB294 \uC0AC\uC804\uC5D0 \uB9CC\uB4E4\uC5B4\uC838 \uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4.","Capitalize File Name":"\uB300\uBB38\uC790 \uD30C\uC77C\uBA85","If you disable this, the names of newly created files will be all lowercase.":"\uBE44\uD65C\uC131\uD654 \uC2DC \uC0C8\uB85C \uC791\uC131\uB41C \uD30C\uC77C\uBA85\uC740 \uC18C\uBB38\uC790\uB85C \uC791\uC131\uB429\uB2C8\uB2E4.","Filename Prefix and Suffix":"\uD30C\uC77C\uBA85 \uC811\uB450\uC0AC \uBC0F \uC811\uBBF8\uC5B4","Here you can add a Prefix and Suffix for your newly created Files.":"\uC0C8\uB85C \uB9CC\uB4E4\uC5B4\uC9C4 \uD30C\uC77C\uC758 \uC811\uB450\uC0AC \uBC0F \uC811\uBBF8\uC5B4\uB97C \uCD94\uAC00\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. {{lang}} \uBCC0\uC218\uB97C \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",Prefix:"\uC811\uB450\uC0AC",Suffix:"\uC811\uBBF8\uC5B4","Here you can edit the Template for newly created Files.":"\uC0C8\uB85C \uB9CC\uB4E4\uC5B4\uC9C4 \uD30C\uC77C\uC758 \uD15C\uD50C\uB9BF\uC744 \uC218\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","Click for a List of Variables":"\uBCC0\uC218 \uBAA9\uB85D \uBCF4\uB7EC\uAC00\uAE30",Template:"\uD15C\uD50C\uB9BF","Local-Dictionary-Builder Settings":"Local-Dictionary-Builder \uC124\uC815",Miscellaneous:"\uAE30\uD0C0","Caching Settings":"\uCE90\uC2F1 \uC124\uC815","Use Caching":"\uCE90\uC2F1 \uC0AC\uC6A9","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"\uCE90\uC2F1\uC744 \uD65C\uC131\uD654\uD558\uAC70\uB098 \uBE44\uD65C\uC131\uD654\uD569\uB2C8\uB2E4. \uCE90\uC2F1\uC740 \uB098\uC911\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC788\uB3C4\uB85D \uBAA8\uB4E0 \uACB0\uACFC\uB97C \uC800\uC7A5\uD558\uC5EC \uC138\uBBF8 \uC624\uD504\uB77C\uC778 \uD658\uACBD\uC744 \uC81C\uACF5\uD569\uB2C8\uB2E4.","Here you can delete all cached Data.":"\uCE90\uC2DC\uB41C \uB370\uC774\uD130\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","You currently have ":"\uD604\uC7AC "," cached Definitions and ":"\uAC1C\uC758 \uCE90\uC26C\uB41C \uC0AC\uC804\uC815\uC758 \uBC0F "," cached Synonyms.":"\uAC1C\uC758 \uCE90\uC26C\uB41C \uC720\uC758\uC5B4\uAC00 \uC788\uC2B5\uB2C8\uB2E4.","Delete Cache":"\uCE90\uC26C \uC0AD\uC81C",Delete:"\uC0AD\uC81C",Success:"\uC131\uACF5","Use Language specific Subfolders":"\uC5B8\uC5B4\uBCC4 \uD558\uC704 \uD3F4\uB354 \uC0AC\uC6A9",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'\uC5B8\uC5B4\uBCC4\uB85C \uD558\uC704 \uD3F4\uB354\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4. \uC608) "Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"Obsidian \uC0AC\uC804 \uD50C\uB7EC\uADF8\uC778\uC5D0 \uC758\uD574 \uC790\uB3D9 \uC0DD\uC131","Yes, overwrite the old File.":"\uB124, \uC774\uC804 \uD30C\uC77C\uC744 \uB36E\uC5B4\uC501\uB2C8\uB2E4.","A existing File with the same Name was found, do you want to overwrite it?":"\uB3D9\uC77C\uD55C \uC774\uB984\uC758 \uAE30\uC874 \uD30C\uC77C\uC744 \uCC3E\uC558\uC2B5\uB2C8\uB2E4. \uB36E\uC5B4\uC4F0\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?","No, keep the old File.":"\uC544\uB2C8\uC694, \uC774\uC804 \uD30C\uC77C\uC744 \uC720\uC9C0\uD569\uB2C8\uB2E4.","Meaning {{i}}":"\uC758\uBBF8 {{i}}","API Information":"API \uC815\uBCF4","Definition API's":"\uC0AC\uC804 \uC815\uC758 API",Website:"\uC6F9\uC0AC\uC774\uD2B8","Synonym API's":"\uC720\uC758\uC5B4 API","Part of Speech API's":"\uC74C\uC131 API",'This Plugin is using Feather Icons':'\uC774 \uD50C\uB7EC\uADF8\uC778\uC740 Feather Icons\uC744 \uC0AC\uC6A9\uD569\uB2C8\uB2E4.',"Enter a word":"\uB2E8\uC5B4\uB97C \uC785\uB825\uD558\uC138\uC694.",Clear:"Clear","Change Language":"\uC5B8\uC5B4 \uBCC0\uACBD","Change Provider":"Change Provider","Collapse Results":"\uACB0\uACFC \uC811\uAE30",Pronunciation:"\uBC1C\uC74C",Meanings:"\uC758\uBBF8",Origin:"\uAE30\uC6D0","New Note":"\uC2E0\uADDC \uB178\uD2B8","View Error":"\uC624\uB958 \uBCF4\uAE30","Match Case":"\uB300\uC18C\uBB38\uC790 \uAD6C\uBD84",'Copied "{{word}}" to clipboard':'"{{word}}"\uB97C \uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uB418\uC5C8\uC2B5\uB2C8\uB2E4.',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"\uB2E8\uC5B4\uB97C \uCC3E\uC744 \uC218 \uC5C6\uAC70\uB098 \uC11C\uBC84\uAC00 \uC5F0\uACB0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uC7A0\uC2DC \uD6C4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uBCF4\uC138\uC694.","Definition:":"\uC0AC\uC804 \uC815\uC758 :","Synonyms:":"\uC720\uC758\uC5B4:","Antonyms:":"\uBC18\uC758\uC5B4:","Choose a Definition Provider Service":"\uC0AC\uC804 \uC815\uC758 \uC81C\uACF5 \uC11C\uBE44\uC2A4\uB97C \uC120\uD0DD\uD558\uC138\uC694.","Choose a Language":"\uC5B8\uC5B4\uB97C \uC120\uD0DD\uD558\uC138\uC694.","Choose a Synonym Provider Service":"\uC720\uC758\uC5B4 \uC81C\uACF5 \uC11C\uBE44\uC2A4\uB97C \uC120\uD0DD\uD558\uC138\uC694."};var an={};var sn={};var ln={};var cn={"Open Dictionary View":"Abrir Vista do Dicion\xE1rio","Open Language Switcher":"Abrir Selector de L\xEDngua",Dictionary:"Dicion\xE1rio",Cut:"Cortar",Copy:"Copiar",Paste:"Colar","Show Synonyms":"Mostrar Sin\xF3nimos","Look up":"Procurar","Reset to default":"Reinicializa\xE7\xE3o por defeito","Dictionary Settings":"Configura\xE7\xF5es de Dicion\xE1rio",Language:"L\xEDngua","The Language the Plugin will use to search for Definitions and Pronunciations.":"A L\xEDngua que o Plugin utilizar\xE1 para pesquisar Defini\xE7\xF5es e Pron\xFAncias.","Synonym Suggestions":"Sugest\xF5es de Sin\xF3nimos","Show synonyms for highlighted words":"Mostrar sin\xF3nimos para palavras em destaque","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"A habilita\xE7\xE3o permitir\xE1 ao Plugin analisar as frases completas para melhor sugerir sin\xF3nimos com base no contexto.","Click ":"Clicar ",here:"aqui"," for Privacy Concerns.":" por Quest\xF5es de Privacidade.","Advanced Synonym Search":"Pesquisa Avan\xE7ada de Sin\xF3nimos","Show Options in Context Menu":"Mostrar Op\xE7\xF5es no Menu de Contexto","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"Permitir Menu de Contexto personalizado com op\xE7\xF5es para procurar sin\xF3nimos (apenas se as sugest\xF5es autom\xE1ticas estiverem desactivadas) e procurar uma defini\xE7\xE3o completa na Barra Lateral. Advert\xEAncia: Isto substituir\xE1 o Menu de Contexto padr\xE3o da Obsidian.","Click Here":"Clicar Aqui","Definition Provider":"Provedor de Defini\xE7\xF5es","The API the Plugin will use to search for Definitions.":"O API que o Plugin utilizar\xE1 para pesquisar Defini\xE7\xF5es.","Synonym Provider":"Provedor de Sin\xF3nimos","The API the Plugin will use to search for Synonyms.":"O API que o Plugin utilizar\xE1 para procurar Sin\xF3nimos.","More Information":"Mais Informa\xE7\xF5es","View Information about the API's and the Plugin itself.":"Ver Informa\xE7\xE3o sobre as API's e o pr\xF3prio Plugin.","More Info":"Mais Info",Donate:"Doar","If you like this Plugin, consider donating to support continued development:":"Se gostar deste Plugin, considere fazer uma doa\xE7\xE3o para apoiar o desenvolvimento cont\xEDnuo:","Local Dictionary Folder":"Pasta de Dicion\xE1rios Local","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"Especificar uma Pasta, onde todas as novas Notas criadas pelo Dicion\xE1rio s\xE3o colocadas. \xC9 favor notar que esta Pasta j\xE1 deve existir.","Capitalize File Name":"Capitalizar Nome do Ficheiro","If you disable this, the names of newly created files will be all lowercase.":"Se desactivar isto, os nomes dos ficheiros rec\xE9m-criados ser\xE3o todos em min\xFAsculas.","Filename Prefix and Suffix":"Prefixo e Sufixo do Nome do Ficheiro","Here you can add a Prefix and Suffix for your newly created Files.":"Aqui pode adicionar um Prefixo e Sufixo para os seus Ficheiros recentemente criados. Pode utilizar a vari\xE1vel {{lang}} aqui.",Prefix:"Prefixo",Suffix:"Sufixo","Here you can edit the Template for newly created Files.":"Aqui pode editar o Template para Ficheiros rec\xE9m-criados.","Click for a List of Variables":"Clique para uma Lista de Vari\xE1veis",Template:"Template","Local-Dictionary-Builder Settings":"Configura\xE7\xF5es do Local-Dictionary-Builder",Miscellaneous:"Miscel\xE2neos","Caching Settings":"Configura\xE7\xF5es de Caching","Use Caching":"Usar Caching","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"Activar ou desactivar o caching. O caching proporciona uma experi\xEAncia semi-offline ao guardar todos os resultados para utiliza\xE7\xE3o posterior.","Here you can delete all cached Data.":"Aqui pode apagar todos os dados armazenados em cache.","You currently have ":"Actualmente tem "," cached Definitions and ":" Defini\xE7\xF5es em cache e "," cached Synonyms.":" Sin\xF3nimos em cache.","Delete Cache":"Eliminar Cache",Delete:"Eliminar",Success:"\xCAxito","Use Language specific Subfolders":"Utilizar Subpastas espec\xEDficas da L\xEDngua",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'Criar Subpastas para cada l\xEDngua, por exemplo, "Dicion\xE1rio/en-US/Cake".',"Autogenerated by Obsidian Dictionary Plugin":"Autogerado por Obsidian Dictionary Plugin","Yes, overwrite the old File.":"Sim, sobregravar o ficheiro antigo.","A existing File with the same Name was found, do you want to overwrite it?":"Foi encontrado um Ficheiro existente com o mesmo Nome, quer sobregrav\xE1-lo?","No, keep the old File.":"N\xE3o, manter o ficheiro antigo.","Meaning {{i}}":"Significado {{i}}","API Information":"Informa\xE7\xE3o de API","Definition API's":"API de Defini\xE7\xE3o",Website:"S\xEDtio Web","Synonym API's":"API de Sin\xF3nimos","Part of Speech API's":"Parte das API de Discurso",'This Plugin is using Feather Icons':'Este Plugin est\xE1 a usar Feather Icons',"Enter a word":"Introduza uma palavra",Clear:"Limpar","Change Language":"Mudar L\xEDngua","Change Provider":"Mudar Provedor","Collapse Results":"Colapsar os Resultados",Pronunciation:"Pronunciamento",Meanings:"Significados",Origin:"Origem","New Note":"Nova Nota","View Error":"Ver Erro","Match Case":"Corresponder Caixa",'Copied "{{word}}" to clipboard':'Copiado "{{word}}" para clipboard',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"N\xE3o consigo encontrar a palavra que procura ou o servidor n\xE3o pode ser alcan\xE7ado. Pode tentar novamente dentro de alguns minutos.","Definition:":"Defini\xE7\xE3o:","Synonyms:":"Sin\xF3nimos:","Antonyms:":"Ant\xF3nimos:","Choose a Definition Provider Service":"Escolha um Servi\xE7o Provedor de Defini\xE7\xF5es","Choose a Language":"Escolha uma L\xEDngua","Choose a Synonym Provider Service":"Escolha um Servi\xE7o Provedor de Sin\xF3nimos"};var un={"Open Dictionary View":"Abrir Visualiza\xE7\xE3o do Dicion\xE1rio","Open Language Switcher":"Abrir Seletor de Idioma",Dictionary:"Dicion\xE1rio",Cut:"Cortar",Copy:"Copiar",Paste:"Colar","Show Synonyms":"Mostrar Sin\xF4nimos","Look up":"Procurar","Reset to default":"Restaurar para o padr\xE3o","Dictionary Settings":"Configura\xE7\xF5es do Dicion\xE1rio",Language:"Idioma","The Language the Plugin will use to search for Definitions and Pronunciations.":"O Idioma que o Plugin ir\xE1 utilizar para pesquisar as Defini\xE7\xF5es e as Pronuncia\xE7\xF5es.","Synonym Suggestions":"Sugest\xF5es de Sin\xF4nimo","Show synonyms for highlighted words":"Mostrar sin\xF4nimos para palavras em destaque","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"A ativa\xE7\xE3o disso permitir\xE1 ao Plugin analisar as frases completas para melhor sugerir sin\xF4nimos com base no contexto.","Click ":"Clique ",here:"aqui"," for Privacy Concerns.":" para Quest\xF5es de Privacidade.","Advanced Synonym Search":"Pesquisa Avan\xE7ada de Sin\xF4nimos","Show Options in Context Menu":"Mostrar Op\xE7\xF5es no Menu de Contexto","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"Permitir Menu de Contexto personalizado com op\xE7\xF5es para procurar sin\xF4nimos (apenas se as sugest\xF5es autom\xE1ticas estiverem desativadas) e procurar uma defini\xE7\xE3o completa na Barra Lateral. Aviso: Isso substituir\xE1 o Menu de Contexto padr\xE3o do Obsidian.","Click Here":"Clique Aqui","Definition Provider":"Provedor de Defini\xE7\xE3o","The API the Plugin will use to search for Definitions.":"A API que o plugin utilizar\xE1 para procurar por Defini\xE7\xF5es.","Synonym Provider":"Provedor de Sin\xF4nimo","The API the Plugin will use to search for Synonyms.":"A API que o plugin utilizar\xE1 para procurar por Sin\xF4nimos.","More Information":"Mais Informa\xE7\xF5es","View Information about the API's and the Plugin itself.":"Ver Informa\xE7\xF5es sobre a API e sobre o Plugin em si.","More Info":"Mais Info",Donate:"Doar","If you like this Plugin, consider donating to support continued development:":"Se voc\xEA gosta deste Plugin, considere fazer uma doa\xE7\xE3o para apoiar o desenvolvimento cont\xEDnuo:","Local Dictionary Folder":"Pasta do Dicion\xE1rio Local","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"Especificar uma Pasta, onde todas as novas Notas criadas pelo Dicion\xE1rio ser\xE3o colocadas. \xC9 necess\xE1rio que esta Pasta j\xE1 exista em seu Obsidian.","Capitalize File Name":"Capitalizar o Nome do Arquivo","If you disable this, the names of newly created files will be all lowercase.":"Se voc\xEA desativar isso, os nomes dos arquivos rec\xE9m-criados ser\xE3o todos em min\xFAsculas.","Filename Prefix and Suffix":"Prefixo e Sufixo do nome do arquivo","Here you can add a Prefix and Suffix for your newly created Files.":"Aqui voc\xEA pode adicionar um Prefixo e Sufixo para seus arquivos rec\xE9m-criados. Voc\xEA pode usar a vari\xE1vel {{lang}} aqui.",Prefix:"Prefixo",Suffix:"Sufixo","Here you can edit the Template for newly created Files.":"Aqui voc\xEA pode editar o Template para arquivos rec\xE9m-criados.","Click for a List of Variables":"Clique para uma Lista de Vari\xE1veis",Template:"Template","Local-Dictionary-Builder Settings":"Configura\xE7\xF5es do Local-Dictionary-Builder (Construtor do Dicion\xE1rio Local)",Miscellaneous:"Miscel\xE2neas","Caching Settings":"Configura\xE7\xF5es de Cache","Use Caching":"Usar Cache","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"Habilitar ou desabilitar o cache. O cache proporciona uma experi\xEAncia semi-offline ao salvar cada resultado para uso posterior.","Here you can delete all cached Data.":"Aqui voc\xEA pode excluir todos os dados armazenados em cache.","You currently have ":"Voc\xEA atualmente tem "," cached Definitions and ":" Defini\xE7\xF5es em cache e "," cached Synonyms.":" Sin\xF4nimos em cache.","Delete Cache":"Apagar Cache",Delete:"Apagar",Success:"Sucesso","Use Language specific Subfolders":"Usar Subpastas espec\xEDficas do Idioma",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'Criar subpastas para cada idioma, por exemplo, "Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"Autogerado pelo Plugin Dicion\xE1rio do Obsidian","Yes, overwrite the old File.":"Sim, substitua o Arquivo antigo.","A existing File with the same Name was found, do you want to overwrite it?":"Foi encontrado um Arquivo existente com o mesmo Nome, voc\xEA quer substitu\xED-lo?","No, keep the old File.":"N\xE3o, manter o Arquivo antigo.","Meaning {{i}}":"Significado {{i}}","API Information":"Informa\xE7\xE3o da API","Definition API's":"API de Defini\xE7\xE3o",Website:"P\xE1gina Web","Synonym API's":"API de Sin\xF4nimos","Part of Speech API's":"Parte da API de Discurso",'This Plugin is using Feather Icons':'Este Plugin est\xE1 usando Feather Icons',"Enter a word":"Digite uma palavra",Clear:"Limpar","Change Language":"Mudar Idioma","Change Provider":"Mudar Provedor","Collapse Results":"Colapsar os Resultados",Pronunciation:"Pron\xFAncia",Meanings:"Significados",Origin:"Origem","New Note":"Nova Nota","View Error":"Ver Erro","Match Case":"Corresponder Caixa",'Copied "{{word}}" to clipboard':'Copiado "{{word}}" para a \xE1rea de transfer\xEAncia (clipboard)',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"N\xE3o consigo encontrar a palavra que procura ou o servidor n\xE3o pode ser alcan\xE7ado. Tente novamente dentro de alguns minutos.","Definition:":"Defini\xE7\xE3o:","Synonyms:":"Sin\xF4nimos:","Antonyms:":"Ant\xF4nimos:","Choose a Definition Provider Service":"Escolha um Servi\xE7o de Provedor de Defini\xE7\xE3o","Choose a Language":"Escolha um Idioma","Choose a Synonym Provider Service":"Escolha um Servi\xE7o de Provedor de Sin\xF4nimo"};var dn={};var fn={"Open Dictionary View":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u041C\u0435\u043D\u044E \u0421\u043B\u043E\u0432\u0430\u0440\u044F","Open Language Switcher":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0412\u044B\u0431\u043E\u0440 \u042F\u0437\u044B\u043A\u0430",Dictionary:"\u0421\u043B\u043E\u0432\u0430\u0440\u044C",Cut:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C",Copy:"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",Paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C","Show Synonyms":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0421\u0438\u043D\u043E\u043D\u0438\u043C\u044B","Look up":"\u041D\u0430\u0439\u0442\u0438","Reset to default":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043A \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u043C \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E","Dictionary Settings":"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0421\u043B\u043E\u0432\u0430\u0440\u044F",Language:"\u042F\u0437\u044B\u043A","The Language the Plugin will use to search for Definitions and Pronunciations.":"\u042F\u0437\u044B\u043A, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u043F\u043B\u0430\u0433\u0438\u043D\u043E\u043C \u043F\u0440\u0438 \u043F\u043E\u0438\u0441\u043A\u0435 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0439 \u0438 \u043F\u0440\u043E\u0438\u0437\u043D\u043E\u0448\u0435\u043D\u0438\u044F.","Synonym Suggestions":"\u041F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0421\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432","Show synonyms for highlighted words":"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0441\u0438\u043D\u043E\u043D\u0438\u043C\u044B \u0434\u043B\u044F \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0445 \u0441\u043B\u043E\u0432","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u0439 \u043E\u043F\u0446\u0438\u0438 \u043F\u043E\u0437\u0432\u043E\u043B\u044F\u0435\u0442 \u043F\u043B\u0430\u0433\u0438\u043D\u0443 \u0430\u043D\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0446\u0435\u043B\u0438\u043A\u043E\u043C \u0434\u043B\u044F \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u0431\u043E\u043B\u0435\u0435 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0438\u0435 \u0441\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E\u0441\u0442\u0438 \u043E\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430.","Click ":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 ",here:"\u0441\u044E\u0434\u0430"," for Privacy Concerns.":" \u0434\u043B\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u0438 \u043E \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438.","Advanced Synonym Search":"\u041F\u0440\u043E\u0434\u0432\u0438\u043D\u0443\u0442\u044B\u0439 \u041F\u043E\u0438\u0441\u043A \u0421\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432","Show Options in Context Menu":"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0444\u0443\u043D\u043A\u0446\u0438\u0438 \u0432 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u043D\u043E\u043C \u043C\u0435\u043D\u044E","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u043D\u043E\u0435 \u043C\u0435\u043D\u044E \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C \u043F\u043E\u0438\u0441\u043A\u0430 \u0441\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432 (\u0442\u043E\u043B\u044C\u043A\u043E \u043F\u0440\u0438 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u043E\u043C \u0430\u0432\u0442\u043E\u0434\u043E\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0438) \u0438 \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u043F\u043E\u043B\u043D\u043E\u0433\u043E \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u044F \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u043C \u043C\u0435\u043D\u044E.","Click Here":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0421\u044E\u0434\u0430","Definition Provider":"\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440 \u041E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0439","The API the Plugin will use to search for Definitions.":"API, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u043F\u043B\u0430\u0433\u0438\u043D\u043E\u043C \u0434\u043B\u044F \u043F\u043E\u0438\u0441\u043A\u0430 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0439.","Synonym Provider":"\u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440 \u0421\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432","The API the Plugin will use to search for Synonyms.":"API, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u043F\u043B\u0430\u0433\u0438\u043D\u043E\u043C \u0434\u043B\u044F \u043F\u043E\u0438\u0441\u043A\u0430 \u0441\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432.","More Information":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u0430\u044F \u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F","View Information about the API's and the Plugin itself.":"\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E\u0431 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u043C\u044B\u0445 API \u0438 \u043E \u0441\u0430\u043C\u043E\u043C \u043F\u043B\u0430\u0433\u0438\u043D\u0435.","More Info":"\u0423\u0437\u043D\u0430\u0442\u044C \u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435",Donate:"\u041F\u043E\u0436\u0435\u0440\u0442\u0432\u043E\u0432\u0430\u0442\u044C","If you like this Plugin, consider donating to support continued development:":"\u0415\u0441\u043B\u0438 \u0432\u0430\u043C \u043D\u0440\u0430\u0432\u0438\u0442\u0441\u044F \u043F\u043B\u0430\u0433\u0438\u043D, \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044C \u043F\u043E\u0436\u0435\u0440\u0442\u0432\u043E\u0432\u0430\u043D\u0438\u044F \u0434\u0430\u043B\u044C\u043D\u0435\u0439\u0448\u0443\u044E \u0435\u0433\u043E \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u043A\u0443:","Local Dictionary Folder":"\u0414\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u044F \u041B\u043E\u043A\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0421\u043B\u043E\u0432\u0430\u0440\u044F","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0434\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u044E, \u0432 \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u0431\u0443\u0434\u0443\u0442 \u0441\u043E\u0437\u0434\u0430\u0432\u0430\u0442\u044C\u0441\u044F \u0432\u0441\u0435 \u043D\u043E\u0432\u044B\u0435 \u0437\u0430\u043C\u0435\u0442\u043A\u0438, \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0435 \u0421\u043B\u043E\u0432\u0430\u0440\u0451\u043C. \u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0443\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043E \u0434\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u044F \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C.","Capitalize File Name":"\u041D\u0430\u0447\u0438\u043D\u0430\u0442\u044C \u0421\u043B\u043E\u0432\u0430 \u0432 \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0438 \u0424\u0430\u0439\u043B\u043E\u0432 \u0441 \u0417\u0430\u0433\u043B\u0430\u0432\u043D\u043E\u0439 \u0411\u0443\u043A\u0432\u044B","If you disable this, the names of newly created files will be all lowercase.":"\u0415\u0441\u043B\u0438 \u0432\u044B \u0432\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u0435 \u044D\u0442\u0443 \u043E\u043F\u0446\u0438\u044E, \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F \u0432 \u0441\u043E\u0437\u0434\u0430\u043D\u043D\u044B\u0445 \u0444\u0430\u0439\u043B\u0430\u0445 \u0431\u0443\u0434\u0443\u0442 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u0438\u0445 \u0431\u0443\u043A\u0432.","Filename Prefix and Suffix":"\u041F\u0440\u0435\u0444\u0438\u043A\u0441 \u0438 \u0441\u0443\u0444\u0444\u0438\u043A\u0441 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0439 \u0444\u0430\u0439\u043B\u043E\u0432","Here you can add a Prefix and Suffix for your newly created Files.":"\u0417\u0434\u0435\u0441\u044C \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044C \u043F\u0440\u0435\u0444\u0438\u043A\u0441 \u0438 \u0441\u0443\u0444\u0444\u0438\u043A\u0441 \u0434\u043B\u044F \u0441\u043E\u0437\u0434\u0430\u0432\u0430\u0435\u043C\u044B\u0445 \u0444\u0430\u0439\u043B\u043E\u0432. \u041C\u043E\u0436\u043D\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u0443\u044E {{lang}}.",Prefix:"\u041F\u0440\u0435\u0444\u0438\u043A\u0441",Suffix:"\u0421\u0443\u0444\u0444\u0438\u043A\u0441","Here you can edit the Template for newly created Files.":"\u0417\u0434\u0435\u0441\u044C \u043C\u043E\u0436\u043D\u043E \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D \u0434\u043B\u044F \u0441\u043E\u0437\u0434\u0430\u0432\u0430\u0435\u043C\u044B\u0445 \u0444\u0430\u0439\u043B\u043E\u0432.","Click for a List of Variables":"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u0441\u044E\u0434\u0430, \u0447\u0442\u043E\u0431\u044B \u043F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0441\u043F\u0438\u0441\u043A\u0443 \u043F\u0435\u0440\u0435\u043C\u0435\u043D\u043D\u044B\u0445",Template:"\u0428\u0430\u0431\u043B\u043E\u043D","Local-Dictionary-Builder Settings":"\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0421\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u041B\u043E\u043A\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u0421\u043B\u043E\u0432\u0430\u0440\u044F",Miscellaneous:"\u0420\u0430\u0437\u043D\u043E\u0435","Caching Settings":"\u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u041A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F","Use Caching":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u041A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0438\u043B\u0438 \u0432\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435. \u041A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043F\u043E\u043B\u0443\u0430\u0432\u0442\u043E\u043D\u043E\u043C\u043D\u0443\u044E \u0440\u0430\u0431\u043E\u0442\u0443, \u0433\u0434\u0435 \u043A\u0430\u0436\u0434\u044B\u0439 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0434\u043B\u044F \u0434\u0430\u043B\u044C\u043D\u0435\u0439\u0448\u0435\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F.","Here you can delete all cached Data.":"\u0417\u0434\u0435\u0441\u044C \u043C\u043E\u0436\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435.","You currently have ":"\u0423 \u0432\u0430\u0441 \u0441\u0435\u0439\u0447\u0430\u0441 "," cached Definitions and ":" \u043A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0439 \u0438 "," cached Synonyms.":" \u043A\u044D\u0448\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432.","Delete Cache":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043A\u044D\u0448",Delete:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C",Success:"\u0423\u0441\u043F\u0435\u0445","Use Language specific Subfolders":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u0434\u0434\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u0438 \u0434\u043B\u044F \u044F\u0437\u044B\u043A\u043E\u0432",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'\u0421\u043E\u0437\u0434\u0430\u0432\u0430\u0442\u044C \u043F\u043E\u0434\u0434\u0438\u0440\u0435\u043A\u0442\u043E\u0440\u0438\u0438 \u0434\u043B\u044F \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u044F\u0437\u044B\u043A\u0430, \u0442.\u0435. "Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"\u0421\u0433\u0435\u043D\u0435\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u043F\u043B\u0430\u0433\u0438\u043D\u043E\u043C Obsidian Dictionary","Yes, overwrite the old File.":"\u0414\u0430, \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0441\u0442\u0430\u0440\u044B\u0439 \u0444\u0430\u0439\u043B.","A existing File with the same Name was found, do you want to overwrite it?":"\u0424\u0430\u0439\u043B \u0441 \u0442\u0430\u043A\u0438\u043C \u0438\u043C\u0435\u043D\u0435\u043C \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0445\u043E\u0442\u0438\u0442\u0435 \u043B\u0438 \u0432\u044B \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0438\u0441\u0430\u0442\u044C?","No, keep the old File.":"\u041D\u0435\u0442, \u043E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0440\u044B\u0439 \u0444\u0430\u0439\u043B.","Meaning {{i}}":"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435 {{i}}","API Information":"\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E\u0431 API","Definition API's":"API \u041E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0439",Website:"\u0421\u0430\u0439\u0442","Synonym API's":"API \u0421\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432","Part of Speech API's":"\u0427\u0430\u0441\u0442\u044C Speech API",'This Plugin is using Feather Icons':'\u042D\u0442\u043E\u0442 \u043F\u043B\u0430\u0433\u0438\u043D \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 Feather Icons',"Enter a word":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043B\u043E\u0432\u043E",Clear:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C","Change Language":"\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u042F\u0437\u044B\u043A","Change Provider":"\u0421\u043C\u0435\u043D\u0438\u0442\u044C \u041F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0430","Collapse Results":"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B",Pronunciation:"\u041F\u0440\u043E\u0438\u0437\u043D\u043E\u0448\u0435\u043D\u0438\u0435",Meanings:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u044F",Origin:"\u041F\u0440\u043E\u0438\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435","New Note":"\u041D\u043E\u0432\u0430\u044F \u0417\u0430\u043C\u0435\u0442\u043A\u0430","View Error":"\u0423\u0432\u0438\u0434\u0435\u0442\u044C \u043E\u0448\u0438\u0431\u043A\u0443","Match Case":"\u0423\u0447\u0438\u0442\u044B\u0432\u0430\u0442\u044C \u0420\u0435\u0433\u0438\u0441\u0442\u0440",'Copied "{{word}}" to clipboard':'"{{word}}" \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043D\u0430\u0439\u0442\u0438 \u0441\u043B\u043E\u0432\u043E \u0438\u043B\u0438 \u0441\u0435\u0440\u0432\u0435\u0440 \u043D\u0435 \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u043E\u043F\u0440\u043E\u0431\u043E\u0432\u0430\u0442\u044C \u0435\u0449\u0451 \u0440\u0430\u0437 \u0447\u0435\u0440\u0435\u0437 \u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043C\u0438\u043D\u0443\u0442.","Definition:":"\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0435:","Synonyms:":"\u0421\u0438\u043D\u043E\u043D\u0438\u043C\u044B:","Antonyms:":"\u0410\u043D\u0442\u043E\u043D\u0438\u043C\u044B:","Choose a Definition Provider Service":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0435\u043D\u0438\u0439","Choose a Language":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u044F\u0437\u044B\u043A","Choose a Synonym Provider Service":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0440\u043E\u0432\u0430\u0439\u0434\u0435\u0440\u0430 \u0441\u0438\u043D\u043E\u043D\u0438\u043C\u043E\u0432"};var pn={};var hn={"Open Dictionary View":"\u6253\u5F00\u67E5\u8BCD\u9762\u677F","Open Language Switcher":"\u5207\u6362\u8BED\u8A00",Dictionary:"\u8BCD\u5178",Cut:"\u526A\u5207",Copy:"\u590D\u5236",Paste:"\u7C98\u8D34","Show Synonyms":"\u663E\u793A\u540C\u4E49\u8BCD","Look up":"\u67E5\u8BE2","Reset to default":"\u91CD\u7F6E\u4E3A\u9ED8\u8BA4\u8BBE\u7F6E","Dictionary Settings":"\u8BCD\u5178\u8BBE\u7F6E",Language:"\u8BED\u8A00","The Language the Plugin will use to search for Definitions and Pronunciations.":"\u63D2\u4EF6\u4F1A\u6839\u636E\u8BE5\u8BED\u8A00\u6765\u641C\u7D22\u8BED\u4E49\u4EE5\u53CA\u53D1\u97F3","Synonym Suggestions":"\u540C\u4E49\u8BCD\u5EFA\u8BAE","Show synonyms for highlighted words":"\u5C55\u793A\u88AB\u9AD8\u4EAE\u7684\u8BCD\u7684\u540C\u4E49\u8BCD","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"\u5141\u8BB8\u8BE5\u9009\u9879\u5C06\u4F1A\u5BF9\u6574\u6BB5\u6587\u672C\u8FDB\u884C\u5206\u6790\u6765\u5EFA\u8BAE\u66F4\u597D\u7684\u540C\u4E49\u8BCD","Click ":"\u70B9\u51FB ",here:"\u8FD9\u91CC"," for Privacy Concerns.":" \u6765\u83B7\u53D6\u76F8\u5173\u9690\u79C1\u89E3\u91CA","Advanced Synonym Search":"\u540C\u4E49\u8BCD\u641C\u7D22\u8FDB\u9636","Show Options in Context Menu":"\u5728\u53F3\u952E\u83DC\u5355\u4E2D\u663E\u793A\u9009\u9879","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"\u5141\u8BB8\u81EA\u5B9A\u4E49\u53F3\u952E\u83DC\u5355\u6765\u66F4\u65B9\u4FBF\u641C\u7D22\u540C\u4E49\u8BCD\uFF08\u9700\u8981\u5173\u95ED\u81EA\u52A8\u5EFA\u8BAE\uFF09\u4E14\u5728\u4FA7\u680F\u7684\u8BCD\u5178\u9762\u677F\u5C55\u793A\u76F8\u5173\u91CA\u4E49\u3002\u6CE8\u610F\uFF0C\u8FD9\u4F1A\u8986\u76D6\u6389 Obsidian \u7684\u9ED8\u8BA4\u53F3\u952E\u83DC\u5355\u3002","Click Here":"\u70B9\u51FB\u8FD9\u91CC","Definition Provider":"\u91CA\u4E49\u6765\u6E90","The API the Plugin will use to search for Definitions.":"\u5C06\u57FA\u4E8E\u8BE5 API \u53BB\u641C\u7D22\u91CA\u4E49","Synonym Provider":"\u540C\u4E49\u8BCD\u6765\u6E90","The API the Plugin will use to search for Synonyms.":"\u5C06\u57FA\u4E8E\u8BE5 API \u53BB\u641C\u7D22\u540C\u4E49\u8BCD","More Information":"\u66F4\u591A\u4FE1\u606F","View Information about the API's and the Plugin itself.":"\u4E86\u89E3\u5173\u4E8E\u63D2\u4EF6\u4EE5\u53CA API \u7684\u4FE1\u606F","More Info":"\u66F4\u591A\u4FE1\u606F",Donate:"\u6350\u8D60","If you like this Plugin, consider donating to support continued development:":"\u5982\u679C\u4F60\u559C\u6B22\u8BE5\u63D2\u4EF6\uFF0C\u53EF\u4EE5\u8003\u8651\u6253\u8D4F\u652F\u6301\uFF1A","Local Dictionary Folder":"\u672C\u5730\u8BCD\u5178\u6587\u4EF6\u5939","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"\u6307\u5B9A\u8BCD\u5178\u521B\u5EFA\u7684\u65B0\u7B14\u8BB0\u6240\u5B58\u653E\u7684\u4F4D\u7F6E\uFF0C\u6CE8\u610F\u6587\u4EF6\u5939\u9700\u8981\u5B58\u5728","Capitalize File Name":"\u5C06\u6587\u4EF6\u540D\u9996\u5B57\u6BCD\u5927\u5199","If you disable this, the names of newly created files will be all lowercase.":"\u5982\u679C\u4F60\u5173\u95ED\u8FD9\u4E2A\u9009\u9879\uFF0C\u65B0\u5EFA\u6587\u4EF6\u9996\u5B57\u6BCD\u5C06\u662F\u5C0F\u5199\u3002","Filename Prefix and Suffix":"\u6587\u4EF6\u540D\u524D\u7F00\u548C\u540E\u7F00","Here you can add a Prefix and Suffix for your newly created Files.":"\u5728\u8FD9\u91CC\u4F60\u53EF\u4EE5\u4E3A\u65B0\u5EFA\u6587\u4EF6\u6DFB\u52A0\u524D\u7F00\u548C\u540E\u7F00\u3002\u4F60\u53EF\u4EE5\u4F7F\u7528 {{lang}} \u53D8\u91CF\u3002Here you can add a Prefix and Suffix for your newly created Files. You can use the {{lang}} variable here.",Prefix:"\u524D\u7F00",Suffix:"\u540E\u7F00","Here you can edit the Template for newly created Files.":"\u5728\u8FD9\u91CC\u4F60\u53EF\u4EE5\u7F16\u8F91\u65B0\u5EFA\u6587\u6863\u7684\u6A21\u677F\u3002","Click for a List of Variables":"\u70B9\u51FB\u67E5\u770B\u53D8\u91CF\u5217\u8868",Template:"\u6A21\u677F","Local-Dictionary-Builder Settings":"\u672C\u5730\u81EA\u5EFA\u8BCD\u5178\u8BBE\u7F6E",Miscellaneous:"\u5176\u4ED6","Caching Settings":"\u7F13\u5B58\u8BBE\u7F6E","Use Caching":"\u4F7F\u7528\u7F13\u5B58","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"\u542F\u7528\u6216\u7981\u7528\u7F13\u5B58\u3002\u7F13\u5B58\u53EF\u4EE5\u4FDD\u5B58\u7ED3\u679C\u4EE5\u4F9B\u540E\u7EED\u4F7F\u7528\uFF0C\u63D0\u4F9B\u63A5\u8FD1\u672C\u5730\u4FDD\u5B58\u7684\u4F53\u9A8C\u3002","Here you can delete all cached Data.":"\u5728\u8FD9\u91CC\u4F60\u53EF\u4EE5\u5220\u9664\u6240\u6709\u7F13\u5B58\u6570\u636E\u3002","You currently have ":"\u4F60\u76EE\u524D\u6709"," cached Definitions and ":" \u5DF2\u7F13\u5B58\u91CA\u4E49\u4E0E "," cached Synonyms.":" \u5DF2\u7F13\u5B58\u540C\u4E49\u8BCD\u3002","Delete Cache":"\u5220\u9664\u7F13\u5B58",Delete:"\u5220\u9664",Success:"\u6210\u529F","Use Language specific Subfolders":"\u4F7F\u7528\u7279\u5B9A\u8BED\u8A00\u7684\u5B50\u6587\u4EF6\u5939",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'\u4E3A\u6240\u6709\u8BED\u8A00\u521B\u5EFA\u5B50\u6587\u4EF6\u5939\uFF0C\u4F8B\u5982"Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"\u7531 Obsidian Dictionary Plugin \u63D2\u4EF6\u81EA\u52A8\u751F\u6210","Yes, overwrite the old File.":"\u597D\uFF0C\u8986\u76D6\u65E7\u6587\u4EF6\u3002","A existing File with the same Name was found, do you want to overwrite it?":"\u53D1\u73B0\u4E00\u4E2A\u540C\u540D\u65E7\u6587\u4EF6\uFF0C\u662F\u5426\u8986\u76D6\uFF1F","No, keep the old File.":"\u4E0D\uFF0C\u4FDD\u7559\u65E7\u6587\u4EF6\u3002","Meaning {{i}}":"\u8BCD\u4E49 {{i}}","API Information":"API \u4FE1\u606F","Definition API's":"\u91CA\u4E49 API",Website:"\u7F51\u7AD9","Synonym API's":"\u540C\u4E49\u8BCD API","Part of Speech API's":"\u8BED\u97F3 API",'This Plugin is using Feather Icons':'\u8FD9\u4E2A\u63D2\u4EF6\u4F7F\u7528 Feather \u56FE\u6807',"Enter a word":"\u8F93\u5165\u5355\u8BCD",Clear:"\u6E05\u9664","Change Language":"\u66F4\u6539\u8BED\u8A00","Change Provider":"\u66F4\u6539\u6765\u6E90","Collapse Results":"\u6298\u53E0\u7ED3\u679C",Pronunciation:"\u53D1\u97F3",Meanings:"\u8BCD\u4E49",Origin:"\u8BCD\u6E90","New Note":"\u65B0\u7B14\u8BB0","View Error":"\u68C0\u89C6\u9519\u8BEF","Match Case":"\u533A\u5206\u5927\u5C0F\u5199",'Copied "{{word}}" to clipboard':'\u5DF2\u590D\u5236 "{{word}}" \u5230\u526A\u8D34\u677F',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"\u65E0\u6CD5\u627E\u5230\u4F60\u641C\u7D22\u7684\u5355\u8BCD\u6216\u8005\u670D\u52A1\u5668\u5F53\u524D\u4E0D\u53EF\u7528\uFF0C\u4F60\u53EF\u4EE5\u51E0\u5206\u949F\u540E\u518D\u8BD5\u4E00\u4E0B\u3002","Definition:":"\u91CA\u4E49\uFF1A","Synonyms:":"\u540C\u4E49\u8BCD\uFF1A","Antonyms:":"\u53CD\u4E49\u8BCD\uFF1A","Choose a Definition Provider Service":"\u9009\u62E9\u4E00\u4E2A\u91CA\u4E49\u8BCD\u5178\u670D\u52A1","Choose a Language":"\u9009\u62E9\u4E00\u79CD\u8BED\u8A00","Choose a Synonym Provider Service":"\u9009\u62E9\u4E00\u4E2A\u540C\u4E49\u8BCD\u8BCD\u5178\u670D\u52A1"};var yn={"Open Dictionary View":"\u6253\u958B\u5B57\u5178\u6AA2\u8996","Open Language Switcher":"\u5207\u63DB\u8A9E\u8A00",Dictionary:"\u5B57\u5178",Cut:"\u526A\u4E0B",Copy:"\u8907\u88FD",Paste:"\u8CBC\u4E0A","Show Synonyms":"\u986F\u793A\u540C\u7FA9\u8A5E","Look up":"\u67E5\u8A62","Reset to default":"\u6062\u5FA9\u9810\u8A2D\u8A2D\u5B9A","Dictionary Settings":"\u5B57\u5178\u8A2D\u5B9A",Language:"\u8A9E\u8A00","The Language the Plugin will use to search for Definitions and Pronunciations.":"\u6B64\u63D2\u4EF6\u7528\u4F86\u67E5\u5C0B\u5B9A\u7FA9\u8207\u767C\u97F3\u7684\u8A9E\u8A00","Synonym Suggestions":"\u540C\u7FA9\u8A5E\u5EFA\u8B70","Show synonyms for highlighted words":"\u986F\u793A\u88AB\u9AD8\u4EAE\u7684\u5B57\u4E4B\u540C\u7FA9\u8A5E","Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context.":"\u555F\u7528\u8A72\u9078\u9805\u6703\u8B93\u6B64\u63D2\u4EF6\u80FD\u5920\u5206\u6790\u6574\u6BB5\u6587\u5B57\u4EE5\u57FA\u65BC\u5167\u5BB9\u7D66\u51FA\u66F4\u597D\u7684\u540C\u7FA9\u8A5E\u5EFA\u8B70","Click ":"\u9EDE\u64CA ",here:"\u9019\u88E1"," for Privacy Concerns.":"\u4EE5\u67E5\u770B\u76F8\u95DC\u96B1\u79C1\u8AAA\u660E","Advanced Synonym Search":"\u9032\u968E\u540C\u7FA9\u8A5E\u67E5\u8A62","Show Options in Context Menu":"\u5728\u53F3\u9375\u83DC\u55AE\u986F\u793A\u9078\u9805","Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.":"\u555F\u7528\u5305\u542B\u9078\u9805\u7684\u81EA\u5B9A\u7FA9\u53F3\u9375\u83DC\u55AE\u4EE5\u641C\u5C0B\u540C\u7FA9\u8A5E\uFF08\u9700\u8981\u95DC\u9589\u81EA\u52D5\u5EFA\u8B70\uFF09\u4E26\u5728\u5074\u6B04\u67E5\u770B\u5B8C\u6574\u5B9A\u7FA9\u3002\u6CE8\u610F\uFF0C\u9019\u6703\u8986\u84CB\u6389 Obsidian \u7684\u9ED8\u8A8D\u53F3\u9375\u83DC\u55AE\u3002","Click Here":"\u9EDE\u64CA\u9019\u88E1","Definition Provider":"\u5B9A\u7FA9\u4F86\u6E90","The API the Plugin will use to search for Definitions.":"\u6B64\u63D2\u4EF6\u67E5\u8A62\u5B9A\u7FA9\u6240\u7528\u7684 API","Synonym Provider":"\u540C\u7FA9\u8A5E\u4F86\u6E90","The API the Plugin will use to search for Synonyms.":"\u6B64\u63D2\u4EF6\u67E5\u8A62\u540C\u7FA9\u8A5E\u6240\u7528\u7684 API","More Information":"\u66F4\u591A\u8CC7\u8A0A","View Information about the API's and the Plugin itself.":"\u4E86\u89E3\u66F4\u591A\u95DC\u65BC API \u4EE5\u53CA\u6B64\u63D2\u4EF6\u7684\u8CC7\u8A0A","More Info":"\u66F4\u591A\u8CC7\u8A0A",Donate:"\u6350\u6B3E","If you like this Plugin, consider donating to support continued development:":"\u5982\u679C\u4F60\u559C\u6B61\u6B64\u63D2\u4EF6\uFF0C\u53EF\u4EE5\u8003\u616E\u6597\u5167\u652F\u6301\u958B\u767C","Local Dictionary Folder":"\u672C\u5730\u5B57\u5178\u8CC7\u6599\u593E","Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.":"\u6307\u5B9A\u6240\u6709\u5B57\u5178\u65B0\u5275\u7684\u7B46\u8A18\u5B58\u653E\u7684\u8CC7\u6599\u593E\uFF0C\u6CE8\u610F\u8A72\u8CC7\u6599\u593E\u5FC5\u9808\u5DF2\u7D93\u5B58\u5728","Capitalize File Name":"\u5927\u5BEB\u6A94\u540D\u9996\u5B57\u6BCD","If you disable this, the names of newly created files will be all lowercase.":"\u5982\u679C\u95DC\u6389\u9019\u500B\u9078\u9805\uFF0C\u65B0\u5EFA\u6A94\u540D\u6703\u662F\u5C0F\u5BEB","Filename Prefix and Suffix":"\u6A94\u540D\u5B57\u9996\u5B57\u5C3E","Here you can add a Prefix and Suffix for your newly created Files.":"\u4F60\u53EF\u4EE5\u5728\u9019\u88E1\u70BA\u65B0\u5EFA\u6A94\u6848\u52A0\u4E0A\u5B57\u9996\u5B57\u5C3E\u3002\u4F60\u53EF\u4EE5\u4F7F\u7528 {{lang}} \u8B8A\u6578\u3002",Prefix:"\u5B57\u9996",Suffix:"\u5B57\u5C3E","Here you can edit the Template for newly created Files.":"\u4F60\u53EF\u4EE5\u5728\u9019\u88E1\u7DE8\u8F2F\u65B0\u5EFA\u6A94\u6848\u7684\u6A21\u677F","Click for a List of Variables":"\u9EDE\u64CA\u4EE5\u67E5\u770B\u8B8A\u6578\u5217\u8868",Template:"\u6A21\u677F","Local-Dictionary-Builder Settings":"\u672C\u5730\u81EA\u5EFA\u5B57\u5178\u8A2D\u5B9A",Miscellaneous:"\u5176\u4ED6","Caching Settings":"\u5FEB\u53D6\u8A2D\u5B9A","Use Caching":"\u4F7F\u7528\u5FEB\u53D6","Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.":"\u555F\u7528\u6216\u4E0D\u555F\u7528\u5FEB\u53D6\u3002\u555F\u7528\u5FEB\u53D6\u6703\u5132\u5B58\u6240\u6709\u7D50\u679C\u4EE5\u4F9B\u5F8C\u7E8C\u4F7F\u7528\uFF0C\u9054\u6210\u63A5\u8FD1\u96E2\u7DDA\u7684\u9AD4\u9A57","Here you can delete all cached Data.":"\u4F60\u53EF\u4EE5\u5728\u9019\u88E1\u522A\u9664\u6240\u6709\u5FEB\u53D6\u8CC7\u6599","You currently have ":"\u4F60\u76EE\u524D\u6709 "," cached Definitions and ":" \u5FEB\u53D6\u5B9A\u7FA9\u8207 "," cached Synonyms.":" \u5FEB\u53D6\u540C\u7FA9\u8A5E","Delete Cache":"\u522A\u9664\u5FEB\u53D6",Delete:"\u522A\u9664",Success:"\u6210\u529F","Use Language specific Subfolders":"\u4F7F\u7528\u7279\u5B9A\u8A9E\u8A00\u5B50\u8CC7\u6599\u593E",'Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"':'\u70BA\u6240\u6709\u8A9E\u8A00\u5275\u5EFA\u5B50\u8CC7\u6599\u593E\uFF0C\u4F8B\u5982 "Dictionary/en-US/Cake"',"Autogenerated by Obsidian Dictionary Plugin":"\u7531 Obsidian Dictionary \u63D2\u4EF6\u81EA\u52D5\u751F\u6210","Yes, overwrite the old File.":"\u597D\uFF0C\u8986\u5BEB\u820A\u6A94\u6848","A existing File with the same Name was found, do you want to overwrite it?":"\u767C\u73FE\u4E00\u500B\u6A94\u540D\u4E00\u6A23\u7684\u820A\u6A94\u6848\uFF0C\u662F\u5426\u8907\u5BEB\u8A72\u6A94\u6848\uFF1F","No, keep the old File.":"\u4E0D\uFF0C\u4FDD\u7559\u820A\u6A94\u6848","Meaning {{i}}":"\u5B57\u7FA9 {{i}}","API Information":"API \u8CC7\u8A0A","Definition API's":"\u5B9A\u7FA9 API",Website:"\u7DB2\u7AD9","Synonym API's":"\u540C\u7FA9\u8A5E API","Part of Speech API's":"\u8A9E\u97F3 API",'This Plugin is using Feather Icons':'\u9019\u500B\u63D2\u4EF6\u4F7F\u7528 Feather \u5716\u793A',"Enter a word":"\u8F38\u5165\u55AE\u5B57","Change Language":"\u66F4\u6539\u8A9E\u8A00","Change Provider":"\u66F4\u6539\u4F86\u6E90","Collapse Results":"\u6536\u5408\u7D50\u679C",Pronunciation:"\u767C\u97F3",Meanings:"\u5B57\u7FA9",Origin:"\u5B57\u6E90","New Note":"\u65B0\u7B46\u8A18","View Error":"\u6AA2\u8996\u932F\u8AA4","Match Case":"\u7B26\u5408\u5927\u5C0F\u5BEB",'Copied Synonym "{{word}}" to clipboard':'\u5DF2\u8907\u88FD\u540C\u7FA9\u8A5E "{{word}}" \u5230\u526A\u8CBC\u7C3F',"I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.":"\u7121\u6CD5\u627E\u5230\u4F60\u8F38\u5165\u7684\u5B57\uFF0C\u6216\u662F\u7121\u6CD5\u9023\u4E0A\u4F3A\u670D\u5668\u3002\u53EF\u4EE5\u904E\u5E7E\u5206\u9418\u518D\u8A66\u3002","Definition:":"\u5B9A\u7FA9\uFF1A","Synonyms:":"\u540C\u7FA9\u8A5E\uFF1A","Choose a Definition Provider Service":"\u9078\u64C7\u4E00\u500B\u5B9A\u7FA9\u4F9B\u61C9\u670D\u52D9","Choose a Language":"\u9078\u64C7\u4E00\u500B\u8A9E\u8A00","Choose a Synonym Provider Service":"\u9078\u64C7\u4E00\u500B\u540C\u7FA9\u8A5E\u4F9B\u61C9\u670D\u52D9"};var Ar={ar:qt,cs:Yt,da:Jt,de:Kt,en:ft,"en-gb":Qt,es:Xt,fr:Zt,hi:en,id:tn,it:nn,ja:rn,ko:on,nl:an,nn:sn,pl:ln,pt:cn,"pt-br":un,ro:dn,ru:fn,tr:pn,"zh-cn":hn,"zh-tw":yn},ht=Ar[pt.moment.locale()];function w(n){return ht||console.error("Error: dictionary locale not found",pt.moment.locale()),ht&&ht[n]||ft[n]}var ne="dictionary-view",mn=w("Dictionary"),gn="quote-glyph",Se={en_US:"English (US)",hi:"\u0939\u093F\u0928\u094D\u0926\u0940 (Hindi)",es:"Espa\xF1ol (Spanish)",fr:"Fran\xE7ais (French)",ja:"\u65E5\u672C\u8A9E (Japanese)",ru:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439 (Russian)",en_GB:"English (UK)",de:"Deutsch (German)",it:"Italiano (Italian)",ko:"\uD55C\uAD6D\uC5B4 (Korean)",pt_BR:"Portugu\xEAs do Brasil (Brazilian Portuguese)",ar:"\u0627\u064E\u0644\u0652\u0639\u064E\u0631\u064E\u0628\u0650\u064A\u064E\u0651\u0629\u064F\u200E (Arabic)",tr:"T\xFCrk\xE7e (Turkish)",cn:"\u4E2D\u6587 (Chinese)"},Ie={en_US:"en-US",hi:"hi",es:"es",fr:"fr",ja:"ja",ru:"ru",en_GB:"en-GB",de:"de",it:"it",ko:"ko",pt_BR:"pt-BR",ar:"ar",tr:"tr",cn:"zh"},vn={cachedDefinitions:[],cachedSynonyms:[]},Me={getLangFromFile:!0,defaultLanguage:"en_US",normalLang:"en_US",shouldShowSynonymPopover:!0,shouldShowCustomContextMenu:!1,apiSettings:{en_US:{definitionApiName:"Free Dictionary API",synonymApiName:"Free Dictionary API"},hi:{definitionApiName:"Free Dictionary API",synonymApiName:null},es:{definitionApiName:"Free Dictionary API",synonymApiName:"Altervista"},fr:{definitionApiName:"Free Dictionary API",synonymApiName:"Altervista"},ja:{definitionApiName:"Free Dictionary API",synonymApiName:null},ru:{definitionApiName:"Free Dictionary API",synonymApiName:null},en_GB:{definitionApiName:"Free Dictionary API",synonymApiName:null},de:{definitionApiName:"Free Dictionary API",synonymApiName:"Open Thesaurus"},it:{definitionApiName:"Free Dictionary API",synonymApiName:"Altervista"},ko:{definitionApiName:"Free Dictionary API",synonymApiName:null},pt_BR:{definitionApiName:"Free Dictionary API",synonymApiName:null},ar:{definitionApiName:"Free Dictionary API",synonymApiName:null},tr:{definitionApiName:"Free Dictionary API",synonymApiName:null},cn:{definitionApiName:"Offline Dictionary",synonymApiName:null}},partOfSpeechApiName:"Systran API",advancedSynonymAnalysis:!1,useCaching:!1,folder:"",capitalizedFileName:!0,prefix:"",suffix:" ({{lang}})",template:`--- -# {{notice}} -aliases: ["{{word}}"] ---- - -# {{word}} - -## {{pronunciationHeader}} - -{{phoneticList}} - -## {{meaningHeader}} - -{{meanings}} - -## {{originHeader}} - -{{origin}} -`,languageSpecificSubFolders:!1};function T(){}var _e=n=>n;function Dr(n){return n&&typeof n=="object"&&typeof n.then=="function"}function yt(n){return n()}function xn(){return Object.create(null)}function de(n){n.forEach(yt)}function ge(n){return typeof n=="function"}function Q(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}var Je;function mt(n,e){return Je||(Je=document.createElement("a")),Je.href=e,n===Je.href}function wn(n){return Object.keys(n).length===0}function bn(n){return n&&ge(n.destroy)?n.destroy:T}var Sn=typeof window!="undefined",Cn=Sn?()=>window.performance.now():()=>Date.now(),gt=Sn?n=>requestAnimationFrame(n):T;var Oe=new Set;function jn(n){Oe.forEach(e=>{e.c(n)||(Oe.delete(e),e.f())}),Oe.size!==0&>(jn)}function An(n){let e;return Oe.size===0&>(jn),{promise:new Promise(t=>{Oe.add(e={c:n,f:t})}),abort(){Oe.delete(e)}}}var Dn=!1;function Ir(){Dn=!0}function Mr(){Dn=!1}function S(n,e){n.appendChild(e)}function X(n,e,t){let i=vt(n);if(!i.getElementById(e)){let r=A("style");r.id=e,r.textContent=t,In(i,r)}}function vt(n){if(!n)return document;let e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Or(n){let e=A("style");return In(vt(n),e),e.sheet}function In(n,e){return S(n.head||n,e),e.sheet}function N(n,e,t){n.insertBefore(e,t||null)}function P(n){n.parentNode&&n.parentNode.removeChild(n)}function ee(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function b(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Pr(n){return Array.from(n.childNodes)}function W(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function xt(n,e){n.value=e==null?"":e}function ze(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function re(n,e,t){n.classList[t?"add":"remove"](e)}function Nr(n,e,{bubbles:t=!1,cancelable:i=!1}={}){let r=document.createEvent("CustomEvent");return r.initCustomEvent(n,t,i,e),r}var Ke=new Map,Qe=0;function Er(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function Fr(n,e){let t={stylesheet:Or(e),rules:{}};return Ke.set(n,t),t}function wt(n,e,t,i,r,o,a,s=0){let l=16.666/i,c=`{ -`;for(let m=0;m<=1;m+=l){let x=e+(t-e)*o(m);c+=m*100+`%{${a(x,1-x)}} -`}let u=c+`100% {${a(t,1-t)}} -}`,f=`__svelte_${Er(u)}_${s}`,p=vt(n),{stylesheet:y,rules:g}=Ke.get(p)||Fr(p,n);g[f]||(g[f]=!0,y.insertRule(`@keyframes ${f} ${u}`,y.cssRules.length));let v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${f} ${i}ms linear ${r}ms 1 both`,Qe+=1,f}function bt(n,e){let t=(n.style.animation||"").split(", "),i=t.filter(e?o=>o.indexOf(e)<0:o=>o.indexOf("__svelte")===-1),r=t.length-i.length;r&&(n.style.animation=i.join(", "),Qe-=r,Qe||kr())}function kr(){gt(()=>{Qe||(Ke.forEach(n=>{let{ownerNode:e}=n.stylesheet;e&&P(e)}),Ke.clear())})}var Ve;function fe(n){Ve=n}function Mn(){if(!Ve)throw new Error("Function called outside component initialization");return Ve}function Re(n){Mn().$$.on_mount.push(n)}var Ue=[];var ve=[],Xe=[],On=[],Lr=Promise.resolve(),St=!1;function Tr(){St||(St=!0,Lr.then(jt))}function oe(n){Xe.push(n)}var Ct=new Set,Ze=0;function jt(){let n=Ve;do{for(;Ze{He=null})),He}function Be(n,e,t){n.dispatchEvent(Nr(`${e?"intro":"outro"}${t}`))}var et=new Set,pe;function ae(){pe={r:0,c:[],p:pe}}function se(){pe.r||de(pe.c),pe=pe.p}function _(n,e){n&&n.i&&(et.delete(n),n.i(e))}function H(n,e,t,i){if(n&&n.o){if(et.has(n))return;et.add(n),pe.c.push(()=>{et.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}var Nn={duration:0};function En(n,e,t){let i=e(n,t),r=!1,o,a,s=0;function l(){o&&bt(n,o)}function c(){let{delay:f=0,duration:p=300,easing:y=_e,tick:g=T,css:v}=i||Nn;v&&(o=wt(n,0,1,p,f,y,v,s++)),g(0,1);let m=Cn()+f,x=m+p;a&&a.abort(),r=!0,oe(()=>Be(n,!0,"start")),a=An(C=>{if(r){if(C>=x)return g(1,0),Be(n,!0,"end"),l(),r=!1;if(C>=m){let E=y((C-m)/p);g(E,1-E)}}return r})}let u=!1;return{start(){u||(u=!0,bt(n),ge(i)?(i=i(),Pn().then(c)):c())},invalidate(){u=!1},end(){r&&(l(),r=!1)}}}function Pe(n,e,t,i){let r=e(n,t),o=i?0:1,a=null,s=null,l=null;function c(){l&&bt(n,l)}function u(p,y){let g=p.b-o;return y*=Math.abs(g),{a:o,b:p.b,d:g,duration:y,start:p.start,end:p.start+y,group:p.group}}function f(p){let{delay:y=0,duration:g=300,easing:v=_e,tick:m=T,css:x}=r||Nn,C={start:Cn()+y,b:p};p||(C.group=pe,pe.r+=1),a||s?s=C:(x&&(c(),l=wt(n,o,p,g,y,v,x)),p&&m(0,1),a=u(C,g),oe(()=>Be(n,p,"start")),An(E=>{if(s&&E>s.start&&(a=u(s,g),s=null,Be(n,a.b,"start"),x&&(c(),l=wt(n,o,a.b,a.duration,0,v,r.css))),a){if(E>=a.end)m(o=a.b,1-o),Be(n,a.b,"end"),s||(a.b?c():--a.group.r||de(a.group.c)),a=null;else if(E>=a.start){let D=E-a.start;o=a.a+a.d*v(D/a.duration),m(o,1-o)}}return!!(a||s)}))}return{run(p){ge(r)?Pn().then(()=>{r=r(),f(p)}):f(p)},end(){c(),a=s=null}}}function At(n,e){let t=e.token={};function i(r,o,a,s){if(e.token!==t)return;e.resolved=s;let l=e.ctx;a!==void 0&&(l=l.slice(),l[a]=s);let c=r&&(e.current=r)(l),u=!1;e.block&&(e.blocks?e.blocks.forEach((f,p)=>{p!==o&&f&&(ae(),H(f,1,1,()=>{e.blocks[p]===f&&(e.blocks[p]=null)}),se())}):e.block.d(1),c.c(),_(c,1),c.m(e.mount(),e.anchor),u=!0),e.block=c,e.blocks&&(e.blocks[o]=c),u&&jt()}if(Dr(n)){let r=Mn();if(n.then(o=>{fe(r),i(e.then,1,e.value,o),fe(null)},o=>{if(fe(r),i(e.catch,2,e.error,o),fe(null),!e.hasCatch)throw o}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function Fn(n,e,t){let i=e.slice(),{resolved:r}=n;n.current===n.then&&(i[n.value]=r),n.current===n.catch&&(i[n.error]=r),n.block.p(i,t)}var Da=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var Ia=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]);function We(n){n&&n.c()}function Ne(n,e,t,i){let{fragment:r,after_update:o}=n.$$;r&&r.m(e,t),i||oe(()=>{let a=n.$$.on_mount.map(yt).filter(ge);n.$$.on_destroy?n.$$.on_destroy.push(...a):de(a),n.$$.on_mount=[]}),o.forEach(oe)}function Ce(n,e){let t=n.$$;t.fragment!==null&&(de(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function zr(n,e){n.$$.dirty[0]===-1&&(Ue.push(n),Tr(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{let g=y.length?y[0]:p;return c.ctx&&r(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),u&&zr(n,f)),p}):[],c.update(),u=!0,de(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){Ir();let f=Pr(e.target);c.fragment&&c.fragment.l(f),f.forEach(P)}else c.fragment&&c.fragment.c();e.intro&&_(n.$$.fragment),Ne(n,e.target,e.anchor,e.customElement),Mr(),jt()}fe(l)}var Vr;typeof HTMLElement=="function"&&(Vr=class extends HTMLElement{constructor(){super();this.attachShadow({mode:"open"})}connectedCallback(){let{on_mount:n}=this.$$;this.$$.on_disconnect=n.map(yt).filter(ge);for(let e in this.$$.slotted)this.appendChild(this.$$.slotted[e])}attributeChangedCallback(n,e,t){this[n]=t}disconnectedCallback(){de(this.$$.on_disconnect)}$destroy(){Ce(this,1),this.$destroy=T}$on(n,e){if(!ge(e))return T;let t=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return t.push(e),()=>{let i=t.indexOf(e);i!==-1&&t.splice(i,1)}}$set(n){this.$$set&&!wn(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}});var K=class{$destroy(){Ce(this,1),this.$destroy=T}$on(e,t){if(!ge(t))return T;let i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{let r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!wn(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};function Rr(n){X(n,"svelte-ja9vc4","h3.svelte-ja9vc4{font-weight:400;margin:0}.feather.svelte-ja9vc4{text-align:center;color:var(--text-muted);font-size:0.9rem}")}function kn(n,e,t){let i=n.slice();return i[3]=e[t],i}function Ln(n,e,t){let i=n.slice();return i[6]=e[t],i}function Tn(n,e,t){let i=n.slice();return i[9]=e[t],i}function _n(n){let e,t,i,r=n[9].name+"",o,a,s,l=w("Website")+"",c,u;return{c(){e=A("div"),t=A("div"),i=A("div"),o=R(r),a=F(),s=A("a"),c=R(l),b(i,"class","setting-item-name"),b(t,"class","setting-item-info"),b(s,"class","setting-item-control"),b(s,"href",u=n[9].url),b(e,"class","setting-item")},m(f,p){N(f,e,p),S(e,t),S(t,i),S(i,o),S(e,a),S(e,s),S(s,c)},p(f,p){p&2&&r!==(r=f[9].name+"")&&W(o,r),p&2&&u!==(u=f[9].url)&&b(s,"href",u)},d(f){f&&P(e)}}}function zn(n){let e,t=n[9].offline===!1&&_n(n);return{c(){t&&t.c(),e=ce()},m(i,r){t&&t.m(i,r),N(i,e,r)},p(i,r){i[9].offline===!1?t?t.p(i,r):(t=_n(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&P(e)}}}function Vn(n){let e,t,i,r=n[6].name+"",o,a,s,l=w("Website")+"",c,u;return{c(){e=A("div"),t=A("div"),i=A("div"),o=R(r),a=F(),s=A("a"),c=R(l),b(i,"class","setting-item-name"),b(t,"class","setting-item-info"),b(s,"class","setting-item-control"),b(s,"href",u=n[6].url),b(e,"class","setting-item")},m(f,p){N(f,e,p),S(e,t),S(t,i),S(i,o),S(e,a),S(e,s),S(s,c)},p(f,p){p&1&&r!==(r=f[6].name+"")&&W(o,r),p&1&&u!==(u=f[6].url)&&b(s,"href",u)},d(f){f&&P(e)}}}function Rn(n){let e,t=n[6].offline===!1&&Vn(n);return{c(){t&&t.c(),e=ce()},m(i,r){t&&t.m(i,r),N(i,e,r)},p(i,r){i[6].offline===!1?t?t.p(i,r):(t=Vn(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&P(e)}}}function Un(n){let e,t,i,r=n[3].name+"",o,a,s,l=w("Website")+"",c,u,f;return{c(){e=A("div"),t=A("div"),i=A("div"),o=R(r),a=F(),s=A("a"),c=R(l),f=F(),b(i,"class","setting-item-name"),b(t,"class","setting-item-info"),b(s,"class","setting-item-control"),b(s,"href",u=n[3].url),b(e,"class","setting-item")},m(p,y){N(p,e,y),S(e,t),S(t,i),S(i,o),S(e,a),S(e,s),S(s,c),S(e,f)},p(p,y){y&4&&r!==(r=p[3].name+"")&&W(o,r),y&4&&u!==(u=p[3].url)&&b(s,"href",u)},d(p){p&&P(e)}}}function Ur(n){let e,t,i,r,o,a,s,l,c,u,f,p,y,g=w('This Plugin is using Feather Icons')+"",v=n[1],m=[];for(let j=0;j{"synonymAPIs"in a&&t(0,i=a.synonymAPIs),"definitionAPIs"in a&&t(1,r=a.definitionAPIs),"partOfSpeechAPIs"in a&&t(2,o=a.partOfSpeechAPIs)},[i,r,o]}var Hn=class extends K{constructor(e){super();Z(this,e,Hr,Ur,Q,{synonymAPIs:0,definitionAPIs:1,partOfSpeechAPIs:2},Rr)}},Bn=Hn;var tt=class extends U.PluginSettingTab{constructor(e,t){super(e,t);this.plugin=t}display(){let{containerEl:e,plugin:t}=this;if(e.empty(),e.createEl("h2",{text:w("Dictionary Settings")}),new U.Setting(e).setName(w("Language")).setDesc(w("The Language the Plugin will use to search for Definitions and Pronunciations.")).addDropdown(o=>{for(let a in Se)o.addOption(a,Se[a]);o.setValue(t.settings.normalLang).onChange(a=>M(this,null,function*(){t.settings.defaultLanguage=a,t.settings.normalLang=a,yield this.save(),this.display()}))}),new U.Setting(e).setName("Get Language from File").setDesc('Use the lang or language key in the frontmatter to set the Language dependent on your open File. Example: lang: "en_US" or language: "de".').addToggle(o=>{o.setValue(this.plugin.settings.getLangFromFile).onChange(a=>M(this,null,function*(){this.plugin.settings.getLangFromFile=a,yield this.plugin.saveSettings()}))}),new U.Setting(e).setName(w("Definition Provider")).setDesc(w("The API the Plugin will use to search for Definitions.")).addDropdown(o=>{var s;let a={};for(let l of t.manager.definitionProvider)l.supportedLanguages.contains(t.settings.defaultLanguage)&&(a[l.name]=l.name);o.addOptions(a).setValue((s=t.settings.apiSettings[t.settings.defaultLanguage].definitionApiName)!=null?s:Object.keys(a).first()).onChange(l=>M(this,null,function*(){t.settings.apiSettings[t.settings.defaultLanguage].definitionApiName=l,yield this.save()}))}),new U.Setting(e).setName(w("Synonym Provider")).setDesc(w("The API the Plugin will use to search for Synonyms.")).addDropdown(o=>{var s;let a={};for(let l of t.manager.synonymProvider)l.supportedLanguages.contains(t.settings.defaultLanguage)&&(a[l.name]=l.name);o.addOptions(a).setValue((s=t.settings.apiSettings[t.settings.defaultLanguage].synonymApiName)!=null?s:Object.keys(a).first()).onChange(l=>M(this,null,function*(){t.settings.apiSettings[t.settings.defaultLanguage].synonymApiName=l,yield this.save()}))}),new U.Setting(e).setName(w("Synonym Suggestions")).setDesc(w("Show synonyms for highlighted words")).addToggle(o=>{t.settings.shouldShowSynonymPopover?o.setValue(!0):o.setValue(!1),o.onChange(a=>M(this,null,function*(){t.settings.shouldShowSynonymPopover=a,yield this.save()}))}),t.manager.partOfSpeechProvider.length){let o=document.createDocumentFragment();o.append(w("Enabling this will allow the Plugin to analyze full sentences to better suggest synonyms based on the context."),o.createEl("br"),w("Click "),o.createEl("a",{href:"https://github.com/phibr0/obsidian-dictionary#privacy",text:w("here")}),w(" for Privacy Concerns.")),new U.Setting(e).setName(w("Advanced Synonym Search")).setDesc(o).addToggle(a=>{a.setValue(t.settings.advancedSynonymAnalysis),a.onChange(s=>M(this,null,function*(){t.settings.advancedSynonymAnalysis=s,yield this.save()}))})}new U.Setting(e).setName(w("Show Options in Context Menu")).setDesc(w("Enable custom Context Menu with options to search for synonyms (only if the auto suggestions are disabled) and to look up a full definition in the Sidebar. Warning: This will override Obsidian's default Context Menu.")).addToggle(o=>{t.settings.shouldShowCustomContextMenu?o.setValue(!0):o.setValue(!1),o.onChange(a=>M(this,null,function*(){t.settings.shouldShowCustomContextMenu=a,yield this.save()}))}),e.createEl("h3",{text:w("Local-Dictionary-Builder Settings")}),new U.Setting(e).setName(w("Local Dictionary Folder")).setDesc(w("Specify a Folder, where all new Notes created by the Dictionary are placed. Please note that this Folder needs to already exist.")).addText(o=>o.setPlaceholder(w("Dictionary")).setValue(t.settings.folder).onChange(a=>M(this,null,function*(){t.settings.folder=a,yield this.save()}))),new U.Setting(e).setName(w("Use Language specific Subfolders")).setDesc(w('Create Subfolders for every language, e.g. "Dictionary/en-US/Cake"')).addToggle(o=>{o.setValue(t.settings.languageSpecificSubFolders),o.onChange(a=>M(this,null,function*(){t.settings.languageSpecificSubFolders=a,yield this.save()}))}),new U.Setting(e).setName(w("Capitalize File Name")).setDesc(w("If you disable this, the names of newly created files will be all lowercase.")).addToggle(o=>{o.setValue(t.settings.capitalizedFileName),o.onChange(a=>M(this,null,function*(){t.settings.capitalizedFileName=a,yield this.save()}))}),new U.Setting(e).setName(w("Filename Prefix and Suffix")).setDesc(w("Here you can add a Prefix and Suffix for your newly created Files.")).setClass("dictionaryprefixsuffix").addText(o=>o.setPlaceholder(w("Prefix")).setValue(t.settings.prefix).onChange(a=>M(this,null,function*(){t.settings.prefix=a,yield this.save()}))).addText(o=>o.setPlaceholder(w("Suffix")).setValue(t.settings.suffix).onChange(a=>M(this,null,function*(){t.settings.suffix=a,yield this.save()})));let i=document.createDocumentFragment();i.append(w("Here you can edit the Template for newly created Files."),i.createEl("br"),i.createEl("a",{href:"https://github.com/phibr0/obsidian-dictionary#variables",text:w("Click for a List of Variables")})),new U.Setting(e).setName(w("Template")).setDesc(i).setClass("dictionarytextarea").addTextArea(o=>o.setPlaceholder(Me.template).setValue(t.settings.template).onChange(a=>M(this,null,function*(){t.settings.template=a,yield this.save()}))).addExtraButton(o=>{o.setIcon("reset").setTooltip(w("Reset to default")).setDisabled(this.plugin.settings.template===Me.template).onClick(()=>M(this,null,function*(){this.plugin.settings.template=Me.template,yield this.plugin.saveSettings()}))}),e.createEl("h3",{text:w("Caching Settings")}),new U.Setting(e).setName(w("Use Caching")).setDesc(w("Enable or disable caching. Caching provides a semi-offline experience by saving every result for later use.")).addToggle(o=>{o.setValue(t.settings.useCaching),o.onChange(a=>M(this,null,function*(){t.settings.useCaching=a,yield this.save()}))});let r=document.createDocumentFragment();r.append(w("Here you can delete all cached Data."),i.createEl("br"),w("You currently have "),t.cache.cachedDefinitions.length.toString(),w(" cached Definitions and "),t.cache.cachedSynonyms.length.toString(),w(" cached Synonyms.")),new U.Setting(e).setName(w("Delete Cache")).setDesc(r).addButton(o=>{o.setDisabled(!t.settings.useCaching),o.setButtonText(w("Delete")),o.onClick(()=>M(this,null,function*(){t.cache.cachedSynonyms=[],t.cache.cachedDefinitions=[],yield this.plugin.saveCache(),new U.Notice(w("Success")),this.display()}))}),e.createEl("h3",{text:w("Miscellaneous")}),new U.Setting(e).setName(w("More Information")).setDesc(w("View Information about the API's and the Plugin itself.")).setClass("extra").addButton(o=>{o.setButtonText(w("More Info")),o.onClick(a=>{new Wn(t).open()})}),new U.Setting(e).setName(w("Donate")).setDesc(w("If you like this Plugin, consider donating to support continued development:")).setClass("extra").addButton(o=>{o.buttonEl.outerHTML=''})}save(){return M(this,null,function*(){yield this.plugin.saveSettings()})}},Wn=class extends U.Modal{constructor(e){super(e.app);this.plugin=e}onOpen(){this.contentEl.parentElement.style.padding="10px 12px",this._view=new Bn({target:this.contentEl,props:{synonymAPIs:this.plugin.manager.synonymProvider,definitionAPIs:this.plugin.manager.definitionProvider,partOfSpeechAPIs:this.plugin.manager.partOfSpeechProvider}})}onClose(){this._view.$destroy(),this.contentEl.empty()}};var tr=G(require("obsidian"));var pi=G(fi()),{__extends:za,__assign:Va,__rest:Ra,__decorate:Ua,__param:Ha,__metadata:Ba,__awaiter:hi,__generator:Wa,__exportStar:$a,__createBinding:Ga,__values:qa,__read:Ya,__spread:Ja,__spreadArrays:Ka,__spreadArray:Qa,__await:Xa,__asyncGenerator:Za,__asyncDelegator:es,__asyncValues:ts,__makeTemplateObject:ns,__importStar:is,__importDefault:rs,__classPrivateFieldGet:os,__classPrivateFieldSet:as,__classPrivateFieldIn:ss}=pi.default;function yi(n){let e=n-1;return e*e*e+1}function mi(n,{delay:e=0,duration:t=400,easing:i=_e}={}){let r=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:o=>`opacity: ${o*r}`}}function Fe(n,{delay:e=0,duration:t=400,easing:i=yi}={}){let r=getComputedStyle(n),o=+r.opacity,a=parseFloat(r.height),s=parseFloat(r.paddingTop),l=parseFloat(r.paddingBottom),c=parseFloat(r.marginTop),u=parseFloat(r.marginBottom),f=parseFloat(r.borderTopWidth),p=parseFloat(r.borderBottomWidth);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};height: ${y*a}px;padding-top: ${y*s}px;padding-bottom: ${y*l}px;margin-top: ${y*c}px;margin-bottom: ${y*u}px;border-top-width: ${y*f}px;border-bottom-width: ${y*p}px;`}}function Br(n){X(n,"svelte-1ufvm6z",'@charset "UTF-8";.opener.svelte-1ufvm6z.svelte-1ufvm6z{display:flex}.opener.svelte-1ufvm6z .collapse-icon.svelte-1ufvm6z::after{content:"\xA0"}.opener.svelte-1ufvm6z svg.svelte-1ufvm6z{transform:rotate(-90deg)}.opener.open.svelte-1ufvm6z svg.svelte-1ufvm6z{transform:rotate(0)}.main.svelte-1ufvm6z.svelte-1ufvm6z{background-color:var(--background-secondary);padding-left:0.6rem;padding-right:0.6rem;padding-top:0.3rem;padding-bottom:0.3rem;margin-bottom:0.3rem;border-radius:0.3rem;overflow:hidden;text-overflow:ellipsis}audio.svelte-1ufvm6z.svelte-1ufvm6z{margin-top:0.3rem}')}function Wr(n){let e=n[0].replace("/","").replace("/","")+"",t;return{c(){t=R(e)},m(i,r){N(i,t,r)},p(i,r){r&1&&e!==(e=i[0].replace("/","").replace("/","")+"")&&W(t,e)},d(i){i&&P(t)}}}function $r(n){let e,t,i,r=n[0].replace("/","").replace("/","")+"",o,a,s,l,c,u=n[2]&&gi(n);return{c(){e=A("div"),t=A("div"),t.innerHTML='',i=F(),o=R(r),a=F(),u&&u.c(),s=ce(),b(t,"class","tree-item-icon collapse-icon svelte-1ufvm6z"),b(t,"style",""),b(e,"class","opener svelte-1ufvm6z"),re(e,"open",n[2])},m(f,p){N(f,e,p),S(e,t),S(e,i),S(e,o),N(f,a,p),u&&u.m(f,p),N(f,s,p),l||(c=Y(e,"click",n[3]),l=!0)},p(f,p){p&1&&r!==(r=f[0].replace("/","").replace("/","")+"")&&W(o,r),p&4&&re(e,"open",f[2]),f[2]?u?(u.p(f,p),p&4&&_(u,1)):(u=gi(f),u.c(),_(u,1),u.m(s.parentNode,s)):u&&(ae(),H(u,1,1,()=>{u=null}),se())},d(f){f&&P(e),f&&P(a),u&&u.d(f),f&&P(s),l=!1,c()}}}function gi(n){let e,t,i,r,o,a;return{c(){e=A("div"),t=A("audio"),i=A("source"),mt(i.src,r=n[1].startsWith("http")?n[1]:"https:"+n[1])||b(i,"src",r),b(i,"type","audio/mpeg"),t.controls=!0,b(t,"class","svelte-1ufvm6z")},m(s,l){N(s,e,l),S(e,t),S(t,i),a=!0},p(s,l){(!a||l&2&&!mt(i.src,r=s[1].startsWith("http")?s[1]:"https:"+s[1]))&&b(i,"src",r)},i(s){a||(s&&oe(()=>{o||(o=Pe(e,Fe,{duration:100},!0)),o.run(1)}),a=!0)},o(s){s&&(o||(o=Pe(e,Fe,{duration:100},!1)),o.run(0)),a=!1},d(s){s&&P(e),s&&o&&o.end()}}}function Gr(n){let e;function t(o,a){return o[1]?$r:Wr}let i=t(n,-1),r=i(n);return{c(){e=A("div"),r.c(),b(e,"class","main svelte-1ufvm6z")},m(o,a){N(o,e,a),r.m(e,null)},p(o,[a]){i===(i=t(o,a))&&r?r.p(o,a):(r.d(1),r=i(o),r&&(r.c(),r.m(e,null)))},i:T,o:T,d(o){o&&P(e),r.d()}}}function qr(n,e,t){let{text:i}=e,{audio:r}=e;addEventListener("dictionary-collapse",s=>t(2,o=s.detail.open));let o=!1,a=()=>t(2,o=!o);return n.$$set=s=>{"text"in s&&t(0,i=s.text),"audio"in s&&t(1,r=s.audio)},[i,r,o,a]}var vi=class extends K{constructor(e){super();Z(this,e,qr,Gr,Q,{text:0,audio:1},Br)}},xi=vi;var Pt=G(require("obsidian"));var Ci=G(Ot());function ao(n){X(n,"svelte-5jhpts",'@charset "UTF-8";.definition.svelte-5jhpts>p.svelte-5jhpts{user-select:text}.opener.svelte-5jhpts.svelte-5jhpts{display:flex}.opener.svelte-5jhpts .collapse-icon.svelte-5jhpts::after{content:"\xA0"}.opener.svelte-5jhpts svg.svelte-5jhpts{transform:rotate(-90deg)}.opener.open.svelte-5jhpts svg.svelte-5jhpts{transform:rotate(0)}.antonym.svelte-5jhpts.svelte-5jhpts,.synonym.svelte-5jhpts.svelte-5jhpts{transition:100ms}.antonym.svelte-5jhpts.svelte-5jhpts:hover,.synonym.svelte-5jhpts.svelte-5jhpts:hover{color:var(--interactive-accent);border-radius:2px}.main.svelte-5jhpts.svelte-5jhpts{background-color:var(--background-secondary);padding-left:0.6rem;padding-right:0.6rem;padding-top:0.3rem;padding-bottom:0.3rem;margin-bottom:0.3rem;border-radius:0.3rem}.main.svelte-5jhpts blockquote.svelte-5jhpts{font-style:italic;margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--background-modifier-border)}.main.svelte-5jhpts .mark{box-shadow:inset 0 -2px var(--text-faint)}.label.svelte-5jhpts.svelte-5jhpts{font-size:0.875em;font-weight:bold}.antonyms.svelte-5jhpts.svelte-5jhpts,.synonyms.svelte-5jhpts.svelte-5jhpts{padding-top:1rem}.antonyms.svelte-5jhpts>p.svelte-5jhpts,.synonyms.svelte-5jhpts>p.svelte-5jhpts,.definition.svelte-5jhpts>p.svelte-5jhpts{margin-top:0}.definition.svelte-5jhpts.svelte-5jhpts{padding:1.5rem 0;border-bottom:1px solid var(--background-modifier-border)}.definition.svelte-5jhpts.svelte-5jhpts:last-child{border-bottom:none}')}function ji(n,e,t){let i=n.slice();return i[8]=e[t],i[10]=t,i}function Ai(n,e,t){let i=n.slice();return i[11]=e[t],i[10]=t,i}function Di(n,e,t){let i=n.slice();return i[13]=e[t],i[10]=t,i}function Ii(n){let e,t,i,r=n[1],o=[];for(let a=0;a{t||(t=Pe(e,Fe,{duration:150},!0)),t.run(1)}),i=!0)},o(a){a&&(t||(t=Pe(e,Fe,{duration:150},!1)),t.run(0)),i=!1},d(a){a&&P(e),ee(o,a),a&&t&&t.end()}}}function Mi(n){let e,t,i,r=n[8].definition+"",o;return{c(){e=A("div"),e.textContent=`${w("Definition:")}`,t=F(),i=A("p"),o=R(r),b(e,"class","label svelte-5jhpts"),b(i,"class","svelte-5jhpts")},m(a,s){N(a,e,s),N(a,t,s),N(a,i,s),S(i,o)},p(a,s){s&2&&r!==(r=a[8].definition+"")&&W(o,r)},d(a){a&&P(e),a&&P(t),a&&P(i)}}}function Oi(n){let e,t=n[8].example.replace(new RegExp(`(${n[0]})`,"gi"),'$1')+"";return{c(){e=A("blockquote"),b(e,"class","svelte-5jhpts")},m(i,r){N(i,e,r),e.innerHTML=t},p(i,r){r&3&&t!==(t=i[8].example.replace(new RegExp(`(${i[0]})`,"gi"),'$1')+"")&&(e.innerHTML=t)},d(i){i&&P(e)}}}function Pi(n){let e,t,i,r,o=n[8].synonyms,a=[];for(let s=0;s',r=F(),a=R(o),s=F(),u&&u.c(),b(i,"class","tree-item-icon collapse-icon svelte-5jhpts"),b(i,"style",""),b(t,"class","opener svelte-5jhpts"),re(t,"open",n[3]),b(e,"class","main svelte-5jhpts")},m(p,y){N(p,e,y),S(e,t),S(t,i),S(t,r),S(t,a),S(e,s),u&&u.m(e,null),l||(c=Y(t,"click",n[5]),l=!0)},p(p,[y]){var g;y&4&&o!==(o=((g=p[2])!=null?g:"")+"")&&W(a,o),y&8&&re(t,"open",p[3]),p[3]?u?(u.p(p,y),y&8&&_(u,1)):(u=Ii(p),u.c(),_(u,1),u.m(e,null)):u&&(ae(),H(u,1,1,()=>{u=null}),se())},i(p){_(u)},o(p){H(u)},d(p){p&&P(e),u&&u.d(),l=!1,c()}}}function lo(n,e,t){let{word:i}=e,{definitions:r}=e,{partOfSpeech:o}=e,a=!1;addEventListener("dictionary-collapse",f=>{t(3,a=f.detail.open)});function s(f){(0,Ci.copy)(f,()=>new Pt.Notice(w('Copied "{{word}}" to clipboard').replace(/{{word}}/g,f)),p=>new Pt.Notice(p))}let l=()=>t(3,a=!a),c=f=>s(f),u=f=>s(f);return n.$$set=f=>{"word"in f&&t(0,i=f.word),"definitions"in f&&t(1,r=f.definitions),"partOfSpeech"in f&&t(2,o=f.partOfSpeech)},[i,r,o,a,s,l,c,u]}var _i=class extends K{constructor(e){super();Z(this,e,lo,so,Q,{word:0,definitions:1,partOfSpeech:2},ao)}},zi=_i;function co(n){X(n,"svelte-1lk7r5d",".error.svelte-1lk7r5d{text-align:center;width:100%;color:var(--text-muted)}.errorDescription.svelte-1lk7r5d{text-align:center;width:100%;font-size:0.9em;color:var(--text-faint)}")}function uo(n){var u;let e,t,i,r,o,a,s,l=((u=n[0])!=null?u:"")+"",c;return{c(){e=A("div"),t=A("p"),t.textContent="Something went wrong..",i=F(),r=A("p"),r.textContent=`${w("I can't find the word you are looking for or the server can't be reached. You can try again in a few minutes.")}`,o=F(),a=A("details"),s=A("summary"),s.textContent=`${w("View Error")}`,c=R(l),b(t,"class","error svelte-1lk7r5d"),b(r,"class","errorDescription svelte-1lk7r5d"),b(a,"class","errorDescription svelte-1lk7r5d"),b(e,"class","main")},m(f,p){N(f,e,p),S(e,t),S(e,i),S(e,r),S(e,o),S(e,a),S(a,s),S(a,c)},p(f,[p]){var y;p&1&&l!==(l=((y=f[0])!=null?y:"")+"")&&W(c,l)},i:T,o:T,d(f){f&&P(e)}}}function fo(n,e,t){let{error:i}=e;return Re(()=>{console.error(i)}),n.$$set=r=>{"error"in r&&t(0,i=r.error)},[i]}var Vi=class extends K{constructor(e){super();Z(this,e,fo,uo,Q,{error:0},co)}},Ri=Vi;function po(n){X(n,"svelte-v5d940",".main.svelte-v5d940{background-color:var(--background-secondary);padding-left:0.6rem;padding-right:0.6rem;padding-top:0.3rem;padding-bottom:0.3rem;margin-bottom:0.3rem;border-radius:0.3rem;user-select:text}")}function ho(n){let e,t=n[0].origin+"",i;return{c(){e=A("div"),i=R(t),b(e,"class","main svelte-v5d940")},m(r,o){N(r,e,o),S(e,i)},p(r,[o]){o&1&&t!==(t=r[0].origin+"")&&W(i,t)},i:T,o:T,d(r){r&&P(e)}}}function yo(n,e,t){let{data:i}=e;return n.$$set=r=>{"data"in r&&t(0,i=r.data)},[i]}var Ui=class extends K{constructor(e){super();Z(this,e,yo,ho,Q,{data:0},po)}},Hi=Ui;var we=G(require("obsidian"));function mo(n){X(n,"svelte-17ilbu5",'.contents.svelte-17ilbu5.svelte-17ilbu5{height:calc(100% - 5rem);overflow-y:auto}.results.svelte-17ilbu5.svelte-17ilbu5{display:flex;flex-wrap:wrap}.container.svelte-17ilbu5.svelte-17ilbu5{max-width:30vw;width:100%;margin:auto;background-color:var(--background-primary-alt);padding-left:0.5rem;padding-right:0.5rem;padding-top:0.3rem;padding-bottom:0.3rem;margin-top:0.5rem;border-radius:0.3rem}.container.svelte-17ilbu5>h3.svelte-17ilbu5{margin-top:0.3rem;margin-bottom:0.3rem;font-weight:normal}.center.svelte-17ilbu5.svelte-17ilbu5{margin:auto;width:100%;margin-top:2rem}@keyframes svelte-17ilbu5-spinner{0%{transform:translate3d(-50%, -50%, 0) rotate(0deg)}100%{transform:translate3d(-50%, -50%, 0) rotate(360deg)}}.spinner.svelte-17ilbu5.svelte-17ilbu5{height:3rem;opacity:1;position:relative;transition:opacity linear 0.1s}.spinner.svelte-17ilbu5.svelte-17ilbu5::before{animation:2s linear infinite svelte-17ilbu5-spinner;border:solid 3px var(--background-modifier-border);border-bottom-color:var(--interactive-accent);border-radius:50%;content:"";height:40px;left:50%;opacity:inherit;position:absolute;top:50%;transform:translate3d(-50%, -50%, 0);transform-origin:center;width:40px;will-change:transform}')}function Bi(n,e,t){let i=n.slice();return i[22]=e[t].definitions,i[23]=e[t].partOfSpeech,i}function Wi(n,e,t){let i=n.slice();return i[26]=e[t].text,i[27]=e[t].audio,i}function $i(n){let e,t,i,r;return{c(){e=A("div"),b(e,"class","search-input-clear-button"),b(e,"aria-label",t=w("Clear"))},m(o,a){N(o,e,a),i||(r=Y(e,"click",n[9]),i=!0)},p:T,d(o){o&&P(e),i=!1,r()}}}function go(n){let e;return{c(){e=A("div"),e.innerHTML='
',b(e,"class","center svelte-17ilbu5")},m(t,i){N(t,e,i)},p:T,i:T,o:T,d(t){t&&P(e)}}}function vo(n){let e,t,i,r={ctx:n,current:null,token:null,hasCatch:!0,pending:bo,then:wo,catch:xo,value:21,error:30,blocks:[,,,]};return At(t=n[2],r),{c(){e=ce(),r.block.c()},m(o,a){N(o,e,a),r.block.m(o,r.anchor=a),r.mount=()=>e.parentNode,r.anchor=e,i=!0},p(o,a){n=o,r.ctx=n,a&4&&t!==(t=n[2])&&At(t,r)||Fn(r,n,a)},i(o){i||(_(r.block),i=!0)},o(o){for(let a=0;a<3;a+=1){let s=r.blocks[a];H(s)}i=!1},d(o){o&&P(e),r.block.d(o),r.token=null,r=null}}}function xo(n){let e,t;return e=new Ri({props:{error:n[30]}}),{c(){We(e.$$.fragment)},m(i,r){Ne(e,i,r),t=!0},p(i,r){let o={};r&4&&(o.error=i[30]),e.$set(o)},i(i){t||(_(e.$$.fragment,i),t=!0)},o(i){H(e.$$.fragment,i),t=!1},d(i){Ce(e,i)}}}function wo(n){var g,v;let e,t=(v=(g=n[21].phonetics)==null?void 0:g.first())==null?void 0:v.text,i,r,o,a,s,l,c=t&&Gi(n),u=n[21].meanings,f=[];for(let m=0;mH(f[m],1,1,()=>{f[m]=null}),y=n[21].origin&&Ji(n);return{c(){e=A("div"),c&&c.c(),i=F(),r=A("div"),o=A("h3"),o.textContent=`${w("Meanings")}`,a=F();for(let m=0;m{c=null}),se()),x&4){u=m[21].meanings;let D;for(D=0;D{y=null}),se())},i(m){if(!l){_(c);for(let x=0;xH(a[l],1,1,()=>{a[l]=null});return{c(){e=A("div"),t=A("h3"),t.textContent=`${w("Pronunciation")}`,i=F();for(let l=0;l',b(e,"class","center svelte-17ilbu5")},m(t,i){N(t,e,i)},p:T,i:T,o:T,d(t){t&&P(e)}}}function So(n){let e,t,i,r,o,a,s,l,c,u,f,p,y,g,v,m,x,C,E,D,j,k,I,O,B,ye,Ae,be,J=n[0]&&$i(n),De=[vo,go],$=[];function ue(L,q){return q&1&&(I=null),L[2]&&L[0]===L[1]?0:(I==null&&(I=!!L[0].trim()),I?1:-1)}return~(O=ue(n,-1))&&(B=$[O]=De[O](n)),{c(){e=A("div"),t=A("div"),r=F(),o=A("div"),s=F(),l=A("div"),u=F(),f=A("div"),y=F(),g=A("div"),m=F(),x=A("div"),C=A("input"),D=F(),J&&J.c(),j=F(),k=A("div"),B&&B.c(),b(t,"id","languageModal"),b(t,"class","nav-action-button"),b(t,"aria-label",i=w("Change Language")),b(o,"id","apiModal"),b(o,"class","nav-action-button"),b(o,"aria-label",a=w("Change Provider")),b(l,"id","openAndCloseAll"),b(l,"class","nav-action-button"),b(l,"aria-label",c=w("Collapse Results")),re(l,"is-active",n[5]),b(f,"id","matchCaseBtn"),b(f,"class","nav-action-button"),b(f,"aria-label",p=w("Match Case")),re(f,"is-active",n[4]),b(g,"id","localDictionaryBuilder"),b(g,"class","nav-action-button"),b(g,"aria-label",v=w("New Note")),b(e,"class","nav-buttons-container"),b(C,"id","dictionary-search-input"),b(C,"type","text"),b(C,"spellcheck","true"),b(C,"placeholder",E=w("Enter a word")),b(x,"class","search-input-container"),b(k,"class","contents svelte-17ilbu5")},m(L,q){N(L,e,q),S(e,t),n[13](t),S(e,r),S(e,o),n[14](o),S(e,s),S(e,l),n[15](l),S(e,u),S(e,f),n[16](f),S(e,y),S(e,g),n[18](g),N(L,m,q),N(L,x,q),S(x,C),xt(C,n[0]),S(x,D),J&&J.m(x,null),N(L,j,q),N(L,k,q),~O&&$[O].m(k,null),ye=!0,Ae||(be=[Y(t,"click",Co),Y(o,"click",jo),Y(l,"click",n[7]),Y(f,"click",n[17]),Y(g,"click",n[10]),Y(C,"input",n[19]),Y(C,"keydown",n[8]),Y(C,"keydown",n[6])],Ae=!0)},p(L,[q]){(!ye||q&32)&&re(l,"is-active",L[5]),(!ye||q&16)&&re(f,"is-active",L[4]),q&1&&C.value!==L[0]&&xt(C,L[0]),L[0]?J?J.p(L,q):(J=$i(L),J.c(),J.m(x,null)):J&&(J.d(1),J=null);let ie=O;O=ue(L,q),O===ie?~O&&$[O].p(L,q):(B&&(ae(),H($[ie],1,1,()=>{$[ie]=null}),se()),~O?(B=$[O],B?B.p(L,q):(B=$[O]=De[O](L),B.c()),_(B,1),B.m(k,null)):B=null)},i(L){ye||(_(B),ye=!0)},o(L){H(B),ye=!1},d(L){L&&P(e),n[13](null),n[14](null),n[15](null),n[16](null),n[18](null),L&&P(m),L&&P(x),J&&J.d(),L&&P(j),L&&P(k),~O&&$[O].d(),Ae=!1,de(be)}}}function Co(){dispatchEvent(new Event("dictionary-open-language-switcher"))}function jo(){dispatchEvent(new Event("dictionary-open-api-switcher"))}function Ao(n,e,t){let{manager:i}=e,{localDictionary:r}=e,{query:o=""}=e,a=null,s,l=[];Re(()=>setTimeout(()=>{(0,we.setIcon)(l[0],"languages",20),(0,we.setIcon)(l[1],"cloud",20),(0,we.setIcon)(l[2],"bullet-list",20),(0,we.setIcon)(l[3],"uppercase-lowercase-a",20),(0,we.setIcon)(l[4],"documents",20)},0));let c=(0,we.debounce)(f,800,!0),u=!0;function f(){o.trim()&&(t(1,a=o),t(2,s=i.requestDefinitions(u?o:o.toLowerCase())))}let p=!1;function y(){dispatchEvent(new CustomEvent("dictionary-collapse",{detail:{open:!p}})),t(5,p=!p)}function g(O){O.key==="Enter"&&f()}function v(){t(0,o=""),t(1,a=null),t(2,s=null),document.querySelector("#dictionary-search-input").focus()}function m(O){return hi(this,void 0,void 0,function*(){o.trim()&&s&&(yield r.newNote(yield s,!O.ctrlKey))})}addEventListener("obsidian-dictionary-plugin-search",O=>{t(0,o=O.detail.query),f()}),addEventListener("dictionary-focus-on-search",()=>{document.querySelector("#dictionary-search-input").focus()});function x(O){ve[O?"unshift":"push"](()=>{l[0]=O,t(3,l)})}function C(O){ve[O?"unshift":"push"](()=>{l[1]=O,t(3,l)})}function E(O){ve[O?"unshift":"push"](()=>{l[2]=O,t(3,l)})}function D(O){ve[O?"unshift":"push"](()=>{l[3]=O,t(3,l)})}let j=()=>t(4,u=!u);function k(O){ve[O?"unshift":"push"](()=>{l[4]=O,t(3,l)})}function I(){o=this.value,t(0,o)}return n.$$set=O=>{"manager"in O&&t(11,i=O.manager),"localDictionary"in O&&t(12,r=O.localDictionary),"query"in O&&t(0,o=O.query)},[o,a,s,l,u,p,c,y,g,v,m,i,r,x,C,E,D,j,k,I]}var Ki=class extends K{constructor(e){super();Z(this,e,Ao,So,Q,{manager:11,localDictionary:12,query:0},mo)}},Qi=Ki;var Xi=G(require("obsidian"));var ke=class extends Xi.FuzzySuggestModal{constructor(e,t){super(e);this.plugin=t,this.setPlaceholder(w("Choose a Language"))}getItems(){let e=[];for(let t in Se)e.push(t);return e}getItemText(e){return e==this.plugin.settings.defaultLanguage?Se[e]+" \u{1F5F8}":Se[e]}onChooseItem(e){return M(this,null,function*(){this.plugin.settings.defaultLanguage=e,this.plugin.settings.normalLang=e,yield this.plugin.saveSettings(),this.close()})}};var er=G(require("obsidian"));var Zi=G(require("obsidian"));var ot=class extends Zi.FuzzySuggestModal{constructor(e,t){super(e);this.available=[];this.plugin=t;for(let i=0;i{new ke(this.app,this.plugin).open()}),addEventListener("dictionary-open-api-switcher",()=>{new at(this.app,this.plugin).open()}),super.onOpen()}};var lt=G(require("obsidian")),Nt=class{constructor(e){this.name="Offline Dictionary";this.supportedLanguages=["en_US","en_GB","cn"];this.offline=!0;this.manager=e}requestDefinitions(e,t){return M(this,null,function*(){let i=(yield this.getOfflineDictionary())[e.toLowerCase()];if(!i)return Promise.reject("Word doesnt exist in Offline Dictionary");let r=[];i.readings.forEach(s=>{r.push({text:s})});let o=[];return i.defs.forEach(s=>{var c,u,f,p,y;let l=[];l.push({definition:t==="cn"?s.def_cn:s.def_en,example:t==="cn"?(u=(c=s.ext)==null?void 0:c.first())==null?void 0:u.ext_cn:(y=(p=(f=s.ext)==null?void 0:f.first())==null?void 0:p.ext_en)!=null?y:""}),o.push({partOfSpeech:t==="cn"?s.pos_cn:s.pos_en,definitions:l})}),{word:e,phonetics:r,meanings:o}})}getOfflineDictionary(){return M(this,null,function*(){let{plugin:e}=this.manager,{adapter:t}=e.app.vault,i=(0,lt.normalizePath)(`${e.manifest.dir}/offlineDictionary.json`);if(!this.offlineDic){if(!(yield t.exists(i))){let r=yield(0,lt.request)({url:`https://github.com/phibr0/obsidian-dictionary/releases/download/${e.manifest.version}/dictionary.json`});yield t.write(i,r)}this.offlineDic=JSON.parse(yield t.read(i))}return this.offlineDic})}};var Et=G(require("obsidian"));var je;(function(r){r[r.Noun=0]="Noun",r[r.Verb=1]="Verb",r[r.Adjective=2]="Adjective",r[r.Adverb=3]="Adverb"})(je||(je={}));var nr;(function(h){h.Adj="ADJ",h.COMBInADJ="COMB in ADJ",h.Empty="",h.\u4E0D\u53EF\u6570\u540D\u8BCD="\u4E0D\u53EF\u6570\u540D\u8BCD",h.\u4E0D\u53EF\u6570\u540D\u8BCD\u590D\u6570\u540D\u8BCD="\u4E0D\u53EF\u6570\u540D\u8BCD\uFF1B\u590D\u6570\u540D\u8BCD",h.\u4E0D\u53EF\u6570\u540D\u8BCD\u611F\u53F9\u8BCD="\u4E0D\u53EF\u6570\u540D\u8BCD\uFF1B\u611F\u53F9\u8BCD",h.\u4E0D\u53EF\u6570\u96C6\u5408\u540D\u8BCD="\u4E0D\u53EF\u6570\u96C6\u5408\u540D\u8BCD",h.\u4E0D\u5B9A\u4EE3\u8BCD="\u4E0D\u5B9A\u4EE3\u8BCD",h.\u4E0D\u5B9A\u526F\u8BCD="\u4E0D\u5B9A\u526F\u8BCD",h.\u4E0E\u526F\u8BCD\u6784\u6210\u7684\u8BCD="\u4E0E\u526F\u8BCD\u6784\u6210\u7684\u8BCD",h.\u4E0E\u52A8\u8BCD\u6784\u6210\u7684\u8BCD="\u4E0E\u52A8\u8BCD\u6784\u6210\u7684\u8BCD",h.\u4E0E\u540D\u8BCD\u6784\u6210\u7684\u8BCD="\u4E0E\u540D\u8BCD\u6784\u6210\u7684\u8BCD",h.\u4E0E\u5F62\u5BB9\u8BCD\u53EF\u6570\u540D\u8BCD\u6784\u6210\u7684\u8BCD="\u4E0E\u5F62\u5BB9\u8BCD\uFF0C\u53EF\u6570\u540D\u8BCD\u6784\u6210\u7684\u8BCD",h.\u4E0E\u5F62\u5BB9\u8BCD\u540D\u8BCD\u6784\u6210\u7684\u8BCD="\u4E0E\u5F62\u5BB9\u8BCD\uFF0C\u540D\u8BCD\u6784\u6210\u7684\u8BCD",h.\u4E0E\u5F62\u5BB9\u8BCD\u6784\u6210\u7684\u8BCD="\u4E0E\u5F62\u5BB9\u8BCD\u6784\u6210\u7684\u8BCD",h.\u4E0E\u6570\u91CF\u8BCD\u6784\u6210\u7684\u8BCD="\u4E0E\u6570\u91CF\u8BCD\u6784\u6210\u7684\u8BCD",h.\u4E0E\u989C\u8272\u8BCD\u6784\u6210\u7684\u8BCD="\u4E0E\u989C\u8272\u8BCD\u6784\u6210\u7684\u8BCD",h.\u4E13\u6709\u540D\u8BCD="\u4E13\u6709\u540D\u8BCD",h.\u4E13\u6709\u540D\u8BCD\u53EF\u6570\u540D\u8BCD="\u4E13\u6709\u540D\u8BCD\uFF1B\u53EF\u6570\u540D\u8BCD",h.\u4E13\u6709\u540D\u8BCD\u79F0\u547C\u540D\u8BCD="\u4E13\u6709\u540D\u8BCD\uFF1B\u79F0\u547C\u540D\u8BCD",h.\u4E13\u6709\u590D\u6570\u540D\u8BCD="\u4E13\u6709\u590D\u6570\u540D\u8BCD",h.\u4E13\u6709\u96C6\u5408\u540D\u8BCD="\u4E13\u6709\u96C6\u5408\u540D\u8BCD",h.\u4ECB\u8BCD="\u4ECB\u8BCD",h.\u4EE3\u8BCD="\u4EE3\u8BCD",h.\u4F5C\u8005\u540D="\u4F5C\u8005\u540D",h.\u5173\u7CFB\u4EE3\u8BCD="\u5173\u7CFB\u4EE3\u8BCD",h.\u5206\u6570\u8BCD="\u5206\u6570\u8BCD",h.\u524D\u7F00="\u524D\u7F00",h.\u524D\u7F6E\u9650\u5B9A\u8BCD="\u524D\u7F6E\u9650\u5B9A\u8BCD",h.\u526F\u8BCD="\u526F\u8BCD",h.\u526F\u8BCD\u6700\u9AD8\u7EA7\u5F62\u5F0F="\u526F\u8BCD\u6700\u9AD8\u7EA7\u5F62\u5F0F",h.\u526F\u8BCD\u6BD4\u8F83\u7EA7\u5F62\u5F0F="\u526F\u8BCD\u6BD4\u8F83\u7EA7\u5F62\u5F0F",h.\u52A8\u8BCD="\u52A8\u8BCD",h.\u52A9\u52A8\u8BCD="\u52A9\u52A8\u8BCD",h.\u5355\u6570\u540D\u8BCD="\u5355\u6570\u540D\u8BCD",h.\u5355\u6570\u540D\u8BCD\u58F0\u97F3\u8BCD="\u5355\u6570\u540D\u8BCD\uFF1B\u58F0\u97F3\u8BCD",h.\u5355\u6570\u540D\u8BCD\u5934\u8854\u540D\u8BCD="\u5355\u6570\u540D\u8BCD\uFF1B\u5934\u8854\u540D\u8BCD",h.\u5355\u6570\u578B\u4EE3\u8BCD="\u5355\u6570\u578B\u4EE3\u8BCD",h.\u5355\u6570\u96C6\u5408\u540D\u8BCD="\u5355\u6570\u96C6\u5408\u540D\u8BCD",h.\u5355\u6570\u96C6\u5408\u540D\u8BCD\u4E13\u6709\u96C6\u5408\u540D\u8BCD="\u5355\u6570\u96C6\u5408\u540D\u8BCD\uFF1B\u4E13\u6709\u96C6\u5408\u540D\u8BCD",h.\u53CA\u7269\u4E0D\u53CA\u7269\u52A8\u8BCD="\u53CA\u7269/\u4E0D\u53CA\u7269\u52A8\u8BCD",h.\u53CD\u8EAB\u4EE3\u8BCD="\u53CD\u8EAB\u4EE3\u8BCD",h.\u53EF\u53D8\u540D\u8BCD="\u53EF\u53D8\u540D\u8BCD",h.\u53EF\u53D8\u540D\u8BCD\u540D\u79F0\u540D\u8BCD="\u53EF\u53D8\u540D\u8BCD\uFF1B\u540D\u79F0\u540D\u8BCD",h.\u53EF\u53D8\u96C6\u5408\u540D\u8BCD="\u53EF\u53D8\u96C6\u5408\u540D\u8BCD",h.\u53EF\u6570\u540D\u8BCD="\u53EF\u6570\u540D\u8BCD",h.\u53EF\u6570\u540D\u8BCD\u4E13\u6709\u540D\u8BCD="\u53EF\u6570\u540D\u8BCD\uFF1B\u4E13\u6709\u540D\u8BCD",h.\u53EF\u6570\u540D\u8BCD\u540D\u79F0\u540D\u8BCD="\u53EF\u6570\u540D\u8BCD\uFF1B\u540D\u79F0\u540D\u8BCD",h.\u53EF\u6570\u540D\u8BCD\u58F0\u97F3\u8BCD="\u53EF\u6570\u540D\u8BCD\uFF1B\u58F0\u97F3\u8BCD",h.\u53EF\u6570\u540D\u8BCD\u5934\u8854\u540D\u8BCD="\u53EF\u6570\u540D\u8BCD\uFF1B\u5934\u8854\u540D\u8BCD",h.\u53EF\u6570\u540D\u8BCD\u5934\u8854\u540D\u8BCD\u79F0\u547C\u540D\u8BCD="\u53EF\u6570\u540D\u8BCD\uFF1B\u5934\u8854\u540D\u8BCD\uFF1B\u79F0\u547C\u540D\u8BCD",h.\u53EF\u6570\u540D\u8BCD\u79F0\u547C\u540D\u8BCD="\u53EF\u6570\u540D\u8BCD\uFF1B\u79F0\u547C\u540D\u8BCD",h.\u53EF\u6570\u96C6\u5408\u540D\u8BCD="\u53EF\u6570\u96C6\u5408\u540D\u8BCD",h.\u53EF\u6570\u96C6\u5408\u540D\u8BCD\u540D\u79F0\u540D\u8BCD="\u53EF\u6570\u96C6\u5408\u540D\u8BCD\uFF1B\u540D\u79F0\u540D\u8BCD",h.\u540D\u79F0\u540D\u8BCD="\u540D\u79F0\u540D\u8BCD",h.\u540D\u79F0\u540D\u8BCD\u540D\u79F0\u540D\u8BCD="\u540D\u79F0\u540D\u8BCD\uFF1B\u540D\u79F0\u540D\u8BCD",h.\u540E\u7F00="\u540E\u7F00",h.\u5426\u5B9A\u4E0D\u5B9A\u4EE3\u8BCD="\u5426\u5B9A\u4E0D\u5B9A\u4EE3\u8BCD",h.\u5426\u5B9A\u4E0D\u5B9A\u526F\u8BCD="\u5426\u5B9A\u4E0D\u5B9A\u526F\u8BCD",h.\u5426\u5B9A\u526F\u8BCD="\u5426\u5B9A\u526F\u8BCD",h.\u5426\u5B9A\u8BCD="\u5426\u5B9A\u8BCD",h.\u5426\u5B9A\u9650\u5B9A\u8BCD="\u5426\u5B9A\u9650\u5B9A\u8BCD",h.\u58F0\u97F3\u8BCD="\u58F0\u97F3\u8BCD",h.\u590D\u6570\u540D\u8BCD="\u590D\u6570\u540D\u8BCD",h.\u590D\u6570\u540D\u8BCD\u540D\u79F0\u540D\u8BCD="\u590D\u6570\u540D\u8BCD\uFF1B\u540D\u79F0\u540D\u8BCD",h.\u590D\u6570\u578B\u4EE3\u8BCD="\u590D\u6570\u578B\u4EE3\u8BCD",h.\u590D\u6570\u6570\u91CF\u8BCD="\u590D\u6570\u6570\u91CF\u8BCD",h.\u5934\u8854\u540D\u8BCD="\u5934\u8854\u540D\u8BCD",h.\u5934\u8854\u540D\u8BCD\u53EF\u6570\u540D\u8BCD="\u5934\u8854\u540D\u8BCD\uFF1B\u53EF\u6570\u540D\u8BCD",h.\u5934\u8854\u540D\u8BCD\u53EF\u6570\u540D\u8BCD\u79F0\u547C\u540D\u8BCD="\u5934\u8854\u540D\u8BCD\uFF1B\u53EF\u6570\u540D\u8BCD\uFF1B\u79F0\u547C\u540D\u8BCD",h.\u5934\u8854\u540D\u8BCD\u79F0\u547C\u540D\u8BCD="\u5934\u8854\u540D\u8BCD\uFF1B\u79F0\u547C\u540D\u8BCD",h.\u5934\u8854\u540D\u8BCD\u79F0\u547C\u540D\u8BCD\u53EF\u6570\u540D\u8BCD="\u5934\u8854\u540D\u8BCD\uFF1B\u79F0\u547C\u540D\u8BCD\uFF1B\u53EF\u6570\u540D\u8BCD",h.\u5BB6\u5EAD\u6210\u5458\u540D\u8BCD="\u5BB6\u5EAD\u6210\u5458\u540D\u8BCD",h.\u5BB6\u5EAD\u6210\u5458\u540D\u8BCD\u5934\u8854\u540D\u8BCD="\u5BB6\u5EAD\u6210\u5458\u540D\u8BCD\uFF1B\u5934\u8854\u540D\u8BCD",h.\u5E7F\u4E49\u5426\u5B9A\u7ED3\u6784\u526F\u8BCD="\u5E7F\u4E49\u5426\u5B9A\u7ED3\u6784\u526F\u8BCD",h.\u5E8F\u6570\u8BCD="\u5E8F\u6570\u8BCD",h.\u5F3A\u8C03\u4EE3\u8BCD="\u5F3A\u8C03\u4EE3\u8BCD",h.\u5F3A\u8C03\u53CD\u8EAB\u4EE3\u8BCD="\u5F3A\u8C03\u53CD\u8EAB\u4EE3\u8BCD",h.\u5F62\u5BB9\u8BCD="\u5F62\u5BB9\u8BCD",h.\u5F62\u5BB9\u8BCD\u6700\u9AD8\u7EA7\u5F62\u5F0F="\u5F62\u5BB9\u8BCD\u6700\u9AD8\u7EA7\u5F62\u5F0F",h.\u5F62\u5BB9\u8BCD\u6BD4\u8F83\u7EA7\u5F62\u5F0F="\u5F62\u5BB9\u8BCD\u6BD4\u8F83\u7EA7\u5F62\u5F0F",h.\u5F62\u5BB9\u8BCD\u901A\u5E38\u7528\u4E8E\u540D\u8BCD\u524D="\u5F62\u5BB9\u8BCD \u901A\u5E38\u7528\u4E8E\u540D\u8BCD\u524D",h.\u60C5\u6001\u52A8\u8BCD="\u60C5\u6001\u52A8\u8BCD",h.\u60C5\u6001\u52A8\u8BCD\u77ED\u8BED="\u60C5\u6001\u52A8\u8BCD\u77ED\u8BED",h.\u60EF\u7528\u8BED="\u60EF\u7528\u8BED",h.\u611F\u53F9\u8BCD\u4E0D\u53EF\u6570\u540D\u8BCD="\u611F\u53F9\u8BCD\uFF1B\u4E0D\u53EF\u6570\u540D\u8BCD",h.\u611F\u53F9\u8BED="\u611F\u53F9\u8BED",h.\u6240\u6709\u683C\u4EE3\u8BCD="\u6240\u6709\u683C\u4EE3\u8BCD",h.\u6240\u6709\u683C\u9650\u5B9A\u8BCD="\u6240\u6709\u683C\u9650\u5B9A\u8BCD",h.\u6570\u8BCD="\u6570\u8BCD",h.\u6570\u91CF\u8BCD="\u6570\u91CF\u8BCD",h.\u6784\u8BCD\u6210\u5206="\u6784\u8BCD\u6210\u5206",h.\u7269\u8D28\u540D\u8BCD="\u7269\u8D28\u540D\u8BCD",h.\u7591\u95EE\u8BCD="\u7591\u95EE\u8BCD",h.\u76F8\u4E92\u4EE3\u8BCD="\u76F8\u4E92\u4EE3\u8BCD",h.\u76F8\u4E92\u52A8\u8BCD="\u76F8\u4E92\u52A8\u8BCD",h.\u76F8\u4E92\u52A8\u8BCD\u4E60\u8BED="\u76F8\u4E92\u52A8\u8BCD\u4E60\u8BED",h.\u76F8\u4E92\u52A8\u8BCD\u77ED\u8BED="\u76F8\u4E92\u52A8\u8BCD\u77ED\u8BED",h.\u76F8\u4E92\u77ED\u8BED="\u76F8\u4E92\u77ED\u8BED",h.\u77ED\u8BED="\u77ED\u8BED",h.\u77ED\u8BED\u4ECB\u8BCD="\u77ED\u8BED\u4ECB\u8BCD",h.\u77ED\u8BED\u52A8\u8BCD="\u77ED\u8BED\u52A8\u8BCD",h.\u79F0\u547C\u540D\u8BCD="\u79F0\u547C\u540D\u8BCD",h.\u79F0\u547C\u540D\u8BCD\u4E13\u6709\u540D\u8BCD="\u79F0\u547C\u540D\u8BCD\uFF1B\u4E13\u6709\u540D\u8BCD",h.\u79F0\u547C\u540D\u8BCD\u5355\u6570\u540D\u8BCD="\u79F0\u547C\u540D\u8BCD\uFF1B\u5355\u6570\u540D\u8BCD",h.\u79F0\u547C\u540D\u8BCD\u53EF\u6570\u540D\u8BCD="\u79F0\u547C\u540D\u8BCD\uFF1B\u53EF\u6570\u540D\u8BCD",h.\u79F0\u547C\u540D\u8BCD\u590D\u6570\u540D\u8BCD="\u79F0\u547C\u540D\u8BCD\uFF1B\u590D\u6570\u540D\u8BCD",h.\u79F0\u547C\u540D\u8BCD\u5934\u8854\u540D\u8BCD\u53EF\u6570\u540D\u8BCD="\u79F0\u547C\u540D\u8BCD\uFF1B\u5934\u8854\u540D\u8BCD\uFF1B\u53EF\u6570\u540D\u8BCD",h.\u80FD\u88AB\u8868\u793A\u7A0B\u5EA6\u7684\u526F\u8BCD\u6216\u4ECB\u8BCD\u8BCD\u7EC4\u4FEE\u9970\u7684\u5F62\u5BB9\u8BCD="\u80FD\u88AB\u8868\u793A\u7A0B\u5EA6\u7684\u526F\u8BCD\u6216\u4ECB\u8BCD\u8BCD\u7EC4\u4FEE\u9970\u7684\u5F62\u5BB9\u8BCD",h.\u8868\u793A\u8BF4\u8BDD\u65F6\u7684\u8BED\u6C14\u6216\u611F\u60C5="\u8868\u793A\u8BF4\u8BDD\u65F6\u7684\u8BED\u6C14\u6216\u611F\u60C5",h.\u88AB\u52A8\u4EE3\u8BCD\u4E60\u8BED="\u88AB\u52A8\u4EE3\u8BCD\u4E60\u8BED",h.\u88AB\u52A8\u52A8\u8BCD="\u88AB\u52A8\u52A8\u8BCD",h.\u88AB\u52A8\u52A8\u8BCD\u77ED\u8BED="\u88AB\u52A8\u52A8\u8BCD\u77ED\u8BED",h.\u88AB\u52A8\u76F8\u4E92\u52A8\u8BCD="\u88AB\u52A8\u76F8\u4E92\u52A8\u8BCD",h.\u8AD6\u58C7="\u8AD6\u58C7",h.\u8FDE\u7CFB\u52A8\u8BCD="\u8FDE\u7CFB\u52A8\u8BCD",h.\u8FDE\u7CFB\u52A8\u8BCD\u53CA\u7269\u4E0D\u53CA\u7269="\u8FDE\u7CFB\u52A8\u8BCD\uFF08\u53CA\u7269/\u4E0D\u53CA\u7269\uFF09",h.\u8FDE\u7CFB\u52A8\u8BCD\u77ED\u8BED="\u8FDE\u7CFB\u52A8\u8BCD\u77ED\u8BED",h.\u8FDE\u8BCD="\u8FDE\u8BCD",h.\u9650\u5B9A\u8BCD="\u9650\u5B9A\u8BCD",h.\u989C\u8272\u8BCD="\u989C\u8272\u8BCD"})(nr||(nr={}));var ir;(function(d){d.ADJUsuADJN="ADJ usu ADJ n",d.ADVAsReply="ADV as reply",d.Adj="ADJ",d.AdjCompar="ADJ-COMPAR",d.AdjGraded="ADJ-GRADED",d.AdjSuperl="ADJ-SUPERL",d.AdjUngraded="ADJ-UNGRADED",d.Adv="ADV",d.AdvBrdNeg="ADV-BRD-NEG",d.AdvCompar="ADV-COMPAR",d.AdvGraded="ADV-GRADED",d.AdvIndef="ADV-INDEF",d.AdvIndefNeg="ADV-INDEF-NEG",d.AdvNeg="ADV-NEG",d.AdvSuperl="ADV-SUPERL",d.Author="AUTHOR",d.Aux="AUX",d.COMBInADJ="COMB in ADJ",d.COMBInADJAndN="COMB in ADJ and N",d.COMBInADJAndNCOUNT="COMB in ADJ and N-COUNT",d.COMBInADJGRADED="COMB in ADJ-GRADED",d.COMBInADV="COMB in ADV",d.COMBInCOLOUR="COMB in COLOUR",d.COMBInN="COMB in N",d.COMBInNCOUNT="COMB in N-COUNT",d.COMBInNCOUNTCOMBInADJ="COMB in N-COUNT, COMB in ADJ",d.COMBInNUNCOUNT="COMB in N-UNCOUNT",d.COMBInNUNCOUNTADJ="COMB in N-UNCOUNT, ADJ",d.COMBInQUANT="COMB in QUANT",d.COMBInVERB="COMB in VERB",d.Colour="COLOUR",d.Comb="COMB",d.ConjCoord="CONJ-COORD",d.ConjCoordNeg="CONJ-COORD-NEG",d.ConjSubord="CONJ-SUBORD",d.Convention="CONVENTION",d.Det="DET",d.DetNeg="DET-NEG",d.DetPoss="DET-POSS",d.Exclam="EXCLAM",d.ExclamNUncount="EXCLAM; N-UNCOUNT",d.Forum="FORUM",d.Fraction="FRACTION",d.Interj="INTERJ",d.Modal="MODAL",d.NCOUNTAlsoNINNAMES="N-COUNT; also N-IN-NAMES",d.NCOUNTAlsoNVOC="N-COUNT; also N-VOC",d.NCount="N-COUNT",d.NCountColl="N-COUNT-COLL",d.NCountCollNInNames="N-COUNT-COLL; N-IN-NAMES",d.NCountNInNames="N-COUNT; N-IN-NAMES",d.NCountNProper="N-COUNT; N-PROPER",d.NCountNTitle="N-COUNT; N-TITLE",d.NCountNTitleNVoc="N-COUNT; N-TITLE; N-VOC",d.NCountNVoc="N-COUNT; N-VOC",d.NCountSound="N-COUNT; SOUND",d.NFamily="N-FAMILY",d.NFamilyNTitle="N-FAMILY; N-TITLE",d.NInNames="N-IN-NAMES",d.NMass="N-MASS",d.NPROPERAlsoNCOUNT="N-PROPER; also N-COUNT",d.NPlural="N-PLURAL",d.NPluralNInNames="N-PLURAL; N-IN-NAMES",d.NProper="N-PROPER",d.NProperColl="N-PROPER-COLL",d.NProperNVoc="N-PROPER; N-VOC",d.NProperPlural="N-PROPER-PLURAL",d.NSing="N-SING",d.NSingColl="N-SING-COLL",d.NSingCollNProperColl="N-SING-COLL; N-PROPER-COLL",d.NSingNTitle="N-SING; N-TITLE",d.NSingSound="N-SING; SOUND",d.NTitle="N-TITLE",d.NTitleNCount="N-TITLE; N-COUNT",d.NTitleNCountNVoc="N-TITLE; N-COUNT; N-VOC",d.NTitleNVoc="N-TITLE; N-VOC",d.NTitleNVocNCount="N-TITLE; N-VOC; N-COUNT",d.NUNCOUNTAlsoEXCLAM="N-UNCOUNT, also EXCLAM",d.NUNCOUNTAlsoNPLURAL="N-UNCOUNT; also N-PLURAL",d.NUncount="N-UNCOUNT",d.NUncountColl="N-UNCOUNT-COLL",d.NUncountExclam="N-UNCOUNT; EXCLAM",d.NVARNum="N-VAR num",d.NVar="N-VAR",d.NVarColl="N-VAR-COLL",d.NVarNInNames="N-VAR; N-IN-NAMES",d.NVoc="N-VOC",d.NVocNCount="N-VOC; N-COUNT",d.NVocNPlural="N-VOC; N-PLURAL",d.NVocNProper="N-VOC; N-PROPER",d.NVocNSing="N-VOC; N-SING",d.NVocNTitleNCount="N-VOC; N-TITLE; N-COUNT",d.Neg="NEG",d.Num="NUM",d.Ord="ORD",d.PHRWithCl="PHR with cl",d.PhrConjCoord="PHR-CONJ-COORD",d.PhrConjSubord="PHR-CONJ-SUBORD",d.PhrErg="PHR-ERG",d.PhrModal="PHR-MODAL",d.PhrRecip="PHR-RECIP",d.PhrVLink="PHR-V-LINK",d.PhrVPassive="PHR-V-PASSIVE",d.PhrVRecip="PHR-V-RECIP",d.PhrasalVerb="PHRASAL VERB",d.PhrasalVerbErg="PHRASAL VERB-ERG",d.PhrasalVerbPassive="PHRASAL VERB-PASSIVE",d.PhrasalVerbRecip="PHRASAL VERB-RECIP",d.PhrasalVerbRecipErg="PHRASAL VERB-RECIP-ERG",d.Phrase="PHRASE",d.Predet="PREDET",d.Prefix="PREFIX",d.Prep="PREP",d.PrepPhrase="PREP-PHRASE",d.Pron="PRON",d.PronEmph="PRON-EMPH",d.PronIndef="PRON-INDEF",d.PronIndefNeg="PRON-INDEF-NEG",d.PronPlural="PRON-PLURAL",d.PronPoss="PRON-POSS",d.PronRecip="PRON-RECIP",d.PronRefl="PRON-REFL",d.PronReflEmph="PRON-REFL-EMPH",d.PronRel="PRON-REL",d.PronSing="PRON-SING",d.Quant="QUANT",d.QuantPlural="QUANT-PLURAL",d.Quest="QUEST",d.Sound="SOUND",d.Suffix="SUFFIX",d.ToInf="to inf",d.VERBNoPassive="VERB: no passive",d.VErg="V-ERG",d.VLink="V-LINK",d.VLinkErg="V-LINK-ERG",d.VLinkWorthAmount="v-link worth amount",d.VLinkWorthIng="v-link worth -ing",d.VLinkWorthNIng="v-link worth n/-ing",d.VPassive="V-PASSIVE",d.VPhr="V PHR",d.VRecip="V-RECIP",d.VRecipErg="V-RECIP-ERG",d.VRecipPassive="V-RECIP-PASSIVE",d.Verb="VERB"})(ir||(ir={}));var Ft=class{constructor(){this.API_END_POINT="https://api.dictionaryapi.dev/api/v2/entries/";this.name="Free Dictionary API";this.url="https://dictionaryapi.dev/";this.offline=!1;this.languageCodes={en_US:"en_US",hi:"hi",es:"es",fr:"fr",ja:"ja",ru:"ru",en_GB:"en_GB",de:"de",it:"it",ko:"ko",pt_BR:"pt-BR",ar:"ar",tr:"tr"}}constructRequest(e,t){return this.API_END_POINT+t+"/"+e}},kt=class extends Ft{constructor(){super(...arguments);this.supportedLanguages=["en_US","en_GB"]}requestDefinitions(e,t,i=!0){return M(this,null,function*(){let r;try{let a=this.constructRequest(encodeURIComponent(e),this.languageCodes[t]);r=yield(0,Et.request)({url:a})}catch(a){return Promise.reject(a)}let o=yield JSON.parse(r);return!o||o.title?Promise.reject(o.title):o.first()})}},Lt=class extends Ft{constructor(){super(...arguments);this.supportedLanguages=["en_US"]}getDoesPosMatch(e,t){switch(t){case je.Noun:return e.partOfSpeech.toLowerCase().contains("noun");case je.Verb:return e.partOfSpeech.toLowerCase().contains("verb");case je.Adjective:return e.partOfSpeech.toLowerCase().contains("adjective");case je.Adverb:return e.partOfSpeech.toLowerCase().contains("adverb")}}requestSynonyms(e,t,i){return M(this,null,function*(){let r;try{r=yield(0,Et.request)({url:this.constructRequest(e,this.languageCodes[t])})}catch(l){return Promise.reject(l)}if(!r)return Promise.reject("Word doesnt exist in this Dictionary");let o=(yield JSON.parse(r)).first().meanings,a=[],s=[];return o.forEach(l=>{if(Number.isNumber(i)&&!this.getDoesPosMatch(l,i)){l.definitions.forEach(c=>{c.synonyms&&c.synonyms.forEach(u=>{s.push({word:u})})});return}l.definitions.forEach(c=>{c.synonyms&&c.synonyms.forEach(u=>{a.push({word:u})})})}),a.concat(s)})}};var rr=G(require("obsidian")),Tt=class{constructor(){this.API_END_POINT="https://www.openthesaurus.de/synonyme/search?q=";this.name="OpenThesaurus";this.url="https://www.openthesaurus.de/";this.supportedLanguages=["de"];this.offline=!1}constructRequest(e){return this.API_END_POINT+e+"&format=application/json"}requestSynonyms(e){return M(this,null,function*(){let t;try{t=yield(0,rr.request)({url:this.constructRequest(e)})}catch(a){return Promise.reject(a)}if(!t)return Promise.reject("Word doesnt exist in this Dictionary");let i=yield JSON.parse(t);if(!i.synsets)return Promise.reject("Word doesnt exist in this Dictionary");if(i.synsets.length<=0)return Promise.reject("No Synonym found");let r=i.synsets[0].terms,o=[];return r.forEach(a=>{let s=a.term;e!=s&&o.push({word:s})}),o})}};var or=G(require("obsidian")),_t=class{constructor(){this.name="Altervista";this.url="http://thesaurus.altervista.org/";this.offline=!1;this.supportedLanguages=["es","it","fr","de"];this.languageCodes={es:"es_ES",it:"it_IT",fr:"fr_FR",de:"de_DE"};this.TOKEN="P4QAmqYIN1DY6XjlQJht"}requestSynonyms(e,t,i){return M(this,null,function*(){let r=[],o;try{o=yield(0,or.request)({url:this.constructRequest(encodeURIComponent(e),t)})}catch(s){return Promise.reject(s)}if(!o)return Promise.reject("Word doesnt exist in this Dictionary");let a=yield JSON.parse(o);for(let s of a.response)s.list.synonyms.split("|").forEach(c=>{r.push({word:c})});return r})}constructRequest(e,t){return`http://thesaurus.altervista.org/thesaurus/v1?word=${e}&key=${this.TOKEN}&language=${this.languageCodes[t]}&output=json`}};var ar=G(require("obsidian")),ct=class{constructor(){this.name="Google";this.offline=!1;this.supportedLanguages=["en_US","de","es","fr"]}};ct.LANGUAGES={en_US:"english",de:"deutsch",es:"Espa\xF1ol",fr:"Fran\xE7ais"};var Le=class extends ct{requestDefinitions(e,t){return M(this,null,function*(){var c,u,f,p,y,g;let i=yield(0,ar.requestUrl)({url:`https://www.google.com/search?q=define+${e.replace(/\s/g,"+")}+${Le.LANGUAGES[t]}`,headers:{"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"}});console.log(i);let o=new DOMParser().parseFromString(i.text,"text/html").querySelector(`div[data-query-term=${e}]`);if(!o)throw"";let a={phonetics:[],meanings:[],word:(u=(c=o.querySelector('span[data-dobid="hdw"]'))==null?void 0:c.textContent)!=null?u:e},s=(f=o.querySelector(".LTKOO > span"))==null?void 0:f.textContent;s&&a.phonetics.push({text:s,audio:(y=(p=o.querySelector("audio > source"))==null?void 0:p.getAttribute("src"))!=null?y:void 0});let l=(g=o.querySelector(".vmod i"))==null?void 0:g.textContent;if(l){let v=m=>{let x=[],C=[];return o.querySelectorAll('.lr_container div[role="button"] span').forEach(D=>{var j;!((j=D.parentElement)==null?void 0:j.getAttribute("data-topic"))&&D.textContent&&C.push(D.textContent.trim())}),m.forEach((D,j)=>{var k;x.push({definition:D.textContent,example:(k=D.nextSibling)==null?void 0:k.textContent,synonyms:j?void 0:C})}),x};a.meanings.push({partOfSpeech:l,definitions:v(o.querySelectorAll('div[data-dobid="dfn"]'))})}return a})}},zt=class extends ct{constructor(){super();this.provider=new Le}requestSynonyms(e,t,i){return M(this,null,function*(){return(yield this.provider.requestDefinitions(e,t)).meanings.first().definitions.first().synonyms.map(r=>({word:r}))})}};var Vt=class{constructor(){this.name="Jisho";this.base_url="https://jisho.org/api/v1/search/words?keyword=";this.API_END_POINT="https://jisho.org/api/v1/search/words?keyword=";this.offline=!1;this.supportedLanguages=["ja"]}};Vt.LANGUAGES={ja:"Japanese"};var Rt=class extends Vt{constructor(){super(...arguments);this.requestDefinitions=(e,t)=>M(this,null,function*(){let r=(yield requestUrl({url:`${this.base_url}/search/words?keyword=${e}`})).json;console.log(r);let a=r.data.first();return{word:a.japanese[0].word,meanings:a.senses.map(l=>({partOfSpeech:l.parts_of_speech.join(` -`),definitions:l.english_definitions.map(c=>({definition:c}))})),phonetics:[...new Set(a.japanese.map(l=>`${l.word} \u300C${l.reading}\u300D`))].map(l=>({text:l}))}})}};var ut=class{constructor(e){this.definitionProvider=[new kt,new Nt(this),new Le,new Rt];this.synonymProvider=[new Lt,new Tt,new _t,new zt];this.partOfSpeechProvider=[];this.plugin=e}requestDefinitions(e){return M(this,null,function*(){let t=this.getDefinitionAPI(),{cache:i,settings:r}=this.plugin;if(r.useCaching&&!t.name.toLowerCase().contains("offline")){let o=i.cachedDefinitions.find(a=>a.content.word.toLowerCase()==e.toLowerCase()&&a.lang==r.defaultLanguage&&a.api==t.name);if(o)return new Promise(a=>a(o.content));{let a=t.requestDefinitions(e,r.defaultLanguage),s=yield a;return s&&(i.cachedDefinitions.push({content:s,api:t.name,lang:r.defaultLanguage}),yield this.plugin.saveCache()),a}}else return t.requestDefinitions(e,this.plugin.settings.defaultLanguage)})}requestSynonyms(e,t){return M(this,null,function*(){let i=this.getSynonymAPI();if(!i)throw"No Synonym API selected/available";let{cache:r,settings:o}=this.plugin;if(o.useCaching&&!i.name.toLowerCase().contains("offline")){let a=r.cachedSynonyms.find(s=>s.word.toLowerCase()==e.toLowerCase()&&s.lang==o.defaultLanguage&&s.api==i.name);if(a)return new Promise(s=>s(a.content));{let s=i.requestSynonyms(e,o.defaultLanguage),l=yield s;return l&&(r.cachedSynonyms.push({content:l,api:i.name,word:e,lang:o.defaultLanguage}),yield this.plugin.saveCache()),s}}else return i.requestSynonyms(e,this.plugin.settings.defaultLanguage,t)})}requestPartOfSpeech(e,t,i){var r;return(r=this.getPartOfSpeechAPI())==null?void 0:r.requestPartOfSpeech(e,t,i,this.plugin.settings.defaultLanguage)}getDefinitionAPI(){let e=this.plugin.settings.defaultLanguage;return this.definitionProvider.find(t=>t.name==this.plugin.settings.apiSettings[e].definitionApiName)}getSynonymAPI(){let e=this.plugin.settings.defaultLanguage;return this.synonymProvider.find(t=>t.name==this.plugin.settings.apiSettings[e].synonymApiName)}getPartOfSpeechAPI(){return this.plugin.settings.advancedSynonymAnalysis?this.partOfSpeechProvider.find(e=>e.name==this.plugin.settings.partOfSpeechApiName):null}};function Do(n){X(n,"svelte-1j3cg25",".dict-s-popover.svelte-1j3cg25.svelte-1j3cg25{min-width:210px;max-width:250px;max-height:200px;background-color:var(--background-primary);border:1px solid var(--background-modifier-border);position:absolute;z-index:var(--layer-popover);border-radius:5px;box-shadow:0px 15px 25px rgba(0, 0, 0, 0.2);font-size:14px;overflow-y:auto;overflow-x:hidden;line-height:1.4}.dict-s-popover__select-option.svelte-1j3cg25.svelte-1j3cg25{cursor:pointer;padding:10px;border-bottom:1px solid var(--background-modifier-border)}.dict-s-popover__select-option.svelte-1j3cg25.svelte-1j3cg25:hover{background-color:var(--background-secondary)}.dict-s-popover.svelte-1j3cg25>.dict-s-popover__select-option.svelte-1j3cg25:last-child{border-bottom:none}.dict-s-popover__select-label.svelte-1j3cg25.svelte-1j3cg25{display:flex;justify-content:space-between;align-items:center}.dict-s-popover__meta-description.svelte-1j3cg25.svelte-1j3cg25,.dict-s-popover__meta-pos.svelte-1j3cg25.svelte-1j3cg25{font-size:12px;color:var(--text-muted)}.dict-s-popover__meta-pos.svelte-1j3cg25.svelte-1j3cg25{display:inline-block;margin-left:10px}")}function sr(n,e,t){let i=n.slice();return i[6]=e[t],i}function lr(n){let e,t=n[6].partsOfSpeech.join(", ")+"",i;return{c(){e=A("div"),i=R(t),b(e,"class","dict-s-popover__meta-pos svelte-1j3cg25")},m(r,o){N(r,e,o),S(e,i)},p(r,o){o&2&&t!==(t=r[6].partsOfSpeech.join(", ")+"")&&W(i,t)},d(r){r&&P(e)}}}function cr(n){let e,t=n[6].description+"",i;return{c(){e=A("div"),i=R(t),b(e,"class","dict-s-popover__meta-description svelte-1j3cg25")},m(r,o){N(r,e,o),S(e,i)},p(r,o){o&2&&t!==(t=r[6].description+"")&&W(i,t)},d(r){r&&P(e)}}}function ur(n){var g;let e,t,i,r=n[6].word+"",o,a,s,l,c,u,f=!!((g=n[6].partsOfSpeech)==null?void 0:g.length)&&lr(n),p=n[6].description&&cr(n);function y(){return n[5](n[6])}return{c(){e=A("div"),t=A("div"),i=A("div"),o=R(r),a=F(),f&&f.c(),s=F(),p&&p.c(),l=F(),b(i,"class","dict-s-popover__term"),b(t,"class","dict-s-popover__select-label svelte-1j3cg25"),b(e,"class","dict-s-popover__select-option svelte-1j3cg25")},m(v,m){N(v,e,m),S(e,t),S(t,i),S(i,o),S(t,a),f&&f.m(t,null),S(e,s),p&&p.m(e,null),S(e,l),c||(u=Y(e,"click",y),c=!0)},p(v,m){var x;n=v,m&2&&r!==(r=n[6].word+"")&&W(o,r),((x=n[6].partsOfSpeech)==null?void 0:x.length)?f?f.p(n,m):(f=lr(n),f.c(),f.m(t,null)):f&&(f.d(1),f=null),n[6].description?p?p.p(n,m):(p=cr(n),p.c(),p.m(e,l)):p&&(p.d(1),p=null)},d(v){v&&P(e),f&&f.d(),p&&p.d(),c=!1,u()}}}function Io(n){let e,t,i,r,o,a=n[1],s=[];for(let l=0;l{i=En(e,mi,{duration:50}),i.start()})},o:T,d(l){l&&P(e),ee(s,l),r=!1,o()}}}function Mo(n,e,t){let{coords:i}=e,{synonyms:r}=e,{onSelect:o}=e,{onClickOutside:a}=e;function s(c){let u=c.clientHeight,f=c.clientWidth;i.bottom+u>window.innerHeight&&c.style.setProperty("top",`${i.top-u}px`),i.left+f>window.innerWidth&&c.style.setProperty("left",`${window.innerWidth-f-15}px`);function p(y){c.contains(y.target)||(document.body.removeEventListener("pointerup",p),a())}document.body.addEventListener("pointerup",p)}let l=c=>o(c.word);return n.$$set=c=>{"coords"in c&&t(0,i=c.coords),"synonyms"in c&&t(1,r=c.synonyms),"onSelect"in c&&t(2,o=c.onSelect),"onClickOutside"in c&&t(4,a=c.onClickOutside)},[i,r,o,s,a,l]}var dr=class extends K{constructor(e){super();Z(this,e,Mo,Io,Q,{coords:0,synonyms:1,onSelect:2,onClickOutside:4},Do)}},fr=dr;var Ut=class{constructor(e){this.isDestroyed=!1;this.settings=e,this.openSynonymPopover()}destroy(){var e;(e=this._view)==null||e.$destroy(),this.isDestroyed=!0}openSynonymPopover(){return M(this,null,function*(){let{cursor:e,coords:t,line:i,selection:r,apiManager:o,onSelect:a}=this.settings,s=i.split(/[.!?]/g),l=0;for(let c of s){if(l<=e.ch&&e.ch<=l+c.length){let u=c.substring(0,e.ch-l),f=c.substring(e.ch-l+r.length),p;if(this.settings.advancedPoS)try{p=yield o.requestPartOfSpeech(r,u,f)}catch(g){console.error(`Error determining part of speech for word ${r}`,g)}let y;if(this.isDestroyed)return;try{y=yield o.requestSynonyms(r,p)}catch(g){console.error(`Error requesting synonyms for word ${r}`,g)}if(this.isDestroyed||!(y==null?void 0:y.length))return;this._view=new fr({intro:!0,target:document.body,props:{coords:t,synonyms:y,onSelect:g=>{a(g),this.destroy()},onClickOutside:()=>{this.destroy()}}});break}l+=c.length+1}})}};function Ht(n,e,t){if(!t.settings.shouldShowCustomContextMenu)return;let i=e.getSelection();i&&i.trim().split(" ").length===1&&(t.settings.shouldShowSynonymPopover||n.addItem(r=>{r.setTitle(w("Show Synonyms")).setIcon("synonyms").onClick(o=>M(this,null,function*(){t.handlePointerUp()}))}),n.addItem(r=>{r.setTitle(w("Look up")).setIcon("quote-glyph").onClick(o=>M(this,null,function*(){let a=t.app.workspace.getLeavesOfType(ne).first();a||(a=t.app.workspace.getRightLeaf(!1),yield a.setViewState({type:ne})),a.view.query(i.trim()),t.app.workspace.revealLeaf(a)}))}))}var pr=G(require("obsidian")),hr={copy:'',synonyms:''},yr=()=>{Object.keys(hr).forEach(n=>{(0,pr.addIcon)(n,hr[n])})};var he=G(require("obsidian")),dt=class{constructor(e){this.plugin=e,this.settings=e.settings}cap(e){return e&&e.split(" ").map(i=>i[0].toUpperCase()+i.substring(1)).join(" ")}newNote(e,t=!0){return M(this,null,function*(){let{plugin:i,settings:r}=this,o="";e.phonetics.forEach((p,y,g)=>{p.audio&&(o+="- "+(p.audio.startsWith("http")?p.audio:"https:"+p.audio),y!=g.length-1&&(o+=` -`))});let a="";e.phonetics.forEach((p,y,g)=>{p.text&&(a+="- "+(p.audio?`
${p.text}
`:p.text),y!=g.length-1&&(a+=` -`))});let s="";e.meanings.forEach((p,y)=>{var g;s+="### "+this.cap((g=p.partOfSpeech)!=null?g:w("Meaning {{i}}").replace(/{{i}}/g,(y+1).toString()))+` - -`,p.definitions.forEach((v,m,x)=>{s+=v.definition+` - -`,v.example&&(s+="> "+v.example+` - -`),v.synonyms&&v.synonyms.length!=0&&(v.synonyms.forEach((C,E,D)=>{s+=C,E!=D.length-1&&(s+=", ")}),s+=` - -`),m!=x.length-1&&(s+=`--- - -`)})});let l,c=Ie[r.defaultLanguage],u=`${r.folder?r.folder+"/":""}${r.languageSpecificSubFolders?c+"/":""}${r.prefix.replace(/{{lang}}/ig,c)}${r.capitalizedFileName?this.cap(e.word):e.word}${r.suffix.replace(/{{lang}}/ig,c)}.md`,f=r.template.replace(/{{notice}}/ig,w("Autogenerated by Obsidian Dictionary Plugin")).replace(/{{word}}/ig,r.capitalizedFileName?this.cap(e.word):e.word).replace(/{{pronunciationheader}}/ig,w("Pronunciation")).replace(/{{phoneticlist}}/ig,a).replace(/{{meaningheader}}/ig,w("Meanings")).replace(/{{meanings}}/ig,s).replace(/{{lang}}/ig,c).replace(/{{audioLinks}}/ig,o);e.origin?f=f.replace(/{{originHeader}}/ig,w("Origin")).replace(/{{origin}}/ig,e.origin):f=f.replace(/{{originHeader}}/ig,"").replace(/{{origin}}/ig,"");try{if((yield i.app.vault.adapter.exists((0,he.normalizePath)(`${r.folder?r.folder+"/":""}${r.languageSpecificSubFolders?c+"/":""}`)))||(yield i.app.vault.createFolder((0,he.normalizePath)(`${r.folder?r.folder+"/":""}${r.languageSpecificSubFolders?c+"/":""}`))),l=yield i.app.vault.create((0,he.normalizePath)(u),f),t){let p=i.app.workspace.splitActiveLeaf();yield p.openFile(l),i.app.workspace.setActiveLeaf(p)}}catch(p){new mr(this.plugin,(0,he.normalizePath)(u),f,t).open()}})}},mr=class extends he.Modal{constructor(e,t,i,r){super(e.app);this.path=t,this.content=i,this.openNote=r}onOpen(){this.contentEl.appendChild(createEl("p",{text:w("A existing File with the same Name was found, do you want to overwrite it?"),cls:"dictionarycenter"}));let e=this.contentEl.appendChild(createDiv({cls:"dictionarybuttons"}));e.appendChild(createEl("button",{text:w("Yes, overwrite the old File."),cls:"mod-cta"})).onClickEvent(()=>M(this,null,function*(){this.app.vault.modify(this.app.vault.getAbstractFileByPath(this.path),this.content);let t=!1;if(this.app.workspace.iterateAllLeaves(i=>{i.view instanceof he.MarkdownView&&i.getViewState().state.file.endsWith(this.path)&&(t=!0,this.app.workspace.setActiveLeaf(i))}),!t&&this.openNote){let i=this.app.workspace.splitActiveLeaf();yield i.openFile(this.app.vault.getAbstractFileByPath(this.path)),this.app.workspace.setActiveLeaf(i)}this.close()})),e.appendChild(createEl("button",{text:w("No, keep the old File."),cls:"mod-cta"})).onClickEvent(()=>{this.close()})}};var gr=G(Ot()),Bt=class extends le.Plugin{constructor(){super(...arguments);this.synonymPopover=null;this.handleContextMenuHelper=(e,t,i)=>{Ht(e,t,this)};this.handlePointerUp=(0,le.debounce)(()=>{var t,i,r;let e=this.app.workspace.activeLeaf;if((e==null?void 0:e.view)instanceof le.MarkdownView){let o=e.view;if(o.getMode()==="source"){let a=o.editor,s=a.getSelection();if(!s||/\s/.test(s))return;let l=a.getCursor("from"),c=a.getLine(l.line),u;if(a.cursorCoords)u=a.cursorCoords(!0,"window");else if(a.coordsAtPos){let f=a.posToOffset(l);u=(r=(i=(t=a.cm).coordsAtPos)==null?void 0:i.call(t,f))!=null?r:a.coordsAtPos(f)}else return;this.synonymPopover=new Ut({apiManager:this.manager,advancedPoS:this.settings.advancedSynonymAnalysis,coords:u,cursor:l,line:c,selection:s,onSelect:f=>{a.replaceSelection(Gt(f,s))}})}}},300,!0)}onload(){return M(this,null,function*(){console.log("loading dictionary"),yield Promise.all([this.loadSettings(),this.loadCache()]),yr(),this.addSettingTab(new tt(this.app,this)),this.manager=new ut(this),this.registerView(ne,e=>new st(e,this)),this.addCommand({id:"dictionary-open-view",name:w("Open Dictionary View"),callback:()=>M(this,null,function*(){this.app.workspace.getLeavesOfType(ne).length==0&&(yield this.app.workspace.getRightLeaf(!1).setViewState({type:ne})),this.app.workspace.revealLeaf(this.app.workspace.getLeavesOfType(ne).first()),dispatchEvent(new Event("dictionary-focus-on-search"))})}),this.addCommand({id:"dictionary-open-language-switcher",name:w("Open Language Switcher"),callback:()=>{new ke(this.app,this).open()}}),this.registerDomEvent(document.body,"pointerup",()=>{!this.settings.shouldShowSynonymPopover||this.handlePointerUp()}),this.registerDomEvent(window,"keydown",()=>{this.synonymPopover&&(this.synonymPopover.destroy(),this.synonymPopover=null)}),this.registerDomEvent(document.body,"contextmenu",e=>{var t,i;if(this.settings.shouldShowCustomContextMenu&&e.path.find(r=>{try{return r.hasClass("markdown-preview-view")}catch(o){return!1}})){let r=window.getSelection().toString();if(r&&((i=(t=this.app.workspace.activeLeaf)==null?void 0:t.getViewState())==null?void 0:i.state.mode)==="preview"){e.preventDefault();let o=new le.Menu(this.app);o.addItem(a=>{a.setTitle(w("Copy")).setIcon("copy").onClick(s=>{(0,gr.copy)(r)})}),r.trim().split(" ").length===1&&o.addItem(a=>{a.setTitle(w("Look up")).setIcon("quote-glyph").onClick(s=>M(this,null,function*(){let l=this.app.workspace.getLeavesOfType(ne).first();l||(l=this.app.workspace.getRightLeaf(!1),yield l.setViewState({type:ne})),l.view.query(r.trim()),this.app.workspace.revealLeaf(l)}))}),o.showAtPosition({x:e.clientX,y:e.clientY})}}}),this.localDictionary=new dt(this),this.registerEvent(this.app.workspace.on("editor-menu",this.handleContextMenuHelper)),this.registerEvent(this.app.workspace.on("file-open",e=>{var t,i,r,o;if(e&&this.settings.getLangFromFile){let a=(i=(t=this.app.metadataCache.getFileCache(e).frontmatter)==null?void 0:t.lang)!=null?i:null;a||(a=(o=(r=this.app.metadataCache.getFileCache(e).frontmatter)==null?void 0:r.language)!=null?o:null),a&&Object.values(Ie).contains(a)?this.settings.defaultLanguage=Object.keys(Ie)[Object.values(Ie).indexOf(a)]:this.settings.defaultLanguage=this.settings.normalLang,this.saveSettings()}}))})}onunload(){console.log("unloading dictionary")}loadSettings(){return M(this,null,function*(){this.settings=Object.assign({},Me,yield this.loadData())})}loadCache(){return M(this,null,function*(){this.cache=Object.assign({},vn,yield this.loadCacheFromDisk())})}loadCacheFromDisk(){return M(this,null,function*(){let e=(0,le.normalizePath)(`${this.manifest.dir}/cache.json`);return(yield this.app.vault.adapter.exists(e))||(yield this.app.vault.adapter.write(e,"{}")),JSON.parse(yield this.app.vault.adapter.read(e))})}saveCache(){return M(this,null,function*(){yield this.app.vault.adapter.write((0,le.normalizePath)(`${this.manifest.dir}/cache.json`),JSON.stringify(this.cache))})}saveSettings(){return M(this,null,function*(){yield this.saveData(this.settings)})}}; -/*! - Copyright (c) 2016 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ - -/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-dictionary-plugin/manifest.json b/.obsidian/plugins/obsidian-dictionary-plugin/manifest.json deleted file mode 100644 index 20558fc..0000000 --- a/.obsidian/plugins/obsidian-dictionary-plugin/manifest.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "id": "obsidian-dictionary-plugin", - "name": "Dictionary", - "version": "2.22.0", - "minAppVersion": "0.12.11", - "description": "This is a simple dictionary for the Obsidian Note-Taking Tool.", - "author": "phibr0", - "authorUrl": "https://github.com/phibr0", - "isDesktopOnly": false -} diff --git a/.obsidian/plugins/obsidian-dictionary-plugin/styles.css b/.obsidian/plugins/obsidian-dictionary-plugin/styles.css deleted file mode 100644 index 9d4db05..0000000 --- a/.obsidian/plugins/obsidian-dictionary-plugin/styles.css +++ /dev/null @@ -1,36 +0,0 @@ -.setting-item.extra > .setting-item-info { - opacity: 0.65; -} - -a[href="https://ko-fi.com/phibr0"] > img -{ - height: 3em; -} - -a[href="https://ko-fi.com/phibr0"] -{ - transform: translate(0, 5%); -} - -.dictionaryprefixsuffix .setting-item-control input { - margin-left: 0.5rem; -} - -.dictionarytextarea .setting-item-control textarea { - height: 15em; - width: 100%; - resize: vertical; -} - -.dictionarycenter { - text-align: center; -} - -.dictionarybuttons { - display: flex; - place-content: center; -} - -.dictionary-view-content { - overflow-y: hidden !important; -} diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js index 0815026..008ca6e 100644 --- a/.obsidian/plugins/obsidian-git/main.js +++ b/.obsidian/plugins/obsidian-git/main.js @@ -3,32668 +3,144 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source visit the plugins github repository (https://github.com/denolehov/obsidian-git) */ -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; -var __esm = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; -}; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key2 of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key2) && key2 !== except) - __defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __publicField = (obj, key2, value) => { - __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value); - return value; -}; - -// node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js -var require_base64_js = __commonJS({ - "node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - exports2.byteLength = byteLength; - exports2.toByteArray = toByteArray; - exports2.fromByteArray = fromByteArray; - var lookup = []; - var revLookup = []; - var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; - var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - for (i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i]; - revLookup[code.charCodeAt(i)] = i; - } - var i; - var len; - revLookup["-".charCodeAt(0)] = 62; - revLookup["_".charCodeAt(0)] = 63; - function getLens(b64) { - var len2 = b64.length; - if (len2 % 4 > 0) { - throw new Error("Invalid string. Length must be a multiple of 4"); - } - var validLen = b64.indexOf("="); - if (validLen === -1) - validLen = len2; - var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; - return [validLen, placeHoldersLen]; - } - function byteLength(b64) { - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; - } - function _byteLength(b64, validLen, placeHoldersLen) { - return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; - } - function toByteArray(b64) { - var tmp; - var lens = getLens(b64); - var validLen = lens[0]; - var placeHoldersLen = lens[1]; - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); - var curByte = 0; - var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; - var i2; - for (i2 = 0; i2 < len2; i2 += 4) { - tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; - arr[curByte++] = tmp >> 16 & 255; - arr[curByte++] = tmp >> 8 & 255; - arr[curByte++] = tmp & 255; - } - if (placeHoldersLen === 2) { - tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; - arr[curByte++] = tmp & 255; - } - if (placeHoldersLen === 1) { - tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; - arr[curByte++] = tmp >> 8 & 255; - arr[curByte++] = tmp & 255; - } - return arr; - } - function tripletToBase64(num2) { - return lookup[num2 >> 18 & 63] + lookup[num2 >> 12 & 63] + lookup[num2 >> 6 & 63] + lookup[num2 & 63]; - } - function encodeChunk(uint8, start, end) { - var tmp; - var output = []; - for (var i2 = start; i2 < end; i2 += 3) { - tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); - output.push(tripletToBase64(tmp)); - } - return output.join(""); - } - function fromByteArray(uint8) { - var tmp; - var len2 = uint8.length; - var extraBytes = len2 % 3; - var parts = []; - var maxChunkLength = 16383; - for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { - parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); - } - if (extraBytes === 1) { - tmp = uint8[len2 - 1]; - parts.push( - lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" - ); - } else if (extraBytes === 2) { - tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; - parts.push( - lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" - ); - } - return parts.join(""); - } - } -}); - -// node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js -var require_ieee754 = __commonJS({ - "node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js"(exports2) { - init_polyfill_buffer(); - exports2.read = function(buffer2, offset, isLE, mLen, nBytes) { - var e, m; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var nBits = -7; - var i = isLE ? nBytes - 1 : 0; - var d = isLE ? -1 : 1; - var s = buffer2[offset + i]; - i += d; - e = s & (1 << -nBits) - 1; - s >>= -nBits; - nBits += eLen; - for (; nBits > 0; e = e * 256 + buffer2[offset + i], i += d, nBits -= 8) { - } - m = e & (1 << -nBits) - 1; - e >>= -nBits; - nBits += mLen; - for (; nBits > 0; m = m * 256 + buffer2[offset + i], i += d, nBits -= 8) { - } - if (e === 0) { - e = 1 - eBias; - } else if (e === eMax) { - return m ? NaN : (s ? -1 : 1) * Infinity; - } else { - m = m + Math.pow(2, mLen); - e = e - eBias; - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen); - }; - exports2.write = function(buffer2, value, offset, isLE, mLen, nBytes) { - var e, m, c; - var eLen = nBytes * 8 - mLen - 1; - var eMax = (1 << eLen) - 1; - var eBias = eMax >> 1; - var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; - var i = isLE ? 0 : nBytes - 1; - var d = isLE ? 1 : -1; - var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; - value = Math.abs(value); - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0; - e = eMax; - } else { - e = Math.floor(Math.log(value) / Math.LN2); - if (value * (c = Math.pow(2, -e)) < 1) { - e--; - c *= 2; - } - if (e + eBias >= 1) { - value += rt / c; - } else { - value += rt * Math.pow(2, 1 - eBias); - } - if (value * c >= 2) { - e++; - c /= 2; - } - if (e + eBias >= eMax) { - m = 0; - e = eMax; - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen); - e = e + eBias; - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); - e = 0; - } - } - for (; mLen >= 8; buffer2[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { - } - e = e << mLen | m; - eLen += mLen; - for (; eLen > 0; buffer2[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { - } - buffer2[offset + i - d] |= s * 128; - }; - } -}); - -// node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js -var require_buffer = __commonJS({ - "node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var base64 = require_base64_js(); - var ieee754 = require_ieee754(); - var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; - exports2.Buffer = Buffer2; - exports2.SlowBuffer = SlowBuffer; - exports2.INSPECT_MAX_BYTES = 50; - var K_MAX_LENGTH = 2147483647; - exports2.kMaxLength = K_MAX_LENGTH; - Buffer2.TYPED_ARRAY_SUPPORT = typedArraySupport(); - if (!Buffer2.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 typedArraySupport() { - try { - const arr = new Uint8Array(1); - const proto = { foo: function() { - return 42; - } }; - Object.setPrototypeOf(proto, Uint8Array.prototype); - Object.setPrototypeOf(arr, proto); - return arr.foo() === 42; - } catch (e) { - return false; - } - } - Object.defineProperty(Buffer2.prototype, "parent", { - enumerable: true, - get: function() { - if (!Buffer2.isBuffer(this)) - return void 0; - return this.buffer; - } - }); - Object.defineProperty(Buffer2.prototype, "offset", { - enumerable: true, - get: function() { - if (!Buffer2.isBuffer(this)) - return void 0; - return this.byteOffset; - } - }); - function createBuffer(length) { - if (length > K_MAX_LENGTH) { - throw new RangeError('The value "' + length + '" is invalid for option "size"'); - } - const buf = new Uint8Array(length); - Object.setPrototypeOf(buf, Buffer2.prototype); - return buf; - } - function Buffer2(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - if (typeof encodingOrOffset === "string") { - throw new TypeError( - 'The "string" argument must be of type string. Received type number' - ); - } - return allocUnsafe(arg); - } - return from(arg, encodingOrOffset, length); - } - Buffer2.poolSize = 8192; - function from(value, encodingOrOffset, length) { - if (typeof value === "string") { - return fromString2(value, encodingOrOffset); - } - if (ArrayBuffer.isView(value)) { - return fromArrayView(value); - } - if (value == null) { - throw new TypeError( - "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value - ); - } - if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { - return fromArrayBuffer(value, encodingOrOffset, length); - } - if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { - return fromArrayBuffer(value, encodingOrOffset, length); - } - if (typeof value === "number") { - throw new TypeError( - 'The "value" argument must not be of type number. Received type number' - ); - } - const valueOf = value.valueOf && value.valueOf(); - if (valueOf != null && valueOf !== value) { - return Buffer2.from(valueOf, encodingOrOffset, length); - } - const b = fromObject(value); - if (b) - return b; - if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { - return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length); - } - throw new TypeError( - "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value - ); - } - Buffer2.from = function(value, encodingOrOffset, length) { - return from(value, encodingOrOffset, length); - }; - Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype); - Object.setPrototypeOf(Buffer2, Uint8Array); - function assertSize(size) { - if (typeof size !== "number") { - throw new TypeError('"size" argument must be of type number'); - } else if (size < 0) { - throw new RangeError('The value "' + size + '" is invalid for option "size"'); - } - } - function alloc(size, fill, encoding) { - assertSize(size); - if (size <= 0) { - return createBuffer(size); - } - if (fill !== void 0) { - return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); - } - return createBuffer(size); - } - Buffer2.alloc = function(size, fill, encoding) { - return alloc(size, fill, encoding); - }; - function allocUnsafe(size) { - assertSize(size); - return createBuffer(size < 0 ? 0 : checked(size) | 0); - } - Buffer2.allocUnsafe = function(size) { - return allocUnsafe(size); - }; - Buffer2.allocUnsafeSlow = function(size) { - return allocUnsafe(size); - }; - function fromString2(string, encoding) { - if (typeof encoding !== "string" || encoding === "") { - encoding = "utf8"; - } - if (!Buffer2.isEncoding(encoding)) { - throw new TypeError("Unknown encoding: " + encoding); - } - const length = byteLength(string, encoding) | 0; - let buf = createBuffer(length); - const actual = buf.write(string, encoding); - if (actual !== length) { - buf = buf.slice(0, actual); - } - return buf; - } - function fromArrayLike(array) { - const length = array.length < 0 ? 0 : checked(array.length) | 0; - const buf = createBuffer(length); - for (let i = 0; i < length; i += 1) { - buf[i] = array[i] & 255; - } - return buf; - } - function fromArrayView(arrayView) { - if (isInstance(arrayView, Uint8Array)) { - const copy2 = new Uint8Array(arrayView); - return fromArrayBuffer(copy2.buffer, copy2.byteOffset, copy2.byteLength); - } - return fromArrayLike(arrayView); - } - function fromArrayBuffer(array, byteOffset, length) { - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('"offset" is outside of buffer bounds'); - } - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('"length" is outside of buffer bounds'); - } - let buf; - if (byteOffset === void 0 && length === void 0) { - buf = new Uint8Array(array); - } else if (length === void 0) { - buf = new Uint8Array(array, byteOffset); - } else { - buf = new Uint8Array(array, byteOffset, length); - } - Object.setPrototypeOf(buf, Buffer2.prototype); - return buf; - } - function fromObject(obj) { - if (Buffer2.isBuffer(obj)) { - const len = checked(obj.length) | 0; - const buf = createBuffer(len); - if (buf.length === 0) { - return buf; - } - obj.copy(buf, 0, 0, len); - return buf; - } - if (obj.length !== void 0) { - if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { - return createBuffer(0); - } - return fromArrayLike(obj); - } - if (obj.type === "Buffer" && Array.isArray(obj.data)) { - return fromArrayLike(obj.data); - } - } - function checked(length) { - if (length >= K_MAX_LENGTH) { - throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); - } - return length | 0; - } - function SlowBuffer(length) { - if (+length != length) { - length = 0; - } - return Buffer2.alloc(+length); - } - Buffer2.isBuffer = function isBuffer(b) { - return b != null && b._isBuffer === true && b !== Buffer2.prototype; - }; - Buffer2.compare = function compare(a, b) { - if (isInstance(a, Uint8Array)) - a = Buffer2.from(a, a.offset, a.byteLength); - if (isInstance(b, Uint8Array)) - b = Buffer2.from(b, b.offset, b.byteLength); - if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { - throw new TypeError( - 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' - ); - } - if (a === b) - return 0; - let x = a.length; - let y = b.length; - for (let i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break; - } - } - if (x < y) - return -1; - if (y < x) - return 1; - return 0; - }; - Buffer2.isEncoding = function isEncoding(encoding) { - switch (String(encoding).toLowerCase()) { - case "hex": - case "utf8": - case "utf-8": - case "ascii": - case "latin1": - case "binary": - case "base64": - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return true; - default: - return false; - } - }; - Buffer2.concat = function concat(list, length) { - if (!Array.isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers'); - } - if (list.length === 0) { - return Buffer2.alloc(0); - } - let i; - if (length === void 0) { - length = 0; - for (i = 0; i < list.length; ++i) { - length += list[i].length; - } - } - const buffer2 = Buffer2.allocUnsafe(length); - let pos = 0; - for (i = 0; i < list.length; ++i) { - let buf = list[i]; - if (isInstance(buf, Uint8Array)) { - if (pos + buf.length > buffer2.length) { - if (!Buffer2.isBuffer(buf)) - buf = Buffer2.from(buf); - buf.copy(buffer2, pos); - } else { - Uint8Array.prototype.set.call( - buffer2, - buf, - pos - ); - } - } else if (!Buffer2.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers'); - } else { - buf.copy(buffer2, pos); - } - pos += buf.length; - } - return buffer2; - }; - function byteLength(string, encoding) { - if (Buffer2.isBuffer(string)) { - return string.length; - } - if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { - return string.byteLength; - } - if (typeof string !== "string") { - throw new TypeError( - 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string - ); - } - const len = string.length; - const mustMatch = arguments.length > 2 && arguments[2] === true; - if (!mustMatch && len === 0) - return 0; - let loweredCase = false; - for (; ; ) { - switch (encoding) { - case "ascii": - case "latin1": - case "binary": - return len; - case "utf8": - case "utf-8": - return utf8ToBytes(string).length; - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return len * 2; - case "hex": - return len >>> 1; - case "base64": - return base64ToBytes(string).length; - default: - if (loweredCase) { - return mustMatch ? -1 : utf8ToBytes(string).length; - } - encoding = ("" + encoding).toLowerCase(); - loweredCase = true; - } - } - } - Buffer2.byteLength = byteLength; - function slowToString(encoding, start, end) { - let loweredCase = false; - if (start === void 0 || start < 0) { - start = 0; - } - if (start > this.length) { - return ""; - } - if (end === void 0 || end > this.length) { - end = this.length; - } - if (end <= 0) { - return ""; - } - end >>>= 0; - start >>>= 0; - if (end <= start) { - return ""; - } - if (!encoding) - encoding = "utf8"; - while (true) { - switch (encoding) { - case "hex": - return hexSlice(this, start, end); - case "utf8": - case "utf-8": - return utf8Slice(this, start, end); - case "ascii": - return asciiSlice(this, start, end); - case "latin1": - case "binary": - return latin1Slice(this, start, end); - case "base64": - return base64Slice(this, start, end); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return utf16leSlice(this, start, end); - default: - if (loweredCase) - throw new TypeError("Unknown encoding: " + encoding); - encoding = (encoding + "").toLowerCase(); - loweredCase = true; - } - } - } - Buffer2.prototype._isBuffer = true; - function swap(b, n, m) { - const i = b[n]; - b[n] = b[m]; - b[m] = i; - } - Buffer2.prototype.swap16 = function swap16() { - const len = this.length; - if (len % 2 !== 0) { - throw new RangeError("Buffer size must be a multiple of 16-bits"); - } - for (let i = 0; i < len; i += 2) { - swap(this, i, i + 1); - } - return this; - }; - Buffer2.prototype.swap32 = function swap32() { - const len = this.length; - if (len % 4 !== 0) { - throw new RangeError("Buffer size must be a multiple of 32-bits"); - } - for (let i = 0; i < len; i += 4) { - swap(this, i, i + 3); - swap(this, i + 1, i + 2); - } - return this; - }; - Buffer2.prototype.swap64 = function swap64() { - const len = this.length; - if (len % 8 !== 0) { - throw new RangeError("Buffer size must be a multiple of 64-bits"); - } - for (let i = 0; i < len; i += 8) { - swap(this, i, i + 7); - swap(this, i + 1, i + 6); - swap(this, i + 2, i + 5); - swap(this, i + 3, i + 4); - } - return this; - }; - Buffer2.prototype.toString = function toString() { - const length = this.length; - if (length === 0) - return ""; - if (arguments.length === 0) - return utf8Slice(this, 0, length); - return slowToString.apply(this, arguments); - }; - Buffer2.prototype.toLocaleString = Buffer2.prototype.toString; - Buffer2.prototype.equals = function equals2(b) { - if (!Buffer2.isBuffer(b)) - throw new TypeError("Argument must be a Buffer"); - if (this === b) - return true; - return Buffer2.compare(this, b) === 0; - }; - Buffer2.prototype.inspect = function inspect() { - let str = ""; - const max = exports2.INSPECT_MAX_BYTES; - str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); - if (this.length > max) - str += " ... "; - return ""; - }; - if (customInspectSymbol) { - Buffer2.prototype[customInspectSymbol] = Buffer2.prototype.inspect; - } - Buffer2.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { - if (isInstance(target, Uint8Array)) { - target = Buffer2.from(target, target.offset, target.byteLength); - } - if (!Buffer2.isBuffer(target)) { - throw new TypeError( - 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target - ); - } - if (start === void 0) { - start = 0; - } - if (end === void 0) { - end = target ? target.length : 0; - } - if (thisStart === void 0) { - thisStart = 0; - } - if (thisEnd === void 0) { - thisEnd = this.length; - } - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError("out of range index"); - } - if (thisStart >= thisEnd && start >= end) { - return 0; - } - if (thisStart >= thisEnd) { - return -1; - } - if (start >= end) { - return 1; - } - start >>>= 0; - end >>>= 0; - thisStart >>>= 0; - thisEnd >>>= 0; - if (this === target) - return 0; - let x = thisEnd - thisStart; - let y = end - start; - const len = Math.min(x, y); - const thisCopy = this.slice(thisStart, thisEnd); - const targetCopy = target.slice(start, end); - for (let i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i]; - y = targetCopy[i]; - break; - } - } - if (x < y) - return -1; - if (y < x) - return 1; - return 0; - }; - function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) { - if (buffer2.length === 0) - return -1; - if (typeof byteOffset === "string") { - encoding = byteOffset; - byteOffset = 0; - } else if (byteOffset > 2147483647) { - byteOffset = 2147483647; - } else if (byteOffset < -2147483648) { - byteOffset = -2147483648; - } - byteOffset = +byteOffset; - if (numberIsNaN(byteOffset)) { - byteOffset = dir ? 0 : buffer2.length - 1; - } - if (byteOffset < 0) - byteOffset = buffer2.length + byteOffset; - if (byteOffset >= buffer2.length) { - if (dir) - return -1; - else - byteOffset = buffer2.length - 1; - } else if (byteOffset < 0) { - if (dir) - byteOffset = 0; - else - return -1; - } - if (typeof val === "string") { - val = Buffer2.from(val, encoding); - } - if (Buffer2.isBuffer(val)) { - if (val.length === 0) { - return -1; - } - return arrayIndexOf(buffer2, val, byteOffset, encoding, dir); - } else if (typeof val === "number") { - val = val & 255; - if (typeof Uint8Array.prototype.indexOf === "function") { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer2, val, byteOffset); - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset); - } - } - return arrayIndexOf(buffer2, [val], byteOffset, encoding, dir); - } - throw new TypeError("val must be string, number or Buffer"); - } - function arrayIndexOf(arr, val, byteOffset, encoding, dir) { - let indexSize = 1; - let arrLength = arr.length; - let valLength = val.length; - if (encoding !== void 0) { - encoding = String(encoding).toLowerCase(); - if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { - if (arr.length < 2 || val.length < 2) { - return -1; - } - indexSize = 2; - arrLength /= 2; - valLength /= 2; - byteOffset /= 2; - } - } - function read(buf, i2) { - if (indexSize === 1) { - return buf[i2]; - } else { - return buf.readUInt16BE(i2 * indexSize); - } - } - let i; - if (dir) { - let foundIndex = -1; - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) - foundIndex = i; - if (i - foundIndex + 1 === valLength) - return foundIndex * indexSize; - } else { - if (foundIndex !== -1) - i -= i - foundIndex; - foundIndex = -1; - } - } - } else { - if (byteOffset + valLength > arrLength) - byteOffset = arrLength - valLength; - for (i = byteOffset; i >= 0; i--) { - let found = true; - for (let j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false; - break; - } - } - if (found) - return i; - } - } - return -1; - } - Buffer2.prototype.includes = function includes(val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1; - }; - Buffer2.prototype.indexOf = function indexOf(val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true); - }; - Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false); - }; - function hexWrite(buf, string, offset, length) { - offset = Number(offset) || 0; - const remaining = buf.length - offset; - if (!length) { - length = remaining; - } else { - length = Number(length); - if (length > remaining) { - length = remaining; - } - } - const strLen = string.length; - if (length > strLen / 2) { - length = strLen / 2; - } - let i; - for (i = 0; i < length; ++i) { - const parsed = parseInt(string.substr(i * 2, 2), 16); - if (numberIsNaN(parsed)) - return i; - buf[offset + i] = parsed; - } - return i; - } - function utf8Write(buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); - } - function asciiWrite(buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length); - } - function base64Write(buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length); - } - function ucs2Write(buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); - } - Buffer2.prototype.write = function write(string, offset, length, encoding) { - if (offset === void 0) { - encoding = "utf8"; - length = this.length; - offset = 0; - } else if (length === void 0 && typeof offset === "string") { - encoding = offset; - length = this.length; - offset = 0; - } else if (isFinite(offset)) { - offset = offset >>> 0; - if (isFinite(length)) { - length = length >>> 0; - if (encoding === void 0) - encoding = "utf8"; - } else { - encoding = length; - length = void 0; - } - } else { - throw new Error( - "Buffer.write(string, encoding, offset[, length]) is no longer supported" - ); - } - const remaining = this.length - offset; - if (length === void 0 || length > remaining) - length = remaining; - if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { - throw new RangeError("Attempt to write outside buffer bounds"); - } - if (!encoding) - encoding = "utf8"; - let loweredCase = false; - for (; ; ) { - switch (encoding) { - case "hex": - return hexWrite(this, string, offset, length); - case "utf8": - case "utf-8": - return utf8Write(this, string, offset, length); - case "ascii": - case "latin1": - case "binary": - return asciiWrite(this, string, offset, length); - case "base64": - return base64Write(this, string, offset, length); - case "ucs2": - case "ucs-2": - case "utf16le": - case "utf-16le": - return ucs2Write(this, string, offset, length); - default: - if (loweredCase) - throw new TypeError("Unknown encoding: " + encoding); - encoding = ("" + encoding).toLowerCase(); - loweredCase = true; - } - } - }; - Buffer2.prototype.toJSON = function toJSON() { - return { - type: "Buffer", - data: Array.prototype.slice.call(this._arr || this, 0) - }; - }; - function base64Slice(buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf); - } else { - return base64.fromByteArray(buf.slice(start, end)); - } - } - function utf8Slice(buf, start, end) { - end = Math.min(buf.length, end); - const res = []; - let i = start; - while (i < end) { - const firstByte = buf[i]; - let codePoint = null; - let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; - if (i + bytesPerSequence <= end) { - let secondByte, thirdByte, fourthByte, tempCodePoint; - switch (bytesPerSequence) { - case 1: - if (firstByte < 128) { - codePoint = firstByte; - } - break; - case 2: - secondByte = buf[i + 1]; - if ((secondByte & 192) === 128) { - tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; - if (tempCodePoint > 127) { - codePoint = tempCodePoint; - } - } - break; - case 3: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; - if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { - codePoint = tempCodePoint; - } - } - break; - case 4: - secondByte = buf[i + 1]; - thirdByte = buf[i + 2]; - fourthByte = buf[i + 3]; - if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { - tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; - if (tempCodePoint > 65535 && tempCodePoint < 1114112) { - codePoint = tempCodePoint; - } - } - } - } - if (codePoint === null) { - codePoint = 65533; - bytesPerSequence = 1; - } else if (codePoint > 65535) { - codePoint -= 65536; - res.push(codePoint >>> 10 & 1023 | 55296); - codePoint = 56320 | codePoint & 1023; - } - res.push(codePoint); - i += bytesPerSequence; - } - return decodeCodePointsArray(res); - } - var MAX_ARGUMENTS_LENGTH = 4096; - function decodeCodePointsArray(codePoints) { - const len = codePoints.length; - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints); - } - let res = ""; - let i = 0; - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ); - } - return res; - } - function asciiSlice(buf, start, end) { - let ret = ""; - end = Math.min(buf.length, end); - for (let i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 127); - } - return ret; - } - function latin1Slice(buf, start, end) { - let ret = ""; - end = Math.min(buf.length, end); - for (let i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]); - } - return ret; - } - function hexSlice(buf, start, end) { - const len = buf.length; - if (!start || start < 0) - start = 0; - if (!end || end < 0 || end > len) - end = len; - let out = ""; - for (let i = start; i < end; ++i) { - out += hexSliceLookupTable[buf[i]]; - } - return out; - } - function utf16leSlice(buf, start, end) { - const bytes = buf.slice(start, end); - let res = ""; - for (let i = 0; i < bytes.length - 1; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); - } - return res; - } - Buffer2.prototype.slice = function slice(start, end) { - const len = this.length; - start = ~~start; - end = end === void 0 ? len : ~~end; - if (start < 0) { - start += len; - if (start < 0) - start = 0; - } else if (start > len) { - start = len; - } - if (end < 0) { - end += len; - if (end < 0) - end = 0; - } else if (end > len) { - end = len; - } - if (end < start) - end = start; - const newBuf = this.subarray(start, end); - Object.setPrototypeOf(newBuf, Buffer2.prototype); - return newBuf; - }; - function checkOffset(offset, ext, length) { - if (offset % 1 !== 0 || offset < 0) - throw new RangeError("offset is not uint"); - if (offset + ext > length) - throw new RangeError("Trying to access beyond buffer length"); - } - Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { - offset = offset >>> 0; - byteLength2 = byteLength2 >>> 0; - if (!noAssert) - checkOffset(offset, byteLength2, this.length); - let val = this[offset]; - let mul = 1; - let i = 0; - while (++i < byteLength2 && (mul *= 256)) { - val += this[offset + i] * mul; - } - return val; - }; - Buffer2.prototype.readUintBE = Buffer2.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { - offset = offset >>> 0; - byteLength2 = byteLength2 >>> 0; - if (!noAssert) { - checkOffset(offset, byteLength2, this.length); - } - let val = this[offset + --byteLength2]; - let mul = 1; - while (byteLength2 > 0 && (mul *= 256)) { - val += this[offset + --byteLength2] * mul; - } - return val; - }; - Buffer2.prototype.readUint8 = Buffer2.prototype.readUInt8 = function readUInt8(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 1, this.length); - return this[offset]; - }; - Buffer2.prototype.readUint16LE = Buffer2.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 2, this.length); - return this[offset] | this[offset + 1] << 8; - }; - Buffer2.prototype.readUint16BE = Buffer2.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 2, this.length); - return this[offset] << 8 | this[offset + 1]; - }; - Buffer2.prototype.readUint32LE = Buffer2.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 4, this.length); - return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; - }; - Buffer2.prototype.readUint32BE = Buffer2.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 4, this.length); - return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); - }; - Buffer2.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { - offset = offset >>> 0; - validateNumber(offset, "offset"); - const first2 = this[offset]; - const last2 = this[offset + 7]; - if (first2 === void 0 || last2 === void 0) { - boundsError(offset, this.length - 8); - } - const lo = first2 + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; - const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last2 * 2 ** 24; - return BigInt(lo) + (BigInt(hi) << BigInt(32)); - }); - Buffer2.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { - offset = offset >>> 0; - validateNumber(offset, "offset"); - const first2 = this[offset]; - const last2 = this[offset + 7]; - if (first2 === void 0 || last2 === void 0) { - boundsError(offset, this.length - 8); - } - const hi = first2 * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; - const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last2; - return (BigInt(hi) << BigInt(32)) + BigInt(lo); - }); - Buffer2.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { - offset = offset >>> 0; - byteLength2 = byteLength2 >>> 0; - if (!noAssert) - checkOffset(offset, byteLength2, this.length); - let val = this[offset]; - let mul = 1; - let i = 0; - while (++i < byteLength2 && (mul *= 256)) { - val += this[offset + i] * mul; - } - mul *= 128; - if (val >= mul) - val -= Math.pow(2, 8 * byteLength2); - return val; - }; - Buffer2.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { - offset = offset >>> 0; - byteLength2 = byteLength2 >>> 0; - if (!noAssert) - checkOffset(offset, byteLength2, this.length); - let i = byteLength2; - let mul = 1; - let val = this[offset + --i]; - while (i > 0 && (mul *= 256)) { - val += this[offset + --i] * mul; - } - mul *= 128; - if (val >= mul) - val -= Math.pow(2, 8 * byteLength2); - return val; - }; - Buffer2.prototype.readInt8 = function readInt8(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 1, this.length); - if (!(this[offset] & 128)) - return this[offset]; - return (255 - this[offset] + 1) * -1; - }; - Buffer2.prototype.readInt16LE = function readInt16LE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 2, this.length); - const val = this[offset] | this[offset + 1] << 8; - return val & 32768 ? val | 4294901760 : val; - }; - Buffer2.prototype.readInt16BE = function readInt16BE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 2, this.length); - const val = this[offset + 1] | this[offset] << 8; - return val & 32768 ? val | 4294901760 : val; - }; - Buffer2.prototype.readInt32LE = function readInt32LE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 4, this.length); - return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; - }; - Buffer2.prototype.readInt32BE = function readInt32BE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 4, this.length); - return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; - }; - Buffer2.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { - offset = offset >>> 0; - validateNumber(offset, "offset"); - const first2 = this[offset]; - const last2 = this[offset + 7]; - if (first2 === void 0 || last2 === void 0) { - boundsError(offset, this.length - 8); - } - const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last2 << 24); - return (BigInt(val) << BigInt(32)) + BigInt(first2 + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); - }); - Buffer2.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { - offset = offset >>> 0; - validateNumber(offset, "offset"); - const first2 = this[offset]; - const last2 = this[offset + 7]; - if (first2 === void 0 || last2 === void 0) { - boundsError(offset, this.length - 8); - } - const val = (first2 << 24) + // Overflow - this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; - return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last2); - }); - Buffer2.prototype.readFloatLE = function readFloatLE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, true, 23, 4); - }; - Buffer2.prototype.readFloatBE = function readFloatBE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 4, this.length); - return ieee754.read(this, offset, false, 23, 4); - }; - Buffer2.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, true, 52, 8); - }; - Buffer2.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { - offset = offset >>> 0; - if (!noAssert) - checkOffset(offset, 8, this.length); - return ieee754.read(this, offset, false, 52, 8); - }; - function checkInt(buf, value, offset, ext, max, min) { - if (!Buffer2.isBuffer(buf)) - throw new TypeError('"buffer" argument must be a Buffer instance'); - if (value > max || value < min) - throw new RangeError('"value" argument is out of bounds'); - if (offset + ext > buf.length) - throw new RangeError("Index out of range"); - } - Buffer2.prototype.writeUintLE = Buffer2.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { - value = +value; - offset = offset >>> 0; - byteLength2 = byteLength2 >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength2) - 1; - checkInt(this, value, offset, byteLength2, maxBytes, 0); - } - let mul = 1; - let i = 0; - this[offset] = value & 255; - while (++i < byteLength2 && (mul *= 256)) { - this[offset + i] = value / mul & 255; - } - return offset + byteLength2; - }; - Buffer2.prototype.writeUintBE = Buffer2.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { - value = +value; - offset = offset >>> 0; - byteLength2 = byteLength2 >>> 0; - if (!noAssert) { - const maxBytes = Math.pow(2, 8 * byteLength2) - 1; - checkInt(this, value, offset, byteLength2, maxBytes, 0); - } - let i = byteLength2 - 1; - let mul = 1; - this[offset + i] = value & 255; - while (--i >= 0 && (mul *= 256)) { - this[offset + i] = value / mul & 255; - } - return offset + byteLength2; - }; - Buffer2.prototype.writeUint8 = Buffer2.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 1, 255, 0); - this[offset] = value & 255; - return offset + 1; - }; - Buffer2.prototype.writeUint16LE = Buffer2.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 2, 65535, 0); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - return offset + 2; - }; - Buffer2.prototype.writeUint16BE = Buffer2.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 2, 65535, 0); - this[offset] = value >>> 8; - this[offset + 1] = value & 255; - return offset + 2; - }; - Buffer2.prototype.writeUint32LE = Buffer2.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 4, 4294967295, 0); - this[offset + 3] = value >>> 24; - this[offset + 2] = value >>> 16; - this[offset + 1] = value >>> 8; - this[offset] = value & 255; - return offset + 4; - }; - Buffer2.prototype.writeUint32BE = Buffer2.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 4, 4294967295, 0); - this[offset] = value >>> 24; - this[offset + 1] = value >>> 16; - this[offset + 2] = value >>> 8; - this[offset + 3] = value & 255; - return offset + 4; - }; - function wrtBigUInt64LE(buf, value, offset, min, max) { - checkIntBI(value, min, max, buf, offset, 7); - let lo = Number(value & BigInt(4294967295)); - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - lo = lo >> 8; - buf[offset++] = lo; - let hi = Number(value >> BigInt(32) & BigInt(4294967295)); - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - hi = hi >> 8; - buf[offset++] = hi; - return offset; - } - function wrtBigUInt64BE(buf, value, offset, min, max) { - checkIntBI(value, min, max, buf, offset, 7); - let lo = Number(value & BigInt(4294967295)); - buf[offset + 7] = lo; - lo = lo >> 8; - buf[offset + 6] = lo; - lo = lo >> 8; - buf[offset + 5] = lo; - lo = lo >> 8; - buf[offset + 4] = lo; - let hi = Number(value >> BigInt(32) & BigInt(4294967295)); - buf[offset + 3] = hi; - hi = hi >> 8; - buf[offset + 2] = hi; - hi = hi >> 8; - buf[offset + 1] = hi; - hi = hi >> 8; - buf[offset] = hi; - return offset + 8; - } - Buffer2.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { - return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); - }); - Buffer2.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { - return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); - }); - Buffer2.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - const limit = Math.pow(2, 8 * byteLength2 - 1); - checkInt(this, value, offset, byteLength2, limit - 1, -limit); - } - let i = 0; - let mul = 1; - let sub = 0; - this[offset] = value & 255; - while (++i < byteLength2 && (mul *= 256)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1; - } - this[offset + i] = (value / mul >> 0) - sub & 255; - } - return offset + byteLength2; - }; - Buffer2.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - const limit = Math.pow(2, 8 * byteLength2 - 1); - checkInt(this, value, offset, byteLength2, limit - 1, -limit); - } - let i = byteLength2 - 1; - let mul = 1; - let sub = 0; - this[offset + i] = value & 255; - while (--i >= 0 && (mul *= 256)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1; - } - this[offset + i] = (value / mul >> 0) - sub & 255; - } - return offset + byteLength2; - }; - Buffer2.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 1, 127, -128); - if (value < 0) - value = 255 + value + 1; - this[offset] = value & 255; - return offset + 1; - }; - Buffer2.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 2, 32767, -32768); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - return offset + 2; - }; - Buffer2.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 2, 32767, -32768); - this[offset] = value >>> 8; - this[offset + 1] = value & 255; - return offset + 2; - }; - Buffer2.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 4, 2147483647, -2147483648); - this[offset] = value & 255; - this[offset + 1] = value >>> 8; - this[offset + 2] = value >>> 16; - this[offset + 3] = value >>> 24; - return offset + 4; - }; - Buffer2.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) - checkInt(this, value, offset, 4, 2147483647, -2147483648); - if (value < 0) - value = 4294967295 + value + 1; - this[offset] = value >>> 24; - this[offset + 1] = value >>> 16; - this[offset + 2] = value >>> 8; - this[offset + 3] = value & 255; - return offset + 4; - }; - Buffer2.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { - return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); - }); - Buffer2.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { - return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); - }); - function checkIEEE754(buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) - throw new RangeError("Index out of range"); - if (offset < 0) - throw new RangeError("Index out of range"); - } - function writeFloat(buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); - } - ieee754.write(buf, value, offset, littleEndian, 23, 4); - return offset + 4; - } - Buffer2.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert); - }; - Buffer2.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert); - }; - function writeDouble(buf, value, offset, littleEndian, noAssert) { - value = +value; - offset = offset >>> 0; - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); - } - ieee754.write(buf, value, offset, littleEndian, 52, 8); - return offset + 8; - } - Buffer2.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert); - }; - Buffer2.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert); - }; - Buffer2.prototype.copy = function copy2(target, targetStart, start, end) { - if (!Buffer2.isBuffer(target)) - throw new TypeError("argument should be a Buffer"); - if (!start) - start = 0; - if (!end && end !== 0) - end = this.length; - if (targetStart >= target.length) - targetStart = target.length; - if (!targetStart) - targetStart = 0; - if (end > 0 && end < start) - end = start; - if (end === start) - return 0; - if (target.length === 0 || this.length === 0) - return 0; - if (targetStart < 0) { - throw new RangeError("targetStart out of bounds"); - } - if (start < 0 || start >= this.length) - throw new RangeError("Index out of range"); - if (end < 0) - throw new RangeError("sourceEnd out of bounds"); - if (end > this.length) - end = this.length; - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start; - } - const len = end - start; - if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { - this.copyWithin(targetStart, start, end); - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, end), - targetStart - ); - } - return len; - }; - Buffer2.prototype.fill = function fill(val, start, end, encoding) { - if (typeof val === "string") { - if (typeof start === "string") { - encoding = start; - start = 0; - end = this.length; - } else if (typeof end === "string") { - encoding = end; - end = this.length; - } - if (encoding !== void 0 && typeof encoding !== "string") { - throw new TypeError("encoding must be a string"); - } - if (typeof encoding === "string" && !Buffer2.isEncoding(encoding)) { - throw new TypeError("Unknown encoding: " + encoding); - } - if (val.length === 1) { - const code = val.charCodeAt(0); - if (encoding === "utf8" && code < 128 || encoding === "latin1") { - val = code; - } - } - } else if (typeof val === "number") { - val = val & 255; - } else if (typeof val === "boolean") { - val = Number(val); - } - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError("Out of range index"); - } - if (end <= start) { - return this; - } - start = start >>> 0; - end = end === void 0 ? this.length : end >>> 0; - if (!val) - val = 0; - let i; - if (typeof val === "number") { - for (i = start; i < end; ++i) { - this[i] = val; - } - } else { - const bytes = Buffer2.isBuffer(val) ? val : Buffer2.from(val, encoding); - const len = bytes.length; - if (len === 0) { - throw new TypeError('The value "' + val + '" is invalid for argument "value"'); - } - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len]; - } - } - return this; - }; - var errors = {}; - function E(sym, getMessage, Base) { - errors[sym] = class NodeError extends Base { - constructor() { - super(); - Object.defineProperty(this, "message", { - value: getMessage.apply(this, arguments), - writable: true, - configurable: true - }); - this.name = `${this.name} [${sym}]`; - this.stack; - delete this.name; - } - get code() { - return sym; - } - set code(value) { - Object.defineProperty(this, "code", { - configurable: true, - enumerable: true, - value, - writable: true - }); - } - toString() { - return `${this.name} [${sym}]: ${this.message}`; - } - }; - } - E( - "ERR_BUFFER_OUT_OF_BOUNDS", - function(name) { - if (name) { - return `${name} is outside of buffer bounds`; - } - return "Attempt to access memory outside buffer bounds"; - }, - RangeError - ); - E( - "ERR_INVALID_ARG_TYPE", - function(name, actual) { - return `The "${name}" argument must be of type number. Received type ${typeof actual}`; - }, - TypeError - ); - E( - "ERR_OUT_OF_RANGE", - function(str, range, input) { - let msg = `The value of "${str}" is out of range.`; - let received = input; - if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { - received = addNumericalSeparator(String(input)); - } else if (typeof input === "bigint") { - received = String(input); - if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { - received = addNumericalSeparator(received); - } - received += "n"; - } - msg += ` It must be ${range}. Received ${received}`; - return msg; - }, - RangeError - ); - function addNumericalSeparator(val) { - let res = ""; - let i = val.length; - const start = val[0] === "-" ? 1 : 0; - for (; i >= start + 4; i -= 3) { - res = `_${val.slice(i - 3, i)}${res}`; - } - return `${val.slice(0, i)}${res}`; - } - function checkBounds(buf, offset, byteLength2) { - validateNumber(offset, "offset"); - if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { - boundsError(offset, buf.length - (byteLength2 + 1)); - } - } - function checkIntBI(value, min, max, buf, offset, byteLength2) { - if (value > max || value < min) { - const n = typeof min === "bigint" ? "n" : ""; - let range; - if (byteLength2 > 3) { - if (min === 0 || min === BigInt(0)) { - range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; - } else { - range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; - } - } else { - range = `>= ${min}${n} and <= ${max}${n}`; - } - throw new errors.ERR_OUT_OF_RANGE("value", range, value); - } - checkBounds(buf, offset, byteLength2); - } - function validateNumber(value, name) { - if (typeof value !== "number") { - throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); - } - } - function boundsError(value, length, type) { - if (Math.floor(value) !== value) { - validateNumber(value, type); - throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); - } - if (length < 0) { - throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); - } - throw new errors.ERR_OUT_OF_RANGE( - type || "offset", - `>= ${type ? 1 : 0} and <= ${length}`, - value - ); - } - var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; - function base64clean(str) { - str = str.split("=")[0]; - str = str.trim().replace(INVALID_BASE64_RE, ""); - if (str.length < 2) - return ""; - while (str.length % 4 !== 0) { - str = str + "="; - } - return str; - } - function utf8ToBytes(string, units) { - units = units || Infinity; - let codePoint; - const length = string.length; - let leadSurrogate = null; - const bytes = []; - for (let i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i); - if (codePoint > 55295 && codePoint < 57344) { - if (!leadSurrogate) { - if (codePoint > 56319) { - if ((units -= 3) > -1) - bytes.push(239, 191, 189); - continue; - } else if (i + 1 === length) { - if ((units -= 3) > -1) - bytes.push(239, 191, 189); - continue; - } - leadSurrogate = codePoint; - continue; - } - if (codePoint < 56320) { - if ((units -= 3) > -1) - bytes.push(239, 191, 189); - leadSurrogate = codePoint; - continue; - } - codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; - } else if (leadSurrogate) { - if ((units -= 3) > -1) - bytes.push(239, 191, 189); - } - leadSurrogate = null; - if (codePoint < 128) { - if ((units -= 1) < 0) - break; - bytes.push(codePoint); - } else if (codePoint < 2048) { - if ((units -= 2) < 0) - break; - bytes.push( - codePoint >> 6 | 192, - codePoint & 63 | 128 - ); - } else if (codePoint < 65536) { - if ((units -= 3) < 0) - break; - bytes.push( - codePoint >> 12 | 224, - codePoint >> 6 & 63 | 128, - codePoint & 63 | 128 - ); - } else if (codePoint < 1114112) { - if ((units -= 4) < 0) - break; - bytes.push( - codePoint >> 18 | 240, - codePoint >> 12 & 63 | 128, - codePoint >> 6 & 63 | 128, - codePoint & 63 | 128 - ); - } else { - throw new Error("Invalid code point"); - } - } - return bytes; - } - function asciiToBytes(str) { - const byteArray = []; - for (let i = 0; i < str.length; ++i) { - byteArray.push(str.charCodeAt(i) & 255); - } - return byteArray; - } - function utf16leToBytes(str, units) { - let c, hi, lo; - const byteArray = []; - for (let i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) - break; - c = str.charCodeAt(i); - hi = c >> 8; - lo = c % 256; - byteArray.push(lo); - byteArray.push(hi); - } - return byteArray; - } - function base64ToBytes(str) { - return base64.toByteArray(base64clean(str)); - } - function blitBuffer(src, dst, offset, length) { - let i; - for (i = 0; i < length; ++i) { - if (i + offset >= dst.length || i >= src.length) - break; - dst[i + offset] = src[i]; - } - return i; - } - function isInstance(obj, type) { - return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; - } - function numberIsNaN(obj) { - return obj !== obj; - } - var hexSliceLookupTable = function() { - const alphabet = "0123456789abcdef"; - const table = new Array(256); - for (let i = 0; i < 16; ++i) { - const i16 = i * 16; - for (let j = 0; j < 16; ++j) { - table[i16 + j] = alphabet[i] + alphabet[j]; - } - } - return table; - }(); - function defineBigIntMethod(fn) { - return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; - } - function BufferBigIntNotDefined() { - throw new Error("BigInt not supported"); - } - } -}); - -// polyfill_buffer.js -var import_obsidian, buffer, Buffer; -var init_polyfill_buffer = __esm({ - "polyfill_buffer.js"() { - import_obsidian = require("obsidian"); - if (import_obsidian.Platform.isMobileApp) { - buffer = require_buffer().Buffer; - } else { - buffer = global.Buffer; - } - Buffer = buffer; - } -}); - -// node_modules/.pnpm/async-lock@1.4.0/node_modules/async-lock/lib/index.js -var require_lib = __commonJS({ - "node_modules/.pnpm/async-lock@1.4.0/node_modules/async-lock/lib/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var AsyncLock2 = function(opts) { - opts = opts || {}; - this.Promise = opts.Promise || Promise; - this.queues = /* @__PURE__ */ Object.create(null); - this.domainReentrant = opts.domainReentrant || false; - if (this.domainReentrant) { - if (typeof process === "undefined" || typeof process.domain === "undefined") { - throw new Error( - "Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill." - ); - } - this.domains = /* @__PURE__ */ Object.create(null); - } - this.timeout = opts.timeout || AsyncLock2.DEFAULT_TIMEOUT; - this.maxOccupationTime = opts.maxOccupationTime || AsyncLock2.DEFAULT_MAX_OCCUPATION_TIME; - this.maxExecutionTime = opts.maxExecutionTime || AsyncLock2.DEFAULT_MAX_EXECUTION_TIME; - if (opts.maxPending === Infinity || Number.isInteger(opts.maxPending) && opts.maxPending >= 0) { - this.maxPending = opts.maxPending; - } else { - this.maxPending = AsyncLock2.DEFAULT_MAX_PENDING; - } - }; - AsyncLock2.DEFAULT_TIMEOUT = 0; - AsyncLock2.DEFAULT_MAX_OCCUPATION_TIME = 0; - AsyncLock2.DEFAULT_MAX_EXECUTION_TIME = 0; - AsyncLock2.DEFAULT_MAX_PENDING = 1e3; - AsyncLock2.prototype.acquire = function(key2, fn, cb, opts) { - if (Array.isArray(key2)) { - return this._acquireBatch(key2, fn, cb, opts); - } - if (typeof fn !== "function") { - throw new Error("You must pass a function to execute"); - } - var deferredResolve = null; - var deferredReject = null; - var deferred2 = null; - if (typeof cb !== "function") { - opts = cb; - cb = null; - deferred2 = new this.Promise(function(resolve, reject) { - deferredResolve = resolve; - deferredReject = reject; - }); - } - opts = opts || {}; - var resolved = false; - var timer = null; - var occupationTimer = null; - var executionTimer = null; - var self2 = this; - var done = function(locked, err, ret) { - if (occupationTimer) { - clearTimeout(occupationTimer); - occupationTimer = null; - } - if (executionTimer) { - clearTimeout(executionTimer); - executionTimer = null; - } - if (locked) { - if (!!self2.queues[key2] && self2.queues[key2].length === 0) { - delete self2.queues[key2]; - } - if (self2.domainReentrant) { - delete self2.domains[key2]; - } - } - if (!resolved) { - if (!deferred2) { - if (typeof cb === "function") { - cb(err, ret); - } - } else { - if (err) { - deferredReject(err); - } else { - deferredResolve(ret); - } - } - resolved = true; - } - if (locked) { - if (!!self2.queues[key2] && self2.queues[key2].length > 0) { - self2.queues[key2].shift()(); - } - } - }; - var exec = function(locked) { - if (resolved) { - return done(locked); - } - if (timer) { - clearTimeout(timer); - timer = null; - } - if (self2.domainReentrant && locked) { - self2.domains[key2] = process.domain; - } - var maxExecutionTime = opts.maxExecutionTime || self2.maxExecutionTime; - if (maxExecutionTime) { - executionTimer = setTimeout(function() { - if (!!self2.queues[key2]) { - done(locked, new Error("Maximum execution time is exceeded " + key2)); - } - }, maxExecutionTime); - } - if (fn.length === 1) { - var called = false; - try { - fn(function(err, ret) { - if (!called) { - called = true; - done(locked, err, ret); - } - }); - } catch (err) { - if (!called) { - called = true; - done(locked, err); - } - } - } else { - self2._promiseTry(function() { - return fn(); - }).then(function(ret) { - done(locked, void 0, ret); - }, function(error) { - done(locked, error); - }); - } - }; - if (self2.domainReentrant && !!process.domain) { - exec = process.domain.bind(exec); - } - if (!self2.queues[key2]) { - self2.queues[key2] = []; - exec(true); - } else if (self2.domainReentrant && !!process.domain && process.domain === self2.domains[key2]) { - exec(false); - } else if (self2.queues[key2].length >= self2.maxPending) { - done(false, new Error("Too many pending tasks in queue " + key2)); - } else { - var taskFn = function() { - exec(true); - }; - if (opts.skipQueue) { - self2.queues[key2].unshift(taskFn); - } else { - self2.queues[key2].push(taskFn); - } - var timeout = opts.timeout || self2.timeout; - if (timeout) { - timer = setTimeout(function() { - timer = null; - done(false, new Error("async-lock timed out in queue " + key2)); - }, timeout); - } - } - var maxOccupationTime = opts.maxOccupationTime || self2.maxOccupationTime; - if (maxOccupationTime) { - occupationTimer = setTimeout(function() { - if (!!self2.queues[key2]) { - done(false, new Error("Maximum occupation time is exceeded in queue " + key2)); - } - }, maxOccupationTime); - } - if (deferred2) { - return deferred2; - } - }; - AsyncLock2.prototype._acquireBatch = function(keys, fn, cb, opts) { - if (typeof cb !== "function") { - opts = cb; - cb = null; - } - var self2 = this; - var getFn = function(key2, fn2) { - return function(cb2) { - self2.acquire(key2, fn2, cb2, opts); - }; - }; - var fnx = keys.reduceRight(function(prev, key2) { - return getFn(key2, prev); - }, fn); - if (typeof cb === "function") { - fnx(cb); - } else { - return new this.Promise(function(resolve, reject) { - if (fnx.length === 1) { - fnx(function(err, ret) { - if (err) { - reject(err); - } else { - resolve(ret); - } - }); - } else { - resolve(fnx()); - } - }); - } - }; - AsyncLock2.prototype.isBusy = function(key2) { - if (!key2) { - return Object.keys(this.queues).length > 0; - } else { - return !!this.queues[key2]; - } - }; - AsyncLock2.prototype._promiseTry = function(fn) { - try { - return this.Promise.resolve(fn()); - } catch (e) { - return this.Promise.reject(e); - } - }; - module2.exports = AsyncLock2; - } -}); - -// node_modules/.pnpm/async-lock@1.4.0/node_modules/async-lock/index.js -var require_async_lock = __commonJS({ - "node_modules/.pnpm/async-lock@1.4.0/node_modules/async-lock/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - module2.exports = require_lib(); - } -}); - -// node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js -var require_inherits_browser = __commonJS({ - "node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports2, module2) { - init_polyfill_buffer(); - if (typeof Object.create === "function") { - module2.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - } - }; - } else { - module2.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor; - var TempCtor = function() { - }; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - }; - } - } -}); - -// node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js -var require_safe_buffer = __commonJS({ - "node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports2, module2) { - init_polyfill_buffer(); - var buffer2 = require_buffer(); - var Buffer2 = buffer2.Buffer; - function copyProps(src, dst) { - for (var key2 in src) { - dst[key2] = src[key2]; - } - } - if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { - module2.exports = buffer2; - } else { - copyProps(buffer2, exports2); - exports2.Buffer = SafeBuffer; - } - function SafeBuffer(arg, encodingOrOffset, length) { - return Buffer2(arg, encodingOrOffset, length); - } - SafeBuffer.prototype = Object.create(Buffer2.prototype); - copyProps(Buffer2, SafeBuffer); - SafeBuffer.from = function(arg, encodingOrOffset, length) { - if (typeof arg === "number") { - throw new TypeError("Argument must not be a number"); - } - return Buffer2(arg, encodingOrOffset, length); - }; - SafeBuffer.alloc = function(size, fill, encoding) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - var buf = Buffer2(size); - if (fill !== void 0) { - if (typeof encoding === "string") { - buf.fill(fill, encoding); - } else { - buf.fill(fill); - } - } else { - buf.fill(0); - } - return buf; - }; - SafeBuffer.allocUnsafe = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return Buffer2(size); - }; - SafeBuffer.allocUnsafeSlow = function(size) { - if (typeof size !== "number") { - throw new TypeError("Argument must be a number"); - } - return buffer2.SlowBuffer(size); - }; - } -}); - -// node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/hash.js -var require_hash = __commonJS({ - "node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/hash.js"(exports2, module2) { - init_polyfill_buffer(); - var Buffer2 = require_safe_buffer().Buffer; - function Hash2(blockSize, finalSize) { - this._block = Buffer2.alloc(blockSize); - this._finalSize = finalSize; - this._blockSize = blockSize; - this._len = 0; - } - Hash2.prototype.update = function(data, enc) { - if (typeof data === "string") { - enc = enc || "utf8"; - data = Buffer2.from(data, enc); - } - var block = this._block; - var blockSize = this._blockSize; - var length = data.length; - var accum = this._len; - for (var offset = 0; offset < length; ) { - var assigned = accum % blockSize; - var remainder = Math.min(length - offset, blockSize - assigned); - for (var i = 0; i < remainder; i++) { - block[assigned + i] = data[offset + i]; - } - accum += remainder; - offset += remainder; - if (accum % blockSize === 0) { - this._update(block); - } - } - this._len += length; - return this; - }; - Hash2.prototype.digest = function(enc) { - var rem = this._len % this._blockSize; - this._block[rem] = 128; - this._block.fill(0, rem + 1); - if (rem >= this._finalSize) { - this._update(this._block); - this._block.fill(0); - } - var bits = this._len * 8; - if (bits <= 4294967295) { - this._block.writeUInt32BE(bits, this._blockSize - 4); - } else { - var lowBits = (bits & 4294967295) >>> 0; - var highBits = (bits - lowBits) / 4294967296; - this._block.writeUInt32BE(highBits, this._blockSize - 8); - this._block.writeUInt32BE(lowBits, this._blockSize - 4); - } - this._update(this._block); - var hash2 = this._hash(); - return enc ? hash2.toString(enc) : hash2; - }; - Hash2.prototype._update = function() { - throw new Error("_update must be implemented by subclass"); - }; - module2.exports = Hash2; - } -}); - -// node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/sha1.js -var require_sha1 = __commonJS({ - "node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/sha1.js"(exports2, module2) { - init_polyfill_buffer(); - var inherits = require_inherits_browser(); - var Hash2 = require_hash(); - var Buffer2 = require_safe_buffer().Buffer; - var K2 = [ - 1518500249, - 1859775393, - 2400959708 | 0, - 3395469782 | 0 - ]; - var W = new Array(80); - function Sha1() { - this.init(); - this._w = W; - Hash2.call(this, 64, 56); - } - inherits(Sha1, Hash2); - Sha1.prototype.init = function() { - this._a = 1732584193; - this._b = 4023233417; - this._c = 2562383102; - this._d = 271733878; - this._e = 3285377520; - return this; - }; - function rotl1(num2) { - return num2 << 1 | num2 >>> 31; - } - function rotl5(num2) { - return num2 << 5 | num2 >>> 27; - } - function rotl30(num2) { - return num2 << 30 | num2 >>> 2; - } - function ft(s, b, c, d) { - if (s === 0) - return b & c | ~b & d; - if (s === 2) - return b & c | b & d | c & d; - return b ^ c ^ d; - } - Sha1.prototype._update = function(M) { - var W2 = this._w; - var a = this._a | 0; - var b = this._b | 0; - var c = this._c | 0; - var d = this._d | 0; - var e = this._e | 0; - for (var i = 0; i < 16; ++i) - W2[i] = M.readInt32BE(i * 4); - for (; i < 80; ++i) - W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]); - for (var j = 0; j < 80; ++j) { - var s = ~~(j / 20); - var t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K2[s] | 0; - e = d; - d = c; - c = rotl30(b); - b = a; - a = t; - } - this._a = a + this._a | 0; - this._b = b + this._b | 0; - this._c = c + this._c | 0; - this._d = d + this._d | 0; - this._e = e + this._e | 0; - }; - Sha1.prototype._hash = function() { - var H = Buffer2.allocUnsafe(20); - H.writeInt32BE(this._a | 0, 0); - H.writeInt32BE(this._b | 0, 4); - H.writeInt32BE(this._c | 0, 8); - H.writeInt32BE(this._d | 0, 12); - H.writeInt32BE(this._e | 0, 16); - return H; - }; - module2.exports = Sha1; - } -}); - -// node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/crc32.js -var require_crc32 = __commonJS({ - "node_modules/.pnpm/crc-32@1.2.2/node_modules/crc-32/crc32.js"(exports2) { - init_polyfill_buffer(); - var CRC32; - (function(factory) { - if (typeof DO_NOT_EXPORT_CRC === "undefined") { - if ("object" === typeof exports2) { - factory(exports2); - } else if ("function" === typeof define && define.amd) { - define(function() { - var module3 = {}; - factory(module3); - return module3; - }); - } else { - factory(CRC32 = {}); - } - } else { - factory(CRC32 = {}); - } - })(function(CRC322) { - CRC322.version = "1.2.2"; - function signed_crc_table() { - var c = 0, table = new Array(256); - for (var n = 0; n != 256; ++n) { - c = n; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; - table[n] = c; - } - return typeof Int32Array !== "undefined" ? new Int32Array(table) : table; - } - var T0 = signed_crc_table(); - function slice_by_16_tables(T) { - var c = 0, v = 0, n = 0, table = typeof Int32Array !== "undefined" ? new Int32Array(4096) : new Array(4096); - for (n = 0; n != 256; ++n) - table[n] = T[n]; - for (n = 0; n != 256; ++n) { - v = T[n]; - for (c = 256 + n; c < 4096; c += 256) - v = table[c] = v >>> 8 ^ T[v & 255]; - } - var out = []; - for (n = 1; n != 16; ++n) - out[n - 1] = typeof Int32Array !== "undefined" ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256); - return out; - } - var TT = slice_by_16_tables(T0); - var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4]; - var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9]; - var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14]; - function crc32_bstr(bstr, seed) { - var C = seed ^ -1; - for (var i = 0, L = bstr.length; i < L; ) - C = C >>> 8 ^ T0[(C ^ bstr.charCodeAt(i++)) & 255]; - return ~C; - } - function crc32_buf(B, seed) { - var C = seed ^ -1, L = B.length - 15, i = 0; - for (; i < L; ) - C = Tf[B[i++] ^ C & 255] ^ Te[B[i++] ^ C >> 8 & 255] ^ Td[B[i++] ^ C >> 16 & 255] ^ Tc[B[i++] ^ C >>> 24] ^ Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]]; - L += 15; - while (i < L) - C = C >>> 8 ^ T0[(C ^ B[i++]) & 255]; - return ~C; - } - function crc32_str(str, seed) { - var C = seed ^ -1; - for (var i = 0, L = str.length, c = 0, d = 0; i < L; ) { - c = str.charCodeAt(i++); - if (c < 128) { - C = C >>> 8 ^ T0[(C ^ c) & 255]; - } else if (c < 2048) { - C = C >>> 8 ^ T0[(C ^ (192 | c >> 6 & 31)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | c & 63)) & 255]; - } else if (c >= 55296 && c < 57344) { - c = (c & 1023) + 64; - d = str.charCodeAt(i++) & 1023; - C = C >>> 8 ^ T0[(C ^ (240 | c >> 8 & 7)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | c >> 2 & 63)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | d >> 6 & 15 | (c & 3) << 4)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | d & 63)) & 255]; - } else { - C = C >>> 8 ^ T0[(C ^ (224 | c >> 12 & 15)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | c >> 6 & 63)) & 255]; - C = C >>> 8 ^ T0[(C ^ (128 | c & 63)) & 255]; - } - } - return ~C; - } - CRC322.table = T0; - CRC322.bstr = crc32_bstr; - CRC322.buf = crc32_buf; - CRC322.str = crc32_str; - }); - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/common.js -var require_common = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/common.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined"; - function _has(obj, key2) { - return Object.prototype.hasOwnProperty.call(obj, key2); - } - exports2.assign = function(obj) { - var sources = Array.prototype.slice.call(arguments, 1); - while (sources.length) { - var source = sources.shift(); - if (!source) { - continue; - } - if (typeof source !== "object") { - throw new TypeError(source + "must be non-object"); - } - for (var p in source) { - if (_has(source, p)) { - obj[p] = source[p]; - } - } - } - return obj; - }; - exports2.shrinkBuf = function(buf, size) { - if (buf.length === size) { - return buf; - } - if (buf.subarray) { - return buf.subarray(0, size); - } - buf.length = size; - return buf; - }; - var fnTyped = { - arraySet: function(dest, src, src_offs, len, dest_offs) { - if (src.subarray && dest.subarray) { - dest.set(src.subarray(src_offs, src_offs + len), dest_offs); - return; - } - for (var i = 0; i < len; i++) { - dest[dest_offs + i] = src[src_offs + i]; - } - }, - // Join array of chunks to single array. - flattenChunks: function(chunks) { - var i, l, len, pos, chunk, result; - len = 0; - for (i = 0, l = chunks.length; i < l; i++) { - len += chunks[i].length; - } - result = new Uint8Array(len); - pos = 0; - for (i = 0, l = chunks.length; i < l; i++) { - chunk = chunks[i]; - result.set(chunk, pos); - pos += chunk.length; - } - return result; - } - }; - var fnUntyped = { - arraySet: function(dest, src, src_offs, len, dest_offs) { - for (var i = 0; i < len; i++) { - dest[dest_offs + i] = src[src_offs + i]; - } - }, - // Join array of chunks to single array. - flattenChunks: function(chunks) { - return [].concat.apply([], chunks); - } - }; - exports2.setTyped = function(on) { - if (on) { - exports2.Buf8 = Uint8Array; - exports2.Buf16 = Uint16Array; - exports2.Buf32 = Int32Array; - exports2.assign(exports2, fnTyped); - } else { - exports2.Buf8 = Array; - exports2.Buf16 = Array; - exports2.Buf32 = Array; - exports2.assign(exports2, fnUntyped); - } - }; - exports2.setTyped(TYPED_OK); - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/trees.js -var require_trees = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/trees.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var utils = require_common(); - var Z_FIXED = 4; - var Z_BINARY = 0; - var Z_TEXT = 1; - var Z_UNKNOWN = 2; - function zero(buf) { - var len = buf.length; - while (--len >= 0) { - buf[len] = 0; - } - } - var STORED_BLOCK = 0; - var STATIC_TREES = 1; - var DYN_TREES = 2; - var MIN_MATCH = 3; - var MAX_MATCH = 258; - var LENGTH_CODES = 29; - var LITERALS = 256; - var L_CODES = LITERALS + 1 + LENGTH_CODES; - var D_CODES = 30; - var BL_CODES = 19; - var HEAP_SIZE = 2 * L_CODES + 1; - var MAX_BITS = 15; - var Buf_size = 16; - var MAX_BL_BITS = 7; - var END_BLOCK = 256; - var REP_3_6 = 16; - var REPZ_3_10 = 17; - var REPZ_11_138 = 18; - var extra_lbits = ( - /* extra bits for each length code */ - [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0] - ); - var extra_dbits = ( - /* extra bits for each distance code */ - [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13] - ); - var extra_blbits = ( - /* extra bits for each bit length code */ - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7] - ); - var bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; - var DIST_CODE_LEN = 512; - var static_ltree = new Array((L_CODES + 2) * 2); - zero(static_ltree); - var static_dtree = new Array(D_CODES * 2); - zero(static_dtree); - var _dist_code = new Array(DIST_CODE_LEN); - zero(_dist_code); - var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); - zero(_length_code); - var base_length = new Array(LENGTH_CODES); - zero(base_length); - var base_dist = new Array(D_CODES); - zero(base_dist); - function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { - this.static_tree = static_tree; - this.extra_bits = extra_bits; - this.extra_base = extra_base; - this.elems = elems; - this.max_length = max_length; - this.has_stree = static_tree && static_tree.length; - } - var static_l_desc; - var static_d_desc; - var static_bl_desc; - function TreeDesc(dyn_tree, stat_desc) { - this.dyn_tree = dyn_tree; - this.max_code = 0; - this.stat_desc = stat_desc; - } - function d_code(dist) { - return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; - } - function put_short(s, w) { - s.pending_buf[s.pending++] = w & 255; - s.pending_buf[s.pending++] = w >>> 8 & 255; - } - function send_bits(s, value, length) { - if (s.bi_valid > Buf_size - length) { - s.bi_buf |= value << s.bi_valid & 65535; - put_short(s, s.bi_buf); - s.bi_buf = value >> Buf_size - s.bi_valid; - s.bi_valid += length - Buf_size; - } else { - s.bi_buf |= value << s.bi_valid & 65535; - s.bi_valid += length; - } - } - function send_code(s, c, tree) { - send_bits( - s, - tree[c * 2], - tree[c * 2 + 1] - /*.Len*/ - ); - } - function bi_reverse(code, len) { - var res = 0; - do { - res |= code & 1; - code >>>= 1; - res <<= 1; - } while (--len > 0); - return res >>> 1; - } - function bi_flush(s) { - if (s.bi_valid === 16) { - put_short(s, s.bi_buf); - s.bi_buf = 0; - s.bi_valid = 0; - } else if (s.bi_valid >= 8) { - s.pending_buf[s.pending++] = s.bi_buf & 255; - s.bi_buf >>= 8; - s.bi_valid -= 8; - } - } - function gen_bitlen(s, desc) { - var tree = desc.dyn_tree; - var max_code = desc.max_code; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var extra = desc.stat_desc.extra_bits; - var base = desc.stat_desc.extra_base; - var max_length = desc.stat_desc.max_length; - var h; - var n, m; - var bits; - var xbits; - var f; - var overflow = 0; - for (bits = 0; bits <= MAX_BITS; bits++) { - s.bl_count[bits] = 0; - } - tree[s.heap[s.heap_max] * 2 + 1] = 0; - for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { - n = s.heap[h]; - bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; - if (bits > max_length) { - bits = max_length; - overflow++; - } - tree[n * 2 + 1] = bits; - if (n > max_code) { - continue; - } - s.bl_count[bits]++; - xbits = 0; - if (n >= base) { - xbits = extra[n - base]; - } - f = tree[n * 2]; - s.opt_len += f * (bits + xbits); - if (has_stree) { - s.static_len += f * (stree[n * 2 + 1] + xbits); - } - } - if (overflow === 0) { - return; - } - do { - bits = max_length - 1; - while (s.bl_count[bits] === 0) { - bits--; - } - s.bl_count[bits]--; - s.bl_count[bits + 1] += 2; - s.bl_count[max_length]--; - overflow -= 2; - } while (overflow > 0); - for (bits = max_length; bits !== 0; bits--) { - n = s.bl_count[bits]; - while (n !== 0) { - m = s.heap[--h]; - if (m > max_code) { - continue; - } - if (tree[m * 2 + 1] !== bits) { - s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2]; - tree[m * 2 + 1] = bits; - } - n--; - } - } - } - function gen_codes(tree, max_code, bl_count) { - var next_code = new Array(MAX_BITS + 1); - var code = 0; - var bits; - var n; - for (bits = 1; bits <= MAX_BITS; bits++) { - next_code[bits] = code = code + bl_count[bits - 1] << 1; - } - for (n = 0; n <= max_code; n++) { - var len = tree[n * 2 + 1]; - if (len === 0) { - continue; - } - tree[n * 2] = bi_reverse(next_code[len]++, len); - } - } - function tr_static_init() { - var n; - var bits; - var length; - var code; - var dist; - var bl_count = new Array(MAX_BITS + 1); - length = 0; - for (code = 0; code < LENGTH_CODES - 1; code++) { - base_length[code] = length; - for (n = 0; n < 1 << extra_lbits[code]; n++) { - _length_code[length++] = code; - } - } - _length_code[length - 1] = code; - dist = 0; - for (code = 0; code < 16; code++) { - base_dist[code] = dist; - for (n = 0; n < 1 << extra_dbits[code]; n++) { - _dist_code[dist++] = code; - } - } - dist >>= 7; - for (; code < D_CODES; code++) { - base_dist[code] = dist << 7; - for (n = 0; n < 1 << extra_dbits[code] - 7; n++) { - _dist_code[256 + dist++] = code; - } - } - for (bits = 0; bits <= MAX_BITS; bits++) { - bl_count[bits] = 0; - } - n = 0; - while (n <= 143) { - static_ltree[n * 2 + 1] = 8; - n++; - bl_count[8]++; - } - while (n <= 255) { - static_ltree[n * 2 + 1] = 9; - n++; - bl_count[9]++; - } - while (n <= 279) { - static_ltree[n * 2 + 1] = 7; - n++; - bl_count[7]++; - } - while (n <= 287) { - static_ltree[n * 2 + 1] = 8; - n++; - bl_count[8]++; - } - gen_codes(static_ltree, L_CODES + 1, bl_count); - for (n = 0; n < D_CODES; n++) { - static_dtree[n * 2 + 1] = 5; - static_dtree[n * 2] = bi_reverse(n, 5); - } - static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); - static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); - static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); - } - function init_block(s) { - var n; - for (n = 0; n < L_CODES; n++) { - s.dyn_ltree[n * 2] = 0; - } - for (n = 0; n < D_CODES; n++) { - s.dyn_dtree[n * 2] = 0; - } - for (n = 0; n < BL_CODES; n++) { - s.bl_tree[n * 2] = 0; - } - s.dyn_ltree[END_BLOCK * 2] = 1; - s.opt_len = s.static_len = 0; - s.last_lit = s.matches = 0; - } - function bi_windup(s) { - if (s.bi_valid > 8) { - put_short(s, s.bi_buf); - } else if (s.bi_valid > 0) { - s.pending_buf[s.pending++] = s.bi_buf; - } - s.bi_buf = 0; - s.bi_valid = 0; - } - function copy_block(s, buf, len, header) { - bi_windup(s); - if (header) { - put_short(s, len); - put_short(s, ~len); - } - utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); - s.pending += len; - } - function smaller(tree, n, m, depth) { - var _n2 = n * 2; - var _m2 = m * 2; - return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m]; - } - function pqdownheap(s, tree, k) { - var v = s.heap[k]; - var j = k << 1; - while (j <= s.heap_len) { - if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { - j++; - } - if (smaller(tree, v, s.heap[j], s.depth)) { - break; - } - s.heap[k] = s.heap[j]; - k = j; - j <<= 1; - } - s.heap[k] = v; - } - function compress_block(s, ltree, dtree) { - var dist; - var lc; - var lx = 0; - var code; - var extra; - if (s.last_lit !== 0) { - do { - dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1]; - lc = s.pending_buf[s.l_buf + lx]; - lx++; - if (dist === 0) { - send_code(s, lc, ltree); - } else { - code = _length_code[lc]; - send_code(s, code + LITERALS + 1, ltree); - extra = extra_lbits[code]; - if (extra !== 0) { - lc -= base_length[code]; - send_bits(s, lc, extra); - } - dist--; - code = d_code(dist); - send_code(s, code, dtree); - extra = extra_dbits[code]; - if (extra !== 0) { - dist -= base_dist[code]; - send_bits(s, dist, extra); - } - } - } while (lx < s.last_lit); - } - send_code(s, END_BLOCK, ltree); - } - function build_tree(s, desc) { - var tree = desc.dyn_tree; - var stree = desc.stat_desc.static_tree; - var has_stree = desc.stat_desc.has_stree; - var elems = desc.stat_desc.elems; - var n, m; - var max_code = -1; - var node; - s.heap_len = 0; - s.heap_max = HEAP_SIZE; - for (n = 0; n < elems; n++) { - if (tree[n * 2] !== 0) { - s.heap[++s.heap_len] = max_code = n; - s.depth[n] = 0; - } else { - tree[n * 2 + 1] = 0; - } - } - while (s.heap_len < 2) { - node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0; - tree[node * 2] = 1; - s.depth[node] = 0; - s.opt_len--; - if (has_stree) { - s.static_len -= stree[node * 2 + 1]; - } - } - desc.max_code = max_code; - for (n = s.heap_len >> 1; n >= 1; n--) { - pqdownheap(s, tree, n); - } - node = elems; - do { - n = s.heap[ - 1 - /*SMALLEST*/ - ]; - s.heap[ - 1 - /*SMALLEST*/ - ] = s.heap[s.heap_len--]; - pqdownheap( - s, - tree, - 1 - /*SMALLEST*/ - ); - m = s.heap[ - 1 - /*SMALLEST*/ - ]; - s.heap[--s.heap_max] = n; - s.heap[--s.heap_max] = m; - tree[node * 2] = tree[n * 2] + tree[m * 2]; - s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; - tree[n * 2 + 1] = tree[m * 2 + 1] = node; - s.heap[ - 1 - /*SMALLEST*/ - ] = node++; - pqdownheap( - s, - tree, - 1 - /*SMALLEST*/ - ); - } while (s.heap_len >= 2); - s.heap[--s.heap_max] = s.heap[ - 1 - /*SMALLEST*/ - ]; - gen_bitlen(s, desc); - gen_codes(tree, max_code, s.bl_count); - } - function scan_tree(s, tree, max_code) { - var n; - var prevlen = -1; - var curlen; - var nextlen = tree[0 * 2 + 1]; - var count = 0; - var max_count = 7; - var min_count = 4; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - tree[(max_code + 1) * 2 + 1] = 65535; - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]; - if (++count < max_count && curlen === nextlen) { - continue; - } else if (count < min_count) { - s.bl_tree[curlen * 2] += count; - } else if (curlen !== 0) { - if (curlen !== prevlen) { - s.bl_tree[curlen * 2]++; - } - s.bl_tree[REP_3_6 * 2]++; - } else if (count <= 10) { - s.bl_tree[REPZ_3_10 * 2]++; - } else { - s.bl_tree[REPZ_11_138 * 2]++; - } - count = 0; - prevlen = curlen; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - } - function send_tree(s, tree, max_code) { - var n; - var prevlen = -1; - var curlen; - var nextlen = tree[0 * 2 + 1]; - var count = 0; - var max_count = 7; - var min_count = 4; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } - for (n = 0; n <= max_code; n++) { - curlen = nextlen; - nextlen = tree[(n + 1) * 2 + 1]; - if (++count < max_count && curlen === nextlen) { - continue; - } else if (count < min_count) { - do { - send_code(s, curlen, s.bl_tree); - } while (--count !== 0); - } else if (curlen !== 0) { - if (curlen !== prevlen) { - send_code(s, curlen, s.bl_tree); - count--; - } - send_code(s, REP_3_6, s.bl_tree); - send_bits(s, count - 3, 2); - } else if (count <= 10) { - send_code(s, REPZ_3_10, s.bl_tree); - send_bits(s, count - 3, 3); - } else { - send_code(s, REPZ_11_138, s.bl_tree); - send_bits(s, count - 11, 7); - } - count = 0; - prevlen = curlen; - if (nextlen === 0) { - max_count = 138; - min_count = 3; - } else if (curlen === nextlen) { - max_count = 6; - min_count = 3; - } else { - max_count = 7; - min_count = 4; - } - } - } - function build_bl_tree(s) { - var max_blindex; - scan_tree(s, s.dyn_ltree, s.l_desc.max_code); - scan_tree(s, s.dyn_dtree, s.d_desc.max_code); - build_tree(s, s.bl_desc); - for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { - if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) { - break; - } - } - s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; - return max_blindex; - } - function send_all_trees(s, lcodes, dcodes, blcodes) { - var rank; - send_bits(s, lcodes - 257, 5); - send_bits(s, dcodes - 1, 5); - send_bits(s, blcodes - 4, 4); - for (rank = 0; rank < blcodes; rank++) { - send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3); - } - send_tree(s, s.dyn_ltree, lcodes - 1); - send_tree(s, s.dyn_dtree, dcodes - 1); - } - function detect_data_type(s) { - var black_mask = 4093624447; - var n; - for (n = 0; n <= 31; n++, black_mask >>>= 1) { - if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0) { - return Z_BINARY; - } - } - if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) { - return Z_TEXT; - } - for (n = 32; n < LITERALS; n++) { - if (s.dyn_ltree[n * 2] !== 0) { - return Z_TEXT; - } - } - return Z_BINARY; - } - var static_init_done = false; - function _tr_init(s) { - if (!static_init_done) { - tr_static_init(); - static_init_done = true; - } - s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); - s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); - s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); - s.bi_buf = 0; - s.bi_valid = 0; - init_block(s); - } - function _tr_stored_block(s, buf, stored_len, last2) { - send_bits(s, (STORED_BLOCK << 1) + (last2 ? 1 : 0), 3); - copy_block(s, buf, stored_len, true); - } - function _tr_align(s) { - send_bits(s, STATIC_TREES << 1, 3); - send_code(s, END_BLOCK, static_ltree); - bi_flush(s); - } - function _tr_flush_block(s, buf, stored_len, last2) { - var opt_lenb, static_lenb; - var max_blindex = 0; - if (s.level > 0) { - if (s.strm.data_type === Z_UNKNOWN) { - s.strm.data_type = detect_data_type(s); - } - build_tree(s, s.l_desc); - build_tree(s, s.d_desc); - max_blindex = build_bl_tree(s); - opt_lenb = s.opt_len + 3 + 7 >>> 3; - static_lenb = s.static_len + 3 + 7 >>> 3; - if (static_lenb <= opt_lenb) { - opt_lenb = static_lenb; - } - } else { - opt_lenb = static_lenb = stored_len + 5; - } - if (stored_len + 4 <= opt_lenb && buf !== -1) { - _tr_stored_block(s, buf, stored_len, last2); - } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { - send_bits(s, (STATIC_TREES << 1) + (last2 ? 1 : 0), 3); - compress_block(s, static_ltree, static_dtree); - } else { - send_bits(s, (DYN_TREES << 1) + (last2 ? 1 : 0), 3); - send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); - compress_block(s, s.dyn_ltree, s.dyn_dtree); - } - init_block(s); - if (last2) { - bi_windup(s); - } - } - function _tr_tally(s, dist, lc) { - s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255; - s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255; - s.pending_buf[s.l_buf + s.last_lit] = lc & 255; - s.last_lit++; - if (dist === 0) { - s.dyn_ltree[lc * 2]++; - } else { - s.matches++; - dist--; - s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++; - s.dyn_dtree[d_code(dist) * 2]++; - } - return s.last_lit === s.lit_bufsize - 1; - } - exports2._tr_init = _tr_init; - exports2._tr_stored_block = _tr_stored_block; - exports2._tr_flush_block = _tr_flush_block; - exports2._tr_tally = _tr_tally; - exports2._tr_align = _tr_align; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/adler32.js -var require_adler32 = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/adler32.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - function adler32(adler, buf, len, pos) { - var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0; - while (len !== 0) { - n = len > 2e3 ? 2e3 : len; - len -= n; - do { - s1 = s1 + buf[pos++] | 0; - s2 = s2 + s1 | 0; - } while (--n); - s1 %= 65521; - s2 %= 65521; - } - return s1 | s2 << 16 | 0; - } - module2.exports = adler32; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/crc32.js -var require_crc322 = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/crc32.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - function makeTable() { - var c, table = []; - for (var n = 0; n < 256; n++) { - c = n; - for (var k = 0; k < 8; k++) { - c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1; - } - table[n] = c; - } - return table; - } - var crcTable = makeTable(); - function crc322(crc, buf, len, pos) { - var t = crcTable, end = pos + len; - crc ^= -1; - for (var i = pos; i < end; i++) { - crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255]; - } - return crc ^ -1; - } - module2.exports = crc322; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/messages.js -var require_messages = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/messages.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - module2.exports = { - 2: "need dictionary", - /* Z_NEED_DICT 2 */ - 1: "stream end", - /* Z_STREAM_END 1 */ - 0: "", - /* Z_OK 0 */ - "-1": "file error", - /* Z_ERRNO (-1) */ - "-2": "stream error", - /* Z_STREAM_ERROR (-2) */ - "-3": "data error", - /* Z_DATA_ERROR (-3) */ - "-4": "insufficient memory", - /* Z_MEM_ERROR (-4) */ - "-5": "buffer error", - /* Z_BUF_ERROR (-5) */ - "-6": "incompatible version" - /* Z_VERSION_ERROR (-6) */ - }; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/deflate.js -var require_deflate = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/deflate.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var utils = require_common(); - var trees = require_trees(); - var adler32 = require_adler32(); - var crc322 = require_crc322(); - var msg = require_messages(); - var Z_NO_FLUSH = 0; - var Z_PARTIAL_FLUSH = 1; - var Z_FULL_FLUSH = 3; - var Z_FINISH = 4; - var Z_BLOCK = 5; - var Z_OK = 0; - var Z_STREAM_END = 1; - var Z_STREAM_ERROR = -2; - var Z_DATA_ERROR = -3; - var Z_BUF_ERROR = -5; - var Z_DEFAULT_COMPRESSION = -1; - var Z_FILTERED = 1; - var Z_HUFFMAN_ONLY = 2; - var Z_RLE = 3; - var Z_FIXED = 4; - var Z_DEFAULT_STRATEGY = 0; - var Z_UNKNOWN = 2; - var Z_DEFLATED = 8; - var MAX_MEM_LEVEL = 9; - var MAX_WBITS = 15; - var DEF_MEM_LEVEL = 8; - var LENGTH_CODES = 29; - var LITERALS = 256; - var L_CODES = LITERALS + 1 + LENGTH_CODES; - var D_CODES = 30; - var BL_CODES = 19; - var HEAP_SIZE = 2 * L_CODES + 1; - var MAX_BITS = 15; - var MIN_MATCH = 3; - var MAX_MATCH = 258; - var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; - var PRESET_DICT = 32; - var INIT_STATE = 42; - var EXTRA_STATE = 69; - var NAME_STATE = 73; - var COMMENT_STATE = 91; - var HCRC_STATE = 103; - var BUSY_STATE = 113; - var FINISH_STATE = 666; - var BS_NEED_MORE = 1; - var BS_BLOCK_DONE = 2; - var BS_FINISH_STARTED = 3; - var BS_FINISH_DONE = 4; - var OS_CODE = 3; - function err(strm, errorCode) { - strm.msg = msg[errorCode]; - return errorCode; - } - function rank(f) { - return (f << 1) - (f > 4 ? 9 : 0); - } - function zero(buf) { - var len = buf.length; - while (--len >= 0) { - buf[len] = 0; - } - } - function flush_pending(strm) { - var s = strm.state; - var len = s.pending; - if (len > strm.avail_out) { - len = strm.avail_out; - } - if (len === 0) { - return; - } - utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); - strm.next_out += len; - s.pending_out += len; - strm.total_out += len; - strm.avail_out -= len; - s.pending -= len; - if (s.pending === 0) { - s.pending_out = 0; - } - } - function flush_block_only(s, last2) { - trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last2); - s.block_start = s.strstart; - flush_pending(s.strm); - } - function put_byte(s, b) { - s.pending_buf[s.pending++] = b; - } - function putShortMSB(s, b) { - s.pending_buf[s.pending++] = b >>> 8 & 255; - s.pending_buf[s.pending++] = b & 255; - } - function read_buf(strm, buf, start, size) { - var len = strm.avail_in; - if (len > size) { - len = size; - } - if (len === 0) { - return 0; - } - strm.avail_in -= len; - utils.arraySet(buf, strm.input, strm.next_in, len, start); - if (strm.state.wrap === 1) { - strm.adler = adler32(strm.adler, buf, len, start); - } else if (strm.state.wrap === 2) { - strm.adler = crc322(strm.adler, buf, len, start); - } - strm.next_in += len; - strm.total_in += len; - return len; - } - function longest_match(s, cur_match) { - var chain_length = s.max_chain_length; - var scan = s.strstart; - var match; - var len; - var best_len = s.prev_length; - var nice_match = s.nice_match; - var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0; - var _win = s.window; - var wmask = s.w_mask; - var prev = s.prev; - var strend = s.strstart + MAX_MATCH; - var scan_end1 = _win[scan + best_len - 1]; - var scan_end = _win[scan + best_len]; - if (s.prev_length >= s.good_match) { - chain_length >>= 2; - } - if (nice_match > s.lookahead) { - nice_match = s.lookahead; - } - do { - match = cur_match; - if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { - continue; - } - scan += 2; - match++; - do { - } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); - len = MAX_MATCH - (strend - scan); - scan = strend - MAX_MATCH; - if (len > best_len) { - s.match_start = cur_match; - best_len = len; - if (len >= nice_match) { - break; - } - scan_end1 = _win[scan + best_len - 1]; - scan_end = _win[scan + best_len]; - } - } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); - if (best_len <= s.lookahead) { - return best_len; - } - return s.lookahead; - } - function fill_window(s) { - var _w_size = s.w_size; - var p, n, m, more, str; - do { - more = s.window_size - s.lookahead - s.strstart; - if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { - utils.arraySet(s.window, s.window, _w_size, _w_size, 0); - s.match_start -= _w_size; - s.strstart -= _w_size; - s.block_start -= _w_size; - n = s.hash_size; - p = n; - do { - m = s.head[--p]; - s.head[p] = m >= _w_size ? m - _w_size : 0; - } while (--n); - n = _w_size; - p = n; - do { - m = s.prev[--p]; - s.prev[p] = m >= _w_size ? m - _w_size : 0; - } while (--n); - more += _w_size; - } - if (s.strm.avail_in === 0) { - break; - } - n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); - s.lookahead += n; - if (s.lookahead + s.insert >= MIN_MATCH) { - str = s.strstart - s.insert; - s.ins_h = s.window[str]; - s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; - while (s.insert) { - s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; - s.prev[str & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = str; - str++; - s.insert--; - if (s.lookahead + s.insert < MIN_MATCH) { - break; - } - } - } - } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); - } - function deflate_stored(s, flush2) { - var max_block_size = 65535; - if (max_block_size > s.pending_buf_size - 5) { - max_block_size = s.pending_buf_size - 5; - } - for (; ; ) { - if (s.lookahead <= 1) { - fill_window(s); - if (s.lookahead === 0 && flush2 === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { - break; - } - } - s.strstart += s.lookahead; - s.lookahead = 0; - var max_start = s.block_start + max_block_size; - if (s.strstart === 0 || s.strstart >= max_start) { - s.lookahead = s.strstart - max_start; - s.strstart = max_start; - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - } - s.insert = 0; - if (flush2 === Z_FINISH) { - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - return BS_FINISH_DONE; - } - if (s.strstart > s.block_start) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - return BS_NEED_MORE; - } - function deflate_fast(s, flush2) { - var hash_head; - var bflush; - for (; ; ) { - if (s.lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush2 === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { - break; - } - } - hash_head = 0; - if (s.lookahead >= MIN_MATCH) { - s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - } - if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { - s.match_length = longest_match(s, hash_head); - } - if (s.match_length >= MIN_MATCH) { - bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); - s.lookahead -= s.match_length; - if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) { - s.match_length--; - do { - s.strstart++; - s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - } while (--s.match_length !== 0); - s.strstart++; - } else { - s.strstart += s.match_length; - s.match_length = 0; - s.ins_h = s.window[s.strstart]; - s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; - } - } else { - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - s.lookahead--; - s.strstart++; - } - if (bflush) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - } - s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush2 === Z_FINISH) { - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - return BS_FINISH_DONE; - } - if (s.last_lit) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - return BS_BLOCK_DONE; - } - function deflate_slow(s, flush2) { - var hash_head; - var bflush; - var max_insert; - for (; ; ) { - if (s.lookahead < MIN_LOOKAHEAD) { - fill_window(s); - if (s.lookahead < MIN_LOOKAHEAD && flush2 === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { - break; - } - } - hash_head = 0; - if (s.lookahead >= MIN_MATCH) { - s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - } - s.prev_length = s.match_length; - s.prev_match = s.match_start; - s.match_length = MIN_MATCH - 1; - if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { - s.match_length = longest_match(s, hash_head); - if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) { - s.match_length = MIN_MATCH - 1; - } - } - if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { - max_insert = s.strstart + s.lookahead - MIN_MATCH; - bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); - s.lookahead -= s.prev_length - 1; - s.prev_length -= 2; - do { - if (++s.strstart <= max_insert) { - s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; - hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = s.strstart; - } - } while (--s.prev_length !== 0); - s.match_available = 0; - s.match_length = MIN_MATCH - 1; - s.strstart++; - if (bflush) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - } else if (s.match_available) { - bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); - if (bflush) { - flush_block_only(s, false); - } - s.strstart++; - s.lookahead--; - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } else { - s.match_available = 1; - s.strstart++; - s.lookahead--; - } - } - if (s.match_available) { - bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); - s.match_available = 0; - } - s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; - if (flush2 === Z_FINISH) { - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - return BS_FINISH_DONE; - } - if (s.last_lit) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - return BS_BLOCK_DONE; - } - function deflate_rle(s, flush2) { - var bflush; - var prev; - var scan, strend; - var _win = s.window; - for (; ; ) { - if (s.lookahead <= MAX_MATCH) { - fill_window(s); - if (s.lookahead <= MAX_MATCH && flush2 === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - if (s.lookahead === 0) { - break; - } - } - s.match_length = 0; - if (s.lookahead >= MIN_MATCH && s.strstart > 0) { - scan = s.strstart - 1; - prev = _win[scan]; - if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { - strend = s.strstart + MAX_MATCH; - do { - } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); - s.match_length = MAX_MATCH - (strend - scan); - if (s.match_length > s.lookahead) { - s.match_length = s.lookahead; - } - } - } - if (s.match_length >= MIN_MATCH) { - bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); - s.lookahead -= s.match_length; - s.strstart += s.match_length; - s.match_length = 0; - } else { - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - s.lookahead--; - s.strstart++; - } - if (bflush) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - } - s.insert = 0; - if (flush2 === Z_FINISH) { - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - return BS_FINISH_DONE; - } - if (s.last_lit) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - return BS_BLOCK_DONE; - } - function deflate_huff(s, flush2) { - var bflush; - for (; ; ) { - if (s.lookahead === 0) { - fill_window(s); - if (s.lookahead === 0) { - if (flush2 === Z_NO_FLUSH) { - return BS_NEED_MORE; - } - break; - } - } - s.match_length = 0; - bflush = trees._tr_tally(s, 0, s.window[s.strstart]); - s.lookahead--; - s.strstart++; - if (bflush) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - } - s.insert = 0; - if (flush2 === Z_FINISH) { - flush_block_only(s, true); - if (s.strm.avail_out === 0) { - return BS_FINISH_STARTED; - } - return BS_FINISH_DONE; - } - if (s.last_lit) { - flush_block_only(s, false); - if (s.strm.avail_out === 0) { - return BS_NEED_MORE; - } - } - return BS_BLOCK_DONE; - } - function Config(good_length, max_lazy, nice_length, max_chain, func) { - this.good_length = good_length; - this.max_lazy = max_lazy; - this.nice_length = nice_length; - this.max_chain = max_chain; - this.func = func; - } - var configuration_table; - configuration_table = [ - /* good lazy nice chain */ - new Config(0, 0, 0, 0, deflate_stored), - /* 0 store only */ - new Config(4, 4, 8, 4, deflate_fast), - /* 1 max speed, no lazy matches */ - new Config(4, 5, 16, 8, deflate_fast), - /* 2 */ - new Config(4, 6, 32, 32, deflate_fast), - /* 3 */ - new Config(4, 4, 16, 16, deflate_slow), - /* 4 lazy matches */ - new Config(8, 16, 32, 32, deflate_slow), - /* 5 */ - new Config(8, 16, 128, 128, deflate_slow), - /* 6 */ - new Config(8, 32, 128, 256, deflate_slow), - /* 7 */ - new Config(32, 128, 258, 1024, deflate_slow), - /* 8 */ - new Config(32, 258, 258, 4096, deflate_slow) - /* 9 max compression */ - ]; - function lm_init(s) { - s.window_size = 2 * s.w_size; - zero(s.head); - s.max_lazy_match = configuration_table[s.level].max_lazy; - s.good_match = configuration_table[s.level].good_length; - s.nice_match = configuration_table[s.level].nice_length; - s.max_chain_length = configuration_table[s.level].max_chain; - s.strstart = 0; - s.block_start = 0; - s.lookahead = 0; - s.insert = 0; - s.match_length = s.prev_length = MIN_MATCH - 1; - s.match_available = 0; - s.ins_h = 0; - } - function DeflateState() { - this.strm = null; - this.status = 0; - this.pending_buf = null; - this.pending_buf_size = 0; - this.pending_out = 0; - this.pending = 0; - this.wrap = 0; - this.gzhead = null; - this.gzindex = 0; - this.method = Z_DEFLATED; - this.last_flush = -1; - this.w_size = 0; - this.w_bits = 0; - this.w_mask = 0; - this.window = null; - this.window_size = 0; - this.prev = null; - this.head = null; - this.ins_h = 0; - this.hash_size = 0; - this.hash_bits = 0; - this.hash_mask = 0; - this.hash_shift = 0; - this.block_start = 0; - this.match_length = 0; - this.prev_match = 0; - this.match_available = 0; - this.strstart = 0; - this.match_start = 0; - this.lookahead = 0; - this.prev_length = 0; - this.max_chain_length = 0; - this.max_lazy_match = 0; - this.level = 0; - this.strategy = 0; - this.good_match = 0; - this.nice_match = 0; - this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); - this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); - this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); - zero(this.dyn_ltree); - zero(this.dyn_dtree); - zero(this.bl_tree); - this.l_desc = null; - this.d_desc = null; - this.bl_desc = null; - this.bl_count = new utils.Buf16(MAX_BITS + 1); - this.heap = new utils.Buf16(2 * L_CODES + 1); - zero(this.heap); - this.heap_len = 0; - this.heap_max = 0; - this.depth = new utils.Buf16(2 * L_CODES + 1); - zero(this.depth); - this.l_buf = 0; - this.lit_bufsize = 0; - this.last_lit = 0; - this.d_buf = 0; - this.opt_len = 0; - this.static_len = 0; - this.matches = 0; - this.insert = 0; - this.bi_buf = 0; - this.bi_valid = 0; - } - function deflateResetKeep(strm) { - var s; - if (!strm || !strm.state) { - return err(strm, Z_STREAM_ERROR); - } - strm.total_in = strm.total_out = 0; - strm.data_type = Z_UNKNOWN; - s = strm.state; - s.pending = 0; - s.pending_out = 0; - if (s.wrap < 0) { - s.wrap = -s.wrap; - } - s.status = s.wrap ? INIT_STATE : BUSY_STATE; - strm.adler = s.wrap === 2 ? 0 : 1; - s.last_flush = Z_NO_FLUSH; - trees._tr_init(s); - return Z_OK; - } - function deflateReset(strm) { - var ret = deflateResetKeep(strm); - if (ret === Z_OK) { - lm_init(strm.state); - } - return ret; - } - function deflateSetHeader(strm, head) { - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - if (strm.state.wrap !== 2) { - return Z_STREAM_ERROR; - } - strm.state.gzhead = head; - return Z_OK; - } - function deflateInit2(strm, level, method2, windowBits, memLevel, strategy) { - if (!strm) { - return Z_STREAM_ERROR; - } - var wrap = 1; - if (level === Z_DEFAULT_COMPRESSION) { - level = 6; - } - if (windowBits < 0) { - wrap = 0; - windowBits = -windowBits; - } else if (windowBits > 15) { - wrap = 2; - windowBits -= 16; - } - if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method2 !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { - return err(strm, Z_STREAM_ERROR); - } - if (windowBits === 8) { - windowBits = 9; - } - var s = new DeflateState(); - strm.state = s; - s.strm = strm; - s.wrap = wrap; - s.gzhead = null; - s.w_bits = windowBits; - s.w_size = 1 << s.w_bits; - s.w_mask = s.w_size - 1; - s.hash_bits = memLevel + 7; - s.hash_size = 1 << s.hash_bits; - s.hash_mask = s.hash_size - 1; - s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); - s.window = new utils.Buf8(s.w_size * 2); - s.head = new utils.Buf16(s.hash_size); - s.prev = new utils.Buf16(s.w_size); - s.lit_bufsize = 1 << memLevel + 6; - s.pending_buf_size = s.lit_bufsize * 4; - s.pending_buf = new utils.Buf8(s.pending_buf_size); - s.d_buf = 1 * s.lit_bufsize; - s.l_buf = (1 + 2) * s.lit_bufsize; - s.level = level; - s.strategy = strategy; - s.method = method2; - return deflateReset(strm); - } - function deflateInit(strm, level) { - return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); - } - function deflate2(strm, flush2) { - var old_flush, s; - var beg, val; - if (!strm || !strm.state || flush2 > Z_BLOCK || flush2 < 0) { - return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; - } - s = strm.state; - if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush2 !== Z_FINISH) { - return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR); - } - s.strm = strm; - old_flush = s.last_flush; - s.last_flush = flush2; - if (s.status === INIT_STATE) { - if (s.wrap === 2) { - strm.adler = 0; - put_byte(s, 31); - put_byte(s, 139); - put_byte(s, 8); - if (!s.gzhead) { - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, 0); - put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); - put_byte(s, OS_CODE); - s.status = BUSY_STATE; - } else { - put_byte( - s, - (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16) - ); - put_byte(s, s.gzhead.time & 255); - put_byte(s, s.gzhead.time >> 8 & 255); - put_byte(s, s.gzhead.time >> 16 & 255); - put_byte(s, s.gzhead.time >> 24 & 255); - put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); - put_byte(s, s.gzhead.os & 255); - if (s.gzhead.extra && s.gzhead.extra.length) { - put_byte(s, s.gzhead.extra.length & 255); - put_byte(s, s.gzhead.extra.length >> 8 & 255); - } - if (s.gzhead.hcrc) { - strm.adler = crc322(strm.adler, s.pending_buf, s.pending, 0); - } - s.gzindex = 0; - s.status = EXTRA_STATE; - } - } else { - var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8; - var level_flags = -1; - if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { - level_flags = 0; - } else if (s.level < 6) { - level_flags = 1; - } else if (s.level === 6) { - level_flags = 2; - } else { - level_flags = 3; - } - header |= level_flags << 6; - if (s.strstart !== 0) { - header |= PRESET_DICT; - } - header += 31 - header % 31; - s.status = BUSY_STATE; - putShortMSB(s, header); - if (s.strstart !== 0) { - putShortMSB(s, strm.adler >>> 16); - putShortMSB(s, strm.adler & 65535); - } - strm.adler = 1; - } - } - if (s.status === EXTRA_STATE) { - if (s.gzhead.extra) { - beg = s.pending; - while (s.gzindex < (s.gzhead.extra.length & 65535)) { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - break; - } - } - put_byte(s, s.gzhead.extra[s.gzindex] & 255); - s.gzindex++; - } - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (s.gzindex === s.gzhead.extra.length) { - s.gzindex = 0; - s.status = NAME_STATE; - } - } else { - s.status = NAME_STATE; - } - } - if (s.status === NAME_STATE) { - if (s.gzhead.name) { - beg = s.pending; - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } - if (s.gzindex < s.gzhead.name.length) { - val = s.gzhead.name.charCodeAt(s.gzindex++) & 255; - } else { - val = 0; - } - put_byte(s, val); - } while (val !== 0); - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (val === 0) { - s.gzindex = 0; - s.status = COMMENT_STATE; - } - } else { - s.status = COMMENT_STATE; - } - } - if (s.status === COMMENT_STATE) { - if (s.gzhead.comment) { - beg = s.pending; - do { - if (s.pending === s.pending_buf_size) { - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); - } - flush_pending(strm); - beg = s.pending; - if (s.pending === s.pending_buf_size) { - val = 1; - break; - } - } - if (s.gzindex < s.gzhead.comment.length) { - val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255; - } else { - val = 0; - } - put_byte(s, val); - } while (val !== 0); - if (s.gzhead.hcrc && s.pending > beg) { - strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); - } - if (val === 0) { - s.status = HCRC_STATE; - } - } else { - s.status = HCRC_STATE; - } - } - if (s.status === HCRC_STATE) { - if (s.gzhead.hcrc) { - if (s.pending + 2 > s.pending_buf_size) { - flush_pending(strm); - } - if (s.pending + 2 <= s.pending_buf_size) { - put_byte(s, strm.adler & 255); - put_byte(s, strm.adler >> 8 & 255); - strm.adler = 0; - s.status = BUSY_STATE; - } - } else { - s.status = BUSY_STATE; - } - } - if (s.pending !== 0) { - flush_pending(strm); - if (strm.avail_out === 0) { - s.last_flush = -1; - return Z_OK; - } - } else if (strm.avail_in === 0 && rank(flush2) <= rank(old_flush) && flush2 !== Z_FINISH) { - return err(strm, Z_BUF_ERROR); - } - if (s.status === FINISH_STATE && strm.avail_in !== 0) { - return err(strm, Z_BUF_ERROR); - } - if (strm.avail_in !== 0 || s.lookahead !== 0 || flush2 !== Z_NO_FLUSH && s.status !== FINISH_STATE) { - var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush2) : s.strategy === Z_RLE ? deflate_rle(s, flush2) : configuration_table[s.level].func(s, flush2); - if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { - s.status = FINISH_STATE; - } - if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { - if (strm.avail_out === 0) { - s.last_flush = -1; - } - return Z_OK; - } - if (bstate === BS_BLOCK_DONE) { - if (flush2 === Z_PARTIAL_FLUSH) { - trees._tr_align(s); - } else if (flush2 !== Z_BLOCK) { - trees._tr_stored_block(s, 0, 0, false); - if (flush2 === Z_FULL_FLUSH) { - zero(s.head); - if (s.lookahead === 0) { - s.strstart = 0; - s.block_start = 0; - s.insert = 0; - } - } - } - flush_pending(strm); - if (strm.avail_out === 0) { - s.last_flush = -1; - return Z_OK; - } - } - } - if (flush2 !== Z_FINISH) { - return Z_OK; - } - if (s.wrap <= 0) { - return Z_STREAM_END; - } - if (s.wrap === 2) { - put_byte(s, strm.adler & 255); - put_byte(s, strm.adler >> 8 & 255); - put_byte(s, strm.adler >> 16 & 255); - put_byte(s, strm.adler >> 24 & 255); - put_byte(s, strm.total_in & 255); - put_byte(s, strm.total_in >> 8 & 255); - put_byte(s, strm.total_in >> 16 & 255); - put_byte(s, strm.total_in >> 24 & 255); - } else { - putShortMSB(s, strm.adler >>> 16); - putShortMSB(s, strm.adler & 65535); - } - flush_pending(strm); - if (s.wrap > 0) { - s.wrap = -s.wrap; - } - return s.pending !== 0 ? Z_OK : Z_STREAM_END; - } - function deflateEnd(strm) { - var status2; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - status2 = strm.state.status; - if (status2 !== INIT_STATE && status2 !== EXTRA_STATE && status2 !== NAME_STATE && status2 !== COMMENT_STATE && status2 !== HCRC_STATE && status2 !== BUSY_STATE && status2 !== FINISH_STATE) { - return err(strm, Z_STREAM_ERROR); - } - strm.state = null; - return status2 === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; - } - function deflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - var s; - var str, n; - var wrap; - var avail; - var next; - var input; - var tmpDict; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - s = strm.state; - wrap = s.wrap; - if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) { - return Z_STREAM_ERROR; - } - if (wrap === 1) { - strm.adler = adler32(strm.adler, dictionary, dictLength, 0); - } - s.wrap = 0; - if (dictLength >= s.w_size) { - if (wrap === 0) { - zero(s.head); - s.strstart = 0; - s.block_start = 0; - s.insert = 0; - } - tmpDict = new utils.Buf8(s.w_size); - utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); - dictionary = tmpDict; - dictLength = s.w_size; - } - avail = strm.avail_in; - next = strm.next_in; - input = strm.input; - strm.avail_in = dictLength; - strm.next_in = 0; - strm.input = dictionary; - fill_window(s); - while (s.lookahead >= MIN_MATCH) { - str = s.strstart; - n = s.lookahead - (MIN_MATCH - 1); - do { - s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; - s.prev[str & s.w_mask] = s.head[s.ins_h]; - s.head[s.ins_h] = str; - str++; - } while (--n); - s.strstart = str; - s.lookahead = MIN_MATCH - 1; - fill_window(s); - } - s.strstart += s.lookahead; - s.block_start = s.strstart; - s.insert = s.lookahead; - s.lookahead = 0; - s.match_length = s.prev_length = MIN_MATCH - 1; - s.match_available = 0; - strm.next_in = next; - strm.input = input; - strm.avail_in = avail; - s.wrap = wrap; - return Z_OK; - } - exports2.deflateInit = deflateInit; - exports2.deflateInit2 = deflateInit2; - exports2.deflateReset = deflateReset; - exports2.deflateResetKeep = deflateResetKeep; - exports2.deflateSetHeader = deflateSetHeader; - exports2.deflate = deflate2; - exports2.deflateEnd = deflateEnd; - exports2.deflateSetDictionary = deflateSetDictionary; - exports2.deflateInfo = "pako deflate (from Nodeca project)"; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/strings.js -var require_strings = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/utils/strings.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var utils = require_common(); - var STR_APPLY_OK = true; - var STR_APPLY_UIA_OK = true; - try { - String.fromCharCode.apply(null, [0]); - } catch (__) { - STR_APPLY_OK = false; - } - try { - String.fromCharCode.apply(null, new Uint8Array(1)); - } catch (__) { - STR_APPLY_UIA_OK = false; - } - var _utf8len = new utils.Buf8(256); - for (q = 0; q < 256; q++) { - _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1; - } - var q; - _utf8len[254] = _utf8len[254] = 1; - exports2.string2buf = function(str) { - var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; - for (m_pos = 0; m_pos < str_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 64512) === 55296 && m_pos + 1 < str_len) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 64512) === 56320) { - c = 65536 + (c - 55296 << 10) + (c2 - 56320); - m_pos++; - } - } - buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4; - } - buf = new utils.Buf8(buf_len); - for (i = 0, m_pos = 0; i < buf_len; m_pos++) { - c = str.charCodeAt(m_pos); - if ((c & 64512) === 55296 && m_pos + 1 < str_len) { - c2 = str.charCodeAt(m_pos + 1); - if ((c2 & 64512) === 56320) { - c = 65536 + (c - 55296 << 10) + (c2 - 56320); - m_pos++; - } - } - if (c < 128) { - buf[i++] = c; - } else if (c < 2048) { - buf[i++] = 192 | c >>> 6; - buf[i++] = 128 | c & 63; - } else if (c < 65536) { - buf[i++] = 224 | c >>> 12; - buf[i++] = 128 | c >>> 6 & 63; - buf[i++] = 128 | c & 63; - } else { - buf[i++] = 240 | c >>> 18; - buf[i++] = 128 | c >>> 12 & 63; - buf[i++] = 128 | c >>> 6 & 63; - buf[i++] = 128 | c & 63; - } - } - return buf; - }; - function buf2binstring(buf, len) { - if (len < 65534) { - if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) { - return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); - } - } - var result = ""; - for (var i = 0; i < len; i++) { - result += String.fromCharCode(buf[i]); - } - return result; - } - exports2.buf2binstring = function(buf) { - return buf2binstring(buf, buf.length); - }; - exports2.binstring2buf = function(str) { - var buf = new utils.Buf8(str.length); - for (var i = 0, len = buf.length; i < len; i++) { - buf[i] = str.charCodeAt(i); - } - return buf; - }; - exports2.buf2string = function(buf, max) { - var i, out, c, c_len; - var len = max || buf.length; - var utf16buf = new Array(len * 2); - for (out = 0, i = 0; i < len; ) { - c = buf[i++]; - if (c < 128) { - utf16buf[out++] = c; - continue; - } - c_len = _utf8len[c]; - if (c_len > 4) { - utf16buf[out++] = 65533; - i += c_len - 1; - continue; - } - c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; - while (c_len > 1 && i < len) { - c = c << 6 | buf[i++] & 63; - c_len--; - } - if (c_len > 1) { - utf16buf[out++] = 65533; - continue; - } - if (c < 65536) { - utf16buf[out++] = c; - } else { - c -= 65536; - utf16buf[out++] = 55296 | c >> 10 & 1023; - utf16buf[out++] = 56320 | c & 1023; - } - } - return buf2binstring(utf16buf, out); - }; - exports2.utf8border = function(buf, max) { - var pos; - max = max || buf.length; - if (max > buf.length) { - max = buf.length; - } - pos = max - 1; - while (pos >= 0 && (buf[pos] & 192) === 128) { - pos--; - } - if (pos < 0) { - return max; - } - if (pos === 0) { - return max; - } - return pos + _utf8len[buf[pos]] > max ? pos : max; - }; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/zstream.js -var require_zstream = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/zstream.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - function ZStream() { - this.input = null; - this.next_in = 0; - this.avail_in = 0; - this.total_in = 0; - this.output = null; - this.next_out = 0; - this.avail_out = 0; - this.total_out = 0; - this.msg = ""; - this.state = null; - this.data_type = 2; - this.adler = 0; - } - module2.exports = ZStream; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/deflate.js -var require_deflate2 = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/deflate.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var zlib_deflate = require_deflate(); - var utils = require_common(); - var strings = require_strings(); - var msg = require_messages(); - var ZStream = require_zstream(); - var toString = Object.prototype.toString; - var Z_NO_FLUSH = 0; - var Z_FINISH = 4; - var Z_OK = 0; - var Z_STREAM_END = 1; - var Z_SYNC_FLUSH = 2; - var Z_DEFAULT_COMPRESSION = -1; - var Z_DEFAULT_STRATEGY = 0; - var Z_DEFLATED = 8; - function Deflate(options) { - if (!(this instanceof Deflate)) - return new Deflate(options); - this.options = utils.assign({ - level: Z_DEFAULT_COMPRESSION, - method: Z_DEFLATED, - chunkSize: 16384, - windowBits: 15, - memLevel: 8, - strategy: Z_DEFAULT_STRATEGY, - to: "" - }, options || {}); - var opt = this.options; - if (opt.raw && opt.windowBits > 0) { - opt.windowBits = -opt.windowBits; - } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) { - opt.windowBits += 16; - } - this.err = 0; - this.msg = ""; - this.ended = false; - this.chunks = []; - this.strm = new ZStream(); - this.strm.avail_out = 0; - var status2 = zlib_deflate.deflateInit2( - this.strm, - opt.level, - opt.method, - opt.windowBits, - opt.memLevel, - opt.strategy - ); - if (status2 !== Z_OK) { - throw new Error(msg[status2]); - } - if (opt.header) { - zlib_deflate.deflateSetHeader(this.strm, opt.header); - } - if (opt.dictionary) { - var dict; - if (typeof opt.dictionary === "string") { - dict = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { - dict = new Uint8Array(opt.dictionary); - } else { - dict = opt.dictionary; - } - status2 = zlib_deflate.deflateSetDictionary(this.strm, dict); - if (status2 !== Z_OK) { - throw new Error(msg[status2]); - } - this._dict_set = true; - } - } - Deflate.prototype.push = function(data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var status2, _mode; - if (this.ended) { - return false; - } - _mode = mode === ~~mode ? mode : mode === true ? Z_FINISH : Z_NO_FLUSH; - if (typeof data === "string") { - strm.input = strings.string2buf(data); - } else if (toString.call(data) === "[object ArrayBuffer]") { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - strm.next_in = 0; - strm.avail_in = strm.input.length; - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - status2 = zlib_deflate.deflate(strm, _mode); - if (status2 !== Z_STREAM_END && status2 !== Z_OK) { - this.onEnd(status2); - this.ended = true; - return false; - } - if (strm.avail_out === 0 || strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH)) { - if (this.options.to === "string") { - this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status2 !== Z_STREAM_END); - if (_mode === Z_FINISH) { - status2 = zlib_deflate.deflateEnd(this.strm); - this.onEnd(status2); - this.ended = true; - return status2 === Z_OK; - } - if (_mode === Z_SYNC_FLUSH) { - this.onEnd(Z_OK); - strm.avail_out = 0; - return true; - } - return true; - }; - Deflate.prototype.onData = function(chunk) { - this.chunks.push(chunk); - }; - Deflate.prototype.onEnd = function(status2) { - if (status2 === Z_OK) { - if (this.options.to === "string") { - this.result = this.chunks.join(""); - } else { - this.result = utils.flattenChunks(this.chunks); - } - } - this.chunks = []; - this.err = status2; - this.msg = this.strm.msg; - }; - function deflate2(input, options) { - var deflator = new Deflate(options); - deflator.push(input, true); - if (deflator.err) { - throw deflator.msg || msg[deflator.err]; - } - return deflator.result; - } - function deflateRaw(input, options) { - options = options || {}; - options.raw = true; - return deflate2(input, options); - } - function gzip(input, options) { - options = options || {}; - options.gzip = true; - return deflate2(input, options); - } - exports2.Deflate = Deflate; - exports2.deflate = deflate2; - exports2.deflateRaw = deflateRaw; - exports2.gzip = gzip; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inffast.js -var require_inffast = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inffast.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var BAD = 30; - var TYPE = 12; - module2.exports = function inflate_fast(strm, start) { - var state; - var _in; - var last2; - var _out; - var beg; - var end; - var dmax; - var wsize; - var whave; - var wnext; - var s_window; - var hold; - var bits; - var lcode; - var dcode; - var lmask; - var dmask; - var here; - var op; - var len; - var dist; - var from; - var from_source; - var input, output; - state = strm.state; - _in = strm.next_in; - input = strm.input; - last2 = _in + (strm.avail_in - 5); - _out = strm.next_out; - output = strm.output; - beg = _out - (start - strm.avail_out); - end = _out + (strm.avail_out - 257); - dmax = state.dmax; - wsize = state.wsize; - whave = state.whave; - wnext = state.wnext; - s_window = state.window; - hold = state.hold; - bits = state.bits; - lcode = state.lencode; - dcode = state.distcode; - lmask = (1 << state.lenbits) - 1; - dmask = (1 << state.distbits) - 1; - top: - do { - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - here = lcode[hold & lmask]; - dolen: - for (; ; ) { - op = here >>> 24; - hold >>>= op; - bits -= op; - op = here >>> 16 & 255; - if (op === 0) { - output[_out++] = here & 65535; - } else if (op & 16) { - len = here & 65535; - op &= 15; - if (op) { - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - len += hold & (1 << op) - 1; - hold >>>= op; - bits -= op; - } - if (bits < 15) { - hold += input[_in++] << bits; - bits += 8; - hold += input[_in++] << bits; - bits += 8; - } - here = dcode[hold & dmask]; - dodist: - for (; ; ) { - op = here >>> 24; - hold >>>= op; - bits -= op; - op = here >>> 16 & 255; - if (op & 16) { - dist = here & 65535; - op &= 15; - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - if (bits < op) { - hold += input[_in++] << bits; - bits += 8; - } - } - dist += hold & (1 << op) - 1; - if (dist > dmax) { - strm.msg = "invalid distance too far back"; - state.mode = BAD; - break top; - } - hold >>>= op; - bits -= op; - op = _out - beg; - if (dist > op) { - op = dist - op; - if (op > whave) { - if (state.sane) { - strm.msg = "invalid distance too far back"; - state.mode = BAD; - break top; - } - } - from = 0; - from_source = s_window; - if (wnext === 0) { - from += wsize - op; - if (op < len) { - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; - from_source = output; - } - } else if (wnext < op) { - from += wsize + wnext - op; - op -= wnext; - if (op < len) { - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = 0; - if (wnext < len) { - op = wnext; - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; - from_source = output; - } - } - } else { - from += wnext - op; - if (op < len) { - len -= op; - do { - output[_out++] = s_window[from++]; - } while (--op); - from = _out - dist; - from_source = output; - } - } - while (len > 2) { - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - output[_out++] = from_source[from++]; - len -= 3; - } - if (len) { - output[_out++] = from_source[from++]; - if (len > 1) { - output[_out++] = from_source[from++]; - } - } - } else { - from = _out - dist; - do { - output[_out++] = output[from++]; - output[_out++] = output[from++]; - output[_out++] = output[from++]; - len -= 3; - } while (len > 2); - if (len) { - output[_out++] = output[from++]; - if (len > 1) { - output[_out++] = output[from++]; - } - } - } - } else if ((op & 64) === 0) { - here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; - continue dodist; - } else { - strm.msg = "invalid distance code"; - state.mode = BAD; - break top; - } - break; - } - } else if ((op & 64) === 0) { - here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; - continue dolen; - } else if (op & 32) { - state.mode = TYPE; - break top; - } else { - strm.msg = "invalid literal/length code"; - state.mode = BAD; - break top; - } - break; - } - } while (_in < last2 && _out < end); - len = bits >> 3; - _in -= len; - bits -= len << 3; - hold &= (1 << bits) - 1; - strm.next_in = _in; - strm.next_out = _out; - strm.avail_in = _in < last2 ? 5 + (last2 - _in) : 5 - (_in - last2); - strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); - state.hold = hold; - state.bits = bits; - return; - }; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inftrees.js -var require_inftrees = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inftrees.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var utils = require_common(); - var MAXBITS = 15; - var ENOUGH_LENS = 852; - var ENOUGH_DISTS = 592; - var CODES = 0; - var LENS = 1; - var DISTS = 2; - var lbase = [ - /* Length codes 257..285 base */ - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 13, - 15, - 17, - 19, - 23, - 27, - 31, - 35, - 43, - 51, - 59, - 67, - 83, - 99, - 115, - 131, - 163, - 195, - 227, - 258, - 0, - 0 - ]; - var lext = [ - /* Length codes 257..285 extra */ - 16, - 16, - 16, - 16, - 16, - 16, - 16, - 16, - 17, - 17, - 17, - 17, - 18, - 18, - 18, - 18, - 19, - 19, - 19, - 19, - 20, - 20, - 20, - 20, - 21, - 21, - 21, - 21, - 16, - 72, - 78 - ]; - var dbase = [ - /* Distance codes 0..29 base */ - 1, - 2, - 3, - 4, - 5, - 7, - 9, - 13, - 17, - 25, - 33, - 49, - 65, - 97, - 129, - 193, - 257, - 385, - 513, - 769, - 1025, - 1537, - 2049, - 3073, - 4097, - 6145, - 8193, - 12289, - 16385, - 24577, - 0, - 0 - ]; - var dext = [ - /* Distance codes 0..29 extra */ - 16, - 16, - 16, - 16, - 17, - 17, - 18, - 18, - 19, - 19, - 20, - 20, - 21, - 21, - 22, - 22, - 23, - 23, - 24, - 24, - 25, - 25, - 26, - 26, - 27, - 27, - 28, - 28, - 29, - 29, - 64, - 64 - ]; - module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) { - var bits = opts.bits; - var len = 0; - var sym = 0; - var min = 0, max = 0; - var root2 = 0; - var curr = 0; - var drop = 0; - var left = 0; - var used = 0; - var huff = 0; - var incr; - var fill; - var low; - var mask; - var next; - var base = null; - var base_index = 0; - var end; - var count = new utils.Buf16(MAXBITS + 1); - var offs = new utils.Buf16(MAXBITS + 1); - var extra = null; - var extra_index = 0; - var here_bits, here_op, here_val; - for (len = 0; len <= MAXBITS; len++) { - count[len] = 0; - } - for (sym = 0; sym < codes; sym++) { - count[lens[lens_index + sym]]++; - } - root2 = bits; - for (max = MAXBITS; max >= 1; max--) { - if (count[max] !== 0) { - break; - } - } - if (root2 > max) { - root2 = max; - } - if (max === 0) { - table[table_index++] = 1 << 24 | 64 << 16 | 0; - table[table_index++] = 1 << 24 | 64 << 16 | 0; - opts.bits = 1; - return 0; - } - for (min = 1; min < max; min++) { - if (count[min] !== 0) { - break; - } - } - if (root2 < min) { - root2 = min; - } - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) { - return -1; - } - } - if (left > 0 && (type === CODES || max !== 1)) { - return -1; - } - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) { - offs[len + 1] = offs[len] + count[len]; - } - for (sym = 0; sym < codes; sym++) { - if (lens[lens_index + sym] !== 0) { - work[offs[lens[lens_index + sym]]++] = sym; - } - } - if (type === CODES) { - base = extra = work; - end = 19; - } else if (type === LENS) { - base = lbase; - base_index -= 257; - extra = lext; - extra_index -= 257; - end = 256; - } else { - base = dbase; - extra = dext; - end = -1; - } - huff = 0; - sym = 0; - len = min; - next = table_index; - curr = root2; - drop = 0; - low = -1; - used = 1 << root2; - mask = used - 1; - if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { - return 1; - } - for (; ; ) { - here_bits = len - drop; - if (work[sym] < end) { - here_op = 0; - here_val = work[sym]; - } else if (work[sym] > end) { - here_op = extra[extra_index + work[sym]]; - here_val = base[base_index + work[sym]]; - } else { - here_op = 32 + 64; - here_val = 0; - } - incr = 1 << len - drop; - fill = 1 << curr; - min = fill; - do { - fill -= incr; - table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0; - } while (fill !== 0); - incr = 1 << len - 1; - while (huff & incr) { - incr >>= 1; - } - if (incr !== 0) { - huff &= incr - 1; - huff += incr; - } else { - huff = 0; - } - sym++; - if (--count[len] === 0) { - if (len === max) { - break; - } - len = lens[lens_index + work[sym]]; - } - if (len > root2 && (huff & mask) !== low) { - if (drop === 0) { - drop = root2; - } - next += min; - curr = len - drop; - left = 1 << curr; - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) { - break; - } - curr++; - left <<= 1; - } - used += 1 << curr; - if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { - return 1; - } - low = huff & mask; - table[low] = root2 << 24 | curr << 16 | next - table_index | 0; - } - } - if (huff !== 0) { - table[next + huff] = len - drop << 24 | 64 << 16 | 0; - } - opts.bits = root2; - return 0; - }; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inflate.js -var require_inflate = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/inflate.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var utils = require_common(); - var adler32 = require_adler32(); - var crc322 = require_crc322(); - var inflate_fast = require_inffast(); - var inflate_table = require_inftrees(); - var CODES = 0; - var LENS = 1; - var DISTS = 2; - var Z_FINISH = 4; - var Z_BLOCK = 5; - var Z_TREES = 6; - var Z_OK = 0; - var Z_STREAM_END = 1; - var Z_NEED_DICT = 2; - var Z_STREAM_ERROR = -2; - var Z_DATA_ERROR = -3; - var Z_MEM_ERROR = -4; - var Z_BUF_ERROR = -5; - var Z_DEFLATED = 8; - var HEAD = 1; - var FLAGS = 2; - var TIME = 3; - var OS = 4; - var EXLEN = 5; - var EXTRA2 = 6; - var NAME = 7; - var COMMENT = 8; - var HCRC = 9; - var DICTID = 10; - var DICT = 11; - var TYPE = 12; - var TYPEDO = 13; - var STORED = 14; - var COPY_ = 15; - var COPY = 16; - var TABLE = 17; - var LENLENS = 18; - var CODELENS = 19; - var LEN_ = 20; - var LEN = 21; - var LENEXT = 22; - var DIST = 23; - var DISTEXT = 24; - var MATCH = 25; - var LIT = 26; - var CHECK = 27; - var LENGTH = 28; - var DONE = 29; - var BAD = 30; - var MEM = 31; - var SYNC = 32; - var ENOUGH_LENS = 852; - var ENOUGH_DISTS = 592; - var MAX_WBITS = 15; - var DEF_WBITS = MAX_WBITS; - function zswap32(q) { - return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24); - } - function InflateState() { - this.mode = 0; - this.last = false; - this.wrap = 0; - this.havedict = false; - this.flags = 0; - this.dmax = 0; - this.check = 0; - this.total = 0; - this.head = null; - this.wbits = 0; - this.wsize = 0; - this.whave = 0; - this.wnext = 0; - this.window = null; - this.hold = 0; - this.bits = 0; - this.length = 0; - this.offset = 0; - this.extra = 0; - this.lencode = null; - this.distcode = null; - this.lenbits = 0; - this.distbits = 0; - this.ncode = 0; - this.nlen = 0; - this.ndist = 0; - this.have = 0; - this.next = null; - this.lens = new utils.Buf16(320); - this.work = new utils.Buf16(288); - this.lendyn = null; - this.distdyn = null; - this.sane = 0; - this.back = 0; - this.was = 0; - } - function inflateResetKeep(strm) { - var state; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - strm.total_in = strm.total_out = state.total = 0; - strm.msg = ""; - if (state.wrap) { - strm.adler = state.wrap & 1; - } - state.mode = HEAD; - state.last = 0; - state.havedict = 0; - state.dmax = 32768; - state.head = null; - state.hold = 0; - state.bits = 0; - state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); - state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); - state.sane = 1; - state.back = -1; - return Z_OK; - } - function inflateReset(strm) { - var state; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - state.wsize = 0; - state.whave = 0; - state.wnext = 0; - return inflateResetKeep(strm); - } - function inflateReset2(strm, windowBits) { - var wrap; - var state; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - if (windowBits < 0) { - wrap = 0; - windowBits = -windowBits; - } else { - wrap = (windowBits >> 4) + 1; - if (windowBits < 48) { - windowBits &= 15; - } - } - if (windowBits && (windowBits < 8 || windowBits > 15)) { - return Z_STREAM_ERROR; - } - if (state.window !== null && state.wbits !== windowBits) { - state.window = null; - } - state.wrap = wrap; - state.wbits = windowBits; - return inflateReset(strm); - } - function inflateInit2(strm, windowBits) { - var ret; - var state; - if (!strm) { - return Z_STREAM_ERROR; - } - state = new InflateState(); - strm.state = state; - state.window = null; - ret = inflateReset2(strm, windowBits); - if (ret !== Z_OK) { - strm.state = null; - } - return ret; - } - function inflateInit(strm) { - return inflateInit2(strm, DEF_WBITS); - } - var virgin = true; - var lenfix; - var distfix; - function fixedtables(state) { - if (virgin) { - var sym; - lenfix = new utils.Buf32(512); - distfix = new utils.Buf32(32); - sym = 0; - while (sym < 144) { - state.lens[sym++] = 8; - } - while (sym < 256) { - state.lens[sym++] = 9; - } - while (sym < 280) { - state.lens[sym++] = 7; - } - while (sym < 288) { - state.lens[sym++] = 8; - } - inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); - sym = 0; - while (sym < 32) { - state.lens[sym++] = 5; - } - inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); - virgin = false; - } - state.lencode = lenfix; - state.lenbits = 9; - state.distcode = distfix; - state.distbits = 5; - } - function updatewindow(strm, src, end, copy2) { - var dist; - var state = strm.state; - if (state.window === null) { - state.wsize = 1 << state.wbits; - state.wnext = 0; - state.whave = 0; - state.window = new utils.Buf8(state.wsize); - } - if (copy2 >= state.wsize) { - utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); - state.wnext = 0; - state.whave = state.wsize; - } else { - dist = state.wsize - state.wnext; - if (dist > copy2) { - dist = copy2; - } - utils.arraySet(state.window, src, end - copy2, dist, state.wnext); - copy2 -= dist; - if (copy2) { - utils.arraySet(state.window, src, end - copy2, copy2, 0); - state.wnext = copy2; - state.whave = state.wsize; - } else { - state.wnext += dist; - if (state.wnext === state.wsize) { - state.wnext = 0; - } - if (state.whave < state.wsize) { - state.whave += dist; - } - } - } - return 0; - } - function inflate2(strm, flush2) { - var state; - var input, output; - var next; - var put; - var have, left; - var hold; - var bits; - var _in, _out; - var copy2; - var from; - var from_source; - var here = 0; - var here_bits, here_op, here_val; - var last_bits, last_op, last_val; - var len; - var ret; - var hbuf = new utils.Buf8(4); - var opts; - var n; - var order = ( - /* permutation of code lengths */ - [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15] - ); - if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { - return Z_STREAM_ERROR; - } - state = strm.state; - if (state.mode === TYPE) { - state.mode = TYPEDO; - } - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - _in = have; - _out = left; - ret = Z_OK; - inf_leave: - for (; ; ) { - switch (state.mode) { - case HEAD: - if (state.wrap === 0) { - state.mode = TYPEDO; - break; - } - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (state.wrap & 2 && hold === 35615) { - state.check = 0; - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - state.check = crc322(state.check, hbuf, 2, 0); - hold = 0; - bits = 0; - state.mode = FLAGS; - break; - } - state.flags = 0; - if (state.head) { - state.head.done = false; - } - if (!(state.wrap & 1) || /* check if zlib header allowed */ - (((hold & 255) << 8) + (hold >> 8)) % 31) { - strm.msg = "incorrect header check"; - state.mode = BAD; - break; - } - if ((hold & 15) !== Z_DEFLATED) { - strm.msg = "unknown compression method"; - state.mode = BAD; - break; - } - hold >>>= 4; - bits -= 4; - len = (hold & 15) + 8; - if (state.wbits === 0) { - state.wbits = len; - } else if (len > state.wbits) { - strm.msg = "invalid window size"; - state.mode = BAD; - break; - } - state.dmax = 1 << len; - strm.adler = state.check = 1; - state.mode = hold & 512 ? DICTID : TYPE; - hold = 0; - bits = 0; - break; - case FLAGS: - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.flags = hold; - if ((state.flags & 255) !== Z_DEFLATED) { - strm.msg = "unknown compression method"; - state.mode = BAD; - break; - } - if (state.flags & 57344) { - strm.msg = "unknown header flags set"; - state.mode = BAD; - break; - } - if (state.head) { - state.head.text = hold >> 8 & 1; - } - if (state.flags & 512) { - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - state.check = crc322(state.check, hbuf, 2, 0); - } - hold = 0; - bits = 0; - state.mode = TIME; - case TIME: - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (state.head) { - state.head.time = hold; - } - if (state.flags & 512) { - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - hbuf[2] = hold >>> 16 & 255; - hbuf[3] = hold >>> 24 & 255; - state.check = crc322(state.check, hbuf, 4, 0); - } - hold = 0; - bits = 0; - state.mode = OS; - case OS: - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (state.head) { - state.head.xflags = hold & 255; - state.head.os = hold >> 8; - } - if (state.flags & 512) { - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - state.check = crc322(state.check, hbuf, 2, 0); - } - hold = 0; - bits = 0; - state.mode = EXLEN; - case EXLEN: - if (state.flags & 1024) { - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.length = hold; - if (state.head) { - state.head.extra_len = hold; - } - if (state.flags & 512) { - hbuf[0] = hold & 255; - hbuf[1] = hold >>> 8 & 255; - state.check = crc322(state.check, hbuf, 2, 0); - } - hold = 0; - bits = 0; - } else if (state.head) { - state.head.extra = null; - } - state.mode = EXTRA2; - case EXTRA2: - if (state.flags & 1024) { - copy2 = state.length; - if (copy2 > have) { - copy2 = have; - } - if (copy2) { - if (state.head) { - len = state.head.extra_len - state.length; - if (!state.head.extra) { - state.head.extra = new Array(state.head.extra_len); - } - utils.arraySet( - state.head.extra, - input, - next, - // extra field is limited to 65536 bytes - // - no need for additional size check - copy2, - /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ - len - ); - } - if (state.flags & 512) { - state.check = crc322(state.check, input, copy2, next); - } - have -= copy2; - next += copy2; - state.length -= copy2; - } - if (state.length) { - break inf_leave; - } - } - state.length = 0; - state.mode = NAME; - case NAME: - if (state.flags & 2048) { - if (have === 0) { - break inf_leave; - } - copy2 = 0; - do { - len = input[next + copy2++]; - if (state.head && len && state.length < 65536) { - state.head.name += String.fromCharCode(len); - } - } while (len && copy2 < have); - if (state.flags & 512) { - state.check = crc322(state.check, input, copy2, next); - } - have -= copy2; - next += copy2; - if (len) { - break inf_leave; - } - } else if (state.head) { - state.head.name = null; - } - state.length = 0; - state.mode = COMMENT; - case COMMENT: - if (state.flags & 4096) { - if (have === 0) { - break inf_leave; - } - copy2 = 0; - do { - len = input[next + copy2++]; - if (state.head && len && state.length < 65536) { - state.head.comment += String.fromCharCode(len); - } - } while (len && copy2 < have); - if (state.flags & 512) { - state.check = crc322(state.check, input, copy2, next); - } - have -= copy2; - next += copy2; - if (len) { - break inf_leave; - } - } else if (state.head) { - state.head.comment = null; - } - state.mode = HCRC; - case HCRC: - if (state.flags & 512) { - while (bits < 16) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (hold !== (state.check & 65535)) { - strm.msg = "header crc mismatch"; - state.mode = BAD; - break; - } - hold = 0; - bits = 0; - } - if (state.head) { - state.head.hcrc = state.flags >> 9 & 1; - state.head.done = true; - } - strm.adler = state.check = 0; - state.mode = TYPE; - break; - case DICTID: - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - strm.adler = state.check = zswap32(hold); - hold = 0; - bits = 0; - state.mode = DICT; - case DICT: - if (state.havedict === 0) { - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - return Z_NEED_DICT; - } - strm.adler = state.check = 1; - state.mode = TYPE; - case TYPE: - if (flush2 === Z_BLOCK || flush2 === Z_TREES) { - break inf_leave; - } - case TYPEDO: - if (state.last) { - hold >>>= bits & 7; - bits -= bits & 7; - state.mode = CHECK; - break; - } - while (bits < 3) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.last = hold & 1; - hold >>>= 1; - bits -= 1; - switch (hold & 3) { - case 0: - state.mode = STORED; - break; - case 1: - fixedtables(state); - state.mode = LEN_; - if (flush2 === Z_TREES) { - hold >>>= 2; - bits -= 2; - break inf_leave; - } - break; - case 2: - state.mode = TABLE; - break; - case 3: - strm.msg = "invalid block type"; - state.mode = BAD; - } - hold >>>= 2; - bits -= 2; - break; - case STORED: - hold >>>= bits & 7; - bits -= bits & 7; - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { - strm.msg = "invalid stored block lengths"; - state.mode = BAD; - break; - } - state.length = hold & 65535; - hold = 0; - bits = 0; - state.mode = COPY_; - if (flush2 === Z_TREES) { - break inf_leave; - } - case COPY_: - state.mode = COPY; - case COPY: - copy2 = state.length; - if (copy2) { - if (copy2 > have) { - copy2 = have; - } - if (copy2 > left) { - copy2 = left; - } - if (copy2 === 0) { - break inf_leave; - } - utils.arraySet(output, input, next, copy2, put); - have -= copy2; - next += copy2; - left -= copy2; - put += copy2; - state.length -= copy2; - break; - } - state.mode = TYPE; - break; - case TABLE: - while (bits < 14) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.nlen = (hold & 31) + 257; - hold >>>= 5; - bits -= 5; - state.ndist = (hold & 31) + 1; - hold >>>= 5; - bits -= 5; - state.ncode = (hold & 15) + 4; - hold >>>= 4; - bits -= 4; - if (state.nlen > 286 || state.ndist > 30) { - strm.msg = "too many length or distance symbols"; - state.mode = BAD; - break; - } - state.have = 0; - state.mode = LENLENS; - case LENLENS: - while (state.have < state.ncode) { - while (bits < 3) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.lens[order[state.have++]] = hold & 7; - hold >>>= 3; - bits -= 3; - } - while (state.have < 19) { - state.lens[order[state.have++]] = 0; - } - state.lencode = state.lendyn; - state.lenbits = 7; - opts = { bits: state.lenbits }; - ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); - state.lenbits = opts.bits; - if (ret) { - strm.msg = "invalid code lengths set"; - state.mode = BAD; - break; - } - state.have = 0; - state.mode = CODELENS; - case CODELENS: - while (state.have < state.nlen + state.ndist) { - for (; ; ) { - here = state.lencode[hold & (1 << state.lenbits) - 1]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (here_val < 16) { - hold >>>= here_bits; - bits -= here_bits; - state.lens[state.have++] = here_val; - } else { - if (here_val === 16) { - n = here_bits + 2; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= here_bits; - bits -= here_bits; - if (state.have === 0) { - strm.msg = "invalid bit length repeat"; - state.mode = BAD; - break; - } - len = state.lens[state.have - 1]; - copy2 = 3 + (hold & 3); - hold >>>= 2; - bits -= 2; - } else if (here_val === 17) { - n = here_bits + 3; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= here_bits; - bits -= here_bits; - len = 0; - copy2 = 3 + (hold & 7); - hold >>>= 3; - bits -= 3; - } else { - n = here_bits + 7; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= here_bits; - bits -= here_bits; - len = 0; - copy2 = 11 + (hold & 127); - hold >>>= 7; - bits -= 7; - } - if (state.have + copy2 > state.nlen + state.ndist) { - strm.msg = "invalid bit length repeat"; - state.mode = BAD; - break; - } - while (copy2--) { - state.lens[state.have++] = len; - } - } - } - if (state.mode === BAD) { - break; - } - if (state.lens[256] === 0) { - strm.msg = "invalid code -- missing end-of-block"; - state.mode = BAD; - break; - } - state.lenbits = 9; - opts = { bits: state.lenbits }; - ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); - state.lenbits = opts.bits; - if (ret) { - strm.msg = "invalid literal/lengths set"; - state.mode = BAD; - break; - } - state.distbits = 6; - state.distcode = state.distdyn; - opts = { bits: state.distbits }; - ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); - state.distbits = opts.bits; - if (ret) { - strm.msg = "invalid distances set"; - state.mode = BAD; - break; - } - state.mode = LEN_; - if (flush2 === Z_TREES) { - break inf_leave; - } - case LEN_: - state.mode = LEN; - case LEN: - if (have >= 6 && left >= 258) { - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - inflate_fast(strm, _out); - put = strm.next_out; - output = strm.output; - left = strm.avail_out; - next = strm.next_in; - input = strm.input; - have = strm.avail_in; - hold = state.hold; - bits = state.bits; - if (state.mode === TYPE) { - state.back = -1; - } - break; - } - state.back = 0; - for (; ; ) { - here = state.lencode[hold & (1 << state.lenbits) - 1]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (here_op && (here_op & 240) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (; ; ) { - here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (last_bits + here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= last_bits; - bits -= last_bits; - state.back += last_bits; - } - hold >>>= here_bits; - bits -= here_bits; - state.back += here_bits; - state.length = here_val; - if (here_op === 0) { - state.mode = LIT; - break; - } - if (here_op & 32) { - state.back = -1; - state.mode = TYPE; - break; - } - if (here_op & 64) { - strm.msg = "invalid literal/length code"; - state.mode = BAD; - break; - } - state.extra = here_op & 15; - state.mode = LENEXT; - case LENEXT: - if (state.extra) { - n = state.extra; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.length += hold & (1 << state.extra) - 1; - hold >>>= state.extra; - bits -= state.extra; - state.back += state.extra; - } - state.was = state.length; - state.mode = DIST; - case DIST: - for (; ; ) { - here = state.distcode[hold & (1 << state.distbits) - 1]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if ((here_op & 240) === 0) { - last_bits = here_bits; - last_op = here_op; - last_val = here_val; - for (; ; ) { - here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; - here_bits = here >>> 24; - here_op = here >>> 16 & 255; - here_val = here & 65535; - if (last_bits + here_bits <= bits) { - break; - } - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - hold >>>= last_bits; - bits -= last_bits; - state.back += last_bits; - } - hold >>>= here_bits; - bits -= here_bits; - state.back += here_bits; - if (here_op & 64) { - strm.msg = "invalid distance code"; - state.mode = BAD; - break; - } - state.offset = here_val; - state.extra = here_op & 15; - state.mode = DISTEXT; - case DISTEXT: - if (state.extra) { - n = state.extra; - while (bits < n) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - state.offset += hold & (1 << state.extra) - 1; - hold >>>= state.extra; - bits -= state.extra; - state.back += state.extra; - } - if (state.offset > state.dmax) { - strm.msg = "invalid distance too far back"; - state.mode = BAD; - break; - } - state.mode = MATCH; - case MATCH: - if (left === 0) { - break inf_leave; - } - copy2 = _out - left; - if (state.offset > copy2) { - copy2 = state.offset - copy2; - if (copy2 > state.whave) { - if (state.sane) { - strm.msg = "invalid distance too far back"; - state.mode = BAD; - break; - } - } - if (copy2 > state.wnext) { - copy2 -= state.wnext; - from = state.wsize - copy2; - } else { - from = state.wnext - copy2; - } - if (copy2 > state.length) { - copy2 = state.length; - } - from_source = state.window; - } else { - from_source = output; - from = put - state.offset; - copy2 = state.length; - } - if (copy2 > left) { - copy2 = left; - } - left -= copy2; - state.length -= copy2; - do { - output[put++] = from_source[from++]; - } while (--copy2); - if (state.length === 0) { - state.mode = LEN; - } - break; - case LIT: - if (left === 0) { - break inf_leave; - } - output[put++] = state.length; - left--; - state.mode = LEN; - break; - case CHECK: - if (state.wrap) { - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold |= input[next++] << bits; - bits += 8; - } - _out -= left; - strm.total_out += _out; - state.total += _out; - if (_out) { - strm.adler = state.check = /*UPDATE(state.check, put - _out, _out);*/ - state.flags ? crc322(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out); - } - _out = left; - if ((state.flags ? hold : zswap32(hold)) !== state.check) { - strm.msg = "incorrect data check"; - state.mode = BAD; - break; - } - hold = 0; - bits = 0; - } - state.mode = LENGTH; - case LENGTH: - if (state.wrap && state.flags) { - while (bits < 32) { - if (have === 0) { - break inf_leave; - } - have--; - hold += input[next++] << bits; - bits += 8; - } - if (hold !== (state.total & 4294967295)) { - strm.msg = "incorrect length check"; - state.mode = BAD; - break; - } - hold = 0; - bits = 0; - } - state.mode = DONE; - case DONE: - ret = Z_STREAM_END; - break inf_leave; - case BAD: - ret = Z_DATA_ERROR; - break inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - default: - return Z_STREAM_ERROR; - } - } - strm.next_out = put; - strm.avail_out = left; - strm.next_in = next; - strm.avail_in = have; - state.hold = hold; - state.bits = bits; - if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush2 !== Z_FINISH)) { - if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { - state.mode = MEM; - return Z_MEM_ERROR; - } - } - _in -= strm.avail_in; - _out -= strm.avail_out; - strm.total_in += _in; - strm.total_out += _out; - state.total += _out; - if (state.wrap && _out) { - strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ - state.flags ? crc322(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out); - } - strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); - if ((_in === 0 && _out === 0 || flush2 === Z_FINISH) && ret === Z_OK) { - ret = Z_BUF_ERROR; - } - return ret; - } - function inflateEnd(strm) { - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - var state = strm.state; - if (state.window) { - state.window = null; - } - strm.state = null; - return Z_OK; - } - function inflateGetHeader(strm, head) { - var state; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - if ((state.wrap & 2) === 0) { - return Z_STREAM_ERROR; - } - state.head = head; - head.done = false; - return Z_OK; - } - function inflateSetDictionary(strm, dictionary) { - var dictLength = dictionary.length; - var state; - var dictid; - var ret; - if (!strm || !strm.state) { - return Z_STREAM_ERROR; - } - state = strm.state; - if (state.wrap !== 0 && state.mode !== DICT) { - return Z_STREAM_ERROR; - } - if (state.mode === DICT) { - dictid = 1; - dictid = adler32(dictid, dictionary, dictLength, 0); - if (dictid !== state.check) { - return Z_DATA_ERROR; - } - } - ret = updatewindow(strm, dictionary, dictLength, dictLength); - if (ret) { - state.mode = MEM; - return Z_MEM_ERROR; - } - state.havedict = 1; - return Z_OK; - } - exports2.inflateReset = inflateReset; - exports2.inflateReset2 = inflateReset2; - exports2.inflateResetKeep = inflateResetKeep; - exports2.inflateInit = inflateInit; - exports2.inflateInit2 = inflateInit2; - exports2.inflate = inflate2; - exports2.inflateEnd = inflateEnd; - exports2.inflateGetHeader = inflateGetHeader; - exports2.inflateSetDictionary = inflateSetDictionary; - exports2.inflateInfo = "pako inflate (from Nodeca project)"; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/constants.js -var require_constants = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/constants.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - module2.exports = { - /* Allowed flush values; see deflate() and inflate() below for details */ - Z_NO_FLUSH: 0, - Z_PARTIAL_FLUSH: 1, - Z_SYNC_FLUSH: 2, - Z_FULL_FLUSH: 3, - Z_FINISH: 4, - Z_BLOCK: 5, - Z_TREES: 6, - /* Return codes for the compression/decompression functions. Negative values - * are errors, positive values are used for special but normal events. - */ - Z_OK: 0, - Z_STREAM_END: 1, - Z_NEED_DICT: 2, - Z_ERRNO: -1, - Z_STREAM_ERROR: -2, - Z_DATA_ERROR: -3, - //Z_MEM_ERROR: -4, - Z_BUF_ERROR: -5, - //Z_VERSION_ERROR: -6, - /* compression levels */ - Z_NO_COMPRESSION: 0, - Z_BEST_SPEED: 1, - Z_BEST_COMPRESSION: 9, - Z_DEFAULT_COMPRESSION: -1, - Z_FILTERED: 1, - Z_HUFFMAN_ONLY: 2, - Z_RLE: 3, - Z_FIXED: 4, - Z_DEFAULT_STRATEGY: 0, - /* Possible values of the data_type field (though see inflate()) */ - Z_BINARY: 0, - Z_TEXT: 1, - //Z_ASCII: 1, // = Z_TEXT (deprecated) - Z_UNKNOWN: 2, - /* The deflate compression method */ - Z_DEFLATED: 8 - //Z_NULL: null // Use -1 or null inline, depending on var type - }; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/gzheader.js -var require_gzheader = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/zlib/gzheader.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - function GZheader() { - this.text = 0; - this.time = 0; - this.xflags = 0; - this.os = 0; - this.extra = null; - this.extra_len = 0; - this.name = ""; - this.comment = ""; - this.hcrc = 0; - this.done = false; - } - module2.exports = GZheader; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/inflate.js -var require_inflate2 = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/lib/inflate.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var zlib_inflate = require_inflate(); - var utils = require_common(); - var strings = require_strings(); - var c = require_constants(); - var msg = require_messages(); - var ZStream = require_zstream(); - var GZheader = require_gzheader(); - var toString = Object.prototype.toString; - function Inflate(options) { - if (!(this instanceof Inflate)) - return new Inflate(options); - this.options = utils.assign({ - chunkSize: 16384, - windowBits: 0, - to: "" - }, options || {}); - var opt = this.options; - if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) { - opt.windowBits = -opt.windowBits; - if (opt.windowBits === 0) { - opt.windowBits = -15; - } - } - if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) { - opt.windowBits += 32; - } - if (opt.windowBits > 15 && opt.windowBits < 48) { - if ((opt.windowBits & 15) === 0) { - opt.windowBits |= 15; - } - } - this.err = 0; - this.msg = ""; - this.ended = false; - this.chunks = []; - this.strm = new ZStream(); - this.strm.avail_out = 0; - var status2 = zlib_inflate.inflateInit2( - this.strm, - opt.windowBits - ); - if (status2 !== c.Z_OK) { - throw new Error(msg[status2]); - } - this.header = new GZheader(); - zlib_inflate.inflateGetHeader(this.strm, this.header); - if (opt.dictionary) { - if (typeof opt.dictionary === "string") { - opt.dictionary = strings.string2buf(opt.dictionary); - } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { - opt.dictionary = new Uint8Array(opt.dictionary); - } - if (opt.raw) { - status2 = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary); - if (status2 !== c.Z_OK) { - throw new Error(msg[status2]); - } - } - } - } - Inflate.prototype.push = function(data, mode) { - var strm = this.strm; - var chunkSize = this.options.chunkSize; - var dictionary = this.options.dictionary; - var status2, _mode; - var next_out_utf8, tail, utf8str; - var allowBufError = false; - if (this.ended) { - return false; - } - _mode = mode === ~~mode ? mode : mode === true ? c.Z_FINISH : c.Z_NO_FLUSH; - if (typeof data === "string") { - strm.input = strings.binstring2buf(data); - } else if (toString.call(data) === "[object ArrayBuffer]") { - strm.input = new Uint8Array(data); - } else { - strm.input = data; - } - strm.next_in = 0; - strm.avail_in = strm.input.length; - do { - if (strm.avail_out === 0) { - strm.output = new utils.Buf8(chunkSize); - strm.next_out = 0; - strm.avail_out = chunkSize; - } - status2 = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); - if (status2 === c.Z_NEED_DICT && dictionary) { - status2 = zlib_inflate.inflateSetDictionary(this.strm, dictionary); - } - if (status2 === c.Z_BUF_ERROR && allowBufError === true) { - status2 = c.Z_OK; - allowBufError = false; - } - if (status2 !== c.Z_STREAM_END && status2 !== c.Z_OK) { - this.onEnd(status2); - this.ended = true; - return false; - } - if (strm.next_out) { - if (strm.avail_out === 0 || status2 === c.Z_STREAM_END || strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH)) { - if (this.options.to === "string") { - next_out_utf8 = strings.utf8border(strm.output, strm.next_out); - tail = strm.next_out - next_out_utf8; - utf8str = strings.buf2string(strm.output, next_out_utf8); - strm.next_out = tail; - strm.avail_out = chunkSize - tail; - if (tail) { - utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); - } - this.onData(utf8str); - } else { - this.onData(utils.shrinkBuf(strm.output, strm.next_out)); - } - } - } - if (strm.avail_in === 0 && strm.avail_out === 0) { - allowBufError = true; - } - } while ((strm.avail_in > 0 || strm.avail_out === 0) && status2 !== c.Z_STREAM_END); - if (status2 === c.Z_STREAM_END) { - _mode = c.Z_FINISH; - } - if (_mode === c.Z_FINISH) { - status2 = zlib_inflate.inflateEnd(this.strm); - this.onEnd(status2); - this.ended = true; - return status2 === c.Z_OK; - } - if (_mode === c.Z_SYNC_FLUSH) { - this.onEnd(c.Z_OK); - strm.avail_out = 0; - return true; - } - return true; - }; - Inflate.prototype.onData = function(chunk) { - this.chunks.push(chunk); - }; - Inflate.prototype.onEnd = function(status2) { - if (status2 === c.Z_OK) { - if (this.options.to === "string") { - this.result = this.chunks.join(""); - } else { - this.result = utils.flattenChunks(this.chunks); - } - } - this.chunks = []; - this.err = status2; - this.msg = this.strm.msg; - }; - function inflate2(input, options) { - var inflator = new Inflate(options); - inflator.push(input, true); - if (inflator.err) { - throw inflator.msg || msg[inflator.err]; - } - return inflator.result; - } - function inflateRaw(input, options) { - options = options || {}; - options.raw = true; - return inflate2(input, options); - } - exports2.Inflate = Inflate; - exports2.inflate = inflate2; - exports2.inflateRaw = inflateRaw; - exports2.ungzip = inflate2; - } -}); - -// node_modules/.pnpm/pako@1.0.11/node_modules/pako/index.js -var require_pako = __commonJS({ - "node_modules/.pnpm/pako@1.0.11/node_modules/pako/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var assign2 = require_common().assign; - var deflate2 = require_deflate2(); - var inflate2 = require_inflate2(); - var constants = require_constants(); - var pako2 = {}; - assign2(pako2, deflate2, inflate2, constants); - module2.exports = pako2; - } -}); - -// node_modules/.pnpm/pify@4.0.1/node_modules/pify/index.js -var require_pify = __commonJS({ - "node_modules/.pnpm/pify@4.0.1/node_modules/pify/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var processFn = (fn, options) => function(...args) { - const P = options.promiseModule; - return new P((resolve, reject) => { - if (options.multiArgs) { - args.push((...result) => { - if (options.errorFirst) { - if (result[0]) { - reject(result); - } else { - result.shift(); - resolve(result); - } - } else { - resolve(result); - } - }); - } else if (options.errorFirst) { - args.push((error, result) => { - if (error) { - reject(error); - } else { - resolve(result); - } - }); - } else { - args.push(resolve); - } - fn.apply(this, args); - }); - }; - module2.exports = (input, options) => { - options = Object.assign({ - exclude: [/.+(Sync|Stream)$/], - errorFirst: true, - promiseModule: Promise - }, options); - const objType = typeof input; - if (!(input !== null && (objType === "object" || objType === "function"))) { - throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${input === null ? "null" : objType}\``); - } - const filter = (key2) => { - const match = (pattern) => typeof pattern === "string" ? key2 === pattern : pattern.test(key2); - return options.include ? options.include.some(match) : !options.exclude.some(match); - }; - let ret; - if (objType === "function") { - ret = function(...args) { - return options.excludeMain ? input(...args) : processFn(input, options).apply(this, args); - }; - } else { - ret = Object.create(Object.getPrototypeOf(input)); - } - for (const key2 in input) { - const property = input[key2]; - ret[key2] = typeof property === "function" && filter(key2) ? processFn(property, options) : property; - } - return ret; - }; - } -}); - -// node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.js -var require_ignore = __commonJS({ - "node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.js"(exports2, module2) { - init_polyfill_buffer(); - function makeArray(subject) { - return Array.isArray(subject) ? subject : [subject]; - } - var EMPTY = ""; - var SPACE = " "; - var ESCAPE = "\\"; - var REGEX_TEST_BLANK_LINE = /^\s+$/; - var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; - var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; - var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; - var REGEX_SPLITALL_CRLF = /\r?\n/g; - var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; - var SLASH = "/"; - var TMP_KEY_IGNORE = "node-ignore"; - if (typeof Symbol !== "undefined") { - TMP_KEY_IGNORE = Symbol.for("node-ignore"); - } - var KEY_IGNORE = TMP_KEY_IGNORE; - var define2 = (object, key2, value) => Object.defineProperty(object, key2, { value }); - var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; - var RETURN_FALSE = () => false; - var sanitizeRange = (range) => range.replace( - REGEX_REGEXP_RANGE, - (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY - ); - var cleanRangeBackSlash = (slashes) => { - const { length } = slashes; - return slashes.slice(0, length - length % 2); - }; - var REPLACERS = [ - // > Trailing spaces are ignored unless they are quoted with backslash ("\") - [ - // (a\ ) -> (a ) - // (a ) -> (a) - // (a \ ) -> (a ) - /\\?\s+$/, - (match) => match.indexOf("\\") === 0 ? SPACE : EMPTY - ], - // replace (\ ) with ' ' - [ - /\\\s/g, - () => SPACE - ], - // Escape metacharacters - // which is written down by users but means special for regular expressions. - // > There are 12 characters with special meanings: - // > - the backslash \, - // > - the caret ^, - // > - the dollar sign $, - // > - the period or dot ., - // > - the vertical bar or pipe symbol |, - // > - the question mark ?, - // > - the asterisk or star *, - // > - the plus sign +, - // > - the opening parenthesis (, - // > - the closing parenthesis ), - // > - and the opening square bracket [, - // > - the opening curly brace {, - // > These special characters are often called "metacharacters". - [ - /[\\$.|*+(){^]/g, - (match) => `\\${match}` - ], - [ - // > a question mark (?) matches a single character - /(?!\\)\?/g, - () => "[^/]" - ], - // leading slash - [ - // > A leading slash matches the beginning of the pathname. - // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c". - // A leading slash matches the beginning of the pathname - /^\//, - () => "^" - ], - // replace special metacharacter slash after the leading slash - [ - /\//g, - () => "\\/" - ], - [ - // > A leading "**" followed by a slash means match in all directories. - // > For example, "**/foo" matches file or directory "foo" anywhere, - // > the same as pattern "foo". - // > "**/foo/bar" matches file or directory "bar" anywhere that is directly - // > under directory "foo". - // Notice that the '*'s have been replaced as '\\*' - /^\^*\\\*\\\*\\\//, - // '**/foo' <-> 'foo' - () => "^(?:.*\\/)?" - ], - // starting - [ - // there will be no leading '/' - // (which has been replaced by section "leading slash") - // If starts with '**', adding a '^' to the regular expression also works - /^(?=[^^])/, - function startingReplacer() { - return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; - } - ], - // two globstars - [ - // Use lookahead assertions so that we could match more than one `'/**'` - /\\\/\\\*\\\*(?=\\\/|$)/g, - // Zero, one or several directories - // should not use '*', or it will be replaced by the next replacer - // Check if it is not the last `'/**'` - (_, index2, str) => index2 + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+" - ], - // normal intermediate wildcards - [ - // Never replace escaped '*' - // ignore rule '\*' will match the path '*' - // 'abc.*/' -> go - // 'abc.*' -> skip this rule, - // coz trailing single wildcard will be handed by [trailing wildcard] - /(^|[^\\]+)(\\\*)+(?=.+)/g, - // '*.js' matches '.js' - // '*.js' doesn't match 'abc' - (_, p1, p2) => { - const unescaped = p2.replace(/\\\*/g, "[^\\/]*"); - return p1 + unescaped; - } - ], - [ - // unescape, revert step 3 except for back slash - // For example, if a user escape a '\\*', - // after step 3, the result will be '\\\\\\*' - /\\\\\\(?=[$.|*+(){^])/g, - () => ESCAPE - ], - [ - // '\\\\' -> '\\' - /\\\\/g, - () => ESCAPE - ], - [ - // > The range notation, e.g. [a-zA-Z], - // > can be used to match one of the characters in a range. - // `\` is escaped by step 3 - /(\\)?\[([^\]/]*?)(\\*)($|\])/g, - (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]" - ], - // ending - [ - // 'js' will not match 'js.' - // 'ab' will not match 'abc' - /(?:[^*])$/, - // WTF! - // https://git-scm.com/docs/gitignore - // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1) - // which re-fixes #24, #38 - // > If there is a separator at the end of the pattern then the pattern - // > will only match directories, otherwise the pattern can match both - // > files and directories. - // 'js*' will not match 'a.js' - // 'js/' will not match 'a.js' - // 'js' will match 'a.js' and 'a.js/' - (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)` - ], - // trailing wildcard - [ - /(\^|\\\/)?\\\*$/, - (_, p1) => { - const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; - return `${prefix}(?=$|\\/$)`; - } - ] - ]; - var regexCache = /* @__PURE__ */ Object.create(null); - var makeRegex = (pattern, ignoreCase) => { - let source = regexCache[pattern]; - if (!source) { - source = REPLACERS.reduce( - (prev, current) => prev.replace(current[0], current[1].bind(pattern)), - pattern - ); - regexCache[pattern] = source; - } - return ignoreCase ? new RegExp(source, "i") : new RegExp(source); - }; - var isString = (subject) => typeof subject === "string"; - var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0; - var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF); - var IgnoreRule = class { - constructor(origin, pattern, negative, regex2) { - this.origin = origin; - this.pattern = pattern; - this.negative = negative; - this.regex = regex2; - } - }; - var createRule = (pattern, ignoreCase) => { - const origin = pattern; - let negative = false; - if (pattern.indexOf("!") === 0) { - negative = true; - pattern = pattern.substr(1); - } - pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); - const regex2 = makeRegex(pattern, ignoreCase); - return new IgnoreRule( - origin, - pattern, - negative, - regex2 - ); - }; - var throwError = (message, Ctor) => { - throw new Ctor(message); - }; - var checkPath = (path2, originalPath, doThrow) => { - if (!isString(path2)) { - return doThrow( - `path must be a string, but got \`${originalPath}\``, - TypeError - ); - } - if (!path2) { - return doThrow(`path must not be empty`, TypeError); - } - if (checkPath.isNotRelative(path2)) { - const r = "`path.relative()`d"; - return doThrow( - `path should be a ${r} string, but got "${originalPath}"`, - RangeError - ); - } - return true; - }; - var isNotRelative = (path2) => REGEX_TEST_INVALID_PATH.test(path2); - checkPath.isNotRelative = isNotRelative; - checkPath.convert = (p) => p; - var Ignore = class { - constructor({ - ignorecase = true, - ignoreCase = ignorecase, - allowRelativePaths = false - } = {}) { - define2(this, KEY_IGNORE, true); - this._rules = []; - this._ignoreCase = ignoreCase; - this._allowRelativePaths = allowRelativePaths; - this._initCache(); - } - _initCache() { - this._ignoreCache = /* @__PURE__ */ Object.create(null); - this._testCache = /* @__PURE__ */ Object.create(null); - } - _addPattern(pattern) { - if (pattern && pattern[KEY_IGNORE]) { - this._rules = this._rules.concat(pattern._rules); - this._added = true; - return; - } - if (checkPattern(pattern)) { - const rule = createRule(pattern, this._ignoreCase); - this._added = true; - this._rules.push(rule); - } - } - // @param {Array | string | Ignore} pattern - add(pattern) { - this._added = false; - makeArray( - isString(pattern) ? splitPattern(pattern) : pattern - ).forEach(this._addPattern, this); - if (this._added) { - this._initCache(); - } - return this; - } - // legacy - addPattern(pattern) { - return this.add(pattern); - } - // | ignored : unignored - // negative | 0:0 | 0:1 | 1:0 | 1:1 - // -------- | ------- | ------- | ------- | -------- - // 0 | TEST | TEST | SKIP | X - // 1 | TESTIF | SKIP | TEST | X - // - SKIP: always skip - // - TEST: always test - // - TESTIF: only test if checkUnignored - // - X: that never happen - // @param {boolean} whether should check if the path is unignored, - // setting `checkUnignored` to `false` could reduce additional - // path matching. - // @returns {TestResult} true if a file is ignored - _testOne(path2, checkUnignored) { - let ignored = false; - let unignored = false; - this._rules.forEach((rule) => { - const { negative } = rule; - if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { - return; - } - const matched = rule.regex.test(path2); - if (matched) { - ignored = !negative; - unignored = negative; - } - }); - return { - ignored, - unignored - }; - } - // @returns {TestResult} - _test(originalPath, cache, checkUnignored, slices) { - const path2 = originalPath && checkPath.convert(originalPath); - checkPath( - path2, - originalPath, - this._allowRelativePaths ? RETURN_FALSE : throwError - ); - return this._t(path2, cache, checkUnignored, slices); - } - _t(path2, cache, checkUnignored, slices) { - if (path2 in cache) { - return cache[path2]; - } - if (!slices) { - slices = path2.split(SLASH); - } - slices.pop(); - if (!slices.length) { - return cache[path2] = this._testOne(path2, checkUnignored); - } - const parent = this._t( - slices.join(SLASH) + SLASH, - cache, - checkUnignored, - slices - ); - return cache[path2] = parent.ignored ? parent : this._testOne(path2, checkUnignored); - } - ignores(path2) { - return this._test(path2, this._ignoreCache, false).ignored; - } - createFilter() { - return (path2) => !this.ignores(path2); - } - filter(paths) { - return makeArray(paths).filter(this.createFilter()); - } - // @returns {TestResult} - test(path2) { - return this._test(path2, this._testCache, true); - } - }; - var factory = (options) => new Ignore(options); - var isPathValid = (path2) => checkPath(path2 && checkPath.convert(path2), path2, RETURN_FALSE); - factory.isPathValid = isPathValid; - factory.default = factory; - module2.exports = factory; - if ( - // Detect `process` so that it can run in browsers. - typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32") - ) { - const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"); - checkPath.convert = makePosix; - const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; - checkPath.isNotRelative = (path2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path2) || isNotRelative(path2); - } - } -}); - -// node_modules/.pnpm/clean-git-ref@2.0.1/node_modules/clean-git-ref/lib/index.js -var require_lib2 = __commonJS({ - "node_modules/.pnpm/clean-git-ref@2.0.1/node_modules/clean-git-ref/lib/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - function escapeRegExp(string) { - return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); - } - function replaceAll(str, search, replacement) { - search = search instanceof RegExp ? search : new RegExp(escapeRegExp(search), "g"); - return str.replace(search, replacement); - } - var CleanGitRef = { - clean: function clean(value) { - if (typeof value !== "string") { - throw new Error("Expected a string, received: " + value); - } - value = replaceAll(value, "./", "/"); - value = replaceAll(value, "..", "."); - value = replaceAll(value, " ", "-"); - value = replaceAll(value, /^[~^:?*\\\-]/g, ""); - value = replaceAll(value, /[~^:?*\\]/g, "-"); - value = replaceAll(value, /[~^:?*\\\-]$/g, ""); - value = replaceAll(value, "@{", "-"); - value = replaceAll(value, /\.$/g, ""); - value = replaceAll(value, /\/$/g, ""); - value = replaceAll(value, /\.lock$/g, ""); - return value; - } - }; - module2.exports = CleanGitRef; - } -}); - -// node_modules/.pnpm/diff3@0.0.3/node_modules/diff3/onp.js -var require_onp = __commonJS({ - "node_modules/.pnpm/diff3@0.0.3/node_modules/diff3/onp.js"(exports2, module2) { - init_polyfill_buffer(); - module2.exports = function(a_, b_) { - var a = a_, b = b_, m = a.length, n = b.length, reverse = false, ed = null, offset = m + 1, path2 = [], pathposi = [], ses = [], lcs = "", SES_DELETE = -1, SES_COMMON = 0, SES_ADD = 1; - var tmp1, tmp2; - var init3 = function() { - if (m >= n) { - tmp1 = a; - tmp2 = m; - a = b; - b = tmp1; - m = n; - n = tmp2; - reverse = true; - offset = m + 1; - } - }; - var P = function(x, y, k) { - return { - "x": x, - "y": y, - "k": k - }; - }; - var seselem = function(elem, t) { - return { - "elem": elem, - "t": t - }; - }; - var snake = function(k, p, pp) { - var r, x, y; - if (p > pp) { - r = path2[k - 1 + offset]; - } else { - r = path2[k + 1 + offset]; - } - y = Math.max(p, pp); - x = y - k; - while (x < m && y < n && a[x] === b[y]) { - ++x; - ++y; - } - path2[k + offset] = pathposi.length; - pathposi[pathposi.length] = new P(x, y, r); - return y; - }; - var recordseq = function(epc) { - var x_idx, y_idx, px_idx, py_idx, i; - x_idx = y_idx = 1; - px_idx = py_idx = 0; - for (i = epc.length - 1; i >= 0; --i) { - while (px_idx < epc[i].x || py_idx < epc[i].y) { - if (epc[i].y - epc[i].x > py_idx - px_idx) { - if (reverse) { - ses[ses.length] = new seselem(b[py_idx], SES_DELETE); - } else { - ses[ses.length] = new seselem(b[py_idx], SES_ADD); - } - ++y_idx; - ++py_idx; - } else if (epc[i].y - epc[i].x < py_idx - px_idx) { - if (reverse) { - ses[ses.length] = new seselem(a[px_idx], SES_ADD); - } else { - ses[ses.length] = new seselem(a[px_idx], SES_DELETE); - } - ++x_idx; - ++px_idx; - } else { - ses[ses.length] = new seselem(a[px_idx], SES_COMMON); - lcs += a[px_idx]; - ++x_idx; - ++y_idx; - ++px_idx; - ++py_idx; - } - } - } - }; - init3(); - return { - SES_DELETE: -1, - SES_COMMON: 0, - SES_ADD: 1, - editdistance: function() { - return ed; - }, - getlcs: function() { - return lcs; - }, - getses: function() { - return ses; - }, - compose: function() { - var delta, size, fp, p, r, epc, i, k; - delta = n - m; - size = m + n + 3; - fp = {}; - for (i = 0; i < size; ++i) { - fp[i] = -1; - path2[i] = -1; - } - p = -1; - do { - ++p; - for (k = -p; k <= delta - 1; ++k) { - fp[k + offset] = snake(k, fp[k - 1 + offset] + 1, fp[k + 1 + offset]); - } - for (k = delta + p; k >= delta + 1; --k) { - fp[k + offset] = snake(k, fp[k - 1 + offset] + 1, fp[k + 1 + offset]); - } - fp[delta + offset] = snake(delta, fp[delta - 1 + offset] + 1, fp[delta + 1 + offset]); - } while (fp[delta + offset] !== n); - ed = delta + 2 * p; - r = path2[delta + offset]; - epc = []; - while (r !== -1) { - epc[epc.length] = new P(pathposi[r].x, pathposi[r].y, null); - r = pathposi[r].k; - } - recordseq(epc); - } - }; - }; - } -}); - -// node_modules/.pnpm/diff3@0.0.3/node_modules/diff3/diff3.js -var require_diff3 = __commonJS({ - "node_modules/.pnpm/diff3@0.0.3/node_modules/diff3/diff3.js"(exports2, module2) { - init_polyfill_buffer(); - var onp = require_onp(); - function longestCommonSubsequence(file1, file2) { - var diff2 = new onp(file1, file2); - diff2.compose(); - var ses = diff2.getses(); - var root2; - var prev; - var file1RevIdx = file1.length - 1, file2RevIdx = file2.length - 1; - for (var i = ses.length - 1; i >= 0; --i) { - if (ses[i].t === diff2.SES_COMMON) { - if (prev) { - prev.chain = { - file1index: file1RevIdx, - file2index: file2RevIdx, - chain: null - }; - prev = prev.chain; - } else { - root2 = { - file1index: file1RevIdx, - file2index: file2RevIdx, - chain: null - }; - prev = root2; - } - file1RevIdx--; - file2RevIdx--; - } else if (ses[i].t === diff2.SES_DELETE) { - file1RevIdx--; - } else if (ses[i].t === diff2.SES_ADD) { - file2RevIdx--; - } - } - var tail = { - file1index: -1, - file2index: -1, - chain: null - }; - if (!prev) { - return tail; - } - prev.chain = tail; - return root2; - } - function diffIndices(file1, file2) { - var result = []; - var tail1 = file1.length; - var tail2 = file2.length; - for (var candidate = longestCommonSubsequence(file1, file2); candidate !== null; candidate = candidate.chain) { - var mismatchLength1 = tail1 - candidate.file1index - 1; - var mismatchLength2 = tail2 - candidate.file2index - 1; - tail1 = candidate.file1index; - tail2 = candidate.file2index; - if (mismatchLength1 || mismatchLength2) { - result.push({ - file1: [tail1 + 1, mismatchLength1], - file2: [tail2 + 1, mismatchLength2] - }); - } - } - result.reverse(); - return result; - } - function diff3MergeIndices(a, o, b) { - var i; - var m1 = diffIndices(o, a); - var m2 = diffIndices(o, b); - var hunks = []; - function addHunk(h, side2) { - hunks.push([h.file1[0], side2, h.file1[1], h.file2[0], h.file2[1]]); - } - for (i = 0; i < m1.length; i++) { - addHunk(m1[i], 0); - } - for (i = 0; i < m2.length; i++) { - addHunk(m2[i], 2); - } - hunks.sort(function(x, y) { - return x[0] - y[0]; - }); - var result = []; - var commonOffset = 0; - function copyCommon(targetOffset) { - if (targetOffset > commonOffset) { - result.push([1, commonOffset, targetOffset - commonOffset]); - commonOffset = targetOffset; - } - } - for (var hunkIndex = 0; hunkIndex < hunks.length; hunkIndex++) { - var firstHunkIndex = hunkIndex; - var hunk = hunks[hunkIndex]; - var regionLhs = hunk[0]; - var regionRhs = regionLhs + hunk[2]; - while (hunkIndex < hunks.length - 1) { - var maybeOverlapping = hunks[hunkIndex + 1]; - var maybeLhs = maybeOverlapping[0]; - if (maybeLhs > regionRhs) - break; - regionRhs = Math.max(regionRhs, maybeLhs + maybeOverlapping[2]); - hunkIndex++; - } - copyCommon(regionLhs); - if (firstHunkIndex == hunkIndex) { - if (hunk[4] > 0) { - result.push([hunk[1], hunk[3], hunk[4]]); - } - } else { - var regions = { - 0: [a.length, -1, o.length, -1], - 2: [b.length, -1, o.length, -1] - }; - for (i = firstHunkIndex; i <= hunkIndex; i++) { - hunk = hunks[i]; - var side = hunk[1]; - var r = regions[side]; - var oLhs = hunk[0]; - var oRhs = oLhs + hunk[2]; - var abLhs = hunk[3]; - var abRhs = abLhs + hunk[4]; - r[0] = Math.min(abLhs, r[0]); - r[1] = Math.max(abRhs, r[1]); - r[2] = Math.min(oLhs, r[2]); - r[3] = Math.max(oRhs, r[3]); - } - var aLhs = regions[0][0] + (regionLhs - regions[0][2]); - var aRhs = regions[0][1] + (regionRhs - regions[0][3]); - var bLhs = regions[2][0] + (regionLhs - regions[2][2]); - var bRhs = regions[2][1] + (regionRhs - regions[2][3]); - result.push([ - -1, - aLhs, - aRhs - aLhs, - regionLhs, - regionRhs - regionLhs, - bLhs, - bRhs - bLhs - ]); - } - commonOffset = regionRhs; - } - copyCommon(o.length); - return result; - } - function diff3Merge2(a, o, b) { - var result = []; - var files = [a, o, b]; - var indices = diff3MergeIndices(a, o, b); - var okLines = []; - function flushOk() { - if (okLines.length) { - result.push({ - ok: okLines - }); - } - okLines = []; - } - function pushOk(xs) { - for (var j = 0; j < xs.length; j++) { - okLines.push(xs[j]); - } - } - function isTrueConflict(rec) { - if (rec[2] != rec[6]) - return true; - var aoff = rec[1]; - var boff = rec[5]; - for (var j = 0; j < rec[2]; j++) { - if (a[j + aoff] != b[j + boff]) - return true; - } - return false; - } - for (var i = 0; i < indices.length; i++) { - var x = indices[i]; - var side = x[0]; - if (side == -1) { - if (!isTrueConflict(x)) { - pushOk(files[0].slice(x[1], x[1] + x[2])); - } else { - flushOk(); - result.push({ - conflict: { - a: a.slice(x[1], x[1] + x[2]), - aIndex: x[1], - o: o.slice(x[3], x[3] + x[4]), - oIndex: x[3], - b: b.slice(x[5], x[5] + x[6]), - bIndex: x[5] - } - }); - } - } else { - pushOk(files[side].slice(x[1], x[1] + x[2])); - } - } - flushOk(); - return result; - } - module2.exports = diff3Merge2; - } -}); - -// node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js -var require_ms = __commonJS({ - "node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports2, module2) { - init_polyfill_buffer(); - var s = 1e3; - var m = s * 60; - var h = m * 60; - var d = h * 24; - var w = d * 7; - var y = d * 365.25; - module2.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === "string" && val.length > 0) { - return parse2(val); - } else if (type === "number" && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) - ); - }; - function parse2(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || "ms").toLowerCase(); - switch (type) { - case "years": - case "year": - case "yrs": - case "yr": - case "y": - return n * y; - case "weeks": - case "week": - case "w": - return n * w; - case "days": - case "day": - case "d": - return n * d; - case "hours": - case "hour": - case "hrs": - case "hr": - case "h": - return n * h; - case "minutes": - case "minute": - case "mins": - case "min": - case "m": - return n * m; - case "seconds": - case "second": - case "secs": - case "sec": - case "s": - return n * s; - case "milliseconds": - case "millisecond": - case "msecs": - case "msec": - case "ms": - return n; - default: - return void 0; - } - } - function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + "d"; - } - if (msAbs >= h) { - return Math.round(ms / h) + "h"; - } - if (msAbs >= m) { - return Math.round(ms / m) + "m"; - } - if (msAbs >= s) { - return Math.round(ms / s) + "s"; - } - return ms + "ms"; - } - function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, "day"); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, "hour"); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, "minute"); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, "second"); - } - return ms + " ms"; - } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); - } - } -}); - -// node_modules/.pnpm/debug@4.3.4_supports-color@9.4.0/node_modules/debug/src/common.js -var require_common2 = __commonJS({ - "node_modules/.pnpm/debug@4.3.4_supports-color@9.4.0/node_modules/debug/src/common.js"(exports2, module2) { - init_polyfill_buffer(); - function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require_ms(); - createDebug.destroy = destroy; - Object.keys(env).forEach((key2) => { - createDebug[key2] = env[key2]; - }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash2 = 0; - for (let i = 0; i < namespace.length; i++) { - hash2 = (hash2 << 5) - hash2 + namespace.charCodeAt(i); - hash2 |= 0; - } - return createDebug.colors[Math.abs(hash2) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug3(...args) { - if (!debug3.enabled) { - return; - } - const self2 = debug3; - const curr = Number(/* @__PURE__ */ new Date()); - const ms = curr - (prevTime || curr); - self2.diff = ms; - self2.prev = prevTime; - self2.curr = curr; - prevTime = curr; - args[0] = createDebug.coerce(args[0]); - if (typeof args[0] !== "string") { - args.unshift("%O"); - } - let index2 = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index2++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val = args[index2]; - match = formatter.call(self2, val); - args.splice(index2, 1); - index2--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug3.namespace = namespace; - debug3.useColors = createDebug.useColors(); - debug3.color = createDebug.selectColor(namespace); - debug3.extend = extend; - debug3.destroy = createDebug.destroy; - Object.defineProperty(debug3, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - return enabledCache; - }, - set: (v) => { - enableOverride = v; - } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug3); - } - return debug3; - } - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - createDebug.names = []; - createDebug.skips = []; - let i; - const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); - const len = split.length; - for (i = 0; i < len; i++) { - if (!split[i]) { - continue; - } - namespaces = split[i].replace(/\*/g, ".*?"); - if (namespaces[0] === "-") { - createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); - } else { - createDebug.names.push(new RegExp("^" + namespaces + "$")); - } - } - } - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace) - ].join(","); - createDebug.enable(""); - return namespaces; - } - function enabled(name) { - if (name[name.length - 1] === "*") { - return true; - } - let i; - let len; - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - return false; - } - function toNamespace(regexp) { - return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*"); - } - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - function destroy() { - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - createDebug.enable(createDebug.load()); - return createDebug; - } - module2.exports = setup; - } -}); - -// node_modules/.pnpm/debug@4.3.4_supports-color@9.4.0/node_modules/debug/src/browser.js -var require_browser = __commonJS({ - "node_modules/.pnpm/debug@4.3.4_supports-color@9.4.0/node_modules/debug/src/browser.js"(exports2, module2) { - init_polyfill_buffer(); - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load; - exports2.useColors = useColors; - exports2.storage = localstorage(); - exports2.destroy = (() => { - let warned = false; - return () => { - if (!warned) { - warned = true; - console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - } - }; - })(); - exports2.colors = [ - "#0000CC", - "#0000FF", - "#0033CC", - "#0033FF", - "#0066CC", - "#0066FF", - "#0099CC", - "#0099FF", - "#00CC00", - "#00CC33", - "#00CC66", - "#00CC99", - "#00CCCC", - "#00CCFF", - "#3300CC", - "#3300FF", - "#3333CC", - "#3333FF", - "#3366CC", - "#3366FF", - "#3399CC", - "#3399FF", - "#33CC00", - "#33CC33", - "#33CC66", - "#33CC99", - "#33CCCC", - "#33CCFF", - "#6600CC", - "#6600FF", - "#6633CC", - "#6633FF", - "#66CC00", - "#66CC33", - "#9900CC", - "#9900FF", - "#9933CC", - "#9933FF", - "#99CC00", - "#99CC33", - "#CC0000", - "#CC0033", - "#CC0066", - "#CC0099", - "#CC00CC", - "#CC00FF", - "#CC3300", - "#CC3333", - "#CC3366", - "#CC3399", - "#CC33CC", - "#CC33FF", - "#CC6600", - "#CC6633", - "#CC9900", - "#CC9933", - "#CCCC00", - "#CCCC33", - "#FF0000", - "#FF0033", - "#FF0066", - "#FF0099", - "#FF00CC", - "#FF00FF", - "#FF3300", - "#FF3333", - "#FF3366", - "#FF3399", - "#FF33CC", - "#FF33FF", - "#FF6600", - "#FF6633", - "#FF9900", - "#FF9933", - "#FFCC00", - "#FFCC33" - ]; - function useColors() { - if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) { - return true; - } - if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 - typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker - typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); - } - function formatArgs(args) { - args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff); - if (!this.useColors) { - return; - } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index2 = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index2++; - if (match === "%c") { - lastC = index2; - } - }); - args.splice(lastC, 0, c); - } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error) { - } - } - function load() { - let r; - try { - r = exports2.storage.getItem("debug"); - } catch (error) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error) { - } - } - module2.exports = require_common2()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error) { - return "[UnexpectedJSONParseError]: " + error.message; - } - }; - } -}); - -// node_modules/.pnpm/@kwsites+file-exists@1.1.1_supports-color@9.4.0/node_modules/@kwsites/file-exists/dist/src/index.js -var require_src = __commonJS({ - "node_modules/.pnpm/@kwsites+file-exists@1.1.1_supports-color@9.4.0/node_modules/@kwsites/file-exists/dist/src/index.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - var __importDefault = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - var fs_1 = require("fs"); - var debug_1 = __importDefault(require_browser()); - var log2 = debug_1.default("@kwsites/file-exists"); - function check(path2, isFile, isDirectory) { - log2(`checking %s`, path2); - try { - const stat = fs_1.statSync(path2); - if (stat.isFile() && isFile) { - log2(`[OK] path represents a file`); - return true; - } - if (stat.isDirectory() && isDirectory) { - log2(`[OK] path represents a directory`); - return true; - } - log2(`[FAIL] path represents something other than a file or directory`); - return false; - } catch (e) { - if (e.code === "ENOENT") { - log2(`[FAIL] path is not accessible: %o`, e); - return false; - } - log2(`[FATAL] %o`, e); - throw e; - } - } - function exists2(path2, type = exports2.READABLE) { - return check(path2, (type & exports2.FILE) > 0, (type & exports2.FOLDER) > 0); - } - exports2.exists = exists2; - exports2.FILE = 1; - exports2.FOLDER = 2; - exports2.READABLE = exports2.FILE + exports2.FOLDER; - } -}); - -// node_modules/.pnpm/@kwsites+file-exists@1.1.1_supports-color@9.4.0/node_modules/@kwsites/file-exists/dist/index.js -var require_dist = __commonJS({ - "node_modules/.pnpm/@kwsites+file-exists@1.1.1_supports-color@9.4.0/node_modules/@kwsites/file-exists/dist/index.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - function __export3(m) { - for (var p in m) - if (!exports2.hasOwnProperty(p)) - exports2[p] = m[p]; - } - Object.defineProperty(exports2, "__esModule", { value: true }); - __export3(require_src()); - } -}); - -// node_modules/.pnpm/@kwsites+promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/.pnpm/@kwsites+promise-deferred@1.1.1/node_modules/@kwsites/promise-deferred/dist/index.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createDeferred = exports2.deferred = void 0; - function deferred2() { - let done; - let fail; - let status2 = "pending"; - const promise2 = new Promise((_done, _fail) => { - done = _done; - fail = _fail; - }); - return { - promise: promise2, - done(result) { - if (status2 === "pending") { - status2 = "resolved"; - done(result); - } - }, - fail(error) { - if (status2 === "pending") { - status2 = "rejected"; - fail(error); - } - }, - get fulfilled() { - return status2 !== "pending"; - }, - get status() { - return status2; - } - }; - } - exports2.deferred = deferred2; - exports2.createDeferred = deferred2; - exports2.default = deferred2; - } -}); - -// node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js -var require_color_name = __commonJS({ - "node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - module2.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] - }; - } -}); - -// node_modules/.pnpm/css-unit-converter@1.1.2/node_modules/css-unit-converter/index.js -var require_css_unit_converter = __commonJS({ - "node_modules/.pnpm/css-unit-converter@1.1.2/node_modules/css-unit-converter/index.js"(exports2, module2) { - init_polyfill_buffer(); - var conversions = { - // length - "px": { - "px": 1, - "cm": 96 / 2.54, - "mm": 96 / 25.4, - "in": 96, - "pt": 96 / 72, - "pc": 16 - }, - "cm": { - "px": 2.54 / 96, - "cm": 1, - "mm": 0.1, - "in": 2.54, - "pt": 2.54 / 72, - "pc": 2.54 / 6 - }, - "mm": { - "px": 25.4 / 96, - "cm": 10, - "mm": 1, - "in": 25.4, - "pt": 25.4 / 72, - "pc": 25.4 / 6 - }, - "in": { - "px": 1 / 96, - "cm": 1 / 2.54, - "mm": 1 / 25.4, - "in": 1, - "pt": 1 / 72, - "pc": 1 / 6 - }, - "pt": { - "px": 0.75, - "cm": 72 / 2.54, - "mm": 72 / 25.4, - "in": 72, - "pt": 1, - "pc": 12 - }, - "pc": { - "px": 6 / 96, - "cm": 6 / 2.54, - "mm": 6 / 25.4, - "in": 6, - "pt": 6 / 72, - "pc": 1 - }, - // angle - "deg": { - "deg": 1, - "grad": 0.9, - "rad": 180 / Math.PI, - "turn": 360 - }, - "grad": { - "deg": 400 / 360, - "grad": 1, - "rad": 200 / Math.PI, - "turn": 400 - }, - "rad": { - "deg": Math.PI / 180, - "grad": Math.PI / 200, - "rad": 1, - "turn": Math.PI * 2 - }, - "turn": { - "deg": 1 / 360, - "grad": 1 / 400, - "rad": 0.5 / Math.PI, - "turn": 1 - }, - // time - "s": { - "s": 1, - "ms": 1 / 1e3 - }, - "ms": { - "s": 1e3, - "ms": 1 - }, - // frequency - "Hz": { - "Hz": 1, - "kHz": 1e3 - }, - "kHz": { - "Hz": 1 / 1e3, - "kHz": 1 - }, - // resolution - "dpi": { - "dpi": 1, - "dpcm": 1 / 2.54, - "dppx": 1 / 96 - }, - "dpcm": { - "dpi": 2.54, - "dpcm": 1, - "dppx": 2.54 / 96 - }, - "dppx": { - "dpi": 96, - "dpcm": 96 / 2.54, - "dppx": 1 - } - }; - module2.exports = function(value, sourceUnit, targetUnit, precision) { - if (!conversions.hasOwnProperty(targetUnit)) - throw new Error("Cannot convert to " + targetUnit); - if (!conversions[targetUnit].hasOwnProperty(sourceUnit)) - throw new Error("Cannot convert from " + sourceUnit + " to " + targetUnit); - var converted = conversions[targetUnit][sourceUnit] * value; - if (precision !== false) { - precision = Math.pow(10, parseInt(precision) || 5); - return Math.round(converted * precision) / precision; - } - return converted; - }; - } -}); - -// node_modules/.pnpm/css-color-converter@2.0.0/node_modules/css-color-converter/lib/index.js -var require_lib3 = __commonJS({ - "node_modules/.pnpm/css-color-converter@2.0.0/node_modules/css-color-converter/lib/index.js"(exports2) { - "use strict"; - init_polyfill_buffer(); - Object.defineProperty(exports2, "__esModule", { - value: true - }); - exports2.fromRgba = fromRgba; - exports2.fromRgb = fromRgb; - exports2.fromHsla = fromHsla; - exports2.fromHsl = fromHsl; - exports2.fromString = fromString2; - exports2["default"] = void 0; - var _colorName = _interopRequireDefault(require_color_name()); - var _cssUnitConverter = _interopRequireDefault(require_css_unit_converter()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _classCallCheck(instance10, Constructor) { - if (!(instance10 instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - function _defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) - _defineProperties(Constructor.prototype, protoProps); - if (staticProps) - _defineProperties(Constructor, staticProps); - return Constructor; - } - function _slicedToArray(arr, i) { - return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray2(arr, i) || _nonIterableRest(); - } - function _nonIterableRest() { - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _unsupportedIterableToArray2(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray2(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray2(o, minLen); - } - function _arrayLikeToArray2(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - function _iterableToArrayLimit(arr, i) { - if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) - return; - var _arr = []; - var _n = true; - var _d = false; - var _e = void 0; - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - if (i && _arr.length === i) - break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"] != null) - _i["return"](); - } finally { - if (_d) - throw _e; - } - } - return _arr; - } - function _arrayWithHoles(arr) { - if (Array.isArray(arr)) - return arr; - } - var hex = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?$/; - var shortHex = /^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?$/; - var rgb = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/; - var rgbfn = /^rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/; - var rgbperc = /^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/; - var rgbpercfn = /^rgba?\(\s*(\d+%)\s+(\d+%)\s+(\d+%)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/; - var hsl = /^hsla?\(\s*(\d+)(deg|rad|grad|turn)?\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/; - function contains2(haystack, needle) { - return haystack.indexOf(needle) > -1; - } - function rgbToHsl(r, g, b) { - var rprim = r / 255; - var gprim = g / 255; - var bprim = b / 255; - var cmax = Math.max(rprim, gprim, bprim); - var cmin = Math.min(rprim, gprim, bprim); - var delta = cmax - cmin; - var l = (cmax + cmin) / 2; - if (delta === 0) { - return [0, 0, l * 100]; - } - var s = delta / (1 - Math.abs(2 * l - 1)); - var h = function() { - switch (cmax) { - case rprim: { - return (gprim - bprim) / delta % 6; - } - case gprim: { - return (bprim - rprim) / delta + 2; - } - default: { - return (rprim - gprim) / delta + 4; - } - } - }(); - return [h * 60, s * 100, l * 100]; - } - function hslToRgb(h, s, l) { - var hprim = h / 60; - var sprim = s / 100; - var lprim = l / 100; - var c = (1 - Math.abs(2 * lprim - 1)) * sprim; - var x = c * (1 - Math.abs(hprim % 2 - 1)); - var m = lprim - c / 2; - var _ref = function() { - if (hprim < 1) - return [c, x, 0]; - if (hprim < 2) - return [x, c, 0]; - if (hprim < 3) - return [0, c, x]; - if (hprim < 4) - return [0, x, c]; - if (hprim < 5) - return [x, 0, c]; - return [c, 0, x]; - }(), _ref2 = _slicedToArray(_ref, 3), rprim = _ref2[0], gprim = _ref2[1], bprim = _ref2[2]; - return [(rprim + m) * 255, (gprim + m) * 255, (bprim + m) * 255]; - } - var Color = /* @__PURE__ */ function() { - function Color2(_ref3) { - var _ref4 = _slicedToArray(_ref3, 4), r = _ref4[0], g = _ref4[1], b = _ref4[2], a = _ref4[3]; - _classCallCheck(this, Color2); - this.values = [Math.max(Math.min(parseInt(r, 10), 255), 0), Math.max(Math.min(parseInt(g, 10), 255), 0), Math.max(Math.min(parseInt(b, 10), 255), 0), a == null ? 1 : Math.max(Math.min(parseFloat(a), 255), 0)]; - } - _createClass(Color2, [{ - key: "toRgbString", - value: function toRgbString() { - var _this$values = _slicedToArray(this.values, 4), r = _this$values[0], g = _this$values[1], b = _this$values[2], a = _this$values[3]; - if (a === 1) { - return "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")"); - } - return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(a, ")"); - } - }, { - key: "toHslString", - value: function toHslString() { - var _this$toHslaArray = this.toHslaArray(), _this$toHslaArray2 = _slicedToArray(_this$toHslaArray, 4), h = _this$toHslaArray2[0], s = _this$toHslaArray2[1], l = _this$toHslaArray2[2], a = _this$toHslaArray2[3]; - if (a === 1) { - return "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)"); - } - return "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(a, ")"); - } - }, { - key: "toHexString", - value: function toHexString() { - var _this$values2 = _slicedToArray(this.values, 4), r = _this$values2[0], g = _this$values2[1], b = _this$values2[2], a = _this$values2[3]; - r = Number(r).toString(16).padStart(2, "0"); - g = Number(g).toString(16).padStart(2, "0"); - b = Number(b).toString(16).padStart(2, "0"); - a = a < 1 ? parseInt(a * 255, 10).toString(16).padStart(2, "0") : ""; - return "#".concat(r).concat(g).concat(b).concat(a); - } - }, { - key: "toRgbaArray", - value: function toRgbaArray() { - return this.values; - } - }, { - key: "toHslaArray", - value: function toHslaArray() { - var _this$values3 = _slicedToArray(this.values, 4), r = _this$values3[0], g = _this$values3[1], b = _this$values3[2], a = _this$values3[3]; - var _rgbToHsl = rgbToHsl(r, g, b), _rgbToHsl2 = _slicedToArray(_rgbToHsl, 3), h = _rgbToHsl2[0], s = _rgbToHsl2[1], l = _rgbToHsl2[2]; - return [h, s, l, a]; - } - }]); - return Color2; - }(); - function fromRgba(_ref5) { - var _ref6 = _slicedToArray(_ref5, 4), r = _ref6[0], g = _ref6[1], b = _ref6[2], a = _ref6[3]; - return new Color([r, g, b, a]); - } - function fromRgb(_ref7) { - var _ref8 = _slicedToArray(_ref7, 3), r = _ref8[0], g = _ref8[1], b = _ref8[2]; - return fromRgba([r, g, b, 1]); - } - function fromHsla(_ref9) { - var _ref10 = _slicedToArray(_ref9, 4), h = _ref10[0], s = _ref10[1], l = _ref10[2], a = _ref10[3]; - var _hslToRgb = hslToRgb(h, s, l), _hslToRgb2 = _slicedToArray(_hslToRgb, 3), r = _hslToRgb2[0], g = _hslToRgb2[1], b = _hslToRgb2[2]; - return fromRgba([r, g, b, a]); - } - function fromHsl(_ref11) { - var _ref12 = _slicedToArray(_ref11, 3), h = _ref12[0], s = _ref12[1], l = _ref12[2]; - return fromHsla([h, s, l, 1]); - } - function fromHexString(str) { - var _ref13 = hex.exec(str) || shortHex.exec(str), _ref14 = _slicedToArray(_ref13, 5), r = _ref14[1], g = _ref14[2], b = _ref14[3], a = _ref14[4]; - r = parseInt(r.length < 2 ? r.repeat(2) : r, 16); - g = parseInt(g.length < 2 ? g.repeat(2) : g, 16); - b = parseInt(b.length < 2 ? b.repeat(2) : b, 16); - a = a && (parseInt(a.length < 2 ? a.repeat(2) : a, 16) / 255).toPrecision(1) || 1; - return fromRgba([r, g, b, a]); - } - function fromRgbString(str) { - var _ref15 = rgb.exec(str) || rgbperc.exec(str) || rgbfn.exec(str) || rgbpercfn.exec(str), _ref16 = _slicedToArray(_ref15, 5), r = _ref16[1], g = _ref16[2], b = _ref16[3], a = _ref16[4]; - r = contains2(r, "%") ? parseInt(r, 10) * 255 / 100 : parseInt(r, 10); - g = contains2(g, "%") ? parseInt(g, 10) * 255 / 100 : parseInt(g, 10); - b = contains2(b, "%") > 0 ? parseInt(b, 10) * 255 / 100 : parseInt(b, 10); - a = a === void 0 ? 1 : parseFloat(a) / (contains2(a, "%") ? 100 : 1); - return fromRgba([r, g, b, a]); - } - function fromHslString(str) { - var _hsl$exec = hsl.exec(str), _hsl$exec2 = _slicedToArray(_hsl$exec, 6), h = _hsl$exec2[1], unit = _hsl$exec2[2], s = _hsl$exec2[3], l = _hsl$exec2[4], a = _hsl$exec2[5]; - unit = unit || "deg"; - h = (0, _cssUnitConverter["default"])(parseFloat(h), unit, "deg"); - s = parseFloat(s); - l = parseFloat(l); - a = a === void 0 ? 1 : parseFloat(a) / (contains2(a, "%") ? 100 : 1); - return fromHsla([h, s, l, a]); - } - function fromString2(str) { - if (_colorName["default"][str]) { - return fromRgb(_colorName["default"][str]); - } - if (hex.test(str) || shortHex.test(str)) { - return fromHexString(str); - } - if (rgb.test(str) || rgbperc.test(str) || rgbfn.test(str) || rgbpercfn.test(str)) { - return fromRgbString(str); - } - if (hsl.test(str)) { - return fromHslString(str); - } - return null; - } - var _default = { - fromString: fromString2, - fromRgb, - fromRgba, - fromHsl, - fromHsla - }; - exports2["default"] = _default; - } -}); - -// node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js -var require_isArguments = __commonJS({ - "node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var toStr = Object.prototype.toString; - module2.exports = function isArguments(value) { - var str = toStr.call(value); - var isArgs = str === "[object Arguments]"; - if (!isArgs) { - isArgs = str !== "[object Array]" && value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && toStr.call(value.callee) === "[object Function]"; - } - return isArgs; - }; - } -}); - -// node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js -var require_implementation = __commonJS({ - "node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var keysShim; - if (!Object.keys) { - has = Object.prototype.hasOwnProperty; - toStr = Object.prototype.toString; - isArgs = require_isArguments(); - isEnumerable = Object.prototype.propertyIsEnumerable; - hasDontEnumBug = !isEnumerable.call({ toString: null }, "toString"); - hasProtoEnumBug = isEnumerable.call(function() { - }, "prototype"); - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ]; - equalsConstructorPrototype = function(o) { - var ctor = o.constructor; - return ctor && ctor.prototype === o; - }; - excludedKeys = { - $applicationCache: true, - $console: true, - $external: true, - $frame: true, - $frameElement: true, - $frames: true, - $innerHeight: true, - $innerWidth: true, - $onmozfullscreenchange: true, - $onmozfullscreenerror: true, - $outerHeight: true, - $outerWidth: true, - $pageXOffset: true, - $pageYOffset: true, - $parent: true, - $scrollLeft: true, - $scrollTop: true, - $scrollX: true, - $scrollY: true, - $self: true, - $webkitIndexedDB: true, - $webkitStorageInfo: true, - $window: true - }; - hasAutomationEqualityBug = function() { - if (typeof window === "undefined") { - return false; - } - for (var k in window) { - try { - if (!excludedKeys["$" + k] && has.call(window, k) && window[k] !== null && typeof window[k] === "object") { - try { - equalsConstructorPrototype(window[k]); - } catch (e) { - return true; - } - } - } catch (e) { - return true; - } - } - return false; - }(); - equalsConstructorPrototypeIfNotBuggy = function(o) { - if (typeof window === "undefined" || !hasAutomationEqualityBug) { - return equalsConstructorPrototype(o); - } - try { - return equalsConstructorPrototype(o); - } catch (e) { - return false; - } - }; - keysShim = function keys(object) { - var isObject2 = object !== null && typeof object === "object"; - var isFunction2 = toStr.call(object) === "[object Function]"; - var isArguments = isArgs(object); - var isString = isObject2 && toStr.call(object) === "[object String]"; - var theKeys = []; - if (!isObject2 && !isFunction2 && !isArguments) { - throw new TypeError("Object.keys called on a non-object"); - } - var skipProto = hasProtoEnumBug && isFunction2; - if (isString && object.length > 0 && !has.call(object, 0)) { - for (var i = 0; i < object.length; ++i) { - theKeys.push(String(i)); - } - } - if (isArguments && object.length > 0) { - for (var j = 0; j < object.length; ++j) { - theKeys.push(String(j)); - } - } else { - for (var name in object) { - if (!(skipProto && name === "prototype") && has.call(object, name)) { - theKeys.push(String(name)); - } - } - } - if (hasDontEnumBug) { - var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); - for (var k = 0; k < dontEnums.length; ++k) { - if (!(skipConstructor && dontEnums[k] === "constructor") && has.call(object, dontEnums[k])) { - theKeys.push(dontEnums[k]); - } - } - } - return theKeys; - }; - } - var has; - var toStr; - var isArgs; - var isEnumerable; - var hasDontEnumBug; - var hasProtoEnumBug; - var dontEnums; - var equalsConstructorPrototype; - var excludedKeys; - var hasAutomationEqualityBug; - var equalsConstructorPrototypeIfNotBuggy; - module2.exports = keysShim; - } -}); - -// node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js -var require_object_keys = __commonJS({ - "node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var slice = Array.prototype.slice; - var isArgs = require_isArguments(); - var origKeys = Object.keys; - var keysShim = origKeys ? function keys(o) { - return origKeys(o); - } : require_implementation(); - var originalKeys = Object.keys; - keysShim.shim = function shimObjectKeys() { - if (Object.keys) { - var keysWorksWithArguments = function() { - var args = Object.keys(arguments); - return args && args.length === arguments.length; - }(1, 2); - if (!keysWorksWithArguments) { - Object.keys = function keys(object) { - if (isArgs(object)) { - return originalKeys(slice.call(object)); - } - return originalKeys(object); - }; - } - } else { - Object.keys = keysShim; - } - return Object.keys || keysShim; - }; - module2.exports = keysShim; - } -}); - -// node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js -var require_shams = __commonJS({ - "node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - module2.exports = function hasSymbols() { - if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { - return false; - } - if (typeof Symbol.iterator === "symbol") { - return true; - } - var obj = {}; - var sym = Symbol("test"); - var symObj = Object(sym); - if (typeof sym === "string") { - return false; - } - if (Object.prototype.toString.call(sym) !== "[object Symbol]") { - return false; - } - if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { - return false; - } - var symVal = 42; - obj[sym] = symVal; - for (sym in obj) { - return false; - } - if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { - return false; - } - if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { - return false; - } - var syms = Object.getOwnPropertySymbols(obj); - if (syms.length !== 1 || syms[0] !== sym) { - return false; - } - if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { - return false; - } - if (typeof Object.getOwnPropertyDescriptor === "function") { - var descriptor = Object.getOwnPropertyDescriptor(obj, sym); - if (descriptor.value !== symVal || descriptor.enumerable !== true) { - return false; - } - } - return true; - }; - } -}); - -// node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js -var require_has_symbols = __commonJS({ - "node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var origSymbol = typeof Symbol !== "undefined" && Symbol; - var hasSymbolSham = require_shams(); - module2.exports = function hasNativeSymbols() { - if (typeof origSymbol !== "function") { - return false; - } - if (typeof Symbol !== "function") { - return false; - } - if (typeof origSymbol("foo") !== "symbol") { - return false; - } - if (typeof Symbol("bar") !== "symbol") { - return false; - } - return hasSymbolSham(); - }; - } -}); - -// node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js -var require_has_proto = __commonJS({ - "node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var test = { - foo: {} - }; - var $Object = Object; - module2.exports = function hasProto() { - return { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object); - }; - } -}); - -// node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js -var require_implementation2 = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; - var slice = Array.prototype.slice; - var toStr = Object.prototype.toString; - var funcType = "[object Function]"; - module2.exports = function bind(that) { - var target = this; - if (typeof target !== "function" || toStr.call(target) !== funcType) { - throw new TypeError(ERROR_MESSAGE + target); - } - var args = slice.call(arguments, 1); - var bound; - var binder = function() { - if (this instanceof bound) { - var result = target.apply( - this, - args.concat(slice.call(arguments)) - ); - if (Object(result) === result) { - return result; - } - return this; - } else { - return target.apply( - that, - args.concat(slice.call(arguments)) - ); - } - }; - var boundLength = Math.max(0, target.length - args.length); - var boundArgs = []; - for (var i = 0; i < boundLength; i++) { - boundArgs.push("$" + i); - } - bound = Function("binder", "return function (" + boundArgs.join(",") + "){ return binder.apply(this,arguments); }")(binder); - if (target.prototype) { - var Empty = function Empty2() { - }; - Empty.prototype = target.prototype; - bound.prototype = new Empty(); - Empty.prototype = null; - } - return bound; - }; - } -}); - -// node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js -var require_function_bind = __commonJS({ - "node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var implementation = require_implementation2(); - module2.exports = Function.prototype.bind || implementation; - } -}); - -// node_modules/.pnpm/has@1.0.3/node_modules/has/src/index.js -var require_src2 = __commonJS({ - "node_modules/.pnpm/has@1.0.3/node_modules/has/src/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var bind = require_function_bind(); - module2.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); - } -}); - -// node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js -var require_get_intrinsic = __commonJS({ - "node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var undefined2; - var $SyntaxError = SyntaxError; - var $Function = Function; - var $TypeError = TypeError; - var getEvalledConstructor = function(expressionSyntax) { - try { - return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); - } catch (e) { - } - }; - var $gOPD = Object.getOwnPropertyDescriptor; - if ($gOPD) { - try { - $gOPD({}, ""); - } catch (e) { - $gOPD = null; - } - } - var throwTypeError = function() { - throw new $TypeError(); - }; - var ThrowTypeError = $gOPD ? function() { - try { - arguments.callee; - return throwTypeError; - } catch (calleeThrows) { - try { - return $gOPD(arguments, "callee").get; - } catch (gOPDthrows) { - return throwTypeError; - } - } - }() : throwTypeError; - var hasSymbols = require_has_symbols()(); - var hasProto = require_has_proto()(); - var getProto = Object.getPrototypeOf || (hasProto ? function(x) { - return x.__proto__; - } : null); - var needsEval = {}; - var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); - var INTRINSICS = { - "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, - "%Array%": Array, - "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, - "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, - "%AsyncFromSyncIteratorPrototype%": undefined2, - "%AsyncFunction%": needsEval, - "%AsyncGenerator%": needsEval, - "%AsyncGeneratorFunction%": needsEval, - "%AsyncIteratorPrototype%": needsEval, - "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, - "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, - "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, - "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, - "%Boolean%": Boolean, - "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, - "%Date%": Date, - "%decodeURI%": decodeURI, - "%decodeURIComponent%": decodeURIComponent, - "%encodeURI%": encodeURI, - "%encodeURIComponent%": encodeURIComponent, - "%Error%": Error, - "%eval%": eval, - // eslint-disable-line no-eval - "%EvalError%": EvalError, - "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, - "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, - "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, - "%Function%": $Function, - "%GeneratorFunction%": needsEval, - "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, - "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, - "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, - "%isFinite%": isFinite, - "%isNaN%": isNaN, - "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, - "%JSON%": typeof JSON === "object" ? JSON : undefined2, - "%Map%": typeof Map === "undefined" ? undefined2 : Map, - "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), - "%Math%": Math, - "%Number%": Number, - "%Object%": Object, - "%parseFloat%": parseFloat, - "%parseInt%": parseInt, - "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, - "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, - "%RangeError%": RangeError, - "%ReferenceError%": ReferenceError, - "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, - "%RegExp%": RegExp, - "%Set%": typeof Set === "undefined" ? undefined2 : Set, - "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), - "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, - "%String%": String, - "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, - "%Symbol%": hasSymbols ? Symbol : undefined2, - "%SyntaxError%": $SyntaxError, - "%ThrowTypeError%": ThrowTypeError, - "%TypedArray%": TypedArray, - "%TypeError%": $TypeError, - "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, - "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, - "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, - "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, - "%URIError%": URIError, - "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, - "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, - "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet - }; - if (getProto) { - try { - null.error; - } catch (e) { - errorProto = getProto(getProto(e)); - INTRINSICS["%Error.prototype%"] = errorProto; - } - } - var errorProto; - var doEval = function doEval2(name) { - var value; - if (name === "%AsyncFunction%") { - value = getEvalledConstructor("async function () {}"); - } else if (name === "%GeneratorFunction%") { - value = getEvalledConstructor("function* () {}"); - } else if (name === "%AsyncGeneratorFunction%") { - value = getEvalledConstructor("async function* () {}"); - } else if (name === "%AsyncGenerator%") { - var fn = doEval2("%AsyncGeneratorFunction%"); - if (fn) { - value = fn.prototype; - } - } else if (name === "%AsyncIteratorPrototype%") { - var gen = doEval2("%AsyncGenerator%"); - if (gen && getProto) { - value = getProto(gen.prototype); - } - } - INTRINSICS[name] = value; - return value; - }; - var LEGACY_ALIASES = { - "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], - "%ArrayPrototype%": ["Array", "prototype"], - "%ArrayProto_entries%": ["Array", "prototype", "entries"], - "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], - "%ArrayProto_keys%": ["Array", "prototype", "keys"], - "%ArrayProto_values%": ["Array", "prototype", "values"], - "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], - "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], - "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], - "%BooleanPrototype%": ["Boolean", "prototype"], - "%DataViewPrototype%": ["DataView", "prototype"], - "%DatePrototype%": ["Date", "prototype"], - "%ErrorPrototype%": ["Error", "prototype"], - "%EvalErrorPrototype%": ["EvalError", "prototype"], - "%Float32ArrayPrototype%": ["Float32Array", "prototype"], - "%Float64ArrayPrototype%": ["Float64Array", "prototype"], - "%FunctionPrototype%": ["Function", "prototype"], - "%Generator%": ["GeneratorFunction", "prototype"], - "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], - "%Int8ArrayPrototype%": ["Int8Array", "prototype"], - "%Int16ArrayPrototype%": ["Int16Array", "prototype"], - "%Int32ArrayPrototype%": ["Int32Array", "prototype"], - "%JSONParse%": ["JSON", "parse"], - "%JSONStringify%": ["JSON", "stringify"], - "%MapPrototype%": ["Map", "prototype"], - "%NumberPrototype%": ["Number", "prototype"], - "%ObjectPrototype%": ["Object", "prototype"], - "%ObjProto_toString%": ["Object", "prototype", "toString"], - "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], - "%PromisePrototype%": ["Promise", "prototype"], - "%PromiseProto_then%": ["Promise", "prototype", "then"], - "%Promise_all%": ["Promise", "all"], - "%Promise_reject%": ["Promise", "reject"], - "%Promise_resolve%": ["Promise", "resolve"], - "%RangeErrorPrototype%": ["RangeError", "prototype"], - "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], - "%RegExpPrototype%": ["RegExp", "prototype"], - "%SetPrototype%": ["Set", "prototype"], - "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], - "%StringPrototype%": ["String", "prototype"], - "%SymbolPrototype%": ["Symbol", "prototype"], - "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], - "%TypedArrayPrototype%": ["TypedArray", "prototype"], - "%TypeErrorPrototype%": ["TypeError", "prototype"], - "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], - "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], - "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], - "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], - "%URIErrorPrototype%": ["URIError", "prototype"], - "%WeakMapPrototype%": ["WeakMap", "prototype"], - "%WeakSetPrototype%": ["WeakSet", "prototype"] - }; - var bind = require_function_bind(); - var hasOwn = require_src2(); - var $concat = bind.call(Function.call, Array.prototype.concat); - var $spliceApply = bind.call(Function.apply, Array.prototype.splice); - var $replace = bind.call(Function.call, String.prototype.replace); - var $strSlice = bind.call(Function.call, String.prototype.slice); - var $exec = bind.call(Function.call, RegExp.prototype.exec); - var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; - var reEscapeChar = /\\(\\)?/g; - var stringToPath = function stringToPath2(string) { - var first2 = $strSlice(string, 0, 1); - var last2 = $strSlice(string, -1); - if (first2 === "%" && last2 !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); - } else if (last2 === "%" && first2 !== "%") { - throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); - } - var result = []; - $replace(string, rePropName, function(match, number, quote, subString) { - result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; - }); - return result; - }; - var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { - var intrinsicName = name; - var alias; - if (hasOwn(LEGACY_ALIASES, intrinsicName)) { - alias = LEGACY_ALIASES[intrinsicName]; - intrinsicName = "%" + alias[0] + "%"; - } - if (hasOwn(INTRINSICS, intrinsicName)) { - var value = INTRINSICS[intrinsicName]; - if (value === needsEval) { - value = doEval(intrinsicName); - } - if (typeof value === "undefined" && !allowMissing) { - throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); - } - return { - alias, - name: intrinsicName, - value - }; - } - throw new $SyntaxError("intrinsic " + name + " does not exist!"); - }; - module2.exports = function GetIntrinsic(name, allowMissing) { - if (typeof name !== "string" || name.length === 0) { - throw new $TypeError("intrinsic name must be a non-empty string"); - } - if (arguments.length > 1 && typeof allowMissing !== "boolean") { - throw new $TypeError('"allowMissing" argument must be a boolean'); - } - if ($exec(/^%?[^%]*%?$/, name) === null) { - throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); - } - var parts = stringToPath(name); - var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; - var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); - var intrinsicRealName = intrinsic.name; - var value = intrinsic.value; - var skipFurtherCaching = false; - var alias = intrinsic.alias; - if (alias) { - intrinsicBaseName = alias[0]; - $spliceApply(parts, $concat([0, 1], alias)); - } - for (var i = 1, isOwn = true; i < parts.length; i += 1) { - var part = parts[i]; - var first2 = $strSlice(part, 0, 1); - var last2 = $strSlice(part, -1); - if ((first2 === '"' || first2 === "'" || first2 === "`" || (last2 === '"' || last2 === "'" || last2 === "`")) && first2 !== last2) { - throw new $SyntaxError("property names with quotes must have matching quotes"); - } - if (part === "constructor" || !isOwn) { - skipFurtherCaching = true; - } - intrinsicBaseName += "." + part; - intrinsicRealName = "%" + intrinsicBaseName + "%"; - if (hasOwn(INTRINSICS, intrinsicRealName)) { - value = INTRINSICS[intrinsicRealName]; - } else if (value != null) { - if (!(part in value)) { - if (!allowMissing) { - throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); - } - return void 0; - } - if ($gOPD && i + 1 >= parts.length) { - var desc = $gOPD(value, part); - isOwn = !!desc; - if (isOwn && "get" in desc && !("originalValue" in desc.get)) { - value = desc.get; - } else { - value = value[part]; - } - } else { - isOwn = hasOwn(value, part); - value = value[part]; - } - if (isOwn && !skipFurtherCaching) { - INTRINSICS[intrinsicRealName] = value; - } - } - } - return value; - }; - } -}); - -// node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js -var require_has_property_descriptors = __commonJS({ - "node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var GetIntrinsic = require_get_intrinsic(); - var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); - var hasPropertyDescriptors = function hasPropertyDescriptors2() { - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - return true; - } catch (e) { - return false; - } - } - return false; - }; - hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { - if (!hasPropertyDescriptors()) { - return null; - } - try { - return $defineProperty([], "length", { value: 1 }).length !== 1; - } catch (e) { - return true; - } - }; - module2.exports = hasPropertyDescriptors; - } -}); - -// node_modules/.pnpm/define-properties@1.2.0/node_modules/define-properties/index.js -var require_define_properties = __commonJS({ - "node_modules/.pnpm/define-properties@1.2.0/node_modules/define-properties/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var keys = require_object_keys(); - var hasSymbols = typeof Symbol === "function" && typeof Symbol("foo") === "symbol"; - var toStr = Object.prototype.toString; - var concat = Array.prototype.concat; - var origDefineProperty = Object.defineProperty; - var isFunction2 = function(fn) { - return typeof fn === "function" && toStr.call(fn) === "[object Function]"; - }; - var hasPropertyDescriptors = require_has_property_descriptors()(); - var supportsDescriptors = origDefineProperty && hasPropertyDescriptors; - var defineProperty = function(object, name, value, predicate) { - if (name in object) { - if (predicate === true) { - if (object[name] === value) { - return; - } - } else if (!isFunction2(predicate) || !predicate()) { - return; - } - } - if (supportsDescriptors) { - origDefineProperty(object, name, { - configurable: true, - enumerable: false, - value, - writable: true - }); - } else { - object[name] = value; - } - }; - var defineProperties = function(object, map) { - var predicates = arguments.length > 2 ? arguments[2] : {}; - var props = keys(map); - if (hasSymbols) { - props = concat.call(props, Object.getOwnPropertySymbols(map)); - } - for (var i = 0; i < props.length; i += 1) { - defineProperty(object, props[i], map[props[i]], predicates[props[i]]); - } - }; - defineProperties.supportsDescriptors = !!supportsDescriptors; - module2.exports = defineProperties; - } -}); - -// node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js -var require_call_bind = __commonJS({ - "node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var bind = require_function_bind(); - var GetIntrinsic = require_get_intrinsic(); - var $apply = GetIntrinsic("%Function.prototype.apply%"); - var $call = GetIntrinsic("%Function.prototype.call%"); - var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind.call($call, $apply); - var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); - var $defineProperty = GetIntrinsic("%Object.defineProperty%", true); - var $max = GetIntrinsic("%Math.max%"); - if ($defineProperty) { - try { - $defineProperty({}, "a", { value: 1 }); - } catch (e) { - $defineProperty = null; - } - } - module2.exports = function callBind(originalFunction) { - var func = $reflectApply(bind, $call, arguments); - if ($gOPD && $defineProperty) { - var desc = $gOPD(func, "length"); - if (desc.configurable) { - $defineProperty( - func, - "length", - { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) } - ); - } - } - return func; - }; - var applyBind = function applyBind2() { - return $reflectApply(bind, $apply, arguments); - }; - if ($defineProperty) { - $defineProperty(module2.exports, "apply", { value: applyBind }); - } else { - module2.exports.apply = applyBind; - } - } -}); - -// node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js -var require_callBound = __commonJS({ - "node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var GetIntrinsic = require_get_intrinsic(); - var callBind = require_call_bind(); - var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf")); - module2.exports = function callBoundIntrinsic(name, allowMissing) { - var intrinsic = GetIntrinsic(name, !!allowMissing); - if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) { - return callBind(intrinsic); - } - return intrinsic; - }; - } -}); - -// node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/implementation.js -var require_implementation3 = __commonJS({ - "node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/implementation.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var objectKeys = require_object_keys(); - var hasSymbols = require_shams()(); - var callBound = require_callBound(); - var toObject = Object; - var $push = callBound("Array.prototype.push"); - var $propIsEnumerable = callBound("Object.prototype.propertyIsEnumerable"); - var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; - module2.exports = function assign2(target, source1) { - if (target == null) { - throw new TypeError("target must be an object"); - } - var to = toObject(target); - if (arguments.length === 1) { - return to; - } - for (var s = 1; s < arguments.length; ++s) { - var from = toObject(arguments[s]); - var keys = objectKeys(from); - var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); - if (getSymbols) { - var syms = getSymbols(from); - for (var j = 0; j < syms.length; ++j) { - var key2 = syms[j]; - if ($propIsEnumerable(from, key2)) { - $push(keys, key2); - } - } - } - for (var i = 0; i < keys.length; ++i) { - var nextKey = keys[i]; - if ($propIsEnumerable(from, nextKey)) { - var propValue = from[nextKey]; - to[nextKey] = propValue; - } - } - } - return to; - }; - } -}); - -// node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/polyfill.js -var require_polyfill = __commonJS({ - "node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/polyfill.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var implementation = require_implementation3(); - var lacksProperEnumerationOrder = function() { - if (!Object.assign) { - return false; - } - var str = "abcdefghijklmnopqrst"; - var letters = str.split(""); - var map = {}; - for (var i = 0; i < letters.length; ++i) { - map[letters[i]] = letters[i]; - } - var obj = Object.assign({}, map); - var actual = ""; - for (var k in obj) { - actual += k; - } - return str !== actual; - }; - var assignHasPendingExceptions = function() { - if (!Object.assign || !Object.preventExtensions) { - return false; - } - var thrower = Object.preventExtensions({ 1: 2 }); - try { - Object.assign(thrower, "xy"); - } catch (e) { - return thrower[1] === "y"; - } - return false; - }; - module2.exports = function getPolyfill() { - if (!Object.assign) { - return implementation; - } - if (lacksProperEnumerationOrder()) { - return implementation; - } - if (assignHasPendingExceptions()) { - return implementation; - } - return Object.assign; - }; - } -}); - -// node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/shim.js -var require_shim = __commonJS({ - "node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/shim.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var define2 = require_define_properties(); - var getPolyfill = require_polyfill(); - module2.exports = function shimAssign() { - var polyfill = getPolyfill(); - define2( - Object, - { assign: polyfill }, - { assign: function() { - return Object.assign !== polyfill; - } } - ); - return polyfill; - }; - } -}); - -// node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/index.js -var require_object = __commonJS({ - "node_modules/.pnpm/object.assign@4.1.4/node_modules/object.assign/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var defineProperties = require_define_properties(); - var callBind = require_call_bind(); - var implementation = require_implementation3(); - var getPolyfill = require_polyfill(); - var shim = require_shim(); - var polyfill = callBind.apply(getPolyfill()); - var bound = function assign2(target, source1) { - return polyfill(Object, arguments); - }; - defineProperties(bound, { - getPolyfill, - implementation, - shim - }); - module2.exports = bound; - } -}); - -// node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js -var require_functions_have_names = __commonJS({ - "node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var functionsHaveNames = function functionsHaveNames2() { - return typeof function f() { - }.name === "string"; - }; - var gOPD = Object.getOwnPropertyDescriptor; - if (gOPD) { - try { - gOPD([], "length"); - } catch (e) { - gOPD = null; - } - } - functionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() { - if (!functionsHaveNames() || !gOPD) { - return false; - } - var desc = gOPD(function() { - }, "name"); - return !!desc && !!desc.configurable; - }; - var $bind = Function.prototype.bind; - functionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() { - return functionsHaveNames() && typeof $bind === "function" && function f() { - }.bind().name !== ""; - }; - module2.exports = functionsHaveNames; - } -}); - -// node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/implementation.js -var require_implementation4 = __commonJS({ - "node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/implementation.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var functionsHaveConfigurableNames = require_functions_have_names().functionsHaveConfigurableNames(); - var $Object = Object; - var $TypeError = TypeError; - module2.exports = function flags() { - if (this != null && this !== $Object(this)) { - throw new $TypeError("RegExp.prototype.flags getter called on non-object"); - } - var result = ""; - if (this.hasIndices) { - result += "d"; - } - if (this.global) { - result += "g"; - } - if (this.ignoreCase) { - result += "i"; - } - if (this.multiline) { - result += "m"; - } - if (this.dotAll) { - result += "s"; - } - if (this.unicode) { - result += "u"; - } - if (this.unicodeSets) { - result += "v"; - } - if (this.sticky) { - result += "y"; - } - return result; - }; - if (functionsHaveConfigurableNames && Object.defineProperty) { - Object.defineProperty(module2.exports, "name", { value: "get flags" }); - } - } -}); - -// node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/polyfill.js -var require_polyfill2 = __commonJS({ - "node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/polyfill.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var implementation = require_implementation4(); - var supportsDescriptors = require_define_properties().supportsDescriptors; - var $gOPD = Object.getOwnPropertyDescriptor; - module2.exports = function getPolyfill() { - if (supportsDescriptors && /a/mig.flags === "gim") { - var descriptor = $gOPD(RegExp.prototype, "flags"); - if (descriptor && typeof descriptor.get === "function" && typeof RegExp.prototype.dotAll === "boolean" && typeof RegExp.prototype.hasIndices === "boolean") { - var calls = ""; - var o = {}; - Object.defineProperty(o, "hasIndices", { - get: function() { - calls += "d"; - } - }); - Object.defineProperty(o, "sticky", { - get: function() { - calls += "y"; - } - }); - if (calls === "dy") { - return descriptor.get; - } - } - } - return implementation; - }; - } -}); - -// node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/shim.js -var require_shim2 = __commonJS({ - "node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/shim.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var supportsDescriptors = require_define_properties().supportsDescriptors; - var getPolyfill = require_polyfill2(); - var gOPD = Object.getOwnPropertyDescriptor; - var defineProperty = Object.defineProperty; - var TypeErr = TypeError; - var getProto = Object.getPrototypeOf; - var regex2 = /a/; - module2.exports = function shimFlags() { - if (!supportsDescriptors || !getProto) { - throw new TypeErr("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors"); - } - var polyfill = getPolyfill(); - var proto = getProto(regex2); - var descriptor = gOPD(proto, "flags"); - if (!descriptor || descriptor.get !== polyfill) { - defineProperty(proto, "flags", { - configurable: true, - enumerable: false, - get: polyfill - }); - } - return polyfill; - }; - } -}); - -// node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/index.js -var require_regexp_prototype = __commonJS({ - "node_modules/.pnpm/regexp.prototype.flags@1.5.0/node_modules/regexp.prototype.flags/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var define2 = require_define_properties(); - var callBind = require_call_bind(); - var implementation = require_implementation4(); - var getPolyfill = require_polyfill2(); - var shim = require_shim2(); - var flagsBound = callBind(getPolyfill()); - define2(flagsBound, { - getPolyfill, - implementation, - shim - }); - module2.exports = flagsBound; - } -}); - -// node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js -var require_shams2 = __commonJS({ - "node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var hasSymbols = require_shams(); - module2.exports = function hasToStringTagShams() { - return hasSymbols() && !!Symbol.toStringTag; - }; - } -}); - -// node_modules/.pnpm/is-arguments@1.1.1/node_modules/is-arguments/index.js -var require_is_arguments = __commonJS({ - "node_modules/.pnpm/is-arguments@1.1.1/node_modules/is-arguments/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var hasToStringTag = require_shams2()(); - var callBound = require_callBound(); - var $toString = callBound("Object.prototype.toString"); - var isStandardArguments = function isArguments(value) { - if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) { - return false; - } - return $toString(value) === "[object Arguments]"; - }; - var isLegacyArguments = function isArguments(value) { - if (isStandardArguments(value)) { - return true; - } - return value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && $toString(value) !== "[object Array]" && $toString(value.callee) === "[object Function]"; - }; - var supportsStandardArguments = function() { - return isStandardArguments(arguments); - }(); - isStandardArguments.isLegacyArguments = isLegacyArguments; - module2.exports = supportsStandardArguments ? isStandardArguments : isLegacyArguments; - } -}); - -// (disabled):node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/util.inspect -var require_util = __commonJS({ - "(disabled):node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/util.inspect"() { - init_polyfill_buffer(); - } -}); - -// node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js -var require_object_inspect = __commonJS({ - "node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js"(exports2, module2) { - init_polyfill_buffer(); - var hasMap = typeof Map === "function" && Map.prototype; - var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null; - var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null; - var mapForEach = hasMap && Map.prototype.forEach; - var hasSet = typeof Set === "function" && Set.prototype; - var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null; - var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null; - var setForEach = hasSet && Set.prototype.forEach; - var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype; - var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; - var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype; - var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; - var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype; - var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; - var booleanValueOf = Boolean.prototype.valueOf; - var objectToString2 = Object.prototype.toString; - var functionToString = Function.prototype.toString; - var $match = String.prototype.match; - var $slice = String.prototype.slice; - var $replace = String.prototype.replace; - var $toUpperCase = String.prototype.toUpperCase; - var $toLowerCase = String.prototype.toLowerCase; - var $test = RegExp.prototype.test; - var $concat = Array.prototype.concat; - var $join = Array.prototype.join; - var $arrSlice = Array.prototype.slice; - var $floor = Math.floor; - var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null; - var gOPS = Object.getOwnPropertySymbols; - var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null; - var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object"; - var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null; - var isEnumerable = Object.prototype.propertyIsEnumerable; - var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) { - return O.__proto__; - } : null); - function addNumericSeparator(num2, str) { - if (num2 === Infinity || num2 === -Infinity || num2 !== num2 || num2 && num2 > -1e3 && num2 < 1e3 || $test.call(/e/, str)) { - return str; - } - var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; - if (typeof num2 === "number") { - var int = num2 < 0 ? -$floor(-num2) : $floor(num2); - if (int !== num2) { - var intStr = String(int); - var dec = $slice.call(str, intStr.length + 1); - return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, ""); - } - } - return $replace.call(str, sepRegex, "$&_"); - } - var utilInspect = require_util(); - var inspectCustom = utilInspect.custom; - var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; - module2.exports = function inspect_(obj, options, depth, seen) { - var opts = options || {}; - if (has(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) { - throw new TypeError('option "quoteStyle" must be "single" or "double"'); - } - if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) { - throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); - } - var customInspect = has(opts, "customInspect") ? opts.customInspect : true; - if (typeof customInspect !== "boolean" && customInspect !== "symbol") { - throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); - } - if (has(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) { - throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); - } - if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") { - throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); - } - var numericSeparator = opts.numericSeparator; - if (typeof obj === "undefined") { - return "undefined"; - } - if (obj === null) { - return "null"; - } - if (typeof obj === "boolean") { - return obj ? "true" : "false"; - } - if (typeof obj === "string") { - return inspectString(obj, opts); - } - if (typeof obj === "number") { - if (obj === 0) { - return Infinity / obj > 0 ? "0" : "-0"; - } - var str = String(obj); - return numericSeparator ? addNumericSeparator(obj, str) : str; - } - if (typeof obj === "bigint") { - var bigIntStr = String(obj) + "n"; - return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; - } - var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth; - if (typeof depth === "undefined") { - depth = 0; - } - if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") { - return isArray(obj) ? "[Array]" : "[Object]"; - } - var indent2 = getIndent(opts, depth); - if (typeof seen === "undefined") { - seen = []; - } else if (indexOf(seen, obj) >= 0) { - return "[Circular]"; - } - function inspect(value, from, noIndent) { - if (from) { - seen = $arrSlice.call(seen); - seen.push(from); - } - if (noIndent) { - var newOpts = { - depth: opts.depth - }; - if (has(opts, "quoteStyle")) { - newOpts.quoteStyle = opts.quoteStyle; - } - return inspect_(value, newOpts, depth + 1, seen); - } - return inspect_(value, opts, depth + 1, seen); - } - if (typeof obj === "function" && !isRegExp(obj)) { - var name = nameOf(obj); - var keys = arrObjKeys(obj, inspect); - return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : ""); - } - if (isSymbol(obj)) { - var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj); - return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString; - } - if (isElement(obj)) { - var s = "<" + $toLowerCase.call(String(obj.nodeName)); - var attrs = obj.attributes || []; - for (var i = 0; i < attrs.length; i++) { - s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts); - } - s += ">"; - if (obj.childNodes && obj.childNodes.length) { - s += "..."; - } - s += ""; - return s; - } - if (isArray(obj)) { - if (obj.length === 0) { - return "[]"; - } - var xs = arrObjKeys(obj, inspect); - if (indent2 && !singleLineValues(xs)) { - return "[" + indentedJoin(xs, indent2) + "]"; - } - return "[ " + $join.call(xs, ", ") + " ]"; - } - if (isError(obj)) { - var parts = arrObjKeys(obj, inspect); - if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) { - return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }"; - } - if (parts.length === 0) { - return "[" + String(obj) + "]"; - } - return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }"; - } - if (typeof obj === "object" && customInspect) { - if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) { - return utilInspect(obj, { depth: maxDepth - depth }); - } else if (customInspect !== "symbol" && typeof obj.inspect === "function") { - return obj.inspect(); - } - } - if (isMap(obj)) { - var mapParts = []; - if (mapForEach) { - mapForEach.call(obj, function(value, key2) { - mapParts.push(inspect(key2, obj, true) + " => " + inspect(value, obj)); - }); - } - return collectionOf("Map", mapSize.call(obj), mapParts, indent2); - } - if (isSet(obj)) { - var setParts = []; - if (setForEach) { - setForEach.call(obj, function(value) { - setParts.push(inspect(value, obj)); - }); - } - return collectionOf("Set", setSize.call(obj), setParts, indent2); - } - if (isWeakMap(obj)) { - return weakCollectionOf("WeakMap"); - } - if (isWeakSet(obj)) { - return weakCollectionOf("WeakSet"); - } - if (isWeakRef(obj)) { - return weakCollectionOf("WeakRef"); - } - if (isNumber(obj)) { - return markBoxed(inspect(Number(obj))); - } - if (isBigInt(obj)) { - return markBoxed(inspect(bigIntValueOf.call(obj))); - } - if (isBoolean(obj)) { - return markBoxed(booleanValueOf.call(obj)); - } - if (isString(obj)) { - return markBoxed(inspect(String(obj))); - } - if (!isDate(obj) && !isRegExp(obj)) { - var ys = arrObjKeys(obj, inspect); - var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; - var protoTag = obj instanceof Object ? "" : "null prototype"; - var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : ""; - var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : ""; - var tag2 = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : ""); - if (ys.length === 0) { - return tag2 + "{}"; - } - if (indent2) { - return tag2 + "{" + indentedJoin(ys, indent2) + "}"; - } - return tag2 + "{ " + $join.call(ys, ", ") + " }"; - } - return String(obj); - }; - function wrapQuotes(s, defaultStyle, opts) { - var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'"; - return quoteChar + s + quoteChar; - } - function quote(s) { - return $replace.call(String(s), /"/g, """); - } - function isArray(obj) { - return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isDate(obj) { - return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isRegExp(obj) { - return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isError(obj) { - return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isString(obj) { - return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isNumber(obj) { - return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isBoolean(obj) { - return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); - } - function isSymbol(obj) { - if (hasShammedSymbols) { - return obj && typeof obj === "object" && obj instanceof Symbol; - } - if (typeof obj === "symbol") { - return true; - } - if (!obj || typeof obj !== "object" || !symToString) { - return false; - } - try { - symToString.call(obj); - return true; - } catch (e) { - } - return false; - } - function isBigInt(obj) { - if (!obj || typeof obj !== "object" || !bigIntValueOf) { - return false; - } - try { - bigIntValueOf.call(obj); - return true; - } catch (e) { - } - return false; - } - var hasOwn = Object.prototype.hasOwnProperty || function(key2) { - return key2 in this; - }; - function has(obj, key2) { - return hasOwn.call(obj, key2); - } - function toStr(obj) { - return objectToString2.call(obj); - } - function nameOf(f) { - if (f.name) { - return f.name; - } - var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/); - if (m) { - return m[1]; - } - return null; - } - function indexOf(xs, x) { - if (xs.indexOf) { - return xs.indexOf(x); - } - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) { - return i; - } - } - return -1; - } - function isMap(x) { - if (!mapSize || !x || typeof x !== "object") { - return false; - } - try { - mapSize.call(x); - try { - setSize.call(x); - } catch (s) { - return true; - } - return x instanceof Map; - } catch (e) { - } - return false; - } - function isWeakMap(x) { - if (!weakMapHas || !x || typeof x !== "object") { - return false; - } - try { - weakMapHas.call(x, weakMapHas); - try { - weakSetHas.call(x, weakSetHas); - } catch (s) { - return true; - } - return x instanceof WeakMap; - } catch (e) { - } - return false; - } - function isWeakRef(x) { - if (!weakRefDeref || !x || typeof x !== "object") { - return false; - } - try { - weakRefDeref.call(x); - return true; - } catch (e) { - } - return false; - } - function isSet(x) { - if (!setSize || !x || typeof x !== "object") { - return false; - } - try { - setSize.call(x); - try { - mapSize.call(x); - } catch (m) { - return true; - } - return x instanceof Set; - } catch (e) { - } - return false; - } - function isWeakSet(x) { - if (!weakSetHas || !x || typeof x !== "object") { - return false; - } - try { - weakSetHas.call(x, weakSetHas); - try { - weakMapHas.call(x, weakMapHas); - } catch (s) { - return true; - } - return x instanceof WeakSet; - } catch (e) { - } - return false; - } - function isElement(x) { - if (!x || typeof x !== "object") { - return false; - } - if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) { - return true; - } - return typeof x.nodeName === "string" && typeof x.getAttribute === "function"; - } - function inspectString(str, opts) { - if (str.length > opts.maxStringLength) { - var remaining = str.length - opts.maxStringLength; - var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : ""); - return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer; - } - var s = $replace.call($replace.call(str, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte); - return wrapQuotes(s, "single", opts); - } - function lowbyte(c) { - var n = c.charCodeAt(0); - var x = { - 8: "b", - 9: "t", - 10: "n", - 12: "f", - 13: "r" - }[n]; - if (x) { - return "\\" + x; - } - return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16)); - } - function markBoxed(str) { - return "Object(" + str + ")"; - } - function weakCollectionOf(type) { - return type + " { ? }"; - } - function collectionOf(type, size, entries, indent2) { - var joinedEntries = indent2 ? indentedJoin(entries, indent2) : $join.call(entries, ", "); - return type + " (" + size + ") {" + joinedEntries + "}"; - } - function singleLineValues(xs) { - for (var i = 0; i < xs.length; i++) { - if (indexOf(xs[i], "\n") >= 0) { - return false; - } - } - return true; - } - function getIndent(opts, depth) { - var baseIndent; - if (opts.indent === " ") { - baseIndent = " "; - } else if (typeof opts.indent === "number" && opts.indent > 0) { - baseIndent = $join.call(Array(opts.indent + 1), " "); - } else { - return null; - } - return { - base: baseIndent, - prev: $join.call(Array(depth + 1), baseIndent) - }; - } - function indentedJoin(xs, indent2) { - if (xs.length === 0) { - return ""; - } - var lineJoiner = "\n" + indent2.prev + indent2.base; - return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent2.prev; - } - function arrObjKeys(obj, inspect) { - var isArr = isArray(obj); - var xs = []; - if (isArr) { - xs.length = obj.length; - for (var i = 0; i < obj.length; i++) { - xs[i] = has(obj, i) ? inspect(obj[i], obj) : ""; - } - } - var syms = typeof gOPS === "function" ? gOPS(obj) : []; - var symMap; - if (hasShammedSymbols) { - symMap = {}; - for (var k = 0; k < syms.length; k++) { - symMap["$" + syms[k]] = syms[k]; - } - } - for (var key2 in obj) { - if (!has(obj, key2)) { - continue; - } - if (isArr && String(Number(key2)) === key2 && key2 < obj.length) { - continue; - } - if (hasShammedSymbols && symMap["$" + key2] instanceof Symbol) { - continue; - } else if ($test.call(/[^\w$]/, key2)) { - xs.push(inspect(key2, obj) + ": " + inspect(obj[key2], obj)); - } else { - xs.push(key2 + ": " + inspect(obj[key2], obj)); - } - } - if (typeof gOPS === "function") { - for (var j = 0; j < syms.length; j++) { - if (isEnumerable.call(obj, syms[j])) { - xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj)); - } - } - } - return xs; - } - } -}); - -// node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js -var require_side_channel = __commonJS({ - "node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var GetIntrinsic = require_get_intrinsic(); - var callBound = require_callBound(); - var inspect = require_object_inspect(); - var $TypeError = GetIntrinsic("%TypeError%"); - var $WeakMap = GetIntrinsic("%WeakMap%", true); - var $Map = GetIntrinsic("%Map%", true); - var $weakMapGet = callBound("WeakMap.prototype.get", true); - var $weakMapSet = callBound("WeakMap.prototype.set", true); - var $weakMapHas = callBound("WeakMap.prototype.has", true); - var $mapGet = callBound("Map.prototype.get", true); - var $mapSet = callBound("Map.prototype.set", true); - var $mapHas = callBound("Map.prototype.has", true); - var listGetNode = function(list, key2) { - for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) { - if (curr.key === key2) { - prev.next = curr.next; - curr.next = list.next; - list.next = curr; - return curr; - } - } - }; - var listGet = function(objects, key2) { - var node = listGetNode(objects, key2); - return node && node.value; - }; - var listSet = function(objects, key2, value) { - var node = listGetNode(objects, key2); - if (node) { - node.value = value; - } else { - objects.next = { - // eslint-disable-line no-param-reassign - key: key2, - next: objects.next, - value - }; - } - }; - var listHas = function(objects, key2) { - return !!listGetNode(objects, key2); - }; - module2.exports = function getSideChannel() { - var $wm; - var $m; - var $o; - var channel = { - assert: function(key2) { - if (!channel.has(key2)) { - throw new $TypeError("Side channel does not contain " + inspect(key2)); - } - }, - get: function(key2) { - if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) { - if ($wm) { - return $weakMapGet($wm, key2); - } - } else if ($Map) { - if ($m) { - return $mapGet($m, key2); - } - } else { - if ($o) { - return listGet($o, key2); - } - } - }, - has: function(key2) { - if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) { - if ($wm) { - return $weakMapHas($wm, key2); - } - } else if ($Map) { - if ($m) { - return $mapHas($m, key2); - } - } else { - if ($o) { - return listHas($o, key2); - } - } - return false; - }, - set: function(key2, value) { - if ($WeakMap && key2 && (typeof key2 === "object" || typeof key2 === "function")) { - if (!$wm) { - $wm = new $WeakMap(); - } - $weakMapSet($wm, key2, value); - } else if ($Map) { - if (!$m) { - $m = new $Map(); - } - $mapSet($m, key2, value); - } else { - if (!$o) { - $o = { key: {}, next: null }; - } - listSet($o, key2, value); - } - } - }; - return channel; - }; - } -}); - -// node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js -var require_internal_slot = __commonJS({ - "node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var GetIntrinsic = require_get_intrinsic(); - var has = require_src2(); - var channel = require_side_channel()(); - var $TypeError = GetIntrinsic("%TypeError%"); - var SLOT = { - assert: function(O, slot) { - if (!O || typeof O !== "object" && typeof O !== "function") { - throw new $TypeError("`O` is not an object"); - } - if (typeof slot !== "string") { - throw new $TypeError("`slot` must be a string"); - } - channel.assert(O); - if (!SLOT.has(O, slot)) { - throw new $TypeError("`" + slot + "` is not present on `O`"); - } - }, - get: function(O, slot) { - if (!O || typeof O !== "object" && typeof O !== "function") { - throw new $TypeError("`O` is not an object"); - } - if (typeof slot !== "string") { - throw new $TypeError("`slot` must be a string"); - } - var slots = channel.get(O); - return slots && slots["$" + slot]; - }, - has: function(O, slot) { - if (!O || typeof O !== "object" && typeof O !== "function") { - throw new $TypeError("`O` is not an object"); - } - if (typeof slot !== "string") { - throw new $TypeError("`slot` must be a string"); - } - var slots = channel.get(O); - return !!slots && has(slots, "$" + slot); - }, - set: function(O, slot, V) { - if (!O || typeof O !== "object" && typeof O !== "function") { - throw new $TypeError("`O` is not an object"); - } - if (typeof slot !== "string") { - throw new $TypeError("`slot` must be a string"); - } - var slots = channel.get(O); - if (!slots) { - slots = {}; - channel.set(O, slots); - } - slots["$" + slot] = V; - } - }; - if (Object.freeze) { - Object.freeze(SLOT); - } - module2.exports = SLOT; - } -}); - -// node_modules/.pnpm/stop-iteration-iterator@1.0.0/node_modules/stop-iteration-iterator/index.js -var require_stop_iteration_iterator = __commonJS({ - "node_modules/.pnpm/stop-iteration-iterator@1.0.0/node_modules/stop-iteration-iterator/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var SLOT = require_internal_slot(); - var $SyntaxError = SyntaxError; - var $StopIteration = typeof StopIteration === "object" ? StopIteration : null; - module2.exports = function getStopIterationIterator(origIterator) { - if (!$StopIteration) { - throw new $SyntaxError("this environment lacks StopIteration"); - } - SLOT.set(origIterator, "[[Done]]", false); - var siIterator = { - next: function next() { - var iterator = SLOT.get(this, "[[Iterator]]"); - var done = SLOT.get(iterator, "[[Done]]"); - try { - return { - done, - value: done ? void 0 : iterator.next() - }; - } catch (e) { - SLOT.set(iterator, "[[Done]]", true); - if (e !== $StopIteration) { - throw e; - } - return { - done: true, - value: void 0 - }; - } - } - }; - SLOT.set(siIterator, "[[Iterator]]", origIterator); - return siIterator; - }; - } -}); - -// node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/index.js -var require_isarray = __commonJS({ - "node_modules/.pnpm/isarray@2.0.5/node_modules/isarray/index.js"(exports2, module2) { - init_polyfill_buffer(); - var toString = {}.toString; - module2.exports = Array.isArray || function(arr) { - return toString.call(arr) == "[object Array]"; - }; - } -}); - -// node_modules/.pnpm/is-string@1.0.7/node_modules/is-string/index.js -var require_is_string = __commonJS({ - "node_modules/.pnpm/is-string@1.0.7/node_modules/is-string/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var strValue = String.prototype.valueOf; - var tryStringObject = function tryStringObject2(value) { - try { - strValue.call(value); - return true; - } catch (e) { - return false; - } - }; - var toStr = Object.prototype.toString; - var strClass = "[object String]"; - var hasToStringTag = require_shams2()(); - module2.exports = function isString(value) { - if (typeof value === "string") { - return true; - } - if (typeof value !== "object") { - return false; - } - return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass; - }; - } -}); - -// node_modules/.pnpm/is-map@2.0.2/node_modules/is-map/index.js -var require_is_map = __commonJS({ - "node_modules/.pnpm/is-map@2.0.2/node_modules/is-map/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var $Map = typeof Map === "function" && Map.prototype ? Map : null; - var $Set = typeof Set === "function" && Set.prototype ? Set : null; - var exported; - if (!$Map) { - exported = function isMap(x) { - return false; - }; - } - var $mapHas = $Map ? Map.prototype.has : null; - var $setHas = $Set ? Set.prototype.has : null; - if (!exported && !$mapHas) { - exported = function isMap(x) { - return false; - }; - } - module2.exports = exported || function isMap(x) { - if (!x || typeof x !== "object") { - return false; - } - try { - $mapHas.call(x); - if ($setHas) { - try { - $setHas.call(x); - } catch (e) { - return true; - } - } - return x instanceof $Map; - } catch (e) { - } - return false; - }; - } -}); - -// node_modules/.pnpm/is-set@2.0.2/node_modules/is-set/index.js -var require_is_set = __commonJS({ - "node_modules/.pnpm/is-set@2.0.2/node_modules/is-set/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var $Map = typeof Map === "function" && Map.prototype ? Map : null; - var $Set = typeof Set === "function" && Set.prototype ? Set : null; - var exported; - if (!$Set) { - exported = function isSet(x) { - return false; - }; - } - var $mapHas = $Map ? Map.prototype.has : null; - var $setHas = $Set ? Set.prototype.has : null; - if (!exported && !$setHas) { - exported = function isSet(x) { - return false; - }; - } - module2.exports = exported || function isSet(x) { - if (!x || typeof x !== "object") { - return false; - } - try { - $setHas.call(x); - if ($mapHas) { - try { - $mapHas.call(x); - } catch (e) { - return true; - } - } - return x instanceof $Set; - } catch (e) { - } - return false; - }; - } -}); - -// node_modules/.pnpm/es-get-iterator@1.1.3/node_modules/es-get-iterator/index.js -var require_es_get_iterator = __commonJS({ - "node_modules/.pnpm/es-get-iterator@1.1.3/node_modules/es-get-iterator/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var isArguments = require_is_arguments(); - var getStopIterationIterator = require_stop_iteration_iterator(); - if (require_has_symbols()() || require_shams()()) { - $iterator = Symbol.iterator; - module2.exports = function getIterator3(iterable) { - if (iterable != null && typeof iterable[$iterator] !== "undefined") { - return iterable[$iterator](); - } - if (isArguments(iterable)) { - return Array.prototype[$iterator].call(iterable); - } - }; - } else { - isArray = require_isarray(); - isString = require_is_string(); - GetIntrinsic = require_get_intrinsic(); - $Map = GetIntrinsic("%Map%", true); - $Set = GetIntrinsic("%Set%", true); - callBound = require_callBound(); - $arrayPush = callBound("Array.prototype.push"); - $charCodeAt = callBound("String.prototype.charCodeAt"); - $stringSlice = callBound("String.prototype.slice"); - advanceStringIndex = function advanceStringIndex2(S, index2) { - var length = S.length; - if (index2 + 1 >= length) { - return index2 + 1; - } - var first2 = $charCodeAt(S, index2); - if (first2 < 55296 || first2 > 56319) { - return index2 + 1; - } - var second = $charCodeAt(S, index2 + 1); - if (second < 56320 || second > 57343) { - return index2 + 1; - } - return index2 + 2; - }; - getArrayIterator = function getArrayIterator2(arraylike) { - var i = 0; - return { - next: function next() { - var done = i >= arraylike.length; - var value; - if (!done) { - value = arraylike[i]; - i += 1; - } - return { - done, - value - }; - } - }; - }; - getNonCollectionIterator = function getNonCollectionIterator2(iterable, noPrimordialCollections) { - if (isArray(iterable) || isArguments(iterable)) { - return getArrayIterator(iterable); - } - if (isString(iterable)) { - var i = 0; - return { - next: function next() { - var nextIndex = advanceStringIndex(iterable, i); - var value = $stringSlice(iterable, i, nextIndex); - i = nextIndex; - return { - done: nextIndex > iterable.length, - value - }; - } - }; - } - if (noPrimordialCollections && typeof iterable["_es6-shim iterator_"] !== "undefined") { - return iterable["_es6-shim iterator_"](); - } - }; - if (!$Map && !$Set) { - module2.exports = function getIterator3(iterable) { - if (iterable != null) { - return getNonCollectionIterator(iterable, true); - } - }; - } else { - isMap = require_is_map(); - isSet = require_is_set(); - $mapForEach = callBound("Map.prototype.forEach", true); - $setForEach = callBound("Set.prototype.forEach", true); - if (typeof process === "undefined" || !process.versions || !process.versions.node) { - $mapIterator = callBound("Map.prototype.iterator", true); - $setIterator = callBound("Set.prototype.iterator", true); - } - $mapAtAtIterator = callBound("Map.prototype.@@iterator", true) || callBound("Map.prototype._es6-shim iterator_", true); - $setAtAtIterator = callBound("Set.prototype.@@iterator", true) || callBound("Set.prototype._es6-shim iterator_", true); - getCollectionIterator = function getCollectionIterator2(iterable) { - if (isMap(iterable)) { - if ($mapIterator) { - return getStopIterationIterator($mapIterator(iterable)); - } - if ($mapAtAtIterator) { - return $mapAtAtIterator(iterable); - } - if ($mapForEach) { - var entries = []; - $mapForEach(iterable, function(v, k) { - $arrayPush(entries, [k, v]); - }); - return getArrayIterator(entries); - } - } - if (isSet(iterable)) { - if ($setIterator) { - return getStopIterationIterator($setIterator(iterable)); - } - if ($setAtAtIterator) { - return $setAtAtIterator(iterable); - } - if ($setForEach) { - var values = []; - $setForEach(iterable, function(v) { - $arrayPush(values, v); - }); - return getArrayIterator(values); - } - } - }; - module2.exports = function getIterator3(iterable) { - return getCollectionIterator(iterable) || getNonCollectionIterator(iterable); - }; - } - } - var $iterator; - var isArray; - var isString; - var GetIntrinsic; - var $Map; - var $Set; - var callBound; - var $arrayPush; - var $charCodeAt; - var $stringSlice; - var advanceStringIndex; - var getArrayIterator; - var getNonCollectionIterator; - var isMap; - var isSet; - var $mapForEach; - var $setForEach; - var $mapIterator; - var $setIterator; - var $mapAtAtIterator; - var $setAtAtIterator; - var getCollectionIterator; - } -}); - -// node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/implementation.js -var require_implementation5 = __commonJS({ - "node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/implementation.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var numberIsNaN = function(value) { - return value !== value; - }; - module2.exports = function is(a, b) { - if (a === 0 && b === 0) { - return 1 / a === 1 / b; - } - if (a === b) { - return true; - } - if (numberIsNaN(a) && numberIsNaN(b)) { - return true; - } - return false; - }; - } -}); - -// node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/polyfill.js -var require_polyfill3 = __commonJS({ - "node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/polyfill.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var implementation = require_implementation5(); - module2.exports = function getPolyfill() { - return typeof Object.is === "function" ? Object.is : implementation; - }; - } -}); - -// node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/shim.js -var require_shim3 = __commonJS({ - "node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/shim.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var getPolyfill = require_polyfill3(); - var define2 = require_define_properties(); - module2.exports = function shimObjectIs() { - var polyfill = getPolyfill(); - define2(Object, { is: polyfill }, { - is: function testObjectIs() { - return Object.is !== polyfill; - } - }); - return polyfill; - }; - } -}); - -// node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/index.js -var require_object_is = __commonJS({ - "node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var define2 = require_define_properties(); - var callBind = require_call_bind(); - var implementation = require_implementation5(); - var getPolyfill = require_polyfill3(); - var shim = require_shim3(); - var polyfill = callBind(getPolyfill(), Object); - define2(polyfill, { - getPolyfill, - implementation, - shim - }); - module2.exports = polyfill; - } -}); - -// node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js -var require_is_callable = __commonJS({ - "node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var fnToStr = Function.prototype.toString; - var reflectApply = typeof Reflect === "object" && Reflect !== null && Reflect.apply; - var badArrayLike; - var isCallableMarker; - if (typeof reflectApply === "function" && typeof Object.defineProperty === "function") { - try { - badArrayLike = Object.defineProperty({}, "length", { - get: function() { - throw isCallableMarker; - } - }); - isCallableMarker = {}; - reflectApply(function() { - throw 42; - }, null, badArrayLike); - } catch (_) { - if (_ !== isCallableMarker) { - reflectApply = null; - } - } - } else { - reflectApply = null; - } - var constructorRegex = /^\s*class\b/; - var isES6ClassFn = function isES6ClassFunction(value) { - try { - var fnStr = fnToStr.call(value); - return constructorRegex.test(fnStr); - } catch (e) { - return false; - } - }; - var tryFunctionObject = function tryFunctionToStr(value) { - try { - if (isES6ClassFn(value)) { - return false; - } - fnToStr.call(value); - return true; - } catch (e) { - return false; - } - }; - var toStr = Object.prototype.toString; - var objectClass = "[object Object]"; - var fnClass = "[object Function]"; - var genClass = "[object GeneratorFunction]"; - var ddaClass = "[object HTMLAllCollection]"; - var ddaClass2 = "[object HTML document.all class]"; - var ddaClass3 = "[object HTMLCollection]"; - var hasToStringTag = typeof Symbol === "function" && !!Symbol.toStringTag; - var isIE68 = !(0 in [,]); - var isDDA = function isDocumentDotAll() { - return false; - }; - if (typeof document === "object") { - all = document.all; - if (toStr.call(all) === toStr.call(document.all)) { - isDDA = function isDocumentDotAll(value) { - if ((isIE68 || !value) && (typeof value === "undefined" || typeof value === "object")) { - try { - var str = toStr.call(value); - return (str === ddaClass || str === ddaClass2 || str === ddaClass3 || str === objectClass) && value("") == null; - } catch (e) { - } - } - return false; - }; - } - } - var all; - module2.exports = reflectApply ? function isCallable(value) { - if (isDDA(value)) { - return true; - } - if (!value) { - return false; - } - if (typeof value !== "function" && typeof value !== "object") { - return false; - } - try { - reflectApply(value, null, badArrayLike); - } catch (e) { - if (e !== isCallableMarker) { - return false; - } - } - return !isES6ClassFn(value) && tryFunctionObject(value); - } : function isCallable(value) { - if (isDDA(value)) { - return true; - } - if (!value) { - return false; - } - if (typeof value !== "function" && typeof value !== "object") { - return false; - } - if (hasToStringTag) { - return tryFunctionObject(value); - } - if (isES6ClassFn(value)) { - return false; - } - var strClass = toStr.call(value); - if (strClass !== fnClass && strClass !== genClass && !/^\[object HTML/.test(strClass)) { - return false; - } - return tryFunctionObject(value); - }; - } -}); - -// node_modules/.pnpm/for-each@0.3.3/node_modules/for-each/index.js -var require_for_each = __commonJS({ - "node_modules/.pnpm/for-each@0.3.3/node_modules/for-each/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var isCallable = require_is_callable(); - var toStr = Object.prototype.toString; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var forEachArray = function forEachArray2(array, iterator, receiver) { - for (var i = 0, len = array.length; i < len; i++) { - if (hasOwnProperty.call(array, i)) { - if (receiver == null) { - iterator(array[i], i, array); - } else { - iterator.call(receiver, array[i], i, array); - } - } - } - }; - var forEachString = function forEachString2(string, iterator, receiver) { - for (var i = 0, len = string.length; i < len; i++) { - if (receiver == null) { - iterator(string.charAt(i), i, string); - } else { - iterator.call(receiver, string.charAt(i), i, string); - } - } - }; - var forEachObject = function forEachObject2(object, iterator, receiver) { - for (var k in object) { - if (hasOwnProperty.call(object, k)) { - if (receiver == null) { - iterator(object[k], k, object); - } else { - iterator.call(receiver, object[k], k, object); - } - } - } - }; - var forEach2 = function forEach3(list, iterator, thisArg) { - if (!isCallable(iterator)) { - throw new TypeError("iterator must be a function"); - } - var receiver; - if (arguments.length >= 3) { - receiver = thisArg; - } - if (toStr.call(list) === "[object Array]") { - forEachArray(list, iterator, receiver); - } else if (typeof list === "string") { - forEachString(list, iterator, receiver); - } else { - forEachObject(list, iterator, receiver); - } - }; - module2.exports = forEach2; - } -}); - -// node_modules/.pnpm/available-typed-arrays@1.0.5/node_modules/available-typed-arrays/index.js -var require_available_typed_arrays = __commonJS({ - "node_modules/.pnpm/available-typed-arrays@1.0.5/node_modules/available-typed-arrays/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var possibleNames = [ - "BigInt64Array", - "BigUint64Array", - "Float32Array", - "Float64Array", - "Int16Array", - "Int32Array", - "Int8Array", - "Uint16Array", - "Uint32Array", - "Uint8Array", - "Uint8ClampedArray" - ]; - var g = typeof globalThis === "undefined" ? global : globalThis; - module2.exports = function availableTypedArrays() { - var out = []; - for (var i = 0; i < possibleNames.length; i++) { - if (typeof g[possibleNames[i]] === "function") { - out[out.length] = possibleNames[i]; - } - } - return out; - }; - } -}); - -// node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js -var require_gopd = __commonJS({ - "node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var GetIntrinsic = require_get_intrinsic(); - var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); - if ($gOPD) { - try { - $gOPD([], "length"); - } catch (e) { - $gOPD = null; - } - } - module2.exports = $gOPD; - } -}); - -// node_modules/.pnpm/which-typed-array@1.1.11/node_modules/which-typed-array/index.js -var require_which_typed_array = __commonJS({ - "node_modules/.pnpm/which-typed-array@1.1.11/node_modules/which-typed-array/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var forEach2 = require_for_each(); - var availableTypedArrays = require_available_typed_arrays(); - var callBind = require_call_bind(); - var callBound = require_callBound(); - var gOPD = require_gopd(); - var $toString = callBound("Object.prototype.toString"); - var hasToStringTag = require_shams2()(); - var g = typeof globalThis === "undefined" ? global : globalThis; - var typedArrays = availableTypedArrays(); - var $slice = callBound("String.prototype.slice"); - var getPrototypeOf = Object.getPrototypeOf; - var $indexOf = callBound("Array.prototype.indexOf", true) || function indexOf(array, value) { - for (var i = 0; i < array.length; i += 1) { - if (array[i] === value) { - return i; - } - } - return -1; - }; - var cache = { __proto__: null }; - if (hasToStringTag && gOPD && getPrototypeOf) { - forEach2(typedArrays, function(typedArray) { - var arr = new g[typedArray](); - if (Symbol.toStringTag in arr) { - var proto = getPrototypeOf(arr); - var descriptor = gOPD(proto, Symbol.toStringTag); - if (!descriptor) { - var superProto = getPrototypeOf(proto); - descriptor = gOPD(superProto, Symbol.toStringTag); - } - cache["$" + typedArray] = callBind(descriptor.get); - } - }); - } else { - forEach2(typedArrays, function(typedArray) { - var arr = new g[typedArray](); - cache["$" + typedArray] = callBind(arr.slice); - }); - } - var tryTypedArrays = function tryAllTypedArrays(value) { - var found = false; - forEach2(cache, function(getter, typedArray) { - if (!found) { - try { - if ("$" + getter(value) === typedArray) { - found = $slice(typedArray, 1); - } - } catch (e) { - } - } - }); - return found; - }; - var trySlices = function tryAllSlices(value) { - var found = false; - forEach2(cache, function(getter, name) { - if (!found) { - try { - getter(value); - found = $slice(name, 1); - } catch (e) { - } - } - }); - return found; - }; - module2.exports = function whichTypedArray(value) { - if (!value || typeof value !== "object") { - return false; - } - if (!hasToStringTag) { - var tag2 = $slice($toString(value), 8, -1); - if ($indexOf(typedArrays, tag2) > -1) { - return tag2; - } - if (tag2 !== "Object") { - return false; - } - return trySlices(value); - } - if (!gOPD) { - return null; - } - return tryTypedArrays(value); - }; - } -}); - -// node_modules/.pnpm/is-typed-array@1.1.12/node_modules/is-typed-array/index.js -var require_is_typed_array = __commonJS({ - "node_modules/.pnpm/is-typed-array@1.1.12/node_modules/is-typed-array/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var whichTypedArray = require_which_typed_array(); - module2.exports = function isTypedArray(value) { - return !!whichTypedArray(value); - }; - } -}); - -// node_modules/.pnpm/is-array-buffer@3.0.2/node_modules/is-array-buffer/index.js -var require_is_array_buffer = __commonJS({ - "node_modules/.pnpm/is-array-buffer@3.0.2/node_modules/is-array-buffer/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var callBind = require_call_bind(); - var callBound = require_callBound(); - var GetIntrinsic = require_get_intrinsic(); - var isTypedArray = require_is_typed_array(); - var $ArrayBuffer = GetIntrinsic("ArrayBuffer", true); - var $Float32Array = GetIntrinsic("Float32Array", true); - var $byteLength = callBound("ArrayBuffer.prototype.byteLength", true); - var abSlice = $ArrayBuffer && !$byteLength && new $ArrayBuffer().slice; - var $abSlice = abSlice && callBind(abSlice); - module2.exports = $byteLength || $abSlice ? function isArrayBuffer(obj) { - if (!obj || typeof obj !== "object") { - return false; - } - try { - if ($byteLength) { - $byteLength(obj); - } else { - $abSlice(obj, 0); - } - return true; - } catch (e) { - return false; - } - } : $Float32Array ? function IsArrayBuffer(obj) { - try { - return new $Float32Array(obj).buffer === obj && !isTypedArray(obj); - } catch (e) { - return typeof obj === "object" && e.name === "RangeError"; - } - } : function isArrayBuffer(obj) { - return false; - }; - } -}); - -// node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js -var require_is_date_object = __commonJS({ - "node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var getDay = Date.prototype.getDay; - var tryDateObject = function tryDateGetDayCall(value) { - try { - getDay.call(value); - return true; - } catch (e) { - return false; - } - }; - var toStr = Object.prototype.toString; - var dateClass = "[object Date]"; - var hasToStringTag = require_shams2()(); - module2.exports = function isDateObject(value) { - if (typeof value !== "object" || value === null) { - return false; - } - return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; - }; - } -}); - -// node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js -var require_is_regex = __commonJS({ - "node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var callBound = require_callBound(); - var hasToStringTag = require_shams2()(); - var has; - var $exec; - var isRegexMarker; - var badStringifier; - if (hasToStringTag) { - has = callBound("Object.prototype.hasOwnProperty"); - $exec = callBound("RegExp.prototype.exec"); - isRegexMarker = {}; - throwRegexMarker = function() { - throw isRegexMarker; - }; - badStringifier = { - toString: throwRegexMarker, - valueOf: throwRegexMarker - }; - if (typeof Symbol.toPrimitive === "symbol") { - badStringifier[Symbol.toPrimitive] = throwRegexMarker; - } - } - var throwRegexMarker; - var $toString = callBound("Object.prototype.toString"); - var gOPD = Object.getOwnPropertyDescriptor; - var regexClass = "[object RegExp]"; - module2.exports = hasToStringTag ? function isRegex(value) { - if (!value || typeof value !== "object") { - return false; - } - var descriptor = gOPD(value, "lastIndex"); - var hasLastIndexDataProperty = descriptor && has(descriptor, "value"); - if (!hasLastIndexDataProperty) { - return false; - } - try { - $exec(value, badStringifier); - } catch (e) { - return e === isRegexMarker; - } - } : function isRegex(value) { - if (!value || typeof value !== "object" && typeof value !== "function") { - return false; - } - return $toString(value) === regexClass; - }; - } -}); - -// node_modules/.pnpm/is-shared-array-buffer@1.0.2/node_modules/is-shared-array-buffer/index.js -var require_is_shared_array_buffer = __commonJS({ - "node_modules/.pnpm/is-shared-array-buffer@1.0.2/node_modules/is-shared-array-buffer/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var callBound = require_callBound(); - var $byteLength = callBound("SharedArrayBuffer.prototype.byteLength", true); - module2.exports = $byteLength ? function isSharedArrayBuffer(obj) { - if (!obj || typeof obj !== "object") { - return false; - } - try { - $byteLength(obj); - return true; - } catch (e) { - return false; - } - } : function isSharedArrayBuffer(obj) { - return false; - }; - } -}); - -// node_modules/.pnpm/is-number-object@1.0.7/node_modules/is-number-object/index.js -var require_is_number_object = __commonJS({ - "node_modules/.pnpm/is-number-object@1.0.7/node_modules/is-number-object/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var numToStr = Number.prototype.toString; - var tryNumberObject = function tryNumberObject2(value) { - try { - numToStr.call(value); - return true; - } catch (e) { - return false; - } - }; - var toStr = Object.prototype.toString; - var numClass = "[object Number]"; - var hasToStringTag = require_shams2()(); - module2.exports = function isNumberObject(value) { - if (typeof value === "number") { - return true; - } - if (typeof value !== "object") { - return false; - } - return hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass; - }; - } -}); - -// node_modules/.pnpm/is-boolean-object@1.1.2/node_modules/is-boolean-object/index.js -var require_is_boolean_object = __commonJS({ - "node_modules/.pnpm/is-boolean-object@1.1.2/node_modules/is-boolean-object/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var callBound = require_callBound(); - var $boolToStr = callBound("Boolean.prototype.toString"); - var $toString = callBound("Object.prototype.toString"); - var tryBooleanObject = function booleanBrandCheck(value) { - try { - $boolToStr(value); - return true; - } catch (e) { - return false; - } - }; - var boolClass = "[object Boolean]"; - var hasToStringTag = require_shams2()(); - module2.exports = function isBoolean(value) { - if (typeof value === "boolean") { - return true; - } - if (value === null || typeof value !== "object") { - return false; - } - return hasToStringTag && Symbol.toStringTag in value ? tryBooleanObject(value) : $toString(value) === boolClass; - }; - } -}); - -// node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js -var require_is_symbol = __commonJS({ - "node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var toStr = Object.prototype.toString; - var hasSymbols = require_has_symbols()(); - if (hasSymbols) { - symToStr = Symbol.prototype.toString; - symStringRegex = /^Symbol\(.*\)$/; - isSymbolObject = function isRealSymbolObject(value) { - if (typeof value.valueOf() !== "symbol") { - return false; - } - return symStringRegex.test(symToStr.call(value)); - }; - module2.exports = function isSymbol(value) { - if (typeof value === "symbol") { - return true; - } - if (toStr.call(value) !== "[object Symbol]") { - return false; - } - try { - return isSymbolObject(value); - } catch (e) { - return false; - } - }; - } else { - module2.exports = function isSymbol(value) { - return false; - }; - } - var symToStr; - var symStringRegex; - var isSymbolObject; - } -}); - -// node_modules/.pnpm/has-bigints@1.0.2/node_modules/has-bigints/index.js -var require_has_bigints = __commonJS({ - "node_modules/.pnpm/has-bigints@1.0.2/node_modules/has-bigints/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var $BigInt = typeof BigInt !== "undefined" && BigInt; - module2.exports = function hasNativeBigInts() { - return typeof $BigInt === "function" && typeof BigInt === "function" && typeof $BigInt(42) === "bigint" && typeof BigInt(42) === "bigint"; - }; - } -}); - -// node_modules/.pnpm/is-bigint@1.0.4/node_modules/is-bigint/index.js -var require_is_bigint = __commonJS({ - "node_modules/.pnpm/is-bigint@1.0.4/node_modules/is-bigint/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var hasBigInts = require_has_bigints()(); - if (hasBigInts) { - bigIntValueOf = BigInt.prototype.valueOf; - tryBigInt = function tryBigIntObject(value) { - try { - bigIntValueOf.call(value); - return true; - } catch (e) { - } - return false; - }; - module2.exports = function isBigInt(value) { - if (value === null || typeof value === "undefined" || typeof value === "boolean" || typeof value === "string" || typeof value === "number" || typeof value === "symbol" || typeof value === "function") { - return false; - } - if (typeof value === "bigint") { - return true; - } - return tryBigInt(value); - }; - } else { - module2.exports = function isBigInt(value) { - return false; - }; - } - var bigIntValueOf; - var tryBigInt; - } -}); - -// node_modules/.pnpm/which-boxed-primitive@1.0.2/node_modules/which-boxed-primitive/index.js -var require_which_boxed_primitive = __commonJS({ - "node_modules/.pnpm/which-boxed-primitive@1.0.2/node_modules/which-boxed-primitive/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var isString = require_is_string(); - var isNumber = require_is_number_object(); - var isBoolean = require_is_boolean_object(); - var isSymbol = require_is_symbol(); - var isBigInt = require_is_bigint(); - module2.exports = function whichBoxedPrimitive(value) { - if (value == null || typeof value !== "object" && typeof value !== "function") { - return null; - } - if (isString(value)) { - return "String"; - } - if (isNumber(value)) { - return "Number"; - } - if (isBoolean(value)) { - return "Boolean"; - } - if (isSymbol(value)) { - return "Symbol"; - } - if (isBigInt(value)) { - return "BigInt"; - } - }; - } -}); - -// node_modules/.pnpm/is-weakmap@2.0.1/node_modules/is-weakmap/index.js -var require_is_weakmap = __commonJS({ - "node_modules/.pnpm/is-weakmap@2.0.1/node_modules/is-weakmap/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var $WeakMap = typeof WeakMap === "function" && WeakMap.prototype ? WeakMap : null; - var $WeakSet = typeof WeakSet === "function" && WeakSet.prototype ? WeakSet : null; - var exported; - if (!$WeakMap) { - exported = function isWeakMap(x) { - return false; - }; - } - var $mapHas = $WeakMap ? $WeakMap.prototype.has : null; - var $setHas = $WeakSet ? $WeakSet.prototype.has : null; - if (!exported && !$mapHas) { - exported = function isWeakMap(x) { - return false; - }; - } - module2.exports = exported || function isWeakMap(x) { - if (!x || typeof x !== "object") { - return false; - } - try { - $mapHas.call(x, $mapHas); - if ($setHas) { - try { - $setHas.call(x, $setHas); - } catch (e) { - return true; - } - } - return x instanceof $WeakMap; - } catch (e) { - } - return false; - }; - } -}); - -// node_modules/.pnpm/is-weakset@2.0.2/node_modules/is-weakset/index.js -var require_is_weakset = __commonJS({ - "node_modules/.pnpm/is-weakset@2.0.2/node_modules/is-weakset/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var GetIntrinsic = require_get_intrinsic(); - var callBound = require_callBound(); - var $WeakSet = GetIntrinsic("%WeakSet%", true); - var $setHas = callBound("WeakSet.prototype.has", true); - if ($setHas) { - $mapHas = callBound("WeakMap.prototype.has", true); - module2.exports = function isWeakSet(x) { - if (!x || typeof x !== "object") { - return false; - } - try { - $setHas(x, $setHas); - if ($mapHas) { - try { - $mapHas(x, $mapHas); - } catch (e) { - return true; - } - } - return x instanceof $WeakSet; - } catch (e) { - } - return false; - }; - } else { - module2.exports = function isWeakSet(x) { - return false; - }; - } - var $mapHas; - } -}); - -// node_modules/.pnpm/which-collection@1.0.1/node_modules/which-collection/index.js -var require_which_collection = __commonJS({ - "node_modules/.pnpm/which-collection@1.0.1/node_modules/which-collection/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var isMap = require_is_map(); - var isSet = require_is_set(); - var isWeakMap = require_is_weakmap(); - var isWeakSet = require_is_weakset(); - module2.exports = function whichCollection(value) { - if (value && typeof value === "object") { - if (isMap(value)) { - return "Map"; - } - if (isSet(value)) { - return "Set"; - } - if (isWeakMap(value)) { - return "WeakMap"; - } - if (isWeakSet(value)) { - return "WeakSet"; - } - } - return false; - }; - } -}); - -// node_modules/.pnpm/array-buffer-byte-length@1.0.0/node_modules/array-buffer-byte-length/index.js -var require_array_buffer_byte_length = __commonJS({ - "node_modules/.pnpm/array-buffer-byte-length@1.0.0/node_modules/array-buffer-byte-length/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var callBound = require_callBound(); - var $byteLength = callBound("ArrayBuffer.prototype.byteLength", true); - var isArrayBuffer = require_is_array_buffer(); - module2.exports = function byteLength(ab) { - if (!isArrayBuffer(ab)) { - return NaN; - } - return $byteLength ? $byteLength(ab) : ab.byteLength; - }; - } -}); - -// node_modules/.pnpm/deep-equal@2.2.2/node_modules/deep-equal/index.js -var require_deep_equal = __commonJS({ - "node_modules/.pnpm/deep-equal@2.2.2/node_modules/deep-equal/index.js"(exports2, module2) { - "use strict"; - init_polyfill_buffer(); - var assign2 = require_object(); - var callBound = require_callBound(); - var flags = require_regexp_prototype(); - var GetIntrinsic = require_get_intrinsic(); - var getIterator3 = require_es_get_iterator(); - var getSideChannel = require_side_channel(); - var is = require_object_is(); - var isArguments = require_is_arguments(); - var isArray = require_isarray(); - var isArrayBuffer = require_is_array_buffer(); - var isDate = require_is_date_object(); - var isRegex = require_is_regex(); - var isSharedArrayBuffer = require_is_shared_array_buffer(); - var objectKeys = require_object_keys(); - var whichBoxedPrimitive = require_which_boxed_primitive(); - var whichCollection = require_which_collection(); - var whichTypedArray = require_which_typed_array(); - var byteLength = require_array_buffer_byte_length(); - var sabByteLength = callBound("SharedArrayBuffer.prototype.byteLength", true); - var $getTime = callBound("Date.prototype.getTime"); - var gPO = Object.getPrototypeOf; - var $objToString = callBound("Object.prototype.toString"); - var $Set = GetIntrinsic("%Set%", true); - var $mapHas = callBound("Map.prototype.has", true); - var $mapGet = callBound("Map.prototype.get", true); - var $mapSize = callBound("Map.prototype.size", true); - var $setAdd = callBound("Set.prototype.add", true); - var $setDelete = callBound("Set.prototype.delete", true); - var $setHas = callBound("Set.prototype.has", true); - var $setSize = callBound("Set.prototype.size", true); - function setHasEqualElement(set, val1, opts, channel) { - var i = getIterator3(set); - var result; - while ((result = i.next()) && !result.done) { - if (internalDeepEqual(val1, result.value, opts, channel)) { - $setDelete(set, result.value); - return true; - } - } - return false; - } - function findLooseMatchingPrimitives(prim) { - if (typeof prim === "undefined") { - return null; - } - if (typeof prim === "object") { - return void 0; - } - if (typeof prim === "symbol") { - return false; - } - if (typeof prim === "string" || typeof prim === "number") { - return +prim === +prim; - } - return true; - } - function mapMightHaveLoosePrim(a, b, prim, item, opts, channel) { - var altValue = findLooseMatchingPrimitives(prim); - if (altValue != null) { - return altValue; - } - var curB = $mapGet(b, altValue); - var looseOpts = assign2({}, opts, { strict: false }); - if (typeof curB === "undefined" && !$mapHas(b, altValue) || !internalDeepEqual(item, curB, looseOpts, channel)) { - return false; - } - return !$mapHas(a, altValue) && internalDeepEqual(item, curB, looseOpts, channel); - } - function setMightHaveLoosePrim(a, b, prim) { - var altValue = findLooseMatchingPrimitives(prim); - if (altValue != null) { - return altValue; - } - return $setHas(b, altValue) && !$setHas(a, altValue); - } - function mapHasEqualEntry(set, map, key1, item1, opts, channel) { - var i = getIterator3(set); - var result; - var key2; - while ((result = i.next()) && !result.done) { - key2 = result.value; - if ( - // eslint-disable-next-line no-use-before-define - internalDeepEqual(key1, key2, opts, channel) && internalDeepEqual(item1, $mapGet(map, key2), opts, channel) - ) { - $setDelete(set, key2); - return true; - } - } - return false; - } - function internalDeepEqual(actual, expected, options, channel) { - var opts = options || {}; - if (opts.strict ? is(actual, expected) : actual === expected) { - return true; - } - var actualBoxed = whichBoxedPrimitive(actual); - var expectedBoxed = whichBoxedPrimitive(expected); - if (actualBoxed !== expectedBoxed) { - return false; - } - if (!actual || !expected || typeof actual !== "object" && typeof expected !== "object") { - return opts.strict ? is(actual, expected) : actual == expected; - } - var hasActual = channel.has(actual); - var hasExpected = channel.has(expected); - var sentinel; - if (hasActual && hasExpected) { - if (channel.get(actual) === channel.get(expected)) { - return true; - } - } else { - sentinel = {}; - } - if (!hasActual) { - channel.set(actual, sentinel); - } - if (!hasExpected) { - channel.set(expected, sentinel); - } - return objEquiv(actual, expected, opts, channel); - } - function isBuffer(x) { - if (!x || typeof x !== "object" || typeof x.length !== "number") { - return false; - } - if (typeof x.copy !== "function" || typeof x.slice !== "function") { - return false; - } - if (x.length > 0 && typeof x[0] !== "number") { - return false; - } - return !!(x.constructor && x.constructor.isBuffer && x.constructor.isBuffer(x)); - } - function setEquiv(a, b, opts, channel) { - if ($setSize(a) !== $setSize(b)) { - return false; - } - var iA = getIterator3(a); - var iB = getIterator3(b); - var resultA; - var resultB; - var set; - while ((resultA = iA.next()) && !resultA.done) { - if (resultA.value && typeof resultA.value === "object") { - if (!set) { - set = new $Set(); - } - $setAdd(set, resultA.value); - } else if (!$setHas(b, resultA.value)) { - if (opts.strict) { - return false; - } - if (!setMightHaveLoosePrim(a, b, resultA.value)) { - return false; - } - if (!set) { - set = new $Set(); - } - $setAdd(set, resultA.value); - } - } - if (set) { - while ((resultB = iB.next()) && !resultB.done) { - if (resultB.value && typeof resultB.value === "object") { - if (!setHasEqualElement(set, resultB.value, opts.strict, channel)) { - return false; - } - } else if (!opts.strict && !$setHas(a, resultB.value) && !setHasEqualElement(set, resultB.value, opts.strict, channel)) { - return false; - } - } - return $setSize(set) === 0; - } - return true; - } - function mapEquiv(a, b, opts, channel) { - if ($mapSize(a) !== $mapSize(b)) { - return false; - } - var iA = getIterator3(a); - var iB = getIterator3(b); - var resultA; - var resultB; - var set; - var key2; - var item1; - var item2; - while ((resultA = iA.next()) && !resultA.done) { - key2 = resultA.value[0]; - item1 = resultA.value[1]; - if (key2 && typeof key2 === "object") { - if (!set) { - set = new $Set(); - } - $setAdd(set, key2); - } else { - item2 = $mapGet(b, key2); - if (typeof item2 === "undefined" && !$mapHas(b, key2) || !internalDeepEqual(item1, item2, opts, channel)) { - if (opts.strict) { - return false; - } - if (!mapMightHaveLoosePrim(a, b, key2, item1, opts, channel)) { - return false; - } - if (!set) { - set = new $Set(); - } - $setAdd(set, key2); - } - } - } - if (set) { - while ((resultB = iB.next()) && !resultB.done) { - key2 = resultB.value[0]; - item2 = resultB.value[1]; - if (key2 && typeof key2 === "object") { - if (!mapHasEqualEntry(set, a, key2, item2, opts, channel)) { - return false; - } - } else if (!opts.strict && (!a.has(key2) || !internalDeepEqual($mapGet(a, key2), item2, opts, channel)) && !mapHasEqualEntry(set, a, key2, item2, assign2({}, opts, { strict: false }), channel)) { - return false; - } - } - return $setSize(set) === 0; - } - return true; - } - function objEquiv(a, b, opts, channel) { - var i, key2; - if (typeof a !== typeof b) { - return false; - } - if (a == null || b == null) { - return false; - } - if ($objToString(a) !== $objToString(b)) { - return false; - } - if (isArguments(a) !== isArguments(b)) { - return false; - } - var aIsArray = isArray(a); - var bIsArray = isArray(b); - if (aIsArray !== bIsArray) { - return false; - } - var aIsError = a instanceof Error; - var bIsError = b instanceof Error; - if (aIsError !== bIsError) { - return false; - } - if (aIsError || bIsError) { - if (a.name !== b.name || a.message !== b.message) { - return false; - } - } - var aIsRegex = isRegex(a); - var bIsRegex = isRegex(b); - if (aIsRegex !== bIsRegex) { - return false; - } - if ((aIsRegex || bIsRegex) && (a.source !== b.source || flags(a) !== flags(b))) { - return false; - } - var aIsDate = isDate(a); - var bIsDate = isDate(b); - if (aIsDate !== bIsDate) { - return false; - } - if (aIsDate || bIsDate) { - if ($getTime(a) !== $getTime(b)) { - return false; - } - } - if (opts.strict && gPO && gPO(a) !== gPO(b)) { - return false; - } - var aWhich = whichTypedArray(a); - var bWhich = whichTypedArray(b); - if (aWhich !== bWhich) { - return false; - } - if (aWhich || bWhich) { - if (a.length !== b.length) { - return false; - } - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) { - return false; - } - } - return true; - } - var aIsBuffer = isBuffer(a); - var bIsBuffer = isBuffer(b); - if (aIsBuffer !== bIsBuffer) { - return false; - } - if (aIsBuffer || bIsBuffer) { - if (a.length !== b.length) { - return false; - } - for (i = 0; i < a.length; i++) { - if (a[i] !== b[i]) { - return false; - } - } - return true; - } - var aIsArrayBuffer = isArrayBuffer(a); - var bIsArrayBuffer = isArrayBuffer(b); - if (aIsArrayBuffer !== bIsArrayBuffer) { - return false; - } - if (aIsArrayBuffer || bIsArrayBuffer) { - if (byteLength(a) !== byteLength(b)) { - return false; - } - return typeof Uint8Array === "function" && internalDeepEqual(new Uint8Array(a), new Uint8Array(b), opts, channel); - } - var aIsSAB = isSharedArrayBuffer(a); - var bIsSAB = isSharedArrayBuffer(b); - if (aIsSAB !== bIsSAB) { - return false; - } - if (aIsSAB || bIsSAB) { - if (sabByteLength(a) !== sabByteLength(b)) { - return false; - } - return typeof Uint8Array === "function" && internalDeepEqual(new Uint8Array(a), new Uint8Array(b), opts, channel); - } - if (typeof a !== typeof b) { - return false; - } - var ka = objectKeys(a); - var kb = objectKeys(b); - if (ka.length !== kb.length) { - return false; - } - ka.sort(); - kb.sort(); - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] != kb[i]) { - return false; - } - } - for (i = ka.length - 1; i >= 0; i--) { - key2 = ka[i]; - if (!internalDeepEqual(a[key2], b[key2], opts, channel)) { - return false; - } - } - var aCollection = whichCollection(a); - var bCollection = whichCollection(b); - if (aCollection !== bCollection) { - return false; - } - if (aCollection === "Set" || bCollection === "Set") { - return setEquiv(a, b, opts, channel); - } - if (aCollection === "Map") { - return mapEquiv(a, b, opts, channel); - } - return true; - } - module2.exports = function deepEqual2(a, b, opts) { - return internalDeepEqual(a, b, opts, getSideChannel()); - }; - } -}); - -// node_modules/.pnpm/js-sha256@0.9.0/node_modules/js-sha256/src/sha256.js -var require_sha256 = __commonJS({ - "node_modules/.pnpm/js-sha256@0.9.0/node_modules/js-sha256/src/sha256.js"(exports, module) { - init_polyfill_buffer(); - (function() { - "use strict"; - var ERROR = "input is invalid type"; - var WINDOW = typeof window === "object"; - var root = WINDOW ? window : {}; - if (root.JS_SHA256_NO_WINDOW) { - WINDOW = false; - } - var WEB_WORKER = !WINDOW && typeof self === "object"; - var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === "object" && process.versions && process.versions.node; - if (NODE_JS) { - root = global; - } else if (WEB_WORKER) { - root = self; - } - var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && typeof module === "object" && module.exports; - var AMD = typeof define === "function" && define.amd; - var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== "undefined"; - var HEX_CHARS = "0123456789abcdef".split(""); - var EXTRA = [-2147483648, 8388608, 32768, 128]; - var SHIFT = [24, 16, 8, 0]; - var K = [ - 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 - ]; - var OUTPUT_TYPES = ["hex", "array", "digest", "arrayBuffer"]; - var blocks = []; - if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) { - Array.isArray = function(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - } - if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) { - ArrayBuffer.isView = function(obj) { - return typeof obj === "object" && obj.buffer && obj.buffer.constructor === ArrayBuffer; - }; - } - var createOutputMethod = function(outputType, is2242) { - return function(message) { - return new Sha256(is2242, true).update(message)[outputType](); - }; - }; - var createMethod = function(is2242) { - var method2 = createOutputMethod("hex", is2242); - if (NODE_JS) { - method2 = nodeWrap(method2, is2242); - } - method2.create = function() { - return new Sha256(is2242); - }; - method2.update = function(message) { - return method2.create().update(message); - }; - for (var i = 0; i < OUTPUT_TYPES.length; ++i) { - var type = OUTPUT_TYPES[i]; - method2[type] = createOutputMethod(type, is2242); - } - return method2; - }; - var nodeWrap = function(method, is224) { - var crypto = eval("require('crypto')"); - var Buffer = eval("require('buffer').Buffer"); - var algorithm = is224 ? "sha224" : "sha256"; - var nodeMethod = function(message) { - if (typeof message === "string") { - return crypto.createHash(algorithm).update(message, "utf8").digest("hex"); - } else { - if (message === null || message === void 0) { - throw new Error(ERROR); - } else if (message.constructor === ArrayBuffer) { - message = new Uint8Array(message); - } - } - if (Array.isArray(message) || ArrayBuffer.isView(message) || message.constructor === Buffer) { - return crypto.createHash(algorithm).update(new Buffer(message)).digest("hex"); - } else { - return method(message); - } - }; - return nodeMethod; - }; - var createHmacOutputMethod = function(outputType, is2242) { - return function(key2, message) { - return new HmacSha256(key2, is2242, true).update(message)[outputType](); - }; - }; - var createHmacMethod = function(is2242) { - var method2 = createHmacOutputMethod("hex", is2242); - method2.create = function(key2) { - return new HmacSha256(key2, is2242); - }; - method2.update = function(key2, message) { - return method2.create(key2).update(message); - }; - for (var i = 0; i < OUTPUT_TYPES.length; ++i) { - var type = OUTPUT_TYPES[i]; - method2[type] = createHmacOutputMethod(type, is2242); - } - return method2; - }; - function Sha256(is2242, sharedMemory) { - if (sharedMemory) { - blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; - this.blocks = blocks; - } else { - this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - } - if (is2242) { - this.h0 = 3238371032; - this.h1 = 914150663; - this.h2 = 812702999; - this.h3 = 4144912697; - this.h4 = 4290775857; - this.h5 = 1750603025; - this.h6 = 1694076839; - this.h7 = 3204075428; - } else { - this.h0 = 1779033703; - this.h1 = 3144134277; - this.h2 = 1013904242; - this.h3 = 2773480762; - this.h4 = 1359893119; - this.h5 = 2600822924; - this.h6 = 528734635; - this.h7 = 1541459225; - } - this.block = this.start = this.bytes = this.hBytes = 0; - this.finalized = this.hashed = false; - this.first = true; - this.is224 = is2242; - } - Sha256.prototype.update = function(message) { - if (this.finalized) { - return; - } - var notString, type = typeof message; - if (type !== "string") { - if (type === "object") { - if (message === null) { - throw new Error(ERROR); - } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) { - message = new Uint8Array(message); - } else if (!Array.isArray(message)) { - if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) { - throw new Error(ERROR); - } - } - } else { - throw new Error(ERROR); - } - notString = true; - } - var code, index2 = 0, i, length = message.length, blocks2 = this.blocks; - while (index2 < length) { - if (this.hashed) { - this.hashed = false; - blocks2[0] = this.block; - blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0; - } - if (notString) { - for (i = this.start; index2 < length && i < 64; ++index2) { - blocks2[i >> 2] |= message[index2] << SHIFT[i++ & 3]; - } - } else { - for (i = this.start; index2 < length && i < 64; ++index2) { - code = message.charCodeAt(index2); - if (code < 128) { - blocks2[i >> 2] |= code << SHIFT[i++ & 3]; - } else if (code < 2048) { - blocks2[i >> 2] |= (192 | code >> 6) << SHIFT[i++ & 3]; - blocks2[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3]; - } else if (code < 55296 || code >= 57344) { - blocks2[i >> 2] |= (224 | code >> 12) << SHIFT[i++ & 3]; - blocks2[i >> 2] |= (128 | code >> 6 & 63) << SHIFT[i++ & 3]; - blocks2[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3]; - } else { - code = 65536 + ((code & 1023) << 10 | message.charCodeAt(++index2) & 1023); - blocks2[i >> 2] |= (240 | code >> 18) << SHIFT[i++ & 3]; - blocks2[i >> 2] |= (128 | code >> 12 & 63) << SHIFT[i++ & 3]; - blocks2[i >> 2] |= (128 | code >> 6 & 63) << SHIFT[i++ & 3]; - blocks2[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3]; - } - } - } - this.lastByteIndex = i; - this.bytes += i - this.start; - if (i >= 64) { - this.block = blocks2[16]; - this.start = i - 64; - this.hash(); - this.hashed = true; - } else { - this.start = i; - } - } - if (this.bytes > 4294967295) { - this.hBytes += this.bytes / 4294967296 << 0; - this.bytes = this.bytes % 4294967296; - } - return this; - }; - Sha256.prototype.finalize = function() { - if (this.finalized) { - return; - } - this.finalized = true; - var blocks2 = this.blocks, i = this.lastByteIndex; - blocks2[16] = this.block; - blocks2[i >> 2] |= EXTRA[i & 3]; - this.block = blocks2[16]; - if (i >= 56) { - if (!this.hashed) { - this.hash(); - } - blocks2[0] = this.block; - blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0; - } - blocks2[14] = this.hBytes << 3 | this.bytes >>> 29; - blocks2[15] = this.bytes << 3; - this.hash(); - }; - Sha256.prototype.hash = function() { - var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4, f = this.h5, g = this.h6, h = this.h7, blocks2 = this.blocks, j, s0, s1, maj, t1, t2, ch, ab, da, cd, bc; - for (j = 16; j < 64; ++j) { - t1 = blocks2[j - 15]; - s0 = (t1 >>> 7 | t1 << 25) ^ (t1 >>> 18 | t1 << 14) ^ t1 >>> 3; - t1 = blocks2[j - 2]; - s1 = (t1 >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10; - blocks2[j] = blocks2[j - 16] + s0 + blocks2[j - 7] + s1 << 0; - } - bc = b & c; - for (j = 0; j < 64; j += 4) { - if (this.first) { - if (this.is224) { - ab = 300032; - t1 = blocks2[0] - 1413257819; - h = t1 - 150054599 << 0; - d = t1 + 24177077 << 0; - } else { - ab = 704751109; - t1 = blocks2[0] - 210244248; - h = t1 - 1521486534 << 0; - d = t1 + 143694565 << 0; - } - this.first = false; - } else { - s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10); - s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7); - ab = a & b; - maj = ab ^ a & c ^ bc; - ch = e & f ^ ~e & g; - t1 = h + s1 + ch + K[j] + blocks2[j]; - t2 = s0 + maj; - h = d + t1 << 0; - d = t1 + t2 << 0; - } - s0 = (d >>> 2 | d << 30) ^ (d >>> 13 | d << 19) ^ (d >>> 22 | d << 10); - s1 = (h >>> 6 | h << 26) ^ (h >>> 11 | h << 21) ^ (h >>> 25 | h << 7); - da = d & a; - maj = da ^ d & b ^ ab; - ch = h & e ^ ~h & f; - t1 = g + s1 + ch + K[j + 1] + blocks2[j + 1]; - t2 = s0 + maj; - g = c + t1 << 0; - c = t1 + t2 << 0; - s0 = (c >>> 2 | c << 30) ^ (c >>> 13 | c << 19) ^ (c >>> 22 | c << 10); - s1 = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7); - cd = c & d; - maj = cd ^ c & a ^ da; - ch = g & h ^ ~g & e; - t1 = f + s1 + ch + K[j + 2] + blocks2[j + 2]; - t2 = s0 + maj; - f = b + t1 << 0; - b = t1 + t2 << 0; - s0 = (b >>> 2 | b << 30) ^ (b >>> 13 | b << 19) ^ (b >>> 22 | b << 10); - s1 = (f >>> 6 | f << 26) ^ (f >>> 11 | f << 21) ^ (f >>> 25 | f << 7); - bc = b & c; - maj = bc ^ b & d ^ cd; - ch = f & g ^ ~f & h; - t1 = e + s1 + ch + K[j + 3] + blocks2[j + 3]; - t2 = s0 + maj; - e = a + t1 << 0; - a = t1 + t2 << 0; - } - this.h0 = this.h0 + a << 0; - this.h1 = this.h1 + b << 0; - this.h2 = this.h2 + c << 0; - this.h3 = this.h3 + d << 0; - this.h4 = this.h4 + e << 0; - this.h5 = this.h5 + f << 0; - this.h6 = this.h6 + g << 0; - this.h7 = this.h7 + h << 0; - }; - Sha256.prototype.hex = function() { - this.finalize(); - var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7; - var hex = HEX_CHARS[h0 >> 28 & 15] + HEX_CHARS[h0 >> 24 & 15] + HEX_CHARS[h0 >> 20 & 15] + HEX_CHARS[h0 >> 16 & 15] + HEX_CHARS[h0 >> 12 & 15] + HEX_CHARS[h0 >> 8 & 15] + HEX_CHARS[h0 >> 4 & 15] + HEX_CHARS[h0 & 15] + HEX_CHARS[h1 >> 28 & 15] + HEX_CHARS[h1 >> 24 & 15] + HEX_CHARS[h1 >> 20 & 15] + HEX_CHARS[h1 >> 16 & 15] + HEX_CHARS[h1 >> 12 & 15] + HEX_CHARS[h1 >> 8 & 15] + HEX_CHARS[h1 >> 4 & 15] + HEX_CHARS[h1 & 15] + HEX_CHARS[h2 >> 28 & 15] + HEX_CHARS[h2 >> 24 & 15] + HEX_CHARS[h2 >> 20 & 15] + HEX_CHARS[h2 >> 16 & 15] + HEX_CHARS[h2 >> 12 & 15] + HEX_CHARS[h2 >> 8 & 15] + HEX_CHARS[h2 >> 4 & 15] + HEX_CHARS[h2 & 15] + HEX_CHARS[h3 >> 28 & 15] + HEX_CHARS[h3 >> 24 & 15] + HEX_CHARS[h3 >> 20 & 15] + HEX_CHARS[h3 >> 16 & 15] + HEX_CHARS[h3 >> 12 & 15] + HEX_CHARS[h3 >> 8 & 15] + HEX_CHARS[h3 >> 4 & 15] + HEX_CHARS[h3 & 15] + HEX_CHARS[h4 >> 28 & 15] + HEX_CHARS[h4 >> 24 & 15] + HEX_CHARS[h4 >> 20 & 15] + HEX_CHARS[h4 >> 16 & 15] + HEX_CHARS[h4 >> 12 & 15] + HEX_CHARS[h4 >> 8 & 15] + HEX_CHARS[h4 >> 4 & 15] + HEX_CHARS[h4 & 15] + HEX_CHARS[h5 >> 28 & 15] + HEX_CHARS[h5 >> 24 & 15] + HEX_CHARS[h5 >> 20 & 15] + HEX_CHARS[h5 >> 16 & 15] + HEX_CHARS[h5 >> 12 & 15] + HEX_CHARS[h5 >> 8 & 15] + HEX_CHARS[h5 >> 4 & 15] + HEX_CHARS[h5 & 15] + HEX_CHARS[h6 >> 28 & 15] + HEX_CHARS[h6 >> 24 & 15] + HEX_CHARS[h6 >> 20 & 15] + HEX_CHARS[h6 >> 16 & 15] + HEX_CHARS[h6 >> 12 & 15] + HEX_CHARS[h6 >> 8 & 15] + HEX_CHARS[h6 >> 4 & 15] + HEX_CHARS[h6 & 15]; - if (!this.is224) { - hex += HEX_CHARS[h7 >> 28 & 15] + HEX_CHARS[h7 >> 24 & 15] + HEX_CHARS[h7 >> 20 & 15] + HEX_CHARS[h7 >> 16 & 15] + HEX_CHARS[h7 >> 12 & 15] + HEX_CHARS[h7 >> 8 & 15] + HEX_CHARS[h7 >> 4 & 15] + HEX_CHARS[h7 & 15]; - } - return hex; - }; - Sha256.prototype.toString = Sha256.prototype.hex; - Sha256.prototype.digest = function() { - this.finalize(); - var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7; - var arr = [ - h0 >> 24 & 255, - h0 >> 16 & 255, - h0 >> 8 & 255, - h0 & 255, - h1 >> 24 & 255, - h1 >> 16 & 255, - h1 >> 8 & 255, - h1 & 255, - h2 >> 24 & 255, - h2 >> 16 & 255, - h2 >> 8 & 255, - h2 & 255, - h3 >> 24 & 255, - h3 >> 16 & 255, - h3 >> 8 & 255, - h3 & 255, - h4 >> 24 & 255, - h4 >> 16 & 255, - h4 >> 8 & 255, - h4 & 255, - h5 >> 24 & 255, - h5 >> 16 & 255, - h5 >> 8 & 255, - h5 & 255, - h6 >> 24 & 255, - h6 >> 16 & 255, - h6 >> 8 & 255, - h6 & 255 - ]; - if (!this.is224) { - arr.push(h7 >> 24 & 255, h7 >> 16 & 255, h7 >> 8 & 255, h7 & 255); - } - return arr; - }; - Sha256.prototype.array = Sha256.prototype.digest; - Sha256.prototype.arrayBuffer = function() { - this.finalize(); - var buffer2 = new ArrayBuffer(this.is224 ? 28 : 32); - var dataView = new DataView(buffer2); - dataView.setUint32(0, this.h0); - dataView.setUint32(4, this.h1); - dataView.setUint32(8, this.h2); - dataView.setUint32(12, this.h3); - dataView.setUint32(16, this.h4); - dataView.setUint32(20, this.h5); - dataView.setUint32(24, this.h6); - if (!this.is224) { - dataView.setUint32(28, this.h7); - } - return buffer2; - }; - function HmacSha256(key2, is2242, sharedMemory) { - var i, type = typeof key2; - if (type === "string") { - var bytes = [], length = key2.length, index2 = 0, code; - for (i = 0; i < length; ++i) { - code = key2.charCodeAt(i); - if (code < 128) { - bytes[index2++] = code; - } else if (code < 2048) { - bytes[index2++] = 192 | code >> 6; - bytes[index2++] = 128 | code & 63; - } else if (code < 55296 || code >= 57344) { - bytes[index2++] = 224 | code >> 12; - bytes[index2++] = 128 | code >> 6 & 63; - bytes[index2++] = 128 | code & 63; - } else { - code = 65536 + ((code & 1023) << 10 | key2.charCodeAt(++i) & 1023); - bytes[index2++] = 240 | code >> 18; - bytes[index2++] = 128 | code >> 12 & 63; - bytes[index2++] = 128 | code >> 6 & 63; - bytes[index2++] = 128 | code & 63; - } - } - key2 = bytes; - } else { - if (type === "object") { - if (key2 === null) { - throw new Error(ERROR); - } else if (ARRAY_BUFFER && key2.constructor === ArrayBuffer) { - key2 = new Uint8Array(key2); - } else if (!Array.isArray(key2)) { - if (!ARRAY_BUFFER || !ArrayBuffer.isView(key2)) { - throw new Error(ERROR); - } - } - } else { - throw new Error(ERROR); - } - } - if (key2.length > 64) { - key2 = new Sha256(is2242, true).update(key2).array(); - } - var oKeyPad = [], iKeyPad = []; - for (i = 0; i < 64; ++i) { - var b = key2[i] || 0; - oKeyPad[i] = 92 ^ b; - iKeyPad[i] = 54 ^ b; - } - Sha256.call(this, is2242, sharedMemory); - this.update(iKeyPad); - this.oKeyPad = oKeyPad; - this.inner = true; - this.sharedMemory = sharedMemory; - } - HmacSha256.prototype = new Sha256(); - HmacSha256.prototype.finalize = function() { - Sha256.prototype.finalize.call(this); - if (this.inner) { - this.inner = false; - var innerHash = this.array(); - Sha256.call(this, this.is224, this.sharedMemory); - this.update(this.oKeyPad); - this.update(innerHash); - Sha256.prototype.finalize.call(this); - } - }; - var exports = createMethod(); - exports.sha256 = exports; - exports.sha224 = createMethod(true); - exports.sha256.hmac = createHmacMethod(); - exports.sha224.hmac = createHmacMethod(true); - if (COMMON_JS) { - module.exports = exports; - } else { - root.sha256 = exports.sha256; - root.sha224 = exports.sha224; - if (AMD) { - define(function() { - return exports; - }); - } - } - })(); - } -}); - -// node_modules/.pnpm/hogan.js@3.0.2/node_modules/hogan.js/lib/compiler.js -var require_compiler = __commonJS({ - "node_modules/.pnpm/hogan.js@3.0.2/node_modules/hogan.js/lib/compiler.js"(exports2) { - init_polyfill_buffer(); - (function(Hogan4) { - var rIsWhitespace = /\S/, rQuot = /\"/g, rNewline = /\n/g, rCr = /\r/g, rSlash = /\\/g, rLineSep = /\u2028/, rParagraphSep = /\u2029/; - Hogan4.tags = { - "#": 1, - "^": 2, - "<": 3, - "$": 4, - "/": 5, - "!": 6, - ">": 7, - "=": 8, - "_v": 9, - "{": 10, - "&": 11, - "_t": 12 - }; - Hogan4.scan = function scan(text2, delimiters) { - var len = text2.length, IN_TEXT = 0, IN_TAG_TYPE = 1, IN_TAG = 2, state = IN_TEXT, tagType = null, tag2 = null, buf = "", tokens = [], seenTag = false, i = 0, lineStart = 0, otag = "{{", ctag = "}}"; - function addBuf() { - if (buf.length > 0) { - tokens.push({ tag: "_t", text: new String(buf) }); - buf = ""; - } - } - function lineIsWhitespace() { - var isAllWhitespace = true; - for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = Hogan4.tags[tokens[j].tag] < Hogan4.tags["_v"] || tokens[j].tag == "_t" && tokens[j].text.match(rIsWhitespace) === null; - if (!isAllWhitespace) { - return false; - } - } - return isAllWhitespace; - } - function filterLine(haveSeenTag, noNewLine) { - addBuf(); - if (haveSeenTag && lineIsWhitespace()) { - for (var j = lineStart, next; j < tokens.length; j++) { - if (tokens[j].text) { - if ((next = tokens[j + 1]) && next.tag == ">") { - next.indent = tokens[j].text.toString(); - } - tokens.splice(j, 1); - } - } - } else if (!noNewLine) { - tokens.push({ tag: "\n" }); - } - seenTag = false; - lineStart = tokens.length; - } - function changeDelimiters(text3, index2) { - var close = "=" + ctag, closeIndex = text3.indexOf(close, index2), delimiters2 = trim( - text3.substring(text3.indexOf("=", index2) + 1, closeIndex) - ).split(" "); - otag = delimiters2[0]; - ctag = delimiters2[delimiters2.length - 1]; - return closeIndex + close.length - 1; - } - if (delimiters) { - delimiters = delimiters.split(" "); - otag = delimiters[0]; - ctag = delimiters[1]; - } - for (i = 0; i < len; i++) { - if (state == IN_TEXT) { - if (tagChange(otag, text2, i)) { - --i; - addBuf(); - state = IN_TAG_TYPE; - } else { - if (text2.charAt(i) == "\n") { - filterLine(seenTag); - } else { - buf += text2.charAt(i); - } - } - } else if (state == IN_TAG_TYPE) { - i += otag.length - 1; - tag2 = Hogan4.tags[text2.charAt(i + 1)]; - tagType = tag2 ? text2.charAt(i + 1) : "_v"; - if (tagType == "=") { - i = changeDelimiters(text2, i); - state = IN_TEXT; - } else { - if (tag2) { - i++; - } - state = IN_TAG; - } - seenTag = i; - } else { - if (tagChange(ctag, text2, i)) { - tokens.push({ - tag: tagType, - n: trim(buf), - otag, - ctag, - i: tagType == "/" ? seenTag - otag.length : i + ctag.length - }); - buf = ""; - i += ctag.length - 1; - state = IN_TEXT; - if (tagType == "{") { - if (ctag == "}}") { - i++; - } else { - cleanTripleStache(tokens[tokens.length - 1]); - } - } - } else { - buf += text2.charAt(i); - } - } - } - filterLine(seenTag, true); - return tokens; - }; - function cleanTripleStache(token) { - if (token.n.substr(token.n.length - 1) === "}") { - token.n = token.n.substring(0, token.n.length - 1); - } - } - function trim(s) { - if (s.trim) { - return s.trim(); - } - return s.replace(/^\s*|\s*$/g, ""); - } - function tagChange(tag2, text2, index2) { - if (text2.charAt(index2) != tag2.charAt(0)) { - return false; - } - for (var i = 1, l = tag2.length; i < l; i++) { - if (text2.charAt(index2 + i) != tag2.charAt(i)) { - return false; - } - } - return true; - } - var allowedInSuper = { "_t": true, "\n": true, "$": true, "/": true }; - function buildTree(tokens, kind, stack, customTags) { - var instructions = [], opener = null, tail = null, token = null; - tail = stack[stack.length - 1]; - while (tokens.length > 0) { - token = tokens.shift(); - if (tail && tail.tag == "<" && !(token.tag in allowedInSuper)) { - throw new Error("Illegal content in < super tag."); - } - if (Hogan4.tags[token.tag] <= Hogan4.tags["$"] || isOpener(token, customTags)) { - stack.push(token); - token.nodes = buildTree(tokens, token.tag, stack, customTags); - } else if (token.tag == "/") { - if (stack.length === 0) { - throw new Error("Closing tag without opener: /" + token.n); - } - opener = stack.pop(); - if (token.n != opener.n && !isCloser(token.n, opener.n, customTags)) { - throw new Error("Nesting error: " + opener.n + " vs. " + token.n); - } - opener.end = token.i; - return instructions; - } else if (token.tag == "\n") { - token.last = tokens.length == 0 || tokens[0].tag == "\n"; - } - instructions.push(token); - } - if (stack.length > 0) { - throw new Error("missing closing tag: " + stack.pop().n); - } - return instructions; - } - function isOpener(token, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].o == token.n) { - token.tag = "#"; - return true; - } - } - } - function isCloser(close, open, tags) { - for (var i = 0, l = tags.length; i < l; i++) { - if (tags[i].c == close && tags[i].o == open) { - return true; - } - } - } - function stringifySubstitutions(obj) { - var items = []; - for (var key2 in obj) { - items.push('"' + esc(key2) + '": function(c,p,t,i) {' + obj[key2] + "}"); - } - return "{ " + items.join(",") + " }"; - } - function stringifyPartials(codeObj) { - var partials = []; - for (var key2 in codeObj.partials) { - partials.push('"' + esc(key2) + '":{name:"' + esc(codeObj.partials[key2].name) + '", ' + stringifyPartials(codeObj.partials[key2]) + "}"); - } - return "partials: {" + partials.join(",") + "}, subs: " + stringifySubstitutions(codeObj.subs); - } - Hogan4.stringify = function(codeObj, text2, options) { - return "{code: function (c,p,i) { " + Hogan4.wrapMain(codeObj.code) + " }," + stringifyPartials(codeObj) + "}"; - }; - var serialNo = 0; - Hogan4.generate = function(tree, text2, options) { - serialNo = 0; - var context = { code: "", subs: {}, partials: {} }; - Hogan4.walk(tree, context); - if (options.asString) { - return this.stringify(context, text2, options); - } - return this.makeTemplate(context, text2, options); - }; - Hogan4.wrapMain = function(code) { - return 'var t=this;t.b(i=i||"");' + code + "return t.fl();"; - }; - Hogan4.template = Hogan4.Template; - Hogan4.makeTemplate = function(codeObj, text2, options) { - var template = this.makePartials(codeObj); - template.code = new Function("c", "p", "i", this.wrapMain(codeObj.code)); - return new this.template(template, text2, this, options); - }; - Hogan4.makePartials = function(codeObj) { - var key2, template = { subs: {}, partials: codeObj.partials, name: codeObj.name }; - for (key2 in template.partials) { - template.partials[key2] = this.makePartials(template.partials[key2]); - } - for (key2 in codeObj.subs) { - template.subs[key2] = new Function("c", "p", "t", "i", codeObj.subs[key2]); - } - return template; - }; - function esc(s) { - return s.replace(rSlash, "\\\\").replace(rQuot, '\\"').replace(rNewline, "\\n").replace(rCr, "\\r").replace(rLineSep, "\\u2028").replace(rParagraphSep, "\\u2029"); - } - function chooseMethod(s) { - return ~s.indexOf(".") ? "d" : "f"; - } - function createPartial(node, context) { - var prefix = "<" + (context.prefix || ""); - var sym = prefix + node.n + serialNo++; - context.partials[sym] = { name: node.n, partials: {} }; - context.code += 't.b(t.rp("' + esc(sym) + '",c,p,"' + (node.indent || "") + '"));'; - return sym; - } - Hogan4.codegen = { - "#": function(node, context) { - context.code += "if(t.s(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,0,' + node.i + "," + node.end + ',"' + node.otag + " " + node.ctag + '")){t.rs(c,p,function(c,p,t){'; - Hogan4.walk(node.nodes, context); - context.code += "});c.pop();}"; - }, - "^": function(node, context) { - context.code += "if(!t.s(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,1,0,0,"")){'; - Hogan4.walk(node.nodes, context); - context.code += "};"; - }, - ">": createPartial, - "<": function(node, context) { - var ctx = { partials: {}, code: "", subs: {}, inPartial: true }; - Hogan4.walk(node.nodes, ctx); - var template = context.partials[createPartial(node, context)]; - template.subs = ctx.subs; - template.partials = ctx.partials; - }, - "$": function(node, context) { - var ctx = { subs: {}, code: "", partials: context.partials, prefix: node.n }; - Hogan4.walk(node.nodes, ctx); - context.subs[node.n] = ctx.code; - if (!context.inPartial) { - context.code += 't.sub("' + esc(node.n) + '",c,p,i);'; - } - }, - "\n": function(node, context) { - context.code += write('"\\n"' + (node.last ? "" : " + i")); - }, - "_v": function(node, context) { - context.code += "t.b(t.v(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));'; - }, - "_t": function(node, context) { - context.code += write('"' + esc(node.text) + '"'); - }, - "{": tripleStache, - "&": tripleStache - }; - function tripleStache(node, context) { - context.code += "t.b(t.t(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,0)));'; - } - function write(s) { - return "t.b(" + s + ");"; - } - Hogan4.walk = function(nodelist, context) { - var func; - for (var i = 0, l = nodelist.length; i < l; i++) { - func = Hogan4.codegen[nodelist[i].tag]; - func && func(nodelist[i], context); - } - return context; - }; - Hogan4.parse = function(tokens, text2, options) { - options = options || {}; - return buildTree(tokens, "", [], options.sectionTags || []); - }; - Hogan4.cache = {}; - Hogan4.cacheKey = function(text2, options) { - return [text2, !!options.asString, !!options.disableLambda, options.delimiters, !!options.modelGet].join("||"); - }; - Hogan4.compile = function(text2, options) { - options = options || {}; - var key2 = Hogan4.cacheKey(text2, options); - var template = this.cache[key2]; - if (template) { - var partials = template.partials; - for (var name in partials) { - delete partials[name].instance; - } - return template; - } - template = this.generate(this.parse(this.scan(text2, options.delimiters), text2, options), text2, options); - return this.cache[key2] = template; - }; - })(typeof exports2 !== "undefined" ? exports2 : Hogan); - } -}); - -// node_modules/.pnpm/hogan.js@3.0.2/node_modules/hogan.js/lib/template.js -var require_template = __commonJS({ - "node_modules/.pnpm/hogan.js@3.0.2/node_modules/hogan.js/lib/template.js"(exports2) { - init_polyfill_buffer(); - var Hogan4 = {}; - (function(Hogan5) { - Hogan5.Template = function(codeObj, text2, compiler, options) { - codeObj = codeObj || {}; - this.r = codeObj.code || this.r; - this.c = compiler; - this.options = options || {}; - this.text = text2 || ""; - this.partials = codeObj.partials || {}; - this.subs = codeObj.subs || {}; - this.buf = ""; - }; - Hogan5.Template.prototype = { - // render: replaced by generated code. - r: function(context, partials, indent2) { - return ""; - }, - // variable escaping - v: hoganEscape, - // triple stache - t: coerceToString, - render: function render2(context, partials, indent2) { - return this.ri([context], partials || {}, indent2); - }, - // render internal -- a hook for overrides that catches partials too - ri: function(context, partials, indent2) { - return this.r(context, partials, indent2); - }, - // ensurePartial - ep: function(symbol, partials) { - var partial = this.partials[symbol]; - var template = partials[partial.name]; - if (partial.instance && partial.base == template) { - return partial.instance; - } - if (typeof template == "string") { - if (!this.c) { - throw new Error("No compiler available."); - } - template = this.c.compile(template, this.options); - } - if (!template) { - return null; - } - this.partials[symbol].base = template; - if (partial.subs) { - if (!partials.stackText) - partials.stackText = {}; - for (key in partial.subs) { - if (!partials.stackText[key]) { - partials.stackText[key] = this.activeSub !== void 0 && partials.stackText[this.activeSub] ? partials.stackText[this.activeSub] : this.text; - } - } - template = createSpecializedPartial( - template, - partial.subs, - partial.partials, - this.stackSubs, - this.stackPartials, - partials.stackText - ); - } - this.partials[symbol].instance = template; - return template; - }, - // tries to find a partial in the current scope and render it - rp: function(symbol, context, partials, indent2) { - var partial = this.ep(symbol, partials); - if (!partial) { - return ""; - } - return partial.ri(context, partials, indent2); - }, - // render a section - rs: function(context, partials, section) { - var tail = context[context.length - 1]; - if (!isArray(tail)) { - section(context, partials, this); - return; - } - for (var i = 0; i < tail.length; i++) { - context.push(tail[i]); - section(context, partials, this); - context.pop(); - } - }, - // maybe start a section - s: function(val, ctx, partials, inverted, start, end, tags) { - var pass; - if (isArray(val) && val.length === 0) { - return false; - } - if (typeof val == "function") { - val = this.ms(val, ctx, partials, inverted, start, end, tags); - } - pass = !!val; - if (!inverted && pass && ctx) { - ctx.push(typeof val == "object" ? val : ctx[ctx.length - 1]); - } - return pass; - }, - // find values with dotted names - d: function(key2, ctx, partials, returnFound) { - var found, names = key2.split("."), val = this.f(names[0], ctx, partials, returnFound), doModelGet = this.options.modelGet, cx = null; - if (key2 === "." && isArray(ctx[ctx.length - 2])) { - val = ctx[ctx.length - 1]; - } else { - for (var i = 1; i < names.length; i++) { - found = findInScope(names[i], val, doModelGet); - if (found !== void 0) { - cx = val; - val = found; - } else { - val = ""; - } - } - } - if (returnFound && !val) { - return false; - } - if (!returnFound && typeof val == "function") { - ctx.push(cx); - val = this.mv(val, ctx, partials); - ctx.pop(); - } - return val; - }, - // find values with normal names - f: function(key2, ctx, partials, returnFound) { - var val = false, v = null, found = false, doModelGet = this.options.modelGet; - for (var i = ctx.length - 1; i >= 0; i--) { - v = ctx[i]; - val = findInScope(key2, v, doModelGet); - if (val !== void 0) { - found = true; - break; - } - } - if (!found) { - return returnFound ? false : ""; - } - if (!returnFound && typeof val == "function") { - val = this.mv(val, ctx, partials); - } - return val; - }, - // higher order templates - ls: function(func, cx, partials, text2, tags) { - var oldTags = this.options.delimiters; - this.options.delimiters = tags; - this.b(this.ct(coerceToString(func.call(cx, text2)), cx, partials)); - this.options.delimiters = oldTags; - return false; - }, - // compile text - ct: function(text2, cx, partials) { - if (this.options.disableLambda) { - throw new Error("Lambda features disabled."); - } - return this.c.compile(text2, this.options).render(cx, partials); - }, - // template result buffering - b: function(s) { - this.buf += s; - }, - fl: function() { - var r = this.buf; - this.buf = ""; - return r; - }, - // method replace section - ms: function(func, ctx, partials, inverted, start, end, tags) { - var textSource, cx = ctx[ctx.length - 1], result = func.call(cx); - if (typeof result == "function") { - if (inverted) { - return true; - } else { - textSource = this.activeSub && this.subsText && this.subsText[this.activeSub] ? this.subsText[this.activeSub] : this.text; - return this.ls(result, cx, partials, textSource.substring(start, end), tags); - } - } - return result; - }, - // method replace variable - mv: function(func, ctx, partials) { - var cx = ctx[ctx.length - 1]; - var result = func.call(cx); - if (typeof result == "function") { - return this.ct(coerceToString(result.call(cx)), cx, partials); - } - return result; - }, - sub: function(name, context, partials, indent2) { - var f = this.subs[name]; - if (f) { - this.activeSub = name; - f(context, partials, this, indent2); - this.activeSub = false; - } - } - }; - function findInScope(key2, scope, doModelGet) { - var val; - if (scope && typeof scope == "object") { - if (scope[key2] !== void 0) { - val = scope[key2]; - } else if (doModelGet && scope.get && typeof scope.get == "function") { - val = scope.get(key2); - } - } - return val; - } - function createSpecializedPartial(instance10, subs, partials, stackSubs, stackPartials, stackText) { - function PartialTemplate() { - } - ; - PartialTemplate.prototype = instance10; - function Substitutions() { - } - ; - Substitutions.prototype = instance10.subs; - var key2; - var partial = new PartialTemplate(); - partial.subs = new Substitutions(); - partial.subsText = {}; - partial.buf = ""; - stackSubs = stackSubs || {}; - partial.stackSubs = stackSubs; - partial.subsText = stackText; - for (key2 in subs) { - if (!stackSubs[key2]) - stackSubs[key2] = subs[key2]; - } - for (key2 in stackSubs) { - partial.subs[key2] = stackSubs[key2]; - } - stackPartials = stackPartials || {}; - partial.stackPartials = stackPartials; - for (key2 in partials) { - if (!stackPartials[key2]) - stackPartials[key2] = partials[key2]; - } - for (key2 in stackPartials) { - partial.partials[key2] = stackPartials[key2]; - } - return partial; - } - var rAmp = /&/g, rLt = //g, rApos = /\'/g, rQuot = /\"/g, hChars = /[&<>\"\']/; - function coerceToString(val) { - return String(val === null || val === void 0 ? "" : val); - } - function hoganEscape(str) { - str = coerceToString(str); - return hChars.test(str) ? str.replace(rAmp, "&").replace(rLt, "<").replace(rGt, ">").replace(rApos, "'").replace(rQuot, """) : str; - } - var isArray = Array.isArray || function(a) { - return Object.prototype.toString.call(a) === "[object Array]"; - }; - })(typeof exports2 !== "undefined" ? exports2 : Hogan4); - } -}); - -// node_modules/.pnpm/hogan.js@3.0.2/node_modules/hogan.js/lib/hogan.js -var require_hogan = __commonJS({ - "node_modules/.pnpm/hogan.js@3.0.2/node_modules/hogan.js/lib/hogan.js"(exports2, module2) { - init_polyfill_buffer(); - var Hogan4 = require_compiler(); - Hogan4.Template = require_template().Template; - Hogan4.template = Hogan4.Template; - module2.exports = Hogan4; - } -}); - -// node_modules/.pnpm/feather-icons@4.29.1/node_modules/feather-icons/dist/feather.js -var require_feather = __commonJS({ - "node_modules/.pnpm/feather-icons@4.29.1/node_modules/feather-icons/dist/feather.js"(exports2, module2) { - init_polyfill_buffer(); - (function webpackUniversalModuleDefinition(root2, factory) { - if (typeof exports2 === "object" && typeof module2 === "object") - module2.exports = factory(); - else if (typeof define === "function" && define.amd) - define([], factory); - else if (typeof exports2 === "object") - exports2["feather"] = factory(); - else - root2["feather"] = factory(); - })(typeof self !== "undefined" ? self : exports2, function() { - return ( - /******/ - function(modules) { - var installedModules = {}; - function __webpack_require__(moduleId) { - if (installedModules[moduleId]) { - return installedModules[moduleId].exports; - } - var module3 = installedModules[moduleId] = { - /******/ - i: moduleId, - /******/ - l: false, - /******/ - exports: {} - /******/ - }; - modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__); - module3.l = true; - return module3.exports; - } - __webpack_require__.m = modules; - __webpack_require__.c = installedModules; - __webpack_require__.d = function(exports3, name, getter) { - if (!__webpack_require__.o(exports3, name)) { - Object.defineProperty(exports3, name, { - /******/ - configurable: false, - /******/ - enumerable: true, - /******/ - get: getter - /******/ - }); - } - }; - __webpack_require__.r = function(exports3) { - Object.defineProperty(exports3, "__esModule", { value: true }); - }; - __webpack_require__.n = function(module3) { - var getter = module3 && module3.__esModule ? ( - /******/ - function getDefault() { - return module3["default"]; - } - ) : ( - /******/ - function getModuleExports() { - return module3; - } - ); - __webpack_require__.d(getter, "a", getter); - return getter; - }; - __webpack_require__.o = function(object, property) { - return Object.prototype.hasOwnProperty.call(object, property); - }; - __webpack_require__.p = ""; - return __webpack_require__(__webpack_require__.s = 0); - }({ - /***/ - "./dist/icons.json": ( - /*!*************************!*\ - !*** ./dist/icons.json ***! - \*************************/ - /*! exports provided: activity, airplay, alert-circle, alert-octagon, alert-triangle, align-center, align-justify, align-left, align-right, anchor, aperture, archive, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, award, bar-chart-2, bar-chart, battery-charging, battery, bell-off, bell, bluetooth, bold, book-open, book, bookmark, box, briefcase, calendar, camera-off, camera, cast, check-circle, check-square, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, chrome, circle, clipboard, clock, cloud-drizzle, cloud-lightning, cloud-off, cloud-rain, cloud-snow, cloud, code, codepen, codesandbox, coffee, columns, command, compass, copy, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, cpu, credit-card, crop, crosshair, database, delete, disc, divide-circle, divide-square, divide, dollar-sign, download-cloud, download, dribbble, droplet, edit-2, edit-3, edit, external-link, eye-off, eye, facebook, fast-forward, feather, figma, file-minus, file-plus, file-text, file, film, filter, flag, folder-minus, folder-plus, folder, framer, frown, gift, git-branch, git-commit, git-merge, git-pull-request, github, gitlab, globe, grid, hard-drive, hash, headphones, heart, help-circle, hexagon, home, image, inbox, info, instagram, italic, key, layers, layout, life-buoy, link-2, link, linkedin, list, loader, lock, log-in, log-out, mail, map-pin, map, maximize-2, maximize, meh, menu, message-circle, message-square, mic-off, mic, minimize-2, minimize, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, mouse-pointer, move, music, navigation-2, navigation, octagon, package, paperclip, pause-circle, pause, pen-tool, percent, phone-call, phone-forwarded, phone-incoming, phone-missed, phone-off, phone-outgoing, phone, pie-chart, play-circle, play, plus-circle, plus-square, plus, pocket, power, printer, radio, refresh-ccw, refresh-cw, repeat, rewind, rotate-ccw, rotate-cw, rss, save, scissors, search, send, server, settings, share-2, share, shield-off, shield, shopping-bag, shopping-cart, shuffle, sidebar, skip-back, skip-forward, slack, slash, sliders, smartphone, smile, speaker, square, star, stop-circle, sun, sunrise, sunset, table, tablet, tag, target, terminal, thermometer, thumbs-down, thumbs-up, toggle-left, toggle-right, tool, trash-2, trash, trello, trending-down, trending-up, triangle, truck, tv, twitch, twitter, type, umbrella, underline, unlock, upload-cloud, upload, user-check, user-minus, user-plus, user-x, user, users, video-off, video, voicemail, volume-1, volume-2, volume-x, volume, watch, wifi-off, wifi, wind, x-circle, x-octagon, x-square, x, youtube, zap-off, zap, zoom-in, zoom-out, default */ - /***/ - function(module3) { - module3.exports = { "activity": '', "airplay": '', "alert-circle": '', "alert-octagon": '', "alert-triangle": '', "align-center": '', "align-justify": '', "align-left": '', "align-right": '', "anchor": '', "aperture": '', "archive": '', "arrow-down-circle": '', "arrow-down-left": '', "arrow-down-right": '', "arrow-down": '', "arrow-left-circle": '', "arrow-left": '', "arrow-right-circle": '', "arrow-right": '', "arrow-up-circle": '', "arrow-up-left": '', "arrow-up-right": '', "arrow-up": '', "at-sign": '', "award": '', "bar-chart-2": '', "bar-chart": '', "battery-charging": '', "battery": '', "bell-off": '', "bell": '', "bluetooth": '', "bold": '', "book-open": '', "book": '', "bookmark": '', "box": '', "briefcase": '', "calendar": '', "camera-off": '', "camera": '', "cast": '', "check-circle": '', "check-square": '', "check": '', "chevron-down": '', "chevron-left": '', "chevron-right": '', "chevron-up": '', "chevrons-down": '', "chevrons-left": '', "chevrons-right": '', "chevrons-up": '', "chrome": '', "circle": '', "clipboard": '', "clock": '', "cloud-drizzle": '', "cloud-lightning": '', "cloud-off": '', "cloud-rain": '', "cloud-snow": '', "cloud": '', "code": '', "codepen": '', "codesandbox": '', "coffee": '', "columns": '', "command": '', "compass": '', "copy": '', "corner-down-left": '', "corner-down-right": '', "corner-left-down": '', "corner-left-up": '', "corner-right-down": '', "corner-right-up": '', "corner-up-left": '', "corner-up-right": '', "cpu": '', "credit-card": '', "crop": '', "crosshair": '', "database": '', "delete": '', "disc": '', "divide-circle": '', "divide-square": '', "divide": '', "dollar-sign": '', "download-cloud": '', "download": '', "dribbble": '', "droplet": '', "edit-2": '', "edit-3": '', "edit": '', "external-link": '', "eye-off": '', "eye": '', "facebook": '', "fast-forward": '', "feather": '', "figma": '', "file-minus": '', "file-plus": '', "file-text": '', "file": '', "film": '', "filter": '', "flag": '', "folder-minus": '', "folder-plus": '', "folder": '', "framer": '', "frown": '', "gift": '', "git-branch": '', "git-commit": '', "git-merge": '', "git-pull-request": '', "github": '', "gitlab": '', "globe": '', "grid": '', "hard-drive": '', "hash": '', "headphones": '', "heart": '', "help-circle": '', "hexagon": '', "home": '', "image": '', "inbox": '', "info": '', "instagram": '', "italic": '', "key": '', "layers": '', "layout": '', "life-buoy": '', "link-2": '', "link": '', "linkedin": '', "list": '', "loader": '', "lock": '', "log-in": '', "log-out": '', "mail": '', "map-pin": '', "map": '', "maximize-2": '', "maximize": '', "meh": '', "menu": '', "message-circle": '', "message-square": '', "mic-off": '', "mic": '', "minimize-2": '', "minimize": '', "minus-circle": '', "minus-square": '', "minus": '', "monitor": '', "moon": '', "more-horizontal": '', "more-vertical": '', "mouse-pointer": '', "move": '', "music": '', "navigation-2": '', "navigation": '', "octagon": '', "package": '', "paperclip": '', "pause-circle": '', "pause": '', "pen-tool": '', "percent": '', "phone-call": '', "phone-forwarded": '', "phone-incoming": '', "phone-missed": '', "phone-off": '', "phone-outgoing": '', "phone": '', "pie-chart": '', "play-circle": '', "play": '', "plus-circle": '', "plus-square": '', "plus": '', "pocket": '', "power": '', "printer": '', "radio": '', "refresh-ccw": '', "refresh-cw": '', "repeat": '', "rewind": '', "rotate-ccw": '', "rotate-cw": '', "rss": '', "save": '', "scissors": '', "search": '', "send": '', "server": '', "settings": '', "share-2": '', "share": '', "shield-off": '', "shield": '', "shopping-bag": '', "shopping-cart": '', "shuffle": '', "sidebar": '', "skip-back": '', "skip-forward": '', "slack": '', "slash": '', "sliders": '', "smartphone": '', "smile": '', "speaker": '', "square": '', "star": '', "stop-circle": '', "sun": '', "sunrise": '', "sunset": '', "table": '', "tablet": '', "tag": '', "target": '', "terminal": '', "thermometer": '', "thumbs-down": '', "thumbs-up": '', "toggle-left": '', "toggle-right": '', "tool": '', "trash-2": '', "trash": '', "trello": '', "trending-down": '', "trending-up": '', "triangle": '', "truck": '', "tv": '', "twitch": '', "twitter": '', "type": '', "umbrella": '', "underline": '', "unlock": '', "upload-cloud": '', "upload": '', "user-check": '', "user-minus": '', "user-plus": '', "user-x": '', "user": '', "users": '', "video-off": '', "video": '', "voicemail": '', "volume-1": '', "volume-2": '', "volume-x": '', "volume": '', "watch": '', "wifi-off": '', "wifi": '', "wind": '', "x-circle": '', "x-octagon": '', "x-square": '', "x": '', "youtube": '', "zap-off": '', "zap": '', "zoom-in": '', "zoom-out": '' }; - } - ), - /***/ - "./node_modules/classnames/dedupe.js": ( - /*!*******************************************!*\ - !*** ./node_modules/classnames/dedupe.js ***! - \*******************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; - (function() { - "use strict"; - var classNames = function() { - function StorageObject() { - } - StorageObject.prototype = /* @__PURE__ */ Object.create(null); - function _parseArray(resultSet, array) { - var length = array.length; - for (var i = 0; i < length; ++i) { - _parse(resultSet, array[i]); - } - } - var hasOwn = {}.hasOwnProperty; - function _parseNumber(resultSet, num2) { - resultSet[num2] = true; - } - function _parseObject(resultSet, object) { - for (var k in object) { - if (hasOwn.call(object, k)) { - resultSet[k] = !!object[k]; - } - } - } - var SPACE = /\s+/; - function _parseString(resultSet, str) { - var array = str.split(SPACE); - var length = array.length; - for (var i = 0; i < length; ++i) { - resultSet[array[i]] = true; - } - } - function _parse(resultSet, arg) { - if (!arg) - return; - var argType = typeof arg; - if (argType === "string") { - _parseString(resultSet, arg); - } else if (Array.isArray(arg)) { - _parseArray(resultSet, arg); - } else if (argType === "object") { - _parseObject(resultSet, arg); - } else if (argType === "number") { - _parseNumber(resultSet, arg); - } - } - function _classNames() { - var len = arguments.length; - var args = Array(len); - for (var i = 0; i < len; i++) { - args[i] = arguments[i]; - } - var classSet = new StorageObject(); - _parseArray(classSet, args); - var list = []; - for (var k in classSet) { - if (classSet[k]) { - list.push(k); - } - } - return list.join(" "); - } - return _classNames; - }(); - if (typeof module3 !== "undefined" && module3.exports) { - module3.exports = classNames; - } else if (true) { - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { - return classNames; - }.apply(exports3, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module3.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else { - } - })(); - } - ), - /***/ - "./node_modules/core-js/es/array/from.js": ( - /*!***********************************************!*\ - !*** ./node_modules/core-js/es/array/from.js ***! - \***********************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - __webpack_require__( - /*! ../../modules/es.string.iterator */ - "./node_modules/core-js/modules/es.string.iterator.js" - ); - __webpack_require__( - /*! ../../modules/es.array.from */ - "./node_modules/core-js/modules/es.array.from.js" - ); - var path2 = __webpack_require__( - /*! ../../internals/path */ - "./node_modules/core-js/internals/path.js" - ); - module3.exports = path2.Array.from; - } - ), - /***/ - "./node_modules/core-js/internals/a-function.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/a-function.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = function(it) { - if (typeof it != "function") { - throw TypeError(String(it) + " is not a function"); - } - return it; - }; - } - ), - /***/ - "./node_modules/core-js/internals/an-object.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/an-object.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var isObject2 = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - module3.exports = function(it) { - if (!isObject2(it)) { - throw TypeError(String(it) + " is not an object"); - } - return it; - }; - } - ), - /***/ - "./node_modules/core-js/internals/array-from.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/array-from.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - var bind = __webpack_require__( - /*! ../internals/bind-context */ - "./node_modules/core-js/internals/bind-context.js" - ); - var toObject = __webpack_require__( - /*! ../internals/to-object */ - "./node_modules/core-js/internals/to-object.js" - ); - var callWithSafeIterationClosing = __webpack_require__( - /*! ../internals/call-with-safe-iteration-closing */ - "./node_modules/core-js/internals/call-with-safe-iteration-closing.js" - ); - var isArrayIteratorMethod = __webpack_require__( - /*! ../internals/is-array-iterator-method */ - "./node_modules/core-js/internals/is-array-iterator-method.js" - ); - var toLength = __webpack_require__( - /*! ../internals/to-length */ - "./node_modules/core-js/internals/to-length.js" - ); - var createProperty = __webpack_require__( - /*! ../internals/create-property */ - "./node_modules/core-js/internals/create-property.js" - ); - var getIteratorMethod = __webpack_require__( - /*! ../internals/get-iterator-method */ - "./node_modules/core-js/internals/get-iterator-method.js" - ); - module3.exports = function from(arrayLike) { - var O = toObject(arrayLike); - var C = typeof this == "function" ? this : Array; - var argumentsLength = arguments.length; - var mapfn = argumentsLength > 1 ? arguments[1] : void 0; - var mapping = mapfn !== void 0; - var index2 = 0; - var iteratorMethod = getIteratorMethod(O); - var length, result, step, iterator; - if (mapping) - mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0, 2); - if (iteratorMethod != void 0 && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { - iterator = iteratorMethod.call(O); - result = new C(); - for (; !(step = iterator.next()).done; index2++) { - createProperty( - result, - index2, - mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index2], true) : step.value - ); - } - } else { - length = toLength(O.length); - result = new C(length); - for (; length > index2; index2++) { - createProperty(result, index2, mapping ? mapfn(O[index2], index2) : O[index2]); - } - } - result.length = index2; - return result; - }; - } - ), - /***/ - "./node_modules/core-js/internals/array-includes.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/array-includes.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var toIndexedObject = __webpack_require__( - /*! ../internals/to-indexed-object */ - "./node_modules/core-js/internals/to-indexed-object.js" - ); - var toLength = __webpack_require__( - /*! ../internals/to-length */ - "./node_modules/core-js/internals/to-length.js" - ); - var toAbsoluteIndex = __webpack_require__( - /*! ../internals/to-absolute-index */ - "./node_modules/core-js/internals/to-absolute-index.js" - ); - module3.exports = function(IS_INCLUDES) { - return function($this, el, fromIndex) { - var O = toIndexedObject($this); - var length = toLength(O.length); - var index2 = toAbsoluteIndex(fromIndex, length); - var value; - if (IS_INCLUDES && el != el) - while (length > index2) { - value = O[index2++]; - if (value != value) - return true; - } - else - for (; length > index2; index2++) - if (IS_INCLUDES || index2 in O) { - if (O[index2] === el) - return IS_INCLUDES || index2 || 0; - } - return !IS_INCLUDES && -1; - }; - }; - } - ), - /***/ - "./node_modules/core-js/internals/bind-context.js": ( - /*!********************************************************!*\ - !*** ./node_modules/core-js/internals/bind-context.js ***! - \********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var aFunction = __webpack_require__( - /*! ../internals/a-function */ - "./node_modules/core-js/internals/a-function.js" - ); - module3.exports = function(fn, that, length) { - aFunction(fn); - if (that === void 0) - return fn; - switch (length) { - case 0: - return function() { - return fn.call(that); - }; - case 1: - return function(a) { - return fn.call(that, a); - }; - case 2: - return function(a, b) { - return fn.call(that, a, b); - }; - case 3: - return function(a, b, c) { - return fn.call(that, a, b, c); - }; - } - return function() { - return fn.apply(that, arguments); - }; - }; - } - ), - /***/ - "./node_modules/core-js/internals/call-with-safe-iteration-closing.js": ( - /*!****************************************************************************!*\ - !*** ./node_modules/core-js/internals/call-with-safe-iteration-closing.js ***! - \****************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - module3.exports = function(iterator, fn, value, ENTRIES) { - try { - return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); - } catch (error) { - var returnMethod = iterator["return"]; - if (returnMethod !== void 0) - anObject(returnMethod.call(iterator)); - throw error; - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/check-correctness-of-iteration.js": ( - /*!**************************************************************************!*\ - !*** ./node_modules/core-js/internals/check-correctness-of-iteration.js ***! - \**************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var ITERATOR = wellKnownSymbol("iterator"); - var SAFE_CLOSING = false; - try { - var called = 0; - var iteratorWithReturn = { - next: function() { - return { done: !!called++ }; - }, - "return": function() { - SAFE_CLOSING = true; - } - }; - iteratorWithReturn[ITERATOR] = function() { - return this; - }; - Array.from(iteratorWithReturn, function() { - throw 2; - }); - } catch (error) { - } - module3.exports = function(exec, SKIP_CLOSING) { - if (!SKIP_CLOSING && !SAFE_CLOSING) - return false; - var ITERATION_SUPPORT = false; - try { - var object = {}; - object[ITERATOR] = function() { - return { - next: function() { - return { done: ITERATION_SUPPORT = true }; - } - }; - }; - exec(object); - } catch (error) { - } - return ITERATION_SUPPORT; - }; - } - ), - /***/ - "./node_modules/core-js/internals/classof-raw.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/internals/classof-raw.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - var toString = {}.toString; - module3.exports = function(it) { - return toString.call(it).slice(8, -1); - }; - } - ), - /***/ - "./node_modules/core-js/internals/classof.js": ( - /*!***************************************************!*\ - !*** ./node_modules/core-js/internals/classof.js ***! - \***************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var classofRaw = __webpack_require__( - /*! ../internals/classof-raw */ - "./node_modules/core-js/internals/classof-raw.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - var CORRECT_ARGUMENTS = classofRaw(function() { - return arguments; - }()) == "Arguments"; - var tryGet = function(it, key2) { - try { - return it[key2]; - } catch (error) { - } - }; - module3.exports = function(it) { - var O, tag2, result; - return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag2 = tryGet(O = Object(it), TO_STRING_TAG)) == "string" ? tag2 : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && typeof O.callee == "function" ? "Arguments" : result; - }; - } - ), - /***/ - "./node_modules/core-js/internals/copy-constructor-properties.js": ( - /*!***********************************************************************!*\ - !*** ./node_modules/core-js/internals/copy-constructor-properties.js ***! - \***********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var ownKeys = __webpack_require__( - /*! ../internals/own-keys */ - "./node_modules/core-js/internals/own-keys.js" - ); - var getOwnPropertyDescriptorModule = __webpack_require__( - /*! ../internals/object-get-own-property-descriptor */ - "./node_modules/core-js/internals/object-get-own-property-descriptor.js" - ); - var definePropertyModule = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ); - module3.exports = function(target, source) { - var keys = ownKeys(source); - var defineProperty = definePropertyModule.f; - var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; - for (var i = 0; i < keys.length; i++) { - var key2 = keys[i]; - if (!has(target, key2)) - defineProperty(target, key2, getOwnPropertyDescriptor(source, key2)); - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/correct-prototype-getter.js": ( - /*!********************************************************************!*\ - !*** ./node_modules/core-js/internals/correct-prototype-getter.js ***! - \********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - module3.exports = !fails(function() { - function F() { - } - F.prototype.constructor = null; - return Object.getPrototypeOf(new F()) !== F.prototype; - }); - } - ), - /***/ - "./node_modules/core-js/internals/create-iterator-constructor.js": ( - /*!***********************************************************************!*\ - !*** ./node_modules/core-js/internals/create-iterator-constructor.js ***! - \***********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - var IteratorPrototype = __webpack_require__( - /*! ../internals/iterators-core */ - "./node_modules/core-js/internals/iterators-core.js" - ).IteratorPrototype; - var create = __webpack_require__( - /*! ../internals/object-create */ - "./node_modules/core-js/internals/object-create.js" - ); - var createPropertyDescriptor = __webpack_require__( - /*! ../internals/create-property-descriptor */ - "./node_modules/core-js/internals/create-property-descriptor.js" - ); - var setToStringTag = __webpack_require__( - /*! ../internals/set-to-string-tag */ - "./node_modules/core-js/internals/set-to-string-tag.js" - ); - var Iterators = __webpack_require__( - /*! ../internals/iterators */ - "./node_modules/core-js/internals/iterators.js" - ); - var returnThis = function() { - return this; - }; - module3.exports = function(IteratorConstructor, NAME, next) { - var TO_STRING_TAG = NAME + " Iterator"; - IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); - setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); - Iterators[TO_STRING_TAG] = returnThis; - return IteratorConstructor; - }; - } - ), - /***/ - "./node_modules/core-js/internals/create-property-descriptor.js": ( - /*!**********************************************************************!*\ - !*** ./node_modules/core-js/internals/create-property-descriptor.js ***! - \**********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = function(bitmap, value) { - return { - enumerable: !(bitmap & 1), - configurable: !(bitmap & 2), - writable: !(bitmap & 4), - value - }; - }; - } - ), - /***/ - "./node_modules/core-js/internals/create-property.js": ( - /*!***********************************************************!*\ - !*** ./node_modules/core-js/internals/create-property.js ***! - \***********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - var toPrimitive = __webpack_require__( - /*! ../internals/to-primitive */ - "./node_modules/core-js/internals/to-primitive.js" - ); - var definePropertyModule = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ); - var createPropertyDescriptor = __webpack_require__( - /*! ../internals/create-property-descriptor */ - "./node_modules/core-js/internals/create-property-descriptor.js" - ); - module3.exports = function(object, key2, value) { - var propertyKey = toPrimitive(key2); - if (propertyKey in object) - definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); - else - object[propertyKey] = value; - }; - } - ), - /***/ - "./node_modules/core-js/internals/define-iterator.js": ( - /*!***********************************************************!*\ - !*** ./node_modules/core-js/internals/define-iterator.js ***! - \***********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - var $ = __webpack_require__( - /*! ../internals/export */ - "./node_modules/core-js/internals/export.js" - ); - var createIteratorConstructor = __webpack_require__( - /*! ../internals/create-iterator-constructor */ - "./node_modules/core-js/internals/create-iterator-constructor.js" - ); - var getPrototypeOf = __webpack_require__( - /*! ../internals/object-get-prototype-of */ - "./node_modules/core-js/internals/object-get-prototype-of.js" - ); - var setPrototypeOf = __webpack_require__( - /*! ../internals/object-set-prototype-of */ - "./node_modules/core-js/internals/object-set-prototype-of.js" - ); - var setToStringTag = __webpack_require__( - /*! ../internals/set-to-string-tag */ - "./node_modules/core-js/internals/set-to-string-tag.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var redefine = __webpack_require__( - /*! ../internals/redefine */ - "./node_modules/core-js/internals/redefine.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var IS_PURE = __webpack_require__( - /*! ../internals/is-pure */ - "./node_modules/core-js/internals/is-pure.js" - ); - var Iterators = __webpack_require__( - /*! ../internals/iterators */ - "./node_modules/core-js/internals/iterators.js" - ); - var IteratorsCore = __webpack_require__( - /*! ../internals/iterators-core */ - "./node_modules/core-js/internals/iterators-core.js" - ); - var IteratorPrototype = IteratorsCore.IteratorPrototype; - var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; - var ITERATOR = wellKnownSymbol("iterator"); - var KEYS = "keys"; - var VALUES = "values"; - var ENTRIES = "entries"; - var returnThis = function() { - return this; - }; - module3.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { - createIteratorConstructor(IteratorConstructor, NAME, next); - var getIterationMethod = function(KIND) { - if (KIND === DEFAULT && defaultIterator) - return defaultIterator; - if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) - return IterablePrototype[KIND]; - switch (KIND) { - case KEYS: - return function keys() { - return new IteratorConstructor(this, KIND); - }; - case VALUES: - return function values() { - return new IteratorConstructor(this, KIND); - }; - case ENTRIES: - return function entries() { - return new IteratorConstructor(this, KIND); - }; - } - return function() { - return new IteratorConstructor(this); - }; - }; - var TO_STRING_TAG = NAME + " Iterator"; - var INCORRECT_VALUES_NAME = false; - var IterablePrototype = Iterable.prototype; - var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT]; - var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); - var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator; - var CurrentIteratorPrototype, methods, KEY; - if (anyNativeIterator) { - CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); - if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { - if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { - if (setPrototypeOf) { - setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); - } else if (typeof CurrentIteratorPrototype[ITERATOR] != "function") { - hide(CurrentIteratorPrototype, ITERATOR, returnThis); - } - } - setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); - if (IS_PURE) - Iterators[TO_STRING_TAG] = returnThis; - } - } - if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { - INCORRECT_VALUES_NAME = true; - defaultIterator = function values() { - return nativeIterator.call(this); - }; - } - if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { - hide(IterablePrototype, ITERATOR, defaultIterator); - } - Iterators[NAME] = defaultIterator; - if (DEFAULT) { - methods = { - values: getIterationMethod(VALUES), - keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), - entries: getIterationMethod(ENTRIES) - }; - if (FORCED) - for (KEY in methods) { - if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { - redefine(IterablePrototype, KEY, methods[KEY]); - } - } - else - $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); - } - return methods; - }; - } - ), - /***/ - "./node_modules/core-js/internals/descriptors.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/internals/descriptors.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - module3.exports = !fails(function() { - return Object.defineProperty({}, "a", { get: function() { - return 7; - } }).a != 7; - }); - } - ), - /***/ - "./node_modules/core-js/internals/document-create-element.js": ( - /*!*******************************************************************!*\ - !*** ./node_modules/core-js/internals/document-create-element.js ***! - \*******************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var isObject2 = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - var document2 = global2.document; - var exist = isObject2(document2) && isObject2(document2.createElement); - module3.exports = function(it) { - return exist ? document2.createElement(it) : {}; - }; - } - ), - /***/ - "./node_modules/core-js/internals/enum-bug-keys.js": ( - /*!*********************************************************!*\ - !*** ./node_modules/core-js/internals/enum-bug-keys.js ***! - \*********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = [ - "constructor", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "toLocaleString", - "toString", - "valueOf" - ]; - } - ), - /***/ - "./node_modules/core-js/internals/export.js": ( - /*!**************************************************!*\ - !*** ./node_modules/core-js/internals/export.js ***! - \**************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var getOwnPropertyDescriptor = __webpack_require__( - /*! ../internals/object-get-own-property-descriptor */ - "./node_modules/core-js/internals/object-get-own-property-descriptor.js" - ).f; - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var redefine = __webpack_require__( - /*! ../internals/redefine */ - "./node_modules/core-js/internals/redefine.js" - ); - var setGlobal = __webpack_require__( - /*! ../internals/set-global */ - "./node_modules/core-js/internals/set-global.js" - ); - var copyConstructorProperties = __webpack_require__( - /*! ../internals/copy-constructor-properties */ - "./node_modules/core-js/internals/copy-constructor-properties.js" - ); - var isForced = __webpack_require__( - /*! ../internals/is-forced */ - "./node_modules/core-js/internals/is-forced.js" - ); - module3.exports = function(options, source) { - var TARGET = options.target; - var GLOBAL = options.global; - var STATIC = options.stat; - var FORCED, target, key2, targetProperty, sourceProperty, descriptor; - if (GLOBAL) { - target = global2; - } else if (STATIC) { - target = global2[TARGET] || setGlobal(TARGET, {}); - } else { - target = (global2[TARGET] || {}).prototype; - } - if (target) - for (key2 in source) { - sourceProperty = source[key2]; - if (options.noTargetGet) { - descriptor = getOwnPropertyDescriptor(target, key2); - targetProperty = descriptor && descriptor.value; - } else - targetProperty = target[key2]; - FORCED = isForced(GLOBAL ? key2 : TARGET + (STATIC ? "." : "#") + key2, options.forced); - if (!FORCED && targetProperty !== void 0) { - if (typeof sourceProperty === typeof targetProperty) - continue; - copyConstructorProperties(sourceProperty, targetProperty); - } - if (options.sham || targetProperty && targetProperty.sham) { - hide(sourceProperty, "sham", true); - } - redefine(target, key2, sourceProperty, options); - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/fails.js": ( - /*!*************************************************!*\ - !*** ./node_modules/core-js/internals/fails.js ***! - \*************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = function(exec) { - try { - return !!exec(); - } catch (error) { - return true; - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/function-to-string.js": ( - /*!**************************************************************!*\ - !*** ./node_modules/core-js/internals/function-to-string.js ***! - \**************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var shared = __webpack_require__( - /*! ../internals/shared */ - "./node_modules/core-js/internals/shared.js" - ); - module3.exports = shared("native-function-to-string", Function.toString); - } - ), - /***/ - "./node_modules/core-js/internals/get-iterator-method.js": ( - /*!***************************************************************!*\ - !*** ./node_modules/core-js/internals/get-iterator-method.js ***! - \***************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var classof = __webpack_require__( - /*! ../internals/classof */ - "./node_modules/core-js/internals/classof.js" - ); - var Iterators = __webpack_require__( - /*! ../internals/iterators */ - "./node_modules/core-js/internals/iterators.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var ITERATOR = wellKnownSymbol("iterator"); - module3.exports = function(it) { - if (it != void 0) - return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)]; - }; - } - ), - /***/ - "./node_modules/core-js/internals/global.js": ( - /*!**************************************************!*\ - !*** ./node_modules/core-js/internals/global.js ***! - \**************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - (function(global2) { - var O = "object"; - var check = function(it) { - return it && it.Math == Math && it; - }; - module3.exports = // eslint-disable-next-line no-undef - check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof global2 == O && global2) || // eslint-disable-next-line no-new-func - Function("return this")(); - }).call(this, __webpack_require__( - /*! ./../../webpack/buildin/global.js */ - "./node_modules/webpack/buildin/global.js" - )); - } - ), - /***/ - "./node_modules/core-js/internals/has.js": ( - /*!***********************************************!*\ - !*** ./node_modules/core-js/internals/has.js ***! - \***********************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - var hasOwnProperty = {}.hasOwnProperty; - module3.exports = function(it, key2) { - return hasOwnProperty.call(it, key2); - }; - } - ), - /***/ - "./node_modules/core-js/internals/hidden-keys.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/internals/hidden-keys.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = {}; - } - ), - /***/ - "./node_modules/core-js/internals/hide.js": ( - /*!************************************************!*\ - !*** ./node_modules/core-js/internals/hide.js ***! - \************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var definePropertyModule = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ); - var createPropertyDescriptor = __webpack_require__( - /*! ../internals/create-property-descriptor */ - "./node_modules/core-js/internals/create-property-descriptor.js" - ); - module3.exports = DESCRIPTORS ? function(object, key2, value) { - return definePropertyModule.f(object, key2, createPropertyDescriptor(1, value)); - } : function(object, key2, value) { - object[key2] = value; - return object; - }; - } - ), - /***/ - "./node_modules/core-js/internals/html.js": ( - /*!************************************************!*\ - !*** ./node_modules/core-js/internals/html.js ***! - \************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var document2 = global2.document; - module3.exports = document2 && document2.documentElement; - } - ), - /***/ - "./node_modules/core-js/internals/ie8-dom-define.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/ie8-dom-define.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - var createElement = __webpack_require__( - /*! ../internals/document-create-element */ - "./node_modules/core-js/internals/document-create-element.js" - ); - module3.exports = !DESCRIPTORS && !fails(function() { - return Object.defineProperty(createElement("div"), "a", { - get: function() { - return 7; - } - }).a != 7; - }); - } - ), - /***/ - "./node_modules/core-js/internals/indexed-object.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/indexed-object.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - var classof = __webpack_require__( - /*! ../internals/classof-raw */ - "./node_modules/core-js/internals/classof-raw.js" - ); - var split = "".split; - module3.exports = fails(function() { - return !Object("z").propertyIsEnumerable(0); - }) ? function(it) { - return classof(it) == "String" ? split.call(it, "") : Object(it); - } : Object; - } - ), - /***/ - "./node_modules/core-js/internals/internal-state.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/internal-state.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var NATIVE_WEAK_MAP = __webpack_require__( - /*! ../internals/native-weak-map */ - "./node_modules/core-js/internals/native-weak-map.js" - ); - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var isObject2 = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var objectHas = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var sharedKey = __webpack_require__( - /*! ../internals/shared-key */ - "./node_modules/core-js/internals/shared-key.js" - ); - var hiddenKeys = __webpack_require__( - /*! ../internals/hidden-keys */ - "./node_modules/core-js/internals/hidden-keys.js" - ); - var WeakMap2 = global2.WeakMap; - var set, get, has; - var enforce = function(it) { - return has(it) ? get(it) : set(it, {}); - }; - var getterFor = function(TYPE) { - return function(it) { - var state; - if (!isObject2(it) || (state = get(it)).type !== TYPE) { - throw TypeError("Incompatible receiver, " + TYPE + " required"); - } - return state; - }; - }; - if (NATIVE_WEAK_MAP) { - var store = new WeakMap2(); - var wmget = store.get; - var wmhas = store.has; - var wmset = store.set; - set = function(it, metadata) { - wmset.call(store, it, metadata); - return metadata; - }; - get = function(it) { - return wmget.call(store, it) || {}; - }; - has = function(it) { - return wmhas.call(store, it); - }; - } else { - var STATE = sharedKey("state"); - hiddenKeys[STATE] = true; - set = function(it, metadata) { - hide(it, STATE, metadata); - return metadata; - }; - get = function(it) { - return objectHas(it, STATE) ? it[STATE] : {}; - }; - has = function(it) { - return objectHas(it, STATE); - }; - } - module3.exports = { - set, - get, - has, - enforce, - getterFor - }; - } - ), - /***/ - "./node_modules/core-js/internals/is-array-iterator-method.js": ( - /*!********************************************************************!*\ - !*** ./node_modules/core-js/internals/is-array-iterator-method.js ***! - \********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var Iterators = __webpack_require__( - /*! ../internals/iterators */ - "./node_modules/core-js/internals/iterators.js" - ); - var ITERATOR = wellKnownSymbol("iterator"); - var ArrayPrototype = Array.prototype; - module3.exports = function(it) { - return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); - }; - } - ), - /***/ - "./node_modules/core-js/internals/is-forced.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/is-forced.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - var replacement = /#|\.prototype\./; - var isForced = function(feature, detection) { - var value = data[normalize2(feature)]; - return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == "function" ? fails(detection) : !!detection; - }; - var normalize2 = isForced.normalize = function(string) { - return String(string).replace(replacement, ".").toLowerCase(); - }; - var data = isForced.data = {}; - var NATIVE = isForced.NATIVE = "N"; - var POLYFILL = isForced.POLYFILL = "P"; - module3.exports = isForced; - } - ), - /***/ - "./node_modules/core-js/internals/is-object.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/is-object.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = function(it) { - return typeof it === "object" ? it !== null : typeof it === "function"; - }; - } - ), - /***/ - "./node_modules/core-js/internals/is-pure.js": ( - /*!***************************************************!*\ - !*** ./node_modules/core-js/internals/is-pure.js ***! - \***************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = false; - } - ), - /***/ - "./node_modules/core-js/internals/iterators-core.js": ( - /*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/iterators-core.js ***! - \**********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - var getPrototypeOf = __webpack_require__( - /*! ../internals/object-get-prototype-of */ - "./node_modules/core-js/internals/object-get-prototype-of.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var IS_PURE = __webpack_require__( - /*! ../internals/is-pure */ - "./node_modules/core-js/internals/is-pure.js" - ); - var ITERATOR = wellKnownSymbol("iterator"); - var BUGGY_SAFARI_ITERATORS = false; - var returnThis = function() { - return this; - }; - var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; - if ([].keys) { - arrayIterator = [].keys(); - if (!("next" in arrayIterator)) - BUGGY_SAFARI_ITERATORS = true; - else { - PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); - if (PrototypeOfArrayIteratorPrototype !== Object.prototype) - IteratorPrototype = PrototypeOfArrayIteratorPrototype; - } - } - if (IteratorPrototype == void 0) - IteratorPrototype = {}; - if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) - hide(IteratorPrototype, ITERATOR, returnThis); - module3.exports = { - IteratorPrototype, - BUGGY_SAFARI_ITERATORS - }; - } - ), - /***/ - "./node_modules/core-js/internals/iterators.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/iterators.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = {}; - } - ), - /***/ - "./node_modules/core-js/internals/native-symbol.js": ( - /*!*********************************************************!*\ - !*** ./node_modules/core-js/internals/native-symbol.js ***! - \*********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var fails = __webpack_require__( - /*! ../internals/fails */ - "./node_modules/core-js/internals/fails.js" - ); - module3.exports = !!Object.getOwnPropertySymbols && !fails(function() { - return !String(Symbol()); - }); - } - ), - /***/ - "./node_modules/core-js/internals/native-weak-map.js": ( - /*!***********************************************************!*\ - !*** ./node_modules/core-js/internals/native-weak-map.js ***! - \***********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var nativeFunctionToString = __webpack_require__( - /*! ../internals/function-to-string */ - "./node_modules/core-js/internals/function-to-string.js" - ); - var WeakMap2 = global2.WeakMap; - module3.exports = typeof WeakMap2 === "function" && /native code/.test(nativeFunctionToString.call(WeakMap2)); - } - ), - /***/ - "./node_modules/core-js/internals/object-create.js": ( - /*!*********************************************************!*\ - !*** ./node_modules/core-js/internals/object-create.js ***! - \*********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - var defineProperties = __webpack_require__( - /*! ../internals/object-define-properties */ - "./node_modules/core-js/internals/object-define-properties.js" - ); - var enumBugKeys = __webpack_require__( - /*! ../internals/enum-bug-keys */ - "./node_modules/core-js/internals/enum-bug-keys.js" - ); - var hiddenKeys = __webpack_require__( - /*! ../internals/hidden-keys */ - "./node_modules/core-js/internals/hidden-keys.js" - ); - var html2 = __webpack_require__( - /*! ../internals/html */ - "./node_modules/core-js/internals/html.js" - ); - var documentCreateElement = __webpack_require__( - /*! ../internals/document-create-element */ - "./node_modules/core-js/internals/document-create-element.js" - ); - var sharedKey = __webpack_require__( - /*! ../internals/shared-key */ - "./node_modules/core-js/internals/shared-key.js" - ); - var IE_PROTO = sharedKey("IE_PROTO"); - var PROTOTYPE = "prototype"; - var Empty = function() { - }; - var createDict = function() { - var iframe = documentCreateElement("iframe"); - var length = enumBugKeys.length; - var lt = "<"; - var script = "script"; - var gt = ">"; - var js = "java" + script + ":"; - var iframeDocument; - iframe.style.display = "none"; - html2.appendChild(iframe); - iframe.src = String(js); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write(lt + script + gt + "document.F=Object" + lt + "/" + script + gt); - iframeDocument.close(); - createDict = iframeDocument.F; - while (length--) - delete createDict[PROTOTYPE][enumBugKeys[length]]; - return createDict(); - }; - module3.exports = Object.create || function create(O, Properties) { - var result; - if (O !== null) { - Empty[PROTOTYPE] = anObject(O); - result = new Empty(); - Empty[PROTOTYPE] = null; - result[IE_PROTO] = O; - } else - result = createDict(); - return Properties === void 0 ? result : defineProperties(result, Properties); - }; - hiddenKeys[IE_PROTO] = true; - } - ), - /***/ - "./node_modules/core-js/internals/object-define-properties.js": ( - /*!********************************************************************!*\ - !*** ./node_modules/core-js/internals/object-define-properties.js ***! - \********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var definePropertyModule = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ); - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - var objectKeys = __webpack_require__( - /*! ../internals/object-keys */ - "./node_modules/core-js/internals/object-keys.js" - ); - module3.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { - anObject(O); - var keys = objectKeys(Properties); - var length = keys.length; - var i = 0; - var key2; - while (length > i) - definePropertyModule.f(O, key2 = keys[i++], Properties[key2]); - return O; - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-define-property.js": ( - /*!******************************************************************!*\ - !*** ./node_modules/core-js/internals/object-define-property.js ***! - \******************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var IE8_DOM_DEFINE = __webpack_require__( - /*! ../internals/ie8-dom-define */ - "./node_modules/core-js/internals/ie8-dom-define.js" - ); - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - var toPrimitive = __webpack_require__( - /*! ../internals/to-primitive */ - "./node_modules/core-js/internals/to-primitive.js" - ); - var nativeDefineProperty = Object.defineProperty; - exports3.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { - anObject(O); - P = toPrimitive(P, true); - anObject(Attributes); - if (IE8_DOM_DEFINE) - try { - return nativeDefineProperty(O, P, Attributes); - } catch (error) { - } - if ("get" in Attributes || "set" in Attributes) - throw TypeError("Accessors not supported"); - if ("value" in Attributes) - O[P] = Attributes.value; - return O; - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-get-own-property-descriptor.js": ( - /*!******************************************************************************!*\ - !*** ./node_modules/core-js/internals/object-get-own-property-descriptor.js ***! - \******************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var DESCRIPTORS = __webpack_require__( - /*! ../internals/descriptors */ - "./node_modules/core-js/internals/descriptors.js" - ); - var propertyIsEnumerableModule = __webpack_require__( - /*! ../internals/object-property-is-enumerable */ - "./node_modules/core-js/internals/object-property-is-enumerable.js" - ); - var createPropertyDescriptor = __webpack_require__( - /*! ../internals/create-property-descriptor */ - "./node_modules/core-js/internals/create-property-descriptor.js" - ); - var toIndexedObject = __webpack_require__( - /*! ../internals/to-indexed-object */ - "./node_modules/core-js/internals/to-indexed-object.js" - ); - var toPrimitive = __webpack_require__( - /*! ../internals/to-primitive */ - "./node_modules/core-js/internals/to-primitive.js" - ); - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var IE8_DOM_DEFINE = __webpack_require__( - /*! ../internals/ie8-dom-define */ - "./node_modules/core-js/internals/ie8-dom-define.js" - ); - var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - exports3.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { - O = toIndexedObject(O); - P = toPrimitive(P, true); - if (IE8_DOM_DEFINE) - try { - return nativeGetOwnPropertyDescriptor(O, P); - } catch (error) { - } - if (has(O, P)) - return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-get-own-property-names.js": ( - /*!*************************************************************************!*\ - !*** ./node_modules/core-js/internals/object-get-own-property-names.js ***! - \*************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var internalObjectKeys = __webpack_require__( - /*! ../internals/object-keys-internal */ - "./node_modules/core-js/internals/object-keys-internal.js" - ); - var enumBugKeys = __webpack_require__( - /*! ../internals/enum-bug-keys */ - "./node_modules/core-js/internals/enum-bug-keys.js" - ); - var hiddenKeys = enumBugKeys.concat("length", "prototype"); - exports3.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { - return internalObjectKeys(O, hiddenKeys); - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-get-own-property-symbols.js": ( - /*!***************************************************************************!*\ - !*** ./node_modules/core-js/internals/object-get-own-property-symbols.js ***! - \***************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - exports3.f = Object.getOwnPropertySymbols; - } - ), - /***/ - "./node_modules/core-js/internals/object-get-prototype-of.js": ( - /*!*******************************************************************!*\ - !*** ./node_modules/core-js/internals/object-get-prototype-of.js ***! - \*******************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var toObject = __webpack_require__( - /*! ../internals/to-object */ - "./node_modules/core-js/internals/to-object.js" - ); - var sharedKey = __webpack_require__( - /*! ../internals/shared-key */ - "./node_modules/core-js/internals/shared-key.js" - ); - var CORRECT_PROTOTYPE_GETTER = __webpack_require__( - /*! ../internals/correct-prototype-getter */ - "./node_modules/core-js/internals/correct-prototype-getter.js" - ); - var IE_PROTO = sharedKey("IE_PROTO"); - var ObjectPrototype = Object.prototype; - module3.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function(O) { - O = toObject(O); - if (has(O, IE_PROTO)) - return O[IE_PROTO]; - if (typeof O.constructor == "function" && O instanceof O.constructor) { - return O.constructor.prototype; - } - return O instanceof Object ? ObjectPrototype : null; - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-keys-internal.js": ( - /*!****************************************************************!*\ - !*** ./node_modules/core-js/internals/object-keys-internal.js ***! - \****************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var toIndexedObject = __webpack_require__( - /*! ../internals/to-indexed-object */ - "./node_modules/core-js/internals/to-indexed-object.js" - ); - var arrayIncludes = __webpack_require__( - /*! ../internals/array-includes */ - "./node_modules/core-js/internals/array-includes.js" - ); - var hiddenKeys = __webpack_require__( - /*! ../internals/hidden-keys */ - "./node_modules/core-js/internals/hidden-keys.js" - ); - var arrayIndexOf = arrayIncludes(false); - module3.exports = function(object, names) { - var O = toIndexedObject(object); - var i = 0; - var result = []; - var key2; - for (key2 in O) - !has(hiddenKeys, key2) && has(O, key2) && result.push(key2); - while (names.length > i) - if (has(O, key2 = names[i++])) { - ~arrayIndexOf(result, key2) || result.push(key2); - } - return result; - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-keys.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/internals/object-keys.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var internalObjectKeys = __webpack_require__( - /*! ../internals/object-keys-internal */ - "./node_modules/core-js/internals/object-keys-internal.js" - ); - var enumBugKeys = __webpack_require__( - /*! ../internals/enum-bug-keys */ - "./node_modules/core-js/internals/enum-bug-keys.js" - ); - module3.exports = Object.keys || function keys(O) { - return internalObjectKeys(O, enumBugKeys); - }; - } - ), - /***/ - "./node_modules/core-js/internals/object-property-is-enumerable.js": ( - /*!*************************************************************************!*\ - !*** ./node_modules/core-js/internals/object-property-is-enumerable.js ***! - \*************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - var nativePropertyIsEnumerable = {}.propertyIsEnumerable; - var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; - var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); - exports3.f = NASHORN_BUG ? function propertyIsEnumerable(V) { - var descriptor = getOwnPropertyDescriptor(this, V); - return !!descriptor && descriptor.enumerable; - } : nativePropertyIsEnumerable; - } - ), - /***/ - "./node_modules/core-js/internals/object-set-prototype-of.js": ( - /*!*******************************************************************!*\ - !*** ./node_modules/core-js/internals/object-set-prototype-of.js ***! - \*******************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var validateSetPrototypeOfArguments = __webpack_require__( - /*! ../internals/validate-set-prototype-of-arguments */ - "./node_modules/core-js/internals/validate-set-prototype-of-arguments.js" - ); - module3.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() { - var correctSetter = false; - var test = {}; - var setter; - try { - setter = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set; - setter.call(test, []); - correctSetter = test instanceof Array; - } catch (error) { - } - return function setPrototypeOf(O, proto) { - validateSetPrototypeOfArguments(O, proto); - if (correctSetter) - setter.call(O, proto); - else - O.__proto__ = proto; - return O; - }; - }() : void 0); - } - ), - /***/ - "./node_modules/core-js/internals/own-keys.js": ( - /*!****************************************************!*\ - !*** ./node_modules/core-js/internals/own-keys.js ***! - \****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var getOwnPropertyNamesModule = __webpack_require__( - /*! ../internals/object-get-own-property-names */ - "./node_modules/core-js/internals/object-get-own-property-names.js" - ); - var getOwnPropertySymbolsModule = __webpack_require__( - /*! ../internals/object-get-own-property-symbols */ - "./node_modules/core-js/internals/object-get-own-property-symbols.js" - ); - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - var Reflect2 = global2.Reflect; - module3.exports = Reflect2 && Reflect2.ownKeys || function ownKeys(it) { - var keys = getOwnPropertyNamesModule.f(anObject(it)); - var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; - return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; - }; - } - ), - /***/ - "./node_modules/core-js/internals/path.js": ( - /*!************************************************!*\ - !*** ./node_modules/core-js/internals/path.js ***! - \************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - module3.exports = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - } - ), - /***/ - "./node_modules/core-js/internals/redefine.js": ( - /*!****************************************************!*\ - !*** ./node_modules/core-js/internals/redefine.js ***! - \****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var shared = __webpack_require__( - /*! ../internals/shared */ - "./node_modules/core-js/internals/shared.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var setGlobal = __webpack_require__( - /*! ../internals/set-global */ - "./node_modules/core-js/internals/set-global.js" - ); - var nativeFunctionToString = __webpack_require__( - /*! ../internals/function-to-string */ - "./node_modules/core-js/internals/function-to-string.js" - ); - var InternalStateModule = __webpack_require__( - /*! ../internals/internal-state */ - "./node_modules/core-js/internals/internal-state.js" - ); - var getInternalState = InternalStateModule.get; - var enforceInternalState = InternalStateModule.enforce; - var TEMPLATE = String(nativeFunctionToString).split("toString"); - shared("inspectSource", function(it) { - return nativeFunctionToString.call(it); - }); - (module3.exports = function(O, key2, value, options) { - var unsafe = options ? !!options.unsafe : false; - var simple2 = options ? !!options.enumerable : false; - var noTargetGet = options ? !!options.noTargetGet : false; - if (typeof value == "function") { - if (typeof key2 == "string" && !has(value, "name")) - hide(value, "name", key2); - enforceInternalState(value).source = TEMPLATE.join(typeof key2 == "string" ? key2 : ""); - } - if (O === global2) { - if (simple2) - O[key2] = value; - else - setGlobal(key2, value); - return; - } else if (!unsafe) { - delete O[key2]; - } else if (!noTargetGet && O[key2]) { - simple2 = true; - } - if (simple2) - O[key2] = value; - else - hide(O, key2, value); - })(Function.prototype, "toString", function toString() { - return typeof this == "function" && getInternalState(this).source || nativeFunctionToString.call(this); - }); - } - ), - /***/ - "./node_modules/core-js/internals/require-object-coercible.js": ( - /*!********************************************************************!*\ - !*** ./node_modules/core-js/internals/require-object-coercible.js ***! - \********************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - module3.exports = function(it) { - if (it == void 0) - throw TypeError("Can't call method on " + it); - return it; - }; - } - ), - /***/ - "./node_modules/core-js/internals/set-global.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/set-global.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var hide = __webpack_require__( - /*! ../internals/hide */ - "./node_modules/core-js/internals/hide.js" - ); - module3.exports = function(key2, value) { - try { - hide(global2, key2, value); - } catch (error) { - global2[key2] = value; - } - return value; - }; - } - ), - /***/ - "./node_modules/core-js/internals/set-to-string-tag.js": ( - /*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/set-to-string-tag.js ***! - \*************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var defineProperty = __webpack_require__( - /*! ../internals/object-define-property */ - "./node_modules/core-js/internals/object-define-property.js" - ).f; - var has = __webpack_require__( - /*! ../internals/has */ - "./node_modules/core-js/internals/has.js" - ); - var wellKnownSymbol = __webpack_require__( - /*! ../internals/well-known-symbol */ - "./node_modules/core-js/internals/well-known-symbol.js" - ); - var TO_STRING_TAG = wellKnownSymbol("toStringTag"); - module3.exports = function(it, TAG, STATIC) { - if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { - defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/shared-key.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/shared-key.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var shared = __webpack_require__( - /*! ../internals/shared */ - "./node_modules/core-js/internals/shared.js" - ); - var uid = __webpack_require__( - /*! ../internals/uid */ - "./node_modules/core-js/internals/uid.js" - ); - var keys = shared("keys"); - module3.exports = function(key2) { - return keys[key2] || (keys[key2] = uid(key2)); - }; - } - ), - /***/ - "./node_modules/core-js/internals/shared.js": ( - /*!**************************************************!*\ - !*** ./node_modules/core-js/internals/shared.js ***! - \**************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var setGlobal = __webpack_require__( - /*! ../internals/set-global */ - "./node_modules/core-js/internals/set-global.js" - ); - var IS_PURE = __webpack_require__( - /*! ../internals/is-pure */ - "./node_modules/core-js/internals/is-pure.js" - ); - var SHARED = "__core-js_shared__"; - var store = global2[SHARED] || setGlobal(SHARED, {}); - (module3.exports = function(key2, value) { - return store[key2] || (store[key2] = value !== void 0 ? value : {}); - })("versions", []).push({ - version: "3.1.3", - mode: IS_PURE ? "pure" : "global", - copyright: "\xA9 2019 Denis Pushkarev (zloirock.ru)" - }); - } - ), - /***/ - "./node_modules/core-js/internals/string-at.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/string-at.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var toInteger = __webpack_require__( - /*! ../internals/to-integer */ - "./node_modules/core-js/internals/to-integer.js" - ); - var requireObjectCoercible = __webpack_require__( - /*! ../internals/require-object-coercible */ - "./node_modules/core-js/internals/require-object-coercible.js" - ); - module3.exports = function(that, pos, CONVERT_TO_STRING) { - var S = String(requireObjectCoercible(that)); - var position = toInteger(pos); - var size = S.length; - var first2, second; - if (position < 0 || position >= size) - return CONVERT_TO_STRING ? "" : void 0; - first2 = S.charCodeAt(position); - return first2 < 55296 || first2 > 56319 || position + 1 === size || (second = S.charCodeAt(position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? S.charAt(position) : first2 : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first2 - 55296 << 10) + (second - 56320) + 65536; - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-absolute-index.js": ( - /*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/to-absolute-index.js ***! - \*************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var toInteger = __webpack_require__( - /*! ../internals/to-integer */ - "./node_modules/core-js/internals/to-integer.js" - ); - var max = Math.max; - var min = Math.min; - module3.exports = function(index2, length) { - var integer = toInteger(index2); - return integer < 0 ? max(integer + length, 0) : min(integer, length); - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-indexed-object.js": ( - /*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/to-indexed-object.js ***! - \*************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var IndexedObject = __webpack_require__( - /*! ../internals/indexed-object */ - "./node_modules/core-js/internals/indexed-object.js" - ); - var requireObjectCoercible = __webpack_require__( - /*! ../internals/require-object-coercible */ - "./node_modules/core-js/internals/require-object-coercible.js" - ); - module3.exports = function(it) { - return IndexedObject(requireObjectCoercible(it)); - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-integer.js": ( - /*!******************************************************!*\ - !*** ./node_modules/core-js/internals/to-integer.js ***! - \******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - var ceil = Math.ceil; - var floor = Math.floor; - module3.exports = function(argument) { - return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-length.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/to-length.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var toInteger = __webpack_require__( - /*! ../internals/to-integer */ - "./node_modules/core-js/internals/to-integer.js" - ); - var min = Math.min; - module3.exports = function(argument) { - return argument > 0 ? min(toInteger(argument), 9007199254740991) : 0; - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-object.js": ( - /*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/to-object.js ***! - \*****************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var requireObjectCoercible = __webpack_require__( - /*! ../internals/require-object-coercible */ - "./node_modules/core-js/internals/require-object-coercible.js" - ); - module3.exports = function(argument) { - return Object(requireObjectCoercible(argument)); - }; - } - ), - /***/ - "./node_modules/core-js/internals/to-primitive.js": ( - /*!********************************************************!*\ - !*** ./node_modules/core-js/internals/to-primitive.js ***! - \********************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var isObject2 = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - module3.exports = function(it, S) { - if (!isObject2(it)) - return it; - var fn, val; - if (S && typeof (fn = it.toString) == "function" && !isObject2(val = fn.call(it))) - return val; - if (typeof (fn = it.valueOf) == "function" && !isObject2(val = fn.call(it))) - return val; - if (!S && typeof (fn = it.toString) == "function" && !isObject2(val = fn.call(it))) - return val; - throw TypeError("Can't convert object to primitive value"); - }; - } - ), - /***/ - "./node_modules/core-js/internals/uid.js": ( - /*!***********************************************!*\ - !*** ./node_modules/core-js/internals/uid.js ***! - \***********************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - var id = 0; - var postfix = Math.random(); - module3.exports = function(key2) { - return "Symbol(".concat(key2 === void 0 ? "" : key2, ")_", (++id + postfix).toString(36)); - }; - } - ), - /***/ - "./node_modules/core-js/internals/validate-set-prototype-of-arguments.js": ( - /*!*******************************************************************************!*\ - !*** ./node_modules/core-js/internals/validate-set-prototype-of-arguments.js ***! - \*******************************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var isObject2 = __webpack_require__( - /*! ../internals/is-object */ - "./node_modules/core-js/internals/is-object.js" - ); - var anObject = __webpack_require__( - /*! ../internals/an-object */ - "./node_modules/core-js/internals/an-object.js" - ); - module3.exports = function(O, proto) { - anObject(O); - if (!isObject2(proto) && proto !== null) { - throw TypeError("Can't set " + String(proto) + " as a prototype"); - } - }; - } - ), - /***/ - "./node_modules/core-js/internals/well-known-symbol.js": ( - /*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/well-known-symbol.js ***! - \*************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var global2 = __webpack_require__( - /*! ../internals/global */ - "./node_modules/core-js/internals/global.js" - ); - var shared = __webpack_require__( - /*! ../internals/shared */ - "./node_modules/core-js/internals/shared.js" - ); - var uid = __webpack_require__( - /*! ../internals/uid */ - "./node_modules/core-js/internals/uid.js" - ); - var NATIVE_SYMBOL = __webpack_require__( - /*! ../internals/native-symbol */ - "./node_modules/core-js/internals/native-symbol.js" - ); - var Symbol2 = global2.Symbol; - var store = shared("wks"); - module3.exports = function(name) { - return store[name] || (store[name] = NATIVE_SYMBOL && Symbol2[name] || (NATIVE_SYMBOL ? Symbol2 : uid)("Symbol." + name)); - }; - } - ), - /***/ - "./node_modules/core-js/modules/es.array.from.js": ( - /*!*******************************************************!*\ - !*** ./node_modules/core-js/modules/es.array.from.js ***! - \*******************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - var $ = __webpack_require__( - /*! ../internals/export */ - "./node_modules/core-js/internals/export.js" - ); - var from = __webpack_require__( - /*! ../internals/array-from */ - "./node_modules/core-js/internals/array-from.js" - ); - var checkCorrectnessOfIteration = __webpack_require__( - /*! ../internals/check-correctness-of-iteration */ - "./node_modules/core-js/internals/check-correctness-of-iteration.js" - ); - var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) { - Array.from(iterable); - }); - $({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, { - from - }); - } - ), - /***/ - "./node_modules/core-js/modules/es.string.iterator.js": ( - /*!************************************************************!*\ - !*** ./node_modules/core-js/modules/es.string.iterator.js ***! - \************************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - var codePointAt = __webpack_require__( - /*! ../internals/string-at */ - "./node_modules/core-js/internals/string-at.js" - ); - var InternalStateModule = __webpack_require__( - /*! ../internals/internal-state */ - "./node_modules/core-js/internals/internal-state.js" - ); - var defineIterator = __webpack_require__( - /*! ../internals/define-iterator */ - "./node_modules/core-js/internals/define-iterator.js" - ); - var STRING_ITERATOR = "String Iterator"; - var setInternalState = InternalStateModule.set; - var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); - defineIterator(String, "String", function(iterated) { - setInternalState(this, { - type: STRING_ITERATOR, - string: String(iterated), - index: 0 - }); - }, function next() { - var state = getInternalState(this); - var string = state.string; - var index2 = state.index; - var point; - if (index2 >= string.length) - return { value: void 0, done: true }; - point = codePointAt(string, index2, true); - state.index += point.length; - return { value: point, done: false }; - }); - } - ), - /***/ - "./node_modules/webpack/buildin/global.js": ( - /*!***********************************!*\ - !*** (webpack)/buildin/global.js ***! - \***********************************/ - /*! no static exports found */ - /***/ - function(module3, exports3) { - var g; - g = function() { - return this; - }(); - try { - g = g || Function("return this")() || (1, eval)("this"); - } catch (e) { - if (typeof window === "object") - g = window; - } - module3.exports = g; - } - ), - /***/ - "./src/default-attrs.json": ( - /*!********************************!*\ - !*** ./src/default-attrs.json ***! - \********************************/ - /*! exports provided: xmlns, width, height, viewBox, fill, stroke, stroke-width, stroke-linecap, stroke-linejoin, default */ - /***/ - function(module3) { - module3.exports = { "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" }; - } - ), - /***/ - "./src/icon.js": ( - /*!*********************!*\ - !*** ./src/icon.js ***! - \*********************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - Object.defineProperty(exports3, "__esModule", { - value: true - }); - var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key2 in source) { - if (Object.prototype.hasOwnProperty.call(source, key2)) { - target[key2] = source[key2]; - } - } - } - return target; - }; - var _createClass = function() { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) - descriptor.writable = true; - Object.defineProperty(target, descriptor.key, descriptor); - } - } - return function(Constructor, protoProps, staticProps) { - if (protoProps) - defineProperties(Constructor.prototype, protoProps); - if (staticProps) - defineProperties(Constructor, staticProps); - return Constructor; - }; - }(); - var _dedupe = __webpack_require__( - /*! classnames/dedupe */ - "./node_modules/classnames/dedupe.js" - ); - var _dedupe2 = _interopRequireDefault(_dedupe); - var _defaultAttrs = __webpack_require__( - /*! ./default-attrs.json */ - "./src/default-attrs.json" - ); - var _defaultAttrs2 = _interopRequireDefault(_defaultAttrs); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function _classCallCheck(instance10, Constructor) { - if (!(instance10 instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } - } - var Icon = function() { - function Icon2(name, contents) { - var tags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; - _classCallCheck(this, Icon2); - this.name = name; - this.contents = contents; - this.tags = tags; - this.attrs = _extends({}, _defaultAttrs2.default, { class: "feather feather-" + name }); - } - _createClass(Icon2, [{ - key: "toSvg", - value: function toSvg() { - var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - var combinedAttrs = _extends({}, this.attrs, attrs, { class: (0, _dedupe2.default)(this.attrs.class, attrs.class) }); - return "" + this.contents + ""; - } - /** - * Return string representation of an `Icon`. - * - * Added for backward compatibility. If old code expects `feather.icons.` - * to be a string, `toString()` will get implicitly called. - * - * @returns {string} - */ - }, { - key: "toString", - value: function toString() { - return this.contents; - } - }]); - return Icon2; - }(); - function attrsToString(attrs) { - return Object.keys(attrs).map(function(key2) { - return key2 + '="' + attrs[key2] + '"'; - }).join(" "); - } - exports3.default = Icon; - } - ), - /***/ - "./src/icons.js": ( - /*!**********************!*\ - !*** ./src/icons.js ***! - \**********************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - Object.defineProperty(exports3, "__esModule", { - value: true - }); - var _icon = __webpack_require__( - /*! ./icon */ - "./src/icon.js" - ); - var _icon2 = _interopRequireDefault(_icon); - var _icons = __webpack_require__( - /*! ../dist/icons.json */ - "./dist/icons.json" - ); - var _icons2 = _interopRequireDefault(_icons); - var _tags = __webpack_require__( - /*! ./tags.json */ - "./src/tags.json" - ); - var _tags2 = _interopRequireDefault(_tags); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - exports3.default = Object.keys(_icons2.default).map(function(key2) { - return new _icon2.default(key2, _icons2.default[key2], _tags2.default[key2]); - }).reduce(function(object, icon) { - object[icon.name] = icon; - return object; - }, {}); - } - ), - /***/ - "./src/index.js": ( - /*!**********************!*\ - !*** ./src/index.js ***! - \**********************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - var _icons = __webpack_require__( - /*! ./icons */ - "./src/icons.js" - ); - var _icons2 = _interopRequireDefault(_icons); - var _toSvg = __webpack_require__( - /*! ./to-svg */ - "./src/to-svg.js" - ); - var _toSvg2 = _interopRequireDefault(_toSvg); - var _replace = __webpack_require__( - /*! ./replace */ - "./src/replace.js" - ); - var _replace2 = _interopRequireDefault(_replace); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - module3.exports = { icons: _icons2.default, toSvg: _toSvg2.default, replace: _replace2.default }; - } - ), - /***/ - "./src/replace.js": ( - /*!************************!*\ - !*** ./src/replace.js ***! - \************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - Object.defineProperty(exports3, "__esModule", { - value: true - }); - var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key2 in source) { - if (Object.prototype.hasOwnProperty.call(source, key2)) { - target[key2] = source[key2]; - } - } - } - return target; - }; - var _dedupe = __webpack_require__( - /*! classnames/dedupe */ - "./node_modules/classnames/dedupe.js" - ); - var _dedupe2 = _interopRequireDefault(_dedupe); - var _icons = __webpack_require__( - /*! ./icons */ - "./src/icons.js" - ); - var _icons2 = _interopRequireDefault(_icons); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function replace() { - var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; - if (typeof document === "undefined") { - throw new Error("`feather.replace()` only works in a browser environment."); - } - var elementsToReplace = document.querySelectorAll("[data-feather]"); - Array.from(elementsToReplace).forEach(function(element2) { - return replaceElement(element2, attrs); - }); - } - function replaceElement(element2) { - var attrs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var elementAttrs = getAttrs(element2); - var name = elementAttrs["data-feather"]; - delete elementAttrs["data-feather"]; - var svgString = _icons2.default[name].toSvg(_extends({}, attrs, elementAttrs, { class: (0, _dedupe2.default)(attrs.class, elementAttrs.class) })); - var svgDocument = new DOMParser().parseFromString(svgString, "image/svg+xml"); - var svgElement = svgDocument.querySelector("svg"); - element2.parentNode.replaceChild(svgElement, element2); - } - function getAttrs(element2) { - return Array.from(element2.attributes).reduce(function(attrs, attr2) { - attrs[attr2.name] = attr2.value; - return attrs; - }, {}); - } - exports3.default = replace; - } - ), - /***/ - "./src/tags.json": ( - /*!***********************!*\ - !*** ./src/tags.json ***! - \***********************/ - /*! exports provided: activity, airplay, alert-circle, alert-octagon, alert-triangle, align-center, align-justify, align-left, align-right, anchor, archive, at-sign, award, aperture, bar-chart, bar-chart-2, battery, battery-charging, bell, bell-off, bluetooth, book-open, book, bookmark, box, briefcase, calendar, camera, cast, chevron-down, chevron-up, circle, clipboard, clock, cloud-drizzle, cloud-lightning, cloud-rain, cloud-snow, cloud, codepen, codesandbox, code, coffee, columns, command, compass, copy, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, cpu, credit-card, crop, crosshair, database, delete, disc, dollar-sign, droplet, edit, edit-2, edit-3, eye, eye-off, external-link, facebook, fast-forward, figma, file-minus, file-plus, file-text, film, filter, flag, folder-minus, folder-plus, folder, framer, frown, gift, git-branch, git-commit, git-merge, git-pull-request, github, gitlab, globe, hard-drive, hash, headphones, heart, help-circle, hexagon, home, image, inbox, instagram, key, layers, layout, life-buoy, link, link-2, linkedin, list, lock, log-in, log-out, mail, map-pin, map, maximize, maximize-2, meh, menu, message-circle, message-square, mic-off, mic, minimize, minimize-2, minus, monitor, moon, more-horizontal, more-vertical, mouse-pointer, move, music, navigation, navigation-2, octagon, package, paperclip, pause, pause-circle, pen-tool, percent, phone-call, phone-forwarded, phone-incoming, phone-missed, phone-off, phone-outgoing, phone, play, pie-chart, play-circle, plus, plus-circle, plus-square, pocket, power, printer, radio, refresh-cw, refresh-ccw, repeat, rewind, rotate-ccw, rotate-cw, rss, save, scissors, search, send, settings, share-2, shield, shield-off, shopping-bag, shopping-cart, shuffle, skip-back, skip-forward, slack, slash, sliders, smartphone, smile, speaker, star, stop-circle, sun, sunrise, sunset, tablet, tag, target, terminal, thermometer, thumbs-down, thumbs-up, toggle-left, toggle-right, tool, trash, trash-2, triangle, truck, tv, twitch, twitter, type, umbrella, unlock, user-check, user-minus, user-plus, user-x, user, users, video-off, video, voicemail, volume, volume-1, volume-2, volume-x, watch, wifi-off, wifi, wind, x-circle, x-octagon, x-square, x, youtube, zap-off, zap, zoom-in, zoom-out, default */ - /***/ - function(module3) { - module3.exports = { "activity": ["pulse", "health", "action", "motion"], "airplay": ["stream", "cast", "mirroring"], "alert-circle": ["warning", "alert", "danger"], "alert-octagon": ["warning", "alert", "danger"], "alert-triangle": ["warning", "alert", "danger"], "align-center": ["text alignment", "center"], "align-justify": ["text alignment", "justified"], "align-left": ["text alignment", "left"], "align-right": ["text alignment", "right"], "anchor": [], "archive": ["index", "box"], "at-sign": ["mention", "at", "email", "message"], "award": ["achievement", "badge"], "aperture": ["camera", "photo"], "bar-chart": ["statistics", "diagram", "graph"], "bar-chart-2": ["statistics", "diagram", "graph"], "battery": ["power", "electricity"], "battery-charging": ["power", "electricity"], "bell": ["alarm", "notification", "sound"], "bell-off": ["alarm", "notification", "silent"], "bluetooth": ["wireless"], "book-open": ["read", "library"], "book": ["read", "dictionary", "booklet", "magazine", "library"], "bookmark": ["read", "clip", "marker", "tag"], "box": ["cube"], "briefcase": ["work", "bag", "baggage", "folder"], "calendar": ["date"], "camera": ["photo"], "cast": ["chromecast", "airplay"], "chevron-down": ["expand"], "chevron-up": ["collapse"], "circle": ["off", "zero", "record"], "clipboard": ["copy"], "clock": ["time", "watch", "alarm"], "cloud-drizzle": ["weather", "shower"], "cloud-lightning": ["weather", "bolt"], "cloud-rain": ["weather"], "cloud-snow": ["weather", "blizzard"], "cloud": ["weather"], "codepen": ["logo"], "codesandbox": ["logo"], "code": ["source", "programming"], "coffee": ["drink", "cup", "mug", "tea", "cafe", "hot", "beverage"], "columns": ["layout"], "command": ["keyboard", "cmd", "terminal", "prompt"], "compass": ["navigation", "safari", "travel", "direction"], "copy": ["clone", "duplicate"], "corner-down-left": ["arrow", "return"], "corner-down-right": ["arrow"], "corner-left-down": ["arrow"], "corner-left-up": ["arrow"], "corner-right-down": ["arrow"], "corner-right-up": ["arrow"], "corner-up-left": ["arrow"], "corner-up-right": ["arrow"], "cpu": ["processor", "technology"], "credit-card": ["purchase", "payment", "cc"], "crop": ["photo", "image"], "crosshair": ["aim", "target"], "database": ["storage", "memory"], "delete": ["remove"], "disc": ["album", "cd", "dvd", "music"], "dollar-sign": ["currency", "money", "payment"], "droplet": ["water"], "edit": ["pencil", "change"], "edit-2": ["pencil", "change"], "edit-3": ["pencil", "change"], "eye": ["view", "watch"], "eye-off": ["view", "watch", "hide", "hidden"], "external-link": ["outbound"], "facebook": ["logo", "social"], "fast-forward": ["music"], "figma": ["logo", "design", "tool"], "file-minus": ["delete", "remove", "erase"], "file-plus": ["add", "create", "new"], "file-text": ["data", "txt", "pdf"], "film": ["movie", "video"], "filter": ["funnel", "hopper"], "flag": ["report"], "folder-minus": ["directory"], "folder-plus": ["directory"], "folder": ["directory"], "framer": ["logo", "design", "tool"], "frown": ["emoji", "face", "bad", "sad", "emotion"], "gift": ["present", "box", "birthday", "party"], "git-branch": ["code", "version control"], "git-commit": ["code", "version control"], "git-merge": ["code", "version control"], "git-pull-request": ["code", "version control"], "github": ["logo", "version control"], "gitlab": ["logo", "version control"], "globe": ["world", "browser", "language", "translate"], "hard-drive": ["computer", "server", "memory", "data"], "hash": ["hashtag", "number", "pound"], "headphones": ["music", "audio", "sound"], "heart": ["like", "love", "emotion"], "help-circle": ["question mark"], "hexagon": ["shape", "node.js", "logo"], "home": ["house", "living"], "image": ["picture"], "inbox": ["email"], "instagram": ["logo", "camera"], "key": ["password", "login", "authentication", "secure"], "layers": ["stack"], "layout": ["window", "webpage"], "life-buoy": ["help", "life ring", "support"], "link": ["chain", "url"], "link-2": ["chain", "url"], "linkedin": ["logo", "social media"], "list": ["options"], "lock": ["security", "password", "secure"], "log-in": ["sign in", "arrow", "enter"], "log-out": ["sign out", "arrow", "exit"], "mail": ["email", "message"], "map-pin": ["location", "navigation", "travel", "marker"], "map": ["location", "navigation", "travel"], "maximize": ["fullscreen"], "maximize-2": ["fullscreen", "arrows", "expand"], "meh": ["emoji", "face", "neutral", "emotion"], "menu": ["bars", "navigation", "hamburger"], "message-circle": ["comment", "chat"], "message-square": ["comment", "chat"], "mic-off": ["record", "sound", "mute"], "mic": ["record", "sound", "listen"], "minimize": ["exit fullscreen", "close"], "minimize-2": ["exit fullscreen", "arrows", "close"], "minus": ["subtract"], "monitor": ["tv", "screen", "display"], "moon": ["dark", "night"], "more-horizontal": ["ellipsis"], "more-vertical": ["ellipsis"], "mouse-pointer": ["arrow", "cursor"], "move": ["arrows"], "music": ["note"], "navigation": ["location", "travel"], "navigation-2": ["location", "travel"], "octagon": ["stop"], "package": ["box", "container"], "paperclip": ["attachment"], "pause": ["music", "stop"], "pause-circle": ["music", "audio", "stop"], "pen-tool": ["vector", "drawing"], "percent": ["discount"], "phone-call": ["ring"], "phone-forwarded": ["call"], "phone-incoming": ["call"], "phone-missed": ["call"], "phone-off": ["call", "mute"], "phone-outgoing": ["call"], "phone": ["call"], "play": ["music", "start"], "pie-chart": ["statistics", "diagram"], "play-circle": ["music", "start"], "plus": ["add", "new"], "plus-circle": ["add", "new"], "plus-square": ["add", "new"], "pocket": ["logo", "save"], "power": ["on", "off"], "printer": ["fax", "office", "device"], "radio": ["signal"], "refresh-cw": ["synchronise", "arrows"], "refresh-ccw": ["arrows"], "repeat": ["loop", "arrows"], "rewind": ["music"], "rotate-ccw": ["arrow"], "rotate-cw": ["arrow"], "rss": ["feed", "subscribe"], "save": ["floppy disk"], "scissors": ["cut"], "search": ["find", "magnifier", "magnifying glass"], "send": ["message", "mail", "email", "paper airplane", "paper aeroplane"], "settings": ["cog", "edit", "gear", "preferences"], "share-2": ["network", "connections"], "shield": ["security", "secure"], "shield-off": ["security", "insecure"], "shopping-bag": ["ecommerce", "cart", "purchase", "store"], "shopping-cart": ["ecommerce", "cart", "purchase", "store"], "shuffle": ["music"], "skip-back": ["music"], "skip-forward": ["music"], "slack": ["logo"], "slash": ["ban", "no"], "sliders": ["settings", "controls"], "smartphone": ["cellphone", "device"], "smile": ["emoji", "face", "happy", "good", "emotion"], "speaker": ["audio", "music"], "star": ["bookmark", "favorite", "like"], "stop-circle": ["media", "music"], "sun": ["brightness", "weather", "light"], "sunrise": ["weather", "time", "morning", "day"], "sunset": ["weather", "time", "evening", "night"], "tablet": ["device"], "tag": ["label"], "target": ["logo", "bullseye"], "terminal": ["code", "command line", "prompt"], "thermometer": ["temperature", "celsius", "fahrenheit", "weather"], "thumbs-down": ["dislike", "bad", "emotion"], "thumbs-up": ["like", "good", "emotion"], "toggle-left": ["on", "off", "switch"], "toggle-right": ["on", "off", "switch"], "tool": ["settings", "spanner"], "trash": ["garbage", "delete", "remove", "bin"], "trash-2": ["garbage", "delete", "remove", "bin"], "triangle": ["delta"], "truck": ["delivery", "van", "shipping", "transport", "lorry"], "tv": ["television", "stream"], "twitch": ["logo"], "twitter": ["logo", "social"], "type": ["text"], "umbrella": ["rain", "weather"], "unlock": ["security"], "user-check": ["followed", "subscribed"], "user-minus": ["delete", "remove", "unfollow", "unsubscribe"], "user-plus": ["new", "add", "create", "follow", "subscribe"], "user-x": ["delete", "remove", "unfollow", "unsubscribe", "unavailable"], "user": ["person", "account"], "users": ["group"], "video-off": ["camera", "movie", "film"], "video": ["camera", "movie", "film"], "voicemail": ["phone"], "volume": ["music", "sound", "mute"], "volume-1": ["music", "sound"], "volume-2": ["music", "sound"], "volume-x": ["music", "sound", "mute"], "watch": ["clock", "time"], "wifi-off": ["disabled"], "wifi": ["connection", "signal", "wireless"], "wind": ["weather", "air"], "x-circle": ["cancel", "close", "delete", "remove", "times", "clear"], "x-octagon": ["delete", "stop", "alert", "warning", "times", "clear"], "x-square": ["cancel", "close", "delete", "remove", "times", "clear"], "x": ["cancel", "close", "delete", "remove", "times", "clear"], "youtube": ["logo", "video", "play"], "zap-off": ["flash", "camera", "lightning"], "zap": ["flash", "camera", "lightning"], "zoom-in": ["magnifying glass"], "zoom-out": ["magnifying glass"] }; - } - ), - /***/ - "./src/to-svg.js": ( - /*!***********************!*\ - !*** ./src/to-svg.js ***! - \***********************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - "use strict"; - Object.defineProperty(exports3, "__esModule", { - value: true - }); - var _icons = __webpack_require__( - /*! ./icons */ - "./src/icons.js" - ); - var _icons2 = _interopRequireDefault(_icons); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - function toSvg(name) { - var attrs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."); - if (!name) { - throw new Error("The required `key` (icon name) parameter is missing."); - } - if (!_icons2.default[name]) { - throw new Error("No icon matching '" + name + "'. See the complete list of icons at https://feathericons.com"); - } - return _icons2.default[name].toSvg(attrs); - } - exports3.default = toSvg; - } - ), - /***/ - 0: ( - /*!**************************************************!*\ - !*** multi core-js/es/array/from ./src/index.js ***! - \**************************************************/ - /*! no static exports found */ - /***/ - function(module3, exports3, __webpack_require__) { - __webpack_require__( - /*! core-js/es/array/from */ - "./node_modules/core-js/es/array/from.js" - ); - module3.exports = __webpack_require__( - /*! /home/runner/work/feather/feather/src/index.js */ - "./src/index.js" - ); - } - ) - /******/ - }) - ); - }); - } -}); - -// src/main.ts -var main_exports = {}; -__export(main_exports, { - default: () => ObsidianGit -}); -module.exports = __toCommonJS(main_exports); -init_polyfill_buffer(); - -// node_modules/.pnpm/isomorphic-git@1.24.5/node_modules/isomorphic-git/index.js -init_polyfill_buffer(); -var import_async_lock = __toESM(require_async_lock(), 1); -var import_sha1 = __toESM(require_sha1(), 1); -var import_crc_32 = __toESM(require_crc32(), 1); -var import_pako = __toESM(require_pako(), 1); -var import_pify = __toESM(require_pify(), 1); -var import_ignore = __toESM(require_ignore(), 1); -var import_clean_git_ref = __toESM(require_lib2(), 1); -var import_diff3 = __toESM(require_diff3(), 1); -var BaseError = class _BaseError extends Error { - constructor(message) { - super(message); - this.caller = ""; - } - toJSON() { - return { - code: this.code, - data: this.data, - caller: this.caller, - message: this.message, - stack: this.stack - }; - } - fromJSON(json) { - const e = new _BaseError(json.message); - e.code = json.code; - e.data = json.data; - e.caller = json.caller; - e.stack = json.stack; - return e; - } - get isIsomorphicGitError() { - return true; - } -}; -var UnmergedPathsError = class _UnmergedPathsError extends BaseError { - /** - * @param {Array} filepaths - */ - constructor(filepaths) { - super( - `Modifying the index is not possible because you have unmerged files: ${filepaths.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 = _UnmergedPathsError.code; - this.data = { filepaths }; - } -}; -UnmergedPathsError.code = "UnmergedPathsError"; -var InternalError = class _InternalError extends BaseError { - /** - * @param {string} message - */ - constructor(message) { - super( - `An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${message}` - ); - this.code = this.name = _InternalError.code; - this.data = { message }; - } -}; -InternalError.code = "InternalError"; -var UnsafeFilepathError = class _UnsafeFilepathError extends BaseError { - /** - * @param {string} filepath - */ - constructor(filepath) { - super(`The filepath "${filepath}" contains unsafe character sequences`); - this.code = this.name = _UnsafeFilepathError.code; - this.data = { filepath }; - } -}; -UnsafeFilepathError.code = "UnsafeFilepathError"; -var BufferCursor = class { - constructor(buffer2) { - this.buffer = buffer2; - this._start = 0; - } - eof() { - return this._start >= this.buffer.length; - } - tell() { - return this._start; - } - seek(n) { - this._start = n; - } - slice(n) { - const r = this.buffer.slice(this._start, this._start + n); - this._start += n; - return r; - } - toString(enc, length) { - const r = this.buffer.toString(enc, this._start, this._start + length); - this._start += length; - return r; - } - write(value, length, enc) { - const r = this.buffer.write(value, this._start, length, enc); - this._start += length; - return r; - } - copy(source, start, end) { - const r = source.copy(this.buffer, this._start, start, end); - this._start += r; - return r; - } - readUInt8() { - const r = this.buffer.readUInt8(this._start); - this._start += 1; - return r; - } - writeUInt8(value) { - const r = this.buffer.writeUInt8(value, this._start); - this._start += 1; - return r; - } - readUInt16BE() { - const r = this.buffer.readUInt16BE(this._start); - this._start += 2; - return r; - } - writeUInt16BE(value) { - const r = this.buffer.writeUInt16BE(value, this._start); - this._start += 2; - return r; - } - readUInt32BE() { - const r = this.buffer.readUInt32BE(this._start); - this._start += 4; - return r; - } - writeUInt32BE(value) { - const r = this.buffer.writeUInt32BE(value, this._start); - this._start += 4; - return r; - } -}; -function compareStrings(a, b) { - return -(a < b) || +(a > b); -} -function comparePath(a, b) { - return compareStrings(a.path, b.path); -} -function normalizeMode(mode) { - let type = mode > 0 ? mode >> 12 : 0; - if (type !== 4 && type !== 8 && type !== 10 && type !== 14) { - type = 8; - } - let permissions = mode & 511; - if (permissions & 73) { - permissions = 493; - } else { - permissions = 420; - } - if (type !== 8) - permissions = 0; - return (type << 12) + permissions; -} -var MAX_UINT32 = 2 ** 32; -function SecondsNanoseconds(givenSeconds, givenNanoseconds, milliseconds, date) { - if (givenSeconds !== void 0 && givenNanoseconds !== void 0) { - return [givenSeconds, givenNanoseconds]; - } - if (milliseconds === void 0) { - milliseconds = date.valueOf(); - } - const seconds = Math.floor(milliseconds / 1e3); - const nanoseconds = (milliseconds - seconds * 1e3) * 1e6; - return [seconds, nanoseconds]; -} -function normalizeStats(e) { - const [ctimeSeconds, ctimeNanoseconds] = SecondsNanoseconds( - e.ctimeSeconds, - e.ctimeNanoseconds, - e.ctimeMs, - e.ctime - ); - const [mtimeSeconds, mtimeNanoseconds] = SecondsNanoseconds( - e.mtimeSeconds, - e.mtimeNanoseconds, - e.mtimeMs, - e.mtime - ); - return { - ctimeSeconds: ctimeSeconds % MAX_UINT32, - ctimeNanoseconds: ctimeNanoseconds % MAX_UINT32, - mtimeSeconds: mtimeSeconds % MAX_UINT32, - mtimeNanoseconds: mtimeNanoseconds % MAX_UINT32, - dev: e.dev % MAX_UINT32, - ino: e.ino % MAX_UINT32, - mode: normalizeMode(e.mode % MAX_UINT32), - uid: e.uid % MAX_UINT32, - gid: e.gid % MAX_UINT32, - // size of -1 happens over a BrowserFS HTTP Backend that doesn't serve Content-Length headers - // (like the Karma webserver) because BrowserFS HTTP Backend uses HTTP HEAD requests to do fs.stat - size: e.size > -1 ? e.size % MAX_UINT32 : 0 - }; -} -function toHex(buffer2) { - let hex = ""; - for (const byte of new Uint8Array(buffer2)) { - if (byte < 16) - hex += "0"; - hex += byte.toString(16); - } - return hex; -} -var supportsSubtleSHA1 = null; -async function shasum(buffer2) { - if (supportsSubtleSHA1 === null) { - supportsSubtleSHA1 = await testSubtleSHA1(); - } - return supportsSubtleSHA1 ? subtleSHA1(buffer2) : shasumSync(buffer2); -} -function shasumSync(buffer2) { - return new import_sha1.default().update(buffer2).digest("hex"); -} -async function subtleSHA1(buffer2) { - const hash2 = await crypto.subtle.digest("SHA-1", buffer2); - return toHex(hash2); -} -async function testSubtleSHA1() { - try { - const hash2 = await subtleSHA1(new Uint8Array([])); - if (hash2 === "da39a3ee5e6b4b0d3255bfef95601890afd80709") - return true; - } catch (_) { - } - return false; -} -function parseCacheEntryFlags(bits) { - return { - assumeValid: Boolean(bits & 32768), - extended: Boolean(bits & 16384), - stage: (bits & 12288) >> 12, - nameLength: bits & 4095 - }; -} -function renderCacheEntryFlags(entry) { - const flags = entry.flags; - flags.extended = false; - flags.nameLength = Math.min(Buffer.from(entry.path).length, 4095); - return (flags.assumeValid ? 32768 : 0) + (flags.extended ? 16384 : 0) + ((flags.stage & 3) << 12) + (flags.nameLength & 4095); -} -var GitIndex = class _GitIndex { - /*:: - _entries: Map - _dirty: boolean // Used to determine if index needs to be saved to filesystem - */ - constructor(entries, unmergedPaths) { - this._dirty = false; - this._unmergedPaths = unmergedPaths || /* @__PURE__ */ new Set(); - this._entries = entries || /* @__PURE__ */ new Map(); - } - _addEntry(entry) { - if (entry.flags.stage === 0) { - entry.stages = [entry]; - this._entries.set(entry.path, entry); - this._unmergedPaths.delete(entry.path); - } else { - let existingEntry = this._entries.get(entry.path); - if (!existingEntry) { - this._entries.set(entry.path, entry); - existingEntry = entry; - } - existingEntry.stages[entry.flags.stage] = entry; - this._unmergedPaths.add(entry.path); - } - } - static async from(buffer2) { - if (Buffer.isBuffer(buffer2)) { - return _GitIndex.fromBuffer(buffer2); - } else if (buffer2 === null) { - return new _GitIndex(null); - } else { - throw new InternalError("invalid type passed to GitIndex.from"); - } - } - static async fromBuffer(buffer2) { - if (buffer2.length === 0) { - throw new InternalError("Index file is empty (.git/index)"); - } - const index2 = new _GitIndex(); - const reader = new BufferCursor(buffer2); - const magic = reader.toString("utf8", 4); - if (magic !== "DIRC") { - throw new InternalError(`Invalid dircache magic file number: ${magic}`); - } - const shaComputed = await shasum(buffer2.slice(0, -20)); - const shaClaimed = buffer2.slice(-20).toString("hex"); - if (shaClaimed !== shaComputed) { - throw new InternalError( - `Invalid checksum in GitIndex buffer: expected ${shaClaimed} but saw ${shaComputed}` - ); - } - const version2 = reader.readUInt32BE(); - if (version2 !== 2) { - throw new InternalError(`Unsupported dircache version: ${version2}`); - } - const numEntries = reader.readUInt32BE(); - let i = 0; - while (!reader.eof() && i < numEntries) { - const entry = {}; - entry.ctimeSeconds = reader.readUInt32BE(); - entry.ctimeNanoseconds = reader.readUInt32BE(); - entry.mtimeSeconds = reader.readUInt32BE(); - entry.mtimeNanoseconds = reader.readUInt32BE(); - entry.dev = reader.readUInt32BE(); - entry.ino = reader.readUInt32BE(); - entry.mode = reader.readUInt32BE(); - entry.uid = reader.readUInt32BE(); - entry.gid = reader.readUInt32BE(); - entry.size = reader.readUInt32BE(); - entry.oid = reader.slice(20).toString("hex"); - const flags = reader.readUInt16BE(); - entry.flags = parseCacheEntryFlags(flags); - const pathlength = buffer2.indexOf(0, reader.tell() + 1) - reader.tell(); - if (pathlength < 1) { - throw new InternalError(`Got a path length of: ${pathlength}`); - } - entry.path = reader.toString("utf8", pathlength); - if (entry.path.includes("..\\") || entry.path.includes("../")) { - throw new UnsafeFilepathError(entry.path); - } - let padding = 8 - (reader.tell() - 12) % 8; - if (padding === 0) - padding = 8; - while (padding--) { - const tmp = reader.readUInt8(); - if (tmp !== 0) { - throw new InternalError( - `Expected 1-8 null characters but got '${tmp}' after ${entry.path}` - ); - } else if (reader.eof()) { - throw new InternalError("Unexpected end of file"); - } - } - entry.stages = []; - index2._addEntry(entry); - i++; - } - return index2; - } - get unmergedPaths() { - return [...this._unmergedPaths]; - } - get entries() { - return [...this._entries.values()].sort(comparePath); - } - get entriesMap() { - return this._entries; - } - get entriesFlat() { - return [...this.entries].flatMap((entry) => { - return entry.stages.length > 1 ? entry.stages.filter((x) => x) : entry; - }); - } - *[Symbol.iterator]() { - for (const entry of this.entries) { - yield entry; - } - } - insert({ filepath, stats, oid, stage = 0 }) { - if (!stats) { - stats = { - ctimeSeconds: 0, - ctimeNanoseconds: 0, - mtimeSeconds: 0, - mtimeNanoseconds: 0, - dev: 0, - ino: 0, - mode: 0, - uid: 0, - gid: 0, - size: 0 - }; - } - stats = normalizeStats(stats); - const bfilepath = Buffer.from(filepath); - const entry = { - ctimeSeconds: stats.ctimeSeconds, - ctimeNanoseconds: stats.ctimeNanoseconds, - mtimeSeconds: stats.mtimeSeconds, - mtimeNanoseconds: stats.mtimeNanoseconds, - dev: stats.dev, - ino: stats.ino, - // We provide a fallback value for `mode` here because not all fs - // implementations assign it, but we use it in GitTree. - // '100644' is for a "regular non-executable file" - mode: stats.mode || 33188, - uid: stats.uid, - gid: stats.gid, - size: stats.size, - path: filepath, - oid, - flags: { - assumeValid: false, - extended: false, - stage, - nameLength: bfilepath.length < 4095 ? bfilepath.length : 4095 - }, - stages: [] - }; - this._addEntry(entry); - this._dirty = true; - } - delete({ filepath }) { - if (this._entries.has(filepath)) { - this._entries.delete(filepath); - } else { - for (const key2 of this._entries.keys()) { - if (key2.startsWith(filepath + "/")) { - this._entries.delete(key2); - } - } - } - if (this._unmergedPaths.has(filepath)) { - this._unmergedPaths.delete(filepath); - } - this._dirty = true; - } - clear() { - this._entries.clear(); - this._dirty = true; - } - has({ filepath }) { - return this._entries.has(filepath); - } - render() { - return this.entries.map((entry) => `${entry.mode.toString(8)} ${entry.oid} ${entry.path}`).join("\n"); - } - static async _entryToBuffer(entry) { - const bpath = Buffer.from(entry.path); - const length = Math.ceil((62 + bpath.length + 1) / 8) * 8; - const written = Buffer.alloc(length); - const writer = new BufferCursor(written); - const stat = normalizeStats(entry); - writer.writeUInt32BE(stat.ctimeSeconds); - writer.writeUInt32BE(stat.ctimeNanoseconds); - writer.writeUInt32BE(stat.mtimeSeconds); - writer.writeUInt32BE(stat.mtimeNanoseconds); - writer.writeUInt32BE(stat.dev); - writer.writeUInt32BE(stat.ino); - writer.writeUInt32BE(stat.mode); - writer.writeUInt32BE(stat.uid); - writer.writeUInt32BE(stat.gid); - writer.writeUInt32BE(stat.size); - writer.write(entry.oid, 20, "hex"); - writer.writeUInt16BE(renderCacheEntryFlags(entry)); - writer.write(entry.path, bpath.length, "utf8"); - return written; - } - async toObject() { - const header = Buffer.alloc(12); - const writer = new BufferCursor(header); - writer.write("DIRC", 4, "utf8"); - writer.writeUInt32BE(2); - writer.writeUInt32BE(this.entriesFlat.length); - let entryBuffers = []; - for (const entry of this.entries) { - entryBuffers.push(_GitIndex._entryToBuffer(entry)); - if (entry.stages.length > 1) { - for (const stage of entry.stages) { - if (stage && stage !== entry) { - entryBuffers.push(_GitIndex._entryToBuffer(stage)); - } - } - } - } - entryBuffers = await Promise.all(entryBuffers); - const body = Buffer.concat(entryBuffers); - const main = Buffer.concat([header, body]); - const sum = await shasum(main); - return Buffer.concat([main, Buffer.from(sum, "hex")]); - } -}; -function compareStats(entry, stats) { - const e = normalizeStats(entry); - const s = normalizeStats(stats); - const staleness = e.mode !== s.mode || e.mtimeSeconds !== s.mtimeSeconds || e.ctimeSeconds !== s.ctimeSeconds || e.uid !== s.uid || e.gid !== s.gid || e.ino !== s.ino || e.size !== s.size; - return staleness; -} -var lock = null; -var IndexCache = Symbol("IndexCache"); -function createCache() { - return { - map: /* @__PURE__ */ new Map(), - stats: /* @__PURE__ */ new Map() - }; -} -async function updateCachedIndexFile(fs, filepath, cache) { - const stat = await fs.lstat(filepath); - const rawIndexFile = await fs.read(filepath); - const index2 = await GitIndex.from(rawIndexFile); - cache.map.set(filepath, index2); - cache.stats.set(filepath, stat); -} -async function isIndexStale(fs, filepath, cache) { - const savedStats = cache.stats.get(filepath); - if (savedStats === void 0) - return true; - const currStats = await fs.lstat(filepath); - if (savedStats === null) - return false; - if (currStats === null) - return false; - return compareStats(savedStats, currStats); -} -var GitIndexManager = class { - /** - * - * @param {object} opts - * @param {import('../models/FileSystem.js').FileSystem} opts.fs - * @param {string} opts.gitdir - * @param {object} opts.cache - * @param {bool} opts.allowUnmerged - * @param {function(GitIndex): any} closure - */ - static async acquire({ fs, gitdir, cache, allowUnmerged = true }, closure) { - if (!cache[IndexCache]) - cache[IndexCache] = createCache(); - const filepath = `${gitdir}/index`; - if (lock === null) - lock = new import_async_lock.default({ maxPending: Infinity }); - let result; - let unmergedPaths = []; - await lock.acquire(filepath, async () => { - if (await isIndexStale(fs, filepath, cache[IndexCache])) { - await updateCachedIndexFile(fs, filepath, cache[IndexCache]); - } - const index2 = cache[IndexCache].map.get(filepath); - unmergedPaths = index2.unmergedPaths; - if (unmergedPaths.length && !allowUnmerged) - throw new UnmergedPathsError(unmergedPaths); - result = await closure(index2); - if (index2._dirty) { - const buffer2 = await index2.toObject(); - await fs.write(filepath, buffer2); - cache[IndexCache].stats.set(filepath, await fs.lstat(filepath)); - index2._dirty = false; - } - }); - return result; - } -}; -function basename(path2) { - const last2 = Math.max(path2.lastIndexOf("/"), path2.lastIndexOf("\\")); - if (last2 > -1) { - path2 = path2.slice(last2 + 1); - } - return path2; -} -function dirname(path2) { - const last2 = Math.max(path2.lastIndexOf("/"), path2.lastIndexOf("\\")); - if (last2 === -1) - return "."; - if (last2 === 0) - return "/"; - return path2.slice(0, last2); -} -function flatFileListToDirectoryStructure(files) { - const inodes = /* @__PURE__ */ new Map(); - const mkdir = function(name) { - if (!inodes.has(name)) { - const dir = { - type: "tree", - fullpath: name, - basename: basename(name), - metadata: {}, - children: [] - }; - inodes.set(name, dir); - dir.parent = mkdir(dirname(name)); - if (dir.parent && dir.parent !== dir) - dir.parent.children.push(dir); - } - return inodes.get(name); - }; - const mkfile = function(name, metadata) { - if (!inodes.has(name)) { - const file = { - type: "blob", - fullpath: name, - basename: basename(name), - metadata, - // This recursively generates any missing parent folders. - parent: mkdir(dirname(name)), - children: [] - }; - if (file.parent) - file.parent.children.push(file); - inodes.set(name, file); - } - return inodes.get(name); - }; - mkdir("."); - for (const file of files) { - mkfile(file.path, file); - } - return inodes; -} -function mode2type(mode) { - switch (mode) { - case 16384: - return "tree"; - case 33188: - return "blob"; - case 33261: - return "blob"; - case 40960: - return "blob"; - case 57344: - return "commit"; - } - throw new InternalError(`Unexpected GitTree entry mode: ${mode.toString(8)}`); -} -var GitWalkerIndex = class { - constructor({ fs, gitdir, cache }) { - this.treePromise = GitIndexManager.acquire( - { fs, gitdir, cache }, - async function(index2) { - return flatFileListToDirectoryStructure(index2.entries); - } - ); - const walker = this; - this.ConstructEntry = class StageEntry { - constructor(fullpath) { - this._fullpath = fullpath; - this._type = false; - this._mode = false; - this._stat = false; - this._oid = false; - } - async type() { - return walker.type(this); - } - async mode() { - return walker.mode(this); - } - async stat() { - return walker.stat(this); - } - async content() { - return walker.content(this); - } - async oid() { - return walker.oid(this); - } - }; - } - async readdir(entry) { - const filepath = entry._fullpath; - const tree = await this.treePromise; - const inode = tree.get(filepath); - if (!inode) - return null; - if (inode.type === "blob") - return null; - if (inode.type !== "tree") { - throw new Error(`ENOTDIR: not a directory, scandir '${filepath}'`); - } - const names = inode.children.map((inode2) => inode2.fullpath); - names.sort(compareStrings); - return names; - } - async type(entry) { - if (entry._type === false) { - await entry.stat(); - } - return entry._type; - } - async mode(entry) { - if (entry._mode === false) { - await entry.stat(); - } - return entry._mode; - } - async stat(entry) { - if (entry._stat === false) { - const tree = await this.treePromise; - const inode = tree.get(entry._fullpath); - if (!inode) { - throw new Error( - `ENOENT: no such file or directory, lstat '${entry._fullpath}'` - ); - } - const stats = inode.type === "tree" ? {} : normalizeStats(inode.metadata); - entry._type = inode.type === "tree" ? "tree" : mode2type(stats.mode); - entry._mode = stats.mode; - if (inode.type === "tree") { - entry._stat = void 0; - } else { - entry._stat = stats; - } - } - return entry._stat; - } - async content(_entry) { - } - async oid(entry) { - if (entry._oid === false) { - const tree = await this.treePromise; - const inode = tree.get(entry._fullpath); - entry._oid = inode.metadata.oid; - } - return entry._oid; - } -}; -var GitWalkSymbol = Symbol("GitWalkSymbol"); -function STAGE() { - const o = /* @__PURE__ */ Object.create(null); - Object.defineProperty(o, GitWalkSymbol, { - value: function({ fs, gitdir, cache }) { - return new GitWalkerIndex({ fs, gitdir, cache }); - } - }); - Object.freeze(o); - return o; -} -var NotFoundError = class _NotFoundError extends BaseError { - /** - * @param {string} what - */ - constructor(what) { - super(`Could not find ${what}.`); - this.code = this.name = _NotFoundError.code; - this.data = { what }; - } -}; -NotFoundError.code = "NotFoundError"; -var ObjectTypeError = class _ObjectTypeError extends BaseError { - /** - * @param {string} oid - * @param {'blob'|'commit'|'tag'|'tree'} actual - * @param {'blob'|'commit'|'tag'|'tree'} expected - * @param {string} [filepath] - */ - constructor(oid, actual, expected, filepath) { - super( - `Object ${oid} ${filepath ? `at ${filepath}` : ""}was anticipated to be a ${expected} but it is a ${actual}.` - ); - this.code = this.name = _ObjectTypeError.code; - this.data = { oid, actual, expected, filepath }; - } -}; -ObjectTypeError.code = "ObjectTypeError"; -var InvalidOidError = class _InvalidOidError extends BaseError { - /** - * @param {string} value - */ - constructor(value) { - super(`Expected a 40-char hex object id but saw "${value}".`); - this.code = this.name = _InvalidOidError.code; - this.data = { value }; - } -}; -InvalidOidError.code = "InvalidOidError"; -var NoRefspecError = class _NoRefspecError extends BaseError { - /** - * @param {string} remote - */ - constructor(remote) { - super(`Could not find a fetch refspec for remote "${remote}". Make sure the config file has an entry like the following: -[remote "${remote}"] +var Jk=Object.create;var Ca=Object.defineProperty;var Qk=Object.getOwnPropertyDescriptor;var eA=Object.getOwnPropertyNames;var tA=Object.getPrototypeOf,nA=Object.prototype.hasOwnProperty;var rA=(t,e,n)=>e in t?Ca(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var iA=(t,e)=>()=>(t&&(e=t(t=0)),e);var R=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),aA=(t,e)=>{for(var n in e)Ca(t,n,{get:e[n],enumerable:!0})},om=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of eA(e))!nA.call(t,i)&&i!==n&&Ca(t,i,{get:()=>e[i],enumerable:!(r=Qk(e,i))||r.enumerable});return t};var Ze=(t,e,n)=>(n=t!=null?Jk(tA(t)):{},om(e||!t||!t.__esModule?Ca(n,"default",{value:t,enumerable:!0}):n,t)),sA=t=>om(Ca({},"__esModule",{value:!0}),t);var ct=(t,e,n)=>rA(t,typeof e!="symbol"?e+"":e,n);var um=R(co=>{"use strict";v();co.byteLength=lA;co.toByteArray=uA;co.fromByteArray=dA;var vn=[],Zt=[],oA=typeof Uint8Array!="undefined"?Uint8Array:Array,pu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Tr=0,lm=pu.length;Tr0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function lA(t){var e=cm(t),n=e[0],r=e[1];return(n+r)*3/4-r}function cA(t,e,n){return(e+n)*3/4-n}function uA(t){var e,n=cm(t),r=n[0],i=n[1],a=new oA(cA(t,r,i)),s=0,o=i>0?r-4:r,l;for(l=0;l>16&255,a[s++]=e>>8&255,a[s++]=e&255;return i===2&&(e=Zt[t.charCodeAt(l)]<<2|Zt[t.charCodeAt(l+1)]>>4,a[s++]=e&255),i===1&&(e=Zt[t.charCodeAt(l)]<<10|Zt[t.charCodeAt(l+1)]<<4|Zt[t.charCodeAt(l+2)]>>2,a[s++]=e>>8&255,a[s++]=e&255),a}function fA(t){return vn[t>>18&63]+vn[t>>12&63]+vn[t>>6&63]+vn[t&63]}function hA(t,e,n){for(var r,i=[],a=e;ao?o:s+a));return r===1?(e=t[n-1],i.push(vn[e>>2]+vn[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(vn[e>>10]+vn[e>>4&63]+vn[e<<2&63]+"=")),i.join("")}});var fm=R(mu=>{v();mu.read=function(t,e,n,r,i){var a,s,o=i*8-r-1,l=(1<>1,u=-7,f=n?i-1:0,h=n?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=o;u>0;a=a*256+t[e+f],f+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=r;u>0;s=s*256+t[e+f],f+=h,u-=8);if(a===0)a=1-c;else{if(a===l)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,r),a=a-c}return(d?-1:1)*s*Math.pow(2,a-r)};mu.write=function(t,e,n,r,i,a){var s,o,l,c=a*8-i-1,u=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=h/l:e+=h*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=u?(o=0,s=u):s+f>=1?(o=(e*l-1)*Math.pow(2,i),s=s+f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[n+d]=o&255,d+=p,o/=256,i-=8);for(s=s<0;t[n+d]=s&255,d+=p,s/=256,c-=8);t[n+d-p]|=g*128}});var Eu=R(ui=>{"use strict";v();var gu=um(),li=fm(),hm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=P;ui.SlowBuffer=wA;ui.INSPECT_MAX_BYTES=50;var uo=2147483647;ui.kMaxLength=uo;P.TYPED_ARRAY_SUPPORT=pA();!P.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 pA(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(P.prototype,"parent",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.buffer}});Object.defineProperty(P.prototype,"offset",{enumerable:!0,get:function(){if(P.isBuffer(this))return this.byteOffset}});function Ln(t){if(t>uo)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,P.prototype),e}function P(t,e,n){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return bu(t)}return gm(t,e,n)}P.poolSize=8192;function gm(t,e,n){if(typeof t=="string")return gA(t,e);if(ArrayBuffer.isView(t))return yA(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(wn(t,ArrayBuffer)||t&&wn(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(wn(t,SharedArrayBuffer)||t&&wn(t.buffer,SharedArrayBuffer)))return vu(t,e,n);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=t.valueOf&&t.valueOf();if(r!=null&&r!==t)return P.from(r,e,n);let i=vA(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return P.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}P.from=function(t,e,n){return gm(t,e,n)};Object.setPrototypeOf(P.prototype,Uint8Array.prototype);Object.setPrototypeOf(P,Uint8Array);function ym(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function mA(t,e,n){return ym(t),t<=0?Ln(t):e!==void 0?typeof n=="string"?Ln(t).fill(e,n):Ln(t).fill(e):Ln(t)}P.alloc=function(t,e,n){return mA(t,e,n)};function bu(t){return ym(t),Ln(t<0?0:xu(t)|0)}P.allocUnsafe=function(t){return bu(t)};P.allocUnsafeSlow=function(t){return bu(t)};function gA(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!P.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let n=vm(t,e)|0,r=Ln(n),i=r.write(t,e);return i!==n&&(r=r.slice(0,i)),r}function yu(t){let e=t.length<0?0:xu(t.length)|0,n=Ln(e);for(let r=0;r=uo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+uo.toString(16)+" bytes");return t|0}function wA(t){return+t!=t&&(t=0),P.alloc(+t)}P.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==P.prototype};P.compare=function(e,n){if(wn(e,Uint8Array)&&(e=P.from(e,e.offset,e.byteLength)),wn(n,Uint8Array)&&(n=P.from(n,n.offset,n.byteLength)),!P.isBuffer(e)||!P.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===n)return 0;let r=e.length,i=n.length;for(let a=0,s=Math.min(r,i);ai.length?(P.isBuffer(s)||(s=P.from(s)),s.copy(i,a)):Uint8Array.prototype.set.call(i,s,a);else if(P.isBuffer(s))s.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=s.length}return i};function vm(t,e){if(P.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||wn(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let n=t.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return wu(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Tm(t).length;default:if(i)return r?-1:wu(t).length;e=(""+e).toLowerCase(),i=!0}}P.byteLength=vm;function bA(t,e,n){let r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return MA(this,e,n);case"utf8":case"utf-8":return bm(this,e,n);case"ascii":return CA(this,e,n);case"latin1":case"binary":return FA(this,e,n);case"base64":return AA(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return OA(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}P.prototype._isBuffer=!0;function Cr(t,e,n){let r=t[e];t[e]=t[n],t[n]=r}P.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;nn&&(e+=" ... "),""};hm&&(P.prototype[hm]=P.prototype.inspect);P.prototype.compare=function(e,n,r,i,a){if(wn(e,Uint8Array)&&(e=P.from(e,e.offset,e.byteLength)),!P.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(n===void 0&&(n=0),r===void 0&&(r=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),n<0||r>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&n>=r)return 0;if(i>=a)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,a>>>=0,this===e)return 0;let s=a-i,o=r-n,l=Math.min(s,o),c=this.slice(i,a),u=e.slice(n,r);for(let f=0;f2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Su(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof e=="string"&&(e=P.from(e,r)),P.isBuffer(e))return e.length===0?-1:dm(t,e,n,r,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):dm(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function dm(t,e,n,r,i){let a=1,s=t.length,o=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(t.length<2||e.length<2)return-1;a=2,s/=2,o/=2,n/=2}function l(u,f){return a===1?u[f]:u.readUInt16BE(f*a)}let c;if(i){let u=-1;for(c=n;cs&&(n=s-o),c=n;c>=0;c--){let u=!0;for(let f=0;fi&&(r=i)):r=i;let a=e.length;r>a/2&&(r=a/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let a=this.length-n;if((r===void 0||r>a)&&(r=a),e.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return xA(this,e,n,r);case"utf8":case"utf-8":return _A(this,e,n,r);case"ascii":case"latin1":case"binary":return SA(this,e,n,r);case"base64":return EA(this,e,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kA(this,e,n,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};P.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function AA(t,e,n){return e===0&&n===t.length?gu.fromByteArray(t):gu.fromByteArray(t.slice(e,n))}function bm(t,e,n){n=Math.min(t.length,n);let r=[],i=e;for(;i239?4:a>223?3:a>191?2:1;if(i+o<=n){let l,c,u,f;switch(o){case 1:a<128&&(s=a);break;case 2:l=t[i+1],(l&192)===128&&(f=(a&31)<<6|l&63,f>127&&(s=f));break;case 3:l=t[i+1],c=t[i+2],(l&192)===128&&(c&192)===128&&(f=(a&15)<<12|(l&63)<<6|c&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(f=(a&15)<<18|(l&63)<<12|(c&63)<<6|u&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),i+=o}return TA(r)}var pm=4096;function TA(t){let e=t.length;if(e<=pm)return String.fromCharCode.apply(String,t);let n="",r=0;for(;rr)&&(n=r);let i="";for(let a=e;ar&&(e=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),nn)throw new RangeError("Trying to access beyond buffer length")}P.prototype.readUintLE=P.prototype.readUIntLE=function(e,n,r){e=e>>>0,n=n>>>0,r||ut(e,n,this.length);let i=this[e],a=1,s=0;for(;++s>>0,n=n>>>0,r||ut(e,n,this.length);let i=this[e+--n],a=1;for(;n>0&&(a*=256);)i+=this[e+--n]*a;return i};P.prototype.readUint8=P.prototype.readUInt8=function(e,n){return e=e>>>0,n||ut(e,1,this.length),this[e]};P.prototype.readUint16LE=P.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||ut(e,2,this.length),this[e]|this[e+1]<<8};P.prototype.readUint16BE=P.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||ut(e,2,this.length),this[e]<<8|this[e+1]};P.prototype.readUint32LE=P.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||ut(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};P.prototype.readUint32BE=P.prototype.readUInt32BE=function(e,n){return e=e>>>0,n||ut(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};P.prototype.readBigUInt64LE=Kn(function(e){e=e>>>0,ci(e,"offset");let n=this[e],r=this[e+7];(n===void 0||r===void 0)&&Fa(e,this.length-8);let i=n+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,a=this[++e]+this[++e]*2**8+this[++e]*2**16+r*2**24;return BigInt(i)+(BigInt(a)<>>0,ci(e,"offset");let n=this[e],r=this[e+7];(n===void 0||r===void 0)&&Fa(e,this.length-8);let i=n*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],a=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+r;return(BigInt(i)<>>0,n=n>>>0,r||ut(e,n,this.length);let i=this[e],a=1,s=0;for(;++s=a&&(i-=Math.pow(2,8*n)),i};P.prototype.readIntBE=function(e,n,r){e=e>>>0,n=n>>>0,r||ut(e,n,this.length);let i=n,a=1,s=this[e+--i];for(;i>0&&(a*=256);)s+=this[e+--i]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*n)),s};P.prototype.readInt8=function(e,n){return e=e>>>0,n||ut(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};P.prototype.readInt16LE=function(e,n){e=e>>>0,n||ut(e,2,this.length);let r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};P.prototype.readInt16BE=function(e,n){e=e>>>0,n||ut(e,2,this.length);let r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};P.prototype.readInt32LE=function(e,n){return e=e>>>0,n||ut(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};P.prototype.readInt32BE=function(e,n){return e=e>>>0,n||ut(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};P.prototype.readBigInt64LE=Kn(function(e){e=e>>>0,ci(e,"offset");let n=this[e],r=this[e+7];(n===void 0||r===void 0)&&Fa(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(r<<24);return(BigInt(i)<>>0,ci(e,"offset");let n=this[e],r=this[e+7];(n===void 0||r===void 0)&&Fa(e,this.length-8);let i=(n<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<>>0,n||ut(e,4,this.length),li.read(this,e,!0,23,4)};P.prototype.readFloatBE=function(e,n){return e=e>>>0,n||ut(e,4,this.length),li.read(this,e,!1,23,4)};P.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||ut(e,8,this.length),li.read(this,e,!0,52,8)};P.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||ut(e,8,this.length),li.read(this,e,!1,52,8)};function Mt(t,e,n,r,i,a){if(!P.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}P.prototype.writeUintLE=P.prototype.writeUIntLE=function(e,n,r,i){if(e=+e,n=n>>>0,r=r>>>0,!i){let o=Math.pow(2,8*r)-1;Mt(this,e,n,r,o,0)}let a=1,s=0;for(this[n]=e&255;++s>>0,r=r>>>0,!i){let o=Math.pow(2,8*r)-1;Mt(this,e,n,r,o,0)}let a=r-1,s=1;for(this[n+a]=e&255;--a>=0&&(s*=256);)this[n+a]=e/s&255;return n+r};P.prototype.writeUint8=P.prototype.writeUInt8=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,1,255,0),this[n]=e&255,n+1};P.prototype.writeUint16LE=P.prototype.writeUInt16LE=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,2,65535,0),this[n]=e&255,this[n+1]=e>>>8,n+2};P.prototype.writeUint16BE=P.prototype.writeUInt16BE=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,2,65535,0),this[n]=e>>>8,this[n+1]=e&255,n+2};P.prototype.writeUint32LE=P.prototype.writeUInt32LE=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,4,4294967295,0),this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=e&255,n+4};P.prototype.writeUint32BE=P.prototype.writeUInt32BE=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,4,4294967295,0),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};function xm(t,e,n,r,i){Am(e,r,i,t,n,7);let a=Number(e&BigInt(4294967295));t[n++]=a,a=a>>8,t[n++]=a,a=a>>8,t[n++]=a,a=a>>8,t[n++]=a;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n++]=s,s=s>>8,t[n++]=s,s=s>>8,t[n++]=s,s=s>>8,t[n++]=s,n}function _m(t,e,n,r,i){Am(e,r,i,t,n,7);let a=Number(e&BigInt(4294967295));t[n+7]=a,a=a>>8,t[n+6]=a,a=a>>8,t[n+5]=a,a=a>>8,t[n+4]=a;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[n+3]=s,s=s>>8,t[n+2]=s,s=s>>8,t[n+1]=s,s=s>>8,t[n]=s,n+8}P.prototype.writeBigUInt64LE=Kn(function(e,n=0){return xm(this,e,n,BigInt(0),BigInt("0xffffffffffffffff"))});P.prototype.writeBigUInt64BE=Kn(function(e,n=0){return _m(this,e,n,BigInt(0),BigInt("0xffffffffffffffff"))});P.prototype.writeIntLE=function(e,n,r,i){if(e=+e,n=n>>>0,!i){let l=Math.pow(2,8*r-1);Mt(this,e,n,r,l-1,-l)}let a=0,s=1,o=0;for(this[n]=e&255;++a>0)-o&255;return n+r};P.prototype.writeIntBE=function(e,n,r,i){if(e=+e,n=n>>>0,!i){let l=Math.pow(2,8*r-1);Mt(this,e,n,r,l-1,-l)}let a=r-1,s=1,o=0;for(this[n+a]=e&255;--a>=0&&(s*=256);)e<0&&o===0&&this[n+a+1]!==0&&(o=1),this[n+a]=(e/s>>0)-o&255;return n+r};P.prototype.writeInt8=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,1,127,-128),e<0&&(e=255+e+1),this[n]=e&255,n+1};P.prototype.writeInt16LE=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,2,32767,-32768),this[n]=e&255,this[n+1]=e>>>8,n+2};P.prototype.writeInt16BE=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,2,32767,-32768),this[n]=e>>>8,this[n+1]=e&255,n+2};P.prototype.writeInt32LE=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,4,2147483647,-2147483648),this[n]=e&255,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24,n+4};P.prototype.writeInt32BE=function(e,n,r){return e=+e,n=n>>>0,r||Mt(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};P.prototype.writeBigInt64LE=Kn(function(e,n=0){return xm(this,e,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});P.prototype.writeBigInt64BE=Kn(function(e,n=0){return _m(this,e,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Sm(t,e,n,r,i,a){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Em(t,e,n,r,i){return e=+e,n=n>>>0,i||Sm(t,e,n,4,34028234663852886e22,-34028234663852886e22),li.write(t,e,n,r,23,4),n+4}P.prototype.writeFloatLE=function(e,n,r){return Em(this,e,n,!0,r)};P.prototype.writeFloatBE=function(e,n,r){return Em(this,e,n,!1,r)};function km(t,e,n,r,i){return e=+e,n=n>>>0,i||Sm(t,e,n,8,17976931348623157e292,-17976931348623157e292),li.write(t,e,n,r,52,8),n+8}P.prototype.writeDoubleLE=function(e,n,r){return km(this,e,n,!0,r)};P.prototype.writeDoubleBE=function(e,n,r){return km(this,e,n,!1,r)};P.prototype.copy=function(e,n,r,i){if(!P.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!i&&i!==0&&(i=this.length),n>=e.length&&(n=e.length),n||(n=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-n>>0,r=r===void 0?this.length:r>>>0,e||(e=0);let a;if(typeof e=="number")for(a=n;a2**32?i=mm(String(n)):typeof n=="bigint"&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=mm(i)),i+="n"),r+=` It must be ${e}. Received ${i}`,r},RangeError);function mm(t){let e="",n=t.length,r=t[0]==="-"?1:0;for(;n>=r+4;n-=3)e=`_${t.slice(n-3,n)}${e}`;return`${t.slice(0,n)}${e}`}function PA(t,e,n){ci(e,"offset"),(t[e]===void 0||t[e+n]===void 0)&&Fa(e,t.length-(n+1))}function Am(t,e,n,r,i,a){if(t>n||t3?e===0||e===BigInt(0)?o=`>= 0${s} and < 2${s} ** ${(a+1)*8}${s}`:o=`>= -(2${s} ** ${(a+1)*8-1}${s}) and < 2 ** ${(a+1)*8-1}${s}`:o=`>= ${e}${s} and <= ${n}${s}`,new oi.ERR_OUT_OF_RANGE("value",o,t)}PA(r,i,a)}function ci(t,e){if(typeof t!="number")throw new oi.ERR_INVALID_ARG_TYPE(e,"number",t)}function Fa(t,e,n){throw Math.floor(t)!==t?(ci(t,n),new oi.ERR_OUT_OF_RANGE(n||"offset","an integer",t)):e<0?new oi.ERR_BUFFER_OUT_OF_BOUNDS:new oi.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${e}`,t)}var IA=/[^+/0-9A-Za-z-_]/g;function RA(t){if(t=t.split("=")[0],t=t.trim().replace(IA,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function wu(t,e){e=e||1/0;let n,r=t.length,i=null,a=[];for(let s=0;s55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(s+1===r){(e-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;a.push(n)}else if(n<2048){if((e-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((e-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((e-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return a}function LA(t){let e=[];for(let n=0;n>8,i=n%256,a.push(i),a.push(r);return a}function Tm(t){return gu.toByteArray(RA(t))}function fo(t,e,n,r){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}function wn(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Su(t){return t!==t}var DA=function(){let t="0123456789abcdef",e=new Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)e[r+i]=t[n]+t[i]}return e}();function Kn(t){return typeof BigInt=="undefined"?BA:t}function BA(){throw new Error("BigInt not supported")}});var Cm,ku,Buffer,v=iA(()=>{Cm=require("obsidian");Cm.Platform.isMobileApp?ku=Eu().Buffer:ku=global.Buffer;Buffer=ku});var Mm=R((p7,Fm)=>{"use strict";v();var $t=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process=="undefined"||typeof process.domain=="undefined")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||$t.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||$t.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||$t.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=$t.DEFAULT_MAX_PENDING};$t.DEFAULT_TIMEOUT=0;$t.DEFAULT_MAX_OCCUPATION_TIME=0;$t.DEFAULT_MAX_EXECUTION_TIME=0;$t.DEFAULT_MAX_PENDING=1e3;$t.prototype.acquire=function(t,e,n,r){if(Array.isArray(t))return this._acquireBatch(t,e,n,r);if(typeof e!="function")throw new Error("You must pass a function to execute");var i=null,a=null,s=null;typeof n!="function"&&(r=n,n=null,s=new this.Promise(function(b,S){i=b,a=S})),r=r||{};var o=!1,l=null,c=null,u=null,f=this,h=function(b,S,k){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(f.queues[t]&&f.queues[t].length===0&&delete f.queues[t],f.domainReentrant&&delete f.domains[t]),o||(s?S?a(S):i(k):typeof n=="function"&&n(S,k),o=!0),b&&f.queues[t]&&f.queues[t].length>0&&f.queues[t].shift()()},d=function(b){if(o)return h(b);l&&(clearTimeout(l),l=null),f.domainReentrant&&b&&(f.domains[t]=process.domain);var S=r.maxExecutionTime||f.maxExecutionTime;if(S&&(u=setTimeout(function(){f.queues[t]&&h(b,new Error("Maximum execution time is exceeded "+t))},S)),e.length===1){var k=!1;try{e(function(x,A){k||(k=!0,h(b,x,A))})}catch(x){k||(k=!0,h(b,x))}}else f._promiseTry(function(){return e()}).then(function(x){h(b,void 0,x)},function(x){h(b,x)})};f.domainReentrant&&process.domain&&(d=process.domain.bind(d));var p=r.maxPending||f.maxPending;if(!f.queues[t])f.queues[t]=[],d(!0);else if(f.domainReentrant&&process.domain&&process.domain===f.domains[t])d(!1);else if(f.queues[t].length>=p)h(!1,new Error("Too many pending tasks in queue "+t));else{var g=function(){d(!0)};r.skipQueue?f.queues[t].unshift(g):f.queues[t].push(g);var m=r.timeout||f.timeout;m&&(l=setTimeout(function(){l=null,h(!1,new Error("async-lock timed out in queue "+t))},m))}var w=r.maxOccupationTime||f.maxOccupationTime;if(w&&(c=setTimeout(function(){f.queues[t]&&h(!1,new Error("Maximum occupation time is exceeded in queue "+t))},w)),s)return s};$t.prototype._acquireBatch=function(t,e,n,r){typeof n!="function"&&(r=n,n=null);var i=this,a=function(o,l){return function(c){i.acquire(o,l,c,r)}},s=t.reduceRight(function(o,l){return a(l,o)},e);if(typeof n=="function")s(n);else return new this.Promise(function(o,l){s.length===1?s(function(c,u){c?l(c):o(u)}):o(s())})};$t.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};$t.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};Fm.exports=$t});var Pm=R((g7,Om)=>{"use strict";v();Om.exports=Mm()});var Im=R((v7,Au)=>{v();typeof Object.create=="function"?Au.exports=function(e,n){n&&(e.super_=n,e.prototype=Object.create(n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Au.exports=function(e,n){if(n){e.super_=n;var r=function(){};r.prototype=n.prototype,e.prototype=new r,e.prototype.constructor=e}}});var Cu=R((Tu,Lm)=>{v();var ho=Eu(),bn=ho.Buffer;function Rm(t,e){for(var n in t)e[n]=t[n]}bn.from&&bn.alloc&&bn.allocUnsafe&&bn.allocUnsafeSlow?Lm.exports=ho:(Rm(ho,Tu),Tu.Buffer=Fr);function Fr(t,e,n){return bn(t,e,n)}Fr.prototype=Object.create(bn.prototype);Rm(bn,Fr);Fr.from=function(t,e,n){if(typeof t=="number")throw new TypeError("Argument must not be a number");return bn(t,e,n)};Fr.alloc=function(t,e,n){if(typeof t!="number")throw new TypeError("Argument must be a number");var r=bn(t);return e!==void 0?typeof n=="string"?r.fill(e,n):r.fill(e):r.fill(0),r};Fr.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return bn(t)};Fr.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ho.SlowBuffer(t)}});var Bm=R((x7,Dm)=>{v();var jm=Cu().Buffer;function po(t,e){this._block=jm.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}po.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=jm.from(t,e));for(var n=this._block,r=this._blockSize,i=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(n&4294967295)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a};po.prototype._update=function(){throw new Error("_update must be implemented by subclass")};Dm.exports=po});var Hm=R((S7,$m)=>{v();var NA=Im(),Nm=Bm(),$A=Cu().Buffer,HA=[1518500249,1859775393,-1894007588,-899497514],UA=new Array(80);function Ma(){this.init(),this._w=UA,Nm.call(this,64,56)}NA(Ma,Nm);Ma.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function zA(t){return t<<1|t>>>31}function GA(t){return t<<5|t>>>27}function VA(t){return t<<30|t>>>2}function WA(t,e,n,r){return t===0?e&n|~e&r:t===2?e&n|e&r|n&r:e^n^r}Ma.prototype._update=function(t){for(var e=this._w,n=this._a|0,r=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=zA(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=GA(n)+WA(c,r,i,a)+s+e[l]+HA[c]|0;s=a,a=i,i=VA(r),r=n,n=u}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0};Ma.prototype._hash=function(){var t=$A.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};$m.exports=Ma});var zm=R(Fu=>{v();var Um;(function(t){typeof DO_NOT_EXPORT_CRC=="undefined"?typeof Fu=="object"?t(Fu):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(Um={}):t(Um={})})(function(t){t.version="1.2.2";function e(){for(var y=0,E=new Array(256),_=0;_!=256;++_)y=_,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,E[_]=y;return typeof Int32Array!="undefined"?new Int32Array(E):E}var n=e();function r(y){var E=0,_=0,C=0,M=typeof Int32Array!="undefined"?new Int32Array(4096):new Array(4096);for(C=0;C!=256;++C)M[C]=y[C];for(C=0;C!=256;++C)for(_=y[C],E=256+C;E<4096;E+=256)_=M[E]=_>>>8^y[_&255];var L=[];for(C=1;C!=16;++C)L[C-1]=typeof Int32Array!="undefined"?M.subarray(C*256,C*256+256):M.slice(C*256,C*256+256);return L}var i=r(n),a=i[0],s=i[1],o=i[2],l=i[3],c=i[4],u=i[5],f=i[6],h=i[7],d=i[8],p=i[9],g=i[10],m=i[11],w=i[12],b=i[13],S=i[14];function k(y,E){for(var _=E^-1,C=0,M=y.length;C>>8^n[(_^y.charCodeAt(C++))&255];return~_}function x(y,E){for(var _=E^-1,C=y.length-15,M=0;M>8&255]^w[y[M++]^_>>16&255]^m[y[M++]^_>>>24]^g[y[M++]]^p[y[M++]]^d[y[M++]]^h[y[M++]]^f[y[M++]]^u[y[M++]]^c[y[M++]]^l[y[M++]]^o[y[M++]]^s[y[M++]]^a[y[M++]]^n[y[M++]];for(C+=15;M>>8^n[(_^y[M++])&255];return~_}function A(y,E){for(var _=E^-1,C=0,M=y.length,L=0,N=0;C>>8^n[(_^L)&255]:L<2048?(_=_>>>8^n[(_^(192|L>>6&31))&255],_=_>>>8^n[(_^(128|L&63))&255]):L>=55296&&L<57344?(L=(L&1023)+64,N=y.charCodeAt(C++)&1023,_=_>>>8^n[(_^(240|L>>8&7))&255],_=_>>>8^n[(_^(128|L>>2&63))&255],_=_>>>8^n[(_^(128|N>>6&15|(L&3)<<4))&255],_=_>>>8^n[(_^(128|N&63))&255]):(_=_>>>8^n[(_^(224|L>>12&15))&255],_=_>>>8^n[(_^(128|L>>6&63))&255],_=_>>>8^n[(_^(128|L&63))&255]);return~_}t.table=n,t.bstr=k,t.buf=x,t.str=A})});var jn=R(St=>{"use strict";v();var qA=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function XA(t,e){return Object.prototype.hasOwnProperty.call(t,e)}St.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(var r in n)XA(n,r)&&(t[r]=n[r])}}return t};St.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var YA={arraySet:function(t,e,n,r,i){if(e.subarray&&t.subarray){t.set(e.subarray(n,n+r),i);return}for(var a=0;a{"use strict";v();var KA=jn(),JA=4,Gm=0,Vm=1,QA=2;function hi(t){for(var e=t.length;--e>=0;)t[e]=0}var e3=0,Km=1,t3=2,n3=3,r3=258,ju=29,ja=256,Pa=ja+1+ju,fi=30,Du=19,Jm=2*Pa+1,Mr=15,Mu=16,i3=7,Bu=256,Qm=16,eg=17,tg=18,Ru=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],mo=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],a3=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ng=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s3=512,Dn=new Array((Pa+2)*2);hi(Dn);var Oa=new Array(fi*2);hi(Oa);var Ia=new Array(s3);hi(Ia);var Ra=new Array(r3-n3+1);hi(Ra);var Nu=new Array(ju);hi(Nu);var go=new Array(fi);hi(go);function Ou(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}var rg,ig,ag;function Pu(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function sg(t){return t<256?Ia[t]:Ia[256+(t>>>7)]}function La(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function Ot(t,e,n){t.bi_valid>Mu-n?(t.bi_buf|=e<>Mu-t.bi_valid,t.bi_valid+=n-Mu):(t.bi_buf|=e<>>=1,n<<=1;while(--e>0);return n>>>1}function o3(t){t.bi_valid===16?(La(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function l3(t,e){var n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,a=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length,c,u,f,h,d,p,g=0;for(h=0;h<=Mr;h++)t.bl_count[h]=0;for(n[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;cl&&(h=l,g++),n[u*2+1]=h,!(u>r)&&(t.bl_count[h]++,d=0,u>=o&&(d=s[u-o]),p=n[u*2],t.opt_len+=p*(h+d),a&&(t.static_len+=p*(i[u*2+1]+d)));if(g!==0){do{for(h=l-1;t.bl_count[h]===0;)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[l]--,g-=2}while(g>0);for(h=l;h!==0;h--)for(u=t.bl_count[h];u!==0;)f=t.heap[--c],!(f>r)&&(n[f*2+1]!==h&&(t.opt_len+=(h-n[f*2+1])*n[f*2],n[f*2+1]=h),u--)}}function lg(t,e,n){var r=new Array(Mr+1),i=0,a,s;for(a=1;a<=Mr;a++)r[a]=i=i+n[a-1]<<1;for(s=0;s<=e;s++){var o=t[s*2+1];o!==0&&(t[s*2]=og(r[o]++,o))}}function c3(){var t,e,n,r,i,a=new Array(Mr+1);for(n=0,r=0;r>=7;r8?La(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function u3(t,e,n,r){ug(t),r&&(La(t,n),La(t,~n)),KA.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}function Wm(t,e,n,r){var i=e*2,a=n*2;return t[i]>1;s>=1;s--)Iu(t,n,s);c=a;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Iu(t,n,1),o=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=o,n[c*2]=n[s*2]+n[o*2],t.depth[c]=(t.depth[s]>=t.depth[o]?t.depth[s]:t.depth[o])+1,n[s*2+1]=n[o*2+1]=c,t.heap[1]=c++,Iu(t,n,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],l3(t,e),lg(n,l,t.bl_count)}function Xm(t,e,n){var r,i=-1,a,s=e[0*2+1],o=0,l=7,c=4;for(s===0&&(l=138,c=3),e[(n+1)*2+1]=65535,r=0;r<=n;r++)a=s,s=e[(r+1)*2+1],!(++o=3&&t.bl_tree[ng[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function h3(t,e,n,r){var i;for(Ot(t,e-257,5),Ot(t,n-1,5),Ot(t,r-4,4),i=0;i>>=1)if(e&1&&t.dyn_ltree[n*2]!==0)return Gm;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Vm;for(n=32;n0?(t.strm.data_type===QA&&(t.strm.data_type=d3(t)),Lu(t,t.l_desc),Lu(t,t.d_desc),s=f3(t),i=t.opt_len+3+7>>>3,a=t.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&e!==-1?fg(t,e,n,r):t.strategy===JA||a===i?(Ot(t,(Km<<1)+(r?1:0),3),qm(t,Dn,Oa)):(Ot(t,(t3<<1)+(r?1:0),3),h3(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),qm(t,t.dyn_ltree,t.dyn_dtree)),cg(t),r&&ug(t)}function y3(t,e,n){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=n&255,t.last_lit++,e===0?t.dyn_ltree[n*2]++:(t.matches++,e--,t.dyn_ltree[(Ra[n]+ja+1)*2]++,t.dyn_dtree[sg(e)*2]++),t.last_lit===t.lit_bufsize-1}di._tr_init=p3;di._tr_stored_block=fg;di._tr_flush_block=g3;di._tr_tally=y3;di._tr_align=m3});var $u=R((O7,dg)=>{"use strict";v();function v3(t,e,n,r){for(var i=t&65535|0,a=t>>>16&65535|0,s=0;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+e[r++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}dg.exports=v3});var Hu=R((I7,pg)=>{"use strict";v();function w3(){for(var t,e=[],n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e}var b3=w3();function x3(t,e,n,r){var i=b3,a=r+n;t^=-1;for(var s=r;s>>8^i[(t^e[s])&255];return t^-1}pg.exports=x3});var yo=R((L7,mg)=>{"use strict";v();mg.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Eg=R(En=>{"use strict";v();var Et=jn(),Kt=hg(),wg=$u(),Jn=Hu(),_3=yo(),Rr=0,S3=1,E3=3,rr=4,gg=5,Sn=0,yg=1,Jt=-2,k3=-3,Uu=-5,A3=-1,T3=1,vo=2,C3=3,F3=4,M3=0,O3=2,_o=8,P3=9,I3=15,R3=8,L3=29,j3=256,Gu=j3+1+L3,D3=30,B3=19,N3=2*Gu+1,$3=15,me=3,tr=258,cn=tr+me+1,H3=32,So=42,Vu=69,wo=73,bo=91,xo=103,Or=113,Ba=666,ot=1,Na=2,Pr=3,gi=4,U3=3;function nr(t,e){return t.msg=_3[e],e}function vg(t){return(t<<1)-(t>4?9:0)}function er(t){for(var e=t.length;--e>=0;)t[e]=0}function Qn(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),n!==0&&(Et.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,e.pending===0&&(e.pending_out=0))}function ht(t,e){Kt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Qn(t.strm)}function ve(t,e){t.pending_buf[t.pending++]=e}function Da(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function z3(t,e,n,r){var i=t.avail_in;return i>r&&(i=r),i===0?0:(t.avail_in-=i,Et.arraySet(e,t.input,t.next_in,i,n),t.state.wrap===1?t.adler=wg(t.adler,e,i,n):t.state.wrap===2&&(t.adler=Jn(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)}function bg(t,e){var n=t.max_chain_length,r=t.strstart,i,a,s=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-cn?t.strstart-(t.w_size-cn):0,c=t.window,u=t.w_mask,f=t.prev,h=t.strstart+tr,d=c[r+s-1],p=c[r+s];t.prev_length>=t.good_match&&(n>>=2),o>t.lookahead&&(o=t.lookahead);do if(i=e,!(c[i+s]!==p||c[i+s-1]!==d||c[i]!==c[r]||c[++i]!==c[r+1])){r+=2,i++;do;while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&rs){if(t.match_start=e,s=a,a>=o)break;d=c[r+s-1],p=c[r+s]}}while((e=f[e&u])>l&&--n!==0);return s<=t.lookahead?s:t.lookahead}function Ir(t){var e=t.w_size,n,r,i,a,s;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-cn)){Et.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,r=t.hash_size,n=r;do i=t.head[--n],t.head[n]=i>=e?i-e:0;while(--r);r=e,n=r;do i=t.prev[--n],t.prev[n]=i>=e?i-e:0;while(--r);a+=e}if(t.strm.avail_in===0)break;if(r=z3(t.strm,t.window,t.strstart+t.lookahead,a),t.lookahead+=r,t.lookahead+t.insert>=me)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ir(t),t.lookahead===0&&e===Rr)return ot;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var r=t.block_start+n;if((t.strstart===0||t.strstart>=r)&&(t.lookahead=t.strstart-r,t.strstart=r,ht(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-cn&&(ht(t,!1),t.strm.avail_out===0))return ot}return t.insert=0,e===rr?(ht(t,!0),t.strm.avail_out===0?Pr:gi):(t.strstart>t.block_start&&(ht(t,!1),t.strm.avail_out===0),ot)}function zu(t,e){for(var n,r;;){if(t.lookahead=me&&(t.ins_h=(t.ins_h<=me)if(r=Kt._tr_tally(t,t.strstart-t.match_start,t.match_length-me),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=me){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=me&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=me-1)),t.prev_length>=me&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-me,r=Kt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-me),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=i&&(t.ins_h=(t.ins_h<=me&&t.strstart>0&&(i=t.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){a=t.strstart+tr;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=me?(n=Kt._tr_tally(t,1,t.match_length-me),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Kt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(ht(t,!1),t.strm.avail_out===0))return ot}return t.insert=0,e===rr?(ht(t,!0),t.strm.avail_out===0?Pr:gi):t.last_lit&&(ht(t,!1),t.strm.avail_out===0)?ot:Na}function W3(t,e){for(var n;;){if(t.lookahead===0&&(Ir(t),t.lookahead===0)){if(e===Rr)return ot;break}if(t.match_length=0,n=Kt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(ht(t,!1),t.strm.avail_out===0))return ot}return t.insert=0,e===rr?(ht(t,!0),t.strm.avail_out===0?Pr:gi):t.last_lit&&(ht(t,!1),t.strm.avail_out===0)?ot:Na}function _n(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}var mi;mi=[new _n(0,0,0,0,G3),new _n(4,4,8,4,zu),new _n(4,5,16,8,zu),new _n(4,6,32,32,zu),new _n(4,4,16,16,pi),new _n(8,16,32,32,pi),new _n(8,16,128,128,pi),new _n(8,32,128,256,pi),new _n(32,128,258,1024,pi),new _n(32,258,258,4096,pi)];function q3(t){t.window_size=2*t.w_size,er(t.head),t.max_lazy_match=mi[t.level].max_lazy,t.good_match=mi[t.level].good_length,t.nice_match=mi[t.level].nice_length,t.max_chain_length=mi[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=me-1,t.match_available=0,t.ins_h=0}function X3(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_o,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Et.Buf16(N3*2),this.dyn_dtree=new Et.Buf16((2*D3+1)*2),this.bl_tree=new Et.Buf16((2*B3+1)*2),er(this.dyn_ltree),er(this.dyn_dtree),er(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Et.Buf16($3+1),this.heap=new Et.Buf16(2*Gu+1),er(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Et.Buf16(2*Gu+1),er(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function xg(t){var e;return!t||!t.state?nr(t,Jt):(t.total_in=t.total_out=0,t.data_type=O3,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?So:Or,t.adler=e.wrap===2?0:1,e.last_flush=Rr,Kt._tr_init(e),Sn)}function _g(t){var e=xg(t);return e===Sn&&q3(t.state),e}function Y3(t,e){return!t||!t.state||t.state.wrap!==2?Jt:(t.state.gzhead=e,Sn)}function Sg(t,e,n,r,i,a){if(!t)return Jt;var s=1;if(e===A3&&(e=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>P3||n!==_o||r<8||r>15||e<0||e>9||a<0||a>F3)return nr(t,Jt);r===8&&(r=9);var o=new X3;return t.state=o,o.strm=t,o.wrap=s,o.gzhead=null,o.w_bits=r,o.w_size=1<gg||e<0)return t?nr(t,Jt):Jt;if(r=t.state,!t.output||!t.input&&t.avail_in!==0||r.status===Ba&&e!==rr)return nr(t,t.avail_out===0?Uu:Jt);if(r.strm=t,n=r.last_flush,r.last_flush=e,r.status===So)if(r.wrap===2)t.adler=0,ve(r,31),ve(r,139),ve(r,8),r.gzhead?(ve(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ve(r,r.gzhead.time&255),ve(r,r.gzhead.time>>8&255),ve(r,r.gzhead.time>>16&255),ve(r,r.gzhead.time>>24&255),ve(r,r.level===9?2:r.strategy>=vo||r.level<2?4:0),ve(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ve(r,r.gzhead.extra.length&255),ve(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=Jn(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Vu):(ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,r.level===9?2:r.strategy>=vo||r.level<2?4:0),ve(r,U3),r.status=Or);else{var s=_o+(r.w_bits-8<<4)<<8,o=-1;r.strategy>=vo||r.level<2?o=0:r.level<6?o=1:r.level===6?o=2:o=3,s|=o<<6,r.strstart!==0&&(s|=H3),s+=31-s%31,r.status=Or,Da(r,s),r.strstart!==0&&(Da(r,t.adler>>>16),Da(r,t.adler&65535)),t.adler=1}if(r.status===Vu)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Jn(t.adler,r.pending_buf,r.pending-i,i)),Qn(t),i=r.pending,r.pending===r.pending_buf_size));)ve(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(t.adler=Jn(t.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=wo)}else r.status=wo;if(r.status===wo)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Jn(t.adler,r.pending_buf,r.pending-i,i)),Qn(t),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}r.gzindexi&&(t.adler=Jn(t.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.gzindex=0,r.status=bo)}else r.status=bo;if(r.status===bo)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(t.adler=Jn(t.adler,r.pending_buf,r.pending-i,i)),Qn(t),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}r.gzindexi&&(t.adler=Jn(t.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.status=xo)}else r.status=xo;if(r.status===xo&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Qn(t),r.pending+2<=r.pending_buf_size&&(ve(r,t.adler&255),ve(r,t.adler>>8&255),t.adler=0,r.status=Or)):r.status=Or),r.pending!==0){if(Qn(t),t.avail_out===0)return r.last_flush=-1,Sn}else if(t.avail_in===0&&vg(e)<=vg(n)&&e!==rr)return nr(t,Uu);if(r.status===Ba&&t.avail_in!==0)return nr(t,Uu);if(t.avail_in!==0||r.lookahead!==0||e!==Rr&&r.status!==Ba){var l=r.strategy===vo?W3(r,e):r.strategy===C3?V3(r,e):mi[r.level].func(r,e);if((l===Pr||l===gi)&&(r.status=Ba),l===ot||l===Pr)return t.avail_out===0&&(r.last_flush=-1),Sn;if(l===Na&&(e===S3?Kt._tr_align(r):e!==gg&&(Kt._tr_stored_block(r,0,0,!1),e===E3&&(er(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Qn(t),t.avail_out===0))return r.last_flush=-1,Sn}return e!==rr?Sn:r.wrap<=0?yg:(r.wrap===2?(ve(r,t.adler&255),ve(r,t.adler>>8&255),ve(r,t.adler>>16&255),ve(r,t.adler>>24&255),ve(r,t.total_in&255),ve(r,t.total_in>>8&255),ve(r,t.total_in>>16&255),ve(r,t.total_in>>24&255)):(Da(r,t.adler>>>16),Da(r,t.adler&65535)),Qn(t),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Sn:yg)}function J3(t){var e;return!t||!t.state?Jt:(e=t.state.status,e!==So&&e!==Vu&&e!==wo&&e!==bo&&e!==xo&&e!==Or&&e!==Ba?nr(t,Jt):(t.state=null,e===Or?nr(t,k3):Sn))}function Q3(t,e){var n=e.length,r,i,a,s,o,l,c,u;if(!t||!t.state||(r=t.state,s=r.wrap,s===2||s===1&&r.status!==So||r.lookahead))return Jt;for(s===1&&(t.adler=wg(t.adler,e,n,0)),r.wrap=0,n>=r.w_size&&(s===0&&(er(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Et.Buf8(r.w_size),Et.arraySet(u,e,n-r.w_size,r.w_size,0),e=u,n=r.w_size),o=t.avail_in,l=t.next_in,c=t.input,t.avail_in=n,t.next_in=0,t.input=e,Ir(r);r.lookahead>=me;){i=r.strstart,a=r.lookahead-(me-1);do r.ins_h=(r.ins_h<{"use strict";v();var Eo=jn(),kg=!0,Ag=!0;try{String.fromCharCode.apply(null,[0])}catch(t){kg=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Ag=!1}var $a=new Eo.Buf8(256);for(Bn=0;Bn<256;Bn++)$a[Bn]=Bn>=252?6:Bn>=248?5:Bn>=240?4:Bn>=224?3:Bn>=192?2:1;var Bn;$a[254]=$a[254]=1;yi.string2buf=function(t){var e,n,r,i,a,s=t.length,o=0;for(i=0;i>>6,e[a++]=128|n&63):n<65536?(e[a++]=224|n>>>12,e[a++]=128|n>>>6&63,e[a++]=128|n&63):(e[a++]=240|n>>>18,e[a++]=128|n>>>12&63,e[a++]=128|n>>>6&63,e[a++]=128|n&63);return e};function Tg(t,e){if(e<65534&&(t.subarray&&Ag||!t.subarray&&kg))return String.fromCharCode.apply(null,Eo.shrinkBuf(t,e));for(var n="",r=0;r4){o[r++]=65533,n+=a-1;continue}for(i&=a===2?31:a===3?15:7;a>1&&n1){o[r++]=65533;continue}i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|i&1023)}return Tg(o,r)};yi.utf8border=function(t,e){var n;for(e=e||t.length,e>t.length&&(e=t.length),n=e-1;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+$a[t[n]]>e?n:e}});var qu=R((H7,Cg)=>{"use strict";v();function eT(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Cg.exports=eT});var Pg=R(za=>{"use strict";v();var Ha=Eg(),Ua=jn(),Yu=Wu(),Zu=yo(),tT=qu(),Og=Object.prototype.toString,nT=0,Xu=4,vi=0,Fg=1,Mg=2,rT=-1,iT=0,aT=8;function Lr(t){if(!(this instanceof Lr))return new Lr(t);this.options=Ua.assign({level:rT,method:aT,chunkSize:16384,windowBits:15,memLevel:8,strategy:iT,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new tT,this.strm.avail_out=0;var n=Ha.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==vi)throw new Error(Zu[n]);if(e.header&&Ha.deflateSetHeader(this.strm,e.header),e.dictionary){var r;if(typeof e.dictionary=="string"?r=Yu.string2buf(e.dictionary):Og.call(e.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(e.dictionary):r=e.dictionary,n=Ha.deflateSetDictionary(this.strm,r),n!==vi)throw new Error(Zu[n]);this._dict_set=!0}}Lr.prototype.push=function(t,e){var n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;a=e===~~e?e:e===!0?Xu:nT,typeof t=="string"?n.input=Yu.string2buf(t):Og.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new Ua.Buf8(r),n.next_out=0,n.avail_out=r),i=Ha.deflate(n,a),i!==Fg&&i!==vi)return this.onEnd(i),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(a===Xu||a===Mg))&&(this.options.to==="string"?this.onData(Yu.buf2binstring(Ua.shrinkBuf(n.output,n.next_out))):this.onData(Ua.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==Fg);return a===Xu?(i=Ha.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===vi):(a===Mg&&(this.onEnd(vi),n.avail_out=0),!0)};Lr.prototype.onData=function(t){this.chunks.push(t)};Lr.prototype.onEnd=function(t){t===vi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ua.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Ku(t,e){var n=new Lr(e);if(n.push(t,!0),n.err)throw n.msg||Zu[n.err];return n.result}function sT(t,e){return e=e||{},e.raw=!0,Ku(t,e)}function oT(t,e){return e=e||{},e.gzip=!0,Ku(t,e)}za.Deflate=Lr;za.deflate=Ku;za.deflateRaw=sT;za.gzip=oT});var Rg=R((V7,Ig)=>{"use strict";v();var ko=30,lT=12;Ig.exports=function(e,n){var r,i,a,s,o,l,c,u,f,h,d,p,g,m,w,b,S,k,x,A,y,E,_,C,M;r=e.state,i=e.next_in,C=e.input,a=i+(e.avail_in-5),s=e.next_out,M=e.output,o=s-(n-e.avail_out),l=s+(e.avail_out-257),c=r.dmax,u=r.wsize,f=r.whave,h=r.wnext,d=r.window,p=r.hold,g=r.bits,m=r.lencode,w=r.distcode,b=(1<>>24,p>>>=x,g-=x,x=k>>>16&255,x===0)M[s++]=k&65535;else if(x&16){A=k&65535,x&=15,x&&(g>>=x,g-=x),g<15&&(p+=C[i++]<>>24,p>>>=x,g-=x,x=k>>>16&255,x&16){if(y=k&65535,x&=15,gc){e.msg="invalid distance too far back",r.mode=ko;break e}if(p>>>=x,g-=x,x=s-o,y>x){if(x=y-x,x>f&&r.sane){e.msg="invalid distance too far back",r.mode=ko;break e}if(E=0,_=d,h===0){if(E+=u-x,x2;)M[s++]=_[E++],M[s++]=_[E++],M[s++]=_[E++],A-=3;A&&(M[s++]=_[E++],A>1&&(M[s++]=_[E++]))}else{E=s-y;do M[s++]=M[E++],M[s++]=M[E++],M[s++]=M[E++],A-=3;while(A>2);A&&(M[s++]=M[E++],A>1&&(M[s++]=M[E++]))}}else if(x&64){e.msg="invalid distance code",r.mode=ko;break e}else{k=w[(k&65535)+(p&(1<>3,i-=A,g-=A<<3,p&=(1<{"use strict";v();var Lg=jn(),wi=15,jg=852,Dg=592,Bg=0,Ju=1,Ng=2,cT=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],uT=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],fT=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],hT=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];$g.exports=function(e,n,r,i,a,s,o,l){var c=l.bits,u=0,f=0,h=0,d=0,p=0,g=0,m=0,w=0,b=0,S=0,k,x,A,y,E,_=null,C=0,M,L=new Lg.Buf16(wi+1),N=new Lg.Buf16(wi+1),j=null,Y=0,le,he,ie;for(u=0;u<=wi;u++)L[u]=0;for(f=0;f=1&&L[d]===0;d--);if(p>d&&(p=d),d===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,l.bits=1,0;for(h=1;h0&&(e===Bg||d!==1))return-1;for(N[1]=0,u=1;ujg||e===Ng&&b>Dg)return 1;for(;;){le=u-m,o[f]M?(he=j[Y+o[f]],ie=_[C+o[f]]):(he=96,ie=0),k=1<>m)+x]=le<<24|he<<16|ie|0;while(x!==0);for(k=1<>=1;if(k!==0?(S&=k-1,S+=k):S=0,f++,--L[u]===0){if(u===d)break;u=n[r+o[f]]}if(u>p&&(S&y)!==A){for(m===0&&(m=p),E+=h,g=u-m,w=1<jg||e===Ng&&b>Dg)return 1;A=S&y,a[A]=p<<24|g<<16|E-s|0}}return S!==0&&(a[E+S]=u-m<<24|64<<16|0),l.bits=p,0}});var _0=R(un=>{"use strict";v();var Ht=jn(),af=$u(),kn=Hu(),dT=Rg(),Ga=Hg(),pT=0,d0=1,p0=2,Ug=4,mT=5,Ao=6,jr=0,gT=1,yT=2,Qt=-2,m0=-3,sf=-4,vT=-5,zg=8,g0=1,Gg=2,Vg=3,Wg=4,qg=5,Xg=6,Yg=7,Zg=8,Kg=9,Jg=10,Fo=11,Nn=12,Qu=13,Qg=14,ef=15,e0=16,t0=17,n0=18,r0=19,To=20,Co=21,i0=22,a0=23,s0=24,o0=25,l0=26,tf=27,c0=28,u0=29,Ne=30,of=31,wT=32,bT=852,xT=592,_T=15,ST=_T;function f0(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function ET(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ht.Buf16(320),this.work=new Ht.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y0(t){var e;return!t||!t.state?Qt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=g0,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Ht.Buf32(bT),e.distcode=e.distdyn=new Ht.Buf32(xT),e.sane=1,e.back=-1,jr)}function v0(t){var e;return!t||!t.state?Qt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,y0(t))}function w0(t,e){var n,r;return!t||!t.state||(r=t.state,e<0?(n=0,e=-e):(n=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Qt:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,v0(t))}function b0(t,e){var n,r;return t?(r=new ET,t.state=r,r.window=null,n=w0(t,e),n!==jr&&(t.state=null),n):Qt}function kT(t){return b0(t,ST)}var h0=!0,nf,rf;function AT(t){if(h0){var e;for(nf=new Ht.Buf32(512),rf=new Ht.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Ga(d0,t.lens,0,288,nf,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ga(p0,t.lens,0,32,rf,0,t.work,{bits:5}),h0=!1}t.lencode=nf,t.lenbits=9,t.distcode=rf,t.distbits=5}function x0(t,e,n,r){var i,a=t.state;return a.window===null&&(a.wsize=1<=a.wsize?(Ht.arraySet(a.window,e,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),Ht.arraySet(a.window,e,n-r,i,a.wnext),r-=i,r?(Ht.arraySet(a.window,e,n-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,n.check=kn(n.check,_,2,0),c=0,u=0,n.mode=Gg;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",n.mode=Ne;break}if((c&15)!==zg){t.msg="unknown compression method",n.mode=Ne;break}if(c>>>=4,u-=4,y=(c&15)+8,n.wbits===0)n.wbits=y;else if(y>n.wbits){t.msg="invalid window size",n.mode=Ne;break}n.dmax=1<>8&1),n.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,n.check=kn(n.check,_,2,0)),c=0,u=0,n.mode=Vg;case Vg:for(;u<32;){if(o===0)break e;o--,c+=r[a++]<>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,n.check=kn(n.check,_,4,0)),c=0,u=0,n.mode=Wg;case Wg:for(;u<16;){if(o===0)break e;o--,c+=r[a++]<>8),n.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,n.check=kn(n.check,_,2,0)),c=0,u=0,n.mode=qg;case qg:if(n.flags&1024){for(;u<16;){if(o===0)break e;o--,c+=r[a++]<>>8&255,n.check=kn(n.check,_,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=Xg;case Xg:if(n.flags&1024&&(d=n.length,d>o&&(d=o),d&&(n.head&&(y=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Ht.arraySet(n.head.extra,r,a,d,y)),n.flags&512&&(n.check=kn(n.check,r,d,a)),o-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=Yg;case Yg:if(n.flags&2048){if(o===0)break e;d=0;do y=r[a+d++],n.head&&y&&n.length<65536&&(n.head.name+=String.fromCharCode(y));while(y&&d>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Nn;break;case Jg:for(;u<32;){if(o===0)break e;o--,c+=r[a++]<>>=u&7,u-=u&7,n.mode=tf;break}for(;u<3;){if(o===0)break e;o--,c+=r[a++]<>>=1,u-=1,c&3){case 0:n.mode=Qg;break;case 1:if(AT(n),n.mode=To,e===Ao){c>>>=2,u-=2;break e}break;case 2:n.mode=t0;break;case 3:t.msg="invalid block type",n.mode=Ne}c>>>=2,u-=2;break;case Qg:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,c+=r[a++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=Ne;break}if(n.length=c&65535,c=0,u=0,n.mode=ef,e===Ao)break e;case ef:n.mode=e0;case e0:if(d=n.length,d){if(d>o&&(d=o),d>l&&(d=l),d===0)break e;Ht.arraySet(i,r,a,d,s),o-=d,a+=d,l-=d,s+=d,n.length-=d;break}n.mode=Nn;break;case t0:for(;u<14;){if(o===0)break e;o--,c+=r[a++]<>>=5,u-=5,n.ndist=(c&31)+1,c>>>=5,u-=5,n.ncode=(c&15)+4,c>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Ne;break}n.have=0,n.mode=n0;case n0:for(;n.have>>=3,u-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},E=Ga(pT,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,E){t.msg="invalid code lengths set",n.mode=Ne;break}n.have=0,n.mode=r0;case r0:for(;n.have>>24,b=m>>>16&255,S=m&65535,!(w<=u);){if(o===0)break e;o--,c+=r[a++]<>>=w,u-=w,n.lens[n.have++]=S;else{if(S===16){for(M=w+2;u>>=w,u-=w,n.have===0){t.msg="invalid bit length repeat",n.mode=Ne;break}y=n.lens[n.have-1],d=3+(c&3),c>>>=2,u-=2}else if(S===17){for(M=w+3;u>>=w,u-=w,y=0,d=3+(c&7),c>>>=3,u-=3}else{for(M=w+7;u>>=w,u-=w,y=0,d=11+(c&127),c>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Ne;break}for(;d--;)n.lens[n.have++]=y}}if(n.mode===Ne)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=Ne;break}if(n.lenbits=9,C={bits:n.lenbits},E=Ga(d0,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,E){t.msg="invalid literal/lengths set",n.mode=Ne;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},E=Ga(p0,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,E){t.msg="invalid distances set",n.mode=Ne;break}if(n.mode=To,e===Ao)break e;case To:n.mode=Co;case Co:if(o>=6&&l>=258){t.next_out=s,t.avail_out=l,t.next_in=a,t.avail_in=o,n.hold=c,n.bits=u,dT(t,h),s=t.next_out,i=t.output,l=t.avail_out,a=t.next_in,r=t.input,o=t.avail_in,c=n.hold,u=n.bits,n.mode===Nn&&(n.back=-1);break}for(n.back=0;m=n.lencode[c&(1<>>24,b=m>>>16&255,S=m&65535,!(w<=u);){if(o===0)break e;o--,c+=r[a++]<>k)],w=m>>>24,b=m>>>16&255,S=m&65535,!(k+w<=u);){if(o===0)break e;o--,c+=r[a++]<>>=k,u-=k,n.back+=k}if(c>>>=w,u-=w,n.back+=w,n.length=S,b===0){n.mode=l0;break}if(b&32){n.back=-1,n.mode=Nn;break}if(b&64){t.msg="invalid literal/length code",n.mode=Ne;break}n.extra=b&15,n.mode=i0;case i0:if(n.extra){for(M=n.extra;u>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=a0;case a0:for(;m=n.distcode[c&(1<>>24,b=m>>>16&255,S=m&65535,!(w<=u);){if(o===0)break e;o--,c+=r[a++]<>k)],w=m>>>24,b=m>>>16&255,S=m&65535,!(k+w<=u);){if(o===0)break e;o--,c+=r[a++]<>>=k,u-=k,n.back+=k}if(c>>>=w,u-=w,n.back+=w,b&64){t.msg="invalid distance code",n.mode=Ne;break}n.offset=S,n.extra=b&15,n.mode=s0;case s0:if(n.extra){for(M=n.extra;u>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Ne;break}n.mode=o0;case o0:if(l===0)break e;if(d=h-l,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Ne;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=s-n.offset,d=n.length;d>l&&(d=l),l-=d,n.length-=d;do i[s++]=g[p++];while(--d);n.length===0&&(n.mode=Co);break;case l0:if(l===0)break e;i[s++]=n.length,l--,n.mode=Co;break;case tf:if(n.wrap){for(;u<32;){if(o===0)break e;o--,c|=r[a++]<{"use strict";v();S0.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var k0=R((Q7,E0)=>{"use strict";v();function OT(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}E0.exports=OT});var T0=R(Wa=>{"use strict";v();var bi=_0(),Va=jn(),Mo=Wu(),Ke=lf(),cf=yo(),PT=qu(),IT=k0(),A0=Object.prototype.toString;function Dr(t){if(!(this instanceof Dr))return new Dr(t);this.options=Va.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new PT,this.strm.avail_out=0;var n=bi.inflateInit2(this.strm,e.windowBits);if(n!==Ke.Z_OK)throw new Error(cf[n]);if(this.header=new IT,bi.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Mo.string2buf(e.dictionary):A0.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=bi.inflateSetDictionary(this.strm,e.dictionary),n!==Ke.Z_OK)))throw new Error(cf[n])}Dr.prototype.push=function(t,e){var n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,s,o,l,c,u=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?Ke.Z_FINISH:Ke.Z_NO_FLUSH,typeof t=="string"?n.input=Mo.binstring2buf(t):A0.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new Va.Buf8(r),n.next_out=0,n.avail_out=r),a=bi.inflate(n,Ke.Z_NO_FLUSH),a===Ke.Z_NEED_DICT&&i&&(a=bi.inflateSetDictionary(this.strm,i)),a===Ke.Z_BUF_ERROR&&u===!0&&(a=Ke.Z_OK,u=!1),a!==Ke.Z_STREAM_END&&a!==Ke.Z_OK)return this.onEnd(a),this.ended=!0,!1;n.next_out&&(n.avail_out===0||a===Ke.Z_STREAM_END||n.avail_in===0&&(s===Ke.Z_FINISH||s===Ke.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=Mo.utf8border(n.output,n.next_out),l=n.next_out-o,c=Mo.buf2string(n.output,o),n.next_out=l,n.avail_out=r-l,l&&Va.arraySet(n.output,n.output,o,l,0),this.onData(c)):this.onData(Va.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(u=!0)}while((n.avail_in>0||n.avail_out===0)&&a!==Ke.Z_STREAM_END);return a===Ke.Z_STREAM_END&&(s=Ke.Z_FINISH),s===Ke.Z_FINISH?(a=bi.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Ke.Z_OK):(s===Ke.Z_SYNC_FLUSH&&(this.onEnd(Ke.Z_OK),n.avail_out=0),!0)};Dr.prototype.onData=function(t){this.chunks.push(t)};Dr.prototype.onEnd=function(t){t===Ke.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Va.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function uf(t,e){var n=new Dr(e);if(n.push(t,!0),n.err)throw n.msg||cf[n.err];return n.result}function RT(t,e){return e=e||{},e.raw=!0,uf(t,e)}Wa.Inflate=Dr;Wa.inflate=uf;Wa.inflateRaw=RT;Wa.ungzip=uf});var M0=R((rD,F0)=>{"use strict";v();var LT=jn().assign,jT=Pg(),DT=T0(),BT=lf(),C0={};LT(C0,jT,DT,BT);F0.exports=C0});var I0=R((aD,P0)=>{"use strict";v();var O0=(t,e)=>function(...n){let r=e.promiseModule;return new r((i,a)=>{e.multiArgs?n.push((...s)=>{e.errorFirst?s[0]?a(s):(s.shift(),i(s)):i(s)}):e.errorFirst?n.push((s,o)=>{s?a(s):i(o)}):n.push(i),t.apply(this,n)})};P0.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let n=typeof t;if(!(t!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":n}\``);let r=a=>{let s=o=>typeof o=="string"?a===o:o.test(a);return e.include?e.include.some(s):!e.exclude.some(s)},i;n==="function"?i=function(...a){return e.excludeMain?t(...a):O0(t,e).apply(this,a)}:i=Object.create(Object.getPrototypeOf(t));for(let a in t){let s=t[a];i[a]=typeof s=="function"&&r(a)?O0(s,e):s}return i}});var U0=R((oD,H0)=>{v();function R0(t){return Array.isArray(t)?t:[t]}var df="",L0=" ",ff="\\",NT=/^\s+$/,$T=/(?:[^\\]|^)\\$/,HT=/^\\!/,UT=/^\\#/,zT=/\r?\n/g,GT=/^\.*\/|^\.+$/,hf="/",B0="node-ignore";typeof Symbol!="undefined"&&(B0=Symbol.for("node-ignore"));var j0=B0,VT=(t,e,n)=>Object.defineProperty(t,e,{value:n}),WT=/([0-z])-([0-z])/g,N0=()=>!1,qT=t=>t.replace(WT,(e,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?e:df),XT=t=>{let{length:e}=t;return t.slice(0,e-e%2)},YT=[[/^\uFEFF/,()=>df],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,n)=>e+(n.indexOf("\\")===0?L0:df)],[/(\\+?)\s/g,(t,e)=>{let{length:n}=e;return e.slice(0,n-n%2)+L0}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,n)=>e+6{let r=n.replace(/\\\*/g,"[^\\/]*");return e+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>ff],[/\\\\/g,()=>ff],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,n,r,i)=>e===ff?`\\[${n}${XT(r)}${i}`:i==="]"&&r.length%2===0?`[${qT(n)}${r}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],D0=Object.create(null),ZT=(t,e)=>{let n=D0[t];return n||(n=YT.reduce((r,[i,a])=>r.replace(i,a.bind(t)),t),D0[t]=n),e?new RegExp(n,"i"):new RegExp(n)},gf=t=>typeof t=="string",KT=t=>t&&gf(t)&&!NT.test(t)&&!$T.test(t)&&t.indexOf("#")!==0,JT=t=>t.split(zT),pf=class{constructor(e,n,r,i){this.origin=e,this.pattern=n,this.negative=r,this.regex=i}},QT=(t,e)=>{let n=t,r=!1;t.indexOf("!")===0&&(r=!0,t=t.substr(1)),t=t.replace(HT,"!").replace(UT,"#");let i=ZT(t,e);return new pf(n,t,r,i)},e5=(t,e)=>{throw new e(t)},$n=(t,e,n)=>gf(t)?t?$n.isNotRelative(t)?n(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${e}\``,TypeError),$0=t=>GT.test(t);$n.isNotRelative=$0;$n.convert=t=>t;var mf=class{constructor({ignorecase:e=!0,ignoreCase:n=e,allowRelativePaths:r=!1}={}){VT(this,j0,!0),this._rules=[],this._ignoreCase=n,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[j0]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(KT(e)){let n=QT(e,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(e){return this._added=!1,R0(gf(e)?JT(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,n){let r=!1,i=!1;return this._rules.forEach(a=>{let{negative:s}=a;if(i===s&&r!==i||s&&!r&&!i&&!n)return;a.regex.test(e)&&(r=!s,i=s)}),{ignored:r,unignored:i}}_test(e,n,r,i){let a=e&&$n.convert(e);return $n(a,e,this._allowRelativePaths?N0:e5),this._t(a,n,r,i)}_t(e,n,r,i){if(e in n)return n[e];if(i||(i=e.split(hf)),i.pop(),!i.length)return n[e]=this._testOne(e,r);let a=this._t(i.join(hf)+hf,n,r,i);return n[e]=a.ignored?a:this._testOne(e,r)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return R0(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},Oo=t=>new mf(t),t5=t=>$n(t&&$n.convert(t),t,N0);Oo.isPathValid=t5;Oo.default=Oo;H0.exports=Oo;if(typeof process!="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");$n.convert=t;let e=/^[a-z]:\//i;$n.isNotRelative=n=>e.test(n)||$0(n)}});var G0=R((cD,z0)=>{"use strict";v();function n5(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function An(t,e,n){return e=e instanceof RegExp?e:new RegExp(n5(e),"g"),t.replace(e,n)}var r5={clean:function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=An(e,"./","/"),e=An(e,"..","."),e=An(e," ","-"),e=An(e,/^[~^:?*\\\-]/g,""),e=An(e,/[~^:?*\\]/g,"-"),e=An(e,/[~^:?*\\\-]$/g,""),e=An(e,"@{","-"),e=An(e,/\.$/g,""),e=An(e,/\/$/g,""),e=An(e,/\.lock$/g,""),e}};z0.exports=r5});var W0=R((fD,V0)=>{v();V0.exports=function(t,e){var n=t,r=e,i=n.length,a=r.length,s=!1,o=null,l=i+1,c=[],u=[],f=[],h="",d=-1,p=0,g=1,m,w,b=function(){i>=a&&(m=n,w=i,n=r,r=m,i=a,a=w,s=!0,l=i+1)},S=function(y,E,_){return{x:y,y:E,k:_}},k=function(y,E){return{elem:y,t:E}},x=function(y,E,_){var C,M,L;for(E>_?C=c[y-1+l]:C=c[y+1+l],L=Math.max(E,_),M=L-y;M=0;--L)for(;CM-C?(s?f[f.length]=new k(r[M],d):f[f.length]=new k(r[M],g),++_,++M):y[L].y-y[L].x=y+1;--j)_[j+l]=x(j,_[j-1+l]+1,_[j+1+l]);_[y+l]=x(y,_[y-1+l]+1,_[y+1+l])}while(_[y+l]!==a);for(o=y+2*C,M=c[y+l],L=[];M!==-1;)L[L.length]=new S(u[M].x,u[M].y,null),M=u[M].k;A(L)}}}});var Y0=R((dD,X0)=>{v();var i5=W0();function a5(t,e){var n=new i5(t,e);n.compose();for(var r=n.getses(),i,a,s=t.length-1,o=e.length-1,l=r.length-1;l>=0;--l)r[l].t===n.SES_COMMON?(a?(a.chain={file1index:s,file2index:o,chain:null},a=a.chain):(i={file1index:s,file2index:o,chain:null},a=i),s--,o--):r[l].t===n.SES_DELETE?s--:r[l].t===n.SES_ADD&&o--;var c={file1index:-1,file2index:-1,chain:null};return a?(a.chain=c,i):c}function q0(t,e){for(var n=[],r=t.length,i=e.length,a=a5(t,e);a!==null;a=a.chain){var s=r-a.file1index-1,o=i-a.file2index-1;r=a.file1index,i=a.file2index,(s||o)&&n.push({file1:[r+1,s],file2:[i+1,o]})}return n.reverse(),n}function s5(t,e,n){var r,i=q0(e,t),a=q0(e,n),s=[];function o(N,j){s.push([N.file1[0],j,N.file1[1],N.file2[0],N.file2[1]])}for(r=0;rc&&(l.push([1,c,N-c]),c=N)}for(var f=0;fg)break;g=Math.max(g,w+m[2]),f++}if(u(p),h==f)d[4]>0&&l.push([d[1],d[3],d[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[n.length,-1,e.length,-1]};for(r=h;r<=f;r++){d=s[r];var S=d[1],k=b[S],x=d[0],A=x+d[2],y=d[3],E=y+d[4];k[0]=Math.min(y,k[0]),k[1]=Math.max(E,k[1]),k[2]=Math.min(x,k[2]),k[3]=Math.max(A,k[3])}var _=b[0][0]+(p-b[0][2]),C=b[0][1]+(g-b[0][3]),M=b[2][0]+(p-b[2][2]),L=b[2][1]+(g-b[2][3]);l.push([-1,_,C-_,p,g-p,M,L-M])}c=g}return u(e.length),l}function o5(t,e,n){var r=[],i=[t,e,n],a=s5(t,e,n),s=[];function o(){s.length&&r.push({ok:s}),s=[]}function l(d){for(var p=0;p{v();var Bi=1e3,Ni=Bi*60,$i=Ni*60,Gr=$i*24,u6=Gr*7,f6=Gr*365.25;J1.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return h6(t);if(n==="number"&&isFinite(t))return e.long?p6(t):d6(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function h6(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*f6;case"weeks":case"week":case"w":return n*u6;case"days":case"day":case"d":return n*Gr;case"hours":case"hour":case"hrs":case"hr":case"h":return n*$i;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ni;case"seconds":case"second":case"secs":case"sec":case"s":return n*Bi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function d6(t){var e=Math.abs(t);return e>=Gr?Math.round(t/Gr)+"d":e>=$i?Math.round(t/$i)+"h":e>=Ni?Math.round(t/Ni)+"m":e>=Bi?Math.round(t/Bi)+"s":t+"ms"}function p6(t){var e=Math.abs(t);return e>=Gr?Jo(t,e,Gr,"day"):e>=$i?Jo(t,e,$i,"hour"):e>=Ni?Jo(t,e,Ni,"minute"):e>=Bi?Jo(t,e,Bi,"second"):t+" ms"}function Jo(t,e,n,r){var i=e>=n*1.5;return Math.round(t/n)+" "+r+(i?"s":"")}});var ty=R((_D,ey)=>{v();function m6(t){n.debug=n,n.default=n,n.coerce=l,n.disable=a,n.enable=i,n.enabled=s,n.humanize=Q1(),n.destroy=c,Object.keys(t).forEach(u=>{n[u]=t[u]}),n.names=[],n.skips=[],n.formatters={};function e(u){let f=0;for(let h=0;h{if(A==="%%")return"%";k++;let E=n.formatters[y];if(typeof E=="function"){let _=m[k];A=E.call(w,_),m.splice(k,1),k--}return A}),n.formatArgs.call(w,m),(w.log||n.log).apply(w,m)}return g.namespace=u,g.useColors=n.useColors(),g.color=n.selectColor(u),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==n.namespaces&&(d=n.namespaces,p=n.enabled(u)),p),set:m=>{h=m}}),typeof n.init=="function"&&n.init(g),g}function r(u,f){let h=n(this.namespace+(typeof f=="undefined"?":":f)+u);return h.log=this.log,h}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let f,h=(typeof u=="string"?u:"").split(/[\s,]+/),d=h.length;for(f=0;f"-"+f)].join(",");return n.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let f,h;for(f=0,h=n.skips.length;f{v();Gt.formatArgs=y6;Gt.save=v6;Gt.load=w6;Gt.useColors=g6;Gt.storage=b6();Gt.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Gt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function g6(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function y6(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Qo.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(n++,i==="%c"&&(r=n))}),t.splice(r,0,e)}Gt.log=console.debug||console.log||(()=>{});function v6(t){try{t?Gt.storage.setItem("debug",t):Gt.storage.removeItem("debug")}catch(e){}}function w6(){let t;try{t=Gt.storage.getItem("debug")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function b6(){try{return localStorage}catch(t){}}Qo.exports=ty()(Gt);var{formatters:x6}=Qo.exports;x6.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ny=R(Vt=>{"use strict";v();var _6=Vt&&Vt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Vt,"__esModule",{value:!0});var S6=require("fs"),E6=_6(el()),Hi=E6.default("@kwsites/file-exists");function k6(t,e,n){Hi("checking %s",t);try{let r=S6.statSync(t);return r.isFile()&&e?(Hi("[OK] path represents a file"),!0):r.isDirectory()&&n?(Hi("[OK] path represents a directory"),!0):(Hi("[FAIL] path represents something other than a file or directory"),!1)}catch(r){if(r.code==="ENOENT")return Hi("[FAIL] path is not accessible: %o",r),!1;throw Hi("[FATAL] %o",r),r}}function A6(t,e=Vt.READABLE){return k6(t,(e&Vt.FILE)>0,(e&Vt.FOLDER)>0)}Vt.exists=A6;Vt.FILE=1;Vt.FOLDER=2;Vt.READABLE=Vt.FILE+Vt.FOLDER});var ry=R(tl=>{"use strict";v();function T6(t){for(var e in t)tl.hasOwnProperty(e)||(tl[e]=t[e])}Object.defineProperty(tl,"__esModule",{value:!0});T6(ny())});var Wf=R(Vr=>{"use strict";v();Object.defineProperty(Vr,"__esModule",{value:!0});Vr.createDeferred=Vr.deferred=void 0;function Vf(){let t,e,n="pending";return{promise:new Promise((i,a)=>{t=i,e=a}),done(i){n==="pending"&&(n="resolved",t(i))},fail(i){n==="pending"&&(n="rejected",e(i))},get fulfilled(){return n!=="pending"},get status(){return n}}}Vr.deferred=Vf;Vr.createDeferred=Vf;Vr.default=Vf});var zw=R((h9,Uw)=>{"use strict";v();Uw.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Vw=R((p9,Gw)=>{v();var Bh={px:{px:1,cm:37.79527559055118,mm:3.7795275590551185,in:96,pt:1.3333333333333333,pc:16},cm:{px:.026458333333333334,cm:1,mm:.1,in:2.54,pt:.035277777777777776,pc:.42333333333333334},mm:{px:.26458333333333334,cm:10,mm:1,in:25.4,pt:.35277777777777775,pc:4.233333333333333},in:{px:.010416666666666666,cm:.39370078740157477,mm:.03937007874015748,in:1,pt:.013888888888888888,pc:.16666666666666666},pt:{px:.75,cm:28.346456692913385,mm:2.834645669291339,in:72,pt:1,pc:12},pc:{px:.0625,cm:2.3622047244094486,mm:.2362204724409449,in:6,pt:.08333333333333333,pc:1},deg:{deg:1,grad:.9,rad:180/Math.PI,turn:360},grad:{deg:1.1111111111111112,grad:1,rad:200/Math.PI,turn:400},rad:{deg:Math.PI/180,grad:Math.PI/200,rad:1,turn:Math.PI*2},turn:{deg:.002777777777777778,grad:.0025,rad:.5/Math.PI,turn:1},s:{s:1,ms:.001},ms:{s:1e3,ms:1},Hz:{Hz:1,kHz:1e3},kHz:{Hz:.001,kHz:1},dpi:{dpi:1,dpcm:.39370078740157477,dppx:.010416666666666666},dpcm:{dpi:2.54,dpcm:1,dppx:.026458333333333334},dppx:{dpi:96,dpcm:37.79527559055118,dppx:1}};Gw.exports=function(t,e,n,r){if(!Bh.hasOwnProperty(n))throw new Error("Cannot convert to "+n);if(!Bh[n].hasOwnProperty(e))throw new Error("Cannot convert from "+e+" to "+n);var i=Bh[n][e]*t;return r!==!1?(r=Math.pow(10,parseInt(r)||5),Math.round(i*r)/r):i}});var a2=R(Vn=>{"use strict";v();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.fromRgba=qi;Vn.fromRgb=Nh;Vn.fromHsla=El;Vn.fromHsl=r2;Vn.fromString=i2;Vn.default=void 0;var Ww=Yw(zw()),BM=Yw(Vw());function Yw(t){return t&&t.__esModule?t:{default:t}}function NM(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qw(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1}function VM(t,e,n){var r=t/255,i=e/255,a=n/255,s=Math.max(r,i,a),o=Math.min(r,i,a),l=s-o,c=(s+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=function(){switch(s){case r:return(i-a)/l%6;case i:return(a-r)/l+2;default:return(r-i)/l+4}}();return[f*60,u*100,c*100]}function WM(t,e,n){var r=t/60,i=e/100,a=n/100,s=(1-Math.abs(2*a-1))*i,o=s*(1-Math.abs(r%2-1)),l=a-s/2,c=function(){return r<1?[s,o,0]:r<2?[o,s,0]:r<3?[0,s,o]:r<4?[0,o,s]:r<5?[o,0,s]:[s,0,o]}(),u=Ft(c,3),f=u[0],h=u[1],d=u[2];return[(f+l)*255,(h+l)*255,(d+l)*255]}var qM=function(){function t(e){var n=Ft(e,4),r=n[0],i=n[1],a=n[2],s=n[3];NM(this,t),this.values=[Math.max(Math.min(parseInt(r,10),255),0),Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(a,10),255),0),s==null?1:Math.max(Math.min(parseFloat(s),255),0)]}return $M(t,[{key:"toRgbString",value:function(){var n=Ft(this.values,4),r=n[0],i=n[1],a=n[2],s=n[3];return s===1?"rgb(".concat(r,", ").concat(i,", ").concat(a,")"):"rgba(".concat(r,", ").concat(i,", ").concat(a,", ").concat(s,")")}},{key:"toHslString",value:function(){var n=this.toHslaArray(),r=Ft(n,4),i=r[0],a=r[1],s=r[2],o=r[3];return o===1?"hsl(".concat(i,", ").concat(a,"%, ").concat(s,"%)"):"hsla(".concat(i,", ").concat(a,"%, ").concat(s,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var n=Ft(this.values,4),r=n[0],i=n[1],a=n[2],s=n[3];return r=Number(r).toString(16).padStart(2,"0"),i=Number(i).toString(16).padStart(2,"0"),a=Number(a).toString(16).padStart(2,"0"),s=s<1?parseInt(s*255,10).toString(16).padStart(2,"0"):"","#".concat(r).concat(i).concat(a).concat(s)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var n=Ft(this.values,4),r=n[0],i=n[1],a=n[2],s=n[3],o=VM(r,i,a),l=Ft(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,s]}}]),t}();function qi(t){var e=Ft(t,4),n=e[0],r=e[1],i=e[2],a=e[3];return new qM([n,r,i,a])}function Nh(t){var e=Ft(t,3),n=e[0],r=e[1],i=e[2];return qi([n,r,i,1])}function El(t){var e=Ft(t,4),n=e[0],r=e[1],i=e[2],a=e[3],s=WM(n,r,i),o=Ft(s,3),l=o[0],c=o[1],u=o[2];return qi([l,c,u,a])}function r2(t){var e=Ft(t,3),n=e[0],r=e[1],i=e[2];return El([n,r,i,1])}function XM(t){var e=Zw.exec(t)||Kw.exec(t),n=Ft(e,5),r=n[1],i=n[2],a=n[3],s=n[4];return r=parseInt(r.length<2?r.repeat(2):r,16),i=parseInt(i.length<2?i.repeat(2):i,16),a=parseInt(a.length<2?a.repeat(2):a,16),s=s&&(parseInt(s.length<2?s.repeat(2):s,16)/255).toPrecision(1)||1,qi([r,i,a,s])}function YM(t){var e=Jw.exec(t)||e2.exec(t)||Qw.exec(t)||t2.exec(t),n=Ft(e,5),r=n[1],i=n[2],a=n[3],s=n[4];return r=Cs(r,"%")?parseInt(r,10)*255/100:parseInt(r,10),i=Cs(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),a=Cs(a,"%")>0?parseInt(a,10)*255/100:parseInt(a,10),s=s===void 0?1:parseFloat(s)/(Cs(s,"%")?100:1),qi([r,i,a,s])}function ZM(t){var e=n2.exec(t),n=Ft(e,6),r=n[1],i=n[2],a=n[3],s=n[4],o=n[5];return i=i||"deg",r=(0,BM.default)(parseFloat(r),i,"deg"),a=parseFloat(a),s=parseFloat(s),o=o===void 0?1:parseFloat(o)/(Cs(o,"%")?100:1),El([r,a,s,o])}function i2(t){return Ww.default[t]?Nh(Ww.default[t]):Zw.test(t)||Kw.test(t)?XM(t):Jw.test(t)||e2.test(t)||Qw.test(t)||t2.test(t)?YM(t):n2.test(t)?ZM(t):null}var KM={fromString:i2,fromRgb:Nh,fromRgba:qi,fromHsl:r2,fromHsla:El};Vn.default=KM});var $h=R((v9,o2)=>{"use strict";v();var s2=Object.prototype.toString;o2.exports=function(e){var n=s2.call(e),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&s2.call(e.callee)==="[object Function]"),r}});var g2=R((b9,m2)=>{"use strict";v();var p2;Object.keys||(Fs=Object.prototype.hasOwnProperty,Hh=Object.prototype.toString,l2=$h(),Uh=Object.prototype.propertyIsEnumerable,c2=!Uh.call({toString:null},"toString"),u2=Uh.call(function(){},"prototype"),Ms=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],kl=function(t){var e=t.constructor;return e&&e.prototype===t},f2={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h2=function(){if(typeof window=="undefined")return!1;for(var t in window)try{if(!f2["$"+t]&&Fs.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{kl(window[t])}catch(e){return!0}}catch(e){return!0}return!1}(),d2=function(t){if(typeof window=="undefined"||!h2)return kl(t);try{return kl(t)}catch(e){return!1}},p2=function(e){var n=e!==null&&typeof e=="object",r=Hh.call(e)==="[object Function]",i=l2(e),a=n&&Hh.call(e)==="[object String]",s=[];if(!n&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var o=u2&&r;if(a&&e.length>0&&!Fs.call(e,0))for(var l=0;l0)for(var c=0;c{"use strict";v();var JM=Array.prototype.slice,QM=$h(),y2=Object.keys,Al=y2?function(e){return y2(e)}:g2(),v2=Object.keys;Al.shim=function(){if(Object.keys){var e=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);e||(Object.keys=function(r){return QM(r)?v2(JM.call(r)):v2(r)})}else Object.keys=Al;return Object.keys||Al};w2.exports=Al});var x2=R((E9,b2)=>{"use strict";v();b2.exports=Error});var S2=R((A9,_2)=>{"use strict";v();_2.exports=EvalError});var k2=R((C9,E2)=>{"use strict";v();E2.exports=RangeError});var T2=R((M9,A2)=>{"use strict";v();A2.exports=ReferenceError});var zh=R((P9,C2)=>{"use strict";v();C2.exports=SyntaxError});var Wn=R((R9,F2)=>{"use strict";v();F2.exports=TypeError});var O2=R((j9,M2)=>{"use strict";v();M2.exports=URIError});var Os=R((B9,P2)=>{"use strict";v();P2.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0}});var Cl=R(($9,R2)=>{"use strict";v();var I2=typeof Symbol!="undefined"&&Symbol,eO=Os();R2.exports=function(){return typeof I2!="function"||typeof Symbol!="function"||typeof I2("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:eO()}});var j2=R((U9,L2)=>{"use strict";v();var Gh={__proto__:null,foo:{}},tO=Object;L2.exports=function(){return{__proto__:Gh}.foo===Gh.foo&&!(Gh instanceof tO)}});var N2=R((G9,B2)=>{"use strict";v();var nO="Function.prototype.bind called on incompatible ",rO=Object.prototype.toString,iO=Math.max,aO="[object Function]",D2=function(e,n){for(var r=[],i=0;i{"use strict";v();var lO=N2();$2.exports=Function.prototype.bind||lO});var Vh=R((X9,H2)=>{"use strict";v();var cO=Function.prototype.call,uO=Object.prototype.hasOwnProperty,fO=Fl();H2.exports=fO.call(cO,uO)});var pn=R((Z9,W2)=>{"use strict";v();var pe,hO=x2(),dO=S2(),pO=k2(),mO=T2(),Ki=zh(),Zi=Wn(),gO=O2(),V2=Function,Wh=function(t){try{return V2('"use strict"; return ('+t+").constructor;")()}catch(e){}},Yr=Object.getOwnPropertyDescriptor;if(Yr)try{Yr({},"")}catch(t){Yr=null}var qh=function(){throw new Zi},yO=Yr?function(){try{return arguments.callee,qh}catch(t){try{return Yr(arguments,"callee").get}catch(e){return qh}}}():qh,Xi=Cl()(),vO=j2()(),ft=Object.getPrototypeOf||(vO?function(t){return t.__proto__}:null),Yi={},wO=typeof Uint8Array=="undefined"||!ft?pe:ft(Uint8Array),Zr={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?pe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?pe:ArrayBuffer,"%ArrayIteratorPrototype%":Xi&&ft?ft([][Symbol.iterator]()):pe,"%AsyncFromSyncIteratorPrototype%":pe,"%AsyncFunction%":Yi,"%AsyncGenerator%":Yi,"%AsyncGeneratorFunction%":Yi,"%AsyncIteratorPrototype%":Yi,"%Atomics%":typeof Atomics=="undefined"?pe:Atomics,"%BigInt%":typeof BigInt=="undefined"?pe:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?pe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?pe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?pe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":hO,"%eval%":eval,"%EvalError%":dO,"%Float32Array%":typeof Float32Array=="undefined"?pe:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?pe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?pe:FinalizationRegistry,"%Function%":V2,"%GeneratorFunction%":Yi,"%Int8Array%":typeof Int8Array=="undefined"?pe:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?pe:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?pe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xi&&ft?ft(ft([][Symbol.iterator]())):pe,"%JSON%":typeof JSON=="object"?JSON:pe,"%Map%":typeof Map=="undefined"?pe:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Xi||!ft?pe:ft(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?pe:Promise,"%Proxy%":typeof Proxy=="undefined"?pe:Proxy,"%RangeError%":pO,"%ReferenceError%":mO,"%Reflect%":typeof Reflect=="undefined"?pe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?pe:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Xi||!ft?pe:ft(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?pe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xi&&ft?ft(""[Symbol.iterator]()):pe,"%Symbol%":Xi?Symbol:pe,"%SyntaxError%":Ki,"%ThrowTypeError%":yO,"%TypedArray%":wO,"%TypeError%":Zi,"%Uint8Array%":typeof Uint8Array=="undefined"?pe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?pe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?pe:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?pe:Uint32Array,"%URIError%":gO,"%WeakMap%":typeof WeakMap=="undefined"?pe:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?pe:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?pe:WeakSet};if(ft)try{null.error}catch(t){U2=ft(ft(t)),Zr["%Error.prototype%"]=U2}var U2,bO=function t(e){var n;if(e==="%AsyncFunction%")n=Wh("async function () {}");else if(e==="%GeneratorFunction%")n=Wh("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=Wh("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&ft&&(n=ft(i.prototype))}return Zr[e]=n,n},z2={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ps=Fl(),Ml=Vh(),xO=Ps.call(Function.call,Array.prototype.concat),_O=Ps.call(Function.apply,Array.prototype.splice),G2=Ps.call(Function.call,String.prototype.replace),Ol=Ps.call(Function.call,String.prototype.slice),SO=Ps.call(Function.call,RegExp.prototype.exec),EO=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,kO=/\\(\\)?/g,AO=function(e){var n=Ol(e,0,1),r=Ol(e,-1);if(n==="%"&&r!=="%")throw new Ki("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Ki("invalid intrinsic syntax, expected opening `%`");var i=[];return G2(e,EO,function(a,s,o,l){i[i.length]=o?G2(l,kO,"$1"):s||a}),i},TO=function(e,n){var r=e,i;if(Ml(z2,r)&&(i=z2[r],r="%"+i[0]+"%"),Ml(Zr,r)){var a=Zr[r];if(a===Yi&&(a=bO(r)),typeof a=="undefined"&&!n)throw new Zi("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:a}}throw new Ki("intrinsic "+e+" does not exist!")};W2.exports=function(e,n){if(typeof e!="string"||e.length===0)throw new Zi("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Zi('"allowMissing" argument must be a boolean');if(SO(/^%?[^%]*%?$/,e)===null)throw new Ki("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=AO(e),i=r.length>0?r[0]:"",a=TO("%"+i+"%",n),s=a.name,o=a.value,l=!1,c=a.alias;c&&(i=c[0],_O(r,xO([0,1],c)));for(var u=1,f=!0;u=r.length){var g=Yr(o,h);f=!!g,f&&"get"in g&&!("originalValue"in g.get)?o=g.get:o=o[h]}else f=Ml(o,h),o=o[h];f&&!l&&(Zr[s]=o)}}return o}});var Il=R((J9,q2)=>{"use strict";v();var CO=pn(),Pl=CO("%Object.defineProperty%",!0)||!1;if(Pl)try{Pl({},"a",{value:1})}catch(t){Pl=!1}q2.exports=Pl});var Ll=R((eB,X2)=>{"use strict";v();var FO=pn(),Rl=FO("%Object.getOwnPropertyDescriptor%",!0);if(Rl)try{Rl([],"length")}catch(t){Rl=null}X2.exports=Rl});var jl=R((nB,K2)=>{"use strict";v();var Y2=Il(),MO=zh(),Ji=Wn(),Z2=Ll();K2.exports=function(e,n,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Ji("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new Ji("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ji("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ji("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ji("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ji("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,l=!!Z2&&Z2(e,n);if(Y2)Y2(e,n,{configurable:s===null&&l?l.configurable:!s,enumerable:i===null&&l?l.enumerable:!i,value:r,writable:a===null&&l?l.writable:!a});else if(o||!i&&!a&&!s)e[n]=r;else throw new MO("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Dl=R((iB,Q2)=>{"use strict";v();var Xh=Il(),J2=function(){return!!Xh};J2.hasArrayLengthDefineBug=function(){if(!Xh)return null;try{return Xh([],"length",{value:1}).length!==1}catch(e){return!0}};Q2.exports=J2});var hr=R((sB,rb)=>{"use strict";v();var OO=Tl(),PO=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",IO=Object.prototype.toString,RO=Array.prototype.concat,eb=jl(),LO=function(t){return typeof t=="function"&&IO.call(t)==="[object Function]"},tb=Dl()(),jO=function(t,e,n,r){if(e in t){if(r===!0){if(t[e]===n)return}else if(!LO(r)||!r())return}tb?eb(t,e,n,!0):eb(t,e,n)},nb=function(t,e){var n=arguments.length>2?arguments[2]:{},r=OO(e);PO&&(r=RO.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i{"use strict";v();var DO=pn(),ib=jl(),BO=Dl()(),ab=Ll(),sb=Wn(),NO=DO("%Math.floor%");ob.exports=function(e,n){if(typeof e!="function")throw new sb("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||NO(n)!==n)throw new sb("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,a=!0;if("length"in e&&ab){var s=ab(e,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(a=!1)}return(i||a||!r)&&(BO?ib(e,"length",n,!0,!0):ib(e,"length",n)),e}});var Kr=R((uB,Bl)=>{"use strict";v();var Yh=Fl(),Nl=pn(),$O=lb(),HO=Wn(),fb=Nl("%Function.prototype.apply%"),hb=Nl("%Function.prototype.call%"),db=Nl("%Reflect.apply%",!0)||Yh.call(hb,fb),cb=Il(),UO=Nl("%Math.max%");Bl.exports=function(e){if(typeof e!="function")throw new HO("a function is required");var n=db(Yh,hb,arguments);return $O(n,1+UO(0,e.length-(arguments.length-1)),!0)};var ub=function(){return db(Yh,fb,arguments)};cb?cb(Bl.exports,"apply",{value:ub}):Bl.exports.apply=ub});var qt=R((hB,gb)=>{"use strict";v();var pb=pn(),mb=Kr(),zO=mb(pb("String.prototype.indexOf"));gb.exports=function(e,n){var r=pb(e,!!n);return typeof r=="function"&&zO(e,".prototype.")>-1?mb(r):r}});var Zh=R((pB,xb)=>{"use strict";v();var GO=Tl(),wb=Os()(),bb=qt(),yb=Object,VO=bb("Array.prototype.push"),vb=bb("Object.prototype.propertyIsEnumerable"),WO=wb?Object.getOwnPropertySymbols:null;xb.exports=function(e,n){if(e==null)throw new TypeError("target must be an object");var r=yb(e);if(arguments.length===1)return r;for(var i=1;i{"use strict";v();var Kh=Zh(),qO=function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),n={},r=0;r{"use strict";v();var YO=hr(),ZO=Jh();Sb.exports=function(){var e=ZO();return YO(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}});var Cb=R((bB,Tb)=>{"use strict";v();var KO=hr(),JO=Kr(),QO=Zh(),kb=Jh(),eP=Eb(),tP=JO.apply(kb()),Ab=function(e,n){return tP(Object,arguments)};KO(Ab,{getPolyfill:kb,implementation:QO,shim:eP});Tb.exports=Ab});var Mb=R((_B,Fb)=>{"use strict";v();var Rs=function(){return typeof function(){}.name=="string"},Is=Object.getOwnPropertyDescriptor;if(Is)try{Is([],"length")}catch(t){Is=null}Rs.functionsHaveConfigurableNames=function(){if(!Rs()||!Is)return!1;var e=Is(function(){},"name");return!!e&&!!e.configurable};var nP=Function.prototype.bind;Rs.boundFunctionsHaveNames=function(){return Rs()&&typeof nP=="function"&&function(){}.bind().name!==""};Fb.exports=Rs});var Ib=R((EB,Pb)=>{"use strict";v();var Ob=jl(),rP=Dl()(),iP=Mb().functionsHaveConfigurableNames(),aP=Wn();Pb.exports=function(e,n){if(typeof e!="function")throw new aP("`fn` is not a function");var r=arguments.length>2&&!!arguments[2];return(!r||iP)&&(rP?Ob(e,"name",n,!0,!0):Ob(e,"name",n)),e}});var Qh=R((AB,Rb)=>{"use strict";v();var sP=Ib(),oP=Wn(),lP=Object;Rb.exports=sP(function(){if(this==null||this!==lP(this))throw new oP("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0)});var ed=R((CB,Lb)=>{"use strict";v();var cP=Qh(),uP=hr().supportsDescriptors,fP=Object.getOwnPropertyDescriptor;Lb.exports=function(){if(uP&&/a/mig.flags==="gim"){var e=fP(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var n="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){n+="d"}}),Object.defineProperty(r,"sticky",{get:function(){n+="y"}}),e.get.call(r),n==="dy")return e.get}}return cP}});var Bb=R((MB,Db)=>{"use strict";v();var hP=hr().supportsDescriptors,dP=ed(),pP=Object.getOwnPropertyDescriptor,mP=Object.defineProperty,gP=TypeError,jb=Object.getPrototypeOf,yP=/a/;Db.exports=function(){if(!hP||!jb)throw new gP("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=dP(),n=jb(yP),r=pP(n,"flags");return(!r||r.get!==e)&&mP(n,"flags",{configurable:!0,enumerable:!1,get:e}),e}});var Ub=R((PB,Hb)=>{"use strict";v();var vP=hr(),wP=Kr(),bP=Qh(),Nb=ed(),xP=Bb(),$b=wP(Nb());vP($b,{getPolyfill:Nb,implementation:bP,shim:xP});Hb.exports=$b});var dr=R((RB,zb)=>{"use strict";v();var _P=Os();zb.exports=function(){return _P()&&!!Symbol.toStringTag}});var nd=R((jB,Vb)=>{"use strict";v();var SP=dr()(),EP=qt(),td=EP("Object.prototype.toString"),$l=function(e){return SP&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:td(e)==="[object Arguments]"},Gb=function(e){return $l(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&td(e)!=="[object Array]"&&td(e.callee)==="[object Function]"},kP=function(){return $l(arguments)}();$l.isLegacyArguments=Gb;Vb.exports=kP?$l:Gb});var Wb=R(()=>{v()});var hx=R((HB,fx)=>{v();var hd=typeof Map=="function"&&Map.prototype,rd=Object.getOwnPropertyDescriptor&&hd?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ul=hd&&rd&&typeof rd.get=="function"?rd.get:null,qb=hd&&Map.prototype.forEach,dd=typeof Set=="function"&&Set.prototype,id=Object.getOwnPropertyDescriptor&&dd?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,zl=dd&&id&&typeof id.get=="function"?id.get:null,Xb=dd&&Set.prototype.forEach,AP=typeof WeakMap=="function"&&WeakMap.prototype,js=AP?WeakMap.prototype.has:null,TP=typeof WeakSet=="function"&&WeakSet.prototype,Ds=TP?WeakSet.prototype.has:null,CP=typeof WeakRef=="function"&&WeakRef.prototype,Yb=CP?WeakRef.prototype.deref:null,FP=Boolean.prototype.valueOf,MP=Object.prototype.toString,OP=Function.prototype.toString,PP=String.prototype.match,pd=String.prototype.slice,mr=String.prototype.replace,IP=String.prototype.toUpperCase,Zb=String.prototype.toLowerCase,ax=RegExp.prototype.test,Kb=Array.prototype.concat,On=Array.prototype.join,RP=Array.prototype.slice,Jb=Math.floor,od=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ad=Object.getOwnPropertySymbols,ld=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Qi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",yt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Qi||!0)?Symbol.toStringTag:null,sx=Object.prototype.propertyIsEnumerable,Qb=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ex(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||ax.call(/e/,e))return e;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var r=t<0?-Jb(-t):Jb(t);if(r!==t){var i=String(r),a=pd.call(e,i.length+1);return mr.call(i,n,"$&_")+"."+mr.call(mr.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return mr.call(e,n,"$&_")}var cd=Wb(),tx=cd.custom,nx=lx(tx)?tx:null;fx.exports=function t(e,n,r,i){var a=n||{};if(pr(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(pr(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=pr(a,"customInspect")?a.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(pr(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(pr(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=a.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ux(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return o?ex(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return o?ex(e,c):c}var u=typeof a.depth=="undefined"?5:a.depth;if(typeof r=="undefined"&&(r=0),r>=u&&u>0&&typeof e=="object")return ud(e)?"[Array]":"[Object]";var f=JP(a,r);if(typeof i=="undefined")i=[];else if(cx(i,e)>=0)return"[Circular]";function h(N,j,Y){if(j&&(i=RP.call(i),i.push(j)),Y){var le={depth:a.depth};return pr(a,"quoteStyle")&&(le.quoteStyle=a.quoteStyle),t(N,le,r+1,i)}return t(N,a,r+1,i)}if(typeof e=="function"&&!rx(e)){var d=zP(e),p=Hl(e,h);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+On.call(p,", ")+" }":"")}if(lx(e)){var g=Qi?mr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ld.call(e);return typeof e=="object"&&!Qi?Ls(g):g}if(YP(e)){for(var m="<"+Zb.call(String(e.nodeName)),w=e.attributes||[],b=0;b",m}if(ud(e)){if(e.length===0)return"[]";var S=Hl(e,h);return f&&!KP(S)?"["+fd(S,f)+"]":"[ "+On.call(S,", ")+" ]"}if(DP(e)){var k=Hl(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!sx.call(e,"cause")?"{ ["+String(e)+"] "+On.call(Kb.call("[cause]: "+h(e.cause),k),", ")+" }":k.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+On.call(k,", ")+" }"}if(typeof e=="object"&&s){if(nx&&typeof e[nx]=="function"&&cd)return cd(e,{depth:u-r});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(GP(e)){var x=[];return qb&&qb.call(e,function(N,j){x.push(h(j,e,!0)+" => "+h(N,e))}),ix("Map",Ul.call(e),x,f)}if(qP(e)){var A=[];return Xb&&Xb.call(e,function(N){A.push(h(N,e))}),ix("Set",zl.call(e),A,f)}if(VP(e))return sd("WeakMap");if(XP(e))return sd("WeakSet");if(WP(e))return sd("WeakRef");if(NP(e))return Ls(h(Number(e)));if(HP(e))return Ls(h(od.call(e)));if($P(e))return Ls(FP.call(e));if(BP(e))return Ls(h(String(e)));if(typeof window!="undefined"&&e===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&e===globalThis||typeof global!="undefined"&&e===global)return"{ [object globalThis] }";if(!jP(e)&&!rx(e)){var y=Hl(e,h),E=Qb?Qb(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",C=!E&&yt&&Object(e)===e&&yt in e?pd.call(gr(e),8,-1):_?"Object":"",M=E||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",L=M+(C||_?"["+On.call(Kb.call([],C||[],_||[]),": ")+"] ":"");return y.length===0?L+"{}":f?L+"{"+fd(y,f)+"}":L+"{ "+On.call(y,", ")+" }"}return String(e)};function ox(t,e,n){var r=(n.quoteStyle||e)==="double"?'"':"'";return r+t+r}function LP(t){return mr.call(String(t),/"/g,""")}function ud(t){return gr(t)==="[object Array]"&&(!yt||!(typeof t=="object"&&yt in t))}function jP(t){return gr(t)==="[object Date]"&&(!yt||!(typeof t=="object"&&yt in t))}function rx(t){return gr(t)==="[object RegExp]"&&(!yt||!(typeof t=="object"&&yt in t))}function DP(t){return gr(t)==="[object Error]"&&(!yt||!(typeof t=="object"&&yt in t))}function BP(t){return gr(t)==="[object String]"&&(!yt||!(typeof t=="object"&&yt in t))}function NP(t){return gr(t)==="[object Number]"&&(!yt||!(typeof t=="object"&&yt in t))}function $P(t){return gr(t)==="[object Boolean]"&&(!yt||!(typeof t=="object"&&yt in t))}function lx(t){if(Qi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!ld)return!1;try{return ld.call(t),!0}catch(e){}return!1}function HP(t){if(!t||typeof t!="object"||!od)return!1;try{return od.call(t),!0}catch(e){}return!1}var UP=Object.prototype.hasOwnProperty||function(t){return t in this};function pr(t,e){return UP.call(t,e)}function gr(t){return MP.call(t)}function zP(t){if(t.name)return t.name;var e=PP.call(OP.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function cx(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,r=t.length;ne.maxStringLength){var n=t.length-e.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return ux(pd.call(t,0,e.maxStringLength),e)+r}var i=mr.call(mr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ZP);return ox(i,"single",e)}function ZP(t){var e=t.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return n?"\\"+n:"\\x"+(e<16?"0":"")+IP.call(e.toString(16))}function Ls(t){return"Object("+t+")"}function sd(t){return t+" { ? }"}function ix(t,e,n,r){var i=r?fd(n,r):On.call(n,", ");return t+" ("+e+") {"+i+"}"}function KP(t){for(var e=0;e=0)return!1;return!0}function JP(t,e){var n;if(t.indent===" ")n=" ";else if(typeof t.indent=="number"&&t.indent>0)n=On.call(Array(t.indent+1)," ");else return null;return{base:n,prev:On.call(Array(e+1),n)}}function fd(t,e){if(t.length===0)return"";var n=` +`+e.prev+e.base;return n+On.call(t,","+n)+` +`+e.prev}function Hl(t,e){var n=ud(t),r=[];if(n){r.length=t.length;for(var i=0;i{"use strict";v();var dx=pn(),ea=qt(),QP=hx(),eI=Wn(),Gl=dx("%WeakMap%",!0),Vl=dx("%Map%",!0),tI=ea("WeakMap.prototype.get",!0),nI=ea("WeakMap.prototype.set",!0),rI=ea("WeakMap.prototype.has",!0),iI=ea("Map.prototype.get",!0),aI=ea("Map.prototype.set",!0),sI=ea("Map.prototype.has",!0),md=function(t,e){for(var n=t,r;(r=n.next)!==null;n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r},oI=function(t,e){var n=md(t,e);return n&&n.value},lI=function(t,e,n){var r=md(t,e);r?r.value=n:t.next={key:e,next:t.next,value:n}},cI=function(t,e){return!!md(t,e)};px.exports=function(){var e,n,r,i={assert:function(a){if(!i.has(a))throw new eI("Side channel does not contain "+QP(a))},get:function(a){if(Gl&&a&&(typeof a=="object"||typeof a=="function")){if(e)return tI(e,a)}else if(Vl){if(n)return iI(n,a)}else if(r)return oI(r,a)},has:function(a){if(Gl&&a&&(typeof a=="object"||typeof a=="function")){if(e)return rI(e,a)}else if(Vl){if(n)return sI(n,a)}else if(r)return cI(r,a);return!1},set:function(a,s){Gl&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Gl),nI(e,a,s)):Vl?(n||(n=new Vl),aI(n,a,s)):(r||(r={key:{},next:null}),lI(r,a,s))}};return i}});var gx=R((VB,mx)=>{"use strict";v();var uI=Vh(),Bs=gd()(),qn=Wn(),yd={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`O` is not an object");if(typeof e!="string")throw new qn("`slot` must be a string");if(Bs.assert(t),!yd.has(t,e))throw new qn("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`O` is not an object");if(typeof e!="string")throw new qn("`slot` must be a string");var n=Bs.get(t);return n&&n["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`O` is not an object");if(typeof e!="string")throw new qn("`slot` must be a string");var n=Bs.get(t);return!!n&&uI(n,"$"+e)},set:function(t,e,n){if(!t||typeof t!="object"&&typeof t!="function")throw new qn("`O` is not an object");if(typeof e!="string")throw new qn("`slot` must be a string");var r=Bs.get(t);r||(r={},Bs.set(t,r)),r["$"+e]=n}};Object.freeze&&Object.freeze(yd);mx.exports=yd});var wx=R((qB,vx)=>{"use strict";v();var Ns=gx(),fI=SyntaxError,yx=typeof StopIteration=="object"?StopIteration:null;vx.exports=function(e){if(!yx)throw new fI("this environment lacks StopIteration");Ns.set(e,"[[Done]]",!1);var n={next:function(){var i=Ns.get(this,"[[Iterator]]"),a=Ns.get(i,"[[Done]]");try{return{done:a,value:a?void 0:i.next()}}catch(s){if(Ns.set(i,"[[Done]]",!0),s!==yx)throw s;return{done:!0,value:void 0}}}};return Ns.set(n,"[[Iterator]]",e),n}});var vd=R((YB,bx)=>{v();var hI={}.toString;bx.exports=Array.isArray||function(t){return hI.call(t)=="[object Array]"}});var wd=R((KB,xx)=>{"use strict";v();var dI=String.prototype.valueOf,pI=function(e){try{return dI.call(e),!0}catch(n){return!1}},mI=Object.prototype.toString,gI="[object String]",yI=dr()();xx.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:yI?pI(e):mI.call(e)===gI}});var xd=R((QB,Ex)=>{"use strict";v();var bd=typeof Map=="function"&&Map.prototype?Map:null,vI=typeof Set=="function"&&Set.prototype?Set:null,Wl;bd||(Wl=function(e){return!1});var Sx=bd?Map.prototype.has:null,_x=vI?Set.prototype.has:null;!Wl&&!Sx&&(Wl=function(e){return!1});Ex.exports=Wl||function(e){if(!e||typeof e!="object")return!1;try{if(Sx.call(e),_x)try{_x.call(e)}catch(n){return!0}return e instanceof bd}catch(n){}return!1}});var Sd=R((tN,Tx)=>{"use strict";v();var wI=typeof Map=="function"&&Map.prototype?Map:null,_d=typeof Set=="function"&&Set.prototype?Set:null,ql;_d||(ql=function(e){return!1});var kx=wI?Map.prototype.has:null,Ax=_d?Set.prototype.has:null;!ql&&!Ax&&(ql=function(e){return!1});Tx.exports=ql||function(e){if(!e||typeof e!="object")return!1;try{if(Ax.call(e),kx)try{kx.call(e)}catch(n){return!0}return e instanceof _d}catch(n){}return!1}});var Nx=R((rN,Zl)=>{"use strict";v();var Cx=nd(),Fx=wx();Cl()()||Os()()?(Xl=Symbol.iterator,Zl.exports=function(e){if(e!=null&&typeof e[Xl]!="undefined")return e[Xl]();if(Cx(e))return Array.prototype[Xl].call(e)}):(Mx=vd(),Ox=wd(),Ed=pn(),Px=Ed("%Map%",!0),Ix=Ed("%Set%",!0),rn=qt(),kd=rn("Array.prototype.push"),Ad=rn("String.prototype.charCodeAt"),Rx=rn("String.prototype.slice"),Lx=function(e,n){var r=e.length;if(n+1>=r)return n+1;var i=Ad(e,n);if(i<55296||i>56319)return n+1;var a=Ad(e,n+1);return a<56320||a>57343?n+1:n+2},Yl=function(e){var n=0;return{next:function(){var i=n>=e.length,a;return i||(a=e[n],n+=1),{done:i,value:a}}}},Td=function(e,n){if(Mx(e)||Cx(e))return Yl(e);if(Ox(e)){var r=0;return{next:function(){var a=Lx(e,r),s=Rx(e,r,a);return r=a,{done:a>e.length,value:s}}}}if(n&&typeof e["_es6-shim iterator_"]!="undefined")return e["_es6-shim iterator_"]()},!Px&&!Ix?Zl.exports=function(e){if(e!=null)return Td(e,!0)}:(jx=xd(),Dx=Sd(),Cd=rn("Map.prototype.forEach",!0),Fd=rn("Set.prototype.forEach",!0),(typeof process=="undefined"||!process.versions||!process.versions.node)&&(Md=rn("Map.prototype.iterator",!0),Od=rn("Set.prototype.iterator",!0)),Pd=rn("Map.prototype.@@iterator",!0)||rn("Map.prototype._es6-shim iterator_",!0),Id=rn("Set.prototype.@@iterator",!0)||rn("Set.prototype._es6-shim iterator_",!0),Bx=function(e){if(jx(e)){if(Md)return Fx(Md(e));if(Pd)return Pd(e);if(Cd){var n=[];return Cd(e,function(i,a){kd(n,[a,i])}),Yl(n)}}if(Dx(e)){if(Od)return Fx(Od(e));if(Id)return Id(e);if(Fd){var r=[];return Fd(e,function(i){kd(r,i)}),Yl(r)}}},Zl.exports=function(e){return Bx(e)||Td(e)}));var Xl,Mx,Ox,Ed,Px,Ix,rn,kd,Ad,Rx,Lx,Yl,Td,jx,Dx,Cd,Fd,Md,Od,Pd,Id,Bx});var Rd=R((aN,Hx)=>{"use strict";v();var $x=function(t){return t!==t};Hx.exports=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||$x(e)&&$x(n))}});var Ld=R((oN,Ux)=>{"use strict";v();var bI=Rd();Ux.exports=function(){return typeof Object.is=="function"?Object.is:bI}});var Gx=R((cN,zx)=>{"use strict";v();var xI=Ld(),_I=hr();zx.exports=function(){var e=xI();return _I(Object,{is:e},{is:function(){return Object.is!==e}}),e}});var Xx=R((fN,qx)=>{"use strict";v();var SI=hr(),EI=Kr(),kI=Rd(),Vx=Ld(),AI=Gx(),Wx=EI(Vx(),Object);SI(Wx,{getPolyfill:Vx,implementation:kI,shim:AI});qx.exports=Wx});var Dd=R((dN,Jx)=>{"use strict";v();var TI=Kr(),Kx=qt(),CI=pn(),jd=CI("%ArrayBuffer%",!0),Kl=Kx("ArrayBuffer.prototype.byteLength",!0),FI=Kx("Object.prototype.toString"),Yx=!!jd&&!Kl&&new jd(0).slice,Zx=!!Yx&&TI(Yx);Jx.exports=Kl||Zx?function(e){if(!e||typeof e!="object")return!1;try{return Kl?Kl(e):Zx(e,0),!0}catch(n){return!1}}:jd?function(e){return FI(e)==="[object ArrayBuffer]"}:function(e){return!1}});var e_=R((mN,Qx)=>{"use strict";v();var MI=Date.prototype.getDay,OI=function(e){try{return MI.call(e),!0}catch(n){return!1}},PI=Object.prototype.toString,II="[object Date]",RI=dr()();Qx.exports=function(e){return typeof e!="object"||e===null?!1:RI?OI(e):PI.call(e)===II}});var a_=R((yN,i_)=>{"use strict";v();var Bd=qt(),t_=dr()(),n_,r_,Nd,$d;t_&&(n_=Bd("Object.prototype.hasOwnProperty"),r_=Bd("RegExp.prototype.exec"),Nd={},Jl=function(){throw Nd},$d={toString:Jl,valueOf:Jl},typeof Symbol.toPrimitive=="symbol"&&($d[Symbol.toPrimitive]=Jl));var Jl,LI=Bd("Object.prototype.toString"),jI=Object.getOwnPropertyDescriptor,DI="[object RegExp]";i_.exports=t_?function(e){if(!e||typeof e!="object")return!1;var n=jI(e,"lastIndex"),r=n&&n_(n,"value");if(!r)return!1;try{r_(e,$d)}catch(i){return i===Nd}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:LI(e)===DI}});var l_=R((wN,o_)=>{"use strict";v();var BI=qt(),s_=BI("SharedArrayBuffer.prototype.byteLength",!0);o_.exports=s_?function(e){if(!e||typeof e!="object")return!1;try{return s_(e),!0}catch(n){return!1}}:function(e){return!1}});var u_=R((xN,c_)=>{"use strict";v();var NI=Number.prototype.toString,$I=function(e){try{return NI.call(e),!0}catch(n){return!1}},HI=Object.prototype.toString,UI="[object Number]",zI=dr()();c_.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:zI?$I(e):HI.call(e)===UI}});var d_=R((SN,h_)=>{"use strict";v();var f_=qt(),GI=f_("Boolean.prototype.toString"),VI=f_("Object.prototype.toString"),WI=function(e){try{return GI(e),!0}catch(n){return!1}},qI="[object Boolean]",XI=dr()();h_.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:XI&&Symbol.toStringTag in e?WI(e):VI(e)===qI}});var y_=R((kN,Hd)=>{"use strict";v();var YI=Object.prototype.toString,ZI=Cl()();ZI?(p_=Symbol.prototype.toString,m_=/^Symbol\(.*\)$/,g_=function(e){return typeof e.valueOf()!="symbol"?!1:m_.test(p_.call(e))},Hd.exports=function(e){if(typeof e=="symbol")return!0;if(YI.call(e)!=="[object Symbol]")return!1;try{return g_(e)}catch(n){return!1}}):Hd.exports=function(e){return!1};var p_,m_,g_});var b_=R((TN,w_)=>{"use strict";v();var v_=typeof BigInt!="undefined"&&BigInt;w_.exports=function(){return typeof v_=="function"&&typeof BigInt=="function"&&typeof v_(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var S_=R((FN,Ud)=>{"use strict";v();var KI=b_()();KI?(x_=BigInt.prototype.valueOf,__=function(e){try{return x_.call(e),!0}catch(n){}return!1},Ud.exports=function(e){return e===null||typeof e=="undefined"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:__(e)}):Ud.exports=function(e){return!1};var x_,__});var k_=R((ON,E_)=>{"use strict";v();var JI=wd(),QI=u_(),eR=d_(),tR=y_(),nR=S_();E_.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(JI(e))return"String";if(QI(e))return"Number";if(eR(e))return"Boolean";if(tR(e))return"Symbol";if(nR(e))return"BigInt"}});var C_=R((IN,T_)=>{"use strict";v();var Ql=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,A_=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,ec;Ql||(ec=function(e){return!1});var Gd=Ql?Ql.prototype.has:null,zd=A_?A_.prototype.has:null;!ec&&!Gd&&(ec=function(e){return!1});T_.exports=ec||function(e){if(!e||typeof e!="object")return!1;try{if(Gd.call(e,Gd),zd)try{zd.call(e,zd)}catch(n){return!0}return e instanceof Ql}catch(n){}return!1}});var M_=R((LN,Wd)=>{"use strict";v();var rR=pn(),F_=qt(),iR=rR("%WeakSet%",!0),Vd=F_("WeakSet.prototype.has",!0);Vd?(tc=F_("WeakMap.prototype.has",!0),Wd.exports=function(e){if(!e||typeof e!="object")return!1;try{if(Vd(e,Vd),tc)try{tc(e,tc)}catch(n){return!0}return e instanceof iR}catch(n){}return!1}):Wd.exports=function(e){return!1};var tc});var P_=R((DN,O_)=>{"use strict";v();var aR=xd(),sR=Sd(),oR=C_(),lR=M_();O_.exports=function(e){if(e&&typeof e=="object"){if(aR(e))return"Map";if(sR(e))return"Set";if(oR(e))return"WeakMap";if(lR(e))return"WeakSet"}return!1}});var j_=R((NN,L_)=>{"use strict";v();var R_=Function.prototype.toString,ta=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Xd,nc;if(typeof ta=="function"&&typeof Object.defineProperty=="function")try{Xd=Object.defineProperty({},"length",{get:function(){throw nc}}),nc={},ta(function(){throw 42},null,Xd)}catch(t){t!==nc&&(ta=null)}else ta=null;var cR=/^\s*class\b/,Yd=function(e){try{var n=R_.call(e);return cR.test(n)}catch(r){return!1}},qd=function(e){try{return Yd(e)?!1:(R_.call(e),!0)}catch(n){return!1}},rc=Object.prototype.toString,uR="[object Object]",fR="[object Function]",hR="[object GeneratorFunction]",dR="[object HTMLAllCollection]",pR="[object HTML document.all class]",mR="[object HTMLCollection]",gR=typeof Symbol=="function"&&!!Symbol.toStringTag,yR=!(0 in[,]),Zd=function(){return!1};typeof document=="object"&&(I_=document.all,rc.call(I_)===rc.call(document.all)&&(Zd=function(e){if((yR||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var n=rc.call(e);return(n===dR||n===pR||n===mR||n===uR)&&e("")==null}catch(r){}return!1}));var I_;L_.exports=ta?function(e){if(Zd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{ta(e,null,Xd)}catch(n){if(n!==nc)return!1}return!Yd(e)&&qd(e)}:function(e){if(Zd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(gR)return qd(e);if(Yd(e))return!1;var n=rc.call(e);return n!==fR&&n!==hR&&!/^\[object HTML/.test(n)?!1:qd(e)}});var N_=R((HN,B_)=>{"use strict";v();var vR=j_(),wR=Object.prototype.toString,D_=Object.prototype.hasOwnProperty,bR=function(e,n,r){for(var i=0,a=e.length;i=3&&(i=r),wR.call(e)==="[object Array]"?bR(e,n,i):typeof e=="string"?xR(e,n,i):_R(e,n,i)};B_.exports=SR});var H_=R((zN,$_)=>{"use strict";v();$_.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var z_=R((VN,U_)=>{"use strict";v();var Kd=H_(),ER=typeof globalThis=="undefined"?global:globalThis;U_.exports=function(){for(var e=[],n=0;n{"use strict";v();var ac=N_(),kR=z_(),G_=Kr(),ep=qt(),ic=Ll(),AR=ep("Object.prototype.toString"),W_=dr()(),V_=typeof globalThis=="undefined"?global:globalThis,Qd=kR(),tp=ep("String.prototype.slice"),Jd=Object.getPrototypeOf,TR=ep("Array.prototype.indexOf",!0)||function(e,n){for(var r=0;r-1?n:n!=="Object"?!1:FR(e)}return ic?CR(e):null}});var K_=R((YN,Z_)=>{"use strict";v();var MR=qt(),Y_=MR("ArrayBuffer.prototype.byteLength",!0),OR=Dd();Z_.exports=function(e){return OR(e)?Y_?Y_(e):e.byteLength:NaN}});var _S=R((KN,xS)=>{"use strict";v();var vS=Cb(),Pn=qt(),J_=Ub(),PR=pn(),na=Nx(),IR=gd(),Q_=Xx(),eS=nd(),tS=vd(),nS=Dd(),rS=e_(),iS=a_(),aS=l_(),sS=Tl(),oS=k_(),lS=P_(),cS=X_(),uS=K_(),fS=Pn("SharedArrayBuffer.prototype.byteLength",!0),hS=Pn("Date.prototype.getTime"),np=Object.getPrototypeOf,dS=Pn("Object.prototype.toString"),lc=PR("%Set%",!0),rp=Pn("Map.prototype.has",!0),cc=Pn("Map.prototype.get",!0),pS=Pn("Map.prototype.size",!0),uc=Pn("Set.prototype.add",!0),wS=Pn("Set.prototype.delete",!0),fc=Pn("Set.prototype.has",!0),oc=Pn("Set.prototype.size",!0);function mS(t,e,n,r){for(var i=na(t),a;(a=i.next())&&!a.done;)if(mn(e,a.value,n,r))return wS(t,a.value),!0;return!1}function bS(t){if(typeof t=="undefined")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function RR(t,e,n,r,i,a){var s=bS(n);if(s!=null)return s;var o=cc(e,s),l=vS({},i,{strict:!1});return typeof o=="undefined"&&!rp(e,s)||!mn(r,o,l,a)?!1:!rp(t,s)&&mn(r,o,l,a)}function LR(t,e,n){var r=bS(n);return r!=null?r:fc(e,r)&&!fc(t,r)}function gS(t,e,n,r,i,a){for(var s=na(t),o,l;(o=s.next())&&!o.done;)if(l=o.value,mn(n,l,i,a)&&mn(r,cc(e,l),i,a))return wS(t,l),!0;return!1}function mn(t,e,n,r){var i=n||{};if(i.strict?Q_(t,e):t===e)return!0;var a=oS(t),s=oS(e);if(a!==s)return!1;if(!t||!e||typeof t!="object"&&typeof e!="object")return i.strict?Q_(t,e):t==e;var o=r.has(t),l=r.has(e),c;if(o&&l){if(r.get(t)===r.get(e))return!0}else c={};return o||r.set(t,c),l||r.set(e,c),BR(t,e,i,r)}function yS(t){return!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function jR(t,e,n,r){if(oc(t)!==oc(e))return!1;for(var i=na(t),a=na(e),s,o,l;(s=i.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new lc),uc(l,s.value);else if(!fc(e,s.value)){if(n.strict||!LR(t,e,s.value))return!1;l||(l=new lc),uc(l,s.value)}if(l){for(;(o=a.next())&&!o.done;)if(o.value&&typeof o.value=="object"){if(!mS(l,o.value,n.strict,r))return!1}else if(!n.strict&&!fc(t,o.value)&&!mS(l,o.value,n.strict,r))return!1;return oc(l)===0}return!0}function DR(t,e,n,r){if(pS(t)!==pS(e))return!1;for(var i=na(t),a=na(e),s,o,l,c,u,f;(s=i.next())&&!s.done;)if(c=s.value[0],u=s.value[1],c&&typeof c=="object")l||(l=new lc),uc(l,c);else if(f=cc(e,c),typeof f=="undefined"&&!rp(e,c)||!mn(u,f,n,r)){if(n.strict||!RR(t,e,c,u,n,r))return!1;l||(l=new lc),uc(l,c)}if(l){for(;(o=a.next())&&!o.done;)if(c=o.value[0],f=o.value[1],c&&typeof c=="object"){if(!gS(l,t,c,f,n,r))return!1}else if(!n.strict&&(!t.has(c)||!mn(cc(t,c),f,n,r))&&!gS(l,t,c,f,vS({},n,{strict:!1}),r))return!1;return oc(l)===0}return!0}function BR(t,e,n,r){var i,a;if(typeof t!=typeof e||t==null||e==null||dS(t)!==dS(e)||eS(t)!==eS(e))return!1;var s=tS(t),o=tS(e);if(s!==o)return!1;var l=t instanceof Error,c=e instanceof Error;if(l!==c||(l||c)&&(t.name!==e.name||t.message!==e.message))return!1;var u=iS(t),f=iS(e);if(u!==f||(u||f)&&(t.source!==e.source||J_(t)!==J_(e)))return!1;var h=rS(t),d=rS(e);if(h!==d||(h||d)&&hS(t)!==hS(e)||n.strict&&np&&np(t)!==np(e))return!1;var p=cS(t),g=cS(e);if(p!==g)return!1;if(p||g){if(t.length!==e.length)return!1;for(i=0;i=0;i--)if(A[i]!=y[i])return!1;for(i=A.length-1;i>=0;i--)if(a=A[i],!mn(t[a],e[a],n,r))return!1;var E=lS(t),_=lS(e);return E!==_?!1:E==="Set"||_==="Set"?jR(t,e,n,r):E==="Map"?DR(t,e,n,r):!0}xS.exports=function(e,n,r){return mn(e,n,r,IR())}});var cp=R((exports,module)=>{v();(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[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],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(n){return new Sha256(e,!0).update(n)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(i){return e.create().update(i)};for(var n=0;n>2]|=t[i]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|r&63)<=57344?(o[a>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|r&63)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|r&63)<=64?(this.block=o[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,l=this.blocks,c,u,f,h,d,p,g,m,w,b,S;for(c=16;c<64;++c)d=l[c-15],u=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,d=l[c-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,l[c]=l[c-16]+u+l[c-7]+f<<0;for(S=e&n,c=0;c<64;c+=4)this.first?(this.is224?(m=300032,d=l[0]-1413257819,o=d-150054599<<0,r=d+24177077<<0):(m=704751109,d=l[0]-210244248,o=d-1521486534<<0,r=d+143694565<<0),this.first=!1):(u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),f=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),m=t&e,h=m^t&n^S,g=i&a^~i&s,d=o+f+g+K[c]+l[c],p=u+h,o=r+d<<0,r=d+p<<0),u=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),f=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),w=r&t,h=w^r&e^m,g=o&i^~o&a,d=s+f+g+K[c+1]+l[c+1],p=u+h,s=n+d<<0,n=d+p<<0,u=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),f=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),b=n&r,h=b^n&t^w,g=s&o^~s&i,d=a+f+g+K[c+2]+l[c+2],p=u+h,a=e+d<<0,e=d+p<<0,u=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),f=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),S=e&n,h=S^e&r^b,g=a&s^~a&o,d=i+f+g+K[c+3]+l[c+3],p=u+h,i=t+d<<0,t=d+p<<0;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0,this.h5=this.h5+a<<0,this.h6=this.h6+s<<0,this.h7=this.h7+o<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,l=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15];return this.is224||(l+=HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]),l},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,l=[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,r>>24&255,r>>16&255,r>>8&255,r&255,i>>24&255,i>>16&255,i>>8&255,i&255,a>>24&255,a>>16&255,a>>8&255,a&255,s>>24&255,s>>16&255,s>>8&255,s&255];return this.is224||l.push(o>>24&255,o>>16&255,o>>8&255,o&255),l},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t};function HmacSha256(t,e,n){var r,i=typeof t;if(i==="string"){var a=[],s=t.length,o=0,l;for(r=0;r>6,a[o++]=128|l&63):l<55296||l>=57344?(a[o++]=224|l>>12,a[o++]=128|l>>6&63,a[o++]=128|l&63):(l=65536+((l&1023)<<10|t.charCodeAt(++r)&1023),a[o++]=240|l>>18,a[o++]=128|l>>12&63,a[o++]=128|l>>6&63,a[o++]=128|l&63);t=a}else if(i==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);t.length>64&&(t=new Sha256(e,!0).update(t).array());var c=[],u=[];for(r=0;r<64;++r){var f=t[r]||0;c[r]=92^f,u[r]=54^f}Sha256.call(this,e,n),this.update(u),this.oKeyPad=c,this.inner=!0,this.sharedMemory=n}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var GE=R(Bp=>{v();(function(t){var e=/\S/,n=/\"/g,r=/\n/g,i=/\r/g,a=/\\/g,s=/\u2028/,o=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(E,_){var C=E.length,M=0,L=1,N=2,j=M,Y=null,le=null,he="",ie=[],Me=!1,de=0,$=0,G="{{",D="}}";function se(){he.length>0&&(ie.push({tag:"_t",text:new String(he)}),he="")}function Se(){for(var st=!0,ee=$;ee"&&(Ee.indent=ie[Ie].text.toString()),ie.splice(Ie,1));else ee||ie.push({tag:` +`});Me=!1,$=ie.length}function be(st,ee){var Ie="="+D,Ee=st.indexOf(Ie,ee),z=c(st.substring(st.indexOf("=",ee)+1,Ee)).split(" ");return G=z[0],D=z[z.length-1],Ee+Ie.length-1}for(_&&(_=_.split(" "),G=_[0],D=_[1]),de=0;de0;){if(j=y.shift(),N&&N.tag=="<"&&!(j.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[j.tag]<=t.tags.$||d(j,C))_.push(j),j.nodes=h(y,j.tag,_,C);else if(j.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+j.n);if(L=_.pop(),j.n!=L.n&&!p(j.n,L.n,C))throw new Error("Nesting error: "+L.n+" vs. "+j.n);return L.end=j.i,M}else j.tag==` +`&&(j.last=y.length==0||y[0].tag==` +`);M.push(j)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return M}function d(y,E){for(var _=0,C=E.length;_":k,"<":function(y,E){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(y.nodes,_);var C=E.partials[k(y,E)];C.subs=_.subs,C.partials=_.partials},$:function(y,E){var _={subs:{},code:"",partials:E.partials,prefix:y.n};t.walk(y.nodes,_),E.subs[y.n]=_.code,E.inPartial||(E.code+='t.sub("'+b(y.n)+'",c,p,i);')},"\n":function(y,E){E.code+=A('"\\n"'+(y.last?"":" + i"))},_v:function(y,E){E.code+="t.b(t.v(t."+S(y.n)+'("'+b(y.n)+'",c,p,0)));'},_t:function(y,E){E.code+=A('"'+b(y.text)+'"')},"{":x,"&":x};function x(y,E){E.code+="t.b(t.t(t."+S(y.n)+'("'+b(y.n)+'",c,p,0)));'}function A(y){return"t.b("+y+");"}t.walk=function(y,E){for(var _,C=0,M=y.length;C{v();var KL={};(function(t){t.Template=function(h,d,p,g){h=h||{},this.r=h.code||this.r,this.c=p,this.options=g||{},this.text=d||"",this.partials=h.partials||{},this.subs=h.subs||{},this.buf=""},t.Template.prototype={r:function(h,d,p){return""},v:u,t:c,render:function(d,p,g){return this.ri([d],p||{},g)},ri:function(h,d,p){return this.r(h,d,p)},ep:function(h,d){var p=this.partials[h],g=d[p.name];if(p.instance&&p.base==g)return p.instance;if(typeof g=="string"){if(!this.c)throw new Error("No compiler available.");g=this.c.compile(g,this.options)}if(!g)return null;if(this.partials[h].base=g,p.subs){d.stackText||(d.stackText={});for(key in p.subs)d.stackText[key]||(d.stackText[key]=this.activeSub!==void 0&&d.stackText[this.activeSub]?d.stackText[this.activeSub]:this.text);g=n(g,p.subs,p.partials,this.stackSubs,this.stackPartials,d.stackText)}return this.partials[h].instance=g,g},rp:function(h,d,p,g){var m=this.ep(h,p);return m?m.ri(d,p,g):""},rs:function(h,d,p){var g=h[h.length-1];if(!f(g)){p(h,d,this);return}for(var m=0;m=0;k--)if(w=d[k],m=e(h,w,S),m!==void 0){b=!0;break}return b?(!g&&typeof m=="function"&&(m=this.mv(m,d,p)),m):g?!1:""},ls:function(h,d,p,g,m){var w=this.options.delimiters;return this.options.delimiters=m,this.b(this.ct(c(h.call(d,g)),d,p)),this.options.delimiters=w,!1},ct:function(h,d,p){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(h,this.options).render(d,p)},b:function(h){this.buf+=h},fl:function(){var h=this.buf;return this.buf="",h},ms:function(h,d,p,g,m,w,b){var S,k=d[d.length-1],x=h.call(k);return typeof x=="function"?g?!0:(S=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(x,k,p,S.substring(m,w),b)):x},mv:function(h,d,p){var g=d[d.length-1],m=h.call(g);return typeof m=="function"?this.ct(c(m.call(g)),g,p):m},sub:function(h,d,p,g){var m=this.subs[h];m&&(this.activeSub=h,m(d,p,this,g),this.activeSub=!1)}};function e(h,d,p){var g;return d&&typeof d=="object"&&(d[h]!==void 0?g=d[h]:p&&d.get&&typeof d.get=="function"&&(g=d.get(h))),g}function n(h,d,p,g,m,w){function b(){}b.prototype=h;function S(){}S.prototype=h.subs;var k,x=new b;x.subs=new S,x.subsText={},x.buf="",g=g||{},x.stackSubs=g,x.subsText=w;for(k in d)g[k]||(g[k]=d[k]);for(k in g)x.subs[k]=g[k];m=m||{},x.stackPartials=m;for(k in p)m[k]||(m[k]=p[k]);for(k in m)x.partials[k]=m[k];return x}var r=/&/g,i=//g,s=/\'/g,o=/\"/g,l=/[&<>\"\']/;function c(h){return String(h==null?"":h)}function u(h){return h=c(h),l.test(h)?h.replace(r,"&").replace(i,"<").replace(a,">").replace(s,"'").replace(o,"""):h}var f=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"}})(typeof Np!="undefined"?Np:KL)});var $p=R((QU,WE)=>{v();var Vc=GE();Vc.Template=VE().Template;Vc.template=Vc.Template;WE.exports=Vc});var Fk=R((so,tm)=>{v();(function(e,n){typeof so=="object"&&typeof tm=="object"?tm.exports=n():typeof define=="function"&&define.amd?define([],n):typeof so=="object"?so.feather=n():e.feather=n()})(typeof self!="undefined"?self:so,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(r,i,a){n.o(r,i)||Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:a})},n.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},n.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(i,"a",i),i},n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},n.p="",n(n.s=0)}({"./dist/icons.json":function(t){t.exports={activity:'',airplay:'',"alert-circle":'',"alert-octagon":'',"alert-triangle":'',"align-center":'',"align-justify":'',"align-left":'',"align-right":'',anchor:'',aperture:'',archive:'',"arrow-down-circle":'',"arrow-down-left":'',"arrow-down-right":'',"arrow-down":'',"arrow-left-circle":'',"arrow-left":'',"arrow-right-circle":'',"arrow-right":'',"arrow-up-circle":'',"arrow-up-left":'',"arrow-up-right":'',"arrow-up":'',"at-sign":'',award:'',"bar-chart-2":'',"bar-chart":'',"battery-charging":'',battery:'',"bell-off":'',bell:'',bluetooth:'',bold:'',"book-open":'',book:'',bookmark:'',box:'',briefcase:'',calendar:'',"camera-off":'',camera:'',cast:'',"check-circle":'',"check-square":'',check:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"chevrons-down":'',"chevrons-left":'',"chevrons-right":'',"chevrons-up":'',chrome:'',circle:'',clipboard:'',clock:'',"cloud-drizzle":'',"cloud-lightning":'',"cloud-off":'',"cloud-rain":'',"cloud-snow":'',cloud:'',code:'',codepen:'',codesandbox:'',coffee:'',columns:'',command:'',compass:'',copy:'',"corner-down-left":'',"corner-down-right":'',"corner-left-down":'',"corner-left-up":'',"corner-right-down":'',"corner-right-up":'',"corner-up-left":'',"corner-up-right":'',cpu:'',"credit-card":'',crop:'',crosshair:'',database:'',delete:'',disc:'',"divide-circle":'',"divide-square":'',divide:'',"dollar-sign":'',"download-cloud":'',download:'',dribbble:'',droplet:'',"edit-2":'',"edit-3":'',edit:'',"external-link":'',"eye-off":'',eye:'',facebook:'',"fast-forward":'',feather:'',figma:'',"file-minus":'',"file-plus":'',"file-text":'',file:'',film:'',filter:'',flag:'',"folder-minus":'',"folder-plus":'',folder:'',framer:'',frown:'',gift:'',"git-branch":'',"git-commit":'',"git-merge":'',"git-pull-request":'',github:'',gitlab:'',globe:'',grid:'',"hard-drive":'',hash:'',headphones:'',heart:'',"help-circle":'',hexagon:'',home:'',image:'',inbox:'',info:'',instagram:'',italic:'',key:'',layers:'',layout:'',"life-buoy":'',"link-2":'',link:'',linkedin:'',list:'',loader:'',lock:'',"log-in":'',"log-out":'',mail:'',"map-pin":'',map:'',"maximize-2":'',maximize:'',meh:'',menu:'',"message-circle":'',"message-square":'',"mic-off":'',mic:'',"minimize-2":'',minimize:'',"minus-circle":'',"minus-square":'',minus:'',monitor:'',moon:'',"more-horizontal":'',"more-vertical":'',"mouse-pointer":'',move:'',music:'',"navigation-2":'',navigation:'',octagon:'',package:'',paperclip:'',"pause-circle":'',pause:'',"pen-tool":'',percent:'',"phone-call":'',"phone-forwarded":'',"phone-incoming":'',"phone-missed":'',"phone-off":'',"phone-outgoing":'',phone:'',"pie-chart":'',"play-circle":'',play:'',"plus-circle":'',"plus-square":'',plus:'',pocket:'',power:'',printer:'',radio:'',"refresh-ccw":'',"refresh-cw":'',repeat:'',rewind:'',"rotate-ccw":'',"rotate-cw":'',rss:'',save:'',scissors:'',search:'',send:'',server:'',settings:'',"share-2":'',share:'',"shield-off":'',shield:'',"shopping-bag":'',"shopping-cart":'',shuffle:'',sidebar:'',"skip-back":'',"skip-forward":'',slack:'',slash:'',sliders:'',smartphone:'',smile:'',speaker:'',square:'',star:'',"stop-circle":'',sun:'',sunrise:'',sunset:'',table:'',tablet:'',tag:'',target:'',terminal:'',thermometer:'',"thumbs-down":'',"thumbs-up":'',"toggle-left":'',"toggle-right":'',tool:'',"trash-2":'',trash:'',trello:'',"trending-down":'',"trending-up":'',triangle:'',truck:'',tv:'',twitch:'',twitter:'',type:'',umbrella:'',underline:'',unlock:'',"upload-cloud":'',upload:'',"user-check":'',"user-minus":'',"user-plus":'',"user-x":'',user:'',users:'',"video-off":'',video:'',voicemail:'',"volume-1":'',"volume-2":'',"volume-x":'',volume:'',watch:'',"wifi-off":'',wifi:'',wind:'',"x-circle":'',"x-octagon":'',"x-square":'',x:'',youtube:'',"zap-off":'',zap:'',"zoom-in":'',"zoom-out":''}},"./node_modules/classnames/dedupe.js":function(t,e,n){var r,i;(function(){"use strict";var a=function(){function s(){}s.prototype=Object.create(null);function o(g,m){for(var w=m.length,b=0;b1?arguments[1]:void 0,m=g!==void 0,w=0,b=c(h),S,k,x,A;if(m&&(g=r(g,p>2?arguments[2]:void 0,2)),b!=null&&!(d==Array&&s(b)))for(A=b.call(h),k=new d;!(x=A.next()).done;w++)l(k,w,m?a(A,g,[x.value,w],!0):x.value);else for(S=o(h.length),k=new d(S);S>w;w++)l(k,w,m?g(h[w],w):h[w]);return k.length=w,k}},"./node_modules/core-js/internals/array-includes.js":function(t,e,n){var r=n("./node_modules/core-js/internals/to-indexed-object.js"),i=n("./node_modules/core-js/internals/to-length.js"),a=n("./node_modules/core-js/internals/to-absolute-index.js");t.exports=function(s){return function(o,l,c){var u=r(o),f=i(u.length),h=a(c,f),d;if(s&&l!=l){for(;f>h;)if(d=u[h++],d!=d)return!0}else for(;f>h;h++)if((s||h in u)&&u[h]===l)return s||h||0;return!s&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(t,e,n){var r=n("./node_modules/core-js/internals/a-function.js");t.exports=function(i,a,s){if(r(i),a===void 0)return i;switch(s){case 0:return function(){return i.call(a)};case 1:return function(o){return i.call(a,o)};case 2:return function(o,l){return i.call(a,o,l)};case 3:return function(o,l,c){return i.call(a,o,l,c)}}return function(){return i.apply(a,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(t,e,n){var r=n("./node_modules/core-js/internals/an-object.js");t.exports=function(i,a,s,o){try{return o?a(r(s)[0],s[1]):a(s)}catch(c){var l=i.return;throw l!==void 0&&r(l.call(i)),c}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(t,e,n){var r=n("./node_modules/core-js/internals/well-known-symbol.js"),i=r("iterator"),a=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){a=!0}};o[i]=function(){return this},Array.from(o,function(){throw 2})}catch(l){}t.exports=function(l,c){if(!c&&!a)return!1;var u=!1;try{var f={};f[i]=function(){return{next:function(){return{done:u=!0}}}},l(f)}catch(h){}return u}},"./node_modules/core-js/internals/classof-raw.js":function(t,e){var n={}.toString;t.exports=function(r){return n.call(r).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(t,e,n){var r=n("./node_modules/core-js/internals/classof-raw.js"),i=n("./node_modules/core-js/internals/well-known-symbol.js"),a=i("toStringTag"),s=r(function(){return arguments}())=="Arguments",o=function(l,c){try{return l[c]}catch(u){}};t.exports=function(l){var c,u,f;return l===void 0?"Undefined":l===null?"Null":typeof(u=o(c=Object(l),a))=="string"?u:s?r(c):(f=r(c))=="Object"&&typeof c.callee=="function"?"Arguments":f}},"./node_modules/core-js/internals/copy-constructor-properties.js":function(t,e,n){var r=n("./node_modules/core-js/internals/has.js"),i=n("./node_modules/core-js/internals/own-keys.js"),a=n("./node_modules/core-js/internals/object-get-own-property-descriptor.js"),s=n("./node_modules/core-js/internals/object-define-property.js");t.exports=function(o,l){for(var c=i(l),u=s.f,f=a.f,h=0;h",S="java"+w+":",k;for(p.style.display="none",o.appendChild(p),p.src=String(S),k=p.contentWindow.document,k.open(),k.write(m+w+b+"document.F=Object"+m+"/"+w+b),k.close(),d=k.F;g--;)delete d[f][a[g]];return d()};t.exports=Object.create||function(g,m){var w;return g!==null?(h[f]=r(g),w=new h,h[f]=null,w[u]=g):w=d(),m===void 0?w:i(w,m)},s[u]=!0},"./node_modules/core-js/internals/object-define-properties.js":function(t,e,n){var r=n("./node_modules/core-js/internals/descriptors.js"),i=n("./node_modules/core-js/internals/object-define-property.js"),a=n("./node_modules/core-js/internals/an-object.js"),s=n("./node_modules/core-js/internals/object-keys.js");t.exports=r?Object.defineProperties:function(l,c){a(l);for(var u=s(c),f=u.length,h=0,d;f>h;)i.f(l,d=u[h++],c[d]);return l}},"./node_modules/core-js/internals/object-define-property.js":function(t,e,n){var r=n("./node_modules/core-js/internals/descriptors.js"),i=n("./node_modules/core-js/internals/ie8-dom-define.js"),a=n("./node_modules/core-js/internals/an-object.js"),s=n("./node_modules/core-js/internals/to-primitive.js"),o=Object.defineProperty;e.f=r?o:function(c,u,f){if(a(c),u=s(u,!0),a(f),i)try{return o(c,u,f)}catch(h){}if("get"in f||"set"in f)throw TypeError("Accessors not supported");return"value"in f&&(c[u]=f.value),c}},"./node_modules/core-js/internals/object-get-own-property-descriptor.js":function(t,e,n){var r=n("./node_modules/core-js/internals/descriptors.js"),i=n("./node_modules/core-js/internals/object-property-is-enumerable.js"),a=n("./node_modules/core-js/internals/create-property-descriptor.js"),s=n("./node_modules/core-js/internals/to-indexed-object.js"),o=n("./node_modules/core-js/internals/to-primitive.js"),l=n("./node_modules/core-js/internals/has.js"),c=n("./node_modules/core-js/internals/ie8-dom-define.js"),u=Object.getOwnPropertyDescriptor;e.f=r?u:function(h,d){if(h=s(h),d=o(d,!0),c)try{return u(h,d)}catch(p){}if(l(h,d))return a(!i.f.call(h,d),h[d])}},"./node_modules/core-js/internals/object-get-own-property-names.js":function(t,e,n){var r=n("./node_modules/core-js/internals/object-keys-internal.js"),i=n("./node_modules/core-js/internals/enum-bug-keys.js"),a=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(o){return r(o,a)}},"./node_modules/core-js/internals/object-get-own-property-symbols.js":function(t,e){e.f=Object.getOwnPropertySymbols},"./node_modules/core-js/internals/object-get-prototype-of.js":function(t,e,n){var r=n("./node_modules/core-js/internals/has.js"),i=n("./node_modules/core-js/internals/to-object.js"),a=n("./node_modules/core-js/internals/shared-key.js"),s=n("./node_modules/core-js/internals/correct-prototype-getter.js"),o=a("IE_PROTO"),l=Object.prototype;t.exports=s?Object.getPrototypeOf:function(c){return c=i(c),r(c,o)?c[o]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?l:null}},"./node_modules/core-js/internals/object-keys-internal.js":function(t,e,n){var r=n("./node_modules/core-js/internals/has.js"),i=n("./node_modules/core-js/internals/to-indexed-object.js"),a=n("./node_modules/core-js/internals/array-includes.js"),s=n("./node_modules/core-js/internals/hidden-keys.js"),o=a(!1);t.exports=function(l,c){var u=i(l),f=0,h=[],d;for(d in u)!r(s,d)&&r(u,d)&&h.push(d);for(;c.length>f;)r(u,d=c[f++])&&(~o(h,d)||h.push(d));return h}},"./node_modules/core-js/internals/object-keys.js":function(t,e,n){var r=n("./node_modules/core-js/internals/object-keys-internal.js"),i=n("./node_modules/core-js/internals/enum-bug-keys.js");t.exports=Object.keys||function(s){return r(s,i)}},"./node_modules/core-js/internals/object-property-is-enumerable.js":function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a=i&&!r.call({1:2},1);e.f=a?function(o){var l=i(this,o);return!!l&&l.enumerable}:r},"./node_modules/core-js/internals/object-set-prototype-of.js":function(t,e,n){var r=n("./node_modules/core-js/internals/validate-set-prototype-of-arguments.js");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,a={},s;try{s=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,s.call(a,[]),i=a instanceof Array}catch(o){}return function(l,c){return r(l,c),i?s.call(l,c):l.__proto__=c,l}}():void 0)},"./node_modules/core-js/internals/own-keys.js":function(t,e,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/object-get-own-property-names.js"),a=n("./node_modules/core-js/internals/object-get-own-property-symbols.js"),s=n("./node_modules/core-js/internals/an-object.js"),o=r.Reflect;t.exports=o&&o.ownKeys||function(c){var u=i.f(s(c)),f=a.f;return f?u.concat(f(c)):u}},"./node_modules/core-js/internals/path.js":function(t,e,n){t.exports=n("./node_modules/core-js/internals/global.js")},"./node_modules/core-js/internals/redefine.js":function(t,e,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/shared.js"),a=n("./node_modules/core-js/internals/hide.js"),s=n("./node_modules/core-js/internals/has.js"),o=n("./node_modules/core-js/internals/set-global.js"),l=n("./node_modules/core-js/internals/function-to-string.js"),c=n("./node_modules/core-js/internals/internal-state.js"),u=c.get,f=c.enforce,h=String(l).split("toString");i("inspectSource",function(d){return l.call(d)}),(t.exports=function(d,p,g,m){var w=m?!!m.unsafe:!1,b=m?!!m.enumerable:!1,S=m?!!m.noTargetGet:!1;if(typeof g=="function"&&(typeof p=="string"&&!s(g,"name")&&a(g,"name",p),f(g).source=h.join(typeof p=="string"?p:"")),d===r){b?d[p]=g:o(p,g);return}else w?!S&&d[p]&&(b=!0):delete d[p];b?d[p]=g:a(d,p,g)})(Function.prototype,"toString",function(){return typeof this=="function"&&u(this).source||l.call(this)})},"./node_modules/core-js/internals/require-object-coercible.js":function(t,e){t.exports=function(n){if(n==null)throw TypeError("Can't call method on "+n);return n}},"./node_modules/core-js/internals/set-global.js":function(t,e,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/hide.js");t.exports=function(a,s){try{i(r,a,s)}catch(o){r[a]=s}return s}},"./node_modules/core-js/internals/set-to-string-tag.js":function(t,e,n){var r=n("./node_modules/core-js/internals/object-define-property.js").f,i=n("./node_modules/core-js/internals/has.js"),a=n("./node_modules/core-js/internals/well-known-symbol.js"),s=a("toStringTag");t.exports=function(o,l,c){o&&!i(o=c?o:o.prototype,s)&&r(o,s,{configurable:!0,value:l})}},"./node_modules/core-js/internals/shared-key.js":function(t,e,n){var r=n("./node_modules/core-js/internals/shared.js"),i=n("./node_modules/core-js/internals/uid.js"),a=r("keys");t.exports=function(s){return a[s]||(a[s]=i(s))}},"./node_modules/core-js/internals/shared.js":function(t,e,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/set-global.js"),a=n("./node_modules/core-js/internals/is-pure.js"),s="__core-js_shared__",o=r[s]||i(s,{});(t.exports=function(l,c){return o[l]||(o[l]=c!==void 0?c:{})})("versions",[]).push({version:"3.1.3",mode:a?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},"./node_modules/core-js/internals/string-at.js":function(t,e,n){var r=n("./node_modules/core-js/internals/to-integer.js"),i=n("./node_modules/core-js/internals/require-object-coercible.js");t.exports=function(a,s,o){var l=String(i(a)),c=r(s),u=l.length,f,h;return c<0||c>=u?o?"":void 0:(f=l.charCodeAt(c),f<55296||f>56319||c+1===u||(h=l.charCodeAt(c+1))<56320||h>57343?o?l.charAt(c):f:o?l.slice(c,c+2):(f-55296<<10)+(h-56320)+65536)}},"./node_modules/core-js/internals/to-absolute-index.js":function(t,e,n){var r=n("./node_modules/core-js/internals/to-integer.js"),i=Math.max,a=Math.min;t.exports=function(s,o){var l=r(s);return l<0?i(l+o,0):a(l,o)}},"./node_modules/core-js/internals/to-indexed-object.js":function(t,e,n){var r=n("./node_modules/core-js/internals/indexed-object.js"),i=n("./node_modules/core-js/internals/require-object-coercible.js");t.exports=function(a){return r(i(a))}},"./node_modules/core-js/internals/to-integer.js":function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(i){return isNaN(i=+i)?0:(i>0?r:n)(i)}},"./node_modules/core-js/internals/to-length.js":function(t,e,n){var r=n("./node_modules/core-js/internals/to-integer.js"),i=Math.min;t.exports=function(a){return a>0?i(r(a),9007199254740991):0}},"./node_modules/core-js/internals/to-object.js":function(t,e,n){var r=n("./node_modules/core-js/internals/require-object-coercible.js");t.exports=function(i){return Object(r(i))}},"./node_modules/core-js/internals/to-primitive.js":function(t,e,n){var r=n("./node_modules/core-js/internals/is-object.js");t.exports=function(i,a){if(!r(i))return i;var s,o;if(a&&typeof(s=i.toString)=="function"&&!r(o=s.call(i))||typeof(s=i.valueOf)=="function"&&!r(o=s.call(i))||!a&&typeof(s=i.toString)=="function"&&!r(o=s.call(i)))return o;throw TypeError("Can't convert object to primitive value")}},"./node_modules/core-js/internals/uid.js":function(t,e){var n=0,r=Math.random();t.exports=function(i){return"Symbol(".concat(i===void 0?"":i,")_",(++n+r).toString(36))}},"./node_modules/core-js/internals/validate-set-prototype-of-arguments.js":function(t,e,n){var r=n("./node_modules/core-js/internals/is-object.js"),i=n("./node_modules/core-js/internals/an-object.js");t.exports=function(a,s){if(i(a),!r(s)&&s!==null)throw TypeError("Can't set "+String(s)+" as a prototype")}},"./node_modules/core-js/internals/well-known-symbol.js":function(t,e,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/shared.js"),a=n("./node_modules/core-js/internals/uid.js"),s=n("./node_modules/core-js/internals/native-symbol.js"),o=r.Symbol,l=i("wks");t.exports=function(c){return l[c]||(l[c]=s&&o[c]||(s?o:a)("Symbol."+c))}},"./node_modules/core-js/modules/es.array.from.js":function(t,e,n){var r=n("./node_modules/core-js/internals/export.js"),i=n("./node_modules/core-js/internals/array-from.js"),a=n("./node_modules/core-js/internals/check-correctness-of-iteration.js"),s=!a(function(o){Array.from(o)});r({target:"Array",stat:!0,forced:s},{from:i})},"./node_modules/core-js/modules/es.string.iterator.js":function(t,e,n){"use strict";var r=n("./node_modules/core-js/internals/string-at.js"),i=n("./node_modules/core-js/internals/internal-state.js"),a=n("./node_modules/core-js/internals/define-iterator.js"),s="String Iterator",o=i.set,l=i.getterFor(s);a(String,"String",function(c){o(this,{type:s,string:String(c),index:0})},function(){var u=l(this),f=u.string,h=u.index,d;return h>=f.length?{value:void 0,done:!0}:(d=r(f,h,!0),u.index+=d.length,{value:d,done:!1})})},"./node_modules/webpack/buildin/global.js":function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(r){typeof window=="object"&&(n=window)}t.exports=n},"./src/default-attrs.json":function(t){t.exports={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"}},"./src/icon.js":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(d){for(var p=1;p2&&arguments[2]!==void 0?arguments[2]:[];u(this,d),this.name=p,this.contents=g,this.tags=m,this.attrs=r({},l.default,{class:"feather feather-"+p})}return i(d,[{key:"toSvg",value:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=r({},this.attrs,g,{class:(0,s.default)(this.attrs.class,g.class)});return""+this.contents+""}},{key:"toString",value:function(){return this.contents}}]),d}();function h(d){return Object.keys(d).map(function(p){return p+'="'+d[p]+'"'}).join(" ")}e.default=f},"./src/icons.js":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("./src/icon.js"),i=c(r),a=n("./dist/icons.json"),s=c(a),o=n("./src/tags.json"),l=c(o);function c(u){return u&&u.__esModule?u:{default:u}}e.default=Object.keys(s.default).map(function(u){return new i.default(u,s.default[u],l.default[u])}).reduce(function(u,f){return u[f.name]=f,u},{})},"./src/index.js":function(t,e,n){"use strict";var r=n("./src/icons.js"),i=c(r),a=n("./src/to-svg.js"),s=c(a),o=n("./src/replace.js"),l=c(o);function c(u){return u&&u.__esModule?u:{default:u}}t.exports={icons:i.default,toSvg:s.default,replace:l.default}},"./src/replace.js":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(h){for(var d=1;d0&&arguments[0]!==void 0?arguments[0]:{};if(typeof document=="undefined")throw new Error("`feather.replace()` only works in a browser environment.");var d=document.querySelectorAll("[data-feather]");Array.from(d).forEach(function(p){return u(p,h)})}function u(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=f(h),g=p["data-feather"];if(delete p["data-feather"],o.default[g]===void 0){console.warn("feather: '"+g+"' is not a valid icon");return}var m=o.default[g].toSvg(r({},d,p,{class:(0,a.default)(d.class,p.class)})),w=new DOMParser().parseFromString(m,"image/svg+xml"),b=w.querySelector("svg");h.parentNode.replaceChild(b,h)}function f(h){return Array.from(h.attributes).reduce(function(d,p){return d[p.name]=p.value,d},{})}e.default=c},"./src/tags.json":function(t){t.exports={activity:["pulse","health","action","motion"],airplay:["stream","cast","mirroring"],"alert-circle":["warning","alert","danger"],"alert-octagon":["warning","alert","danger"],"alert-triangle":["warning","alert","danger"],"align-center":["text alignment","center"],"align-justify":["text alignment","justified"],"align-left":["text alignment","left"],"align-right":["text alignment","right"],anchor:[],archive:["index","box"],"at-sign":["mention","at","email","message"],award:["achievement","badge"],aperture:["camera","photo"],"bar-chart":["statistics","diagram","graph"],"bar-chart-2":["statistics","diagram","graph"],battery:["power","electricity"],"battery-charging":["power","electricity"],bell:["alarm","notification","sound"],"bell-off":["alarm","notification","silent"],bluetooth:["wireless"],"book-open":["read","library"],book:["read","dictionary","booklet","magazine","library"],bookmark:["read","clip","marker","tag"],box:["cube"],briefcase:["work","bag","baggage","folder"],calendar:["date"],camera:["photo"],cast:["chromecast","airplay"],"chevron-down":["expand"],"chevron-up":["collapse"],circle:["off","zero","record"],clipboard:["copy"],clock:["time","watch","alarm"],"cloud-drizzle":["weather","shower"],"cloud-lightning":["weather","bolt"],"cloud-rain":["weather"],"cloud-snow":["weather","blizzard"],cloud:["weather"],codepen:["logo"],codesandbox:["logo"],code:["source","programming"],coffee:["drink","cup","mug","tea","cafe","hot","beverage"],columns:["layout"],command:["keyboard","cmd","terminal","prompt"],compass:["navigation","safari","travel","direction"],copy:["clone","duplicate"],"corner-down-left":["arrow","return"],"corner-down-right":["arrow"],"corner-left-down":["arrow"],"corner-left-up":["arrow"],"corner-right-down":["arrow"],"corner-right-up":["arrow"],"corner-up-left":["arrow"],"corner-up-right":["arrow"],cpu:["processor","technology"],"credit-card":["purchase","payment","cc"],crop:["photo","image"],crosshair:["aim","target"],database:["storage","memory"],delete:["remove"],disc:["album","cd","dvd","music"],"dollar-sign":["currency","money","payment"],droplet:["water"],edit:["pencil","change"],"edit-2":["pencil","change"],"edit-3":["pencil","change"],eye:["view","watch"],"eye-off":["view","watch","hide","hidden"],"external-link":["outbound"],facebook:["logo","social"],"fast-forward":["music"],figma:["logo","design","tool"],"file-minus":["delete","remove","erase"],"file-plus":["add","create","new"],"file-text":["data","txt","pdf"],film:["movie","video"],filter:["funnel","hopper"],flag:["report"],"folder-minus":["directory"],"folder-plus":["directory"],folder:["directory"],framer:["logo","design","tool"],frown:["emoji","face","bad","sad","emotion"],gift:["present","box","birthday","party"],"git-branch":["code","version control"],"git-commit":["code","version control"],"git-merge":["code","version control"],"git-pull-request":["code","version control"],github:["logo","version control"],gitlab:["logo","version control"],globe:["world","browser","language","translate"],"hard-drive":["computer","server","memory","data"],hash:["hashtag","number","pound"],headphones:["music","audio","sound"],heart:["like","love","emotion"],"help-circle":["question mark"],hexagon:["shape","node.js","logo"],home:["house","living"],image:["picture"],inbox:["email"],instagram:["logo","camera"],key:["password","login","authentication","secure"],layers:["stack"],layout:["window","webpage"],"life-buoy":["help","life ring","support"],link:["chain","url"],"link-2":["chain","url"],linkedin:["logo","social media"],list:["options"],lock:["security","password","secure"],"log-in":["sign in","arrow","enter"],"log-out":["sign out","arrow","exit"],mail:["email","message"],"map-pin":["location","navigation","travel","marker"],map:["location","navigation","travel"],maximize:["fullscreen"],"maximize-2":["fullscreen","arrows","expand"],meh:["emoji","face","neutral","emotion"],menu:["bars","navigation","hamburger"],"message-circle":["comment","chat"],"message-square":["comment","chat"],"mic-off":["record","sound","mute"],mic:["record","sound","listen"],minimize:["exit fullscreen","close"],"minimize-2":["exit fullscreen","arrows","close"],minus:["subtract"],monitor:["tv","screen","display"],moon:["dark","night"],"more-horizontal":["ellipsis"],"more-vertical":["ellipsis"],"mouse-pointer":["arrow","cursor"],move:["arrows"],music:["note"],navigation:["location","travel"],"navigation-2":["location","travel"],octagon:["stop"],package:["box","container"],paperclip:["attachment"],pause:["music","stop"],"pause-circle":["music","audio","stop"],"pen-tool":["vector","drawing"],percent:["discount"],"phone-call":["ring"],"phone-forwarded":["call"],"phone-incoming":["call"],"phone-missed":["call"],"phone-off":["call","mute"],"phone-outgoing":["call"],phone:["call"],play:["music","start"],"pie-chart":["statistics","diagram"],"play-circle":["music","start"],plus:["add","new"],"plus-circle":["add","new"],"plus-square":["add","new"],pocket:["logo","save"],power:["on","off"],printer:["fax","office","device"],radio:["signal"],"refresh-cw":["synchronise","arrows"],"refresh-ccw":["arrows"],repeat:["loop","arrows"],rewind:["music"],"rotate-ccw":["arrow"],"rotate-cw":["arrow"],rss:["feed","subscribe"],save:["floppy disk"],scissors:["cut"],search:["find","magnifier","magnifying glass"],send:["message","mail","email","paper airplane","paper aeroplane"],settings:["cog","edit","gear","preferences"],"share-2":["network","connections"],shield:["security","secure"],"shield-off":["security","insecure"],"shopping-bag":["ecommerce","cart","purchase","store"],"shopping-cart":["ecommerce","cart","purchase","store"],shuffle:["music"],"skip-back":["music"],"skip-forward":["music"],slack:["logo"],slash:["ban","no"],sliders:["settings","controls"],smartphone:["cellphone","device"],smile:["emoji","face","happy","good","emotion"],speaker:["audio","music"],star:["bookmark","favorite","like"],"stop-circle":["media","music"],sun:["brightness","weather","light"],sunrise:["weather","time","morning","day"],sunset:["weather","time","evening","night"],tablet:["device"],tag:["label"],target:["logo","bullseye"],terminal:["code","command line","prompt"],thermometer:["temperature","celsius","fahrenheit","weather"],"thumbs-down":["dislike","bad","emotion"],"thumbs-up":["like","good","emotion"],"toggle-left":["on","off","switch"],"toggle-right":["on","off","switch"],tool:["settings","spanner"],trash:["garbage","delete","remove","bin"],"trash-2":["garbage","delete","remove","bin"],triangle:["delta"],truck:["delivery","van","shipping","transport","lorry"],tv:["television","stream"],twitch:["logo"],twitter:["logo","social"],type:["text"],umbrella:["rain","weather"],unlock:["security"],"user-check":["followed","subscribed"],"user-minus":["delete","remove","unfollow","unsubscribe"],"user-plus":["new","add","create","follow","subscribe"],"user-x":["delete","remove","unfollow","unsubscribe","unavailable"],user:["person","account"],users:["group"],"video-off":["camera","movie","film"],video:["camera","movie","film"],voicemail:["phone"],volume:["music","sound","mute"],"volume-1":["music","sound"],"volume-2":["music","sound"],"volume-x":["music","sound","mute"],watch:["clock","time"],"wifi-off":["disabled"],wifi:["connection","signal","wireless"],wind:["weather","air"],"x-circle":["cancel","close","delete","remove","times","clear"],"x-octagon":["delete","stop","alert","warning","times","clear"],"x-square":["cancel","close","delete","remove","times","clear"],x:["cancel","close","delete","remove","times","clear"],youtube:["logo","video","play"],"zap-off":["flash","camera","lightning"],zap:["flash","camera","lightning"],"zoom-in":["magnifying glass"],"zoom-out":["magnifying glass"]}},"./src/to-svg.js":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("./src/icons.js"),i=a(r);function a(o){return o&&o.__esModule?o:{default:o}}function s(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."),!o)throw new Error("The required `key` (icon name) parameter is missing.");if(!i.default[o])throw new Error("No icon matching '"+o+"'. See the complete list of icons at https://feathericons.com");return i.default[o].toSvg(l)}e.default=s},0:function(t,e,n){n("./node_modules/core-js/es/array/from.js"),t.exports=n("./src/index.js")}})})});var i7={};aA(i7,{default:()=>hu});module.exports=sA(i7);v();v();var Xa=Ze(Pm(),1),Nf=Ze(Hm(),1),v1=Ze(zm(),1),Vo=Ze(M0(),1),Ro=Ze(I0(),1),w1=Ze(U0(),1),fn=Ze(G0(),1),b1=Ze(Y0(),1),ge=class t extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let n=new t(e.message);return n.code=e.code,n.data=e.data,n.caller=e.caller,n.stack=e.stack,n}get isIsomorphicGitError(){return!0}},Ya=class t extends ge{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=t.code,this.data={filepaths:e}}};Ya.code="UnmergedPathsError";var ue=class t extends ge{constructor(e){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=t.code,this.data={message:e}}};ue.code="InternalError";var Si=class t extends ge{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=t.code,this.data={filepath:e}}};Si.code="UnsafeFilepathError";var en=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 n=this.buffer.slice(this._start,this._start+e);return this._start+=e,n}toString(e,n){let r=this.buffer.toString(e,this._start,this._start+n);return this._start+=n,r}write(e,n,r){let i=this.buffer.write(e,this._start,n,r);return this._start+=n,i}copy(e,n,r){let i=e.copy(this.buffer,this._start,n,r);return this._start+=i,i}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let n=this.buffer.writeUInt8(e,this._start);return this._start+=1,n}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let n=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,n}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let n=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,n}};function Wo(t,e){return-(te)}function x1(t,e){return Wo(t.path,e.path)}function _1(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let n=t&511;return n&73?n=493:n=420,e!==8&&(n=0),(e<<12)+n}var Tn=2**32;function Z0(t,e,n,r){if(t!==void 0&&e!==void 0)return[t,e];n===void 0&&(n=r.valueOf());let i=Math.floor(n/1e3),a=(n-i*1e3)*1e6;return[i,a]}function Ei(t){let[e,n]=Z0(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[r,i]=Z0(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%Tn,ctimeNanoseconds:n%Tn,mtimeSeconds:r%Tn,mtimeNanoseconds:i%Tn,dev:t.dev%Tn,ino:t.ino%Tn,mode:_1(t.mode%Tn),uid:t.uid%Tn,gid:t.gid%Tn,size:t.size>-1?t.size%Tn:0}}function l5(t){let e="";for(let n of new Uint8Array(t))n<16&&(e+="0"),e+=n.toString(16);return e}var yf=null;async function Un(t){return yf===null&&(yf=await u5()),yf?S1(t):c5(t)}function c5(t){return new Nf.default().update(t).digest("hex")}async function S1(t){let e=await crypto.subtle.digest("SHA-1",t);return l5(e)}async function u5(){try{if(await S1(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709")return!0}catch(t){}return!1}function f5(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}function h5(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}var Tf=class t{constructor(e,n){this._dirty=!1,this._unmergedPaths=n||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 n=this._entries.get(e.path);n||(this._entries.set(e.path,e),n=e),n.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(Buffer.isBuffer(e))return t.fromBuffer(e);if(e===null)return new t(null);throw new ue("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new ue("Index file is empty (.git/index)");let n=new t,r=new en(e),i=r.toString("utf8",4);if(i!=="DIRC")throw new ue(`Invalid dircache magic file number: ${i}`);let a=await Un(e.slice(0,-20)),s=e.slice(-20).toString("hex");if(s!==a)throw new ue(`Invalid checksum in GitIndex buffer: expected ${s} but saw ${a}`);let o=r.readUInt32BE();if(o!==2)throw new ue(`Unsupported dircache version: ${o}`);let l=r.readUInt32BE(),c=0;for(;!r.eof()&&ce.stages.length>1?e.stages.filter(n=>n):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:n,oid:r,stage:i=0}){n||(n={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),n=Ei(n);let a=Buffer.from(e),s={ctimeSeconds:n.ctimeSeconds,ctimeNanoseconds:n.ctimeNanoseconds,mtimeSeconds:n.mtimeSeconds,mtimeNanoseconds:n.mtimeNanoseconds,dev:n.dev,ino:n.ino,mode:n.mode||33188,uid:n.uid,gid:n.gid,size:n.size,path:e,oid:r,flags:{assumeValid:!1,extended:!1,stage:i,nameLength:a.length<4095?a.length:4095},stages:[]};this._addEntry(s),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let n of this._entries.keys())n.startsWith(e+"/")&&this._entries.delete(n);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(` +`)}static async _entryToBuffer(e){let n=Buffer.from(e.path),r=Math.ceil((62+n.length+1)/8)*8,i=Buffer.alloc(r),a=new en(i),s=Ei(e);return a.writeUInt32BE(s.ctimeSeconds),a.writeUInt32BE(s.ctimeNanoseconds),a.writeUInt32BE(s.mtimeSeconds),a.writeUInt32BE(s.mtimeNanoseconds),a.writeUInt32BE(s.dev),a.writeUInt32BE(s.ino),a.writeUInt32BE(s.mode),a.writeUInt32BE(s.uid),a.writeUInt32BE(s.gid),a.writeUInt32BE(s.size),a.write(e.oid,20,"hex"),a.writeUInt16BE(h5(e)),a.write(e.path,n.length,"utf8"),i}async toObject(){let e=Buffer.alloc(12),n=new en(e);n.write("DIRC",4,"utf8"),n.writeUInt32BE(2),n.writeUInt32BE(this.entriesFlat.length);let r=[];for(let o of this.entries)if(r.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&r.push(t._entryToBuffer(l));r=await Promise.all(r);let i=Buffer.concat(r),a=Buffer.concat([e,i]),s=await Un(a);return Buffer.concat([a,Buffer.from(s,"hex")])}};function Lo(t,e,n=!0,r=!0){let i=Ei(t),a=Ei(e);return n&&i.mode!==a.mode||i.mtimeSeconds!==a.mtimeSeconds||i.ctimeSeconds!==a.ctimeSeconds||i.uid!==a.uid||i.gid!==a.gid||r&&i.ino!==a.ino||i.size!==a.size}var vf=null,xi=Symbol("IndexCache");function d5(){return{map:new Map,stats:new Map}}async function p5(t,e,n){let r=await t.lstat(e),i=await t.read(e),a=await Tf.from(i);n.map.set(e,a),n.stats.set(e,r)}async function m5(t,e,n){let r=n.stats.get(e);if(r===void 0)return!0;let i=await t.lstat(e);return r===null||i===null?!1:Lo(r,i)}var lt=class{static async acquire({fs:e,gitdir:n,cache:r,allowUnmerged:i=!0},a){r[xi]||(r[xi]=d5());let s=`${n}/index`;vf===null&&(vf=new Xa.default({maxPending:1/0}));let o,l=[];return await vf.acquire(s,async()=>{await m5(e,s,r[xi])&&await p5(e,s,r[xi]);let c=r[xi].map.get(s);if(l=c.unmergedPaths,l.length&&!i)throw new Ya(l);if(o=await a(c),c._dirty){let u=await c.toObject();await e.write(s,u),r[xi].stats.set(s,await e.lstat(s)),c._dirty=!1}}),o}};function jo(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function ki(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function E1(t){let e=new Map,n=function(i){if(!e.has(i)){let a={type:"tree",fullpath:i,basename:jo(i),metadata:{},children:[]};e.set(i,a),a.parent=n(ki(i)),a.parent&&a.parent!==a&&a.parent.children.push(a)}return e.get(i)},r=function(i,a){if(!e.has(i)){let s={type:"blob",fullpath:i,basename:jo(i),metadata:a,parent:n(ki(i)),children:[]};s.parent&&s.parent.children.push(s),e.set(i,s)}return e.get(i)};n(".");for(let i of t)r(i.path,i);return e}function g5(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new ue(`Unexpected GitTree entry mode: ${t.toString(8)}`)}var Cf=class{constructor({fs:e,gitdir:n,cache:r}){this.treePromise=lt.acquire({fs:e,gitdir:n,cache:r},async function(a){return E1(a.entries)});let i=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(e){let n=e._fullpath,i=(await this.treePromise).get(n);if(!i||i.type==="blob")return null;if(i.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${n}'`);let a=i.children.map(s=>s.fullpath);return a.sort(Wo),a}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let r=(await this.treePromise).get(e._fullpath);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let i=r.type==="tree"?{}:Ei(r.metadata);e._type=r.type==="tree"?"tree":g5(i.mode),e._mode=i.mode,r.type==="tree"?e._stat=void 0:e._stat=i}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let r=(await this.treePromise).get(e._fullpath);e._oid=r.metadata.oid}return e._oid}},qo=Symbol("GitWalkSymbol");function Xo(){let t=Object.create(null);return Object.defineProperty(t,qo,{value:function({fs:e,gitdir:n,cache:r}){return new Cf({fs:e,gitdir:n,cache:r})}}),Object.freeze(t),t}var Re=class t extends ge{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};Re.code="NotFoundError";var kt=class t extends ge{constructor(e,n,r,i){super(`Object ${e} ${i?`at ${i}`:""}was anticipated to be a ${r} but it is a ${n}.`),this.code=this.name=t.code,this.data={oid:e,actual:n,expected:r,filepath:i}}};kt.code="ObjectTypeError";var or=class t extends ge{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=t.code,this.data={value:e}}};or.code="InvalidOidError";var Za=class t extends ge{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 = _NoRefspecError.code; - this.data = { remote }; - } -}; -NoRefspecError.code = "NoRefspecError"; -var GitPackedRefs = class _GitPackedRefs { - constructor(text2) { - this.refs = /* @__PURE__ */ new Map(); - this.parsedConfig = []; - if (text2) { - let key2 = null; - this.parsedConfig = text2.trim().split("\n").map((line) => { - if (/^\s*#/.test(line)) { - return { line, comment: true }; - } - const i = line.indexOf(" "); - if (line.startsWith("^")) { - const value = line.slice(1); - this.refs.set(key2 + "^{}", value); - return { line, ref: key2, peeled: value }; - } else { - const value = line.slice(0, i); - key2 = line.slice(i + 1); - this.refs.set(key2, value); - return { line, ref: key2, oid: value }; - } - }); - } - return this; - } - static from(text2) { - return new _GitPackedRefs(text2); - } - delete(ref) { - this.parsedConfig = this.parsedConfig.filter((entry) => entry.ref !== ref); - this.refs.delete(ref); - } - toString() { - return this.parsedConfig.map(({ line }) => line).join("\n") + "\n"; - } -}; -var GitRefSpec = class _GitRefSpec { - constructor({ remotePath, localPath, force, matchPrefix }) { - Object.assign(this, { - remotePath, - localPath, - force, - matchPrefix - }); - } - static from(refspec) { - const [ - forceMatch, - remotePath, - remoteGlobMatch, - localPath, - localGlobMatch - ] = refspec.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1); - const force = forceMatch === "+"; - const remoteIsGlob = remoteGlobMatch === "*"; - const localIsGlob = localGlobMatch === "*"; - if (remoteIsGlob !== localIsGlob) { - throw new InternalError("Invalid refspec"); - } - return new _GitRefSpec({ - remotePath, - localPath, - force, - matchPrefix: remoteIsGlob - }); - } - translate(remoteBranch) { - if (this.matchPrefix) { - if (remoteBranch.startsWith(this.remotePath)) { - return this.localPath + remoteBranch.replace(this.remotePath, ""); - } - } else { - if (remoteBranch === this.remotePath) - return this.localPath; - } - return null; - } - reverseTranslate(localBranch) { - if (this.matchPrefix) { - if (localBranch.startsWith(this.localPath)) { - return this.remotePath + localBranch.replace(this.localPath, ""); - } - } else { - if (localBranch === this.localPath) - return this.remotePath; - } - return null; - } -}; -var GitRefSpecSet = class _GitRefSpecSet { - constructor(rules = []) { - this.rules = rules; - } - static from(refspecs) { - const rules = []; - for (const refspec of refspecs) { - rules.push(GitRefSpec.from(refspec)); - } - return new _GitRefSpecSet(rules); - } - add(refspec) { - const rule = GitRefSpec.from(refspec); - this.rules.push(rule); - } - translate(remoteRefs) { - const result = []; - for (const rule of this.rules) { - for (const remoteRef of remoteRefs) { - const localRef = rule.translate(remoteRef); - if (localRef) { - result.push([remoteRef, localRef]); - } - } - } - return result; - } - translateOne(remoteRef) { - let result = null; - for (const rule of this.rules) { - const localRef = rule.translate(remoteRef); - if (localRef) { - result = localRef; - } - } - return result; - } - localNamespaces() { - return this.rules.filter((rule) => rule.matchPrefix).map((rule) => rule.localPath.replace(/\/$/, "")); - } -}; -function compareRefNames(a, b) { - const _a2 = a.replace(/\^\{\}$/, ""); - const _b = b.replace(/\^\{\}$/, ""); - const tmp = -(_a2 < _b) || +(_a2 > _b); - if (tmp === 0) { - return a.endsWith("^{}") ? 1 : -1; - } - return tmp; -} -function normalizePath(path2) { - return path2.replace(/\/\.\//g, "/").replace(/\/{2,}/g, "/").replace(/^\/\.$/, "/").replace(/^\.\/$/, ".").replace(/^\.\//, "").replace(/\/\.$/, "").replace(/(.+)\/$/, "$1").replace(/^$/, "."); -} -function join(...parts) { - return normalizePath(parts.map(normalizePath).join("/")); -} -var num = (val) => { - val = val.toLowerCase(); - let n = parseInt(val); - if (val.endsWith("k")) - n *= 1024; - if (val.endsWith("m")) - n *= 1024 * 1024; - if (val.endsWith("g")) - n *= 1024 * 1024 * 1024; - return n; -}; -var bool = (val) => { - val = val.trim().toLowerCase(); - if (val === "true" || val === "yes" || val === "on") - return true; - if (val === "false" || val === "no" || val === "off") - return false; - throw Error( - `Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${val}` - ); -}; -var schema = { - core: { - filemode: bool, - bare: bool, - logallrefupdates: bool, - symlinks: bool, - ignorecase: bool, - bigFileThreshold: num - } -}; -var SECTION_LINE_REGEX = /^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/; -var SECTION_REGEX = /^[A-Za-z0-9-.]+$/; -var VARIABLE_LINE_REGEX = /^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/; -var VARIABLE_NAME_REGEX = /^[A-Za-z][A-Za-z-]*$/; -var VARIABLE_VALUE_COMMENT_REGEX = /^(.*?)( *[#;].*)$/; -var extractSectionLine = (line) => { - const matches = SECTION_LINE_REGEX.exec(line); - if (matches != null) { - const [section, subsection] = matches.slice(1); - return [section, subsection]; - } - return null; -}; -var extractVariableLine = (line) => { - const matches = VARIABLE_LINE_REGEX.exec(line); - if (matches != null) { - const [name, rawValue = "true"] = matches.slice(1); - const valueWithoutComments = removeComments(rawValue); - const valueWithoutQuotes = removeQuotes(valueWithoutComments); - return [name, valueWithoutQuotes]; - } - return null; -}; -var removeComments = (rawValue) => { - const commentMatches = VARIABLE_VALUE_COMMENT_REGEX.exec(rawValue); - if (commentMatches == null) { - return rawValue; - } - const [valueWithoutComment, comment] = commentMatches.slice(1); - if (hasOddNumberOfQuotes(valueWithoutComment) && hasOddNumberOfQuotes(comment)) { - return `${valueWithoutComment}${comment}`; - } - return valueWithoutComment; -}; -var hasOddNumberOfQuotes = (text2) => { - const numberOfQuotes = (text2.match(/(?:^|[^\\])"/g) || []).length; - return numberOfQuotes % 2 !== 0; -}; -var removeQuotes = (text2) => { - return text2.split("").reduce((newText, c, idx, text3) => { - const isQuote = c === '"' && text3[idx - 1] !== "\\"; - const isEscapeForQuote = c === "\\" && text3[idx + 1] === '"'; - if (isQuote || isEscapeForQuote) { - return newText; - } - return newText + c; - }, ""); -}; -var lower = (text2) => { - return text2 != null ? text2.toLowerCase() : null; -}; -var getPath = (section, subsection, name) => { - return [lower(section), subsection, lower(name)].filter((a) => a != null).join("."); -}; -var normalizePath$1 = (path2) => { - const pathSegments = path2.split("."); - const section = pathSegments.shift(); - const name = pathSegments.pop(); - const subsection = pathSegments.length ? pathSegments.join(".") : void 0; - return { - section, - subsection, - name, - path: getPath(section, subsection, name), - sectionPath: getPath(section, subsection, null) - }; -}; -var findLastIndex = (array, callback) => { - return array.reduce((lastIndex, item, index2) => { - return callback(item) ? index2 : lastIndex; - }, -1); -}; -var GitConfig = class _GitConfig { - constructor(text2) { - let section = null; - let subsection = null; - this.parsedConfig = text2.split("\n").map((line) => { - let name = null; - let value = null; - const trimmedLine = line.trim(); - const extractedSection = extractSectionLine(trimmedLine); - const isSection = extractedSection != null; - if (isSection) { - ; - [section, subsection] = extractedSection; - } else { - const extractedVariable = extractVariableLine(trimmedLine); - const isVariable = extractedVariable != null; - if (isVariable) { - ; - [name, value] = extractedVariable; - } - } - const path2 = getPath(section, subsection, name); - return { line, isSection, section, subsection, name, value, path: path2 }; - }); - } - static from(text2) { - return new _GitConfig(text2); - } - async get(path2, getall = false) { - const normalizedPath = normalizePath$1(path2).path; - const allValues = this.parsedConfig.filter((config) => config.path === normalizedPath).map(({ section, name, value }) => { - const fn = schema[section] && schema[section][name]; - return fn ? fn(value) : value; - }); - return getall ? allValues : allValues.pop(); - } - async getall(path2) { - return this.get(path2, true); - } - async getSubsections(section) { - return this.parsedConfig.filter((config) => config.section === section && config.isSection).map((config) => config.subsection); - } - async deleteSection(section, subsection) { - this.parsedConfig = this.parsedConfig.filter( - (config) => !(config.section === section && config.subsection === subsection) - ); - } - async append(path2, value) { - return this.set(path2, value, true); - } - async set(path2, value, append3 = false) { - const { - section, - subsection, - name, - path: normalizedPath, - sectionPath - } = normalizePath$1(path2); - const configIndex = findLastIndex( - this.parsedConfig, - (config) => config.path === normalizedPath - ); - if (value == null) { - if (configIndex !== -1) { - this.parsedConfig.splice(configIndex, 1); - } - } else { - if (configIndex !== -1) { - const config = this.parsedConfig[configIndex]; - const modifiedConfig = Object.assign({}, config, { - name, - value, - modified: true - }); - if (append3) { - this.parsedConfig.splice(configIndex + 1, 0, modifiedConfig); - } else { - this.parsedConfig[configIndex] = modifiedConfig; - } - } else { - const sectionIndex = this.parsedConfig.findIndex( - (config) => config.path === sectionPath - ); - const newConfig = { - section, - subsection, - name, - value, - modified: true, - path: normalizedPath - }; - if (SECTION_REGEX.test(section) && VARIABLE_NAME_REGEX.test(name)) { - if (sectionIndex >= 0) { - this.parsedConfig.splice(sectionIndex + 1, 0, newConfig); - } else { - const newSection = { - section, - subsection, - modified: true, - path: sectionPath - }; - this.parsedConfig.push(newSection, newConfig); - } - } - } - } - } - toString() { - return this.parsedConfig.map(({ line, section, subsection, name, value, modified: modified2 = false }) => { - if (!modified2) { - return line; - } - if (name != null && value != null) { - if (typeof value === "string" && /[#;]/.test(value)) { - return ` ${name} = "${value}"`; - } - return ` ${name} = ${value}`; - } - if (subsection != null) { - return `[${section} "${subsection}"]`; - } - return `[${section}]`; - }).join("\n"); - } -}; -var GitConfigManager = class { - static async get({ fs, gitdir }) { - const text2 = await fs.read(`${gitdir}/config`, { encoding: "utf8" }); - return GitConfig.from(text2); - } - static async save({ fs, gitdir, config }) { - await fs.write(`${gitdir}/config`, config.toString(), { - encoding: "utf8" - }); - } -}; -var refpaths = (ref) => [ - `${ref}`, - `refs/${ref}`, - `refs/tags/${ref}`, - `refs/heads/${ref}`, - `refs/remotes/${ref}`, - `refs/remotes/${ref}/HEAD` -]; -var GIT_FILES = ["config", "description", "index", "shallow", "commondir"]; -var GitRefManager = class _GitRefManager { - static async updateRemoteRefs({ - fs, - gitdir, - remote, - refs, - symrefs, - tags, - refspecs = void 0, - prune = false, - pruneTags = false - }) { - for (const value of refs.values()) { - if (!value.match(/[0-9a-f]{40}/)) { - throw new InvalidOidError(value); - } - } - const config = await GitConfigManager.get({ fs, gitdir }); - if (!refspecs) { - refspecs = await config.getall(`remote.${remote}.fetch`); - if (refspecs.length === 0) { - throw new NoRefspecError(remote); - } - refspecs.unshift(`+HEAD:refs/remotes/${remote}/HEAD`); - } - const refspec = GitRefSpecSet.from(refspecs); - const actualRefsToWrite = /* @__PURE__ */ new Map(); - if (pruneTags) { - const tags2 = await _GitRefManager.listRefs({ - fs, - gitdir, - filepath: "refs/tags" - }); - await _GitRefManager.deleteRefs({ - fs, - gitdir, - refs: tags2.map((tag2) => `refs/tags/${tag2}`) - }); - } - if (tags) { - for (const serverRef of refs.keys()) { - if (serverRef.startsWith("refs/tags") && !serverRef.endsWith("^{}")) { - if (!await _GitRefManager.exists({ fs, gitdir, ref: serverRef })) { - const oid = refs.get(serverRef); - actualRefsToWrite.set(serverRef, oid); - } - } - } - } - const refTranslations = refspec.translate([...refs.keys()]); - for (const [serverRef, translatedRef] of refTranslations) { - const value = refs.get(serverRef); - actualRefsToWrite.set(translatedRef, value); - } - const symrefTranslations = refspec.translate([...symrefs.keys()]); - for (const [serverRef, translatedRef] of symrefTranslations) { - const value = symrefs.get(serverRef); - const symtarget = refspec.translateOne(value); - if (symtarget) { - actualRefsToWrite.set(translatedRef, `ref: ${symtarget}`); - } - } - const pruned = []; - if (prune) { - for (const filepath of refspec.localNamespaces()) { - const refs2 = (await _GitRefManager.listRefs({ - fs, - gitdir, - filepath - })).map((file) => `${filepath}/${file}`); - for (const ref of refs2) { - if (!actualRefsToWrite.has(ref)) { - pruned.push(ref); - } - } - } - if (pruned.length > 0) { - await _GitRefManager.deleteRefs({ fs, gitdir, refs: pruned }); - } - } - for (const [key2, value] of actualRefsToWrite) { - await fs.write(join(gitdir, key2), `${value.trim()} -`, "utf8"); - } - return { pruned }; - } - // TODO: make this less crude? - static async writeRef({ fs, gitdir, ref, value }) { - if (!value.match(/[0-9a-f]{40}/)) { - throw new InvalidOidError(value); - } - await fs.write(join(gitdir, ref), `${value.trim()} -`, "utf8"); - } - static async writeSymbolicRef({ fs, gitdir, ref, value }) { - await fs.write(join(gitdir, ref), `ref: ${value.trim()} -`, "utf8"); - } - static async deleteRef({ fs, gitdir, ref }) { - return _GitRefManager.deleteRefs({ fs, gitdir, refs: [ref] }); - } - static async deleteRefs({ fs, gitdir, refs }) { - await Promise.all(refs.map((ref) => fs.rm(join(gitdir, ref)))); - let text2 = await fs.read(`${gitdir}/packed-refs`, { encoding: "utf8" }); - const packed = GitPackedRefs.from(text2); - const beforeSize = packed.refs.size; - for (const ref of refs) { - if (packed.refs.has(ref)) { - packed.delete(ref); - } - } - if (packed.refs.size < beforeSize) { - text2 = packed.toString(); - await fs.write(`${gitdir}/packed-refs`, text2, { encoding: "utf8" }); - } - } - /** - * @param {object} args - * @param {import('../models/FileSystem.js').FileSystem} args.fs - * @param {string} args.gitdir - * @param {string} args.ref - * @param {number} [args.depth] - * @returns {Promise} - */ - static async resolve({ fs, gitdir, ref, depth = void 0 }) { - if (depth !== void 0) { - depth--; - if (depth === -1) { - return ref; - } - } - let sha; - if (ref.startsWith("ref: ")) { - ref = ref.slice("ref: ".length); - return _GitRefManager.resolve({ fs, gitdir, ref, depth }); - } - if (ref.length === 40 && /[0-9a-f]{40}/.test(ref)) { - return ref; - } - const packedMap = await _GitRefManager.packedRefs({ fs, gitdir }); - const allpaths = refpaths(ref).filter((p) => !GIT_FILES.includes(p)); - for (const ref2 of allpaths) { - sha = await fs.read(`${gitdir}/${ref2}`, { encoding: "utf8" }) || packedMap.get(ref2); - if (sha) { - return _GitRefManager.resolve({ fs, gitdir, ref: sha.trim(), depth }); - } - } - throw new NotFoundError(ref); - } - static async exists({ fs, gitdir, ref }) { - try { - await _GitRefManager.expand({ fs, gitdir, ref }); - return true; - } catch (err) { - return false; - } - } - static async expand({ fs, gitdir, ref }) { - if (ref.length === 40 && /[0-9a-f]{40}/.test(ref)) { - return ref; - } - const packedMap = await _GitRefManager.packedRefs({ fs, gitdir }); - const allpaths = refpaths(ref); - for (const ref2 of allpaths) { - if (await fs.exists(`${gitdir}/${ref2}`)) - return ref2; - if (packedMap.has(ref2)) - return ref2; - } - throw new NotFoundError(ref); - } - static async expandAgainstMap({ ref, map }) { - const allpaths = refpaths(ref); - for (const ref2 of allpaths) { - if (await map.has(ref2)) - return ref2; - } - throw new NotFoundError(ref); - } - static resolveAgainstMap({ ref, fullref = ref, depth = void 0, map }) { - if (depth !== void 0) { - depth--; - if (depth === -1) { - return { fullref, oid: ref }; - } - } - if (ref.startsWith("ref: ")) { - ref = ref.slice("ref: ".length); - return _GitRefManager.resolveAgainstMap({ ref, fullref, depth, map }); - } - if (ref.length === 40 && /[0-9a-f]{40}/.test(ref)) { - return { fullref, oid: ref }; - } - const allpaths = refpaths(ref); - for (const ref2 of allpaths) { - const sha = map.get(ref2); - if (sha) { - return _GitRefManager.resolveAgainstMap({ - ref: sha.trim(), - fullref: ref2, - depth, - map - }); - } - } - throw new NotFoundError(ref); - } - static async packedRefs({ fs, gitdir }) { - const text2 = await fs.read(`${gitdir}/packed-refs`, { encoding: "utf8" }); - const packed = GitPackedRefs.from(text2); - return packed.refs; - } - // List all the refs that match the `filepath` prefix - static async listRefs({ fs, gitdir, filepath }) { - const packedMap = _GitRefManager.packedRefs({ fs, gitdir }); - let files = null; - try { - files = await fs.readdirDeep(`${gitdir}/${filepath}`); - files = files.map((x) => x.replace(`${gitdir}/${filepath}/`, "")); - } catch (err) { - files = []; - } - for (let key2 of (await packedMap).keys()) { - if (key2.startsWith(filepath)) { - key2 = key2.replace(filepath + "/", ""); - if (!files.includes(key2)) { - files.push(key2); - } - } - } - files.sort(compareRefNames); - return files; - } - static async listBranches({ fs, gitdir, remote }) { - if (remote) { - return _GitRefManager.listRefs({ - fs, - gitdir, - filepath: `refs/remotes/${remote}` - }); - } else { - return _GitRefManager.listRefs({ fs, gitdir, filepath: `refs/heads` }); - } - } - static async listTags({ fs, gitdir }) { - const tags = await _GitRefManager.listRefs({ - fs, - gitdir, - filepath: `refs/tags` - }); - return tags.filter((x) => !x.endsWith("^{}")); - } -}; -function compareTreeEntryPath(a, b) { - return compareStrings(appendSlashIfDir(a), appendSlashIfDir(b)); -} -function appendSlashIfDir(entry) { - return entry.mode === "040000" ? entry.path + "/" : entry.path; -} -function mode2type$1(mode) { - switch (mode) { - case "040000": - return "tree"; - case "100644": - return "blob"; - case "100755": - return "blob"; - case "120000": - return "blob"; - case "160000": - return "commit"; - } - throw new InternalError(`Unexpected GitTree entry mode: ${mode}`); -} -function parseBuffer(buffer2) { - const _entries = []; - let cursor = 0; - while (cursor < buffer2.length) { - const space2 = buffer2.indexOf(32, cursor); - if (space2 === -1) { - throw new InternalError( - `GitTree: Error parsing buffer at byte location ${cursor}: Could not find the next space character.` - ); - } - const nullchar = buffer2.indexOf(0, cursor); - if (nullchar === -1) { - throw new InternalError( - `GitTree: Error parsing buffer at byte location ${cursor}: Could not find the next null character.` - ); - } - let mode = buffer2.slice(cursor, space2).toString("utf8"); - if (mode === "40000") - mode = "040000"; - const type = mode2type$1(mode); - const path2 = buffer2.slice(space2 + 1, nullchar).toString("utf8"); - if (path2.includes("\\") || path2.includes("/")) { - throw new UnsafeFilepathError(path2); - } - const oid = buffer2.slice(nullchar + 1, nullchar + 21).toString("hex"); - cursor = nullchar + 21; - _entries.push({ mode, path: path2, oid, type }); - } - return _entries; -} -function limitModeToAllowed(mode) { - if (typeof mode === "number") { - mode = mode.toString(8); - } - if (mode.match(/^0?4.*/)) - return "040000"; - if (mode.match(/^1006.*/)) - return "100644"; - if (mode.match(/^1007.*/)) - return "100755"; - if (mode.match(/^120.*/)) - return "120000"; - if (mode.match(/^160.*/)) - return "160000"; - throw new InternalError(`Could not understand file mode: ${mode}`); -} -function nudgeIntoShape(entry) { - if (!entry.oid && entry.sha) { - entry.oid = entry.sha; - } - entry.mode = limitModeToAllowed(entry.mode); - if (!entry.type) { - entry.type = mode2type$1(entry.mode); - } - return entry; -} -var GitTree = class _GitTree { - constructor(entries) { - if (Buffer.isBuffer(entries)) { - this._entries = parseBuffer(entries); - } else if (Array.isArray(entries)) { - this._entries = entries.map(nudgeIntoShape); - } else { - throw new InternalError("invalid type passed to GitTree constructor"); - } - this._entries.sort(comparePath); - } - static from(tree) { - return new _GitTree(tree); - } - render() { - return this._entries.map((entry) => `${entry.mode} ${entry.type} ${entry.oid} ${entry.path}`).join("\n"); - } - toObject() { - const entries = [...this._entries]; - entries.sort(compareTreeEntryPath); - return Buffer.concat( - entries.map((entry) => { - const mode = Buffer.from(entry.mode.replace(/^0/, "")); - const space2 = Buffer.from(" "); - const path2 = Buffer.from(entry.path, "utf8"); - const nullchar = Buffer.from([0]); - const oid = Buffer.from(entry.oid, "hex"); - return Buffer.concat([mode, space2, path2, nullchar, oid]); - }) - ); - } - /** - * @returns {TreeEntry[]} - */ - entries() { - return this._entries; - } - *[Symbol.iterator]() { - for (const entry of this._entries) { - yield entry; - } - } -}; -var GitObject = class { - static wrap({ type, object }) { - return Buffer.concat([ - Buffer.from(`${type} ${object.byteLength.toString()}\0`), - Buffer.from(object) - ]); - } - static unwrap(buffer2) { - const s = buffer2.indexOf(32); - const i = buffer2.indexOf(0); - const type = buffer2.slice(0, s).toString("utf8"); - const length = buffer2.slice(s + 1, i).toString("utf8"); - const actualLength = buffer2.length - (i + 1); - if (parseInt(length) !== actualLength) { - throw new InternalError( - `Length mismatch: expected ${length} bytes but got ${actualLength} instead.` - ); - } - return { - type, - object: Buffer.from(buffer2.slice(i + 1)) - }; - } -}; -async function readObjectLoose({ fs, gitdir, oid }) { - const source = `objects/${oid.slice(0, 2)}/${oid.slice(2)}`; - const file = await fs.read(`${gitdir}/${source}`); - if (!file) { - return null; - } - return { object: file, format: "deflated", source }; -} -function applyDelta(delta, source) { - const reader = new BufferCursor(delta); - const sourceSize = readVarIntLE(reader); - if (sourceSize !== source.byteLength) { - throw new InternalError( - `applyDelta expected source buffer to be ${sourceSize} bytes but the provided buffer was ${source.length} bytes` - ); - } - const targetSize = readVarIntLE(reader); - let target; - const firstOp = readOp(reader, source); - if (firstOp.byteLength === targetSize) { - target = firstOp; - } else { - target = Buffer.alloc(targetSize); - const writer = new BufferCursor(target); - writer.copy(firstOp); - while (!reader.eof()) { - writer.copy(readOp(reader, source)); - } - const tell = writer.tell(); - if (targetSize !== tell) { - throw new InternalError( - `applyDelta expected target buffer to be ${targetSize} bytes but the resulting buffer was ${tell} bytes` - ); - } - } - return target; -} -function readVarIntLE(reader) { - let result = 0; - let shift = 0; - let byte = null; - do { - byte = reader.readUInt8(); - result |= (byte & 127) << shift; - shift += 7; - } while (byte & 128); - return result; -} -function readCompactLE(reader, flags, size) { - let result = 0; - let shift = 0; - while (size--) { - if (flags & 1) { - result |= reader.readUInt8() << shift; - } - flags >>= 1; - shift += 8; - } - return result; -} -function readOp(reader, source) { - const byte = reader.readUInt8(); - const COPY = 128; - const OFFS = 15; - const SIZE = 112; - if (byte & COPY) { - const offset = readCompactLE(reader, byte & OFFS, 4); - let size = readCompactLE(reader, (byte & SIZE) >> 4, 3); - if (size === 0) - size = 65536; - return source.slice(offset, offset + size); - } else { - return reader.slice(byte); - } -} -function fromValue(value) { - let queue = [value]; - return { - next() { - return Promise.resolve({ done: queue.length === 0, value: queue.pop() }); - }, - return() { - queue = []; - return {}; - }, - [Symbol.asyncIterator]() { - return this; - } - }; -} -function getIterator(iterable) { - if (iterable[Symbol.asyncIterator]) { - return iterable[Symbol.asyncIterator](); - } - if (iterable[Symbol.iterator]) { - return iterable[Symbol.iterator](); - } - if (iterable.next) { - return iterable; - } - return fromValue(iterable); -} -var StreamReader = class { - constructor(stream) { - this.stream = getIterator(stream); - this.buffer = null; - this.cursor = 0; - this.undoCursor = 0; - this.started = false; - this._ended = false; - this._discardedBytes = 0; - } - eof() { - return this._ended && this.cursor === this.buffer.length; - } - tell() { - return this._discardedBytes + this.cursor; - } - async byte() { - if (this.eof()) - return; - if (!this.started) - await this._init(); - if (this.cursor === this.buffer.length) { - await this._loadnext(); - if (this._ended) - return; - } - this._moveCursor(1); - return this.buffer[this.undoCursor]; - } - async chunk() { - if (this.eof()) - return; - if (!this.started) - await this._init(); - if (this.cursor === this.buffer.length) { - await this._loadnext(); - if (this._ended) - return; - } - this._moveCursor(this.buffer.length); - return this.buffer.slice(this.undoCursor, this.cursor); - } - async read(n) { - if (this.eof()) - return; - if (!this.started) - await this._init(); - if (this.cursor + n > this.buffer.length) { - this._trim(); - await this._accumulate(n); - } - this._moveCursor(n); - return this.buffer.slice(this.undoCursor, this.cursor); - } - async skip(n) { - if (this.eof()) - return; - if (!this.started) - await this._init(); - if (this.cursor + n > this.buffer.length) { - this._trim(); - await this._accumulate(n); - } - this._moveCursor(n); - } - async undo() { - this.cursor = this.undoCursor; - } - async _next() { - this.started = true; - let { done, value } = await this.stream.next(); - if (done) { - this._ended = true; - } - if (value) { - value = Buffer.from(value); - } - return value; - } - _trim() { - this.buffer = this.buffer.slice(this.undoCursor); - this.cursor -= this.undoCursor; - this._discardedBytes += this.undoCursor; - this.undoCursor = 0; - } - _moveCursor(n) { - this.undoCursor = this.cursor; - this.cursor += n; - if (this.cursor > this.buffer.length) { - this.cursor = this.buffer.length; - } - } - async _accumulate(n) { - if (this._ended) - return; - const buffers = [this.buffer]; - while (this.cursor + n > lengthBuffers(buffers)) { - const nextbuffer = await this._next(); - if (this._ended) - break; - buffers.push(nextbuffer); - } - this.buffer = Buffer.concat(buffers); - } - 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 lengthBuffers(buffers) { - return buffers.reduce((acc, buffer2) => acc + buffer2.length, 0); -} -async function listpack(stream, onData) { - const reader = new StreamReader(stream); - let PACK = await reader.read(4); - PACK = PACK.toString("utf8"); - if (PACK !== "PACK") { - throw new InternalError(`Invalid PACK header '${PACK}'`); - } - let version2 = await reader.read(4); - version2 = version2.readUInt32BE(0); - if (version2 !== 2) { - throw new InternalError(`Invalid packfile version: ${version2}`); - } - let numObjects = await reader.read(4); - numObjects = numObjects.readUInt32BE(0); - if (numObjects < 1) - return; - while (!reader.eof() && numObjects--) { - const offset = reader.tell(); - const { type, length, ofs, reference } = await parseHeader(reader); - const inflator = new import_pako.default.Inflate(); - while (!inflator.result) { - const chunk = await reader.chunk(); - if (!chunk) - break; - inflator.push(chunk, false); - if (inflator.err) { - throw new InternalError(`Pako error: ${inflator.msg}`); - } - if (inflator.result) { - if (inflator.result.length !== length) { - throw new InternalError( - `Inflated object size is different from that stated in packfile.` - ); - } - await reader.undo(); - await reader.read(chunk.length - inflator.strm.avail_in); - const end = reader.tell(); - await onData({ - data: inflator.result, - type, - num: numObjects, - offset, - end, - reference, - ofs - }); - } - } - } -} -async function parseHeader(reader) { - let byte = await reader.byte(); - const type = byte >> 4 & 7; - let length = byte & 15; - if (byte & 128) { - let shift = 4; - do { - byte = await reader.byte(); - length |= (byte & 127) << shift; - shift += 7; - } while (byte & 128); - } - let ofs; - let reference; - if (type === 6) { - let shift = 0; - ofs = 0; - const bytes = []; - do { - byte = await reader.byte(); - ofs |= (byte & 127) << shift; - shift += 7; - bytes.push(byte); - } while (byte & 128); - reference = Buffer.from(bytes); - } - if (type === 7) { - const buf = await reader.read(20); - reference = buf; - } - return { type, length, ofs, reference }; -} -var supportsDecompressionStream = false; -async function inflate(buffer2) { - if (supportsDecompressionStream === null) { - supportsDecompressionStream = testDecompressionStream(); - } - return supportsDecompressionStream ? browserInflate(buffer2) : import_pako.default.inflate(buffer2); -} -async function browserInflate(buffer2) { - const ds = new DecompressionStream("deflate"); - const d = new Blob([buffer2]).stream().pipeThrough(ds); - return new Uint8Array(await new Response(d).arrayBuffer()); -} -function testDecompressionStream() { - try { - const ds = new DecompressionStream("deflate"); - if (ds) - return true; - } catch (_) { - } - return false; -} -function decodeVarInt(reader) { - const bytes = []; - let byte = 0; - let multibyte = 0; - do { - byte = reader.readUInt8(); - const lastSeven = byte & 127; - bytes.push(lastSeven); - multibyte = byte & 128; - } while (multibyte); - return bytes.reduce((a, b) => a + 1 << 7 | b, -1); -} -function otherVarIntDecode(reader, startWith) { - let result = startWith; - let shift = 4; - let byte = null; - do { - byte = reader.readUInt8(); - result |= (byte & 127) << shift; - shift += 7; - } while (byte & 128); - return result; -} -var GitPackIndex = class _GitPackIndex { - constructor(stuff) { - Object.assign(this, stuff); - this.offsetCache = {}; - } - static async fromIdx({ idx, getExternalRefDelta }) { - const reader = new BufferCursor(idx); - const magic = reader.slice(4).toString("hex"); - if (magic !== "ff744f63") { - return; - } - const version2 = reader.readUInt32BE(); - if (version2 !== 2) { - throw new InternalError( - `Unable to read version ${version2} packfile IDX. (Only version 2 supported)` - ); - } - if (idx.byteLength > 2048 * 1024 * 1024) { - throw new InternalError( - `To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.` - ); - } - reader.seek(reader.tell() + 4 * 255); - const size = reader.readUInt32BE(); - const hashes = []; - for (let i = 0; i < size; i++) { - const hash2 = reader.slice(20).toString("hex"); - hashes[i] = hash2; - } - reader.seek(reader.tell() + 4 * size); - const offsets = /* @__PURE__ */ new Map(); - for (let i = 0; i < size; i++) { - offsets.set(hashes[i], reader.readUInt32BE()); - } - const packfileSha = reader.slice(20).toString("hex"); - return new _GitPackIndex({ - hashes, - crcs: {}, - offsets, - packfileSha, - getExternalRefDelta - }); - } - static async fromPack({ pack, getExternalRefDelta, onProgress }) { - const listpackTypes = { - 1: "commit", - 2: "tree", - 3: "blob", - 4: "tag", - 6: "ofs-delta", - 7: "ref-delta" - }; - const offsetToObject = {}; - const packfileSha = pack.slice(-20).toString("hex"); - const hashes = []; - const crcs = {}; - const offsets = /* @__PURE__ */ new Map(); - let totalObjectCount = null; - let lastPercent = null; - await listpack([pack], async ({ data, type, reference, offset, num: num2 }) => { - if (totalObjectCount === null) - totalObjectCount = num2; - const percent = Math.floor( - (totalObjectCount - num2) * 100 / totalObjectCount - ); - if (percent !== lastPercent) { - if (onProgress) { - await onProgress({ - phase: "Receiving objects", - loaded: totalObjectCount - num2, - total: totalObjectCount - }); - } - } - lastPercent = percent; - type = listpackTypes[type]; - if (["commit", "tree", "blob", "tag"].includes(type)) { - offsetToObject[offset] = { - type, - offset - }; - } else if (type === "ofs-delta") { - offsetToObject[offset] = { - type, - offset - }; - } else if (type === "ref-delta") { - offsetToObject[offset] = { - type, - offset - }; - } - }); - const offsetArray = Object.keys(offsetToObject).map(Number); - for (const [i, start] of offsetArray.entries()) { - const end = i + 1 === offsetArray.length ? pack.byteLength - 20 : offsetArray[i + 1]; - const o = offsetToObject[start]; - const crc = import_crc_32.default.buf(pack.slice(start, end)) >>> 0; - o.end = end; - o.crc = crc; - } - const p = new _GitPackIndex({ - pack: Promise.resolve(pack), - packfileSha, - crcs, - hashes, - offsets, - getExternalRefDelta - }); - lastPercent = null; - let count = 0; - const objectsByDepth = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; - for (let offset in offsetToObject) { - offset = Number(offset); - const percent = Math.floor(count * 100 / totalObjectCount); - if (percent !== lastPercent) { - if (onProgress) { - await onProgress({ - phase: "Resolving deltas", - loaded: count, - total: totalObjectCount - }); - } - } - count++; - lastPercent = percent; - const o = offsetToObject[offset]; - if (o.oid) - continue; - try { - p.readDepth = 0; - p.externalReadDepth = 0; - const { type, object } = await p.readSlice({ start: offset }); - objectsByDepth[p.readDepth] += 1; - const oid = await shasum(GitObject.wrap({ type, object })); - o.oid = oid; - hashes.push(oid); - offsets.set(oid, offset); - crcs[oid] = o.crc; - } catch (err) { - continue; - } - } - hashes.sort(); - return p; - } - async toBuffer() { - const buffers = []; - const write = (str, encoding) => { - buffers.push(Buffer.from(str, encoding)); - }; - write("ff744f63", "hex"); - write("00000002", "hex"); - const fanoutBuffer = new BufferCursor(Buffer.alloc(256 * 4)); - for (let i = 0; i < 256; i++) { - let count = 0; - for (const hash2 of this.hashes) { - if (parseInt(hash2.slice(0, 2), 16) <= i) - count++; - } - fanoutBuffer.writeUInt32BE(count); - } - buffers.push(fanoutBuffer.buffer); - for (const hash2 of this.hashes) { - write(hash2, "hex"); - } - const crcsBuffer = new BufferCursor(Buffer.alloc(this.hashes.length * 4)); - for (const hash2 of this.hashes) { - crcsBuffer.writeUInt32BE(this.crcs[hash2]); - } - buffers.push(crcsBuffer.buffer); - const offsetsBuffer = new BufferCursor(Buffer.alloc(this.hashes.length * 4)); - for (const hash2 of this.hashes) { - offsetsBuffer.writeUInt32BE(this.offsets.get(hash2)); - } - buffers.push(offsetsBuffer.buffer); - write(this.packfileSha, "hex"); - const totalBuffer = Buffer.concat(buffers); - const sha = await shasum(totalBuffer); - const shaBuffer = Buffer.alloc(20); - shaBuffer.write(sha, "hex"); - return Buffer.concat([totalBuffer, shaBuffer]); - } - async load({ pack }) { - this.pack = pack; - } - async unload() { - this.pack = null; - } - async read({ oid }) { - if (!this.offsets.get(oid)) { - if (this.getExternalRefDelta) { - this.externalReadDepth++; - return this.getExternalRefDelta(oid); - } else { - throw new InternalError(`Could not read object ${oid} from packfile`); - } - } - const start = this.offsets.get(oid); - return this.readSlice({ start }); - } - async readSlice({ start }) { - if (this.offsetCache[start]) { - return Object.assign({}, this.offsetCache[start]); - } - this.readDepth++; - const types2 = { - 16: "commit", - 32: "tree", - 48: "blob", - 64: "tag", - 96: "ofs_delta", - 112: "ref_delta" - }; - if (!this.pack) { - throw new InternalError( - "Tried to read from a GitPackIndex with no packfile loaded into memory" - ); - } - const raw = (await this.pack).slice(start); - const reader = new BufferCursor(raw); - const byte = reader.readUInt8(); - const btype = byte & 112; - let type = types2[btype]; - if (type === void 0) { - throw new InternalError("Unrecognized type: 0b" + btype.toString(2)); - } - const lastFour = byte & 15; - let length = lastFour; - const multibyte = byte & 128; - if (multibyte) { - length = otherVarIntDecode(reader, lastFour); - } - let base = null; - let object = null; - if (type === "ofs_delta") { - const offset = decodeVarInt(reader); - const baseOffset = start - offset; - ({ object: base, type } = await this.readSlice({ start: baseOffset })); - } - if (type === "ref_delta") { - const oid = reader.slice(20).toString("hex"); - ({ object: base, type } = await this.read({ oid })); - } - const buffer2 = raw.slice(reader.tell()); - object = Buffer.from(await inflate(buffer2)); - if (object.byteLength !== length) { - throw new InternalError( - `Packfile told us object would have length ${length} but it had length ${object.byteLength}` - ); - } - if (base) { - object = Buffer.from(applyDelta(object, base)); - } - if (this.readDepth > 3) { - this.offsetCache[start] = { type, object }; - } - return { type, format: "content", object }; - } -}; -var PackfileCache = Symbol("PackfileCache"); -async function loadPackIndex({ - fs, - filename, - getExternalRefDelta, - emitter, - emitterPrefix -}) { - const idx = await fs.read(filename); - return GitPackIndex.fromIdx({ idx, getExternalRefDelta }); -} -function readPackIndex({ - fs, - cache, - filename, - getExternalRefDelta, - emitter, - emitterPrefix -}) { - if (!cache[PackfileCache]) - cache[PackfileCache] = /* @__PURE__ */ new Map(); - let p = cache[PackfileCache].get(filename); - if (!p) { - p = loadPackIndex({ - fs, - filename, - getExternalRefDelta, - emitter, - emitterPrefix - }); - cache[PackfileCache].set(filename, p); - } - return p; -} -async function readObjectPacked({ - fs, - cache, - gitdir, - oid, - format = "content", - getExternalRefDelta -}) { - let list = await fs.readdir(join(gitdir, "objects/pack")); - list = list.filter((x) => x.endsWith(".idx")); - for (const filename of list) { - const indexFile = `${gitdir}/objects/pack/${filename}`; - const p = await readPackIndex({ - fs, - cache, - filename: indexFile, - getExternalRefDelta - }); - if (p.error) - throw new InternalError(p.error); - if (p.offsets.has(oid)) { - if (!p.pack) { - const packFile = indexFile.replace(/idx$/, "pack"); - p.pack = fs.read(packFile); - } - const result = await p.read({ oid, getExternalRefDelta }); - result.format = "content"; - result.source = `objects/pack/${filename.replace(/idx$/, "pack")}`; - return result; - } - } - return null; -} -async function _readObject({ - fs, - cache, - gitdir, - oid, - format = "content" -}) { - const getExternalRefDelta = (oid2) => _readObject({ fs, cache, gitdir, oid: oid2 }); - let result; - if (oid === "4b825dc642cb6eb9a060e54bf8d69288fbee4904") { - result = { format: "wrapped", object: Buffer.from(`tree 0\0`) }; - } - if (!result) { - result = await readObjectLoose({ fs, gitdir, oid }); - } - if (!result) { - result = await readObjectPacked({ - fs, - cache, - gitdir, - oid, - getExternalRefDelta - }); - } - if (!result) { - throw new NotFoundError(oid); - } - if (format === "deflated") { - return result; - } - if (result.format === "deflated") { - result.object = Buffer.from(await inflate(result.object)); - result.format = "wrapped"; - } - if (result.format === "wrapped") { - if (format === "wrapped" && result.format === "wrapped") { - return result; - } - const sha = await shasum(result.object); - if (sha !== oid) { - throw new InternalError( - `SHA check failed! Expected ${oid}, computed ${sha}` - ); - } - const { object, type } = GitObject.unwrap(result.object); - result.type = type; - result.object = object; - result.format = "content"; - } - if (result.format === "content") { - if (format === "content") - return result; - return; - } - throw new InternalError(`invalid format "${result.format}"`); -} -var AlreadyExistsError = class _AlreadyExistsError extends BaseError { - /** - * @param {'note'|'remote'|'tag'|'branch'} noun - * @param {string} where - * @param {boolean} canForce - */ - constructor(noun, where, canForce = true) { - super( - `Failed to create ${noun} at ${where} because it already exists.${canForce ? ` (Hint: use 'force: true' parameter to overwrite existing ${noun}.)` : ""}` - ); - this.code = this.name = _AlreadyExistsError.code; - this.data = { noun, where, canForce }; - } -}; -AlreadyExistsError.code = "AlreadyExistsError"; -var AmbiguousError = class _AmbiguousError extends BaseError { - /** - * @param {'oids'|'refs'} nouns - * @param {string} short - * @param {string[]} matches - */ - constructor(nouns, short, matches) { - super( - `Found multiple ${nouns} matching "${short}" (${matches.join( - ", " - )}). Use a longer abbreviation length to disambiguate them.` - ); - this.code = this.name = _AmbiguousError.code; - this.data = { nouns, short, matches }; - } -}; -AmbiguousError.code = "AmbiguousError"; -var CheckoutConflictError = class _CheckoutConflictError extends BaseError { - /** - * @param {string[]} filepaths - */ - constructor(filepaths) { - super( - `Your local changes to the following files would be overwritten by checkout: ${filepaths.join( - ", " - )}` - ); - this.code = this.name = _CheckoutConflictError.code; - this.data = { filepaths }; - } -}; -CheckoutConflictError.code = "CheckoutConflictError"; -var CommitNotFetchedError = class _CommitNotFetchedError extends BaseError { - /** - * @param {string} ref - * @param {string} oid - */ - constructor(ref, oid) { - super( - `Failed to checkout "${ref}" because commit ${oid} is not available locally. Do a git fetch to make the branch available locally.` - ); - this.code = this.name = _CommitNotFetchedError.code; - this.data = { ref, oid }; - } -}; -CommitNotFetchedError.code = "CommitNotFetchedError"; -var EmptyServerResponseError = class _EmptyServerResponseError extends BaseError { - constructor() { - super(`Empty response from git server.`); - this.code = this.name = _EmptyServerResponseError.code; - this.data = {}; - } -}; -EmptyServerResponseError.code = "EmptyServerResponseError"; -var FastForwardError = class _FastForwardError extends BaseError { - constructor() { - super(`A simple fast-forward merge was not possible.`); - this.code = this.name = _FastForwardError.code; - this.data = {}; - } -}; -FastForwardError.code = "FastForwardError"; -var GitPushError = class _GitPushError extends BaseError { - /** - * @param {string} prettyDetails - * @param {PushResult} result - */ - constructor(prettyDetails, result) { - super(`One or more branches were not updated: ${prettyDetails}`); - this.code = this.name = _GitPushError.code; - this.data = { prettyDetails, result }; - } -}; -GitPushError.code = "GitPushError"; -var HttpError = class _HttpError extends BaseError { - /** - * @param {number} statusCode - * @param {string} statusMessage - * @param {string} response - */ - constructor(statusCode, statusMessage, response) { - super(`HTTP Error: ${statusCode} ${statusMessage}`); - this.code = this.name = _HttpError.code; - this.data = { statusCode, statusMessage, response }; - } -}; -HttpError.code = "HttpError"; -var InvalidFilepathError = class _InvalidFilepathError extends BaseError { - /** - * @param {'leading-slash'|'trailing-slash'|'directory'} [reason] - */ - constructor(reason) { - let message = "invalid filepath"; - if (reason === "leading-slash" || reason === "trailing-slash") { - message = `"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.`; - } else if (reason === "directory") { - message = `"filepath" should not be a directory.`; - } - super(message); - this.code = this.name = _InvalidFilepathError.code; - this.data = { reason }; - } -}; -InvalidFilepathError.code = "InvalidFilepathError"; -var InvalidRefNameError = class _InvalidRefNameError extends BaseError { - /** - * @param {string} ref - * @param {string} suggestion - * @param {boolean} canForce - */ - constructor(ref, suggestion) { - super( - `"${ref}" would be an invalid git reference. (Hint: a valid alternative would be "${suggestion}".)` - ); - this.code = this.name = _InvalidRefNameError.code; - this.data = { ref, suggestion }; - } -}; -InvalidRefNameError.code = "InvalidRefNameError"; -var MaxDepthError = class _MaxDepthError extends BaseError { - /** - * @param {number} depth - */ - constructor(depth) { - super(`Maximum search depth of ${depth} exceeded.`); - this.code = this.name = _MaxDepthError.code; - this.data = { depth }; - } -}; -MaxDepthError.code = "MaxDepthError"; -var MergeNotSupportedError = class _MergeNotSupportedError extends BaseError { - constructor() { - super(`Merges with conflicts are not supported yet.`); - this.code = this.name = _MergeNotSupportedError.code; - this.data = {}; - } -}; -MergeNotSupportedError.code = "MergeNotSupportedError"; -var MergeConflictError = class _MergeConflictError extends BaseError { - /** - * @param {Array} filepaths - */ - constructor(filepaths) { - super( - `Automatic merge failed with one or more merge conflicts in the following files: ${filepaths.toString()}. Fix conflicts then commit the result.` - ); - this.code = this.name = _MergeConflictError.code; - this.data = { filepaths }; - } -}; -MergeConflictError.code = "MergeConflictError"; -var MissingNameError = class _MissingNameError extends BaseError { - /** - * @param {'author'|'committer'|'tagger'} role - */ - constructor(role) { - super( - `No name was provided for ${role} in the argument or in the .git/config file.` - ); - this.code = this.name = _MissingNameError.code; - this.data = { role }; - } -}; -MissingNameError.code = "MissingNameError"; -var MissingParameterError = class _MissingParameterError extends BaseError { - /** - * @param {string} parameter - */ - constructor(parameter) { - super( - `The function requires a "${parameter}" parameter but none was provided.` - ); - this.code = this.name = _MissingParameterError.code; - this.data = { parameter }; - } -}; -MissingParameterError.code = "MissingParameterError"; -var MultipleGitError = class _MultipleGitError extends BaseError { - /** - * @param {Error[]} errors - * @param {string} message - */ - constructor(errors) { - super( - `There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more` - ); - this.code = this.name = _MultipleGitError.code; - this.data = { errors }; - this.errors = errors; - } -}; -MultipleGitError.code = "MultipleGitError"; -var ParseError = class _ParseError extends BaseError { - /** - * @param {string} expected - * @param {string} actual - */ - constructor(expected, actual) { - super(`Expected "${expected}" but received "${actual}".`); - this.code = this.name = _ParseError.code; - this.data = { expected, actual }; - } -}; -ParseError.code = "ParseError"; -var PushRejectedError = class _PushRejectedError extends BaseError { - /** - * @param {'not-fast-forward'|'tag-exists'} reason - */ - constructor(reason) { - let message = ""; - if (reason === "not-fast-forward") { - message = " because it was not a simple fast-forward"; - } else if (reason === "tag-exists") { - message = " because tag already exists"; - } - super(`Push rejected${message}. Use "force: true" to override.`); - this.code = this.name = _PushRejectedError.code; - this.data = { reason }; - } -}; -PushRejectedError.code = "PushRejectedError"; -var RemoteCapabilityError = class _RemoteCapabilityError extends BaseError { - /** - * @param {'shallow'|'deepen-since'|'deepen-not'|'deepen-relative'} capability - * @param {'depth'|'since'|'exclude'|'relative'} parameter - */ - constructor(capability, parameter) { - super( - `Remote does not support the "${capability}" so the "${parameter}" parameter cannot be used.` - ); - this.code = this.name = _RemoteCapabilityError.code; - this.data = { capability, parameter }; - } -}; -RemoteCapabilityError.code = "RemoteCapabilityError"; -var SmartHttpError = class _SmartHttpError extends BaseError { - /** - * @param {string} preview - * @param {string} response - */ - constructor(preview, response) { - super( - `Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${preview}` - ); - this.code = this.name = _SmartHttpError.code; - this.data = { preview, response }; - } -}; -SmartHttpError.code = "SmartHttpError"; -var UnknownTransportError = class _UnknownTransportError extends BaseError { - /** - * @param {string} url - * @param {string} transport - * @param {string} [suggestion] - */ - constructor(url, transport, suggestion) { - super( - `Git remote "${url}" uses an unrecognized transport protocol: "${transport}"` - ); - this.code = this.name = _UnknownTransportError.code; - this.data = { url, transport, suggestion }; - } -}; -UnknownTransportError.code = "UnknownTransportError"; -var UrlParseError = class _UrlParseError extends BaseError { - /** - * @param {string} url - */ - constructor(url) { - super(`Cannot parse remote URL: "${url}"`); - this.code = this.name = _UrlParseError.code; - this.data = { url }; - } -}; -UrlParseError.code = "UrlParseError"; -var UserCanceledError = class _UserCanceledError extends BaseError { - constructor() { - super(`The operation was canceled.`); - this.code = this.name = _UserCanceledError.code; - this.data = {}; - } -}; -UserCanceledError.code = "UserCanceledError"; -var IndexResetError = class _IndexResetError extends BaseError { - /** - * @param {Array} filepaths - */ - constructor(filepath) { - super( - `Could not merge index: Entry for '${filepath}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged chages.` - ); - this.code = this.name = _IndexResetError.code; - this.data = { filepath }; - } -}; -IndexResetError.code = "IndexResetError"; -var Errors = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AlreadyExistsError, - AmbiguousError, - CheckoutConflictError, - CommitNotFetchedError, - EmptyServerResponseError, - FastForwardError, - GitPushError, - HttpError, - InternalError, - InvalidFilepathError, - InvalidOidError, - InvalidRefNameError, - MaxDepthError, - MergeNotSupportedError, - MergeConflictError, - MissingNameError, - MissingParameterError, - MultipleGitError, - NoRefspecError, - NotFoundError, - ObjectTypeError, - ParseError, - PushRejectedError, - RemoteCapabilityError, - SmartHttpError, - UnknownTransportError, - UnsafeFilepathError, - UrlParseError, - UserCanceledError, - UnmergedPathsError, - IndexResetError -}); -function formatAuthor({ name, email, timestamp, timezoneOffset }) { - timezoneOffset = formatTimezoneOffset(timezoneOffset); - return `${name} <${email}> ${timestamp} ${timezoneOffset}`; -} -function formatTimezoneOffset(minutes) { - const sign = simpleSign(negateExceptForZero(minutes)); - minutes = Math.abs(minutes); - const hours = Math.floor(minutes / 60); - minutes -= hours * 60; - let strHours = String(hours); - let strMinutes = String(minutes); - if (strHours.length < 2) - strHours = "0" + strHours; - if (strMinutes.length < 2) - strMinutes = "0" + strMinutes; - return (sign === -1 ? "-" : "+") + strHours + strMinutes; -} -function simpleSign(n) { - return Math.sign(n) || (Object.is(n, -0) ? -1 : 1); -} -function negateExceptForZero(n) { - return n === 0 ? n : -n; -} -function normalizeNewlines(str) { - str = str.replace(/\r/g, ""); - str = str.replace(/^\n+/, ""); - str = str.replace(/\n+$/, "") + "\n"; - return str; -} -function parseAuthor(author) { - const [, name, email, timestamp, offset] = author.match( - /^(.*) <(.*)> (.*) (.*)$/ - ); - return { - name, - email, - timestamp: Number(timestamp), - timezoneOffset: parseTimezoneOffset(offset) - }; -} -function parseTimezoneOffset(offset) { - let [, sign, hours, minutes] = offset.match(/(\+|-)(\d\d)(\d\d)/); - minutes = (sign === "+" ? 1 : -1) * (Number(hours) * 60 + Number(minutes)); - return negateExceptForZero$1(minutes); -} -function negateExceptForZero$1(n) { - return n === 0 ? n : -n; -} -var GitAnnotatedTag = class _GitAnnotatedTag { - constructor(tag2) { - if (typeof tag2 === "string") { - this._tag = tag2; - } else if (Buffer.isBuffer(tag2)) { - this._tag = tag2.toString("utf8"); - } else if (typeof tag2 === "object") { - this._tag = _GitAnnotatedTag.render(tag2); - } else { - throw new InternalError( - "invalid type passed to GitAnnotatedTag constructor" - ); - } - } - static from(tag2) { - return new _GitAnnotatedTag(tag2); - } - static render(obj) { - return `object ${obj.object} -type ${obj.type} -tag ${obj.tag} -tagger ${formatAuthor(obj.tagger)} +`),this.code=this.name=t.code,this.data={remote:e}}};Za.code="NoRefspecError";var Do=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let n=null;this.parsedConfig=e.trim().split(` +`).map(r=>{if(/^\s*#/.test(r))return{line:r,comment:!0};let i=r.indexOf(" ");if(r.startsWith("^")){let a=r.slice(1);return this.refs.set(n+"^{}",a),{line:r,ref:n,peeled:a}}else{let a=r.slice(0,i);return n=r.slice(i+1),this.refs.set(n,a),{line:r,ref:n,oid:a}}})}return this}static from(e){return new t(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(n=>n.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(` +`)+` +`}},Bo=class t{constructor({remotePath:e,localPath:n,force:r,matchPrefix:i}){Object.assign(this,{remotePath:e,localPath:n,force:r,matchPrefix:i})}static from(e){let[n,r,i,a,s]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=n==="+",l=i==="*";if(l!==(s==="*"))throw new ue("Invalid refspec");return new t({remotePath:r,localPath:a,force:o,matchPrefix:l})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}},Ff=class t{constructor(e=[]){this.rules=e}static from(e){let n=[];for(let r of e)n.push(Bo.from(r));return new t(n)}add(e){let n=Bo.from(e);this.rules.push(n)}translate(e){let n=[];for(let r of this.rules)for(let i of e){let a=r.translate(i);a&&n.push([i,a])}return n}translateOne(e){let n=null;for(let r of this.rules){let i=r.translate(e);i&&(n=i)}return n}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function y5(t,e){let n=t.replace(/\^\{\}$/,""),r=e.replace(/\^\{\}$/,""),i=-(nr);return i===0?t.endsWith("^{}")?1:-1:i}var K0=new Map;function J0(t){let e=K0.get(t);return e||(e=v5(t),K0.set(t,e)),e}function v5(t){return t=t.split("/./").join("/").replace(/\/{2,}/g,"/"),t==="/."?"/":t==="./"||(t.startsWith("./")&&(t=t.slice(2)),t.endsWith("/.")&&(t=t.slice(0,-2)),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t==="")?".":t}function B(...t){return J0(t.map(J0).join("/"))}var w5=t=>{t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},qa=t=>{if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},Q0={core:{filemode:qa,bare:qa,logallrefupdates:qa,symlinks:qa,ignorecase:qa,bigFileThreshold:w5}},b5=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,x5=/^[A-Za-z0-9-.]+$/,_5=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,S5=/^[A-Za-z][A-Za-z-]*$/,E5=/^(.*?)( *[#;].*)$/,k5=t=>{let e=b5.exec(t);if(e!=null){let[n,r]=e.slice(1);return[n,r]}return null},A5=t=>{let e=_5.exec(t);if(e!=null){let[n,r="true"]=e.slice(1),i=T5(r),a=C5(i);return[n,a]}return null},T5=t=>{let e=E5.exec(t);if(e==null)return t;let[n,r]=e.slice(1);return e1(n)&&e1(r)?`${n}${r}`:n},e1=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,C5=t=>t.split("").reduce((e,n,r,i)=>{let a=n==='"'&&i[r-1]!=="\\",s=n==="\\"&&i[r+1]==='"';return a||s?e:e+n},""),t1=t=>t!=null?t.toLowerCase():null,Mf=(t,e,n)=>[t1(t),e,t1(n)].filter(r=>r!=null).join("."),n1=t=>{let e=t.split("."),n=e.shift(),r=e.pop(),i=e.length?e.join("."):void 0;return{section:n,subsection:i,name:r,path:Mf(n,i,r),sectionPath:Mf(n,i,null)}},F5=(t,e)=>t.reduce((n,r,i)=>e(r)?i:n,-1),Of=class t{constructor(e){let n=null,r=null;this.parsedConfig=e?e.split(` +`).map(i=>{let a=null,s=null,o=i.trim(),l=k5(o),c=l!=null;if(c)[n,r]=l;else{let f=A5(o);f!=null&&([a,s]=f)}let u=Mf(n,r,a);return{line:i,isSection:c,section:n,subsection:r,name:a,value:s,path:u}}):[]}static from(e){return new t(e)}async get(e,n=!1){let r=n1(e).path,i=this.parsedConfig.filter(a=>a.path===r).map(({section:a,name:s,value:o})=>{let l=Q0[a]&&Q0[a][s];return l?l(o):o});return n?i:i.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(n=>n.section===e&&n.isSection).map(n=>n.subsection)}async deleteSection(e,n){this.parsedConfig=this.parsedConfig.filter(r=>!(r.section===e&&r.subsection===n))}async append(e,n){return this.set(e,n,!0)}async set(e,n,r=!1){let{section:i,subsection:a,name:s,path:o,sectionPath:l}=n1(e),c=F5(this.parsedConfig,u=>u.path===o);if(n==null)c!==-1&&this.parsedConfig.splice(c,1);else if(c!==-1){let u=this.parsedConfig[c],f=Object.assign({},u,{name:s,value:n,modified:!0});r?this.parsedConfig.splice(c+1,0,f):this.parsedConfig[c]=f}else{let u=this.parsedConfig.findIndex(h=>h.path===l),f={section:i,subsection:a,name:s,value:n,modified:!0,path:o};if(x5.test(i)&&S5.test(s))if(u>=0)this.parsedConfig.splice(u+1,0,f);else{let h={section:i,subsection:a,modified:!0,path:l};this.parsedConfig.push(h,f)}}}toString(){return this.parsedConfig.map(({line:e,section:n,subsection:r,name:i,value:a,modified:s=!1})=>s?i!=null&&a!=null?typeof a=="string"&&/[#;]/.test(a)?` ${i} = "${a}"`:` ${i} = ${a}`:r!=null?`[${n} "${r}"]`:`[${n}]`:e).join(` +`)}},ze=class{static async get({fs:e,gitdir:n}){let r=await e.read(`${n}/config`,{encoding:"utf8"});return Of.from(r)}static async save({fs:e,gitdir:n,config:r}){await e.write(`${n}/config`,r.toString(),{encoding:"utf8"})}},Po=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],M5=["config","description","index","shallow","commondir"],wf;async function ir(t,e){return wf===void 0&&(wf=new Xa.default),wf.acquire(t,e)}var q=class t{static async updateRemoteRefs({fs:e,gitdir:n,remote:r,refs:i,symrefs:a,tags:s,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let m of i.values())if(!m.match(/[0-9a-f]{40}/))throw new or(m);let u=await ze.get({fs:e,gitdir:n});if(!o){if(o=await u.getall(`remote.${r}.fetch`),o.length===0)throw new Za(r);o.unshift(`+HEAD:refs/remotes/${r}/HEAD`)}let f=Ff.from(o),h=new Map;if(c){let m=await t.listRefs({fs:e,gitdir:n,filepath:"refs/tags"});await t.deleteRefs({fs:e,gitdir:n,refs:m.map(w=>`refs/tags/${w}`)})}if(s){for(let m of i.keys())if(m.startsWith("refs/tags")&&!m.endsWith("^{}")&&!await t.exists({fs:e,gitdir:n,ref:m})){let w=i.get(m);h.set(m,w)}}let d=f.translate([...i.keys()]);for(let[m,w]of d){let b=i.get(m);h.set(w,b)}let p=f.translate([...a.keys()]);for(let[m,w]of p){let b=a.get(m),S=f.translateOne(b);S&&h.set(w,`ref: ${S}`)}let g=[];if(l){for(let m of f.localNamespaces()){let w=(await t.listRefs({fs:e,gitdir:n,filepath:m})).map(b=>`${m}/${b}`);for(let b of w)h.has(b)||g.push(b)}g.length>0&&await t.deleteRefs({fs:e,gitdir:n,refs:g})}for(let[m,w]of h)await ir(m,async()=>e.write(B(n,m),`${w.trim()} +`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:n,ref:r,value:i}){if(!i.match(/[0-9a-f]{40}/))throw new or(i);await ir(r,async()=>e.write(B(n,r),`${i.trim()} +`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:n,ref:r,value:i}){await ir(r,async()=>e.write(B(n,r),`ref: ${i.trim()} +`,"utf8"))}static async deleteRef({fs:e,gitdir:n,ref:r}){return t.deleteRefs({fs:e,gitdir:n,refs:[r]})}static async deleteRefs({fs:e,gitdir:n,refs:r}){await Promise.all(r.map(o=>e.rm(B(n,o))));let i=await ir("packed-refs",async()=>e.read(`${n}/packed-refs`,{encoding:"utf8"})),a=Do.from(i),s=a.refs.size;for(let o of r)a.refs.has(o)&&a.delete(o);a.refs.sizee.write(`${n}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:n,ref:r,depth:i=void 0}){if(i!==void 0&&(i--,i===-1))return r;if(r.startsWith("ref: "))return r=r.slice(5),t.resolve({fs:e,gitdir:n,ref:r,depth:i});if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;let a=await t.packedRefs({fs:e,gitdir:n}),s=Po(r).filter(o=>!M5.includes(o));for(let o of s){let l=await ir(o,async()=>await e.read(`${n}/${o}`,{encoding:"utf8"})||a.get(o));if(l)return t.resolve({fs:e,gitdir:n,ref:l.trim(),depth:i})}throw new Re(r)}static async exists({fs:e,gitdir:n,ref:r}){try{return await t.expand({fs:e,gitdir:n,ref:r}),!0}catch(i){return!1}}static async expand({fs:e,gitdir:n,ref:r}){if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;let i=await t.packedRefs({fs:e,gitdir:n}),a=Po(r);for(let s of a)if(await ir(s,async()=>e.exists(`${n}/${s}`))||i.has(s))return s;throw new Re(r)}static async expandAgainstMap({ref:e,map:n}){let r=Po(e);for(let i of r)if(await n.has(i))return i;throw new Re(e)}static resolveAgainstMap({ref:e,fullref:n=e,depth:r=void 0,map:i}){if(r!==void 0&&(r--,r===-1))return{fullref:n,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:n,depth:r,map:i});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:n,oid:e};let a=Po(e);for(let s of a){let o=i.get(s);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:s,depth:r,map:i})}throw new Re(e)}static async packedRefs({fs:e,gitdir:n}){let r=await ir("packed-refs",async()=>e.read(`${n}/packed-refs`,{encoding:"utf8"}));return Do.from(r).refs}static async listRefs({fs:e,gitdir:n,filepath:r}){let i=t.packedRefs({fs:e,gitdir:n}),a=null;try{a=await e.readdirDeep(`${n}/${r}`),a=a.map(s=>s.replace(`${n}/${r}/`,""))}catch(s){a=[]}for(let s of(await i).keys())s.startsWith(r)&&(s=s.replace(r+"/",""),a.includes(s)||a.push(s));return a.sort(y5),a}static async listBranches({fs:e,gitdir:n,remote:r}){return r?t.listRefs({fs:e,gitdir:n,filepath:`refs/remotes/${r}`}):t.listRefs({fs:e,gitdir:n,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:n}){return(await t.listRefs({fs:e,gitdir:n,filepath:"refs/tags"})).filter(i=>!i.endsWith("^{}"))}};function O5(t,e){return Wo(r1(t),r1(e))}function r1(t){return t.mode==="040000"?t.path+"/":t.path}function k1(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new ue(`Unexpected GitTree entry mode: ${t}`)}function P5(t){let e=[],n=0;for(;n`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(` +`)}toObject(){let e=[...this._entries];return e.sort(O5),Buffer.concat(e.map(n=>{let r=Buffer.from(n.mode.replace(/^0/,"")),i=Buffer.from(" "),a=Buffer.from(n.path,"utf8"),s=Buffer.from([0]),o=Buffer.from(n.oid,"hex");return Buffer.concat([r,i,a,s,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},lr=class{static wrap({type:e,object:n}){return Buffer.concat([Buffer.from(`${e} ${n.byteLength.toString()}\0`),Buffer.from(n)])}static unwrap(e){let n=e.indexOf(32),r=e.indexOf(0),i=e.slice(0,n).toString("utf8"),a=e.slice(n+1,r).toString("utf8"),s=e.length-(r+1);if(parseInt(a)!==s)throw new ue(`Length mismatch: expected ${a} bytes but got ${s} instead.`);return{type:i,object:Buffer.from(e.slice(r+1))}}};async function L5({fs:t,gitdir:e,oid:n}){let r=`objects/${n.slice(0,2)}/${n.slice(2)}`,i=await t.read(`${e}/${r}`);return i?{object:i,format:"deflated",source:r}:null}function j5(t,e){let n=new en(t),r=i1(n);if(r!==e.byteLength)throw new ue(`applyDelta expected source buffer to be ${r} bytes but the provided buffer was ${e.length} bytes`);let i=i1(n),a,s=s1(n,e);if(s.byteLength===i)a=s;else{a=Buffer.alloc(i);let o=new en(a);for(o.copy(s);!n.eof();)o.copy(s1(n,e));let l=o.tell();if(i!==l)throw new ue(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${l} bytes`)}return a}function i1(t){let e=0,n=0,r=null;do r=t.readUInt8(),e|=(r&127)<>=1,i+=8;return r}function s1(t,e){let n=t.readUInt8(),r=128,i=15,a=112;if(n&r){let s=a1(t,n&i,4),o=a1(t,(n&a)>>4,3);return o===0&&(o=65536),e.slice(s,s+o)}else return t.slice(n)}function D5(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function A1(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:D5(t)}var No=class{constructor(e){if(typeof Buffer=="undefined")throw new Error("Missing Buffer dependency");this.stream=A1(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:n}=await this.stream.next();return e&&(this._ended=!0,!n)?Buffer.alloc(0):(n&&(n=Buffer.from(n)),n)}_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 n=[this.buffer];for(;this.cursor+e>B5(n);){let r=await this._next();if(this._ended)break;n.push(r)}this.buffer=Buffer.concat(n)}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 B5(t){return t.reduce((e,n)=>e+n.length,0)}async function N5(t,e){let n=new No(t),r=await n.read(4);if(r=r.toString("utf8"),r!=="PACK")throw new ue(`Invalid PACK header '${r}'`);let i=await n.read(4);if(i=i.readUInt32BE(0),i!==2)throw new ue(`Invalid packfile version: ${i}`);let a=await n.read(4);if(a=a.readUInt32BE(0),!(a<1))for(;!n.eof()&&a--;){let s=n.tell(),{type:o,length:l,ofs:c,reference:u}=await $5(n),f=new Vo.default.Inflate;for(;!f.result;){let h=await n.chunk();if(!h)break;if(f.push(h,!1),f.err)throw new ue(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new ue("Inflated object size is different from that stated in packfile.");await n.undo(),await n.read(h.length-f.strm.avail_in);let d=n.tell();await e({data:f.result,type:o,num:a,offset:s,end:d,reference:u,ofs:c})}}}}async function $5(t){let e=await t.byte(),n=e>>4&7,r=e&15;if(e&128){let s=4;do e=await t.byte(),r|=(e&127)<i+1<<7|a,-1)}function G5(t,e){let n=e,r=4,i=null;do i=t.readUInt8(),n|=(i&127)<2048*1024*1024)throw new ue("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");r.seek(r.tell()+4*255);let s=r.readUInt32BE(),o=[];for(let u=0;u{u===null&&(u=k);let x=Math.floor((u-k)*100/u);x!==f&&r&&await r({phase:"Receiving objects",loaded:u-k,total:u}),f=x,w=i[w],["commit","tree","blob","tag"].includes(w)?a[S]={type:w,offset:S}:w==="ofs-delta"?a[S]={type:w,offset:S}:w==="ref-delta"&&(a[S]={type:w,offset:S})});let h=Object.keys(a).map(Number);for(let[m,w]of h.entries()){let b=m+1===h.length?e.byteLength-20:h[m+1],S=a[w],k=v1.default.buf(e.slice(w,b))>>>0;S.end=b,S.crc=k}let d=new t({pack:Promise.resolve(e),packfileSha:s,crcs:l,hashes:o,offsets:c,getExternalRefDelta:n});f=null;let p=0,g=[0,0,0,0,0,0,0,0,0,0,0,0];for(let m in a){m=Number(m);let w=Math.floor(p*100/u);w!==f&&r&&await r({phase:"Resolving deltas",loaded:p,total:u}),p++,f=w;let b=a[m];if(!b.oid)try{d.readDepth=0,d.externalReadDepth=0;let{type:S,object:k}=await d.readSlice({start:m});g[d.readDepth]+=1;let x=await Un(lr.wrap({type:S,object:k}));b.oid=x,o.push(x),c.set(x,m),l[x]=b.crc}catch(S){continue}}return o.sort(),d}async toBuffer(){let e=[],n=(c,u)=>{e.push(Buffer.from(c,u))};n("ff744f63","hex"),n("00000002","hex");let r=new en(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let f of this.hashes)parseInt(f.slice(0,2),16)<=c&&u++;r.writeUInt32BE(u)}e.push(r.buffer);for(let c of this.hashes)n(c,"hex");let i=new en(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)i.writeUInt32BE(this.crcs[c]);e.push(i.buffer);let a=new en(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)a.writeUInt32BE(this.offsets.get(c));e.push(a.buffer),n(this.packfileSha,"hex");let s=Buffer.concat(e),o=await Un(s),l=Buffer.alloc(20);return l.write(o,"hex"),Buffer.concat([s,l])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new ue(`Could not read object ${e} from packfile`)}let n=this.offsets.get(e);return this.readSlice({start:n})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let n={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new ue("Tried to read from a GitPackIndex with no packfile loaded into memory");let r=(await this.pack).slice(e),i=new en(r),a=i.readUInt8(),s=a&112,o=n[s];if(o===void 0)throw new ue("Unrecognized type: 0b"+s.toString(2));let l=a&15,c=l;a&128&&(c=G5(i,l));let f=null,h=null;if(o==="ofs_delta"){let p=z5(i),g=e-p;({object:f,type:o}=await this.readSlice({start:g}))}if(o==="ref_delta"){let p=i.slice(20).toString("hex");({object:f,type:o}=await this.read({oid:p}))}let d=r.slice(i.tell());if(h=Buffer.from(await T1(d)),h.byteLength!==c)throw new ue(`Packfile told us object would have length ${c} but it had length ${h.byteLength}`);return f&&(h=Buffer.from(j5(h,f))),this.readDepth>3&&(this.offsetCache[e]={type:o,object:h}),{type:o,format:"content",object:h}}},Io=Symbol("PackfileCache");async function V5({fs:t,filename:e,getExternalRefDelta:n,emitter:r,emitterPrefix:i}){let a=await t.read(e);return Ka.fromIdx({idx:a,getExternalRefDelta:n})}function $f({fs:t,cache:e,filename:n,getExternalRefDelta:r,emitter:i,emitterPrefix:a}){e[Io]||(e[Io]=new Map);let s=e[Io].get(n);return s||(s=V5({fs:t,filename:n,getExternalRefDelta:r,emitter:i,emitterPrefix:a}),e[Io].set(n,s)),s}async function W5({fs:t,cache:e,gitdir:n,oid:r,format:i="content",getExternalRefDelta:a}){let s=await t.readdir(B(n,"objects/pack"));s=s.filter(o=>o.endsWith(".idx"));for(let o of s){let l=`${n}/objects/pack/${o}`,c=await $f({fs:t,cache:e,filename:l,getExternalRefDelta:a});if(c.error)throw new ue(c.error);if(c.offsets.has(r)){if(!c.pack){let f=l.replace(/idx$/,"pack");c.pack=t.read(f)}let u=await c.read({oid:r,getExternalRefDelta:a});return u.format="content",u.source=`objects/pack/${o.replace(/idx$/,"pack")}`,u}}return null}async function Ge({fs:t,cache:e,gitdir:n,oid:r,format:i="content"}){let a=u=>Ge({fs:t,cache:e,gitdir:n,oid:u}),s;if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(s={format:"wrapped",object:Buffer.from("tree 0\0")}),s||(s=await L5({fs:t,gitdir:n,oid:r})),!s){if(s=await W5({fs:t,cache:e,gitdir:n,oid:r,getExternalRefDelta:a}),!s)throw new Re(r);return s}if(i==="deflated"||(s.format==="deflated"&&(s.object=Buffer.from(await T1(s.object)),s.format="wrapped"),i==="wrapped"))return s;let o=await Un(s.object);if(o!==r)throw new ue(`SHA check failed! Expected ${r}, computed ${o}`);let{object:l,type:c}=lr.unwrap(s.object);if(s.type=c,s.object=l,s.format="content",i==="content")return s;throw new ue(`invalid requested format "${i}"`)}var hn=class t extends ge{constructor(e,n,r=!0){super(`Failed to create ${e} at ${n} because it already exists.${r?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=t.code,this.data={noun:e,where:n,canForce:r}}};hn.code="AlreadyExistsError";var Ja=class t extends ge{constructor(e,n,r){super(`Found multiple ${e} matching "${n}" (${r.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=t.code,this.data={nouns:e,short:n,matches:r}}};Ja.code="AmbiguousError";var Qa=class t extends ge{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=t.code,this.data={filepaths:e}}};Qa.code="CheckoutConflictError";var es=class t extends ge{constructor(e,n){super(`Failed to checkout "${e}" because commit ${n} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=t.code,this.data={ref:e,oid:n}}};es.code="CommitNotFetchedError";var ts=class t extends ge{constructor(){super("Empty response from git server."),this.code=this.name=t.code,this.data={}}};ts.code="EmptyServerResponseError";var ns=class t extends ge{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=t.code,this.data={}}};ns.code="FastForwardError";var rs=class t extends ge{constructor(e,n){super(`One or more branches were not updated: ${e}`),this.code=this.name=t.code,this.data={prettyDetails:e,result:n}}};rs.code="GitPushError";var Ai=class t extends ge{constructor(e,n,r){super(`HTTP Error: ${e} ${n}`),this.code=this.name=t.code,this.data={statusCode:e,statusMessage:n,response:r}}};Ai.code="HttpError";var cr=class t extends ge{constructor(e){let n="invalid filepath";e==="leading-slash"||e==="trailing-slash"?n='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(n='"filepath" should not be a directory.'),super(n),this.code=this.name=t.code,this.data={reason:e}}};cr.code="InvalidFilepathError";var zn=class t extends ge{constructor(e,n){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${n}".)`),this.code=this.name=t.code,this.data={ref:e,suggestion:n}}};zn.code="InvalidRefNameError";var is=class t extends ge{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=t.code,this.data={depth:e}}};is.code="MaxDepthError";var Ti=class t extends ge{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=t.code,this.data={}}};Ti.code="MergeNotSupportedError";var Ci=class t extends ge{constructor(e,n,r,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=t.code,this.data={filepaths:e,bothModified:n,deleteByUs:r,deleteByTheirs:i}}};Ci.code="MergeConflictError";var At=class t extends ge{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=t.code,this.data={role:e}}};At.code="MissingNameError";var Pt=class t extends ge{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=t.code,this.data={parameter:e}}};Pt.code="MissingParameterError";var as=class t extends ge{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=t.code,this.data={errors:e},this.errors=e}};as.code="MultipleGitError";var $r=class t extends ge{constructor(e,n){super(`Expected "${e}" but received "${n}".`),this.code=this.name=t.code,this.data={expected:e,actual:n}}};$r.code="ParseError";var Fi=class t extends ge{constructor(e){let n="";e==="not-fast-forward"?n=" because it was not a simple fast-forward":e==="tag-exists"&&(n=" because tag already exists"),super(`Push rejected${n}. Use "force: true" to override.`),this.code=this.name=t.code,this.data={reason:e}}};Fi.code="PushRejectedError";var ar=class t extends ge{constructor(e,n){super(`Remote does not support the "${e}" so the "${n}" parameter cannot be used.`),this.code=this.name=t.code,this.data={capability:e,parameter:n}}};ar.code="RemoteCapabilityError";var ss=class t extends ge{constructor(e,n){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=t.code,this.data={preview:e,response:n}}};ss.code="SmartHttpError";var os=class t extends ge{constructor(e,n,r){super(`Git remote "${e}" uses an unrecognized transport protocol: "${n}"`),this.code=this.name=t.code,this.data={url:e,transport:n,suggestion:r}}};os.code="UnknownTransportError";var ls=class t extends ge{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=t.code,this.data={url:e}}};ls.code="UrlParseError";var Mi=class t extends ge{constructor(){super("The operation was canceled."),this.code=this.name=t.code,this.data={}}};Mi.code="UserCanceledError";var cs=class t extends ge{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=t.code,this.data={filepath:e}}};cs.code="IndexResetError";var us=class t extends ge{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=t.code,this.data={ref:e}}};us.code="NoCommitError";var hs=Object.freeze({__proto__:null,AlreadyExistsError:hn,AmbiguousError:Ja,CheckoutConflictError:Qa,CommitNotFetchedError:es,EmptyServerResponseError:ts,FastForwardError:ns,GitPushError:rs,HttpError:Ai,InternalError:ue,InvalidFilepathError:cr,InvalidOidError:or,InvalidRefNameError:zn,MaxDepthError:is,MergeNotSupportedError:Ti,MergeConflictError:Ci,MissingNameError:At,MissingParameterError:Pt,MultipleGitError:as,NoRefspecError:Za,NotFoundError:Re,ObjectTypeError:kt,ParseError:$r,PushRejectedError:Fi,RemoteCapabilityError:ar,SmartHttpError:ss,UnknownTransportError:os,UnsafeFilepathError:Si,UrlParseError:ls,UserCanceledError:Mi,UnmergedPathsError:Ya,IndexResetError:cs,NoCommitError:us});function Pf({name:t,email:e,timestamp:n,timezoneOffset:r}){return r=q5(r),`${t} <${e}> ${n} ${r}`}function q5(t){let e=X5(Y5(t));t=Math.abs(t);let n=Math.floor(t/60);t-=n*60;let r=String(n),i=String(t);return r.length<2&&(r="0"+r),i.length<2&&(i="0"+i),(e===-1?"-":"+")+r+i}function X5(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}function Y5(t){return t===0?t:-t}function Hn(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+` +`,t}function $o(t){let[,e,n,r,i]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:n,timestamp:Number(r),timezoneOffset:Z5(i)}}function Z5(t){let[,e,n,r]=t.match(/(\+|-)(\d\d)(\d\d)/);return r=(e==="+"?1:-1)*(Number(n)*60+Number(r)),K5(r)}function K5(t){return t===0?t:-t}var Ut=class t{constructor(e){if(typeof e=="string")this._tag=e;else if(Buffer.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=t.render(e);else throw new ue("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new t(e)}static render(e){return`object ${e.object} +type ${e.type} +tag ${e.tag} +tagger ${Pf(e.tagger)} -${obj.message} -${obj.gpgsig ? obj.gpgsig : ""}`; - } - justHeaders() { - return this._tag.slice(0, this._tag.indexOf("\n\n")); - } - message() { - const tag2 = this.withoutSignature(); - return tag2.slice(tag2.indexOf("\n\n") + 2); - } - parse() { - return Object.assign(this.headers(), { - message: this.message(), - gpgsig: this.gpgsig() - }); - } - render() { - return this._tag; - } - headers() { - const headers = this.justHeaders().split("\n"); - const hs = []; - for (const h of headers) { - if (h[0] === " ") { - hs[hs.length - 1] += "\n" + h.slice(1); - } else { - hs.push(h); - } - } - const obj = {}; - for (const h of hs) { - const key2 = h.slice(0, h.indexOf(" ")); - const value = h.slice(h.indexOf(" ") + 1); - if (Array.isArray(obj[key2])) { - obj[key2].push(value); - } else { - obj[key2] = value; - } - } - if (obj.tagger) { - obj.tagger = parseAuthor(obj.tagger); - } - if (obj.committer) { - obj.committer = parseAuthor(obj.committer); - } - return obj; - } - withoutSignature() { - const tag2 = normalizeNewlines(this._tag); - if (tag2.indexOf("\n-----BEGIN PGP SIGNATURE-----") === -1) - return tag2; - return tag2.slice(0, tag2.lastIndexOf("\n-----BEGIN PGP SIGNATURE-----")); - } - gpgsig() { - if (this._tag.indexOf("\n-----BEGIN PGP SIGNATURE-----") === -1) - return; - const signature = this._tag.slice( - this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"), - this._tag.indexOf("-----END PGP SIGNATURE-----") + "-----END PGP SIGNATURE-----".length - ); - return normalizeNewlines(signature); - } - payload() { - return this.withoutSignature() + "\n"; - } - toObject() { - return Buffer.from(this._tag, "utf8"); - } - static async sign(tag2, sign, secretKey) { - const payload = tag2.payload(); - let { signature } = await sign({ payload, secretKey }); - signature = normalizeNewlines(signature); - const signedTag = payload + signature; - return _GitAnnotatedTag.from(signedTag); - } -}; -function indent(str) { - return str.trim().split("\n").map((x) => " " + x).join("\n") + "\n"; -} -function outdent(str) { - return str.split("\n").map((x) => x.replace(/^ /, "")).join("\n"); -} -var GitCommit = class _GitCommit { - constructor(commit2) { - if (typeof commit2 === "string") { - this._commit = commit2; - } else if (Buffer.isBuffer(commit2)) { - this._commit = commit2.toString("utf8"); - } else if (typeof commit2 === "object") { - this._commit = _GitCommit.render(commit2); - } else { - throw new InternalError("invalid type passed to GitCommit constructor"); - } - } - static fromPayloadSignature({ payload, signature }) { - const headers = _GitCommit.justHeaders(payload); - const message = _GitCommit.justMessage(payload); - const commit2 = normalizeNewlines( - headers + "\ngpgsig" + indent(signature) + "\n" + message - ); - return new _GitCommit(commit2); - } - static from(commit2) { - return new _GitCommit(commit2); - } - toObject() { - return Buffer.from(this._commit, "utf8"); - } - // Todo: allow setting the headers and message - headers() { - return this.parseHeaders(); - } - // Todo: allow setting the headers and message - message() { - return _GitCommit.justMessage(this._commit); - } - parse() { - return Object.assign({ message: this.message() }, this.headers()); - } - static justMessage(commit2) { - return normalizeNewlines(commit2.slice(commit2.indexOf("\n\n") + 2)); - } - static justHeaders(commit2) { - return commit2.slice(0, commit2.indexOf("\n\n")); - } - parseHeaders() { - const headers = _GitCommit.justHeaders(this._commit).split("\n"); - const hs = []; - for (const h of headers) { - if (h[0] === " ") { - hs[hs.length - 1] += "\n" + h.slice(1); - } else { - hs.push(h); - } - } - const obj = { - parent: [] - }; - for (const h of hs) { - const key2 = h.slice(0, h.indexOf(" ")); - const value = h.slice(h.indexOf(" ") + 1); - if (Array.isArray(obj[key2])) { - obj[key2].push(value); - } else { - obj[key2] = value; - } - } - if (obj.author) { - obj.author = parseAuthor(obj.author); - } - if (obj.committer) { - obj.committer = parseAuthor(obj.committer); - } - return obj; - } - static renderHeaders(obj) { - let headers = ""; - if (obj.tree) { - headers += `tree ${obj.tree} -`; - } else { - headers += `tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 -`; - } - if (obj.parent) { - if (obj.parent.length === void 0) { - throw new InternalError(`commit 'parent' property should be an array`); - } - for (const p of obj.parent) { - headers += `parent ${p} -`; - } - } - const author = obj.author; - headers += `author ${formatAuthor(author)} -`; - const committer = obj.committer || obj.author; - headers += `committer ${formatAuthor(committer)} -`; - if (obj.gpgsig) { - headers += "gpgsig" + indent(obj.gpgsig); - } - return headers; - } - static render(obj) { - return _GitCommit.renderHeaders(obj) + "\n" + normalizeNewlines(obj.message); - } - render() { - return this._commit; - } - withoutSignature() { - const commit2 = normalizeNewlines(this._commit); - if (commit2.indexOf("\ngpgsig") === -1) - return commit2; - const headers = commit2.slice(0, commit2.indexOf("\ngpgsig")); - const message = commit2.slice( - commit2.indexOf("-----END PGP SIGNATURE-----\n") + "-----END PGP SIGNATURE-----\n".length - ); - return normalizeNewlines(headers + "\n" + message); - } - isolateSignature() { - const signature = this._commit.slice( - this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"), - this._commit.indexOf("-----END PGP SIGNATURE-----") + "-----END PGP SIGNATURE-----".length - ); - return outdent(signature); - } - static async sign(commit2, sign, secretKey) { - const payload = commit2.withoutSignature(); - const message = _GitCommit.justMessage(commit2._commit); - let { signature } = await sign({ payload, secretKey }); - signature = normalizeNewlines(signature); - const headers = _GitCommit.justHeaders(commit2._commit); - const signedCommit = headers + "\ngpgsig" + indent(signature) + "\n" + message; - return _GitCommit.from(signedCommit); - } -}; -async function resolveTree({ fs, cache, gitdir, oid }) { - if (oid === "4b825dc642cb6eb9a060e54bf8d69288fbee4904") { - return { tree: GitTree.from([]), oid }; - } - const { type, object } = await _readObject({ fs, cache, gitdir, oid }); - if (type === "tag") { - oid = GitAnnotatedTag.from(object).parse().object; - return resolveTree({ fs, cache, gitdir, oid }); - } - if (type === "commit") { - oid = GitCommit.from(object).parse().tree; - return resolveTree({ fs, cache, gitdir, oid }); - } - if (type !== "tree") { - throw new ObjectTypeError(oid, type, "tree"); - } - return { tree: GitTree.from(object), oid }; -} -var GitWalkerRepo = class { - constructor({ fs, gitdir, ref, cache }) { - this.fs = fs; - this.cache = cache; - this.gitdir = gitdir; - this.mapPromise = (async () => { - const map = /* @__PURE__ */ new Map(); - let oid; - try { - oid = await GitRefManager.resolve({ fs, gitdir, ref }); - } catch (e) { - if (e instanceof NotFoundError) { - oid = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"; - } - } - const tree = await resolveTree({ fs, cache: this.cache, gitdir, oid }); - tree.type = "tree"; - tree.mode = "40000"; - map.set(".", tree); - return map; - })(); - const walker = this; - this.ConstructEntry = class TreeEntry { - constructor(fullpath) { - this._fullpath = fullpath; - this._type = false; - this._mode = false; - this._stat = false; - this._content = false; - this._oid = false; - } - async type() { - return walker.type(this); - } - async mode() { - return walker.mode(this); - } - async stat() { - return walker.stat(this); - } - async content() { - return walker.content(this); - } - async oid() { - return walker.oid(this); - } - }; - } - async readdir(entry) { - const filepath = entry._fullpath; - const { fs, cache, gitdir } = this; - const map = await this.mapPromise; - const obj = map.get(filepath); - if (!obj) - throw new Error(`No obj for ${filepath}`); - const oid = obj.oid; - if (!oid) - throw new Error(`No oid for obj ${JSON.stringify(obj)}`); - if (obj.type !== "tree") { - return null; - } - const { type, object } = await _readObject({ fs, cache, gitdir, oid }); - if (type !== obj.type) { - throw new ObjectTypeError(oid, type, obj.type); - } - const tree = GitTree.from(object); - for (const entry2 of tree) { - map.set(join(filepath, entry2.path), entry2); - } - return tree.entries().map((entry2) => join(filepath, entry2.path)); - } - async type(entry) { - if (entry._type === false) { - const map = await this.mapPromise; - const { type } = map.get(entry._fullpath); - entry._type = type; - } - return entry._type; - } - async mode(entry) { - if (entry._mode === false) { - const map = await this.mapPromise; - const { mode } = map.get(entry._fullpath); - entry._mode = normalizeMode(parseInt(mode, 8)); - } - return entry._mode; - } - async stat(_entry) { - } - async content(entry) { - if (entry._content === false) { - const map = await this.mapPromise; - const { fs, cache, gitdir } = this; - const obj = map.get(entry._fullpath); - const oid = obj.oid; - const { type, object } = await _readObject({ fs, cache, gitdir, oid }); - if (type !== "blob") { - entry._content = void 0; - } else { - entry._content = new Uint8Array(object); - } - } - return entry._content; - } - async oid(entry) { - if (entry._oid === false) { - const map = await this.mapPromise; - const obj = map.get(entry._fullpath); - entry._oid = obj.oid; - } - return entry._oid; - } -}; -function TREE({ ref = "HEAD" } = {}) { - const o = /* @__PURE__ */ Object.create(null); - Object.defineProperty(o, GitWalkSymbol, { - value: function({ fs, gitdir, cache }) { - return new GitWalkerRepo({ fs, gitdir, ref, cache }); - } - }); - Object.freeze(o); - return o; -} -var GitWalkerFs = class { - constructor({ fs, dir, gitdir, cache }) { - this.fs = fs; - this.cache = cache; - this.dir = dir; - this.gitdir = gitdir; - const walker = this; - this.ConstructEntry = class WorkdirEntry { - constructor(fullpath) { - this._fullpath = fullpath; - this._type = false; - this._mode = false; - this._stat = false; - this._content = false; - this._oid = false; - } - async type() { - return walker.type(this); - } - async mode() { - return walker.mode(this); - } - async stat() { - return walker.stat(this); - } - async content() { - return walker.content(this); - } - async oid() { - return walker.oid(this); - } - }; - } - async readdir(entry) { - const filepath = entry._fullpath; - const { fs, dir } = this; - const names = await fs.readdir(join(dir, filepath)); - if (names === null) - return null; - return names.map((name) => join(filepath, name)); - } - async type(entry) { - if (entry._type === false) { - await entry.stat(); - } - return entry._type; - } - async mode(entry) { - if (entry._mode === false) { - await entry.stat(); - } - return entry._mode; - } - async stat(entry) { - if (entry._stat === false) { - const { fs, dir } = this; - let stat = await fs.lstat(`${dir}/${entry._fullpath}`); - if (!stat) { - throw new Error( - `ENOENT: no such file or directory, lstat '${entry._fullpath}'` - ); - } - let type = stat.isDirectory() ? "tree" : "blob"; - if (type === "blob" && !stat.isFile() && !stat.isSymbolicLink()) { - type = "special"; - } - entry._type = type; - stat = normalizeStats(stat); - entry._mode = stat.mode; - if (stat.size === -1 && entry._actualSize) { - stat.size = entry._actualSize; - } - entry._stat = stat; - } - return entry._stat; - } - async content(entry) { - if (entry._content === false) { - const { fs, dir } = this; - if (await entry.type() === "tree") { - entry._content = void 0; - } else { - const content = await fs.read(`${dir}/${entry._fullpath}`); - entry._actualSize = content.length; - if (entry._stat && entry._stat.size === -1) { - entry._stat.size = entry._actualSize; - } - entry._content = new Uint8Array(content); - } - } - return entry._content; - } - async oid(entry) { - if (entry._oid === false) { - const { fs, gitdir, cache } = this; - let oid; - await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - const stage = index2.entriesMap.get(entry._fullpath); - const stats = await entry.stat(); - if (!stage || compareStats(stats, stage)) { - const content = await entry.content(); - if (content === void 0) { - oid = void 0; - } else { - oid = await shasum( - GitObject.wrap({ type: "blob", object: await entry.content() }) - ); - if (stage && oid === stage.oid && stats.mode === stage.mode && compareStats(stats, stage)) { - index2.insert({ - filepath: entry._fullpath, - stats, - oid - }); - } - } - } else { - oid = stage.oid; - } - }); - entry._oid = oid; - } - return entry._oid; - } -}; -function WORKDIR() { - const o = /* @__PURE__ */ Object.create(null); - Object.defineProperty(o, GitWalkSymbol, { - value: function({ fs, dir, gitdir, cache }) { - return new GitWalkerFs({ fs, dir, gitdir, cache }); - } - }); - Object.freeze(o); - return o; -} -function arrayRange(start, end) { - const length = end - start; - return Array.from({ length }, (_, i) => start + i); -} -var flat = typeof Array.prototype.flat === "undefined" ? (entries) => entries.reduce((acc, x) => acc.concat(x), []) : (entries) => entries.flat(); -var RunningMinimum = class { - constructor() { - this.value = null; - } - consider(value) { - if (value === null || value === void 0) - return; - if (this.value === null) { - this.value = value; - } else if (value < this.value) { - this.value = value; - } - } - reset() { - this.value = null; - } -}; -function* unionOfIterators(sets) { - const min = new RunningMinimum(); - let minimum; - const heads = []; - const numsets = sets.length; - for (let i = 0; i < numsets; i++) { - heads[i] = sets[i].next().value; - if (heads[i] !== void 0) { - min.consider(heads[i]); - } - } - if (min.value === null) - return; - while (true) { - const result = []; - minimum = min.value; - min.reset(); - for (let i = 0; i < numsets; i++) { - if (heads[i] !== void 0 && heads[i] === minimum) { - result[i] = heads[i]; - heads[i] = sets[i].next().value; - } else { - result[i] = null; - } - if (heads[i] !== void 0) { - min.consider(heads[i]); - } - } - yield result; - if (min.value === null) - return; - } -} -async function _walk({ - fs, - cache, - dir, - gitdir, - trees, - // @ts-ignore - map = async (_, entry) => entry, - // The default reducer is a flatmap that filters out undefineds. - reduce = async (parent, children2) => { - const flatten = flat(children2); - if (parent !== void 0) - flatten.unshift(parent); - return flatten; - }, - // The default iterate function walks all children concurrently - iterate = (walk2, children2) => Promise.all([...children2].map(walk2)) -}) { - const walkers = trees.map( - (proxy) => proxy[GitWalkSymbol]({ fs, dir, gitdir, cache }) - ); - const root2 = new Array(walkers.length).fill("."); - const range = arrayRange(0, walkers.length); - const unionWalkerFromReaddir = async (entries) => { - range.map((i) => { - entries[i] = entries[i] && new walkers[i].ConstructEntry(entries[i]); - }); - const subdirs = await Promise.all( - range.map((i) => entries[i] ? walkers[i].readdir(entries[i]) : []) - ); - const iterators = subdirs.map((array) => array === null ? [] : array).map((array) => array[Symbol.iterator]()); - return { - entries, - children: unionOfIterators(iterators) - }; - }; - const walk2 = async (root3) => { - const { entries, children: children2 } = await unionWalkerFromReaddir(root3); - const fullpath = entries.find((entry) => entry && entry._fullpath)._fullpath; - const parent = await map(fullpath, entries); - if (parent !== null) { - let walkedChildren = await iterate(walk2, children2); - walkedChildren = walkedChildren.filter((x) => x !== void 0); - return reduce(parent, walkedChildren); - } - }; - return walk2(root2); -} -async function rmRecursive(fs, filepath) { - const entries = await fs.readdir(filepath); - if (entries == null) { - await fs.rm(filepath); - } else if (entries.length) { - await Promise.all( - entries.map((entry) => { - const subpath = join(filepath, entry); - return fs.lstat(subpath).then((stat) => { - if (!stat) - return; - return stat.isDirectory() ? rmRecursive(fs, subpath) : fs.rm(subpath); - }); - }) - ).then(() => fs.rmdir(filepath)); - } else { - await fs.rmdir(filepath); - } -} -function isPromiseLike(obj) { - return isObject(obj) && isFunction(obj.then) && isFunction(obj.catch); -} -function isObject(obj) { - return obj && typeof obj === "object"; -} -function isFunction(obj) { - return typeof obj === "function"; -} -function isPromiseFs(fs) { - const test = (targetFs) => { - try { - return targetFs.readFile().catch((e) => e); - } catch (e) { - return e; - } - }; - return isPromiseLike(test(fs)); -} -var commands = [ - "readFile", - "writeFile", - "mkdir", - "rmdir", - "unlink", - "stat", - "lstat", - "readdir", - "readlink", - "symlink" -]; -function bindFs(target, fs) { - if (isPromiseFs(fs)) { - for (const command of commands) { - target[`_${command}`] = fs[command].bind(fs); - } - } else { - for (const command of commands) { - target[`_${command}`] = (0, import_pify.default)(fs[command].bind(fs)); - } - } - if (isPromiseFs(fs)) { - if (fs.rm) - target._rm = fs.rm.bind(fs); - else if (fs.rmdir.length > 1) - target._rm = fs.rmdir.bind(fs); - else - target._rm = rmRecursive.bind(null, target); - } else { - if (fs.rm) - target._rm = (0, import_pify.default)(fs.rm.bind(fs)); - else if (fs.rmdir.length > 2) - target._rm = (0, import_pify.default)(fs.rmdir.bind(fs)); - else - target._rm = rmRecursive.bind(null, target); - } -} -var FileSystem = class { - constructor(fs) { - if (typeof fs._original_unwrapped_fs !== "undefined") - return fs; - const promises = Object.getOwnPropertyDescriptor(fs, "promises"); - if (promises && promises.enumerable) { - bindFs(this, fs.promises); - } else { - bindFs(this, fs); - } - this._original_unwrapped_fs = fs; - } - /** - * Return true if a file exists, false if it doesn't exist. - * Rethrows errors that aren't related to file existance. - */ - async exists(filepath, options = {}) { - try { - await this._stat(filepath); - return true; - } catch (err) { - if (err.code === "ENOENT" || err.code === "ENOTDIR") { - return false; - } else { - console.log('Unhandled error in "FileSystem.exists()" function', err); - throw err; - } - } - } - /** - * Return the contents of a file if it exists, otherwise returns null. - * - * @param {string} filepath - * @param {object} [options] - * - * @returns {Promise} - */ - async read(filepath, options = {}) { - try { - let buffer2 = await this._readFile(filepath, options); - if (typeof buffer2 !== "string") { - buffer2 = Buffer.from(buffer2); - } - return buffer2; - } catch (err) { - return null; - } - } - /** - * Write a file (creating missing directories if need be) without throwing errors. - * - * @param {string} filepath - * @param {Buffer|Uint8Array|string} contents - * @param {object|string} [options] - */ - async write(filepath, contents, options = {}) { - try { - await this._writeFile(filepath, contents, options); - return; - } catch (err) { - await this.mkdir(dirname(filepath)); - await this._writeFile(filepath, contents, options); - } - } - /** - * Make a directory (or series of nested directories) without throwing an error if it already exists. - */ - async mkdir(filepath, _selfCall = false) { - try { - await this._mkdir(filepath); - return; - } catch (err) { - if (err === null) - return; - if (err.code === "EEXIST") - return; - if (_selfCall) - throw err; - if (err.code === "ENOENT") { - const parent = dirname(filepath); - if (parent === "." || parent === "/" || parent === filepath) - throw err; - await this.mkdir(parent); - await this.mkdir(filepath, true); - } - } - } - /** - * Delete a file without throwing an error if it is already deleted. - */ - async rm(filepath) { - try { - await this._unlink(filepath); - } catch (err) { - if (err.code !== "ENOENT") - throw err; - } - } - /** - * Delete a directory without throwing an error if it is already deleted. - */ - async rmdir(filepath, opts) { - try { - if (opts && opts.recursive) { - await this._rm(filepath, opts); - } else { - await this._rmdir(filepath); - } - } catch (err) { - if (err.code !== "ENOENT") - throw err; - } - } - /** - * Read a directory without throwing an error is the directory doesn't exist - */ - async readdir(filepath) { - try { - const names = await this._readdir(filepath); - names.sort(compareStrings); - return names; - } catch (err) { - if (err.code === "ENOTDIR") - return null; - return []; - } - } - /** - * Return a flast list of all the files nested inside a directory - * - * Based on an elegant concurrent recursive solution from SO - * https://stackoverflow.com/a/45130990/2168416 - */ - async readdirDeep(dir) { - const subdirs = await this._readdir(dir); - const files = await Promise.all( - subdirs.map(async (subdir) => { - const res = dir + "/" + subdir; - return (await this._stat(res)).isDirectory() ? this.readdirDeep(res) : res; - }) - ); - return files.reduce((a, f) => a.concat(f), []); - } - /** - * Return the Stats of a file/symlink if it exists, otherwise returns null. - * Rethrows errors that aren't related to file existance. - */ - async lstat(filename) { - try { - const stats = await this._lstat(filename); - return stats; - } catch (err) { - if (err.code === "ENOENT") { - return null; - } - throw err; - } - } - /** - * Reads the contents of a symlink if it exists, otherwise returns null. - * Rethrows errors that aren't related to file existance. - */ - async readlink(filename, opts = { encoding: "buffer" }) { - try { - const link = await this._readlink(filename, opts); - return Buffer.isBuffer(link) ? link : Buffer.from(link); - } catch (err) { - if (err.code === "ENOENT") { - return null; - } - throw err; - } - } - /** - * Write the contents of buffer to a symlink. - */ - async writelink(filename, buffer2) { - return this._symlink(buffer2.toString("utf8"), filename); - } -}; -function assertParameter(name, value) { - if (value === void 0) { - throw new MissingParameterError(name); - } -} -async function modified(entry, base) { - if (!entry && !base) - return false; - if (entry && !base) - return true; - if (!entry && base) - return true; - if (await entry.type() === "tree" && await base.type() === "tree") { - return false; - } - if (await entry.type() === await base.type() && await entry.mode() === await base.mode() && await entry.oid() === await base.oid()) { - return false; - } - return true; -} -async function abortMerge({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - commit: commit2 = "HEAD", - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("dir", dir); - assertParameter("gitdir", gitdir); - const fs = new FileSystem(_fs); - const trees = [TREE({ ref: commit2 }), WORKDIR(), STAGE()]; - let unmergedPaths = []; - await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - unmergedPaths = index2.unmergedPaths; - }); - const results = await _walk({ - fs, - cache, - dir, - gitdir, - trees, - map: async function(path2, [head, workdir, index2]) { - const staged = !await modified(workdir, index2); - const unmerged = unmergedPaths.includes(path2); - const unmodified = !await modified(index2, head); - if (staged || unmerged) { - return head ? { - path: path2, - mode: await head.mode(), - oid: await head.oid(), - type: await head.type(), - content: await head.content() - } : void 0; - } - if (unmodified) - return false; - else - throw new IndexResetError(path2); - } - }); - await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - for (const entry of results) { - if (entry === false) - continue; - if (!entry) { - await fs.rmdir(`${dir}/${entry.path}`, { recursive: true }); - index2.delete({ filepath: entry.path }); - continue; - } - if (entry.type === "blob") { - const content = new TextDecoder().decode(entry.content); - await fs.write(`${dir}/${entry.path}`, content, { mode: entry.mode }); - index2.insert({ - filepath: entry.path, - oid: entry.oid, - stage: 0 - }); - } - } - }); - } catch (err) { - err.caller = "git.abortMerge"; - throw err; - } -} -var GitIgnoreManager = class { - static async isIgnored({ fs, dir, gitdir = join(dir, ".git"), filepath }) { - if (basename(filepath) === ".git") - return true; - if (filepath === ".") - return false; - let excludes = ""; - const excludesFile = join(gitdir, "info", "exclude"); - if (await fs.exists(excludesFile)) { - excludes = await fs.read(excludesFile, "utf8"); - } - const pairs = [ - { - gitignore: join(dir, ".gitignore"), - filepath - } - ]; - const pieces = filepath.split("/").filter(Boolean); - for (let i = 1; i < pieces.length; i++) { - const folder = pieces.slice(0, i).join("/"); - const file = pieces.slice(i).join("/"); - pairs.push({ - gitignore: join(dir, folder, ".gitignore"), - filepath: file - }); - } - let ignoredStatus = false; - for (const p of pairs) { - let file; - try { - file = await fs.read(p.gitignore, "utf8"); - } catch (err) { - if (err.code === "NOENT") - continue; - } - const ign = (0, import_ignore.default)().add(excludes); - ign.add(file); - const parentdir = dirname(p.filepath); - if (parentdir !== "." && ign.ignores(parentdir)) - return true; - if (ignoredStatus) { - ignoredStatus = !ign.test(p.filepath).unignored; - } else { - ignoredStatus = ign.test(p.filepath).ignored; - } - } - return ignoredStatus; - } -}; -async function writeObjectLoose({ fs, gitdir, object, format, oid }) { - if (format !== "deflated") { - throw new InternalError( - "GitObjectStoreLoose expects objects to write to be in deflated format" - ); - } - const source = `objects/${oid.slice(0, 2)}/${oid.slice(2)}`; - const filepath = `${gitdir}/${source}`; - if (!await fs.exists(filepath)) - await fs.write(filepath, object); -} -var supportsCompressionStream = null; -async function deflate(buffer2) { - if (supportsCompressionStream === null) { - supportsCompressionStream = testCompressionStream(); - } - return supportsCompressionStream ? browserDeflate(buffer2) : import_pako.default.deflate(buffer2); -} -async function browserDeflate(buffer2) { - const cs = new CompressionStream("deflate"); - const c = new Blob([buffer2]).stream().pipeThrough(cs); - return new Uint8Array(await new Response(c).arrayBuffer()); -} -function testCompressionStream() { - try { - const cs = new CompressionStream("deflate"); - new Blob([]).stream(); - if (cs) - return true; - } catch (_) { - } - return false; -} -async function _writeObject({ - fs, - gitdir, - type, - object, - format = "content", - oid = void 0, - dryRun = false -}) { - if (format !== "deflated") { - if (format !== "wrapped") { - object = GitObject.wrap({ type, object }); - } - oid = await shasum(object); - object = Buffer.from(await deflate(object)); - } - if (!dryRun) { - await writeObjectLoose({ fs, gitdir, object, format: "deflated", oid }); - } - return oid; -} -function posixifyPathBuffer(buffer2) { - let idx; - while (~(idx = buffer2.indexOf(92))) - buffer2[idx] = 47; - return buffer2; -} -async function add({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - filepath, - cache = {}, - force = false, - parallel = true -}) { - try { - assertParameter("fs", _fs); - assertParameter("dir", dir); - assertParameter("gitdir", gitdir); - assertParameter("filepath", filepath); - const fs = new FileSystem(_fs); - await GitIndexManager.acquire({ fs, gitdir, cache }, async (index2) => { - return addToIndex({ - dir, - gitdir, - fs, - filepath, - index: index2, - force, - parallel - }); - }); - } catch (err) { - err.caller = "git.add"; - throw err; - } -} -async function addToIndex({ - dir, - gitdir, - fs, - filepath, - index: index2, - force, - parallel -}) { - filepath = Array.isArray(filepath) ? filepath : [filepath]; - const promises = filepath.map(async (currentFilepath) => { - if (!force) { - const ignored = await GitIgnoreManager.isIgnored({ - fs, - dir, - gitdir, - filepath: currentFilepath - }); - if (ignored) - return; - } - const stats = await fs.lstat(join(dir, currentFilepath)); - if (!stats) - throw new NotFoundError(currentFilepath); - if (stats.isDirectory()) { - const children2 = await fs.readdir(join(dir, currentFilepath)); - if (parallel) { - const promises2 = children2.map( - (child) => addToIndex({ - dir, - gitdir, - fs, - filepath: [join(currentFilepath, child)], - index: index2, - force, - parallel - }) - ); - await Promise.all(promises2); - } else { - for (const child of children2) { - await addToIndex({ - dir, - gitdir, - fs, - filepath: [join(currentFilepath, child)], - index: index2, - force, - parallel - }); - } - } - } else { - const object = stats.isSymbolicLink() ? await fs.readlink(join(dir, currentFilepath)).then(posixifyPathBuffer) : await fs.read(join(dir, currentFilepath)); - if (object === null) - throw new NotFoundError(currentFilepath); - const oid = await _writeObject({ fs, gitdir, type: "blob", object }); - index2.insert({ filepath: currentFilepath, stats, oid }); - } - }); - const settledPromises = await Promise.allSettled(promises); - const rejectedPromises = settledPromises.filter((settle) => settle.status === "rejected").map((settle) => settle.reason); - if (rejectedPromises.length > 1) { - throw new MultipleGitError(rejectedPromises); - } - if (rejectedPromises.length === 1) { - throw rejectedPromises[0]; - } - const fulfilledPromises = settledPromises.filter((settle) => settle.status === "fulfilled" && settle.value).map((settle) => settle.value); - return fulfilledPromises; -} -async function _commit({ - fs, - cache, - onSign, - gitdir, - message, - author, - committer, - signingKey, - dryRun = false, - noUpdateBranch = false, - ref, - parent, - tree -}) { - if (!ref) { - ref = await GitRefManager.resolve({ - fs, - gitdir, - ref: "HEAD", - depth: 2 - }); - } - return GitIndexManager.acquire( - { fs, gitdir, cache, allowUnmerged: false }, - async function(index2) { - const inodes = flatFileListToDirectoryStructure(index2.entries); - const inode = inodes.get("."); - if (!tree) { - tree = await constructTree({ fs, gitdir, inode, dryRun }); - } - if (!parent) { - try { - parent = [ - await GitRefManager.resolve({ - fs, - gitdir, - ref - }) - ]; - } catch (err) { - parent = []; - } - } else { - parent = await Promise.all( - parent.map((p) => { - return GitRefManager.resolve({ fs, gitdir, ref: p }); - }) - ); - } - let comm = GitCommit.from({ - tree, - parent, - author, - committer, - message - }); - if (signingKey) { - comm = await GitCommit.sign(comm, onSign, signingKey); - } - const oid = await _writeObject({ - fs, - gitdir, - type: "commit", - object: comm.toObject(), - dryRun - }); - if (!noUpdateBranch && !dryRun) { - await GitRefManager.writeRef({ - fs, - gitdir, - ref, - value: oid - }); - } - return oid; - } - ); -} -async function constructTree({ fs, gitdir, inode, dryRun }) { - const children2 = inode.children; - for (const inode2 of children2) { - if (inode2.type === "tree") { - inode2.metadata.mode = "040000"; - inode2.metadata.oid = await constructTree({ fs, gitdir, inode: inode2, dryRun }); - } - } - const entries = children2.map((inode2) => ({ - mode: inode2.metadata.mode, - path: inode2.basename, - oid: inode2.metadata.oid, - type: inode2.type - })); - const tree = GitTree.from(entries); - const oid = await _writeObject({ - fs, - gitdir, - type: "tree", - object: tree.toObject(), - dryRun - }); - return oid; -} -async function resolveFilepath({ fs, cache, gitdir, oid, filepath }) { - if (filepath.startsWith("/")) { - throw new InvalidFilepathError("leading-slash"); - } else if (filepath.endsWith("/")) { - throw new InvalidFilepathError("trailing-slash"); - } - const _oid = oid; - const result = await resolveTree({ fs, cache, gitdir, oid }); - const tree = result.tree; - if (filepath === "") { - oid = result.oid; - } else { - const pathArray = filepath.split("/"); - oid = await _resolveFilepath({ - fs, - cache, - gitdir, - tree, - pathArray, - oid: _oid, - filepath - }); - } - return oid; -} -async function _resolveFilepath({ - fs, - cache, - gitdir, - tree, - pathArray, - oid, - filepath -}) { - const name = pathArray.shift(); - for (const entry of tree) { - if (entry.path === name) { - if (pathArray.length === 0) { - return entry.oid; - } else { - const { type, object } = await _readObject({ - fs, - cache, - gitdir, - oid: entry.oid - }); - if (type !== "tree") { - throw new ObjectTypeError(oid, type, "tree", filepath); - } - tree = GitTree.from(object); - return _resolveFilepath({ - fs, - cache, - gitdir, - tree, - pathArray, - oid, - filepath - }); - } - } - } - throw new NotFoundError(`file or directory found at "${oid}:${filepath}"`); -} -async function _readTree({ - fs, - cache, - gitdir, - oid, - filepath = void 0 -}) { - if (filepath !== void 0) { - oid = await resolveFilepath({ fs, cache, gitdir, oid, filepath }); - } - const { tree, oid: treeOid } = await resolveTree({ fs, cache, gitdir, oid }); - const result = { - oid: treeOid, - tree: tree.entries() - }; - return result; -} -async function _writeTree({ fs, gitdir, tree }) { - const object = GitTree.from(tree).toObject(); - const oid = await _writeObject({ - fs, - gitdir, - type: "tree", - object, - format: "content" - }); - return oid; -} -async function _addNote({ - fs, - cache, - onSign, - gitdir, - ref, - oid, - note, - force, - author, - committer, - signingKey -}) { - let parent; - try { - parent = await GitRefManager.resolve({ gitdir, fs, ref }); - } catch (err) { - if (!(err instanceof NotFoundError)) { - throw err; - } - } - const result = await _readTree({ - fs, - cache, - gitdir, - oid: parent || "4b825dc642cb6eb9a060e54bf8d69288fbee4904" - }); - let tree = result.tree; - if (force) { - tree = tree.filter((entry) => entry.path !== oid); - } else { - for (const entry of tree) { - if (entry.path === oid) { - throw new AlreadyExistsError("note", oid); - } - } - } - if (typeof note === "string") { - note = Buffer.from(note, "utf8"); - } - const noteOid = await _writeObject({ - fs, - gitdir, - type: "blob", - object: note, - format: "content" - }); - tree.push({ mode: "100644", path: oid, oid: noteOid, type: "blob" }); - const treeOid = await _writeTree({ - fs, - gitdir, - tree - }); - const commitOid = await _commit({ - fs, - cache, - onSign, - gitdir, - ref, - tree: treeOid, - parent: parent && [parent], - message: `Note added by 'isomorphic-git addNote' -`, - author, - committer, - signingKey - }); - return commitOid; -} -async function _getConfig({ fs, gitdir, path: path2 }) { - const config = await GitConfigManager.get({ fs, gitdir }); - return config.get(path2); -} -async function normalizeAuthorObject({ fs, gitdir, author = {} }) { - let { name, email, timestamp, timezoneOffset } = author; - name = name || await _getConfig({ fs, gitdir, path: "user.name" }); - email = email || await _getConfig({ fs, gitdir, path: "user.email" }) || ""; - if (name === void 0) { - return void 0; - } - timestamp = timestamp != null ? timestamp : Math.floor(Date.now() / 1e3); - timezoneOffset = timezoneOffset != null ? timezoneOffset : new Date(timestamp * 1e3).getTimezoneOffset(); - return { name, email, timestamp, timezoneOffset }; -} -async function normalizeCommitterObject({ - fs, - gitdir, - author, - committer -}) { - committer = Object.assign({}, committer || author); - if (author) { - committer.timestamp = committer.timestamp || author.timestamp; - committer.timezoneOffset = committer.timezoneOffset || author.timezoneOffset; - } - committer = await normalizeAuthorObject({ fs, gitdir, author: committer }); - return committer; -} -async function addNote({ - fs: _fs, - onSign, - dir, - gitdir = join(dir, ".git"), - ref = "refs/notes/commits", - oid, - note, - force, - author: _author, - committer: _committer, - signingKey, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - assertParameter("note", note); - if (signingKey) { - assertParameter("onSign", onSign); - } - const fs = new FileSystem(_fs); - const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); - if (!author) - throw new MissingNameError("author"); - const committer = await normalizeCommitterObject({ - fs, - gitdir, - author, - committer: _committer - }); - if (!committer) - throw new MissingNameError("committer"); - return await _addNote({ - fs: new FileSystem(fs), - cache, - onSign, - gitdir, - ref, - oid, - note, - force, - author, - committer, - signingKey - }); - } catch (err) { - err.caller = "git.addNote"; - throw err; - } -} -async function _addRemote({ fs, gitdir, remote, url, force }) { - if (remote !== import_clean_git_ref.default.clean(remote)) { - throw new InvalidRefNameError(remote, import_clean_git_ref.default.clean(remote)); - } - const config = await GitConfigManager.get({ fs, gitdir }); - if (!force) { - const remoteNames = await config.getSubsections("remote"); - if (remoteNames.includes(remote)) { - if (url !== await config.get(`remote.${remote}.url`)) { - throw new AlreadyExistsError("remote", remote); - } - } - } - await config.set(`remote.${remote}.url`, url); - await config.set( - `remote.${remote}.fetch`, - `+refs/heads/*:refs/remotes/${remote}/*` - ); - await GitConfigManager.save({ fs, gitdir, config }); -} -async function addRemote({ - fs, - dir, - gitdir = join(dir, ".git"), - remote, - url, - force = false -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("remote", remote); - assertParameter("url", url); - return await _addRemote({ - fs: new FileSystem(fs), - gitdir, - remote, - url, - force - }); - } catch (err) { - err.caller = "git.addRemote"; - throw err; - } -} -async function _annotatedTag({ - fs, - cache, - onSign, - gitdir, - ref, - tagger, - message = ref, - gpgsig, - object, - signingKey, - force = false -}) { - ref = ref.startsWith("refs/tags/") ? ref : `refs/tags/${ref}`; - if (!force && await GitRefManager.exists({ fs, gitdir, ref })) { - throw new AlreadyExistsError("tag", ref); - } - const oid = await GitRefManager.resolve({ - fs, - gitdir, - ref: object || "HEAD" - }); - const { type } = await _readObject({ fs, cache, gitdir, oid }); - let tagObject = GitAnnotatedTag.from({ - object: oid, - type, - tag: ref.replace("refs/tags/", ""), - tagger, - message, - gpgsig - }); - if (signingKey) { - tagObject = await GitAnnotatedTag.sign(tagObject, onSign, signingKey); - } - const value = await _writeObject({ - fs, - gitdir, - type: "tag", - object: tagObject.toObject() - }); - await GitRefManager.writeRef({ fs, gitdir, ref, value }); -} -async function annotatedTag({ - fs: _fs, - onSign, - dir, - gitdir = join(dir, ".git"), - ref, - tagger: _tagger, - message = ref, - gpgsig, - object, - signingKey, - force = false, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - if (signingKey) { - assertParameter("onSign", onSign); - } - const fs = new FileSystem(_fs); - const tagger = await normalizeAuthorObject({ fs, gitdir, author: _tagger }); - if (!tagger) - throw new MissingNameError("tagger"); - return await _annotatedTag({ - fs, - cache, - onSign, - gitdir, - ref, - tagger, - message, - gpgsig, - object, - signingKey, - force - }); - } catch (err) { - err.caller = "git.annotatedTag"; - throw err; - } -} -async function _branch({ - fs, - gitdir, - ref, - object, - checkout: checkout2 = false, - force = false -}) { - if (ref !== import_clean_git_ref.default.clean(ref)) { - throw new InvalidRefNameError(ref, import_clean_git_ref.default.clean(ref)); - } - const fullref = `refs/heads/${ref}`; - if (!force) { - const exist = await GitRefManager.exists({ fs, gitdir, ref: fullref }); - if (exist) { - throw new AlreadyExistsError("branch", ref, false); - } - } - let oid; - try { - oid = await GitRefManager.resolve({ fs, gitdir, ref: object || "HEAD" }); - } catch (e) { - } - if (oid) { - await GitRefManager.writeRef({ fs, gitdir, ref: fullref, value: oid }); - } - if (checkout2) { - await GitRefManager.writeSymbolicRef({ - fs, - gitdir, - ref: "HEAD", - value: fullref - }); - } -} -async function branch({ - fs, - dir, - gitdir = join(dir, ".git"), - ref, - object, - checkout: checkout2 = false, - force = false -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - return await _branch({ - fs: new FileSystem(fs), - gitdir, - ref, - object, - checkout: checkout2, - force - }); - } catch (err) { - err.caller = "git.branch"; - throw err; - } -} -var worthWalking = (filepath, root2) => { - if (filepath === "." || root2 == null || root2.length === 0 || root2 === ".") { - return true; - } - if (root2.length >= filepath.length) { - return root2.startsWith(filepath); - } else { - return filepath.startsWith(root2); - } -}; -async function _checkout({ - fs, - cache, - onProgress, - dir, - gitdir, - remote, - ref, - filepaths, - noCheckout, - noUpdateHead, - dryRun, - force, - track = true -}) { - let oid; - try { - oid = await GitRefManager.resolve({ fs, gitdir, ref }); - } catch (err) { - if (ref === "HEAD") - throw err; - const remoteRef = `${remote}/${ref}`; - oid = await GitRefManager.resolve({ - fs, - gitdir, - ref: remoteRef - }); - if (track) { - const config = await GitConfigManager.get({ fs, gitdir }); - await config.set(`branch.${ref}.remote`, remote); - await config.set(`branch.${ref}.merge`, `refs/heads/${ref}`); - await GitConfigManager.save({ fs, gitdir, config }); - } - await GitRefManager.writeRef({ - fs, - gitdir, - ref: `refs/heads/${ref}`, - value: oid - }); - } - if (!noCheckout) { - let ops; - try { - ops = await analyze({ - fs, - cache, - onProgress, - dir, - gitdir, - ref, - force, - filepaths - }); - } catch (err) { - if (err instanceof NotFoundError && err.data.what === oid) { - throw new CommitNotFetchedError(ref, oid); - } else { - throw err; - } - } - const conflicts2 = ops.filter(([method2]) => method2 === "conflict").map(([method2, fullpath]) => fullpath); - if (conflicts2.length > 0) { - throw new CheckoutConflictError(conflicts2); - } - const errors = ops.filter(([method2]) => method2 === "error").map(([method2, fullpath]) => fullpath); - if (errors.length > 0) { - throw new InternalError(errors.join(", ")); - } - if (dryRun) { - return; - } - let count = 0; - const total = ops.length; - await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - await Promise.all( - ops.filter( - ([method2]) => method2 === "delete" || method2 === "delete-index" - ).map(async function([method2, fullpath]) { - const filepath = `${dir}/${fullpath}`; - if (method2 === "delete") { - await fs.rm(filepath); - } - index2.delete({ filepath: fullpath }); - if (onProgress) { - await onProgress({ - phase: "Updating workdir", - loaded: ++count, - total - }); - } - }) - ); - }); - await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - for (const [method2, fullpath] of ops) { - if (method2 === "rmdir" || method2 === "rmdir-index") { - const filepath = `${dir}/${fullpath}`; - try { - if (method2 === "rmdir-index") { - index2.delete({ filepath: fullpath }); - } - await fs.rmdir(filepath); - if (onProgress) { - await onProgress({ - phase: "Updating workdir", - loaded: ++count, - total - }); - } - } catch (e) { - if (e.code === "ENOTEMPTY") { - console.log( - `Did not delete ${fullpath} because directory is not empty` - ); - } else { - throw e; - } - } - } - } - }); - await Promise.all( - ops.filter(([method2]) => method2 === "mkdir" || method2 === "mkdir-index").map(async function([_, fullpath]) { - const filepath = `${dir}/${fullpath}`; - await fs.mkdir(filepath); - if (onProgress) { - await onProgress({ - phase: "Updating workdir", - loaded: ++count, - total - }); - } - }) - ); - await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - await Promise.all( - ops.filter( - ([method2]) => method2 === "create" || method2 === "create-index" || method2 === "update" || method2 === "mkdir-index" - ).map(async function([method2, fullpath, oid2, mode, chmod]) { - const filepath = `${dir}/${fullpath}`; - try { - if (method2 !== "create-index" && method2 !== "mkdir-index") { - const { object } = await _readObject({ fs, cache, gitdir, oid: oid2 }); - if (chmod) { - await fs.rm(filepath); - } - if (mode === 33188) { - await fs.write(filepath, object); - } else if (mode === 33261) { - await fs.write(filepath, object, { mode: 511 }); - } else if (mode === 40960) { - await fs.writelink(filepath, object); - } else { - throw new InternalError( - `Invalid mode 0o${mode.toString(8)} detected in blob ${oid2}` - ); - } - } - const stats = await fs.lstat(filepath); - if (mode === 33261) { - stats.mode = 493; - } - if (method2 === "mkdir-index") { - stats.mode = 57344; - } - index2.insert({ - filepath: fullpath, - stats, - oid: oid2 - }); - if (onProgress) { - await onProgress({ - phase: "Updating workdir", - loaded: ++count, - total - }); - } - } catch (e) { - console.log(e); - } - }) - ); - }); - } - if (!noUpdateHead) { - const fullRef = await GitRefManager.expand({ fs, gitdir, ref }); - if (fullRef.startsWith("refs/heads")) { - await GitRefManager.writeSymbolicRef({ - fs, - gitdir, - ref: "HEAD", - value: fullRef - }); - } else { - await GitRefManager.writeRef({ fs, gitdir, ref: "HEAD", value: oid }); - } - } -} -async function analyze({ - fs, - cache, - onProgress, - dir, - gitdir, - ref, - force, - filepaths -}) { - let count = 0; - return _walk({ - fs, - cache, - dir, - gitdir, - trees: [TREE({ ref }), WORKDIR(), STAGE()], - map: async function(fullpath, [commit2, workdir, stage]) { - if (fullpath === ".") - return; - if (filepaths && !filepaths.some((base) => worthWalking(fullpath, base))) { - return null; - } - if (onProgress) { - await onProgress({ phase: "Analyzing workdir", loaded: ++count }); - } - const key2 = [!!stage, !!commit2, !!workdir].map(Number).join(""); - switch (key2) { - case "000": - return; - case "001": - if (force && filepaths && filepaths.includes(fullpath)) { - return ["delete", fullpath]; - } - return; - case "010": { - switch (await commit2.type()) { - case "tree": { - return ["mkdir", fullpath]; - } - case "blob": { - return [ - "create", - fullpath, - await commit2.oid(), - await commit2.mode() - ]; - } - case "commit": { - return [ - "mkdir-index", - fullpath, - await commit2.oid(), - await commit2.mode() - ]; - } - default: { - return [ - "error", - `new entry Unhandled type ${await commit2.type()}` - ]; - } - } - } - case "011": { - switch (`${await commit2.type()}-${await workdir.type()}`) { - case "tree-tree": { - return; - } - case "tree-blob": - case "blob-tree": { - return ["conflict", fullpath]; - } - case "blob-blob": { - if (await commit2.oid() !== await workdir.oid()) { - if (force) { - return [ - "update", - fullpath, - await commit2.oid(), - await commit2.mode(), - await commit2.mode() !== await workdir.mode() - ]; - } else { - return ["conflict", fullpath]; - } - } else { - if (await commit2.mode() !== await workdir.mode()) { - if (force) { - return [ - "update", - fullpath, - await commit2.oid(), - await commit2.mode(), - true - ]; - } else { - return ["conflict", fullpath]; - } - } else { - return [ - "create-index", - fullpath, - await commit2.oid(), - await commit2.mode() - ]; - } - } - } - case "commit-tree": { - return; - } - case "commit-blob": { - return ["conflict", fullpath]; - } - default: { - return ["error", `new entry Unhandled type ${commit2.type}`]; - } - } - } - case "100": { - return ["delete-index", fullpath]; - } - case "101": { - switch (await stage.type()) { - case "tree": { - return ["rmdir", fullpath]; - } - case "blob": { - if (await stage.oid() !== await workdir.oid()) { - if (force) { - return ["delete", fullpath]; - } else { - return ["conflict", fullpath]; - } - } else { - return ["delete", fullpath]; - } - } - case "commit": { - return ["rmdir-index", fullpath]; - } - default: { - return [ - "error", - `delete entry Unhandled type ${await stage.type()}` - ]; - } - } - } - case "110": - case "111": { - switch (`${await stage.type()}-${await commit2.type()}`) { - case "tree-tree": { - return; - } - case "blob-blob": { - if (await stage.oid() === await commit2.oid() && await stage.mode() === await commit2.mode() && !force) { - return; - } - if (workdir) { - if (await workdir.oid() !== await stage.oid() && await workdir.oid() !== await commit2.oid()) { - if (force) { - return [ - "update", - fullpath, - await commit2.oid(), - await commit2.mode(), - await commit2.mode() !== await workdir.mode() - ]; - } else { - return ["conflict", fullpath]; - } - } - } else if (force) { - return [ - "update", - fullpath, - await commit2.oid(), - await commit2.mode(), - await commit2.mode() !== await stage.mode() - ]; - } - if (await commit2.mode() !== await stage.mode()) { - return [ - "update", - fullpath, - await commit2.oid(), - await commit2.mode(), - true - ]; - } - if (await commit2.oid() !== await stage.oid()) { - return [ - "update", - fullpath, - await commit2.oid(), - await commit2.mode(), - false - ]; - } else { - return; - } - } - case "tree-blob": { - return ["update-dir-to-blob", fullpath, await commit2.oid()]; - } - case "blob-tree": { - return ["update-blob-to-tree", fullpath]; - } - case "commit-commit": { - return [ - "mkdir-index", - fullpath, - await commit2.oid(), - await commit2.mode() - ]; - } - default: { - return [ - "error", - `update entry Unhandled type ${await stage.type()}-${await commit2.type()}` - ]; - } - } - } - } - }, - // Modify the default flat mapping - reduce: async function(parent, children2) { - children2 = flat(children2); - if (!parent) { - return children2; - } else if (parent && parent[0] === "rmdir") { - children2.push(parent); - return children2; - } else { - children2.unshift(parent); - return children2; - } - } - }); -} -async function checkout({ - fs, - onProgress, - dir, - gitdir = join(dir, ".git"), - remote = "origin", - ref: _ref, - filepaths, - noCheckout = false, - noUpdateHead = _ref === void 0, - dryRun = false, - force = false, - track = true, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("dir", dir); - assertParameter("gitdir", gitdir); - const ref = _ref || "HEAD"; - return await _checkout({ - fs: new FileSystem(fs), - cache, - onProgress, - dir, - gitdir, - remote, - ref, - filepaths, - noCheckout, - noUpdateHead, - dryRun, - force, - track - }); - } catch (err) { - err.caller = "git.checkout"; - throw err; - } -} -var abbreviateRx = new RegExp("^refs/(heads/|tags/|remotes/)?(.*)"); -function abbreviateRef(ref) { - const match = abbreviateRx.exec(ref); - if (match) { - if (match[1] === "remotes/" && ref.endsWith("/HEAD")) { - return match[2].slice(0, -5); - } else { - return match[2]; - } - } - return ref; -} -async function _currentBranch({ - fs, - gitdir, - fullname = false, - test = false -}) { - const ref = await GitRefManager.resolve({ - fs, - gitdir, - ref: "HEAD", - depth: 2 - }); - if (test) { - try { - await GitRefManager.resolve({ fs, gitdir, ref }); - } catch (_) { - return; - } - } - if (!ref.startsWith("refs/")) - return; - return fullname ? ref : abbreviateRef(ref); -} -function translateSSHtoHTTP(url) { - url = url.replace(/^git@([^:]+):/, "https://$1/"); - url = url.replace(/^ssh:\/\//, "https://"); - return url; -} -function calculateBasicAuthHeader({ username = "", password = "" }) { - return `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`; -} -async function forAwait(iterable, cb) { - const iter = getIterator(iterable); - while (true) { - const { value, done } = await iter.next(); - if (value) - await cb(value); - if (done) - break; - } - if (iter.return) - iter.return(); -} -async function collect(iterable) { - let size = 0; - const buffers = []; - await forAwait(iterable, (value) => { - buffers.push(value); - size += value.byteLength; - }); - const result = new Uint8Array(size); - let nextIndex = 0; - for (const buffer2 of buffers) { - result.set(buffer2, nextIndex); - nextIndex += buffer2.byteLength; - } - return result; -} -function extractAuthFromUrl(url) { - let userpass = url.match(/^https?:\/\/([^/]+)@/); - if (userpass == null) - return { url, auth: {} }; - userpass = userpass[1]; - const [username, password] = userpass.split(":"); - url = url.replace(`${userpass}@`, ""); - return { url, auth: { username, password } }; -} -function padHex(b, n) { - const s = n.toString(16); - return "0".repeat(b - s.length) + s; -} -var GitPktLine = class { - static flush() { - return Buffer.from("0000", "utf8"); - } - static delim() { - return Buffer.from("0001", "utf8"); - } - static encode(line) { - if (typeof line === "string") { - line = Buffer.from(line); - } - const length = line.length + 4; - const hexlength = padHex(4, length); - return Buffer.concat([Buffer.from(hexlength, "utf8"), line]); - } - static streamReader(stream) { - const reader = new StreamReader(stream); - return async function read() { - try { - let length = await reader.read(4); - if (length == null) - return true; - length = parseInt(length.toString("utf8"), 16); - if (length === 0) - return null; - if (length === 1) - return null; - const buffer2 = await reader.read(length - 4); - if (buffer2 == null) - return true; - return buffer2; - } catch (err) { - console.log("error", err); - return true; - } - }; - } -}; -async function parseCapabilitiesV2(read) { - const capabilities2 = {}; - let line; - while (true) { - line = await read(); - if (line === true) - break; - if (line === null) - continue; - line = line.toString("utf8").replace(/\n$/, ""); - const i = line.indexOf("="); - if (i > -1) { - const key2 = line.slice(0, i); - const value = line.slice(i + 1); - capabilities2[key2] = value; - } else { - capabilities2[line] = true; - } - } - return { protocolVersion: 2, capabilities2 }; -} -async function parseRefsAdResponse(stream, { service }) { - const capabilities = /* @__PURE__ */ new Set(); - const refs = /* @__PURE__ */ new Map(); - const symrefs = /* @__PURE__ */ new Map(); - const read = GitPktLine.streamReader(stream); - let lineOne = await read(); - while (lineOne === null) - lineOne = await read(); - if (lineOne === true) - throw new EmptyServerResponseError(); - if (lineOne.includes("version 2")) { - return parseCapabilitiesV2(read); - } - if (lineOne.toString("utf8").replace(/\n$/, "") !== `# service=${service}`) { - throw new ParseError(`# service=${service}\\n`, lineOne.toString("utf8")); - } - let lineTwo = await read(); - while (lineTwo === null) - lineTwo = await read(); - if (lineTwo === true) - return { capabilities, refs, symrefs }; - lineTwo = lineTwo.toString("utf8"); - if (lineTwo.includes("version 2")) { - return parseCapabilitiesV2(read); - } - const [firstRef, capabilitiesLine] = splitAndAssert(lineTwo, "\0", "\\x00"); - capabilitiesLine.split(" ").map((x) => capabilities.add(x)); - const [ref, name] = splitAndAssert(firstRef, " ", " "); - refs.set(name, ref); - while (true) { - const line = await read(); - if (line === true) - break; - if (line !== null) { - const [ref2, name2] = splitAndAssert(line.toString("utf8"), " ", " "); - refs.set(name2, ref2); - } - } - for (const cap of capabilities) { - if (cap.startsWith("symref=")) { - const m = cap.match(/symref=([^:]+):(.*)/); - if (m.length === 3) { - symrefs.set(m[1], m[2]); - } - } - } - return { protocolVersion: 1, capabilities, refs, symrefs }; -} -function splitAndAssert(line, sep2, expected) { - const split = line.trim().split(sep2); - if (split.length !== 2) { - throw new ParseError( - `Two strings separated by '${expected}'`, - line.toString("utf8") - ); - } - return split; -} -var corsProxify = (corsProxy, url) => corsProxy.endsWith("?") ? `${corsProxy}${url}` : `${corsProxy}/${url.replace(/^https?:\/\//, "")}`; -var updateHeaders = (headers, auth) => { - if (auth.username || auth.password) { - headers.Authorization = calculateBasicAuthHeader(auth); - } - if (auth.headers) { - Object.assign(headers, auth.headers); - } -}; -var stringifyBody = async (res) => { - try { - const data = Buffer.from(await collect(res.body)); - const response = data.toString("utf8"); - const preview = response.length < 256 ? response : response.slice(0, 256) + "..."; - return { preview, response, data }; - } catch (e) { - return {}; - } -}; -var GitRemoteHTTP = class { - static async capabilities() { - return ["discover", "connect"]; - } - /** - * @param {Object} args - * @param {HttpClient} args.http - * @param {ProgressCallback} [args.onProgress] - * @param {AuthCallback} [args.onAuth] - * @param {AuthFailureCallback} [args.onAuthFailure] - * @param {AuthSuccessCallback} [args.onAuthSuccess] - * @param {string} [args.corsProxy] - * @param {string} args.service - * @param {string} args.url - * @param {Object} args.headers - * @param {1 | 2} args.protocolVersion - Git Protocol Version - */ - static async discover({ - http, - onProgress, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - service, - url: _origUrl, - headers, - protocolVersion - }) { - let { url, auth } = extractAuthFromUrl(_origUrl); - const proxifiedURL = corsProxy ? corsProxify(corsProxy, url) : url; - if (auth.username || auth.password) { - headers.Authorization = calculateBasicAuthHeader(auth); - } - if (protocolVersion === 2) { - headers["Git-Protocol"] = "version=2"; - } - let res; - let tryAgain; - let providedAuthBefore = false; - do { - res = await http.request({ - onProgress, - method: "GET", - url: `${proxifiedURL}/info/refs?service=${service}`, - headers - }); - tryAgain = false; - if (res.statusCode === 401 || res.statusCode === 203) { - const getAuth = providedAuthBefore ? onAuthFailure : onAuth; - if (getAuth) { - auth = await getAuth(url, { - ...auth, - headers: { ...headers } - }); - if (auth && auth.cancel) { - throw new UserCanceledError(); - } else if (auth) { - updateHeaders(headers, auth); - providedAuthBefore = true; - tryAgain = true; - } - } - } else if (res.statusCode === 200 && providedAuthBefore && onAuthSuccess) { - await onAuthSuccess(url, auth); - } - } while (tryAgain); - if (res.statusCode !== 200) { - const { response } = await stringifyBody(res); - throw new HttpError(res.statusCode, res.statusMessage, response); - } - if (res.headers["content-type"] === `application/x-${service}-advertisement`) { - const remoteHTTP = await parseRefsAdResponse(res.body, { service }); - remoteHTTP.auth = auth; - return remoteHTTP; - } else { - const { preview, response, data } = await stringifyBody(res); - try { - const remoteHTTP = await parseRefsAdResponse([data], { service }); - remoteHTTP.auth = auth; - return remoteHTTP; - } catch (e) { - throw new SmartHttpError(preview, response); - } - } - } - /** - * @param {Object} args - * @param {HttpClient} args.http - * @param {ProgressCallback} [args.onProgress] - * @param {string} [args.corsProxy] - * @param {string} args.service - * @param {string} args.url - * @param {Object} [args.headers] - * @param {any} args.body - * @param {any} args.auth - */ - static async connect({ - http, - onProgress, - corsProxy, - service, - url, - auth, - body, - headers - }) { - const urlAuth = extractAuthFromUrl(url); - if (urlAuth) - url = urlAuth.url; - if (corsProxy) - url = corsProxify(corsProxy, url); - headers["content-type"] = `application/x-${service}-request`; - headers.accept = `application/x-${service}-result`; - updateHeaders(headers, auth); - const res = await http.request({ - onProgress, - method: "POST", - url: `${url}/${service}`, - body, - headers - }); - if (res.statusCode !== 200) { - const { response } = stringifyBody(res); - throw new HttpError(res.statusCode, res.statusMessage, response); - } - return res; - } -}; -function parseRemoteUrl({ url }) { - if (url.startsWith("git@")) { - return { - transport: "ssh", - address: url - }; - } - const matches = url.match(/(\w+)(:\/\/|::)(.*)/); - if (matches === null) - return; - if (matches[2] === "://") { - return { - transport: matches[1], - address: matches[0] - }; - } - if (matches[2] === "::") { - return { - transport: matches[1], - address: matches[3] - }; - } -} -var GitRemoteManager = class { - static getRemoteHelperFor({ url }) { - const remoteHelpers = /* @__PURE__ */ new Map(); - remoteHelpers.set("http", GitRemoteHTTP); - remoteHelpers.set("https", GitRemoteHTTP); - const parts = parseRemoteUrl({ url }); - if (!parts) { - throw new UrlParseError(url); - } - if (remoteHelpers.has(parts.transport)) { - return remoteHelpers.get(parts.transport); - } - throw new UnknownTransportError( - url, - parts.transport, - parts.transport === "ssh" ? translateSSHtoHTTP(url) : void 0 - ); - } -}; -var lock$1 = null; -var GitShallowManager = class { - static async read({ fs, gitdir }) { - if (lock$1 === null) - lock$1 = new import_async_lock.default(); - const filepath = join(gitdir, "shallow"); - const oids = /* @__PURE__ */ new Set(); - await lock$1.acquire(filepath, async function() { - const text2 = await fs.read(filepath, { encoding: "utf8" }); - if (text2 === null) - return oids; - if (text2.trim() === "") - return oids; - text2.trim().split("\n").map((oid) => oids.add(oid)); - }); - return oids; - } - static async write({ fs, gitdir, oids }) { - if (lock$1 === null) - lock$1 = new import_async_lock.default(); - const filepath = join(gitdir, "shallow"); - if (oids.size > 0) { - const text2 = [...oids].join("\n") + "\n"; - await lock$1.acquire(filepath, async function() { - await fs.write(filepath, text2, { - encoding: "utf8" - }); - }); - } else { - await lock$1.acquire(filepath, async function() { - await fs.rm(filepath); - }); - } - } -}; -async function hasObjectLoose({ fs, gitdir, oid }) { - const source = `objects/${oid.slice(0, 2)}/${oid.slice(2)}`; - return fs.exists(`${gitdir}/${source}`); -} -async function hasObjectPacked({ - fs, - cache, - gitdir, - oid, - getExternalRefDelta -}) { - let list = await fs.readdir(join(gitdir, "objects/pack")); - list = list.filter((x) => x.endsWith(".idx")); - for (const filename of list) { - const indexFile = `${gitdir}/objects/pack/${filename}`; - const p = await readPackIndex({ - fs, - cache, - filename: indexFile, - getExternalRefDelta - }); - if (p.error) - throw new InternalError(p.error); - if (p.offsets.has(oid)) { - return true; - } - } - return false; -} -async function hasObject({ - fs, - cache, - gitdir, - oid, - format = "content" -}) { - const getExternalRefDelta = (oid2) => _readObject({ fs, cache, gitdir, oid: oid2 }); - let result = await hasObjectLoose({ fs, gitdir, oid }); - if (!result) { - result = await hasObjectPacked({ - fs, - cache, - gitdir, - oid, - getExternalRefDelta - }); - } - return result; -} -function emptyPackfile(pack) { - const pheader = "5041434b"; - const version2 = "00000002"; - const obCount = "00000000"; - const header = pheader + version2 + obCount; - return pack.slice(0, 12).toString("hex") === header; -} -function filterCapabilities(server, client) { - const serverNames = server.map((cap) => cap.split("=", 1)[0]); - return client.filter((cap) => { - const name = cap.split("=", 1)[0]; - return serverNames.includes(name); - }); -} -var pkg = { - name: "isomorphic-git", - version: "1.24.5", - agent: "git/isomorphic-git@1.24.5" -}; -var FIFO = class { - constructor() { - this._queue = []; - } - write(chunk) { - if (this._ended) { - throw Error("You cannot write to a FIFO that has already been ended!"); - } - if (this._waiting) { - const resolve = this._waiting; - this._waiting = null; - resolve({ value: chunk }); - } else { - this._queue.push(chunk); - } - } - end() { - this._ended = true; - if (this._waiting) { - const resolve = this._waiting; - this._waiting = null; - resolve({ done: true }); - } - } - destroy(err) { - this._ended = true; - this.error = err; - } - async next() { - if (this._queue.length > 0) { - return { value: this._queue.shift() }; - } - if (this._ended) { - return { done: true }; - } - if (this._waiting) { - throw Error( - "You cannot call read until the previous call to read has returned!" - ); - } - return new Promise((resolve) => { - this._waiting = resolve; - }); - } -}; -function findSplit(str) { - const r = str.indexOf("\r"); - const n = str.indexOf("\n"); - if (r === -1 && n === -1) - return -1; - if (r === -1) - return n + 1; - if (n === -1) - return r + 1; - if (n === r + 1) - return n + 1; - return Math.min(r, n) + 1; -} -function splitLines(input) { - const output = new FIFO(); - let tmp = ""; - (async () => { - await forAwait(input, (chunk) => { - chunk = chunk.toString("utf8"); - tmp += chunk; - while (true) { - const i = findSplit(tmp); - if (i === -1) - break; - output.write(tmp.slice(0, i)); - tmp = tmp.slice(i); - } - }); - if (tmp.length > 0) { - output.write(tmp); - } - output.end(); - })(); - return output; -} -var GitSideBand = class { - static demux(input) { - const read = GitPktLine.streamReader(input); - const packetlines = new FIFO(); - const packfile = new FIFO(); - const progress = new FIFO(); - const nextBit = async function() { - const line = await read(); - if (line === null) - return nextBit(); - if (line === true) { - packetlines.end(); - progress.end(); - packfile.end(); - return; - } - switch (line[0]) { - case 1: { - packfile.write(line.slice(1)); - break; - } - case 2: { - progress.write(line.slice(1)); - break; - } - case 3: { - const error = line.slice(1); - progress.write(error); - packfile.destroy(new Error(error.toString("utf8"))); - return; - } - default: { - packetlines.write(line.slice(0)); - } - } - nextBit(); - }; - nextBit(); - return { - packetlines, - packfile, - progress - }; - } - // static mux ({ - // protocol, // 'side-band' or 'side-band-64k' - // packetlines, - // packfile, - // progress, - // error - // }) { - // const MAX_PACKET_LENGTH = protocol === 'side-band-64k' ? 999 : 65519 - // let output = new PassThrough() - // packetlines.on('data', data => { - // if (data === null) { - // output.write(GitPktLine.flush()) - // } else { - // output.write(GitPktLine.encode(data)) - // } - // }) - // let packfileWasEmpty = true - // let packfileEnded = false - // let progressEnded = false - // let errorEnded = false - // let goodbye = Buffer.concat([ - // GitPktLine.encode(Buffer.from('010A', 'hex')), - // GitPktLine.flush() - // ]) - // packfile - // .on('data', data => { - // packfileWasEmpty = false - // const buffers = splitBuffer(data, MAX_PACKET_LENGTH) - // for (const buffer of buffers) { - // output.write( - // GitPktLine.encode(Buffer.concat([Buffer.from('01', 'hex'), buffer])) - // ) - // } - // }) - // .on('end', () => { - // packfileEnded = true - // if (!packfileWasEmpty) output.write(goodbye) - // if (progressEnded && errorEnded) output.end() - // }) - // progress - // .on('data', data => { - // const buffers = splitBuffer(data, MAX_PACKET_LENGTH) - // for (const buffer of buffers) { - // output.write( - // GitPktLine.encode(Buffer.concat([Buffer.from('02', 'hex'), buffer])) - // ) - // } - // }) - // .on('end', () => { - // progressEnded = true - // if (packfileEnded && errorEnded) output.end() - // }) - // error - // .on('data', data => { - // const buffers = splitBuffer(data, MAX_PACKET_LENGTH) - // for (const buffer of buffers) { - // output.write( - // GitPktLine.encode(Buffer.concat([Buffer.from('03', 'hex'), buffer])) - // ) - // } - // }) - // .on('end', () => { - // errorEnded = true - // if (progressEnded && packfileEnded) output.end() - // }) - // return output - // } -}; -async function parseUploadPackResponse(stream) { - const { packetlines, packfile, progress } = GitSideBand.demux(stream); - const shallows = []; - const unshallows = []; - const acks = []; - let nak = false; - let done = false; - return new Promise((resolve, reject) => { - forAwait(packetlines, (data) => { - const line = data.toString("utf8").trim(); - if (line.startsWith("shallow")) { - const oid = line.slice(-41).trim(); - if (oid.length !== 40) { - reject(new InvalidOidError(oid)); - } - shallows.push(oid); - } else if (line.startsWith("unshallow")) { - const oid = line.slice(-41).trim(); - if (oid.length !== 40) { - reject(new InvalidOidError(oid)); - } - unshallows.push(oid); - } else if (line.startsWith("ACK")) { - const [, oid, status2] = line.split(" "); - acks.push({ oid, status: status2 }); - if (!status2) - done = true; - } else if (line.startsWith("NAK")) { - nak = true; - done = true; - } - if (done) { - resolve({ shallows, unshallows, acks, nak, packfile, progress }); - } - }); - }); -} -function writeUploadPackRequest({ - capabilities = [], - wants = [], - haves = [], - shallows = [], - depth = null, - since = null, - exclude = [] -}) { - const packstream = []; - wants = [...new Set(wants)]; - let firstLineCapabilities = ` ${capabilities.join(" ")}`; - for (const oid of wants) { - packstream.push(GitPktLine.encode(`want ${oid}${firstLineCapabilities} -`)); - firstLineCapabilities = ""; - } - for (const oid of shallows) { - packstream.push(GitPktLine.encode(`shallow ${oid} -`)); - } - if (depth !== null) { - packstream.push(GitPktLine.encode(`deepen ${depth} -`)); - } - if (since !== null) { - packstream.push( - GitPktLine.encode(`deepen-since ${Math.floor(since.valueOf() / 1e3)} -`) - ); - } - for (const oid of exclude) { - packstream.push(GitPktLine.encode(`deepen-not ${oid} -`)); - } - packstream.push(GitPktLine.flush()); - for (const oid of haves) { - packstream.push(GitPktLine.encode(`have ${oid} -`)); - } - packstream.push(GitPktLine.encode(`done -`)); - return packstream; -} -async function _fetch({ - fs, - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - gitdir, - ref: _ref, - remoteRef: _remoteRef, - remote: _remote, - url: _url, - corsProxy, - depth = null, - since = null, - exclude = [], - relative: relative2 = false, - tags = false, - singleBranch = false, - headers = {}, - prune = false, - pruneTags = false -}) { - const ref = _ref || await _currentBranch({ fs, gitdir, test: true }); - const config = await GitConfigManager.get({ fs, gitdir }); - const remote = _remote || ref && await config.get(`branch.${ref}.remote`) || "origin"; - const url = _url || await config.get(`remote.${remote}.url`); - if (typeof url === "undefined") { - throw new MissingParameterError("remote OR url"); - } - const remoteRef = _remoteRef || ref && await config.get(`branch.${ref}.merge`) || _ref || "HEAD"; - if (corsProxy === void 0) { - corsProxy = await config.get("http.corsProxy"); - } - const GitRemoteHTTP2 = GitRemoteManager.getRemoteHelperFor({ url }); - const remoteHTTP = await GitRemoteHTTP2.discover({ - http, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - service: "git-upload-pack", - url, - headers, - protocolVersion: 1 - }); - const auth = remoteHTTP.auth; - const remoteRefs = remoteHTTP.refs; - if (remoteRefs.size === 0) { - return { - defaultBranch: null, - fetchHead: null, - fetchHeadDescription: null - }; - } - if (depth !== null && !remoteHTTP.capabilities.has("shallow")) { - throw new RemoteCapabilityError("shallow", "depth"); - } - if (since !== null && !remoteHTTP.capabilities.has("deepen-since")) { - throw new RemoteCapabilityError("deepen-since", "since"); - } - if (exclude.length > 0 && !remoteHTTP.capabilities.has("deepen-not")) { - throw new RemoteCapabilityError("deepen-not", "exclude"); - } - if (relative2 === true && !remoteHTTP.capabilities.has("deepen-relative")) { - throw new RemoteCapabilityError("deepen-relative", "relative"); - } - const { oid, fullref } = GitRefManager.resolveAgainstMap({ - ref: remoteRef, - map: remoteRefs - }); - for (const remoteRef2 of remoteRefs.keys()) { - if (remoteRef2 === fullref || remoteRef2 === "HEAD" || remoteRef2.startsWith("refs/heads/") || tags && remoteRef2.startsWith("refs/tags/")) { - continue; - } - remoteRefs.delete(remoteRef2); - } - const capabilities = filterCapabilities( - [...remoteHTTP.capabilities], - [ - "multi_ack_detailed", - "no-done", - "side-band-64k", - // Note: I removed 'thin-pack' option since our code doesn't "fatten" packfiles, - // which is necessary for compatibility with git. It was the cause of mysterious - // 'fatal: pack has [x] unresolved deltas' errors that plagued us for some time. - // isomorphic-git is perfectly happy with thin packfiles in .git/objects/pack but - // canonical git it turns out is NOT. - "ofs-delta", - `agent=${pkg.agent}` - ] - ); - if (relative2) - capabilities.push("deepen-relative"); - const wants = singleBranch ? [oid] : remoteRefs.values(); - const haveRefs = singleBranch ? [ref] : await GitRefManager.listRefs({ - fs, - gitdir, - filepath: `refs` - }); - let haves = []; - for (let ref2 of haveRefs) { - try { - ref2 = await GitRefManager.expand({ fs, gitdir, ref: ref2 }); - const oid2 = await GitRefManager.resolve({ fs, gitdir, ref: ref2 }); - if (await hasObject({ fs, cache, gitdir, oid: oid2 })) { - haves.push(oid2); - } - } catch (err) { - } - } - haves = [...new Set(haves)]; - const oids = await GitShallowManager.read({ fs, gitdir }); - const shallows = remoteHTTP.capabilities.has("shallow") ? [...oids] : []; - const packstream = writeUploadPackRequest({ - capabilities, - wants, - haves, - shallows, - depth, - since, - exclude - }); - const packbuffer = Buffer.from(await collect(packstream)); - const raw = await GitRemoteHTTP2.connect({ - http, - onProgress, - corsProxy, - service: "git-upload-pack", - url, - auth, - body: [packbuffer], - headers - }); - const response = await parseUploadPackResponse(raw.body); - if (raw.headers) { - response.headers = raw.headers; - } - for (const oid2 of response.shallows) { - if (!oids.has(oid2)) { - try { - const { object } = await _readObject({ fs, cache, gitdir, oid: oid2 }); - const commit2 = new GitCommit(object); - const hasParents = await Promise.all( - commit2.headers().parent.map((oid3) => hasObject({ fs, cache, gitdir, oid: oid3 })) - ); - const haveAllParents = hasParents.length === 0 || hasParents.every((has) => has); - if (!haveAllParents) { - oids.add(oid2); - } - } catch (err) { - oids.add(oid2); - } - } - } - for (const oid2 of response.unshallows) { - oids.delete(oid2); - } - await GitShallowManager.write({ fs, gitdir, oids }); - if (singleBranch) { - const refs = /* @__PURE__ */ new Map([[fullref, oid]]); - const symrefs = /* @__PURE__ */ new Map(); - let bail = 10; - let key2 = fullref; - while (bail--) { - const value = remoteHTTP.symrefs.get(key2); - if (value === void 0) - break; - symrefs.set(key2, value); - key2 = value; - } - const realRef = remoteRefs.get(key2); - if (realRef) { - refs.set(key2, realRef); - } - const { pruned } = await GitRefManager.updateRemoteRefs({ - fs, - gitdir, - remote, - refs, - symrefs, - tags, - prune - }); - if (prune) { - response.pruned = pruned; - } - } else { - const { pruned } = await GitRefManager.updateRemoteRefs({ - fs, - gitdir, - remote, - refs: remoteRefs, - symrefs: remoteHTTP.symrefs, - tags, - prune, - pruneTags - }); - if (prune) { - response.pruned = pruned; - } - } - response.HEAD = remoteHTTP.symrefs.get("HEAD"); - if (response.HEAD === void 0) { - const { oid: oid2 } = GitRefManager.resolveAgainstMap({ - ref: "HEAD", - map: remoteRefs - }); - for (const [key2, value] of remoteRefs.entries()) { - if (key2 !== "HEAD" && value === oid2) { - response.HEAD = key2; - break; - } - } - } - const noun = fullref.startsWith("refs/tags") ? "tag" : "branch"; - response.FETCH_HEAD = { - oid, - description: `${noun} '${abbreviateRef(fullref)}' of ${url}` - }; - if (onProgress || onMessage) { - const lines = splitLines(response.progress); - forAwait(lines, async (line) => { - if (onMessage) - await onMessage(line); - if (onProgress) { - const matches = line.match(/([^:]*).*\((\d+?)\/(\d+?)\)/); - if (matches) { - await onProgress({ - phase: matches[1].trim(), - loaded: parseInt(matches[2], 10), - total: parseInt(matches[3], 10) - }); - } - } - }); - } - const packfile = Buffer.from(await collect(response.packfile)); - const packfileSha = packfile.slice(-20).toString("hex"); - const res = { - defaultBranch: response.HEAD, - fetchHead: response.FETCH_HEAD.oid, - fetchHeadDescription: response.FETCH_HEAD.description - }; - if (response.headers) { - res.headers = response.headers; - } - if (prune) { - res.pruned = response.pruned; - } - if (packfileSha !== "" && !emptyPackfile(packfile)) { - res.packfile = `objects/pack/pack-${packfileSha}.pack`; - const fullpath = join(gitdir, res.packfile); - await fs.write(fullpath, packfile); - const getExternalRefDelta = (oid2) => _readObject({ fs, cache, gitdir, oid: oid2 }); - const idx = await GitPackIndex.fromPack({ - pack: packfile, - getExternalRefDelta, - onProgress - }); - await fs.write(fullpath.replace(/\.pack$/, ".idx"), await idx.toBuffer()); - } - return res; -} -async function _init({ - fs, - bare = false, - dir, - gitdir = bare ? dir : join(dir, ".git"), - defaultBranch = "master" -}) { - if (await fs.exists(gitdir + "/config")) - return; - let folders = [ - "hooks", - "info", - "objects/info", - "objects/pack", - "refs/heads", - "refs/tags" - ]; - folders = folders.map((dir2) => gitdir + "/" + dir2); - for (const folder of folders) { - await fs.mkdir(folder); - } - await fs.write( - gitdir + "/config", - `[core] +${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(` +`),n=[];for(let i of e)i[0]===" "?n[n.length-1]+=` +`+i.slice(1):n.push(i);let r={};for(let i of n){let a=i.slice(0,i.indexOf(" ")),s=i.slice(i.indexOf(" ")+1);Array.isArray(r[a])?r[a].push(s):r[a]=s}return r.tagger&&(r.tagger=$o(r.tagger)),r.committer&&(r.committer=$o(r.committer)),r}withoutSignature(){let e=Hn(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 Hn(e)}payload(){return this.withoutSignature()+` +`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,n,r){let i=e.payload(),{signature:a}=await n({payload:i,secretKey:r});a=Hn(a);let s=i+a;return t.from(s)}};function xf(t){return t.trim().split(` +`).map(e=>" "+e).join(` +`)+` +`}function J5(t){return t.split(` +`).map(e=>e.replace(/^ /,"")).join(` +`)}var Rt=class t{constructor(e){if(typeof e=="string")this._commit=e;else if(Buffer.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=t.render(e);else throw new ue("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:n}){let r=t.justHeaders(e),i=t.justMessage(e),a=Hn(r+` +gpgsig`+xf(n)+` +`+i);return new t(a)}static from(e){return new t(e)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return t.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return Hn(e.slice(e.indexOf(` + +`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(` + +`))}parseHeaders(){let e=t.justHeaders(this._commit).split(` +`),n=[];for(let i of e)i[0]===" "?n[n.length-1]+=` +`+i.slice(1):n.push(i);let r={parent:[]};for(let i of n){let a=i.slice(0,i.indexOf(" ")),s=i.slice(i.indexOf(" ")+1);Array.isArray(r[a])?r[a].push(s):r[a]=s}return r.author&&(r.author=$o(r.author)),r.committer&&(r.committer=$o(r.committer)),r}static renderHeaders(e){let n="";if(e.tree?n+=`tree ${e.tree} +`:n+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +`,e.parent){if(e.parent.length===void 0)throw new ue("commit 'parent' property should be an array");for(let a of e.parent)n+=`parent ${a} +`}let r=e.author;n+=`author ${Pf(r)} +`;let i=e.committer||e.author;return n+=`committer ${Pf(i)} +`,e.gpgsig&&(n+="gpgsig"+xf(e.gpgsig)),n}static render(e){return t.renderHeaders(e)+` +`+Hn(e.message)}render(){return this._commit}withoutSignature(){let e=Hn(this._commit);if(e.indexOf(` +gpgsig`)===-1)return e;let n=e.slice(0,e.indexOf(` +gpgsig`)),r=e.slice(e.indexOf(`-----END PGP SIGNATURE----- +`)+28);return Hn(n+` +`+r)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return J5(e)}static async sign(e,n,r){let i=e.withoutSignature(),a=t.justMessage(e._commit),{signature:s}=await n({payload:i,secretKey:r});s=Hn(s);let l=t.justHeaders(e._commit)+` +gpgsig`+xf(s)+` +`+a;return t.from(l)}};async function Oi({fs:t,cache:e,gitdir:n,oid:r}){if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:It.from([]),oid:r};let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:n,oid:r});if(i==="tag")return r=Ut.from(a).parse().object,Oi({fs:t,cache:e,gitdir:n,oid:r});if(i==="commit")return r=Rt.from(a).parse().tree,Oi({fs:t,cache:e,gitdir:n,oid:r});if(i!=="tree")throw new kt(r,i,"tree");return{tree:It.from(a),oid:r}}var If=class{constructor({fs:e,gitdir:n,ref:r,cache:i}){this.fs=e,this.cache=i,this.gitdir=n,this.mapPromise=(async()=>{let s=new Map,o;try{o=await q.resolve({fs:e,gitdir:n,ref:r})}catch(c){c instanceof Re&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Oi({fs:e,cache:this.cache,gitdir:n,oid:o});return l.type="tree",l.mode="40000",s.set(".",l),s})();let a=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(e){let n=e._fullpath,{fs:r,cache:i,gitdir:a}=this,s=await this.mapPromise,o=s.get(n);if(!o)throw new Error(`No obj for ${n}`);let l=o.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!=="tree")return null;let{type:c,object:u}=await Ge({fs:r,cache:i,gitdir:a,oid:l});if(c!==o.type)throw new kt(l,c,o.type);let f=It.from(u);for(let h of f)s.set(B(n,h.path),h);return f.entries().map(h=>B(n,h.path))}async type(e){if(e._type===!1){let n=await this.mapPromise,{type:r}=n.get(e._fullpath);e._type=r}return e._type}async mode(e){if(e._mode===!1){let n=await this.mapPromise,{mode:r}=n.get(e._fullpath);e._mode=_1(parseInt(r,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let n=await this.mapPromise,{fs:r,cache:i,gitdir:a}=this,o=n.get(e._fullpath).oid,{type:l,object:c}=await Ge({fs:r,cache:i,gitdir:a,oid:o});l!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let r=(await this.mapPromise).get(e._fullpath);e._oid=r.oid}return e._oid}};function sr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,qo,{value:function({fs:n,gitdir:r,cache:i}){return new If({fs:n,gitdir:r,ref:t,cache:i})}}),Object.freeze(e),e}var Rf=class{constructor({fs:e,dir:n,gitdir:r,cache:i}){this.fs=e,this.cache=i,this.dir=n,this.gitdir=r;let a=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(e){let n=e._fullpath,{fs:r,dir:i}=this,a=await r.readdir(B(i,n));return a===null?null:a.map(s=>B(n,s))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:n,dir:r}=this,i=await n.lstat(`${r}/${e._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let a=i.isDirectory()?"tree":"blob";a==="blob"&&!i.isFile()&&!i.isSymbolicLink()&&(a="special"),e._type=a,i=Ei(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:n,dir:r,gitdir:i}=this;if(await e.type()==="tree")e._content=void 0;else{let s=await(await ze.get({fs:n,gitdir:i})).get("core.autocrlf"),o=await n.read(`${r}/${e._fullpath}`,{autocrlf:s});e._actualSize=o.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(o)}}return e._content}async oid(e){if(e._oid===!1){let{fs:n,gitdir:r,cache:i}=this,a;await lt.acquire({fs:n,gitdir:r,cache:i},async function(s){let o=s.entriesMap.get(e._fullpath),l=await e.stat(),u=await(await ze.get({fs:n,gitdir:r})).get("core.filemode"),f=typeof process!="undefined"?process.platform!=="win32":!0;!o||Lo(l,o,u,f)?await e.content()===void 0?a=void 0:(a=await Un(lr.wrap({type:"blob",object:await e.content()})),o&&a===o.oid&&(!u||l.mode===o.mode)&&Lo(l,o,u,f)&&s.insert({filepath:e._fullpath,stats:l,oid:a})):a=o.oid}),e._oid=a}return e._oid}};function Yo(){let t=Object.create(null);return Object.defineProperty(t,qo,{value:function({fs:e,dir:n,gitdir:r,cache:i}){return new Rf({fs:e,dir:n,gitdir:r,cache:i})}}),Object.freeze(t),t}function Q5(t,e){let n=e-t;return Array.from({length:n},(r,i)=>t+i)}var C1=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,n)=>e.concat(n),[]):t=>t.flat(),Lf=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:ec,reduce:s=async(l,c)=>{let u=C1(c);return l!==void 0&&u.unshift(l),u},iterate:o=(l,c)=>Promise.all([...c].map(l))}){let l=i.map(d=>d[qo]({fs:t,dir:n,gitdir:r,cache:e})),c=new Array(l.length).fill("."),u=Q5(0,l.length),f=async d=>{u.map(m=>{d[m]=d[m]&&new l[m].ConstructEntry(d[m])});let g=(await Promise.all(u.map(m=>d[m]?l[m].readdir(d[m]):[]))).map(m=>m===null?[]:m).map(m=>m[Symbol.iterator]());return{entries:d,children:eC(g)}},h=async d=>{let{entries:p,children:g}=await f(d),m=p.find(b=>b&&b._fullpath)._fullpath,w=await a(m,p);if(w!==null){let b=await o(h,g);return b=b.filter(S=>S!==void 0),s(w,b)}};return h(c)}async function jf(t,e){let n=await t.readdir(e);n==null?await t.rm(e):n.length?await Promise.all(n.map(r=>{let i=B(e,r);return t.lstat(i).then(a=>{if(a)return a.isDirectory()?jf(t,i):t.rm(i)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}function tC(t){return nC(t)&&o1(t.then)&&o1(t.catch)}function nC(t){return t&&typeof t=="object"}function o1(t){return typeof t=="function"}function l1(t){return tC((n=>{try{return n.readFile().catch(r=>r)}catch(r){return r}})(t))}var c1=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function u1(t,e){if(l1(e))for(let n of c1)t[`_${n}`]=e[n].bind(e);else for(let n of c1)t[`_${n}`]=(0,Ro.default)(e[n].bind(e));l1(e)?e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=jf.bind(null,t):e.rm?t._rm=(0,Ro.default)(e.rm.bind(e)):e.rmdir.length>2?t._rm=(0,Ro.default)(e.rmdir.bind(e)):t._rm=jf.bind(null,t)}var Q=class{constructor(e){if(typeof e._original_unwrapped_fs!="undefined")return e;let n=Object.getOwnPropertyDescriptor(e,"promises");n&&n.enumerable?u1(this,e.promises):u1(this,e),this._original_unwrapped_fs=e}async exists(e,n={}){try{return await this._stat(e),!0}catch(r){if(r.code==="ENOENT"||r.code==="ENOTDIR")return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',r),r}}async read(e,n={}){try{let r=await this._readFile(e,n);if(n.autocrlf==="true")try{r=new TextDecoder("utf8",{fatal:!0}).decode(r),r=r.replace(/\r\n/g,` +`),r=new TextEncoder().encode(r)}catch(i){}return typeof r!="string"&&(r=Buffer.from(r)),r}catch(r){return null}}async write(e,n,r={}){try{await this._writeFile(e,n,r);return}catch(i){await this.mkdir(ki(e)),await this._writeFile(e,n,r)}}async mkdir(e,n=!1){try{await this._mkdir(e);return}catch(r){if(r===null||r.code==="EEXIST")return;if(n)throw r;if(r.code==="ENOENT"){let i=ki(e);if(i==="."||i==="/"||i===e)throw r;await this.mkdir(i),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(n){if(n.code!=="ENOENT")throw n}}async rmdir(e,n){try{n&&n.recursive?await this._rm(e,n):await this._rmdir(e)}catch(r){if(r.code!=="ENOENT")throw r}}async readdir(e){try{let n=await this._readdir(e);return n.sort(Wo),n}catch(n){return n.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let n=await this._readdir(e);return(await Promise.all(n.map(async i=>{let a=e+"/"+i;return(await this._stat(a)).isDirectory()?this.readdirDeep(a):a}))).reduce((i,a)=>i.concat(a),[])}async lstat(e){try{return await this._lstat(e)}catch(n){if(n.code==="ENOENT")return null;throw n}}async readlink(e,n={encoding:"buffer"}){try{let r=await this._readlink(e,n);return Buffer.isBuffer(r)?r:Buffer.from(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}async writelink(e,n){return this._symlink(n.toString("utf8"),e)}};function F(t,e){if(e===void 0)throw new Pt(t)}async function Ho(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}async function rC({fs:t,dir:e,gitdir:n=B(e,".git"),commit:r="HEAD",cache:i={}}){try{F("fs",t),F("dir",e),F("gitdir",n);let a=new Q(t),s=[sr({ref:r}),Yo(),Xo()],o=[];await lt.acquire({fs:a,gitdir:n,cache:i},async function(c){o=c.unmergedPaths});let l=await Pi({fs:a,cache:i,dir:e,gitdir:n,trees:s,map:async function(c,[u,f,h]){let d=!await Ho(f,h),p=o.includes(c),g=!await Ho(h,u);if(d||p)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(g)return!1;throw new cs(c)}});await lt.acquire({fs:a,gitdir:n,cache:i},async function(c){for(let u of l)if(u!==!1){if(!u){await a.rmdir(`${e}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){let f=new TextDecoder().decode(u.content);await a.write(`${e}/${u.path}`,f,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(a){throw a.caller="git.abortMerge",a}}var Ii=class{static async isIgnored({fs:e,dir:n,gitdir:r=B(n,".git"),filepath:i}){if(jo(i)===".git")return!0;if(i===".")return!1;let a="",s=B(r,"info","exclude");await e.exists(s)&&(a=await e.read(s,"utf8"));let o=[{gitignore:B(n,".gitignore"),filepath:i}],l=i.split("/").filter(Boolean);for(let u=1;uDf({dir:e,gitdir:n,fs:o,filepath:r,index:l,force:a,parallel:s}))}catch(o){throw o.caller="git.add",o}}async function Df({dir:t,gitdir:e,fs:n,filepath:r,index:i,force:a,parallel:s}){r=Array.isArray(r)?r:[r];let o=r.map(async f=>{if(!a&&await Ii.isIgnored({fs:n,dir:t,gitdir:e,filepath:f}))return;let h=await n.lstat(B(t,f));if(!h)throw new Re(f);if(h.isDirectory()){let d=await n.readdir(B(t,f));if(s){let p=d.map(g=>Df({dir:t,gitdir:e,fs:n,filepath:[B(f,g)],index:i,force:a,parallel:s}));await Promise.all(p)}else for(let p of d)await Df({dir:t,gitdir:e,fs:n,filepath:[B(f,p)],index:i,force:a,parallel:s})}else{let p=await(await ze.get({fs:n,gitdir:e})).get("core.autocrlf"),g=h.isSymbolicLink()?await n.readlink(B(t,f)).then(oC):await n.read(B(t,f),{autocrlf:p});if(g===null)throw new Re(f);let m=await zt({fs:n,gitdir:e,type:"blob",object:g});i.insert({filepath:f,stats:h,oid:m})}}),l=await Promise.allSettled(o),c=l.filter(f=>f.status==="rejected").map(f=>f.reason);if(c.length>1)throw new as(c);if(c.length===1)throw c[0];return l.filter(f=>f.status==="fulfilled"&&f.value).map(f=>f.value)}async function fs({fs:t,gitdir:e,path:n}){return(await ze.get({fs:t,gitdir:e})).get(n)}function M1(t,...e){for(let n of e)if(n)for(let r of Object.keys(n)){let i=n[r];i!==void 0&&(t[r]=i)}return t}async function Hr({fs:t,gitdir:e,author:n,commit:r}){let i=Math.floor(Date.now()/1e3),a={name:await fs({fs:t,gitdir:e,path:"user.name"}),email:await fs({fs:t,gitdir:e,path:"user.email"})||"",timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},s=M1({},a,r?r.author:void 0,n);if(s.name!==void 0)return s}async function Ri({fs:t,gitdir:e,author:n,committer:r,commit:i}){let a=Math.floor(Date.now()/1e3),s={name:await fs({fs:t,gitdir:e,path:"user.name"}),email:await fs({fs:t,gitdir:e,path:"user.email"})||"",timestamp:a,timezoneOffset:new Date(a*1e3).getTimezoneOffset()},o=M1({},s,i?i.committer:void 0,n,r);if(o.name!==void 0)return o}async function O1({fs:t,cache:e,gitdir:n,oid:r}){let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:n,oid:r});if(i==="tag")return r=Ut.from(a).parse().object,O1({fs:t,cache:e,gitdir:n,oid:r});if(i!=="commit")throw new kt(r,i,"commit");return{commit:Rt.from(a),oid:r}}async function Uo({fs:t,cache:e,gitdir:n,oid:r}){let{commit:i,oid:a}=await O1({fs:t,cache:e,gitdir:n,oid:r});return{oid:a,commit:i.parse(),payload:i.withoutSignature()}}async function Zo({fs:t,cache:e,onSign:n,gitdir:r,message:i,author:a,committer:s,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:h,tree:d}){let p=!1;f||(f=await q.resolve({fs:t,gitdir:r,ref:"HEAD",depth:2}));let g,m;try{g=await q.resolve({fs:t,gitdir:r,ref:f}),m=await Uo({fs:t,gitdir:r,oid:g,cache:{}})}catch(S){p=!0}if(l&&p)throw new us(f);let w=l?await Hr({fs:t,gitdir:r,author:a,commit:m.commit}):await Hr({fs:t,gitdir:r,author:a});if(!w)throw new At("author");let b=l?await Ri({fs:t,gitdir:r,author:w,committer:s,commit:m.commit}):await Ri({fs:t,gitdir:r,author:w,committer:s});if(!b)throw new At("committer");return lt.acquire({fs:t,gitdir:r,cache:e,allowUnmerged:!1},async function(S){let x=E1(S.entries).get(".");if(d||(d=await P1({fs:t,gitdir:r,inode:x,dryRun:c})),h?h=await Promise.all(h.map(E=>q.resolve({fs:t,gitdir:r,ref:E}))):l?h=m.commit.parent:h=g?[g]:[],!i)if(l)i=m.commit.message;else throw new Pt("message");let A=Rt.from({tree:d,parent:h,author:w,committer:b,message:i});o&&(A=await Rt.sign(A,n,o));let y=await zt({fs:t,gitdir:r,type:"commit",object:A.toObject(),dryRun:c});return!u&&!c&&await q.writeRef({fs:t,gitdir:r,ref:f,value:y}),y})}async function P1({fs:t,gitdir:e,inode:n,dryRun:r}){let i=n.children;for(let l of i)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await P1({fs:t,gitdir:e,inode:l,dryRun:r}));let a=i.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),s=It.from(a);return await zt({fs:t,gitdir:e,type:"tree",object:s.toObject(),dryRun:r})}async function ds({fs:t,cache:e,gitdir:n,oid:r,filepath:i}){if(i.startsWith("/"))throw new cr("leading-slash");if(i.endsWith("/"))throw new cr("trailing-slash");let a=r,s=await Oi({fs:t,cache:e,gitdir:n,oid:r}),o=s.tree;if(i==="")r=s.oid;else{let l=i.split("/");r=await I1({fs:t,cache:e,gitdir:n,tree:o,pathArray:l,oid:a,filepath:i})}return r}async function I1({fs:t,cache:e,gitdir:n,tree:r,pathArray:i,oid:a,filepath:s}){let o=i.shift();for(let l of r)if(l.path===o){if(i.length===0)return l.oid;{let{type:c,object:u}=await Ge({fs:t,cache:e,gitdir:n,oid:l.oid});if(c!=="tree")throw new kt(a,c,"tree",s);return r=It.from(u),I1({fs:t,cache:e,gitdir:n,tree:r,pathArray:i,oid:a,filepath:s})}}throw new Re(`file or directory found at "${a}:${s}"`)}async function Di({fs:t,cache:e,gitdir:n,oid:r,filepath:i=void 0}){i!==void 0&&(r=await ds({fs:t,cache:e,gitdir:n,oid:r,filepath:i}));let{tree:a,oid:s}=await Oi({fs:t,cache:e,gitdir:n,oid:r});return{oid:s,tree:a.entries()}}async function Hf({fs:t,gitdir:e,tree:n}){let r=It.from(n).toObject();return await zt({fs:t,gitdir:e,type:"tree",object:r,format:"content"})}async function cC({fs:t,cache:e,onSign:n,gitdir:r,ref:i,oid:a,note:s,force:o,author:l,committer:c,signingKey:u}){let f;try{f=await q.resolve({gitdir:r,fs:t,ref:i})}catch(w){if(!(w instanceof Re))throw w}let d=(await Di({fs:t,cache:e,gitdir:r,oid:f||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(o)d=d.filter(w=>w.path!==a);else for(let w of d)if(w.path===a)throw new hn("note",a);typeof s=="string"&&(s=Buffer.from(s,"utf8"));let p=await zt({fs:t,gitdir:r,type:"blob",object:s,format:"content"});d.push({mode:"100644",path:a,oid:p,type:"blob"});let g=await Hf({fs:t,gitdir:r,tree:d});return await Zo({fs:t,cache:e,onSign:n,gitdir:r,ref:i,tree:g,parent:f&&[f],message:`Note added by 'isomorphic-git addNote' +`,author:l,committer:c,signingKey:u})}async function uC({fs:t,onSign:e,dir:n,gitdir:r=B(n,".git"),ref:i="refs/notes/commits",oid:a,note:s,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{F("fs",t),F("gitdir",r),F("oid",a),F("note",s),u&&F("onSign",e);let h=new Q(t),d=await Hr({fs:h,gitdir:r,author:l});if(!d)throw new At("author");let p=await Ri({fs:h,gitdir:r,author:d,committer:c});if(!p)throw new At("committer");return await cC({fs:new Q(h),cache:f,onSign:e,gitdir:r,ref:i,oid:a,note:s,force:o,author:d,committer:p,signingKey:u})}catch(h){throw h.caller="git.addNote",h}}async function R1({fs:t,gitdir:e,remote:n,url:r,force:i}){if(n!==fn.default.clean(n))throw new zn(n,fn.default.clean(n));let a=await ze.get({fs:t,gitdir:e});if(!i&&(await a.getSubsections("remote")).includes(n)&&r!==await a.get(`remote.${n}.url`))throw new hn("remote",n);await a.set(`remote.${n}.url`,r),await a.set(`remote.${n}.fetch`,`+refs/heads/*:refs/remotes/${n}/*`),await ze.save({fs:t,gitdir:e,config:a})}async function fC({fs:t,dir:e,gitdir:n=B(e,".git"),remote:r,url:i,force:a=!1}){try{return F("fs",t),F("gitdir",n),F("remote",r),F("url",i),await R1({fs:new Q(t),gitdir:n,remote:r,url:i,force:a})}catch(s){throw s.caller="git.addRemote",s}}async function hC({fs:t,cache:e,onSign:n,gitdir:r,ref:i,tagger:a,message:s=i,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`,!u&&await q.exists({fs:t,gitdir:r,ref:i}))throw new hn("tag",i);let f=await q.resolve({fs:t,gitdir:r,ref:l||"HEAD"}),{type:h}=await Ge({fs:t,cache:e,gitdir:r,oid:f}),d=Ut.from({object:f,type:h,tag:i.replace("refs/tags/",""),tagger:a,message:s,gpgsig:o});c&&(d=await Ut.sign(d,n,c));let p=await zt({fs:t,gitdir:r,type:"tag",object:d.toObject()});await q.writeRef({fs:t,gitdir:r,ref:i,value:p})}async function dC({fs:t,onSign:e,dir:n,gitdir:r=B(n,".git"),ref:i,tagger:a,message:s=i,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{F("fs",t),F("gitdir",r),F("ref",i),c&&F("onSign",e);let h=new Q(t),d=await Hr({fs:h,gitdir:r,author:a});if(!d)throw new At("tagger");return await hC({fs:h,cache:f,onSign:e,gitdir:r,ref:i,tagger:d,message:s,gpgsig:o,object:l,signingKey:c,force:u})}catch(h){throw h.caller="git.annotatedTag",h}}async function pC({fs:t,gitdir:e,ref:n,object:r,checkout:i=!1,force:a=!1}){if(n!==fn.default.clean(n))throw new zn(n,fn.default.clean(n));let s=`refs/heads/${n}`;if(!a&&await q.exists({fs:t,gitdir:e,ref:s}))throw new hn("branch",n,!1);let o;try{o=await q.resolve({fs:t,gitdir:e,ref:r||"HEAD"})}catch(l){}o&&await q.writeRef({fs:t,gitdir:e,ref:s,value:o}),i&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}async function mC({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r,object:i,checkout:a=!1,force:s=!1}){try{return F("fs",t),F("gitdir",n),F("ref",r),await pC({fs:new Q(t),gitdir:n,ref:r,object:i,checkout:a,force:s})}catch(o){throw o.caller="git.branch",o}}var L1=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function Uf({fs:t,cache:e,onProgress:n,onPostCheckout:r,dir:i,gitdir:a,remote:s,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:h,track:d=!0}){let p;if(r)try{p=await q.resolve({fs:t,gitdir:a,ref:"HEAD"})}catch(m){p="0000000000000000000000000000000000000000"}let g;try{g=await q.resolve({fs:t,gitdir:a,ref:o})}catch(m){if(o==="HEAD")throw m;let w=`${s}/${o}`;if(g=await q.resolve({fs:t,gitdir:a,ref:w}),d){let b=await ze.get({fs:t,gitdir:a});await b.set(`branch.${o}.remote`,s),await b.set(`branch.${o}.merge`,`refs/heads/${o}`),await ze.save({fs:t,gitdir:a,config:b})}await q.writeRef({fs:t,gitdir:a,ref:`refs/heads/${o}`,value:g})}if(!c){let m;try{m=await gC({fs:t,cache:e,onProgress:n,dir:i,gitdir:a,ref:o,force:h,filepaths:l})}catch(x){throw x instanceof Re&&x.data.what===g?new es(o,g):x}let w=m.filter(([x])=>x==="conflict").map(([x,A])=>A);if(w.length>0)throw new Qa(w);let b=m.filter(([x])=>x==="error").map(([x,A])=>A);if(b.length>0)throw new ue(b.join(", "));if(f){r&&await r({previousHead:p,newHead:g,type:l!=null&&l.length>0?"file":"branch"});return}let S=0,k=m.length;await lt.acquire({fs:t,gitdir:a,cache:e},async function(x){await Promise.all(m.filter(([A])=>A==="delete"||A==="delete-index").map(async function([A,y]){let E=`${i}/${y}`;A==="delete"&&await t.rm(E),x.delete({filepath:y}),n&&await n({phase:"Updating workdir",loaded:++S,total:k})}))}),await lt.acquire({fs:t,gitdir:a,cache:e},async function(x){for(let[A,y]of m)if(A==="rmdir"||A==="rmdir-index"){let E=`${i}/${y}`;try{A==="rmdir-index"&&x.delete({filepath:y}),await t.rmdir(E),n&&await n({phase:"Updating workdir",loaded:++S,total:k})}catch(_){if(_.code==="ENOTEMPTY")console.log(`Did not delete ${y} because directory is not empty`);else throw _}}}),await Promise.all(m.filter(([x])=>x==="mkdir"||x==="mkdir-index").map(async function([x,A]){let y=`${i}/${A}`;await t.mkdir(y),n&&await n({phase:"Updating workdir",loaded:++S,total:k})})),await lt.acquire({fs:t,gitdir:a,cache:e},async function(x){await Promise.all(m.filter(([A])=>A==="create"||A==="create-index"||A==="update"||A==="mkdir-index").map(async function([A,y,E,_,C]){let M=`${i}/${y}`;try{if(A!=="create-index"&&A!=="mkdir-index"){let{object:N}=await Ge({fs:t,cache:e,gitdir:a,oid:E});if(C&&await t.rm(M),_===33188)await t.write(M,N);else if(_===33261)await t.write(M,N,{mode:511});else if(_===40960)await t.writelink(M,N);else throw new ue(`Invalid mode 0o${_.toString(8)} detected in blob ${E}`)}let L=await t.lstat(M);_===33261&&(L.mode=493),A==="mkdir-index"&&(L.mode=57344),x.insert({filepath:y,stats:L,oid:E}),n&&await n({phase:"Updating workdir",loaded:++S,total:k})}catch(L){console.log(L)}}))}),r&&await r({previousHead:p,newHead:g,type:l!=null&&l.length>0?"file":"branch"})}if(!u){let m=await q.expand({fs:t,gitdir:a,ref:o});m.startsWith("refs/heads")?await q.writeSymbolicRef({fs:t,gitdir:a,ref:"HEAD",value:m}):await q.writeRef({fs:t,gitdir:a,ref:"HEAD",value:g})}}async function gC({fs:t,cache:e,onProgress:n,dir:r,gitdir:i,ref:a,force:s,filepaths:o}){let l=0;return Pi({fs:t,cache:e,dir:r,gitdir:i,trees:[sr({ref:a}),Yo(),Xo()],map:async function(c,[u,f,h]){if(c===".")return;if(o&&!o.some(p=>L1(c,p)))return null;switch(n&&await n({phase:"Analyzing workdir",loaded:++l}),[!!h,!!u,!!f].map(Number).join("")){case"000":return;case"001":return s&&o&&o.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await f.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await f.oid()?s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]:await u.mode()!==await f.mode()?s?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await h.type()){case"tree":return["rmdir",c];case"blob":return await h.oid()!==await f.oid()?s?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await h.type()}`]}case"110":case"111":switch(`${await h.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await h.oid()===await u.oid()&&await h.mode()===await u.mode()&&!s)return;if(f){if(await f.oid()!==await h.oid()&&await f.oid()!==await u.oid())return s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]}else if(s)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()];return await u.mode()!==await h.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await h.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await h.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=C1(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function yC({fs:t,onProgress:e,onPostCheckout:n,dir:r,gitdir:i=B(r,".git"),remote:a="origin",ref:s,filepaths:o,noCheckout:l=!1,noUpdateHead:c=s===void 0,dryRun:u=!1,force:f=!1,track:h=!0,cache:d={}}){try{F("fs",t),F("dir",r),F("gitdir",i);let p=s||"HEAD";return await Uf({fs:new Q(t),cache:d,onProgress:e,onPostCheckout:n,dir:r,gitdir:i,remote:a,ref:p,filepaths:o,noCheckout:l,noUpdateHead:c,dryRun:u,force:f,track:h})}catch(p){throw p.caller="git.checkout",p}}var vC=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function Nr(t){let e=vC.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}async function zr({fs:t,gitdir:e,fullname:n=!1,test:r=!1}){let i=await q.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(r)try{await q.resolve({fs:t,gitdir:e,ref:i})}catch(a){return}if(i.startsWith("refs/"))return n?i:Nr(i)}function wC(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}function j1({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}async function ps(t,e){let n=A1(t);for(;;){let{value:r,done:i}=await n.next();if(r&&await e(r),i)break}n.return&&n.return()}async function zo(t){let e=0,n=[];await ps(t,a=>{n.push(a),e+=a.byteLength});let r=new Uint8Array(e),i=0;for(let a of n)r.set(a,i),i+=a.byteLength;return r}function f1(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[n,r]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:n,password:r}}}function Bf(t,e){let n=e.toString(16);return"0".repeat(t-n.length)+n}var Ue=class{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=Buffer.from(e));let n=e.length+4,r=Bf(4,n);return Buffer.concat([Buffer.from(r,"utf8"),e])}static streamReader(e){let n=new No(e);return async function(){try{let i=await n.read(4);if(i==null)return!0;if(i=parseInt(i.toString("utf8"),16),i===0||i===1)return null;let a=await n.read(i-4);return a==null?!0:a}catch(i){return e.error=i,!0}}}};async function h1(t){let e={},n;for(;n=await t(),n!==!0;){if(n===null)continue;n=n.toString("utf8").replace(/\n$/,"");let r=n.indexOf("=");if(r>-1){let i=n.slice(0,r),a=n.slice(r+1);e[i]=a}else e[n]=!0}return{protocolVersion:2,capabilities2:e}}async function d1(t,{service:e}){let n=new Set,r=new Map,i=new Map,a=Ue.streamReader(t),s=await a();for(;s===null;)s=await a();if(s===!0)throw new ts;if(s.includes("version 2"))return h1(a);if(s.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new $r(`# service=${e}\\n`,s.toString("utf8"));let o=await a();for(;o===null;)o=await a();if(o===!0)return{capabilities:n,refs:r,symrefs:i};if(o=o.toString("utf8"),o.includes("version 2"))return h1(a);let[l,c]=Sf(o,"\0","\\x00");if(c.split(" ").map(u=>n.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,f]=Sf(l," "," ");for(r.set(f,u);;){let h=await a();if(h===!0)break;if(h!==null){let[d,p]=Sf(h.toString("utf8")," "," ");r.set(p,d)}}}for(let u of n)if(u.startsWith("symref=")){let f=u.match(/symref=([^:]+):(.*)/);f.length===3&&i.set(f[1],f[2])}return{protocolVersion:1,capabilities:n,refs:r,symrefs:i}}function Sf(t,e,n){let r=t.trim().split(e);if(r.length!==2)throw new $r(`Two strings separated by '${n}'`,t.toString("utf8"));return r}var p1=(t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,m1=(t,e)=>{(e.username||e.password)&&(t.Authorization=j1(e)),e.headers&&Object.assign(t,e.headers)},Ef=async t=>{try{let e=Buffer.from(await zo(t.body)),n=e.toString("utf8");return{preview:n.length<256?n:n.slice(0,256)+"...",response:n,data:e}}catch(e){return{}}},Li=class{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:n,onAuth:r,onAuthSuccess:i,onAuthFailure:a,corsProxy:s,service:o,url:l,headers:c,protocolVersion:u}){let{url:f,auth:h}=f1(l),d=s?p1(s,f):f;(h.username||h.password)&&(c.Authorization=j1(h)),u===2&&(c["Git-Protocol"]="version=2");let p,g,m=!1;do if(p=await e.request({onProgress:n,method:"GET",url:`${d}/info/refs?service=${o}`,headers:c}),g=!1,p.statusCode===401||p.statusCode===203){let w=m?a:r;if(w){if(h=await w(f,{...h,headers:{...c}}),h&&h.cancel)throw new Mi;h&&(m1(c,h),m=!0,g=!0)}}else p.statusCode===200&&m&&i&&await i(f,h);while(g);if(p.statusCode!==200){let{response:w}=await Ef(p);throw new Ai(p.statusCode,p.statusMessage,w)}if(p.headers["content-type"]===`application/x-${o}-advertisement`){let w=await d1(p.body,{service:o});return w.auth=h,w}else{let{preview:w,response:b,data:S}=await Ef(p);try{let k=await d1([S],{service:o});return k.auth=h,k}catch(k){throw new ss(w,b)}}}static async connect({http:e,onProgress:n,corsProxy:r,service:i,url:a,auth:s,body:o,headers:l}){let c=f1(a);c&&(a=c.url),r&&(a=p1(r,a)),l["content-type"]=`application/x-${i}-request`,l.accept=`application/x-${i}-result`,m1(l,s);let u=await e.request({onProgress:n,method:"POST",url:`${a}/${i}`,body:o,headers:l});if(u.statusCode!==200){let{response:f}=Ef(u);throw new Ai(u.statusCode,u.statusMessage,f)}return u}};function bC({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}var ji=class{static getRemoteHelperFor({url:e}){let n=new Map;n.set("http",Li),n.set("https",Li);let r=bC({url:e});if(!r)throw new ls(e);if(n.has(r.transport))return n.get(r.transport);throw new os(e,r.transport,r.transport==="ssh"?wC(e):void 0)}},Br=null,Ur=class{static async read({fs:e,gitdir:n}){Br===null&&(Br=new Xa.default);let r=B(n,"shallow"),i=new Set;return await Br.acquire(r,async function(){let a=await e.read(r,{encoding:"utf8"});if(a===null||a.trim()==="")return i;a.trim().split(` +`).map(s=>i.add(s))}),i}static async write({fs:e,gitdir:n,oids:r}){Br===null&&(Br=new Xa.default);let i=B(n,"shallow");if(r.size>0){let a=[...r].join(` +`)+` +`;await Br.acquire(i,async function(){await e.write(i,a,{encoding:"utf8"})})}else await Br.acquire(i,async function(){await e.rm(i)})}};async function xC({fs:t,gitdir:e,oid:n}){let r=`objects/${n.slice(0,2)}/${n.slice(2)}`;return t.exists(`${e}/${r}`)}async function _C({fs:t,cache:e,gitdir:n,oid:r,getExternalRefDelta:i}){let a=await t.readdir(B(n,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(let s of a){let o=`${n}/objects/pack/${s}`,l=await $f({fs:t,cache:e,filename:o,getExternalRefDelta:i});if(l.error)throw new ue(l.error);if(l.offsets.has(r))return!0}return!1}async function g1({fs:t,cache:e,gitdir:n,oid:r,format:i="content"}){let a=o=>Ge({fs:t,cache:e,gitdir:n,oid:o}),s=await xC({fs:t,gitdir:n,oid:r});return s||(s=await _C({fs:t,cache:e,gitdir:n,oid:r,getExternalRefDelta:a})),s}function SC(t){let i="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===i}function D1(t,e){let n=t.map(r=>r.split("=",1)[0]);return e.filter(r=>{let i=r.split("=",1)[0];return n.includes(i)})}var Ko={name:"isomorphic-git",version:"1.27.1",agent:"git/isomorphic-git@1.27.1"},_i=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 n=this._waiting;this._waiting=null,n({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 EC(t){let e=t.indexOf("\r"),n=t.indexOf(` +`);return e===-1&&n===-1?-1:e===-1?n+1:n===-1?e+1:n===e+1?n+1:Math.min(e,n)+1}function B1(t){let e=new _i,n="";return(async()=>(await ps(t,r=>{for(r=r.toString("utf8"),n+=r;;){let i=EC(n);if(i===-1)break;e.write(n.slice(0,i)),n=n.slice(i)}}),n.length>0&&e.write(n),e.end()))(),e}var Go=class{static demux(e){let n=Ue.streamReader(e),r=new _i,i=new _i,a=new _i,s=async function(){let o=await n();if(o===null)return s();if(o===!0){r.end(),a.end(),e.error?i.destroy(e.error):i.end();return}switch(o[0]){case 1:{i.write(o.slice(1));break}case 2:{a.write(o.slice(1));break}case 3:{let l=o.slice(1);a.write(l),r.end(),a.end(),i.destroy(new Error(l.toString("utf8")));return}default:r.write(o)}s()};return s(),{packetlines:r,packfile:i,progress:a}}};async function kC(t){let{packetlines:e,packfile:n,progress:r}=Go.demux(t),i=[],a=[],s=[],o=!1,l=!1;return new Promise((c,u)=>{ps(e,f=>{let h=f.toString("utf8").trim();if(h.startsWith("shallow")){let d=h.slice(-41).trim();d.length!==40&&u(new or(d)),i.push(d)}else if(h.startsWith("unshallow")){let d=h.slice(-41).trim();d.length!==40&&u(new or(d)),a.push(d)}else if(h.startsWith("ACK")){let[,d,p]=h.split(" ");s.push({oid:d,status:p}),p||(l=!0)}else h.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(t.error?u(t.error):c({shallows:i,unshallows:a,acks:s,nak:o,packfile:n,progress:r}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:i,unshallows:a,acks:s,nak:o,packfile:n,progress:r}))})})}function AC({capabilities:t=[],wants:e=[],haves:n=[],shallows:r=[],depth:i=null,since:a=null,exclude:s=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(Ue.encode(`want ${c}${l} +`)),l="";for(let c of r)o.push(Ue.encode(`shallow ${c} +`));i!==null&&o.push(Ue.encode(`deepen ${i} +`)),a!==null&&o.push(Ue.encode(`deepen-since ${Math.floor(a.valueOf()/1e3)} +`));for(let c of s)o.push(Ue.encode(`deepen-not ${c} +`));o.push(Ue.flush());for(let c of n)o.push(Ue.encode(`have ${c} +`));return o.push(Ue.encode(`done +`)),o}async function zf({fs:t,cache:e,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:h,corsProxy:d,depth:p=null,since:g=null,exclude:m=[],relative:w=!1,tags:b=!1,singleBranch:S=!1,headers:k={},prune:x=!1,pruneTags:A=!1}){let y=c||await zr({fs:t,gitdir:l,test:!0}),E=await ze.get({fs:t,gitdir:l}),_=f||y&&await E.get(`branch.${y}.remote`)||"origin",C=h||await E.get(`remote.${_}.url`);if(typeof C=="undefined")throw new Pt("remote OR url");let M=u||y&&await E.get(`branch.${y}.merge`)||c||"HEAD";d===void 0&&(d=await E.get("http.corsProxy"));let L=ji.getRemoteHelperFor({url:C}),N=await L.discover({http:n,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:d,service:"git-upload-pack",url:C,headers:k,protocolVersion:1}),j=N.auth,Y=N.refs;if(Y.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!N.capabilities.has("shallow"))throw new ar("shallow","depth");if(g!==null&&!N.capabilities.has("deepen-since"))throw new ar("deepen-since","since");if(m.length>0&&!N.capabilities.has("deepen-not"))throw new ar("deepen-not","exclude");if(w===!0&&!N.capabilities.has("deepen-relative"))throw new ar("deepen-relative","relative");let{oid:le,fullref:he}=q.resolveAgainstMap({ref:M,map:Y});for(let z of Y.keys())z===he||z==="HEAD"||z.startsWith("refs/heads/")||b&&z.startsWith("refs/tags/")||Y.delete(z);let ie=D1([...N.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Ko.agent}`]);w&&ie.push("deepen-relative");let Me=S?[le]:Y.values(),de=S?[y]:await q.listRefs({fs:t,gitdir:l,filepath:"refs"}),$=[];for(let z of de)try{z=await q.expand({fs:t,gitdir:l,ref:z});let nt=await q.resolve({fs:t,gitdir:l,ref:z});await g1({fs:t,cache:e,gitdir:l,oid:nt})&&$.push(nt)}catch(nt){}$=[...new Set($)];let G=await Ur.read({fs:t,gitdir:l}),D=N.capabilities.has("shallow")?[...G]:[],se=AC({capabilities:ie,wants:Me,haves:$,shallows:D,depth:p,since:g,exclude:m}),Se=Buffer.from(await zo(se)),mt=await L.connect({http:n,onProgress:r,corsProxy:d,service:"git-upload-pack",url:C,auth:j,body:[Se],headers:k}),be=await kC(mt.body);mt.headers&&(be.headers=mt.headers);for(let z of be.shallows)if(!G.has(z))try{let{object:nt}=await Ge({fs:t,cache:e,gitdir:l,oid:z}),H=new Rt(nt),Z=await Promise.all(H.headers().parent.map(Ye=>g1({fs:t,cache:e,gitdir:l,oid:Ye})));Z.length===0||Z.every(Ye=>Ye)||G.add(z)}catch(nt){G.add(z)}for(let z of be.unshallows)G.delete(z);if(await Ur.write({fs:t,gitdir:l,oids:G}),S){let z=new Map([[he,le]]),nt=new Map,H=10,Z=he;for(;H--;){let _t=N.symrefs.get(Z);if(_t===void 0)break;nt.set(Z,_t),Z=_t}let ye=Y.get(Z);ye&&z.set(Z,ye);let{pruned:Ye}=await q.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:z,symrefs:nt,tags:b,prune:x});x&&(be.pruned=Ye)}else{let{pruned:z}=await q.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:Y,symrefs:N.symrefs,tags:b,prune:x,pruneTags:A});x&&(be.pruned=z)}if(be.HEAD=N.symrefs.get("HEAD"),be.HEAD===void 0){let{oid:z}=q.resolveAgainstMap({ref:"HEAD",map:Y});for(let[nt,H]of Y.entries())if(nt!=="HEAD"&&H===z){be.HEAD=nt;break}}let st=he.startsWith("refs/tags")?"tag":"branch";if(be.FETCH_HEAD={oid:le,description:`${st} '${Nr(he)}' of ${C}`},r||i){let z=B1(be.progress);ps(z,async nt=>{if(i&&await i(nt),r){let H=nt.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);H&&await r({phase:H[1].trim(),loaded:parseInt(H[2],10),total:parseInt(H[3],10)})}})}let ee=Buffer.from(await zo(be.packfile));if(mt.body.error)throw mt.body.error;let Ie=ee.slice(-20).toString("hex"),Ee={defaultBranch:be.HEAD,fetchHead:be.FETCH_HEAD.oid,fetchHeadDescription:be.FETCH_HEAD.description};if(be.headers&&(Ee.headers=be.headers),x&&(Ee.pruned=be.pruned),Ie!==""&&!SC(ee)){Ee.packfile=`objects/pack/pack-${Ie}.pack`;let z=B(l,Ee.packfile);await t.write(z,ee);let nt=Z=>Ge({fs:t,cache:e,gitdir:l,oid:Z}),H=await Ka.fromPack({pack:ee,getExternalRefDelta:nt,onProgress:r});await t.write(z.replace(/\.pack$/,".idx"),await H.toBuffer())}return Ee}async function N1({fs:t,bare:e=!1,dir:n,gitdir:r=e?n:B(n,".git"),defaultBranch:i="master"}){if(await t.exists(r+"/config"))return;let a=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];a=a.map(s=>r+"/"+s);for(let s of a)await t.mkdir(s);await t.write(r+"/config",`[core] repositoryformatversion = 0 filemode = false - bare = ${bare} -` + (bare ? "" : " logallrefupdates = true\n") + " symlinks = false\n ignorecase = true\n" - ); - await fs.write(gitdir + "/HEAD", `ref: refs/heads/${defaultBranch} -`); -} -async function _clone({ - fs, - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir, - url, - corsProxy, - ref, - remote, - depth, - since, - exclude, - relative: relative2, - singleBranch, - noCheckout, - noTags, - headers -}) { - try { - await _init({ fs, gitdir }); - await _addRemote({ fs, gitdir, remote, url, force: false }); - if (corsProxy) { - const config = await GitConfigManager.get({ fs, gitdir }); - await config.set(`http.corsProxy`, corsProxy); - await GitConfigManager.save({ fs, gitdir, config }); - } - const { defaultBranch, fetchHead } = await _fetch({ - fs, - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - gitdir, - ref, - remote, - corsProxy, - depth, - since, - exclude, - relative: relative2, - singleBranch, - headers, - tags: !noTags - }); - if (fetchHead === null) - return; - ref = ref || defaultBranch; - ref = ref.replace("refs/heads/", ""); - await _checkout({ - fs, - cache, - onProgress, - dir, - gitdir, - ref, - remote, - noCheckout - }); - } catch (err) { - await fs.rmdir(gitdir, { recursive: true, maxRetries: 10 }).catch(() => void 0); - throw err; - } -} -async function clone({ - fs, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir = join(dir, ".git"), - url, - corsProxy = void 0, - ref = void 0, - remote = "origin", - depth = void 0, - since = void 0, - exclude = [], - relative: relative2 = false, - singleBranch = false, - noCheckout = false, - noTags = false, - headers = {}, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("http", http); - assertParameter("gitdir", gitdir); - if (!noCheckout) { - assertParameter("dir", dir); - } - assertParameter("url", url); - return await _clone({ - fs: new FileSystem(fs), - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir, - url, - corsProxy, - ref, - remote, - depth, - since, - exclude, - relative: relative2, - singleBranch, - noCheckout, - noTags, - headers - }); - } catch (err) { - err.caller = "git.clone"; - throw err; - } -} -async function commit({ - fs: _fs, - onSign, - dir, - gitdir = join(dir, ".git"), - message, - author: _author, - committer: _committer, - signingKey, - dryRun = false, - noUpdateBranch = false, - ref, - parent, - tree, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("message", message); - if (signingKey) { - assertParameter("onSign", onSign); - } - const fs = new FileSystem(_fs); - const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); - if (!author) - throw new MissingNameError("author"); - const committer = await normalizeCommitterObject({ - fs, - gitdir, - author, - committer: _committer - }); - if (!committer) - throw new MissingNameError("committer"); - return await _commit({ - fs, - cache, - onSign, - gitdir, - message, - author, - committer, - signingKey, - dryRun, - noUpdateBranch, - ref, - parent, - tree - }); - } catch (err) { - err.caller = "git.commit"; - throw err; - } -} -async function currentBranch({ - fs, - dir, - gitdir = join(dir, ".git"), - fullname = false, - test = false -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - return await _currentBranch({ - fs: new FileSystem(fs), - gitdir, - fullname, - test - }); - } catch (err) { - err.caller = "git.currentBranch"; - throw err; - } -} -async function _deleteBranch({ fs, gitdir, ref }) { - ref = ref.startsWith("refs/heads/") ? ref : `refs/heads/${ref}`; - const exist = await GitRefManager.exists({ fs, gitdir, ref }); - if (!exist) { - throw new NotFoundError(ref); - } - const fullRef = await GitRefManager.expand({ fs, gitdir, ref }); - const currentRef = await _currentBranch({ fs, gitdir, fullname: true }); - if (fullRef === currentRef) { - const value = await GitRefManager.resolve({ fs, gitdir, ref: fullRef }); - await GitRefManager.writeRef({ fs, gitdir, ref: "HEAD", value }); - } - await GitRefManager.deleteRef({ fs, gitdir, ref: fullRef }); -} -async function deleteBranch({ - fs, - dir, - gitdir = join(dir, ".git"), - ref -}) { - try { - assertParameter("fs", fs); - assertParameter("ref", ref); - return await _deleteBranch({ - fs: new FileSystem(fs), - gitdir, - ref - }); - } catch (err) { - err.caller = "git.deleteBranch"; - throw err; - } -} -async function deleteRef({ fs, dir, gitdir = join(dir, ".git"), ref }) { - try { - assertParameter("fs", fs); - assertParameter("ref", ref); - await GitRefManager.deleteRef({ fs: new FileSystem(fs), gitdir, ref }); - } catch (err) { - err.caller = "git.deleteRef"; - throw err; - } -} -async function _deleteRemote({ fs, gitdir, remote }) { - const config = await GitConfigManager.get({ fs, gitdir }); - await config.deleteSection("remote", remote); - await GitConfigManager.save({ fs, gitdir, config }); -} -async function deleteRemote({ - fs, - dir, - gitdir = join(dir, ".git"), - remote -}) { - try { - assertParameter("fs", fs); - assertParameter("remote", remote); - return await _deleteRemote({ - fs: new FileSystem(fs), - gitdir, - remote - }); - } catch (err) { - err.caller = "git.deleteRemote"; - throw err; - } -} -async function _deleteTag({ fs, gitdir, ref }) { - ref = ref.startsWith("refs/tags/") ? ref : `refs/tags/${ref}`; - await GitRefManager.deleteRef({ fs, gitdir, ref }); -} -async function deleteTag({ fs, dir, gitdir = join(dir, ".git"), ref }) { - try { - assertParameter("fs", fs); - assertParameter("ref", ref); - return await _deleteTag({ - fs: new FileSystem(fs), - gitdir, - ref - }); - } catch (err) { - err.caller = "git.deleteTag"; - throw err; - } -} -async function expandOidLoose({ fs, gitdir, oid: short }) { - const prefix = short.slice(0, 2); - const objectsSuffixes = await fs.readdir(`${gitdir}/objects/${prefix}`); - return objectsSuffixes.map((suffix) => `${prefix}${suffix}`).filter((_oid) => _oid.startsWith(short)); -} -async function expandOidPacked({ - fs, - cache, - gitdir, - oid: short, - getExternalRefDelta -}) { - const results = []; - let list = await fs.readdir(join(gitdir, "objects/pack")); - list = list.filter((x) => x.endsWith(".idx")); - for (const filename of list) { - const indexFile = `${gitdir}/objects/pack/${filename}`; - const p = await readPackIndex({ - fs, - cache, - filename: indexFile, - getExternalRefDelta - }); - if (p.error) - throw new InternalError(p.error); - for (const oid of p.offsets.keys()) { - if (oid.startsWith(short)) - results.push(oid); - } - } - return results; -} -async function _expandOid({ fs, cache, gitdir, oid: short }) { - const getExternalRefDelta = (oid) => _readObject({ fs, cache, gitdir, oid }); - const results = await expandOidLoose({ fs, gitdir, oid: short }); - const packedOids = await expandOidPacked({ - fs, - cache, - gitdir, - oid: short, - getExternalRefDelta - }); - for (const packedOid of packedOids) { - if (results.indexOf(packedOid) === -1) { - results.push(packedOid); - } - } - if (results.length === 1) { - return results[0]; - } - if (results.length > 1) { - throw new AmbiguousError("oids", short, results); - } - throw new NotFoundError(`an object matching "${short}"`); -} -async function expandOid({ - fs, - dir, - gitdir = join(dir, ".git"), - oid, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - return await _expandOid({ - fs: new FileSystem(fs), - cache, - gitdir, - oid - }); - } catch (err) { - err.caller = "git.expandOid"; - throw err; - } -} -async function expandRef({ fs, dir, gitdir = join(dir, ".git"), ref }) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - return await GitRefManager.expand({ - fs: new FileSystem(fs), - gitdir, - ref - }); - } catch (err) { - err.caller = "git.expandRef"; - throw err; - } -} -async function _findMergeBase({ fs, cache, gitdir, oids }) { - const visits = {}; - const passes = oids.length; - let heads = oids.map((oid, index2) => ({ index: index2, oid })); - while (heads.length) { - const result = /* @__PURE__ */ new Set(); - for (const { oid, index: index2 } of heads) { - if (!visits[oid]) - visits[oid] = /* @__PURE__ */ new Set(); - visits[oid].add(index2); - if (visits[oid].size === passes) { - result.add(oid); - } - } - if (result.size > 0) { - return [...result]; - } - const newheads = /* @__PURE__ */ new Map(); - for (const { oid, index: index2 } of heads) { - try { - const { object } = await _readObject({ fs, cache, gitdir, oid }); - const commit2 = GitCommit.from(object); - const { parent } = commit2.parseHeaders(); - for (const oid2 of parent) { - if (!visits[oid2] || !visits[oid2].has(index2)) { - newheads.set(oid2 + ":" + index2, { oid: oid2, index: index2 }); - } - } - } catch (err) { - } - } - heads = Array.from(newheads.values()); - } - return []; -} -var LINEBREAKS = /^.*(\r?\n|$)/gm; -function mergeFile({ branches, contents }) { - const ourName = branches[1]; - const theirName = branches[2]; - const baseContent = contents[0]; - const ourContent = contents[1]; - const theirContent = contents[2]; - const ours = ourContent.match(LINEBREAKS); - const base = baseContent.match(LINEBREAKS); - const theirs = theirContent.match(LINEBREAKS); - const result = (0, import_diff3.default)(ours, base, theirs); - const markerSize = 7; - let mergedText = ""; - let cleanMerge = true; - for (const item of result) { - if (item.ok) { - mergedText += item.ok.join(""); - } - if (item.conflict) { - cleanMerge = false; - mergedText += `${"<".repeat(markerSize)} ${ourName} -`; - mergedText += item.conflict.a.join(""); - mergedText += `${"=".repeat(markerSize)} -`; - mergedText += item.conflict.b.join(""); - mergedText += `${">".repeat(markerSize)} ${theirName} -`; - } - } - return { cleanMerge, mergedText }; -} -async function mergeTree({ - fs, - cache, - dir, - gitdir = join(dir, ".git"), - index: index2, - ourOid, - baseOid, - theirOid, - ourName = "ours", - baseName = "base", - theirName = "theirs", - dryRun = false, - abortOnConflict = true, - mergeDriver -}) { - const ourTree = TREE({ ref: ourOid }); - const baseTree = TREE({ ref: baseOid }); - const theirTree = TREE({ ref: theirOid }); - const unmergedFiles = []; - const results = await _walk({ - fs, - cache, - dir, - gitdir, - trees: [ourTree, baseTree, theirTree], - map: async function(filepath, [ours, base, theirs]) { - const path2 = basename(filepath); - const ourChange = await modified(ours, base); - const theirChange = await modified(theirs, base); - switch (`${ourChange}-${theirChange}`) { - case "false-false": { - return { - mode: await base.mode(), - path: path2, - oid: await base.oid(), - type: await base.type() - }; - } - case "false-true": { - return theirs ? { - mode: await theirs.mode(), - path: path2, - oid: await theirs.oid(), - type: await theirs.type() - } : void 0; - } - case "true-false": { - return ours ? { - mode: await ours.mode(), - path: path2, - oid: await ours.oid(), - type: await ours.type() - } : void 0; - } - case "true-true": { - if (ours && base && theirs && await ours.type() === "blob" && await base.type() === "blob" && await theirs.type() === "blob") { - return mergeBlobs({ - fs, - gitdir, - path: path2, - ours, - base, - theirs, - ourName, - baseName, - theirName, - mergeDriver - }).then(async (r) => { - if (!r.cleanMerge) { - unmergedFiles.push(filepath); - if (!abortOnConflict) { - const baseOid2 = await base.oid(); - const ourOid2 = await ours.oid(); - const theirOid2 = await theirs.oid(); - index2.delete({ filepath }); - index2.insert({ filepath, oid: baseOid2, stage: 1 }); - index2.insert({ filepath, oid: ourOid2, stage: 2 }); - index2.insert({ filepath, oid: theirOid2, stage: 3 }); - } - } else if (!abortOnConflict) { - index2.insert({ filepath, oid: r.mergeResult.oid, stage: 0 }); - } - return r.mergeResult; - }); - } - throw new MergeNotSupportedError(); - } - } - }, - /** - * @param {TreeEntry} [parent] - * @param {Array} children - */ - reduce: unmergedFiles.length !== 0 && (!dir || abortOnConflict) ? void 0 : async (parent, children2) => { - const entries = children2.filter(Boolean); - if (!parent) - return; - if (parent && parent.type === "tree" && entries.length === 0) - return; - if (entries.length > 0) { - const tree = new GitTree(entries); - const object = tree.toObject(); - const oid = await _writeObject({ - fs, - gitdir, - type: "tree", - object, - dryRun - }); - parent.oid = oid; - } - return parent; - } - }); - if (unmergedFiles.length !== 0) { - if (dir && !abortOnConflict) { - await _walk({ - fs, - cache, - dir, - gitdir, - trees: [TREE({ ref: results.oid })], - map: async function(filepath, [entry]) { - const path2 = `${dir}/${filepath}`; - if (await entry.type() === "blob") { - const mode = await entry.mode(); - const content = new TextDecoder().decode(await entry.content()); - await fs.write(path2, content, { mode }); - } - return true; - } - }); - } - return new MergeConflictError(unmergedFiles); - } - return results.oid; -} -async function mergeBlobs({ - fs, - gitdir, - path: path2, - ours, - base, - theirs, - ourName, - theirName, - baseName, - dryRun, - mergeDriver = mergeFile -}) { - const type = "blob"; - const mode = await base.mode() === await ours.mode() ? await theirs.mode() : await ours.mode(); - if (await ours.oid() === await theirs.oid()) { - return { - cleanMerge: true, - mergeResult: { mode, path: path2, oid: await ours.oid(), type } - }; - } - if (await ours.oid() === await base.oid()) { - return { - cleanMerge: true, - mergeResult: { mode, path: path2, oid: await theirs.oid(), type } - }; - } - if (await theirs.oid() === await base.oid()) { - return { - cleanMerge: true, - mergeResult: { mode, path: path2, oid: await ours.oid(), type } - }; - } - const ourContent = Buffer.from(await ours.content()).toString("utf8"); - const baseContent = Buffer.from(await base.content()).toString("utf8"); - const theirContent = Buffer.from(await theirs.content()).toString("utf8"); - const { mergedText, cleanMerge } = await mergeDriver({ - branches: [baseName, ourName, theirName], - contents: [baseContent, ourContent, theirContent], - path: path2 - }); - const oid = await _writeObject({ - fs, - gitdir, - type: "blob", - object: Buffer.from(mergedText, "utf8"), - dryRun - }); - return { cleanMerge, mergeResult: { mode, path: path2, oid, type } }; -} -async function _merge({ - fs, - cache, - dir, - gitdir, - ours, - theirs, - fastForward: fastForward2 = true, - fastForwardOnly = false, - dryRun = false, - noUpdateBranch = false, - abortOnConflict = true, - message, - author, - committer, - signingKey, - onSign, - mergeDriver -}) { - if (ours === void 0) { - ours = await _currentBranch({ fs, gitdir, fullname: true }); - } - ours = await GitRefManager.expand({ - fs, - gitdir, - ref: ours - }); - theirs = await GitRefManager.expand({ - fs, - gitdir, - ref: theirs - }); - const ourOid = await GitRefManager.resolve({ - fs, - gitdir, - ref: ours - }); - const theirOid = await GitRefManager.resolve({ - fs, - gitdir, - ref: theirs - }); - const baseOids = await _findMergeBase({ - fs, - cache, - gitdir, - oids: [ourOid, theirOid] - }); - if (baseOids.length !== 1) { - throw new MergeNotSupportedError(); - } - const baseOid = baseOids[0]; - if (baseOid === theirOid) { - return { - oid: ourOid, - alreadyMerged: true - }; - } - if (fastForward2 && baseOid === ourOid) { - if (!dryRun && !noUpdateBranch) { - await GitRefManager.writeRef({ fs, gitdir, ref: ours, value: theirOid }); - } - return { - oid: theirOid, - fastForward: true - }; - } else { - if (fastForwardOnly) { - throw new FastForwardError(); - } - const tree = await GitIndexManager.acquire( - { fs, gitdir, cache, allowUnmerged: false }, - async (index2) => { - return mergeTree({ - fs, - cache, - dir, - gitdir, - index: index2, - ourOid, - theirOid, - baseOid, - ourName: abbreviateRef(ours), - baseName: "base", - theirName: abbreviateRef(theirs), - dryRun, - abortOnConflict, - mergeDriver - }); - } - ); - if (tree instanceof MergeConflictError) - throw tree; - if (!message) { - message = `Merge branch '${abbreviateRef(theirs)}' into ${abbreviateRef( - ours - )}`; - } - const oid = await _commit({ - fs, - cache, - gitdir, - message, - ref: ours, - tree, - parent: [ourOid, theirOid], - author, - committer, - signingKey, - onSign, - dryRun, - noUpdateBranch - }); - return { - oid, - tree, - mergeCommit: true - }; - } -} -async function _pull({ - fs, - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir, - ref, - url, - remote, - remoteRef, - prune, - pruneTags, - fastForward: fastForward2, - fastForwardOnly, - corsProxy, - singleBranch, - headers, - author, - committer, - signingKey -}) { - try { - if (!ref) { - const head = await _currentBranch({ fs, gitdir }); - if (!head) { - throw new MissingParameterError("ref"); - } - ref = head; - } - const { fetchHead, fetchHeadDescription } = await _fetch({ - fs, - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - gitdir, - corsProxy, - ref, - url, - remote, - remoteRef, - singleBranch, - headers, - prune, - pruneTags - }); - await _merge({ - fs, - cache, - gitdir, - ours: ref, - theirs: fetchHead, - fastForward: fastForward2, - fastForwardOnly, - message: `Merge ${fetchHeadDescription}`, - author, - committer, - signingKey, - dryRun: false, - noUpdateBranch: false - }); - await _checkout({ - fs, - cache, - onProgress, - dir, - gitdir, - ref, - remote, - noCheckout: false - }); - } catch (err) { - err.caller = "git.pull"; - throw err; - } -} -async function fastForward({ - fs, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir = join(dir, ".git"), - ref, - url, - remote, - remoteRef, - corsProxy, - singleBranch, - headers = {}, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("http", http); - assertParameter("gitdir", gitdir); - const thisWillNotBeUsed = { - name: "", - email: "", - timestamp: Date.now(), - timezoneOffset: 0 - }; - return await _pull({ - fs: new FileSystem(fs), - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir, - ref, - url, - remote, - remoteRef, - fastForwardOnly: true, - corsProxy, - singleBranch, - headers, - author: thisWillNotBeUsed, - committer: thisWillNotBeUsed - }); - } catch (err) { - err.caller = "git.fastForward"; - throw err; - } -} -async function fetch({ - fs, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir = join(dir, ".git"), - ref, - remote, - remoteRef, - url, - corsProxy, - depth = null, - since = null, - exclude = [], - relative: relative2 = false, - tags = false, - singleBranch = false, - headers = {}, - prune = false, - pruneTags = false, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("http", http); - assertParameter("gitdir", gitdir); - return await _fetch({ - fs: new FileSystem(fs), - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - gitdir, - ref, - remote, - remoteRef, - url, - corsProxy, - depth, - since, - exclude, - relative: relative2, - tags, - singleBranch, - headers, - prune, - pruneTags - }); - } catch (err) { - err.caller = "git.fetch"; - throw err; - } -} -async function findMergeBase({ - fs, - dir, - gitdir = join(dir, ".git"), - oids, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("oids", oids); - return await _findMergeBase({ - fs: new FileSystem(fs), - cache, - gitdir, - oids - }); - } catch (err) { - err.caller = "git.findMergeBase"; - throw err; - } -} -async function _findRoot({ fs, filepath }) { - if (await fs.exists(join(filepath, ".git"))) { - return filepath; - } else { - const parent = dirname(filepath); - if (parent === filepath) { - throw new NotFoundError(`git root for ${filepath}`); - } - return _findRoot({ fs, filepath: parent }); - } -} -async function findRoot({ fs, filepath }) { - try { - assertParameter("fs", fs); - assertParameter("filepath", filepath); - return await _findRoot({ fs: new FileSystem(fs), filepath }); - } catch (err) { - err.caller = "git.findRoot"; - throw err; - } -} -async function getConfig({ fs, dir, gitdir = join(dir, ".git"), path: path2 }) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("path", path2); - return await _getConfig({ - fs: new FileSystem(fs), - gitdir, - path: path2 - }); - } catch (err) { - err.caller = "git.getConfig"; - throw err; - } -} -async function _getConfigAll({ fs, gitdir, path: path2 }) { - const config = await GitConfigManager.get({ fs, gitdir }); - return config.getall(path2); -} -async function getConfigAll({ - fs, - dir, - gitdir = join(dir, ".git"), - path: path2 -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("path", path2); - return await _getConfigAll({ - fs: new FileSystem(fs), - gitdir, - path: path2 - }); - } catch (err) { - err.caller = "git.getConfigAll"; - throw err; - } -} -async function getRemoteInfo({ - http, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - url, - headers = {}, - forPush = false -}) { - try { - assertParameter("http", http); - assertParameter("url", url); - const GitRemoteHTTP2 = GitRemoteManager.getRemoteHelperFor({ url }); - const remote = await GitRemoteHTTP2.discover({ - http, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - service: forPush ? "git-receive-pack" : "git-upload-pack", - url, - headers, - protocolVersion: 1 - }); - const result = { - capabilities: [...remote.capabilities] - }; - for (const [ref, oid] of remote.refs) { - const parts = ref.split("/"); - const last2 = parts.pop(); - let o = result; - for (const part of parts) { - o[part] = o[part] || {}; - o = o[part]; - } - o[last2] = oid; - } - for (const [symref, ref] of remote.symrefs) { - const parts = symref.split("/"); - const last2 = parts.pop(); - let o = result; - for (const part of parts) { - o[part] = o[part] || {}; - o = o[part]; - } - o[last2] = ref; - } - return result; - } catch (err) { - err.caller = "git.getRemoteInfo"; - throw err; - } -} -function formatInfoRefs(remote, prefix, symrefs, peelTags) { - const refs = []; - for (const [key2, value] of remote.refs) { - if (prefix && !key2.startsWith(prefix)) - continue; - if (key2.endsWith("^{}")) { - if (peelTags) { - const _key = key2.replace("^{}", ""); - const last2 = refs[refs.length - 1]; - const r = last2.ref === _key ? last2 : refs.find((x) => x.ref === _key); - if (r === void 0) { - throw new Error("I did not expect this to happen"); - } - r.peeled = value; - } - continue; - } - const ref = { ref: key2, oid: value }; - if (symrefs) { - if (remote.symrefs.has(key2)) { - ref.target = remote.symrefs.get(key2); - } - } - refs.push(ref); - } - return refs; -} -async function getRemoteInfo2({ - http, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - url, - headers = {}, - forPush = false, - protocolVersion = 2 -}) { - try { - assertParameter("http", http); - assertParameter("url", url); - const GitRemoteHTTP2 = GitRemoteManager.getRemoteHelperFor({ url }); - const remote = await GitRemoteHTTP2.discover({ - http, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - service: forPush ? "git-receive-pack" : "git-upload-pack", - url, - headers, - protocolVersion - }); - if (remote.protocolVersion === 2) { - return { - protocolVersion: remote.protocolVersion, - capabilities: remote.capabilities2 - }; - } - const capabilities = {}; - for (const cap of remote.capabilities) { - const [key2, value] = cap.split("="); - if (value) { - capabilities[key2] = value; - } else { - capabilities[key2] = true; - } - } - return { - protocolVersion: 1, - capabilities, - refs: formatInfoRefs(remote, void 0, true, true) - }; - } catch (err) { - err.caller = "git.getRemoteInfo2"; - throw err; - } -} -async function hashObject({ - type, - object, - format = "content", - oid = void 0 -}) { - if (format !== "deflated") { - if (format !== "wrapped") { - object = GitObject.wrap({ type, object }); - } - oid = await shasum(object); - } - return { oid, object }; -} -async function hashBlob({ object }) { - try { - assertParameter("object", object); - if (typeof object === "string") { - object = Buffer.from(object, "utf8"); - } else { - object = Buffer.from(object); - } - const type = "blob"; - const { oid, object: _object } = await hashObject({ - type: "blob", - format: "content", - object - }); - return { oid, type, object: new Uint8Array(_object), format: "wrapped" }; - } catch (err) { - err.caller = "git.hashBlob"; - throw err; - } -} -async function _indexPack({ - fs, - cache, - onProgress, - dir, - gitdir, - filepath -}) { - try { - filepath = join(dir, filepath); - const pack = await fs.read(filepath); - const getExternalRefDelta = (oid) => _readObject({ fs, cache, gitdir, oid }); - const idx = await GitPackIndex.fromPack({ - pack, - getExternalRefDelta, - onProgress - }); - await fs.write(filepath.replace(/\.pack$/, ".idx"), await idx.toBuffer()); - return { - oids: [...idx.hashes] - }; - } catch (err) { - err.caller = "git.indexPack"; - throw err; - } -} -async function indexPack({ - fs, - onProgress, - dir, - gitdir = join(dir, ".git"), - filepath, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("dir", dir); - assertParameter("gitdir", dir); - assertParameter("filepath", filepath); - return await _indexPack({ - fs: new FileSystem(fs), - cache, - onProgress, - dir, - gitdir, - filepath - }); - } catch (err) { - err.caller = "git.indexPack"; - throw err; - } -} -async function init({ - fs, - bare = false, - dir, - gitdir = bare ? dir : join(dir, ".git"), - defaultBranch = "master" -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - if (!bare) { - assertParameter("dir", dir); - } - return await _init({ - fs: new FileSystem(fs), - bare, - dir, - gitdir, - defaultBranch - }); - } catch (err) { - err.caller = "git.init"; - throw err; - } -} -async function _isDescendent({ - fs, - cache, - gitdir, - oid, - ancestor, - depth -}) { - const shallows = await GitShallowManager.read({ fs, gitdir }); - if (!oid) { - throw new MissingParameterError("oid"); - } - if (!ancestor) { - throw new MissingParameterError("ancestor"); - } - if (oid === ancestor) - return false; - const queue = [oid]; - const visited = /* @__PURE__ */ new Set(); - let searchdepth = 0; - while (queue.length) { - if (searchdepth++ === depth) { - throw new MaxDepthError(depth); - } - const oid2 = queue.shift(); - const { type, object } = await _readObject({ - fs, - cache, - gitdir, - oid: oid2 - }); - if (type !== "commit") { - throw new ObjectTypeError(oid2, type, "commit"); - } - const commit2 = GitCommit.from(object).parse(); - for (const parent of commit2.parent) { - if (parent === ancestor) - return true; - } - if (!shallows.has(oid2)) { - for (const parent of commit2.parent) { - if (!visited.has(parent)) { - queue.push(parent); - visited.add(parent); - } - } - } - } - return false; -} -async function isDescendent({ - fs, - dir, - gitdir = join(dir, ".git"), - oid, - ancestor, - depth = -1, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - assertParameter("ancestor", ancestor); - return await _isDescendent({ - fs: new FileSystem(fs), - cache, - gitdir, - oid, - ancestor, - depth - }); - } catch (err) { - err.caller = "git.isDescendent"; - throw err; - } -} -async function isIgnored({ - fs, - dir, - gitdir = join(dir, ".git"), - filepath -}) { - try { - assertParameter("fs", fs); - assertParameter("dir", dir); - assertParameter("gitdir", gitdir); - assertParameter("filepath", filepath); - return GitIgnoreManager.isIgnored({ - fs: new FileSystem(fs), - dir, - gitdir, - filepath - }); - } catch (err) { - err.caller = "git.isIgnored"; - throw err; - } -} -async function listBranches({ - fs, - dir, - gitdir = join(dir, ".git"), - remote -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - return GitRefManager.listBranches({ - fs: new FileSystem(fs), - gitdir, - remote - }); - } catch (err) { - err.caller = "git.listBranches"; - throw err; - } -} -async function _listFiles({ fs, gitdir, ref, cache }) { - if (ref) { - const oid = await GitRefManager.resolve({ gitdir, fs, ref }); - const filenames = []; - await accumulateFilesFromOid({ - fs, - cache, - gitdir, - oid, - filenames, - prefix: "" - }); - return filenames; - } else { - return GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - return index2.entries.map((x) => x.path); - }); - } -} -async function accumulateFilesFromOid({ - fs, - cache, - gitdir, - oid, - filenames, - prefix -}) { - const { tree } = await _readTree({ fs, cache, gitdir, oid }); - for (const entry of tree) { - if (entry.type === "tree") { - await accumulateFilesFromOid({ - fs, - cache, - gitdir, - oid: entry.oid, - filenames, - prefix: join(prefix, entry.path) - }); - } else { - filenames.push(join(prefix, entry.path)); - } - } -} -async function listFiles({ - fs, - dir, - gitdir = join(dir, ".git"), - ref, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - return await _listFiles({ - fs: new FileSystem(fs), - cache, - gitdir, - ref - }); - } catch (err) { - err.caller = "git.listFiles"; - throw err; - } -} -async function _listNotes({ fs, cache, gitdir, ref }) { - let parent; - try { - parent = await GitRefManager.resolve({ gitdir, fs, ref }); - } catch (err) { - if (err instanceof NotFoundError) { - return []; - } - } - const result = await _readTree({ - fs, - cache, - gitdir, - oid: parent - }); - const notes = result.tree.map((entry) => ({ - target: entry.path, - note: entry.oid - })); - return notes; -} -async function listNotes({ - fs, - dir, - gitdir = join(dir, ".git"), - ref = "refs/notes/commits", - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - return await _listNotes({ - fs: new FileSystem(fs), - cache, - gitdir, - ref - }); - } catch (err) { - err.caller = "git.listNotes"; - throw err; - } -} -async function _listRemotes({ fs, gitdir }) { - const config = await GitConfigManager.get({ fs, gitdir }); - const remoteNames = await config.getSubsections("remote"); - const remotes = Promise.all( - remoteNames.map(async (remote) => { - const url = await config.get(`remote.${remote}.url`); - return { remote, url }; - }) - ); - return remotes; -} -async function listRemotes({ fs, dir, gitdir = join(dir, ".git") }) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - return await _listRemotes({ - fs: new FileSystem(fs), - gitdir - }); - } catch (err) { - err.caller = "git.listRemotes"; - throw err; - } -} -async function parseListRefsResponse(stream) { - const read = GitPktLine.streamReader(stream); - const refs = []; - let line; - while (true) { - line = await read(); - if (line === true) - break; - if (line === null) - continue; - line = line.toString("utf8").replace(/\n$/, ""); - const [oid, ref, ...attrs] = line.split(" "); - const r = { ref, oid }; - for (const attr2 of attrs) { - const [name, value] = attr2.split(":"); - if (name === "symref-target") { - r.target = value; - } else if (name === "peeled") { - r.peeled = value; - } - } - refs.push(r); - } - return refs; -} -async function writeListRefsRequest({ prefix, symrefs, peelTags }) { - const packstream = []; - packstream.push(GitPktLine.encode("command=ls-refs\n")); - packstream.push(GitPktLine.encode(`agent=${pkg.agent} -`)); - if (peelTags || symrefs || prefix) { - packstream.push(GitPktLine.delim()); - } - if (peelTags) - packstream.push(GitPktLine.encode("peel")); - if (symrefs) - packstream.push(GitPktLine.encode("symrefs")); - if (prefix) - packstream.push(GitPktLine.encode(`ref-prefix ${prefix}`)); - packstream.push(GitPktLine.flush()); - return packstream; -} -async function listServerRefs({ - http, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - url, - headers = {}, - forPush = false, - protocolVersion = 2, - prefix, - symrefs, - peelTags -}) { - try { - assertParameter("http", http); - assertParameter("url", url); - const remote = await GitRemoteHTTP.discover({ - http, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - service: forPush ? "git-receive-pack" : "git-upload-pack", - url, - headers, - protocolVersion - }); - if (remote.protocolVersion === 1) { - return formatInfoRefs(remote, prefix, symrefs, peelTags); - } - const body = await writeListRefsRequest({ prefix, symrefs, peelTags }); - const res = await GitRemoteHTTP.connect({ - http, - auth: remote.auth, - headers, - corsProxy, - service: forPush ? "git-receive-pack" : "git-upload-pack", - url, - body - }); - return parseListRefsResponse(res.body); - } catch (err) { - err.caller = "git.listServerRefs"; - throw err; - } -} -async function listTags({ fs, dir, gitdir = join(dir, ".git") }) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - return GitRefManager.listTags({ fs: new FileSystem(fs), gitdir }); - } catch (err) { - err.caller = "git.listTags"; - throw err; - } -} -async function resolveCommit({ fs, cache, gitdir, oid }) { - const { type, object } = await _readObject({ fs, cache, gitdir, oid }); - if (type === "tag") { - oid = GitAnnotatedTag.from(object).parse().object; - return resolveCommit({ fs, cache, gitdir, oid }); - } - if (type !== "commit") { - throw new ObjectTypeError(oid, type, "commit"); - } - return { commit: GitCommit.from(object), oid }; -} -async function _readCommit({ fs, cache, gitdir, oid }) { - const { commit: commit2, oid: commitOid } = await resolveCommit({ - fs, - cache, - gitdir, - oid - }); - const result = { - oid: commitOid, - commit: commit2.parse(), - payload: commit2.withoutSignature() - }; - return result; -} -function compareAge(a, b) { - return a.committer.timestamp - b.committer.timestamp; -} -var EMPTY_OID = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"; -async function resolveFileIdInTree({ fs, cache, gitdir, oid, fileId }) { - if (fileId === EMPTY_OID) - return; - const _oid = oid; - let filepath; - const result = await resolveTree({ fs, cache, gitdir, oid }); - const tree = result.tree; - if (fileId === result.oid) { - filepath = result.path; - } else { - filepath = await _resolveFileId({ - fs, - cache, - gitdir, - tree, - fileId, - oid: _oid - }); - if (Array.isArray(filepath)) { - if (filepath.length === 0) - filepath = void 0; - else if (filepath.length === 1) - filepath = filepath[0]; - } - } - return filepath; -} -async function _resolveFileId({ - fs, - cache, - gitdir, - tree, - fileId, - oid, - filepaths = [], - parentPath = "" -}) { - const walks = tree.entries().map(function(entry) { - let result; - if (entry.oid === fileId) { - result = join(parentPath, entry.path); - filepaths.push(result); - } else if (entry.type === "tree") { - result = _readObject({ - fs, - cache, - gitdir, - oid: entry.oid - }).then(function({ object }) { - return _resolveFileId({ - fs, - cache, - gitdir, - tree: GitTree.from(object), - fileId, - oid, - filepaths, - parentPath: join(parentPath, entry.path) - }); - }); - } - return result; - }); - await Promise.all(walks); - return filepaths; -} -async function _log({ - fs, - cache, - gitdir, - filepath, - ref, - depth, - since, - force, - follow -}) { - const sinceTimestamp = typeof since === "undefined" ? void 0 : Math.floor(since.valueOf() / 1e3); - const commits = []; - const shallowCommits = await GitShallowManager.read({ fs, gitdir }); - const oid = await GitRefManager.resolve({ fs, gitdir, ref }); - const tips = [await _readCommit({ fs, cache, gitdir, oid })]; - let lastFileOid; - let lastCommit; - let isOk; - function endCommit(commit2) { - if (isOk && filepath) - commits.push(commit2); - } - while (tips.length > 0) { - const commit2 = tips.pop(); - if (sinceTimestamp !== void 0 && commit2.commit.committer.timestamp <= sinceTimestamp) { - break; - } - if (filepath) { - let vFileOid; - try { - vFileOid = await resolveFilepath({ - fs, - cache, - gitdir, - oid: commit2.commit.tree, - filepath - }); - if (lastCommit && lastFileOid !== vFileOid) { - commits.push(lastCommit); - } - lastFileOid = vFileOid; - lastCommit = commit2; - isOk = true; - } catch (e) { - if (e instanceof NotFoundError) { - let found = follow && lastFileOid; - if (found) { - found = await resolveFileIdInTree({ - fs, - cache, - gitdir, - oid: commit2.commit.tree, - fileId: lastFileOid - }); - if (found) { - if (Array.isArray(found)) { - if (lastCommit) { - const lastFound = await resolveFileIdInTree({ - fs, - cache, - gitdir, - oid: lastCommit.commit.tree, - fileId: lastFileOid - }); - if (Array.isArray(lastFound)) { - found = found.filter((p) => lastFound.indexOf(p) === -1); - if (found.length === 1) { - found = found[0]; - filepath = found; - if (lastCommit) - commits.push(lastCommit); - } else { - found = false; - if (lastCommit) - commits.push(lastCommit); - break; - } - } - } - } else { - filepath = found; - if (lastCommit) - commits.push(lastCommit); - } - } - } - if (!found) { - if (isOk && lastFileOid) { - commits.push(lastCommit); - if (!force) - break; - } - if (!force && !follow) - throw e; - } - lastCommit = commit2; - isOk = false; - } else - throw e; - } - } else { - commits.push(commit2); - } - if (depth !== void 0 && commits.length === depth) { - endCommit(commit2); - break; - } - if (!shallowCommits.has(commit2.oid)) { - for (const oid2 of commit2.commit.parent) { - const commit3 = await _readCommit({ fs, cache, gitdir, oid: oid2 }); - if (!tips.map((commit4) => commit4.oid).includes(commit3.oid)) { - tips.push(commit3); - } - } - } - if (tips.length === 0) { - endCommit(commit2); - } - tips.sort((a, b) => compareAge(a.commit, b.commit)); - } - return commits; -} -async function log({ - fs, - dir, - gitdir = join(dir, ".git"), - filepath, - ref = "HEAD", - depth, - since, - // Date - force, - follow, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - return await _log({ - fs: new FileSystem(fs), - cache, - gitdir, - filepath, - ref, - depth, - since, - force, - follow - }); - } catch (err) { - err.caller = "git.log"; - throw err; - } -} -async function merge({ - fs: _fs, - onSign, - dir, - gitdir = join(dir, ".git"), - ours, - theirs, - fastForward: fastForward2 = true, - fastForwardOnly = false, - dryRun = false, - noUpdateBranch = false, - abortOnConflict = true, - message, - author: _author, - committer: _committer, - signingKey, - cache = {}, - mergeDriver -}) { - try { - assertParameter("fs", _fs); - if (signingKey) { - assertParameter("onSign", onSign); - } - const fs = new FileSystem(_fs); - const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); - if (!author && (!fastForwardOnly || !fastForward2)) { - throw new MissingNameError("author"); - } - const committer = await normalizeCommitterObject({ - fs, - gitdir, - author, - committer: _committer - }); - if (!committer && (!fastForwardOnly || !fastForward2)) { - throw new MissingNameError("committer"); - } - return await _merge({ - fs, - cache, - dir, - gitdir, - ours, - theirs, - fastForward: fastForward2, - fastForwardOnly, - dryRun, - noUpdateBranch, - abortOnConflict, - message, - author, - committer, - signingKey, - onSign, - mergeDriver - }); - } catch (err) { - err.caller = "git.merge"; - throw err; - } -} -var types = { - commit: 16, - tree: 32, - blob: 48, - tag: 64, - ofs_delta: 96, - ref_delta: 112 -}; -async function _pack({ - fs, - cache, - dir, - gitdir = join(dir, ".git"), - oids -}) { - const hash2 = new import_sha1.default(); - const outputStream = []; - function write(chunk, enc) { - const buff = Buffer.from(chunk, enc); - outputStream.push(buff); - hash2.update(buff); - } - async function writeObject2({ stype, object }) { - const type = types[stype]; - let length = object.length; - let multibyte = length > 15 ? 128 : 0; - const lastFour = length & 15; - length = length >>> 4; - let byte = (multibyte | type | lastFour).toString(16); - write(byte, "hex"); - while (multibyte) { - multibyte = length > 127 ? 128 : 0; - byte = multibyte | length & 127; - write(padHex(2, byte), "hex"); - length = length >>> 7; - } - write(Buffer.from(await deflate(object))); - } - write("PACK"); - write("00000002", "hex"); - write(padHex(8, oids.length), "hex"); - for (const oid of oids) { - const { type, object } = await _readObject({ fs, cache, gitdir, oid }); - await writeObject2({ write, object, stype: type }); - } - const digest = hash2.digest(); - outputStream.push(digest); - return outputStream; -} -async function _packObjects({ fs, cache, gitdir, oids, write }) { - const buffers = await _pack({ fs, cache, gitdir, oids }); - const packfile = Buffer.from(await collect(buffers)); - const packfileSha = packfile.slice(-20).toString("hex"); - const filename = `pack-${packfileSha}.pack`; - if (write) { - await fs.write(join(gitdir, `objects/pack/${filename}`), packfile); - return { filename }; - } - return { - filename, - packfile: new Uint8Array(packfile) - }; -} -async function packObjects({ - fs, - dir, - gitdir = join(dir, ".git"), - oids, - write = false, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("oids", oids); - return await _packObjects({ - fs: new FileSystem(fs), - cache, - gitdir, - oids, - write - }); - } catch (err) { - err.caller = "git.packObjects"; - throw err; - } -} -async function pull({ - fs: _fs, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir = join(dir, ".git"), - ref, - url, - remote, - remoteRef, - prune = false, - pruneTags = false, - fastForward: fastForward2 = true, - fastForwardOnly = false, - corsProxy, - singleBranch, - headers = {}, - author: _author, - committer: _committer, - signingKey, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - const fs = new FileSystem(_fs); - const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); - if (!author) - throw new MissingNameError("author"); - const committer = await normalizeCommitterObject({ - fs, - gitdir, - author, - committer: _committer - }); - if (!committer) - throw new MissingNameError("committer"); - return await _pull({ - fs, - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir, - ref, - url, - remote, - remoteRef, - fastForward: fastForward2, - fastForwardOnly, - corsProxy, - singleBranch, - headers, - author, - committer, - signingKey, - prune, - pruneTags - }); - } catch (err) { - err.caller = "git.pull"; - throw err; - } -} -async function listCommitsAndTags({ - fs, - cache, - dir, - gitdir = join(dir, ".git"), - start, - finish -}) { - const shallows = await GitShallowManager.read({ fs, gitdir }); - const startingSet = /* @__PURE__ */ new Set(); - const finishingSet = /* @__PURE__ */ new Set(); - for (const ref of start) { - startingSet.add(await GitRefManager.resolve({ fs, gitdir, ref })); - } - for (const ref of finish) { - try { - const oid = await GitRefManager.resolve({ fs, gitdir, ref }); - finishingSet.add(oid); - } catch (err) { - } - } - const visited = /* @__PURE__ */ new Set(); - async function walk2(oid) { - visited.add(oid); - const { type, object } = await _readObject({ fs, cache, gitdir, oid }); - if (type === "tag") { - const tag2 = GitAnnotatedTag.from(object); - const commit2 = tag2.headers().object; - return walk2(commit2); - } - if (type !== "commit") { - throw new ObjectTypeError(oid, type, "commit"); - } - if (!shallows.has(oid)) { - const commit2 = GitCommit.from(object); - const parents = commit2.headers().parent; - for (oid of parents) { - if (!finishingSet.has(oid) && !visited.has(oid)) { - await walk2(oid); - } - } - } - } - for (const oid of startingSet) { - await walk2(oid); - } - return visited; -} -async function listObjects({ - fs, - cache, - dir, - gitdir = join(dir, ".git"), - oids -}) { - const visited = /* @__PURE__ */ new Set(); - async function walk2(oid) { - if (visited.has(oid)) - return; - visited.add(oid); - const { type, object } = await _readObject({ fs, cache, gitdir, oid }); - if (type === "tag") { - const tag2 = GitAnnotatedTag.from(object); - const obj = tag2.headers().object; - await walk2(obj); - } else if (type === "commit") { - const commit2 = GitCommit.from(object); - const tree = commit2.headers().tree; - await walk2(tree); - } else if (type === "tree") { - const tree = GitTree.from(object); - for (const entry of tree) { - if (entry.type === "blob") { - visited.add(entry.oid); - } - if (entry.type === "tree") { - await walk2(entry.oid); - } - } - } - } - for (const oid of oids) { - await walk2(oid); - } - return visited; -} -async function parseReceivePackResponse(packfile) { - const result = {}; - let response = ""; - const read = GitPktLine.streamReader(packfile); - let line = await read(); - while (line !== true) { - if (line !== null) - response += line.toString("utf8") + "\n"; - line = await read(); - } - const lines = response.toString("utf8").split("\n"); - line = lines.shift(); - if (!line.startsWith("unpack ")) { - throw new ParseError('unpack ok" or "unpack [error message]', line); - } - result.ok = line === "unpack ok"; - if (!result.ok) { - result.error = line.slice("unpack ".length); - } - result.refs = {}; - for (const line2 of lines) { - if (line2.trim() === "") - continue; - const status2 = line2.slice(0, 2); - const refAndMessage = line2.slice(3); - let space2 = refAndMessage.indexOf(" "); - if (space2 === -1) - space2 = refAndMessage.length; - const ref = refAndMessage.slice(0, space2); - const error = refAndMessage.slice(space2 + 1); - result.refs[ref] = { - ok: status2 === "ok", - error - }; - } - return result; -} -async function writeReceivePackRequest({ - capabilities = [], - triplets = [] -}) { - const packstream = []; - let capsFirstLine = `\0 ${capabilities.join(" ")}`; - for (const trip of triplets) { - packstream.push( - GitPktLine.encode( - `${trip.oldoid} ${trip.oid} ${trip.fullRef}${capsFirstLine} -` - ) - ); - capsFirstLine = ""; - } - packstream.push(GitPktLine.flush()); - return packstream; -} -async function _push({ - fs, - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - gitdir, - ref: _ref, - remoteRef: _remoteRef, - remote, - url: _url, - force = false, - delete: _delete = false, - corsProxy, - headers = {} -}) { - const ref = _ref || await _currentBranch({ fs, gitdir }); - if (typeof ref === "undefined") { - throw new MissingParameterError("ref"); - } - const config = await GitConfigManager.get({ fs, gitdir }); - remote = remote || await config.get(`branch.${ref}.pushRemote`) || await config.get("remote.pushDefault") || await config.get(`branch.${ref}.remote`) || "origin"; - const url = _url || await config.get(`remote.${remote}.pushurl`) || await config.get(`remote.${remote}.url`); - if (typeof url === "undefined") { - throw new MissingParameterError("remote OR url"); - } - const remoteRef = _remoteRef || await config.get(`branch.${ref}.merge`); - if (typeof url === "undefined") { - throw new MissingParameterError("remoteRef"); - } - if (corsProxy === void 0) { - corsProxy = await config.get("http.corsProxy"); - } - const fullRef = await GitRefManager.expand({ fs, gitdir, ref }); - const oid = _delete ? "0000000000000000000000000000000000000000" : await GitRefManager.resolve({ fs, gitdir, ref: fullRef }); - const GitRemoteHTTP2 = GitRemoteManager.getRemoteHelperFor({ url }); - const httpRemote = await GitRemoteHTTP2.discover({ - http, - onAuth, - onAuthSuccess, - onAuthFailure, - corsProxy, - service: "git-receive-pack", - url, - headers, - protocolVersion: 1 - }); - const auth = httpRemote.auth; - let fullRemoteRef; - if (!remoteRef) { - fullRemoteRef = fullRef; - } else { - try { - fullRemoteRef = await GitRefManager.expandAgainstMap({ - ref: remoteRef, - map: httpRemote.refs - }); - } catch (err) { - if (err instanceof NotFoundError) { - fullRemoteRef = remoteRef.startsWith("refs/") ? remoteRef : `refs/heads/${remoteRef}`; - } else { - throw err; - } - } - } - const oldoid = httpRemote.refs.get(fullRemoteRef) || "0000000000000000000000000000000000000000"; - const thinPack = !httpRemote.capabilities.has("no-thin"); - let objects = /* @__PURE__ */ new Set(); - if (!_delete) { - const finish = [...httpRemote.refs.values()]; - let skipObjects = /* @__PURE__ */ new Set(); - if (oldoid !== "0000000000000000000000000000000000000000") { - const mergebase = await _findMergeBase({ - fs, - cache, - gitdir, - oids: [oid, oldoid] - }); - for (const oid2 of mergebase) - finish.push(oid2); - if (thinPack) { - skipObjects = await listObjects({ fs, cache, gitdir, oids: mergebase }); - } - } - if (!finish.includes(oid)) { - const commits = await listCommitsAndTags({ - fs, - cache, - gitdir, - start: [oid], - finish - }); - objects = await listObjects({ fs, cache, gitdir, oids: commits }); - } - if (thinPack) { - try { - const ref2 = await GitRefManager.resolve({ - fs, - gitdir, - ref: `refs/remotes/${remote}/HEAD`, - depth: 2 - }); - const { oid: oid2 } = await GitRefManager.resolveAgainstMap({ - ref: ref2.replace(`refs/remotes/${remote}/`, ""), - fullref: ref2, - map: httpRemote.refs - }); - const oids = [oid2]; - for (const oid3 of await listObjects({ fs, cache, gitdir, oids })) { - skipObjects.add(oid3); - } - } catch (e) { - } - for (const oid2 of skipObjects) { - objects.delete(oid2); - } - } - if (oid === oldoid) - force = true; - if (!force) { - if (fullRef.startsWith("refs/tags") && oldoid !== "0000000000000000000000000000000000000000") { - throw new PushRejectedError("tag-exists"); - } - if (oid !== "0000000000000000000000000000000000000000" && oldoid !== "0000000000000000000000000000000000000000" && !await _isDescendent({ - fs, - cache, - gitdir, - oid, - ancestor: oldoid, - depth: -1 - })) { - throw new PushRejectedError("not-fast-forward"); - } - } - } - const capabilities = filterCapabilities( - [...httpRemote.capabilities], - ["report-status", "side-band-64k", `agent=${pkg.agent}`] - ); - const packstream1 = await writeReceivePackRequest({ - capabilities, - triplets: [{ oldoid, oid, fullRef: fullRemoteRef }] - }); - const packstream2 = _delete ? [] : await _pack({ - fs, - cache, - gitdir, - oids: [...objects] - }); - const res = await GitRemoteHTTP2.connect({ - http, - onProgress, - corsProxy, - service: "git-receive-pack", - url, - auth, - headers, - body: [...packstream1, ...packstream2] - }); - const { packfile, progress } = await GitSideBand.demux(res.body); - if (onMessage) { - const lines = splitLines(progress); - forAwait(lines, async (line) => { - await onMessage(line); - }); - } - const result = await parseReceivePackResponse(packfile); - if (res.headers) { - result.headers = res.headers; - } - if (remote && result.ok && result.refs[fullRemoteRef].ok) { - const ref2 = `refs/remotes/${remote}/${fullRemoteRef.replace( - "refs/heads", - "" - )}`; - if (_delete) { - await GitRefManager.deleteRef({ fs, gitdir, ref: ref2 }); - } else { - await GitRefManager.writeRef({ fs, gitdir, ref: ref2, value: oid }); - } - } - if (result.ok && Object.values(result.refs).every((result2) => result2.ok)) { - return result; - } else { - const prettyDetails = Object.entries(result.refs).filter(([k, v]) => !v.ok).map(([k, v]) => ` - - ${k}: ${v.error}`).join(""); - throw new GitPushError(prettyDetails, result); - } -} -async function push({ - fs, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - dir, - gitdir = join(dir, ".git"), - ref, - remoteRef, - remote = "origin", - url, - force = false, - delete: _delete = false, - corsProxy, - headers = {}, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("http", http); - assertParameter("gitdir", gitdir); - return await _push({ - fs: new FileSystem(fs), - cache, - http, - onProgress, - onMessage, - onAuth, - onAuthSuccess, - onAuthFailure, - gitdir, - ref, - remoteRef, - remote, - url, - force, - delete: _delete, - corsProxy, - headers - }); - } catch (err) { - err.caller = "git.push"; - throw err; - } -} -async function resolveBlob({ fs, cache, gitdir, oid }) { - const { type, object } = await _readObject({ fs, cache, gitdir, oid }); - if (type === "tag") { - oid = GitAnnotatedTag.from(object).parse().object; - return resolveBlob({ fs, cache, gitdir, oid }); - } - if (type !== "blob") { - throw new ObjectTypeError(oid, type, "blob"); - } - return { oid, blob: new Uint8Array(object) }; -} -async function _readBlob({ - fs, - cache, - gitdir, - oid, - filepath = void 0 -}) { - if (filepath !== void 0) { - oid = await resolveFilepath({ fs, cache, gitdir, oid, filepath }); - } - const blob = await resolveBlob({ - fs, - cache, - gitdir, - oid - }); - return blob; -} -async function readBlob({ - fs, - dir, - gitdir = join(dir, ".git"), - oid, - filepath, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - return await _readBlob({ - fs: new FileSystem(fs), - cache, - gitdir, - oid, - filepath - }); - } catch (err) { - err.caller = "git.readBlob"; - throw err; - } -} -async function readCommit({ - fs, - dir, - gitdir = join(dir, ".git"), - oid, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - return await _readCommit({ - fs: new FileSystem(fs), - cache, - gitdir, - oid - }); - } catch (err) { - err.caller = "git.readCommit"; - throw err; - } -} -async function _readNote({ - fs, - cache, - gitdir, - ref = "refs/notes/commits", - oid -}) { - const parent = await GitRefManager.resolve({ gitdir, fs, ref }); - const { blob } = await _readBlob({ - fs, - cache, - gitdir, - oid: parent, - filepath: oid - }); - return blob; -} -async function readNote({ - fs, - dir, - gitdir = join(dir, ".git"), - ref = "refs/notes/commits", - oid, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - assertParameter("oid", oid); - return await _readNote({ - fs: new FileSystem(fs), - cache, - gitdir, - ref, - oid - }); - } catch (err) { - err.caller = "git.readNote"; - throw err; - } -} -async function readObject({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - oid, - format = "parsed", - filepath = void 0, - encoding = void 0, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - const fs = new FileSystem(_fs); - if (filepath !== void 0) { - oid = await resolveFilepath({ - fs, - cache, - gitdir, - oid, - filepath - }); - } - const _format = format === "parsed" ? "content" : format; - const result = await _readObject({ - fs, - cache, - gitdir, - oid, - format: _format - }); - result.oid = oid; - if (format === "parsed") { - result.format = "parsed"; - switch (result.type) { - case "commit": - result.object = GitCommit.from(result.object).parse(); - break; - case "tree": - result.object = GitTree.from(result.object).entries(); - break; - case "blob": - if (encoding) { - result.object = result.object.toString(encoding); - } else { - result.object = new Uint8Array(result.object); - result.format = "content"; - } - break; - case "tag": - result.object = GitAnnotatedTag.from(result.object).parse(); - break; - default: - throw new ObjectTypeError( - result.oid, - result.type, - "blob|commit|tag|tree" - ); - } - } else if (result.format === "deflated" || result.format === "wrapped") { - result.type = result.format; - } - return result; - } catch (err) { - err.caller = "git.readObject"; - throw err; - } -} -async function _readTag({ fs, cache, gitdir, oid }) { - const { type, object } = await _readObject({ - fs, - cache, - gitdir, - oid, - format: "content" - }); - if (type !== "tag") { - throw new ObjectTypeError(oid, type, "tag"); - } - const tag2 = GitAnnotatedTag.from(object); - const result = { - oid, - tag: tag2.parse(), - payload: tag2.payload() - }; - return result; -} -async function readTag({ - fs, - dir, - gitdir = join(dir, ".git"), - oid, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - return await _readTag({ - fs: new FileSystem(fs), - cache, - gitdir, - oid - }); - } catch (err) { - err.caller = "git.readTag"; - throw err; - } -} -async function readTree({ - fs, - dir, - gitdir = join(dir, ".git"), - oid, - filepath = void 0, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - return await _readTree({ - fs: new FileSystem(fs), - cache, - gitdir, - oid, - filepath - }); - } catch (err) { - err.caller = "git.readTree"; - throw err; - } -} -async function remove({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - filepath, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("filepath", filepath); - await GitIndexManager.acquire( - { fs: new FileSystem(_fs), gitdir, cache }, - async function(index2) { - index2.delete({ filepath }); - } - ); - } catch (err) { - err.caller = "git.remove"; - throw err; - } -} -async function _removeNote({ - fs, - cache, - onSign, - gitdir, - ref = "refs/notes/commits", - oid, - author, - committer, - signingKey -}) { - let parent; - try { - parent = await GitRefManager.resolve({ gitdir, fs, ref }); - } catch (err) { - if (!(err instanceof NotFoundError)) { - throw err; - } - } - const result = await _readTree({ - fs, - gitdir, - oid: parent || "4b825dc642cb6eb9a060e54bf8d69288fbee4904" - }); - let tree = result.tree; - tree = tree.filter((entry) => entry.path !== oid); - const treeOid = await _writeTree({ - fs, - gitdir, - tree - }); - const commitOid = await _commit({ - fs, - cache, - onSign, - gitdir, - ref, - tree: treeOid, - parent: parent && [parent], - message: `Note removed by 'isomorphic-git removeNote' -`, - author, - committer, - signingKey - }); - return commitOid; -} -async function removeNote({ - fs: _fs, - onSign, - dir, - gitdir = join(dir, ".git"), - ref = "refs/notes/commits", - oid, - author: _author, - committer: _committer, - signingKey, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("oid", oid); - const fs = new FileSystem(_fs); - const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); - if (!author) - throw new MissingNameError("author"); - const committer = await normalizeCommitterObject({ - fs, - gitdir, - author, - committer: _committer - }); - if (!committer) - throw new MissingNameError("committer"); - return await _removeNote({ - fs, - cache, - onSign, - gitdir, - ref, - oid, - author, - committer, - signingKey - }); - } catch (err) { - err.caller = "git.removeNote"; - throw err; - } -} -async function _renameBranch({ - fs, - gitdir, - oldref, - ref, - checkout: checkout2 = false -}) { - if (ref !== import_clean_git_ref.default.clean(ref)) { - throw new InvalidRefNameError(ref, import_clean_git_ref.default.clean(ref)); - } - if (oldref !== import_clean_git_ref.default.clean(oldref)) { - throw new InvalidRefNameError(oldref, import_clean_git_ref.default.clean(oldref)); - } - const fulloldref = `refs/heads/${oldref}`; - const fullnewref = `refs/heads/${ref}`; - const newexist = await GitRefManager.exists({ fs, gitdir, ref: fullnewref }); - if (newexist) { - throw new AlreadyExistsError("branch", ref, false); - } - const value = await GitRefManager.resolve({ - fs, - gitdir, - ref: fulloldref, - depth: 1 - }); - await GitRefManager.writeRef({ fs, gitdir, ref: fullnewref, value }); - await GitRefManager.deleteRef({ fs, gitdir, ref: fulloldref }); - const fullCurrentBranchRef = await _currentBranch({ - fs, - gitdir, - fullname: true - }); - const isCurrentBranch = fullCurrentBranchRef === fulloldref; - if (checkout2 || isCurrentBranch) { - await GitRefManager.writeSymbolicRef({ - fs, - gitdir, - ref: "HEAD", - value: fullnewref - }); - } -} -async function renameBranch({ - fs, - dir, - gitdir = join(dir, ".git"), - ref, - oldref, - checkout: checkout2 = false -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - assertParameter("oldref", oldref); - return await _renameBranch({ - fs: new FileSystem(fs), - gitdir, - ref, - oldref, - checkout: checkout2 - }); - } catch (err) { - err.caller = "git.renameBranch"; - throw err; - } -} -async function hashObject$1({ gitdir, type, object }) { - return shasum(GitObject.wrap({ type, object })); -} -async function resetIndex({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - filepath, - ref, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("filepath", filepath); - const fs = new FileSystem(_fs); - let oid; - let workdirOid; - try { - oid = await GitRefManager.resolve({ fs, gitdir, ref: ref || "HEAD" }); - } catch (e) { - if (ref) { - throw e; - } - } - if (oid) { - try { - oid = await resolveFilepath({ - fs, - cache, - gitdir, - oid, - filepath - }); - } catch (e) { - oid = null; - } - } - let stats = { - ctime: /* @__PURE__ */ new Date(0), - mtime: /* @__PURE__ */ new Date(0), - dev: 0, - ino: 0, - mode: 0, - uid: 0, - gid: 0, - size: 0 - }; - const object = dir && await fs.read(join(dir, filepath)); - if (object) { - workdirOid = await hashObject$1({ - gitdir, - type: "blob", - object - }); - if (oid === workdirOid) { - stats = await fs.lstat(join(dir, filepath)); - } - } - await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - index2.delete({ filepath }); - if (oid) { - index2.insert({ filepath, stats, oid }); - } - }); - } catch (err) { - err.caller = "git.reset"; - throw err; - } -} -async function resolveRef({ - fs, - dir, - gitdir = join(dir, ".git"), - ref, - depth -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - const oid = await GitRefManager.resolve({ - fs: new FileSystem(fs), - gitdir, - ref, - depth - }); - return oid; - } catch (err) { - err.caller = "git.resolveRef"; - throw err; - } -} -async function setConfig({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - path: path2, - value, - append: append3 = false -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("path", path2); - const fs = new FileSystem(_fs); - const config = await GitConfigManager.get({ fs, gitdir }); - if (append3) { - await config.append(path2, value); - } else { - await config.set(path2, value); - } - await GitConfigManager.save({ fs, gitdir, config }); - } catch (err) { - err.caller = "git.setConfig"; - throw err; - } -} -async function status({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - filepath, - cache = {} -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("filepath", filepath); - const fs = new FileSystem(_fs); - const ignored = await GitIgnoreManager.isIgnored({ - fs, - gitdir, - dir, - filepath - }); - if (ignored) { - return "ignored"; - } - const headTree = await getHeadTree({ fs, cache, gitdir }); - const treeOid = await getOidAtPath({ - fs, - cache, - gitdir, - tree: headTree, - path: filepath - }); - const indexEntry = await GitIndexManager.acquire( - { fs, gitdir, cache }, - async function(index2) { - for (const entry of index2) { - if (entry.path === filepath) - return entry; - } - return null; - } - ); - const stats = await fs.lstat(join(dir, filepath)); - const H = treeOid !== null; - const I = indexEntry !== null; - const W = stats !== null; - const getWorkdirOid = async () => { - if (I && !compareStats(indexEntry, stats)) { - return indexEntry.oid; - } else { - const object = await fs.read(join(dir, filepath)); - const workdirOid = await hashObject$1({ - gitdir, - type: "blob", - object - }); - if (I && indexEntry.oid === workdirOid) { - if (stats.size !== -1) { - GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - index2.insert({ filepath, stats, oid: workdirOid }); - }); - } - } - return workdirOid; - } - }; - if (!H && !W && !I) - return "absent"; - if (!H && !W && I) - return "*absent"; - if (!H && W && !I) - return "*added"; - if (!H && W && I) { - const workdirOid = await getWorkdirOid(); - return workdirOid === indexEntry.oid ? "added" : "*added"; - } - if (H && !W && !I) - return "deleted"; - if (H && !W && I) { - return treeOid === indexEntry.oid ? "*deleted" : "*deleted"; - } - if (H && W && !I) { - const workdirOid = await getWorkdirOid(); - return workdirOid === treeOid ? "*undeleted" : "*undeletemodified"; - } - if (H && W && I) { - const workdirOid = await getWorkdirOid(); - if (workdirOid === treeOid) { - return workdirOid === indexEntry.oid ? "unmodified" : "*unmodified"; - } else { - return workdirOid === indexEntry.oid ? "modified" : "*modified"; - } - } - } catch (err) { - err.caller = "git.status"; - throw err; - } -} -async function getOidAtPath({ fs, cache, gitdir, tree, path: path2 }) { - if (typeof path2 === "string") - path2 = path2.split("/"); - const dirname3 = path2.shift(); - for (const entry of tree) { - if (entry.path === dirname3) { - if (path2.length === 0) { - return entry.oid; - } - const { type, object } = await _readObject({ - fs, - cache, - gitdir, - oid: entry.oid - }); - if (type === "tree") { - const tree2 = GitTree.from(object); - return getOidAtPath({ fs, cache, gitdir, tree: tree2, path: path2 }); - } - if (type === "blob") { - throw new ObjectTypeError(entry.oid, type, "blob", path2.join("/")); - } - } - } - return null; -} -async function getHeadTree({ fs, cache, gitdir }) { - let oid; - try { - oid = await GitRefManager.resolve({ fs, gitdir, ref: "HEAD" }); - } catch (e) { - if (e instanceof NotFoundError) { - return []; - } - } - const { tree } = await _readTree({ fs, cache, gitdir, oid }); - return tree; -} -async function statusMatrix({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - ref = "HEAD", - filepaths = ["."], - filter, - cache = {}, - ignored: shouldIgnore = false -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - const fs = new FileSystem(_fs); - return await _walk({ - fs, - cache, - dir, - gitdir, - trees: [TREE({ ref }), WORKDIR(), STAGE()], - map: async function(filepath, [head, workdir, stage]) { - if (!head && !stage && workdir) { - if (!shouldIgnore) { - const isIgnored2 = await GitIgnoreManager.isIgnored({ - fs, - dir, - filepath - }); - if (isIgnored2) { - return null; - } - } - } - if (!filepaths.some((base) => worthWalking(filepath, base))) { - return null; - } - if (filter) { - if (!filter(filepath)) - return; - } - const [headType, workdirType, stageType] = await Promise.all([ - head && head.type(), - workdir && workdir.type(), - stage && stage.type() - ]); - const isBlob = [headType, workdirType, stageType].includes("blob"); - if ((headType === "tree" || headType === "special") && !isBlob) - return; - if (headType === "commit") - return null; - if ((workdirType === "tree" || workdirType === "special") && !isBlob) - return; - if (stageType === "commit") - return null; - if ((stageType === "tree" || stageType === "special") && !isBlob) - return; - const headOid = headType === "blob" ? await head.oid() : void 0; - const stageOid = stageType === "blob" ? await stage.oid() : void 0; - let workdirOid; - if (headType !== "blob" && workdirType === "blob" && stageType !== "blob") { - workdirOid = "42"; - } else if (workdirType === "blob") { - workdirOid = await workdir.oid(); - } - const entry = [void 0, headOid, workdirOid, stageOid]; - const result = entry.map((value) => entry.indexOf(value)); - result.shift(); - return [filepath, ...result]; - } - }); - } catch (err) { - err.caller = "git.statusMatrix"; - throw err; - } -} -async function tag({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - ref, - object, - force = false -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - const fs = new FileSystem(_fs); - if (ref === void 0) { - throw new MissingParameterError("ref"); - } - ref = ref.startsWith("refs/tags/") ? ref : `refs/tags/${ref}`; - const value = await GitRefManager.resolve({ - fs, - gitdir, - ref: object || "HEAD" - }); - if (!force && await GitRefManager.exists({ fs, gitdir, ref })) { - throw new AlreadyExistsError("tag", ref); - } - await GitRefManager.writeRef({ fs, gitdir, ref, value }); - } catch (err) { - err.caller = "git.tag"; - throw err; - } -} -async function updateIndex({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - cache = {}, - filepath, - oid, - mode, - add: add2, - remove: remove3, - force -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("filepath", filepath); - const fs = new FileSystem(_fs); - if (remove3) { - return await GitIndexManager.acquire( - { fs, gitdir, cache }, - async function(index2) { - let fileStats2; - if (!force) { - fileStats2 = await fs.lstat(join(dir, filepath)); - if (fileStats2) { - if (fileStats2.isDirectory()) { - throw new InvalidFilepathError("directory"); - } - return; - } - } - if (index2.has({ filepath })) { - index2.delete({ - filepath - }); - } - } - ); - } - let fileStats; - if (!oid) { - fileStats = await fs.lstat(join(dir, filepath)); - if (!fileStats) { - throw new NotFoundError( - `file at "${filepath}" on disk and "remove" not set` - ); - } - if (fileStats.isDirectory()) { - throw new InvalidFilepathError("directory"); - } - } - return await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { - if (!add2 && !index2.has({ filepath })) { - throw new NotFoundError( - `file at "${filepath}" in index and "add" not set` - ); - } - let stats = { - ctime: /* @__PURE__ */ new Date(0), - mtime: /* @__PURE__ */ new Date(0), - dev: 0, - ino: 0, - mode, - uid: 0, - gid: 0, - size: 0 - }; - if (!oid) { - stats = fileStats; - const object = stats.isSymbolicLink() ? await fs.readlink(join(dir, filepath)) : await fs.read(join(dir, filepath)); - oid = await _writeObject({ - fs, - gitdir, - type: "blob", - format: "content", - object - }); - } - index2.insert({ - filepath, - oid, - stats - }); - return oid; - }); - } catch (err) { - err.caller = "git.updateIndex"; - throw err; - } -} -function version() { - try { - return pkg.version; - } catch (err) { - err.caller = "git.version"; - throw err; - } -} -async function walk({ - fs, - dir, - gitdir = join(dir, ".git"), - trees, - map, - reduce, - iterate, - cache = {} -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("trees", trees); - return await _walk({ - fs: new FileSystem(fs), - cache, - dir, - gitdir, - trees, - map, - reduce, - iterate - }); - } catch (err) { - err.caller = "git.walk"; - throw err; - } -} -async function writeBlob({ fs, dir, gitdir = join(dir, ".git"), blob }) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("blob", blob); - return await _writeObject({ - fs: new FileSystem(fs), - gitdir, - type: "blob", - object: blob, - format: "content" - }); - } catch (err) { - err.caller = "git.writeBlob"; - throw err; - } -} -async function _writeCommit({ fs, gitdir, commit: commit2 }) { - const object = GitCommit.from(commit2).toObject(); - const oid = await _writeObject({ - fs, - gitdir, - type: "commit", - object, - format: "content" - }); - return oid; -} -async function writeCommit({ - fs, - dir, - gitdir = join(dir, ".git"), - commit: commit2 -}) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("commit", commit2); - return await _writeCommit({ - fs: new FileSystem(fs), - gitdir, - commit: commit2 - }); - } catch (err) { - err.caller = "git.writeCommit"; - throw err; - } -} -async function writeObject({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - type, - object, - format = "parsed", - oid, - encoding = void 0 -}) { - try { - const fs = new FileSystem(_fs); - if (format === "parsed") { - switch (type) { - case "commit": - object = GitCommit.from(object).toObject(); - break; - case "tree": - object = GitTree.from(object).toObject(); - break; - case "blob": - object = Buffer.from(object, encoding); - break; - case "tag": - object = GitAnnotatedTag.from(object).toObject(); - break; - default: - throw new ObjectTypeError(oid || "", type, "blob|commit|tag|tree"); - } - format = "content"; - } - oid = await _writeObject({ - fs, - gitdir, - type, - object, - oid, - format - }); - return oid; - } catch (err) { - err.caller = "git.writeObject"; - throw err; - } -} -async function writeRef({ - fs: _fs, - dir, - gitdir = join(dir, ".git"), - ref, - value, - force = false, - symbolic = false -}) { - try { - assertParameter("fs", _fs); - assertParameter("gitdir", gitdir); - assertParameter("ref", ref); - assertParameter("value", value); - const fs = new FileSystem(_fs); - if (ref !== import_clean_git_ref.default.clean(ref)) { - throw new InvalidRefNameError(ref, import_clean_git_ref.default.clean(ref)); - } - if (!force && await GitRefManager.exists({ fs, gitdir, ref })) { - throw new AlreadyExistsError("ref", ref); - } - if (symbolic) { - await GitRefManager.writeSymbolicRef({ - fs, - gitdir, - ref, - value - }); - } else { - value = await GitRefManager.resolve({ - fs, - gitdir, - ref: value - }); - await GitRefManager.writeRef({ - fs, - gitdir, - ref, - value - }); - } - } catch (err) { - err.caller = "git.writeRef"; - throw err; - } -} -async function _writeTag({ fs, gitdir, tag: tag2 }) { - const object = GitAnnotatedTag.from(tag2).toObject(); - const oid = await _writeObject({ - fs, - gitdir, - type: "tag", - object, - format: "content" - }); - return oid; -} -async function writeTag({ fs, dir, gitdir = join(dir, ".git"), tag: tag2 }) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("tag", tag2); - return await _writeTag({ - fs: new FileSystem(fs), - gitdir, - tag: tag2 - }); - } catch (err) { - err.caller = "git.writeTag"; - throw err; - } -} -async function writeTree({ fs, dir, gitdir = join(dir, ".git"), tree }) { - try { - assertParameter("fs", fs); - assertParameter("gitdir", gitdir); - assertParameter("tree", tree); - return await _writeTree({ - fs: new FileSystem(fs), - gitdir, - tree - }); - } catch (err) { - err.caller = "git.writeTree"; - throw err; - } -} -var index = { - Errors, - STAGE, - TREE, - WORKDIR, - add, - abortMerge, - addNote, - addRemote, - annotatedTag, - branch, - checkout, - clone, - commit, - getConfig, - getConfigAll, - setConfig, - currentBranch, - deleteBranch, - deleteRef, - deleteRemote, - deleteTag, - expandOid, - expandRef, - fastForward, - fetch, - findMergeBase, - findRoot, - getRemoteInfo, - getRemoteInfo2, - hashBlob, - indexPack, - init, - isDescendent, - isIgnored, - listBranches, - listFiles, - listNotes, - listRemotes, - listServerRefs, - listTags, - log, - merge, - packObjects, - pull, - push, - readBlob, - readCommit, - readNote, - readObject, - readTag, - readTree, - remove, - removeNote, - renameBranch, - resetIndex, - updateIndex, - resolveRef, - status, - statusMatrix, - tag, - version, - walk, - writeBlob, - writeCommit, - writeObject, - writeRef, - writeTag, - writeTree -}; -var isomorphic_git_default = index; + bare = ${e} +`+(e?"":` logallrefupdates = true +`)+` symlinks = false + ignorecase = true +`),await t.write(r+"/HEAD",`ref: refs/heads/${i} +`)}async function TC({fs:t,cache:e,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:h,ref:d,remote:p,depth:g,since:m,exclude:w,relative:b,singleBranch:S,noCheckout:k,noTags:x,headers:A}){try{if(await N1({fs:t,gitdir:u}),await R1({fs:t,gitdir:u,remote:p,url:f,force:!1}),h){let _=await ze.get({fs:t,gitdir:u});await _.set("http.corsProxy",h),await ze.save({fs:t,gitdir:u,config:_})}let{defaultBranch:y,fetchHead:E}=await zf({fs:t,cache:e,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:u,ref:d,remote:p,corsProxy:h,depth:g,since:m,exclude:w,relative:b,singleBranch:S,headers:A,tags:!x});if(E===null)return;d=d||y,d=d.replace("refs/heads/",""),await Uf({fs:t,cache:e,onProgress:r,onPostCheckout:l,dir:c,gitdir:u,ref:d,remote:p,noCheckout:k})}catch(y){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),y}}async function CC({fs:t,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:o,dir:l,gitdir:c=B(l,".git"),url:u,corsProxy:f=void 0,ref:h=void 0,remote:d="origin",depth:p=void 0,since:g=void 0,exclude:m=[],relative:w=!1,singleBranch:b=!1,noCheckout:S=!1,noTags:k=!1,headers:x={},cache:A={}}){try{return F("fs",t),F("http",e),F("gitdir",c),S||F("dir",l),F("url",u),await TC({fs:new Q(t),cache:A,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:o,dir:l,gitdir:c,url:u,corsProxy:f,ref:h,remote:d,depth:p,since:g,exclude:m,relative:w,singleBranch:b,noCheckout:S,noTags:k,headers:x})}catch(y){throw y.caller="git.clone",y}}async function FC({fs:t,onSign:e,dir:n,gitdir:r=B(n,".git"),message:i,author:a,committer:s,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:h,tree:d,cache:p={}}){try{F("fs",t),l||F("message",i),o&&F("onSign",e);let g=new Q(t);return await Zo({fs:g,cache:p,onSign:e,gitdir:r,message:i,author:a,committer:s,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:h,tree:d})}catch(g){throw g.caller="git.commit",g}}async function MC({fs:t,dir:e,gitdir:n=B(e,".git"),fullname:r=!1,test:i=!1}){try{return F("fs",t),F("gitdir",n),await zr({fs:new Q(t),gitdir:n,fullname:r,test:i})}catch(a){throw a.caller="git.currentBranch",a}}async function OC({fs:t,gitdir:e,ref:n}){if(n=n.startsWith("refs/heads/")?n:`refs/heads/${n}`,!await q.exists({fs:t,gitdir:e,ref:n}))throw new Re(n);let i=await q.expand({fs:t,gitdir:e,ref:n}),a=await zr({fs:t,gitdir:e,fullname:!0});if(i===a){let l=await q.resolve({fs:t,gitdir:e,ref:i});await q.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await q.deleteRef({fs:t,gitdir:e,ref:i});let s=Nr(n),o=await ze.get({fs:t,gitdir:e});await o.deleteSection("branch",s),await ze.save({fs:t,gitdir:e,config:o})}async function PC({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r}){try{return F("fs",t),F("ref",r),await OC({fs:new Q(t),gitdir:n,ref:r})}catch(i){throw i.caller="git.deleteBranch",i}}async function IC({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r}){try{F("fs",t),F("ref",r),await q.deleteRef({fs:new Q(t),gitdir:n,ref:r})}catch(i){throw i.caller="git.deleteRef",i}}async function RC({fs:t,gitdir:e,remote:n}){let r=await ze.get({fs:t,gitdir:e});await r.deleteSection("remote",n),await ze.save({fs:t,gitdir:e,config:r})}async function LC({fs:t,dir:e,gitdir:n=B(e,".git"),remote:r}){try{return F("fs",t),F("remote",r),await RC({fs:new Q(t),gitdir:n,remote:r})}catch(i){throw i.caller="git.deleteRemote",i}}async function jC({fs:t,gitdir:e,ref:n}){n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,await q.deleteRef({fs:t,gitdir:e,ref:n})}async function DC({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r}){try{return F("fs",t),F("ref",r),await jC({fs:new Q(t),gitdir:n,ref:r})}catch(i){throw i.caller="git.deleteTag",i}}async function BC({fs:t,gitdir:e,oid:n}){let r=n.slice(0,2);return(await t.readdir(`${e}/objects/${r}`)).map(a=>`${r}${a}`).filter(a=>a.startsWith(n))}async function NC({fs:t,cache:e,gitdir:n,oid:r,getExternalRefDelta:i}){let a=[],s=await t.readdir(B(n,"objects/pack"));s=s.filter(o=>o.endsWith(".idx"));for(let o of s){let l=`${n}/objects/pack/${o}`,c=await $f({fs:t,cache:e,filename:l,getExternalRefDelta:i});if(c.error)throw new ue(c.error);for(let u of c.offsets.keys())u.startsWith(r)&&a.push(u)}return a}async function $C({fs:t,cache:e,gitdir:n,oid:r}){let i=o=>Ge({fs:t,cache:e,gitdir:n,oid:o}),a=await BC({fs:t,gitdir:n,oid:r}),s=await NC({fs:t,cache:e,gitdir:n,oid:r,getExternalRefDelta:i});for(let o of s)a.indexOf(o)===-1&&a.push(o);if(a.length===1)return a[0];throw a.length>1?new Ja("oids",r,a):new Re(`an object matching "${r}"`)}async function HC({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,cache:i={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await $C({fs:new Q(t),cache:i,gitdir:n,oid:r})}catch(a){throw a.caller="git.expandOid",a}}async function UC({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r}){try{return F("fs",t),F("gitdir",n),F("ref",r),await q.expand({fs:new Q(t),gitdir:n,ref:r})}catch(i){throw i.caller="git.expandRef",i}}async function Gf({fs:t,cache:e,gitdir:n,oids:r}){let i={},a=r.length,s=r.map((o,l)=>({index:l,oid:o}));for(;s.length;){let o=new Set;for(let{oid:c,index:u}of s)i[c]||(i[c]=new Set),i[c].add(u),i[c].size===a&&o.add(c);if(o.size>0)return[...o];let l=new Map;for(let{oid:c,index:u}of s)try{let{object:f}=await Ge({fs:t,cache:e,gitdir:n,oid:c}),h=Rt.from(f),{parent:d}=h.parseHeaders();for(let p of d)(!i[p]||!i[p].has(u))&&l.set(p+":"+u,{oid:p,index:u})}catch(f){}s=Array.from(l.values())}return[]}var kf=/^.*(\r?\n|$)/gm;function zC({branches:t,contents:e}){let n=t[1],r=t[2],i=e[0],a=e[1],s=e[2],o=a.match(kf),l=i.match(kf),c=s.match(kf),u=(0,b1.default)(o,l,c),f=7,h="",d=!0;for(let p of u)p.ok&&(h+=p.ok.join("")),p.conflict&&(d=!1,h+=`${"<".repeat(f)} ${n} +`,h+=p.conflict.a.join(""),h+=`${"=".repeat(f)} +`,h+=p.conflict.b.join(""),h+=`${">".repeat(f)} ${r} +`);return{cleanMerge:d,mergedText:h}}async function GC({fs:t,cache:e,dir:n,gitdir:r=B(n,".git"),index:i,ourOid:a,baseOid:s,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:h=!0,mergeDriver:d}){let p=sr({ref:a}),g=sr({ref:s}),m=sr({ref:o}),w=[],b=[],S=[],k=[],x=await Pi({fs:t,cache:e,dir:n,gitdir:r,trees:[p,g,m],map:async function(A,[y,E,_]){let C=jo(A),M=await Ho(y,E),L=await Ho(_,E);switch(`${M}-${L}`){case"false-false":return{mode:await E.mode(),path:C,oid:await E.oid(),type:await E.type()};case"false-true":return _?{mode:await _.mode(),path:C,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return y?{mode:await y.mode(),path:C,oid:await y.oid(),type:await y.type()}:void 0;case"true-true":{if(y&&E&&_&&await y.type()==="blob"&&await E.type()==="blob"&&await _.type()==="blob")return VC({fs:t,gitdir:r,path:C,ours:y,base:E,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:d}).then(async N=>{if(N.cleanMerge)h||i.insert({filepath:A,oid:N.mergeResult.oid,stage:0});else if(w.push(A),b.push(A),!h){let j=await E.oid(),Y=await y.oid(),le=await _.oid();i.delete({filepath:A}),i.insert({filepath:A,oid:j,stage:1}),i.insert({filepath:A,oid:Y,stage:2}),i.insert({filepath:A,oid:le,stage:3})}return N.mergeResult});if(E&&!y&&_&&await E.type()==="blob"&&await _.type()==="blob"){if(w.push(A),S.push(A),!h){let N=await E.oid(),j=await _.oid();i.delete({filepath:A}),i.insert({filepath:A,oid:N,stage:1}),i.insert({filepath:A,oid:j,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:C}}if(E&&y&&!_&&await E.type()==="blob"&&await y.type()==="blob"){if(w.push(A),k.push(A),!h){let N=await E.oid(),j=await y.oid();i.delete({filepath:A}),i.insert({filepath:A,oid:N,stage:1}),i.insert({filepath:A,oid:j,stage:2})}return{mode:await y.mode(),oid:await y.oid(),type:"blob",path:C}}if(E&&!y&&!_&&await E.type()==="blob")return;throw new Ti}}},reduce:w.length!==0&&(!n||h)?void 0:async(A,y)=>{let E=y.filter(Boolean);if(A&&!(A&&A.type==="tree"&&E.length===0)){if(E.length>0){let C=new It(E).toObject(),M=await zt({fs:t,gitdir:r,type:"tree",object:C,dryRun:f});A.oid=M}return A}}});return w.length!==0?(n&&!h&&await Pi({fs:t,cache:e,dir:n,gitdir:r,trees:[sr({ref:x.oid})],map:async function(A,[y]){let E=`${n}/${A}`;if(await y.type()==="blob"){let _=await y.mode(),C=new TextDecoder().decode(await y.content());await t.write(E,C,{mode:_})}return!0}}),new Ci(w,b,S,k)):x.oid}async function VC({fs:t,gitdir:e,path:n,ours:r,base:i,theirs:a,ourName:s,theirName:o,baseName:l,dryRun:c,mergeDriver:u=zC}){let f="blob",h=await i.mode()===await r.mode()?await a.mode():await r.mode();if(await r.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:h,path:n,oid:await r.oid(),type:f}};if(await r.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:h,path:n,oid:await a.oid(),type:f}};if(await a.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:h,path:n,oid:await r.oid(),type:f}};let d=Buffer.from(await r.content()).toString("utf8"),p=Buffer.from(await i.content()).toString("utf8"),g=Buffer.from(await a.content()).toString("utf8"),{mergedText:m,cleanMerge:w}=await u({branches:[l,s,o],contents:[p,d,g],path:n}),b=await zt({fs:t,gitdir:e,type:"blob",object:Buffer.from(m,"utf8"),dryRun:c});return{cleanMerge:w,mergeResult:{mode:h,path:n,oid:b,type:f}}}async function $1({fs:t,cache:e,dir:n,gitdir:r,ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:h,committer:d,signingKey:p,onSign:g,mergeDriver:m}){i===void 0&&(i=await zr({fs:t,gitdir:r,fullname:!0})),i=await q.expand({fs:t,gitdir:r,ref:i}),a=await q.expand({fs:t,gitdir:r,ref:a});let w=await q.resolve({fs:t,gitdir:r,ref:i}),b=await q.resolve({fs:t,gitdir:r,ref:a}),S=await Gf({fs:t,cache:e,gitdir:r,oids:[w,b]});if(S.length!==1)throw new Ti;let k=S[0];if(k===b)return{oid:w,alreadyMerged:!0};if(s&&k===w)return!l&&!c&&await q.writeRef({fs:t,gitdir:r,ref:i,value:b}),{oid:b,fastForward:!0};{if(o)throw new ns;let x=await lt.acquire({fs:t,gitdir:r,cache:e,allowUnmerged:!1},async y=>GC({fs:t,cache:e,dir:n,gitdir:r,index:y,ourOid:w,theirOid:b,baseOid:k,ourName:Nr(i),baseName:"base",theirName:Nr(a),dryRun:l,abortOnConflict:u,mergeDriver:m}));if(x instanceof Ci)throw x;return f||(f=`Merge branch '${Nr(a)}' into ${Nr(i)}`),{oid:await Zo({fs:t,cache:e,gitdir:r,message:f,ref:i,tree:x,parent:[w,b],author:h,committer:d,signingKey:p,onSign:g,dryRun:l,noUpdateBranch:c}),tree:x,mergeCommit:!0}}}async function H1({fs:t,cache:e,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,dir:l,gitdir:c,ref:u,url:f,remote:h,remoteRef:d,prune:p,pruneTags:g,fastForward:m,fastForwardOnly:w,corsProxy:b,singleBranch:S,headers:k,author:x,committer:A,signingKey:y}){try{if(!u){let C=await zr({fs:t,gitdir:c});if(!C)throw new Pt("ref");u=C}let{fetchHead:E,fetchHeadDescription:_}=await zf({fs:t,cache:e,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:c,corsProxy:b,ref:u,url:f,remote:h,remoteRef:d,singleBranch:S,headers:k,prune:p,pruneTags:g});await $1({fs:t,cache:e,gitdir:c,ours:u,theirs:E,fastForward:m,fastForwardOnly:w,message:`Merge ${_}`,author:x,committer:A,signingKey:y,dryRun:!1,noUpdateBranch:!1}),await Uf({fs:t,cache:e,onProgress:r,dir:l,gitdir:c,ref:u,remote:h,noCheckout:!1})}catch(E){throw E.caller="git.pull",E}}async function WC({fs:t,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l=B(o,".git"),ref:c,url:u,remote:f,remoteRef:h,corsProxy:d,singleBranch:p,headers:g={},cache:m={}}){try{F("fs",t),F("http",e),F("gitdir",l);let w={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await H1({fs:new Q(t),cache:m,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l,ref:c,url:u,remote:f,remoteRef:h,fastForwardOnly:!0,corsProxy:d,singleBranch:p,headers:g,author:w,committer:w})}catch(w){throw w.caller="git.fastForward",w}}async function qC({fs:t,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l=B(o,".git"),ref:c,remote:u,remoteRef:f,url:h,corsProxy:d,depth:p=null,since:g=null,exclude:m=[],relative:w=!1,tags:b=!1,singleBranch:S=!1,headers:k={},prune:x=!1,pruneTags:A=!1,cache:y={}}){try{return F("fs",t),F("http",e),F("gitdir",l),await zf({fs:new Q(t),cache:y,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:l,ref:c,remote:u,remoteRef:f,url:h,corsProxy:d,depth:p,since:g,exclude:m,relative:w,tags:b,singleBranch:S,headers:k,prune:x,pruneTags:A})}catch(E){throw E.caller="git.fetch",E}}async function XC({fs:t,dir:e,gitdir:n=B(e,".git"),oids:r,cache:i={}}){try{return F("fs",t),F("gitdir",n),F("oids",r),await Gf({fs:new Q(t),cache:i,gitdir:n,oids:r})}catch(a){throw a.caller="git.findMergeBase",a}}async function U1({fs:t,filepath:e}){if(await t.exists(B(e,".git")))return e;{let n=ki(e);if(n===e)throw new Re(`git root for ${e}`);return U1({fs:t,filepath:n})}}async function YC({fs:t,filepath:e}){try{return F("fs",t),F("filepath",e),await U1({fs:new Q(t),filepath:e})}catch(n){throw n.caller="git.findRoot",n}}async function ZC({fs:t,dir:e,gitdir:n=B(e,".git"),path:r}){try{return F("fs",t),F("gitdir",n),F("path",r),await fs({fs:new Q(t),gitdir:n,path:r})}catch(i){throw i.caller="git.getConfig",i}}async function KC({fs:t,gitdir:e,path:n}){return(await ze.get({fs:t,gitdir:e})).getall(n)}async function JC({fs:t,dir:e,gitdir:n=B(e,".git"),path:r}){try{return F("fs",t),F("gitdir",n),F("path",r),await KC({fs:new Q(t),gitdir:n,path:r})}catch(i){throw i.caller="git.getConfigAll",i}}async function QC({http:t,onAuth:e,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:s={},forPush:o=!1}){try{F("http",t),F("url",a);let c=await ji.getRemoteHelperFor({url:a}).discover({http:t,onAuth:e,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[f,h]of c.refs){let d=f.split("/"),p=d.pop(),g=u;for(let m of d)g[m]=g[m]||{},g=g[m];g[p]=h}for(let[f,h]of c.symrefs){let d=f.split("/"),p=d.pop(),g=u;for(let m of d)g[m]=g[m]||{},g=g[m];g[p]=h}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function z1(t,e,n,r){let i=[];for(let[a,s]of t.refs){if(e&&!a.startsWith(e))continue;if(a.endsWith("^{}")){if(r){let l=a.replace("^{}",""),c=i[i.length-1],u=c.ref===l?c:i.find(f=>f.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=s}continue}let o={ref:a,oid:s};n&&t.symrefs.has(a)&&(o.target=t.symrefs.get(a)),i.push(o)}return i}async function e8({http:t,onAuth:e,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:s={},forPush:o=!1,protocolVersion:l=2}){try{F("http",t),F("url",a);let u=await ji.getRemoteHelperFor({url:a}).discover({http:t,onAuth:e,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let f={};for(let h of u.capabilities){let[d,p]=h.split("=");p?f[d]=p:f[d]=!0}return{protocolVersion:1,capabilities:f,refs:z1(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function t8({type:t,object:e,format:n="content",oid:r=void 0}){return n!=="deflated"&&(n!=="wrapped"&&(e=lr.wrap({type:t,object:e})),r=await Un(e)),{oid:r,object:e}}async function n8({object:t}){try{F("object",t),typeof t=="string"?t=Buffer.from(t,"utf8"):t=Buffer.from(t);let e="blob",{oid:n,object:r}=await t8({type:"blob",format:"content",object:t});return{oid:n,type:e,object:new Uint8Array(r),format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}async function r8({fs:t,cache:e,onProgress:n,dir:r,gitdir:i,filepath:a}){try{a=B(r,a);let s=await t.read(a),o=c=>Ge({fs:t,cache:e,gitdir:i,oid:c}),l=await Ka.fromPack({pack:s,getExternalRefDelta:o,onProgress:n});return await t.write(a.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(s){throw s.caller="git.indexPack",s}}async function i8({fs:t,onProgress:e,dir:n,gitdir:r=B(n,".git"),filepath:i,cache:a={}}){try{return F("fs",t),F("dir",n),F("gitdir",n),F("filepath",i),await r8({fs:new Q(t),cache:a,onProgress:e,dir:n,gitdir:r,filepath:i})}catch(s){throw s.caller="git.indexPack",s}}async function a8({fs:t,bare:e=!1,dir:n,gitdir:r=e?n:B(n,".git"),defaultBranch:i="master"}){try{return F("fs",t),F("gitdir",r),e||F("dir",n),await N1({fs:new Q(t),bare:e,dir:n,gitdir:r,defaultBranch:i})}catch(a){throw a.caller="git.init",a}}async function G1({fs:t,cache:e,gitdir:n,oid:r,ancestor:i,depth:a}){let s=await Ur.read({fs:t,gitdir:n});if(!r)throw new Pt("oid");if(!i)throw new Pt("ancestor");if(r===i)return!1;let o=[r],l=new Set,c=0;for(;o.length;){if(c++===a)throw new is(a);let u=o.shift(),{type:f,object:h}=await Ge({fs:t,cache:e,gitdir:n,oid:u});if(f!=="commit")throw new kt(u,f,"commit");let d=Rt.from(h).parse();for(let p of d.parent)if(p===i)return!0;if(!s.has(u))for(let p of d.parent)l.has(p)||(o.push(p),l.add(p))}return!1}async function s8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,ancestor:i,depth:a=-1,cache:s={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),F("ancestor",i),await G1({fs:new Q(t),cache:s,gitdir:n,oid:r,ancestor:i,depth:a})}catch(o){throw o.caller="git.isDescendent",o}}async function o8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r}){try{return F("fs",t),F("dir",e),F("gitdir",n),F("filepath",r),Ii.isIgnored({fs:new Q(t),dir:e,gitdir:n,filepath:r})}catch(i){throw i.caller="git.isIgnored",i}}async function l8({fs:t,dir:e,gitdir:n=B(e,".git"),remote:r}){try{return F("fs",t),F("gitdir",n),q.listBranches({fs:new Q(t),gitdir:n,remote:r})}catch(i){throw i.caller="git.listBranches",i}}async function c8({fs:t,gitdir:e,ref:n,cache:r}){if(n){let i=await q.resolve({gitdir:e,fs:t,ref:n}),a=[];return await V1({fs:t,cache:r,gitdir:e,oid:i,filenames:a,prefix:""}),a}else return lt.acquire({fs:t,gitdir:e,cache:r},async function(i){return i.entries.map(a=>a.path)})}async function V1({fs:t,cache:e,gitdir:n,oid:r,filenames:i,prefix:a}){let{tree:s}=await Di({fs:t,cache:e,gitdir:n,oid:r});for(let o of s)o.type==="tree"?await V1({fs:t,cache:e,gitdir:n,oid:o.oid,filenames:i,prefix:B(a,o.path)}):i.push(B(a,o.path))}async function u8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r,cache:i={}}){try{return F("fs",t),F("gitdir",n),await c8({fs:new Q(t),cache:i,gitdir:n,ref:r})}catch(a){throw a.caller="git.listFiles",a}}async function f8({fs:t,cache:e,gitdir:n,ref:r}){let i;try{i=await q.resolve({gitdir:n,fs:t,ref:r})}catch(o){if(o instanceof Re)return[]}return(await Di({fs:t,cache:e,gitdir:n,oid:i})).tree.map(o=>({target:o.path,note:o.oid}))}async function h8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r="refs/notes/commits",cache:i={}}){try{return F("fs",t),F("gitdir",n),F("ref",r),await f8({fs:new Q(t),cache:i,gitdir:n,ref:r})}catch(a){throw a.caller="git.listNotes",a}}async function d8({fs:t,gitdir:e}){let n=await ze.get({fs:t,gitdir:e}),r=await n.getSubsections("remote");return Promise.all(r.map(async a=>{let s=await n.get(`remote.${a}.url`);return{remote:a,url:s}}))}async function p8({fs:t,dir:e,gitdir:n=B(e,".git")}){try{return F("fs",t),F("gitdir",n),await d8({fs:new Q(t),gitdir:n})}catch(r){throw r.caller="git.listRemotes",r}}async function m8(t){let e=Ue.streamReader(t),n=[],r;for(;r=await e(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let[i,a,...s]=r.split(" "),o={ref:a,oid:i};for(let l of s){let[c,u]=l.split(":");c==="symref-target"?o.target=u:c==="peeled"&&(o.peeled=u)}n.push(o)}return n}async function g8({prefix:t,symrefs:e,peelTags:n}){let r=[];return r.push(Ue.encode(`command=ls-refs +`)),r.push(Ue.encode(`agent=${Ko.agent} +`)),(n||e||t)&&r.push(Ue.delim()),n&&r.push(Ue.encode("peel")),e&&r.push(Ue.encode("symrefs")),t&&r.push(Ue.encode(`ref-prefix ${t}`)),r.push(Ue.flush()),r}async function y8({http:t,onAuth:e,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:s={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{F("http",t),F("url",a);let h=await Li.discover({http:t,onAuth:e,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:l});if(h.protocolVersion===1)return z1(h,c,u,f);let d=await g8({prefix:c,symrefs:u,peelTags:f}),p=await Li.connect({http:t,auth:h.auth,headers:s,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,body:d});return m8(p.body)}catch(h){throw h.caller="git.listServerRefs",h}}async function v8({fs:t,dir:e,gitdir:n=B(e,".git")}){try{return F("fs",t),F("gitdir",n),q.listTags({fs:new Q(t),gitdir:n})}catch(r){throw r.caller="git.listTags",r}}function w8(t,e){return t.committer.timestamp-e.committer.timestamp}var b8="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function y1({fs:t,cache:e,gitdir:n,oid:r,fileId:i}){if(i===b8)return;let a=r,s,o=await Oi({fs:t,cache:e,gitdir:n,oid:r}),l=o.tree;return i===o.oid?s=o.path:(s=await W1({fs:t,cache:e,gitdir:n,tree:l,fileId:i,oid:a}),Array.isArray(s)&&(s.length===0?s=void 0:s.length===1&&(s=s[0]))),s}async function W1({fs:t,cache:e,gitdir:n,tree:r,fileId:i,oid:a,filepaths:s=[],parentPath:o=""}){let l=r.entries().map(function(c){let u;return c.oid===i?(u=B(o,c.path),s.push(u)):c.type==="tree"&&(u=Ge({fs:t,cache:e,gitdir:n,oid:c.oid}).then(function({object:f}){return W1({fs:t,cache:e,gitdir:n,tree:It.from(f),fileId:i,oid:a,filepaths:s,parentPath:B(o,c.path)})})),u});return await Promise.all(l),s}async function x8({fs:t,cache:e,gitdir:n,filepath:r,ref:i,depth:a,since:s,force:o,follow:l}){let c=typeof s=="undefined"?void 0:Math.floor(s.valueOf()/1e3),u=[],f=await Ur.read({fs:t,gitdir:n}),h=await q.resolve({fs:t,gitdir:n,ref:i}),d=[await Uo({fs:t,cache:e,gitdir:n,oid:h})],p,g,m;function w(b){m&&r&&u.push(b)}for(;d.length>0;){let b=d.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(r){let S;try{S=await ds({fs:t,cache:e,gitdir:n,oid:b.commit.tree,filepath:r}),g&&p!==S&&u.push(g),p=S,g=b,m=!0}catch(k){if(k instanceof Re){let x=l&&p;if(x&&(x=await y1({fs:t,cache:e,gitdir:n,oid:b.commit.tree,fileId:p}),x))if(Array.isArray(x)){if(g){let A=await y1({fs:t,cache:e,gitdir:n,oid:g.commit.tree,fileId:p});if(Array.isArray(A))if(x=x.filter(y=>A.indexOf(y)===-1),x.length===1)x=x[0],r=x,g&&u.push(g);else{x=!1,g&&u.push(g);break}}}else r=x,g&&u.push(g);if(!x){if(m&&p&&(u.push(g),!o))break;if(!o&&!l)throw k}g=b,m=!1}else throw k}}else u.push(b);if(a!==void 0&&u.length===a){w(b);break}if(!f.has(b.oid))for(let S of b.commit.parent){let k=await Uo({fs:t,cache:e,gitdir:n,oid:S});d.map(x=>x.oid).includes(k.oid)||d.push(k)}d.length===0&&w(b),d.sort((S,k)=>w8(S.commit,k.commit))}return u}async function _8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r,ref:i="HEAD",depth:a,since:s,force:o,follow:l,cache:c={}}){try{return F("fs",t),F("gitdir",n),F("ref",i),await x8({fs:new Q(t),cache:c,gitdir:n,filepath:r,ref:i,depth:a,since:s,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function S8({fs:t,onSign:e,dir:n,gitdir:r=B(n,".git"),ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:h,committer:d,signingKey:p,cache:g={},mergeDriver:m}){try{F("fs",t),p&&F("onSign",e);let w=new Q(t),b=await Hr({fs:w,gitdir:r,author:h});if(!b&&(!o||!s))throw new At("author");let S=await Ri({fs:w,gitdir:r,author:b,committer:d});if(!S&&(!o||!s))throw new At("committer");return await $1({fs:w,cache:g,dir:n,gitdir:r,ours:i,theirs:a,fastForward:s,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:b,committer:S,signingKey:p,onSign:e,mergeDriver:m})}catch(w){throw w.caller="git.merge",w}}var E8={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function q1({fs:t,cache:e,dir:n,gitdir:r=B(n,".git"),oids:i}){let a=new Nf.default,s=[];function o(u,f){let h=Buffer.from(u,f);s.push(h),a.update(h)}async function l({stype:u,object:f}){let h=E8[u],d=f.length,p=d>15?128:0,g=d&15;d=d>>>4;let m=(p|h|g).toString(16);for(o(m,"hex");p;)p=d>127?128:0,m=p|d&127,o(Bf(2,m),"hex"),d=d>>>7;o(Buffer.from(await F1(f)))}o("PACK"),o("00000002","hex"),o(Bf(8,i.length),"hex");for(let u of i){let{type:f,object:h}=await Ge({fs:t,cache:e,gitdir:r,oid:u});await l({write:o,object:h,stype:f})}let c=a.digest();return s.push(c),s}async function k8({fs:t,cache:e,gitdir:n,oids:r,write:i}){let a=await q1({fs:t,cache:e,gitdir:n,oids:r}),s=Buffer.from(await zo(a)),l=`pack-${s.slice(-20).toString("hex")}.pack`;return i?(await t.write(B(n,`objects/pack/${l}`),s),{filename:l}):{filename:l,packfile:new Uint8Array(s)}}async function A8({fs:t,dir:e,gitdir:n=B(e,".git"),oids:r,write:i=!1,cache:a={}}){try{return F("fs",t),F("gitdir",n),F("oids",r),await k8({fs:new Q(t),cache:a,gitdir:n,oids:r,write:i})}catch(s){throw s.caller="git.packObjects",s}}async function T8({fs:t,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l=B(o,".git"),ref:c,url:u,remote:f,remoteRef:h,prune:d=!1,pruneTags:p=!1,fastForward:g=!0,fastForwardOnly:m=!1,corsProxy:w,singleBranch:b,headers:S={},author:k,committer:x,signingKey:A,cache:y={}}){try{F("fs",t),F("gitdir",l);let E=new Q(t),_=await Hr({fs:E,gitdir:l,author:k});if(!_)throw new At("author");let C=await Ri({fs:E,gitdir:l,author:_,committer:x});if(!C)throw new At("committer");return await H1({fs:E,cache:y,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l,ref:c,url:u,remote:f,remoteRef:h,fastForward:g,fastForwardOnly:m,corsProxy:w,singleBranch:b,headers:S,author:_,committer:C,signingKey:A,prune:d,pruneTags:p})}catch(E){throw E.caller="git.pull",E}}async function C8({fs:t,cache:e,dir:n,gitdir:r=B(n,".git"),start:i,finish:a}){let s=await Ur.read({fs:t,gitdir:r}),o=new Set,l=new Set;for(let f of i)o.add(await q.resolve({fs:t,gitdir:r,ref:f}));for(let f of a)try{let h=await q.resolve({fs:t,gitdir:r,ref:f});l.add(h)}catch(h){}let c=new Set;async function u(f){c.add(f);let{type:h,object:d}=await Ge({fs:t,cache:e,gitdir:r,oid:f});if(h==="tag"){let g=Ut.from(d).headers().object;return u(g)}if(h!=="commit")throw new kt(f,h,"commit");if(!s.has(f)){let g=Rt.from(d).headers().parent;for(f of g)!l.has(f)&&!c.has(f)&&await u(f)}}for(let f of o)await u(f);return c}async function Af({fs:t,cache:e,dir:n,gitdir:r=B(n,".git"),oids:i}){let a=new Set;async function s(o){if(a.has(o))return;a.add(o);let{type:l,object:c}=await Ge({fs:t,cache:e,gitdir:r,oid:o});if(l==="tag"){let f=Ut.from(c).headers().object;await s(f)}else if(l==="commit"){let f=Rt.from(c).headers().tree;await s(f)}else if(l==="tree"){let u=It.from(c);for(let f of u)f.type==="blob"&&a.add(f.oid),f.type==="tree"&&await s(f.oid)}}for(let o of i)await s(o);return a}async function F8(t){let e={},n="",r=Ue.streamReader(t),i=await r();for(;i!==!0;)i!==null&&(n+=i.toString("utf8")+` +`),i=await r();let a=n.toString("utf8").split(` +`);if(i=a.shift(),!i.startsWith("unpack "))throw new $r('unpack ok" or "unpack [error message]',i);e.ok=i==="unpack ok",e.ok||(e.error=i.slice(7)),e.refs={};for(let s of a){if(s.trim()==="")continue;let o=s.slice(0,2),l=s.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);e.refs[u]={ok:o==="ok",error:f}}return e}async function M8({capabilities:t=[],triplets:e=[]}){let n=[],r=`\0 ${t.join(" ")}`;for(let i of e)n.push(Ue.encode(`${i.oldoid} ${i.oid} ${i.fullRef}${r} +`)),r="";return n.push(Ue.flush()),n}async function O8({fs:t,cache:e,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:h,url:d,force:p=!1,delete:g=!1,corsProxy:m,headers:w={}}){let b=u||await zr({fs:t,gitdir:c});if(typeof b=="undefined")throw new Pt("ref");let S=await ze.get({fs:t,gitdir:c});h=h||await S.get(`branch.${b}.pushRemote`)||await S.get("remote.pushDefault")||await S.get(`branch.${b}.remote`)||"origin";let k=d||await S.get(`remote.${h}.pushurl`)||await S.get(`remote.${h}.url`);if(typeof k=="undefined")throw new Pt("remote OR url");let x=f||await S.get(`branch.${b}.merge`);if(typeof k=="undefined")throw new Pt("remoteRef");m===void 0&&(m=await S.get("http.corsProxy"));let A=await q.expand({fs:t,gitdir:c,ref:b}),y=g?"0000000000000000000000000000000000000000":await q.resolve({fs:t,gitdir:c,ref:A}),E=ji.getRemoteHelperFor({url:k}),_=await E.discover({http:n,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:m,service:"git-receive-pack",url:k,headers:w,protocolVersion:1}),C=_.auth,M;if(!x)M=A;else try{M=await q.expandAgainstMap({ref:x,map:_.refs})}catch(G){if(G instanceof Re)M=x.startsWith("refs/")?x:`refs/heads/${x}`;else throw G}let L=_.refs.get(M)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:h,url:k,localRef:{ref:g?"(delete)":A,oid:y},remoteRef:{ref:M,oid:L}}))throw new Mi;let N=!_.capabilities.has("no-thin"),j=new Set;if(!g){let G=[..._.refs.values()],D=new Set;if(L!=="0000000000000000000000000000000000000000"){let se=await Gf({fs:t,cache:e,gitdir:c,oids:[y,L]});for(let Se of se)G.push(Se);N&&(D=await Af({fs:t,cache:e,gitdir:c,oids:se}))}if(!G.includes(y)){let se=await C8({fs:t,cache:e,gitdir:c,start:[y],finish:G});j=await Af({fs:t,cache:e,gitdir:c,oids:se})}if(N){try{let se=await q.resolve({fs:t,gitdir:c,ref:`refs/remotes/${h}/HEAD`,depth:2}),{oid:Se}=await q.resolveAgainstMap({ref:se.replace(`refs/remotes/${h}/`,""),fullref:se,map:_.refs}),mt=[Se];for(let be of await Af({fs:t,cache:e,gitdir:c,oids:mt}))D.add(be)}catch(se){}for(let se of D)j.delete(se)}if(y===L&&(p=!0),!p){if(A.startsWith("refs/tags")&&L!=="0000000000000000000000000000000000000000")throw new Fi("tag-exists");if(y!=="0000000000000000000000000000000000000000"&&L!=="0000000000000000000000000000000000000000"&&!await G1({fs:t,cache:e,gitdir:c,oid:y,ancestor:L,depth:-1}))throw new Fi("not-fast-forward")}}let Y=D1([..._.capabilities],["report-status","side-band-64k",`agent=${Ko.agent}`]),le=await M8({capabilities:Y,triplets:[{oldoid:L,oid:y,fullRef:M}]}),he=g?[]:await q1({fs:t,cache:e,gitdir:c,oids:[...j]}),ie=await E.connect({http:n,onProgress:r,corsProxy:m,service:"git-receive-pack",url:k,auth:C,headers:w,body:[...le,...he]}),{packfile:Me,progress:de}=await Go.demux(ie.body);if(i){let G=B1(de);ps(G,async D=>{await i(D)})}let $=await F8(Me);if(ie.headers&&($.headers=ie.headers),h&&$.ok&&$.refs[M].ok&&!A.startsWith("refs/tags")){let G=`refs/remotes/${h}/${M.replace("refs/heads","")}`;g?await q.deleteRef({fs:t,gitdir:c,ref:G}):await q.writeRef({fs:t,gitdir:c,ref:G,value:y})}if($.ok&&Object.values($.refs).every(G=>G.ok))return $;{let G=Object.entries($.refs).filter(([D,se])=>!se.ok).map(([D,se])=>` + - ${D}: ${se.error}`).join("");throw new rs(G,$)}}async function P8({fs:t,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,dir:l,gitdir:c=B(l,".git"),ref:u,remoteRef:f,remote:h="origin",url:d,force:p=!1,delete:g=!1,corsProxy:m,headers:w={},cache:b={}}){try{return F("fs",t),F("http",e),F("gitdir",c),await O8({fs:new Q(t),cache:b,http:e,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,gitdir:c,ref:u,remoteRef:f,remote:h,url:d,force:p,delete:g,corsProxy:m,headers:w})}catch(S){throw S.caller="git.push",S}}async function X1({fs:t,cache:e,gitdir:n,oid:r}){let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:n,oid:r});if(i==="tag")return r=Ut.from(a).parse().object,X1({fs:t,cache:e,gitdir:n,oid:r});if(i!=="blob")throw new kt(r,i,"blob");return{oid:r,blob:new Uint8Array(a)}}async function Y1({fs:t,cache:e,gitdir:n,oid:r,filepath:i=void 0}){return i!==void 0&&(r=await ds({fs:t,cache:e,gitdir:n,oid:r,filepath:i})),await X1({fs:t,cache:e,gitdir:n,oid:r})}async function ms({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,filepath:i,cache:a={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await Y1({fs:new Q(t),cache:a,gitdir:n,oid:r,filepath:i})}catch(s){throw s.caller="git.readBlob",s}}async function I8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,cache:i={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await Uo({fs:new Q(t),cache:i,gitdir:n,oid:r})}catch(a){throw a.caller="git.readCommit",a}}async function R8({fs:t,cache:e,gitdir:n,ref:r="refs/notes/commits",oid:i}){let a=await q.resolve({gitdir:n,fs:t,ref:r}),{blob:s}=await Y1({fs:t,cache:e,gitdir:n,oid:a,filepath:i});return s}async function L8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r="refs/notes/commits",oid:i,cache:a={}}){try{return F("fs",t),F("gitdir",n),F("ref",r),F("oid",i),await R8({fs:new Q(t),cache:a,gitdir:n,ref:r,oid:i})}catch(s){throw s.caller="git.readNote",s}}async function j8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,format:i="parsed",filepath:a=void 0,encoding:s=void 0,cache:o={}}){try{F("fs",t),F("gitdir",n),F("oid",r);let l=new Q(t);a!==void 0&&(r=await ds({fs:l,cache:o,gitdir:n,oid:r,filepath:a}));let u=await Ge({fs:l,cache:o,gitdir:n,oid:r,format:i==="parsed"?"content":i});if(u.oid=r,i==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=Rt.from(u.object).parse();break;case"tree":u.object=It.from(u.object).entries();break;case"blob":s?u.object=u.object.toString(s):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=Ut.from(u.object).parse();break;default:throw new kt(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(l){throw l.caller="git.readObject",l}}async function D8({fs:t,cache:e,gitdir:n,oid:r}){let{type:i,object:a}=await Ge({fs:t,cache:e,gitdir:n,oid:r,format:"content"});if(i!=="tag")throw new kt(r,i,"tag");let s=Ut.from(a);return{oid:r,tag:s.parse(),payload:s.payload()}}async function B8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,cache:i={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await D8({fs:new Q(t),cache:i,gitdir:n,oid:r})}catch(a){throw a.caller="git.readTag",a}}async function N8({fs:t,dir:e,gitdir:n=B(e,".git"),oid:r,filepath:i=void 0,cache:a={}}){try{return F("fs",t),F("gitdir",n),F("oid",r),await Di({fs:new Q(t),cache:a,gitdir:n,oid:r,filepath:i})}catch(s){throw s.caller="git.readTree",s}}async function $8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r,cache:i={}}){try{F("fs",t),F("gitdir",n),F("filepath",r),await lt.acquire({fs:new Q(t),gitdir:n,cache:i},async function(a){a.delete({filepath:r})})}catch(a){throw a.caller="git.remove",a}}async function H8({fs:t,cache:e,onSign:n,gitdir:r,ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l}){let c;try{c=await q.resolve({gitdir:r,fs:t,ref:i})}catch(p){if(!(p instanceof Re))throw p}let f=(await Di({fs:t,gitdir:r,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==a);let h=await Hf({fs:t,gitdir:r,tree:f});return await Zo({fs:t,cache:e,onSign:n,gitdir:r,ref:i,tree:h,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote' +`,author:s,committer:o,signingKey:l})}async function U8({fs:t,onSign:e,dir:n,gitdir:r=B(n,".git"),ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l,cache:c={}}){try{F("fs",t),F("gitdir",r),F("oid",a);let u=new Q(t),f=await Hr({fs:u,gitdir:r,author:s});if(!f)throw new At("author");let h=await Ri({fs:u,gitdir:r,author:f,committer:o});if(!h)throw new At("committer");return await H8({fs:u,cache:c,onSign:e,gitdir:r,ref:i,oid:a,author:f,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function z8({fs:t,gitdir:e,oldref:n,ref:r,checkout:i=!1}){if(r!==fn.default.clean(r))throw new zn(r,fn.default.clean(r));if(n!==fn.default.clean(n))throw new zn(n,fn.default.clean(n));let a=`refs/heads/${n}`,s=`refs/heads/${r}`;if(await q.exists({fs:t,gitdir:e,ref:s}))throw new hn("branch",r,!1);let l=await q.resolve({fs:t,gitdir:e,ref:a,depth:1});await q.writeRef({fs:t,gitdir:e,ref:s,value:l}),await q.deleteRef({fs:t,gitdir:e,ref:a});let u=await zr({fs:t,gitdir:e,fullname:!0})===a;(i||u)&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}async function G8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r,oldref:i,checkout:a=!1}){try{return F("fs",t),F("gitdir",n),F("ref",r),F("oldref",i),await z8({fs:new Q(t),gitdir:n,ref:r,oldref:i,checkout:a})}catch(s){throw s.caller="git.renameBranch",s}}async function Z1({gitdir:t,type:e,object:n}){return Un(lr.wrap({type:e,object:n}))}async function V8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r,ref:i,cache:a={}}){try{F("fs",t),F("gitdir",n),F("filepath",r);let s=new Q(t),o,l;try{o=await q.resolve({fs:s,gitdir:n,ref:i||"HEAD"})}catch(f){if(i)throw f}if(o)try{o=await ds({fs:s,cache:a,gitdir:n,oid:o,filepath:r})}catch(f){o=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},u=e&&await s.read(B(e,r));u&&(l=await Z1({gitdir:n,type:"blob",object:u}),o===l&&(c=await s.lstat(B(e,r)))),await lt.acquire({fs:s,gitdir:n,cache:a},async function(f){f.delete({filepath:r}),o&&f.insert({filepath:r,stats:c,oid:o})})}catch(s){throw s.caller="git.reset",s}}async function W8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r,depth:i}){try{return F("fs",t),F("gitdir",n),F("ref",r),await q.resolve({fs:new Q(t),gitdir:n,ref:r,depth:i})}catch(a){throw a.caller="git.resolveRef",a}}async function q8({fs:t,dir:e,gitdir:n=B(e,".git"),path:r,value:i,append:a=!1}){try{F("fs",t),F("gitdir",n),F("path",r);let s=new Q(t),o=await ze.get({fs:s,gitdir:n});a?await o.append(r,i):await o.set(r,i),await ze.save({fs:s,gitdir:n,config:o})}catch(s){throw s.caller="git.setConfig",s}}async function X8({fs:t,dir:e,gitdir:n=B(e,".git"),filepath:r,cache:i={}}){try{F("fs",t),F("gitdir",n),F("filepath",r);let a=new Q(t);if(await Ii.isIgnored({fs:a,gitdir:n,dir:e,filepath:r}))return"ignored";let o=await Y8({fs:a,cache:i,gitdir:n}),l=await K1({fs:a,cache:i,gitdir:n,tree:o,path:r}),c=await lt.acquire({fs:a,gitdir:n,cache:i},async function(g){for(let m of g)if(m.path===r)return m;return null}),u=await a.lstat(B(e,r)),f=l!==null,h=c!==null,d=u!==null,p=async()=>{if(h&&!Lo(c,u))return c.oid;{let g=await a.read(B(e,r)),m=await Z1({gitdir:n,type:"blob",object:g});return h&&c.oid===m&&u.size!==-1&<.acquire({fs:a,gitdir:n,cache:i},async function(w){w.insert({filepath:r,stats:u,oid:m})}),m}};if(!f&&!d&&!h)return"absent";if(!f&&!d&&h)return"*absent";if(!f&&d&&!h)return"*added";if(!f&&d&&h)return await p()===c.oid?"added":"*added";if(f&&!d&&!h)return"deleted";if(f&&!d&&h)return l===c.oid,"*deleted";if(f&&d&&!h)return await p()===l?"*undeleted":"*undeletemodified";if(f&&d&&h){let g=await p();return g===l?g===c.oid?"unmodified":"*unmodified":g===c.oid?"modified":"*modified"}}catch(a){throw a.caller="git.status",a}}async function K1({fs:t,cache:e,gitdir:n,tree:r,path:i}){typeof i=="string"&&(i=i.split("/"));let a=i.shift();for(let s of r)if(s.path===a){if(i.length===0)return s.oid;let{type:o,object:l}=await Ge({fs:t,cache:e,gitdir:n,oid:s.oid});if(o==="tree"){let c=It.from(l);return K1({fs:t,cache:e,gitdir:n,tree:c,path:i})}if(o==="blob")throw new kt(s.oid,o,"blob",i.join("/"))}return null}async function Y8({fs:t,cache:e,gitdir:n}){let r;try{r=await q.resolve({fs:t,gitdir:n,ref:"HEAD"})}catch(a){if(a instanceof Re)return[]}let{tree:i}=await Di({fs:t,cache:e,gitdir:n,oid:r});return i}async function Z8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r="HEAD",filepaths:i=["."],filter:a,cache:s={},ignored:o=!1}){try{F("fs",t),F("gitdir",n),F("ref",r);let l=new Q(t);return await Pi({fs:l,cache:s,dir:e,gitdir:n,trees:[sr({ref:r}),Yo(),Xo()],map:async function(c,[u,f,h]){if(!u&&!h&&f&&!o&&await Ii.isIgnored({fs:l,dir:e,filepath:c})||!i.some(A=>L1(c,A)))return null;if(a&&!a(c))return;let[d,p,g]=await Promise.all([u&&u.type(),f&&f.type(),h&&h.type()]),m=[d,p,g].includes("blob");if((d==="tree"||d==="special")&&!m)return;if(d==="commit")return null;if((p==="tree"||p==="special")&&!m)return;if(g==="commit")return null;if((g==="tree"||g==="special")&&!m)return;let w=d==="blob"?await u.oid():void 0,b=g==="blob"?await h.oid():void 0,S;d!=="blob"&&p==="blob"&&g!=="blob"?S="42":p==="blob"&&(S=await f.oid());let k=[void 0,w,S,b],x=k.map(A=>k.indexOf(A));return x.shift(),[c,...x]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function K8({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r,object:i,force:a=!1}){try{F("fs",t),F("gitdir",n),F("ref",r);let s=new Q(t);if(r===void 0)throw new Pt("ref");r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`;let o=await q.resolve({fs:s,gitdir:n,ref:i||"HEAD"});if(!a&&await q.exists({fs:s,gitdir:n,ref:r}))throw new hn("tag",r);await q.writeRef({fs:s,gitdir:n,ref:r,value:o})}catch(s){throw s.caller="git.tag",s}}async function J8({fs:t,dir:e,gitdir:n=B(e,".git"),cache:r={},filepath:i,oid:a,mode:s,add:o,remove:l,force:c}){try{F("fs",t),F("gitdir",n),F("filepath",i);let u=new Q(t);if(l)return await lt.acquire({fs:u,gitdir:n,cache:r},async function(h){let d;if(!c&&(d=await u.lstat(B(e,i)),d)){if(d.isDirectory())throw new cr("directory");return}h.has({filepath:i})&&h.delete({filepath:i})});let f;if(!a){if(f=await u.lstat(B(e,i)),!f)throw new Re(`file at "${i}" on disk and "remove" not set`);if(f.isDirectory())throw new cr("directory")}return await lt.acquire({fs:u,gitdir:n,cache:r},async function(h){if(!o&&!h.has({filepath:i}))throw new Re(`file at "${i}" in index and "add" not set`);let d={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:s,uid:0,gid:0,size:0};if(!a){d=f;let p=d.isSymbolicLink()?await u.readlink(B(e,i)):await u.read(B(e,i));a=await zt({fs:u,gitdir:n,type:"blob",format:"content",object:p})}return h.insert({filepath:i,oid:a,stats:d}),a})}catch(u){throw u.caller="git.updateIndex",u}}function Q8(){try{return Ko.version}catch(t){throw t.caller="git.version",t}}async function e6({fs:t,dir:e,gitdir:n=B(e,".git"),trees:r,map:i,reduce:a,iterate:s,cache:o={}}){try{return F("fs",t),F("gitdir",n),F("trees",r),await Pi({fs:new Q(t),cache:o,dir:e,gitdir:n,trees:r,map:i,reduce:a,iterate:s})}catch(l){throw l.caller="git.walk",l}}async function t6({fs:t,dir:e,gitdir:n=B(e,".git"),blob:r}){try{return F("fs",t),F("gitdir",n),F("blob",r),await zt({fs:new Q(t),gitdir:n,type:"blob",object:r,format:"content"})}catch(i){throw i.caller="git.writeBlob",i}}async function n6({fs:t,gitdir:e,commit:n}){let r=Rt.from(n).toObject();return await zt({fs:t,gitdir:e,type:"commit",object:r,format:"content"})}async function r6({fs:t,dir:e,gitdir:n=B(e,".git"),commit:r}){try{return F("fs",t),F("gitdir",n),F("commit",r),await n6({fs:new Q(t),gitdir:n,commit:r})}catch(i){throw i.caller="git.writeCommit",i}}async function i6({fs:t,dir:e,gitdir:n=B(e,".git"),type:r,object:i,format:a="parsed",oid:s,encoding:o=void 0}){try{let l=new Q(t);if(a==="parsed"){switch(r){case"commit":i=Rt.from(i).toObject();break;case"tree":i=It.from(i).toObject();break;case"blob":i=Buffer.from(i,o);break;case"tag":i=Ut.from(i).toObject();break;default:throw new kt(s||"",r,"blob|commit|tag|tree")}a="content"}return s=await zt({fs:l,gitdir:n,type:r,object:i,oid:s,format:a}),s}catch(l){throw l.caller="git.writeObject",l}}async function a6({fs:t,dir:e,gitdir:n=B(e,".git"),ref:r,value:i,force:a=!1,symbolic:s=!1}){try{F("fs",t),F("gitdir",n),F("ref",r),F("value",i);let o=new Q(t);if(r!==fn.default.clean(r))throw new zn(r,fn.default.clean(r));if(!a&&await q.exists({fs:o,gitdir:n,ref:r}))throw new hn("ref",r);s?await q.writeSymbolicRef({fs:o,gitdir:n,ref:r,value:i}):(i=await q.resolve({fs:o,gitdir:n,ref:i}),await q.writeRef({fs:o,gitdir:n,ref:r,value:i}))}catch(o){throw o.caller="git.writeRef",o}}async function s6({fs:t,gitdir:e,tag:n}){let r=Ut.from(n).toObject();return await zt({fs:t,gitdir:e,type:"tag",object:r,format:"content"})}async function o6({fs:t,dir:e,gitdir:n=B(e,".git"),tag:r}){try{return F("fs",t),F("gitdir",n),F("tag",r),await s6({fs:new Q(t),gitdir:n,tag:r})}catch(i){throw i.caller="git.writeTag",i}}async function l6({fs:t,dir:e,gitdir:n=B(e,".git"),tree:r}){try{return F("fs",t),F("gitdir",n),F("tree",r),await Hf({fs:new Q(t),gitdir:n,tree:r})}catch(i){throw i.caller="git.writeTree",i}}var c6={Errors:hs,STAGE:Xo,TREE:sr,WORKDIR:Yo,add:lC,abortMerge:rC,addNote:uC,addRemote:fC,annotatedTag:dC,branch:mC,checkout:yC,clone:CC,commit:FC,getConfig:ZC,getConfigAll:JC,setConfig:q8,currentBranch:MC,deleteBranch:PC,deleteRef:IC,deleteRemote:LC,deleteTag:DC,expandOid:HC,expandRef:UC,fastForward:WC,fetch:qC,findMergeBase:XC,findRoot:YC,getRemoteInfo:QC,getRemoteInfo2:e8,hashBlob:n8,indexPack:i8,init:a8,isDescendent:s8,isIgnored:o8,listBranches:l8,listFiles:u8,listNotes:h8,listRemotes:p8,listServerRefs:y8,listTags:v8,log:_8,merge:S8,packObjects:A8,pull:T8,push:P8,readBlob:ms,readCommit:I8,readNote:L8,readObject:j8,readTag:B8,readTree:N8,remove:$8,removeNote:U8,renameBranch:G8,resetIndex:V8,updateIndex:J8,resolveRef:W8,status:X8,statusMatrix:Z8,tag:K8,version:Q8,walk:e6,writeBlob:t6,writeCommit:r6,writeObject:i6,writeRef:a6,writeTag:o6,writeTree:l6},ae=c6;var _e=require("obsidian");v();var ti=require("obsidian");v();var RS=require("child_process"),LS=Ze(el()),Jr=require("obsidian"),vt=Ze(require("path")),Hs=require("path");v();var pl=Ze(ry(),1),ul=Ze(el(),1),Fv=require("child_process"),hw=Ze(Wf(),1),Ui=Ze(Wf(),1),Bw=require("node:events"),hl=Object.defineProperty,C6=Object.defineProperties,F6=Object.getOwnPropertyDescriptor,M6=Object.getOwnPropertyDescriptors,hh=Object.getOwnPropertyNames,iy=Object.getOwnPropertySymbols,Dy=Object.prototype.hasOwnProperty,O6=Object.prototype.propertyIsEnumerable,ay=(t,e,n)=>e in t?hl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,tn=(t,e)=>{for(var n in e||(e={}))Dy.call(e,n)&&ay(t,n,e[n]);if(iy)for(var n of iy(e))O6.call(e,n)&&ay(t,n,e[n]);return t},vs=(t,e)=>C6(t,M6(e)),W=(t,e)=>function(){return t&&(e=(0,t[hh(t)[0]])(t=0)),e},P6=(t,e)=>function(){return e||(0,t[hh(t)[0]])((e={exports:{}}).exports,e),e.exports},Qe=(t,e)=>{for(var n in e)hl(t,n,{get:e[n],enumerable:!0})},I6=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hh(e))!Dy.call(t,i)&&i!==n&&hl(t,i,{get:()=>e[i],enumerable:!(r=F6(e,i))||r.enumerable});return t},We=t=>I6(hl({},"__esModule",{value:!0}),t),ys=(t,e,n)=>new Promise((r,i)=>{var a=l=>{try{o(n.next(l))}catch(c){i(c)}},s=l=>{try{o(n.throw(l))}catch(c){i(c)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);o((n=n.apply(t,e)).next())});function R6(...t){let e=new String(t);return dl.set(e,t),e}function ll(t){return t instanceof String&&dl.has(t)}function sy(t){return dl.get(t)||[]}var dl,_s=W({"src/lib/args/pathspec.ts"(){"use strict";dl=new WeakMap}}),dn,fr=W({"src/lib/errors/git-error.ts"(){"use strict";dn=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),Ss,Gi=W({"src/lib/errors/git-response-error.ts"(){"use strict";fr(),Ss=class extends dn{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),By,Ny=W({"src/lib/errors/task-configuration-error.ts"(){"use strict";fr(),By=class extends dn{constructor(t){super(void 0,t)}}}});function $y(t){return typeof t=="function"?t:Xr}function Hy(t){return typeof t=="function"&&t!==Xr}function Uy(t,e){let n=t.indexOf(e);return n<=0?[t,""]:[t.substr(0,n),t.substr(n+1)]}function zy(t,e=0){return Gy(t)&&t.length>e?t[e]:void 0}function qr(t,e=0){if(Gy(t)&&t.length>e)return t[t.length-1-e]}function Gy(t){return!!(t&&typeof t.length=="number")}function Es(t="",e=!0,n=` +`){return t.split(n).reduce((r,i)=>{let a=e?i.trim():i;return a&&r.push(a),r},[])}function dh(t,e){return Es(t,!0).map(n=>e(n))}function ph(t){return(0,pl.exists)(t,pl.FOLDER)}function we(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function Vy(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function ml(t,e){if(Array.isArray(t)){let n=t.indexOf(e);n>=0&&t.splice(n,1)}else t.delete(e);return e}function Cn(t){return Array.isArray(t)?t:[t]}function Wy(t){return t.replace(/[\s-]+(.)/g,(e,n)=>n.toUpperCase())}function qy(t){return Cn(t).map(String)}function Pe(t,e=0){if(t==null)return e;let n=parseInt(t,10);return isNaN(n)?e:n}function ws(t,e){let n=[];for(let r=0,i=t.length;rn in t?{[n]:t[n]}:{}))}function Qf(t=0){return new Promise(e=>setTimeout(e,t))}function eh(t){if(t!==!1)return t}var zi,Xr,ks,gl=W({"src/lib/utils/util.ts"(){"use strict";zi="\0",Xr=()=>{},ks=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Fn(t,e,n){return e(t)?t:arguments.length>2?n:void 0}function mh(t,e){let n=ll(t)?"string":typeof t;return/number|string|boolean/.test(n)&&(!e||!e.includes(n))}function gh(t){return!!t&&ks(t)==="[object Object]"}function Yy(t){return typeof t=="function"}var As,gt,Zy,cl,yh,Ky=W({"src/lib/utils/argument-filters.ts"(){"use strict";gl(),_s(),As=t=>Array.isArray(t),gt=t=>typeof t=="string",Zy=t=>Array.isArray(t)&&t.every(gt),cl=t=>gt(t)||Array.isArray(t)&&t.every(gt),yh=t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number"}}),th,L6=W({"src/lib/utils/exit-codes.ts"(){"use strict";th=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(th||{})}}),xs,j6=W({"src/lib/utils/git-output-streams.ts"(){"use strict";xs=class{constructor(t,e){this.stdOut=t,this.stdErr=e}asStrings(){return new xs(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),fe,ur,D6=W({"src/lib/utils/line-parser.ts"(){"use strict";fe=class{constructor(t,e){this.matches=[],this.parse=(n,r)=>(this.resetMatches(),this._regExp.every((i,a)=>this.addMatch(i,a,n(a)))?this.useMatches(r,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}useMatches(t,e){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,n){let r=n&&t.exec(n);return r&&this.pushMatch(e,r),!!r}pushMatch(t,e){this.matches.push(...e.slice(1))}},ur=class extends fe{addMatch(t,e,n){return/^remote:\s/.test(String(n))&&super.addMatch(t,e,n)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function Jy(...t){let e=process.cwd(),n=Object.assign(tn({baseDir:e},Qy),...t.filter(r=>typeof r=="object"&&r));return n.baseDir=n.baseDir||e,n.trimmed=n.trimmed===!0,n}var Qy,B6=W({"src/lib/utils/simple-git-options.ts"(){"use strict";Qy={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function vh(t,e=[]){return gh(t)?Object.keys(t).reduce((n,r)=>{let i=t[r];return ll(i)?n.push(i):mh(i,["boolean"])?n.push(r+"="+i):n.push(r),n},e):e}function Lt(t,e=0,n=!1){let r=[];for(let i=0,a=e<0?t.length:e;i{for(let a=Es(i,r),s=0,o=a.length;s{if(!(s+c>=o))return a[s+c]};e.some(({parse:c})=>c(l,t))}}),t}var H6=W({"src/lib/utils/task-parser.ts"(){"use strict";gl()}}),ev={};Qe(ev,{ExitCodes:()=>th,GitOutputStreams:()=>xs,LineParser:()=>fe,NOOP:()=>Xr,NULL:()=>zi,RemoteLineParser:()=>ur,append:()=>we,appendTaskOptions:()=>vh,asArray:()=>Cn,asCamelCase:()=>Wy,asFunction:()=>$y,asNumber:()=>Pe,asStringArray:()=>qy,bufferToString:()=>bs,callTaskParser:()=>nh,createInstanceConfig:()=>Jy,delay:()=>Qf,filterArray:()=>As,filterFunction:()=>Yy,filterHasLength:()=>yh,filterPlainObject:()=>gh,filterPrimitives:()=>mh,filterString:()=>gt,filterStringArray:()=>Zy,filterStringOrStringArray:()=>cl,filterType:()=>Fn,first:()=>zy,folderExists:()=>ph,forEachLineWithContent:()=>dh,getTrailingOptions:()=>Lt,including:()=>Vy,isUserFunction:()=>Hy,last:()=>qr,objectToString:()=>ks,orVoid:()=>eh,parseStringResponse:()=>Dt,pick:()=>Xy,prefixedArray:()=>ws,remove:()=>ml,splitOn:()=>Uy,toLinesWithContent:()=>Es,trailingFunctionArgument:()=>qe,trailingOptionsArgument:()=>wh});var oe=W({"src/lib/utils/index.ts"(){"use strict";Ky(),L6(),j6(),D6(),B6(),$6(),H6(),gl()}}),tv={};Qe(tv,{CheckRepoActions:()=>rh,checkIsBareRepoTask:()=>rv,checkIsRepoRootTask:()=>nv,checkIsRepoTask:()=>U6});function U6(t){switch(t){case"bare":return rv();case"root":return nv()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:yl,parser:bh}}function nv(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:yl,parser(e){return/^\.(git)?$/.test(e.trim())}}}function rv(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:yl,parser:bh}}function z6(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var rh,yl,bh,iv=W({"src/lib/tasks/check-is-repo.ts"(){"use strict";oe(),rh=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(rh||{}),yl=({exitCode:t},e,n,r)=>{if(t===128&&z6(e))return n(Buffer.from("false"));r(e)},bh=t=>t.trim()==="true"}});function G6(t,e){let n=new av(t),r=t?ov:sv;return Es(e).forEach(i=>{let a=i.replace(r,"");n.paths.push(a),(lv.test(a)?n.folders:n.files).push(a)}),n}var av,sv,ov,lv,V6=W({"src/lib/responses/CleanSummary.ts"(){"use strict";oe(),av=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},sv=/^[a-z]+\s*/i,ov=/^[a-z]+\s+[a-z]+\s*/i,lv=/\/$/}}),ih={};Qe(ih,{EMPTY_COMMANDS:()=>vl,adhocExecTask:()=>cv,configurationErrorTask:()=>jt,isBufferTask:()=>fv,isEmptyTask:()=>hv,straightThroughBufferTask:()=>uv,straightThroughStringTask:()=>Tt});function cv(t){return{commands:vl,format:"empty",parser:t}}function jt(t){return{commands:vl,format:"empty",parser(){throw typeof t=="string"?new By(t):t}}}function Tt(t,e=!1){return{commands:t,format:"utf-8",parser(n){return e?String(n).trim():n}}}function uv(t){return{commands:t,format:"buffer",parser(e){return e}}}function fv(t){return t.format==="buffer"}function hv(t){return t.format==="empty"||!t.commands.length}var vl,Je=W({"src/lib/tasks/task.ts"(){"use strict";Ny(),vl=[]}}),dv={};Qe(dv,{CONFIG_ERROR_INTERACTIVE_MODE:()=>xh,CONFIG_ERROR_MODE_REQUIRED:()=>_h,CONFIG_ERROR_UNKNOWN_OPTION:()=>Sh,CleanOptions:()=>il,cleanTask:()=>pv,cleanWithOptionsTask:()=>W6,isCleanOptionsArray:()=>q6});function W6(t,e){let{cleanMode:n,options:r,valid:i}=X6(t);return n?i.options?(r.push(...e),r.some(K6)?jt(xh):pv(n,r)):jt(Sh+JSON.stringify(t)):jt(_h)}function pv(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(r){return G6(t==="n",r)}}}function q6(t){return Array.isArray(t)&&t.every(e=>Eh.has(e))}function X6(t){let e,n=[],r={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(i=>{Y6(i)?(e=i,r.cleanMode=!0):r.options=r.options&&Z6(n[n.length]=`-${i}`)}),{cleanMode:e,options:n,valid:r}}function Y6(t){return t==="f"||t==="n"}function Z6(t){return/^-[a-z]$/i.test(t)&&Eh.has(t.charAt(1))}function K6(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var xh,_h,Sh,il,Eh,mv=W({"src/lib/tasks/clean.ts"(){"use strict";V6(),oe(),Je(),xh="Git clean interactive mode is not supported",_h='Git clean mode parameter ("n" or "f") is required',Sh="Git clean unknown option found in: ",il=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(il||{}),Eh=new Set(["i",...qy(Object.values(il))])}});function J6(t){let e=new yv;for(let n of gv(t))e.addValue(n.file,String(n.key),n.value);return e}function Q6(t,e){let n=null,r=[],i=new Map;for(let a of gv(t,e))a.key===e&&(r.push(n=a.value),i.has(a.file)||i.set(a.file,[]),i.get(a.file).push(n));return{key:e,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function e4(t){return t.replace(/^(file):/,"")}function*gv(t,e=null){let n=t.split("\0");for(let r=0,i=n.length-1;rObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=qr(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,n){let r=this.addFile(t);r.hasOwnProperty(e)?Array.isArray(r[e])?r[e].push(n):r[e]=[r[e],n]:r[e]=n,this._all=void 0}}}});function qf(t,e){return typeof t=="string"&&ah.hasOwnProperty(t)?t:e}function n4(t,e,n,r){let i=["config",`--${r}`];return n&&i.push("--add"),i.push(t,e),{commands:i,format:"utf-8",parser(a){return a}}}function r4(t,e){let n=["config","--null","--show-origin","--get-all",t];return e&&n.splice(1,0,`--${e}`),{commands:n,format:"utf-8",parser(r){return Q6(r,t)}}}function i4(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(n){return J6(n)}}}function a4(){return{addConfig(t,e,...n){return this._runTask(n4(t,e,n[0]===!0,qf(n[1],"local")),qe(arguments))},getConfig(t,e){return this._runTask(r4(t,qf(e,void 0)),qe(arguments))},listConfig(...t){return this._runTask(i4(qf(t[0],void 0)),qe(arguments))}}}var ah,vv=W({"src/lib/tasks/config.ts"(){"use strict";t4(),oe(),ah=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(ah||{})}});function s4(t){return wv.has(t)}var Xf,wv,bv=W({"src/lib/tasks/diff-name-status.ts"(){"use strict";Xf=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(Xf||{}),wv=new Set(Object.values(Xf))}});function o4(...t){return new _v().param(...t)}function l4(t){let e=new Set,n={};return dh(t,r=>{let[i,a,s]=r.split(zi);e.add(i),(n[i]=n[i]||[]).push({line:Pe(a),path:i,preview:s})}),{paths:e,results:n}}function c4(){return{grep(t){let e=qe(arguments),n=Lt(arguments);for(let i of xv)if(n.includes(i))return this._runTask(jt(`git.grep: use of "${i}" is not supported.`),e);typeof t=="string"&&(t=o4().param(t));let r=["grep","--null","-n","--full-name",...n,...t];return this._runTask({commands:r,format:"utf-8",parser(i){return l4(i)}},e)}}}var xv,gs,oy,_v,Sv=W({"src/lib/tasks/grep.ts"(){"use strict";oe(),Je(),xv=["-h"],gs=Symbol("grepQuery"),_v=class{constructor(){this[oy]=[]}*[(oy=gs,Symbol.iterator)](){for(let t of this[gs])yield t}and(...t){return t.length&&this[gs].push("--and","(",...ws(t,"-e"),")"),this}param(...t){return this[gs].push(...ws(t,"-e")),this}}}}),Ev={};Qe(Ev,{ResetMode:()=>al,getResetMode:()=>f4,resetTask:()=>u4});function u4(t,e){let n=["reset"];return kv(t)&&n.push(`--${t}`),n.push(...e),Tt(n)}function f4(t){if(kv(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function kv(t){return Av.includes(t)}var al,Av,Tv=W({"src/lib/tasks/reset.ts"(){"use strict";Je(),al=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(al||{}),Av=Array.from(Object.values(al))}});function h4(){return(0,ul.default)("simple-git")}function ly(t,e,n){return!e||!String(e).replace(/\s*/,"")?n?(r,...i)=>{t(r,...i),n(r,...i)}:t:(r,...i)=>{t(`%s ${r}`,e,...i),n&&n(r,...i)}}function d4(t,e,{namespace:n}){if(typeof t=="string")return t;let r=e&&e.namespace||"";return r.startsWith(n)?r.substr(n.length+1):r||n}function kh(t,e,n,r=h4()){let i=t&&`[${t}]`||"",a=[],s=typeof e=="string"?r.extend(e):e,o=d4(Fn(e,gt),s,r);return c(n);function l(u,f){return we(a,kh(t,o.replace(/^[^:]+/,u),f,r))}function c(u){let f=u&&`[${u}]`||"",h=s&&ly(s,f)||Xr,d=ly(r,`${i} ${f}`,h);return Object.assign(s?h:d,{label:t,sibling:l,info:d,step:c})}}var Cv=W({"src/lib/git-logger.ts"(){"use strict";oe(),ul.default.formatters.L=t=>String(yh(t)?t.length:"-"),ul.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):ks(t)}}),nl,sh,p4=W({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";fr(),Cv(),nl=class{constructor(t="GitExecutor"){this.logLabel=t,this._queue=new Map}withProgress(t){return this._queue.get(t)}createProgress(t){let e=nl.getName(t.commands[0]),n=kh(this.logLabel,e);return{task:t,logger:n,name:e}}push(t){let e=this.createProgress(t);return e.logger("Adding task to the queue, commands = %o",t.commands),this._queue.set(t,e),e}fatal(t){for(let[e,{logger:n}]of Array.from(this._queue.entries()))e===t.task?(n.info("Failed %o",t),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",t.message),this.complete(e);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(t){this.withProgress(t)&&this._queue.delete(t)}attempt(t){let e=this.withProgress(t);if(!e)throw new dn(void 0,"TasksPendingQueue: attempt called for an unknown task");return e.logger("Starting task"),e}static getName(t="empty"){return`task:${t}:${++nl.counter}`}},sh=nl,sh.counter=0}});function Wr(t,e){return{method:zy(t.commands)||"",commands:e}}function m4(t,e){return n=>{e("[ERROR] child process exception %o",n),t.push(Buffer.from(String(n.stack),"ascii"))}}function cy(t,e,n,r){return i=>{n("%s received %L bytes",e,i),r("%B",i),t.push(i)}}var oh,g4=W({"src/lib/runners/git-executor-chain.ts"(){"use strict";fr(),Je(),oe(),p4(),oh=class{constructor(t,e,n){this._executor=t,this._scheduler=e,this._plugins=n,this._chain=Promise.resolve(),this._queue=new sh}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}attemptTask(t){return ys(this,null,function*(){let e=yield this._scheduler.next(),n=()=>this._queue.complete(t);try{let{logger:r}=this._queue.attempt(t);return yield hv(t)?this.attemptEmptyTask(t,r):this.attemptRemoteTask(t,r)}catch(r){throw this.onFatalException(t,r)}finally{n(),e()}})}onFatalException(t,e){let n=e instanceof dn?Object.assign(e,{task:t}):new dn(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(n),n}attemptRemoteTask(t,e){return ys(this,null,function*(){let n=this._plugins.exec("spawn.binary","",Wr(t,t.commands)),r=this._plugins.exec("spawn.args",[...t.commands],Wr(t,t.commands)),i=yield this.gitResponse(t,n,r,this.outputHandler,e.step("SPAWN")),a=yield this.handleTaskData(t,r,i,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),fv(t)?nh(t.parser,a):nh(t.parser,a.asStrings())})}attemptEmptyTask(t,e){return ys(this,null,function*(){return e("empty task bypassing child process to call to task's parser"),t.parser(this)})}handleTaskData(t,e,n,r){let{exitCode:i,rejection:a,stdOut:s,stdErr:o}=n;return new Promise((l,c)=>{r("Preparing to handle process response exitCode=%d stdOut=",i);let{error:u}=this._plugins.exec("task.error",{error:a},tn(tn({},Wr(t,e)),n));if(u&&t.onError)return r.info("exitCode=%s handling with custom error handler"),t.onError(n,u,f=>{r.info("custom error handler treated as success"),r("custom error returned a %s",ks(f)),l(new xs(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(o)))},c);if(u)return r.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,o.length,a),c(u);r.info("retrieving task output complete"),l(new xs(Buffer.concat(s),Buffer.concat(o)))})}gitResponse(t,e,n,r,i){return ys(this,null,function*(){let a=i.sibling("output"),s=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Wr(t,t.commands));return new Promise(o=>{let l=[],c=[];i.info("%s %o",e,n),i("%O",s);let u=this._beforeSpawn(t,n);if(u)return o({stdOut:l,stdErr:c,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,vs(tn({},Wr(t,n)),{kill(h){u=h||u}}));let f=(0,Fv.spawn)(e,n,s);f.stdout.on("data",cy(l,"stdOut",i,a.step("stdOut"))),f.stderr.on("data",cy(c,"stdErr",i,a.step("stdErr"))),f.on("error",m4(c,i)),r&&(i("Passing child process stdOut/stdErr to custom outputHandler"),r(e,f.stdout,f.stderr,[...n])),this._plugins.exec("spawn.after",void 0,vs(tn({},Wr(t,n)),{spawned:f,close(h,d){o({stdOut:l,stdErr:c,exitCode:h,rejection:u||d})},kill(h){f.killed||(u=h,f.kill("SIGINT"))}}))})})}_beforeSpawn(t,e){let n;return this._plugins.exec("spawn.before",void 0,vs(tn({},Wr(t,e)),{kill(r){n=r||n}})),n}}}}),Mv={};Qe(Mv,{GitExecutor:()=>Ov});var Ov,y4=W({"src/lib/runners/git-executor.ts"(){"use strict";g4(),Ov=class{constructor(t,e,n){this.cwd=t,this._scheduler=e,this._plugins=n,this._chain=new oh(this,this._scheduler,this._plugins)}chain(){return new oh(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function v4(t,e,n=Xr){let r=a=>{n(null,a)},i=a=>{(a==null?void 0:a.task)===t&&n(a instanceof Ss?w4(a):a,void 0)};e.then(r,i)}function w4(t){let e=r=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${r} should be GitResponseError.git.${r}, this will no longer be available in version 3`),e=Xr};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(n,{}));function n(r,i){return i in t||(r[i]={enumerable:!1,configurable:!1,get(){return e(i),t.git[i]}}),r}}var b4=W({"src/lib/task-callback.ts"(){"use strict";Gi(),oe()}});function uy(t,e){return cv(n=>{if(!ph(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||n).cwd=t})}var x4=W({"src/lib/tasks/change-working-directory.ts"(){"use strict";oe(),Je()}});function Yf(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=ml(e,"-B")),Tt(e)}function _4(){return{checkout(){return this._runTask(Yf(Lt(arguments,1)),qe(arguments))},checkoutBranch(t,e){return this._runTask(Yf(["-b",t,e,...Lt(arguments)]),qe(arguments))},checkoutLocalBranch(t){return this._runTask(Yf(["-b",t,...Lt(arguments)]),qe(arguments))}}}var S4=W({"src/lib/tasks/checkout.ts"(){"use strict";oe(),Je()}});function E4(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function k4(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return Dt(E4(),[Pv],t)}})}}}var Pv,A4=W({"src/lib/tasks/count-objects.ts"(){"use strict";oe(),Pv=new fe(/([a-z-]+): (\d+)$/,(t,[e,n])=>{let r=Wy(e);t.hasOwnProperty(r)&&(t[r]=Pe(n))})}});function T4(t){return Dt({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Iv,t)}var Iv,C4=W({"src/lib/parsers/parse-commit.ts"(){"use strict";oe(),Iv=[new fe(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,n,r])=>{t.branch=e,t.commit=r,t.root=!!n}),new fe(/\s*Author:\s(.+)/i,(t,[e])=>{let n=e.split("<"),r=n.pop();!r||!r.includes("@")||(t.author={email:r.substr(0,r.length-1),name:n.join("<").trim()})}),new fe(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,n,r])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(n,10)||0,t.summary.deletions=parseInt(r,10)||0}),new fe(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,n,r])=>{t.summary.changes=parseInt(e,10)||0;let i=parseInt(n,10)||0;r==="-"?t.summary.deletions=i:r==="+"&&(t.summary.insertions=i)})]}});function F4(t,e,n){return{commands:["-c","core.abbrev=40","commit",...ws(t,"-m"),...e,...n],format:"utf-8",parser:T4}}function M4(){return{commit(e,...n){let r=qe(arguments),i=t(e)||F4(Cn(e),Cn(Fn(n[0],cl,[])),[...Fn(n[1],As,[]),...Lt(arguments,0,!0)]);return this._runTask(i,r)}};function t(e){return!cl(e)&&jt("git.commit: requires the commit message to be supplied as a string/string[]")}}var O4=W({"src/lib/tasks/commit.ts"(){"use strict";C4(),oe(),Je()}});function P4(){return{firstCommit(){return this._runTask(Tt(["rev-list","--max-parents=0","HEAD"],!0),qe(arguments))}}}var I4=W({"src/lib/tasks/first-commit.ts"(){"use strict";oe(),Je()}});function R4(t,e){let n=["hash-object",t];return e&&n.push("-w"),Tt(n,!0)}var L4=W({"src/lib/tasks/hash-object.ts"(){"use strict";Je()}});function j4(t,e,n){let r=String(n).trim(),i;if(i=Rv.exec(r))return new sl(t,e,!1,i[1]);if(i=Lv.exec(r))return new sl(t,e,!0,i[1]);let a="",s=r.split(" ");for(;s.length;)if(s.shift()==="in"){a=s.join(" ");break}return new sl(t,e,/^re/i.test(r),a)}var sl,Rv,Lv,D4=W({"src/lib/responses/InitSummary.ts"(){"use strict";sl=class{constructor(t,e,n,r){this.bare=t,this.path=e,this.existing=n,this.gitDir=r}},Rv=/^Init.+ repository in (.+)$/,Lv=/^Rein.+ in (.+)$/}});function B4(t){return t.includes(Ah)}function N4(t=!1,e,n){let r=["init",...n];return t&&!B4(r)&&r.splice(1,0,Ah),{commands:r,format:"utf-8",parser(i){return j4(r.includes("--bare"),e,i)}}}var Ah,$4=W({"src/lib/tasks/init.ts"(){"use strict";D4(),Ah="--bare"}});function Th(t){for(let e=0;eDt(new jv,e,n,!1)}var Zf,fy,hy,dy,Bv,Nv=W({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Ts(),U4(),bv(),oe(),Zf=[new fe(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,n,r=""])=>{t.files.push({file:e.trim(),changes:Pe(n),insertions:r.replace(/[^+]/g,"").length,deletions:r.replace(/[^-]/g,"").length,binary:!1})}),new fe(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,n,r])=>{t.files.push({file:e.trim(),before:Pe(n),after:Pe(r),binary:!0})}),new fe(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);t.changed=Pe(e),t.insertions=Pe(r==null?void 0:r[1]),t.deletions=Pe(i==null?void 0:i[1])})],fy=[new fe(/(\d+)\t(\d+)\t(.+)$/,(t,[e,n,r])=>{let i=Pe(e),a=Pe(n);t.changed++,t.insertions+=i,t.deletions+=a,t.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new fe(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],hy=[new fe(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],dy=[new fe(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,n,r,i,a])=>{t.changed++,t.files.push({file:a!=null?a:r,changes:0,insertions:0,deletions:0,binary:!1,status:eh(s4(e)&&e),from:eh(!!a&&r!==a&&r),similarity:Pe(n)})})],Bv={"":Zf,"--stat":Zf,"--numstat":fy,"--name-status":dy,"--name-only":hy}}});function z4(t,e){return e.reduce((n,r,i)=>(n[r]=t[i]||"",n),Object.create({diff:null}))}function $v(t=Oh,e=Hv,n=""){let r=Dv(n);return function(i){let a=Es(i.trim(),!1,Fh).map(function(s){let o=s.split(Mh),l=z4(o[0].split(t),e);return o.length>1&&o[1].trim()&&(l.diff=r(o[1])),l});return{all:a,latest:a.length&&a[0]||null,total:a.length}}}var Fh,Mh,Oh,Hv,Uv=W({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oe(),Nv(),Ts(),Fh="\xF2\xF2\xF2\xF2\xF2\xF2 ",Mh=" \xF2\xF2",Oh=" \xF2 ",Hv=["hash","date","message","refs","author_name","author_email"]}}),zv={};Qe(zv,{diffSummaryTask:()=>G4,validateLogFormatConfig:()=>wl});function G4(t){let e=Th(t),n=["diff"];return e===""&&(e="--stat",n.push("--stat=4096")),n.push(...t),wl(n)||{commands:n,format:"utf-8",parser:Dv(e)}}function wl(t){let e=t.filter(H4);if(e.length>1)return jt(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return jt(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var Ph=W({"src/lib/tasks/diff.ts"(){"use strict";Ts(),Nv(),Je()}});function V4(t,e){let n=[],r=[];return Object.keys(t).forEach(i=>{n.push(i),r.push(String(t[i]))}),[n,r.join(e)]}function W4(t){return Object.keys(t).reduce((e,n)=>(n in lh||(e[n]=t[n]),e),{})}function Gv(t={},e=[]){let n=Fn(t.splitter,gt,Oh),r=!mh(t.format)&&t.format?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[i,a]=V4(r,n),s=[],o=[`--pretty=format:${Fh}${a}${Mh}`,...e],l=t.n||t["max-count"]||t.maxCount;if(l&&o.push(`--max-count=${l}`),t.from||t.to){let c=t.symmetric!==!1?"...":"..";s.push(`${t.from||""}${c}${t.to||""}`)}return gt(t.file)&&o.push("--follow",R6(t.file)),vh(W4(t),o),{fields:i,splitter:n,commands:[...o,...s]}}function q4(t,e,n){let r=$v(t,e,Th(n));return{commands:["log",...n],format:"utf-8",parser:r}}function X4(){return{log(...n){let r=qe(arguments),i=Gv(wh(arguments),Fn(arguments[0],As)),a=e(...n)||wl(i.commands)||t(i);return this._runTask(a,r)}};function t(n){return q4(n.splitter,n.fields,n.commands)}function e(n,r){return gt(n)&>(r)&&jt("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var lh,Vv=W({"src/lib/tasks/log.ts"(){"use strict";Ts(),_s(),Uv(),oe(),Je(),Ph(),lh=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(lh||{})}}),ol,Wv,Y4=W({"src/lib/responses/MergeSummary.ts"(){"use strict";ol=class{constructor(t,e=null,n){this.reason=t,this.file=e,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Wv=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),ch,qv,Z4=W({"src/lib/responses/PullSummary.ts"(){"use strict";ch=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},qv=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Kf(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function py(t){let e=/^\s*(\d+)/.exec(t),n=/delta (\d+)/i.exec(t);return{count:Pe(e&&e[1]||"0"),delta:Pe(n&&n[1]||"0")}}var Xv,K4=W({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oe(),Xv=[new ur(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,n])=>{let r=e.toLowerCase(),i=Kf(t.remoteMessages);Object.assign(i,{[r]:Pe(n)})}),new ur(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,n])=>{let r=e.toLowerCase(),i=Kf(t.remoteMessages);Object.assign(i,{[r]:Pe(n)})}),new ur(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,n,r])=>{let i=Kf(t.remoteMessages);i.total=py(e),i.reused=py(n),i.packReused=Pe(r)})]}});function Yv(t,e){return Dt({remoteMessages:new Kv},Zv,e)}var Zv,Kv,Jv=W({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oe(),K4(),Zv=[new ur(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...Xv,new ur([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new ur([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,n,r])=>{t.remoteMessages.vulnerabilities={count:Pe(e),summary:n,url:r}})],Kv=class{constructor(){this.all=[]}}}});function J4(t,e){let n=Dt(new qv,Qv,[t,e]);return n.message&&n}var my,gy,yy,vy,Qv,wy,Ih,ew=W({"src/lib/parsers/parse-pull.ts"(){"use strict";Z4(),oe(),Jv(),my=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,gy=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,yy=/^(create|delete) mode \d+ (.+)/,vy=[new fe(my,(t,[e,n,r])=>{t.files.push(e),n&&(t.insertions[e]=n.length),r&&(t.deletions[e]=r.length)}),new fe(gy,(t,[e,,n,,r])=>n!==void 0||r!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+n||0,t.summary.deletions=+r||0,!0):!1),new fe(yy,(t,[e,n])=>{we(t.files,n),we(e==="create"?t.created:t.deleted,n)})],Qv=[new fe(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new fe(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new fe(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,n,r,i])=>{t.branch.local=r,t.hash.local=e,t.branch.remote=i,t.hash.remote=n})],wy=(t,e)=>Dt(new ch,vy,[t,e]),Ih=(t,e)=>Object.assign(new ch,wy(t,e),Yv(t,e))}}),by,tw,xy,Q4=W({"src/lib/parsers/parse-merge.ts"(){"use strict";Y4(),oe(),ew(),by=[new fe(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new fe(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,n])=>{t.conflicts.push(new ol(e,n))}),new fe(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,n,r])=>{t.conflicts.push(new ol(e,n,{deleteRef:r}))}),new fe(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new ol(e,null))}),new fe(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],tw=(t,e)=>Object.assign(xy(t,e),Ih(t,e)),xy=t=>Dt(new Wv,by,t)}});function _y(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,n){let r=tw(e,n);if(r.failed)throw new Ss(r);return r}}:jt("Git.merge requires at least one option")}var eF=W({"src/lib/tasks/merge.ts"(){"use strict";Gi(),Q4(),Je()}});function tF(t,e,n){let r=n.includes("deleted"),i=n.includes("tag")||/^refs\/tags/.test(t),a=!n.includes("new");return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:t,remote:e}}var Sy,nw,Ey,nF=W({"src/lib/parsers/parse-push.ts"(){"use strict";oe(),Jv(),Sy=[new fe(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new fe(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref=vs(tn({},t.ref||{}),{local:e})}),new fe(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,n,r])=>{t.pushed.push(tF(e,n,r))}),new fe(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,n,r])=>{t.branch=vs(tn({},t.branch||{}),{local:e,remote:n,remoteName:r})}),new fe(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,n,r,i])=>{t.update={head:{local:e,remote:n},hash:{from:r,to:i}}})],nw=(t,e)=>{let n=Ey(t,e),r=Yv(t,e);return tn(tn({},n),r)},Ey=(t,e)=>Dt({pushed:[]},Sy,[t,e])}}),rw={};Qe(rw,{pushTagsTask:()=>rF,pushTask:()=>Rh});function rF(t={},e){return we(e,"--tags"),Rh(t,e)}function Rh(t={},e){let n=["push",...e];return t.branch&&n.splice(1,0,t.branch),t.remote&&n.splice(1,0,t.remote),ml(n,"-v"),we(n,"--verbose"),we(n,"--porcelain"),{commands:n,format:"utf-8",parser:nw}}var iw=W({"src/lib/tasks/push.ts"(){"use strict";nF(),oe()}});function iF(){return{showBuffer(){let t=["show",...Lt(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(uv(t),qe(arguments))},show(){let t=["show",...Lt(arguments,1)];return this._runTask(Tt(t),qe(arguments))}}}var aF=W({"src/lib/tasks/show.ts"(){"use strict";oe(),Je()}}),ky,aw,sF=W({"src/lib/responses/FileStatusSummary.ts"(){"use strict";ky=/^(.+)\0(.+)$/,aw=class{constructor(t,e,n){if(this.path=t,this.index=e,this.working_dir=n,e==="R"||n==="R"){let r=ky.exec(t)||[null,t,t];this.from=r[2]||"",this.path=r[1]||""}}}}});function Ay(t){let[e,n]=t.split(zi);return{from:n||e,to:e}}function Wt(t,e,n){return[`${t}${e}`,n]}function Jf(t,...e){return e.map(n=>Wt(t,n,(r,i)=>we(r.conflicted,i)))}function oF(t,e){let n=e.trim();switch(" "){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.substr(3));case n.charAt(1):return r(" ",n.charAt(0),n.substr(2));default:return}function r(i,a,s){let o=`${i}${a}`,l=sw.get(o);l&&l(t,s),o!=="##"&&o!=="!!"&&t.files.push(new aw(s,i,a))}}var Ty,sw,ow,lF=W({"src/lib/responses/StatusSummary.ts"(){"use strict";oe(),sF(),Ty=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},sw=new Map([Wt(" ","A",(t,e)=>we(t.created,e)),Wt(" ","D",(t,e)=>we(t.deleted,e)),Wt(" ","M",(t,e)=>we(t.modified,e)),Wt("A"," ",(t,e)=>we(t.created,e)&&we(t.staged,e)),Wt("A","M",(t,e)=>we(t.created,e)&&we(t.staged,e)&&we(t.modified,e)),Wt("D"," ",(t,e)=>we(t.deleted,e)&&we(t.staged,e)),Wt("M"," ",(t,e)=>we(t.modified,e)&&we(t.staged,e)),Wt("M","M",(t,e)=>we(t.modified,e)&&we(t.staged,e)),Wt("R"," ",(t,e)=>{we(t.renamed,Ay(e))}),Wt("R","M",(t,e)=>{let n=Ay(e);we(t.renamed,n),we(t.modified,n.to)}),Wt("!","!",(t,e)=>{we(t.ignored=t.ignored||[],e)}),Wt("?","?",(t,e)=>we(t.not_added,e)),...Jf("A","A","U"),...Jf("D","D","U"),...Jf("U","A","D","U"),["##",(t,e)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,s=/\son\s([\S]+)$/,o;o=n.exec(e),t.ahead=o&&+o[1]||0,o=r.exec(e),t.behind=o&&+o[1]||0,o=i.exec(e),t.current=o&&o[1],o=a.exec(e),t.tracking=o&&o[1],o=s.exec(e),t.current=o&&o[1]||t.current,t.detached=/\(no branch\)/.test(e)}]]),ow=function(t){let e=t.split(zi),n=new Ty;for(let r=0,i=e.length;r!lw.includes(n))],parser(n){return ow(n)}}}var lw,uF=W({"src/lib/tasks/status.ts"(){"use strict";lF(),lw=["--null","-z"]}});function fl(t=0,e=0,n=0,r="",i=!0){return Object.defineProperty({major:t,minor:e,patch:n,agent:r,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function fF(){return fl(0,0,0,"",!1)}function hF(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:dF,onError(t,e,n,r){if(t.exitCode===-2)return n(Buffer.from(Lh));r(e)}})}}}function dF(t){return t===Lh?fF():Dt(fl(0,0,0,t),cw,t)}var Lh,cw,pF=W({"src/lib/tasks/version.ts"(){"use strict";oe(),Lh="installed=false",cw=[new fe(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,n,r,i=""])=>{Object.assign(t,fl(Pe(e),Pe(n),Pe(r),i))}),new fe(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,n,r,i=""])=>{Object.assign(t,fl(Pe(e),Pe(n),r,i))})]}}),uw={};Qe(uw,{SimpleGitApi:()=>uh});var uh,mF=W({"src/lib/simple-git-api.ts"(){"use strict";b4(),x4(),S4(),A4(),O4(),vv(),I4(),Sv(),L4(),$4(),Vv(),eF(),iw(),aF(),uF(),Je(),pF(),oe(),uh=class{constructor(t){this._executor=t}_runTask(t,e){let n=this._executor.chain(),r=n.push(t);return e&&v4(t,r,e),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(t){return this._runTask(Tt(["add",...Cn(t)]),qe(arguments))}cwd(t){let e=qe(arguments);return typeof t=="string"?this._runTask(uy(t,this._executor),e):typeof(t==null?void 0:t.path)=="string"?this._runTask(uy(t.path,t.root&&this._executor||void 0),e):this._runTask(jt("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(R4(t,e===!0),qe(arguments))}init(t){return this._runTask(N4(t===!0,this._executor.cwd,Lt(arguments)),qe(arguments))}merge(){return this._runTask(_y(Lt(arguments)),qe(arguments))}mergeFromTo(t,e){return gt(t)&>(e)?this._runTask(_y([t,e,...Lt(arguments)]),qe(arguments,!1)):this._runTask(jt("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=Rh({remote:Fn(arguments[0],gt),branch:Fn(arguments[1],gt)},Lt(arguments));return this._runTask(t,qe(arguments))}stash(){return this._runTask(Tt(["stash",...Lt(arguments)]),qe(arguments))}status(){return this._runTask(cF(Lt(arguments)),qe(arguments))}},Object.assign(uh.prototype,_4(),M4(),a4(),k4(),P4(),c4(),X4(),iF(),hF())}}),fw={};Qe(fw,{Scheduler:()=>dw});var Cy,dw,gF=W({"src/lib/runners/scheduler.ts"(){"use strict";oe(),Cv(),Cy=(()=>{let t=0;return()=>{t++;let{promise:e,done:n}=(0,hw.createDeferred)();return{promise:e,done:n,id:t}}})(),dw=class{constructor(t=2){this.concurrency=t,this.logger=kh("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=we(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),ml(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=we(this.pending,Cy());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),pw={};Qe(pw,{applyPatchTask:()=>yF});function yF(t,e){return Tt(["apply",...e,...t])}var vF=W({"src/lib/tasks/apply-patch.ts"(){"use strict";Je()}});function wF(t,e){return{branch:t,hash:e,success:!0}}function bF(t){return{branch:t,hash:null,success:!1}}var mw,xF=W({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";mw=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function gw(t,e){return e===1&&fh.test(t)}var Fy,fh,My,bl,_F=W({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";xF(),oe(),Fy=/(\S+)\s+\(\S+\s([^)]+)\)/,fh=/^error[^']+'([^']+)'/m,My=[new fe(Fy,(t,[e,n])=>{let r=wF(e,n);t.all.push(r),t.branches[e]=r}),new fe(fh,(t,[e])=>{let n=bF(e);t.errors.push(n),t.all.push(n),t.branches[e]=n})],bl=(t,e)=>Dt(new mw,My,[t,e])}}),yw,SF=W({"src/lib/responses/BranchSummary.ts"(){"use strict";yw=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,n,r,i){t==="*"&&(this.detached=e,this.current=n),this.all.push(n),this.branches[n]={current:t==="*",linkedWorkTree:t==="+",name:n,commit:r,label:i}}}}});function Oy(t){return t?t.charAt(0):""}function vw(t){return Dt(new yw,ww,t)}var ww,EF=W({"src/lib/parsers/parse-branch.ts"(){"use strict";SF(),oe(),ww=[new fe(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,n,r,i])=>{t.push(Oy(e),!0,n,r,i)}),new fe(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(t,[e,n,r,i])=>{t.push(Oy(e),!1,n,r,i)})]}}),bw={};Qe(bw,{branchLocalTask:()=>AF,branchTask:()=>kF,containsDeleteBranchCommand:()=>xw,deleteBranchTask:()=>CF,deleteBranchesTask:()=>TF});function xw(t){let e=["-d","-D","--delete"];return t.some(n=>e.includes(n))}function kF(t){let e=xw(t),n=["branch",...t];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(r,i){return e?bl(r,i).all[0]:vw(r)}}}function AF(){return{format:"utf-8",commands:["branch","-v"],parser:vw}}function TF(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(n,r){return bl(n,r)},onError({exitCode:n,stdOut:r},i,a,s){if(!gw(String(i),n))return s(i);a(r)}}}function CF(t,e=!1){let n={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(r,i){return bl(r,i).branches[t]},onError({exitCode:r,stdErr:i,stdOut:a},s,o,l){if(!gw(String(s),r))return l(s);throw new Ss(n.parser(bs(a),bs(i)),String(s))}};return n}var FF=W({"src/lib/tasks/branch.ts"(){"use strict";Gi(),_F(),EF(),oe()}}),_w,MF=W({"src/lib/responses/CheckIgnore.ts"(){"use strict";_w=t=>t.split(/\n/g).map(e=>e.trim()).filter(e=>!!e)}}),Sw={};Qe(Sw,{checkIgnoreTask:()=>OF});function OF(t){return{commands:["check-ignore",...t],format:"utf-8",parser:_w}}var PF=W({"src/lib/tasks/check-ignore.ts"(){"use strict";MF()}}),Ew={};Qe(Ew,{cloneMirrorTask:()=>RF,cloneTask:()=>kw});function IF(t){return/^--upload-pack(=|$)/.test(t)}function kw(t,e,n){let r=["clone",...n];return gt(t)&&r.push(t),gt(e)&&r.push(e),r.find(IF)?jt("git.fetch: potential exploit argument blocked."):Tt(r)}function RF(t,e,n){return we(n,"--mirror"),kw(t,e,n)}var LF=W({"src/lib/tasks/clone.ts"(){"use strict";Je(),oe()}});function jF(t,e){return Dt({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},Aw,[t,e])}var Aw,DF=W({"src/lib/parsers/parse-fetch.ts"(){"use strict";oe(),Aw=[new fe(/From (.+)$/,(t,[e])=>{t.remote=e}),new fe(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,n])=>{t.branches.push({name:e,tracking:n})}),new fe(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,n])=>{t.tags.push({name:e,tracking:n})}),new fe(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new fe(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,n,r,i])=>{t.updated.push({name:r,tracking:i,to:n,from:e})})]}}),Tw={};Qe(Tw,{fetchTask:()=>NF});function BF(t){return/^--upload-pack(=|$)/.test(t)}function NF(t,e,n){let r=["fetch",...n];return t&&e&&r.push(t,e),r.find(BF)?jt("git.fetch: potential exploit argument blocked."):{commands:r,format:"utf-8",parser:jF}}var $F=W({"src/lib/tasks/fetch.ts"(){"use strict";DF(),Je()}});function HF(t){return Dt({moves:[]},Cw,t)}var Cw,UF=W({"src/lib/parsers/parse-move.ts"(){"use strict";oe(),Cw=[new fe(/^Renaming (.+) to (.+)$/,(t,[e,n])=>{t.moves.push({from:e,to:n})})]}}),Fw={};Qe(Fw,{moveTask:()=>zF});function zF(t,e){return{commands:["mv","-v",...Cn(t),e],format:"utf-8",parser:HF}}var GF=W({"src/lib/tasks/move.ts"(){"use strict";UF(),oe()}}),Mw={};Qe(Mw,{pullTask:()=>VF});function VF(t,e,n){let r=["pull",...n];return t&&e&&r.splice(1,0,t,e),{commands:r,format:"utf-8",parser(i,a){return Ih(i,a)},onError(i,a,s,o){let l=J4(bs(i.stdOut),bs(i.stdErr));if(l)return o(new Ss(l));o(a)}}}var WF=W({"src/lib/tasks/pull.ts"(){"use strict";Gi(),ew(),oe()}});function qF(t){let e={};return Ow(t,([n])=>e[n]={name:n}),Object.values(e)}function XF(t){let e={};return Ow(t,([n,r,i])=>{e.hasOwnProperty(n)||(e[n]={name:n,refs:{fetch:"",push:""}}),i&&r&&(e[n].refs[i.replace(/[^a-z]/g,"")]=r)}),Object.values(e)}function Ow(t,e){dh(t,n=>e(n.split(/\s+/)))}var YF=W({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oe()}}),Pw={};Qe(Pw,{addRemoteTask:()=>ZF,getRemotesTask:()=>KF,listRemotesTask:()=>JF,remoteTask:()=>QF,removeRemoteTask:()=>eM});function ZF(t,e,n){return Tt(["remote","add",...n,t,e])}function KF(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?XF:qF}}function JF(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),Tt(e)}function QF(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),Tt(e)}function eM(t){return Tt(["remote","remove",t])}var tM=W({"src/lib/tasks/remote.ts"(){"use strict";YF(),Je()}}),Iw={};Qe(Iw,{stashListTask:()=>nM});function nM(t={},e){let n=Gv(t),r=["stash","list",...n.commands,...e],i=$v(n.splitter,n.fields,Th(r));return wl(r)||{commands:r,format:"utf-8",parser:i}}var rM=W({"src/lib/tasks/stash-list.ts"(){"use strict";Ts(),Uv(),Ph(),Vv()}}),Rw={};Qe(Rw,{addSubModuleTask:()=>iM,initSubModuleTask:()=>aM,subModuleTask:()=>xl,updateSubModuleTask:()=>sM});function iM(t,e){return xl(["add",t,e])}function aM(t){return xl(["init",...t])}function xl(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),Tt(e)}function sM(t){return xl(["update",...t])}var oM=W({"src/lib/tasks/sub-module.ts"(){"use strict";Je()}});function lM(t,e){let n=isNaN(t),r=isNaN(e);return n!==r?n?1:-1:n?Lw(t,e):0}function Lw(t,e){return t===e?0:t>e?1:-1}function cM(t){return t.trim()}function rl(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var Py,jw,uM=W({"src/lib/responses/TagList.ts"(){"use strict";Py=class{constructor(t,e){this.all=t,this.latest=e}},jw=function(t,e=!1){let n=t.split(` +`).map(cM).filter(Boolean);e||n.sort(function(i,a){let s=i.split("."),o=a.split(".");if(s.length===1||o.length===1)return lM(rl(s[0]),rl(o[0]));for(let l=0,c=Math.max(s.length,o.length);li.indexOf(".")>=0);return new Py(n,r)}}}),Dw={};Qe(Dw,{addAnnotatedTagTask:()=>dM,addTagTask:()=>hM,tagListTask:()=>fM});function fM(t=[]){let e=t.some(n=>/^--sort=/.test(n));return{format:"utf-8",commands:["tag","-l",...t],parser(n){return jw(n,e)}}}function hM(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function dM(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var pM=W({"src/lib/tasks/tag.ts"(){"use strict";uM()}}),mM=P6({"src/git.js"(t,e){"use strict";var{GitExecutor:n}=(y4(),We(Mv)),{SimpleGitApi:r}=(mF(),We(uw)),{Scheduler:i}=(gF(),We(fw)),{configurationErrorTask:a}=(Je(),We(ih)),{asArray:s,filterArray:o,filterPrimitives:l,filterString:c,filterStringOrStringArray:u,filterType:f,getTrailingOptions:h,trailingFunctionArgument:d,trailingOptionsArgument:p}=(oe(),We(ev)),{applyPatchTask:g}=(vF(),We(pw)),{branchTask:m,branchLocalTask:w,deleteBranchesTask:b,deleteBranchTask:S}=(FF(),We(bw)),{checkIgnoreTask:k}=(PF(),We(Sw)),{checkIsRepoTask:x}=(iv(),We(tv)),{cloneTask:A,cloneMirrorTask:y}=(LF(),We(Ew)),{cleanWithOptionsTask:E,isCleanOptionsArray:_}=(mv(),We(dv)),{diffSummaryTask:C}=(Ph(),We(zv)),{fetchTask:M}=($F(),We(Tw)),{moveTask:L}=(GF(),We(Fw)),{pullTask:N}=(WF(),We(Mw)),{pushTagsTask:j}=(iw(),We(rw)),{addRemoteTask:Y,getRemotesTask:le,listRemotesTask:he,remoteTask:ie,removeRemoteTask:Me}=(tM(),We(Pw)),{getResetMode:de,resetTask:$}=(Tv(),We(Ev)),{stashListTask:G}=(rM(),We(Iw)),{addSubModuleTask:D,initSubModuleTask:se,subModuleTask:Se,updateSubModuleTask:mt}=(oM(),We(Rw)),{addAnnotatedTagTask:be,addTagTask:st,tagListTask:ee}=(pM(),We(Dw)),{straightThroughBufferTask:Ie,straightThroughStringTask:Ee}=(Je(),We(ih));function z(H,Z){this._plugins=Z,this._executor=new n(H.baseDir,new i(H.maxConcurrentProcesses),Z),this._trimmed=H.trimmed}(z.prototype=Object.create(r.prototype)).constructor=z,z.prototype.customBinary=function(H){return this._plugins.reconfigure("binary",H),this},z.prototype.env=function(H,Z){return arguments.length===1&&typeof H=="object"?this._executor.env=H:(this._executor.env=this._executor.env||{})[H]=Z,this},z.prototype.stashList=function(H){return this._runTask(G(p(arguments)||{},o(H)&&H||[]),d(arguments))};function nt(H,Z,ye,Ye){return typeof ye!="string"?a(`git.${H}() requires a string 'repoPath'`):Z(ye,f(Ye,c),h(arguments))}z.prototype.clone=function(){return this._runTask(nt("clone",A,...arguments),d(arguments))},z.prototype.mirror=function(){return this._runTask(nt("mirror",y,...arguments),d(arguments))},z.prototype.mv=function(H,Z){return this._runTask(L(H,Z),d(arguments))},z.prototype.checkoutLatestTag=function(H){var Z=this;return this.pull(function(){Z.tags(function(ye,Ye){Z.checkout(Ye.latest,H)})})},z.prototype.pull=function(H,Z,ye,Ye){return this._runTask(N(f(H,c),f(Z,c),h(arguments)),d(arguments))},z.prototype.fetch=function(H,Z){return this._runTask(M(f(H,c),f(Z,c),h(arguments)),d(arguments))},z.prototype.silent=function(H){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},z.prototype.tags=function(H,Z){return this._runTask(ee(h(arguments)),d(arguments))},z.prototype.rebase=function(){return this._runTask(Ee(["rebase",...h(arguments)]),d(arguments))},z.prototype.reset=function(H){return this._runTask($(de(H),h(arguments)),d(arguments))},z.prototype.revert=function(H){let Z=d(arguments);return typeof H!="string"?this._runTask(a("Commit must be a string"),Z):this._runTask(Ee(["revert",...h(arguments,0,!0),H]),Z)},z.prototype.addTag=function(H){let Z=typeof H=="string"?st(H):a("Git.addTag requires a tag name");return this._runTask(Z,d(arguments))},z.prototype.addAnnotatedTag=function(H,Z){return this._runTask(be(H,Z),d(arguments))},z.prototype.deleteLocalBranch=function(H,Z,ye){return this._runTask(S(H,typeof Z=="boolean"?Z:!1),d(arguments))},z.prototype.deleteLocalBranches=function(H,Z,ye){return this._runTask(b(H,typeof Z=="boolean"?Z:!1),d(arguments))},z.prototype.branch=function(H,Z){return this._runTask(m(h(arguments)),d(arguments))},z.prototype.branchLocal=function(H){return this._runTask(w(),d(arguments))},z.prototype.raw=function(H){let Z=!Array.isArray(H),ye=[].slice.call(Z?arguments:H,0);for(let _t=0;_tt.removeEventListener("abort",a))}}]:void 0}function vM(t){return typeof t=="string"&&t.trim().toLowerCase()==="-c"}function wM(t,e){if(vM(t)&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new Gn(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function bM(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new Gn(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(e==="clone"&&/^\s*-u\b/.test(t))throw new Gn(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(e==="push"&&/^\s*--exec\b/.test(t))throw new Gn(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function xM({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action(n,r){return n.forEach((i,a)=>{let s=aQf(i))).then(s.done)}return{type:"spawn.after",action(i,a){return ys(this,arguments,function*(s,{spawned:o,close:l}){var c,u;let f=n(),h=!0,d=()=>void(h=!1);(c=o.stdout)==null||c.on("data",d),(u=o.stderr)==null||u.on("data",d),o.on("error",d),o.on("close",p=>f.close(p)),o.on("exit",p=>f.exit(p));try{yield f.result,h&&(yield Qf(50)),l(f.exitCode)}catch(p){l(f.exitCode,p)}})}}}oe();var EM="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Ry="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function kM(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(t)}function Ly(t,e){if(t.length<1||t.length>2)throw new Gn(void 0,"binary",EM);if(t.some(kM))if(e)console.warn(Ry);else throw new Gn(void 0,"binary",Ry);let[r,i]=t;return{binary:r,prefix:i}}function AM(t,e=["git"],n=!1){let r=Ly(Cn(e),n);t.on("binary",i=>{r=Ly(Cn(i),n)}),t.append("spawn.binary",()=>r.binary),t.append("spawn.args",i=>r.prefix?[r.prefix,...i]:i)}fr();function TM(t){return!!(t.exitCode&&t.stdErr.length)}function CM(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function FM(t=!1,e=TM,n=CM){return(r,i)=>!t&&r||!e(i)?r:n(i)}function jy(t){return{type:"task.error",action(e,n){let r=t(e.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new dn(void 0,r.toString("utf-8"))}:{error:r}}}}oe();var MM=class{constructor(){this.plugins=new Set,this.events=new Bw.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let n=we(this.plugins,{type:t,action:e});return()=>this.plugins.delete(n)}add(t){let e=[];return Cn(t).forEach(n=>n&&this.plugins.add(we(e,n))),()=>{e.forEach(n=>this.plugins.delete(n))}}exec(t,e,n){let r=e,i=Object.freeze(Object.create(n));for(let a of this.plugins)a.type===t&&(r=a.action(r,i));return r}};oe();function OM(t){let e="--progress",n=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(a,s){return n.includes(s.method)?Vy(a,e):a}},{type:"spawn.after",action(a,s){var o;s.commands.includes(e)&&((o=s.spawned.stderr)==null||o.on("data",l=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));c&&t({method:s.method,stage:PM(c[1]),progress:Pe(c[2]),processed:Pe(c[3]),total:Pe(c[4])})}))}}]}function PM(t){return String(t.toLowerCase().split(" ",1))||"unknown"}oe();function IM(t){let e=Xy(t,["uid","gid"]);return{type:"spawn.options",action(n){return tn(tn({},e),n)}}}function RM({block:t,stdErr:e=!0,stdOut:n=!0}){if(t>0)return{type:"spawn.after",action(r,i){var a,s;let o;function l(){o&&clearTimeout(o),o=setTimeout(u,t)}function c(){var f,h;(f=i.spawned.stdout)==null||f.off("data",l),(h=i.spawned.stderr)==null||h.off("data",l),i.spawned.off("exit",c),i.spawned.off("close",c),o&&clearTimeout(o)}function u(){c(),i.kill(new Gn(void 0,"timeout","block timeout reached"))}n&&((a=i.spawned.stdout)==null||a.on("data",l)),e&&((s=i.spawned.stderr)==null||s.on("data",l)),i.spawned.on("exit",c),i.spawned.on("close",c),l()}}}_s();function LM(){return{type:"spawn.args",action(t){let e=[],n;function r(i){(n=n||[]).push(...i)}for(let i=0;ill(s)&&sy(s)||s));break}e.push(a)}return n?[...e,"--",...n.map(String)]:e}}}oe();var jM=mM();function DM(t,e){var n;let r=new MM,i=Jy(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!ph(i.baseDir))throw new gM(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&r.add(_M(i.config)),r.add(xM(i.unsafe)),r.add(LM()),r.add(SM(i.completion)),i.abort&&r.add(yM(i.abort)),i.progress&&r.add(OM(i.progress)),i.timeout&&r.add(RM(i.timeout)),i.spawnOptions&&r.add(IM(i.spawnOptions)),r.add(jy(FM(!0))),i.errors&&r.add(jy(i.errors)),AM(r,i.binary,(n=i.unsafe)==null?void 0:n.allowUnsafeCustomBinary),new jM(i,r)}Gi();var Nw=DM;v();var $w=require("obsidian"),_l="YYYY-MM-DD",jh=`${_l} HH:mm`,Dh=`${_l} HH:mm:ss`,Sl=40,Vi="conflict-files-obsidian-git.md",Mn={commitMessage:"vault backup: {{date}}",commitDateFormat:Dh,autoSaveInterval:0,autoPushInterval:0,autoPullInterval:0,autoPullOnBoot:!1,disablePush:!1,pullBeforePush:!0,disablePopups:!1,disablePopupsForNoChanges:!1,listChangedFilesInMessageBody:!1,showStatusBar:!0,updateSubmodules:!1,syncMethod:"merge",customMessageOnAutoBackup:!1,autoBackupAfterFileChange:!1,treeStructure:!1,refreshSourceControl:$w.Platform.isDesktopApp,basePath:"",differentIntervalCommitAndPush:!1,changedFilesInStatusBar:!1,showedMobileNotice:!1,refreshSourceControlTimer:7e3,showBranchStatusBar:!0,setLastSaveToLastCommit:!1,submoduleRecurseCheckout:!1,gitDir:"",showFileMenu:!0,authorInHistoryView:"hide",dateInHistoryView:!1,lineAuthor:{show:!1,followMovement:"inactive",authorDisplay:"initials",showCommitHash:!1,dateTimeFormatOptions:"date",dateTimeFormatCustomString:jh,dateTimeTimezone:"viewer-local",coloringMaxAge:"1y",colorNew:{r:255,g:150,b:150},colorOld:{r:120,g:160,b:255},textColorCss:"var(--text-muted)",ignoreWhitespace:!1,gutterSpacingFallbackLength:5}},dt={type:"git-view",name:"Source Control",icon:"git-pull-request"},nn={type:"git-history-view",name:"History",icon:"history"},Ct={type:"diff-view",name:"Diff View",icon:"git-pull-request"};v();function Hw(t,e){let n=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:n})}var Wi=class extends Error{constructor(n){super("No network connection available");this.originalError=n}};v();var SS=Ze(a2()),ES=Ze(_S()),ra=require("obsidian"),ip=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function Xt(t,e){let n;if(e){if(e.button===0||e.button===1){let r=ra.Keymap.isModEvent(e);n=t.workspace.getLeaf(r)}}else n=t.workspace.getLeaf(!1);return n}function In(t,e,n,r,i){if(e.button==2){let a=t.vault.getAbstractFileByPath(n);if(a!=null){let s=new ra.Menu;t.workspace.trigger("file-menu",s,a,i,r),s.showAtPosition({x:e.pageX,y:e.pageY})}}}function yr(t){throw new Error("Impossible branch: "+t)}function ap(t){return`rgb(${t.r},${t.g},${t.b})`}function kS(t){var a;let e=(a=SS.fromString(t))==null?void 0:a.toRgbaArray();if(e===void 0)return;let[n,r,i]=e;return{r:n,g:r,b:i}}function AS(t){return t.diff(ra.moment.unix(0),"seconds")}function TS(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function CS(t,e){return(0,ES.default)(t,e,{strict:!0})}function vr(t,e){return new Proxy(t,{get(n,r){return r==="length"?Math.min(e,n.length):n[r]}})}function FS(t,e,n){return t.length<=e?new Array(e-t.length).fill(n).join("")+t:t.substring(t.length-e)}function MS(t,e){if(e<=0)return t;let n=new Array(e).fill(" ").join(""),r=t.substring(e,t.length);return n+r}function sp(t,e,n){return t<=e&&e<=n}function wr(t){let[e,...n]=t.split("/");return[e,n.length===0?void 0:n.join("/")]}function Bt(t){return t.endsWith("/")?t:t.split("/").last().replace(".md","")}function $s(t){return t===1?"1 minute":`${t} minutes`}v();var OS=require("obsidian"),ia=class{constructor(e){this.plugin=e,this.app=e.app}getRelativeVaultPath(e){return this.plugin.settings.basePath?this.plugin.settings.basePath+"/"+e:e}getRelativeRepoPath(e,n=!0){return n&&this.plugin.settings.basePath.length>0?e.substring(this.plugin.settings.basePath.length+1):e}_getTreeStructure(e,n=0){let r=[];for(e=[...e];e.length>0;){let i=e.first(),a=i.path.substring(n);if(a.contains("/")){let s=a.substring(0,a.indexOf("/")),o=e.filter(c=>c.path.substring(n).startsWith(s+"/"));o.forEach(c=>e.remove(c));let l=i.path.substring(0,a.indexOf("/")+n);r.push({title:s,path:l,vaultPath:this.getRelativeVaultPath(l),children:this._getTreeStructure(o,(n>0?n+s.length:s.length)+1)})}else r.push({title:a,data:i,path:i.path,vaultPath:this.getRelativeVaultPath(i.path)}),e.remove(i)}return r}simplify(e){var n,r,i,a;for(let s of e){for(;;){let o=((n=s.children)==null?void 0:n.length)==1,l=((i=(r=s.children)==null?void 0:r.first())==null?void 0:i.data)==null;if(!(s.children!=null&&o&&l))break;let c=s.children.first();s.title+="/"+c.title,s.data=c.data,s.path=c.path,s.vaultPath=c.vaultPath,s.children=c.children}s.children!=null&&this.simplify(s.children),(a=s.children)==null||a.sort((o,l)=>{let c=(l.data==null?1:0)-(o.data==null?1:0);return c!=0?c:o.title.localeCompare(l.title)})}return e.sort((s,o)=>{let l=(o.data==null?1:0)-(s.data==null?1:0);return l!=0?l:s.title.localeCompare(o.title)})}getTreeStructure(e){let n=this._getTreeStructure(e);return this.simplify(n)}async formatCommitMessage(e){let n;if(e.includes("{{numFiles}}")){n=await this.status();let r=n.staged.length;e=e.replace("{{numFiles}}",String(r))}if(e.includes("{{hostname}}")){let r=this.plugin.localStorage.getHostname()||"";e=e.replace("{{hostname}}",r)}if(e.includes("{{files}}")){n=n!=null?n:await this.status();let r={},i="";if(n.staged.length<100){n.staged.forEach(s=>{s.index in r?r[s.index].push(s.path):r[s.index]=[s.path]});let a=[];for(let[s,o]of Object.entries(r))a.push(s+" "+o.join(" "));i=a.join(", ")}else i="Too many files to list";e=e.replace("{{files}}",i)}if(e=e.replace("{{date}}",(0,OS.moment)().format(this.plugin.settings.commitDateFormat)),this.plugin.settings.listChangedFilesInMessageBody){let r=n!=null?n:await this.status(),i="";r.staged.length<100?i=r.staged.map(a=>a.path).join(` +`):i="Too many files to list",e=e+` -// src/main.ts -var import_obsidian30 = require("obsidian"); +Affected files: +`+i}return e}};var Le=class extends ia{constructor(e){super(e)}async setGitInstance(e=!1){if(this.isGitInstalled()){let n=this.app.vault.adapter,r=n.getBasePath(),i=r;this.plugin.settings.basePath&&(await n.exists((0,Jr.normalizePath)(this.plugin.settings.basePath))?i=vt.join(r,this.plugin.settings.basePath):e||new Jr.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=i,this.git=Nw({baseDir:i,binary:this.plugin.localStorage.getGitPath()||void 0,config:["core.quotepath=off"]});let a=this.plugin.localStorage.getPATHPaths(),s=this.plugin.localStorage.getEnvVars(),o=this.plugin.settings.gitDir;if(a.length>0){let l=process.env.PATH+":"+a.join(":");process.env.PATH=l}o&&(process.env.GIT_DIR=o);for(let l of s){let[c,u]=l.split("=");process.env[c]=u}if(LS.default.enable("simple-git"),await this.git.checkIsRepo()){let l=await this.git.revparse("--show-cdup"),c=(0,Hs.resolve)(i+Hs.sep+l);this.absoluteRepoPath=c,await this.git.cwd(c)}}}getRelativeVaultPath(e){let r=this.app.vault.adapter.getBasePath(),i=vt.join(this.absoluteRepoPath,e),a=vt.relative(r,i);return Jr.Platform.isWin&&(a=a.replace(/\\/g,"/")),a}getRelativeRepoPath(e,n=!0){if(n){let i=this.plugin.app.vault.adapter.getBasePath(),a=this.absoluteRepoPath,s=vt.join(i,e),o=vt.relative(a,s);return Jr.Platform.isWin&&(o=o.replace(/\\/g,"/")),o}return e}async status(){this.plugin.setPluginState({gitAction:1});let e=await this.git.status();this.plugin.setPluginState({gitAction:0});let n=e.files.map(r=>{let i=this.formatPath(r);return{path:i.path,from:i.from,index:r.index==="?"?"U":r.index,working_dir:r.working_dir==="?"?"U":r.working_dir,vault_path:this.getRelativeVaultPath(i.path)}});return{all:n,changed:n.filter(r=>r.working_dir!==" "),staged:n.filter(r=>r.index!==" "&&r.index!="U"),conflicted:e.conflicted.map(r=>this.formatPath({path:r}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(e){let n=this.getRelativeRepoPath(e),i=["-C",vt.dirname(n),"rev-parse","HEAD"],a=this.git.raw(i);return a.catch(s=>console.warn("obsidian-git: rev-parse error:",s)),a}async getSubmodulePaths(){return new Promise(e=>{this.git.outputHandler((n,r,i,a)=>{if(!(a.contains("submodule")&&a.contains("foreach")))return;let s="",o=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");r.on("data",l=>{s+=l.toString("utf8")}),r.on("end",()=>{let c=s.split(` +`).map(u=>{let f=u.match(/'([^']*)'/);if(f!=null)return o+"/"+f[1]+Hs.sep}).filter(u=>!!u);c.reverse(),e(c)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},n=>this.plugin.displayError(n))})}formatPath(e,n=!1){function r(i){if(i!=null)return i.startsWith('"')&&i.endsWith('"')?i.substring(1,i.length-1):i}return n?{from:r(e.from),path:r(e.path)}:{path:r(e.path)}}async blame(e,n,r){if(e=this.getRelativeRepoPath(e),!await this.isTracked(e))return"untracked";let i=await this.getSubmoduleOfFile(e),a=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:e;a.push("blame","--porcelain"),r&&a.push("-w");let o=`-C${Sl}`;switch(n){case"inactive":break;case"same-commit":a.push("-C",o);break;case"all-commits":a.push("-C","-C",o);break;default:yr(n)}a.push("--",s);let l=await this.git.raw(a);return NR(l)}async isTracked(e){let n=await this.getSubmoduleOfFile(e),r=n?["-C",n.submodule]:[],i=n?n.relativeFilepath:e;return r.push("ls-files","--",i),this.git.raw(r).then(a=>a.trim()!=="")}async commitAll({message:e}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let r=await this.getSubmodulePaths();for(let i of r)await this.git.cwd({path:i,root:!1}).add("-A"),await this.git.cwd({path:i,root:!1}).commit(await this.formatCommitMessage(e))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let n=await this.git.commit(await this.formatCommitMessage(e));return this.app.workspace.trigger("obsidian-git:head-change"),n.summary.changes}async commit({message:e,amend:n}){this.plugin.setPluginState({gitAction:4});let r=(await this.git.commit(await this.formatCommitMessage(e),n?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),r}async stage(e,n){this.plugin.setPluginState({gitAction:3}),e=this.getRelativeRepoPath(e,n),await this.git.add(["--",e]),this.plugin.setPluginState({gitAction:0})}async stageAll({dir:e}){this.plugin.setPluginState({gitAction:3}),await this.git.add(e!=null?e:"-A"),this.plugin.setPluginState({gitAction:0})}async unstageAll({dir:e}){this.plugin.setPluginState({gitAction:3}),await this.git.reset(e!=null?["--",e]:[]),this.plugin.setPluginState({gitAction:0})}async unstage(e,n){this.plugin.setPluginState({gitAction:3}),e=this.getRelativeRepoPath(e,n),await this.git.reset(["--",e]),this.plugin.setPluginState({gitAction:0})}async discard(e){this.plugin.setPluginState({gitAction:3}),await this.isTracked(e)?await this.git.checkout(["--",e]):await this.app.vault.adapter.rmdir(this.getRelativeVaultPath(e),!0),this.plugin.setPluginState({gitAction:0})}async hashObject(e){e=this.getRelativeRepoPath(e);let n=await this.getSubmoduleOfFile(e),r=n?["-C",n.submodule]:[],i=n?n.relativeFilepath:e;return r.push("hash-object","--",i),this.git.raw(r)}async discardAll({dir:e}){return this.discard(e!=null?e:".")}async pull(){this.plugin.setPluginState({gitAction:2});try{this.plugin.settings.updateSubmodules&&await this.git.subModule(["update","--remote","--merge","--recursive"]);let e=await this.branchInfo(),n=await this.git.revparse([e.current]);if(!e.tracking&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring pull of main repo and updating submodules only.");return}await this.git.fetch();let r=await this.git.revparse([e.tracking]);if(n!==r){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{switch(this.plugin.settings.syncMethod){case"merge":await this.git.merge([e.tracking]);break;case"rebase":await this.git.rebase([e.tracking])}}catch(s){this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${"message"in s?s.message:s}`);return}else if(this.plugin.settings.syncMethod==="reset")try{await this.git.raw(["update-ref",`refs/heads/${e.current}`,r]),await this.unstageAll({})}catch(s){this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${"message"in s?s.message:s}`)}this.app.workspace.trigger("obsidian-git:head-change");let i=await this.git.revparse([e.current]);return(await this.git.diff([`${n}..${i}`,"--name-only"])).split(/\r\n|\r|\n/).filter(s=>s.length>0).map(s=>({path:s,working_dir:"P",vault_path:this.getRelativeVaultPath(s)}))}else return[]}catch(e){this.convertErrors(e)}}async push(){this.plugin.setPluginState({gitAction:5});try{if(this.plugin.settings.updateSubmodules){let a=await this.git.env({...process.env,OBSIDIAN_GIT:1}).subModule(["foreach","--recursive",`tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`]);console.log(a)}let e=await this.git.status(),n=e.tracking,r=e.current;if(!n&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring push of main repo and updating submodules only.");return}let i=(await this.git.diffSummary([r,n,"--"])).changed;return await this.git.env({...process.env,OBSIDIAN_GIT:1}).push(),i}catch(e){this.convertErrors(e)}}async getUnpushedCommits(){let e=await this.git.status(),n=e.tracking,r=e.current;return n==null||r==null?0:(await this.git.diffSummary([r,n,"--"])).changed}async canPush(){if(this.plugin.settings.updateSubmodules===!0)return!0;let e=await this.git.status(),n=e.tracking,r=e.current;return n?(await this.git.diffSummary([r,n,"--"])).changed!==0:!1}async checkRequirements(){return this.isGitInstalled()?await this.git.checkIsRepo()?"valid":"missing-repo":"missing-git"}async branchInfo(){let e=await this.git.status(),n=await this.git.branch(["--no-color"]);return{current:e.current||void 0,tracking:e.tracking||void 0,branches:n.all}}async getRemoteUrl(e){try{return await this.git.remote(["get-url",e])||void 0}catch(n){if(String(n).contains(e))return;throw n}}async log(e,n=!0,r){let i;return e&&(i=this.getRelativeRepoPath(e,n)),(await this.git.log({file:i,maxCount:r,"-m":null,"--name-status":null})).all.map(s=>{var o,l,c,u;return{...s,author:{name:s.author_name,email:s.author_email},refs:s.refs.split(", ").filter(f=>f.length>0),diff:{...s.diff,files:(l=(o=s.diff)==null?void 0:o.files.map(f=>({...f,status:f.status,path:f.file,hash:s.hash,vault_path:this.getRelativeVaultPath(f.file)})))!=null?l:[]},fileName:(u=(c=s.diff)==null?void 0:c.files.first())==null?void 0:u.file}})}async show(e,n,r=!0){let i=this.getRelativeRepoPath(n,r);return this.git.show([e+":"+i])}async checkout(e,n){if(n&&(e=`${n}/${e}`),await this.git.checkout(e),this.plugin.settings.submoduleRecurseCheckout){let r=await this.getSubmodulePaths();for(let i of r){let a=await this.git.cwd({path:i,root:!1}).branch();Object.keys(a.branches).includes(e)&&await this.git.cwd({path:i,root:!1}).checkout(e)}}}async createBranch(e){await this.git.checkout(["-b",e])}async deleteBranch(e,n){await this.git.branch([n?"-D":"-d",e])}async branchIsMerged(e){return!(await this.git.branch(["--no-merged"])).all.contains(e)}async init(){await this.git.init(!1)}async clone(e,n,r){await this.git.clone(e,vt.join(this.app.vault.adapter.getBasePath(),n),r?["--depth",`${r}`]:[])}async setConfig(e,n){n==null?await this.git.raw(["config","--local","--unset",e]):await this.git.addConfig(e,n)}async getConfig(e){let r=(await this.git.listConfig("local")).all[e];if(typeof r=="string")return r;throw new Error("Config value is not a string")}async fetch(e){await this.git.fetch(e!=null?[e]:[])}async setRemote(e,n){(await this.getRemotes()).includes(e)?await this.git.remote(["set-url",e,n]):await this.git.remote(["add",e,n])}async getRemoteBranches(e){let n=await this.git.branch(["-r","--list",`${e}*`]),r=[];for(let i in n.branches)r.push(n.branches[i].name);return r}async getRemotes(){let e=await this.git.remote([]);return e?e.trim().split(` +`):[]}async removeRemote(e){await this.git.removeRemote(e)}async updateUpstreamBranch(e){try{await this.git.branch(["--set-upstream-to",e])}catch(n){console.error(n);try{await this.git.branch(["--set-upstream",e])}catch(r){console.error(r),await this.git.push(["--set-upstream",...wr(e)])}}}updateGitPath(e){return this.setGitInstance()}updateBasePath(e){return this.setGitInstance(!0)}async getDiffString(e,n=!1,r){return n?await this.git.diff(["--cached","--",e]):r?await this.git.show([`${r}`,"--",e]):await this.git.diff(["--",e])}async diff(e,n,r){return await this.git.diff([`${n}..${r}`,"--",e])}async getSubmoduleOfFile(e){if(!await this.app.vault.adapter.exists(vt.dirname(e)))return;let n=await this.git.raw(["-C",vt.dirname(e),"rev-parse","--show-toplevel"],o=>o&&console.warn("get-submodule-of-file",o==null?void 0:o.message));if(n=n.trim(),(await this.git.raw(["-C",vt.dirname(e),"rev-parse","--show-superproject-working-tree"],o=>o&&console.warn("get-submodule-of-file",o==null?void 0:o.message))).trim()==="")return;let a=this.app.vault.adapter.getFullPath(vt.normalize(e)),s=vt.relative(n,a);return{submodule:n,relativeFilepath:s}}async getLastCommitTime(){let e=await this.git.log({n:1});if(e!=null&&e.latest!=null)return new Date(e.latest.date)}isGitInstalled(){let e=(0,RS.spawnSync)(this.plugin.localStorage.getGitPath()||"git",["--version"],{stdio:"ignore"});return e.error?(console.error(e.error),!1):!0}convertErrors(e){if(e instanceof dn){let n=String(e.message);if(n.contains("Could not resolve host")||n.contains("Unable to resolve host")||n.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||n.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||n.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new Wi(n)}throw e}},jS={hash:"000000",isZeroCommit:!0,summary:""};function NR(t){let n=t.replace(`\r +`,` +`).split(` +`),r={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},i=1;for(let a=0;a=4&&n.groupSizePerStartingLine.set(e,parseInt(t[3])),parseInt(t[2])!==e)throw Error(`git-blame output is out of order: ${e} vs ${t[2]}`);return r}function HR(t,e,n){let r=t[0],i=t.slice(1).join(" "),a=e.hashPerLine[n],s=e.commits.get(a)||{hash:a,author:{},committer:{},previous:{}};switch(r){case"summary":s.summary=i;break;case"author":s.author.name=i;break;case"author-mail":s.author.email=IS(i);break;case"author-time":s.author.epochSeconds=parseInt(i);break;case"author-tz":s.author.tz=i;break;case"committer":s.committer.name=i;break;case"committer-mail":s.committer.email=IS(i);break;case"committer-time":s.committer.epochSeconds=parseInt(i);break;case"committer-tz":s.committer.tz=i;break;case"previous":s.previous.commitHash=i;break;case"filename":s.previous.filename=i;break}e.commits.set(a,s)}function UR(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);op(t.author)&&(t.author=void 0),op(t.committer)&&(t.committer=void 0),op(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function op(t){return!t||Object.keys(t).length===0}function PS(t){return t.length>0&&t[0].trim()===t[0]}function IS(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}v();var vE=require("@codemirror/state");v();var KS=require("@codemirror/state"),kc=require("obsidian");v();var lp=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(e,n){if(e)return this.ensureInitialized(e),n(this.eventsPerFilepath.get(e))}forEachSubscriber(e){this.eventsPerFilepath.forEach(n=>n.forEach(e))}ensureInitialized(e){this.eventsPerFilepath.get(e)||this.eventsPerFilepath.set(e,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(e=>e==null?void 0:e.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},aa=new lp;v();var _c=require("@codemirror/state"),WS=Ze(cp());v();var V=require("obsidian");v();v();function gn(){}gn.prototype={diff:function(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.callback;typeof i=="function"&&(a=i,i={});var s=this;function o(k){return k=s.postProcess(k,i),a?(setTimeout(function(){a(k)},0),!0):k}e=this.castInput(e,i),n=this.castInput(n,i),e=this.removeEmpty(this.tokenize(e,i)),n=this.removeEmpty(this.tokenize(n,i));var l=n.length,c=e.length,u=1,f=l+c;i.maxEditLength!=null&&(f=Math.min(f,i.maxEditLength));var h=(r=i.timeout)!==null&&r!==void 0?r:1/0,d=Date.now()+h,p=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(p[0],n,e,0,i);if(p[0].oldPos+1>=c&&g+1>=l)return o(DS(s,p[0].lastComponent,n,e,s.useLongestToken));var m=-1/0,w=1/0;function b(){for(var k=Math.max(m,-u);k<=Math.min(w,u);k+=2){var x=void 0,A=p[k-1],y=p[k+1];A&&(p[k-1]=void 0);var E=!1;if(y){var _=y.oldPos-k;E=y&&0<=_&&_=c&&g+1>=l)return o(DS(s,x.lastComponent,n,e,s.useLongestToken));p[k]=x,x.oldPos+1>=c&&(w=Math.min(w,k-1)),g+1>=l&&(m=Math.max(m,k+1))}u++}if(a)(function k(){setTimeout(function(){if(u>f||Date.now()>d)return a();b()||k()},0)})();else for(;u<=f&&Date.now()<=d;){var S=b();if(S)return S}},addToPath:function(e,n,r,i,a){var s=e.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}},extractCommon:function(e,n,r,i,a){for(var s=n.length,o=r.length,l=e.oldPos,c=l-i,u=0;c+1d.length?g:d}),f.value=t.join(h)}else f.value=t.join(n.slice(c,c+f.count));c+=f.count,f.added||(u+=f.count)}}return a}var d$=new gn;function BS(t,e){var n;for(n=0;ne.length&&(n=t.length-e.length);var r=e.length;t.length0&&e[s]!=e[a];)a=i[a];e[s]==e[a]&&a++}a=0;for(var o=n;o0&&t[o]!=e[a];)a=i[a];t[o]==e[a]&&a++}return a}var pc="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",GR=new RegExp("[".concat(pc,"]+|\\s+|[^").concat(pc,"]"),"ug"),gc=new gn;gc.equals=function(t,e,n){return n.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t.trim()===e.trim()};gc.tokenize=function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;if(e.intlSegmenter){if(e.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(e.intlSegmenter.segment(t),function(a){return a.segment})}else n=t.match(GR)||[];var r=[],i=null;return n.forEach(function(a){/\s/.test(a)?i==null?r.push(a):r.push(r.pop()+a):/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+a):r.push(i+a):r.push(a),i=a}),r};gc.join=function(t){return t.map(function(e,n){return n==0?e:e.replace(/^\s+/,"")}).join("")};gc.postProcess=function(t,e){if(!t||e.oneChangePerToken)return t;var n=null,r=null,i=null;return t.forEach(function(a){a.added?r=a:a.removed?i=a:((r||i)&&HS(n,i,r,a),n=a,r=null,i=null)}),(r||i)&&HS(n,i,r,null),t};function HS(t,e,n,r){if(e&&n){var i=e.value.match(/^\s*/)[0],a=e.value.match(/\s*$/)[0],s=n.value.match(/^\s*/)[0],o=n.value.match(/\s*$/)[0];if(t){var l=BS(i,s);t.value=hp(t.value,s,l),e.value=Us(e.value,l),n.value=Us(n.value,l)}if(r){var c=NS(a,o);r.value=fp(r.value,o,c),e.value=dc(e.value,c),n.value=dc(n.value,c)}}else if(n)t&&(n.value=n.value.replace(/^\s*/,"")),r&&(r.value=r.value.replace(/^\s*/,""));else if(t&&r){var u=r.value.match(/^\s*/)[0],f=e.value.match(/^\s*/)[0],h=e.value.match(/\s*$/)[0],d=BS(u,f);e.value=Us(e.value,d);var p=NS(Us(u,d),h);e.value=dc(e.value,p),r.value=fp(r.value,u,p),t.value=hp(t.value,u,u.slice(0,u.length-p.length))}else if(r){var g=r.value.match(/^\s*/)[0],m=e.value.match(/\s*$/)[0],w=$S(m,g);e.value=dc(e.value,w)}else if(t){var b=t.value.match(/\s*$/)[0],S=e.value.match(/^\s*/)[0],k=$S(b,S);e.value=Us(e.value,k)}}var VR=new gn;VR.tokenize=function(t){var e=new RegExp("(\\r?\\n)|[".concat(pc,"]+|[^\\S\\n\\r]+|[^").concat(pc,"]"),"ug");return t.match(e)||[]};var yc=new gn;yc.tokenize=function(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` +`));var n=[],r=t.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var i=0;it.length)&&(e=t.length);for(var n=0,r=new Array(e);n0?f(L.lines.slice(-s.context)):[],d-=g.length,p-=g.length)}(M=g).push.apply(M,up(C.map(function(he){return(_.added?"+":"-")+he}))),_.added?w+=C.length:m+=C.length}else{if(d)if(C.length<=s.context*2&&S{this.resolve=e,this.open()})}onClose(){new Promise(e=>setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,n){n.setText(e)}onChooseSuggestion(e,n){if(this.resolve){let r;this.config.allowEmpty&&e===" "?r="":e==="..."?r=void 0:r=e,this.resolve(r)}}};v();var br=require("obsidian"),wc=class{constructor(e,n){this.plugin=n;this.promises={};this.adapter=e.adapter,this.vault=e,this.lastBasePath=this.plugin.settings.basePath,this.promises.readFile=this.readFile.bind(this),this.promises.writeFile=this.writeFile.bind(this),this.promises.readdir=this.readdir.bind(this),this.promises.mkdir=this.mkdir.bind(this),this.promises.rmdir=this.rmdir.bind(this),this.promises.stat=this.stat.bind(this),this.promises.unlink=this.unlink.bind(this),this.promises.lstat=this.lstat.bind(this),this.promises.readlink=this.readlink.bind(this),this.promises.symlink=this.symlink.bind(this)}async readFile(e,n){var r;if(this.maybeLog("Read: "+e+JSON.stringify(n)),n=="utf8"||n.encoding=="utf8"){let i=this.vault.getAbstractFileByPath(e);return i instanceof br.TFile?(this.maybeLog("Reuse"),this.vault.read(i)):this.adapter.read(e)}else{if(e.endsWith(this.gitDir+"/index"))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(e)):(r=this.index)!=null?r:this.adapter.readBinary(e);let i=this.vault.getAbstractFileByPath(e);return i instanceof br.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(i)):this.adapter.readBinary(e)}}async writeFile(e,n){if(this.maybeLog("Write: "+e),typeof n=="string"){let r=this.vault.getAbstractFileByPath(e);return r instanceof br.TFile?this.vault.modify(r,n):this.adapter.write(e,n)}else if(e.endsWith(this.gitDir+"/index"))this.index=n,this.indexmtime=Date.now();else{let r=this.vault.getAbstractFileByPath(e);return r instanceof br.TFile?this.vault.modifyBinary(r,n):this.adapter.writeBinary(e,n)}}async readdir(e){e==="."&&(e="/");let n=await this.adapter.list(e),r=[...n.files,...n.folders],i;return e!=="/"?i=r.map(a=>(0,br.normalizePath)(a.substring(e.length))):i=r,i}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,n){var r,i;return this.adapter.rmdir(e,(i=(r=n==null?void 0:n.options)==null?void 0:r.recursive)!=null?i:!1)}async stat(e){if(e.endsWith(this.gitDir+"/index")){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:this.index.length,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let r=await this.adapter.stat(e);if(r==null)throw{code:"ENOENT"};return this.indexctime=r.ctime,this.indexmtime=r.mtime,{ctimeMs:r.ctime,mtimeMs:r.mtime,size:r.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let n=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),n instanceof br.TFile)return this.maybeLog("Reuse stat"),{ctimeMs:n.stat.ctime,mtimeMs:n.stat.mtime,size:n.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let r=await this.adapter.stat(e);if(r)return{ctimeMs:r.ctime,mtimeMs:r.mtime,size:r.size,type:r.type==="folder"?"directory":r.type,isFile:()=>r.type==="file",isDirectory:()=>r.type==="folder",isSymbolicLink:()=>!1};throw{code:"ENOENT"}}}async unlink(e){return this.adapter.remove(e)}async lstat(e){return this.stat(e)}async readlink(e){throw new Error(`readlink of (${e}) is not implemented.`)}async symlink(e){throw new Error(`symlink of (${e}) is not implemented.`)}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index"),this.index,{ctime:this.indexctime,mtime:this.indexmtime}),this.clearIndex()}clearIndex(){this.index=void 0,this.indexctime=void 0,this.indexmtime=void 0}get gitDir(){return this.plugin.settings.gitDir||".git"}maybeLog(e){}};var yn=class extends ia{constructor(n){super(n);this.FILE=0;this.HEAD=1;this.WORKDIR=2;this.STAGE=3;this.status_mapping={"000":" ","003":"AD","020":"??","022":"A ","023":"AM",100:"D ",101:" D",103:"MD",110:"DA",111:" ",113:"MM",120:"DA",121:" M",122:"M ",123:"MM"};this.noticeLength=999999;this.fs=new wc(this.app.vault,this.plugin)}getRepo(){return{fs:this.fs,dir:this.plugin.settings.basePath,gitdir:this.plugin.settings.gitDir||void 0,onAuth:()=>{var n,r;return{username:(n=this.plugin.localStorage.getUsername())!=null?n:void 0,password:(r=this.plugin.localStorage.getPassword())!=null?r:void 0}},onAuthFailure:async()=>{new Qr.Notice("Authentication failed. Please try with different credentials");let n=await new Xe(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(n){let r=await new Xe(this.plugin,{placeholder:"Specify your password/personal access token"}).openAndGetResult();if(r)return this.plugin.localStorage.setUsername(n),this.plugin.localStorage.setPassword(r),{username:n,password:r}}return{cancel:!0}},http:{async request({url:n,method:r,headers:i,body:a}){let s;a&&(s=(await oL(a)).buffer);let o=await(0,Qr.requestUrl)({url:n,method:r,headers:i,body:s,throw:!1});return{url:n,method:r,headers:o.headers,body:[new Uint8Array(o.arrayBuffer)],statusCode:o.status,statusMessage:o.status.toString()}}}}}async wrapFS(n){try{let r=await n;return await this.fs.saveAndClear(),r}catch(r){throw await this.fs.saveAndClear(),r}}async status(){let n,r=window.setTimeout(()=>{n=new Qr.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{this.plugin.setPluginState({gitAction:1});let i=(await this.wrapFS(ae.statusMatrix({...this.getRepo()}))).map(l=>this.getFileStatusResult(l)),a=i.filter(l=>l.working_dir!==" "),s=i.filter(l=>l.index!==" "&&l.index!=="U"),o=[];return window.clearTimeout(r),n==null||n.hide(),{all:i,changed:a,staged:s,conflicted:o}}catch(i){throw window.clearTimeout(r),n==null||n.hide(),this.plugin.displayError(i),i}}async commitAll({message:n,status:r,unstagedFiles:i}){try{return await this.checkAuthorInfo(),await this.stageAll({status:r,unstagedFiles:i}),this.commit({message:n})}catch(a){throw this.plugin.displayError(a),a}}async commit({message:n}){try{await this.checkAuthorInfo(),this.plugin.setPluginState({gitAction:4});let r=await this.formatCommitMessage(n),i=this.plugin.localStorage.getConflict(),a;if(i){let s=await this.branchInfo();a=[s.current,s.tracking]}await this.wrapFS(ae.commit({...this.getRepo(),message:r,parent:a})),this.plugin.localStorage.setConflict(!1);return}catch(r){throw this.plugin.displayError(r),r}}async stage(n,r){let i=this.getRelativeRepoPath(n,r),a;r?a=n:a=this.getRelativeVaultPath(n);try{this.plugin.setPluginState({gitAction:3}),await this.app.vault.adapter.exists(a)?await this.wrapFS(ae.add({...this.getRepo(),filepath:i})):await this.wrapFS(ae.remove({...this.getRepo(),filepath:i}))}catch(s){throw this.plugin.displayError(s),s}}async stageAll({dir:n,status:r,unstagedFiles:i}){try{if(r)await Promise.all(r.changed.map(a=>a.working_dir!=="D"?this.wrapFS(ae.add({...this.getRepo(),filepath:a.path})):ae.remove({...this.getRepo(),filepath:a.path})));else{let a=i!=null?i:await this.getUnstagedFiles(n!=null?n:".");await Promise.all(a.map(({filepath:s,deleted:o})=>o?ae.remove({...this.getRepo(),filepath:s}):this.wrapFS(ae.add({...this.getRepo(),filepath:s}))))}}catch(a){throw this.plugin.displayError(a),a}}async unstage(n,r){try{this.plugin.setPluginState({gitAction:3}),n=this.getRelativeRepoPath(n,r),await this.wrapFS(ae.resetIndex({...this.getRepo(),filepath:n}))}catch(i){throw this.plugin.displayError(i),i}}async unstageAll({dir:n,status:r}){try{let i;r?i=r.staged.map(a=>a.path):i=(await this.getStagedFiles(n!=null?n:".")).map(({filepath:s})=>s),await this.wrapFS(Promise.all(i.map(a=>ae.resetIndex({...this.getRepo(),filepath:a}))))}catch(i){throw this.plugin.displayError(i),i}}async discard(n){try{this.plugin.setPluginState({gitAction:3}),await this.wrapFS(ae.checkout({...this.getRepo(),filepaths:[n],force:!0}))}catch(r){throw this.plugin.displayError(r),r}}async discardAll({dir:n,status:r}){let i=[];r?n!=null?i=r.changed.filter(a=>a.path.startsWith(n)).map(a=>a.path):i=r.changed.map(a=>a.path):i=(await this.getUnstagedFiles(n)).map(({filepath:a})=>a);try{await this.wrapFS(ae.checkout({...this.getRepo(),filepaths:i,force:!0}))}catch(a){throw this.plugin.displayError(a),a}}getProgressText(n,r){let i=`${n} progress:`;return r.phase&&(i=`${i} ${r.phase}:`),r.loaded&&(i=`${i} ${r.loaded}`,r.total&&(i=`${i} of ${r.total}`)),i}resolveRef(n){return this.wrapFS(ae.resolveRef({...this.getRepo(),ref:n}))}async pull(){let n=this.showNotice("Initializing pull");try{this.plugin.setPluginState({gitAction:2});let r=await this.resolveRef("HEAD");await this.fetch();let i=await this.branchInfo();await this.checkAuthorInfo(),(await this.wrapFS(ae.merge({...this.getRepo(),ours:i.current,theirs:i.tracking,abortOnConflict:!1}))).alreadyMerged||await this.wrapFS(ae.checkout({...this.getRepo(),ref:i.current,onProgress:l=>{n!==void 0&&(n.noticeEl.innerText=this.getProgressText("Checkout",l))},remote:i.remote})),n==null||n.hide();let s=await this.resolveRef("HEAD"),o=await this.getFileChangesCount(r,s);return this.showNotice("Finished pull",!1),o.map(l=>({path:l.path,working_dir:"P",index:"P",vault_path:this.getRelativeVaultPath(l.path)}))}catch(r){throw n==null||n.hide(),r instanceof hs.MergeConflictError&&await this.plugin.handleConflict(r.data.filepaths.map(i=>this.getRelativeVaultPath(i))),this.plugin.displayError(r),r}}async push(){if(!await this.canPush())return 0;let n=this.showNotice("Initializing push");try{this.plugin.setPluginState({gitAction:1});let r=await this.branchInfo(),i=r.tracking,a=r.current,s=(await this.getFileChangesCount(a,i)).length;return this.plugin.setPluginState({gitAction:5}),await this.wrapFS(ae.push({...this.getRepo(),onProgress:o=>{n!==void 0&&(n.noticeEl.innerText=this.getProgressText("Pushing",o))}})),n==null||n.hide(),s}catch(r){throw n==null||n.hide(),this.plugin.displayError(r),r}}async getUnpushedCommits(){let n=await this.branchInfo(),r=n.tracking,i=n.current;if(r==null||i==null)return 0;let a=await this.resolveRef(i),s=await this.resolveRef(r);return(await this.getFileChangesCount(a,s)).length}async canPush(){let n=await this.branchInfo(),r=n.tracking,i=n.current,a=await this.resolveRef(i),s=await this.resolveRef(r);return a!=s}async checkRequirements(){return await this.plugin.app.vault.adapter.exists(`${this.getRepo().dir}/.git/HEAD`)?"valid":"missing-repo"}async branchInfo(){var n,r;try{let i=await ae.currentBranch(this.getRepo())||"",a=await ae.listBranches(this.getRepo()),s=(n=await this.getConfig(`branch.${i}.remote`))!=null?n:"origin",o=(r=await this.getConfig(`branch.${i}.merge`))==null?void 0:r.split("refs/heads")[1],l=o?s+o:void 0;return{current:i,tracking:l,branches:a,remote:s}}catch(i){throw this.plugin.displayError(i),i}}async getCurrentRemote(){var i;let n=await ae.currentBranch(this.getRepo())||"";return(i=await this.getConfig(`branch.${n}.remote`))!=null?i:"origin"}async checkout(n,r){try{return this.wrapFS(ae.checkout({...this.getRepo(),ref:n,force:!!r,remote:r}))}catch(i){throw this.plugin.displayError(i),i}}async createBranch(n){try{await this.wrapFS(ae.branch({...this.getRepo(),ref:n,checkout:!0}))}catch(r){throw this.plugin.displayError(r),r}}async deleteBranch(n){try{await this.wrapFS(ae.deleteBranch({...this.getRepo(),ref:n}))}catch(r){throw this.plugin.displayError(r),r}}branchIsMerged(n){return Promise.resolve(!0)}async init(){try{await this.wrapFS(ae.init(this.getRepo()))}catch(n){throw this.plugin.displayError(n),n}}async clone(n,r,i){let a=this.showNotice("Initializing clone");try{await this.wrapFS(ae.clone({...this.getRepo(),dir:r,url:n,depth:i,onProgress:s=>{a!==void 0&&(a.noticeEl.innerText=this.getProgressText("Cloning",s))}})),a==null||a.hide()}catch(s){throw a==null||a.hide(),this.plugin.displayError(s),s}}async setConfig(n,r){try{return this.wrapFS(ae.setConfig({...this.getRepo(),path:n,value:r}))}catch(i){throw this.plugin.displayError(i),i}}async getConfig(n){try{return this.wrapFS(ae.getConfig({...this.getRepo(),path:n}))}catch(r){throw this.plugin.displayError(r),r}}async fetch(n){let r=this.showNotice("Initializing fetch");try{let i={...this.getRepo(),onProgress:a=>{r!==void 0&&(r.noticeEl.innerText=this.getProgressText("Fetching",a))},remote:n!=null?n:await this.getCurrentRemote()};await this.wrapFS(ae.fetch(i)),r==null||r.hide()}catch(i){throw this.plugin.displayError(i),r==null||r.hide(),i}}async setRemote(n,r){try{await this.wrapFS(ae.addRemote({...this.getRepo(),remote:n,url:r,force:!0}))}catch(i){throw this.plugin.displayError(i),i}}async getRemoteBranches(n){let r=[];return r.push(...await this.wrapFS(ae.listBranches({...this.getRepo(),remote:n}))),r.remove("HEAD"),r=r.map(i=>`${n}/${i}`),r}async getRemotes(){return(await this.wrapFS(ae.listRemotes({...this.getRepo()}))).map(n=>n.remote)}async removeRemote(n){await this.wrapFS(ae.deleteRemote({...this.getRepo(),remote:n}))}async getRemoteUrl(n){var r;return(r=(await this.wrapFS(ae.listRemotes({...this.getRepo()}))).filter(i=>i.remote==n)[0])==null?void 0:r.url}async log(n,r=!0,i){let a=await this.wrapFS(ae.log({...this.getRepo(),depth:i}));return Promise.all(a.map(async s=>{let o=s.commit.message.split(` -// src/lineAuthor/lineAuthorIntegration.ts -init_polyfill_buffer(); -var import_obsidian12 = require("obsidian"); +`);return{message:o[0],author:{name:s.commit.author.name,email:s.commit.author.email},body:o.slice(1).join(` -// src/gitManager/simpleGit.ts -init_polyfill_buffer(); -var import_child_process2 = require("child_process"); -var import_debug2 = __toESM(require_browser()); -var import_obsidian4 = require("obsidian"); -var path = __toESM(require("path")); -var import_path = require("path"); - -// node_modules/.pnpm/github.com+Vinzent03+git-js@6b9a2d899bc8256e38a1d6f0b8a88116ba2bf56a_supports-color@9.4.0_rdkutdaeyye3o67thmklazfzta/node_modules/simple-git/dist/esm/index.js -init_polyfill_buffer(); -var import_file_exists = __toESM(require_dist(), 1); -var import_debug = __toESM(require_browser(), 1); -var import_child_process = require("child_process"); -var import_promise_deferred = __toESM(require_dist2(), 1); -var import_promise_deferred2 = __toESM(require_dist2(), 1); -var __defProp2 = Object.defineProperty; -var __defProps = Object.defineProperties; -var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; -var __getOwnPropNames2 = Object.getOwnPropertyNames; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; -var __hasOwnProp2 = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp2 = (obj, key2, value) => key2 in obj ? __defProp2(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; -var __spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp2.call(b, prop)) - __defNormalProp2(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp2(a, prop, b[prop]); - } - return a; -}; -var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __markAsModule = (target) => __defProp2(target, "__esModule", { value: true }); -var __esm2 = (fn, res) => function __init() { - return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res; -}; -var __commonJS2 = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export2 = (target, all) => { - for (var name in all) - __defProp2(target, name, { get: all[name], enumerable: true }); -}; -var __reExport = (target, module2, copyDefault, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key2 of __getOwnPropNames2(module2)) - if (!__hasOwnProp2.call(target, key2) && (copyDefault || key2 !== "default")) - __defProp2(target, key2, { get: () => module2[key2], enumerable: !(desc = __getOwnPropDesc2(module2, key2)) || desc.enumerable }); - } - return target; -}; -var __toCommonJS2 = /* @__PURE__ */ ((cache) => { - return (module2, temp) => { - return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp); - }; -})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); -var __async = (__this, __arguments, generator) => { - return new Promise((resolve, reject) => { - var fulfilled = (value) => { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - }; - var rejected = (value) => { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); - } - }; - var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); - step((generator = generator.apply(__this, __arguments)).next()); - }); -}; -var GitError; -var init_git_error = __esm2({ - "src/lib/errors/git-error.ts"() { - GitError = class extends Error { - constructor(task, message) { - super(message); - this.task = task; - Object.setPrototypeOf(this, new.target.prototype); - } - }; - } -}); -var GitResponseError; -var init_git_response_error = __esm2({ - "src/lib/errors/git-response-error.ts"() { - init_git_error(); - GitResponseError = class extends GitError { - constructor(git, message) { - super(void 0, message || String(git)); - this.git = git; - } - }; - } -}); -var TaskConfigurationError; -var init_task_configuration_error = __esm2({ - "src/lib/errors/task-configuration-error.ts"() { - init_git_error(); - TaskConfigurationError = class extends GitError { - constructor(message) { - super(void 0, message); - } - }; - } -}); -function asFunction(source) { - return typeof source === "function" ? source : NOOP; -} -function isUserFunction(source) { - return typeof source === "function" && source !== NOOP; -} -function splitOn(input, char) { - const index2 = input.indexOf(char); - if (index2 <= 0) { - return [input, ""]; - } - return [input.substr(0, index2), input.substr(index2 + 1)]; -} -function first(input, offset = 0) { - return isArrayLike(input) && input.length > offset ? input[offset] : void 0; -} -function last(input, offset = 0) { - if (isArrayLike(input) && input.length > offset) { - return input[input.length - 1 - offset]; - } -} -function isArrayLike(input) { - return !!(input && typeof input.length === "number"); -} -function toLinesWithContent(input = "", trimmed2 = true, separator2 = "\n") { - return input.split(separator2).reduce((output, line) => { - const lineContent = trimmed2 ? line.trim() : line; - if (lineContent) { - output.push(lineContent); - } - return output; - }, []); -} -function forEachLineWithContent(input, callback) { - return toLinesWithContent(input, true).map((line) => callback(line)); -} -function folderExists(path2) { - return (0, import_file_exists.exists)(path2, import_file_exists.FOLDER); -} -function append(target, item) { - if (Array.isArray(target)) { - if (!target.includes(item)) { - target.push(item); - } - } else { - target.add(item); - } - return item; -} -function including(target, item) { - if (Array.isArray(target) && !target.includes(item)) { - target.push(item); - } - return target; -} -function remove2(target, item) { - if (Array.isArray(target)) { - const index2 = target.indexOf(item); - if (index2 >= 0) { - target.splice(index2, 1); - } - } else { - target.delete(item); - } - return item; -} -function asArray(source) { - return Array.isArray(source) ? source : [source]; -} -function asStringArray(source) { - return asArray(source).map(String); -} -function asNumber(source, onNaN = 0) { - if (source == null) { - return onNaN; - } - const num2 = parseInt(source, 10); - return isNaN(num2) ? onNaN : num2; -} -function prefixedArray(input, prefix) { - const output = []; - for (let i = 0, max = input.length; i < max; i++) { - output.push(prefix, input[i]); - } - return output; -} -function bufferToString(input) { - return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8"); -} -function pick(source, properties) { - return Object.assign({}, ...properties.map((property) => property in source ? { [property]: source[property] } : {})); -} -function delay(duration = 0) { - return new Promise((done) => setTimeout(done, duration)); -} -var NULL; -var NOOP; -var objectToString; -var init_util = __esm2({ - "src/lib/utils/util.ts"() { - NULL = "\0"; - NOOP = () => { - }; - objectToString = Object.prototype.toString.call.bind(Object.prototype.toString); - } -}); -function filterType(input, filter, def) { - if (filter(input)) { - return input; - } - return arguments.length > 2 ? def : void 0; -} -function filterPrimitives(input, omit) { - return /number|string|boolean/.test(typeof input) && (!omit || !omit.includes(typeof input)); -} -function filterPlainObject(input) { - return !!input && objectToString(input) === "[object Object]"; -} -function filterFunction(input) { - return typeof input === "function"; -} -var filterArray; -var filterString; -var filterStringArray; -var filterStringOrStringArray; -var filterHasLength; -var init_argument_filters = __esm2({ - "src/lib/utils/argument-filters.ts"() { - init_util(); - filterArray = (input) => { - return Array.isArray(input); - }; - filterString = (input) => { - return typeof input === "string"; - }; - filterStringArray = (input) => { - return Array.isArray(input) && input.every(filterString); - }; - filterStringOrStringArray = (input) => { - return filterString(input) || Array.isArray(input) && input.every(filterString); - }; - filterHasLength = (input) => { - if (input == null || "number|boolean|function".includes(typeof input)) { - return false; - } - return Array.isArray(input) || typeof input === "string" || typeof input.length === "number"; - }; - } -}); -var ExitCodes; -var init_exit_codes = __esm2({ - "src/lib/utils/exit-codes.ts"() { - ExitCodes = /* @__PURE__ */ ((ExitCodes2) => { - ExitCodes2[ExitCodes2["SUCCESS"] = 0] = "SUCCESS"; - ExitCodes2[ExitCodes2["ERROR"] = 1] = "ERROR"; - ExitCodes2[ExitCodes2["NOT_FOUND"] = -2] = "NOT_FOUND"; - ExitCodes2[ExitCodes2["UNCLEAN"] = 128] = "UNCLEAN"; - return ExitCodes2; - })(ExitCodes || {}); - } -}); -var GitOutputStreams; -var init_git_output_streams = __esm2({ - "src/lib/utils/git-output-streams.ts"() { - GitOutputStreams = class { - constructor(stdOut, stdErr) { - this.stdOut = stdOut; - this.stdErr = stdErr; - } - asStrings() { - return new GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8")); - } - }; - } -}); -var LineParser; -var RemoteLineParser; -var init_line_parser = __esm2({ - "src/lib/utils/line-parser.ts"() { - LineParser = class { - constructor(regExp, useMatches) { - this.matches = []; - this.parse = (line, target) => { - this.resetMatches(); - if (!this._regExp.every((reg, index2) => this.addMatch(reg, index2, line(index2)))) { - return false; - } - return this.useMatches(target, this.prepareMatches()) !== false; - }; - this._regExp = Array.isArray(regExp) ? regExp : [regExp]; - if (useMatches) { - this.useMatches = useMatches; - } - } - useMatches(target, match) { - throw new Error(`LineParser:useMatches not implemented`); - } - resetMatches() { - this.matches.length = 0; - } - prepareMatches() { - return this.matches; - } - addMatch(reg, index2, line) { - const matched = line && reg.exec(line); - if (matched) { - this.pushMatch(index2, matched); - } - return !!matched; - } - pushMatch(_index, matched) { - this.matches.push(...matched.slice(1)); - } - }; - RemoteLineParser = class extends LineParser { - addMatch(reg, index2, line) { - return /^remote:\s/.test(String(line)) && super.addMatch(reg, index2, line); - } - pushMatch(index2, matched) { - if (index2 > 0 || matched.length > 1) { - super.pushMatch(index2, matched); - } - } - }; - } -}); -function createInstanceConfig(...options) { - const baseDir = process.cwd(); - const config = Object.assign(__spreadValues({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === "object" && o)); - config.baseDir = config.baseDir || baseDir; - config.trimmed = config.trimmed === true; - return config; -} -var defaultOptions; -var init_simple_git_options = __esm2({ - "src/lib/utils/simple-git-options.ts"() { - defaultOptions = { - binary: "git", - maxConcurrentProcesses: 5, - config: [], - trimmed: false - }; - } -}); -function appendTaskOptions(options, commands2 = []) { - if (!filterPlainObject(options)) { - return commands2; - } - return Object.keys(options).reduce((commands22, key2) => { - const value = options[key2]; - if (filterPrimitives(value, ["boolean"])) { - commands22.push(key2 + "=" + value); - } else { - commands22.push(key2); - } - return commands22; - }, commands2); -} -function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) { - const command = []; - for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) { - if ("string|number".includes(typeof args[i])) { - command.push(String(args[i])); - } - } - appendTaskOptions(trailingOptionsArgument(args), command); - if (!objectOnly) { - command.push(...trailingArrayArgument(args)); - } - return command; -} -function trailingArrayArgument(args) { - const hasTrailingCallback = typeof last(args) === "function"; - return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []); -} -function trailingOptionsArgument(args) { - const hasTrailingCallback = filterFunction(last(args)); - return filterType(last(args, hasTrailingCallback ? 1 : 0), filterPlainObject); -} -function trailingFunctionArgument(args, includeNoop = true) { - const callback = asFunction(last(args)); - return includeNoop || isUserFunction(callback) ? callback : void 0; -} -var init_task_options = __esm2({ - "src/lib/utils/task-options.ts"() { - init_argument_filters(); - init_util(); - } -}); -function callTaskParser(parser3, streams) { - return parser3(streams.stdOut, streams.stdErr); -} -function parseStringResponse(result, parsers12, texts, trim = true) { - asArray(texts).forEach((text2) => { - for (let lines = toLinesWithContent(text2, trim), i = 0, max = lines.length; i < max; i++) { - const line = (offset = 0) => { - if (i + offset >= max) { - return; - } - return lines[i + offset]; - }; - parsers12.some(({ parse: parse2 }) => parse2(line, result)); - } - }); - return result; -} -var init_task_parser = __esm2({ - "src/lib/utils/task-parser.ts"() { - init_util(); - } -}); -var utils_exports = {}; -__export2(utils_exports, { - ExitCodes: () => ExitCodes, - GitOutputStreams: () => GitOutputStreams, - LineParser: () => LineParser, - NOOP: () => NOOP, - NULL: () => NULL, - RemoteLineParser: () => RemoteLineParser, - append: () => append, - appendTaskOptions: () => appendTaskOptions, - asArray: () => asArray, - asFunction: () => asFunction, - asNumber: () => asNumber, - asStringArray: () => asStringArray, - bufferToString: () => bufferToString, - callTaskParser: () => callTaskParser, - createInstanceConfig: () => createInstanceConfig, - delay: () => delay, - filterArray: () => filterArray, - filterFunction: () => filterFunction, - filterHasLength: () => filterHasLength, - filterPlainObject: () => filterPlainObject, - filterPrimitives: () => filterPrimitives, - filterString: () => filterString, - filterStringArray: () => filterStringArray, - filterStringOrStringArray: () => filterStringOrStringArray, - filterType: () => filterType, - first: () => first, - folderExists: () => folderExists, - forEachLineWithContent: () => forEachLineWithContent, - getTrailingOptions: () => getTrailingOptions, - including: () => including, - isUserFunction: () => isUserFunction, - last: () => last, - objectToString: () => objectToString, - parseStringResponse: () => parseStringResponse, - pick: () => pick, - prefixedArray: () => prefixedArray, - remove: () => remove2, - splitOn: () => splitOn, - toLinesWithContent: () => toLinesWithContent, - trailingFunctionArgument: () => trailingFunctionArgument, - trailingOptionsArgument: () => trailingOptionsArgument -}); -var init_utils = __esm2({ - "src/lib/utils/index.ts"() { - init_argument_filters(); - init_exit_codes(); - init_git_output_streams(); - init_line_parser(); - init_simple_git_options(); - init_task_options(); - init_task_parser(); - init_util(); - } -}); -var check_is_repo_exports = {}; -__export2(check_is_repo_exports, { - CheckRepoActions: () => CheckRepoActions, - checkIsBareRepoTask: () => checkIsBareRepoTask, - checkIsRepoRootTask: () => checkIsRepoRootTask, - checkIsRepoTask: () => checkIsRepoTask -}); -function checkIsRepoTask(action) { - switch (action) { - case "bare": - return checkIsBareRepoTask(); - case "root": - return checkIsRepoRootTask(); - } - const commands2 = ["rev-parse", "--is-inside-work-tree"]; - return { - commands: commands2, - format: "utf-8", - onError, - parser - }; -} -function checkIsRepoRootTask() { - const commands2 = ["rev-parse", "--git-dir"]; - return { - commands: commands2, - format: "utf-8", - onError, - parser(path2) { - return /^\.(git)?$/.test(path2.trim()); - } - }; -} -function checkIsBareRepoTask() { - const commands2 = ["rev-parse", "--is-bare-repository"]; - return { - commands: commands2, - format: "utf-8", - onError, - parser - }; -} -function isNotRepoMessage(error) { - return /(Not a git repository|Kein Git-Repository)/i.test(String(error)); -} -var CheckRepoActions; -var onError; -var parser; -var init_check_is_repo = __esm2({ - "src/lib/tasks/check-is-repo.ts"() { - init_utils(); - CheckRepoActions = /* @__PURE__ */ ((CheckRepoActions2) => { - CheckRepoActions2["BARE"] = "bare"; - CheckRepoActions2["IN_TREE"] = "tree"; - CheckRepoActions2["IS_REPO_ROOT"] = "root"; - return CheckRepoActions2; - })(CheckRepoActions || {}); - onError = ({ exitCode }, error, done, fail) => { - if (exitCode === 128 && isNotRepoMessage(error)) { - return done(Buffer.from("false")); - } - fail(error); - }; - parser = (text2) => { - return text2.trim() === "true"; - }; - } -}); -function cleanSummaryParser(dryRun, text2) { - const summary = new CleanResponse(dryRun); - const regexp = dryRun ? dryRunRemovalRegexp : removalRegexp; - toLinesWithContent(text2).forEach((line) => { - const removed = line.replace(regexp, ""); - summary.paths.push(removed); - (isFolderRegexp.test(removed) ? summary.folders : summary.files).push(removed); - }); - return summary; -} -var CleanResponse; -var removalRegexp; -var dryRunRemovalRegexp; -var isFolderRegexp; -var init_CleanSummary = __esm2({ - "src/lib/responses/CleanSummary.ts"() { - init_utils(); - CleanResponse = class { - constructor(dryRun) { - this.dryRun = dryRun; - this.paths = []; - this.files = []; - this.folders = []; - } - }; - removalRegexp = /^[a-z]+\s*/i; - dryRunRemovalRegexp = /^[a-z]+\s+[a-z]+\s*/i; - isFolderRegexp = /\/$/; - } -}); -var task_exports = {}; -__export2(task_exports, { - EMPTY_COMMANDS: () => EMPTY_COMMANDS, - adhocExecTask: () => adhocExecTask, - configurationErrorTask: () => configurationErrorTask, - isBufferTask: () => isBufferTask, - isEmptyTask: () => isEmptyTask, - straightThroughBufferTask: () => straightThroughBufferTask, - straightThroughStringTask: () => straightThroughStringTask -}); -function adhocExecTask(parser3) { - return { - commands: EMPTY_COMMANDS, - format: "empty", - parser: parser3 - }; -} -function configurationErrorTask(error) { - return { - commands: EMPTY_COMMANDS, - format: "empty", - parser() { - throw typeof error === "string" ? new TaskConfigurationError(error) : error; - } - }; -} -function straightThroughStringTask(commands2, trimmed2 = false) { - return { - commands: commands2, - format: "utf-8", - parser(text2) { - return trimmed2 ? String(text2).trim() : text2; - } - }; -} -function straightThroughBufferTask(commands2) { - return { - commands: commands2, - format: "buffer", - parser(buffer2) { - return buffer2; - } - }; -} -function isBufferTask(task) { - return task.format === "buffer"; -} -function isEmptyTask(task) { - return task.format === "empty" || !task.commands.length; -} -var EMPTY_COMMANDS; -var init_task = __esm2({ - "src/lib/tasks/task.ts"() { - init_task_configuration_error(); - EMPTY_COMMANDS = []; - } -}); -var clean_exports = {}; -__export2(clean_exports, { - CONFIG_ERROR_INTERACTIVE_MODE: () => CONFIG_ERROR_INTERACTIVE_MODE, - CONFIG_ERROR_MODE_REQUIRED: () => CONFIG_ERROR_MODE_REQUIRED, - CONFIG_ERROR_UNKNOWN_OPTION: () => CONFIG_ERROR_UNKNOWN_OPTION, - CleanOptions: () => CleanOptions, - cleanTask: () => cleanTask, - cleanWithOptionsTask: () => cleanWithOptionsTask, - isCleanOptionsArray: () => isCleanOptionsArray -}); -function cleanWithOptionsTask(mode, customArgs) { - const { cleanMode, options, valid } = getCleanOptions(mode); - if (!cleanMode) { - return configurationErrorTask(CONFIG_ERROR_MODE_REQUIRED); - } - if (!valid.options) { - return configurationErrorTask(CONFIG_ERROR_UNKNOWN_OPTION + JSON.stringify(mode)); - } - options.push(...customArgs); - if (options.some(isInteractiveMode)) { - return configurationErrorTask(CONFIG_ERROR_INTERACTIVE_MODE); - } - return cleanTask(cleanMode, options); -} -function cleanTask(mode, customArgs) { - const commands2 = ["clean", `-${mode}`, ...customArgs]; - return { - commands: commands2, - format: "utf-8", - parser(text2) { - return cleanSummaryParser(mode === "n", text2); - } - }; -} -function isCleanOptionsArray(input) { - return Array.isArray(input) && input.every((test) => CleanOptionValues.has(test)); -} -function getCleanOptions(input) { - let cleanMode; - let options = []; - let valid = { cleanMode: false, options: true }; - input.replace(/[^a-z]i/g, "").split("").forEach((char) => { - if (isCleanMode(char)) { - cleanMode = char; - valid.cleanMode = true; - } else { - valid.options = valid.options && isKnownOption(options[options.length] = `-${char}`); - } - }); - return { - cleanMode, - options, - valid - }; -} -function isCleanMode(cleanMode) { - return cleanMode === "f" || cleanMode === "n"; -} -function isKnownOption(option) { - return /^-[a-z]$/i.test(option) && CleanOptionValues.has(option.charAt(1)); -} -function isInteractiveMode(option) { - if (/^-[^\-]/.test(option)) { - return option.indexOf("i") > 0; - } - return option === "--interactive"; -} -var CONFIG_ERROR_INTERACTIVE_MODE; -var CONFIG_ERROR_MODE_REQUIRED; -var CONFIG_ERROR_UNKNOWN_OPTION; -var CleanOptions; -var CleanOptionValues; -var init_clean = __esm2({ - "src/lib/tasks/clean.ts"() { - init_CleanSummary(); - init_utils(); - init_task(); - CONFIG_ERROR_INTERACTIVE_MODE = "Git clean interactive mode is not supported"; - CONFIG_ERROR_MODE_REQUIRED = 'Git clean mode parameter ("n" or "f") is required'; - CONFIG_ERROR_UNKNOWN_OPTION = "Git clean unknown option found in: "; - CleanOptions = /* @__PURE__ */ ((CleanOptions2) => { - CleanOptions2["DRY_RUN"] = "n"; - CleanOptions2["FORCE"] = "f"; - CleanOptions2["IGNORED_INCLUDED"] = "x"; - CleanOptions2["IGNORED_ONLY"] = "X"; - CleanOptions2["EXCLUDING"] = "e"; - CleanOptions2["QUIET"] = "q"; - CleanOptions2["RECURSIVE"] = "d"; - return CleanOptions2; - })(CleanOptions || {}); - CleanOptionValues = /* @__PURE__ */ new Set([ - "i", - ...asStringArray(Object.values(CleanOptions)) - ]); - } -}); -function configListParser(text2) { - const config = new ConfigList(); - for (const item of configParser(text2)) { - config.addValue(item.file, String(item.key), item.value); - } - return config; -} -function configGetParser(text2, key2) { - let value = null; - const values = []; - const scopes = /* @__PURE__ */ new Map(); - for (const item of configParser(text2, key2)) { - if (item.key !== key2) { - continue; - } - values.push(value = item.value); - if (!scopes.has(item.file)) { - scopes.set(item.file, []); - } - scopes.get(item.file).push(value); - } - return { - key: key2, - paths: Array.from(scopes.keys()), - scopes, - value, - values - }; -} -function configFilePath(filePath) { - return filePath.replace(/^(file):/, ""); -} -function* configParser(text2, requestedKey = null) { - const lines = text2.split("\0"); - for (let i = 0, max = lines.length - 1; i < max; ) { - const file = configFilePath(lines[i++]); - let value = lines[i++]; - let key2 = requestedKey; - if (value.includes("\n")) { - const line = splitOn(value, "\n"); - key2 = line[0]; - value = line[1]; - } - yield { file, key: key2, value }; - } -} -var ConfigList; -var init_ConfigList = __esm2({ - "src/lib/responses/ConfigList.ts"() { - init_utils(); - ConfigList = class { - constructor() { - this.files = []; - this.values = /* @__PURE__ */ Object.create(null); - } - get all() { - if (!this._all) { - this._all = this.files.reduce((all, file) => { - return Object.assign(all, this.values[file]); - }, {}); - } - return this._all; - } - addFile(file) { - if (!(file in this.values)) { - const latest = last(this.files); - this.values[file] = latest ? Object.create(this.values[latest]) : {}; - this.files.push(file); - } - return this.values[file]; - } - addValue(file, key2, value) { - const values = this.addFile(file); - if (!values.hasOwnProperty(key2)) { - values[key2] = value; - } else if (Array.isArray(values[key2])) { - values[key2].push(value); - } else { - values[key2] = [values[key2], value]; - } - this._all = void 0; - } - }; - } -}); -function asConfigScope(scope, fallback) { - if (typeof scope === "string" && GitConfigScope.hasOwnProperty(scope)) { - return scope; - } - return fallback; -} -function addConfigTask(key2, value, append22, scope) { - const commands2 = ["config", `--${scope}`]; - if (append22) { - commands2.push("--add"); - } - commands2.push(key2, value); - return { - commands: commands2, - format: "utf-8", - parser(text2) { - return text2; - } - }; -} -function getConfigTask(key2, scope) { - const commands2 = ["config", "--null", "--show-origin", "--get-all", key2]; - if (scope) { - commands2.splice(1, 0, `--${scope}`); - } - return { - commands: commands2, - format: "utf-8", - parser(text2) { - return configGetParser(text2, key2); - } - }; -} -function listConfigTask(scope) { - const commands2 = ["config", "--list", "--show-origin", "--null"]; - if (scope) { - commands2.push(`--${scope}`); - } - return { - commands: commands2, - format: "utf-8", - parser(text2) { - return configListParser(text2); - } - }; -} -function config_default() { - return { - addConfig(key2, value, ...rest) { - return this._runTask(addConfigTask(key2, value, rest[0] === true, asConfigScope( - rest[1], - "local" - /* local */ - )), trailingFunctionArgument(arguments)); - }, - getConfig(key2, scope) { - return this._runTask(getConfigTask(key2, asConfigScope(scope, void 0)), trailingFunctionArgument(arguments)); - }, - listConfig(...rest) { - return this._runTask(listConfigTask(asConfigScope(rest[0], void 0)), trailingFunctionArgument(arguments)); - } - }; -} -var GitConfigScope; -var init_config = __esm2({ - "src/lib/tasks/config.ts"() { - init_ConfigList(); - init_utils(); - GitConfigScope = /* @__PURE__ */ ((GitConfigScope2) => { - GitConfigScope2["system"] = "system"; - GitConfigScope2["global"] = "global"; - GitConfigScope2["local"] = "local"; - GitConfigScope2["worktree"] = "worktree"; - return GitConfigScope2; - })(GitConfigScope || {}); - } -}); -function grepQueryBuilder(...params) { - return new GrepQuery().param(...params); -} -function parseGrep(grep) { - const paths = /* @__PURE__ */ new Set(); - const results = {}; - forEachLineWithContent(grep, (input) => { - const [path2, line, preview] = input.split(NULL); - paths.add(path2); - (results[path2] = results[path2] || []).push({ - line: asNumber(line), - path: path2, - preview - }); - }); - return { - paths, - results - }; -} -function grep_default() { - return { - grep(searchTerm) { - const then = trailingFunctionArgument(arguments); - const options = getTrailingOptions(arguments); - for (const option of disallowedOptions) { - if (options.includes(option)) { - return this._runTask(configurationErrorTask(`git.grep: use of "${option}" is not supported.`), then); - } - } - if (typeof searchTerm === "string") { - searchTerm = grepQueryBuilder().param(searchTerm); - } - const commands2 = ["grep", "--null", "-n", "--full-name", ...options, ...searchTerm]; - return this._runTask({ - commands: commands2, - format: "utf-8", - parser(stdOut) { - return parseGrep(stdOut); - } - }, then); - } - }; -} -var disallowedOptions; -var Query; -var _a; -var GrepQuery; -var init_grep = __esm2({ - "src/lib/tasks/grep.ts"() { - init_utils(); - init_task(); - disallowedOptions = ["-h"]; - Query = Symbol("grepQuery"); - GrepQuery = class { - constructor() { - this[_a] = []; - } - *[(_a = Query, Symbol.iterator)]() { - for (const query of this[Query]) { - yield query; - } - } - and(...and) { - and.length && this[Query].push("--and", "(", ...prefixedArray(and, "-e"), ")"); - return this; - } - param(...param) { - this[Query].push(...prefixedArray(param, "-e")); - return this; - } - }; - } -}); -var reset_exports = {}; -__export2(reset_exports, { - ResetMode: () => ResetMode, - getResetMode: () => getResetMode, - resetTask: () => resetTask -}); -function resetTask(mode, customArgs) { - const commands2 = ["reset"]; - if (isValidResetMode(mode)) { - commands2.push(`--${mode}`); - } - commands2.push(...customArgs); - return straightThroughStringTask(commands2); -} -function getResetMode(mode) { - if (isValidResetMode(mode)) { - return mode; - } - switch (typeof mode) { - case "string": - case "undefined": - return "soft"; - } - return; -} -function isValidResetMode(mode) { - return ResetModes.includes(mode); -} -var ResetMode; -var ResetModes; -var init_reset = __esm2({ - "src/lib/tasks/reset.ts"() { - init_task(); - ResetMode = /* @__PURE__ */ ((ResetMode2) => { - ResetMode2["MIXED"] = "mixed"; - ResetMode2["SOFT"] = "soft"; - ResetMode2["HARD"] = "hard"; - ResetMode2["MERGE"] = "merge"; - ResetMode2["KEEP"] = "keep"; - return ResetMode2; - })(ResetMode || {}); - ResetModes = Array.from(Object.values(ResetMode)); - } -}); -function createLog() { - return (0, import_debug.default)("simple-git"); -} -function prefixedLogger(to, prefix, forward) { - if (!prefix || !String(prefix).replace(/\s*/, "")) { - return !forward ? to : (message, ...args) => { - to(message, ...args); - forward(message, ...args); - }; - } - return (message, ...args) => { - to(`%s ${message}`, prefix, ...args); - if (forward) { - forward(message, ...args); - } - }; -} -function childLoggerName(name, childDebugger, { namespace: parentNamespace }) { - if (typeof name === "string") { - return name; - } - const childNamespace = childDebugger && childDebugger.namespace || ""; - if (childNamespace.startsWith(parentNamespace)) { - return childNamespace.substr(parentNamespace.length + 1); - } - return childNamespace || parentNamespace; -} -function createLogger(label, verbose, initialStep, infoDebugger = createLog()) { - const labelPrefix = label && `[${label}]` || ""; - const spawned = []; - const debugDebugger = typeof verbose === "string" ? infoDebugger.extend(verbose) : verbose; - const key2 = childLoggerName(filterType(verbose, filterString), debugDebugger, infoDebugger); - return step(initialStep); - function sibling(name, initial) { - return append(spawned, createLogger(label, key2.replace(/^[^:]+/, name), initial, infoDebugger)); - } - function step(phase) { - const stepPrefix = phase && `[${phase}]` || ""; - const debug22 = debugDebugger && prefixedLogger(debugDebugger, stepPrefix) || NOOP; - const info = prefixedLogger(infoDebugger, `${labelPrefix} ${stepPrefix}`, debug22); - return Object.assign(debugDebugger ? debug22 : info, { - label, - sibling, - info, - step - }); - } -} -var init_git_logger = __esm2({ - "src/lib/git-logger.ts"() { - init_utils(); - import_debug.default.formatters.L = (value) => String(filterHasLength(value) ? value.length : "-"); - import_debug.default.formatters.B = (value) => { - if (Buffer.isBuffer(value)) { - return value.toString("utf8"); - } - return objectToString(value); - }; - } -}); -var _TasksPendingQueue; -var TasksPendingQueue; -var init_tasks_pending_queue = __esm2({ - "src/lib/runners/tasks-pending-queue.ts"() { - init_git_error(); - init_git_logger(); - _TasksPendingQueue = class { - constructor(logLabel = "GitExecutor") { - this.logLabel = logLabel; - this._queue = /* @__PURE__ */ new Map(); - } - withProgress(task) { - return this._queue.get(task); - } - createProgress(task) { - const name = _TasksPendingQueue.getName(task.commands[0]); - const logger = createLogger(this.logLabel, name); - return { - task, - logger, - name - }; - } - push(task) { - const progress = this.createProgress(task); - progress.logger("Adding task to the queue, commands = %o", task.commands); - this._queue.set(task, progress); - return progress; - } - fatal(err) { - for (const [task, { logger }] of Array.from(this._queue.entries())) { - if (task === err.task) { - logger.info(`Failed %o`, err); - logger(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`); - } else { - logger.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`, err.message); - } - this.complete(task); - } - if (this._queue.size !== 0) { - throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`); - } - } - complete(task) { - const progress = this.withProgress(task); - if (progress) { - this._queue.delete(task); - } - } - attempt(task) { - const progress = this.withProgress(task); - if (!progress) { - throw new GitError(void 0, "TasksPendingQueue: attempt called for an unknown task"); - } - progress.logger("Starting task"); - return progress; - } - static getName(name = "empty") { - return `task:${name}:${++_TasksPendingQueue.counter}`; - } - }; - TasksPendingQueue = _TasksPendingQueue; - TasksPendingQueue.counter = 0; - } -}); -function pluginContext(task, commands2) { - return { - method: first(task.commands) || "", - commands: commands2 - }; -} -function onErrorReceived(target, logger) { - return (err) => { - logger(`[ERROR] child process exception %o`, err); - target.push(Buffer.from(String(err.stack), "ascii")); - }; -} -function onDataReceived(target, name, logger, output) { - return (buffer2) => { - logger(`%s received %L bytes`, name, buffer2); - output(`%B`, buffer2); - target.push(buffer2); - }; -} -var GitExecutorChain; -var init_git_executor_chain = __esm2({ - "src/lib/runners/git-executor-chain.ts"() { - init_git_error(); - init_task(); - init_utils(); - init_tasks_pending_queue(); - GitExecutorChain = class { - constructor(_executor, _scheduler, _plugins) { - this._executor = _executor; - this._scheduler = _scheduler; - this._plugins = _plugins; - this._chain = Promise.resolve(); - this._queue = new TasksPendingQueue(); - } - get binary() { - return this._executor.binary; - } - get cwd() { - return this._cwd || this._executor.cwd; - } - set cwd(cwd) { - this._cwd = cwd; - } - get env() { - return this._executor.env; - } - get outputHandler() { - return this._executor.outputHandler; - } - chain() { - return this; - } - push(task) { - this._queue.push(task); - return this._chain = this._chain.then(() => this.attemptTask(task)); - } - attemptTask(task) { - return __async(this, null, function* () { - const onScheduleComplete = yield this._scheduler.next(); - const onQueueComplete = () => this._queue.complete(task); - try { - const { logger } = this._queue.attempt(task); - return yield isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger); - } catch (e) { - throw this.onFatalException(task, e); - } finally { - onQueueComplete(); - onScheduleComplete(); - } - }); - } - onFatalException(task, e) { - const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e)); - this._chain = Promise.resolve(); - this._queue.fatal(gitError); - return gitError; - } - attemptRemoteTask(task, logger) { - return __async(this, null, function* () { - const args = this._plugins.exec("spawn.args", [...task.commands], pluginContext(task, task.commands)); - const raw = yield this.gitResponse(task, this.binary, args, this.outputHandler, logger.step("SPAWN")); - const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE")); - logger(`passing response to task's parser as a %s`, task.format); - if (isBufferTask(task)) { - return callTaskParser(task.parser, outputStreams); - } - return callTaskParser(task.parser, outputStreams.asStrings()); - }); - } - attemptEmptyTask(task, logger) { - return __async(this, null, function* () { - logger(`empty task bypassing child process to call to task's parser`); - return task.parser(this); - }); - } - handleTaskData(task, args, result, logger) { - const { exitCode, rejection, stdOut, stdErr } = result; - return new Promise((done, fail) => { - logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode); - const { error } = this._plugins.exec("task.error", { error: rejection }, __spreadValues(__spreadValues({}, pluginContext(task, args)), result)); - if (error && task.onError) { - logger.info(`exitCode=%s handling with custom error handler`); - return task.onError(result, error, (newStdOut) => { - logger.info(`custom error handler treated as success`); - logger(`custom error returned a %s`, objectToString(newStdOut)); - done(new GitOutputStreams(Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut, Buffer.concat(stdErr))); - }, fail); - } - if (error) { - logger.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`, exitCode, stdErr.length, rejection); - return fail(error); - } - logger.info(`retrieving task output complete`); - done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr))); - }); - } - gitResponse(task, command, args, outputHandler, logger) { - return __async(this, null, function* () { - const outputLogger = logger.sibling("output"); - const spawnOptions = this._plugins.exec("spawn.options", { - cwd: this.cwd, - env: this.env, - windowsHide: true - }, pluginContext(task, task.commands)); - return new Promise((done) => { - const stdOut = []; - const stdErr = []; - logger.info(`%s %o`, command, args); - logger("%O", spawnOptions); - let rejection = this._beforeSpawn(task, args); - if (rejection) { - return done({ - stdOut, - stdErr, - exitCode: 9901, - rejection - }); - } - this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), { - kill(reason) { - rejection = reason || rejection; - } - })); - const spawned = (0, import_child_process.spawn)(command, args, spawnOptions); - spawned.stdout.on("data", onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))); - spawned.stderr.on("data", onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))); - spawned.on("error", onErrorReceived(stdErr, logger)); - if (outputHandler) { - logger(`Passing child process stdOut/stdErr to custom outputHandler`); - outputHandler(command, spawned.stdout, spawned.stderr, [...args]); - } - this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), { - spawned, - close(exitCode, reason) { - done({ - stdOut, - stdErr, - exitCode, - rejection: rejection || reason - }); - }, - kill(reason) { - if (spawned.killed) { - return; - } - rejection = reason; - spawned.kill("SIGINT"); - } - })); - }); - }); - } - _beforeSpawn(task, args) { - let rejection; - this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), { - kill(reason) { - rejection = reason || rejection; - } - })); - return rejection; - } - }; - } -}); -var git_executor_exports = {}; -__export2(git_executor_exports, { - GitExecutor: () => GitExecutor -}); -var GitExecutor; -var init_git_executor = __esm2({ - "src/lib/runners/git-executor.ts"() { - init_git_executor_chain(); - GitExecutor = class { - constructor(binary = "git", cwd, _scheduler, _plugins) { - this.binary = binary; - this.cwd = cwd; - this._scheduler = _scheduler; - this._plugins = _plugins; - this._chain = new GitExecutorChain(this, this._scheduler, this._plugins); - } - chain() { - return new GitExecutorChain(this, this._scheduler, this._plugins); - } - push(task) { - return this._chain.push(task); - } - }; - } -}); -function taskCallback(task, response, callback = NOOP) { - const onSuccess = (data) => { - callback(null, data); - }; - const onError2 = (err) => { - if ((err == null ? void 0 : err.task) === task) { - callback(err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err, void 0); - } - }; - response.then(onSuccess, onError2); -} -function addDeprecationNoticeToError(err) { - let log2 = (name) => { - console.warn(`simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`); - log2 = NOOP; - }; - return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {})); - function descriptorReducer(all, name) { - if (name in err) { - return all; - } - all[name] = { - enumerable: false, - configurable: false, - get() { - log2(name); - return err.git[name]; - } - }; - return all; - } -} -var init_task_callback = __esm2({ - "src/lib/task-callback.ts"() { - init_git_response_error(); - init_utils(); - } -}); -function changeWorkingDirectoryTask(directory, root2) { - return adhocExecTask((instance10) => { - if (!folderExists(directory)) { - throw new Error(`Git.cwd: cannot change to non-directory "${directory}"`); - } - return (root2 || instance10).cwd = directory; - }); -} -var init_change_working_directory = __esm2({ - "src/lib/tasks/change-working-directory.ts"() { - init_utils(); - init_task(); - } -}); -function checkoutTask(args) { - const commands2 = ["checkout", ...args]; - if (commands2[1] === "-b" && commands2.includes("-B")) { - commands2[1] = remove2(commands2, "-B"); - } - return straightThroughStringTask(commands2); -} -function checkout_default() { - return { - checkout() { - return this._runTask(checkoutTask(getTrailingOptions(arguments, 1)), trailingFunctionArgument(arguments)); - }, - checkoutBranch(branchName, startPoint) { - return this._runTask(checkoutTask(["-b", branchName, startPoint, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments)); - }, - checkoutLocalBranch(branchName) { - return this._runTask(checkoutTask(["-b", branchName, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments)); - } - }; -} -var init_checkout = __esm2({ - "src/lib/tasks/checkout.ts"() { - init_utils(); - init_task(); - } -}); -function parseCommitResult(stdOut) { - const result = { - author: null, - branch: "", - commit: "", - root: false, - summary: { - changes: 0, - insertions: 0, - deletions: 0 - } - }; - return parseStringResponse(result, parsers, stdOut); -} -var parsers; -var init_parse_commit = __esm2({ - "src/lib/parsers/parse-commit.ts"() { - init_utils(); - parsers = [ - new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/, (result, [branch2, root2, commit2]) => { - result.branch = branch2; - result.commit = commit2; - result.root = !!root2; - }), - new LineParser(/\s*Author:\s(.+)/i, (result, [author]) => { - const parts = author.split("<"); - const email = parts.pop(); - if (!email || !email.includes("@")) { - return; - } - result.author = { - email: email.substr(0, email.length - 1), - name: parts.join("<").trim() - }; - }), - new LineParser(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g, (result, [changes, insertions, deletions]) => { - result.summary.changes = parseInt(changes, 10) || 0; - result.summary.insertions = parseInt(insertions, 10) || 0; - result.summary.deletions = parseInt(deletions, 10) || 0; - }), - new LineParser(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/, (result, [changes, lines, direction]) => { - result.summary.changes = parseInt(changes, 10) || 0; - const count = parseInt(lines, 10) || 0; - if (direction === "-") { - result.summary.deletions = count; - } else if (direction === "+") { - result.summary.insertions = count; - } - }) - ]; - } -}); -function commitTask(message, files, customArgs) { - const commands2 = [ - "-c", - "core.abbrev=40", - "commit", - ...prefixedArray(message, "-m"), - ...files, - ...customArgs - ]; - return { - commands: commands2, - format: "utf-8", - parser: parseCommitResult - }; -} -function commit_default() { - return { - commit(message, ...rest) { - const next = trailingFunctionArgument(arguments); - const task = rejectDeprecatedSignatures(message) || commitTask(asArray(message), asArray(filterType(rest[0], filterStringOrStringArray, [])), [...filterType(rest[1], filterArray, []), ...getTrailingOptions(arguments, 0, true)]); - return this._runTask(task, next); - } - }; - function rejectDeprecatedSignatures(message) { - return !filterStringOrStringArray(message) && configurationErrorTask(`git.commit: requires the commit message to be supplied as a string/string[]`); - } -} -var init_commit = __esm2({ - "src/lib/tasks/commit.ts"() { - init_parse_commit(); - init_utils(); - init_task(); - } -}); -function hashObjectTask(filePath, write) { - const commands2 = ["hash-object", filePath]; - if (write) { - commands2.push("-w"); - } - return straightThroughStringTask(commands2, true); -} -var init_hash_object = __esm2({ - "src/lib/tasks/hash-object.ts"() { - init_task(); - } -}); -function parseInit(bare, path2, text2) { - const response = String(text2).trim(); - let result; - if (result = initResponseRegex.exec(response)) { - return new InitSummary(bare, path2, false, result[1]); - } - if (result = reInitResponseRegex.exec(response)) { - return new InitSummary(bare, path2, true, result[1]); - } - let gitDir = ""; - const tokens = response.split(" "); - while (tokens.length) { - const token = tokens.shift(); - if (token === "in") { - gitDir = tokens.join(" "); - break; - } - } - return new InitSummary(bare, path2, /^re/i.test(response), gitDir); -} -var InitSummary; -var initResponseRegex; -var reInitResponseRegex; -var init_InitSummary = __esm2({ - "src/lib/responses/InitSummary.ts"() { - InitSummary = class { - constructor(bare, path2, existing, gitDir) { - this.bare = bare; - this.path = path2; - this.existing = existing; - this.gitDir = gitDir; - } - }; - initResponseRegex = /^Init.+ repository in (.+)$/; - reInitResponseRegex = /^Rein.+ in (.+)$/; - } -}); -function hasBareCommand(command) { - return command.includes(bareCommand); -} -function initTask(bare = false, path2, customArgs) { - const commands2 = ["init", ...customArgs]; - if (bare && !hasBareCommand(commands2)) { - commands2.splice(1, 0, bareCommand); - } - return { - commands: commands2, - format: "utf-8", - parser(text2) { - return parseInit(commands2.includes("--bare"), path2, text2); - } - }; -} -var bareCommand; -var init_init = __esm2({ - "src/lib/tasks/init.ts"() { - init_InitSummary(); - bareCommand = "--bare"; - } -}); -function logFormatFromCommand(customArgs) { - for (let i = 0; i < customArgs.length; i++) { - const format = logFormatRegex.exec(customArgs[i]); - if (format) { - return `--${format[1]}`; - } - } - return ""; -} -function isLogFormat(customArg) { - return logFormatRegex.test(customArg); -} -var logFormatRegex; -var init_log_format = __esm2({ - "src/lib/args/log-format.ts"() { - logFormatRegex = /^--(stat|numstat|name-only|name-status)(=|$)/; - } -}); -var DiffSummary; -var init_DiffSummary = __esm2({ - "src/lib/responses/DiffSummary.ts"() { - DiffSummary = class { - constructor() { - this.changed = 0; - this.deletions = 0; - this.insertions = 0; - this.files = []; - } - }; - } -}); -function getDiffParser(format = "") { - const parser3 = diffSummaryParsers[format]; - return (stdOut) => parseStringResponse(new DiffSummary(), parser3, stdOut, false); -} -var statParser; -var numStatParser; -var nameOnlyParser; -var nameStatusParser; -var diffSummaryParsers; -var init_parse_diff_summary = __esm2({ - "src/lib/parsers/parse-diff-summary.ts"() { - init_log_format(); - init_DiffSummary(); - init_utils(); - statParser = [ - new LineParser(/(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/, (result, [file, changes, alterations = ""]) => { - result.files.push({ - file: file.trim(), - changes: asNumber(changes), - insertions: alterations.replace(/[^+]/g, "").length, - deletions: alterations.replace(/[^-]/g, "").length, - binary: false - }); - }), - new LineParser(/(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/, (result, [file, before, after]) => { - result.files.push({ - file: file.trim(), - before: asNumber(before), - after: asNumber(after), - binary: true - }); - }), - new LineParser(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/, (result, [changed, summary]) => { - const inserted = /(\d+) i/.exec(summary); - const deleted = /(\d+) d/.exec(summary); - result.changed = asNumber(changed); - result.insertions = asNumber(inserted == null ? void 0 : inserted[1]); - result.deletions = asNumber(deleted == null ? void 0 : deleted[1]); - }) - ]; - numStatParser = [ - new LineParser(/(\d+)\t(\d+)\t(.+)$/, (result, [changesInsert, changesDelete, file]) => { - const insertions = asNumber(changesInsert); - const deletions = asNumber(changesDelete); - result.changed++; - result.insertions += insertions; - result.deletions += deletions; - result.files.push({ - file, - changes: insertions + deletions, - insertions, - deletions, - binary: false - }); - }), - new LineParser(/-\t-\t(.+)$/, (result, [file]) => { - result.changed++; - result.files.push({ - file, - after: 0, - before: 0, - binary: true - }); - }) - ]; - nameOnlyParser = [ - new LineParser(/(.+)$/, (result, [file]) => { - result.changed++; - result.files.push({ - file, - changes: 0, - insertions: 0, - deletions: 0, - binary: false - }); - }) - ]; - nameStatusParser = [ - new LineParser(/([ACDMRTUXB])([0-9][0-9][0-9])?\t(.[^\t]+)\t?(.*)?$/, (result, [status2, _similarity, from, to]) => { - result.changed++; - result.files.push({ - file: to != null ? to : from, - changes: 0, - status: status2, - insertions: 0, - deletions: 0, - binary: false - }); - }) - ]; - diffSummaryParsers = { - [ - "" - /* NONE */ - ]: statParser, - [ - "--stat" - /* STAT */ - ]: statParser, - [ - "--numstat" - /* NUM_STAT */ - ]: numStatParser, - [ - "--name-status" - /* NAME_STATUS */ - ]: nameStatusParser, - [ - "--name-only" - /* NAME_ONLY */ - ]: nameOnlyParser - }; - } -}); -function lineBuilder(tokens, fields) { - return fields.reduce((line, field, index2) => { - line[field] = tokens[index2] || ""; - return line; - }, /* @__PURE__ */ Object.create({ diff: null })); -} -function createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNames, logFormat = "") { - const parseDiffResult = getDiffParser(logFormat); - return function(stdOut) { - const all = toLinesWithContent(stdOut, true, START_BOUNDARY).map(function(item) { - const lineDetail = item.trim().split(COMMIT_BOUNDARY); - const listLogLine = lineBuilder(lineDetail[0].trim().split(splitter), fields); - if (lineDetail.length > 1 && !!lineDetail[1].trim()) { - listLogLine.diff = parseDiffResult(lineDetail[1]); - } - return listLogLine; - }); - return { - all, - latest: all.length && all[0] || null, - total: all.length - }; - }; -} -var START_BOUNDARY; -var COMMIT_BOUNDARY; -var SPLITTER; -var defaultFieldNames; -var init_parse_list_log_summary = __esm2({ - "src/lib/parsers/parse-list-log-summary.ts"() { - init_utils(); - init_parse_diff_summary(); - init_log_format(); - START_BOUNDARY = "\xF2\xF2\xF2\xF2\xF2\xF2 "; - COMMIT_BOUNDARY = " \xF2\xF2"; - SPLITTER = " \xF2 "; - defaultFieldNames = ["hash", "date", "message", "refs", "author_name", "author_email"]; - } -}); -var diff_exports = {}; -__export2(diff_exports, { - diffSummaryTask: () => diffSummaryTask, - validateLogFormatConfig: () => validateLogFormatConfig -}); -function diffSummaryTask(customArgs) { - let logFormat = logFormatFromCommand(customArgs); - const commands2 = ["diff"]; - if (logFormat === "") { - logFormat = "--stat"; - commands2.push("--stat=4096"); - } - commands2.push(...customArgs); - return validateLogFormatConfig(commands2) || { - commands: commands2, - format: "utf-8", - parser: getDiffParser(logFormat) - }; -} -function validateLogFormatConfig(customArgs) { - const flags = customArgs.filter(isLogFormat); - if (flags.length > 1) { - return configurationErrorTask(`Summary flags are mutually exclusive - pick one of ${flags.join(",")}`); - } - if (flags.length && customArgs.includes("-z")) { - return configurationErrorTask(`Summary flag ${flags} parsing is not compatible with null termination option '-z'`); - } -} -var init_diff = __esm2({ - "src/lib/tasks/diff.ts"() { - init_log_format(); - init_parse_diff_summary(); - init_task(); - } -}); -function prettyFormat(format, splitter) { - const fields = []; - const formatStr = []; - Object.keys(format).forEach((field) => { - fields.push(field); - formatStr.push(String(format[field])); - }); - return [fields, formatStr.join(splitter)]; -} -function userOptions(input) { - return Object.keys(input).reduce((out, key2) => { - if (!(key2 in excludeOptions)) { - out[key2] = input[key2]; - } - return out; - }, {}); -} -function parseLogOptions(opt = {}, customArgs = []) { - const splitter = filterType(opt.splitter, filterString, SPLITTER); - const format = !filterPrimitives(opt.format) && opt.format ? opt.format : { - hash: "%H", - date: opt.strictDate === false ? "%ai" : "%aI", - message: "%s", - refs: "%D", - body: opt.multiLine ? "%B" : "%b", - author_name: opt.mailMap !== false ? "%aN" : "%an", - author_email: opt.mailMap !== false ? "%aE" : "%ae" - }; - const [fields, formatStr] = prettyFormat(format, splitter); - const suffix = []; - const command = [ - `--pretty=format:${START_BOUNDARY}${formatStr}${COMMIT_BOUNDARY}`, - ...customArgs - ]; - const maxCount = opt.n || opt["max-count"] || opt.maxCount; - if (maxCount) { - command.push(`--max-count=${maxCount}`); - } - if (opt.from || opt.to) { - const rangeOperator = opt.symmetric !== false ? "..." : ".."; - suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`); - } - if (filterString(opt.file)) { - suffix.push("--follow", opt.file); - } - appendTaskOptions(userOptions(opt), command); - return { - fields, - splitter, - commands: [...command, ...suffix] - }; -} -function logTask(splitter, fields, customArgs) { - const parser3 = createListLogSummaryParser(splitter, fields, logFormatFromCommand(customArgs)); - return { - commands: ["log", ...customArgs], - format: "utf-8", - parser: parser3 - }; -} -function log_default() { - return { - log(...rest) { - const next = trailingFunctionArgument(arguments); - const options = parseLogOptions(trailingOptionsArgument(arguments), filterType(arguments[0], filterArray)); - const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options); - return this._runTask(task, next); - } - }; - function createLogTask(options) { - return logTask(options.splitter, options.fields, options.commands); - } - function rejectDeprecatedSignatures(from, to) { - return filterString(from) && filterString(to) && configurationErrorTask(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`); - } -} -var excludeOptions; -var init_log = __esm2({ - "src/lib/tasks/log.ts"() { - init_log_format(); - init_parse_list_log_summary(); - init_utils(); - init_task(); - init_diff(); - excludeOptions = /* @__PURE__ */ ((excludeOptions2) => { - excludeOptions2[excludeOptions2["--pretty"] = 0] = "--pretty"; - excludeOptions2[excludeOptions2["max-count"] = 1] = "max-count"; - excludeOptions2[excludeOptions2["maxCount"] = 2] = "maxCount"; - excludeOptions2[excludeOptions2["n"] = 3] = "n"; - excludeOptions2[excludeOptions2["file"] = 4] = "file"; - excludeOptions2[excludeOptions2["format"] = 5] = "format"; - excludeOptions2[excludeOptions2["from"] = 6] = "from"; - excludeOptions2[excludeOptions2["to"] = 7] = "to"; - excludeOptions2[excludeOptions2["splitter"] = 8] = "splitter"; - excludeOptions2[excludeOptions2["symmetric"] = 9] = "symmetric"; - excludeOptions2[excludeOptions2["mailMap"] = 10] = "mailMap"; - excludeOptions2[excludeOptions2["multiLine"] = 11] = "multiLine"; - excludeOptions2[excludeOptions2["strictDate"] = 12] = "strictDate"; - return excludeOptions2; - })(excludeOptions || {}); - } -}); -var MergeSummaryConflict; -var MergeSummaryDetail; -var init_MergeSummary = __esm2({ - "src/lib/responses/MergeSummary.ts"() { - MergeSummaryConflict = class { - constructor(reason, file = null, meta) { - this.reason = reason; - this.file = file; - this.meta = meta; - } - toString() { - return `${this.file}:${this.reason}`; - } - }; - MergeSummaryDetail = class { - constructor() { - this.conflicts = []; - this.merges = []; - this.result = "success"; - } - get failed() { - return this.conflicts.length > 0; - } - get reason() { - return this.result; - } - toString() { - if (this.conflicts.length) { - return `CONFLICTS: ${this.conflicts.join(", ")}`; - } - return "OK"; - } - }; - } -}); -var PullSummary; -var PullFailedSummary; -var init_PullSummary = __esm2({ - "src/lib/responses/PullSummary.ts"() { - PullSummary = class { - constructor() { - this.remoteMessages = { - all: [] - }; - this.created = []; - this.deleted = []; - this.files = []; - this.deletions = {}; - this.insertions = {}; - this.summary = { - changes: 0, - deletions: 0, - insertions: 0 - }; - } - }; - PullFailedSummary = class { - constructor() { - this.remote = ""; - this.hash = { - local: "", - remote: "" - }; - this.branch = { - local: "", - remote: "" - }; - this.message = ""; - } - toString() { - return this.message; - } - }; - } -}); -function objectEnumerationResult(remoteMessages) { - return remoteMessages.objects = remoteMessages.objects || { - compressing: 0, - counting: 0, - enumerating: 0, - packReused: 0, - reused: { count: 0, delta: 0 }, - total: { count: 0, delta: 0 } - }; -} -function asObjectCount(source) { - const count = /^\s*(\d+)/.exec(source); - const delta = /delta (\d+)/i.exec(source); - return { - count: asNumber(count && count[1] || "0"), - delta: asNumber(delta && delta[1] || "0") - }; -} -var remoteMessagesObjectParsers; -var init_parse_remote_objects = __esm2({ - "src/lib/parsers/parse-remote-objects.ts"() { - init_utils(); - remoteMessagesObjectParsers = [ - new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i, (result, [action, count]) => { - const key2 = action.toLowerCase(); - const enumeration = objectEnumerationResult(result.remoteMessages); - Object.assign(enumeration, { [key2]: asNumber(count) }); - }), - new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i, (result, [action, count]) => { - const key2 = action.toLowerCase(); - const enumeration = objectEnumerationResult(result.remoteMessages); - Object.assign(enumeration, { [key2]: asNumber(count) }); - }), - new RemoteLineParser(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i, (result, [total, reused, packReused]) => { - const objects = objectEnumerationResult(result.remoteMessages); - objects.total = asObjectCount(total); - objects.reused = asObjectCount(reused); - objects.packReused = asNumber(packReused); - }) - ]; - } -}); -function parseRemoteMessages(_stdOut, stdErr) { - return parseStringResponse({ remoteMessages: new RemoteMessageSummary() }, parsers2, stdErr); -} -var parsers2; -var RemoteMessageSummary; -var init_parse_remote_messages = __esm2({ - "src/lib/parsers/parse-remote-messages.ts"() { - init_utils(); - init_parse_remote_objects(); - parsers2 = [ - new RemoteLineParser(/^remote:\s*(.+)$/, (result, [text2]) => { - result.remoteMessages.all.push(text2.trim()); - return false; - }), - ...remoteMessagesObjectParsers, - new RemoteLineParser([/create a (?:pull|merge) request/i, /\s(https?:\/\/\S+)$/], (result, [pullRequestUrl]) => { - result.remoteMessages.pullRequestUrl = pullRequestUrl; - }), - new RemoteLineParser([/found (\d+) vulnerabilities.+\(([^)]+)\)/i, /\s(https?:\/\/\S+)$/], (result, [count, summary, url]) => { - result.remoteMessages.vulnerabilities = { - count: asNumber(count), - summary, - url - }; - }) - ]; - RemoteMessageSummary = class { - constructor() { - this.all = []; - } - }; - } -}); -function parsePullErrorResult(stdOut, stdErr) { - const pullError = parseStringResponse(new PullFailedSummary(), errorParsers, [stdOut, stdErr]); - return pullError.message && pullError; -} -var FILE_UPDATE_REGEX; -var SUMMARY_REGEX; -var ACTION_REGEX; -var parsers3; -var errorParsers; -var parsePullDetail; -var parsePullResult; -var init_parse_pull = __esm2({ - "src/lib/parsers/parse-pull.ts"() { - init_PullSummary(); - init_utils(); - init_parse_remote_messages(); - FILE_UPDATE_REGEX = /^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/; - SUMMARY_REGEX = /(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/; - ACTION_REGEX = /^(create|delete) mode \d+ (.+)/; - parsers3 = [ - new LineParser(FILE_UPDATE_REGEX, (result, [file, insertions, deletions]) => { - result.files.push(file); - if (insertions) { - result.insertions[file] = insertions.length; - } - if (deletions) { - result.deletions[file] = deletions.length; - } - }), - new LineParser(SUMMARY_REGEX, (result, [changes, , insertions, , deletions]) => { - if (insertions !== void 0 || deletions !== void 0) { - result.summary.changes = +changes || 0; - result.summary.insertions = +insertions || 0; - result.summary.deletions = +deletions || 0; - return true; - } - return false; - }), - new LineParser(ACTION_REGEX, (result, [action, file]) => { - append(result.files, file); - append(action === "create" ? result.created : result.deleted, file); - }) - ]; - errorParsers = [ - new LineParser(/^from\s(.+)$/i, (result, [remote]) => void (result.remote = remote)), - new LineParser(/^fatal:\s(.+)$/, (result, [message]) => void (result.message = message)), - new LineParser(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/, (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => { - result.branch.local = branchLocal; - result.hash.local = hashLocal; - result.branch.remote = branchRemote; - result.hash.remote = hashRemote; - }) - ]; - parsePullDetail = (stdOut, stdErr) => { - return parseStringResponse(new PullSummary(), parsers3, [stdOut, stdErr]); - }; - parsePullResult = (stdOut, stdErr) => { - return Object.assign(new PullSummary(), parsePullDetail(stdOut, stdErr), parseRemoteMessages(stdOut, stdErr)); - }; - } -}); -var parsers4; -var parseMergeResult; -var parseMergeDetail; -var init_parse_merge = __esm2({ - "src/lib/parsers/parse-merge.ts"() { - init_MergeSummary(); - init_utils(); - init_parse_pull(); - parsers4 = [ - new LineParser(/^Auto-merging\s+(.+)$/, (summary, [autoMerge]) => { - summary.merges.push(autoMerge); - }), - new LineParser(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/, (summary, [reason, file]) => { - summary.conflicts.push(new MergeSummaryConflict(reason, file)); - }), - new LineParser(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/, (summary, [reason, file, deleteRef2]) => { - summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef: deleteRef2 })); - }), - new LineParser(/^CONFLICT\s+\((.+)\):/, (summary, [reason]) => { - summary.conflicts.push(new MergeSummaryConflict(reason, null)); - }), - new LineParser(/^Automatic merge failed;\s+(.+)$/, (summary, [result]) => { - summary.result = result; - }) - ]; - parseMergeResult = (stdOut, stdErr) => { - return Object.assign(parseMergeDetail(stdOut, stdErr), parsePullResult(stdOut, stdErr)); - }; - parseMergeDetail = (stdOut) => { - return parseStringResponse(new MergeSummaryDetail(), parsers4, stdOut); - }; - } -}); -function mergeTask(customArgs) { - if (!customArgs.length) { - return configurationErrorTask("Git.merge requires at least one option"); - } - return { - commands: ["merge", ...customArgs], - format: "utf-8", - parser(stdOut, stdErr) { - const merge2 = parseMergeResult(stdOut, stdErr); - if (merge2.failed) { - throw new GitResponseError(merge2); - } - return merge2; - } - }; -} -var init_merge = __esm2({ - "src/lib/tasks/merge.ts"() { - init_git_response_error(); - init_parse_merge(); - init_task(); - } -}); -function pushResultPushedItem(local, remote, status2) { - const deleted = status2.includes("deleted"); - const tag2 = status2.includes("tag") || /^refs\/tags/.test(local); - const alreadyUpdated = !status2.includes("new"); - return { - deleted, - tag: tag2, - branch: !tag2, - new: !alreadyUpdated, - alreadyUpdated, - local, - remote - }; -} -var parsers5; -var parsePushResult; -var parsePushDetail; -var init_parse_push = __esm2({ - "src/lib/parsers/parse-push.ts"() { - init_utils(); - init_parse_remote_messages(); - parsers5 = [ - new LineParser(/^Pushing to (.+)$/, (result, [repo]) => { - result.repo = repo; - }), - new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => { - result.ref = __spreadProps(__spreadValues({}, result.ref || {}), { - local - }); - }), - new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => { - result.pushed.push(pushResultPushedItem(local, remote, type)); - }), - new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, (result, [local, remote, remoteName]) => { - result.branch = __spreadProps(__spreadValues({}, result.branch || {}), { - local, - remote, - remoteName - }); - }), - new LineParser(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/, (result, [local, remote, from, to]) => { - result.update = { - head: { - local, - remote - }, - hash: { - from, - to - } - }; - }) - ]; - parsePushResult = (stdOut, stdErr) => { - const pushDetail = parsePushDetail(stdOut, stdErr); - const responseDetail = parseRemoteMessages(stdOut, stdErr); - return __spreadValues(__spreadValues({}, pushDetail), responseDetail); - }; - parsePushDetail = (stdOut, stdErr) => { - return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]); - }; - } -}); -var push_exports = {}; -__export2(push_exports, { - pushTagsTask: () => pushTagsTask, - pushTask: () => pushTask -}); -function pushTagsTask(ref = {}, customArgs) { - append(customArgs, "--tags"); - return pushTask(ref, customArgs); -} -function pushTask(ref = {}, customArgs) { - const commands2 = ["push", ...customArgs]; - if (ref.branch) { - commands2.splice(1, 0, ref.branch); - } - if (ref.remote) { - commands2.splice(1, 0, ref.remote); - } - remove2(commands2, "-v"); - append(commands2, "--verbose"); - append(commands2, "--porcelain"); - return { - commands: commands2, - format: "utf-8", - parser: parsePushResult - }; -} -var init_push = __esm2({ - "src/lib/tasks/push.ts"() { - init_parse_push(); - init_utils(); - } -}); -var fromPathRegex; -var FileStatusSummary; -var init_FileStatusSummary = __esm2({ - "src/lib/responses/FileStatusSummary.ts"() { - fromPathRegex = /^(.+) -> (.+)$/; - FileStatusSummary = class { - constructor(path2, index2, working_dir) { - this.path = path2; - this.index = index2; - this.working_dir = working_dir; - if (index2 + working_dir === "R") { - const detail = fromPathRegex.exec(path2) || [null, path2, path2]; - this.from = detail[1] || ""; - this.path = detail[2] || ""; - } - } - }; - } -}); -function renamedFile(line) { - const [to, from] = line.split(NULL); - return { - from: from || to, - to - }; -} -function parser2(indexX, indexY, handler) { - return [`${indexX}${indexY}`, handler]; -} -function conflicts(indexX, ...indexY) { - return indexY.map((y) => parser2(indexX, y, (result, file) => append(result.conflicted, file))); -} -function splitLine(result, lineStr) { - const trimmed2 = lineStr.trim(); - switch (" ") { - case trimmed2.charAt(2): - return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3)); - case trimmed2.charAt(1): - return data(" ", trimmed2.charAt(0), trimmed2.substr(2)); - default: - return; - } - function data(index2, workingDir, path2) { - const raw = `${index2}${workingDir}`; - const handler = parsers6.get(raw); - if (handler) { - handler(result, path2); - } - if (raw !== "##" && raw !== "!!") { - result.files.push(new FileStatusSummary(path2.replace(/\0.+$/, ""), index2, workingDir)); - } - } -} -var StatusSummary; -var parsers6; -var parseStatusSummary; -var init_StatusSummary = __esm2({ - "src/lib/responses/StatusSummary.ts"() { - init_utils(); - init_FileStatusSummary(); - StatusSummary = class { - constructor() { - this.not_added = []; - this.conflicted = []; - this.created = []; - this.deleted = []; - this.ignored = void 0; - this.modified = []; - this.renamed = []; - this.files = []; - this.staged = []; - this.ahead = 0; - this.behind = 0; - this.current = null; - this.tracking = null; - this.detached = false; - this.isClean = () => { - return !this.files.length; - }; - } - }; - parsers6 = new Map([ - parser2(" ", "A", (result, file) => append(result.created, file)), - parser2(" ", "D", (result, file) => append(result.deleted, file)), - parser2(" ", "M", (result, file) => append(result.modified, file)), - parser2("A", " ", (result, file) => append(result.created, file) && append(result.staged, file)), - parser2("A", "M", (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)), - parser2("D", " ", (result, file) => append(result.deleted, file) && append(result.staged, file)), - parser2("M", " ", (result, file) => append(result.modified, file) && append(result.staged, file)), - parser2("M", "M", (result, file) => append(result.modified, file) && append(result.staged, file)), - parser2("R", " ", (result, file) => { - append(result.renamed, renamedFile(file)); - }), - parser2("R", "M", (result, file) => { - const renamed = renamedFile(file); - append(result.renamed, renamed); - append(result.modified, renamed.to); - }), - parser2("!", "!", (_result, _file) => { - append(_result.ignored = _result.ignored || [], _file); - }), - parser2("?", "?", (result, file) => append(result.not_added, file)), - ...conflicts( - "A", - "A", - "U" - /* UNMERGED */ - ), - ...conflicts( - "D", - "D", - "U" - /* UNMERGED */ - ), - ...conflicts( - "U", - "A", - "D", - "U" - /* UNMERGED */ - ), - [ - "##", - (result, line) => { - const aheadReg = /ahead (\d+)/; - const behindReg = /behind (\d+)/; - const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/; - const trackingReg = /\.{3}(\S*)/; - const onEmptyBranchReg = /\son\s([\S]+)$/; - let regexResult; - regexResult = aheadReg.exec(line); - result.ahead = regexResult && +regexResult[1] || 0; - regexResult = behindReg.exec(line); - result.behind = regexResult && +regexResult[1] || 0; - regexResult = currentReg.exec(line); - result.current = regexResult && regexResult[1]; - regexResult = trackingReg.exec(line); - result.tracking = regexResult && regexResult[1]; - regexResult = onEmptyBranchReg.exec(line); - result.current = regexResult && regexResult[1] || result.current; - result.detached = /\(no branch\)/.test(line); - } - ] - ]); - parseStatusSummary = function(text2) { - const lines = text2.split(NULL); - const status2 = new StatusSummary(); - for (let i = 0, l = lines.length; i < l; ) { - let line = lines[i++].trim(); - if (!line) { - continue; - } - if (line.charAt(0) === "R") { - line += NULL + (lines[i++] || ""); - } - splitLine(status2, line); - } - return status2; - }; - } -}); -function statusTask(customArgs) { - const commands2 = [ - "status", - "--porcelain", - "-b", - "-u", - "--null", - ...customArgs.filter((arg) => !ignoredOptions.includes(arg)) - ]; - return { - format: "utf-8", - commands: commands2, - parser(text2) { - return parseStatusSummary(text2); - } - }; -} -var ignoredOptions; -var init_status = __esm2({ - "src/lib/tasks/status.ts"() { - init_StatusSummary(); - ignoredOptions = ["--null", "-z"]; - } -}); -function versionResponse(major = 0, minor = 0, patch = 0, agent = "", installed = true) { - return Object.defineProperty({ - major, - minor, - patch, - agent, - installed - }, "toString", { - value() { - return `${this.major}.${this.minor}.${this.patch}`; - }, - configurable: false, - enumerable: false - }); -} -function notInstalledResponse() { - return versionResponse(0, 0, 0, "", false); -} -function version_default() { - return { - version() { - return this._runTask({ - commands: ["--version"], - format: "utf-8", - parser: versionParser, - onError(result, error, done, fail) { - if (result.exitCode === -2) { - return done(Buffer.from(NOT_INSTALLED)); - } - fail(error); - } - }); - } - }; -} -function versionParser(stdOut) { - if (stdOut === NOT_INSTALLED) { - return notInstalledResponse(); - } - return parseStringResponse(versionResponse(0, 0, 0, stdOut), parsers7, stdOut); -} -var NOT_INSTALLED; -var parsers7; -var init_version = __esm2({ - "src/lib/tasks/version.ts"() { - init_utils(); - NOT_INSTALLED = "installed=false"; - parsers7 = [ - new LineParser(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/, (result, [major, minor, patch, agent = ""]) => { - Object.assign(result, versionResponse(asNumber(major), asNumber(minor), asNumber(patch), agent)); - }), - new LineParser(/version (\d+)\.(\d+)\.(\D+)(.+)?$/, (result, [major, minor, patch, agent = ""]) => { - Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent)); - }) - ]; - } -}); -var simple_git_api_exports = {}; -__export2(simple_git_api_exports, { - SimpleGitApi: () => SimpleGitApi -}); -var SimpleGitApi; -var init_simple_git_api = __esm2({ - "src/lib/simple-git-api.ts"() { - init_task_callback(); - init_change_working_directory(); - init_checkout(); - init_commit(); - init_config(); - init_grep(); - init_hash_object(); - init_init(); - init_log(); - init_merge(); - init_push(); - init_status(); - init_task(); - init_version(); - init_utils(); - SimpleGitApi = class { - constructor(_executor) { - this._executor = _executor; - } - _runTask(task, then) { - const chain = this._executor.chain(); - const promise2 = chain.push(task); - if (then) { - taskCallback(task, promise2, then); - } - return Object.create(this, { - then: { value: promise2.then.bind(promise2) }, - catch: { value: promise2.catch.bind(promise2) }, - _executor: { value: chain } - }); - } - add(files) { - return this._runTask(straightThroughStringTask(["add", ...asArray(files)]), trailingFunctionArgument(arguments)); - } - cwd(directory) { - const next = trailingFunctionArgument(arguments); - if (typeof directory === "string") { - return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next); - } - if (typeof (directory == null ? void 0 : directory.path) === "string") { - return this._runTask(changeWorkingDirectoryTask(directory.path, directory.root && this._executor || void 0), next); - } - return this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"), next); - } - hashObject(path2, write) { - return this._runTask(hashObjectTask(path2, write === true), trailingFunctionArgument(arguments)); - } - init(bare) { - return this._runTask(initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - } - merge() { - return this._runTask(mergeTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - } - mergeFromTo(remote, branch2) { - if (!(filterString(remote) && filterString(branch2))) { - return this._runTask(configurationErrorTask(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`)); - } - return this._runTask(mergeTask([remote, branch2, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments, false)); - } - outputHandler(handler) { - this._executor.outputHandler = handler; - return this; - } - push() { - const task = pushTask({ - remote: filterType(arguments[0], filterString), - branch: filterType(arguments[1], filterString) - }, getTrailingOptions(arguments)); - return this._runTask(task, trailingFunctionArgument(arguments)); - } - stash() { - return this._runTask(straightThroughStringTask(["stash", ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments)); - } - status() { - return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); - } - }; - Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), grep_default(), log_default(), version_default()); - } -}); -var scheduler_exports = {}; -__export2(scheduler_exports, { - Scheduler: () => Scheduler -}); -var createScheduledTask; -var Scheduler; -var init_scheduler = __esm2({ - "src/lib/runners/scheduler.ts"() { - init_utils(); - init_git_logger(); - createScheduledTask = (() => { - let id = 0; - return () => { - id++; - const { promise: promise2, done } = (0, import_promise_deferred.createDeferred)(); - return { - promise: promise2, - done, - id - }; - }; - })(); - Scheduler = class { - constructor(concurrency = 2) { - this.concurrency = concurrency; - this.logger = createLogger("", "scheduler"); - this.pending = []; - this.running = []; - this.logger(`Constructed, concurrency=%s`, concurrency); - } - schedule() { - if (!this.pending.length || this.running.length >= this.concurrency) { - this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`, this.pending.length, this.running.length, this.concurrency); - return; - } - const task = append(this.running, this.pending.shift()); - this.logger(`Attempting id=%s`, task.id); - task.done(() => { - this.logger(`Completing id=`, task.id); - remove2(this.running, task); - this.schedule(); - }); - } - next() { - const { promise: promise2, id } = append(this.pending, createScheduledTask()); - this.logger(`Scheduling id=%s`, id); - this.schedule(); - return promise2; - } - }; - } -}); -var apply_patch_exports = {}; -__export2(apply_patch_exports, { - applyPatchTask: () => applyPatchTask -}); -function applyPatchTask(patches, customArgs) { - return straightThroughStringTask(["apply", ...customArgs, ...patches]); -} -var init_apply_patch = __esm2({ - "src/lib/tasks/apply-patch.ts"() { - init_task(); - } -}); -function branchDeletionSuccess(branch2, hash2) { - return { - branch: branch2, - hash: hash2, - success: true - }; -} -function branchDeletionFailure(branch2) { - return { - branch: branch2, - hash: null, - success: false - }; -} -var BranchDeletionBatch; -var init_BranchDeleteSummary = __esm2({ - "src/lib/responses/BranchDeleteSummary.ts"() { - BranchDeletionBatch = class { - constructor() { - this.all = []; - this.branches = {}; - this.errors = []; - } - get success() { - return !this.errors.length; - } - }; - } -}); -function hasBranchDeletionError(data, processExitCode) { - return processExitCode === 1 && deleteErrorRegex.test(data); -} -var deleteSuccessRegex; -var deleteErrorRegex; -var parsers8; -var parseBranchDeletions; -var init_parse_branch_delete = __esm2({ - "src/lib/parsers/parse-branch-delete.ts"() { - init_BranchDeleteSummary(); - init_utils(); - deleteSuccessRegex = /(\S+)\s+\(\S+\s([^)]+)\)/; - deleteErrorRegex = /^error[^']+'([^']+)'/m; - parsers8 = [ - new LineParser(deleteSuccessRegex, (result, [branch2, hash2]) => { - const deletion = branchDeletionSuccess(branch2, hash2); - result.all.push(deletion); - result.branches[branch2] = deletion; - }), - new LineParser(deleteErrorRegex, (result, [branch2]) => { - const deletion = branchDeletionFailure(branch2); - result.errors.push(deletion); - result.all.push(deletion); - result.branches[branch2] = deletion; - }) - ]; - parseBranchDeletions = (stdOut, stdErr) => { - return parseStringResponse(new BranchDeletionBatch(), parsers8, [stdOut, stdErr]); - }; - } -}); -var BranchSummaryResult; -var init_BranchSummary = __esm2({ - "src/lib/responses/BranchSummary.ts"() { - BranchSummaryResult = class { - constructor() { - this.all = []; - this.branches = {}; - this.current = ""; - this.detached = false; - } - push(status2, detached, name, commit2, label) { - if (status2 === "*") { - this.detached = detached; - this.current = name; - } - this.all.push(name); - this.branches[name] = { - current: status2 === "*", - linkedWorkTree: status2 === "+", - name, - commit: commit2, - label - }; - } - }; - } -}); -function branchStatus(input) { - return input ? input.charAt(0) : ""; -} -function parseBranchSummary(stdOut) { - return parseStringResponse(new BranchSummaryResult(), parsers9, stdOut); -} -var parsers9; -var init_parse_branch = __esm2({ - "src/lib/parsers/parse-branch.ts"() { - init_BranchSummary(); - init_utils(); - parsers9 = [ - new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, (result, [current, name, commit2, label]) => { - result.push(branchStatus(current), true, name, commit2, label); - }), - new LineParser(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s, (result, [current, name, commit2, label]) => { - result.push(branchStatus(current), false, name, commit2, label); - }) - ]; - } -}); -var branch_exports = {}; -__export2(branch_exports, { - branchLocalTask: () => branchLocalTask, - branchTask: () => branchTask, - containsDeleteBranchCommand: () => containsDeleteBranchCommand, - deleteBranchTask: () => deleteBranchTask, - deleteBranchesTask: () => deleteBranchesTask -}); -function containsDeleteBranchCommand(commands2) { - const deleteCommands = ["-d", "-D", "--delete"]; - return commands2.some((command) => deleteCommands.includes(command)); -} -function branchTask(customArgs) { - const isDelete = containsDeleteBranchCommand(customArgs); - const commands2 = ["branch", ...customArgs]; - if (commands2.length === 1) { - commands2.push("-a"); - } - if (!commands2.includes("-v")) { - commands2.splice(1, 0, "-v"); - } - return { - format: "utf-8", - commands: commands2, - parser(stdOut, stdErr) { - if (isDelete) { - return parseBranchDeletions(stdOut, stdErr).all[0]; - } - return parseBranchSummary(stdOut); - } - }; -} -function branchLocalTask() { - const parser3 = parseBranchSummary; - return { - format: "utf-8", - commands: ["branch", "-v"], - parser: parser3 - }; -} -function deleteBranchesTask(branches, forceDelete = false) { - return { - format: "utf-8", - commands: ["branch", "-v", forceDelete ? "-D" : "-d", ...branches], - parser(stdOut, stdErr) { - return parseBranchDeletions(stdOut, stdErr); - }, - onError({ exitCode, stdOut }, error, done, fail) { - if (!hasBranchDeletionError(String(error), exitCode)) { - return fail(error); - } - done(stdOut); - } - }; -} -function deleteBranchTask(branch2, forceDelete = false) { - const task = { - format: "utf-8", - commands: ["branch", "-v", forceDelete ? "-D" : "-d", branch2], - parser(stdOut, stdErr) { - return parseBranchDeletions(stdOut, stdErr).branches[branch2]; - }, - onError({ exitCode, stdErr, stdOut }, error, _, fail) { - if (!hasBranchDeletionError(String(error), exitCode)) { - return fail(error); - } - throw new GitResponseError(task.parser(bufferToString(stdOut), bufferToString(stdErr)), String(error)); - } - }; - return task; -} -var init_branch = __esm2({ - "src/lib/tasks/branch.ts"() { - init_git_response_error(); - init_parse_branch_delete(); - init_parse_branch(); - init_utils(); - } -}); -var parseCheckIgnore; -var init_CheckIgnore = __esm2({ - "src/lib/responses/CheckIgnore.ts"() { - parseCheckIgnore = (text2) => { - return text2.split(/\n/g).map((line) => line.trim()).filter((file) => !!file); - }; - } -}); -var check_ignore_exports = {}; -__export2(check_ignore_exports, { - checkIgnoreTask: () => checkIgnoreTask -}); -function checkIgnoreTask(paths) { - return { - commands: ["check-ignore", ...paths], - format: "utf-8", - parser: parseCheckIgnore - }; -} -var init_check_ignore = __esm2({ - "src/lib/tasks/check-ignore.ts"() { - init_CheckIgnore(); - } -}); -var clone_exports = {}; -__export2(clone_exports, { - cloneMirrorTask: () => cloneMirrorTask, - cloneTask: () => cloneTask -}); -function disallowedCommand(command) { - return /^--upload-pack(=|$)/.test(command); -} -function cloneTask(repo, directory, customArgs) { - const commands2 = ["clone", ...customArgs]; - filterString(repo) && commands2.push(repo); - filterString(directory) && commands2.push(directory); - const banned = commands2.find(disallowedCommand); - if (banned) { - return configurationErrorTask(`git.fetch: potential exploit argument blocked.`); - } - return straightThroughStringTask(commands2); -} -function cloneMirrorTask(repo, directory, customArgs) { - append(customArgs, "--mirror"); - return cloneTask(repo, directory, customArgs); -} -var init_clone = __esm2({ - "src/lib/tasks/clone.ts"() { - init_task(); - init_utils(); - } -}); -function parseFetchResult(stdOut, stdErr) { - const result = { - raw: stdOut, - remote: null, - branches: [], - tags: [], - updated: [], - deleted: [] - }; - return parseStringResponse(result, parsers10, [stdOut, stdErr]); -} -var parsers10; -var init_parse_fetch = __esm2({ - "src/lib/parsers/parse-fetch.ts"() { - init_utils(); - parsers10 = [ - new LineParser(/From (.+)$/, (result, [remote]) => { - result.remote = remote; - }), - new LineParser(/\* \[new branch]\s+(\S+)\s*-> (.+)$/, (result, [name, tracking]) => { - result.branches.push({ - name, - tracking - }); - }), - new LineParser(/\* \[new tag]\s+(\S+)\s*-> (.+)$/, (result, [name, tracking]) => { - result.tags.push({ - name, - tracking - }); - }), - new LineParser(/- \[deleted]\s+\S+\s*-> (.+)$/, (result, [tracking]) => { - result.deleted.push({ - tracking - }); - }), - new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, (result, [from, to, name, tracking]) => { - result.updated.push({ - name, - tracking, - to, - from - }); - }) - ]; - } -}); -var fetch_exports = {}; -__export2(fetch_exports, { - fetchTask: () => fetchTask -}); -function disallowedCommand2(command) { - return /^--upload-pack(=|$)/.test(command); -} -function fetchTask(remote, branch2, customArgs) { - const commands2 = ["fetch", ...customArgs]; - if (remote && branch2) { - commands2.push(remote, branch2); - } - const banned = commands2.find(disallowedCommand2); - if (banned) { - return configurationErrorTask(`git.fetch: potential exploit argument blocked.`); - } - return { - commands: commands2, - format: "utf-8", - parser: parseFetchResult - }; -} -var init_fetch = __esm2({ - "src/lib/tasks/fetch.ts"() { - init_parse_fetch(); - init_task(); - } -}); -function parseMoveResult(stdOut) { - return parseStringResponse({ moves: [] }, parsers11, stdOut); -} -var parsers11; -var init_parse_move = __esm2({ - "src/lib/parsers/parse-move.ts"() { - init_utils(); - parsers11 = [ - new LineParser(/^Renaming (.+) to (.+)$/, (result, [from, to]) => { - result.moves.push({ from, to }); - }) - ]; - } -}); -var move_exports = {}; -__export2(move_exports, { - moveTask: () => moveTask -}); -function moveTask(from, to) { - return { - commands: ["mv", "-v", ...asArray(from), to], - format: "utf-8", - parser: parseMoveResult - }; -} -var init_move = __esm2({ - "src/lib/tasks/move.ts"() { - init_parse_move(); - init_utils(); - } -}); -var pull_exports = {}; -__export2(pull_exports, { - pullTask: () => pullTask -}); -function pullTask(remote, branch2, customArgs) { - const commands2 = ["pull", ...customArgs]; - if (remote && branch2) { - commands2.splice(1, 0, remote, branch2); - } - return { - commands: commands2, - format: "utf-8", - parser(stdOut, stdErr) { - return parsePullResult(stdOut, stdErr); - }, - onError(result, _error, _done, fail) { - const pullError = parsePullErrorResult(bufferToString(result.stdOut), bufferToString(result.stdErr)); - if (pullError) { - return fail(new GitResponseError(pullError)); - } - fail(_error); - } - }; -} -var init_pull = __esm2({ - "src/lib/tasks/pull.ts"() { - init_git_response_error(); - init_parse_pull(); - init_utils(); - } -}); -function parseGetRemotes(text2) { - const remotes = {}; - forEach(text2, ([name]) => remotes[name] = { name }); - return Object.values(remotes); -} -function parseGetRemotesVerbose(text2) { - const remotes = {}; - forEach(text2, ([name, url, purpose]) => { - if (!remotes.hasOwnProperty(name)) { - remotes[name] = { - name, - refs: { fetch: "", push: "" } - }; - } - if (purpose && url) { - remotes[name].refs[purpose.replace(/[^a-z]/g, "")] = url; - } - }); - return Object.values(remotes); -} -function forEach(text2, handler) { - forEachLineWithContent(text2, (line) => handler(line.split(/\s+/))); -} -var init_GetRemoteSummary = __esm2({ - "src/lib/responses/GetRemoteSummary.ts"() { - init_utils(); - } -}); -var remote_exports = {}; -__export2(remote_exports, { - addRemoteTask: () => addRemoteTask, - getRemotesTask: () => getRemotesTask, - listRemotesTask: () => listRemotesTask, - remoteTask: () => remoteTask, - removeRemoteTask: () => removeRemoteTask -}); -function addRemoteTask(remoteName, remoteRepo, customArgs = []) { - return straightThroughStringTask(["remote", "add", ...customArgs, remoteName, remoteRepo]); -} -function getRemotesTask(verbose) { - const commands2 = ["remote"]; - if (verbose) { - commands2.push("-v"); - } - return { - commands: commands2, - format: "utf-8", - parser: verbose ? parseGetRemotesVerbose : parseGetRemotes - }; -} -function listRemotesTask(customArgs = []) { - const commands2 = [...customArgs]; - if (commands2[0] !== "ls-remote") { - commands2.unshift("ls-remote"); - } - return straightThroughStringTask(commands2); -} -function remoteTask(customArgs = []) { - const commands2 = [...customArgs]; - if (commands2[0] !== "remote") { - commands2.unshift("remote"); - } - return straightThroughStringTask(commands2); -} -function removeRemoteTask(remoteName) { - return straightThroughStringTask(["remote", "remove", remoteName]); -} -var init_remote = __esm2({ - "src/lib/tasks/remote.ts"() { - init_GetRemoteSummary(); - init_task(); - } -}); -var stash_list_exports = {}; -__export2(stash_list_exports, { - stashListTask: () => stashListTask -}); -function stashListTask(opt = {}, customArgs) { - const options = parseLogOptions(opt); - const commands2 = ["stash", "list", ...options.commands, ...customArgs]; - const parser3 = createListLogSummaryParser(options.splitter, options.fields, logFormatFromCommand(commands2)); - return validateLogFormatConfig(commands2) || { - commands: commands2, - format: "utf-8", - parser: parser3 - }; -} -var init_stash_list = __esm2({ - "src/lib/tasks/stash-list.ts"() { - init_log_format(); - init_parse_list_log_summary(); - init_diff(); - init_log(); - } -}); -var sub_module_exports = {}; -__export2(sub_module_exports, { - addSubModuleTask: () => addSubModuleTask, - initSubModuleTask: () => initSubModuleTask, - subModuleTask: () => subModuleTask, - updateSubModuleTask: () => updateSubModuleTask -}); -function addSubModuleTask(repo, path2) { - return subModuleTask(["add", repo, path2]); -} -function initSubModuleTask(customArgs) { - return subModuleTask(["init", ...customArgs]); -} -function subModuleTask(customArgs) { - const commands2 = [...customArgs]; - if (commands2[0] !== "submodule") { - commands2.unshift("submodule"); - } - return straightThroughStringTask(commands2); -} -function updateSubModuleTask(customArgs) { - return subModuleTask(["update", ...customArgs]); -} -var init_sub_module = __esm2({ - "src/lib/tasks/sub-module.ts"() { - init_task(); - } -}); -function singleSorted(a, b) { - const aIsNum = isNaN(a); - const bIsNum = isNaN(b); - if (aIsNum !== bIsNum) { - return aIsNum ? 1 : -1; - } - return aIsNum ? sorted(a, b) : 0; -} -function sorted(a, b) { - return a === b ? 0 : a > b ? 1 : -1; -} -function trimmed(input) { - return input.trim(); -} -function toNumber(input) { - if (typeof input === "string") { - return parseInt(input.replace(/^\D+/g, ""), 10) || 0; - } - return 0; -} -var TagList; -var parseTagList; -var init_TagList = __esm2({ - "src/lib/responses/TagList.ts"() { - TagList = class { - constructor(all, latest) { - this.all = all; - this.latest = latest; - } - }; - parseTagList = function(data, customSort = false) { - const tags = data.split("\n").map(trimmed).filter(Boolean); - if (!customSort) { - tags.sort(function(tagA, tagB) { - const partsA = tagA.split("."); - const partsB = tagB.split("."); - if (partsA.length === 1 || partsB.length === 1) { - return singleSorted(toNumber(partsA[0]), toNumber(partsB[0])); - } - for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) { - const diff2 = sorted(toNumber(partsA[i]), toNumber(partsB[i])); - if (diff2) { - return diff2; - } - } - return 0; - }); - } - const latest = customSort ? tags[0] : [...tags].reverse().find((tag2) => tag2.indexOf(".") >= 0); - return new TagList(tags, latest); - }; - } -}); -var tag_exports = {}; -__export2(tag_exports, { - addAnnotatedTagTask: () => addAnnotatedTagTask, - addTagTask: () => addTagTask, - tagListTask: () => tagListTask -}); -function tagListTask(customArgs = []) { - const hasCustomSort = customArgs.some((option) => /^--sort=/.test(option)); - return { - format: "utf-8", - commands: ["tag", "-l", ...customArgs], - parser(text2) { - return parseTagList(text2, hasCustomSort); - } - }; -} -function addTagTask(name) { - return { - format: "utf-8", - commands: ["tag", name], - parser() { - return { name }; - } - }; -} -function addAnnotatedTagTask(name, tagMessage) { - return { - format: "utf-8", - commands: ["tag", "-a", "-m", tagMessage, name], - parser() { - return { name }; - } - }; -} -var init_tag = __esm2({ - "src/lib/tasks/tag.ts"() { - init_TagList(); - } -}); -var require_git = __commonJS2({ - "src/git.js"(exports2, module2) { - var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS2(git_executor_exports)); - var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS2(simple_git_api_exports)); - var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS2(scheduler_exports)); - var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS2(task_exports)); - var { - asArray: asArray2, - filterArray: filterArray2, - filterPrimitives: filterPrimitives2, - filterString: filterString2, - filterStringOrStringArray: filterStringOrStringArray2, - filterType: filterType2, - getTrailingOptions: getTrailingOptions2, - trailingFunctionArgument: trailingFunctionArgument2, - trailingOptionsArgument: trailingOptionsArgument2 - } = (init_utils(), __toCommonJS2(utils_exports)); - var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS2(apply_patch_exports)); - var { - branchTask: branchTask2, - branchLocalTask: branchLocalTask2, - deleteBranchesTask: deleteBranchesTask2, - deleteBranchTask: deleteBranchTask2 - } = (init_branch(), __toCommonJS2(branch_exports)); - var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS2(check_ignore_exports)); - var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS2(check_is_repo_exports)); - var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS2(clone_exports)); - var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS2(clean_exports)); - var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS2(diff_exports)); - var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS2(fetch_exports)); - var { moveTask: moveTask2 } = (init_move(), __toCommonJS2(move_exports)); - var { pullTask: pullTask2 } = (init_pull(), __toCommonJS2(pull_exports)); - var { pushTagsTask: pushTagsTask2 } = (init_push(), __toCommonJS2(push_exports)); - var { - addRemoteTask: addRemoteTask2, - getRemotesTask: getRemotesTask2, - listRemotesTask: listRemotesTask2, - remoteTask: remoteTask2, - removeRemoteTask: removeRemoteTask2 - } = (init_remote(), __toCommonJS2(remote_exports)); - var { getResetMode: getResetMode2, resetTask: resetTask2 } = (init_reset(), __toCommonJS2(reset_exports)); - var { stashListTask: stashListTask2 } = (init_stash_list(), __toCommonJS2(stash_list_exports)); - var { - addSubModuleTask: addSubModuleTask2, - initSubModuleTask: initSubModuleTask2, - subModuleTask: subModuleTask2, - updateSubModuleTask: updateSubModuleTask2 - } = (init_sub_module(), __toCommonJS2(sub_module_exports)); - var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS2(tag_exports)); - var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS2(task_exports)); - function Git2(options, plugins) { - this._executor = new GitExecutor2(options.binary, options.baseDir, new Scheduler2(options.maxConcurrentProcesses), plugins); - this._trimmed = options.trimmed; - } - (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2; - Git2.prototype.customBinary = function(command) { - this._executor.binary = command; - return this; - }; - Git2.prototype.env = function(name, value) { - if (arguments.length === 1 && typeof name === "object") { - this._executor.env = name; - } else { - (this._executor.env = this._executor.env || {})[name] = value; - } - return this; - }; - Git2.prototype.stashList = function(options) { - return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments)); - }; - function createCloneTask(api, task, repoPath, localPath) { - if (typeof repoPath !== "string") { - return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`); - } - return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments)); - } - Git2.prototype.clone = function() { - return this._runTask(createCloneTask("clone", cloneTask2, ...arguments), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.mirror = function() { - return this._runTask(createCloneTask("mirror", cloneMirrorTask2, ...arguments), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.mv = function(from, to) { - return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.checkoutLatestTag = function(then) { - var git = this; - return this.pull(function() { - git.tags(function(err, tags) { - git.checkout(tags.latest, then); - }); - }); - }; - Git2.prototype.pull = function(remote, branch2, options, then) { - return this._runTask(pullTask2(filterType2(remote, filterString2), filterType2(branch2, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.fetch = function(remote, branch2) { - return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch2, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.silent = function(silence) { - console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"); - return this; - }; - Git2.prototype.tags = function(options, then) { - return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.rebase = function() { - return this._runTask(straightThroughStringTask2(["rebase", ...getTrailingOptions2(arguments)]), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.reset = function(mode) { - return this._runTask(resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.revert = function(commit2) { - const next = trailingFunctionArgument2(arguments); - if (typeof commit2 !== "string") { - return this._runTask(configurationErrorTask2("Commit must be a string"), next); - } - return this._runTask(straightThroughStringTask2(["revert", ...getTrailingOptions2(arguments, 0, true), commit2]), next); - }; - Git2.prototype.addTag = function(name) { - const task = typeof name === "string" ? addTagTask2(name) : configurationErrorTask2("Git.addTag requires a tag name"); - return this._runTask(task, trailingFunctionArgument2(arguments)); - }; - Git2.prototype.addAnnotatedTag = function(tagName, tagMessage) { - return this._runTask(addAnnotatedTagTask2(tagName, tagMessage), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.deleteLocalBranch = function(branchName, forceDelete, then) { - return this._runTask(deleteBranchTask2(branchName, typeof forceDelete === "boolean" ? forceDelete : false), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.deleteLocalBranches = function(branchNames, forceDelete, then) { - return this._runTask(deleteBranchesTask2(branchNames, typeof forceDelete === "boolean" ? forceDelete : false), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.branch = function(options, then) { - return this._runTask(branchTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.branchLocal = function(then) { - return this._runTask(branchLocalTask2(), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.raw = function(commands2) { - const createRestCommands = !Array.isArray(commands2); - const command = [].slice.call(createRestCommands ? arguments : commands2, 0); - for (let i = 0; i < command.length && createRestCommands; i++) { - if (!filterPrimitives2(command[i])) { - command.splice(i, command.length - i); - break; - } - } - command.push(...getTrailingOptions2(arguments, 0, true)); - var next = trailingFunctionArgument2(arguments); - if (!command.length) { - return this._runTask(configurationErrorTask2("Raw: must supply one or more command to execute"), next); - } - return this._runTask(straightThroughStringTask2(command, this._trimmed), next); - }; - Git2.prototype.submoduleAdd = function(repo, path2, then) { - return this._runTask(addSubModuleTask2(repo, path2), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.submoduleUpdate = function(args, then) { - return this._runTask(updateSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.submoduleInit = function(args, then) { - return this._runTask(initSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.subModule = function(options, then) { - return this._runTask(subModuleTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.listRemote = function() { - return this._runTask(listRemotesTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.addRemote = function(remoteName, remoteRepo, then) { - return this._runTask(addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.removeRemote = function(remoteName, then) { - return this._runTask(removeRemoteTask2(remoteName), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.getRemotes = function(verbose, then) { - return this._runTask(getRemotesTask2(verbose === true), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.remote = function(options, then) { - return this._runTask(remoteTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.tag = function(options, then) { - const command = getTrailingOptions2(arguments); - if (command[0] !== "tag") { - command.unshift("tag"); - } - return this._runTask(straightThroughStringTask2(command), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.updateServerInfo = function(then) { - return this._runTask(straightThroughStringTask2(["update-server-info"]), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.pushTags = function(remote, then) { - const task = pushTagsTask2({ remote: filterType2(remote, filterString2) }, getTrailingOptions2(arguments)); - return this._runTask(task, trailingFunctionArgument2(arguments)); - }; - Git2.prototype.rm = function(files) { - return this._runTask(straightThroughStringTask2(["rm", "-f", ...asArray2(files)]), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.rmKeepLocal = function(files) { - return this._runTask(straightThroughStringTask2(["rm", "--cached", ...asArray2(files)]), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.catFile = function(options, then) { - return this._catFile("utf-8", arguments); - }; - Git2.prototype.binaryCatFile = function() { - return this._catFile("buffer", arguments); - }; - Git2.prototype._catFile = function(format, args) { - var handler = trailingFunctionArgument2(args); - var command = ["cat-file"]; - var options = args[0]; - if (typeof options === "string") { - return this._runTask(configurationErrorTask2("Git.catFile: options must be supplied as an array of strings"), handler); - } - if (Array.isArray(options)) { - command.push.apply(command, options); - } - const task = format === "buffer" ? straightThroughBufferTask2(command) : straightThroughStringTask2(command); - return this._runTask(task, handler); - }; - Git2.prototype.diff = function(options, then) { - const task = filterString2(options) ? configurationErrorTask2("git.diff: supplying options as a single string is no longer supported, switch to an array of strings") : straightThroughStringTask2(["diff", ...getTrailingOptions2(arguments)]); - return this._runTask(task, trailingFunctionArgument2(arguments)); - }; - Git2.prototype.diffSummary = function() { - return this._runTask(diffSummaryTask2(getTrailingOptions2(arguments, 1)), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.applyPatch = function(patches) { - const task = !filterStringOrStringArray2(patches) ? configurationErrorTask2(`git.applyPatch requires one or more string patches as the first argument`) : applyPatchTask2(asArray2(patches), getTrailingOptions2([].slice.call(arguments, 1))); - return this._runTask(task, trailingFunctionArgument2(arguments)); - }; - Git2.prototype.revparse = function() { - const commands2 = ["rev-parse", ...getTrailingOptions2(arguments, true)]; - return this._runTask(straightThroughStringTask2(commands2, true), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.show = function(options, then) { - return this._runTask(straightThroughStringTask2(["show", ...getTrailingOptions2(arguments, 1)]), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.clean = function(mode, options, then) { - const usingCleanOptionsArray = isCleanOptionsArray2(mode); - const cleanMode = usingCleanOptionsArray && mode.join("") || filterType2(mode, filterString2) || ""; - const customArgs = getTrailingOptions2([].slice.call(arguments, usingCleanOptionsArray ? 1 : 0)); - return this._runTask(cleanWithOptionsTask2(cleanMode, customArgs), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.exec = function(then) { - const task = { - commands: [], - format: "utf-8", - parser() { - if (typeof then === "function") { - then(); - } - } - }; - return this._runTask(task); - }; - Git2.prototype.clearQueue = function() { - return this; - }; - Git2.prototype.checkIgnore = function(pathnames, then) { - return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments)); - }; - Git2.prototype.checkIsRepo = function(checkType, then) { - return this._runTask(checkIsRepoTask2(filterType2(checkType, filterString2)), trailingFunctionArgument2(arguments)); - }; - module2.exports = Git2; - } -}); -init_git_error(); -var GitConstructError = class extends GitError { - constructor(config, message) { - super(void 0, message); - this.config = config; - } -}; -init_git_error(); -init_git_error(); -var GitPluginError = class extends GitError { - constructor(task, plugin, message) { - super(task, message); - this.task = task; - this.plugin = plugin; - Object.setPrototypeOf(this, new.target.prototype); - } -}; -init_git_response_error(); -init_task_configuration_error(); -init_check_is_repo(); -init_clean(); -init_config(); -init_grep(); -init_reset(); -function abortPlugin(signal) { - if (!signal) { - return; - } - const onSpawnAfter = { - type: "spawn.after", - action(_data, context) { - function kill() { - context.kill(new GitPluginError(void 0, "abort", "Abort signal received")); - } - signal.addEventListener("abort", kill); - context.spawned.on("close", () => signal.removeEventListener("abort", kill)); - } - }; - const onSpawnBefore = { - type: "spawn.before", - action(_data, context) { - if (signal.aborted) { - context.kill(new GitPluginError(void 0, "abort", "Abort already signaled")); - } - } - }; - return [onSpawnBefore, onSpawnAfter]; -} -function isConfigSwitch(arg) { - return typeof arg === "string" && arg.trim().toLowerCase() === "-c"; -} -function preventProtocolOverride(arg, next) { - if (!isConfigSwitch(arg)) { - return; - } - if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) { - return; - } - throw new GitPluginError(void 0, "unsafe", "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol"); -} -function preventUploadPack(arg, method2) { - if (/^\s*--(upload|receive)-pack/.test(arg)) { - throw new GitPluginError(void 0, "unsafe", `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`); - } - if (method2 === "clone" && /^\s*-u\b/.test(arg)) { - throw new GitPluginError(void 0, "unsafe", `Use of clone with option -u is not permitted without enabling allowUnsafePack`); - } - if (method2 === "push" && /^\s*--exec\b/.test(arg)) { - throw new GitPluginError(void 0, "unsafe", `Use of push with option --exec is not permitted without enabling allowUnsafePack`); - } -} -function blockUnsafeOperationsPlugin({ - allowUnsafeProtocolOverride = false, - allowUnsafePack = false -} = {}) { - return { - type: "spawn.args", - action(args, context) { - args.forEach((current, index2) => { - const next = index2 < args.length ? args[index2 + 1] : ""; - allowUnsafeProtocolOverride || preventProtocolOverride(current, next); - allowUnsafePack || preventUploadPack(current, context.method); - }); - return args; - } - }; -} -init_utils(); -function commandConfigPrefixingPlugin(configuration) { - const prefix = prefixedArray(configuration, "-c"); - return { - type: "spawn.args", - action(data) { - return [...prefix, ...data]; - } - }; -} -init_utils(); -var never = (0, import_promise_deferred2.deferred)().promise; -function completionDetectionPlugin({ - onClose = true, - onExit = 50 -} = {}) { - function createEvents() { - let exitCode = -1; - const events = { - close: (0, import_promise_deferred2.deferred)(), - closeTimeout: (0, import_promise_deferred2.deferred)(), - exit: (0, import_promise_deferred2.deferred)(), - exitTimeout: (0, import_promise_deferred2.deferred)() - }; - const result = Promise.race([ - onClose === false ? never : events.closeTimeout.promise, - onExit === false ? never : events.exitTimeout.promise - ]); - configureTimeout(onClose, events.close, events.closeTimeout); - configureTimeout(onExit, events.exit, events.exitTimeout); - return { - close(code) { - exitCode = code; - events.close.done(); - }, - exit(code) { - exitCode = code; - events.exit.done(); - }, - get exitCode() { - return exitCode; - }, - result - }; - } - function configureTimeout(flag, event, timeout) { - if (flag === false) { - return; - } - (flag === true ? event.promise : event.promise.then(() => delay(flag))).then(timeout.done); - } - return { - type: "spawn.after", - action(_0, _1) { - return __async(this, arguments, function* (_data, { spawned, close }) { - var _a2, _b; - const events = createEvents(); - let deferClose = true; - let quickClose = () => void (deferClose = false); - (_a2 = spawned.stdout) == null ? void 0 : _a2.on("data", quickClose); - (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose); - spawned.on("error", quickClose); - spawned.on("close", (code) => events.close(code)); - spawned.on("exit", (code) => events.exit(code)); - try { - yield events.result; - if (deferClose) { - yield delay(50); - } - close(events.exitCode); - } catch (err) { - close(events.exitCode, err); - } - }); - } - }; -} -init_git_error(); -function isTaskError(result) { - return !!(result.exitCode && result.stdErr.length); -} -function getErrorMessage(result) { - return Buffer.concat([...result.stdOut, ...result.stdErr]); -} -function errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) { - return (error, result) => { - if (!overwrite && error || !isError(result)) { - return error; - } - return errorMessage(result); - }; -} -function errorDetectionPlugin(config) { - return { - type: "task.error", - action(data, context) { - const error = config(data.error, { - stdErr: context.stdErr, - stdOut: context.stdOut, - exitCode: context.exitCode - }); - if (Buffer.isBuffer(error)) { - return { error: new GitError(void 0, error.toString("utf-8")) }; - } - return { - error - }; - } - }; -} -init_utils(); -var PluginStore = class { - constructor() { - this.plugins = /* @__PURE__ */ new Set(); - } - add(plugin) { - const plugins = []; - asArray(plugin).forEach((plugin2) => plugin2 && this.plugins.add(append(plugins, plugin2))); - return () => { - plugins.forEach((plugin2) => this.plugins.delete(plugin2)); - }; - } - exec(type, data, context) { - let output = data; - const contextual = Object.freeze(Object.create(context)); - for (const plugin of this.plugins) { - if (plugin.type === type) { - output = plugin.action(output, contextual); - } - } - return output; - } -}; -init_utils(); -function progressMonitorPlugin(progress) { - const progressCommand = "--progress"; - const progressMethods = ["checkout", "clone", "fetch", "pull", "push"]; - const onProgress = { - type: "spawn.after", - action(_data, context) { - var _a2; - if (!context.commands.includes(progressCommand)) { - return; - } - (_a2 = context.spawned.stderr) == null ? void 0 : _a2.on("data", (chunk) => { - const message = /^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString("utf8")); - if (!message) { - return; - } - progress({ - method: context.method, - stage: progressEventStage(message[1]), - progress: asNumber(message[2]), - processed: asNumber(message[3]), - total: asNumber(message[4]) - }); - }); - } - }; - const onArgs = { - type: "spawn.args", - action(args, context) { - if (!progressMethods.includes(context.method)) { - return args; - } - return including(args, progressCommand); - } - }; - return [onArgs, onProgress]; -} -function progressEventStage(input) { - return String(input.toLowerCase().split(" ", 1)) || "unknown"; -} -init_utils(); -function spawnOptionsPlugin(spawnOptions) { - const options = pick(spawnOptions, ["uid", "gid"]); - return { - type: "spawn.options", - action(data) { - return __spreadValues(__spreadValues({}, options), data); - } - }; -} -function timeoutPlugin({ - block, - stdErr = true, - stdOut = true -}) { - if (block > 0) { - return { - type: "spawn.after", - action(_data, context) { - var _a2, _b; - let timeout; - function wait3() { - timeout && clearTimeout(timeout); - timeout = setTimeout(kill, block); - } - function stop() { - var _a3, _b2; - (_a3 = context.spawned.stdout) == null ? void 0 : _a3.off("data", wait3); - (_b2 = context.spawned.stderr) == null ? void 0 : _b2.off("data", wait3); - context.spawned.off("exit", stop); - context.spawned.off("close", stop); - timeout && clearTimeout(timeout); - } - function kill() { - stop(); - context.kill(new GitPluginError(void 0, "timeout", `block timeout reached`)); - } - stdOut && ((_a2 = context.spawned.stdout) == null ? void 0 : _a2.on("data", wait3)); - stdErr && ((_b = context.spawned.stderr) == null ? void 0 : _b.on("data", wait3)); - context.spawned.on("exit", stop); - context.spawned.on("close", stop); - wait3(); - } - }; - } -} -init_utils(); -var Git = require_git(); -function gitInstanceFactory(baseDir, options) { - const plugins = new PluginStore(); - const config = createInstanceConfig(baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {}, options); - if (!folderExists(config.baseDir)) { - throw new GitConstructError(config, `Cannot use simple-git on a directory that does not exist`); - } - if (Array.isArray(config.config)) { - plugins.add(commandConfigPrefixingPlugin(config.config)); - } - plugins.add(blockUnsafeOperationsPlugin(config.unsafe)); - plugins.add(completionDetectionPlugin(config.completion)); - config.abort && plugins.add(abortPlugin(config.abort)); - config.progress && plugins.add(progressMonitorPlugin(config.progress)); - config.timeout && plugins.add(timeoutPlugin(config.timeout)); - config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions)); - plugins.add(errorDetectionPlugin(errorDetectionHandler(true))); - config.errors && plugins.add(errorDetectionPlugin(config.errors)); - return new Git(config, plugins); -} -init_git_response_error(); -var esm_default = gitInstanceFactory; - -// src/constants.ts -init_polyfill_buffer(); -var import_obsidian2 = require("obsidian"); -var DATE_FORMAT = "YYYY-MM-DD"; -var DATE_TIME_FORMAT_MINUTES = `${DATE_FORMAT} HH:mm`; -var DATE_TIME_FORMAT_SECONDS = `${DATE_FORMAT} HH:mm:ss`; -var GIT_LINE_AUTHORING_MOVEMENT_DETECTION_MINIMAL_LENGTH = 40; -var DEFAULT_SETTINGS = { - commitMessage: "vault backup: {{date}}", - commitDateFormat: DATE_TIME_FORMAT_SECONDS, - autoSaveInterval: 0, - autoPushInterval: 0, - autoPullInterval: 0, - autoPullOnBoot: false, - disablePush: false, - pullBeforePush: true, - disablePopups: false, - listChangedFilesInMessageBody: false, - showStatusBar: true, - updateSubmodules: false, - syncMethod: "merge", - customMessageOnAutoBackup: false, - autoBackupAfterFileChange: false, - treeStructure: false, - refreshSourceControl: import_obsidian2.Platform.isDesktopApp, - basePath: "", - differentIntervalCommitAndPush: false, - changedFilesInStatusBar: false, - showedMobileNotice: false, - refreshSourceControlTimer: 7e3, - showBranchStatusBar: true, - setLastSaveToLastCommit: false, - submoduleRecurseCheckout: false, - gitDir: "", - showFileMenu: true, - lineAuthor: { - show: false, - followMovement: "inactive", - authorDisplay: "initials", - showCommitHash: false, - dateTimeFormatOptions: "date", - dateTimeFormatCustomString: DATE_TIME_FORMAT_MINUTES, - dateTimeTimezone: "viewer-local", - coloringMaxAge: "1y", - // colors were picked via: - // https://color.adobe.com/de/create/color-accessibility - colorNew: { r: 255, g: 150, b: 150 }, - colorOld: { r: 120, g: 160, b: 255 }, - textColorCss: "var(--text-muted)", - // more pronounced than line numbers, but less than the content text - ignoreWhitespace: false, - gutterSpacingFallbackLength: 5 - } -}; -var SOURCE_CONTROL_VIEW_CONFIG = { - type: "git-view", - name: "Source Control", - icon: "git-pull-request" -}; -var HISTORY_VIEW_CONFIG = { - type: "git-history-view", - name: "History", - icon: "history" -}; -var DIFF_VIEW_CONFIG = { - type: "diff-view", - name: "Diff View", - icon: "git-pull-request" -}; - -// src/types.ts -init_polyfill_buffer(); -function mergeSettingsByPriority(low, high) { - const lineAuthor = Object.assign({}, low.lineAuthor, high.lineAuthor); - return Object.assign({}, low, high, { lineAuthor }); -} - -// src/utils.ts -init_polyfill_buffer(); -var cssColorConverter = __toESM(require_lib3()); -var import_deep_equal = __toESM(require_deep_equal()); -var import_obsidian3 = require("obsidian"); -var worthWalking2 = (filepath, root2) => { - if (filepath === "." || root2 == null || root2.length === 0 || root2 === ".") { - return true; - } - if (root2.length >= filepath.length) { - return root2.startsWith(filepath); - } else { - return filepath.startsWith(root2); - } -}; -function getNewLeaf(event) { - let leaf; - if (event) { - if (event.button === 0 || event.button === 1) { - const type = import_obsidian3.Keymap.isModEvent(event); - leaf = app.workspace.getLeaf(type); - } - } else { - leaf = app.workspace.getLeaf(false); - } - return leaf; -} -function impossibleBranch(x) { - throw new Error("Impossible branch: " + x); -} -function rgbToString(rgb) { - return `rgb(${rgb.r},${rgb.g},${rgb.b})`; -} -function convertToRgb(str) { - var _a2; - const color = (_a2 = cssColorConverter.fromString(str)) == null ? void 0 : _a2.toRgbaArray(); - if (color === void 0) { - return void 0; - } - const [r, g, b] = color; - return { r, g, b }; -} -function momentToEpochSeconds(instant) { - return instant.diff(import_obsidian3.moment.unix(0), "seconds"); -} -function median(array) { - if (array.length === 0) - return void 0; - return array.slice().sort()[Math.floor(array.length / 2)]; -} -function strictDeepEqual(a, b) { - return (0, import_deep_equal.default)(a, b, { strict: true }); -} -function resizeToLength(original, desiredLength, fillChar) { - if (original.length <= desiredLength) { - const prefix = new Array(desiredLength - original.length).fill(fillChar).join(""); - return prefix + original; - } else { - return original.substring(original.length - desiredLength); - } -} -function prefixOfLengthAsWhitespace(toBeRenderedText, whitespacePrefixLength) { - if (whitespacePrefixLength <= 0) - return toBeRenderedText; - const whitespacePrefix = new Array(whitespacePrefixLength).fill(" ").join(""); - const originalSuffix = toBeRenderedText.substring( - whitespacePrefixLength, - toBeRenderedText.length - ); - return whitespacePrefix + originalSuffix; -} -function between(l, x, r) { - return l <= x && x <= r; -} -function splitRemoteBranch(remoteBranch) { - const [remote, ...branch2] = remoteBranch.split("/"); - return [remote, branch2.length === 0 ? void 0 : branch2.join("/")]; -} -function getDisplayPath(path2) { - if (path2.endsWith("/")) - return path2; - return path2.split("/").last().replace(".md", ""); -} -function formatMinutes(minutes) { - if (minutes === 1) - return "1 minute"; - return `${minutes} minutes`; -} - -// src/gitManager/gitManager.ts -init_polyfill_buffer(); -var GitManager = class { - constructor(plugin) { - this.plugin = plugin; - this.app = plugin.app; - } - getVaultPath(path2) { - if (this.plugin.settings.basePath) { - return this.plugin.settings.basePath + "/" + path2; - } else { - return path2; - } - } - asRepositoryRelativePath(path2, relativeToVault) { - return relativeToVault && this.plugin.settings.basePath.length > 0 ? path2.substring(this.plugin.settings.basePath.length + 1) : path2; - } - _getTreeStructure(children2, beginLength = 0) { - const list = []; - children2 = [...children2]; - while (children2.length > 0) { - const first2 = children2.first(); - const restPath = first2.path.substring(beginLength); - if (restPath.contains("/")) { - const title = restPath.substring(0, restPath.indexOf("/")); - const childrenWithSameTitle = children2.filter((item) => { - return item.path.substring(beginLength).startsWith(title + "/"); - }); - childrenWithSameTitle.forEach((item) => children2.remove(item)); - const path2 = first2.path.substring( - 0, - restPath.indexOf("/") + beginLength - ); - list.push({ - title, - path: path2, - vaultPath: this.getVaultPath(path2), - children: this._getTreeStructure( - childrenWithSameTitle, - (beginLength > 0 ? beginLength + title.length : title.length) + 1 - ) - }); - } else { - list.push({ - title: restPath, - data: first2, - path: first2.path, - vaultPath: this.getVaultPath(first2.path) - }); - children2.remove(first2); - } - } - return list; - } - /* - * Sorts the children and simplifies the title - * If a node only contains another subdirectory, that subdirectory is moved up one level and integrated into the parent node - */ - simplify(tree) { - var _a2, _b, _c, _d; - for (const node of tree) { - while (true) { - const singleChild = ((_a2 = node.children) == null ? void 0 : _a2.length) == 1; - const singleChildIsDir = ((_c = (_b = node.children) == null ? void 0 : _b.first()) == null ? void 0 : _c.data) == void 0; - if (!(node.children != void 0 && singleChild && singleChildIsDir)) - break; - const child = node.children.first(); - node.title += "/" + child.title; - node.data = child.data; - node.path = child.path; - node.vaultPath = child.vaultPath; - node.children = child.children; - } - if (node.children != void 0) { - this.simplify(node.children); - } - (_d = node.children) == null ? void 0 : _d.sort((a, b) => { - const dirCompare = (b.data == void 0 ? 1 : 0) - (a.data == void 0 ? 1 : 0); - if (dirCompare != 0) { - return dirCompare; - } else { - return a.title.localeCompare(b.title); - } - }); - } - return tree.sort((a, b) => { - const dirCompare = (b.data == void 0 ? 1 : 0) - (a.data == void 0 ? 1 : 0); - if (dirCompare != 0) { - return dirCompare; - } else { - return a.title.localeCompare(b.title); - } - }); - } - getTreeStructure(children2) { - const tree = this._getTreeStructure(children2); - const res = this.simplify(tree); - return res; - } - async formatCommitMessage(template) { - let status2; - if (template.includes("{{numFiles}}")) { - status2 = await this.status(); - const numFiles = status2.staged.length; - template = template.replace("{{numFiles}}", String(numFiles)); - } - if (template.includes("{{hostname}}")) { - const hostname = this.plugin.localStorage.getHostname() || ""; - template = template.replace("{{hostname}}", hostname); - } - if (template.includes("{{files}}")) { - status2 = status2 != null ? status2 : await this.status(); - const changeset = {}; - status2.staged.forEach((value) => { - if (value.index in changeset) { - changeset[value.index].push(value.path); - } else { - changeset[value.index] = [value.path]; - } - }); - const chunks = []; - for (const [action, files2] of Object.entries(changeset)) { - chunks.push(action + " " + files2.join(" ")); - } - const files = chunks.join(", "); - template = template.replace("{{files}}", files); - } - const moment5 = window.moment; - template = template.replace( - "{{date}}", - moment5().format(this.plugin.settings.commitDateFormat) - ); - if (this.plugin.settings.listChangedFilesInMessageBody) { - template = template + "\n\nAffected files:\n" + (status2 != null ? status2 : await this.status()).staged.map((e) => e.path).join("\n"); - } - return template; - } -}; - -// src/gitManager/simpleGit.ts -var SimpleGit = class extends GitManager { - constructor(plugin) { - super(plugin); - } - async setGitInstance(ignoreError = false) { - if (this.isGitInstalled()) { - const adapter = this.app.vault.adapter; - const path2 = adapter.getBasePath(); - let basePath = path2; - if (this.plugin.settings.basePath) { - const exists2 = await adapter.exists( - (0, import_obsidian4.normalizePath)(this.plugin.settings.basePath) - ); - if (exists2) { - basePath = path2 + import_path.sep + this.plugin.settings.basePath; - } else if (!ignoreError) { - new import_obsidian4.Notice("ObsidianGit: Base path does not exist"); - } - } - this.git = esm_default({ - baseDir: basePath, - binary: this.plugin.localStorage.getGitPath() || void 0, - config: ["core.quotepath=off"] - }); - const pathPaths = this.plugin.localStorage.getPATHPaths(); - const envVars = this.plugin.localStorage.getEnvVars(); - const gitDir = this.plugin.settings.gitDir; - if (pathPaths.length > 0) { - const path3 = process.env["PATH"] + ":" + pathPaths.join(":"); - process.env["PATH"] = path3; - } - if (gitDir) { - process.env["GIT_DIR"] = gitDir; - } - for (const envVar of envVars) { - const [key2, value] = envVar.split("="); - process.env[key2] = value; - } - import_debug2.default.enable("simple-git"); - if (await this.git.checkIsRepo()) { - await this.git.cwd(await this.git.revparse("--show-toplevel")); - } - } - } - async status() { - this.plugin.setState(1 /* status */); - const status2 = await this.git.status((err) => this.onError(err)); - this.plugin.setState(0 /* idle */); - return { - changed: status2.files.filter((e) => e.working_dir !== " ").map((e) => { - const res = this.formatPath(e); - return { - path: res.path, - from: res.from, - working_dir: e.working_dir === "?" ? "U" : e.working_dir, - vault_path: this.getVaultPath(res.path) - }; - }), - staged: status2.files.filter((e) => e.index !== " " && e.index != "?").map((e) => { - const res = this.formatPath(e, e.index === "R"); - return { - path: res.path, - from: res.from, - index: e.index, - vault_path: this.getVaultPath(res.path) - }; - }), - conflicted: status2.conflicted.map( - (path2) => this.formatPath({ path: path2 }).path - ) - }; - } - async submoduleAwareHeadRevisonInContainingDirectory(filepath) { - const repoPath = this.asRepositoryRelativePath(filepath, true); - const containingDirectory = path.dirname(repoPath); - const args = ["-C", containingDirectory, "rev-parse", "HEAD"]; - const result = this.git.raw(args); - result.catch( - (err) => console.warn("obsidian-git: rev-parse error:", err) - ); - return result; - } - async getSubmodulePaths() { - return new Promise(async (resolve) => { - this.git.outputHandler(async (cmd, stdout, stderr, args) => { - if (!(args.contains("submodule") && args.contains("foreach"))) { - return; - } - let body = ""; - const root2 = this.app.vault.adapter.getBasePath() + (this.plugin.settings.basePath ? "/" + this.plugin.settings.basePath : ""); - stdout.on("data", (chunk) => { - body += chunk.toString("utf8"); - }); - stdout.on("end", async () => { - const submods = body.split("\n"); - const strippedSubmods = submods.map((i) => { - const submod = i.match(/'([^']*)'/); - if (submod != void 0) { - return root2 + "/" + submod[1] + import_path.sep; - } - }).filter((i) => !!i); - strippedSubmods.reverse(); - resolve(strippedSubmods); - }); - }); - await this.git.subModule(["foreach", "--recursive", ""]); - this.git.outputHandler(() => { - }); - }); - } - //Remove wrong `"` like "My file.md" - formatPath(path2, renamed = false) { - function format(path3) { - if (path3 == void 0) - return void 0; - if (path3.startsWith('"') && path3.endsWith('"')) { - return path3.substring(1, path3.length - 1); - } else { - return path3; - } - } - if (renamed) { - return { - from: format(path2.from), - path: format(path2.path) - }; - } else { - return { - path: format(path2.path) - }; - } - } - async blame(path2, trackMovement, ignoreWhitespace) { - path2 = this.asRepositoryRelativePath(path2, true); - if (!await this.isTracked(path2)) - return "untracked"; - const inSubmodule = await this.getSubmoduleOfFile(path2); - const args = inSubmodule ? ["-C", inSubmodule.submodule] : []; - const relativePath = inSubmodule ? inSubmodule.relativeFilepath : path2; - args.push("blame", "--porcelain"); - if (ignoreWhitespace) - args.push("-w"); - const trackCArg = `-C${GIT_LINE_AUTHORING_MOVEMENT_DETECTION_MINIMAL_LENGTH}`; - switch (trackMovement) { - case "inactive": - break; - case "same-commit": - args.push("-C", trackCArg); - break; - case "all-commits": - args.push("-C", "-C", trackCArg); - break; - default: - impossibleBranch(trackMovement); - } - args.push("--", relativePath); - const rawBlame = await this.git.raw( - args, - (err) => err && console.warn("git-blame", err) - ); - return parseBlame(rawBlame); - } - async isTracked(path2) { - const inSubmodule = await this.getSubmoduleOfFile(path2); - const args = inSubmodule ? ["-C", inSubmodule.submodule] : []; - const relativePath = inSubmodule ? inSubmodule.relativeFilepath : path2; - args.push("ls-files", "--", relativePath); - return this.git.raw(args, (err) => err && console.warn("ls-files", err)).then((x) => x.trim() !== ""); - } - async commitAll({ message }) { - if (this.plugin.settings.updateSubmodules) { - this.plugin.setState(4 /* commit */); - const submodulePaths = await this.getSubmodulePaths(); - for (const item of submodulePaths) { - await this.git.cwd({ path: item, root: false }).add("-A", (err) => this.onError(err)); - await this.git.cwd({ path: item, root: false }).commit( - await this.formatCommitMessage(message), - (err) => this.onError(err) - ); - } - } - this.plugin.setState(3 /* add */); - await this.git.add("-A", (err) => this.onError(err)); - this.plugin.setState(4 /* commit */); - const res = await this.git.commit( - await this.formatCommitMessage(message), - (err) => this.onError(err) - ); - dispatchEvent(new CustomEvent("git-head-update")); - return res.summary.changes; - } - async commit(message) { - this.plugin.setState(4 /* commit */); - const res = (await this.git.commit( - await this.formatCommitMessage(message), - (err) => this.onError(err) - )).summary.changes; - dispatchEvent(new CustomEvent("git-head-update")); - this.plugin.setState(0 /* idle */); - return res; - } - async stage(path2, relativeToVault) { - this.plugin.setState(3 /* add */); - path2 = this.asRepositoryRelativePath(path2, relativeToVault); - await this.git.add(["--", path2], (err) => this.onError(err)); - this.plugin.setState(0 /* idle */); - } - async stageAll({ dir }) { - this.plugin.setState(3 /* add */); - await this.git.add(dir != null ? dir : "-A", (err) => this.onError(err)); - this.plugin.setState(0 /* idle */); - } - async unstageAll({ dir }) { - this.plugin.setState(3 /* add */); - await this.git.reset( - dir != void 0 ? ["--", dir] : [], - (err) => this.onError(err) - ); - this.plugin.setState(0 /* idle */); - } - async unstage(path2, relativeToVault) { - this.plugin.setState(3 /* add */); - path2 = this.asRepositoryRelativePath(path2, relativeToVault); - await this.git.reset(["--", path2], (err) => this.onError(err)); - this.plugin.setState(0 /* idle */); - } - async discard(filepath) { - this.plugin.setState(3 /* add */); - await this.git.checkout(["--", filepath], (err) => this.onError(err)); - this.plugin.setState(0 /* idle */); - } - async hashObject(filepath) { - filepath = this.asRepositoryRelativePath(filepath, true); - const inSubmodule = await this.getSubmoduleOfFile(filepath); - const args = inSubmodule ? ["-C", inSubmodule.submodule] : []; - const relativeFilepath = inSubmodule ? inSubmodule.relativeFilepath : filepath; - args.push("hash-object", "--", relativeFilepath); - const revision = this.git.raw(args); - revision.catch( - (err) => err && console.warn("obsidian-git. hash-object failed:", err == null ? void 0 : err.message) - ); - return revision; - } - async discardAll({ dir }) { - return this.discard(dir != null ? dir : "."); - } - async pull() { - this.plugin.setState(2 /* pull */); - if (this.plugin.settings.updateSubmodules) - await this.git.subModule( - ["update", "--remote", "--merge", "--recursive"], - (err) => this.onError(err) - ); - const branchInfo = await this.branchInfo(); - const localCommit = await this.git.revparse( - [branchInfo.current], - (err) => this.onError(err) - ); - await this.git.fetch((err) => this.onError(err)); - const upstreamCommit = await this.git.revparse( - [branchInfo.tracking], - (err) => this.onError(err) - ); - if (localCommit !== upstreamCommit) { - if (this.plugin.settings.syncMethod === "merge" || this.plugin.settings.syncMethod === "rebase") { - try { - switch (this.plugin.settings.syncMethod) { - case "merge": - await this.git.merge([branchInfo.tracking]); - break; - case "rebase": - await this.git.rebase([branchInfo.tracking]); - } - } catch (err) { - this.plugin.displayError( - `Pull failed (${this.plugin.settings.syncMethod}): ${err.message}` - ); - return; - } - } else if (this.plugin.settings.syncMethod === "reset") { - try { - await this.git.raw( - [ - "update-ref", - `refs/heads/${branchInfo.current}`, - upstreamCommit - ], - (err) => this.onError(err) - ); - await this.unstageAll({}); - } catch (err) { - this.plugin.displayError( - `Sync failed (${this.plugin.settings.syncMethod}): ${err.message}` - ); - } - } - dispatchEvent(new CustomEvent("git-head-update")); - const afterMergeCommit = await this.git.revparse( - [branchInfo.current], - (err) => this.onError(err) - ); - const filesChanged = await this.git.diff([ - `${localCommit}..${afterMergeCommit}`, - "--name-only" - ]); - return filesChanged.split(/\r\n|\r|\n/).filter((value) => value.length > 0).map((e) => { - return { - path: e, - working_dir: "P", - vault_path: this.getVaultPath(e) - }; - }); - } else { - return []; - } - } - async push() { - this.plugin.setState(1 /* status */); - const status2 = await this.git.status(); - const trackingBranch = status2.tracking; - const currentBranch2 = status2.current; - const remoteChangedFiles = (await this.git.diffSummary( - [currentBranch2, trackingBranch, "--"], - (err) => this.onError(err) - )).changed; - this.plugin.setState(5 /* push */); - if (this.plugin.settings.updateSubmodules) { - await this.git.env({ ...process.env, OBSIDIAN_GIT: 1 }).subModule( - [ - "foreach", - "--recursive", - `tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi` - ], - (err) => this.onError(err) - ); - } - await this.git.env({ ...process.env, OBSIDIAN_GIT: 1 }).push((err) => this.onError(err)); - return remoteChangedFiles; - } - async getUnpushedCommits() { - const status2 = await this.git.status(); - const trackingBranch = status2.tracking; - const currentBranch2 = status2.current; - if (trackingBranch == null || currentBranch2 == null) { - return 0; - } - const remoteChangedFiles = (await this.git.diffSummary( - [currentBranch2, trackingBranch, "--"], - (err) => this.onError(err) - )).changed; - return remoteChangedFiles; - } - async canPush() { - if (this.plugin.settings.updateSubmodules === true) { - return true; - } - const status2 = await this.git.status((err) => this.onError(err)); - const trackingBranch = status2.tracking; - const currentBranch2 = status2.current; - const remoteChangedFiles = (await this.git.diffSummary([currentBranch2, trackingBranch, "--"])).changed; - return remoteChangedFiles !== 0; - } - async checkRequirements() { - if (!this.isGitInstalled()) { - return "missing-git"; - } - if (!await this.git.checkIsRepo()) { - return "missing-repo"; - } - return "valid"; - } - async branchInfo() { - const status2 = await this.git.status((err) => this.onError(err)); - const branches = await this.git.branch( - ["--no-color"], - (err) => this.onError(err) - ); - return { - current: status2.current || void 0, - tracking: status2.tracking || void 0, - branches: branches.all - }; - } - async getRemoteUrl(remote) { - try { - await this.git.remote(["get-url", remote]); - } catch (error) { - if (error.toString().contains(remote)) { - return void 0; - } else { - this.onError(error); - } - } - } - // https://github.com/kometenstaub/obsidian-version-history-diff/issues/3 - async log(file, relativeToVault = true, limit) { - let path2; - if (file) { - path2 = this.asRepositoryRelativePath(file, relativeToVault); - } - const res = await this.git.log( - { - file: path2, - maxCount: limit, - "-m": null, - "--name-status": null - }, - (err) => this.onError(err) - ); - return res.all.map((e) => { - var _a2, _b, _c, _d; - return { - ...e, - refs: e.refs.split(", "), - diff: { - ...e.diff, - files: (_b = (_a2 = e.diff) == null ? void 0 : _a2.files.map((f) => ({ - ...f, - status: f.status, - path: f.file, - hash: e.hash, - vault_path: this.getVaultPath(f.file) - }))) != null ? _b : [] - }, - fileName: (_d = (_c = e.diff) == null ? void 0 : _c.files.first()) == null ? void 0 : _d.file - }; - }); - } - async show(commitHash, file, relativeToVault = true) { - const path2 = this.asRepositoryRelativePath(file, relativeToVault); - return this.git.show( - [commitHash + ":" + path2], - (err) => this.onError(err) - ); - } - async checkout(branch2, remote) { - if (remote) { - branch2 = `${remote}/${branch2}`; - } - await this.git.checkout(branch2, (err) => this.onError(err)); - if (this.plugin.settings.submoduleRecurseCheckout) { - const submodulePaths = await this.getSubmodulePaths(); - for (const submodulePath of submodulePaths) { - const branchSummary = await this.git.cwd({ path: submodulePath, root: false }).branch(); - if (Object.keys(branchSummary.branches).includes(branch2)) { - await this.git.cwd({ path: submodulePath, root: false }).checkout(branch2, (err) => this.onError(err)); - } - } - } - } - async createBranch(branch2) { - await this.git.checkout(["-b", branch2], (err) => this.onError(err)); - } - async deleteBranch(branch2, force) { - await this.git.branch( - [force ? "-D" : "-d", branch2], - (err) => this.onError(err) - ); - } - async branchIsMerged(branch2) { - const notMergedBranches = await this.git.branch( - ["--no-merged"], - (err) => this.onError(err) - ); - return !notMergedBranches.all.contains(branch2); - } - async init() { - await this.git.init(false, (err) => this.onError(err)); - } - async clone(url, dir, depth) { - await this.git.clone( - url, - path.join( - this.app.vault.adapter.getBasePath(), - dir - ), - depth ? ["--depth", `${depth}`] : [], - (err) => this.onError(err) - ); - } - async setConfig(path2, value) { - if (value == void 0) { - await this.git.raw(["config", "--local", "--unset", path2]); - } else { - await this.git.addConfig(path2, value, (err) => this.onError(err)); - } - } - async getConfig(path2) { - const config = await this.git.listConfig( - "local", - (err) => this.onError(err) - ); - return config.all[path2]; - } - async fetch(remote) { - await this.git.fetch( - remote != void 0 ? [remote] : [], - (err) => this.onError(err) - ); - } - async setRemote(name, url) { - if ((await this.getRemotes()).includes(name)) - await this.git.remote( - ["set-url", name, url], - (err) => this.onError(err) - ); - else { - await this.git.remote( - ["add", name, url], - (err) => this.onError(err) - ); - } - } - async getRemoteBranches(remote) { - const res = await this.git.branch( - ["-r", "--list", `${remote}*`], - (err) => this.onError(err) - ); - console.log(remote); - console.log(res); - const list = []; - for (const item in res.branches) { - list.push(res.branches[item].name); - } - return list; - } - async getRemotes() { - const res = await this.git.remote([], (err) => this.onError(err)); - if (res) { - return res.trim().split("\n"); - } else { - return []; - } - } - async removeRemote(remoteName) { - await this.git.removeRemote(remoteName); - } - async updateUpstreamBranch(remoteBranch) { - try { - await this.git.branch(["--set-upstream-to", remoteBranch]); - } catch (e) { - console.error(e); - try { - await this.git.branch(["--set-upstream", remoteBranch]); - } catch (e2) { - console.error(e2); - await this.git.push( - // A type error occurs here because the third element could be undefined. - // However, it is unlikely to be undefined due to the `remoteBranch`'s format, and error handling is in place. - // Therefore, we temporarily ignore the error. - // @ts-ignore - ["--set-upstream", ...splitRemoteBranch(remoteBranch)], - (err) => this.onError(err) - ); - } - } - } - updateGitPath(gitPath) { - this.setGitInstance(); - } - updateBasePath(basePath) { - this.setGitInstance(true); - } - async getDiffString(filePath, stagedChanges = false, hash2) { - if (stagedChanges) - return await this.git.diff(["--cached", "--", filePath]); - if (hash2) - return await this.git.show([`${hash2}`, "--", filePath]); - else - return await this.git.diff(["--", filePath]); - } - async diff(file, commit1, commit2) { - return await this.git.diff([`${commit1}..${commit2}`, "--", file]); - } - async getSubmoduleOfFile(repositoryRelativeFile) { - let submoduleRoot = await this.git.raw( - [ - "-C", - path.dirname(repositoryRelativeFile), - "rev-parse", - "--show-toplevel" - ], - (err) => err && console.warn("get-submodule-of-file", err == null ? void 0 : err.message) - ); - submoduleRoot = submoduleRoot.trim(); - const superProject = await this.git.raw( - [ - "-C", - path.dirname(repositoryRelativeFile), - "rev-parse", - "--show-superproject-working-tree" - ], - (err) => err && console.warn("get-submodule-of-file", err == null ? void 0 : err.message) - ); - if (superProject.trim() === "") { - return void 0; - } - const fsAdapter = this.app.vault.adapter; - const absolutePath = fsAdapter.getFullPath( - path.normalize(repositoryRelativeFile) - ); - const newRelativePath = path.relative(submoduleRoot, absolutePath); - return { submodule: submoduleRoot, relativeFilepath: newRelativePath }; - } - async getLastCommitTime() { - const res = await this.git.log({ n: 1 }, (err) => this.onError(err)); - if (res != null && res.latest != null) { - return new Date(res.latest.date); - } - } - isGitInstalled() { - const command = (0, import_child_process2.spawnSync)( - this.plugin.localStorage.getGitPath() || "git", - ["--version"], - { - stdio: "ignore" - } - ); - if (command.error) { - console.error(command.error); - return false; - } - return true; - } - onError(error) { - if (error) { - const networkFailure = error.message.contains("Could not resolve host") || error.message.match( - /ssh: connect to host .*? port .*?: Operation timed out/ - ) || error.message.match( - /ssh: connect to host .*? port .*?: Network is unreachable/ - ); - if (!networkFailure) { - this.plugin.displayError(error.message); - this.plugin.setState(0 /* idle */); - } else if (!this.plugin.offlineMode) { - this.plugin.displayError( - "Git: Going into offline mode. Future network errors will no longer be displayed.", - 2e3 - ); - } - if (networkFailure) { - this.plugin.offlineMode = true; - this.plugin.setState(0 /* idle */); - } - } - } -}; -var zeroCommit = { - hash: "000000", - isZeroCommit: true, - summary: "" -}; -function parseBlame(blameOutputUnnormalized) { - const blameOutput = blameOutputUnnormalized.replace("\r\n", "\n"); - const blameLines = blameOutput.split("\n"); - const result = { - commits: /* @__PURE__ */ new Map(), - hashPerLine: [void 0], - // one-based indices - originalFileLineNrPerLine: [void 0], - finalFileLineNrPerLine: [void 0], - groupSizePerStartingLine: /* @__PURE__ */ new Map() - }; - let line = 1; - for (let bi = 0; bi < blameLines.length; ) { - if (startsWithNonWhitespace(blameLines[bi])) { - const lineInfo = blameLines[bi].split(" "); - const commitHash = parseLineInfoInto(lineInfo, line, result); - bi++; - for (; startsWithNonWhitespace(blameLines[bi]); bi++) { - const spaceSeparatedHeaderValues = blameLines[bi].split(" "); - parseHeaderInto(spaceSeparatedHeaderValues, result, line); - } - finalizeBlameCommitInfo(result.commits.get(commitHash)); - line += 1; - } else if (blameLines[bi] === "" && bi === blameLines.length - 1) { - } else { - throw Error( - `Expected non-whitespace line or EOF, but found: ${blameLines[bi]}` - ); - } - bi++; - } - return result; -} -function parseLineInfoInto(lineInfo, line, result) { - const hash2 = lineInfo[0]; - result.hashPerLine.push(hash2); - result.originalFileLineNrPerLine.push(parseInt(lineInfo[1])); - result.finalFileLineNrPerLine.push(parseInt(lineInfo[2])); - lineInfo.length >= 4 && result.groupSizePerStartingLine.set(line, parseInt(lineInfo[3])); - if (parseInt(lineInfo[2]) !== line) { - throw Error( - `git-blame output is out of order: ${line} vs ${lineInfo[2]}` - ); - } - return hash2; -} -function parseHeaderInto(header, out, line) { - const key2 = header[0]; - const value = header.slice(1).join(" "); - const commitHash = out.hashPerLine[line]; - const commit2 = out.commits.get(commitHash) || { - hash: commitHash, - author: {}, - committer: {}, - previous: {} - }; - switch (key2) { - case "summary": - commit2.summary = value; - break; - case "author": - commit2.author.name = value; - break; - case "author-mail": - commit2.author.email = removeEmailBrackets(value); - break; - case "author-time": - commit2.author.epochSeconds = parseInt(value); - break; - case "author-tz": - commit2.author.tz = value; - break; - case "committer": - commit2.committer.name = value; - break; - case "committer-mail": - commit2.committer.email = removeEmailBrackets(value); - break; - case "committer-time": - commit2.committer.epochSeconds = parseInt(value); - break; - case "committer-tz": - commit2.committer.tz = value; - break; - case "previous": - commit2.previous.commitHash = value; - break; - case "filename": - commit2.previous.filename = value; - break; - } - out.commits.set(commitHash, commit2); -} -function finalizeBlameCommitInfo(commit2) { - if (commit2.summary === void 0) { - throw Error(`Summary not provided for commit: ${commit2.hash}`); - } - if (isUndefinedOrEmptyObject(commit2.author)) { - commit2.author = void 0; - } - if (isUndefinedOrEmptyObject(commit2.committer)) { - commit2.committer = void 0; - } - if (isUndefinedOrEmptyObject(commit2.previous)) { - commit2.previous = void 0; - } - commit2.isZeroCommit = Boolean(commit2.hash.match(/^0*$/)); -} -function isUndefinedOrEmptyObject(obj) { - return !obj || Object.keys(obj).length === 0; -} -function startsWithNonWhitespace(str) { - return str.length > 0 && str[0].trim() === str[0]; -} -function removeEmailBrackets(gitEmail) { - const prefixCleaned = gitEmail.startsWith("<") ? gitEmail.substring(1) : gitEmail; - return prefixCleaned.endsWith(">") ? prefixCleaned.substring(0, prefixCleaned.length - 1) : prefixCleaned; -} - -// src/lineAuthor/lineAuthorProvider.ts -init_polyfill_buffer(); -var import_state4 = require("@codemirror/state"); - -// src/lineAuthor/control.ts -init_polyfill_buffer(); -var import_state2 = require("@codemirror/state"); -var import_obsidian9 = require("obsidian"); - -// src/lineAuthor/eventsPerFilepath.ts -init_polyfill_buffer(); -var SECONDS = 1e3; -var REMOVE_STALES_FREQUENCY = 60 * SECONDS; -var EventsPerFilePath = class { - constructor() { - this.eventsPerFilepath = /* @__PURE__ */ new Map(); - this.startRemoveStalesSubscribersInterval(); - } - /** - * Run the {@link handler} on the subscribers to {@link filepath}. - */ - ifFilepathDefinedTransformSubscribers(filepath, handler) { - if (!filepath) - return; - this.ensureInitialized(filepath); - return handler(this.eventsPerFilepath.get(filepath)); - } - forEachSubscriber(handler) { - this.eventsPerFilepath.forEach((subs) => subs.forEach(handler)); - } - ensureInitialized(filepath) { - if (!this.eventsPerFilepath.get(filepath)) - this.eventsPerFilepath.set(filepath, /* @__PURE__ */ new Set()); - } - startRemoveStalesSubscribersInterval() { - this.removeStalesSubscribersTimer = window.setInterval( - () => this == null ? void 0 : this.forEachSubscriber((las) => las == null ? void 0 : las.removeIfStale()), - REMOVE_STALES_FREQUENCY - ); - } - clear() { - window.clearInterval(this.removeStalesSubscribersTimer); - this.eventsPerFilepath.clear(); - } -}; -var eventsPerFilePathSingleton = new EventsPerFilePath(); - -// src/lineAuthor/model.ts -init_polyfill_buffer(); -var import_state = require("@codemirror/state"); -var import_js_sha256 = __toESM(require_sha256()); - -// src/setting/settings.ts -init_polyfill_buffer(); -var import_obsidian8 = require("obsidian"); - -// src/gitManager/isomorphicGit.ts -init_polyfill_buffer(); - -// node_modules/.pnpm/diff@5.1.0/node_modules/diff/lib/index.mjs -init_polyfill_buffer(); -function Diff() { -} -Diff.prototype = { - diff: function diff(oldString, newString) { - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - var callback = options.callback; - if (typeof options === "function") { - callback = options; - options = {}; - } - this.options = options; - var self2 = this; - function done(value) { - if (callback) { - setTimeout(function() { - callback(void 0, value); - }, 0); - return true; - } else { - return value; - } - } - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - if (options.maxEditLength) { - maxEditLength = Math.min(maxEditLength, options.maxEditLength); - } - var bestPath = [{ - newPos: -1, - components: [] - }]; - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - return done([{ - value: this.join(newString), - count: newString.length - }]); - } - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = void 0; - var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - bestPath[diagonalPath - 1] = void 0; - } - var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = void 0; - continue; - } - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self2.pushComponent(basePath.components, void 0, true); - } else { - basePath = addPath; - basePath.newPos++; - self2.pushComponent(basePath.components, true, void 0); - } - _oldPos = self2.extractCommon(basePath, newString, oldString, diagonalPath); - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self2, basePath.components, newString, oldString, self2.useLongestToken)); - } else { - bestPath[diagonalPath] = basePath; - } - } - editLength++; - } - if (callback) { - (function exec() { - setTimeout(function() { - if (editLength > maxEditLength) { - return callback(); - } - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); - if (ret) { - return ret; - } - } - } - }, - pushComponent: function pushComponent(components, added, removed) { - var last2 = components[components.length - 1]; - if (last2 && last2.added === added && last2.removed === removed) { - components[components.length - 1] = { - count: last2.count + 1, - added, - removed - }; - } else { - components.push({ - count: 1, - added, - removed - }); - } - }, - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } - basePath.newPos = newPos; - return oldPos; - }, - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, - removeEmpty: function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - }, - castInput: function castInput(value) { - return value; - }, - tokenize: function tokenize(value) { - return value.split(""); - }, - join: function join3(chars) { - return chars.join(""); - } -}; -function buildValues(diff2, components, newString, oldString, useLongestToken) { - var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function(value2, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value2.length ? oldValue : value2; - }); - component.value = diff2.join(value); - } else { - component.value = diff2.join(newString.slice(newPos, newPos + component.count)); - } - newPos += component.count; - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff2.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } - var lastComponent = components[componentLen - 1]; - if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff2.equals("", lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } - return components; -} -function clonePath(path2) { - return { - newPos: path2.newPos, - components: path2.components.slice(0) - }; -} -var characterDiff = new Diff(); -function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); -} -var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; -var reWhitespace = /\S/; -var wordDiff = new Diff(); -wordDiff.equals = function(left, right) { - if (this.options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } - return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); -}; -wordDiff.tokenize = function(value) { - var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); - for (var i = 0; i < tokens.length - 1; i++) { - if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { - tokens[i] += tokens[i + 2]; - tokens.splice(i + 1, 2); - i--; - } - } - return tokens; -}; -function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); -} -var lineDiff = new Diff(); -lineDiff.tokenize = function(value) { - var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } - for (var i = 0; i < linesAndNewlines.length; i++) { - var line = linesAndNewlines[i]; - if (i % 2 && !this.options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } else { - if (this.options.ignoreWhitespace) { - line = line.trim(); - } - retLines.push(line); - } - } - return retLines; -}; -function diffLines(oldStr, newStr, callback) { - return lineDiff.diff(oldStr, newStr, callback); -} -var sentenceDiff = new Diff(); -sentenceDiff.tokenize = function(value) { - return value.split(/(\S.+?[.!?])(?=\s+|$)/); -}; -var cssDiff = new Diff(); -cssDiff.tokenize = function(value) { - return value.split(/([{}:;,]|\s+)/); -}; -function _typeof(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function(obj2) { - return typeof obj2; - }; - } else { - _typeof = function(obj2) { - return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }; - } - return _typeof(obj); -} -function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); -} -function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) - return _arrayLikeToArray(arr); -} -function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) - return Array.from(iter); -} -function _unsupportedIterableToArray(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); -} -function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) - arr2[i] = arr[i]; - return arr2; -} -function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); -} -var objectPrototypeToString = Object.prototype.toString; -var jsonDiff = new Diff(); -jsonDiff.useLongestToken = true; -jsonDiff.tokenize = lineDiff.tokenize; -jsonDiff.castInput = function(value) { - var _this$options = this.options, undefinedReplacement = _this$options.undefinedReplacement, _this$options$stringi = _this$options.stringifyReplacer, stringifyReplacer = _this$options$stringi === void 0 ? function(k, v) { - return typeof v === "undefined" ? undefinedReplacement : v; - } : _this$options$stringi; - return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " "); -}; -jsonDiff.equals = function(left, right) { - return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1")); -}; -function canonicalize(obj, stack, replacementStack, replacer, key2) { - stack = stack || []; - replacementStack = replacementStack || []; - if (replacer) { - obj = replacer(key2, obj); - } - var i; - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } - var canonicalizedObj; - if ("[object Array]" === objectPrototypeToString.call(obj)) { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key2); - } - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } - if (_typeof(obj) === "object" && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); - var sortedKeys = [], _key; - for (_key in obj) { - if (obj.hasOwnProperty(_key)) { - sortedKeys.push(_key); - } - } - sortedKeys.sort(); - for (i = 0; i < sortedKeys.length; i += 1) { - _key = sortedKeys[i]; - canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); - } - stack.pop(); - replacementStack.pop(); - } else { - canonicalizedObj = obj; - } - return canonicalizedObj; -} -var arrayDiff = new Diff(); -arrayDiff.tokenize = function(value) { - return value.slice(); -}; -arrayDiff.join = arrayDiff.removeEmpty = function(value) { - return value; -}; -function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (!options) { - options = {}; - } - if (typeof options.context === "undefined") { - options.context = 4; - } - var diff2 = diffLines(oldStr, newStr, options); - if (!diff2) { - return; - } - diff2.push({ - value: "", - lines: [] - }); - function contextLines(lines) { - return lines.map(function(entry) { - return " " + entry; - }); - } - var hunks = []; - var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; - var _loop = function _loop2(i2) { - var current = diff2[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - if (current.added || current.removed) { - var _curRange; - if (!oldRangeStart) { - var prev = diff2[i2 - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - if (prev) { - curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) { - return (current.added ? "+" : "-") + entry; - }))); - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - if (lines.length <= options.context * 2 && i2 < diff2.length - 2) { - var _curRange2; - (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); - } else { - var _curRange3; - var contextSize = Math.min(lines.length, options.context); - (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); - var hunk = { - oldStart: oldRangeStart, - oldLines: oldLine - oldRangeStart + contextSize, - newStart: newRangeStart, - newLines: newLine - newRangeStart + contextSize, - lines: curRange - }; - if (i2 >= diff2.length - 2 && lines.length <= options.context) { - var oldEOFNewline = /\n$/.test(oldStr); - var newEOFNewline = /\n$/.test(newStr); - var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; - if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) { - curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file"); - } - if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { - curRange.push("\\ No newline at end of file"); - } - } - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - }; - for (var i = 0; i < diff2.length; i++) { - _loop(i); - } - return { - oldFileName, - newFileName, - oldHeader, - newHeader, - hunks - }; -} -function formatPatch(diff2) { - var ret = []; - if (diff2.oldFileName == diff2.newFileName) { - ret.push("Index: " + diff2.oldFileName); - } - ret.push("==================================================================="); - ret.push("--- " + diff2.oldFileName + (typeof diff2.oldHeader === "undefined" ? "" : " " + diff2.oldHeader)); - ret.push("+++ " + diff2.newFileName + (typeof diff2.newHeader === "undefined" ? "" : " " + diff2.newHeader)); - for (var i = 0; i < diff2.hunks.length; i++) { - var hunk = diff2.hunks[i]; - if (hunk.oldLines === 0) { - hunk.oldStart -= 1; - } - if (hunk.newLines === 0) { - hunk.newStart -= 1; - } - ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@"); - ret.push.apply(ret, hunk.lines); - } - return ret.join("\n") + "\n"; -} -function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)); -} -function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); -} - -// src/gitManager/isomorphicGit.ts -var import_obsidian7 = require("obsidian"); - -// src/ui/modals/generalModal.ts -init_polyfill_buffer(); -var import_obsidian5 = require("obsidian"); -var generalModalConfigDefaults = { - options: [], - placeholder: "", - allowEmpty: false, - onlySelection: false, - initialValue: void 0 -}; -var GeneralModal = class extends import_obsidian5.SuggestModal { - constructor(config) { - super(app); - this.config = { ...generalModalConfigDefaults, ...config }; - this.setPlaceholder(this.config.placeholder); - } - open() { - super.open(); - if (this.config.initialValue != void 0) { - this.inputEl.value = this.config.initialValue; - this.inputEl.dispatchEvent(new Event("input")); - } - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - selectSuggestion(value, evt) { - if (this.resolve) { - let res; - if (this.config.allowEmpty && value === " ") - res = ""; - else if (value === "...") - res = void 0; - else - res = value; - this.resolve(res); - } - super.selectSuggestion(value, evt); - } - onClose() { - if (this.resolve) - this.resolve(void 0); - } - getSuggestions(query) { - if (this.config.onlySelection) { - return this.config.options; - } else if (this.config.allowEmpty) { - return [query.length > 0 ? query : " ", ...this.config.options]; - } else { - return [query.length > 0 ? query : "...", ...this.config.options]; - } - } - renderSuggestion(value, el) { - el.setText(value); - } - onChooseSuggestion(item, evt) { - } -}; - -// src/gitManager/myAdapter.ts -init_polyfill_buffer(); -var import_obsidian6 = require("obsidian"); -var MyAdapter = class { - constructor(vault, plugin) { - this.plugin = plugin; - this.promises = {}; - this.adapter = vault.adapter; - this.vault = vault; - this.lastBasePath = this.plugin.settings.basePath; - this.promises.readFile = this.readFile.bind(this); - this.promises.writeFile = this.writeFile.bind(this); - this.promises.readdir = this.readdir.bind(this); - this.promises.mkdir = this.mkdir.bind(this); - this.promises.rmdir = this.rmdir.bind(this); - this.promises.stat = this.stat.bind(this); - this.promises.unlink = this.unlink.bind(this); - this.promises.lstat = this.lstat.bind(this); - this.promises.readlink = this.readlink.bind(this); - this.promises.symlink = this.symlink.bind(this); - } - async readFile(path2, opts) { - var _a2; - this.maybeLog("Read: " + path2 + JSON.stringify(opts)); - if (opts == "utf8" || opts.encoding == "utf8") { - const file = this.vault.getAbstractFileByPath(path2); - if (file instanceof import_obsidian6.TFile) { - this.maybeLog("Reuse"); - return this.vault.read(file); - } else { - return this.adapter.read(path2); - } - } else { - if (path2.endsWith(this.gitDir + "/index")) { - if (this.plugin.settings.basePath != this.lastBasePath) { - this.clearIndex(); - this.lastBasePath = this.plugin.settings.basePath; - return this.adapter.readBinary(path2); - } - return (_a2 = this.index) != null ? _a2 : this.adapter.readBinary(path2); - } - const file = this.vault.getAbstractFileByPath(path2); - if (file instanceof import_obsidian6.TFile) { - this.maybeLog("Reuse"); - return this.vault.readBinary(file); - } else { - return this.adapter.readBinary(path2); - } - } - } - async writeFile(path2, data) { - this.maybeLog("Write: " + path2); - if (typeof data === "string") { - const file = this.vault.getAbstractFileByPath(path2); - if (file instanceof import_obsidian6.TFile) { - return this.vault.modify(file, data); - } else { - return this.adapter.write(path2, data); - } - } else { - if (path2.endsWith(this.gitDir + "/index")) { - this.index = data; - this.indexmtime = Date.now(); - } else { - const file = this.vault.getAbstractFileByPath(path2); - if (file instanceof import_obsidian6.TFile) { - return this.vault.modifyBinary(file, data); - } else { - return this.adapter.writeBinary(path2, data); - } - } - } - } - async readdir(path2) { - if (path2 === ".") - path2 = "/"; - const res = await this.adapter.list(path2); - const all = [...res.files, ...res.folders]; - let formattedAll; - if (path2 !== "/") { - formattedAll = all.map( - (e) => (0, import_obsidian6.normalizePath)(e.substring(path2.length)) - ); - } else { - formattedAll = all; - } - return formattedAll; - } - async mkdir(path2) { - return this.adapter.mkdir(path2); - } - async rmdir(path2, opts) { - var _a2, _b; - return this.adapter.rmdir(path2, (_b = (_a2 = opts == null ? void 0 : opts.options) == null ? void 0 : _a2.recursive) != null ? _b : false); - } - async stat(path2) { - if (path2.endsWith(this.gitDir + "/index")) { - if (this.index !== void 0 && this.indexctime != void 0 && this.indexmtime != void 0) { - return { - isFile: () => true, - isDirectory: () => false, - isSymbolicLink: () => false, - size: this.index.length, - type: "file", - ctimeMs: this.indexctime, - mtimeMs: this.indexmtime - }; - } else { - const stat = await this.adapter.stat(path2); - if (stat == void 0) { - throw { code: "ENOENT" }; - } - this.indexctime = stat.ctime; - this.indexmtime = stat.mtime; - return { - ctimeMs: stat.ctime, - mtimeMs: stat.mtime, - size: stat.size, - type: "file", - isFile: () => true, - isDirectory: () => false, - isSymbolicLink: () => false - }; - } - } - if (path2 === ".") - path2 = "/"; - const file = this.vault.getAbstractFileByPath(path2); - this.maybeLog("Stat: " + path2); - if (file instanceof import_obsidian6.TFile) { - this.maybeLog("Reuse stat"); - return { - ctimeMs: file.stat.ctime, - mtimeMs: file.stat.mtime, - size: file.stat.size, - type: "file", - isFile: () => true, - isDirectory: () => false, - isSymbolicLink: () => false - }; - } else { - const stat = await this.adapter.stat(path2); - if (stat) { - return { - ctimeMs: stat.ctime, - mtimeMs: stat.mtime, - size: stat.size, - type: stat.type === "folder" ? "directory" : stat.type, - isFile: () => stat.type === "file", - isDirectory: () => stat.type === "folder", - isSymbolicLink: () => false - }; - } else { - throw { code: "ENOENT" }; - } - } - } - async unlink(path2) { - return this.adapter.remove(path2); - } - async lstat(path2) { - return this.stat(path2); - } - async readlink(path2) { - throw new Error(`readlink of (${path2}) is not implemented.`); - } - async symlink(path2) { - throw new Error(`symlink of (${path2}) is not implemented.`); - } - async saveAndClear() { - if (this.index !== void 0) { - await this.adapter.writeBinary( - this.plugin.gitManager.getVaultPath(this.gitDir + "/index"), - this.index, - { - ctime: this.indexctime, - mtime: this.indexmtime - } - ); - } - this.clearIndex(); - } - clearIndex() { - this.index = void 0; - this.indexctime = void 0; - this.indexmtime = void 0; - } - get gitDir() { - return this.plugin.settings.gitDir || ".git"; - } - maybeLog(text2) { - } -}; - -// src/gitManager/isomorphicGit.ts -var IsomorphicGit = class extends GitManager { - constructor(plugin) { - super(plugin); - this.FILE = 0; - this.HEAD = 1; - this.WORKDIR = 2; - this.STAGE = 3; - // Mapping from statusMatrix to git status codes based off git status --short - // See: https://isomorphic-git.org/docs/en/statusMatrix - this.status_mapping = { - "000": " ", - "003": "AD", - "020": "??", - "022": "A ", - "023": "AM", - "100": "D ", - "101": " D", - "103": "MD", - "110": "DA", - // Technically, two files: first one is deleted "D " and second one is untracked "??" - "111": " ", - "113": "MM", - "120": "DA", - // Same as "110" - "121": " M", - "122": "M ", - "123": "MM" - }; - this.noticeLength = 999999; - this.fs = new MyAdapter(this.app.vault, this.plugin); - } - getRepo() { - return { - fs: this.fs, - dir: this.plugin.settings.basePath, - gitdir: this.plugin.settings.gitDir || void 0, - onAuth: () => { - var _a2, _b; - return { - username: (_a2 = this.plugin.localStorage.getUsername()) != null ? _a2 : void 0, - password: (_b = this.plugin.localStorage.getPassword()) != null ? _b : void 0 - }; - }, - onAuthFailure: async () => { - new import_obsidian7.Notice( - "Authentication failed. Please try with different credentials" - ); - const username = await new GeneralModal({ - placeholder: "Specify your username" - }).open(); - if (username) { - const password = await new GeneralModal({ - placeholder: "Specify your password/personal access token" - }).open(); - if (password) { - this.plugin.localStorage.setUsername(username); - this.plugin.localStorage.setPassword(password); - return { - username, - password - }; - } - } - return { cancel: true }; - }, - http: { - async request({ - url, - method: method2, - headers, - body - }) { - if (body) { - body = await collect2(body); - body = body.buffer; - } - const res = await (0, import_obsidian7.requestUrl)({ - url, - method: method2, - headers, - body, - throw: false - }); - return { - url, - method: method2, - headers: res.headers, - body: [new Uint8Array(res.arrayBuffer)], - statusCode: res.status, - statusMessage: res.status.toString() - }; - } - } - }; - } - async wrapFS(call) { - try { - const res = await call; - await this.fs.saveAndClear(); - return res; - } catch (error) { - await this.fs.saveAndClear(); - throw error; - } - } - async status() { - let notice; - const timeout = window.setTimeout(function() { - notice = new import_obsidian7.Notice( - "This takes longer: Getting status", - this.noticeLength - ); - }, 2e4); - try { - this.plugin.setState(1 /* status */); - const status2 = (await this.wrapFS(isomorphic_git_default.statusMatrix({ ...this.getRepo() }))).map((row) => this.getFileStatusResult(row)); - const changed = status2.filter( - (fileStatus) => fileStatus.working_dir !== " " - ); - const staged = status2.filter( - (fileStatus) => fileStatus.index !== " " && fileStatus.index !== "U" - ); - const conflicted = []; - window.clearTimeout(timeout); - notice == null ? void 0 : notice.hide(); - return { changed, staged, conflicted }; - } catch (error) { - window.clearTimeout(timeout); - notice == null ? void 0 : notice.hide(); - this.plugin.displayError(error); - throw error; - } - } - async commitAll({ - message, - status: status2, - unstagedFiles - }) { - try { - await this.checkAuthorInfo(); - await this.stageAll({ status: status2, unstagedFiles }); - return this.commit(message); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async commit(message) { - try { - await this.checkAuthorInfo(); - this.plugin.setState(4 /* commit */); - const formatMessage = await this.formatCommitMessage(message); - const hadConflict = this.plugin.localStorage.getConflict(); - let parent = void 0; - if (hadConflict) { - const branchInfo = await this.branchInfo(); - parent = [branchInfo.current, branchInfo.tracking]; - } - await this.wrapFS( - isomorphic_git_default.commit({ - ...this.getRepo(), - message: formatMessage, - parent - }) - ); - this.plugin.localStorage.setConflict(false); - return; - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async stage(filepath, relativeToVault) { - const gitPath = this.asRepositoryRelativePath( - filepath, - relativeToVault - ); - let vaultPath; - if (relativeToVault) { - vaultPath = filepath; - } else { - vaultPath = this.getVaultPath(filepath); - } - try { - this.plugin.setState(3 /* add */); - if (await this.app.vault.adapter.exists(vaultPath)) { - await this.wrapFS( - isomorphic_git_default.add({ ...this.getRepo(), filepath: gitPath }) - ); - } else { - await this.wrapFS( - isomorphic_git_default.remove({ ...this.getRepo(), filepath: gitPath }) - ); - } - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async stageAll({ - dir, - status: status2, - unstagedFiles - }) { - try { - if (status2) { - await Promise.all( - status2.changed.map( - (file) => file.working_dir !== "D" ? this.wrapFS( - isomorphic_git_default.add({ - ...this.getRepo(), - filepath: file.path - }) - ) : isomorphic_git_default.remove({ - ...this.getRepo(), - filepath: file.path - }) - ) - ); - } else { - const filesToStage = unstagedFiles != null ? unstagedFiles : await this.getUnstagedFiles(dir != null ? dir : "."); - await Promise.all( - filesToStage.map( - ({ filepath, deleted }) => deleted ? isomorphic_git_default.remove({ ...this.getRepo(), filepath }) : this.wrapFS( - isomorphic_git_default.add({ ...this.getRepo(), filepath }) - ) - ) - ); - } - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async unstage(filepath, relativeToVault) { - try { - this.plugin.setState(3 /* add */); - filepath = this.asRepositoryRelativePath(filepath, relativeToVault); - await this.wrapFS( - isomorphic_git_default.resetIndex({ ...this.getRepo(), filepath }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async unstageAll({ - dir, - status: status2 - }) { - try { - let staged; - if (status2) { - staged = status2.staged.map((file) => file.path); - } else { - const res = await this.getStagedFiles(dir != null ? dir : "."); - staged = res.map(({ filepath }) => filepath); - } - await this.wrapFS( - Promise.all( - staged.map( - (file) => isomorphic_git_default.resetIndex({ ...this.getRepo(), filepath: file }) - ) - ) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async discard(filepath) { - try { - this.plugin.setState(3 /* add */); - await this.wrapFS( - isomorphic_git_default.checkout({ - ...this.getRepo(), - filepaths: [filepath], - force: true - }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async discardAll({ - dir, - status: status2 - }) { - let files = []; - if (status2) { - if (dir != void 0) { - files = status2.changed.filter((file) => file.path.startsWith(dir)).map((file) => file.path); - } else { - files = status2.changed.map((file) => file.path); - } - } else { - files = (await this.getUnstagedFiles(dir)).map( - ({ filepath }) => filepath - ); - } - try { - await this.wrapFS( - isomorphic_git_default.checkout({ - ...this.getRepo(), - filepaths: files, - force: true - }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - getProgressText(action, event) { - let out = `${action} progress:`; - if (event.phase) { - out = `${out} ${event.phase}:`; - } - if (event.loaded) { - out = `${out} ${event.loaded}`; - if (event.total) { - out = `${out} of ${event.total}`; - } - } - return out; - } - resolveRef(ref) { - return this.wrapFS(isomorphic_git_default.resolveRef({ ...this.getRepo(), ref })); - } - async pull() { - const progressNotice = this.showNotice("Initializing pull"); - try { - this.plugin.setState(2 /* pull */); - const localCommit = await this.resolveRef("HEAD"); - await this.fetch(); - const branchInfo = await this.branchInfo(); - await this.checkAuthorInfo(); - const mergeRes = await this.wrapFS( - isomorphic_git_default.merge({ - ...this.getRepo(), - ours: branchInfo.current, - theirs: branchInfo.tracking, - abortOnConflict: false - }) - ); - if (!mergeRes.alreadyMerged) { - await this.wrapFS( - isomorphic_git_default.checkout({ - ...this.getRepo(), - ref: branchInfo.current, - onProgress: (progress) => { - if (progressNotice !== void 0) { - progressNotice.noticeEl.innerText = this.getProgressText("Checkout", progress); - } - }, - remote: branchInfo.remote - }) - ); - } - progressNotice == null ? void 0 : progressNotice.hide(); - const upstreamCommit = await this.resolveRef("HEAD"); - const changedFiles = await this.getFileChangesCount( - localCommit, - upstreamCommit - ); - this.showNotice("Finished pull", false); - return changedFiles.map((file) => ({ - path: file.path, - working_dir: "P", - index: "P", - vault_path: this.getVaultPath(file.path) - })); - } catch (error) { - progressNotice == null ? void 0 : progressNotice.hide(); - if (error instanceof Errors.MergeConflictError) { - this.plugin.handleConflict( - error.data.filepaths.map((file) => this.getVaultPath(file)) - ); - } - this.plugin.displayError(error); - throw error; - } - } - async push() { - if (!await this.canPush()) { - return 0; - } - const progressNotice = this.showNotice("Initializing push"); - try { - this.plugin.setState(1 /* status */); - const status2 = await this.branchInfo(); - const trackingBranch = status2.tracking; - const currentBranch2 = status2.current; - const numChangedFiles = (await this.getFileChangesCount(currentBranch2, trackingBranch)).length; - this.plugin.setState(5 /* push */); - await this.wrapFS( - isomorphic_git_default.push({ - ...this.getRepo(), - onProgress: (progress) => { - if (progressNotice !== void 0) { - progressNotice.noticeEl.innerText = this.getProgressText("Pushing", progress); - } - } - }) - ); - progressNotice == null ? void 0 : progressNotice.hide(); - return numChangedFiles; - } catch (error) { - progressNotice == null ? void 0 : progressNotice.hide(); - this.plugin.displayError(error); - throw error; - } - } - async getUnpushedCommits() { - const status2 = await this.branchInfo(); - const trackingBranch = status2.tracking; - const currentBranch2 = status2.current; - if (trackingBranch == null || currentBranch2 == null) { - return 0; - } - const localCommit = await this.resolveRef(currentBranch2); - const upstreamCommit = await this.resolveRef(trackingBranch); - const changedFiles = await this.getFileChangesCount( - localCommit, - upstreamCommit - ); - return changedFiles.length; - } - async canPush() { - const status2 = await this.branchInfo(); - const trackingBranch = status2.tracking; - const currentBranch2 = status2.current; - const current = await this.resolveRef(currentBranch2); - const tracking = await this.resolveRef(trackingBranch); - return current != tracking; - } - async checkRequirements() { - const headExists = await this.plugin.app.vault.adapter.exists( - `${this.getRepo().dir}/.git/HEAD` - ); - return headExists ? "valid" : "missing-repo"; - } - async branchInfo() { - var _a2, _b; - try { - const current = await isomorphic_git_default.currentBranch(this.getRepo()) || ""; - const branches = await isomorphic_git_default.listBranches(this.getRepo()); - const remote = (_a2 = await this.getConfig(`branch.${current}.remote`)) != null ? _a2 : "origin"; - const trackingBranch = (_b = await this.getConfig(`branch.${current}.merge`)) == null ? void 0 : _b.split("refs/heads")[1]; - const tracking = trackingBranch ? remote + trackingBranch : void 0; - return { - current, - tracking, - branches, - remote - }; - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async getCurrentRemote() { - var _a2; - const current = await isomorphic_git_default.currentBranch(this.getRepo()) || ""; - const remote = (_a2 = await this.getConfig(`branch.${current}.remote`)) != null ? _a2 : "origin"; - return remote; - } - async checkout(branch2, remote) { - try { - return this.wrapFS( - isomorphic_git_default.checkout({ - ...this.getRepo(), - ref: branch2, - force: !!remote, - remote - }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async createBranch(branch2) { - try { - await this.wrapFS( - isomorphic_git_default.branch({ ...this.getRepo(), ref: branch2, checkout: true }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async deleteBranch(branch2) { - try { - await this.wrapFS( - isomorphic_git_default.deleteBranch({ ...this.getRepo(), ref: branch2 }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async branchIsMerged(branch2) { - return true; - } - async init() { - try { - await this.wrapFS(isomorphic_git_default.init(this.getRepo())); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async clone(url, dir, depth) { - const progressNotice = this.showNotice("Initializing clone"); - try { - await this.wrapFS( - isomorphic_git_default.clone({ - ...this.getRepo(), - dir, - url, - depth, - onProgress: (progress) => { - if (progressNotice !== void 0) { - progressNotice.noticeEl.innerText = this.getProgressText("Cloning", progress); - } - } - }) - ); - progressNotice == null ? void 0 : progressNotice.hide(); - } catch (error) { - progressNotice == null ? void 0 : progressNotice.hide(); - this.plugin.displayError(error); - throw error; - } - } - async setConfig(path2, value) { - try { - return this.wrapFS( - isomorphic_git_default.setConfig({ - ...this.getRepo(), - path: path2, - value - }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async getConfig(path2) { - try { - return this.wrapFS( - isomorphic_git_default.getConfig({ - ...this.getRepo(), - path: path2 - }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async fetch(remote) { - const progressNotice = this.showNotice("Initializing fetch"); - try { - const args = { - ...this.getRepo(), - onProgress: (progress) => { - if (progressNotice !== void 0) { - progressNotice.noticeEl.innerText = this.getProgressText("Fetching", progress); - } - }, - remote: remote != null ? remote : await this.getCurrentRemote() - }; - await this.wrapFS(isomorphic_git_default.fetch(args)); - progressNotice == null ? void 0 : progressNotice.hide(); - } catch (error) { - this.plugin.displayError(error); - progressNotice == null ? void 0 : progressNotice.hide(); - throw error; - } - } - async setRemote(name, url) { - try { - await this.wrapFS( - isomorphic_git_default.addRemote({ - ...this.getRepo(), - remote: name, - url, - force: true - }) - ); - } catch (error) { - this.plugin.displayError(error); - throw error; - } - } - async getRemoteBranches(remote) { - let remoteBranches = []; - remoteBranches.push( - ...await this.wrapFS( - isomorphic_git_default.listBranches({ ...this.getRepo(), remote }) - ) - ); - remoteBranches.remove("HEAD"); - remoteBranches = remoteBranches.map((e) => `${remote}/${e}`); - return remoteBranches; - } - async getRemotes() { - return (await this.wrapFS(isomorphic_git_default.listRemotes({ ...this.getRepo() }))).map( - (remoteUrl) => remoteUrl.remote - ); - } - async removeRemote(remoteName) { - await this.wrapFS( - isomorphic_git_default.deleteRemote({ ...this.getRepo(), remote: remoteName }) - ); - } - async getRemoteUrl(remote) { - var _a2; - return (_a2 = (await this.wrapFS(isomorphic_git_default.listRemotes({ ...this.getRepo() }))).filter((item) => item.remote == remote)[0]) == null ? void 0 : _a2.url; - } - async log(_, __ = true, limit) { - const logs = await this.wrapFS( - isomorphic_git_default.log({ ...this.getRepo(), depth: limit }) - ); - return Promise.all( - logs.map(async (log2) => { - const completeMessage = log2.commit.message.split("\n\n"); - return { - message: completeMessage[0], - body: completeMessage.slice(1).join("\n\n"), - date: new Date( - log2.commit.committer.timestamp - ).toDateString(), - diff: { - changed: 0, - files: (await this.getFileChangesCount( - log2.commit.parent.first(), - log2.oid - )).map((item) => { - return { - path: item.path, - status: item.type, - vault_path: this.getVaultPath(item.path), - hash: log2.oid, - binary: void 0 - }; - }) - }, - hash: log2.oid, - refs: [] - }; - }) - ); - } - updateBasePath(basePath) { - this.getRepo().dir = basePath; - } - async updateUpstreamBranch(remoteBranch) { - const [remote, branch2] = splitRemoteBranch(remoteBranch); - const branchInfo = await this.branchInfo(); - await this.setConfig( - `branch.${branchInfo.current}.merge`, - `refs/heads/${branch2}` - ); - await this.setConfig(`branch.${branch2}.remote`, remote); - } - updateGitPath(gitPath) { - return; - } - async getFileChangesCount(commitHash1, commitHash2) { - return this.walkDifference({ - walkers: [ - isomorphic_git_default.TREE({ ref: commitHash1 }), - isomorphic_git_default.TREE({ ref: commitHash2 }) - ] - }); - } - async walkDifference({ - walkers, - dir: base - }) { - const res = await this.wrapFS( - isomorphic_git_default.walk({ - ...this.getRepo(), - trees: walkers, - map: async function(filepath, [A, B]) { - if (!worthWalking2(filepath, base)) { - return null; - } - if (await (A == null ? void 0 : A.type()) === "tree" || await (B == null ? void 0 : B.type()) === "tree") { - return; - } - const Aoid = await (A == null ? void 0 : A.oid()); - const Boid = await (B == null ? void 0 : B.oid()); - let type = "equal"; - if (Aoid !== Boid) { - type = "M"; - } - if (Aoid === void 0) { - type = "A"; - } - if (Boid === void 0) { - type = "D"; - } - if (Aoid === void 0 && Boid === void 0) { - console.log("Something weird happened:"); - console.log(A); - console.log(B); - } - if (type === "equal") { - return; - } - return { - path: filepath, - type - }; - } - }) - ); - return res; - } - async getStagedFiles(dir = ".") { - const res = await this.walkDifference({ - walkers: [isomorphic_git_default.TREE({ ref: "HEAD" }), isomorphic_git_default.STAGE()], - dir - }); - return res.map((file) => { - return { - vault_path: this.getVaultPath(file.path), - filepath: file.path - }; - }); - } - async getUnstagedFiles(base = ".") { - let notice; - const timeout = window.setTimeout(function() { - notice = new import_obsidian7.Notice( - "This takes longer: Getting status", - this.noticeLength - ); - }, 2e4); - try { - const repo = this.getRepo(); - const res = await this.wrapFS( - //Modified from `git.statusMatrix` - isomorphic_git_default.walk({ - ...repo, - trees: [isomorphic_git_default.WORKDIR(), isomorphic_git_default.STAGE()], - map: async function(filepath, [workdir, stage]) { - if (!stage && workdir) { - const isIgnored2 = await isomorphic_git_default.isIgnored({ - ...repo, - filepath - }); - if (isIgnored2) { - return null; - } - } - if (!worthWalking2(filepath, base)) { - return null; - } - const [workdirType, stageType] = await Promise.all([ - workdir && workdir.type(), - stage && stage.type() - ]); - const isBlob = [workdirType, stageType].includes( - "blob" - ); - if ((workdirType === "tree" || workdirType === "special") && !isBlob) - return; - if (stageType === "commit") - return null; - if ((stageType === "tree" || stageType === "special") && !isBlob) - return; - const stageOid = stageType === "blob" ? await stage.oid() : void 0; - let workdirOid; - if (workdirType === "blob" && stageType !== "blob") { - workdirOid = "42"; - } else if (workdirType === "blob") { - workdirOid = await workdir.oid(); - } - if (!workdirOid) { - return { - filepath, - deleted: true - }; - } - if (workdirOid !== stageOid) { - return { - filepath, - deleted: false - }; - } - return null; - } - }) - ); - window.clearTimeout(timeout); - notice == null ? void 0 : notice.hide(); - return res; - } catch (error) { - window.clearTimeout(timeout); - notice == null ? void 0 : notice.hide(); - this.plugin.displayError(error); - throw error; - } - } - async getDiffString(filePath, stagedChanges = false, hash2) { - const vaultPath = this.getVaultPath(filePath); - const map = async (file, [A]) => { - if (filePath == file) { - const oid = await A.oid(); - const contents = await isomorphic_git_default.readBlob({ - ...this.getRepo(), - oid - }); - return contents.blob; - } - }; - if (hash2) { - const commitContent = await readBlob({ - ...this.getRepo(), - filepath: filePath, - oid: hash2 - }).then((headBlob) => new TextDecoder().decode(headBlob.blob)).catch((err) => { - if (err instanceof isomorphic_git_default.Errors.NotFoundError) - return void 0; - throw err; - }); - const commit2 = await isomorphic_git_default.readCommit({ - ...this.getRepo(), - oid: hash2 - }); - const previousContent = await readBlob({ - ...this.getRepo(), - filepath: filePath, - oid: commit2.commit.parent.first() - }).then((headBlob) => new TextDecoder().decode(headBlob.blob)).catch((err) => { - if (err instanceof isomorphic_git_default.Errors.NotFoundError) - return void 0; - throw err; - }); - const diff2 = createPatch( - vaultPath, - previousContent != null ? previousContent : "", - commitContent != null ? commitContent : "" - ); - return diff2; - } - const stagedBlob = (await isomorphic_git_default.walk({ - ...this.getRepo(), - trees: [isomorphic_git_default.STAGE()], - map - })).first(); - const stagedContent = new TextDecoder().decode(stagedBlob); - if (stagedChanges) { - const headContent = await this.resolveRef("HEAD").then( - (oid) => readBlob({ - ...this.getRepo(), - filepath: filePath, - oid - }) - ).then((headBlob) => new TextDecoder().decode(headBlob.blob)).catch((err) => { - if (err instanceof isomorphic_git_default.Errors.NotFoundError) - return void 0; - throw err; - }); - const diff2 = createPatch( - vaultPath, - headContent != null ? headContent : "", - stagedContent - ); - return diff2; - } else { - let workdirContent; - if (await app.vault.adapter.exists(vaultPath)) { - workdirContent = await app.vault.adapter.read(vaultPath); - } else { - workdirContent = ""; - } - const diff2 = createPatch(vaultPath, stagedContent, workdirContent); - return diff2; - } - } - async getLastCommitTime() { - const repo = this.getRepo(); - const oid = await this.resolveRef("HEAD"); - const commit2 = await isomorphic_git_default.readCommit({ ...repo, oid }); - const date = commit2.commit.committer.timestamp; - return new Date(date * 1e3); - } - getFileStatusResult(row) { - const status2 = this.status_mapping[`${row[this.HEAD]}${row[this.WORKDIR]}${row[this.STAGE]}`]; - return { - index: status2[0] == "?" ? "U" : status2[0], - working_dir: status2[1] == "?" ? "U" : status2[1], - path: row[this.FILE], - vault_path: this.getVaultPath(row[this.FILE]) - }; - } - async checkAuthorInfo() { - const name = await this.getConfig("user.name"); - const email = await this.getConfig("user.email"); - if (!name || !email) { - throw "Git author information is not set. Please set it in the settings."; - } - } - showNotice(message, infinity = true) { - if (!this.plugin.settings.disablePopups) { - return new import_obsidian7.Notice( - message, - infinity ? this.noticeLength : void 0 - ); - } - } -}; -function fromValue2(value) { - let queue = [value]; - return { - next() { - return Promise.resolve({ - done: queue.length === 0, - value: queue.pop() - }); - }, - return() { - queue = []; - return {}; - }, - [Symbol.asyncIterator]() { - return this; - } - }; -} -function getIterator2(iterable) { - if (iterable[Symbol.asyncIterator]) { - return iterable[Symbol.asyncIterator](); - } - if (iterable[Symbol.iterator]) { - return iterable[Symbol.iterator](); - } - if (iterable.next) { - return iterable; - } - return fromValue2(iterable); -} -async function forAwait2(iterable, cb) { - const iter = getIterator2(iterable); - while (true) { - const { value, done } = await iter.next(); - if (value) - await cb(value); - if (done) - break; - } - if (iter.return) - iter.return(); -} -async function collect2(iterable) { - let size = 0; - const buffers = []; - await forAwait2(iterable, (value) => { - buffers.push(value); - size += value.byteLength; - }); - const result = new Uint8Array(size); - let nextIndex = 0; - for (const buffer2 of buffers) { - result.set(buffer2, nextIndex); - nextIndex += buffer2.byteLength; - } - return result; -} - -// src/setting/settings.ts -var FORMAT_STRING_REFERENCE_URL = "https://momentjs.com/docs/#/parsing/string-format/"; -var LINE_AUTHOR_FEATURE_WIKI_LINK = "https://publish.obsidian.md/git-doc/Line+Authoring"; -var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab { - constructor() { - super(...arguments); - this.lineAuthorColorSettings = /* @__PURE__ */ new Map(); - } - // narrow type from PluginSettingTab.plugin - get settings() { - return this.plugin.settings; - } - display() { - const { containerEl } = this; - const plugin = this.plugin; - const commitOrBackup = plugin.settings.differentIntervalCommitAndPush ? "commit" : "backup"; - const gitReady = plugin.gitReady; - containerEl.empty(); - containerEl.createEl("h2", { text: "Git Backup settings" }); - if (!gitReady) { - containerEl.createEl("p", { - text: "Git is not ready. When all settings are correct you can configure auto backup, etc." - }); - } - if (gitReady) { - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Automatic" }); - new import_obsidian8.Setting(containerEl).setName("Split automatic commit and push").setDesc("Enable to use separate timer for commit and push").addToggle( - (toggle) => toggle.setValue( - plugin.settings.differentIntervalCommitAndPush - ).onChange((value) => { - plugin.settings.differentIntervalCommitAndPush = value; - plugin.saveSettings(); - plugin.clearAutoBackup(); - plugin.clearAutoPush(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.startAutoBackup( - plugin.settings.autoSaveInterval - ); - } - if (value && plugin.settings.autoPushInterval > 0) { - plugin.startAutoPush( - plugin.settings.autoPushInterval - ); - } - this.display(); - }) - ); - new import_obsidian8.Setting(containerEl).setName(`Vault ${commitOrBackup} interval (minutes)`).setDesc( - `${plugin.settings.differentIntervalCommitAndPush ? "Commit" : "Commit and push"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)` - ).addText( - (text2) => text2.setValue(String(plugin.settings.autoSaveInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoSaveInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.clearAutoBackup(); - plugin.startAutoBackup( - plugin.settings.autoSaveInterval - ); - new import_obsidian8.Notice( - `Automatic ${commitOrBackup} enabled! Every ${formatMinutes( - plugin.settings.autoSaveInterval - )}.` - ); - } else if (plugin.settings.autoSaveInterval <= 0) { - plugin.clearAutoBackup() && new import_obsidian8.Notice( - `Automatic ${commitOrBackup} disabled!` - ); - } - } else { - new import_obsidian8.Notice("Please specify a valid number."); - } - }) - ); - if (!plugin.settings.setLastSaveToLastCommit) - new import_obsidian8.Setting(containerEl).setName(`Auto Backup after stopping file edits`).setDesc( - `Requires the ${commitOrBackup} interval not to be 0. - If turned on, do auto ${commitOrBackup} every ${formatMinutes( - plugin.settings.autoSaveInterval - )} after stopping file edits. - This also prevents auto ${commitOrBackup} while editing a file. If turned off, it's independent from the last change.` - ).addToggle( - (toggle) => toggle.setValue(plugin.settings.autoBackupAfterFileChange).onChange((value) => { - plugin.settings.autoBackupAfterFileChange = value; - this.display(); - plugin.saveSettings(); - plugin.clearAutoBackup(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.startAutoBackup( - plugin.settings.autoSaveInterval - ); - } - }) - ); - if (!plugin.settings.autoBackupAfterFileChange) - new import_obsidian8.Setting(containerEl).setName(`Auto ${commitOrBackup} after latest commit`).setDesc( - `If turned on, set last auto ${commitOrBackup} time to latest commit` - ).addToggle( - (toggle) => toggle.setValue(plugin.settings.setLastSaveToLastCommit).onChange(async (value) => { - plugin.settings.setLastSaveToLastCommit = value; - plugin.saveSettings(); - this.display(); - plugin.clearAutoBackup(); - await plugin.setUpAutoBackup(); - }) - ); - if (plugin.settings.differentIntervalCommitAndPush) { - new import_obsidian8.Setting(containerEl).setName(`Vault push interval (minutes)`).setDesc( - "Push changes every X minutes. Set to 0 (default) to disable." - ).addText( - (text2) => text2.setValue(String(plugin.settings.autoPushInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoPushInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoPushInterval > 0) { - plugin.clearAutoPush(); - plugin.startAutoPush( - plugin.settings.autoPushInterval - ); - new import_obsidian8.Notice( - `Automatic push enabled! Every ${formatMinutes( - plugin.settings.autoPushInterval - )}.` - ); - } else if (plugin.settings.autoPushInterval <= 0) { - plugin.clearAutoPush() && new import_obsidian8.Notice( - "Automatic push disabled!" - ); - } - } else { - new import_obsidian8.Notice( - "Please specify a valid number." - ); - } - }) - ); - } - new import_obsidian8.Setting(containerEl).setName("Auto pull interval (minutes)").setDesc( - "Pull changes every X minutes. Set to 0 (default) to disable." - ).addText( - (text2) => text2.setValue(String(plugin.settings.autoPullInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoPullInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoPullInterval > 0) { - plugin.clearAutoPull(); - plugin.startAutoPull( - plugin.settings.autoPullInterval - ); - new import_obsidian8.Notice( - `Automatic pull enabled! Every ${formatMinutes( - plugin.settings.autoPullInterval - )}.` - ); - } else if (plugin.settings.autoPullInterval <= 0) { - plugin.clearAutoPull() && new import_obsidian8.Notice("Automatic pull disabled!"); - } - } else { - new import_obsidian8.Notice("Please specify a valid number."); - } - }) - ); - new import_obsidian8.Setting(containerEl).setName("Specify custom commit message on auto backup").setDesc("You will get a pop up to specify your message").addToggle( - (toggle) => toggle.setValue(plugin.settings.customMessageOnAutoBackup).onChange((value) => { - plugin.settings.customMessageOnAutoBackup = value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Commit message on auto backup/commit").setDesc( - "Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message)" - ).addTextArea( - (text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.autoCommitMessage).onChange((value) => { - plugin.settings.autoCommitMessage = value; - plugin.saveSettings(); - }) - ); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Commit message" }); - new import_obsidian8.Setting(containerEl).setName("Commit message on manual backup/commit").setDesc( - "Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message)" - ).addTextArea( - (text2) => text2.setPlaceholder("vault backup: {{date}}").setValue( - plugin.settings.commitMessage ? plugin.settings.commitMessage : "" - ).onChange((value) => { - plugin.settings.commitMessage = value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("{{date}} placeholder format").setDesc( - `Specify custom date format. E.g. "${DATE_TIME_FORMAT_SECONDS}"` - ).addText( - (text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange(async (value) => { - plugin.settings.commitDateFormat = value; - await plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText( - (text2) => { - var _a2; - return text2.setValue((_a2 = plugin.localStorage.getHostname()) != null ? _a2 : "").onChange(async (value) => { - plugin.localStorage.setHostname(value); - }); - } - ); - new import_obsidian8.Setting(containerEl).setName("Preview commit message").addButton( - (button) => button.setButtonText("Preview").onClick(async () => { - const commitMessagePreview = await plugin.gitManager.formatCommitMessage( - plugin.settings.commitMessage - ); - new import_obsidian8.Notice(`${commitMessagePreview}`); - }) - ); - new import_obsidian8.Setting(containerEl).setName("List filenames affected by commit in the commit body").addToggle( - (toggle) => toggle.setValue(plugin.settings.listChangedFilesInMessageBody).onChange((value) => { - plugin.settings.listChangedFilesInMessageBody = value; - plugin.saveSettings(); - }) - ); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Backup" }); - if (plugin.gitManager instanceof SimpleGit) - new import_obsidian8.Setting(containerEl).setName("Sync Method").setDesc( - "Selects the method used for handling new changes found in your remote git repository." - ).addDropdown((dropdown) => { - const options = { - merge: "Merge", - rebase: "Rebase", - reset: "Other sync service (Only updates the HEAD without touching the working directory)" - }; - dropdown.addOptions(options); - dropdown.setValue(plugin.settings.syncMethod); - dropdown.onChange(async (option) => { - plugin.settings.syncMethod = option; - plugin.saveSettings(); - }); - }); - new import_obsidian8.Setting(containerEl).setName("Pull updates on startup").setDesc("Automatically pull updates when Obsidian starts").addToggle( - (toggle) => toggle.setValue(plugin.settings.autoPullOnBoot).onChange((value) => { - plugin.settings.autoPullOnBoot = value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Push on backup").setDesc("Disable to only commit changes").addToggle( - (toggle) => toggle.setValue(!plugin.settings.disablePush).onChange((value) => { - plugin.settings.disablePush = !value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Pull changes before push").setDesc("Commit -> pull -> push (Only if pushing is enabled)").addToggle( - (toggle) => toggle.setValue(plugin.settings.pullBeforePush).onChange((value) => { - plugin.settings.pullBeforePush = value; - plugin.saveSettings(); - }) - ); - if (plugin.gitManager instanceof SimpleGit) { - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Line author information" }); - this.addLineAuthorInfoSettings(); - } - } - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Miscellaneous" }); - new import_obsidian8.Setting(containerEl).setName( - "Automatically refresh Source Control View on file changes" - ).setDesc( - "On slower machines this may cause lags. If so, just disable this option" - ).addToggle( - (toggle) => toggle.setValue(plugin.settings.refreshSourceControl).onChange((value) => { - plugin.settings.refreshSourceControl = value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Source Control View refresh interval").setDesc( - "Milliseconds to wait after file change before refreshing the Source Control View" - ).addText( - (toggle) => toggle.setValue( - plugin.settings.refreshSourceControlTimer.toString() - ).setPlaceholder("7000").onChange((value) => { - plugin.settings.refreshSourceControlTimer = Math.max( - parseInt(value), - 500 - ); - plugin.saveSettings(); - plugin.setRefreshDebouncer(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Disable notifications").setDesc( - "Disable notifications for git operations to minimize distraction (refer to status bar for updates). Errors are still shown as notifications even if you enable this setting" - ).addToggle( - (toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => { - plugin.settings.disablePopups = value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Show status bar").setDesc( - "Obsidian must be restarted for the changes to take affect" - ).addToggle( - (toggle) => toggle.setValue(plugin.settings.showStatusBar).onChange((value) => { - plugin.settings.showStatusBar = value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Show stage/unstage button in file menu").addToggle( - (toggle) => toggle.setValue(plugin.settings.showFileMenu).onChange((value) => { - plugin.settings.showFileMenu = value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Show branch status bar").setDesc( - "Obsidian must be restarted for the changes to take affect" - ).addToggle( - (toggle) => toggle.setValue(plugin.settings.showBranchStatusBar).onChange((value) => { - plugin.settings.showBranchStatusBar = value; - plugin.saveSettings(); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Show the count of modified files in the status bar").addToggle( - (toggle) => toggle.setValue(plugin.settings.changedFilesInStatusBar).onChange((value) => { - plugin.settings.changedFilesInStatusBar = value; - plugin.saveSettings(); - }) - ); - containerEl.createEl("br"); - if (plugin.gitManager instanceof IsomorphicGit) { - containerEl.createEl("h3", { - text: "Authentication/Commit Author" - }); - } else { - containerEl.createEl("h3", { text: "Commit Author" }); - } - if (plugin.gitManager instanceof IsomorphicGit) - new import_obsidian8.Setting(containerEl).setName( - "Username on your git server. E.g. your username on GitHub" - ).addText((cb) => { - var _a2; - cb.setValue((_a2 = plugin.localStorage.getUsername()) != null ? _a2 : ""); - cb.onChange((value) => { - plugin.localStorage.setUsername(value); - }); - }); - if (plugin.gitManager instanceof IsomorphicGit) - new import_obsidian8.Setting(containerEl).setName("Password/Personal access token").setDesc( - "Type in your password. You won't be able to see it again." - ).addText((cb) => { - cb.inputEl.autocapitalize = "off"; - cb.inputEl.autocomplete = "off"; - cb.inputEl.spellcheck = false; - cb.onChange((value) => { - plugin.localStorage.setPassword(value); - }); - }); - if (plugin.gitReady) - new import_obsidian8.Setting(containerEl).setName("Author name for commit").addText(async (cb) => { - cb.setValue(await plugin.gitManager.getConfig("user.name")); - cb.onChange((value) => { - plugin.gitManager.setConfig( - "user.name", - value == "" ? void 0 : value - ); - }); - }); - if (plugin.gitReady) - new import_obsidian8.Setting(containerEl).setName("Author email for commit").addText(async (cb) => { - cb.setValue( - await plugin.gitManager.getConfig("user.email") - ); - cb.onChange((value) => { - plugin.gitManager.setConfig( - "user.email", - value == "" ? void 0 : value - ); - }); - }); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Advanced" }); - if (plugin.gitManager instanceof SimpleGit) { - new import_obsidian8.Setting(containerEl).setName("Update submodules").setDesc( - '"Create backup" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule' - ).addToggle( - (toggle) => toggle.setValue(plugin.settings.updateSubmodules).onChange((value) => { - plugin.settings.updateSubmodules = value; - plugin.saveSettings(); - }) - ); - if (plugin.settings.updateSubmodules) { - new import_obsidian8.Setting(containerEl).setName("Submodule recurse checkout/switch").setDesc( - "Whenever a checkout happens on the root repository, recurse the checkout on the submodules (if the branches exist)." - ).addToggle( - (toggle) => toggle.setValue(plugin.settings.submoduleRecurseCheckout).onChange((value) => { - plugin.settings.submoduleRecurseCheckout = value; - plugin.saveSettings(); - }) - ); - } - } - if (plugin.gitManager instanceof SimpleGit) - new import_obsidian8.Setting(containerEl).setName("Custom Git binary path").addText((cb) => { - var _a2; - cb.setValue((_a2 = plugin.localStorage.getGitPath()) != null ? _a2 : ""); - cb.setPlaceholder("git"); - cb.onChange((value) => { - plugin.localStorage.setGitPath(value); - plugin.gitManager.updateGitPath(value || "git"); - }); - }); - if (plugin.gitManager instanceof SimpleGit) - new import_obsidian8.Setting(containerEl).setName("Additional environment variables").setDesc( - "Use each line for a new environment variable in the format KEY=VALUE" - ).addTextArea((cb) => { - cb.setPlaceholder("GIT_DIR=/path/to/git/dir"); - cb.setValue(plugin.localStorage.getEnvVars().join("\n")); - cb.onChange((value) => { - plugin.localStorage.setEnvVars(value.split("\n")); - }); - }); - if (plugin.gitManager instanceof SimpleGit) - new import_obsidian8.Setting(containerEl).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea((cb) => { - cb.setValue(plugin.localStorage.getPATHPaths().join("\n")); - cb.onChange((value) => { - plugin.localStorage.setPATHPaths(value.split("\n")); - }); - }); - if (plugin.gitManager instanceof SimpleGit) - new import_obsidian8.Setting(containerEl).setName("Reload with new environment variables").setDesc( - "Removing previously added environment variables will not take effect until Obsidian is restarted." - ).addButton((cb) => { - cb.setButtonText("Reload"); - cb.setCta(); - cb.onClick(() => { - plugin.gitManager.setGitInstance(); - }); - }); - new import_obsidian8.Setting(containerEl).setName("Custom base path (Git repository path)").setDesc( - ` +`),date:new Date(s.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChangesCount(s.commit.parent.first(),s.oid)).map(l=>({path:l.path,status:l.type,vault_path:this.getRelativeVaultPath(l.path),hash:s.oid,binary:void 0}))},hash:s.oid,refs:[]}}))}updateBasePath(n){return this.getRepo().dir=n,Promise.resolve()}async updateUpstreamBranch(n){let[r,i]=wr(n),a=await this.branchInfo();await this.setConfig(`branch.${a.current}.merge`,`refs/heads/${i}`),await this.setConfig(`branch.${i}.remote`,r)}updateGitPath(n){return Promise.resolve()}async getFileChangesCount(n,r){return this.walkDifference({walkers:[ae.TREE({ref:n}),ae.TREE({ref:r})]})}async walkDifference({walkers:n,dir:r}){return await this.wrapFS(ae.walk({...this.getRepo(),trees:n,map:async function(a,[s,o]){if(!ip(a,r))return null;if(await(s==null?void 0:s.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(s==null?void 0:s.oid()),c=await(o==null?void 0:o.oid()),u="equal";if(l!==c&&(u="M"),l===void 0&&(u="A"),c===void 0&&(u="D"),l===void 0&&c===void 0&&(console.log("Something weird happened:"),console.log(s),console.log(o)),u!=="equal")return{path:a,type:u}}}))}async getStagedFiles(n="."){return(await this.walkDifference({walkers:[ae.TREE({ref:"HEAD"}),ae.STAGE()],dir:n})).map(i=>({vault_path:this.getRelativeVaultPath(i.path),filepath:i.path}))}async getUnstagedFiles(n="."){let r,i=window.setTimeout(()=>{r=new Qr.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let a=this.getRepo(),s=await this.wrapFS(ae.walk({...a,trees:[ae.WORKDIR(),ae.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await ae.isIgnored({...a,filepath:o})||!ip(o,n))return null;let[u,f]=await Promise.all([l&&l.type(),c&&c.type()]),h=[u,f].includes("blob");if((u==="tree"||u==="special")&&!h)return;if(f==="commit")return null;if((f==="tree"||f==="special")&&!h)return;let d=f==="blob"?await c.oid():void 0,p;return u==="blob"&&f!=="blob"?p="42":u==="blob"&&(p=await l.oid()),p?p!==d?{filepath:o,deleted:!1}:null:{filepath:o,deleted:!0}}}));return window.clearTimeout(i),r==null||r.hide(),s}catch(a){throw window.clearTimeout(i),r==null||r.hide(),this.plugin.displayError(a),a}}async getDiffString(n,r=!1,i){let a=this.getRelativeVaultPath(n),s=async(c,[u])=>{if(n==c){let f=await u.oid();return(await ae.readBlob({...this.getRepo(),oid:f})).blob}};if(i){let c=await ms({...this.getRepo(),filepath:n,oid:i}).then(d=>new TextDecoder().decode(d.blob)).catch(d=>{if(!(d instanceof ae.Errors.NotFoundError))throw d}),u=await ae.readCommit({...this.getRepo(),oid:i}),f=await ms({...this.getRepo(),filepath:n,oid:u.commit.parent.first()}).then(d=>new TextDecoder().decode(d.blob)).catch(d=>{if(!(d instanceof ae.Errors.NotFoundError))throw d});return vc(a,f!=null?f:"",c!=null?c:"")}let o=(await ae.walk({...this.getRepo(),trees:[ae.STAGE()],map:s})).first(),l=new TextDecoder().decode(o);if(r){let c=await this.resolveRef("HEAD").then(f=>ms({...this.getRepo(),filepath:n,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof ae.Errors.NotFoundError))throw f});return vc(a,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(a)?c=await this.app.vault.adapter.read(a):c="",vc(a,l,c)}}async getLastCommitTime(){let n=this.getRepo(),r=await this.resolveRef("HEAD"),a=(await ae.readCommit({...n,oid:r})).commit.committer.timestamp;return new Date(a*1e3)}getFileStatusResult(n){let r=this.status_mapping[`${n[this.HEAD]}${n[this.WORKDIR]}${n[this.STAGE]}`];return{index:r[0]=="?"?"U":r[0],working_dir:r[1]=="?"?"U":r[1],path:n[this.FILE],vault_path:this.getRelativeVaultPath(n[this.FILE])}}async checkAuthorInfo(){let n=await this.getConfig("user.name"),r=await this.getConfig("user.email");if(!n||!r)throw Error("Git author information is not set. Please set it in the settings.")}showNotice(n,r=!0){if(!this.plugin.settings.disablePopups)return new Qr.Notice(n,r?this.noticeLength:void 0)}};function iL(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function aL(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:iL(t)}async function sL(t,e){let n=aL(t);for(;;){let{value:r,done:i}=await n.next();if(r&&await e(r),i)break}n.return&&n.return()}async function oL(t){let e=0,n=[];await sL(t,a=>{n.push(a),e+=a.byteLength});let r=new Uint8Array(e),i=0;for(let a of n)r.set(a,i),i+=a.byteLength;return r}var lL="https://momentjs.com/docs/#/parsing/string-format/",cL="https://publish.obsidian.md/git-doc/Line+Authoring",bc=class extends V.PluginSettingTab{constructor(n,r){super(n,r);this.plugin=r;this.lineAuthorColorSettings=new Map}get settings(){return this.plugin.settings}display(){let{containerEl:n}=this,r=this.plugin,i;r.settings.differentIntervalCommitAndPush?i="commit":i="commit-and-sync";let a=r.gitReady;n.empty(),a||(n.createEl("p",{text:"Git is not ready. When all settings are correct you can configure commit-sync, etc."}),n.createEl("br"));let s;if(a){new V.Setting(n).setName("Automatic").setHeading(),new V.Setting(n).setName("Split timers for automatic commit and sync").setDesc("Enable to use one interval for commit and another for sync.").addToggle(u=>u.setValue(r.settings.differentIntervalCommitAndPush).onChange(async f=>{r.settings.differentIntervalCommitAndPush=f,await r.saveSettings(),r.automaticsManager.reload("commit","push"),this.display()})),new V.Setting(n).setName(`Auto ${i} interval (minutes)`).setDesc(`${r.settings.differentIntervalCommitAndPush?"Commit":"Commit and sync"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText(u=>u.setValue(String(r.settings.autoSaveInterval)).onChange(async f=>{isNaN(Number(f))?new V.Notice("Please specify a valid number."):(r.settings.autoSaveInterval=Number(f),await r.saveSettings(),r.automaticsManager.reload("commit"),r.settings.autoSaveInterval>0?new V.Notice(`Automatic ${i} enabled! Every ${$s(r.settings.autoSaveInterval)}.`):r.settings.autoSaveInterval<=0&&new V.Notice(`Automatic ${i} disabled!`))})),s=new V.Setting(n).setName(`Auto ${i} after stopping file edits`).setDesc(`Requires the ${i} interval not to be 0. + If turned on, do auto ${i} every ${$s(r.settings.autoSaveInterval)} after stopping file edits. + This also prevents auto ${i} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(u=>u.setValue(r.settings.autoBackupAfterFileChange).onChange(async f=>{r.settings.autoBackupAfterFileChange=f,this.display(),await r.saveSettings(),r.automaticsManager.reload("commit")})),this.mayDisableSetting(s,r.settings.setLastSaveToLastCommit),s=new V.Setting(n).setName(`Auto ${i} after latest commit`).setDesc(`If turned on, sets last auto ${i} timestamp to the latest commit timestamp. This reduces the frequency of auto ${i} when doing manual commits.`).addToggle(u=>u.setValue(r.settings.setLastSaveToLastCommit).onChange(async f=>{r.settings.setLastSaveToLastCommit=f,await r.saveSettings(),r.automaticsManager.reload("commit"),this.display()})),this.mayDisableSetting(s,r.settings.autoBackupAfterFileChange),s=new V.Setting(n).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(u=>u.setValue(String(r.settings.autoPushInterval)).onChange(async f=>{isNaN(Number(f))?new V.Notice("Please specify a valid number."):(r.settings.autoPushInterval=Number(f),await r.saveSettings(),r.settings.autoPushInterval>0?(r.automaticsManager.reload("push"),new V.Notice(`Automatic push enabled! Every ${$s(r.settings.autoPushInterval)}.`)):r.settings.autoPushInterval<=0&&new V.Notice("Automatic push disabled!"))})),this.mayDisableSetting(s,!r.settings.differentIntervalCommitAndPush),new V.Setting(n).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(u=>u.setValue(String(r.settings.autoPullInterval)).onChange(async f=>{isNaN(Number(f))?new V.Notice("Please specify a valid number."):(r.settings.autoPullInterval=Number(f),await r.saveSettings(),r.settings.autoPullInterval>0?(r.automaticsManager.reload("pull"),new V.Notice(`Automatic pull enabled! Every ${$s(r.settings.autoPullInterval)}.`)):r.settings.autoPullInterval<=0&&new V.Notice("Automatic pull disabled!"))})),new V.Setting(n).setName(`Specify custom commit message on auto ${i}`).setDesc("You will get a pop up to specify your message.").addToggle(u=>u.setValue(r.settings.customMessageOnAutoBackup).onChange(async f=>{r.settings.customMessageOnAutoBackup=f,await r.saveSettings(),this.display()})),s=new V.Setting(n).setName(`Commit message on auto ${i}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(u=>u.setPlaceholder("vault backup: {{date}}").setValue(r.settings.autoCommitMessage).onChange(async f=>{r.settings.autoCommitMessage=f,await r.saveSettings()})),this.mayDisableSetting(s,r.settings.customMessageOnAutoBackup),new V.Setting(n).setName("Commit message").setHeading(),new V.Setting(n).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(u=>u.setPlaceholder("vault backup: {{date}}").setValue(r.settings.commitMessage?r.settings.commitMessage:"").onChange(async f=>{r.settings.commitMessage=f,await r.saveSettings()}));let c=new V.Setting(n).setName("{{date}} placeholder format").addMomentFormat(u=>u.setDefaultFormat(r.settings.commitDateFormat).setValue(r.settings.commitDateFormat).onChange(async f=>{r.settings.commitDateFormat=f,await r.saveSettings()}));c.descEl.innerHTML=` + Specify custom date format. E.g. "${Dh}. See Moment.js for more formats.`,new V.Setting(n).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText(u=>{var f;return u.setValue((f=r.localStorage.getHostname())!=null?f:"").onChange(h=>{r.localStorage.setHostname(h)})}),new V.Setting(n).setName("Preview commit message").addButton(u=>u.setButtonText("Preview").onClick(async()=>{let f=await r.gitManager.formatCommitMessage(r.settings.commitMessage);new V.Notice(`${f}`)})),new V.Setting(n).setName("List filenames affected by commit in the commit body").addToggle(u=>u.setValue(r.settings.listChangedFilesInMessageBody).onChange(async f=>{r.settings.listChangedFilesInMessageBody=f,await r.saveSettings()})),new V.Setting(n).setName("Pull").setHeading(),r.gitManager instanceof Le&&new V.Setting(n).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(u=>{let f={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};u.addOptions(f),u.setValue(r.settings.syncMethod),u.onChange(async h=>{r.settings.syncMethod=h,await r.saveSettings()})}),new V.Setting(n).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(u=>u.setValue(r.settings.autoPullOnBoot).onChange(async f=>{r.settings.autoPullOnBoot=f,await r.saveSettings()})),new V.Setting(n).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),s=new V.Setting(n).setName("Push on commit-and-sync").setDesc(`Most of the time you want to push after committing. Turning this off turns a commit-and-sync action into commit ${r.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(u=>u.setValue(!r.settings.disablePush).onChange(async f=>{r.settings.disablePush=!f,this.display(),await r.saveSettings()})),new V.Setting(n).setName("Pull on commit-and-sync").setDesc(`On commit-and-sync, pull commits as well. Turning this off turns a commit-and-sync action into commit ${r.settings.disablePush?"":"and push "}only.`).addToggle(u=>u.setValue(r.settings.pullBeforePush).onChange(async f=>{r.settings.pullBeforePush=f,this.display(),await r.saveSettings()})),r.gitManager instanceof Le&&(new V.Setting(n).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new V.Setting(n).setName("History view").setHeading(),new V.Setting(n).setName("Show Author").setDesc("Show the author of the commit in the history view.").addDropdown(c=>{let u={hide:"Hide",full:"Full",initials:"Initials"};c.addOptions(u),c.setValue(r.settings.authorInHistoryView),c.onChange(async f=>{r.settings.authorInHistoryView=f,await r.saveSettings(),await r.refresh()})}),new V.Setting(n).setName("Show Date").setDesc("Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date.").addToggle(c=>c.setValue(r.settings.dateInHistoryView).onChange(async u=>{r.settings.dateInHistoryView=u,await r.saveSettings(),await r.refresh()})),new V.Setting(n).setName("Source control view").setHeading(),new V.Setting(n).setName("Automatically refresh source control view on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option.").addToggle(c=>c.setValue(r.settings.refreshSourceControl).onChange(async u=>{r.settings.refreshSourceControl=u,await r.saveSettings()})),new V.Setting(n).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>c.setValue(r.settings.refreshSourceControlTimer.toString()).setPlaceholder("7000").onChange(async u=>{r.settings.refreshSourceControlTimer=Math.max(parseInt(u),500),await r.saveSettings(),r.setRefreshDebouncer()})),new V.Setting(n).setName("Miscellaneous").setHeading(),new V.Setting(n).setName("Disable notifications").setDesc("Disable notifications for git operations to minimize distraction (refer to status bar for updates). Errors are still shown as notifications even if you enable this setting.").addToggle(c=>c.setValue(r.settings.disablePopups).onChange(async u=>{r.settings.disablePopups=u,this.display(),await r.saveSettings()})),r.settings.disablePopups||new V.Setting(n).setName("Hide notifications for no changes").setDesc("Don't show notifications when there are no changes to commit or push.").addToggle(c=>c.setValue(r.settings.disablePopupsForNoChanges).onChange(async u=>{r.settings.disablePopupsForNoChanges=u,await r.saveSettings()})),new V.Setting(n).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(r.settings.showStatusBar).onChange(async u=>{r.settings.showStatusBar=u,await r.saveSettings()})),new V.Setting(n).setName("Show stage/unstage button in file menu").addToggle(c=>c.setValue(r.settings.showFileMenu).onChange(async u=>{r.settings.showFileMenu=u,await r.saveSettings()})),new V.Setting(n).setName("Show branch status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(r.settings.showBranchStatusBar).onChange(async u=>{r.settings.showBranchStatusBar=u,await r.saveSettings()})),new V.Setting(n).setName("Show the count of modified files in the status bar").addToggle(c=>c.setValue(r.settings.changedFilesInStatusBar).onChange(async u=>{r.settings.changedFilesInStatusBar=u,await r.saveSettings()})),r.gitManager instanceof yn?new V.Setting(n).setName("Authentication/commit author").setHeading():new V.Setting(n).setName("Commit author").setHeading(),r.gitManager instanceof yn&&new V.Setting(n).setName("Username on your git server. E.g. your username on GitHub").addText(c=>{var u;c.setValue((u=r.localStorage.getUsername())!=null?u:""),c.onChange(f=>{r.localStorage.setUsername(f)})}),r.gitManager instanceof yn&&new V.Setting(n).setName("Password/Personal access token").setDesc("Type in your password. You won't be able to see it again.").addText(c=>{c.inputEl.autocapitalize="off",c.inputEl.autocomplete="off",c.inputEl.spellcheck=!1,c.onChange(u=>{r.localStorage.setPassword(u)})}),r.gitReady&&new V.Setting(n).setName("Author name for commit").addText(async c=>{c.setValue(await r.gitManager.getConfig("user.name")),c.onChange(async u=>{await r.gitManager.setConfig("user.name",u==""?void 0:u)})}),r.gitReady&&new V.Setting(n).setName("Author email for commit").addText(async c=>{c.setValue(await r.gitManager.getConfig("user.email")),c.onChange(async u=>{await r.gitManager.setConfig("user.email",u==""?void 0:u)})}),new V.Setting(n).setName("Advanced").setDesc("These settings usually don't need to be changed, but may be requried for special setups.").setHeading(),r.gitManager instanceof Le&&(new V.Setting(n).setName("Update submodules").setDesc('"Commit-and-sync" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule.').addToggle(c=>c.setValue(r.settings.updateSubmodules).onChange(async u=>{r.settings.updateSubmodules=u,await r.saveSettings()})),r.settings.updateSubmodules&&new V.Setting(n).setName("Submodule recurse checkout/switch").setDesc("Whenever a checkout happens on the root repository, recurse the checkout on the submodules (if the branches exist).").addToggle(c=>c.setValue(r.settings.submoduleRecurseCheckout).onChange(async u=>{r.settings.submoduleRecurseCheckout=u,await r.saveSettings()}))),r.gitManager instanceof Le&&new V.Setting(n).setName("Custom Git binary path").addText(c=>{var u;c.setValue((u=r.localStorage.getGitPath())!=null?u:""),c.setPlaceholder("git"),c.onChange(f=>{r.localStorage.setGitPath(f),r.gitManager.updateGitPath(f||"git").catch(h=>r.displayError(h))})}),r.gitManager instanceof Le&&new V.Setting(n).setName("Additional environment variables").setDesc("Use each line for a new environment variable in the format KEY=VALUE .").addTextArea(c=>{c.setPlaceholder("GIT_DIR=/path/to/git/dir"),c.setValue(r.localStorage.getEnvVars().join(` +`)),c.onChange(u=>{r.localStorage.setEnvVars(u.split(` +`))})}),r.gitManager instanceof Le&&new V.Setting(n).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(r.localStorage.getPATHPaths().join(` +`)),c.onChange(u=>{r.localStorage.setPATHPaths(u.split(` +`))})}),r.gitManager instanceof Le&&new V.Setting(n).setName("Reload with new environment variables").setDesc("Removing previously added environment variables will not take effect until Obsidian is restarted.").addButton(c=>{c.setButtonText("Reload"),c.setCta(),c.onClick(async()=>{await r.gitManager.setGitInstance()})}),new V.Setting(n).setName("Custom base path (Git repository path)").setDesc(` Sets the relative path to the vault from which the Git binary should be executed. Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows. - ` - ).addText((cb) => { - cb.setValue(plugin.settings.basePath); - cb.setPlaceholder("directory/directory-with-git-repo"); - cb.onChange((value) => { - plugin.settings.basePath = value; - plugin.saveSettings(); - plugin.gitManager.updateBasePath(value || ""); - }); - }); - new import_obsidian8.Setting(containerEl).setName("Custom Git directory path (Instead of '.git')").setDesc( - `Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.` - ).addText((cb) => { - cb.setValue(plugin.settings.gitDir); - cb.setPlaceholder(".git"); - cb.onChange((value) => { - plugin.settings.gitDir = value; - plugin.saveSettings(); - }); - }); - new import_obsidian8.Setting(containerEl).setName("Disable on this device").addToggle( - (toggle) => toggle.setValue(plugin.localStorage.getPluginDisabled()).onChange((value) => { - plugin.localStorage.setPluginDisabled(value); - if (value) { - plugin.unloadPlugin(); - } else { - plugin.loadPlugin(); - } - new import_obsidian8.Notice( - "Obsidian must be restarted for the changes to take affect" - ); - }) - ); - new import_obsidian8.Setting(containerEl).setName("Donate").setDesc( - "If you like this Plugin, consider donating to support continued development." - ).addButton((bt) => { - bt.buttonEl.outerHTML = "Buy Me a Coffee at ko-fi.com"; - }); - const info = containerEl.createDiv(); - info.setAttr("align", "center"); - info.setText( - "Debugging and logging:\nYou can always see the logs of this and every other plugin by opening the console with" - ); - const keys = containerEl.createDiv(); - keys.setAttr("align", "center"); - keys.addClass("obsidian-git-shortcuts"); - if (import_obsidian8.Platform.isMacOS === true) { - keys.createEl("kbd", { text: "CMD (\u2318) + OPTION (\u2325) + I" }); - } else { - keys.createEl("kbd", { text: "CTRL + SHIFT + I" }); - } - } - configureLineAuthorShowStatus(show) { - this.settings.lineAuthor.show = show; - this.plugin.saveSettings(); - if (show) - this.plugin.lineAuthoringFeature.activateFeature(); - else - this.plugin.lineAuthoringFeature.deactivateFeature(); - } - /** - * Persists the setting {@link key} with value {@link value} and - * refreshes the line author info views. - */ - lineAuthorSettingHandler(key2, value) { - this.settings.lineAuthor[key2] = value; - this.plugin.saveSettings(); - this.plugin.lineAuthoringFeature.refreshLineAuthorViews(); - } - /** - * Ensure, that certain last shown values are persisten in the settings. - * - * Necessary for the line author info gutter context menus. - */ - beforeSaveSettings() { - const laSettings = this.settings.lineAuthor; - if (laSettings.authorDisplay !== "hide") { - laSettings.lastShownAuthorDisplay = laSettings.authorDisplay; - } - if (laSettings.dateTimeFormatOptions !== "hide") { - laSettings.lastShownDateTimeFormatOptions = laSettings.dateTimeFormatOptions; - } - } - addLineAuthorInfoSettings() { - const baseLineAuthorInfoSetting = new import_obsidian8.Setting(this.containerEl).setName( - "Show commit authoring information next to each line" - ); - if (!this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform()) { - baseLineAuthorInfoSetting.setDesc("Only available on desktop currently.").setDisabled(true); - } - baseLineAuthorInfoSetting.descEl.innerHTML = ` - Feature guide and quick examples
- The commit hash, author name and authoring date can all be individually toggled.
Hide everything, to only show the age-colored sidebar.`; - baseLineAuthorInfoSetting.addToggle( - (toggle) => toggle.setValue(this.settings.lineAuthor.show).onChange((value) => { - this.configureLineAuthorShowStatus(value); - this.display(); - }) - ); - if (this.settings.lineAuthor.show) { - const trackMovement = new import_obsidian8.Setting(this.containerEl).setName("Follow movement and copies across files and commits").setDesc("").addDropdown((dropdown) => { - dropdown.addOptions({ - inactive: "Do not follow (default)", - "same-commit": "Follow within same commit", - "all-commits": "Follow within all commits (maybe slow)" - }); - dropdown.setValue(this.settings.lineAuthor.followMovement); - dropdown.onChange( - (value) => this.lineAuthorSettingHandler("followMovement", value) - ); - }); - trackMovement.descEl.innerHTML = ` + `).addText(c=>{c.setValue(r.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{r.settings.basePath=u,await r.saveSettings(),r.gitManager.updateBasePath(u||"").catch(f=>r.displayError(f))})}),new V.Setting(n).setName("Custom Git directory path (Instead of '.git')").setDesc('Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(r.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{r.settings.gitDir=u,await r.saveSettings()})}),new V.Setting(n).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(r.localStorage.getPluginDisabled()).onChange(u=>{r.localStorage.setPluginDisabled(u),u?r.unloadPlugin():r.init({fromReload:!0}).catch(f=>r.displayError(f)),new V.Notice("Obsidian must be restarted for the changes to take affect.")})),new V.Setting(n).setName("Support").setHeading(),new V.Setting(n).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{c.buttonEl.outerHTML="Buy Me a Coffee at ko-fi.com"});let o=n.createDiv();o.setAttr("align","center"),o.setAttr("style","margin: var(--size-4-2)");let l=o.createEl("button");if(l.setText("Copy Debug Information"),l.onclick=async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.plugin.settings,pluginVersion:this.plugin.manifest.version},null,4)),new V.Notice("Debug information copied to clipboard. May contain sensitive information!")},V.Platform.isDesktopApp){let c=n.createDiv();c.setAttr("align","center"),c.setText(`Debugging and logging: +You can always see the logs of this and every other plugin by opening the console with`);let u=n.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),V.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(n,r){r&&(n.setDisabled(r),n.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(n){this.settings.lineAuthor.show=n,this.plugin.saveSettings(),n?this.plugin.lineAuthoringFeature.activateFeature():this.plugin.lineAuthoringFeature.deactivateFeature()}async lineAuthorSettingHandler(n,r){this.settings.lineAuthor[n]=r,await this.plugin.saveSettings(),this.plugin.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let n=this.settings.lineAuthor;n.authorDisplay!=="hide"&&(n.lastShownAuthorDisplay=n.authorDisplay),n.dateTimeFormatOptions!=="hide"&&(n.lastShownDateTimeFormatOptions=n.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let n=new V.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform()||n.setDesc("Only available on desktop currently.").setDisabled(!0),n.descEl.innerHTML=` + Feature guide and quick examples
+ The commit hash, author name and authoring date can all be individually toggled.
Hide everything, to only show the age-colored sidebar.`,n.addToggle(r=>r.setValue(this.settings.lineAuthor.show).onChange(i=>{this.configureLineAuthorShowStatus(i),this.display()})),this.settings.lineAuthor.show){let r=new V.Setting(this.containerEl).setName("Follow movement and copies across files and commits").setDesc("").addDropdown(a=>{a.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),a.setValue(this.settings.lineAuthor.followMovement),a.onChange(s=>this.lineAuthorSettingHandler("followMovement",s))});if(r.descEl.innerHTML=` By default (deactivated), each line only shows the newest commit where it was changed.
With same commit, cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown. @@ -32672,119 +148,12 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab { With all commits, cut-copy-paste-ing text inbetween multiple commits will be detected.
It uses git-blame and - for matches (at least ${GIT_LINE_AUTHORING_MOVEMENT_DETECTION_MINIMAL_LENGTH} characters) within the same (or all) commit(s), the originating commit's information is shown.`; - new import_obsidian8.Setting(this.containerEl).setName("Show commit hash").addToggle((tgl) => { - tgl.setValue(this.settings.lineAuthor.showCommitHash); - tgl.onChange( - async (value) => this.lineAuthorSettingHandler("showCommitHash", value) - ); - }); - new import_obsidian8.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown((dropdown) => { - const options = { - hide: "Hide", - initials: "Initials (default)", - "first name": "First name", - "last name": "Last name", - full: "Full name" - }; - dropdown.addOptions(options); - dropdown.setValue(this.settings.lineAuthor.authorDisplay); - dropdown.onChange( - async (value) => this.lineAuthorSettingHandler("authorDisplay", value) - ); - }); - new import_obsidian8.Setting(this.containerEl).setName("Authoring date display").setDesc( - "If and how the date and time of authoring the line is displayed" - ).addDropdown((dropdown) => { - const options = { - hide: "Hide", - date: "Date (default)", - datetime: "Date and time", - "natural language": "Natural language", - custom: "Custom" - }; - dropdown.addOptions(options); - dropdown.setValue( - this.settings.lineAuthor.dateTimeFormatOptions - ); - dropdown.onChange( - async (value) => { - this.lineAuthorSettingHandler( - "dateTimeFormatOptions", - value - ); - this.display(); - } - ); - }); - if (this.settings.lineAuthor.dateTimeFormatOptions === "custom") { - const dateTimeFormatCustomStringSetting = new import_obsidian8.Setting( - this.containerEl - ); - dateTimeFormatCustomStringSetting.setName("Custom authoring date format").addText((cb) => { - cb.setValue( - this.settings.lineAuthor.dateTimeFormatCustomString - ); - cb.setPlaceholder("YYYY-MM-DD HH:mm"); - cb.onChange((value) => { - this.lineAuthorSettingHandler( - "dateTimeFormatCustomString", - value - ); - dateTimeFormatCustomStringSetting.descEl.innerHTML = this.previewCustomDateTimeDescriptionHtml( - value - ); - }); - }); - dateTimeFormatCustomStringSetting.descEl.innerHTML = this.previewCustomDateTimeDescriptionHtml( - this.settings.lineAuthor.dateTimeFormatCustomString - ); - } - new import_obsidian8.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown((dropdown) => { - const options = { - "viewer-local": "My local (default)", - "author-local": "Author's local", - utc0000: "UTC+0000/Z" - }; - dropdown.addOptions(options); - dropdown.setValue( - this.settings.lineAuthor.dateTimeTimezone - ); - dropdown.onChange( - async (value) => this.lineAuthorSettingHandler("dateTimeTimezone", value) - ); - }).descEl.innerHTML = ` + for matches (at least ${Sl} characters) within the same (or all) commit(s), the originating commit's information is shown.`,new V.Setting(this.containerEl).setName("Show commit hash").addToggle(a=>{a.setValue(this.settings.lineAuthor.showCommitHash),a.onChange(s=>this.lineAuthorSettingHandler("showCommitHash",s))}),new V.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(a=>{let s={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};a.addOptions(s),a.setValue(this.settings.lineAuthor.authorDisplay),a.onChange(async o=>this.lineAuthorSettingHandler("authorDisplay",o))}),new V.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(a=>{let s={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};a.addOptions(s),a.setValue(this.settings.lineAuthor.dateTimeFormatOptions),a.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",o),this.display()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let a=new V.Setting(this.containerEl);a.setName("Custom authoring date format").addText(s=>{s.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),s.setPlaceholder("YYYY-MM-DD HH:mm"),s.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",o),a.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(o)})}),a.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(this.settings.lineAuthor.dateTimeFormatCustomString)}new V.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(a=>{let s={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};a.addOptions(s),a.setValue(this.settings.lineAuthor.dateTimeTimezone),a.onChange(async o=>this.lineAuthorSettingHandler("dateTimeTimezone",o))}).descEl.innerHTML=` The time-zone in which the authoring date should be shown. Either your local time-zone (default), the author's time-zone during commit creation or UTC\xB100:00. - `; - const oldestAgeSetting = new import_obsidian8.Setting(this.containerEl).setName( - "Oldest age in coloring" - ); - oldestAgeSetting.descEl.innerHTML = this.previewOldestAgeDescriptionHtml( - this.settings.lineAuthor.coloringMaxAge - )[0]; - oldestAgeSetting.addText((text2) => { - text2.setPlaceholder("1y"); - text2.setValue(this.settings.lineAuthor.coloringMaxAge); - text2.onChange((value) => { - const [preview, valid] = this.previewOldestAgeDescriptionHtml(value); - oldestAgeSetting.descEl.innerHTML = preview; - if (valid) { - this.lineAuthorSettingHandler("coloringMaxAge", value); - this.refreshColorSettingsName("oldest"); - } - }); - }); - this.createColorSetting("newest"); - this.createColorSetting("oldest"); - new import_obsidian8.Setting(this.containerEl).setName("Text color").addText((field) => { - field.setValue(this.settings.lineAuthor.textColorCss); - field.onChange((value) => { - this.lineAuthorSettingHandler("textColorCss", value); - }); - }).descEl.innerHTML = ` + `;let i=new V.Setting(this.containerEl).setName("Oldest age in coloring");i.descEl.innerHTML=this.previewOldestAgeDescriptionHtml(this.settings.lineAuthor.coloringMaxAge)[0],i.addText(a=>{a.setPlaceholder("1y"),a.setValue(this.settings.lineAuthor.coloringMaxAge),a.onChange(async s=>{let[o,l]=this.previewOldestAgeDescriptionHtml(s);i.descEl.innerHTML=o,l&&(await this.lineAuthorSettingHandler("coloringMaxAge",s),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest"),new V.Setting(this.containerEl).setName("Text color").addText(a=>{a.setValue(this.settings.lineAuthor.textColorCss),a.onChange(async s=>{await this.lineAuthorSettingHandler("textColorCss",s)})}).descEl.innerHTML=` The CSS color of the gutter text.
It is higly recommended to use @@ -32798,13 +167,7 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab { See: List of available CSS variables in Obsidian - `; - new import_obsidian8.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle((tgl) => { - tgl.setValue(this.settings.lineAuthor.ignoreWhitespace); - tgl.onChange( - (value) => this.lineAuthorSettingHandler("ignoreWhitespace", value) - ); - }).descEl.innerHTML = ` + `,new V.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(a=>{a.setValue(this.settings.lineAuthor.ignoreWhitespace),a.onChange(s=>this.lineAuthorSettingHandler("ignoreWhitespace",s))}).descEl.innerHTML=` Whitespace and newlines are interpreted as part of the document and in changes by default (hence not ignored). @@ -32815,11378 +178,137 @@ var ObsidianGitSettingsTab = class extends import_obsidian8.PluginSettingTab { 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(which) { - const setting = new import_obsidian8.Setting(this.containerEl).setName("").addText((text2) => { - const color = pickColor(which, this.settings.lineAuthor); - const defaultColor = pickColor( - which, - DEFAULT_SETTINGS.lineAuthor - ); - text2.setPlaceholder(rgbToString(defaultColor)); - text2.setValue(rgbToString(color)); - text2.onChange((colorNew) => { - const rgb = convertToRgb(colorNew); - if (rgb !== void 0) { - const key2 = which === "newest" ? "colorNew" : "colorOld"; - this.lineAuthorSettingHandler(key2, rgb); - } - this.refreshColorSettingsDesc(which, rgb); - }); - }); - this.lineAuthorColorSettings.set(which, setting); - this.refreshColorSettingsName(which); - this.refreshColorSettingsDesc( - which, - pickColor(which, this.settings.lineAuthor) - ); - } - refreshColorSettingsName(which) { - const settingsDom = this.lineAuthorColorSettings.get(which); - if (settingsDom) { - const whichDescriber = which === "oldest" ? `oldest (${this.settings.lineAuthor.coloringMaxAge} or older)` : "newest"; - settingsDom.nameEl.innerText = `Color for ${whichDescriber} commits`; - } - } - refreshColorSettingsDesc(which, rgb) { - const settingsDom = this.lineAuthorColorSettings.get(which); - if (settingsDom) { - settingsDom.descEl.innerHTML = this.colorSettingPreviewDescHtml( - which, - this.settings.lineAuthor, - rgb !== void 0 - ); - } - } - colorSettingPreviewDescHtml(which, laSettings, colorIsValid) { - const rgbStr = colorIsValid ? previewColor(which, laSettings) : `rgba(127,127,127,0.3)`; - const today = import_obsidian8.moment.unix(import_obsidian8.moment.now() / 1e3).format("YYYY-MM-DD"); - const text2 = colorIsValid ? `abcdef Author Name ${today}` : "invalid color"; - const preview = `
{let a=vp(n,this.settings.lineAuthor),s=vp(n,Mn.lineAuthor);i.setPlaceholder(ap(s)),i.setValue(ap(a)),i.onChange(async o=>{let l=kS(o);if(l!==void 0){let c=n==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(n,l)})});this.lineAuthorColorSettings.set(n,r),this.refreshColorSettingsName(n),this.refreshColorSettingsDesc(n,vp(n,this.settings.lineAuthor))}refreshColorSettingsName(n){let r=this.lineAuthorColorSettings.get(n);if(r){let i=n==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";r.nameEl.innerText=`Color for ${i} commits`}}refreshColorSettingsDesc(n,r){let i=this.lineAuthorColorSettings.get(n);i&&(i.descEl.innerHTML=this.colorSettingPreviewDescHtml(n,this.settings.lineAuthor,r!==void 0))}colorSettingPreviewDescHtml(n,r,i){let a=i?wp(n,r):"rgba(127,127,127,0.3)",s=V.moment.unix(V.moment.now()/1e3).format("YYYY-MM-DD"),o=i?`abcdef Author Name ${s}`:"invalid color";return`Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and + named colors (e.g. 'black', 'purple'). Color preview: ${`
${text2}
`; - return `Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and - named colors (e.g. 'black', 'purple'). Color preview: ${preview}`; - } - previewCustomDateTimeDescriptionHtml(dateTimeFormatCustomString) { - const formattedDateTime = (0, import_obsidian8.moment)().format(dateTimeFormatCustomString); - return `
Format string to display the authoring date.
Currently: ${formattedDateTime}`; - } - previewOldestAgeDescriptionHtml(coloringMaxAge) { - const duration = parseColoringMaxAgeDuration(coloringMaxAge); - const durationString = duration !== void 0 ? `${duration.asDays()} days` : "invalid!"; - return [ - `The oldest age in the line author coloring. Everything older will have the same color. -
Smallest valid age is "1d". Currently: ${durationString}`, - duration - ]; - } -}; -function pickColor(which, las) { - return which === "oldest" ? las.colorOld : las.colorNew; -} -function parseColoringMaxAgeDuration(durationString) { - const duration = import_obsidian8.moment.duration("P" + durationString.toUpperCase()); - return duration.isValid() && duration.asDays() && duration.asDays() >= 1 ? duration : void 0; -} - -// src/lineAuthor/model.ts -function lineAuthoringId(head, objHash, path2) { - if (head === void 0 || objHash === void 0 || path2 === void 0) { - return void 0; - } - return `head${head}-obj${objHash}-path${path2}`; -} -var LineAuthoringContainerType = import_state.Annotation.define(); -function newComputationResultAsTransaction(key2, la, state) { - return state.update({ - annotations: LineAuthoringContainerType.of({ - key: key2, - la, - lineOffsetsFromUnsavedChanges: /* @__PURE__ */ new Map() - }) - }); -} -function getLineAuthorAnnotation(tr) { - return tr.annotation(LineAuthoringContainerType); -} -var lineAuthorState = import_state.StateField.define({ - create: (_state) => void 0, - /** - * The state can be updated from either an annotated transaction containing - * the newest line authoring (for the saved document) - or from - * unsaved changes of the document as the user is actively typing in the editor. - * - * In the first case, we take the new line authoring and discard anything we had remembered - * from unsaved changes. In the second case, we use the unsaved changes in {@link enrichUnsavedChanges} to pre-compute information to immediately update the - * line author gutter without needing to wait until the document is saved and the - * line authoring is properly computed. - */ - update: (previous, transaction) => { - var _a2; - return (_a2 = getLineAuthorAnnotation(transaction)) != null ? _a2 : enrichUnsavedChanges(transaction, previous); - }, - // compare cache keys. - // equality rate is >= 95% :) - // hence avoids recomputation of views - compare: (l, r) => (l == null ? void 0 : l.key) === (r == null ? void 0 : r.key) -}); -function laStateDigest(laState) { - var _a2; - const digest = import_js_sha256.sha256.create(); - if (!laState) - return digest; - const { la, key: key2, lineOffsetsFromUnsavedChanges } = laState; - digest.update(la === "untracked" ? "t" : "f"); - digest.update(key2); - for (const [k, v] of (_a2 = lineOffsetsFromUnsavedChanges.entries()) != null ? _a2 : []) - digest.update([k, v]); - return digest; -} -var latestSettings = { - get: void 0, - save: void 0 -}; -function provideSettingsAccess(settingsGetter, settingsSetter) { - latestSettings.get = settingsGetter; - latestSettings.save = settingsSetter; -} -function maxAgeInDaysFromSettings(settings) { - var _a2, _b; - return (_b = (_a2 = parseColoringMaxAgeDuration(settings.coloringMaxAge)) == null ? void 0 : _a2.asDays()) != null ? _b : parseColoringMaxAgeDuration( - DEFAULT_SETTINGS.lineAuthor.coloringMaxAge - ).asDays(); -} -function enrichUnsavedChanges(tr, prev) { - if (!prev) - return void 0; - if (!tr.changes.empty) { - tr.changes.iterChanges((fromA, toA, fromB, toB) => { - var _a2; - const oldDoc = tr.startState.doc; - const { newDoc } = tr; - const beforeFrom = oldDoc.lineAt(fromA).number; - const beforeTo = oldDoc.lineAt(toA).number; - const afterFrom = newDoc.lineAt(fromB).number; - const afterTo = newDoc.lineAt(toB).number; - const beforeLen = beforeTo - beforeFrom + 1; - const afterLen = afterTo - afterFrom + 1; - for (let afterI = afterFrom; afterI <= afterTo; afterI++) { - let offset = (_a2 = prev.lineOffsetsFromUnsavedChanges.get(afterI)) != null ? _a2 : 0; - const isLastLine = afterTo === afterI; - const changeInNumberOfLines = afterLen - beforeLen; - if (isLastLine) - offset += changeInNumberOfLines; - prev.lineOffsetsFromUnsavedChanges.set(afterI, offset); - } - }); - } - return prev; -} - -// src/lineAuthor/control.ts -var LineAuthoringSubscriber = class { - // remember path to detect and adapt to renames - constructor(state) { - this.state = state; - this.subscribeMe(); - } - async notifyLineAuthoring(id, la) { - if (this.view === void 0) { - console.warn( - `Obsidian Git: View is not defined for editor cache key. Unforeseen situation. id: ${id}` - ); - return; - } - const state = this.view.state; - const transaction = newComputationResultAsTransaction(id, la, state); - this.view.dispatch(transaction); - } - updateToNewState(state) { - const filepathChanged = this.lastSeenPath && this.filepath != this.lastSeenPath; - this.state = state; - if (filepathChanged) { - this.unsubscribeMe(this.lastSeenPath); - this.subscribeMe(); - } - return this; - } - removeIfStale() { - if (this.view.destroyed) { - this.unsubscribeMe(this.lastSeenPath); - } - } - subscribeMe() { - if (this.filepath === void 0) - return; - eventsPerFilePathSingleton.ifFilepathDefinedTransformSubscribers( - this.filepath, - (subs) => subs.add(this) - ); - this.lastSeenPath = this.filepath; - } - unsubscribeMe(oldFilepath) { - eventsPerFilePathSingleton.ifFilepathDefinedTransformSubscribers( - oldFilepath, - (subs) => subs.delete(this) - ); - } - get filepath() { - var _a2, _b; - return (_b = (_a2 = this.state.field(import_obsidian9.editorViewField)) == null ? void 0 : _a2.file) == null ? void 0 : _b.path; - } - get view() { - return this.state.field(import_obsidian9.editorEditorField); - } -}; -var subscribeNewEditor = import_state2.StateField.define({ - create: (state) => new LineAuthoringSubscriber(state), - update: (v, transaction) => v.updateToNewState(transaction.state), - compare: (a, b) => a === b -}); - -// src/lineAuthor/view/cache.ts -init_polyfill_buffer(); -function clearViewCache() { - longestRenderedGutter = void 0; - renderedAgeInDaysForAdaptiveInitialColoring = []; - ageIdx = 0; - gutterInstances.clear(); - gutterMarkersRangeSet.clear(); - attachedGutterElements.clear(); -} -var longestRenderedGutter = void 0; -var getLongestRenderedGutter = () => longestRenderedGutter; -function conditionallyUpdateLongestRenderedGutter(gutter2, text2) { - var _a2; - const length = text2.length; - if (length < ((_a2 = longestRenderedGutter == null ? void 0 : longestRenderedGutter.length) != null ? _a2 : 0)) - return; - longestRenderedGutter = { gutter: gutter2, length, text: text2 }; - const settings = latestSettings.get(); - if (length !== settings.gutterSpacingFallbackLength) { - settings.gutterSpacingFallbackLength = length; - latestSettings.save(settings); - } -} -var renderedAgeInDaysForAdaptiveInitialColoring = []; -var ADAPTIVE_INITIAL_COLORING_AGE_CACHE_SIZE = 15; -var ageIdx = 0; -function recordRenderedAgeInDays(age) { - renderedAgeInDaysForAdaptiveInitialColoring[ageIdx] = age; - ageIdx = (ageIdx + 1) % ADAPTIVE_INITIAL_COLORING_AGE_CACHE_SIZE; -} -function computeAdaptiveInitialColoringAgeInDays() { - return median(renderedAgeInDaysForAdaptiveInitialColoring); -} -var gutterInstances = /* @__PURE__ */ new Map(); -var gutterMarkersRangeSet = /* @__PURE__ */ new Map(); -var attachedGutterElements = /* @__PURE__ */ new Set(); - -// src/lineAuthor/view/view.ts -init_polyfill_buffer(); -var import_state3 = require("@codemirror/state"); -var import_view2 = require("@codemirror/view"); - -// src/lineAuthor/view/gutter/gutter.ts -init_polyfill_buffer(); -var import_view = require("@codemirror/view"); -var import_js_sha2562 = __toESM(require_sha256()); -var import_obsidian10 = require("obsidian"); - -// src/lineAuthor/view/contextMenu.ts -init_polyfill_buffer(); - -// src/lineAuthor/view/gutter/gutterElementSearch.ts -init_polyfill_buffer(); -var mouseXY = { x: -10, y: -10 }; -function prepareGutterSearchForContextMenuHandling() { - if (mouseXY.x === -10) { - window.addEventListener("mousedown", (e) => { - mouseXY.x = e.clientX; - mouseXY.y = e.clientY; - }); - } -} -function findGutterElementUnderMouse() { - for (const elt of attachedGutterElements) { - if (contains(elt, mouseXY)) - return elt; - } -} -function contains(elt, pt) { - const { x, y, width, height } = elt.getBoundingClientRect(); - return x <= pt.x && pt.x <= x + width && y <= pt.y && pt.y <= y + height; -} - -// src/pluginGlobalRef.ts -init_polyfill_buffer(); -var pluginRef = {}; - -// src/lineAuthor/view/contextMenu.ts -var COMMIT_ATTR = "data-commit"; -function handleContextMenu(menu, editor, _mdv) { - if (editor.hasFocus()) - return; - const gutterElement = findGutterElementUnderMouse(); - if (!gutterElement) - return; - const info = getCommitInfo(gutterElement); - if (!info) - return; - if (!info.isZeroCommit && !info.isWaitingGutter) { - addCopyHashMenuItem(info, menu); - } - addConfigurableLineAuthorSettings("showCommitHash", menu); - addConfigurableLineAuthorSettings("authorDisplay", menu); - addConfigurableLineAuthorSettings("dateTimeFormatOptions", menu); -} -function addCopyHashMenuItem(commit2, menu) { - menu.addItem( - (item) => item.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick((_e) => navigator.clipboard.writeText(commit2.hash)) - ); -} -function addConfigurableLineAuthorSettings(key2, menu) { - var _a2, _b; - let title; - let actionNewValue; - const settings = pluginRef.plugin.settings.lineAuthor; - const currentValue = settings[key2]; - const currentlyShown = typeof currentValue === "boolean" ? currentValue : currentValue !== "hide"; - const defaultValue = DEFAULT_SETTINGS.lineAuthor[key2]; - if (key2 === "showCommitHash") { - title = "Show commit hash"; - actionNewValue = !currentValue; - } else if (key2 === "authorDisplay") { - const showOption = (_a2 = settings.lastShownAuthorDisplay) != null ? _a2 : defaultValue; - title = "Show author " + (currentlyShown ? currentValue : showOption); - actionNewValue = currentlyShown ? "hide" : showOption; - } else if (key2 === "dateTimeFormatOptions") { - const showOption = (_b = settings.lastShownDateTimeFormatOptions) != null ? _b : defaultValue; - title = "Show " + (currentlyShown ? currentValue : showOption); - title += !title.contains("date") ? " date" : ""; - actionNewValue = currentlyShown ? "hide" : showOption; - } else { - impossibleBranch(key2); - } - menu.addItem( - (item) => item.setTitle(title).setSection("obs-git-line-author-configure").setChecked(currentlyShown).onClick( - (_e) => { - var _a3, _b2; - return (_b2 = (_a3 = pluginRef.plugin) == null ? void 0 : _a3.settingsTab) == null ? void 0 : _b2.lineAuthorSettingHandler( - key2, - actionNewValue - ); - } - ) - ); -} -function enrichCommitInfoForContextMenu(commit2, isWaitingGutter, elt) { - elt.setAttr( - COMMIT_ATTR, - JSON.stringify({ - hash: commit2.hash, - isZeroCommit: commit2.isZeroCommit, - isWaitingGutter - }) - ); -} -function getCommitInfo(elt) { - const commitInfoStr = elt.getAttr(COMMIT_ATTR); - return commitInfoStr ? JSON.parse(commitInfoStr) : void 0; -} - -// src/lineAuthor/view/gutter/coloring.ts -init_polyfill_buffer(); -function previewColor(which, settings) { - return which === "oldest" ? coloringBasedOnCommitAge(0, false, settings).color : coloringBasedOnCommitAge(void 0, true, settings).color; -} -function coloringBasedOnCommitAge(commitAuthorEpochSeonds, isZeroCommit, settings) { - const maxAgeInDays = maxAgeInDaysFromSettings(settings); - const epochSecondsNow = Date.now() / 1e3; - const authoringEpochSeconds = commitAuthorEpochSeonds != null ? commitAuthorEpochSeonds : 0; - const secondsSinceCommit = isZeroCommit ? 0 : epochSecondsNow - authoringEpochSeconds; - const daysSinceCommit = secondsSinceCommit / 60 / 60 / 24; - const x = Math.pow( - Math.clamp(daysSinceCommit / maxAgeInDays, 0, 1), - 1 / 2.3 - ); - const dark = isDarkMode(); - const color0 = settings.colorNew; - const color1 = settings.colorOld; - const scaling = dark ? 0.4 : 1; - const r = lin(color0.r, color1.r, x) * scaling; - const g = lin(color0.g, color1.g, x) * scaling; - const b = lin(color0.b, color1.b, x) * scaling; - const a = dark ? 0.75 : 0.25; - return { color: `rgba(${r},${g},${b},${a})`, daysSinceCommit }; -} -function lin(z0, z1, x) { - return z0 + (z1 - z0) * x; -} -function isDarkMode() { - const obsidian = window == null ? void 0 : window.app; - return (obsidian == null ? void 0 : obsidian.getTheme()) === "obsidian"; -} -function setTextColorCssBasedOnSetting(settings) { - document.body.style.setProperty( - "--obs-git-gutter-text", - settings.textColorCss - ); -} - -// src/lineAuthor/view/gutter/commitChoice.ts -init_polyfill_buffer(); -function chooseNewestCommit(lineAuthoring, startLine, endLine) { - let newest = void 0; - for (let line = startLine; line <= endLine; line++) { - const currentHash = lineAuthoring.hashPerLine[line]; - const currentCommit = lineAuthoring.commits.get(currentHash); - if (!newest || currentCommit.isZeroCommit || isNewerThan(currentCommit, newest)) { - newest = currentCommit; - } - } - return newest; -} -function isNewerThan(left, right) { - var _a2, _b, _c, _d; - const l = (_b = (_a2 = left.author) == null ? void 0 : _a2.epochSeconds) != null ? _b : 0; - const r = (_d = (_c = right.author) == null ? void 0 : _c.epochSeconds) != null ? _d : 0; - return l > r; -} - -// src/lineAuthor/view/gutter/gutter.ts -var VALUE_NOT_FOUND_FALLBACK = "-"; -var NEW_CHANGE_CHARACTER = "+"; -var NEW_CHANGE_NUMBER_OF_CHARACTERS = 3; -var DIFFERING_AUTHOR_COMMITTER_MARKER = "*"; -var NON_WHITESPACE_REGEXP = /\S/g; -var UNINTRUSIVE_CHARACTER_FOR_WAITING_RENDERING = "%"; -var TextGutter = class extends import_view.GutterMarker { - constructor(text2) { - super(); - this.text = text2; - } - eq(other) { - return this.text === (other == null ? void 0 : other.text); - } - toDOM() { - return document.createTextNode(this.text); - } - destroy(dom) { - if (!document.body.contains(dom)) - dom.remove(); - } -}; -var LineAuthoringGutter = class extends import_view.GutterMarker { - /** - * **This should only be called {@link lineAuthoringGutterMarker}!** - * - * We want to avoid creating the same instance multiple times for improved performance. - */ - constructor(lineAuthoring, startLine, endLine, key2, settings, options) { - super(); - this.lineAuthoring = lineAuthoring; - this.startLine = startLine; - this.endLine = endLine; - this.key = key2; - this.settings = settings; - this.options = options; - this.point = false; - this.elementClass = "obs-git-blame-gutter"; - } - // Equality used by CodeMirror for optimisations - eq(other) { - return this.key === (other == null ? void 0 : other.key) && this.startLine === (other == null ? void 0 : other.startLine) && this.endLine === (other == null ? void 0 : other.endLine) && (this == null ? void 0 : this.options) === (other == null ? void 0 : other.options); - } - /** - * Renders to a Html node. - * - * It choses the newest commit within the line-range, - * renders it, makes adjustments for fake-commits and finally warps - * it into HTML. - * - * The DOM is actually precomputed with {@link computeDom}, - * which provides a finaliser to run before the DOM is handed over to CodeMirror. - * This is done, because this method is called frequently. It is called, - * whenever a gutter gets into the viewport and needs to be rendered. - * - * The age in days is recorded via {@link recordRenderedAgeInDays} to enable adaptive coloring. - */ - toDOM() { - var _a2; - this.precomputedDomProvider = (_a2 = this.precomputedDomProvider) != null ? _a2 : this.computeDom(); - return this.precomputedDomProvider(); - } - destroy(dom) { - if (!document.body.contains(dom)) { - dom.remove(); - attachedGutterElements.delete(dom); - } - } - /** - * Prepares the DOM for this gutter. - */ - computeDom() { - const commit2 = chooseNewestCommit( - this.lineAuthoring, - this.startLine, - this.endLine - ); - let toBeRenderedText = commit2.isZeroCommit ? "" : this.renderNonZeroCommit(commit2); - const isTrueCommit = !commit2.isZeroCommit && this.options !== "waiting-for-result"; - if (isTrueCommit) { - conditionallyUpdateLongestRenderedGutter(this, toBeRenderedText); - } else { - toBeRenderedText = this.adaptTextForFakeCommit( - commit2, - toBeRenderedText, - this.options - ); - } - const domProvider = this.createHtmlNode( - commit2, - toBeRenderedText, - this.options === "waiting-for-result" - ); - return domProvider; - } - createHtmlNode(commit2, text2, isWaitingGutter) { - var _a2; - const templateElt = window.createDiv(); - templateElt.innerText = text2; - const { color, daysSinceCommit } = coloringBasedOnCommitAge( - (_a2 = commit2 == null ? void 0 : commit2.author) == null ? void 0 : _a2.epochSeconds, - commit2 == null ? void 0 : commit2.isZeroCommit, - this.settings - ); - templateElt.style.backgroundColor = color; - enrichCommitInfoForContextMenu(commit2, isWaitingGutter, templateElt); - function prepareForDomAttachment() { - const elt = templateElt.cloneNode(true); - attachedGutterElements.add(elt); - if (!isWaitingGutter) - recordRenderedAgeInDays(daysSinceCommit); - return elt; - } - return prepareForDomAttachment; - } - renderNonZeroCommit(commit2) { - const optionalShortHash = this.settings.showCommitHash ? this.renderHash(commit2) : ""; - const optionalAuthorName = this.settings.authorDisplay === "hide" ? "" : `${this.renderAuthorName( - commit2, - this.settings.authorDisplay - )}`; - const optionalAuthoringDate = this.settings.dateTimeFormatOptions === "hide" ? "" : `${this.renderAuthoringDate( - commit2, - this.settings.dateTimeFormatOptions, - this.settings.dateTimeFormatCustomString, - this.settings.dateTimeTimezone - )}`; - const parts = [ - optionalShortHash, - optionalAuthorName, - optionalAuthoringDate - ]; - return parts.filter((x) => x.length >= 1).join(" "); - } - renderHash(nonZeroCommit) { - return nonZeroCommit.hash.substring(0, 6); - } - renderAuthorName(nonZeroCommit, authorDisplay) { - var _a2, _b, _c, _d; - const name = (_b = (_a2 = nonZeroCommit == null ? void 0 : nonZeroCommit.author) == null ? void 0 : _a2.name) != null ? _b : ""; - const words = name.split(" ").filter((word) => word.length >= 1); - let rendered; - switch (authorDisplay) { - case "initials": - rendered = words.map((word) => word[0].toUpperCase()).join(""); - break; - case "first name": - rendered = (_c = words.first()) != null ? _c : VALUE_NOT_FOUND_FALLBACK; - break; - case "last name": - rendered = (_d = words.last()) != null ? _d : VALUE_NOT_FOUND_FALLBACK; - break; - case "full": - rendered = name; - break; - default: - return impossibleBranch(authorDisplay); - } - if (!strictDeepEqual(nonZeroCommit == null ? void 0 : nonZeroCommit.author, nonZeroCommit == null ? void 0 : nonZeroCommit.committer)) { - rendered = rendered + DIFFERING_AUTHOR_COMMITTER_MARKER; - } - return rendered; - } - renderAuthoringDate(nonZeroCommit, dateTimeFormatOptions, dateTimeFormatCustomString, dateTimeTimezone) { - var _a2; - const FALLBACK_COMMIT_DATE = "?"; - if (((_a2 = nonZeroCommit == null ? void 0 : nonZeroCommit.author) == null ? void 0 : _a2.epochSeconds) === void 0) - return FALLBACK_COMMIT_DATE; - let dateTimeFormatting; - switch (dateTimeFormatOptions) { - case "date": - dateTimeFormatting = DATE_FORMAT; - break; - case "datetime": - dateTimeFormatting = DATE_TIME_FORMAT_MINUTES; - break; - case "custom": - dateTimeFormatting = dateTimeFormatCustomString; - break; - case "natural language": - dateTimeFormatting = (time) => { - const diff2 = time.diff((0, import_obsidian10.moment)()); - const addFluentSuffix = true; - return import_obsidian10.moment.duration(diff2).humanize(addFluentSuffix); - }; - break; - default: - return impossibleBranch(dateTimeFormatOptions); - } - let authoringDate = import_obsidian10.moment.unix( - nonZeroCommit.author.epochSeconds - ); - switch (dateTimeTimezone) { - case "viewer-local": - break; - case "author-local": - authoringDate = authoringDate.utcOffset( - nonZeroCommit.author.tz - ); - dateTimeFormatting += " Z"; - break; - case "utc0000": - authoringDate = authoringDate.utc(); - dateTimeFormatting += "[Z]"; - break; - default: - return impossibleBranch(dateTimeTimezone); - } - if (typeof dateTimeFormatting === "string") { - return authoringDate.format(dateTimeFormatting); - } else { - return dateTimeFormatting(authoringDate); - } - } - adaptTextForFakeCommit(commit2, toBeRenderedText, options) { - var _a2, _b, _c, _d; - const original = (_b = (_a2 = getLongestRenderedGutter()) == null ? void 0 : _a2.text) != null ? _b : toBeRenderedText; - const fillCharacter = options !== "waiting-for-result" && commit2.isZeroCommit ? NEW_CHANGE_CHARACTER : UNINTRUSIVE_CHARACTER_FOR_WAITING_RENDERING; - toBeRenderedText = original.replace( - NON_WHITESPACE_REGEXP, - fillCharacter - ); - const desiredTextLength = (_d = (_c = latestSettings.get()) == null ? void 0 : _c.gutterSpacingFallbackLength) != null ? _d : toBeRenderedText.length; - toBeRenderedText = resizeToLength( - toBeRenderedText, - desiredTextLength, - fillCharacter - ); - if (options !== "waiting-for-result" && commit2.isZeroCommit) { - const numberOfLastCharactersToKeep = Math.min( - desiredTextLength, - NEW_CHANGE_NUMBER_OF_CHARACTERS - ); - toBeRenderedText = prefixOfLengthAsWhitespace( - toBeRenderedText, - desiredTextLength - numberOfLastCharactersToKeep - ); - } - return toBeRenderedText; - } -}; -function lineAuthoringGutterMarker(la, startLine, endLine, key2, settings, options) { - const digest = import_js_sha2562.sha256.create(); - digest.update(Object.values(settings).join(",")); - digest.update(`s${startLine}-e${endLine}-k${key2}-o${options}`); - const cacheKey = digest.hex(); - const cached = gutterInstances.get(cacheKey); - if (cached) - return cached; - const result = new LineAuthoringGutter( - la, - startLine, - endLine, - key2, - settings, - options - ); - gutterInstances.set(cacheKey, result); - return result; -} - -// src/lineAuthor/view/gutter/initial.ts -init_polyfill_buffer(); -var import_obsidian11 = require("obsidian"); -function initialSpacingGutter() { - var _a2, _b; - const length = (_b = (_a2 = latestSettings.get()) == null ? void 0 : _a2.gutterSpacingFallbackLength) != null ? _b : DEFAULT_SETTINGS.lineAuthor.gutterSpacingFallbackLength; - return new TextGutter(Array(length).fill("-").join("")); -} -function initialLineAuthoringGutter(settings) { - const { lineAuthoring, ageForInitialRender } = adaptiveInitialColoredWaitingLineAuthoring(settings); - return lineAuthoringGutterMarker( - lineAuthoring, - 1, - 1, - "initialGutter" + ageForInitialRender, - // use a age coloring based cache key - settings, - "waiting-for-result" - ); -} -function adaptiveInitialColoredWaitingLineAuthoring(settings) { - var _a2; - const ageForInitialRender = (_a2 = computeAdaptiveInitialColoringAgeInDays()) != null ? _a2 : maxAgeInDaysFromSettings(settings) * 0.25; - const slightlyOlderAgeForInitialRender = (0, import_obsidian11.moment)().add( - -ageForInitialRender, - "days" - ); - const dummyAuthor = { - name: "", - epochSeconds: momentToEpochSeconds(slightlyOlderAgeForInitialRender), - tz: "+0000" - }; - const dummyCommit = { - hash: "waiting-for-result", - author: dummyAuthor, - committer: dummyAuthor, - isZeroCommit: false - }; - return { - lineAuthoring: { - hashPerLine: [void 0, "waiting-for-result"], - commits: /* @__PURE__ */ new Map([["waiting-for-result", dummyCommit]]) - }, - ageForInitialRender - }; -} - -// src/lineAuthor/view/gutter/untrackedFile.ts -init_polyfill_buffer(); -function newUntrackedFileGutter(key2, settings) { - const dummyLineAuthoring = { - hashPerLine: [void 0, "000000"], - commits: /* @__PURE__ */ new Map([["000000", zeroCommit]]) - }; - return lineAuthoringGutterMarker(dummyLineAuthoring, 1, 1, key2, settings); -} - -// src/lineAuthor/view/view.ts -var UNDISPLAYED = new TextGutter(""); -var lineAuthorGutter = (0, import_view2.gutter)({ - class: "line-author-gutter-container", - markers(view) { - const lineAuthoring = view.state.field(lineAuthorState, false); - return lineAuthoringGutterMarkersRangeSet(view, lineAuthoring); - }, - lineMarkerChange(update2) { - const newLineAuthoringId = laStateDigest( - update2.state.field(lineAuthorState) - ); - const oldLineAuthoringId = laStateDigest( - update2.startState.field(lineAuthorState) - ); - return oldLineAuthoringId !== newLineAuthoringId; - }, - renderEmptyElements: true, - initialSpacer: (view) => { - temporaryWorkaroundGutterSpacingForRenderedLineAuthoring(view); - return initialSpacingGutter(); - }, - updateSpacer: (_sp, update2) => { - var _a2, _b; - temporaryWorkaroundGutterSpacingForRenderedLineAuthoring(update2.view); - return (_b = (_a2 = getLongestRenderedGutter()) == null ? void 0 : _a2.gutter) != null ? _b : initialSpacingGutter(); - } -}); -function lineAuthoringGutterMarkersRangeSet(view, optLA) { - const digest = laStateDigest(optLA); - const doc = view.state.doc; - const lineBlockEndPos = /* @__PURE__ */ new Map(); - for (let line = 1; line <= doc.lines; line++) { - const from = doc.line(line).from; - const to = view.lineBlockAt(from).to; - lineBlockEndPos.set(line, [from, to]); - digest.update([from, to, 0]); - } - const laSettings = latestSettings.get(); - digest.update("s" + Object.values(latestSettings).join(",")); - const cacheKey = digest.hex(); - const cached = gutterMarkersRangeSet.get(cacheKey); - if (cached) - return cached; - const { result, allowCache } = computeLineAuthoringGutterMarkersRangeSet( - doc, - lineBlockEndPos, - laSettings, - optLA - ); - if (allowCache) - gutterMarkersRangeSet.set(cacheKey, result); - return result; -} -function computeLineAuthoringGutterMarkersRangeSet(doc, blocksPerLine, settings, optLA) { - let allowCache = true; - const docLastLine = doc.lines; - const ranges = []; - function add2(from, to, gutter2) { - return ranges.push(gutter2.range(from, to)); - } - const lineFrom = computeLineMappingForUnsavedChanges(docLastLine, optLA); - const emptyDoc = doc.length === 0; - const lastLineIsEmpty = doc.iterLines(docLastLine, docLastLine + 1).next().value === ""; - for (let startLine = 1; startLine <= docLastLine; startLine++) { - const [from, to] = blocksPerLine.get(startLine); - const endLine = doc.lineAt(to).number; - if (emptyDoc) { - add2(from, to, UNDISPLAYED); - continue; - } - if (startLine === docLastLine && lastLineIsEmpty) { - add2(from, to, UNDISPLAYED); - continue; - } - if (optLA === void 0) { - add2(from, to, initialLineAuthoringGutter(settings)); - allowCache = false; - continue; - } - const { key: key2, la } = optLA; - if (la === "untracked") { - add2(from, to, newUntrackedFileGutter(la, settings)); - continue; - } - const lastAuthorLine = la.hashPerLine.length - 1; - const laStartLine = lineFrom[startLine]; - const laEndLine = lineFrom[endLine]; - if (laEndLine && laEndLine > lastAuthorLine) { - add2(from, to, UNDISPLAYED); - } - if (laStartLine !== void 0 && between(1, laStartLine, lastAuthorLine) && laEndLine !== void 0 && between(1, laEndLine, lastAuthorLine)) { - add2( - from, - to, - lineAuthoringGutterMarker( - la, - laStartLine, - laEndLine, - key2, - settings - ) - ); - continue; - } - if (lastAuthorLine < 1) { - add2(from, to, initialLineAuthoringGutter(settings)); - allowCache = false; - continue; - } - const start = Math.clamp(laStartLine != null ? laStartLine : startLine, 1, lastAuthorLine); - const end = Math.clamp(laEndLine != null ? laEndLine : endLine, 1, lastAuthorLine); - add2( - from, - to, - lineAuthoringGutterMarker( - la, - start, - end, - key2 + "computing", - settings, - "waiting-for-result" - ) - ); - } - return { result: import_state3.RangeSet.of( - ranges, - /* sort = */ - true - ), allowCache }; -} -function computeLineMappingForUnsavedChanges(docLastLine, optLA) { - if (!(optLA == null ? void 0 : optLA.lineOffsetsFromUnsavedChanges)) { - return Array.from(new Array(docLastLine + 1), (ln) => ln); - } - const lineFrom = [void 0]; - let cumulativeLineOffset = 0; - for (let ln = 1; ln <= docLastLine; ln++) { - const unsavedChanges = optLA.lineOffsetsFromUnsavedChanges.get(ln); - cumulativeLineOffset += unsavedChanges != null ? unsavedChanges : 0; - lineFrom[ln] = unsavedChanges === void 0 ? ln - cumulativeLineOffset : void 0; - } - return lineFrom; -} -function temporaryWorkaroundGutterSpacingForRenderedLineAuthoring(view) { - const guttersContainers = view.dom.querySelectorAll( - ".cm-gutters" - ); - guttersContainers.forEach((cont) => { - if (!(cont == null ? void 0 : cont.style)) - return; - if (!cont.style.marginLeft) { - cont.style.marginLeft = "unset"; - } - }); -} - -// src/lineAuthor/lineAuthorProvider.ts -var LineAuthorProvider = class { - constructor(plugin) { - this.plugin = plugin; - /** - * Saves all computed line authoring results. - * - * See {@link LineAuthoringId} - */ - this.lineAuthorings = /* @__PURE__ */ new Map(); - } - async trackChanged(file) { - this.trackChangedHelper(file).catch((reason) => { - console.warn("Obsidian Git: Error in trackChanged." + reason); - return Promise.reject(reason); - }); - } - async trackChangedHelper(file) { - if (!file) - return; - if (file.path === void 0) { - console.warn( - "Obsidian Git: Attempted to track change of undefined filepath. Unforeseen situation." - ); - return; - } - this.computeLineAuthorInfo(file.path); - } - destroy() { - this.lineAuthorings.clear(); - eventsPerFilePathSingleton.clear(); - clearViewCache(); - } - async computeLineAuthorInfo(filepath) { - const gitManager = this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager; - const headRevision = await gitManager.submoduleAwareHeadRevisonInContainingDirectory( - filepath - ); - const fileHash = await gitManager.hashObject(filepath); - const key2 = lineAuthoringId(headRevision, fileHash, filepath); - if (key2 === void 0) { - return; - } - if (this.lineAuthorings.has(key2)) { - } else { - const gitAuthorResult = await gitManager.blame( - filepath, - this.plugin.settings.lineAuthor.followMovement, - this.plugin.settings.lineAuthor.ignoreWhitespace - ); - this.lineAuthorings.set(key2, gitAuthorResult); - } - this.notifyComputationResultToSubscribers(filepath, key2); - } - notifyComputationResultToSubscribers(filepath, key2) { - eventsPerFilePathSingleton.ifFilepathDefinedTransformSubscribers( - filepath, - async (subs) => subs.forEach( - (sub) => sub.notifyLineAuthoring(key2, this.lineAuthorings.get(key2)) - ) - ); - } -}; -var enabledLineAuthorInfoExtensions = import_state4.Prec.high([ - subscribeNewEditor, - lineAuthorState, - lineAuthorGutter -]); - -// src/lineAuthor/lineAuthorIntegration.ts -var LineAuthoringFeature = class { - constructor(plg) { - this.plg = plg; - this.codeMirrorExtensions = []; - this.handleWorkspaceLeaf = (leaf) => { - const obsView = leaf == null ? void 0 : leaf.view; - const file = obsView == null ? void 0 : obsView.file; - if (!this.lineAuthorInfoProvider) { - console.warn( - "Obsidian Git: undefined lineAuthorInfoProvider. Unexpected situation." - ); - return; - } - if (file === void 0 || (obsView == null ? void 0 : obsView.allowNoFile) === true) - return; - this.lineAuthorInfoProvider.trackChanged(file); - }; - } - // ========================= INIT and DE-INIT ========================== - onLoadPlugin() { - this.plg.registerEditorExtension(this.codeMirrorExtensions); - provideSettingsAccess( - () => this.plg.settings.lineAuthor, - (laSettings) => { - this.plg.settings.lineAuthor = laSettings; - this.plg.saveSettings(); - } - ); - } - conditionallyActivateBySettings() { - if (this.plg.settings.lineAuthor.show) { - this.activateFeature(); - } - } - activateFeature() { - try { - if (!this.isAvailableOnCurrentPlatform()) - return; - setTextColorCssBasedOnSetting(this.plg.settings.lineAuthor); - this.lineAuthorInfoProvider = new LineAuthorProvider(this.plg); - this.createEventHandlers(); - this.activateCodeMirrorExtensions(); - console.log(this.plg.manifest.name + ": Enabled line authoring."); - } catch (e) { - console.warn( - "Obsidian Git: Error while loading line authoring feature.", - e - ); - this.deactivateFeature(); - } - } - /** - * Deactivates the feature. This function is very defensive, as it is also - * called to cleanup, if a critical error in the line authoring has occurred. - */ - deactivateFeature() { - var _a2; - this.destroyEventHandlers(); - this.deactivateCodeMirrorExtensions(); - (_a2 = this.lineAuthorInfoProvider) == null ? void 0 : _a2.destroy(); - this.lineAuthorInfoProvider = void 0; - console.log(this.plg.manifest.name + ": Disabled line authoring."); - } - isAvailableOnCurrentPlatform() { - return { - available: this.plg.useSimpleGit && import_obsidian12.Platform.isDesktopApp, - gitManager: this.plg.gitManager instanceof SimpleGit ? this.plg.gitManager : void 0 - }; - } - // ========================= REFRESH ========================== - refreshLineAuthorViews() { - if (this.plg.settings.lineAuthor.show) { - this.deactivateFeature(); - this.activateFeature(); - } - } - // ========================= CODEMIRROR EXTENSIONS ========================== - activateCodeMirrorExtensions() { - this.codeMirrorExtensions.push(enabledLineAuthorInfoExtensions); - this.plg.app.workspace.updateOptions(); - this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf); - } - deactivateCodeMirrorExtensions() { - for (const ext of this.codeMirrorExtensions) { - this.codeMirrorExtensions.remove(ext); - } - this.plg.app.workspace.updateOptions(); - } - // ========================= HANDLERS ========================== - createEventHandlers() { - this.gutterContextMenuEvent = this.createGutterContextMenuHandler(); - this.fileOpenEvent = this.createFileOpenEvent(); - this.workspaceLeafChangeEvent = this.createWorkspaceLeafChangeEvent(); - this.fileModificationEvent = this.createVaultFileModificationHandler(); - this.refreshOnCssChangeEvent = this.createCssRefreshHandler(); - this.fileRenameEvent = this.createFileRenameEvent(); - prepareGutterSearchForContextMenuHandling(); - 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.fileRenameEvent); - } - destroyEventHandlers() { - this.plg.app.workspace.offref(this.refreshOnCssChangeEvent); - this.plg.app.workspace.offref(this.fileOpenEvent); - this.plg.app.workspace.offref(this.workspaceLeafChangeEvent); - this.plg.app.workspace.offref(this.refreshOnCssChangeEvent); - this.plg.app.vault.offref(this.fileRenameEvent); - this.plg.app.workspace.offref(this.gutterContextMenuEvent); - } - createFileOpenEvent() { - return this.plg.app.workspace.on( - "file-open", - (file) => { - var _a2; - return (_a2 = this.lineAuthorInfoProvider) == null ? void 0 : _a2.trackChanged(file); - } - ); - } - createWorkspaceLeafChangeEvent() { - return this.plg.app.workspace.on( - "active-leaf-change", - this.handleWorkspaceLeaf - ); - } - createFileRenameEvent() { - return this.plg.app.vault.on( - "rename", - (file, _old) => { - var _a2; - return file instanceof import_obsidian12.TFile && ((_a2 = this.lineAuthorInfoProvider) == null ? void 0 : _a2.trackChanged(file)); - } - ); - } - createVaultFileModificationHandler() { - return this.plg.app.vault.on( - "modify", - (anyPath) => { - var _a2; - return anyPath instanceof import_obsidian12.TFile && ((_a2 = this.lineAuthorInfoProvider) == null ? void 0 : _a2.trackChanged(anyPath)); - } - ); - } - createCssRefreshHandler() { - return this.plg.app.workspace.on( - "css-change", - () => this.refreshLineAuthorViews() - ); - } - createGutterContextMenuHandler() { - return this.plg.app.workspace.on("editor-menu", handleContextMenu); - } -}; - -// src/promiseQueue.ts -init_polyfill_buffer(); -var PromiseQueue = class { - constructor() { - this.tasks = []; - } - addTask(task) { - this.tasks.push(task); - if (this.tasks.length === 1) { - this.handleTask(); - } - } - async handleTask() { - if (this.tasks.length > 0) { - this.tasks[0]().finally(() => { - this.tasks.shift(); - this.handleTask(); - }); - } - } -}; - -// src/statusBar.ts -init_polyfill_buffer(); -var import_obsidian13 = require("obsidian"); -var StatusBar = class { - constructor(statusBarEl, plugin) { - this.statusBarEl = statusBarEl; - this.plugin = plugin; - this.messages = []; - this.base = "obsidian-git-statusbar-"; - this.statusBarEl.setAttribute("aria-label-position", "top"); - this.statusBarEl.setAttribute("data-tooltip-position", "top"); - addEventListener("git-refresh", this.refreshCommitTimestamp.bind(this)); - } - displayMessage(message, timeout) { - this.messages.push({ - message: `Git: ${message.slice(0, 100)}`, - timeout - }); - this.display(); - } - display() { - if (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(); - } else if (this.currentMessage) { - const messageAge = Date.now() - this.lastMessageTimestamp; - if (messageAge >= this.currentMessage.timeout) { - this.currentMessage = null; - this.lastMessageTimestamp = null; - } - } else { - this.displayState(); - } - } - displayState() { - if (this.statusBarEl.getText().length > 3 || !this.statusBarEl.hasChildNodes()) { - this.statusBarEl.empty(); - this.iconEl = this.statusBarEl.createDiv(); - this.textEl = this.statusBarEl.createDiv(); - this.textEl.style.float = "right"; - this.textEl.style.marginLeft = "5px"; - this.iconEl.style.float = "left"; - } - switch (this.plugin.state) { - case 0 /* idle */: - this.displayFromNow(); - break; - case 1 /* status */: - this.statusBarEl.ariaLabel = "Checking repository status..."; - (0, import_obsidian13.setIcon)(this.iconEl, "refresh-cw"); - this.statusBarEl.addClass(this.base + "status"); - break; - case 3 /* add */: - this.statusBarEl.ariaLabel = "Adding files..."; - (0, import_obsidian13.setIcon)(this.iconEl, "refresh-w"); - this.statusBarEl.addClass(this.base + "add"); - break; - case 4 /* commit */: - this.statusBarEl.ariaLabel = "Committing changes..."; - (0, import_obsidian13.setIcon)(this.iconEl, "git-commit"); - this.statusBarEl.addClass(this.base + "commit"); - break; - case 5 /* push */: - this.statusBarEl.ariaLabel = "Pushing changes..."; - (0, import_obsidian13.setIcon)(this.iconEl, "upload"); - this.statusBarEl.addClass(this.base + "push"); - break; - case 2 /* pull */: - this.statusBarEl.ariaLabel = "Pulling changes..."; - (0, import_obsidian13.setIcon)(this.iconEl, "download"); - this.statusBarEl.addClass(this.base + "pull"); - break; - case 6 /* conflicted */: - this.statusBarEl.ariaLabel = "You have conflict files..."; - (0, import_obsidian13.setIcon)(this.iconEl, "alert-circle"); - this.statusBarEl.addClass(this.base + "conflict"); - break; - default: - this.statusBarEl.ariaLabel = "Failed on initialization!"; - (0, import_obsidian13.setIcon)(this.iconEl, "alert-triangle"); - this.statusBarEl.addClass(this.base + "failed-init"); - break; - } - } - displayFromNow() { - var _a2; - const timestamp = this.lastCommitTimestamp; - if (timestamp) { - const moment5 = window.moment; - const fromNow = moment5(timestamp).fromNow(); - this.statusBarEl.ariaLabel = `${this.plugin.offlineMode ? "Offline: " : ""}Last Commit: ${fromNow}`; - if ((_a2 = this.unPushedCommits) != null ? _a2 : 0 > 0) { - this.statusBarEl.ariaLabel += ` -(${this.unPushedCommits} unpushed commits)`; - } - } else { - this.statusBarEl.ariaLabel = this.plugin.offlineMode ? "Git is offline" : "Git is ready"; - } - if (this.plugin.offlineMode) { - (0, import_obsidian13.setIcon)(this.iconEl, "globe"); - } else { - (0, import_obsidian13.setIcon)(this.iconEl, "check"); - } - if (this.plugin.settings.changedFilesInStatusBar && this.plugin.cachedStatus) { - this.textEl.setText( - this.plugin.cachedStatus.changed.length.toString() - ); - } - this.statusBarEl.addClass(this.base + "idle"); - } - async refreshCommitTimestamp() { - this.lastCommitTimestamp = await this.plugin.gitManager.getLastCommitTime(); - this.unPushedCommits = await this.plugin.gitManager.getUnpushedCommits(); - } -}; - -// src/ui/modals/changedFilesModal.ts -init_polyfill_buffer(); -var import_obsidian14 = require("obsidian"); -var ChangedFilesModal = class extends import_obsidian14.FuzzySuggestModal { - constructor(plugin, changedFiles) { - super(plugin.app); - this.plugin = plugin; - this.changedFiles = changedFiles; - this.setPlaceholder( - "Not supported files will be opened by default app!" - ); - } - getItems() { - return this.changedFiles; - } - getItemText(item) { - if (item.index == "U" && item.working_dir == "U") { - return `Untracked | ${item.vault_path}`; - } - let working_dir = ""; - let index2 = ""; - if (item.working_dir != " ") - working_dir = `Working dir: ${item.working_dir} `; - if (item.index != " ") - index2 = `Index: ${item.index}`; - return `${working_dir}${index2} | ${item.vault_path}`; - } - onChooseItem(item, _) { - if (this.plugin.app.metadataCache.getFirstLinkpathDest( - item.vault_path, - "" - ) == null) { - this.app.openWithDefaultApp(item.vault_path); - } else { - this.plugin.app.workspace.openLinkText(item.vault_path, "/"); - } - } -}; - -// src/ui/modals/customMessageModal.ts -init_polyfill_buffer(); -var import_obsidian15 = require("obsidian"); -var CustomMessageModal = class extends import_obsidian15.SuggestModal { - constructor(plugin, fromAutoBackup) { - super(plugin.app); - this.fromAutoBackup = fromAutoBackup; - this.resolve = null; - this.plugin = plugin; - this.setPlaceholder( - "Type your message and select optional the version with the added date." - ); - } - open() { - super.open(); - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - onClose() { - if (this.resolve) - this.resolve(void 0); - } - selectSuggestion(value, evt) { - if (this.resolve) - this.resolve(value); - super.selectSuggestion(value, evt); - } - getSuggestions(query) { - const date = window.moment().format(this.plugin.settings.commitDateFormat); - if (query == "") - query = "..."; - return [query, `${date}: ${query}`, `${query}: ${date}`]; - } - renderSuggestion(value, el) { - el.innerText = value; - } - onChooseSuggestion(item, _) { - } -}; - -// src/openInGitHub.ts -init_polyfill_buffer(); -var import_obsidian16 = require("obsidian"); -async function openLineInGitHub(editor, file, manager) { - const data = await getData(manager); - if (data.result === "failure") { - new import_obsidian16.Notice(data.reason); - return; - } - const { isGitHub, branch: branch2, repo, user } = data; - if (isGitHub) { - const path2 = manager.asRepositoryRelativePath(file.path, true); - const from = editor.getCursor("from").line + 1; - const to = editor.getCursor("to").line + 1; - if (from === to) { - window.open( - `https://github.com/${user}/${repo}/blob/${branch2}/${path2}?plain=1#L${from}` - ); - } else { - window.open( - `https://github.com/${user}/${repo}/blob/${branch2}/${path2}?plain=1#L${from}-L${to}` - ); - } - } else { - new import_obsidian16.Notice("It seems like you are not using GitHub"); - } -} -async function openHistoryInGitHub(file, manager) { - const data = await getData(manager); - if (data.result === "failure") { - new import_obsidian16.Notice(data.reason); - return; - } - const { isGitHub, branch: branch2, repo, user } = data; - const path2 = manager.asRepositoryRelativePath(file.path, true); - if (isGitHub) { - window.open( - `https://github.com/${user}/${repo}/commits/${branch2}/${path2}` - ); - } else { - new import_obsidian16.Notice("It seems like you are not using GitHub"); - } -} -async function getData(manager) { - const branchInfo = await manager.branchInfo(); - const remoteBranch = branchInfo.tracking; - const branch2 = branchInfo.current; - if (remoteBranch == null) { - return { - result: "failure", - reason: "Remote branch is not configured" - }; - } - if (branch2 == null) { - return { - result: "failure", - reason: "Failed to get current branch name" - }; - } - const remote = remoteBranch.substring(0, remoteBranch.indexOf("/")); - const remoteUrl = await manager.getConfig( - `remote.${remote}.url` - ); - const [isGitHub, httpsUser, httpsRepo, sshUser, sshRepo] = remoteUrl.match( - /(?:^https:\/\/github\.com\/(.*)\/(.*)\.git$)|(?:^[a-zA-Z]+@github\.com:(.*)\/(.*)\.git$)/ - ); - return { - result: "success", - isGitHub: !!isGitHub, - repo: httpsRepo || sshRepo, - user: httpsUser || sshUser, - branch: branch2 - }; -} - -// src/setting/localStorageSettings.ts -init_polyfill_buffer(); -var LocalStorageSettings = class { - constructor(plugin) { - this.plugin = plugin; - this.prefix = this.plugin.manifest.id + ":"; - } - migrate() { - const keys = [ - "password", - "hostname", - "conflict", - "lastAutoPull", - "lastAutoBackup", - "lastAutoPush", - "gitPath", - "pluginDisabled" - ]; - for (const key2 of keys) { - const old = localStorage.getItem(this.prefix + key2); - if (app.loadLocalStorage(this.prefix + key2) == null && old != null) { - if (old != null) { - app.saveLocalStorage(this.prefix + key2, old); - localStorage.removeItem(this.prefix + key2); - } - } - } - } - getPassword() { - return app.loadLocalStorage(this.prefix + "password"); - } - setPassword(value) { - return app.saveLocalStorage(this.prefix + "password", value); - } - getUsername() { - return app.loadLocalStorage(this.prefix + "username"); - } - setUsername(value) { - return app.saveLocalStorage(this.prefix + "username", value); - } - getHostname() { - return app.loadLocalStorage(this.prefix + "hostname"); - } - setHostname(value) { - return app.saveLocalStorage(this.prefix + "hostname", value); - } - getConflict() { - return app.loadLocalStorage(this.prefix + "conflict") == "true"; - } - setConflict(value) { - return app.saveLocalStorage(this.prefix + "conflict", `${value}`); - } - getLastAutoPull() { - return app.loadLocalStorage(this.prefix + "lastAutoPull"); - } - setLastAutoPull(value) { - return app.saveLocalStorage(this.prefix + "lastAutoPull", value); - } - getLastAutoBackup() { - return app.loadLocalStorage(this.prefix + "lastAutoBackup"); - } - setLastAutoBackup(value) { - return app.saveLocalStorage(this.prefix + "lastAutoBackup", value); - } - getLastAutoPush() { - return app.loadLocalStorage(this.prefix + "lastAutoPush"); - } - setLastAutoPush(value) { - return app.saveLocalStorage(this.prefix + "lastAutoPush", value); - } - getGitPath() { - return app.loadLocalStorage(this.prefix + "gitPath"); - } - setGitPath(value) { - return app.saveLocalStorage(this.prefix + "gitPath", value); - } - getPATHPaths() { - var _a2, _b; - return (_b = (_a2 = app.loadLocalStorage(this.prefix + "PATHPaths")) == null ? void 0 : _a2.split(":")) != null ? _b : []; - } - setPATHPaths(value) { - return app.saveLocalStorage(this.prefix + "PATHPaths", value.join(":")); - } - getEnvVars() { - var _a2; - return JSON.parse( - (_a2 = app.loadLocalStorage(this.prefix + "envVars")) != null ? _a2 : "[]" - ); - } - setEnvVars(value) { - return app.saveLocalStorage( - this.prefix + "envVars", - JSON.stringify(value) - ); - } - getPluginDisabled() { - return app.loadLocalStorage(this.prefix + "pluginDisabled") == "true"; - } - setPluginDisabled(value) { - return app.saveLocalStorage(this.prefix + "pluginDisabled", `${value}`); - } -}; - -// src/ui/diff/diffView.ts -init_polyfill_buffer(); - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff2html.js -init_polyfill_buffer(); - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff-parser.js -init_polyfill_buffer(); - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/types.js -init_polyfill_buffer(); -var LineType; -(function(LineType2) { - LineType2["INSERT"] = "insert"; - LineType2["DELETE"] = "delete"; - LineType2["CONTEXT"] = "context"; -})(LineType || (LineType = {})); -var OutputFormatType = { - LINE_BY_LINE: "line-by-line", - SIDE_BY_SIDE: "side-by-side" -}; -var LineMatchingType = { - LINES: "lines", - WORDS: "words", - NONE: "none" -}; -var DiffStyleType = { - WORD: "word", - CHAR: "char" -}; - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/utils.js -init_polyfill_buffer(); -var specials = [ - "-", - "[", - "]", - "/", - "{", - "}", - "(", - ")", - "*", - "+", - "?", - ".", - "\\", - "^", - "$", - "|" -]; -var regex = RegExp("[" + specials.join("\\") + "]", "g"); -function escapeForRegExp(str) { - return str.replace(regex, "\\$&"); -} -function unifyPath(path2) { - return path2 ? path2.replace(/\\/g, "/") : path2; -} -function hashCode(text2) { - let i, chr, len; - let hash2 = 0; - for (i = 0, len = text2.length; i < len; i++) { - chr = text2.charCodeAt(i); - hash2 = (hash2 << 5) - hash2 + chr; - hash2 |= 0; - } - return hash2; -} - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff-parser.js -function getExtension(filename, language) { - const filenameParts = filename.split("."); - return filenameParts.length > 1 ? filenameParts[filenameParts.length - 1] : language; -} -function startsWithAny(str, prefixes) { - return prefixes.reduce((startsWith, prefix) => startsWith || str.startsWith(prefix), false); -} -var baseDiffFilenamePrefixes = ["a/", "b/", "i/", "w/", "c/", "o/"]; -function getFilename(line, linePrefix, extraPrefix) { - const prefixes = extraPrefix !== void 0 ? [...baseDiffFilenamePrefixes, extraPrefix] : baseDiffFilenamePrefixes; - const FilenameRegExp = linePrefix ? new RegExp(`^${escapeForRegExp(linePrefix)} "?(.+?)"?$`) : new RegExp('^"?(.+?)"?$'); - const [, filename = ""] = FilenameRegExp.exec(line) || []; - const matchingPrefix = prefixes.find((p) => filename.indexOf(p) === 0); - const fnameWithoutPrefix = matchingPrefix ? filename.slice(matchingPrefix.length) : filename; - return fnameWithoutPrefix.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/, ""); -} -function getSrcFilename(line, srcPrefix) { - return getFilename(line, "---", srcPrefix); -} -function getDstFilename(line, dstPrefix) { - return getFilename(line, "+++", dstPrefix); -} -function parse(diffInput, config = {}) { - const files = []; - let currentFile = null; - let currentBlock = null; - let oldLine = null; - let oldLine2 = null; - let newLine = null; - let possibleOldName = null; - let possibleNewName = null; - const oldFileNameHeader = "--- "; - const newFileNameHeader = "+++ "; - const hunkHeaderPrefix = "@@"; - const oldMode = /^old mode (\d{6})/; - const newMode = /^new mode (\d{6})/; - const deletedFileMode = /^deleted file mode (\d{6})/; - const newFileMode = /^new file mode (\d{6})/; - const copyFrom = /^copy from "?(.+)"?/; - const copyTo = /^copy to "?(.+)"?/; - const renameFrom = /^rename from "?(.+)"?/; - const renameTo = /^rename to "?(.+)"?/; - const similarityIndex = /^similarity index (\d+)%/; - const dissimilarityIndex = /^dissimilarity index (\d+)%/; - const index2 = /^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/; - const binaryFiles = /^Binary files (.*) and (.*) differ/; - const binaryDiff = /^GIT binary patch/; - const combinedIndex = /^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/; - const combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/; - const combinedNewFile = /^new file mode (\d{6})/; - const combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/; - const diffLines2 = diffInput.replace(/\\ No newline at end of file/g, "").replace(/\r\n?/g, "\n").split("\n"); - function saveBlock() { - if (currentBlock !== null && currentFile !== null) { - currentFile.blocks.push(currentBlock); - currentBlock = null; - } - } - function saveFile() { - if (currentFile !== null) { - if (!currentFile.oldName && possibleOldName !== null) { - currentFile.oldName = possibleOldName; - } - if (!currentFile.newName && possibleNewName !== null) { - currentFile.newName = possibleNewName; - } - if (currentFile.newName) { - files.push(currentFile); - currentFile = null; - } - } - possibleOldName = null; - possibleNewName = null; - } - function startFile() { - saveBlock(); - saveFile(); - currentFile = { - blocks: [], - deletedLines: 0, - addedLines: 0 - }; - } - function startBlock(line) { - saveBlock(); - let values; - if (currentFile !== null) { - if (values = /^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(line)) { - currentFile.isCombined = false; - oldLine = parseInt(values[1], 10); - newLine = parseInt(values[2], 10); - } else if (values = /^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(line)) { - currentFile.isCombined = true; - oldLine = parseInt(values[1], 10); - oldLine2 = parseInt(values[2], 10); - newLine = parseInt(values[3], 10); - } else { - if (line.startsWith(hunkHeaderPrefix)) { - console.error("Failed to parse lines, starting in 0!"); - } - oldLine = 0; - newLine = 0; - currentFile.isCombined = false; - } - } - currentBlock = { - lines: [], - oldStartLine: oldLine, - oldStartLine2: oldLine2, - newStartLine: newLine, - header: line - }; - } - function createLine(line) { - if (currentFile === null || currentBlock === null || oldLine === null || newLine === null) - return; - const currentLine = { - content: line - }; - const addedPrefixes = currentFile.isCombined ? ["+ ", " +", "++"] : ["+"]; - const deletedPrefixes = currentFile.isCombined ? ["- ", " -", "--"] : ["-"]; - if (startsWithAny(line, addedPrefixes)) { - currentFile.addedLines++; - currentLine.type = LineType.INSERT; - currentLine.oldNumber = void 0; - currentLine.newNumber = newLine++; - } else if (startsWithAny(line, deletedPrefixes)) { - currentFile.deletedLines++; - currentLine.type = LineType.DELETE; - currentLine.oldNumber = oldLine++; - currentLine.newNumber = void 0; - } else { - currentLine.type = LineType.CONTEXT; - currentLine.oldNumber = oldLine++; - currentLine.newNumber = newLine++; - } - currentBlock.lines.push(currentLine); - } - function existHunkHeader(line, lineIdx) { - let idx = lineIdx; - while (idx < diffLines2.length - 3) { - if (line.startsWith("diff")) { - return false; - } - if (diffLines2[idx].startsWith(oldFileNameHeader) && diffLines2[idx + 1].startsWith(newFileNameHeader) && diffLines2[idx + 2].startsWith(hunkHeaderPrefix)) { - return true; - } - idx++; - } - return false; - } - diffLines2.forEach((line, lineIndex) => { - if (!line || line.startsWith("*")) { - return; - } - let values; - const prevLine = diffLines2[lineIndex - 1]; - const nxtLine = diffLines2[lineIndex + 1]; - const afterNxtLine = diffLines2[lineIndex + 2]; - if (line.startsWith("diff --git") || line.startsWith("diff --combined")) { - startFile(); - const gitDiffStart = /^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/; - if (values = gitDiffStart.exec(line)) { - possibleOldName = getFilename(values[1], void 0, config.dstPrefix); - possibleNewName = getFilename(values[2], void 0, config.srcPrefix); - } - if (currentFile === null) { - throw new Error("Where is my file !!!"); - } - currentFile.isGitDiff = true; - return; - } - if (line.startsWith("Binary files") && !(currentFile === null || currentFile === void 0 ? void 0 : currentFile.isGitDiff)) { - startFile(); - const unixDiffBinaryStart = /^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/; - if (values = unixDiffBinaryStart.exec(line)) { - possibleOldName = getFilename(values[1], void 0, config.dstPrefix); - possibleNewName = getFilename(values[2], void 0, config.srcPrefix); - } - if (currentFile === null) { - throw new Error("Where is my file !!!"); - } - currentFile.isBinary = true; - return; - } - if (!currentFile || !currentFile.isGitDiff && currentFile && line.startsWith(oldFileNameHeader) && nxtLine.startsWith(newFileNameHeader) && afterNxtLine.startsWith(hunkHeaderPrefix)) { - startFile(); - } - if (currentFile === null || currentFile === void 0 ? void 0 : currentFile.isTooBig) { - return; - } - if (currentFile && (typeof config.diffMaxChanges === "number" && currentFile.addedLines + currentFile.deletedLines > config.diffMaxChanges || typeof config.diffMaxLineLength === "number" && line.length > config.diffMaxLineLength)) { - currentFile.isTooBig = true; - currentFile.addedLines = 0; - currentFile.deletedLines = 0; - currentFile.blocks = []; - currentBlock = null; - const message = typeof config.diffTooBigMessage === "function" ? config.diffTooBigMessage(files.length) : "Diff too big to be displayed"; - startBlock(message); - return; - } - if (line.startsWith(oldFileNameHeader) && nxtLine.startsWith(newFileNameHeader) || line.startsWith(newFileNameHeader) && prevLine.startsWith(oldFileNameHeader)) { - if (currentFile && !currentFile.oldName && line.startsWith("--- ") && (values = getSrcFilename(line, config.srcPrefix))) { - currentFile.oldName = values; - currentFile.language = getExtension(currentFile.oldName, currentFile.language); - return; - } - if (currentFile && !currentFile.newName && line.startsWith("+++ ") && (values = getDstFilename(line, config.dstPrefix))) { - currentFile.newName = values; - currentFile.language = getExtension(currentFile.newName, currentFile.language); - return; - } - } - if (currentFile && (line.startsWith(hunkHeaderPrefix) || currentFile.isGitDiff && currentFile.oldName && currentFile.newName && !currentBlock)) { - startBlock(line); - return; - } - if (currentBlock && (line.startsWith("+") || line.startsWith("-") || line.startsWith(" "))) { - createLine(line); - return; - } - const doesNotExistHunkHeader = !existHunkHeader(line, lineIndex); - if (currentFile === null) { - throw new Error("Where is my file !!!"); - } - if (values = oldMode.exec(line)) { - currentFile.oldMode = values[1]; - } else if (values = newMode.exec(line)) { - currentFile.newMode = values[1]; - } else if (values = deletedFileMode.exec(line)) { - currentFile.deletedFileMode = values[1]; - currentFile.isDeleted = true; - } else if (values = newFileMode.exec(line)) { - currentFile.newFileMode = values[1]; - currentFile.isNew = true; - } else if (values = copyFrom.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.oldName = values[1]; - } - currentFile.isCopy = true; - } else if (values = copyTo.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.newName = values[1]; - } - currentFile.isCopy = true; - } else if (values = renameFrom.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.oldName = values[1]; - } - currentFile.isRename = true; - } else if (values = renameTo.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.newName = values[1]; - } - currentFile.isRename = true; - } else if (values = binaryFiles.exec(line)) { - currentFile.isBinary = true; - currentFile.oldName = getFilename(values[1], void 0, config.srcPrefix); - currentFile.newName = getFilename(values[2], void 0, config.dstPrefix); - startBlock("Binary file"); - } else if (binaryDiff.test(line)) { - currentFile.isBinary = true; - startBlock(line); - } else if (values = similarityIndex.exec(line)) { - currentFile.unchangedPercentage = parseInt(values[1], 10); - } else if (values = dissimilarityIndex.exec(line)) { - currentFile.changedPercentage = parseInt(values[1], 10); - } else if (values = index2.exec(line)) { - currentFile.checksumBefore = values[1]; - currentFile.checksumAfter = values[2]; - values[3] && (currentFile.mode = values[3]); - } else if (values = combinedIndex.exec(line)) { - currentFile.checksumBefore = [values[2], values[3]]; - currentFile.checksumAfter = values[1]; - } else if (values = combinedMode.exec(line)) { - currentFile.oldMode = [values[2], values[3]]; - currentFile.newMode = values[1]; - } else if (values = combinedNewFile.exec(line)) { - currentFile.newFileMode = values[1]; - currentFile.isNew = true; - } else if (values = combinedDeletedFile.exec(line)) { - currentFile.deletedFileMode = values[1]; - currentFile.isDeleted = true; - } - }); - saveBlock(); - saveFile(); - return files; -} - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/file-list-renderer.js -init_polyfill_buffer(); - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/render-utils.js -init_polyfill_buffer(); - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/rematch.js -init_polyfill_buffer(); -function levenshtein(a, b) { - if (a.length === 0) { - return b.length; - } - if (b.length === 0) { - return a.length; - } - const matrix = []; - let i; - for (i = 0; i <= b.length; i++) { - matrix[i] = [i]; - } - let j; - for (j = 0; j <= a.length; j++) { - matrix[0][j] = j; - } - for (i = 1; i <= b.length; i++) { - for (j = 1; j <= a.length; j++) { - if (b.charAt(i - 1) === a.charAt(j - 1)) { - matrix[i][j] = matrix[i - 1][j - 1]; - } else { - matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1)); - } - } - } - return matrix[b.length][a.length]; -} -function newDistanceFn(str) { - return (x, y) => { - const xValue = str(x).trim(); - const yValue = str(y).trim(); - const lev = levenshtein(xValue, yValue); - return lev / (xValue.length + yValue.length); - }; -} -function newMatcherFn(distance2) { - function findBestMatch(a, b, cache = /* @__PURE__ */ new Map()) { - let bestMatchDist = Infinity; - let bestMatch; - for (let i = 0; i < a.length; ++i) { - for (let j = 0; j < b.length; ++j) { - const cacheKey = JSON.stringify([a[i], b[j]]); - let md; - if (!(cache.has(cacheKey) && (md = cache.get(cacheKey)))) { - md = distance2(a[i], b[j]); - cache.set(cacheKey, md); - } - if (md < bestMatchDist) { - bestMatchDist = md; - bestMatch = { indexA: i, indexB: j, score: bestMatchDist }; - } - } - } - return bestMatch; - } - function group(a, b, level = 0, cache = /* @__PURE__ */ new Map()) { - const bm = findBestMatch(a, b, cache); - if (!bm || a.length + b.length < 3) { - return [[a, b]]; - } - const a1 = a.slice(0, bm.indexA); - const b1 = b.slice(0, bm.indexB); - const aMatch = [a[bm.indexA]]; - const bMatch = [b[bm.indexB]]; - const tailA = bm.indexA + 1; - const tailB = bm.indexB + 1; - const a2 = a.slice(tailA); - const b2 = b.slice(tailB); - const group1 = group(a1, b1, level + 1, cache); - const groupMatch = group(aMatch, bMatch, level + 1, cache); - const group2 = group(a2, b2, level + 1, cache); - let result = groupMatch; - if (bm.indexA > 0 || bm.indexB > 0) { - result = group1.concat(result); - } - if (a.length > tailA || b.length > tailB) { - result = result.concat(group2); - } - return result; - } - return group; -} - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/render-utils.js -var CSSLineClass = { - INSERTS: "d2h-ins", - DELETES: "d2h-del", - CONTEXT: "d2h-cntx", - INFO: "d2h-info", - INSERT_CHANGES: "d2h-ins d2h-change", - DELETE_CHANGES: "d2h-del d2h-change" -}; -var defaultRenderConfig = { - matching: LineMatchingType.NONE, - matchWordsThreshold: 0.25, - maxLineLengthHighlight: 1e4, - diffStyle: DiffStyleType.WORD -}; -var separator = "/"; -var distance = newDistanceFn((change) => change.value); -var matcher = newMatcherFn(distance); -function isDevNullName(name) { - return name.indexOf("dev/null") !== -1; -} -function removeInsElements(line) { - return line.replace(/(]*>((.|\n)*?)<\/ins>)/g, ""); -} -function removeDelElements(line) { - return line.replace(/(]*>((.|\n)*?)<\/del>)/g, ""); -} -function toCSSClass(lineType) { - switch (lineType) { - case LineType.CONTEXT: - return CSSLineClass.CONTEXT; - case LineType.INSERT: - return CSSLineClass.INSERTS; - case LineType.DELETE: - return CSSLineClass.DELETES; - } -} -function prefixLength(isCombined) { - return isCombined ? 2 : 1; -} -function escapeForHtml(str) { - return str.slice(0).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/"); -} -function deconstructLine(line, isCombined, escape = true) { - const indexToSplit = prefixLength(isCombined); - return { - prefix: line.substring(0, indexToSplit), - content: escape ? escapeForHtml(line.substring(indexToSplit)) : line.substring(indexToSplit) - }; -} -function filenameDiff(file) { - const oldFilename = unifyPath(file.oldName); - const newFilename = unifyPath(file.newName); - if (oldFilename !== newFilename && !isDevNullName(oldFilename) && !isDevNullName(newFilename)) { - const prefixPaths = []; - const suffixPaths = []; - const oldFilenameParts = oldFilename.split(separator); - const newFilenameParts = newFilename.split(separator); - const oldFilenamePartsSize = oldFilenameParts.length; - const newFilenamePartsSize = newFilenameParts.length; - let i = 0; - let j = oldFilenamePartsSize - 1; - let k = newFilenamePartsSize - 1; - while (i < j && i < k) { - if (oldFilenameParts[i] === newFilenameParts[i]) { - prefixPaths.push(newFilenameParts[i]); - i += 1; - } else { - break; - } - } - while (j > i && k > i) { - if (oldFilenameParts[j] === newFilenameParts[k]) { - suffixPaths.unshift(newFilenameParts[k]); - j -= 1; - k -= 1; - } else { - break; - } - } - const finalPrefix = prefixPaths.join(separator); - const finalSuffix = suffixPaths.join(separator); - const oldRemainingPath = oldFilenameParts.slice(i, j + 1).join(separator); - const newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator); - if (finalPrefix.length && finalSuffix.length) { - return finalPrefix + separator + "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}" + separator + finalSuffix; - } else if (finalPrefix.length) { - return finalPrefix + separator + "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}"; - } else if (finalSuffix.length) { - return "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}" + separator + finalSuffix; - } - return oldFilename + " \u2192 " + newFilename; - } else if (!isDevNullName(newFilename)) { - return newFilename; - } else { - return oldFilename; - } -} -function getHtmlId(file) { - return `d2h-${hashCode(filenameDiff(file)).toString().slice(-6)}`; -} -function getFileIcon(file) { - let templateName = "file-changed"; - if (file.isRename) { - templateName = "file-renamed"; - } else if (file.isCopy) { - templateName = "file-renamed"; - } else if (file.isNew) { - templateName = "file-added"; - } else if (file.isDeleted) { - templateName = "file-deleted"; - } else if (file.newName !== file.oldName) { - templateName = "file-renamed"; - } - return templateName; -} -function diffHighlight(diffLine1, diffLine2, isCombined, config = {}) { - const { matching, maxLineLengthHighlight, matchWordsThreshold, diffStyle } = Object.assign(Object.assign({}, defaultRenderConfig), config); - const line1 = deconstructLine(diffLine1, isCombined, false); - const line2 = deconstructLine(diffLine2, isCombined, false); - if (line1.content.length > maxLineLengthHighlight || line2.content.length > maxLineLengthHighlight) { - return { - oldLine: { - prefix: line1.prefix, - content: escapeForHtml(line1.content) - }, - newLine: { - prefix: line2.prefix, - content: escapeForHtml(line2.content) - } - }; - } - const diff2 = diffStyle === "char" ? diffChars(line1.content, line2.content) : diffWordsWithSpace(line1.content, line2.content); - const changedWords = []; - if (diffStyle === "word" && matching === "words") { - const removed = diff2.filter((element2) => element2.removed); - const added = diff2.filter((element2) => element2.added); - const chunks = matcher(added, removed); - chunks.forEach((chunk) => { - if (chunk[0].length === 1 && chunk[1].length === 1) { - const dist = distance(chunk[0][0], chunk[1][0]); - if (dist < matchWordsThreshold) { - changedWords.push(chunk[0][0]); - changedWords.push(chunk[1][0]); - } - } - }); - } - const highlightedLine = diff2.reduce((highlightedLine2, part) => { - const elemType = part.added ? "ins" : part.removed ? "del" : null; - const addClass = changedWords.indexOf(part) > -1 ? ' class="d2h-change"' : ""; - const escapedValue = escapeForHtml(part.value); - return elemType !== null ? `${highlightedLine2}<${elemType}${addClass}>${escapedValue}` : `${highlightedLine2}${escapedValue}`; - }, ""); - return { - oldLine: { - prefix: line1.prefix, - content: removeInsElements(highlightedLine) - }, - newLine: { - prefix: line2.prefix, - content: removeDelElements(highlightedLine) - } - }; -} - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/file-list-renderer.js -var baseTemplatesPath = "file-summary"; -var iconsBaseTemplatesPath = "icon"; -function render(diffFiles, hoganUtils) { - const files = diffFiles.map((file) => hoganUtils.render(baseTemplatesPath, "line", { - fileHtmlId: getHtmlId(file), - oldName: file.oldName, - newName: file.newName, - fileName: filenameDiff(file), - deletedLines: "-" + file.deletedLines, - addedLines: "+" + file.addedLines - }, { - fileIcon: hoganUtils.template(iconsBaseTemplatesPath, getFileIcon(file)) - })).join("\n"); - return hoganUtils.render(baseTemplatesPath, "wrapper", { - filesNumber: diffFiles.length, - files - }); -} - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/line-by-line-renderer.js -init_polyfill_buffer(); -var defaultLineByLineRendererConfig = Object.assign(Object.assign({}, defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); -var genericTemplatesPath = "generic"; -var baseTemplatesPath2 = "line-by-line"; -var iconsBaseTemplatesPath2 = "icon"; -var tagsBaseTemplatesPath = "tag"; -var LineByLineRenderer = class { - constructor(hoganUtils, config = {}) { - this.hoganUtils = hoganUtils; - this.config = Object.assign(Object.assign({}, defaultLineByLineRendererConfig), config); - } - render(diffFiles) { - const diffsHtml = diffFiles.map((file) => { - let diffs; - if (file.blocks.length) { - diffs = this.generateFileHtml(file); - } else { - diffs = this.generateEmptyDiff(); - } - return this.makeFileDiffHtml(file, diffs); - }).join("\n"); - return this.hoganUtils.render(genericTemplatesPath, "wrapper", { content: diffsHtml }); - } - makeFileDiffHtml(file, diffs) { - if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) - return ""; - const fileDiffTemplate = this.hoganUtils.template(baseTemplatesPath2, "file-diff"); - const filePathTemplate = this.hoganUtils.template(genericTemplatesPath, "file-path"); - const fileIconTemplate = this.hoganUtils.template(iconsBaseTemplatesPath2, "file"); - const fileTagTemplate = this.hoganUtils.template(tagsBaseTemplatesPath, getFileIcon(file)); - return fileDiffTemplate.render({ - file, - fileHtmlId: getHtmlId(file), - diffs, - filePath: filePathTemplate.render({ - fileDiffName: filenameDiff(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) - }); - } - generateEmptyDiff() { - return this.hoganUtils.render(genericTemplatesPath, "empty-diff", { - contentClass: "d2h-code-line", - CSSLineClass - }); - } - generateFileHtml(file) { - const matcher2 = newMatcherFn(newDistanceFn((e) => deconstructLine(e.content, file.isCombined).content)); - return file.blocks.map((block) => { - let lines = this.hoganUtils.render(genericTemplatesPath, "block-header", { - CSSLineClass, - blockHeader: file.isTooBig ? block.header : escapeForHtml(block.header), - lineClass: "d2h-code-linenumber", - contentClass: "d2h-code-line" - }); - this.applyLineGroupping(block).forEach(([contextLines, oldLines, newLines]) => { - if (oldLines.length && newLines.length && !contextLines.length) { - this.applyRematchMatching(oldLines, newLines, matcher2).map(([oldLines2, newLines2]) => { - const { left, right } = this.processChangedLines(file, file.isCombined, oldLines2, newLines2); - lines += left; - lines += right; - }); - } else if (contextLines.length) { - contextLines.forEach((line) => { - const { prefix, content } = deconstructLine(line.content, file.isCombined); - lines += this.generateSingleLineHtml(file, { - type: CSSLineClass.CONTEXT, - prefix, - content, - oldNumber: line.oldNumber, - newNumber: line.newNumber - }); - }); - } else if (oldLines.length || newLines.length) { - const { left, right } = this.processChangedLines(file, file.isCombined, oldLines, newLines); - lines += left; - lines += right; - } else { - console.error("Unknown state reached while processing groups of lines", contextLines, oldLines, newLines); - } - }); - return lines; - }).join("\n"); - } - applyLineGroupping(block) { - const blockLinesGroups = []; - let oldLines = []; - let newLines = []; - for (let i = 0; i < block.lines.length; i++) { - const diffLine = block.lines[i]; - if (diffLine.type !== LineType.INSERT && newLines.length || diffLine.type === LineType.CONTEXT && oldLines.length > 0) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - if (diffLine.type === LineType.CONTEXT) { - blockLinesGroups.push([[diffLine], [], []]); - } else if (diffLine.type === LineType.INSERT && oldLines.length === 0) { - blockLinesGroups.push([[], [], [diffLine]]); - } else if (diffLine.type === LineType.INSERT && oldLines.length > 0) { - newLines.push(diffLine); - } else if (diffLine.type === LineType.DELETE) { - oldLines.push(diffLine); - } - } - if (oldLines.length || newLines.length) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - return blockLinesGroups; - } - applyRematchMatching(oldLines, newLines, matcher2) { - const comparisons = oldLines.length * newLines.length; - const maxLineSizeInBlock = Math.max.apply(null, [0].concat(oldLines.concat(newLines).map((elem) => elem.content.length))); - const doMatching = comparisons < this.config.matchingMaxComparisons && maxLineSizeInBlock < this.config.maxLineSizeInBlockForComparison && (this.config.matching === "lines" || this.config.matching === "words"); - return doMatching ? matcher2(oldLines, newLines) : [[oldLines, newLines]]; - } - processChangedLines(file, isCombined, oldLines, newLines) { - const fileHtml = { - right: "", - left: "" - }; - const maxLinesNumber = Math.max(oldLines.length, newLines.length); - for (let i = 0; i < maxLinesNumber; i++) { - const oldLine = oldLines[i]; - const newLine = newLines[i]; - const diff2 = oldLine !== void 0 && newLine !== void 0 ? diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; - const preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? Object.assign(Object.assign({}, diff2 !== void 0 ? { - prefix: diff2.oldLine.prefix, - content: diff2.oldLine.content, - type: CSSLineClass.DELETE_CHANGES - } : Object.assign(Object.assign({}, deconstructLine(oldLine.content, isCombined)), { type: toCSSClass(oldLine.type) })), { oldNumber: oldLine.oldNumber, newNumber: oldLine.newNumber }) : void 0; - const preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? Object.assign(Object.assign({}, diff2 !== void 0 ? { - prefix: diff2.newLine.prefix, - content: diff2.newLine.content, - type: CSSLineClass.INSERT_CHANGES - } : Object.assign(Object.assign({}, deconstructLine(newLine.content, isCombined)), { type: toCSSClass(newLine.type) })), { oldNumber: newLine.oldNumber, newNumber: newLine.newNumber }) : void 0; - const { left, right } = this.generateLineHtml(file, preparedOldLine, preparedNewLine); - fileHtml.left += left; - fileHtml.right += right; - } - return fileHtml; - } - generateLineHtml(file, oldLine, newLine) { - return { - left: this.generateSingleLineHtml(file, oldLine), - right: this.generateSingleLineHtml(file, newLine) - }; - } - generateSingleLineHtml(file, line) { - if (line === void 0) - return ""; - const lineNumberHtml = this.hoganUtils.render(baseTemplatesPath2, "numbers", { - oldNumber: line.oldNumber || "", - newNumber: line.newNumber || "" - }); - return this.hoganUtils.render(genericTemplatesPath, "line", { - type: line.type, - lineClass: "d2h-code-linenumber", - contentClass: "d2h-code-line", - prefix: line.prefix === " " ? " " : line.prefix, - content: line.content, - lineNumber: lineNumberHtml, - line, - file - }); - } -}; - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/side-by-side-renderer.js -init_polyfill_buffer(); -var defaultSideBySideRendererConfig = Object.assign(Object.assign({}, defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); -var genericTemplatesPath2 = "generic"; -var baseTemplatesPath3 = "side-by-side"; -var iconsBaseTemplatesPath3 = "icon"; -var tagsBaseTemplatesPath2 = "tag"; -var SideBySideRenderer = class { - constructor(hoganUtils, config = {}) { - this.hoganUtils = hoganUtils; - this.config = Object.assign(Object.assign({}, defaultSideBySideRendererConfig), config); - } - render(diffFiles) { - const diffsHtml = diffFiles.map((file) => { - let diffs; - if (file.blocks.length) { - diffs = this.generateFileHtml(file); - } else { - diffs = this.generateEmptyDiff(); - } - return this.makeFileDiffHtml(file, diffs); - }).join("\n"); - return this.hoganUtils.render(genericTemplatesPath2, "wrapper", { content: diffsHtml }); - } - makeFileDiffHtml(file, diffs) { - if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) - return ""; - const fileDiffTemplate = this.hoganUtils.template(baseTemplatesPath3, "file-diff"); - const filePathTemplate = this.hoganUtils.template(genericTemplatesPath2, "file-path"); - const fileIconTemplate = this.hoganUtils.template(iconsBaseTemplatesPath3, "file"); - const fileTagTemplate = this.hoganUtils.template(tagsBaseTemplatesPath2, getFileIcon(file)); - return fileDiffTemplate.render({ - file, - fileHtmlId: getHtmlId(file), - diffs, - filePath: filePathTemplate.render({ - fileDiffName: filenameDiff(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) - }); - } - generateEmptyDiff() { - return { - right: "", - left: this.hoganUtils.render(genericTemplatesPath2, "empty-diff", { - contentClass: "d2h-code-side-line", - CSSLineClass - }) - }; - } - generateFileHtml(file) { - const matcher2 = newMatcherFn(newDistanceFn((e) => deconstructLine(e.content, file.isCombined).content)); - return file.blocks.map((block) => { - const fileHtml = { - left: this.makeHeaderHtml(block.header, file), - right: this.makeHeaderHtml("") - }; - this.applyLineGroupping(block).forEach(([contextLines, oldLines, newLines]) => { - if (oldLines.length && newLines.length && !contextLines.length) { - this.applyRematchMatching(oldLines, newLines, matcher2).map(([oldLines2, newLines2]) => { - const { left, right } = this.processChangedLines(file.isCombined, oldLines2, newLines2); - fileHtml.left += left; - fileHtml.right += right; - }); - } else if (contextLines.length) { - contextLines.forEach((line) => { - const { prefix, content } = deconstructLine(line.content, file.isCombined); - const { left, right } = this.generateLineHtml({ - type: CSSLineClass.CONTEXT, - prefix, - content, - number: line.oldNumber - }, { - type: CSSLineClass.CONTEXT, - prefix, - content, - number: line.newNumber - }); - fileHtml.left += left; - fileHtml.right += right; - }); - } else if (oldLines.length || newLines.length) { - const { left, right } = this.processChangedLines(file.isCombined, oldLines, newLines); - fileHtml.left += left; - fileHtml.right += right; - } else { - console.error("Unknown state reached while processing groups of lines", contextLines, oldLines, newLines); - } - }); - return fileHtml; - }).reduce((accomulated, html2) => { - return { left: accomulated.left + html2.left, right: accomulated.right + html2.right }; - }, { left: "", right: "" }); - } - applyLineGroupping(block) { - const blockLinesGroups = []; - let oldLines = []; - let newLines = []; - for (let i = 0; i < block.lines.length; i++) { - const diffLine = block.lines[i]; - if (diffLine.type !== LineType.INSERT && newLines.length || diffLine.type === LineType.CONTEXT && oldLines.length > 0) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - if (diffLine.type === LineType.CONTEXT) { - blockLinesGroups.push([[diffLine], [], []]); - } else if (diffLine.type === LineType.INSERT && oldLines.length === 0) { - blockLinesGroups.push([[], [], [diffLine]]); - } else if (diffLine.type === LineType.INSERT && oldLines.length > 0) { - newLines.push(diffLine); - } else if (diffLine.type === LineType.DELETE) { - oldLines.push(diffLine); - } - } - if (oldLines.length || newLines.length) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - return blockLinesGroups; - } - applyRematchMatching(oldLines, newLines, matcher2) { - const comparisons = oldLines.length * newLines.length; - const maxLineSizeInBlock = Math.max.apply(null, [0].concat(oldLines.concat(newLines).map((elem) => elem.content.length))); - const doMatching = comparisons < this.config.matchingMaxComparisons && maxLineSizeInBlock < this.config.maxLineSizeInBlockForComparison && (this.config.matching === "lines" || this.config.matching === "words"); - return doMatching ? matcher2(oldLines, newLines) : [[oldLines, newLines]]; - } - makeHeaderHtml(blockHeader, file) { - return this.hoganUtils.render(genericTemplatesPath2, "block-header", { - CSSLineClass, - blockHeader: (file === null || file === void 0 ? void 0 : file.isTooBig) ? blockHeader : escapeForHtml(blockHeader), - lineClass: "d2h-code-side-linenumber", - contentClass: "d2h-code-side-line" - }); - } - processChangedLines(isCombined, oldLines, newLines) { - const fileHtml = { - right: "", - left: "" - }; - const maxLinesNumber = Math.max(oldLines.length, newLines.length); - for (let i = 0; i < maxLinesNumber; i++) { - const oldLine = oldLines[i]; - const newLine = newLines[i]; - const diff2 = oldLine !== void 0 && newLine !== void 0 ? diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; - const preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? Object.assign(Object.assign({}, diff2 !== void 0 ? { - prefix: diff2.oldLine.prefix, - content: diff2.oldLine.content, - type: CSSLineClass.DELETE_CHANGES - } : Object.assign(Object.assign({}, deconstructLine(oldLine.content, isCombined)), { type: toCSSClass(oldLine.type) })), { number: oldLine.oldNumber }) : void 0; - const preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? Object.assign(Object.assign({}, diff2 !== void 0 ? { - prefix: diff2.newLine.prefix, - content: diff2.newLine.content, - type: CSSLineClass.INSERT_CHANGES - } : Object.assign(Object.assign({}, deconstructLine(newLine.content, isCombined)), { type: toCSSClass(newLine.type) })), { number: newLine.newNumber }) : void 0; - const { left, right } = this.generateLineHtml(preparedOldLine, preparedNewLine); - fileHtml.left += left; - fileHtml.right += right; - } - return fileHtml; - } - generateLineHtml(oldLine, newLine) { - return { - left: this.generateSingleHtml(oldLine), - right: this.generateSingleHtml(newLine) - }; - } - generateSingleHtml(line) { - const lineClass = "d2h-code-side-linenumber"; - const contentClass = "d2h-code-side-line"; - return this.hoganUtils.render(genericTemplatesPath2, "line", { - type: (line === null || line === void 0 ? void 0 : line.type) || `${CSSLineClass.CONTEXT} d2h-emptyplaceholder`, - lineClass: line !== void 0 ? lineClass : `${lineClass} d2h-code-side-emptyplaceholder`, - contentClass: line !== void 0 ? contentClass : `${contentClass} d2h-code-side-emptyplaceholder`, - prefix: (line === null || line === void 0 ? void 0 : line.prefix) === " " ? " " : line === null || line === void 0 ? void 0 : line.prefix, - content: line === null || line === void 0 ? void 0 : line.content, - lineNumber: line === null || line === void 0 ? void 0 : line.number - }); - } -}; - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/hoganjs-utils.js -init_polyfill_buffer(); -var Hogan3 = __toESM(require_hogan()); - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff2html-templates.js -init_polyfill_buffer(); -var Hogan2 = __toESM(require_hogan()); -var defaultTemplates = {}; -defaultTemplates["file-summary-line"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
  • '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(t.rp("'); - t.b(t.v(t.f("fileName", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b(t.v(t.f("addedLines", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b(t.v(t.f("deletedLines", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
  • "); - return t.fl(); -}, partials: { "'); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' Files changed ('); - t.b(t.v(t.f("filesNumber", c, p, 0))); - t.b(")"); - t.b("\n" + i); - t.b(' hide'); - t.b("\n" + i); - t.b(' show'); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
      '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("files", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["generic-block-header"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - if (t.s(t.f("blockHeader", c, p, 1), c, p, 0, 156, 173, "{{ }}")) { - t.rs(c, p, function(c2, p2, t2) { - t2.b(t2.t(t2.f("blockHeader", c2, p2, 0))); - }); - c.pop(); - } - if (!t.s(t.f("blockHeader", c, p, 1), c, p, 1, 0, 0, "")) { - t.b(" "); - } - ; - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["generic-empty-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" File without changes"); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["generic-file-path"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(''); - t.b("\n" + i); - t.b(t.rp("'); - t.b(t.v(t.f("fileDiffName", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(t.rp(""); - t.b("\n" + i); - t.b('"); - return t.fl(); -}, partials: { ""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("lineNumber", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - if (t.s(t.f("prefix", c, p, 1), c, p, 0, 162, 238, "{{ }}")) { - t.rs(c, p, function(c2, p2, t2) { - t2.b(' '); - t2.b(t2.t(t2.f("prefix", c2, p2, 0))); - t2.b(""); - t2.b("\n" + i); - }); - c.pop(); - } - if (!t.s(t.f("prefix", c, p, 1), c, p, 1, 0, 0, "")) { - t.b('  '); - t.b("\n" + i); - } - ; - if (t.s(t.f("content", c, p, 1), c, p, 0, 371, 445, "{{ }}")) { - t.rs(c, p, function(c2, p2, t2) { - t2.b(' '); - t2.b(t2.t(t2.f("content", c2, p2, 0))); - t2.b(""); - t2.b("\n" + i); - }); - c.pop(); - } - if (!t.s(t.f("content", c, p, 1), c, p, 1, 0, 0, "")) { - t.b('
    '); - t.b("\n" + i); - } - ; - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["generic-wrapper"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("content", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["icon-file-added"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["icon-file-changed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["icon-file-deleted"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["icon-file-renamed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["icon-file"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["line-by-line-file-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("filePath", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("diffs", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["line-by-line-numbers"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b(t.v(t.f("oldNumber", c, p, 0))); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b(t.v(t.f("newNumber", c, p, 0))); - t.b("
    "); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["side-by-side-file-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("filePath", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.d("diffs.left", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.d("diffs.right", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["tag-file-added"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('ADDED'); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["tag-file-changed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('CHANGED'); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["tag-file-deleted"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('DELETED'); - return t.fl(); -}, partials: {}, subs: {} }); -defaultTemplates["tag-file-renamed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('RENAMED'); - return t.fl(); -}, partials: {}, subs: {} }); - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/hoganjs-utils.js -var HoganJsUtils = class { - constructor({ compiledTemplates = {}, rawTemplates = {} }) { - const compiledRawTemplates = Object.entries(rawTemplates).reduce((previousTemplates, [name, templateString]) => { - const compiledTemplate = Hogan3.compile(templateString, { asString: false }); - return Object.assign(Object.assign({}, previousTemplates), { [name]: compiledTemplate }); - }, {}); - this.preCompiledTemplates = Object.assign(Object.assign(Object.assign({}, defaultTemplates), compiledTemplates), compiledRawTemplates); - } - static compile(templateString) { - return Hogan3.compile(templateString, { asString: false }); - } - render(namespace, view, params, partials, indent2) { - const templateKey = this.templateKey(namespace, view); - try { - const template = this.preCompiledTemplates[templateKey]; - return template.render(params, partials, indent2); - } catch (e) { - throw new Error(`Could not find template to render '${templateKey}'`); - } - } - template(namespace, view) { - return this.preCompiledTemplates[this.templateKey(namespace, view)]; - } - templateKey(namespace, view) { - return `${namespace}-${view}`; - } -}; - -// node_modules/.pnpm/diff2html@3.4.41/node_modules/diff2html/lib-esm/diff2html.js -var defaultDiff2HtmlConfig = Object.assign(Object.assign(Object.assign({}, defaultLineByLineRendererConfig), defaultSideBySideRendererConfig), { outputFormat: OutputFormatType.LINE_BY_LINE, drawFileList: true }); -function html(diffInput, configuration = {}) { - const config = Object.assign(Object.assign({}, defaultDiff2HtmlConfig), configuration); - const diffJson = typeof diffInput === "string" ? parse(diffInput, config) : diffInput; - const hoganUtils = new HoganJsUtils(config); - const fileList = config.drawFileList ? render(diffJson, hoganUtils) : ""; - const diffOutput = config.outputFormat === "side-by-side" ? new SideBySideRenderer(hoganUtils, config).render(diffJson) : new LineByLineRenderer(hoganUtils, config).render(diffJson); - return fileList + diffOutput; -} - -// src/ui/diff/diffView.ts -var import_obsidian17 = require("obsidian"); -var DiffView = class extends import_obsidian17.ItemView { - constructor(leaf, plugin) { - super(leaf); - this.plugin = plugin; - this.gettingDiff = false; - this.gitRefreshBind = this.refresh.bind(this); - this.gitViewRefreshBind = this.refresh.bind(this); - this.parser = new DOMParser(); - this.navigation = true; - addEventListener("git-refresh", this.gitRefreshBind); - addEventListener("git-view-refresh", this.gitViewRefreshBind); - } - getViewType() { - return DIFF_VIEW_CONFIG.type; - } - getDisplayText() { - var _a2; - if (((_a2 = this.state) == null ? void 0 : _a2.file) != null) { - let fileName = this.state.file.split("/").last(); - if (fileName == null ? void 0 : fileName.endsWith(".md")) - fileName = fileName.slice(0, -3); - return DIFF_VIEW_CONFIG.name + ` (${fileName})`; - } - return DIFF_VIEW_CONFIG.name; - } - getIcon() { - return DIFF_VIEW_CONFIG.icon; - } - async setState(state, result) { - this.state = state; - if (import_obsidian17.Platform.isMobile) { - this.leaf.view.titleEl.textContent = this.getDisplayText(); - } - await this.refresh(); - } - getState() { - return this.state; - } - onClose() { - removeEventListener("git-refresh", this.gitRefreshBind); - removeEventListener("git-view-refresh", this.gitViewRefreshBind); - return super.onClose(); - } - onOpen() { - this.refresh(); - return super.onOpen(); - } - async refresh() { - var _a2; - if (((_a2 = this.state) == null ? void 0 : _a2.file) && !this.gettingDiff && this.plugin.gitManager) { - this.gettingDiff = true; - try { - let diff2 = await this.plugin.gitManager.getDiffString( - this.state.file, - this.state.staged, - this.state.hash - ); - this.contentEl.empty(); - if (!diff2) { - if (this.plugin.gitManager instanceof SimpleGit && await this.plugin.gitManager.isTracked( - this.state.file - )) { - diff2 = [ - `--- ${this.state.file}`, - `+++ ${this.state.file}`, - "" - ].join("\n"); - } else { - const content = await this.app.vault.adapter.read( - this.plugin.gitManager.getVaultPath(this.state.file) - ); - const header = `--- /dev/null + style="background-color: ${a}; width: 30ch;" + >${o}`}`}previewCustomDateTimeDescriptionHtml(n){let r=(0,V.moment)().format(n);return`Format string to display the authoring date.
    Currently: ${r}`}previewOldestAgeDescriptionHtml(n){let r=xc(n);return[`The oldest age in the line author coloring. Everything older will have the same color. +
    Smallest valid age is "1d". Currently: ${r!==void 0?`${r.asDays()} days`:"invalid!"}`,r]}};function vp(t,e){return t==="oldest"?e.colorOld:e.colorNew}function xc(t){let e=V.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}function qS(t,e,n){if(!(t===void 0||e===void 0||n===void 0))return`head${t}-obj${e}-path${n}`}var XS=_c.Annotation.define();function YS(t,e,n){return n.update({annotations:XS.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}function uL(t){return t.annotation(XS)}var sa=_c.StateField.define({create:t=>{},update:(t,e)=>{var n;return(n=uL(e))!=null?n:fL(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function Sc(t){var a;let e=WS.sha256.create();if(!t)return e;let{la:n,key:r,lineOffsetsFromUnsavedChanges:i}=t;e.update(n==="untracked"?"t":"f"),e.update(r);for(let[s,o]of(a=i.entries())!=null?a:[])e.update([s,o]);return e}var an={get:void 0,save:void 0};function ZS(t,e){an.get=t,an.save=e}function Ec(t){var e,n;return(n=(e=xc(t.coloringMaxAge))==null?void 0:e.asDays())!=null?n:xc(Mn.lineAuthor.coloringMaxAge).asDays()}function fL(t,e){if(e)return t.changes.empty||t.changes.iterChanges((n,r,i,a)=>{var p;let s=t.startState.doc,{newDoc:o}=t,l=s.lineAt(n).number,c=s.lineAt(r).number,u=o.lineAt(i).number,f=o.lineAt(a).number,h=c-l+1,d=f-u+1;for(let g=u;g<=f;g++){let m=(p=e.lineOffsetsFromUnsavedChanges.get(g))!=null?p:0,w=f===g,b=d-h;w&&(m+=b),e.lineOffsetsFromUnsavedChanges.set(g,m)}}),e}var bp=class{constructor(e){this.state=e;this.subscribeMe()}notifyLineAuthoring(e,n){if(this.view===void 0){console.warn(`Git: View is not defined for editor cache key. Unforeseen situation. id: ${e}`);return}let r=this.view.state,i=YS(e,n,r);this.view.dispatch(i)}updateToNewState(e){let n=this.lastSeenPath&&this.filepath!=this.lastSeenPath;return this.state=e,n&&(this.unsubscribeMe(this.lastSeenPath),this.subscribeMe()),this}removeIfStale(){this.view.destroyed&&this.unsubscribeMe(this.lastSeenPath)}subscribeMe(){this.filepath!==void 0&&(aa.ifFilepathDefinedTransformSubscribers(this.filepath,e=>e.add(this)),this.lastSeenPath=this.filepath)}unsubscribeMe(e){aa.ifFilepathDefinedTransformSubscribers(e,n=>n.delete(this))}get filepath(){var e,n;return(n=(e=this.state.field(kc.editorInfoField))==null?void 0:e.file)==null?void 0:n.path}get view(){return this.state.field(kc.editorEditorField)}},JS=KS.StateField.define({create:t=>new bp(t),update:(t,e)=>t.updateToNewState(e.state),compare:(t,e)=>t===e});v();function QS(){oa=void 0,xp=[],Ac=0,Cc.clear(),Fc.clear(),la.clear()}var oa,Tc=()=>oa;function eE(t,e){var i;let n=e.length;if(n<((i=oa==null?void 0:oa.length)!=null?i:0))return;oa={gutter:t,length:n,text:e};let r=an.get();n!==r.gutterSpacingFallbackLength&&(r.gutterSpacingFallbackLength=n,an.save(r))}var xp=[],hL=15,Ac=0;function tE(t){xp[Ac]=t,Ac=(Ac+1)%hL}function nE(){return TS(xp)}var Cc=new Map,Fc=new Map,la=new Set;v();var mE=require("@codemirror/state"),gE=require("@codemirror/view");v();var kp=require("@codemirror/view"),fE=Ze(cp()),Pc=require("obsidian");v();v();var Mc={x:-10,y:-10};function rE(){Mc.x===-10&&window.addEventListener("mousedown",t=>{Mc.x=t.clientX,Mc.y=t.clientY})}function iE(){for(let t of la)if(dL(t,Mc))return t}function dL(t,e){let{x:n,y:r,width:i,height:a}=t.getBoundingClientRect();return n<=e.x&&e.x<=n+i&&r<=e.y&&e.y<=r+a}v();var Gs={};var aE="data-commit";function sE(t,e,n){if(e.hasFocus())return;let r=iE();if(!r)return;let i=mL(r);i&&(!i.isZeroCommit&&!i.isWaitingGutter&&pL(i,t),_p("showCommitHash",t),_p("authorDisplay",t),_p("dateTimeFormatOptions",t))}function pL(t,e){e.addItem(n=>n.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick(r=>navigator.clipboard.writeText(t.hash)))}function _p(t,e){var l,c;let n,r,i=Gs.plugin.settings.lineAuthor,a=i[t],s=typeof a=="boolean"?a:a!=="hide",o=Mn.lineAuthor[t];if(t==="showCommitHash")n="Show commit hash",r=a;else if(t==="authorDisplay"){let u=(l=i.lastShownAuthorDisplay)!=null?l:o;n="Show author "+(s?a:u),r=s?"hide":u}else if(t==="dateTimeFormatOptions"){let u=(c=i.lastShownDateTimeFormatOptions)!=null?c:o;n="Show "+(s?a:u),n+=n.contains("date")?"":" date",r=s?"hide":u}else yr(t);e.addItem(u=>u.setTitle(n).setSection("obs-git-line-author-configure").setChecked(s).onClick(f=>{var h,d;return(d=(h=Gs.plugin)==null?void 0:h.settingsTab)==null?void 0:d.lineAuthorSettingHandler(t,r)}))}function oE(t,e,n){n.setAttr(aE,JSON.stringify({hash:t.hash,isZeroCommit:t.isZeroCommit,isWaitingGutter:e}))}function mL(t){let e=t.getAttr(aE);return e?JSON.parse(e):void 0}v();function wp(t,e){return t==="oldest"?Oc(0,!1,e).color:Oc(void 0,!0,e).color}function Oc(t,e,n){let r=Ec(n),i=Date.now()/1e3,a=t!=null?t:0,o=(e?0:i-a)/60/60/24,l=Math.pow(Math.clamp(o/r,0,1),1/2.3),c=gL(),u=n.colorNew,f=n.colorOld,h=c?.4:1,d=Sp(u.r,f.r,l)*h,p=Sp(u.g,f.g,l)*h,g=Sp(u.b,f.b,l)*h;return{color:`rgba(${d},${p},${g},${c?.75:.25})`,daysSinceCommit:o}}function Sp(t,e,n){return t+(e-t)*n}function gL(){var t;return((t=window.app)==null?void 0:t.getTheme())==="obsidian"}function lE(t){document.body.style.setProperty("--obs-git-gutter-text",t.textColorCss)}v();function cE(t,e,n){let r;for(let i=e;i<=n;i++){let a=t.hashPerLine[i],s=t.commits.get(a);(!r||s.isZeroCommit||yL(s,r))&&(r=s)}return r}function yL(t,e){var i,a,s,o;let n=(a=(i=t.author)==null?void 0:i.epochSeconds)!=null?a:0,r=(o=(s=e.author)==null?void 0:s.epochSeconds)!=null?o:0;return n>r}var uE="-",vL="+",wL=3,bL="*",xL=/\S/g,_L="%",ca=class t extends kp.GutterMarker{constructor(n){super();this.text=n}eq(n){return n instanceof t&&this.text===n.text}toDOM(){return document.createTextNode(this.text)}destroy(n){document.body.contains(n)||n.remove()}},Ep=class extends kp.GutterMarker{constructor(n,r,i,a,s,o){super();this.lineAuthoring=n;this.startLine=r;this.endLine=i;this.key=a;this.settings=s;this.options=o;this.point=!1;this.elementClass="obs-git-blame-gutter"}eq(n){return this.key===(n==null?void 0:n.key)&&this.startLine===(n==null?void 0:n.startLine)&&this.endLine===(n==null?void 0:n.endLine)&&(this==null?void 0:this.options)===(n==null?void 0:n.options)}toDOM(){var n;return this.precomputedDomProvider=(n=this.precomputedDomProvider)!=null?n:this.computeDom(),this.precomputedDomProvider()}destroy(n){document.body.contains(n)||(n.remove(),la.delete(n))}computeDom(){let n=cE(this.lineAuthoring,this.startLine,this.endLine),r=n.isZeroCommit?"":this.renderNonZeroCommit(n);return!n.isZeroCommit&&this.options!=="waiting-for-result"?eE(this,r):r=this.adaptTextForFakeCommit(n,r,this.options),this.createHtmlNode(n,r,this.options==="waiting-for-result")}createHtmlNode(n,r,i){var c;let a=window.createDiv();a.innerText=r;let{color:s,daysSinceCommit:o}=Oc((c=n==null?void 0:n.author)==null?void 0:c.epochSeconds,n==null?void 0:n.isZeroCommit,this.settings);a.style.backgroundColor=s,oE(n,i,a);function l(){let u=a.cloneNode(!0);return la.add(u),i||tE(o),u}return l}renderNonZeroCommit(n){let r=this.settings.showCommitHash?this.renderHash(n):"",i=this.settings.authorDisplay==="hide"?"":`${this.renderAuthorName(n,this.settings.authorDisplay)}`,a=this.settings.dateTimeFormatOptions==="hide"?"":`${this.renderAuthoringDate(n,this.settings.dateTimeFormatOptions,this.settings.dateTimeFormatCustomString,this.settings.dateTimeTimezone)}`;return[r,i,a].filter(o=>o.length>=1).join(" ")}renderHash(n){return n.hash.substring(0,6)}renderAuthorName(n,r){var o,l,c,u;let i=(l=(o=n==null?void 0:n.author)==null?void 0:o.name)!=null?l:"",a=i.split(" ").filter(f=>f.length>=1),s;switch(r){case"initials":s=a.map(f=>f[0].toUpperCase()).join("");break;case"first name":s=(c=a.first())!=null?c:uE;break;case"last name":s=(u=a.last())!=null?u:uE;break;case"full":s=i;break;default:return yr(r)}return CS(n==null?void 0:n.author,n==null?void 0:n.committer)||(s=s+bL),s}renderAuthoringDate(n,r,i,a){var c;let s="?";if(((c=n==null?void 0:n.author)==null?void 0:c.epochSeconds)===void 0)return s;let o;switch(r){case"date":o=_l;break;case"datetime":o=jh;break;case"custom":o=i;break;case"natural language":o=u=>{let f=u.diff((0,Pc.moment)());return Pc.moment.duration(f).humanize(!0)};break;default:return yr(r)}let l=Pc.moment.unix(n.author.epochSeconds);switch(a){case"viewer-local":break;case"author-local":l=l.utcOffset(n.author.tz),typeof o=="string"&&(o+=" Z");break;case"utc0000":l=l.utc(),typeof o=="string"&&(o+="[Z]");break;default:return yr(a)}return typeof o=="string"?l.format(o):o(l)}adaptTextForFakeCommit(n,r,i){var l,c,u,f;let a=(c=(l=Tc())==null?void 0:l.text)!=null?c:r,s=i!=="waiting-for-result"&&n.isZeroCommit?vL:_L;r=a.replace(xL,s);let o=(f=(u=an.get())==null?void 0:u.gutterSpacingFallbackLength)!=null?f:r.length;if(r=FS(r,o,s),i!=="waiting-for-result"&&n.isZeroCommit){let h=Math.min(o,wL);r=MS(r,o-h)}return r}};function ei(t,e,n,r,i,a){let s=fE.sha256.create();s.update(Object.values(i).join(",")),s.update(`s${e}-e${n}-k${r}-o${a}`);let o=s.hex(),l=Cc.get(o);if(l)return l;let c=new Ep(t,e,n,r,i,a);return Cc.set(o,c),c}v();var hE=require("obsidian");function Ap(){var e,n;let t=(n=(e=an.get())==null?void 0:e.gutterSpacingFallbackLength)!=null?n:Mn.lineAuthor.gutterSpacingFallbackLength;return new ca(Array(t).fill("-").join(""))}function Tp(t){let{lineAuthoring:e,ageForInitialRender:n}=SL(t);return ei(e,1,1,"initialGutter"+n,t,"waiting-for-result")}function SL(t){var a;let e=(a=nE())!=null?a:Ec(t)*.25,n=(0,hE.moment)().add(-e,"days"),r={name:"",epochSeconds:AS(n),tz:"+0000"},i={hash:"waiting-for-result",author:r,committer:r,isZeroCommit:!1};return{lineAuthoring:{hashPerLine:[void 0,"waiting-for-result"],commits:new Map([["waiting-for-result",i]])},ageForInitialRender:e}}v();function dE(t,e){return ei({hashPerLine:[void 0,"000000"],commits:new Map([["000000",jS]])},1,1,t,e)}var Cp=new ca(""),yE=(0,gE.gutter)({class:"line-author-gutter-container",markers(t){let e=t.state.field(sa,!1);return EL(t,e)},lineMarkerChange(t){let e=Sc(t.state.field(sa));return Sc(t.startState.field(sa))!==e},renderEmptyElements:!0,initialSpacer:t=>(pE(t),Ap()),updateSpacer:(t,e)=>{var n,r;return pE(e.view),(r=(n=Tc())==null?void 0:n.gutter)!=null?r:Ap()}});function EL(t,e){let n=Sc(e),r=t.state.doc,i=new Map;for(let u=1;u<=r.lines;u++){let f=r.line(u).from,h=t.lineBlockAt(f).to;i.set(u,[f,h]),n.update([f,h,0])}let a=an.get();n.update("s"+Object.values(an).join(","));let s=n.hex(),o=Fc.get(s);if(o)return o;let{result:l,allowCache:c}=kL(r,i,a,e);return c&&Fc.set(s,l),l}function kL(t,e,n,r){let i=!0,a=t.lines,s=[];function o(f,h,d){return s.push(d.range(f,h))}let l=AL(a,r),c=t.length===0,u=t.iterLines(a,a+1).next().value==="";for(let f=1;f<=a;f++){let[h,d]=e.get(f),p=t.lineAt(d).number;if(c){o(h,d,Cp);continue}if(f===a&&u){o(h,d,Cp);continue}if(r===void 0){o(h,d,Tp(n)),i=!1;continue}let{key:g,la:m}=r;if(m==="untracked"){o(h,d,dE(m,n));continue}let w=m.hashPerLine.length-1,b=l[f],S=l[p];if(S&&S>w&&o(h,d,Cp),b!==void 0&&sp(1,b,w)&&S!==void 0&&sp(1,S,w)){o(h,d,ei(m,b,S,g,n));continue}if(w<1){o(h,d,Tp(n)),i=!1;continue}let k=Math.clamp(b!=null?b:f,1,w),x=Math.clamp(S!=null?S:p,1,w);o(h,d,ei(m,k,x,g+"computing",n,"waiting-for-result"))}return{result:mE.RangeSet.of(s,!0),allowCache:i}}function AL(t,e){if(!(e!=null&&e.lineOffsetsFromUnsavedChanges))return Array.from(new Array(t+1),i=>i);let n=[void 0],r=0;for(let i=1;i<=t;i++){let a=e.lineOffsetsFromUnsavedChanges.get(i);r+=a!=null?a:0,n[i]=a===void 0?i-r:void 0}return n}function pE(t){t.dom.querySelectorAll(".cm-gutters").forEach(n=>{n!=null&&n.style&&(n.style.marginLeft||(n.style.marginLeft="unset"))})}var Ic=class{constructor(e){this.plugin=e;this.lineAuthorings=new Map}async trackChanged(e){return this.trackChangedHelper(e).catch(n=>(console.warn("Git: Error in trackChanged."+n),Promise.reject(n)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeLineAuthorInfo(e.path)}}destroy(){this.lineAuthorings.clear(),aa.clear(),QS()}async computeLineAuthorInfo(e){let n=this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager,r=await n.submoduleAwareHeadRevisonInContainingDirectory(e),i=await n.hashObject(e),a=qS(r,i,e);if(a!==void 0){if(!this.lineAuthorings.has(a)){let s=await n.blame(e,this.plugin.settings.lineAuthor.followMovement,this.plugin.settings.lineAuthor.ignoreWhitespace);this.lineAuthorings.set(a,s)}this.notifyComputationResultToSubscribers(e,a)}}notifyComputationResultToSubscribers(e,n){aa.ifFilepathDefinedTransformSubscribers(e,r=>r.forEach(i=>i.notifyLineAuthoring(n,this.lineAuthorings.get(n))))}},wE=vE.Prec.high([JS,sa,yE]);var Rc=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.lineAuthorInfoProvider){console.warn("Git: undefined lineAuthorInfoProvider. Unexpected situation.");return}let n=e==null?void 0:e.view;!(n instanceof ti.MarkdownView)||n.file==null||(n==null?void 0:n.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(n.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),ZS(()=>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;lE(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new Ic(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),console.log(this.plg.manifest.name+": Enabled line authoring.")}catch(e){console.warn("Git: Error while loading line authoring feature.",e),this.deactivateFeature()}}deactivateFeature(){var e;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.lineAuthorInfoProvider)==null||e.destroy(),this.lineAuthorInfoProvider=void 0,console.log(this.plg.manifest.name+": Disabled line authoring.")}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&ti.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Le?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(wE),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.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),rE(),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.fileRenameEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.workspace.offref(this.fileOpenEvent),this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent),this.plg.app.workspace.offref(this.gutterContextMenuEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",e=>{var n;return void((n=this.lineAuthorInfoProvider)==null?void 0:n.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,n)=>{var r;return e instanceof ti.TFile&&((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var n;return e instanceof ti.TFile&&((n=this.lineAuthorInfoProvider)==null?void 0:n.trackChanged(e))})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",sE)}};v();var Lc=class{constructor(e){this.plugin=e;this.tasks=[]}addTask(e){this.tasks.push(e),this.tasks.length===1&&this.handleTask()}handleTask(){this.tasks.length>0&&this.tasks[0]().catch(e=>this.plugin.displayError(e)).finally(()=>{this.tasks.shift(),this.handleTask()})}};v();var sn=require("obsidian");var jc=class{constructor(e,n){this.statusBarEl=e;this.plugin=n;this.messages=[];this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),n.registerEvent(n.app.workspace.on("obsidian-git:refresh",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(e,n){this.messages.push({message:`Git: ${e.slice(0,100)}`,timeout:n}),this.display()}display(){this.messages.length>0&&!this.currentMessage?(this.currentMessage=this.messages.shift(),this.statusBarEl.addClass(this.base+"message"),this.statusBarEl.ariaLabel="",this.statusBarEl.setText(this.currentMessage.message),this.lastMessageTimestamp=Date.now()):this.currentMessage?Date.now()-this.lastMessageTimestamp>=this.currentMessage.timeout&&(this.currentMessage=null,this.lastMessageTimestamp=null):this.displayState()}displayState(){switch((this.statusBarEl.getText().length>3||!this.statusBarEl.hasChildNodes())&&(this.statusBarEl.empty(),this.conflictEl=this.statusBarEl.createDiv(),this.conflictEl.setAttribute("data-tooltip-position","top"),this.conflictEl.style.float="left",this.iconEl=this.statusBarEl.createDiv(),this.iconEl.style.float="left",this.textEl=this.statusBarEl.createDiv(),this.textEl.style.float="right",this.textEl.style.marginLeft="5px"),this.plugin.localStorage.getConflict()?((0,sn.setIcon)(this.conflictEl,"alert-circle"),this.conflictEl.ariaLabel="You have merge conflicts. Resolve them and commit afterwards.",this.conflictEl.style.marginRight="5px",this.conflictEl.addClass(this.base+"conflict")):(this.conflictEl.empty(),this.conflictEl.style.marginRight=""),this.plugin.state.gitAction){case 0:this.displayFromNow();break;case 1:this.statusBarEl.ariaLabel="Checking repository status...",(0,sn.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,sn.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,sn.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,sn.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,sn.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,sn.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var r;let e=this.lastCommitTimestamp,n=this.plugin.state.offlineMode;if(e){let i=(0,sn.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${n?"Offline: ":""}Last Commit: ${i}`,(r=this.unPushedCommits)!=null&&r&&(this.statusBarEl.ariaLabel+=` +(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=n?"Git is offline":"Git is ready";n?(0,sn.setIcon)(this.iconEl,"globe"):(0,sn.setIcon)(this.iconEl,"check"),this.plugin.settings.changedFilesInStatusBar&&this.plugin.cachedStatus&&this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()),this.statusBarEl.addClass(this.base+"idle")}async refreshCommitTimestamp(){this.lastCommitTimestamp=await this.plugin.gitManager.getLastCommitTime(),this.unPushedCommits=await this.plugin.gitManager.getUnpushedCommits()}remove(){this.statusBarEl.remove()}};v();var Bc=require("obsidian"),Dc=class extends Bc.SuggestModal{constructor(n){super(n.app);this.plugin=n;this.resolve=null;this.setPlaceholder("Type your message and select optional the version with the added date.")}openAndGetResult(){return new Promise(n=>{this.resolve=n,this.open()})}onClose(){new Promise(n=>setTimeout(n,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(n){let r=(0,Bc.moment)().format(this.plugin.settings.commitDateFormat);return n==""&&(n="..."),[n,`${r}: ${n}`,`${n}: ${r}`]}renderSuggestion(n,r){r.innerText=n}onChooseSuggestion(n,r){this.resolve&&this.resolve(n)}};v();var bE=require("obsidian"),Vs=class{constructor(e){this.plugin=e}saveLastAuto(e,n){n==="backup"?this.plugin.localStorage.setLastAutoBackup(e.toString()):n==="pull"?this.plugin.localStorage.setLastAutoPull(e.toString()):n==="push"&&this.plugin.localStorage.setLastAutoPush(e.toString())}loadLastAuto(){var e,n,r;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((n=this.plugin.localStorage.getLastAutoPull())!=null?n:""),push:new Date((r=this.plugin.localStorage.getLastAutoPush())!=null?r:"")}}async init(){await this.setUpAutoCommitAndSync();let e=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let n=new Date,r=this.plugin.settings.autoPushInterval-Math.round((n.getTime()-e.push.getTime())/1e3/60);this.startAutoPush(r<=0?0:r)}if(this.plugin.settings.autoPullInterval>0){let n=new Date,r=this.plugin.settings.autoPullInterval-Math.round((n.getTime()-e.pull.getTime())/1e3/60);this.startAutoPull(r<=0?0:r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...e){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.plugin.localStorage.setLastAutoBackup(e.toString())}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let e=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let n=new Date,r=this.plugin.settings.autoSaveInterval-Math.round((n.getTime()-e.backup.getTime())/1e3/60);this.startAutoCommitAndSync(r<=0?0:r)}}}startAutoCommitAndSync(e){let n=(e!=null?e:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?e===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,bE.debounce)(()=>this.doAutoCommitAndSync(),n,!0):(n>2147483647&&(n=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),n))}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(()=>this.plugin.settings.differentIntervalCommitAndPush?this.plugin.commit({fromAuto:!0}):this.plugin.commitAndSync(!0)),this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync()}startAutoPull(e){let n=(e!=null?e:this.plugin.settings.autoPullInterval)*6e4;n>2147483647&&(n=2147483647),this.timeoutIDPull=window.setTimeout(()=>{this.plugin.promiseQueue.addTask(()=>this.plugin.pullChangesFromRemote()),this.saveLastAuto(new Date,"pull"),this.startAutoPull()},n)}startAutoPush(e){let n=(e!=null?e:this.plugin.settings.autoPushInterval)*6e4;n>2147483647&&(n=2147483647),this.timeoutIDPush=window.setTimeout(()=>{this.plugin.promiseQueue.addTask(()=>this.plugin.push()),this.saveLastAuto(new Date,"push"),this.startAutoPush()},n)}clearAutoCommitAndSync(){var n;let e=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,e=!0),this.plugin.autoCommitDebouncer&&((n=this.plugin.autoCommitDebouncer)==null||n.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.timeoutIDPush=void 0,!0):!1}};v();var qs=require("obsidian");v();var Ws=require("obsidian");async function xE(t,e,n){let r=await SE(e,n);if(r.result==="failure"){new Ws.Notice(r.reason);return}let{isGitHub:i,branch:a,repo:s,user:o,filePath:l}=r;if(i){let c=t.getCursor("from").line+1,u=t.getCursor("to").line+1;c===u?window.open(`https://github.com/${o}/${s}/blob/${a}/${l}?plain=1#L${c}`):window.open(`https://github.com/${o}/${s}/blob/${a}/${l}?plain=1#L${c}-L${u}`)}else new Ws.Notice("It seems like you are not using GitHub")}async function _E(t,e){let n=await SE(t,e);if(n.result==="failure"){new Ws.Notice(n.reason);return}let{isGitHub:r,branch:i,repo:a,user:s,filePath:o}=n;r?window.open(`https://github.com/${s}/${a}/commits/${i}/${o}`):new Ws.Notice("It seems like you are not using GitHub")}async function SE(t,e){let n=await e.branchInfo(),r=n.tracking,i=n.current,a,s=e.getRelativeRepoPath(t.path);if(e instanceof Le){let l=await e.getSubmoduleOfFile(e.getRelativeRepoPath(t.path));if(l){s=l.relativeFilepath;let c=await e.git.cwd({path:l.submodule,root:!1}).status();if(r=c.tracking||void 0,i=c.current||void 0,r){let u=r.substring(0,r.indexOf("/")),f=await e.git.cwd({path:l.submodule,root:!1}).getConfig(`remote.${u}.url`,"local");if(f.value!=null)a=f.value;else return{result:"failure",reason:"Failed to get remote url of submodule"}}}}if(r==null)return{result:"failure",reason:"Remote branch is not configured"};if(i==null)return{result:"failure",reason:"Failed to get current branch name"};if(a==null){let l=r.substring(0,r.indexOf("/"));if(a=await e.getConfig(`remote.${l}.url`),a==null)return{result:"failure",reason:"Failed to get remote url"}}let o=a.match(/(?:^https:\/\/github\.com\/(.+)\/(.+?)(?:\.git)?$)|(?:^[a-zA-Z]+@github\.com:(.+)\/(.+?)(?:\.git)?$)/);if(o==null)return{result:"failure",reason:"Could not parse remote url"};{let[l,c,u,f,h]=o;return{result:"success",isGitHub:!!l,repo:u||h,user:c||f,branch:i,filePath:s}}}v();var EE=require("obsidian"),Nc=class extends EE.FuzzySuggestModal{constructor(e,n){super(e.app),this.plugin=e,this.changedFiles=n,this.setPlaceholder("Not supported files will be opened by default app!")}getItems(){return this.changedFiles}getItemText(e){if(e.index=="U"&&e.working_dir=="U")return`Untracked | ${e.vault_path}`;let n="",r="";return e.working_dir!=" "&&(n=`Working Dir: ${e.working_dir} `),e.index!=" "&&(r=`Index: ${e.index}`),`${n}${r} | ${e.vault_path}`}onChooseItem(e,n){this.plugin.app.metadataCache.getFirstLinkpathDest(e.vault_path,"")==null?this.app.openWithDefaultApp(e.vault_path):this.plugin.app.workspace.openLinkText(e.vault_path,"/")}};v();var kE=require("obsidian"),$c=class extends kE.Modal{constructor(n,r){super(n);this.content=r;this.resolve=null}openAndGetReslt(){return new Promise(n=>{this.resolve=n,this.open()})}onOpen(){let{contentEl:n,titleEl:r}=this;r.setText("Edit .gitignore");let i=n.createDiv(),a=i.createEl("textarea",{text:this.content,cls:["obsidian-git-textarea"],attr:{rows:10,cols:30,wrap:"off"}});i.createEl("button",{cls:["mod-cta","obsidian-git-center-button"],text:"Save"}).addEventListener("click",()=>{this.resolve(a.value),this.close()})}onClose(){let{contentEl:n}=this;n.empty(),this.resolve&&this.resolve(void 0)}};function AE(t){let e=t.app;t.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let n=t.gitManager.getRelativeVaultPath(".gitignore");await e.vault.adapter.exists(n)||await e.vault.adapter.write(n,"");let r=await e.vault.adapter.read(n),a=await new $c(e,r).openAndGetReslt();a!==void 0&&(await e.vault.adapter.write(n,a),await t.refresh())}}),t.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var i;let n=e.workspace.getLeavesOfType(dt.type),r;n.length===0?(r=(i=e.workspace.getRightLeaf(!1))!=null?i:e.workspace.getLeaf(),await r.setViewState({type:dt.type})):r=n.first(),await e.workspace.revealLeaf(r),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var i;let n=e.workspace.getLeavesOfType(nn.type),r;n.length===0?(r=(i=e.workspace.getRightLeaf(!1))!=null?i:e.workspace.getLeaf(),await r.setViewState({type:nn.type})):r=n.first(),await e.workspace.revealLeaf(r),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:n=>{var i;let r=e.workspace.getActiveFile();if(n)return r!==null;(i=Xt(e))==null||i.setViewState({type:Ct.type,active:!0,state:{staged:!1,file:t.gitManager.getRelativeRepoPath(r.path,!0)}})}}),t.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(n,{file:r})=>{if(r)return xE(n,r,t.gitManager)}}),t.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(n,{file:r})=>{if(r)return _E(r,t.gitManager)}}),t.addCommand({id:"pull",name:"Pull",callback:()=>t.promiseQueue.addTask(()=>t.pullChangesFromRemote())}),t.addCommand({id:"fetch",name:"Fetch",callback:()=>t.promiseQueue.addTask(()=>t.fetch())}),t.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>t.promiseQueue.addTask(()=>t.switchRemoteBranch())}),t.addCommand({id:"add-to-gitignore",name:"Add file to gitignore",checkCallback:n=>{let r=e.workspace.getActiveFile();if(n)return r!==null;t.addFileToGitignore(r).catch(i=>t.displayError(i))}}),t.addCommand({id:"push",name:"Commit-and-sync",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync(!1))}),t.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>t.promiseQueue.addTask(async()=>{await t.commitAndSync(!1),window.close()})}),t.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync(!1,!0))}),t.addCommand({id:"commit",name:"Commit all changes",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1}))}),t.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit-staged",name:"Commit staged",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:!0}))}),qs.Platform.isDesktopApp&&t.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0,amend:!0}))}),t.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0}))}),t.addCommand({id:"push2",name:"Push",callback:()=>t.promiseQueue.addTask(()=>t.push())}),t.addCommand({id:"stage-current-file",name:"Stage current file",checkCallback:n=>{let r=e.workspace.getActiveFile();if(n)return r!==null;t.promiseQueue.addTask(()=>t.stageFile(r))}}),t.addCommand({id:"unstage-current-file",name:"Unstage current file",checkCallback:n=>{let r=e.workspace.getActiveFile();if(n)return r!==null;t.promiseQueue.addTask(()=>t.unstageFile(r))}}),t.addCommand({id:"edit-remotes",name:"Edit remotes",callback:()=>t.editRemotes().catch(n=>t.displayError(n))}),t.addCommand({id:"remove-remote",name:"Remove remote",callback:()=>t.removeRemote().catch(n=>t.displayError(n))}),t.addCommand({id:"set-upstream-branch",name:"Set upstream branch",callback:()=>t.setUpstreamBranch().catch(n=>t.displayError(n))}),t.addCommand({id:"delete-repo",name:"CAUTION: Delete repository",callback:async()=>{await e.vault.adapter.exists(`${t.settings.basePath}/.git`)?await new Xe(t,{options:["NO","YES"],placeholder:"Do you really want to delete the repository (.git directory)? plugin action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"&&(await e.vault.adapter.rmdir(`${t.settings.basePath}/.git`,!0),new qs.Notice("Successfully deleted repository. Reloading plugin..."),t.unloadPlugin(),await t.init({fromReload:!0})):new qs.Notice("No repository found")}}),t.addCommand({id:"init-repo",name:"Initialize a new repo",callback:()=>t.createNewRepo().catch(n=>t.displayError(n))}),t.addCommand({id:"clone-repo",name:"Clone an existing remote repo",callback:()=>t.cloneNewRepo().catch(n=>t.displayError(n))}),t.addCommand({id:"list-changed-files",name:"List changed files",callback:async()=>{if(await t.isAllInitialized())try{let n=await t.updateCachedStatus();if(n.changed.length+n.staged.length>500){t.displayError("Too many changes to display");return}new Nc(t,n.all).open()}catch(n){t.displayError(n)}}}),t.addCommand({id:"switch-branch",name:"Switch branch",callback:()=>{t.switchBranch().catch(n=>t.displayError(n))}}),t.addCommand({id:"create-branch",name:"Create new branch",callback:()=>{t.createBranch().catch(n=>t.displayError(n))}}),t.addCommand({id:"delete-branch",name:"Delete branch",callback:()=>{t.deleteBranch().catch(n=>t.displayError(n))}}),t.addCommand({id:"discard-all",name:"CAUTION: Discard all changes",callback:async()=>{if(!await t.isAllInitialized())return!1;await new Xe(t,{options:["NO","YES"],placeholder:"Do you want to discard all changes to tracked files? plugin action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"&&t.promiseQueue.addTask(()=>t.discardAll())}}),t.addCommand({id:"toggle-line-author-info",name:"Toggle line author information",callback:()=>{var n;return(n=t.settingsTab)==null?void 0:n.configureLineAuthorShowStatus(!t.settings.lineAuthor.show)}})}v();var Hc=class{constructor(e){this.plugin=e;this.prefix=this.plugin.manifest.id+":",this.app=e.app}migrate(){let e=["password","hostname","conflict","lastAutoPull","lastAutoBackup","lastAutoPush","gitPath","pluginDisabled"];for(let n of e){let r=localStorage.getItem(this.prefix+n);this.app.loadLocalStorage(this.prefix+n)==null&&r!=null&&r!=null&&(this.app.saveLocalStorage(this.prefix+n,r),localStorage.removeItem(this.prefix+n))}}getPassword(){return this.app.loadLocalStorage(this.prefix+"password")}setPassword(e){return this.app.saveLocalStorage(this.prefix+"password",e)}getUsername(){return this.app.loadLocalStorage(this.prefix+"username")}setUsername(e){return this.app.saveLocalStorage(this.prefix+"username",e)}getHostname(){return this.app.loadLocalStorage(this.prefix+"hostname")}setHostname(e){return this.app.saveLocalStorage(this.prefix+"hostname",e)}getConflict(){return this.app.loadLocalStorage(this.prefix+"conflict")=="true"}setConflict(e){return this.app.saveLocalStorage(this.prefix+"conflict",`${e}`)}getLastAutoPull(){return this.app.loadLocalStorage(this.prefix+"lastAutoPull")}setLastAutoPull(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPull",e)}getLastAutoBackup(){return this.app.loadLocalStorage(this.prefix+"lastAutoBackup")}setLastAutoBackup(e){return this.app.saveLocalStorage(this.prefix+"lastAutoBackup",e)}getLastAutoPush(){return this.app.loadLocalStorage(this.prefix+"lastAutoPush")}setLastAutoPush(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPush",e)}getGitPath(){return this.app.loadLocalStorage(this.prefix+"gitPath")}setGitPath(e){return this.app.saveLocalStorage(this.prefix+"gitPath",e)}getPATHPaths(){var e,n;return(n=(e=this.app.loadLocalStorage(this.prefix+"PATHPaths"))==null?void 0:e.split(":"))!=null?n:[]}setPATHPaths(e){return this.app.saveLocalStorage(this.prefix+"PATHPaths",e.join(":"))}getEnvVars(){var e;return JSON.parse((e=this.app.loadLocalStorage(this.prefix+"envVars"))!=null?e:"[]")}setEnvVars(e){return this.app.saveLocalStorage(this.prefix+"envVars",JSON.stringify(e))}getPluginDisabled(){return this.app.loadLocalStorage(this.prefix+"pluginDisabled")=="true"}setPluginDisabled(e){return this.app.saveLocalStorage(this.prefix+"pluginDisabled",`${e}`)}};v();v();v();v();var $e;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})($e||($e={}));var TE={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},CE={LINES:"lines",WORDS:"words",NONE:"none"},FE={WORD:"word",CHAR:"char"},ni;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(ni||(ni={}));v();var TL=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],CL=RegExp("["+TL.join("\\")+"]","g");function ME(t){return t.replace(CL,"\\$&")}function Fp(t){return t&&t.replace(/\\/g,"/")}function OE(t){let e,n,r,i=0;for(e=0,r=t.length;e1?n[n.length-1]:e}function IE(t,e){return e.reduce((n,r)=>n||t.startsWith(r),!1)}var RE=["a/","b/","i/","w/","c/","o/"];function xr(t,e,n){let r=n!==void 0?[...RE,n]:RE,i=e?new RegExp(`^${ME(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,a=""]=i.exec(t)||[],s=r.find(l=>a.indexOf(l)===0);return(s?a.slice(s.length):a).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function FL(t,e){return xr(t,"---",e)}function ML(t,e){return xr(t,"+++",e)}function LE(t,e={}){let n=[],r=null,i=null,a=null,s=null,o=null,l=null,c=null,u="--- ",f="+++ ",h="@@",d=/^old mode (\d{6})/,p=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,m=/^new file mode (\d{6})/,w=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,S=/^rename from "?(.+)"?/,k=/^rename to "?(.+)"?/,x=/^similarity index (\d+)%/,A=/^dissimilarity index (\d+)%/,y=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,E=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,C=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,M=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,L=/^new file mode (\d{6})/,N=/^deleted file mode (\d{6}),(\d{6})/,j=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,` +`).split(` +`);function Y(){i!==null&&r!==null&&(r.blocks.push(i),i=null)}function le(){r!==null&&(!r.oldName&&l!==null&&(r.oldName=l),!r.newName&&c!==null&&(r.newName=c),r.newName&&(n.push(r),r=null)),l=null,c=null}function he(){Y(),le(),r={blocks:[],deletedLines:0,addedLines:0}}function ie($){Y();let G;r!==null&&((G=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec($))?(r.isCombined=!1,a=parseInt(G[1],10),o=parseInt(G[2],10)):(G=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec($))?(r.isCombined=!0,a=parseInt(G[1],10),s=parseInt(G[2],10),o=parseInt(G[3],10)):($.startsWith(h)&&console.error("Failed to parse lines, starting in 0!"),a=0,o=0,r.isCombined=!1)),i={lines:[],oldStartLine:a,oldStartLine2:s,newStartLine:o,header:$}}function Me($){if(r===null||i===null||a===null||o===null)return;let G={content:$},D=r.isCombined?["+ "," +","++"]:["+"],se=r.isCombined?["- "," -","--"]:["-"];IE($,D)?(r.addedLines++,G.type=$e.INSERT,G.oldNumber=void 0,G.newNumber=o++):IE($,se)?(r.deletedLines++,G.type=$e.DELETE,G.oldNumber=a++,G.newNumber=void 0):(G.type=$e.CONTEXT,G.oldNumber=a++,G.newNumber=o++),i.lines.push(G)}function de($,G){let D=G;for(;D{if(!$||$.startsWith("*"))return;let D,se=j[G-1],Se=j[G+1],mt=j[G+2];if($.startsWith("diff --git")||$.startsWith("diff --combined")){if(he(),(D=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec($))&&(l=xr(D[1],void 0,e.dstPrefix),c=xr(D[2],void 0,e.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isGitDiff=!0;return}if($.startsWith("Binary files")&&!(r!=null&&r.isGitDiff)){if(he(),(D=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec($))&&(l=xr(D[1],void 0,e.dstPrefix),c=xr(D[2],void 0,e.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isBinary=!0;return}if((!r||!r.isGitDiff&&r&&$.startsWith(u)&&Se.startsWith(f)&&mt.startsWith(h))&&he(),r!=null&&r.isTooBig)return;if(r&&(typeof e.diffMaxChanges=="number"&&r.addedLines+r.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&$.length>e.diffMaxLineLength)){r.isTooBig=!0,r.addedLines=0,r.deletedLines=0,r.blocks=[],i=null;let st=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(n.length):"Diff too big to be displayed";ie(st);return}if($.startsWith(u)&&Se.startsWith(f)||$.startsWith(f)&&se.startsWith(u)){if(r&&!r.oldName&&$.startsWith("--- ")&&(D=FL($,e.srcPrefix))){r.oldName=D,r.language=PE(r.oldName,r.language);return}if(r&&!r.newName&&$.startsWith("+++ ")&&(D=ML($,e.dstPrefix))){r.newName=D,r.language=PE(r.newName,r.language);return}}if(r&&($.startsWith(h)||r.isGitDiff&&r.oldName&&r.newName&&!i)){ie($);return}if(i&&($.startsWith("+")||$.startsWith("-")||$.startsWith(" "))){Me($);return}let be=!de($,G);if(r===null)throw new Error("Where is my file !!!");(D=d.exec($))?r.oldMode=D[1]:(D=p.exec($))?r.newMode=D[1]:(D=g.exec($))?(r.deletedFileMode=D[1],r.isDeleted=!0):(D=m.exec($))?(r.newFileMode=D[1],r.isNew=!0):(D=w.exec($))?(be&&(r.oldName=D[1]),r.isCopy=!0):(D=b.exec($))?(be&&(r.newName=D[1]),r.isCopy=!0):(D=S.exec($))?(be&&(r.oldName=D[1]),r.isRename=!0):(D=k.exec($))?(be&&(r.newName=D[1]),r.isRename=!0):(D=E.exec($))?(r.isBinary=!0,r.oldName=xr(D[1],void 0,e.srcPrefix),r.newName=xr(D[2],void 0,e.dstPrefix),ie("Binary file")):_.test($)?(r.isBinary=!0,ie($)):(D=x.exec($))?r.unchangedPercentage=parseInt(D[1],10):(D=A.exec($))?r.changedPercentage=parseInt(D[1],10):(D=y.exec($))?(r.checksumBefore=D[1],r.checksumAfter=D[2],D[3]&&(r.mode=D[3])):(D=C.exec($))?(r.checksumBefore=[D[2],D[3]],r.checksumAfter=D[1]):(D=M.exec($))?(r.oldMode=[D[2],D[3]],r.newMode=D[1]):(D=L.exec($))?(r.newFileMode=D[1],r.isNew=!0):(D=N.exec($))&&(r.deletedFileMode=D[1],r.isDeleted=!0)}),Y(),le(),n}v();v();v();function Xn(){}Xn.prototype={diff:function(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.callback;typeof r=="function"&&(i=r,r={}),this.options=r;var a=this;function s(g){return i?(setTimeout(function(){i(void 0,g)},0),!0):g}e=this.castInput(e),n=this.castInput(n),e=this.removeEmpty(this.tokenize(e)),n=this.removeEmpty(this.tokenize(n));var o=n.length,l=e.length,c=1,u=o+l;r.maxEditLength&&(u=Math.min(u,r.maxEditLength));var f=[{newPos:-1,components:[]}],h=this.extractCommon(f[0],n,e,0);if(f[0].newPos+1>=o&&h+1>=l)return s([{value:this.join(n),count:n.length}]);function d(){for(var g=-1*c;g<=c;g+=2){var m=void 0,w=f[g-1],b=f[g+1],S=(b?b.newPos:0)-g;w&&(f[g-1]=void 0);var k=w&&w.newPos+1=o&&S+1>=l)return s(PL(a,m.components,n,e,a.useLongestToken));f[g]=m}c++}if(i)(function g(){setTimeout(function(){if(c>u)return i();d()||g()},0)})();else for(;c<=u;){var p=d();if(p)return p}},pushComponent:function(e,n,r){var i=e[e.length-1];i&&i.added===n&&i.removed===r?e[e.length-1]={count:i.count+1,added:n,removed:r}:e.push({count:1,added:n,removed:r})},extractCommon:function(e,n,r,i){for(var a=n.length,s=r.length,o=e.newPos,l=o-i,c=0;o+1d.length?g:d}),c.value=t.join(u)}else c.value=t.join(n.slice(o,o+c.count));o+=c.count,c.added||(l+=c.count)}}var h=e[s-1];return s>1&&typeof h.value=="string"&&(h.added||h.removed)&&t.equals("",h.value)&&(e[s-2].value+=h.value,e.pop()),e}function IL(t){return{newPos:t.newPos,components:t.components.slice(0)}}var RL=new Xn;function BE(t,e,n){return RL.diff(t,e,n)}var jE=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,DE=/\S/,Pp=new Xn;Pp.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!DE.test(t)&&!DE.test(e)};Pp.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n{let r=t(e).trim(),i=t(n).trim();return NL(r,i)/(r.length+i.length)}}function fa(t){function e(r,i,a=new Map){let s=1/0,o;for(let l=0;l0||o.indexB>0)&&(S=m.concat(S)),(r.length>h||i.length>d)&&(S=S.concat(b)),S}return n}var pt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},ri={matching:CE.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:FE.WORD,colorScheme:ni.LIGHT},Rn="/",HE=ua(t=>t.value),$L=fa(HE);function Rp(t){return t.indexOf("dev/null")!==-1}function HL(t){return t.replace(/(]*>((.|\n)*?)<\/ins>)/g,"")}function UL(t){return t.replace(/(]*>((.|\n)*?)<\/del>)/g,"")}function ha(t){switch(t){case $e.CONTEXT:return pt.CONTEXT;case $e.INSERT:return pt.INSERTS;case $e.DELETE:return pt.DELETES}}function da(t){switch(t){case ni.DARK:return"d2h-dark-color-scheme";case ni.AUTO:return"d2h-auto-color-scheme";case ni.LIGHT:default:return"d2h-light-color-scheme"}}function zL(t){return t?2:1}function _r(t){return t.slice(0).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function on(t,e,n=!0){let r=zL(e);return{prefix:t.substring(0,r),content:n?_r(t.substring(r)):t.substring(r)}}function ii(t){let e=Fp(t.oldName),n=Fp(t.newName);if(e!==n&&!Rp(e)&&!Rp(n)){let r=[],i=[],a=e.split(Rn),s=n.split(Rn),o=a.length,l=s.length,c=0,u=o-1,f=l-1;for(;cc&&f>c&&a[u]===s[f];)i.unshift(s[f]),u-=1,f-=1;let h=r.join(Rn),d=i.join(Rn),p=a.slice(c,u+1).join(Rn),g=s.slice(c,f+1).join(Rn);return h.length&&d.length?h+Rn+"{"+p+" \u2192 "+g+"}"+Rn+d:h.length?h+Rn+"{"+p+" \u2192 "+g+"}":d.length?"{"+p+" \u2192 "+g+"}"+Rn+d:e+" \u2192 "+n}else return Rp(n)?e:n}function pa(t){return`d2h-${OE(ii(t)).toString().slice(-6)}`}function ma(t){let e="file-changed";return t.isRename||t.isCopy?e="file-renamed":t.isNew?e="file-added":t.isDeleted?e="file-deleted":t.newName!==t.oldName&&(e="file-renamed"),e}function zc(t,e,n,r={}){let{matching:i,maxLineLengthHighlight:a,matchWordsThreshold:s,diffStyle:o}=Object.assign(Object.assign({},ri),r),l=on(t,n,!1),c=on(e,n,!1);if(l.content.length>a||c.content.length>a)return{oldLine:{prefix:l.prefix,content:_r(l.content)},newLine:{prefix:c.prefix,content:_r(c.content)}};let u=o==="char"?BE(l.content,c.content):NE(l.content,c.content),f=[];if(o==="word"&&i==="words"){let d=u.filter(m=>m.removed),p=u.filter(m=>m.added);$L(p,d).forEach(m=>{m[0].length===1&&m[1].length===1&&HE(m[0][0],m[1][0]){let g=p.added?"ins":p.removed?"del":null,m=f.indexOf(p)>-1?' class="d2h-change"':"",w=_r(p.value);return g!==null?`${d}<${g}${m}>${w}`:`${d}${w}`},"");return{oldLine:{prefix:l.prefix,content:HL(h)},newLine:{prefix:c.prefix,content:UL(h)}}}var UE="file-summary",GL="icon",VL={colorScheme:ri.colorScheme},Gc=class{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},VL),n)}render(e){let n=e.map(r=>this.hoganUtils.render(UE,"line",{fileHtmlId:pa(r),oldName:r.oldName,newName:r.newName,fileName:ii(r),deletedLines:"-"+r.deletedLines,addedLines:"+"+r.addedLines},{fileIcon:this.hoganUtils.template(GL,ma(r))})).join(` +`);return this.hoganUtils.render(UE,"wrapper",{colorScheme:da(this.config.colorScheme),filesNumber:e.length,files:n})}};v();var jp=Object.assign(Object.assign({},ri),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Ys="generic",zE="line-by-line",WL="icon",qL="tag",Zs=class{constructor(e,n={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},jp),n)}render(e){let n=e.map(r=>{let i;return r.blocks.length?i=this.generateFileHtml(r):i=this.generateEmptyDiff(),this.makeFileDiffHtml(r,i)}).join(` +`);return this.hoganUtils.render(Ys,"wrapper",{colorScheme:da(this.config.colorScheme),content:n})}makeFileDiffHtml(e,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let r=this.hoganUtils.template(zE,"file-diff"),i=this.hoganUtils.template(Ys,"file-path"),a=this.hoganUtils.template(WL,"file"),s=this.hoganUtils.template(qL,ma(e));return r.render({file:e,fileHtmlId:pa(e),diffs:n,filePath:i.render({fileDiffName:ii(e)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return this.hoganUtils.render(Ys,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:pt})}generateFileHtml(e){let n=fa(ua(r=>on(r.content,e.isCombined).content));return e.blocks.map(r=>{let i=this.hoganUtils.render(Ys,"block-header",{CSSLineClass:pt,blockHeader:e.isTooBig?r.header:_r(r.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(r).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,n).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);i+=u,i+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=on(l.content,e.isCombined);i+=this.generateSingleLineHtml(e,{type:pt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,s,o);i+=l,i+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).join(` +`)}applyLineGroupping(e){let n=[],r=[],i=[];for(let a=0;a0)&&(n.push([[],r,i]),r=[],i=[]),s.type===$e.CONTEXT?n.push([[s],[],[]]):s.type===$e.INSERT&&r.length===0?n.push([[],[],[s]]):s.type===$e.INSERT&&r.length>0?i.push(s):s.type===$e.DELETE&&r.push(s)}return(r.length||i.length)&&(n.push([[],r,i]),r=[],i=[]),n}applyRematchMatching(e,n,r){let i=e.length*n.length,a=Math.max.apply(null,[0].concat(e.concat(n).map(o=>o.content.length)));return i{let i;return r.blocks.length?i=this.generateFileHtml(r):i=this.generateEmptyDiff(),this.makeFileDiffHtml(r,i)}).join(` +`);return this.hoganUtils.render(Ks,"wrapper",{colorScheme:da(this.config.colorScheme),content:n})}makeFileDiffHtml(e,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let r=this.hoganUtils.template(XL,"file-diff"),i=this.hoganUtils.template(Ks,"file-path"),a=this.hoganUtils.template(YL,"file"),s=this.hoganUtils.template(ZL,ma(e));return r.render({file:e,fileHtmlId:pa(e),diffs:n,filePath:i.render({fileDiffName:ii(e)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Ks,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:pt})}}generateFileHtml(e){let n=fa(ua(r=>on(r.content,e.isCombined).content));return e.blocks.map(r=>{let i={left:this.makeHeaderHtml(r.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(r).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,n).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);i.left+=u,i.right+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=on(l.content,e.isCombined),{left:f,right:h}=this.generateLineHtml({type:pt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:pt.CONTEXT,prefix:c,content:u,number:l.newNumber});i.left+=f,i.right+=h});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,s,o);i.left+=l,i.right+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).reduce((r,i)=>({left:r.left+i.left,right:r.right+i.right}),{left:"",right:""})}applyLineGroupping(e){let n=[],r=[],i=[];for(let a=0;a0)&&(n.push([[],r,i]),r=[],i=[]),s.type===$e.CONTEXT?n.push([[s],[],[]]):s.type===$e.INSERT&&r.length===0?n.push([[],[],[s]]):s.type===$e.INSERT&&r.length>0?i.push(s):s.type===$e.DELETE&&r.push(s)}return(r.length||i.length)&&(n.push([[],r,i]),r=[],i=[]),n}applyRematchMatching(e,n,r){let i=e.length*n.length,a=Math.max.apply(null,[0].concat(e.concat(n).map(o=>o.content.length)));return i'),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(r.rp("'),r.b(r.v(r.f("fileName",t,e,0))),r.b(""),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(r.v(r.f("addedLines",t,e,0))),r.b(""),r.b(` +`+n),r.b(' '),r.b(r.v(r.f("deletedLines",t,e,0))),r.b(""),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(""),r.fl()},partials:{"'),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b(' Files changed ('),r.b(r.v(r.f("filesNumber",t,e,0))),r.b(")"),r.b(` +`+n),r.b(' hide'),r.b(` +`+n),r.b(' show'),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b('
      '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("files",t,e,0))),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b(""),r.fl()},partials:{},subs:{}});et["generic-block-header"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b(""),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b('
    '),r.s(r.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(r.rs(t,e,function(i,a,s){s.b(s.t(s.f("blockHeader",i,a,0)))}),t.pop()),r.s(r.f("blockHeader",t,e,1),t,e,1,0,0,"")||r.b(" "),r.b("
    "),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(""),r.fl()},partials:{},subs:{}});et["generic-empty-diff"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b(""),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b(" File without changes"),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(""),r.fl()},partials:{},subs:{}});et["generic-file-path"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b(''),r.b(` +`+n),r.b(r.rp("'),r.b(r.v(r.f("fileDiffName",t,e,0))),r.b(""),r.b(` +`+n),r.b(r.rp(""),r.b(` +`+n),r.b('"),r.fl()},partials:{""),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("lineNumber",t,e,0))),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.s(r.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(r.rs(t,e,function(i,a,s){s.b(' '),s.b(s.t(s.f("prefix",i,a,0))),s.b(""),s.b(` +`+n)}),t.pop()),r.s(r.f("prefix",t,e,1),t,e,1,0,0,"")||(r.b('  '),r.b(` +`+n)),r.s(r.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(r.rs(t,e,function(i,a,s){s.b(' '),s.b(s.t(s.f("content",i,a,0))),s.b(""),s.b(` +`+n)}),t.pop()),r.s(r.f("content",t,e,1),t,e,1,0,0,"")||(r.b('
    '),r.b(` +`+n)),r.b("
    "),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(""),r.fl()},partials:{},subs:{}});et["generic-wrapper"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('
    '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("content",t,e,0))),r.b(` +`+n),r.b("
    "),r.fl()},partials:{},subs:{}});et["icon-file-added"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});et["icon-file-changed"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});et["icon-file-deleted"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});et["icon-file-renamed"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});et["icon-file"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});et["line-by-line-file-diff"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('
    '),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("filePath",t,e,0))),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("diffs",t,e,0))),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.fl()},partials:{},subs:{}});et["line-by-line-numbers"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('
    '),r.b(r.v(r.f("oldNumber",t,e,0))),r.b("
    "),r.b(` +`+n),r.b('
    '),r.b(r.v(r.f("newNumber",t,e,0))),r.b("
    "),r.fl()},partials:{},subs:{}});et["side-by-side-file-diff"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('
    '),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("filePath",t,e,0))),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(" "),r.b(r.t(r.d("diffs.left",t,e,0))),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(" "),r.b(r.t(r.d("diffs.right",t,e,0))),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.b(` +`+n),r.b("
    "),r.fl()},partials:{},subs:{}});et["tag-file-added"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('ADDED'),r.fl()},partials:{},subs:{}});et["tag-file-changed"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('CHANGED'),r.fl()},partials:{},subs:{}});et["tag-file-deleted"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('DELETED'),r.fl()},partials:{},subs:{}});et["tag-file-renamed"]=new rt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('RENAMED'),r.fl()},partials:{},subs:{}});var Qs=class{constructor({compiledTemplates:e={},rawTemplates:n={}}){let r=Object.entries(n).reduce((i,[a,s])=>{let o=Hp.compile(s,{asString:!1});return Object.assign(Object.assign({},i),{[a]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},et),e),r)}static compile(e){return Hp.compile(e,{asString:!1})}render(e,n,r,i,a){let s=this.templateKey(e,n);try{return this.preCompiledTemplates[s].render(r,i,a)}catch(o){throw new Error(`Could not find template to render '${s}'`)}}template(e,n){return this.preCompiledTemplates[this.templateKey(e,n)]}templateKey(e,n){return`${e}-${n}`}};var JL=Object.assign(Object.assign(Object.assign({},jp),Dp),{outputFormat:TE.LINE_BY_LINE,drawFileList:!0});function qE(t,e={}){let n=Object.assign(Object.assign({},JL),e),r=typeof t=="string"?LE(t,n):t,i=new Qs(n),{colorScheme:a}=n,s={colorScheme:a},o=n.drawFileList?new Gc(i,s).render(r):"",l=n.outputFormat==="side-by-side"?new Js(i,n).render(r):new Zs(i,n).render(r);return o+l}var Wc=require("obsidian");var ga=class extends Wc.ItemView{constructor(n,r){super(n);this.plugin=r;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.gitRefreshRef=this.app.workspace.on("obsidian-git:refresh",()=>{this.refresh().catch(console.error)}),this.gitViewRefreshRef=this.app.workspace.on("obsidian-git:view-refresh",()=>{this.refresh().catch(console.error)})}getViewType(){return Ct.type}getDisplayText(){var n;if(((n=this.state)==null?void 0:n.file)!=null){let r=this.state.file.split("/").last();return r!=null&&r.endsWith(".md")&&(r=r.slice(0,-3)),Ct.name+` (${r})`}return Ct.name}getIcon(){return Ct.icon}async setState(n,r){this.state=n,Wc.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 n;if((n=this.state)!=null&&n.file&&!this.gettingDiff&&this.plugin.gitManager){this.gettingDiff=!0;try{let r=await this.plugin.gitManager.getDiffString(this.state.file,this.state.staged,this.state.hash);this.contentEl.empty();let i=this.plugin.gitManager.getRelativeVaultPath(this.state.file);if(!r){if(this.plugin.gitManager instanceof Le&&await this.plugin.gitManager.isTracked(this.state.file))r=[`--- ${this.state.file}`,`+++ ${this.state.file}`,""].join(` +`);else if(await this.app.vault.adapter.exists(i)){let a=await this.app.vault.adapter.read(i);r=[...`--- /dev/null +++ ${this.state.file} -@@ -0,0 +1,${content.split("\n").length} @@`; - diff2 = [ - ...header.split("\n"), - ...content.split("\n").map((line) => `+${line}`) - ].join("\n"); - } - } - const diffEl = this.parser.parseFromString(html(diff2), "text/html").querySelector(".d2h-file-diff"); - this.contentEl.append(diffEl); - } finally { - this.gettingDiff = false; - } - } - } -}; - -// src/ui/history/historyView.ts -init_polyfill_buffer(); -var import_obsidian20 = require("obsidian"); - -// src/ui/history/historyView.svelte -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/index.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/animations.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/utils.js -init_polyfill_buffer(); -function noop() { -} -var identity = (x) => x; -function run(fn) { - return fn(); -} -function blank_object() { - return /* @__PURE__ */ Object.create(null); -} -function run_all(fns) { - fns.forEach(run); -} -function is_function(thing) { - return typeof thing === "function"; -} -function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function"; -} -function is_empty(obj) { - return Object.keys(obj).length === 0; -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/environment.js -init_polyfill_buffer(); -var is_client = typeof window !== "undefined"; -var now = is_client ? () => window.performance.now() : () => Date.now(); -var raf = is_client ? (cb) => requestAnimationFrame(cb) : noop; - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/loop.js -init_polyfill_buffer(); -var tasks = /* @__PURE__ */ new Set(); -function run_tasks(now2) { - tasks.forEach((task) => { - if (!task.c(now2)) { - tasks.delete(task); - task.f(); - } - }); - if (tasks.size !== 0) - raf(run_tasks); -} -function loop(callback) { - let task; - if (tasks.size === 0) - raf(run_tasks); - return { - promise: new Promise((fulfill) => { - tasks.add(task = { c: callback, f: fulfill }); - }), - abort() { - tasks.delete(task); - } - }; -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/style_manager.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/dom.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/globals.js -init_polyfill_buffer(); -var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : ( - // @ts-ignore Node typings have this - global -); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/ResizeObserverSingleton.js -var ResizeObserverSingleton = class _ResizeObserverSingleton { - /** @param {ResizeObserverOptions} options */ - constructor(options) { - /** - * @private - * @readonly - * @type {WeakMap} - */ - __publicField(this, "_listeners", "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0); - /** - * @private - * @type {ResizeObserver} - */ - __publicField(this, "_observer"); - /** @type {ResizeObserverOptions} */ - __publicField(this, "options"); - this.options = options; - } - /** - * @param {Element} element - * @param {import('./private.js').Listener} listener - * @returns {() => void} - */ - observe(element2, listener) { - this._listeners.set(element2, listener); - this._getObserver().observe(element2, this.options); - return () => { - this._listeners.delete(element2); - this._observer.unobserve(element2); - }; - } - /** - * @private - */ - _getObserver() { - var _a2; - return (_a2 = this._observer) != null ? _a2 : this._observer = new ResizeObserver((entries) => { - var _a3; - for (const entry of entries) { - _ResizeObserverSingleton.entries.set(entry.target, entry); - (_a3 = this._listeners.get(entry.target)) == null ? void 0 : _a3(entry); - } - }); - } -}; -ResizeObserverSingleton.entries = "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0; - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/dom.js -var is_hydrating = false; -function start_hydrating() { - is_hydrating = true; -} -function end_hydrating() { - is_hydrating = false; -} -function append2(target, node) { - target.appendChild(node); -} -function append_styles(target, style_sheet_id, styles) { - const append_styles_to = get_root_for_style(target); - if (!append_styles_to.getElementById(style_sheet_id)) { - const style = element("style"); - style.id = style_sheet_id; - style.textContent = styles; - append_stylesheet(append_styles_to, style); - } -} -function get_root_for_style(node) { - if (!node) - return document; - const root2 = node.getRootNode ? node.getRootNode() : node.ownerDocument; - if (root2 && /** @type {ShadowRoot} */ - root2.host) { - return ( - /** @type {ShadowRoot} */ - root2 - ); - } - return node.ownerDocument; -} -function append_empty_stylesheet(node) { - const style_element = element("style"); - style_element.textContent = "/* empty */"; - append_stylesheet(get_root_for_style(node), style_element); - return style_element.sheet; -} -function append_stylesheet(node, style) { - append2( - /** @type {Document} */ - node.head || node, - style - ); - return style.sheet; -} -function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); -} -function detach(node) { - if (node.parentNode) { - node.parentNode.removeChild(node); - } -} -function destroy_each(iterations, detaching) { - for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) - iterations[i].d(detaching); - } -} -function element(name) { - return document.createElement(name); -} -function text(data) { - return document.createTextNode(data); -} -function space() { - return text(" "); -} -function empty() { - return text(""); -} -function listen(node, event, handler, options) { - node.addEventListener(event, handler, options); - return () => node.removeEventListener(event, handler, options); -} -function stop_propagation(fn) { - return function(event) { - event.stopPropagation(); - return fn.call(this, event); - }; -} -function attr(node, attribute, value) { - if (value == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) - node.setAttribute(attribute, value); -} -function children(element2) { - return Array.from(element2.childNodes); -} -function set_data(text2, data) { - data = "" + data; - if (text2.data === data) - return; - text2.data = /** @type {string} */ - data; -} -function set_input_value(input, value) { - input.value = value == null ? "" : value; -} -function set_style(node, key2, value, important) { - if (value == null) { - node.style.removeProperty(key2); - } else { - node.style.setProperty(key2, value, important ? "important" : ""); - } -} -function toggle_class(element2, name, toggle) { - element2.classList.toggle(name, !!toggle); -} -function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) { - return new CustomEvent(type, { detail, bubbles, cancelable }); -} -function get_custom_elements_slots(element2) { - const result = {}; - element2.childNodes.forEach( - /** @param {Element} node */ - (node) => { - result[node.slot || "default"] = true; - } - ); - return result; -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/style_manager.js -var managed_styles = /* @__PURE__ */ new Map(); -var active = 0; -function hash(str) { - let hash2 = 5381; - let i = str.length; - while (i--) - hash2 = (hash2 << 5) - hash2 ^ str.charCodeAt(i); - return hash2 >>> 0; -} -function create_style_information(doc, node) { - const info = { stylesheet: append_empty_stylesheet(node), rules: {} }; - managed_styles.set(doc, info); - return info; -} -function create_rule(node, a, b, duration, delay2, ease, fn, uid = 0) { - const step = 16.666 / duration; - let keyframes = "{\n"; - for (let p = 0; p <= 1; p += step) { - const t = a + (b - a) * ease(p); - keyframes += p * 100 + `%{${fn(t, 1 - t)}} -`; - } - const rule = keyframes + `100% {${fn(b, 1 - b)}} -}`; - const name = `__svelte_${hash(rule)}_${uid}`; - const doc = get_root_for_style(node); - const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node); - if (!rules[name]) { - rules[name] = true; - stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length); - } - const animation = node.style.animation || ""; - node.style.animation = `${animation ? `${animation}, ` : ""}${name} ${duration}ms linear ${delay2}ms 1 both`; - active += 1; - return name; -} -function delete_rule(node, name) { - const previous = (node.style.animation || "").split(", "); - const next = previous.filter( - name ? (anim) => anim.indexOf(name) < 0 : (anim) => anim.indexOf("__svelte") === -1 - // remove all Svelte animations - ); - const deleted = previous.length - next.length; - if (deleted) { - node.style.animation = next.join(", "); - active -= deleted; - if (!active) - clear_rules(); - } -} -function clear_rules() { - raf(() => { - if (active) - return; - managed_styles.forEach((info) => { - const { ownerNode } = info.stylesheet; - if (ownerNode) - detach(ownerNode); - }); - managed_styles.clear(); - }); -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/await_block.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/transitions.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/scheduler.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/lifecycle.js -init_polyfill_buffer(); -var current_component; -function set_current_component(component) { - current_component = component; -} -function get_current_component() { - if (!current_component) - throw new Error("Function called outside component initialization"); - return current_component; -} -function onDestroy(fn) { - get_current_component().$$.on_destroy.push(fn); -} -function bubble(component, event) { - const callbacks = component.$$.callbacks[event.type]; - if (callbacks) { - callbacks.slice().forEach((fn) => fn.call(this, event)); - } -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/scheduler.js -var dirty_components = []; -var binding_callbacks = []; -var render_callbacks = []; -var flush_callbacks = []; -var resolved_promise = /* @__PURE__ */ Promise.resolve(); -var update_scheduled = false; -function schedule_update() { - if (!update_scheduled) { - update_scheduled = true; - resolved_promise.then(flush); - } -} -function add_render_callback(fn) { - render_callbacks.push(fn); -} -var seen_callbacks = /* @__PURE__ */ new Set(); -var flushidx = 0; -function flush() { - if (flushidx !== 0) { - return; - } - const saved_component = current_component; - do { - try { - while (flushidx < dirty_components.length) { - const component = dirty_components[flushidx]; - flushidx++; - set_current_component(component); - update(component.$$); - } - } catch (e) { - dirty_components.length = 0; - flushidx = 0; - throw e; - } - set_current_component(null); - dirty_components.length = 0; - flushidx = 0; - while (binding_callbacks.length) - binding_callbacks.pop()(); - for (let i = 0; i < render_callbacks.length; i += 1) { - const callback = render_callbacks[i]; - if (!seen_callbacks.has(callback)) { - seen_callbacks.add(callback); - callback(); - } - } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - seen_callbacks.clear(); - set_current_component(saved_component); -} -function update($$) { - if ($$.fragment !== null) { - $$.update(); - run_all($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback); - } -} -function flush_render_callbacks(fns) { - const filtered = []; - const targets = []; - render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c)); - targets.forEach((c) => c()); - render_callbacks = filtered; -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/transitions.js -var promise; -function wait() { - if (!promise) { - promise = Promise.resolve(); - promise.then(() => { - promise = null; - }); - } - return promise; -} -function dispatch(node, direction, kind) { - node.dispatchEvent(custom_event(`${direction ? "intro" : "outro"}${kind}`)); -} -var outroing = /* @__PURE__ */ new Set(); -var outros; -function group_outros() { - outros = { - r: 0, - c: [], - p: outros - // parent group - }; -} -function check_outros() { - if (!outros.r) { - run_all(outros.c); - } - outros = outros.p; -} -function transition_in(block, local) { - if (block && block.i) { - outroing.delete(block); - block.i(local); - } -} -function transition_out(block, local, detach2, callback) { - if (block && block.o) { - if (outroing.has(block)) - return; - outroing.add(block); - outros.c.push(() => { - outroing.delete(block); - if (callback) { - if (detach2) - block.d(1); - callback(); - } - }); - block.o(local); - } else if (callback) { - callback(); - } -} -var null_transition = { duration: 0 }; -function create_bidirectional_transition(node, fn, params, intro) { - const options = { direction: "both" }; - let config = fn(node, params, options); - let t = intro ? 0 : 1; - let running_program = null; - let pending_program = null; - let animation_name = null; - let original_inert_value; - function clear_animation() { - if (animation_name) - delete_rule(node, animation_name); - } - function init3(program, duration) { - const d = ( - /** @type {Program['d']} */ - program.b - t - ); - duration *= Math.abs(d); - return { - a: t, - b: program.b, - d, - duration, - start: program.start, - end: program.start + duration, - group: program.group - }; - } - function go(b) { - const { - delay: delay2 = 0, - duration = 300, - easing = identity, - tick: tick2 = noop, - css - } = config || null_transition; - const program = { - start: now() + delay2, - b - }; - if (!b) { - program.group = outros; - outros.r += 1; - } - if ("inert" in node) { - if (b) { - if (original_inert_value !== void 0) { - node.inert = original_inert_value; - } - } else { - original_inert_value = /** @type {HTMLElement} */ - node.inert; - node.inert = true; - } - } - if (running_program || pending_program) { - pending_program = program; - } else { - if (css) { - clear_animation(); - animation_name = create_rule(node, t, b, duration, delay2, easing, css); - } - if (b) - tick2(0, 1); - running_program = init3(program, duration); - add_render_callback(() => dispatch(node, b, "start")); - loop((now2) => { - if (pending_program && now2 > pending_program.start) { - running_program = init3(pending_program, duration); - pending_program = null; - dispatch(node, running_program.b, "start"); - if (css) { - clear_animation(); - animation_name = create_rule( - node, - t, - running_program.b, - running_program.duration, - 0, - easing, - config.css - ); - } - } - if (running_program) { - if (now2 >= running_program.end) { - tick2(t = running_program.b, 1 - t); - dispatch(node, running_program.b, "end"); - if (!pending_program) { - if (running_program.b) { - clear_animation(); - } else { - if (!--running_program.group.r) - run_all(running_program.group.c); - } - } - running_program = null; - } else if (now2 >= running_program.start) { - const p = now2 - running_program.start; - t = running_program.a + running_program.d * easing(p / running_program.duration); - tick2(t, 1 - t); - } - } - return !!(running_program || pending_program); - }); - } - } - return { - run(b) { - if (is_function(config)) { - wait().then(() => { - const opts = { direction: b ? "in" : "out" }; - config = config(opts); - go(b); - }); - } else { - go(b); - } - }, - end() { - clear_animation(); - running_program = pending_program = null; - } - }; -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/each.js -init_polyfill_buffer(); -function ensure_array_like(array_like_or_iterator) { - return (array_like_or_iterator == null ? void 0 : array_like_or_iterator.length) !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator); -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/spread.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/ssr.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/shared/boolean_attributes.js -init_polyfill_buffer(); -var _boolean_attributes = ( - /** @type {const} */ - [ - "allowfullscreen", - "allowpaymentrequest", - "async", - "autofocus", - "autoplay", - "checked", - "controls", - "default", - "defer", - "disabled", - "formnovalidate", - "hidden", - "inert", - "ismap", - "loop", - "multiple", - "muted", - "nomodule", - "novalidate", - "open", - "playsinline", - "readonly", - "required", - "reversed", - "selected" - ] -); -var boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/shared/utils/names.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/Component.js -init_polyfill_buffer(); -function create_component(block) { - block && block.c(); -} -function mount_component(component, target, anchor) { - const { fragment, after_update } = component.$$; - fragment && fragment.m(target, anchor); - add_render_callback(() => { - const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); - if (component.$$.on_destroy) { - component.$$.on_destroy.push(...new_on_destroy); - } else { - run_all(new_on_destroy); - } - component.$$.on_mount = []; - }); - after_update.forEach(add_render_callback); -} -function destroy_component(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - flush_render_callbacks($$.after_update); - run_all($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } -} -function make_dirty(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty.fill(0); - } - component.$$.dirty[i / 31 | 0] |= 1 << i % 31; -} -function init2(component, options, instance10, create_fragment10, not_equal, props, append_styles2, dirty = [-1]) { - const parent_component = current_component; - set_current_component(component); - const $$ = component.$$ = { - fragment: null, - ctx: [], - // state - props, - update: noop, - not_equal, - bound: blank_object(), - // lifecycle - on_mount: [], - on_destroy: [], - on_disconnect: [], - before_update: [], - after_update: [], - context: new Map(options.context || (parent_component ? parent_component.$$.context : [])), - // everything else - callbacks: blank_object(), - dirty, - skip_bound: false, - root: options.target || parent_component.$$.root - }; - append_styles2 && append_styles2($$.root); - let ready = false; - $$.ctx = instance10 ? instance10(component, options.props || {}, (i, ret, ...rest) => { - const value = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value); - if (ready) - make_dirty(component, i); - } - return ret; - }) : []; - $$.update(); - ready = true; - run_all($$.before_update); - $$.fragment = create_fragment10 ? create_fragment10($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - start_hydrating(); - const nodes = children(options.target); - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach); - } else { - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor); - end_hydrating(); - flush(); - } - set_current_component(parent_component); -} -var SvelteElement; -if (typeof HTMLElement === "function") { - SvelteElement = class extends HTMLElement { - constructor($$componentCtor, $$slots, use_shadow_dom) { - super(); - /** The Svelte component constructor */ - __publicField(this, "$$ctor"); - /** Slots */ - __publicField(this, "$$s"); - /** The Svelte component instance */ - __publicField(this, "$$c"); - /** Whether or not the custom element is connected */ - __publicField(this, "$$cn", false); - /** Component props data */ - __publicField(this, "$$d", {}); - /** `true` if currently in the process of reflecting component props back to attributes */ - __publicField(this, "$$r", false); - /** @type {Record} Props definition (name, reflected, type etc) */ - __publicField(this, "$$p_d", {}); - /** @type {Record} Event listeners */ - __publicField(this, "$$l", {}); - /** @type {Map} Event listener unsubscribe functions */ - __publicField(this, "$$l_u", /* @__PURE__ */ new Map()); - this.$$ctor = $$componentCtor; - this.$$s = $$slots; - if (use_shadow_dom) { - this.attachShadow({ mode: "open" }); - } - } - addEventListener(type, listener, options) { - this.$$l[type] = this.$$l[type] || []; - this.$$l[type].push(listener); - if (this.$$c) { - const unsub = this.$$c.$on(type, listener); - this.$$l_u.set(listener, unsub); - } - super.addEventListener(type, listener, options); - } - removeEventListener(type, listener, options) { - super.removeEventListener(type, listener, options); - if (this.$$c) { - const unsub = this.$$l_u.get(listener); - if (unsub) { - unsub(); - this.$$l_u.delete(listener); - } - } - } - async connectedCallback() { - this.$$cn = true; - if (!this.$$c) { - let create_slot = function(name) { - return () => { - let node; - const obj = { - c: function create() { - node = element("slot"); - if (name !== "default") { - attr(node, "name", name); - } - }, - /** - * @param {HTMLElement} target - * @param {HTMLElement} [anchor] - */ - m: function mount(target, anchor) { - insert(target, node, anchor); - }, - d: function destroy(detaching) { - if (detaching) { - detach(node); - } - } - }; - return obj; - }; - }; - await Promise.resolve(); - if (!this.$$cn) { - return; - } - const $$slots = {}; - const existing_slots = get_custom_elements_slots(this); - for (const name of this.$$s) { - if (name in existing_slots) { - $$slots[name] = [create_slot(name)]; - } - } - for (const attribute of this.attributes) { - const name = this.$$g_p(attribute.name); - if (!(name in this.$$d)) { - this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp"); - } - } - this.$$c = new this.$$ctor({ - target: this.shadowRoot || this, - props: { - ...this.$$d, - $$slots, - $$scope: { - ctx: [] - } - } - }); - const reflect_attributes = () => { - this.$$r = true; - for (const key2 in this.$$p_d) { - this.$$d[key2] = this.$$c.$$.ctx[this.$$c.$$.props[key2]]; - if (this.$$p_d[key2].reflect) { - const attribute_value = get_custom_element_value( - key2, - this.$$d[key2], - this.$$p_d, - "toAttribute" - ); - if (attribute_value == null) { - this.removeAttribute(key2); - } else { - this.setAttribute(this.$$p_d[key2].attribute || key2, attribute_value); - } - } - } - this.$$r = false; - }; - this.$$c.$$.after_update.push(reflect_attributes); - reflect_attributes(); - for (const type in this.$$l) { - for (const listener of this.$$l[type]) { - const unsub = this.$$c.$on(type, listener); - this.$$l_u.set(listener, unsub); - } - } - this.$$l = {}; - } - } - // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte - // and setting attributes through setAttribute etc, this is helpful - attributeChangedCallback(attr2, _oldValue, newValue) { - var _a2; - if (this.$$r) - return; - attr2 = this.$$g_p(attr2); - this.$$d[attr2] = get_custom_element_value(attr2, newValue, this.$$p_d, "toProp"); - (_a2 = this.$$c) == null ? void 0 : _a2.$set({ [attr2]: this.$$d[attr2] }); - } - disconnectedCallback() { - this.$$cn = false; - Promise.resolve().then(() => { - if (!this.$$cn) { - this.$$c.$destroy(); - this.$$c = void 0; - } - }); - } - $$g_p(attribute_name) { - return Object.keys(this.$$p_d).find( - (key2) => this.$$p_d[key2].attribute === attribute_name || !this.$$p_d[key2].attribute && key2.toLowerCase() === attribute_name - ) || attribute_name; - } - }; -} -function get_custom_element_value(prop, value, props_definition, transform) { - var _a2; - const type = (_a2 = props_definition[prop]) == null ? void 0 : _a2.type; - value = type === "Boolean" && typeof value !== "boolean" ? value != null : value; - if (!transform || !props_definition[prop]) { - return value; - } else if (transform === "toAttribute") { - switch (type) { - case "Object": - case "Array": - return value == null ? null : JSON.stringify(value); - case "Boolean": - return value ? "" : null; - case "Number": - return value == null ? null : value; - default: - return value; - } - } else { - switch (type) { - case "Object": - case "Array": - return value && JSON.parse(value); - case "Boolean": - return value; - case "Number": - return value != null ? +value : value; - default: - return value; - } - } -} -var SvelteComponent = class { - constructor() { - /** - * ### PRIVATE API - * - * Do not use, may change at any time - * - * @type {any} - */ - __publicField(this, "$$"); - /** - * ### PRIVATE API - * - * Do not use, may change at any time - * - * @type {any} - */ - __publicField(this, "$$set"); - } - /** @returns {void} */ - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - /** - * @template {Extract} K - * @param {K} type - * @param {((e: Events[K]) => void) | null | undefined} callback - * @returns {() => void} - */ - $on(type, callback) { - if (!is_function(callback)) { - return noop; - } - const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); - callbacks.push(callback); - return () => { - const index2 = callbacks.indexOf(callback); - if (index2 !== -1) - callbacks.splice(index2, 1); - }; - } - /** - * @param {Partial} props - * @returns {void} - */ - $set(props) { - if (this.$$set && !is_empty(props)) { - this.$$.skip_bound = true; - this.$$set(props); - this.$$.skip_bound = false; - } - } -}; - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/dev.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/shared/version.js -init_polyfill_buffer(); -var PUBLIC_VERSION = "4"; - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/internal/disclose-version/index.js -init_polyfill_buffer(); -if (typeof window !== "undefined") - (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(PUBLIC_VERSION); - -// node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs -init_polyfill_buffer(); -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function(resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -// src/ui/history/historyView.svelte -var import_obsidian19 = require("obsidian"); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/index.js -init_polyfill_buffer(); - -// src/ui/history/components/logComponent.svelte -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/transition/index.js -init_polyfill_buffer(); - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/easing/index.js -init_polyfill_buffer(); -function cubicOut(t) { - const f = t - 1; - return f * f * f + 1; -} - -// node_modules/.pnpm/svelte@4.2.0/node_modules/svelte/src/runtime/transition/index.js -function slide(node, { delay: delay2 = 0, duration = 400, easing = cubicOut, axis = "y" } = {}) { - const style = getComputedStyle(node); - const opacity = +style.opacity; - const primary_property = axis === "y" ? "height" : "width"; - const primary_property_value = parseFloat(style[primary_property]); - const secondary_properties = axis === "y" ? ["top", "bottom"] : ["left", "right"]; - const capitalized_secondary_properties = secondary_properties.map( - (e) => `${e[0].toUpperCase()}${e.slice(1)}` - ); - const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]); - const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]); - const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]); - const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]); - const border_width_start_value = parseFloat( - style[`border${capitalized_secondary_properties[0]}Width`] - ); - const border_width_end_value = parseFloat( - style[`border${capitalized_secondary_properties[1]}Width`] - ); - return { - delay: delay2, - duration, - easing, - css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};${primary_property}: ${t * primary_property_value}px;padding-${secondary_properties[0]}: ${t * padding_start_value}px;padding-${secondary_properties[1]}: ${t * padding_end_value}px;margin-${secondary_properties[0]}: ${t * margin_start_value}px;margin-${secondary_properties[1]}: ${t * margin_end_value}px;border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;` - }; -} - -// src/ui/history/components/logFileComponent.svelte -init_polyfill_buffer(); -var import_obsidian18 = require("obsidian"); -function add_css(target) { - append_styles(target, "svelte-1wbh8tp", "main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}"); -} -function create_if_block(ctx) { - let div; - let mounted; - let dispose; - return { - c() { - div = element("div"); - attr(div, "data-icon", "go-to-file"); - attr(div, "aria-label", "Open File"); - attr(div, "class", "clickable-icon"); - }, - m(target, anchor) { - insert(target, div, anchor); - ctx[7](div); - if (!mounted) { - dispose = [ - listen(div, "auxclick", stop_propagation( - /*open*/ - ctx[4] - )), - listen(div, "click", stop_propagation( - /*open*/ - ctx[4] - )) - ]; - mounted = true; - } - }, - p: noop, - d(detaching) { - if (detaching) { - detach(div); - } - ctx[7](null); - mounted = false; - run_all(dispose); - } - }; -} -function create_fragment(ctx) { - let main; - let div3; - let div0; - let t0_value = getDisplayPath( - /*diff*/ - ctx[0].vault_path - ) + ""; - let t0; - let t1; - let div2; - let div1; - let show_if = ( - /*view*/ - ctx[1].app.vault.getAbstractFileByPath( - /*diff*/ - ctx[0].vault_path - ) - ); - let t2; - let span; - let t3_value = ( - /*diff*/ - ctx[0].status + "" - ); - let t3; - let span_data_type_value; - let div3_data_path_value; - let div3_aria_label_value; - let mounted; - let dispose; - let if_block = show_if && create_if_block(ctx); - return { - c() { - var _a2, _b; - main = element("main"); - div3 = element("div"); - div0 = element("div"); - t0 = text(t0_value); - t1 = space(); - div2 = element("div"); - div1 = element("div"); - if (if_block) - if_block.c(); - t2 = space(); - span = element("span"); - t3 = text(t3_value); - attr(div0, "class", "tree-item-inner nav-file-title-content"); - attr(div1, "class", "buttons"); - attr(span, "class", "type"); - attr(span, "data-type", span_data_type_value = /*diff*/ - ctx[0].status); - attr(div2, "class", "git-tools"); - attr(div3, "class", "tree-item-self is-clickable nav-file-title svelte-1wbh8tp"); - attr(div3, "data-path", div3_data_path_value = /*diff*/ - ctx[0].vault_path); - attr( - div3, - "aria-label-position", - /*side*/ - ctx[3] - ); - attr( - div3, - "data-tooltip-position", - /*side*/ - ctx[3] - ); - attr(div3, "aria-label", div3_aria_label_value = /*diff*/ - ctx[0].vault_path); - toggle_class( - div3, - "is-active", - /*view*/ - ((_a2 = ctx[1].plugin.lastDiffViewState) == null ? void 0 : _a2.file) == /*diff*/ - ctx[0].vault_path && /*view*/ - ((_b = ctx[1].plugin.lastDiffViewState) == null ? void 0 : _b.hash) - ); - attr(main, "class", "tree-item nav-file svelte-1wbh8tp"); - }, - m(target, anchor) { - insert(target, main, anchor); - append2(main, div3); - append2(div3, div0); - append2(div0, t0); - append2(div3, t1); - append2(div3, div2); - append2(div2, div1); - if (if_block) - if_block.m(div1, null); - append2(div2, t2); - append2(div2, span); - append2(span, t3); - if (!mounted) { - dispose = [ - listen(main, "click", stop_propagation( - /*showDiff*/ - ctx[5] - )), - listen(main, "auxclick", stop_propagation( - /*showDiff*/ - ctx[5] - )), - listen( - main, - "focus", - /*focus_handler*/ - ctx[6] - ) - ]; - mounted = true; - } - }, - p(ctx2, [dirty]) { - var _a2, _b; - if (dirty & /*diff*/ - 1 && t0_value !== (t0_value = getDisplayPath( - /*diff*/ - ctx2[0].vault_path - ) + "")) - set_data(t0, t0_value); - if (dirty & /*view, diff*/ - 3) - show_if = /*view*/ - ctx2[1].app.vault.getAbstractFileByPath( - /*diff*/ - ctx2[0].vault_path - ); - if (show_if) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block(ctx2); - if_block.c(); - if_block.m(div1, null); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & /*diff*/ - 1 && t3_value !== (t3_value = /*diff*/ - ctx2[0].status + "")) - set_data(t3, t3_value); - if (dirty & /*diff*/ - 1 && span_data_type_value !== (span_data_type_value = /*diff*/ - ctx2[0].status)) { - attr(span, "data-type", span_data_type_value); - } - if (dirty & /*diff*/ - 1 && div3_data_path_value !== (div3_data_path_value = /*diff*/ - ctx2[0].vault_path)) { - attr(div3, "data-path", div3_data_path_value); - } - if (dirty & /*side*/ - 8) { - attr( - div3, - "aria-label-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*side*/ - 8) { - attr( - div3, - "data-tooltip-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*diff*/ - 1 && div3_aria_label_value !== (div3_aria_label_value = /*diff*/ - ctx2[0].vault_path)) { - attr(div3, "aria-label", div3_aria_label_value); - } - if (dirty & /*view, diff*/ - 3) { - toggle_class( - div3, - "is-active", - /*view*/ - ((_a2 = ctx2[1].plugin.lastDiffViewState) == null ? void 0 : _a2.file) == /*diff*/ - ctx2[0].vault_path && /*view*/ - ((_b = ctx2[1].plugin.lastDiffViewState) == null ? void 0 : _b.hash) - ); - } - }, - i: noop, - o: noop, - d(detaching) { - if (detaching) { - detach(main); - } - if (if_block) - if_block.d(); - mounted = false; - run_all(dispose); - } - }; -} -function instance($$self, $$props, $$invalidate) { - let side; - let { diff: diff2 } = $$props; - let { view } = $$props; - let buttons = []; - window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian18.setIcon)(b, b.getAttr("data-icon"))), 0); - function open(event) { - var _a2; - const file = view.app.vault.getAbstractFileByPath(diff2.vault_path); - if (file instanceof import_obsidian18.TFile) { - (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); - } - } - function showDiff(event) { - var _a2; - (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.setViewState({ - type: DIFF_VIEW_CONFIG.type, - active: true, - state: { - file: diff2.path, - staged: false, - hash: diff2.hash - } - }); - } - function focus_handler(event) { - bubble.call(this, $$self, event); - } - function div_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[0] = $$value; - $$invalidate(2, buttons); - }); - } - $$self.$$set = ($$props2) => { - if ("diff" in $$props2) - $$invalidate(0, diff2 = $$props2.diff); - if ("view" in $$props2) - $$invalidate(1, view = $$props2.view); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*view*/ - 2) { - $: - $$invalidate(3, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [diff2, view, buttons, side, open, showDiff, focus_handler, div_binding]; -} -var LogFileComponent = class extends SvelteComponent { - constructor(options) { - super(); - init2(this, options, instance, create_fragment, safe_not_equal, { diff: 0, view: 1 }, add_css); - } -}; -var logFileComponent_default = LogFileComponent; - -// src/ui/history/components/logTreeComponent.svelte -init_polyfill_buffer(); -function add_css2(target) { - append_styles(target, "svelte-1lnl15d", "main.svelte-1lnl15d .nav-folder-title-content.svelte-1lnl15d{display:flex;align-items:center}"); -} -function get_each_context(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[8] = list[i]; - return child_ctx; -} -function create_else_block(ctx) { - let div4; - let div3; - let div0; - let t0; - let div1; - let t1; - let div2; - let t2_value = ( - /*entity*/ - ctx[8].title + "" - ); - let t2; - let div3_aria_label_value; - let t3; - let t4; - let current; - let mounted; - let dispose; - function click_handler() { - return ( - /*click_handler*/ - ctx[7]( - /*entity*/ - ctx[8] - ) - ); - } - let if_block = !/*closed*/ - ctx[4][ - /*entity*/ - ctx[8].title - ] && create_if_block_1(ctx); - return { - c() { - div4 = element("div"); - div3 = element("div"); - div0 = element("div"); - t0 = space(); - div1 = element("div"); - div1.innerHTML = ``; - t1 = space(); - div2 = element("div"); - t2 = text(t2_value); - t3 = space(); - if (if_block) - if_block.c(); - t4 = space(); - attr(div0, "data-icon", "folder"); - set_style(div0, "padding-right", "5px"); - set_style(div0, "display", "flex"); - attr(div1, "class", "tree-item-icon nav-folder-collapse-indicator collapse-icon"); - toggle_class( - div1, - "is-collapsed", - /*closed*/ - ctx[4][ - /*entity*/ - ctx[8].title - ] - ); - attr(div2, "class", "tree-item-inner nav-folder-title-content svelte-1lnl15d"); - attr(div3, "class", "tree-item-self is-clickable nav-folder-title"); - attr( - div3, - "aria-label-position", - /*side*/ - ctx[5] - ); - attr( - div3, - "data-tooltip-position", - /*side*/ - ctx[5] - ); - attr(div3, "aria-label", div3_aria_label_value = /*entity*/ - ctx[8].vaultPath); - attr(div4, "class", "tree-item nav-folder"); - toggle_class( - div4, - "is-collapsed", - /*closed*/ - ctx[4][ - /*entity*/ - ctx[8].title - ] - ); - }, - m(target, anchor) { - insert(target, div4, anchor); - append2(div4, div3); - append2(div3, div0); - append2(div3, t0); - append2(div3, div1); - append2(div3, t1); - append2(div3, div2); - append2(div2, t2); - append2(div4, t3); - if (if_block) - if_block.m(div4, null); - append2(div4, t4); - current = true; - if (!mounted) { - dispose = listen(div3, "click", click_handler); - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - if (!current || dirty & /*closed, hierarchy*/ - 17) { - toggle_class( - div1, - "is-collapsed", - /*closed*/ - ctx[4][ - /*entity*/ - ctx[8].title - ] - ); - } - if ((!current || dirty & /*hierarchy*/ - 1) && t2_value !== (t2_value = /*entity*/ - ctx[8].title + "")) - set_data(t2, t2_value); - if (!current || dirty & /*side*/ - 32) { - attr( - div3, - "aria-label-position", - /*side*/ - ctx[5] - ); - } - if (!current || dirty & /*side*/ - 32) { - attr( - div3, - "data-tooltip-position", - /*side*/ - ctx[5] - ); - } - if (!current || dirty & /*hierarchy*/ - 1 && div3_aria_label_value !== (div3_aria_label_value = /*entity*/ - ctx[8].vaultPath)) { - attr(div3, "aria-label", div3_aria_label_value); - } - if (!/*closed*/ - ctx[4][ - /*entity*/ - ctx[8].title - ]) { - if (if_block) { - if_block.p(ctx, dirty); - if (dirty & /*closed, hierarchy*/ - 17) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block_1(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(div4, t4); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - if (!current || dirty & /*closed, hierarchy*/ - 17) { - toggle_class( - div4, - "is-collapsed", - /*closed*/ - ctx[4][ - /*entity*/ - ctx[8].title - ] - ); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) { - detach(div4); - } - if (if_block) - if_block.d(); - mounted = false; - dispose(); - } - }; -} -function create_if_block2(ctx) { - let div; - let logfilecomponent; - let t; - let current; - logfilecomponent = new logFileComponent_default({ - props: { - diff: ( - /*entity*/ - ctx[8].data - ), - view: ( - /*view*/ - ctx[2] - ) - } - }); - return { - c() { - div = element("div"); - create_component(logfilecomponent.$$.fragment); - t = space(); - }, - m(target, anchor) { - insert(target, div, anchor); - mount_component(logfilecomponent, div, null); - append2(div, t); - current = true; - }, - p(ctx2, dirty) { - const logfilecomponent_changes = {}; - if (dirty & /*hierarchy*/ - 1) - logfilecomponent_changes.diff = /*entity*/ - ctx2[8].data; - if (dirty & /*view*/ - 4) - logfilecomponent_changes.view = /*view*/ - ctx2[2]; - logfilecomponent.$set(logfilecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(logfilecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(logfilecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) { - detach(div); - } - destroy_component(logfilecomponent); - } - }; -} -function create_if_block_1(ctx) { - let div; - let logtreecomponent; - let div_transition; - let current; - logtreecomponent = new LogTreeComponent({ - props: { - hierarchy: ( - /*entity*/ - ctx[8] - ), - plugin: ( - /*plugin*/ - ctx[1] - ), - view: ( - /*view*/ - ctx[2] - ) - } - }); - return { - c() { - div = element("div"); - create_component(logtreecomponent.$$.fragment); - attr(div, "class", "tree-item-children nav-folder-children"); - }, - m(target, anchor) { - insert(target, div, anchor); - mount_component(logtreecomponent, div, null); - current = true; - }, - p(ctx2, dirty) { - const logtreecomponent_changes = {}; - if (dirty & /*hierarchy*/ - 1) - logtreecomponent_changes.hierarchy = /*entity*/ - ctx2[8]; - if (dirty & /*plugin*/ - 2) - logtreecomponent_changes.plugin = /*plugin*/ - ctx2[1]; - if (dirty & /*view*/ - 4) - logtreecomponent_changes.view = /*view*/ - ctx2[2]; - logtreecomponent.$set(logtreecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(logtreecomponent.$$.fragment, local); - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(logtreecomponent.$$.fragment, local); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(div); - } - destroy_component(logtreecomponent); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_each_block(ctx) { - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [create_if_block2, create_else_block]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if ( - /*entity*/ - ctx2[8].data - ) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert(target, if_block_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) { - detach(if_block_anchor); - } - if_blocks[current_block_type_index].d(detaching); - } - }; -} -function create_fragment2(ctx) { - let main; - let current; - let each_value = ensure_array_like( - /*hierarchy*/ - ctx[0].children - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - main = element("main"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(main, "class", "svelte-1lnl15d"); - toggle_class( - main, - "topLevel", - /*topLevel*/ - ctx[3] - ); - }, - m(target, anchor) { - insert(target, main, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(main, null); - } - } - current = true; - }, - p(ctx2, [dirty]) { - if (dirty & /*hierarchy, view, closed, plugin, side, fold*/ - 119) { - each_value = ensure_array_like( - /*hierarchy*/ - ctx2[0].children - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(main, null); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - if (!current || dirty & /*topLevel*/ - 8) { - toggle_class( - main, - "topLevel", - /*topLevel*/ - ctx2[3] - ); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(main); - } - destroy_each(each_blocks, detaching); - } - }; -} -function instance2($$self, $$props, $$invalidate) { - let side; - let { hierarchy } = $$props; - let { plugin } = $$props; - let { view } = $$props; - let { topLevel = false } = $$props; - const closed = {}; - function fold(item) { - $$invalidate(4, closed[item.title] = !closed[item.title], closed); - } - const click_handler = (entity) => fold(entity); - $$self.$$set = ($$props2) => { - if ("hierarchy" in $$props2) - $$invalidate(0, hierarchy = $$props2.hierarchy); - if ("plugin" in $$props2) - $$invalidate(1, plugin = $$props2.plugin); - if ("view" in $$props2) - $$invalidate(2, view = $$props2.view); - if ("topLevel" in $$props2) - $$invalidate(3, topLevel = $$props2.topLevel); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*view*/ - 4) { - $: - $$invalidate(5, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [hierarchy, plugin, view, topLevel, closed, side, fold, click_handler]; -} -var LogTreeComponent = class extends SvelteComponent { - constructor(options) { - super(); - init2( - this, - options, - instance2, - create_fragment2, - safe_not_equal, - { - hierarchy: 0, - plugin: 1, - view: 2, - topLevel: 3 - }, - add_css2 - ); - } -}; -var logTreeComponent_default = LogTreeComponent; - -// src/ui/history/components/logComponent.svelte -function add_css3(target) { - append_styles(target, "svelte-1t6egnt", ".git-ref.svelte-1t6egnt{color:var(--text-accent)}"); -} -function get_each_context2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[8] = list[i]; - return child_ctx; -} -function create_if_block_2(ctx) { - let div; - let t_value = ( - /*log*/ - ctx[0].refs.join(", ") + "" - ); - let t; - return { - c() { - div = element("div"); - t = text(t_value); - attr(div, "class", "git-ref svelte-1t6egnt"); - }, - m(target, anchor) { - insert(target, div, anchor); - append2(div, t); - }, - p(ctx2, dirty) { - if (dirty & /*log*/ - 1 && t_value !== (t_value = /*log*/ - ctx2[0].refs.join(", ") + "")) - set_data(t, t_value); - }, - d(detaching) { - if (detaching) { - detach(div); - } - } - }; -} -function create_if_block3(ctx) { - let div; - let current_block_type_index; - let if_block; - let div_transition; - let current; - const if_block_creators = [create_if_block_12, create_else_block2]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if ( - /*showTree*/ - ctx2[2] - ) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - div = element("div"); - if_block.c(); - attr(div, "class", "tree-item-children nav-folder-children"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div, null); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(if_block); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(div); - } - if_blocks[current_block_type_index].d(); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_else_block2(ctx) { - let each_1_anchor; - let current; - let each_value = ensure_array_like( - /*log*/ - ctx[0].diff.files - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - m(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert(target, each_1_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - if (dirty & /*view, log*/ - 3) { - each_value = ensure_array_like( - /*log*/ - ctx2[0].diff.files - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context2(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block2(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(each_1_anchor); - } - destroy_each(each_blocks, detaching); - } - }; -} -function create_if_block_12(ctx) { - let logtreecomponent; - let current; - logtreecomponent = new logTreeComponent_default({ - props: { - hierarchy: ( - /*logsHierarchy*/ - ctx[6] - ), - plugin: ( - /*plugin*/ - ctx[3] - ), - view: ( - /*view*/ - ctx[1] - ), - topLevel: true - } - }); - return { - c() { - create_component(logtreecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(logtreecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const logtreecomponent_changes = {}; - if (dirty & /*logsHierarchy*/ - 64) - logtreecomponent_changes.hierarchy = /*logsHierarchy*/ - ctx2[6]; - if (dirty & /*plugin*/ - 8) - logtreecomponent_changes.plugin = /*plugin*/ - ctx2[3]; - if (dirty & /*view*/ - 2) - logtreecomponent_changes.view = /*view*/ - ctx2[1]; - logtreecomponent.$set(logtreecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(logtreecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(logtreecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(logtreecomponent, detaching); - } - }; -} -function create_each_block2(ctx) { - let logfilecomponent; - let current; - logfilecomponent = new logFileComponent_default({ - props: { - view: ( - /*view*/ - ctx[1] - ), - diff: ( - /*file*/ - ctx[8] - ) - } - }); - return { - c() { - create_component(logfilecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(logfilecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const logfilecomponent_changes = {}; - if (dirty & /*view*/ - 2) - logfilecomponent_changes.view = /*view*/ - ctx2[1]; - if (dirty & /*log*/ - 1) - logfilecomponent_changes.diff = /*file*/ - ctx2[8]; - logfilecomponent.$set(logfilecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(logfilecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(logfilecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(logfilecomponent, detaching); - } - }; -} -function create_fragment3(ctx) { - let main; - let div4; - let div3; - let div0; - let t0; - let div2; - let t1; - let div1; - let t2_value = ( - /*log*/ - ctx[0].message + "" - ); - let t2; - let div1_aria_label_value; - let t3; - let current; - let mounted; - let dispose; - let if_block0 = ( - /*log*/ - ctx[0].refs.length > 0 && create_if_block_2(ctx) - ); - let if_block1 = !/*isCollapsed*/ - ctx[4] && create_if_block3(ctx); - return { - c() { - main = element("main"); - div4 = element("div"); - div3 = element("div"); - div0 = element("div"); - div0.innerHTML = ``; - t0 = space(); - div2 = element("div"); - if (if_block0) - if_block0.c(); - t1 = space(); - div1 = element("div"); - t2 = text(t2_value); - t3 = space(); - if (if_block1) - if_block1.c(); - attr(div0, "class", "tree-item-icon nav-folder-collapse-indicator collapse-icon"); - toggle_class( - div0, - "is-collapsed", - /*isCollapsed*/ - ctx[4] - ); - attr(div1, "class", "tree-item-inner nav-folder-title-content"); - attr(div1, "aria-label", div1_aria_label_value = /*log*/ - ctx[0].message); - attr( - div1, - "aria-label-position", - /*side*/ - ctx[5] - ); - attr( - div1, - "data-tooltip-position", - /*side*/ - ctx[5] - ); - attr(div3, "class", "tree-item-self is-clickable nav-folder-title"); - attr(div4, "class", "tree-item nav-folder"); - toggle_class( - div4, - "is-collapsed", - /*isCollapsed*/ - ctx[4] - ); - }, - m(target, anchor) { - insert(target, main, anchor); - append2(main, div4); - append2(div4, div3); - append2(div3, div0); - append2(div3, t0); - append2(div3, div2); - if (if_block0) - if_block0.m(div2, null); - append2(div2, t1); - append2(div2, div1); - append2(div1, t2); - append2(div4, t3); - if (if_block1) - if_block1.m(div4, null); - current = true; - if (!mounted) { - dispose = listen( - div3, - "click", - /*click_handler*/ - ctx[7] - ); - mounted = true; - } - }, - p(ctx2, [dirty]) { - if (!current || dirty & /*isCollapsed*/ - 16) { - toggle_class( - div0, - "is-collapsed", - /*isCollapsed*/ - ctx2[4] - ); - } - if ( - /*log*/ - ctx2[0].refs.length > 0 - ) { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_2(ctx2); - if_block0.c(); - if_block0.m(div2, t1); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if ((!current || dirty & /*log*/ - 1) && t2_value !== (t2_value = /*log*/ - ctx2[0].message + "")) - set_data(t2, t2_value); - if (!current || dirty & /*log*/ - 1 && div1_aria_label_value !== (div1_aria_label_value = /*log*/ - ctx2[0].message)) { - attr(div1, "aria-label", div1_aria_label_value); - } - if (!current || dirty & /*side*/ - 32) { - attr( - div1, - "aria-label-position", - /*side*/ - ctx2[5] - ); - } - if (!current || dirty & /*side*/ - 32) { - attr( - div1, - "data-tooltip-position", - /*side*/ - ctx2[5] - ); - } - if (!/*isCollapsed*/ - ctx2[4]) { - if (if_block1) { - if_block1.p(ctx2, dirty); - if (dirty & /*isCollapsed*/ - 16) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block3(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(div4, null); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - if (!current || dirty & /*isCollapsed*/ - 16) { - toggle_class( - div4, - "is-collapsed", - /*isCollapsed*/ - ctx2[4] - ); - } - }, - i(local) { - if (current) - return; - transition_in(if_block1); - current = true; - }, - o(local) { - transition_out(if_block1); - current = false; - }, - d(detaching) { - if (detaching) { - detach(main); - } - if (if_block0) - if_block0.d(); - if (if_block1) - if_block1.d(); - mounted = false; - dispose(); - } - }; -} -function instance3($$self, $$props, $$invalidate) { - let logsHierarchy; - let side; - let { log: log2 } = $$props; - let { view } = $$props; - let { showTree } = $$props; - let { plugin } = $$props; - let isCollapsed = true; - const click_handler = () => $$invalidate(4, isCollapsed = !isCollapsed); - $$self.$$set = ($$props2) => { - if ("log" in $$props2) - $$invalidate(0, log2 = $$props2.log); - if ("view" in $$props2) - $$invalidate(1, view = $$props2.view); - if ("showTree" in $$props2) - $$invalidate(2, showTree = $$props2.showTree); - if ("plugin" in $$props2) - $$invalidate(3, plugin = $$props2.plugin); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*plugin, log*/ - 9) { - $: - $$invalidate(6, logsHierarchy = { - title: "", - path: "", - vaultPath: "", - children: plugin.gitManager.getTreeStructure(log2.diff.files) - }); - } - if ($$self.$$.dirty & /*view*/ - 2) { - $: - $$invalidate(5, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [log2, view, showTree, plugin, isCollapsed, side, logsHierarchy, click_handler]; -} -var LogComponent = class extends SvelteComponent { - constructor(options) { - super(); - init2(this, options, instance3, create_fragment3, safe_not_equal, { log: 0, view: 1, showTree: 2, plugin: 3 }, add_css3); - } -}; -var logComponent_default = LogComponent; - -// src/ui/history/historyView.svelte -function get_each_context3(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[11] = list[i]; - return child_ctx; -} -function create_if_block4(ctx) { - let div1; - let div0; - let current; - let each_value = ensure_array_like( - /*logs*/ - ctx[6] - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block3(get_each_context3(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - div1 = element("div"); - div0 = element("div"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(div0, "class", "tree-item-children nav-folder-children"); - attr(div1, "class", "tree-item nav-folder mod-root"); - }, - m(target, anchor) { - insert(target, div1, anchor); - append2(div1, div0); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(div0, null); - } - } - current = true; - }, - p(ctx2, dirty) { - if (dirty & /*view, showTree, logs, plugin*/ - 71) { - each_value = ensure_array_like( - /*logs*/ - ctx2[6] - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context3(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block3(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(div0, null); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(div1); - } - destroy_each(each_blocks, detaching); - } - }; -} -function create_each_block3(ctx) { - let logcomponent; - let current; - logcomponent = new logComponent_default({ - props: { - view: ( - /*view*/ - ctx[1] - ), - showTree: ( - /*showTree*/ - ctx[2] - ), - log: ( - /*log*/ - ctx[11] - ), - plugin: ( - /*plugin*/ - ctx[0] - ) - } - }); - return { - c() { - create_component(logcomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(logcomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const logcomponent_changes = {}; - if (dirty & /*view*/ - 2) - logcomponent_changes.view = /*view*/ - ctx2[1]; - if (dirty & /*showTree*/ - 4) - logcomponent_changes.showTree = /*showTree*/ - ctx2[2]; - if (dirty & /*logs*/ - 64) - logcomponent_changes.log = /*log*/ - ctx2[11]; - if (dirty & /*plugin*/ - 1) - logcomponent_changes.plugin = /*plugin*/ - ctx2[0]; - logcomponent.$set(logcomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(logcomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(logcomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(logcomponent, detaching); - } - }; -} -function create_fragment4(ctx) { - let main; - let div3; - let div2; - let div0; - let t0; - let div1; - let t1; - let div4; - let current; - let mounted; - let dispose; - let if_block = ( - /*logs*/ - ctx[6] && create_if_block4(ctx) - ); - return { - c() { - main = element("main"); - div3 = element("div"); - div2 = element("div"); - div0 = element("div"); - t0 = space(); - div1 = element("div"); - t1 = space(); - div4 = element("div"); - if (if_block) - if_block.c(); - attr(div0, "id", "layoutChange"); - attr(div0, "class", "clickable-icon nav-action-button"); - attr(div0, "aria-label", "Change Layout"); - attr(div1, "id", "refresh"); - attr(div1, "class", "clickable-icon nav-action-button"); - attr(div1, "data-icon", "refresh-cw"); - attr(div1, "aria-label", "Refresh"); - set_style(div1, "margin", "1px"); - toggle_class( - div1, - "loading", - /*loading*/ - ctx[4] - ); - attr(div2, "class", "nav-buttons-container"); - attr(div3, "class", "nav-header"); - attr(div4, "class", "nav-files-container"); - set_style(div4, "position", "relative"); - }, - m(target, anchor) { - insert(target, main, anchor); - append2(main, div3); - append2(div3, div2); - append2(div2, div0); - ctx[7](div0); - append2(div2, t0); - append2(div2, div1); - ctx[9](div1); - append2(main, t1); - append2(main, div4); - if (if_block) - if_block.m(div4, null); - current = true; - if (!mounted) { - dispose = [ - listen( - div0, - "click", - /*click_handler*/ - ctx[8] - ), - listen(div1, "click", triggerRefresh) - ]; - mounted = true; - } - }, - p(ctx2, [dirty]) { - if (!current || dirty & /*loading*/ - 16) { - toggle_class( - div1, - "loading", - /*loading*/ - ctx2[4] - ); - } - if ( - /*logs*/ - ctx2[6] - ) { - if (if_block) { - if_block.p(ctx2, dirty); - if (dirty & /*logs*/ - 64) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block4(ctx2); - if_block.c(); - transition_in(if_block, 1); - if_block.m(div4, null); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) { - detach(main); - } - ctx[7](null); - ctx[9](null); - if (if_block) - if_block.d(); - mounted = false; - run_all(dispose); - } - }; -} -function triggerRefresh() { - dispatchEvent(new CustomEvent("git-refresh")); -} -function instance4($$self, $$props, $$invalidate) { - let { plugin } = $$props; - let { view } = $$props; - let loading; - let buttons = []; - let logs; - let showTree = plugin.settings.treeStructure; - let layoutBtn; - addEventListener("git-view-refresh", refresh); - plugin.app.workspace.onLayoutReady(() => { - window.setTimeout( - () => { - buttons.forEach((btn) => (0, import_obsidian19.setIcon)(btn, btn.getAttr("data-icon"), 16)); - (0, import_obsidian19.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); - }, - 0 - ); - }); - onDestroy(() => { - removeEventListener("git-view-refresh", refresh); - }); - function refresh() { - return __awaiter(this, void 0, void 0, function* () { - $$invalidate(4, loading = true); - const isSimpleGit = plugin.gitManager instanceof SimpleGit; - $$invalidate(6, logs = yield plugin.gitManager.log(void 0, false, isSimpleGit ? 50 : 10)); - $$invalidate(4, loading = false); - }); - } - function div0_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - layoutBtn = $$value; - $$invalidate(3, layoutBtn); - }); - } - const click_handler = () => { - $$invalidate(2, showTree = !showTree); - $$invalidate(0, plugin.settings.treeStructure = showTree, plugin); - plugin.saveSettings(); - }; - function div1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[6] = $$value; - $$invalidate(5, buttons); - }); - } - $$self.$$set = ($$props2) => { - if ("plugin" in $$props2) - $$invalidate(0, plugin = $$props2.plugin); - if ("view" in $$props2) - $$invalidate(1, view = $$props2.view); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*layoutBtn, showTree*/ - 12) { - $: { - if (layoutBtn) { - layoutBtn.empty(); - (0, import_obsidian19.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); - } - } - } - }; - return [ - plugin, - view, - showTree, - layoutBtn, - loading, - buttons, - logs, - div0_binding, - click_handler, - div1_binding - ]; -} -var HistoryView = class extends SvelteComponent { - constructor(options) { - super(); - init2(this, options, instance4, create_fragment4, safe_not_equal, { plugin: 0, view: 1 }); - } -}; -var historyView_default = HistoryView; - -// src/ui/history/historyView.ts -var HistoryView2 = class extends import_obsidian20.ItemView { - constructor(leaf, plugin) { - super(leaf); - this.plugin = plugin; - this.hoverPopover = null; - } - getViewType() { - return HISTORY_VIEW_CONFIG.type; - } - getDisplayText() { - return HISTORY_VIEW_CONFIG.name; - } - getIcon() { - return HISTORY_VIEW_CONFIG.icon; - } - onClose() { - return super.onClose(); - } - onOpen() { - this._view = new historyView_default({ - target: this.contentEl, - props: { - plugin: this.plugin, - view: this - } - }); - return super.onOpen(); - } -}; - -// src/ui/modals/branchModal.ts -init_polyfill_buffer(); -var import_obsidian21 = require("obsidian"); -var BranchModal = class extends import_obsidian21.FuzzySuggestModal { - constructor(branches) { - super(app); - this.branches = branches; - this.setPlaceholder("Select branch to checkout"); - } - getItems() { - return this.branches; - } - getItemText(item) { - return item; - } - onChooseItem(item, evt) { - this.resolve(item); - } - open() { - super.open(); - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - async onClose() { - await new Promise((resolve) => setTimeout(resolve, 10)); - if (this.resolve) - this.resolve(void 0); - } -}; - -// src/ui/modals/ignoreModal.ts -init_polyfill_buffer(); -var import_obsidian22 = require("obsidian"); -var IgnoreModal = class extends import_obsidian22.Modal { - constructor(app2, content) { - super(app2); - this.content = content; - this.resolve = null; - } - open() { - super.open(); - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - onOpen() { - const { contentEl, titleEl } = this; - titleEl.setText("Edit .gitignore"); - const div = contentEl.createDiv(); - const text2 = div.createEl("textarea", { - text: this.content, - cls: ["obsidian-git-textarea"], - attr: { rows: 10, cols: 30, wrap: "off" } - }); - div.createEl("button", { - cls: ["mod-cta", "obsidian-git-center-button"], - text: "Save" - }).addEventListener("click", async () => { - this.resolve(text2.value); - this.close(); - }); - } - onClose() { - const { contentEl } = this; - this.resolve(void 0); - contentEl.empty(); - } -}; - -// src/ui/sourceControl/sourceControl.ts -init_polyfill_buffer(); -var import_obsidian29 = require("obsidian"); - -// src/ui/sourceControl/sourceControl.svelte -init_polyfill_buffer(); -var import_obsidian28 = require("obsidian"); - -// src/ui/modals/discardModal.ts -init_polyfill_buffer(); -var import_obsidian23 = require("obsidian"); -var DiscardModal = class extends import_obsidian23.Modal { - constructor(app2, deletion, filename) { - super(app2); - this.deletion = deletion; - this.filename = filename; - this.resolve = null; - } - myOpen() { - this.open(); - return new Promise((resolve) => { - this.resolve = resolve; - }); - } - onOpen() { - const { contentEl, titleEl } = this; - titleEl.setText(`${this.deletion ? "Delete" : "Discard"} this file?`); - contentEl.createEl("p").setText( - `Do you really want to ${this.deletion ? "delete" : "discard the changes of"} "${this.filename}"` - ); - const div = contentEl.createDiv({ cls: "modal-button-container" }); - const discard = div.createEl("button", { - cls: "mod-warning", - text: this.deletion ? "Delete" : "Discard" - }); - discard.addEventListener("click", async () => { - if (this.resolve) - this.resolve(true); - this.close(); - }); - discard.addEventListener("keypress", async () => { - if (this.resolve) - this.resolve(true); - this.close(); - }); - const close = div.createEl("button", { - text: "Cancel" - }); - close.addEventListener("click", () => { - if (this.resolve) - this.resolve(false); - return this.close(); - }); - close.addEventListener("keypress", () => { - if (this.resolve) - this.resolve(false); - return this.close(); - }); - } - onClose() { - const { contentEl } = this; - contentEl.empty(); - } -}; - -// src/ui/sourceControl/components/fileComponent.svelte -init_polyfill_buffer(); -var import_obsidian25 = require("obsidian"); - -// node_modules/.pnpm/github.com+Vinzent03+obsidian-community-lib@e663de4f95c879b40613090da78ea599ff621d24_@codemir_kbfcpig3uak7df3ohthcqq53p4/node_modules/obsidian-community-lib/dist/index.js -init_polyfill_buffer(); - -// node_modules/.pnpm/github.com+Vinzent03+obsidian-community-lib@e663de4f95c879b40613090da78ea599ff621d24_@codemir_kbfcpig3uak7df3ohthcqq53p4/node_modules/obsidian-community-lib/dist/utils.js -init_polyfill_buffer(); -var feather = __toESM(require_feather()); -var import_obsidian24 = require("obsidian"); -function hoverPreview(event, view, to) { - const targetEl = event.target; - app.workspace.trigger("hover-link", { - event, - source: view.getViewType(), - hoverParent: view, - targetEl, - linktext: to - }); -} - -// src/ui/sourceControl/components/fileComponent.svelte -function add_css4(target) { - append_styles(target, "svelte-1wbh8tp", "main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}"); -} -function create_if_block5(ctx) { - let div; - let mounted; - let dispose; - return { - c() { - div = element("div"); - attr(div, "data-icon", "go-to-file"); - attr(div, "aria-label", "Open File"); - attr(div, "class", "clickable-icon"); - }, - m(target, anchor) { - insert(target, div, anchor); - ctx[11](div); - if (!mounted) { - dispose = [ - listen(div, "auxclick", stop_propagation( - /*open*/ - ctx[5] - )), - listen(div, "click", stop_propagation( - /*open*/ - ctx[5] - )) - ]; - mounted = true; - } - }, - p: noop, - d(detaching) { - if (detaching) { - detach(div); - } - ctx[11](null); - mounted = false; - run_all(dispose); - } - }; -} -function create_fragment5(ctx) { - let main; - let div6; - let div0; - let t0_value = getDisplayPath( - /*change*/ - ctx[0].vault_path - ) + ""; - let t0; - let t1; - let div5; - let div3; - let show_if = ( - /*view*/ - ctx[1].app.vault.getAbstractFileByPath( - /*change*/ - ctx[0].vault_path - ) - ); - let t2; - let div1; - let t3; - let div2; - let t4; - let div4; - let t5_value = ( - /*change*/ - ctx[0].working_dir + "" - ); - let t5; - let div4_data_type_value; - let div6_data_path_value; - let div6_aria_label_value; - let mounted; - let dispose; - let if_block = show_if && create_if_block5(ctx); - return { - c() { - var _a2, _b, _c; - main = element("main"); - div6 = element("div"); - div0 = element("div"); - t0 = text(t0_value); - t1 = space(); - div5 = element("div"); - div3 = element("div"); - if (if_block) - if_block.c(); - t2 = space(); - div1 = element("div"); - t3 = space(); - div2 = element("div"); - t4 = space(); - div4 = element("div"); - t5 = text(t5_value); - attr(div0, "class", "tree-item-inner nav-file-title-content"); - attr(div1, "data-icon", "undo"); - attr(div1, "aria-label", "Discard"); - attr(div1, "class", "clickable-icon"); - attr(div2, "data-icon", "plus"); - attr(div2, "aria-label", "Stage"); - attr(div2, "class", "clickable-icon"); - attr(div3, "class", "buttons"); - attr(div4, "class", "type"); - attr(div4, "data-type", div4_data_type_value = /*change*/ - ctx[0].working_dir); - attr(div5, "class", "git-tools"); - attr(div6, "class", "tree-item-self is-clickable nav-file-title svelte-1wbh8tp"); - attr(div6, "data-path", div6_data_path_value = /*change*/ - ctx[0].vault_path); - attr( - div6, - "aria-label-position", - /*side*/ - ctx[3] - ); - attr( - div6, - "data-tooltip-position", - /*side*/ - ctx[3] - ); - attr(div6, "aria-label", div6_aria_label_value = /*change*/ - ctx[0].vault_path); - toggle_class( - div6, - "is-active", - /*view*/ - ((_a2 = ctx[1].plugin.lastDiffViewState) == null ? void 0 : _a2.file) == /*change*/ - ctx[0].vault_path && !/*view*/ - ((_b = ctx[1].plugin.lastDiffViewState) == null ? void 0 : _b.hash) && !/*view*/ - ((_c = ctx[1].plugin.lastDiffViewState) == null ? void 0 : _c.staged) - ); - attr(main, "class", "tree-item nav-file svelte-1wbh8tp"); - }, - m(target, anchor) { - insert(target, main, anchor); - append2(main, div6); - append2(div6, div0); - append2(div0, t0); - append2(div6, t1); - append2(div6, div5); - append2(div5, div3); - if (if_block) - if_block.m(div3, null); - append2(div3, t2); - append2(div3, div1); - ctx[12](div1); - append2(div3, t3); - append2(div3, div2); - ctx[13](div2); - append2(div5, t4); - append2(div5, div4); - append2(div4, t5); - if (!mounted) { - dispose = [ - listen(div1, "click", stop_propagation( - /*discard*/ - ctx[8] - )), - listen(div2, "click", stop_propagation( - /*stage*/ - ctx[6] - )), - listen( - main, - "mouseover", - /*hover*/ - ctx[4] - ), - listen(main, "click", stop_propagation( - /*showDiff*/ - ctx[7] - )), - listen(main, "auxclick", stop_propagation( - /*showDiff*/ - ctx[7] - )), - listen( - main, - "focus", - /*focus_handler*/ - ctx[10] - ) - ]; - mounted = true; - } - }, - p(ctx2, [dirty]) { - var _a2, _b, _c; - if (dirty & /*change*/ - 1 && t0_value !== (t0_value = getDisplayPath( - /*change*/ - ctx2[0].vault_path - ) + "")) - set_data(t0, t0_value); - if (dirty & /*view, change*/ - 3) - show_if = /*view*/ - ctx2[1].app.vault.getAbstractFileByPath( - /*change*/ - ctx2[0].vault_path - ); - if (show_if) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block5(ctx2); - if_block.c(); - if_block.m(div3, t2); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & /*change*/ - 1 && t5_value !== (t5_value = /*change*/ - ctx2[0].working_dir + "")) - set_data(t5, t5_value); - if (dirty & /*change*/ - 1 && div4_data_type_value !== (div4_data_type_value = /*change*/ - ctx2[0].working_dir)) { - attr(div4, "data-type", div4_data_type_value); - } - if (dirty & /*change*/ - 1 && div6_data_path_value !== (div6_data_path_value = /*change*/ - ctx2[0].vault_path)) { - attr(div6, "data-path", div6_data_path_value); - } - if (dirty & /*side*/ - 8) { - attr( - div6, - "aria-label-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*side*/ - 8) { - attr( - div6, - "data-tooltip-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*change*/ - 1 && div6_aria_label_value !== (div6_aria_label_value = /*change*/ - ctx2[0].vault_path)) { - attr(div6, "aria-label", div6_aria_label_value); - } - if (dirty & /*view, change*/ - 3) { - toggle_class( - div6, - "is-active", - /*view*/ - ((_a2 = ctx2[1].plugin.lastDiffViewState) == null ? void 0 : _a2.file) == /*change*/ - ctx2[0].vault_path && !/*view*/ - ((_b = ctx2[1].plugin.lastDiffViewState) == null ? void 0 : _b.hash) && !/*view*/ - ((_c = ctx2[1].plugin.lastDiffViewState) == null ? void 0 : _c.staged) - ); - } - }, - i: noop, - o: noop, - d(detaching) { - if (detaching) { - detach(main); - } - if (if_block) - if_block.d(); - ctx[12](null); - ctx[13](null); - mounted = false; - run_all(dispose); - } - }; -} -function instance5($$self, $$props, $$invalidate) { - let side; - let { change } = $$props; - let { view } = $$props; - let { manager } = $$props; - let buttons = []; - window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian25.setIcon)(b, b.getAttr("data-icon"))), 0); - function hover(event) { - if (app.vault.getAbstractFileByPath(change.vault_path)) { - hoverPreview(event, view, change.vault_path); - } - } - function open(event) { - var _a2; - const file = view.app.vault.getAbstractFileByPath(change.vault_path); - console.log(event); - if (file instanceof import_obsidian25.TFile) { - (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); - } - } - function stage() { - manager.stage(change.path, false).finally(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - function showDiff(event) { - var _a2; - (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.setViewState({ - type: DIFF_VIEW_CONFIG.type, - active: true, - state: { file: change.path, staged: false } - }); - } - function discard() { - const deleteFile = change.working_dir == "U"; - new DiscardModal(view.app, deleteFile, change.vault_path).myOpen().then((shouldDiscard) => { - if (shouldDiscard === true) { - if (deleteFile) { - view.app.vault.adapter.remove(change.vault_path).finally(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } else { - manager.discard(change.path).finally(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - } - }); - } - function focus_handler(event) { - bubble.call(this, $$self, event); - } - function div_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[1] = $$value; - $$invalidate(2, buttons); - }); - } - function div1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[0] = $$value; - $$invalidate(2, buttons); - }); - } - function div2_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[2] = $$value; - $$invalidate(2, buttons); - }); - } - $$self.$$set = ($$props2) => { - if ("change" in $$props2) - $$invalidate(0, change = $$props2.change); - if ("view" in $$props2) - $$invalidate(1, view = $$props2.view); - if ("manager" in $$props2) - $$invalidate(9, manager = $$props2.manager); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*view*/ - 2) { - $: - $$invalidate(3, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [ - change, - view, - buttons, - side, - hover, - open, - stage, - showDiff, - discard, - manager, - focus_handler, - div_binding, - div1_binding, - div2_binding - ]; -} -var FileComponent = class extends SvelteComponent { - constructor(options) { - super(); - init2(this, options, instance5, create_fragment5, safe_not_equal, { change: 0, view: 1, manager: 9 }, add_css4); - } -}; -var fileComponent_default = FileComponent; - -// src/ui/sourceControl/components/pulledFileComponent.svelte -init_polyfill_buffer(); -var import_obsidian26 = require("obsidian"); -function add_css5(target) { - append_styles(target, "svelte-1wbh8tp", "main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}"); -} -function create_fragment6(ctx) { - let main; - let div2; - let div0; - let t0_value = getDisplayPath( - /*change*/ - ctx[0].vault_path - ) + ""; - let t0; - let t1; - let div1; - let span; - let t2_value = ( - /*change*/ - ctx[0].working_dir + "" - ); - let t2; - let span_data_type_value; - let div2_data_path_value; - let div2_aria_label_value; - let mounted; - let dispose; - return { - c() { - main = element("main"); - div2 = element("div"); - div0 = element("div"); - t0 = text(t0_value); - t1 = space(); - div1 = element("div"); - span = element("span"); - t2 = text(t2_value); - attr(div0, "class", "tree-item-inner nav-file-title-content"); - attr(span, "class", "type"); - attr(span, "data-type", span_data_type_value = /*change*/ - ctx[0].working_dir); - attr(div1, "class", "git-tools"); - attr(div2, "class", "tree-item-self is-clickable nav-file-title svelte-1wbh8tp"); - attr(div2, "data-path", div2_data_path_value = /*change*/ - ctx[0].vault_path); - attr( - div2, - "aria-label-position", - /*side*/ - ctx[1] - ); - attr( - div2, - "data-tooltip-position", - /*side*/ - ctx[1] - ); - attr(div2, "aria-label", div2_aria_label_value = /*change*/ - ctx[0].vault_path); - attr(main, "class", "tree-item nav-file svelte-1wbh8tp"); - }, - m(target, anchor) { - insert(target, main, anchor); - append2(main, div2); - append2(div2, div0); - append2(div0, t0); - append2(div2, t1); - append2(div2, div1); - append2(div1, span); - append2(span, t2); - if (!mounted) { - dispose = [ - listen( - main, - "mouseover", - /*hover*/ - ctx[2] - ), - listen(main, "click", stop_propagation( - /*open*/ - ctx[3] - )), - listen(main, "auxclick", stop_propagation( - /*open*/ - ctx[3] - )), - listen( - main, - "focus", - /*focus_handler*/ - ctx[5] - ) - ]; - mounted = true; - } - }, - p(ctx2, [dirty]) { - if (dirty & /*change*/ - 1 && t0_value !== (t0_value = getDisplayPath( - /*change*/ - ctx2[0].vault_path - ) + "")) - set_data(t0, t0_value); - if (dirty & /*change*/ - 1 && t2_value !== (t2_value = /*change*/ - ctx2[0].working_dir + "")) - set_data(t2, t2_value); - if (dirty & /*change*/ - 1 && span_data_type_value !== (span_data_type_value = /*change*/ - ctx2[0].working_dir)) { - attr(span, "data-type", span_data_type_value); - } - if (dirty & /*change*/ - 1 && div2_data_path_value !== (div2_data_path_value = /*change*/ - ctx2[0].vault_path)) { - attr(div2, "data-path", div2_data_path_value); - } - if (dirty & /*side*/ - 2) { - attr( - div2, - "aria-label-position", - /*side*/ - ctx2[1] - ); - } - if (dirty & /*side*/ - 2) { - attr( - div2, - "data-tooltip-position", - /*side*/ - ctx2[1] - ); - } - if (dirty & /*change*/ - 1 && div2_aria_label_value !== (div2_aria_label_value = /*change*/ - ctx2[0].vault_path)) { - attr(div2, "aria-label", div2_aria_label_value); - } - }, - i: noop, - o: noop, - d(detaching) { - if (detaching) { - detach(main); - } - mounted = false; - run_all(dispose); - } - }; -} -function instance6($$self, $$props, $$invalidate) { - let side; - let { change } = $$props; - let { view } = $$props; - function hover(event) { - if (app.vault.getAbstractFileByPath(change.vault_path)) { - hoverPreview(event, view, change.vault_path); - } - } - function open(event) { - var _a2; - const file = view.app.vault.getAbstractFileByPath(change.vault_path); - if (file instanceof import_obsidian26.TFile) { - (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); - } - } - function focus_handler(event) { - bubble.call(this, $$self, event); - } - $$self.$$set = ($$props2) => { - if ("change" in $$props2) - $$invalidate(0, change = $$props2.change); - if ("view" in $$props2) - $$invalidate(4, view = $$props2.view); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*view*/ - 16) { - $: - $$invalidate(1, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [change, side, hover, open, view, focus_handler]; -} -var PulledFileComponent = class extends SvelteComponent { - constructor(options) { - super(); - init2(this, options, instance6, create_fragment6, safe_not_equal, { change: 0, view: 4 }, add_css5); - } -}; -var pulledFileComponent_default = PulledFileComponent; - -// src/ui/sourceControl/components/stagedFileComponent.svelte -init_polyfill_buffer(); -var import_obsidian27 = require("obsidian"); -function add_css6(target) { - append_styles(target, "svelte-1wbh8tp", "main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}"); -} -function create_if_block6(ctx) { - let div; - let mounted; - let dispose; - return { - c() { - div = element("div"); - attr(div, "data-icon", "go-to-file"); - attr(div, "aria-label", "Open File"); - attr(div, "class", "clickable-icon"); - }, - m(target, anchor) { - insert(target, div, anchor); - ctx[10](div); - if (!mounted) { - dispose = listen(div, "click", stop_propagation( - /*open*/ - ctx[5] - )); - mounted = true; - } - }, - p: noop, - d(detaching) { - if (detaching) { - detach(div); - } - ctx[10](null); - mounted = false; - dispose(); - } - }; -} -function create_fragment7(ctx) { - let main; - let div5; - let div0; - let t0_value = getDisplayPath( - /*change*/ - ctx[0].vault_path - ) + ""; - let t0; - let t1; - let div4; - let div2; - let show_if = ( - /*view*/ - ctx[1].app.vault.getAbstractFileByPath( - /*change*/ - ctx[0].vault_path - ) - ); - let t2; - let div1; - let t3; - let div3; - let t4_value = ( - /*change*/ - ctx[0].index + "" - ); - let t4; - let div3_data_type_value; - let div5_data_path_value; - let div5_aria_label_value; - let mounted; - let dispose; - let if_block = show_if && create_if_block6(ctx); - return { - c() { - var _a2, _b, _c; - main = element("main"); - div5 = element("div"); - div0 = element("div"); - t0 = text(t0_value); - t1 = space(); - div4 = element("div"); - div2 = element("div"); - if (if_block) - if_block.c(); - t2 = space(); - div1 = element("div"); - t3 = space(); - div3 = element("div"); - t4 = text(t4_value); - attr(div0, "class", "tree-item-inner nav-file-title-content"); - attr(div1, "data-icon", "minus"); - attr(div1, "aria-label", "Unstage"); - attr(div1, "class", "clickable-icon"); - attr(div2, "class", "buttons"); - attr(div3, "class", "type"); - attr(div3, "data-type", div3_data_type_value = /*change*/ - ctx[0].index); - attr(div4, "class", "git-tools"); - attr(div5, "class", "tree-item-self is-clickable nav-file-title svelte-1wbh8tp"); - attr(div5, "data-path", div5_data_path_value = /*change*/ - ctx[0].vault_path); - attr( - div5, - "aria-label-position", - /*side*/ - ctx[3] - ); - attr( - div5, - "data-tooltip-position", - /*side*/ - ctx[3] - ); - attr(div5, "aria-label", div5_aria_label_value = /*change*/ - ctx[0].vault_path); - toggle_class( - div5, - "is-active", - /*view*/ - ((_a2 = ctx[1].plugin.lastDiffViewState) == null ? void 0 : _a2.file) == /*change*/ - ctx[0].vault_path && !/*view*/ - ((_b = ctx[1].plugin.lastDiffViewState) == null ? void 0 : _b.hash) && /*view*/ - ((_c = ctx[1].plugin.lastDiffViewState) == null ? void 0 : _c.staged) - ); - attr(main, "class", "tree-item nav-file svelte-1wbh8tp"); - }, - m(target, anchor) { - insert(target, main, anchor); - append2(main, div5); - append2(div5, div0); - append2(div0, t0); - append2(div5, t1); - append2(div5, div4); - append2(div4, div2); - if (if_block) - if_block.m(div2, null); - append2(div2, t2); - append2(div2, div1); - ctx[11](div1); - append2(div4, t3); - append2(div4, div3); - append2(div3, t4); - if (!mounted) { - dispose = [ - listen(div1, "click", stop_propagation( - /*unstage*/ - ctx[7] - )), - listen( - main, - "mouseover", - /*hover*/ - ctx[4] - ), - listen( - main, - "focus", - /*focus_handler*/ - ctx[9] - ), - listen(main, "click", stop_propagation( - /*showDiff*/ - ctx[6] - )), - listen(main, "auxclick", stop_propagation( - /*showDiff*/ - ctx[6] - )) - ]; - mounted = true; - } - }, - p(ctx2, [dirty]) { - var _a2, _b, _c; - if (dirty & /*change*/ - 1 && t0_value !== (t0_value = getDisplayPath( - /*change*/ - ctx2[0].vault_path - ) + "")) - set_data(t0, t0_value); - if (dirty & /*view, change*/ - 3) - show_if = /*view*/ - ctx2[1].app.vault.getAbstractFileByPath( - /*change*/ - ctx2[0].vault_path - ); - if (show_if) { - if (if_block) { - if_block.p(ctx2, dirty); - } else { - if_block = create_if_block6(ctx2); - if_block.c(); - if_block.m(div2, t2); - } - } else if (if_block) { - if_block.d(1); - if_block = null; - } - if (dirty & /*change*/ - 1 && t4_value !== (t4_value = /*change*/ - ctx2[0].index + "")) - set_data(t4, t4_value); - if (dirty & /*change*/ - 1 && div3_data_type_value !== (div3_data_type_value = /*change*/ - ctx2[0].index)) { - attr(div3, "data-type", div3_data_type_value); - } - if (dirty & /*change*/ - 1 && div5_data_path_value !== (div5_data_path_value = /*change*/ - ctx2[0].vault_path)) { - attr(div5, "data-path", div5_data_path_value); - } - if (dirty & /*side*/ - 8) { - attr( - div5, - "aria-label-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*side*/ - 8) { - attr( - div5, - "data-tooltip-position", - /*side*/ - ctx2[3] - ); - } - if (dirty & /*change*/ - 1 && div5_aria_label_value !== (div5_aria_label_value = /*change*/ - ctx2[0].vault_path)) { - attr(div5, "aria-label", div5_aria_label_value); - } - if (dirty & /*view, change*/ - 3) { - toggle_class( - div5, - "is-active", - /*view*/ - ((_a2 = ctx2[1].plugin.lastDiffViewState) == null ? void 0 : _a2.file) == /*change*/ - ctx2[0].vault_path && !/*view*/ - ((_b = ctx2[1].plugin.lastDiffViewState) == null ? void 0 : _b.hash) && /*view*/ - ((_c = ctx2[1].plugin.lastDiffViewState) == null ? void 0 : _c.staged) - ); - } - }, - i: noop, - o: noop, - d(detaching) { - if (detaching) { - detach(main); - } - if (if_block) - if_block.d(); - ctx[11](null); - mounted = false; - run_all(dispose); - } - }; -} -function instance7($$self, $$props, $$invalidate) { - let side; - let { change } = $$props; - let { view } = $$props; - let { manager } = $$props; - let buttons = []; - window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian27.setIcon)(b, b.getAttr("data-icon"), 16)), 0); - function hover(event) { - if (app.vault.getAbstractFileByPath(change.vault_path)) { - hoverPreview(event, view, change.vault_path); - } - } - function open(event) { - var _a2; - const file = view.app.vault.getAbstractFileByPath(change.vault_path); - if (file instanceof import_obsidian27.TFile) { - (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); - } - } - function showDiff(event) { - var _a2; - (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.setViewState({ - type: DIFF_VIEW_CONFIG.type, - active: true, - state: { file: change.path, staged: true } - }); - } - function unstage() { - manager.unstage(change.path, false).finally(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - function focus_handler(event) { - bubble.call(this, $$self, event); - } - function div_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[1] = $$value; - $$invalidate(2, buttons); - }); - } - function div1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[0] = $$value; - $$invalidate(2, buttons); - }); - } - $$self.$$set = ($$props2) => { - if ("change" in $$props2) - $$invalidate(0, change = $$props2.change); - if ("view" in $$props2) - $$invalidate(1, view = $$props2.view); - if ("manager" in $$props2) - $$invalidate(8, manager = $$props2.manager); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*view*/ - 2) { - $: - $$invalidate(3, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [ - change, - view, - buttons, - side, - hover, - open, - showDiff, - unstage, - manager, - focus_handler, - div_binding, - div1_binding - ]; -} -var StagedFileComponent = class extends SvelteComponent { - constructor(options) { - super(); - init2(this, options, instance7, create_fragment7, safe_not_equal, { change: 0, view: 1, manager: 8 }, add_css6); - } -}; -var stagedFileComponent_default = StagedFileComponent; - -// src/ui/sourceControl/components/treeComponent.svelte -init_polyfill_buffer(); -function add_css7(target) { - append_styles(target, "svelte-hup5mn", "main.svelte-hup5mn .nav-folder-title.svelte-hup5mn{align-items:center}"); -} -function get_each_context4(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[15] = list[i]; - return child_ctx; -} -function create_else_block3(ctx) { - let div7; - let div6; - let div0; - let t0; - let div1; - let t1; - let div2; - let t2_value = ( - /*entity*/ - ctx[15].title + "" - ); - let t2; - let t3; - let div5; - let div4; - let t4; - let div3; - let div6_aria_label_value; - let t5; - let t6; - let current; - let mounted; - let dispose; - function select_block_type_2(ctx2, dirty) { - if ( - /*fileType*/ - ctx2[3] == 0 /* staged */ - ) - return create_if_block_5; - return create_else_block_1; - } - let current_block_type = select_block_type_2(ctx, -1); - let if_block0 = current_block_type(ctx); - let if_block1 = !/*closed*/ - ctx[5][ - /*entity*/ - ctx[15].title - ] && create_if_block_4(ctx); - function click_handler_3() { - return ( - /*click_handler_3*/ - ctx[14]( - /*entity*/ - ctx[15] - ) - ); - } - return { - c() { - div7 = element("div"); - div6 = element("div"); - div0 = element("div"); - t0 = space(); - div1 = element("div"); - div1.innerHTML = ``; - t1 = space(); - div2 = element("div"); - t2 = text(t2_value); - t3 = space(); - div5 = element("div"); - div4 = element("div"); - if_block0.c(); - t4 = space(); - div3 = element("div"); - t5 = space(); - if (if_block1) - if_block1.c(); - t6 = space(); - attr(div0, "data-icon", "folder"); - set_style(div0, "padding-right", "5px"); - set_style(div0, "display", "flex"); - attr(div1, "class", "tree-item-icon nav-folder-collapse-indicator collapse-icon"); - toggle_class( - div1, - "is-collapsed", - /*closed*/ - ctx[5][ - /*entity*/ - ctx[15].title - ] - ); - attr(div2, "class", "tree-item-inner nav-folder-title-content"); - set_style(div3, "width", "11px"); - attr(div4, "class", "buttons"); - attr(div5, "class", "git-tools"); - attr(div6, "class", "tree-item-self is-clickable nav-folder-title svelte-hup5mn"); - attr( - div6, - "aria-label-position", - /*side*/ - ctx[6] - ); - attr( - div6, - "data-tooltip-position", - /*side*/ - ctx[6] - ); - attr(div6, "aria-label", div6_aria_label_value = /*entity*/ - ctx[15].vaultPath); - attr(div7, "class", "tree-item nav-folder"); - toggle_class( - div7, - "is-collapsed", - /*closed*/ - ctx[5][ - /*entity*/ - ctx[15].title - ] - ); - }, - m(target, anchor) { - insert(target, div7, anchor); - append2(div7, div6); - append2(div6, div0); - append2(div6, t0); - append2(div6, div1); - append2(div6, t1); - append2(div6, div2); - append2(div2, t2); - append2(div6, t3); - append2(div6, div5); - append2(div5, div4); - if_block0.m(div4, null); - append2(div4, t4); - append2(div4, div3); - append2(div7, t5); - if (if_block1) - if_block1.m(div7, null); - append2(div7, t6); - current = true; - if (!mounted) { - dispose = listen(div7, "click", click_handler_3); - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - if (!current || dirty & /*closed, hierarchy*/ - 33) { - toggle_class( - div1, - "is-collapsed", - /*closed*/ - ctx[5][ - /*entity*/ - ctx[15].title - ] - ); - } - if ((!current || dirty & /*hierarchy*/ - 1) && t2_value !== (t2_value = /*entity*/ - ctx[15].title + "")) - set_data(t2, t2_value); - if (current_block_type === (current_block_type = select_block_type_2(ctx, dirty)) && if_block0) { - if_block0.p(ctx, dirty); - } else { - if_block0.d(1); - if_block0 = current_block_type(ctx); - if (if_block0) { - if_block0.c(); - if_block0.m(div4, t4); - } - } - if (!current || dirty & /*side*/ - 64) { - attr( - div6, - "aria-label-position", - /*side*/ - ctx[6] - ); - } - if (!current || dirty & /*side*/ - 64) { - attr( - div6, - "data-tooltip-position", - /*side*/ - ctx[6] - ); - } - if (!current || dirty & /*hierarchy*/ - 1 && div6_aria_label_value !== (div6_aria_label_value = /*entity*/ - ctx[15].vaultPath)) { - attr(div6, "aria-label", div6_aria_label_value); - } - if (!/*closed*/ - ctx[5][ - /*entity*/ - ctx[15].title - ]) { - if (if_block1) { - if_block1.p(ctx, dirty); - if (dirty & /*closed, hierarchy*/ - 33) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block_4(ctx); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(div7, t6); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - if (!current || dirty & /*closed, hierarchy*/ - 33) { - toggle_class( - div7, - "is-collapsed", - /*closed*/ - ctx[5][ - /*entity*/ - ctx[15].title - ] - ); - } - }, - i(local) { - if (current) - return; - transition_in(if_block1); - current = true; - }, - o(local) { - transition_out(if_block1); - current = false; - }, - d(detaching) { - if (detaching) { - detach(div7); - } - if_block0.d(); - if (if_block1) - if_block1.d(); - mounted = false; - dispose(); - } - }; -} -function create_if_block7(ctx) { - let div; - let current_block_type_index; - let if_block; - let t; - let current; - const if_block_creators = [create_if_block_13, create_if_block_22, create_if_block_3]; - const if_blocks = []; - function select_block_type_1(ctx2, dirty) { - if ( - /*fileType*/ - ctx2[3] == 0 /* staged */ - ) - return 0; - if ( - /*fileType*/ - ctx2[3] == 1 /* changed */ - ) - return 1; - if ( - /*fileType*/ - ctx2[3] == 2 /* pulled */ - ) - return 2; - return -1; - } - if (~(current_block_type_index = select_block_type_1(ctx, -1))) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - } - return { - c() { - div = element("div"); - if (if_block) - if_block.c(); - t = space(); - }, - m(target, anchor) { - insert(target, div, anchor); - if (~current_block_type_index) { - if_blocks[current_block_type_index].m(div, null); - } - append2(div, t); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type_1(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if (~current_block_type_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } - } else { - if (if_block) { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - } - if (~current_block_type_index) { - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div, t); - } else { - if_block = null; - } - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) { - detach(div); - } - if (~current_block_type_index) { - if_blocks[current_block_type_index].d(); - } - } - }; -} -function create_else_block_1(ctx) { - let div0; - let t; - let div1; - let mounted; - let dispose; - function click_handler_1() { - return ( - /*click_handler_1*/ - ctx[12]( - /*entity*/ - ctx[15] - ) - ); - } - function click_handler_2() { - return ( - /*click_handler_2*/ - ctx[13]( - /*entity*/ - ctx[15] - ) - ); - } - return { - c() { - div0 = element("div"); - div0.innerHTML = ``; - t = space(); - div1 = element("div"); - div1.innerHTML = ``; - attr(div0, "data-icon", "undo"); - attr(div0, "aria-label", "Discard"); - attr(div0, "class", "clickable-icon"); - attr(div1, "data-icon", "plus"); - attr(div1, "aria-label", "Stage"); - attr(div1, "class", "clickable-icon"); - }, - m(target, anchor) { - insert(target, div0, anchor); - insert(target, t, anchor); - insert(target, div1, anchor); - if (!mounted) { - dispose = [ - listen(div0, "click", stop_propagation(click_handler_1)), - listen(div1, "click", stop_propagation(click_handler_2)) - ]; - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - }, - d(detaching) { - if (detaching) { - detach(div0); - detach(t); - detach(div1); - } - mounted = false; - run_all(dispose); - } - }; -} -function create_if_block_5(ctx) { - let div; - let mounted; - let dispose; - function click_handler() { - return ( - /*click_handler*/ - ctx[11]( - /*entity*/ - ctx[15] - ) - ); - } - return { - c() { - div = element("div"); - div.innerHTML = ``; - attr(div, "data-icon", "minus"); - attr(div, "aria-label", "Unstage"); - attr(div, "class", "clickable-icon"); - }, - m(target, anchor) { - insert(target, div, anchor); - if (!mounted) { - dispose = listen(div, "click", stop_propagation(click_handler)); - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - }, - d(detaching) { - if (detaching) { - detach(div); - } - mounted = false; - dispose(); - } - }; -} -function create_if_block_4(ctx) { - let div; - let treecomponent; - let div_transition; - let current; - treecomponent = new TreeComponent({ - props: { - hierarchy: ( - /*entity*/ - ctx[15] - ), - plugin: ( - /*plugin*/ - ctx[1] - ), - view: ( - /*view*/ - ctx[2] - ), - fileType: ( - /*fileType*/ - ctx[3] - ) - } - }); - return { - c() { - div = element("div"); - create_component(treecomponent.$$.fragment); - attr(div, "class", "tree-item-children nav-folder-children"); - }, - m(target, anchor) { - insert(target, div, anchor); - mount_component(treecomponent, div, null); - current = true; - }, - p(ctx2, dirty) { - const treecomponent_changes = {}; - if (dirty & /*hierarchy*/ - 1) - treecomponent_changes.hierarchy = /*entity*/ - ctx2[15]; - if (dirty & /*plugin*/ - 2) - treecomponent_changes.plugin = /*plugin*/ - ctx2[1]; - if (dirty & /*view*/ - 4) - treecomponent_changes.view = /*view*/ - ctx2[2]; - if (dirty & /*fileType*/ - 8) - treecomponent_changes.fileType = /*fileType*/ - ctx2[3]; - treecomponent.$set(treecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(treecomponent.$$.fragment, local); - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(treecomponent.$$.fragment, local); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(div); - } - destroy_component(treecomponent); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_if_block_3(ctx) { - let pulledfilecomponent; - let current; - pulledfilecomponent = new pulledFileComponent_default({ - props: { - change: ( - /*entity*/ - ctx[15].data - ), - view: ( - /*view*/ - ctx[2] - ) - } - }); - return { - c() { - create_component(pulledfilecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(pulledfilecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const pulledfilecomponent_changes = {}; - if (dirty & /*hierarchy*/ - 1) - pulledfilecomponent_changes.change = /*entity*/ - ctx2[15].data; - if (dirty & /*view*/ - 4) - pulledfilecomponent_changes.view = /*view*/ - ctx2[2]; - pulledfilecomponent.$set(pulledfilecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(pulledfilecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(pulledfilecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(pulledfilecomponent, detaching); - } - }; -} -function create_if_block_22(ctx) { - let filecomponent; - let current; - filecomponent = new fileComponent_default({ - props: { - change: ( - /*entity*/ - ctx[15].data - ), - manager: ( - /*plugin*/ - ctx[1].gitManager - ), - view: ( - /*view*/ - ctx[2] - ) - } - }); - return { - c() { - create_component(filecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(filecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const filecomponent_changes = {}; - if (dirty & /*hierarchy*/ - 1) - filecomponent_changes.change = /*entity*/ - ctx2[15].data; - if (dirty & /*plugin*/ - 2) - filecomponent_changes.manager = /*plugin*/ - ctx2[1].gitManager; - if (dirty & /*view*/ - 4) - filecomponent_changes.view = /*view*/ - ctx2[2]; - filecomponent.$set(filecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(filecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(filecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(filecomponent, detaching); - } - }; -} -function create_if_block_13(ctx) { - let stagedfilecomponent; - let current; - stagedfilecomponent = new stagedFileComponent_default({ - props: { - change: ( - /*entity*/ - ctx[15].data - ), - manager: ( - /*plugin*/ - ctx[1].gitManager - ), - view: ( - /*view*/ - ctx[2] - ) - } - }); - return { - c() { - create_component(stagedfilecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(stagedfilecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const stagedfilecomponent_changes = {}; - if (dirty & /*hierarchy*/ - 1) - stagedfilecomponent_changes.change = /*entity*/ - ctx2[15].data; - if (dirty & /*plugin*/ - 2) - stagedfilecomponent_changes.manager = /*plugin*/ - ctx2[1].gitManager; - if (dirty & /*view*/ - 4) - stagedfilecomponent_changes.view = /*view*/ - ctx2[2]; - stagedfilecomponent.$set(stagedfilecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(stagedfilecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(stagedfilecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(stagedfilecomponent, detaching); - } - }; -} -function create_each_block4(ctx) { - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [create_if_block7, create_else_block3]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if ( - /*entity*/ - ctx2[15].data - ) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - if_block.c(); - if_block_anchor = empty(); - }, - m(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert(target, if_block_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) { - detach(if_block_anchor); - } - if_blocks[current_block_type_index].d(detaching); - } - }; -} -function create_fragment8(ctx) { - let main; - let current; - let each_value = ensure_array_like( - /*hierarchy*/ - ctx[0].children - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block4(get_each_context4(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - main = element("main"); - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - attr(main, "class", "svelte-hup5mn"); - toggle_class( - main, - "topLevel", - /*topLevel*/ - ctx[4] - ); - }, - m(target, anchor) { - insert(target, main, anchor); - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(main, null); - } - } - current = true; - }, - p(ctx2, [dirty]) { - if (dirty & /*hierarchy, plugin, view, fileType, closed, fold, side, unstage, stage, discard*/ - 2031) { - each_value = ensure_array_like( - /*hierarchy*/ - ctx2[0].children - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context4(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block4(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(main, null); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - if (!current || dirty & /*topLevel*/ - 16) { - toggle_class( - main, - "topLevel", - /*topLevel*/ - ctx2[4] - ); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(main); - } - destroy_each(each_blocks, detaching); - } - }; -} -function instance8($$self, $$props, $$invalidate) { - let side; - let { hierarchy } = $$props; - let { plugin } = $$props; - let { view } = $$props; - let { fileType } = $$props; - let { topLevel = false } = $$props; - const closed = {}; - function stage(path2) { - plugin.gitManager.stageAll({ dir: path2 }).finally(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - function unstage(path2) { - plugin.gitManager.unstageAll({ dir: path2 }).finally(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - function discard(item) { - new DiscardModal(view.app, false, item.vaultPath).myOpen().then((shouldDiscard) => { - if (shouldDiscard === true) { - plugin.gitManager.discardAll({ - dir: item.path, - status: plugin.cachedStatus - }).finally(() => { - dispatchEvent(new CustomEvent("git-refresh")); - }); - } - }); - } - function fold(item) { - $$invalidate(5, closed[item.title] = !closed[item.title], closed); - } - const click_handler = (entity) => unstage(entity.path); - const click_handler_1 = (entity) => discard(entity); - const click_handler_2 = (entity) => stage(entity.path); - const click_handler_3 = (entity) => fold(entity); - $$self.$$set = ($$props2) => { - if ("hierarchy" in $$props2) - $$invalidate(0, hierarchy = $$props2.hierarchy); - if ("plugin" in $$props2) - $$invalidate(1, plugin = $$props2.plugin); - if ("view" in $$props2) - $$invalidate(2, view = $$props2.view); - if ("fileType" in $$props2) - $$invalidate(3, fileType = $$props2.fileType); - if ("topLevel" in $$props2) - $$invalidate(4, topLevel = $$props2.topLevel); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*view*/ - 4) { - $: - $$invalidate(6, side = view.leaf.getRoot().side == "left" ? "right" : "left"); - } - }; - return [ - hierarchy, - plugin, - view, - fileType, - topLevel, - closed, - side, - stage, - unstage, - discard, - fold, - click_handler, - click_handler_1, - click_handler_2, - click_handler_3 - ]; -} -var TreeComponent = class extends SvelteComponent { - constructor(options) { - super(); - init2( - this, - options, - instance8, - create_fragment8, - safe_not_equal, - { - hierarchy: 0, - plugin: 1, - view: 2, - fileType: 3, - topLevel: 4 - }, - add_css7 - ); - } -}; -var treeComponent_default = TreeComponent; - -// src/ui/sourceControl/sourceControl.svelte -function add_css8(target) { - append_styles(target, "svelte-1bvmxec", `.commit-msg-input.svelte-1bvmxec.svelte-1bvmxec{width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field)}.git-commit-msg.svelte-1bvmxec.svelte-1bvmxec{position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto}main.svelte-1bvmxec .git-tools .files-count.svelte-1bvmxec{padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center}.nav-folder-title.svelte-1bvmxec.svelte-1bvmxec{align-items:center}.git-commit-msg-clear-button.svelte-1bvmxec.svelte-1bvmxec{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-1bvmxec.svelte-1bvmxec:after{content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat}`); -} -function get_each_context5(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[40] = list[i]; - return child_ctx; -} -function get_each_context_1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[40] = list[i]; - return child_ctx; -} -function get_each_context_2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[45] = list[i]; - return child_ctx; -} -function create_if_block_8(ctx) { - let div; - let div_aria_label_value; - let mounted; - let dispose; - return { - c() { - div = element("div"); - attr(div, "class", "git-commit-msg-clear-button svelte-1bvmxec"); - attr(div, "aria-label", div_aria_label_value = "Clear"); - }, - m(target, anchor) { - insert(target, div, anchor); - if (!mounted) { - dispose = listen( - div, - "click", - /*click_handler_1*/ - ctx[33] - ); - mounted = true; - } - }, - p: noop, - d(detaching) { - if (detaching) { - detach(div); - } - mounted = false; - dispose(); - } - }; -} -function create_if_block8(ctx) { - let div18; - let div17; - let div7; - let div6; - let div0; - let t0; - let div1; - let t2; - let div5; - let div3; - let div2; - let t3; - let div4; - let t4_value = ( - /*status*/ - ctx[6].staged.length + "" - ); - let t4; - let t5; - let t6; - let div16; - let div15; - let div8; - let t7; - let div9; - let t9; - let div14; - let div12; - let div10; - let t10; - let div11; - let t11; - let div13; - let t12_value = ( - /*status*/ - ctx[6].changed.length + "" - ); - let t12; - let t13; - let t14; - let current; - let mounted; - let dispose; - let if_block0 = ( - /*stagedOpen*/ - ctx[13] && create_if_block_6(ctx) - ); - let if_block1 = ( - /*changesOpen*/ - ctx[12] && create_if_block_42(ctx) - ); - let if_block2 = ( - /*lastPulledFiles*/ - ctx[7].length > 0 && create_if_block_14(ctx) - ); - return { - c() { - div18 = element("div"); - div17 = element("div"); - div7 = element("div"); - div6 = element("div"); - div0 = element("div"); - div0.innerHTML = ``; - t0 = space(); - div1 = element("div"); - div1.textContent = "Staged Changes"; - t2 = space(); - div5 = element("div"); - div3 = element("div"); - div2 = element("div"); - div2.innerHTML = ``; - t3 = space(); - div4 = element("div"); - t4 = text(t4_value); - t5 = space(); - if (if_block0) - if_block0.c(); - t6 = space(); - div16 = element("div"); - div15 = element("div"); - div8 = element("div"); - div8.innerHTML = ``; - t7 = space(); - div9 = element("div"); - div9.textContent = "Changes"; - t9 = space(); - div14 = element("div"); - div12 = element("div"); - div10 = element("div"); - div10.innerHTML = ``; - t10 = space(); - div11 = element("div"); - div11.innerHTML = ``; - t11 = space(); - div13 = element("div"); - t12 = text(t12_value); - t13 = space(); - if (if_block1) - if_block1.c(); - t14 = space(); - if (if_block2) - if_block2.c(); - attr(div0, "class", "tree-item-icon nav-folder-collapse-indicator collapse-icon"); - toggle_class(div0, "is-collapsed", !/*stagedOpen*/ - ctx[13]); - attr(div1, "class", "tree-item-inner nav-folder-title-content"); - attr(div2, "data-icon", "minus"); - attr(div2, "aria-label", "Unstage"); - attr(div2, "class", "clickable-icon"); - attr(div3, "class", "buttons"); - attr(div4, "class", "files-count svelte-1bvmxec"); - attr(div5, "class", "git-tools"); - attr(div6, "class", "tree-item-self is-clickable nav-folder-title svelte-1bvmxec"); - attr(div7, "class", "staged tree-item nav-folder"); - toggle_class(div7, "is-collapsed", !/*stagedOpen*/ - ctx[13]); - attr(div8, "class", "tree-item-icon nav-folder-collapse-indicator collapse-icon"); - toggle_class(div8, "is-collapsed", !/*changesOpen*/ - ctx[12]); - attr(div9, "class", "tree-item-inner nav-folder-title-content"); - attr(div10, "data-icon", "undo"); - attr(div10, "aria-label", "Discard"); - attr(div10, "class", "clickable-icon"); - attr(div11, "data-icon", "plus"); - attr(div11, "aria-label", "Stage"); - attr(div11, "class", "clickable-icon"); - attr(div12, "class", "buttons"); - attr(div13, "class", "files-count svelte-1bvmxec"); - attr(div14, "class", "git-tools"); - attr(div15, "class", "tree-item-self is-clickable nav-folder-title svelte-1bvmxec"); - attr(div16, "class", "changes tree-item nav-folder"); - toggle_class(div16, "is-collapsed", !/*changesOpen*/ - ctx[12]); - attr(div17, "class", "tree-item-children nav-folder-children"); - attr(div18, "class", "tree-item nav-folder mod-root"); - }, - m(target, anchor) { - insert(target, div18, anchor); - append2(div18, div17); - append2(div17, div7); - append2(div7, div6); - append2(div6, div0); - append2(div6, t0); - append2(div6, div1); - append2(div6, t2); - append2(div6, div5); - append2(div5, div3); - append2(div3, div2); - ctx[34](div2); - append2(div5, t3); - append2(div5, div4); - append2(div4, t4); - append2(div7, t5); - if (if_block0) - if_block0.m(div7, null); - append2(div17, t6); - append2(div17, div16); - append2(div16, div15); - append2(div15, div8); - append2(div15, t7); - append2(div15, div9); - append2(div15, t9); - append2(div15, div14); - append2(div14, div12); - append2(div12, div10); - append2(div12, t10); - append2(div12, div11); - ctx[36](div11); - append2(div14, t11); - append2(div14, div13); - append2(div13, t12); - append2(div16, t13); - if (if_block1) - if_block1.m(div16, null); - append2(div17, t14); - if (if_block2) - if_block2.m(div17, null); - current = true; - if (!mounted) { - dispose = [ - listen(div2, "click", stop_propagation( - /*unstageAll*/ - ctx[19] - )), - listen( - div6, - "click", - /*click_handler_2*/ - ctx[35] - ), - listen(div10, "click", stop_propagation( - /*discard*/ - ctx[22] - )), - listen(div11, "click", stop_propagation( - /*stageAll*/ - ctx[18] - )), - listen( - div15, - "click", - /*click_handler_3*/ - ctx[37] - ) - ]; - mounted = true; - } - }, - p(ctx2, dirty) { - if (!current || dirty[0] & /*stagedOpen*/ - 8192) { - toggle_class(div0, "is-collapsed", !/*stagedOpen*/ - ctx2[13]); - } - if ((!current || dirty[0] & /*status*/ - 64) && t4_value !== (t4_value = /*status*/ - ctx2[6].staged.length + "")) - set_data(t4, t4_value); - if ( - /*stagedOpen*/ - ctx2[13] - ) { - if (if_block0) { - if_block0.p(ctx2, dirty); - if (dirty[0] & /*stagedOpen*/ - 8192) { - transition_in(if_block0, 1); - } - } else { - if_block0 = create_if_block_6(ctx2); - if_block0.c(); - transition_in(if_block0, 1); - if_block0.m(div7, null); - } - } else if (if_block0) { - group_outros(); - transition_out(if_block0, 1, 1, () => { - if_block0 = null; - }); - check_outros(); - } - if (!current || dirty[0] & /*stagedOpen*/ - 8192) { - toggle_class(div7, "is-collapsed", !/*stagedOpen*/ - ctx2[13]); - } - if (!current || dirty[0] & /*changesOpen*/ - 4096) { - toggle_class(div8, "is-collapsed", !/*changesOpen*/ - ctx2[12]); - } - if ((!current || dirty[0] & /*status*/ - 64) && t12_value !== (t12_value = /*status*/ - ctx2[6].changed.length + "")) - set_data(t12, t12_value); - if ( - /*changesOpen*/ - ctx2[12] - ) { - if (if_block1) { - if_block1.p(ctx2, dirty); - if (dirty[0] & /*changesOpen*/ - 4096) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block_42(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(div16, null); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - if (!current || dirty[0] & /*changesOpen*/ - 4096) { - toggle_class(div16, "is-collapsed", !/*changesOpen*/ - ctx2[12]); - } - if ( - /*lastPulledFiles*/ - ctx2[7].length > 0 - ) { - if (if_block2) { - if_block2.p(ctx2, dirty); - if (dirty[0] & /*lastPulledFiles*/ - 128) { - transition_in(if_block2, 1); - } - } else { - if_block2 = create_if_block_14(ctx2); - if_block2.c(); - transition_in(if_block2, 1); - if_block2.m(div17, null); - } - } else if (if_block2) { - group_outros(); - transition_out(if_block2, 1, 1, () => { - if_block2 = null; - }); - check_outros(); - } - }, - i(local) { - if (current) - return; - transition_in(if_block0); - transition_in(if_block1); - transition_in(if_block2); - current = true; - }, - o(local) { - transition_out(if_block0); - transition_out(if_block1); - transition_out(if_block2); - current = false; - }, - d(detaching) { - if (detaching) { - detach(div18); - } - ctx[34](null); - if (if_block0) - if_block0.d(); - ctx[36](null); - if (if_block1) - if_block1.d(); - if (if_block2) - if_block2.d(); - mounted = false; - run_all(dispose); - } - }; -} -function create_if_block_6(ctx) { - let div; - let current_block_type_index; - let if_block; - let div_transition; - let current; - const if_block_creators = [create_if_block_7, create_else_block_2]; - const if_blocks = []; - function select_block_type(ctx2, dirty) { - if ( - /*showTree*/ - ctx2[3] - ) - return 0; - return 1; - } - current_block_type_index = select_block_type(ctx, [-1, -1]); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - div = element("div"); - if_block.c(); - attr(div, "class", "tree-item-children nav-folder-children"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div, null); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(if_block); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(div); - } - if_blocks[current_block_type_index].d(); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_else_block_2(ctx) { - let each_1_anchor; - let current; - let each_value_2 = ensure_array_like( - /*status*/ - ctx[6].staged - ); - let each_blocks = []; - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - m(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert(target, each_1_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - if (dirty[0] & /*status, view, plugin*/ - 67) { - each_value_2 = ensure_array_like( - /*status*/ - ctx2[6].staged - ); - let i; - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2(ctx2, each_value_2, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block_2(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - group_outros(); - for (i = each_value_2.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value_2.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(each_1_anchor); - } - destroy_each(each_blocks, detaching); - } - }; -} -function create_if_block_7(ctx) { - let treecomponent; - let current; - treecomponent = new treeComponent_default({ - props: { - hierarchy: ( - /*stagedHierarchy*/ - ctx[10] - ), - plugin: ( - /*plugin*/ - ctx[0] - ), - view: ( - /*view*/ - ctx[1] - ), - fileType: 0 /* staged */, - topLevel: true - } - }); - return { - c() { - create_component(treecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(treecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const treecomponent_changes = {}; - if (dirty[0] & /*stagedHierarchy*/ - 1024) - treecomponent_changes.hierarchy = /*stagedHierarchy*/ - ctx2[10]; - if (dirty[0] & /*plugin*/ - 1) - treecomponent_changes.plugin = /*plugin*/ - ctx2[0]; - if (dirty[0] & /*view*/ - 2) - treecomponent_changes.view = /*view*/ - ctx2[1]; - treecomponent.$set(treecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(treecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(treecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(treecomponent, detaching); - } - }; -} -function create_each_block_2(ctx) { - let stagedfilecomponent; - let current; - stagedfilecomponent = new stagedFileComponent_default({ - props: { - change: ( - /*stagedFile*/ - ctx[45] - ), - view: ( - /*view*/ - ctx[1] - ), - manager: ( - /*plugin*/ - ctx[0].gitManager - ) - } - }); - return { - c() { - create_component(stagedfilecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(stagedfilecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const stagedfilecomponent_changes = {}; - if (dirty[0] & /*status*/ - 64) - stagedfilecomponent_changes.change = /*stagedFile*/ - ctx2[45]; - if (dirty[0] & /*view*/ - 2) - stagedfilecomponent_changes.view = /*view*/ - ctx2[1]; - if (dirty[0] & /*plugin*/ - 1) - stagedfilecomponent_changes.manager = /*plugin*/ - ctx2[0].gitManager; - stagedfilecomponent.$set(stagedfilecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(stagedfilecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(stagedfilecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(stagedfilecomponent, detaching); - } - }; -} -function create_if_block_42(ctx) { - let div; - let current_block_type_index; - let if_block; - let div_transition; - let current; - const if_block_creators = [create_if_block_52, create_else_block_12]; - const if_blocks = []; - function select_block_type_1(ctx2, dirty) { - if ( - /*showTree*/ - ctx2[3] - ) - return 0; - return 1; - } - current_block_type_index = select_block_type_1(ctx, [-1, -1]); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - div = element("div"); - if_block.c(); - attr(div, "class", "tree-item-children nav-folder-children"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type_1(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div, null); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(if_block); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(div); - } - if_blocks[current_block_type_index].d(); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_else_block_12(ctx) { - let each_1_anchor; - let current; - let each_value_1 = ensure_array_like( - /*status*/ - ctx[6].changed - ); - let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - m(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert(target, each_1_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - if (dirty[0] & /*status, view, plugin*/ - 67) { - each_value_1 = ensure_array_like( - /*status*/ - ctx2[6].changed - ); - let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx2, each_value_1, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block_1(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - group_outros(); - for (i = each_value_1.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value_1.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(each_1_anchor); - } - destroy_each(each_blocks, detaching); - } - }; -} -function create_if_block_52(ctx) { - let treecomponent; - let current; - treecomponent = new treeComponent_default({ - props: { - hierarchy: ( - /*changeHierarchy*/ - ctx[9] - ), - plugin: ( - /*plugin*/ - ctx[0] - ), - view: ( - /*view*/ - ctx[1] - ), - fileType: 1 /* changed */, - topLevel: true - } - }); - return { - c() { - create_component(treecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(treecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const treecomponent_changes = {}; - if (dirty[0] & /*changeHierarchy*/ - 512) - treecomponent_changes.hierarchy = /*changeHierarchy*/ - ctx2[9]; - if (dirty[0] & /*plugin*/ - 1) - treecomponent_changes.plugin = /*plugin*/ - ctx2[0]; - if (dirty[0] & /*view*/ - 2) - treecomponent_changes.view = /*view*/ - ctx2[1]; - treecomponent.$set(treecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(treecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(treecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(treecomponent, detaching); - } - }; -} -function create_each_block_1(ctx) { - let filecomponent; - let current; - filecomponent = new fileComponent_default({ - props: { - change: ( - /*change*/ - ctx[40] - ), - view: ( - /*view*/ - ctx[1] - ), - manager: ( - /*plugin*/ - ctx[0].gitManager - ) - } - }); - filecomponent.$on("git-refresh", triggerRefresh2); - return { - c() { - create_component(filecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(filecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const filecomponent_changes = {}; - if (dirty[0] & /*status*/ - 64) - filecomponent_changes.change = /*change*/ - ctx2[40]; - if (dirty[0] & /*view*/ - 2) - filecomponent_changes.view = /*view*/ - ctx2[1]; - if (dirty[0] & /*plugin*/ - 1) - filecomponent_changes.manager = /*plugin*/ - ctx2[0].gitManager; - filecomponent.$set(filecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(filecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(filecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(filecomponent, detaching); - } - }; -} -function create_if_block_14(ctx) { - let div3; - let div2; - let div0; - let t0; - let div1; - let t2; - let span; - let t3_value = ( - /*lastPulledFiles*/ - ctx[7].length + "" - ); - let t3; - let t4; - let current; - let mounted; - let dispose; - let if_block = ( - /*lastPulledFilesOpen*/ - ctx[14] && create_if_block_23(ctx) - ); - return { - c() { - div3 = element("div"); - div2 = element("div"); - div0 = element("div"); - div0.innerHTML = ``; - t0 = space(); - div1 = element("div"); - div1.textContent = "Recently Pulled Files"; - t2 = space(); - span = element("span"); - t3 = text(t3_value); - t4 = space(); - if (if_block) - if_block.c(); - attr(div0, "class", "tree-item-icon nav-folder-collapse-indicator collapse-icon"); - attr(div1, "class", "tree-item-inner nav-folder-title-content"); - attr(span, "class", "tree-item-flair"); - attr(div2, "class", "tree-item-self is-clickable nav-folder-title svelte-1bvmxec"); - attr(div3, "class", "pulled nav-folder"); - toggle_class(div3, "is-collapsed", !/*lastPulledFilesOpen*/ - ctx[14]); - }, - m(target, anchor) { - insert(target, div3, anchor); - append2(div3, div2); - append2(div2, div0); - append2(div2, t0); - append2(div2, div1); - append2(div2, t2); - append2(div2, span); - append2(span, t3); - append2(div3, t4); - if (if_block) - if_block.m(div3, null); - current = true; - if (!mounted) { - dispose = listen( - div2, - "click", - /*click_handler_4*/ - ctx[38] - ); - mounted = true; - } - }, - p(ctx2, dirty) { - if ((!current || dirty[0] & /*lastPulledFiles*/ - 128) && t3_value !== (t3_value = /*lastPulledFiles*/ - ctx2[7].length + "")) - set_data(t3, t3_value); - if ( - /*lastPulledFilesOpen*/ - ctx2[14] - ) { - if (if_block) { - if_block.p(ctx2, dirty); - if (dirty[0] & /*lastPulledFilesOpen*/ - 16384) { - transition_in(if_block, 1); - } - } else { - if_block = create_if_block_23(ctx2); - if_block.c(); - transition_in(if_block, 1); - if_block.m(div3, null); - } - } else if (if_block) { - group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; - }); - check_outros(); - } - if (!current || dirty[0] & /*lastPulledFilesOpen*/ - 16384) { - toggle_class(div3, "is-collapsed", !/*lastPulledFilesOpen*/ - ctx2[14]); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - current = true; - }, - o(local) { - transition_out(if_block); - current = false; - }, - d(detaching) { - if (detaching) { - detach(div3); - } - if (if_block) - if_block.d(); - mounted = false; - dispose(); - } - }; -} -function create_if_block_23(ctx) { - let div; - let current_block_type_index; - let if_block; - let div_transition; - let current; - const if_block_creators = [create_if_block_32, create_else_block4]; - const if_blocks = []; - function select_block_type_2(ctx2, dirty) { - if ( - /*showTree*/ - ctx2[3] - ) - return 0; - return 1; - } - current_block_type_index = select_block_type_2(ctx, [-1, -1]); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - return { - c() { - div = element("div"); - if_block.c(); - attr(div, "class", "tree-item-children nav-folder-children"); - }, - m(target, anchor) { - insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); - current = true; - }, - p(ctx2, dirty) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type_2(ctx2, dirty); - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - group_outros(); - transition_out(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - check_outros(); - if_block = if_blocks[current_block_type_index]; - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx2); - if_block.c(); - } else { - if_block.p(ctx2, dirty); - } - transition_in(if_block, 1); - if_block.m(div, null); - } - }, - i(local) { - if (current) - return; - transition_in(if_block); - if (local) { - add_render_callback(() => { - if (!current) - return; - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); - div_transition.run(1); - }); - } - current = true; - }, - o(local) { - transition_out(if_block); - if (local) { - if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); - div_transition.run(0); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(div); - } - if_blocks[current_block_type_index].d(); - if (detaching && div_transition) - div_transition.end(); - } - }; -} -function create_else_block4(ctx) { - let each_1_anchor; - let current; - let each_value = ensure_array_like( - /*lastPulledFiles*/ - ctx[7] - ); - let each_blocks = []; - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block5(get_each_context5(ctx, each_value, i)); - } - const out = (i) => transition_out(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - return { - c() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - each_1_anchor = empty(); - }, - m(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].m(target, anchor); - } - } - insert(target, each_1_anchor, anchor); - current = true; - }, - p(ctx2, dirty) { - if (dirty[0] & /*lastPulledFiles, view*/ - 130) { - each_value = ensure_array_like( - /*lastPulledFiles*/ - ctx2[7] - ); - let i; - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context5(ctx2, each_value, i); - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block5(child_ctx); - each_blocks[i].c(); - transition_in(each_blocks[i], 1); - each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); - } - } - group_outros(); - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - check_outros(); - } - }, - i(local) { - if (current) - return; - for (let i = 0; i < each_value.length; i += 1) { - transition_in(each_blocks[i]); - } - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } - current = false; - }, - d(detaching) { - if (detaching) { - detach(each_1_anchor); - } - destroy_each(each_blocks, detaching); - } - }; -} -function create_if_block_32(ctx) { - let treecomponent; - let current; - treecomponent = new treeComponent_default({ - props: { - hierarchy: ( - /*lastPulledFilesHierarchy*/ - ctx[11] - ), - plugin: ( - /*plugin*/ - ctx[0] - ), - view: ( - /*view*/ - ctx[1] - ), - fileType: 2 /* pulled */, - topLevel: true - } - }); - return { - c() { - create_component(treecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(treecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const treecomponent_changes = {}; - if (dirty[0] & /*lastPulledFilesHierarchy*/ - 2048) - treecomponent_changes.hierarchy = /*lastPulledFilesHierarchy*/ - ctx2[11]; - if (dirty[0] & /*plugin*/ - 1) - treecomponent_changes.plugin = /*plugin*/ - ctx2[0]; - if (dirty[0] & /*view*/ - 2) - treecomponent_changes.view = /*view*/ - ctx2[1]; - treecomponent.$set(treecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(treecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(treecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(treecomponent, detaching); - } - }; -} -function create_each_block5(ctx) { - let pulledfilecomponent; - let current; - pulledfilecomponent = new pulledFileComponent_default({ - props: { - change: ( - /*change*/ - ctx[40] - ), - view: ( - /*view*/ - ctx[1] - ) - } - }); - pulledfilecomponent.$on("git-refresh", triggerRefresh2); - return { - c() { - create_component(pulledfilecomponent.$$.fragment); - }, - m(target, anchor) { - mount_component(pulledfilecomponent, target, anchor); - current = true; - }, - p(ctx2, dirty) { - const pulledfilecomponent_changes = {}; - if (dirty[0] & /*lastPulledFiles*/ - 128) - pulledfilecomponent_changes.change = /*change*/ - ctx2[40]; - if (dirty[0] & /*view*/ - 2) - pulledfilecomponent_changes.view = /*view*/ - ctx2[1]; - pulledfilecomponent.$set(pulledfilecomponent_changes); - }, - i(local) { - if (current) - return; - transition_in(pulledfilecomponent.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(pulledfilecomponent.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component(pulledfilecomponent, detaching); - } - }; -} -function create_fragment9(ctx) { - let main; - let div9; - let div8; - let div0; - let t0; - let div1; - let t1; - let div2; - let t2; - let div3; - let t3; - let div4; - let t4; - let div5; - let t5; - let div6; - let t6; - let div7; - let t7; - let div10; - let textarea; - let t8; - let t9; - let div11; - let main_data_type_value; - let current; - let mounted; - let dispose; - let if_block0 = ( - /*commitMessage*/ - ctx[2] && create_if_block_8(ctx) - ); - let if_block1 = ( - /*status*/ - ctx[6] && /*stagedHierarchy*/ - ctx[10] && /*changeHierarchy*/ - ctx[9] && create_if_block8(ctx) - ); - return { - c() { - main = element("main"); - div9 = element("div"); - div8 = element("div"); - div0 = element("div"); - t0 = space(); - div1 = element("div"); - t1 = space(); - div2 = element("div"); - t2 = space(); - div3 = element("div"); - t3 = space(); - div4 = element("div"); - t4 = space(); - div5 = element("div"); - t5 = space(); - div6 = element("div"); - t6 = space(); - div7 = element("div"); - t7 = space(); - div10 = element("div"); - textarea = element("textarea"); - t8 = space(); - if (if_block0) - if_block0.c(); - t9 = space(); - div11 = element("div"); - if (if_block1) - if_block1.c(); - attr(div0, "id", "backup-btn"); - attr(div0, "data-icon", "arrow-up-circle"); - attr(div0, "class", "clickable-icon nav-action-button"); - attr(div0, "aria-label", "Backup"); - attr(div1, "id", "commit-btn"); - attr(div1, "data-icon", "check"); - attr(div1, "class", "clickable-icon nav-action-button"); - attr(div1, "aria-label", "Commit"); - attr(div2, "id", "stage-all"); - attr(div2, "class", "clickable-icon nav-action-button"); - attr(div2, "data-icon", "plus-circle"); - attr(div2, "aria-label", "Stage all"); - attr(div3, "id", "unstage-all"); - attr(div3, "class", "clickable-icon nav-action-button"); - attr(div3, "data-icon", "minus-circle"); - attr(div3, "aria-label", "Unstage all"); - attr(div4, "id", "push"); - attr(div4, "class", "clickable-icon nav-action-button"); - attr(div4, "data-icon", "upload"); - attr(div4, "aria-label", "Push"); - attr(div5, "id", "pull"); - attr(div5, "class", "clickable-icon nav-action-button"); - attr(div5, "data-icon", "download"); - attr(div5, "aria-label", "Pull"); - attr(div6, "id", "layoutChange"); - attr(div6, "class", "clickable-icon nav-action-button"); - attr(div6, "aria-label", "Change Layout"); - attr(div7, "id", "refresh"); - attr(div7, "class", "clickable-icon nav-action-button"); - attr(div7, "data-icon", "refresh-cw"); - attr(div7, "aria-label", "Refresh"); - set_style(div7, "margin", "1px"); - toggle_class( - div7, - "loading", - /*loading*/ - ctx[5] - ); - attr(div8, "class", "nav-buttons-container"); - attr(div9, "class", "nav-header"); - attr( - textarea, - "rows", - /*rows*/ - ctx[15] - ); - attr(textarea, "class", "commit-msg-input svelte-1bvmxec"); - attr(textarea, "spellcheck", "true"); - attr(textarea, "placeholder", "Commit Message"); - attr(div10, "class", "git-commit-msg svelte-1bvmxec"); - attr(div11, "class", "nav-files-container"); - set_style(div11, "position", "relative"); - attr(main, "data-type", main_data_type_value = SOURCE_CONTROL_VIEW_CONFIG.type); - attr(main, "class", "svelte-1bvmxec"); - }, - m(target, anchor) { - insert(target, main, anchor); - append2(main, div9); - append2(div9, div8); - append2(div8, div0); - ctx[23](div0); - append2(div8, t0); - append2(div8, div1); - ctx[24](div1); - append2(div8, t1); - append2(div8, div2); - ctx[25](div2); - append2(div8, t2); - append2(div8, div3); - ctx[26](div3); - append2(div8, t3); - append2(div8, div4); - ctx[27](div4); - append2(div8, t4); - append2(div8, div5); - ctx[28](div5); - append2(div8, t5); - append2(div8, div6); - ctx[29](div6); - append2(div8, t6); - append2(div8, div7); - ctx[31](div7); - append2(main, t7); - append2(main, div10); - append2(div10, textarea); - set_input_value( - textarea, - /*commitMessage*/ - ctx[2] - ); - append2(div10, t8); - if (if_block0) - if_block0.m(div10, null); - append2(main, t9); - append2(main, div11); - if (if_block1) - if_block1.m(div11, null); - current = true; - if (!mounted) { - dispose = [ - listen( - div0, - "click", - /*backup*/ - ctx[17] - ), - listen( - div1, - "click", - /*commit*/ - ctx[16] - ), - listen( - div2, - "click", - /*stageAll*/ - ctx[18] - ), - listen( - div3, - "click", - /*unstageAll*/ - ctx[19] - ), - listen( - div4, - "click", - /*push*/ - ctx[20] - ), - listen( - div5, - "click", - /*pull*/ - ctx[21] - ), - listen( - div6, - "click", - /*click_handler*/ - ctx[30] - ), - listen(div7, "click", triggerRefresh2), - listen( - textarea, - "input", - /*textarea_input_handler*/ - ctx[32] - ) - ]; - mounted = true; - } - }, - p(ctx2, dirty) { - if (!current || dirty[0] & /*loading*/ - 32) { - toggle_class( - div7, - "loading", - /*loading*/ - ctx2[5] - ); - } - if (!current || dirty[0] & /*rows*/ - 32768) { - attr( - textarea, - "rows", - /*rows*/ - ctx2[15] - ); - } - if (dirty[0] & /*commitMessage*/ - 4) { - set_input_value( - textarea, - /*commitMessage*/ - ctx2[2] - ); - } - if ( - /*commitMessage*/ - ctx2[2] - ) { - if (if_block0) { - if_block0.p(ctx2, dirty); - } else { - if_block0 = create_if_block_8(ctx2); - if_block0.c(); - if_block0.m(div10, null); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - if ( - /*status*/ - ctx2[6] && /*stagedHierarchy*/ - ctx2[10] && /*changeHierarchy*/ - ctx2[9] - ) { - if (if_block1) { - if_block1.p(ctx2, dirty); - if (dirty[0] & /*status, stagedHierarchy, changeHierarchy*/ - 1600) { - transition_in(if_block1, 1); - } - } else { - if_block1 = create_if_block8(ctx2); - if_block1.c(); - transition_in(if_block1, 1); - if_block1.m(div11, null); - } - } else if (if_block1) { - group_outros(); - transition_out(if_block1, 1, 1, () => { - if_block1 = null; - }); - check_outros(); - } - }, - i(local) { - if (current) - return; - transition_in(if_block1); - current = true; - }, - o(local) { - transition_out(if_block1); - current = false; - }, - d(detaching) { - if (detaching) { - detach(main); - } - ctx[23](null); - ctx[24](null); - ctx[25](null); - ctx[26](null); - ctx[27](null); - ctx[28](null); - ctx[29](null); - ctx[31](null); - if (if_block0) - if_block0.d(); - if (if_block1) - if_block1.d(); - mounted = false; - run_all(dispose); - } - }; -} -function triggerRefresh2() { - dispatchEvent(new CustomEvent("git-refresh")); -} -function instance9($$self, $$props, $$invalidate) { - let rows; - let { plugin } = $$props; - let { view } = $$props; - let loading; - let status2; - let lastPulledFiles = []; - let commitMessage = plugin.settings.commitMessage; - let buttons = []; - let changeHierarchy; - let stagedHierarchy; - let lastPulledFilesHierarchy; - let changesOpen = true; - let stagedOpen = true; - let lastPulledFilesOpen = true; - let showTree = plugin.settings.treeStructure; - let layoutBtn; - addEventListener("git-view-refresh", refresh); - plugin.app.workspace.onLayoutReady(() => { - window.setTimeout( - () => { - buttons.forEach((btn) => (0, import_obsidian28.setIcon)(btn, btn.getAttr("data-icon"))); - (0, import_obsidian28.setIcon)(layoutBtn, showTree ? "list" : "folder"); - }, - 0 - ); - }); - onDestroy(() => { - removeEventListener("git-view-refresh", refresh); - }); - function commit2() { - return __awaiter(this, void 0, void 0, function* () { - $$invalidate(5, loading = true); - if (status2) { - if (yield plugin.hasTooBigFiles(status2.staged)) { - plugin.setState(0 /* idle */); - return false; - } - plugin.promiseQueue.addTask(() => plugin.gitManager.commit(commitMessage).then(() => { - if (commitMessage !== plugin.settings.commitMessage) { - $$invalidate(2, commitMessage = ""); - } - plugin.setUpAutoBackup(); - }).finally(triggerRefresh2)); - } - }); - } - function backup() { - return __awaiter(this, void 0, void 0, function* () { - $$invalidate(5, loading = true); - if (status2) { - plugin.promiseQueue.addTask(() => plugin.createBackup(false, false, commitMessage).then(() => { - if (commitMessage !== plugin.settings.commitMessage) { - $$invalidate(2, commitMessage = ""); - } - }).finally(triggerRefresh2)); - } - }); - } - function refresh() { - return __awaiter(this, void 0, void 0, function* () { - if (!plugin.gitReady) { - $$invalidate(6, status2 = void 0); - return; - } - const unPushedCommits = yield plugin.gitManager.getUnpushedCommits(); - buttons.forEach((btn) => { - var _a2, _b; - if (import_obsidian28.Platform.isMobile) { - btn.removeClass("button-border"); - if (btn.id == "push" && unPushedCommits > 0) { - btn.addClass("button-border"); - } - } else { - (_a2 = btn.firstElementChild) === null || _a2 === void 0 ? void 0 : _a2.removeAttribute("color"); - if (btn.id == "push" && unPushedCommits > 0) { - (_b = btn.firstElementChild) === null || _b === void 0 ? void 0 : _b.setAttr("color", "var(--text-accent)"); - } - } - }); - $$invalidate(6, status2 = plugin.cachedStatus); - if (plugin.lastPulledFiles && plugin.lastPulledFiles != lastPulledFiles) { - $$invalidate(7, lastPulledFiles = plugin.lastPulledFiles); - $$invalidate(11, lastPulledFilesHierarchy = { - title: "", - path: "", - vaultPath: "", - children: plugin.gitManager.getTreeStructure(lastPulledFiles) - }); - } - if (status2) { - const sort = (a, b) => { - return a.vault_path.split("/").last().localeCompare(getDisplayPath(b.vault_path)); - }; - status2.changed.sort(sort); - status2.staged.sort(sort); - if (status2.changed.length + status2.staged.length > 500) { - $$invalidate(6, status2 = void 0); - if (!plugin.loading) { - plugin.displayError("Too many changes to display"); - } - } else { - $$invalidate(9, changeHierarchy = { - title: "", - path: "", - vaultPath: "", - children: plugin.gitManager.getTreeStructure(status2.changed) - }); - $$invalidate(10, stagedHierarchy = { - title: "", - path: "", - vaultPath: "", - children: plugin.gitManager.getTreeStructure(status2.staged) - }); - } - } else { - $$invalidate(9, changeHierarchy = void 0); - $$invalidate(10, stagedHierarchy = void 0); - } - $$invalidate(5, loading = plugin.loading); - }); - } - function stageAll() { - $$invalidate(5, loading = true); - plugin.promiseQueue.addTask(() => plugin.gitManager.stageAll({ status: status2 }).finally(triggerRefresh2)); - } - function unstageAll() { - $$invalidate(5, loading = true); - plugin.promiseQueue.addTask(() => plugin.gitManager.unstageAll({ status: status2 }).finally(triggerRefresh2)); - } - function push2() { - $$invalidate(5, loading = true); - plugin.promiseQueue.addTask(() => plugin.push().finally(triggerRefresh2)); - } - function pull2() { - $$invalidate(5, loading = true); - plugin.promiseQueue.addTask(() => plugin.pullChangesFromRemote().finally(triggerRefresh2)); - } - function discard() { - new DiscardModal(view.app, false, plugin.gitManager.getVaultPath("/")).myOpen().then((shouldDiscard) => { - if (shouldDiscard === true) { - plugin.promiseQueue.addTask(() => plugin.gitManager.discardAll({ status: plugin.cachedStatus }).finally(() => { - dispatchEvent(new CustomEvent("git-refresh")); - })); - } - }); - } - function div0_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[5] = $$value; - $$invalidate(8, buttons); - }); - } - function div1_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[0] = $$value; - $$invalidate(8, buttons); - }); - } - function div2_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[1] = $$value; - $$invalidate(8, buttons); - }); - } - function div3_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[2] = $$value; - $$invalidate(8, buttons); - }); - } - function div4_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[3] = $$value; - $$invalidate(8, buttons); - }); - } - function div5_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[4] = $$value; - $$invalidate(8, buttons); - }); - } - function div6_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - layoutBtn = $$value; - $$invalidate(4, layoutBtn); - }); - } - const click_handler = () => { - $$invalidate(3, showTree = !showTree); - $$invalidate(0, plugin.settings.treeStructure = showTree, plugin); - plugin.saveSettings(); - }; - function div7_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[6] = $$value; - $$invalidate(8, buttons); - }); - } - function textarea_input_handler() { - commitMessage = this.value; - $$invalidate(2, commitMessage); - } - const click_handler_1 = () => $$invalidate(2, commitMessage = ""); - function div2_binding_1($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[8] = $$value; - $$invalidate(8, buttons); - }); - } - const click_handler_2 = () => $$invalidate(13, stagedOpen = !stagedOpen); - function div11_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - buttons[9] = $$value; - $$invalidate(8, buttons); - }); - } - const click_handler_3 = () => $$invalidate(12, changesOpen = !changesOpen); - const click_handler_4 = () => $$invalidate(14, lastPulledFilesOpen = !lastPulledFilesOpen); - $$self.$$set = ($$props2) => { - if ("plugin" in $$props2) - $$invalidate(0, plugin = $$props2.plugin); - if ("view" in $$props2) - $$invalidate(1, view = $$props2.view); - }; - $$self.$$.update = () => { - if ($$self.$$.dirty[0] & /*layoutBtn, showTree*/ - 24) { - $: { - if (layoutBtn) { - layoutBtn.empty(); - (0, import_obsidian28.setIcon)(layoutBtn, showTree ? "list" : "folder"); - } - } - } - if ($$self.$$.dirty[0] & /*commitMessage*/ - 4) { - $: - $$invalidate(15, rows = (commitMessage.match(/\n/g) || []).length + 1 || 1); - } - }; - return [ - plugin, - view, - commitMessage, - showTree, - layoutBtn, - loading, - status2, - lastPulledFiles, - buttons, - changeHierarchy, - stagedHierarchy, - lastPulledFilesHierarchy, - changesOpen, - stagedOpen, - lastPulledFilesOpen, - rows, - commit2, - backup, - stageAll, - unstageAll, - push2, - pull2, - discard, - div0_binding, - div1_binding, - div2_binding, - div3_binding, - div4_binding, - div5_binding, - div6_binding, - click_handler, - div7_binding, - textarea_input_handler, - click_handler_1, - div2_binding_1, - click_handler_2, - div11_binding, - click_handler_3, - click_handler_4 - ]; -} -var SourceControl = class extends SvelteComponent { - constructor(options) { - super(); - init2(this, options, instance9, create_fragment9, safe_not_equal, { plugin: 0, view: 1 }, add_css8, [-1, -1]); - } -}; -var sourceControl_default = SourceControl; - -// src/ui/sourceControl/sourceControl.ts -var GitView = class extends import_obsidian29.ItemView { - constructor(leaf, plugin) { - super(leaf); - this.plugin = plugin; - this.hoverPopover = null; - } - getViewType() { - return SOURCE_CONTROL_VIEW_CONFIG.type; - } - getDisplayText() { - return SOURCE_CONTROL_VIEW_CONFIG.name; - } - getIcon() { - return SOURCE_CONTROL_VIEW_CONFIG.icon; - } - onClose() { - return super.onClose(); - } - onOpen() { - this._view = new sourceControl_default({ - target: this.contentEl, - props: { - plugin: this.plugin, - view: this - } - }); - return super.onOpen(); - } -}; - -// src/ui/statusBar/branchStatusBar.ts -init_polyfill_buffer(); -var BranchStatusBar = class { - constructor(statusBarEl, plugin) { - this.statusBarEl = statusBarEl; - this.plugin = plugin; - this.statusBarEl.addClass("mod-clickable"); - this.statusBarEl.onClickEvent((e) => { - this.plugin.switchBranch(); - }); - } - async display() { - if (this.plugin.gitReady) { - const branchInfo = await this.plugin.gitManager.branchInfo(); - if (branchInfo.current != void 0) { - this.statusBarEl.setText(branchInfo.current); - } else { - this.statusBarEl.empty(); - } - } else { - this.statusBarEl.empty(); - } - } -}; - -// src/main.ts -var ObsidianGit = class extends import_obsidian30.Plugin { - constructor() { - super(...arguments); - this.gitReady = false; - this.promiseQueue = new PromiseQueue(); - this.conflictOutputFile = "conflict-files-obsidian-git.md"; - this.offlineMode = false; - this.loading = false; - this.lineAuthoringFeature = new LineAuthoringFeature(this); - } - setState(state) { - var _a2; - this.state = state; - (_a2 = this.statusBar) == null ? void 0 : _a2.display(); - } - async updateCachedStatus() { - this.cachedStatus = await this.gitManager.status(); - return this.cachedStatus; - } - async refresh() { - const gitView = this.app.workspace.getLeavesOfType( - SOURCE_CONTROL_VIEW_CONFIG.type - ); - const historyView = this.app.workspace.getLeavesOfType( - HISTORY_VIEW_CONFIG.type - ); - if (this.settings.changedFilesInStatusBar || gitView.length > 0 || historyView.length > 0) { - this.loading = true; - dispatchEvent(new CustomEvent("git-view-refresh")); - await this.updateCachedStatus(); - this.loading = false; - dispatchEvent(new CustomEvent("git-view-refresh")); - } - } - async refreshUpdatedHead() { - this.lineAuthoringFeature.refreshLineAuthorViews(); - } - async onload() { - console.log("loading " + this.manifest.name + " plugin"); - pluginRef.plugin = this; - this.localStorage = new LocalStorageSettings(this); - this.localStorage.migrate(); - await this.loadSettings(); - this.migrateSettings(); - this.settingsTab = new ObsidianGitSettingsTab(this.app, this); - this.addSettingTab(this.settingsTab); - if (!this.localStorage.getPluginDisabled()) { - this.loadPlugin(); - } - } - async loadPlugin() { - addEventListener("git-refresh", this.refresh.bind(this)); - addEventListener("git-head-update", this.refreshUpdatedHead.bind(this)); - this.registerView(SOURCE_CONTROL_VIEW_CONFIG.type, (leaf) => { - return new GitView(leaf, this); - }); - this.registerView(HISTORY_VIEW_CONFIG.type, (leaf) => { - return new HistoryView2(leaf, this); - }); - this.registerView(DIFF_VIEW_CONFIG.type, (leaf) => { - return new DiffView(leaf, this); - }); - this.lineAuthoringFeature.onLoadPlugin(); - this.app.workspace.registerHoverLinkSource( - SOURCE_CONTROL_VIEW_CONFIG.type, - { - display: "Git View", - defaultMod: true - } - ); - this.setRefreshDebouncer(); - this.addCommand({ - id: "edit-gitignore", - name: "Edit .gitignore", - callback: async () => { - const path2 = this.gitManager.getVaultPath(".gitignore"); - if (!await this.app.vault.adapter.exists(path2)) { - this.app.vault.adapter.write(path2, ""); - } - const content = await this.app.vault.adapter.read(path2); - const modal = new IgnoreModal(this.app, content); - const res = await modal.open(); - if (res !== void 0) { - await this.app.vault.adapter.write(path2, res); - this.refresh(); - } - } - }); - this.addCommand({ - id: "open-git-view", - name: "Open source control view", - callback: async () => { - const leafs = this.app.workspace.getLeavesOfType( - SOURCE_CONTROL_VIEW_CONFIG.type - ); - let leaf; - if (leafs.length === 0) { - leaf = this.app.workspace.getRightLeaf(false); - await leaf.setViewState({ - type: SOURCE_CONTROL_VIEW_CONFIG.type - }); - } else { - leaf = leafs.first(); - } - this.app.workspace.revealLeaf(leaf); - dispatchEvent(new CustomEvent("git-refresh")); - } - }); - this.addCommand({ - id: "open-history-view", - name: "Open history view", - callback: async () => { - const leafs = this.app.workspace.getLeavesOfType( - HISTORY_VIEW_CONFIG.type - ); - let leaf; - if (leafs.length === 0) { - leaf = this.app.workspace.getRightLeaf(false); - await leaf.setViewState({ - type: HISTORY_VIEW_CONFIG.type - }); - } else { - leaf = leafs.first(); - } - this.app.workspace.revealLeaf(leaf); - dispatchEvent(new CustomEvent("git-refresh")); - } - }); - this.addCommand({ - id: "open-diff-view", - name: "Open diff view", - checkCallback: (checking) => { - var _a2; - const file = this.app.workspace.getActiveFile(); - if (checking) { - return file !== null; - } else { - (_a2 = getNewLeaf()) == null ? void 0 : _a2.setViewState({ - type: DIFF_VIEW_CONFIG.type, - active: true, - state: { - staged: false, - file: this.gitManager.asRepositoryRelativePath( - file.path, - true - ) - } - }); - } - } - }); - this.addCommand({ - id: "view-file-on-github", - name: "Open file on GitHub", - editorCallback: (editor, { file }) => { - if (file) - return openLineInGitHub(editor, file, this.gitManager); - } - }); - this.addCommand({ - id: "view-history-on-github", - name: "Open file history on GitHub", - editorCallback: (_, { file }) => { - if (file) - return openHistoryInGitHub(file, this.gitManager); - } - }); - this.addCommand({ - id: "pull", - name: "Pull", - callback: () => this.promiseQueue.addTask(() => this.pullChangesFromRemote()) - }); - this.addCommand({ - id: "fetch", - name: "fetch", - callback: () => this.promiseQueue.addTask(() => this.fetch()) - }); - this.addCommand({ - id: "switch-to-remote-branch", - name: "Switch to remote branch", - callback: () => this.promiseQueue.addTask(() => this.switchRemoteBranch()) - }); - this.addCommand({ - id: "add-to-gitignore", - name: "Add file to gitignore", - checkCallback: (checking) => { - const file = app.workspace.getActiveFile(); - if (checking) { - return file !== null; - } else { - app.vault.adapter.append( - this.gitManager.getVaultPath(".gitignore"), - "\n" + this.gitManager.asRepositoryRelativePath( - file.path, - true - ) - ).then(() => { - this.refresh(); - }); - } - } - }); - this.addCommand({ - id: "push", - name: "Create backup", - callback: () => this.promiseQueue.addTask(() => this.createBackup(false)) - }); - this.addCommand({ - id: "backup-and-close", - name: "Create backup and close", - callback: () => this.promiseQueue.addTask(async () => { - await this.createBackup(false); - window.close(); - }) - }); - this.addCommand({ - id: "commit-push-specified-message", - name: "Create backup with specific message", - callback: () => this.promiseQueue.addTask(() => this.createBackup(false, true)) - }); - this.addCommand({ - id: "commit", - name: "Commit all changes", - callback: () => this.promiseQueue.addTask( - () => this.commit({ fromAutoBackup: false }) - ) - }); - this.addCommand({ - id: "commit-specified-message", - name: "Commit all changes with specific message", - callback: () => this.promiseQueue.addTask( - () => this.commit({ - fromAutoBackup: false, - requestCustomMessage: true - }) - ) - }); - this.addCommand({ - id: "commit-staged", - name: "Commit staged", - callback: () => this.promiseQueue.addTask( - () => this.commit({ - fromAutoBackup: false, - requestCustomMessage: false, - onlyStaged: true - }) - ) - }); - this.addCommand({ - id: "commit-staged-specified-message", - name: "Commit staged with specific message", - callback: () => this.promiseQueue.addTask( - () => this.commit({ - fromAutoBackup: false, - requestCustomMessage: true, - onlyStaged: true - }) - ) - }); - this.addCommand({ - id: "push2", - name: "Push", - callback: () => this.promiseQueue.addTask(() => this.push()) - }); - this.addCommand({ - id: "stage-current-file", - name: "Stage current file", - checkCallback: (checking) => { - const file = this.app.workspace.getActiveFile(); - if (checking) { - return file !== null; - } else { - this.promiseQueue.addTask(() => this.stageFile(file)); - } - } - }); - this.addCommand({ - id: "unstage-current-file", - name: "Unstage current file", - checkCallback: (checking) => { - const file = this.app.workspace.getActiveFile(); - if (checking) { - return file !== null; - } else { - this.promiseQueue.addTask(() => this.unstageFile(file)); - } - } - }); - this.addCommand({ - id: "edit-remotes", - name: "Edit remotes", - callback: async () => this.editRemotes() - }); - this.addCommand({ - id: "remove-remote", - name: "Remove remote", - callback: async () => this.removeRemote() - }); - this.addCommand({ - id: "delete-repo", - name: "CAUTION: Delete repository", - callback: async () => { - const repoExists = await this.app.vault.adapter.exists( - `${this.settings.basePath}/.git` - ); - if (repoExists) { - const modal = new GeneralModal({ - options: ["NO", "YES"], - placeholder: "Do you really want to delete the repository (.git directory)? This action cannot be undone.", - onlySelection: true - }); - const shouldDelete = await modal.open() === "YES"; - if (shouldDelete) { - await this.app.vault.adapter.rmdir( - `${this.settings.basePath}/.git`, - true - ); - new import_obsidian30.Notice( - "Successfully deleted repository. Reloading plugin..." - ); - this.unloadPlugin(); - this.init(); - } - } else { - new import_obsidian30.Notice("No repository found"); - } - } - }); - this.addCommand({ - id: "init-repo", - name: "Initialize a new repo", - callback: async () => this.createNewRepo() - }); - this.addCommand({ - id: "clone-repo", - name: "Clone an existing remote repo", - callback: async () => this.cloneNewRepo() - }); - this.addCommand({ - id: "list-changed-files", - name: "List changed files", - callback: async () => { - if (!await this.isAllInitialized()) - return; - const status2 = await this.gitManager.status(); - this.setState(0 /* idle */); - if (status2.changed.length + status2.staged.length > 500) { - this.displayError("Too many changes to display"); - return; - } - new ChangedFilesModal(this, status2.changed).open(); - } - }); - this.addCommand({ - id: "switch-branch", - name: "Switch branch", - callback: () => { - this.switchBranch(); - } - }); - this.addCommand({ - id: "create-branch", - name: "Create new branch", - callback: () => { - this.createBranch(); - } - }); - this.addCommand({ - id: "delete-branch", - name: "Delete branch", - callback: () => { - this.deleteBranch(); - } - }); - this.addCommand({ - id: "discard-all", - name: "CAUTION: Discard all changes", - callback: async () => { - if (!await this.isAllInitialized()) - return false; - const modal = new GeneralModal({ - options: ["NO", "YES"], - placeholder: "Do you want to discard all changes to tracked files? This action cannot be undone.", - onlySelection: true - }); - const shouldDiscardAll = await modal.open() === "YES"; - if (shouldDiscardAll) { - this.promiseQueue.addTask(() => this.discardAll()); - } - } - }); - this.addCommand({ - id: "toggle-line-author-info", - name: "Toggle line author information", - callback: () => { - var _a2; - return (_a2 = this.settingsTab) == null ? void 0 : _a2.configureLineAuthorShowStatus( - !this.settings.lineAuthor.show - ); - } - }); - this.registerEvent( - this.app.workspace.on("file-menu", (menu, file, source) => { - this.handleFileMenu(menu, file, source); - }) - ); - if (this.settings.showStatusBar) { - const statusBarEl = this.addStatusBarItem(); - this.statusBar = new StatusBar(statusBarEl, this); - this.registerInterval( - window.setInterval(() => { - var _a2; - return (_a2 = this.statusBar) == null ? void 0 : _a2.display(); - }, 1e3) - ); - } - if (import_obsidian30.Platform.isDesktop && this.settings.showBranchStatusBar) { - const branchStatusBarEl = this.addStatusBarItem(); - this.branchBar = new BranchStatusBar(branchStatusBarEl, this); - this.registerInterval( - window.setInterval(() => { - var _a2; - return (_a2 = this.branchBar) == null ? void 0 : _a2.display(); - }, 6e4) - ); - } - this.app.workspace.onLayoutReady(() => this.init()); - } - setRefreshDebouncer() { - var _a2; - (_a2 = this.debRefresh) == null ? void 0 : _a2.cancel(); - this.debRefresh = (0, import_obsidian30.debounce)( - () => { - if (this.settings.refreshSourceControl) { - this.refresh(); - } - }, - this.settings.refreshSourceControlTimer, - true - ); - } - async showNotices() { - const length = 1e4; - if (this.manifest.id === "obsidian-git" && import_obsidian30.Platform.isDesktopApp && !this.settings.showedMobileNotice) { - new import_obsidian30.Notice( - "Obsidian Git is now available on mobile! Please read the plugin's README for more information.", - length - ); - this.settings.showedMobileNotice = true; - await this.saveSettings(); - } - if (this.manifest.id === "obsidian-git-isomorphic") { - new import_obsidian30.Notice( - "Obsidian Git Mobile is now deprecated. Please uninstall it and install Obsidian Git instead.", - length - ); - } - } - handleFileMenu(menu, file, source) { - if (!this.settings.showFileMenu) - return; - if (source !== "file-explorer-context-menu") { - return; - } - if (!file) { - return; - } - if (!this.gitReady) - return; - menu.addItem((item) => { - item.setTitle(`Git: Stage`).setIcon("plus-circle").setSection("action").onClick((_) => { - this.promiseQueue.addTask(async () => { - if (file instanceof import_obsidian30.TFile) { - await this.gitManager.stage(file.path, true); - } else { - await this.gitManager.stageAll({ - dir: this.gitManager.asRepositoryRelativePath( - file.path, - true - ) - }); - } - this.displayMessage(`Staged ${file.path}`); - }); - }); - }); - menu.addItem((item) => { - item.setTitle(`Git: Unstage`).setIcon("minus-circle").setSection("action").onClick((_) => { - this.promiseQueue.addTask(async () => { - if (file instanceof import_obsidian30.TFile) { - await this.gitManager.unstage(file.path, true); - } else { - await this.gitManager.unstageAll({ - dir: this.gitManager.asRepositoryRelativePath( - file.path, - true - ) - }); - } - this.displayMessage(`Unstaged ${file.path}`); - }); - }); - }); - } - async migrateSettings() { - if (this.settings.mergeOnPull != void 0) { - this.settings.syncMethod = this.settings.mergeOnPull ? "merge" : "rebase"; - this.settings.mergeOnPull = void 0; - await this.saveSettings(); - } - if (this.settings.autoCommitMessage === void 0) { - this.settings.autoCommitMessage = this.settings.commitMessage; - await this.saveSettings(); - } - if (this.settings.gitPath != void 0) { - this.localStorage.setGitPath(this.settings.gitPath); - this.settings.gitPath = void 0; - await this.saveSettings(); - } - if (this.settings.username != void 0) { - this.localStorage.setPassword(this.settings.username); - this.settings.username = void 0; - await this.saveSettings(); - } - } - unloadPlugin() { - this.gitReady = false; - dispatchEvent(new CustomEvent("git-refresh")); - this.lineAuthoringFeature.deactivateFeature(); - this.clearAutoPull(); - this.clearAutoPush(); - this.clearAutoBackup(); - removeEventListener("git-refresh", this.refresh.bind(this)); - removeEventListener( - "git-head-update", - this.refreshUpdatedHead.bind(this) - ); - this.app.workspace.offref(this.openEvent); - this.app.metadataCache.offref(this.modifyEvent); - this.app.metadataCache.offref(this.deleteEvent); - this.app.metadataCache.offref(this.createEvent); - this.app.metadataCache.offref(this.renameEvent); - this.debRefresh.cancel(); - } - async onunload() { - this.app.workspace.unregisterHoverLinkSource( - SOURCE_CONTROL_VIEW_CONFIG.type - ); - this.unloadPlugin(); - console.log("unloading " + this.manifest.name + " plugin"); - } - async loadSettings() { - let data = await this.loadData(); - if (data == void 0) { - data = { showedMobileNotice: true }; - } - this.settings = mergeSettingsByPriority(DEFAULT_SETTINGS, data); - } - async saveSettings() { - var _a2; - (_a2 = this.settingsTab) == null ? void 0 : _a2.beforeSaveSettings(); - await this.saveData(this.settings); - } - saveLastAuto(date, mode) { - if (mode === "backup") { - this.localStorage.setLastAutoBackup(date.toString()); - } else if (mode === "pull") { - this.localStorage.setLastAutoPull(date.toString()); - } else if (mode === "push") { - this.localStorage.setLastAutoPush(date.toString()); - } - } - loadLastAuto() { - var _a2, _b, _c; - return { - backup: new Date((_a2 = this.localStorage.getLastAutoBackup()) != null ? _a2 : ""), - pull: new Date((_b = this.localStorage.getLastAutoPull()) != null ? _b : ""), - push: new Date((_c = this.localStorage.getLastAutoPush()) != null ? _c : "") - }; - } - get useSimpleGit() { - return import_obsidian30.Platform.isDesktopApp; - } - async init() { - var _a2; - this.showNotices(); - try { - if (this.useSimpleGit) { - this.gitManager = new SimpleGit(this); - await this.gitManager.setGitInstance(); - } else { - this.gitManager = new IsomorphicGit(this); - } - const result = await this.gitManager.checkRequirements(); - switch (result) { - case "missing-git": - this.displayError("Cannot run git command"); - break; - case "missing-repo": - new import_obsidian30.Notice( - "Can't find a valid git repository. Please create one via the given command or clone an existing repo.", - 1e4 - ); - break; - case "valid": - this.gitReady = true; - this.setState(0 /* idle */); - this.openEvent = this.app.workspace.on( - "active-leaf-change", - (leaf) => this.handleViewActiveState(leaf) - ); - this.modifyEvent = this.app.vault.on("modify", () => { - this.debRefresh(); - }); - this.deleteEvent = this.app.vault.on("delete", () => { - this.debRefresh(); - }); - this.createEvent = this.app.vault.on("create", () => { - this.debRefresh(); - }); - this.renameEvent = this.app.vault.on("rename", () => { - this.debRefresh(); - }); - this.registerEvent(this.modifyEvent); - this.registerEvent(this.deleteEvent); - this.registerEvent(this.createEvent); - this.registerEvent(this.renameEvent); - (_a2 = this.branchBar) == null ? void 0 : _a2.display(); - this.lineAuthoringFeature.conditionallyActivateBySettings(); - dispatchEvent(new CustomEvent("git-refresh")); - if (this.settings.autoPullOnBoot) { - this.promiseQueue.addTask( - () => this.pullChangesFromRemote() - ); - } - this.setUpAutos(); - break; - default: - console.log( - "Something weird happened. The 'checkRequirements' result is " + result - ); - } - } catch (error) { - this.displayError(error); - console.error(error); - } - } - async createNewRepo() { - await this.gitManager.init(); - new import_obsidian30.Notice("Initialized new repo"); - await this.init(); - } - async cloneNewRepo() { - const modal = new GeneralModal({ placeholder: "Enter remote URL" }); - const url = await modal.open(); - if (url) { - const confirmOption = "Vault Root"; - let dir = await new GeneralModal({ - options: this.gitManager instanceof IsomorphicGit ? [confirmOption] : [], - placeholder: "Enter directory for clone. It needs to be empty or not existent.", - allowEmpty: this.gitManager instanceof IsomorphicGit - }).open(); - if (dir !== void 0) { - if (dir === confirmOption) { - dir = "."; - } - dir = (0, import_obsidian30.normalizePath)(dir); - if (dir === "/") { - dir = "."; - } - if (dir === ".") { - const modal2 = new GeneralModal({ - options: ["NO", "YES"], - placeholder: `Does your remote repo contain a ${app.vault.configDir} directory at the root?`, - onlySelection: true - }); - const containsConflictDir = await modal2.open(); - if (containsConflictDir === void 0) { - new import_obsidian30.Notice("Aborted clone"); - return; - } else if (containsConflictDir === "YES") { - const confirmOption2 = "DELETE ALL YOUR LOCAL CONFIG AND PLUGINS"; - const modal3 = new GeneralModal({ - options: ["Abort clone", confirmOption2], - placeholder: `To avoid conflicts, the local ${app.vault.configDir} directory needs to be deleted.`, - onlySelection: true - }); - const shouldDelete = await modal3.open() === confirmOption2; - if (shouldDelete) { - await this.app.vault.adapter.rmdir( - app.vault.configDir, - true - ); - } else { - new import_obsidian30.Notice("Aborted clone"); - return; - } - } - } - const depth = await new GeneralModal({ - placeholder: "Specify depth of clone. Leave empty for full clone.", - allowEmpty: true - }).open(); - let depthInt = void 0; - if (depth !== "") { - depthInt = parseInt(depth); - if (isNaN(depthInt)) { - new import_obsidian30.Notice("Invalid depth. Aborting clone."); - return; - } - } - new import_obsidian30.Notice(`Cloning new repo into "${dir}"`); - const oldBase = this.settings.basePath; - const customDir = dir && dir !== "."; - if (customDir) { - this.settings.basePath = dir; - } - try { - await this.gitManager.clone(url, dir, depthInt); - } catch (error) { - this.settings.basePath = oldBase; - this.saveSettings(); - throw error; - } - new import_obsidian30.Notice("Cloned new repo."); - new import_obsidian30.Notice("Please restart Obsidian"); - if (customDir) { - this.saveSettings(); - } - } - } - } - /** - * Retries to call `this.init()` if necessary, otherwise returns directly - * @returns true if `this.gitManager` is ready to be used, false if not. - */ - async isAllInitialized() { - if (!this.gitReady) { - await this.init(); - } - return this.gitReady; - } - ///Used for command - async pullChangesFromRemote() { - if (!await this.isAllInitialized()) - return; - const filesUpdated = await this.pull(); - this.setUpAutoBackup(); - if (!filesUpdated) { - this.displayMessage("Everything is up-to-date"); - } - if (this.gitManager instanceof SimpleGit) { - const status2 = await this.gitManager.status(); - if (status2.conflicted.length > 0) { - this.displayError( - `You have conflicts in ${status2.conflicted.length} ${status2.conflicted.length == 1 ? "file" : "files"}` - ); - this.handleConflict(status2.conflicted); - } - } - dispatchEvent(new CustomEvent("git-refresh")); - this.setState(0 /* idle */); - } - async createBackup(fromAutoBackup, requestCustomMessage = false, commitMessage) { - if (!await this.isAllInitialized()) - return; - if (this.settings.syncMethod == "reset" && this.settings.pullBeforePush) { - await this.pull(); - } - if (!await this.commit({ - fromAutoBackup, - requestCustomMessage, - commitMessage - })) - return; - if (!this.settings.disablePush) { - if (await this.gitManager.canPush()) { - if (this.settings.syncMethod != "reset" && this.settings.pullBeforePush) { - await this.pull(); - } - await this.push(); - } else { - this.displayMessage("No changes to push"); - } - } - this.setState(0 /* idle */); - } - // Returns true if commit was successfully - async commit({ - fromAutoBackup, - requestCustomMessage = false, - onlyStaged = false, - commitMessage - }) { - if (!await this.isAllInitialized()) - return false; - let hadConflict = this.localStorage.getConflict(); - let changedFiles; - let status2; - let unstagedFiles; - if (this.gitManager instanceof SimpleGit) { - this.mayDeleteConflictFile(); - status2 = await this.updateCachedStatus(); - if (status2.conflicted.length == 0) { - this.localStorage.setConflict(false); - hadConflict = false; - } - if (fromAutoBackup && status2.conflicted.length > 0) { - this.displayError( - `Did not commit, because you have conflicts in ${status2.conflicted.length} ${status2.conflicted.length == 1 ? "file" : "files"}. Please resolve them and commit per command.` - ); - this.handleConflict(status2.conflicted); - return false; - } - changedFiles = [...status2.changed, ...status2.staged]; - } else if (fromAutoBackup && hadConflict) { - this.setState(6 /* conflicted */); - this.displayError( - `Did not commit, because you have conflicts. Please resolve them and commit per command.` - ); - return false; - } else if (hadConflict) { - await this.mayDeleteConflictFile(); - status2 = await this.updateCachedStatus(); - changedFiles = [...status2.changed, ...status2.staged]; - } else { - if (onlyStaged) { - changedFiles = await this.gitManager.getStagedFiles(); - } else { - unstagedFiles = await this.gitManager.getUnstagedFiles(); - changedFiles = unstagedFiles.map(({ filepath }) => ({ - vault_path: this.gitManager.getVaultPath(filepath) - })); - } - } - if (await this.hasTooBigFiles(changedFiles)) { - this.setState(0 /* idle */); - return false; - } - if (changedFiles.length !== 0 || hadConflict) { - let cmtMessage = commitMessage != null ? commitMessage : commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage; - if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) { - if (!this.settings.disablePopups && fromAutoBackup) { - new import_obsidian30.Notice( - "Auto backup: Please enter a custom commit message. Leave empty to abort" - ); - } - const tempMessage = await new CustomMessageModal( - this, - true - ).open(); - if (tempMessage != void 0 && tempMessage != "" && tempMessage != "...") { - cmtMessage = tempMessage; - } else { - this.setState(0 /* idle */); - return false; - } - } - let committedFiles; - if (onlyStaged) { - committedFiles = await this.gitManager.commit(cmtMessage); - } else { - committedFiles = await this.gitManager.commitAll({ - message: cmtMessage, - status: status2, - unstagedFiles - }); - } - if (this.gitManager instanceof SimpleGit) { - if ((await this.updateCachedStatus()).conflicted.length == 0) { - this.localStorage.setConflict(false); - } - } - let roughly = false; - if (committedFiles === void 0) { - roughly = true; - committedFiles = changedFiles.length; - } - this.setUpAutoBackup(); - this.displayMessage( - `Committed${roughly ? " approx." : ""} ${committedFiles} ${committedFiles == 1 ? "file" : "files"}` - ); - } else { - this.displayMessage("No changes to commit"); - } - dispatchEvent(new CustomEvent("git-refresh")); - this.setState(0 /* idle */); - return true; - } - async hasTooBigFiles(files) { - const branchInfo = await this.gitManager.branchInfo(); - const remote = branchInfo.tracking ? splitRemoteBranch(branchInfo.tracking)[0] : null; - if (remote) { - const remoteUrl = await this.gitManager.getRemoteUrl(remote); - if (remoteUrl == null ? void 0 : remoteUrl.includes("github.com")) { - const tooBigFiles = files.filter((f) => { - const file = this.app.vault.getAbstractFileByPath( - f.vault_path - ); - if (file instanceof import_obsidian30.TFile) { - return file.stat.size >= 1e8; - } - return false; - }); - if (tooBigFiles.length > 0) { - this.displayError( - `Did not commit, because following files are too big: ${tooBigFiles.map( - (e) => e.vault_path - )}. Please remove them.` - ); - return true; - } - } - } - return false; - } - async push() { - if (!await this.isAllInitialized()) - return false; - if (!await this.remotesAreSet()) { - return false; - } - const hadConflict = this.localStorage.getConflict(); - if (this.gitManager instanceof SimpleGit) - await this.mayDeleteConflictFile(); - let status2; - if (this.gitManager instanceof SimpleGit && (status2 = await this.updateCachedStatus()).conflicted.length > 0) { - this.displayError( - `Cannot push. You have conflicts in ${status2.conflicted.length} ${status2.conflicted.length == 1 ? "file" : "files"}` - ); - this.handleConflict(status2.conflicted); - return false; - } else if (this.gitManager instanceof IsomorphicGit && hadConflict) { - this.displayError(`Cannot push. You have conflicts`); - this.setState(6 /* conflicted */); - return false; - } - { - console.log("Pushing...."); - const pushedFiles = await this.gitManager.push(); - console.log("Pushed!", pushedFiles); - if (pushedFiles > 0) { - this.displayMessage( - `Pushed ${pushedFiles} ${pushedFiles == 1 ? "file" : "files"} to remote` - ); - } else { - this.displayMessage(`No changes to push`); - } - this.offlineMode = false; - this.setState(0 /* idle */); - dispatchEvent(new CustomEvent("git-refresh")); - return true; - } - } - /// Used for internals - /// Returns whether the pull added a commit or not. - async pull() { - if (!await this.remotesAreSet()) { - return false; - } - const pulledFiles = await this.gitManager.pull() || []; - this.offlineMode = false; - if (pulledFiles.length > 0) { - this.displayMessage( - `Pulled ${pulledFiles.length} ${pulledFiles.length == 1 ? "file" : "files"} from remote` - ); - this.lastPulledFiles = pulledFiles; - } - return pulledFiles.length != 0; - } - async fetch() { - if (!await this.remotesAreSet()) { - return; - } - await this.gitManager.fetch(); - this.displayMessage(`Fetched from remote`); - this.offlineMode = false; - dispatchEvent(new CustomEvent("git-refresh")); - } - async mayDeleteConflictFile() { - const file = this.app.vault.getAbstractFileByPath( - this.conflictOutputFile - ); - if (file) { - this.app.workspace.iterateAllLeaves((leaf) => { - var _a2; - if (leaf.view instanceof import_obsidian30.MarkdownView && ((_a2 = leaf.view.file) == null ? void 0 : _a2.path) == file.path) { - leaf.detach(); - } - }); - await this.app.vault.delete(file); - } - } - async stageFile(file) { - if (!await this.isAllInitialized()) - return false; - await this.gitManager.stage(file.path, true); - this.displayMessage(`Staged ${file.path}`); - dispatchEvent(new CustomEvent("git-refresh")); - this.setState(0 /* idle */); - return true; - } - async unstageFile(file) { - if (!await this.isAllInitialized()) - return false; - await this.gitManager.unstage(file.path, true); - this.displayMessage(`Unstaged ${file.path}`); - dispatchEvent(new CustomEvent("git-refresh")); - this.setState(0 /* idle */); - return true; - } - async switchBranch() { - var _a2; - if (!await this.isAllInitialized()) - return; - const branchInfo = await this.gitManager.branchInfo(); - const selectedBranch = await new BranchModal( - branchInfo.branches - ).open(); - if (selectedBranch != void 0) { - await this.gitManager.checkout(selectedBranch); - this.displayMessage(`Switched to ${selectedBranch}`); - (_a2 = this.branchBar) == null ? void 0 : _a2.display(); - return selectedBranch; - } - } - async switchRemoteBranch() { - var _a2; - if (!await this.isAllInitialized()) - return; - const selectedBranch = await this.selectRemoteBranch() || ""; - const [remote, branch2] = splitRemoteBranch(selectedBranch); - if (branch2 != void 0 && remote != void 0) { - await this.gitManager.checkout(branch2, remote); - this.displayMessage(`Switched to ${selectedBranch}`); - (_a2 = this.branchBar) == null ? void 0 : _a2.display(); - return selectedBranch; - } - } - async createBranch() { - var _a2; - if (!await this.isAllInitialized()) - return; - const newBranch = await new GeneralModal({ - placeholder: "Create new branch" - }).open(); - if (newBranch != void 0) { - await this.gitManager.createBranch(newBranch); - this.displayMessage(`Created new branch ${newBranch}`); - (_a2 = this.branchBar) == null ? void 0 : _a2.display(); - return newBranch; - } - } - async deleteBranch() { - var _a2; - if (!await this.isAllInitialized()) - return; - const branchInfo = await this.gitManager.branchInfo(); - if (branchInfo.current) - branchInfo.branches.remove(branchInfo.current); - const branch2 = await new GeneralModal({ - options: branchInfo.branches, - placeholder: "Delete branch", - onlySelection: true - }).open(); - if (branch2 != void 0) { - let force = false; - const merged = await this.gitManager.branchIsMerged(branch2); - if (!merged) { - const forceAnswer = await new GeneralModal({ - options: ["YES", "NO"], - placeholder: "This branch isn't merged into HEAD. Force delete?", - onlySelection: true - }).open(); - if (forceAnswer !== "YES") { - return; - } - force = forceAnswer === "YES"; - } - await this.gitManager.deleteBranch(branch2, force); - this.displayMessage(`Deleted branch ${branch2}`); - (_a2 = this.branchBar) == null ? void 0 : _a2.display(); - return branch2; - } - } - async remotesAreSet() { - if (!(await this.gitManager.branchInfo()).tracking) { - new import_obsidian30.Notice("No upstream branch is set. Please select one."); - const remoteBranch = await this.selectRemoteBranch(); - if (remoteBranch == void 0) { - this.displayError("Aborted. No upstream-branch is set!", 1e4); - this.setState(0 /* idle */); - return false; - } else { - await this.gitManager.updateUpstreamBranch(remoteBranch); - return true; - } - } - return true; - } - async setUpAutoBackup() { - if (this.settings.setLastSaveToLastCommit) { - this.clearAutoBackup(); - const lastCommitDate = await this.gitManager.getLastCommitTime(); - if (lastCommitDate) { - this.localStorage.setLastAutoBackup(lastCommitDate.toString()); - } - } - if (!this.timeoutIDBackup && !this.onFileModifyEventRef) { - const lastAutos = this.loadLastAuto(); - if (this.settings.autoSaveInterval > 0) { - const now2 = /* @__PURE__ */ new Date(); - const diff2 = this.settings.autoSaveInterval - Math.round( - (now2.getTime() - lastAutos.backup.getTime()) / 1e3 / 60 - ); - this.startAutoBackup(diff2 <= 0 ? 0 : diff2); - } - } - } - async setUpAutos() { - this.setUpAutoBackup(); - const lastAutos = this.loadLastAuto(); - if (this.settings.differentIntervalCommitAndPush && this.settings.autoPushInterval > 0) { - const now2 = /* @__PURE__ */ new Date(); - const diff2 = this.settings.autoPushInterval - Math.round( - (now2.getTime() - lastAutos.push.getTime()) / 1e3 / 60 - ); - this.startAutoPush(diff2 <= 0 ? 0 : diff2); - } - if (this.settings.autoPullInterval > 0) { - const now2 = /* @__PURE__ */ new Date(); - const diff2 = this.settings.autoPullInterval - Math.round( - (now2.getTime() - lastAutos.pull.getTime()) / 1e3 / 60 - ); - this.startAutoPull(diff2 <= 0 ? 0 : diff2); - } - } - async discardAll() { - await this.gitManager.discardAll({ - status: this.cachedStatus - }); - new import_obsidian30.Notice( - "All local changes have been discarded. New files remain untouched." - ); - } - clearAutos() { - this.clearAutoBackup(); - this.clearAutoPush(); - this.clearAutoPull(); - } - startAutoBackup(minutes) { - let time = (minutes != null ? minutes : this.settings.autoSaveInterval) * 6e4; - if (this.settings.autoBackupAfterFileChange) { - if (minutes === 0) { - this.doAutoBackup(); - } else { - this.onFileModifyEventRef = this.app.vault.on( - "modify", - () => this.autoBackupDebouncer() - ); - this.autoBackupDebouncer = (0, import_obsidian30.debounce)( - () => this.doAutoBackup(), - time, - true - ); - } - } else { - if (time > 2147483647) - time = 2147483647; - this.timeoutIDBackup = window.setTimeout( - () => this.doAutoBackup(), - time - ); - } - } - // This is used for both auto backup and commit - doAutoBackup() { - this.promiseQueue.addTask(() => { - if (this.settings.differentIntervalCommitAndPush) { - return this.commit({ fromAutoBackup: true }); - } else { - return this.createBackup(true); - } - }); - this.saveLastAuto(/* @__PURE__ */ new Date(), "backup"); - this.saveSettings(); - this.startAutoBackup(); - } - startAutoPull(minutes) { - let time = (minutes != null ? minutes : this.settings.autoPullInterval) * 6e4; - if (time > 2147483647) - time = 2147483647; - this.timeoutIDPull = window.setTimeout(() => { - this.promiseQueue.addTask(() => this.pullChangesFromRemote()); - this.saveLastAuto(/* @__PURE__ */ new Date(), "pull"); - this.saveSettings(); - this.startAutoPull(); - }, time); - } - startAutoPush(minutes) { - let time = (minutes != null ? minutes : this.settings.autoPushInterval) * 6e4; - if (time > 2147483647) - time = 2147483647; - this.timeoutIDPush = window.setTimeout(() => { - this.promiseQueue.addTask(() => this.push()); - this.saveLastAuto(/* @__PURE__ */ new Date(), "push"); - this.saveSettings(); - this.startAutoPush(); - }, time); - } - clearAutoBackup() { - var _a2; - let wasActive = false; - if (this.timeoutIDBackup) { - window.clearTimeout(this.timeoutIDBackup); - this.timeoutIDBackup = void 0; - wasActive = true; - } - if (this.onFileModifyEventRef) { - (_a2 = this.autoBackupDebouncer) == null ? void 0 : _a2.cancel(); - this.app.vault.offref(this.onFileModifyEventRef); - this.onFileModifyEventRef = void 0; - wasActive = true; - } - return wasActive; - } - clearAutoPull() { - if (this.timeoutIDPull) { - window.clearTimeout(this.timeoutIDPull); - this.timeoutIDPull = void 0; - return true; - } - return false; - } - clearAutoPush() { - if (this.timeoutIDPush) { - window.clearTimeout(this.timeoutIDPush); - this.timeoutIDPush = void 0; - return true; - } - return false; - } - async handleConflict(conflicted) { - this.setState(6 /* conflicted */); - this.localStorage.setConflict(true); - let lines; - if (conflicted !== void 0) { - lines = [ - "# Conflicts", - "Please resolve them and commit them using the commands `Obsidian Git: Commit all changes` followed by `Obsidian Git: Push`", - "(This file will automatically be deleted before commit)", - "[[#Additional Instructions]] available below file list", - "", - ...conflicted.map((e) => { - const file = this.app.vault.getAbstractFileByPath(e); - if (file instanceof import_obsidian30.TFile) { - const link = this.app.metadataCache.fileToLinktext( - file, - "/" - ); - return `- [[${link}]]`; - } else { - return `- Not a file: ${e}`; - } - }), - ` +@@ -0,0 +1,${a.split(` +`).length} @@`.split(` +`),...a.split(` +`).map(o=>`+${o}`)].join(` +`)}}if(r){let a=this.parser.parseFromString(qE(r),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(a)}else{let a=this.contentEl.createDiv({cls:"obsidian-git-center"});a.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),a.createEl("br"),a.createSpan({text:"File not found: "+this.state.file})}}finally{this.gettingDiff=!1}}}};v();var Ak=require("obsidian");v();v();v();v();function ke(){}var eo=t=>t;function Up(t){return t()}function qc(){return Object.create(null)}function Ae(t){t.forEach(Up)}function ya(t){return typeof t=="function"}function it(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function XE(t){return Object.keys(t).length===0}v();var YE=typeof window!="undefined",zp=YE?()=>window.performance.now():()=>Date.now(),to=YE?t=>requestAnimationFrame(t):ke;v();var va=new Set;function ZE(t){va.forEach(e=>{e.c(t)||(va.delete(e),e.f())}),va.size!==0&&to(ZE)}function Gp(t){let e;return va.size===0&&to(ZE),{promise:new Promise(n=>{va.add(e={c:t,f:n})}),abort(){va.delete(e)}}}v();v();v();v();var Vp=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var Xc=class t{constructor(e){ct(this,"_listeners","WeakMap"in Vp?new WeakMap:void 0);ct(this,"_observer");ct(this,"options");this.options=e}observe(e,n){return this._listeners.set(e,n),this._getObserver().observe(e,this.options),()=>{this._listeners.delete(e),this._observer.unobserve(e)}}_getObserver(){var e;return(e=this._observer)!=null?e:this._observer=new ResizeObserver(n=>{var r;for(let i of n)t.entries.set(i.target,i),(r=this._listeners.get(i.target))==null||r(i)})}};Xc.entries="WeakMap"in Vp?new WeakMap:void 0;var KE=!1;function JE(){KE=!0}function QE(){KE=!1}function O(t,e){t.appendChild(e)}function Nt(t,e,n){let r=Yc(t);if(!r.getElementById(e)){let i=I("style");i.id=e,i.textContent=n,tk(r,i)}}function Yc(t){if(!t)return document;let e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function ek(t){let e=I("style");return e.textContent="/* empty */",tk(Yc(t),e),e.sheet}function tk(t,e){return O(t.head||t,e),e.sheet}function re(t,e,n){t.insertBefore(e,n||null)}function ne(t){t.parentNode&&t.parentNode.removeChild(t)}function ln(t,e){for(let n=0;nt.removeEventListener(e,n,r)}function xe(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function T(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function nk(t){return Array.from(t.childNodes)}function Oe(t,e){e=""+e,t.data!==e&&(t.data=e)}function Wp(t,e){t.value=e==null?"":e}function Yt(t,e,n,r){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function ce(t,e,n){t.classList.toggle(e,!!n)}function Zc(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}function rk(t){let e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}var Kc=new Map,Jc=0;function ej(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function tj(t,e){let n={stylesheet:ek(e),rules:{}};return Kc.set(t,n),n}function Qc(t,e,n,r,i,a,s,o=0){let l=16.666/r,c=`{ +`;for(let m=0;m<=1;m+=l){let w=e+(n-e)*a(m);c+=m*100+`%{${s(w,1-w)}} +`}let u=c+`100% {${s(n,1-n)}} +}`,f=`__svelte_${ej(u)}_${o}`,h=Yc(t),{stylesheet:d,rules:p}=Kc.get(h)||tj(h,t);p[f]||(p[f]=!0,d.insertRule(`@keyframes ${f} ${u}`,d.cssRules.length));let g=t.style.animation||"";return t.style.animation=`${g?`${g}, `:""}${f} ${r}ms linear ${i}ms 1 both`,Jc+=1,f}function qp(t,e){let n=(t.style.animation||"").split(", "),r=n.filter(e?a=>a.indexOf(e)<0:a=>a.indexOf("__svelte")===-1),i=n.length-r.length;i&&(t.style.animation=r.join(", "),Jc-=i,Jc||nj())}function nj(){to(()=>{Jc||(Kc.forEach(t=>{let{ownerNode:e}=t.stylesheet;e&&ne(e)}),Kc.clear())})}v();v();v();v();var Sr;function Yn(t){Sr=t}function ik(){if(!Sr)throw new Error("Function called outside component initialization");return Sr}function no(t){ik().$$.on_destroy.push(t)}function Er(t,e){let n=t.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}var ai=[];var je=[],xa=[],ak=[],rj=Promise.resolve(),Yp=!1;function sk(){Yp||(Yp=!0,rj.then(eu))}function wt(t){xa.push(t)}var Xp=new Set,ba=0;function eu(){if(ba!==0)return;let t=Sr;do{try{for(;bat.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),xa=e}var ro;function aj(){return ro||(ro=Promise.resolve(),ro.then(()=>{ro=null})),ro}function Zp(t,e,n){t.dispatchEvent(Zc(`${e?"intro":"outro"}${n}`))}var tu=new Set,Zn;function Ce(){Zn={r:0,c:[],p:Zn}}function Fe(){Zn.r||Ae(Zn.c),Zn=Zn.p}function U(t,e){t&&t.i&&(tu.delete(t),t.i(e))}function X(t,e,n,r){if(t&&t.o){if(tu.has(t))return;tu.add(t),Zn.c.push(()=>{tu.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}var sj={duration:0};function bt(t,e,n,r){let a=e(t,n,{direction:"both"}),s=r?0:1,o=null,l=null,c=null,u;function f(){c&&qp(t,c)}function h(p,g){let m=p.b-s;return g*=Math.abs(m),{a:s,b:p.b,d:m,duration:g,start:p.start,end:p.start+g,group:p.group}}function d(p){let{delay:g=0,duration:m=300,easing:w=eo,tick:b=ke,css:S}=a||sj,k={start:zp()+g,b:p};p||(k.group=Zn,Zn.r+=1),"inert"in t&&(p?u!==void 0&&(t.inert=u):(u=t.inert,t.inert=!0)),o||l?l=k:(S&&(f(),c=Qc(t,s,p,m,g,w,S)),p&&b(0,1),o=h(k,m),wt(()=>Zp(t,p,"start")),Gp(x=>{if(l&&x>l.start&&(o=h(l,m),l=null,Zp(t,o.b,"start"),S&&(f(),c=Qc(t,s,o.b,o.duration,0,w,a.css))),o){if(x>=o.end)b(s=o.b,1-s),Zp(t,o.b,"end"),l||(o.b?f():--o.group.r||Ae(o.group.c)),o=null;else if(x>=o.start){let A=x-o.start;s=o.a+o.d*w(A/o.duration),b(s,1-s)}}return!!(o||l)}))}return{run(p){ya(a)?aj().then(()=>{a=a({direction:p?"in":"out"}),d(p)}):d(p)},end(){f(),o=l=null}}}v();function tt(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}v();v();v();var oj=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],lj=new Set([...oj]);v();v();v();function He(t){t&&t.c()}function De(t,e,n){let{fragment:r,after_update:i}=t.$$;r&&r.m(e,n),wt(()=>{let a=t.$$.on_mount.map(Up).filter(ya);t.$$.on_destroy?t.$$.on_destroy.push(...a):Ae(a),t.$$.on_mount=[]}),i.forEach(wt)}function Be(t,e){let n=t.$$;n.fragment!==null&&(ok(n.after_update),Ae(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function uj(t,e){t.$$.dirty[0]===-1&&(ai.push(t),sk(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{let p=d.length?d[0]:h;return c.ctx&&i(c.ctx[f],c.ctx[f]=p)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](p),u&&uj(t,f)),h}):[],c.update(),u=!0,Ae(c.before_update),c.fragment=r?r(c.ctx):!1,e.target){if(e.hydrate){JE();let f=nk(e.target);c.fragment&&c.fragment.l(f),f.forEach(ne)}else c.fragment&&c.fragment.c();e.intro&&U(t.$$.fragment),De(t,e.target,e.anchor),QE(),eu()}Yn(l)}var fj;typeof HTMLElement=="function"&&(fj=class extends HTMLElement{constructor(e,n,r){super();ct(this,"$$ctor");ct(this,"$$s");ct(this,"$$c");ct(this,"$$cn",!1);ct(this,"$$d",{});ct(this,"$$r",!1);ct(this,"$$p_d",{});ct(this,"$$l",{});ct(this,"$$l_u",new Map);this.$$ctor=e,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(e,n,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(n),this.$$c){let i=this.$$c.$on(e,n);this.$$l_u.set(n,i)}super.addEventListener(e,n,r)}removeEventListener(e,n,r){if(super.removeEventListener(e,n,r),this.$$c){let i=this.$$l_u.get(n);i&&(i(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(a){return()=>{let s;return{c:function(){s=I("slot"),a!=="default"&&T(s,"name",a)},m:function(c,u){re(c,s,u)},d:function(c){c&&ne(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let n={},r=rk(this);for(let a of this.$$s)a in r&&(n[a]=[e(a)]);for(let a of this.attributes){let s=this.$$g_p(a.name);s in this.$$d||(this.$$d[s]=Kp(s,a.value,this.$$p_d,"toProp"))}for(let a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});let i=()=>{this.$$r=!0;for(let a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){let s=Kp(a,this.$$d[a],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,s)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(let a in this.$$l)for(let s of this.$$l[a]){let o=this.$$c.$on(a,s);this.$$l_u.set(s,o)}this.$$l={}}}attributeChangedCallback(e,n,r){var i;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Kp(e,r,this.$$p_d,"toProp"),(i=this.$$c)==null||i.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(e){return Object.keys(this.$$p_d).find(n=>this.$$p_d[n].attribute===e||!this.$$p_d[n].attribute&&n.toLowerCase()===e)||e}});function Kp(t,e,n,r){var a;let i=(a=n[t])==null?void 0:a.type;if(e=i==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(i){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(i){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}var Ve=class{constructor(){ct(this,"$$");ct(this,"$$set")}$destroy(){Be(this,1),this.$destroy=ke}$on(e,n){if(!ya(n))return ke;let r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{let i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!XE(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}};v();v();var lk="4";v();typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(lk);v();function _a(t,e,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(t,e||[])).next())})}var iu=require("obsidian");v();v();var io=require("obsidian");v();v();function ck(t){let e=t-1;return e*e*e+1}function xt(t,{delay:e=0,duration:n=400,easing:r=ck,axis:i="y"}={}){let a=getComputedStyle(t),s=+a.opacity,o=i==="y"?"height":"width",l=parseFloat(a[o]),c=i==="y"?["top","bottom"]:["left","right"],u=c.map(w=>`${w[0].toUpperCase()}${w.slice(1)}`),f=parseFloat(a[`padding${u[0]}`]),h=parseFloat(a[`padding${u[1]}`]),d=parseFloat(a[`margin${u[0]}`]),p=parseFloat(a[`margin${u[1]}`]),g=parseFloat(a[`border${u[0]}Width`]),m=parseFloat(a[`border${u[1]}Width`]);return{delay:e,duration:n,easing:r,css:w=>`overflow: hidden;opacity: ${Math.min(w*20,1)*s};${o}: ${w*l}px;padding-${c[0]}: ${w*f}px;padding-${c[1]}: ${w*h}px;margin-${c[0]}: ${w*d}px;margin-${c[1]}: ${w*p}px;border-${c[0]}-width: ${w*g}px;border-${c[1]}-width: ${w*m}px;`}}v();var Sa=require("obsidian");function hj(t){Nt(t,"svelte-1wbh8tp","main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}")}function uk(t){let e,n,r;return{c(){e=I("div"),T(e,"data-icon","go-to-file"),T(e,"aria-label","Open File"),T(e,"class","clickable-icon")},m(i,a){re(i,e,a),t[7](e),n||(r=[te(e,"auxclick",xe(t[4])),te(e,"click",xe(t[4]))],n=!0)},p:ke,d(i){i&&ne(e),t[7](null),n=!1,Ae(r)}}}function dj(t){let e,n,r,i=Bt(t[0].vault_path)+"",a,s,o,l,c=t[1].app.vault.getAbstractFileByPath(t[0].vault_path)instanceof Sa.TFile,u,f,h=t[0].status+"",d,p,g,m,w,b,S=c&&uk(t);return{c(){var k,x;e=I("main"),n=I("div"),r=I("div"),a=Te(i),s=J(),o=I("div"),l=I("div"),S&&S.c(),u=J(),f=I("span"),d=Te(h),T(r,"class","tree-item-inner nav-file-title-content"),T(l,"class","buttons"),T(f,"class","type"),T(f,"data-type",p=t[0].status),T(o,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-file-title svelte-1wbh8tp"),T(n,"data-path",g=t[0].vault_path),T(n,"data-tooltip-position",t[3]),T(n,"aria-label",m=t[0].vault_path),ce(n,"is-active",((k=t[1].plugin.lastDiffViewState)==null?void 0:k.file)==t[0].vault_path&&((x=t[1].plugin.lastDiffViewState)==null?void 0:x.hash)),T(e,"class","tree-item nav-file svelte-1wbh8tp")},m(k,x){re(k,e,x),O(e,n),O(n,r),O(r,a),O(n,s),O(n,o),O(o,l),S&&S.m(l,null),O(o,u),O(o,f),O(f,d),w||(b=[te(e,"click",xe(t[5])),te(e,"auxclick",xe(t[8])),te(e,"focus",t[6])],w=!0)},p(k,[x]){var A,y;x&1&&i!==(i=Bt(k[0].vault_path)+"")&&Oe(a,i),x&3&&(c=k[1].app.vault.getAbstractFileByPath(k[0].vault_path)instanceof Sa.TFile),c?S?S.p(k,x):(S=uk(k),S.c(),S.m(l,null)):S&&(S.d(1),S=null),x&1&&h!==(h=k[0].status+"")&&Oe(d,h),x&1&&p!==(p=k[0].status)&&T(f,"data-type",p),x&1&&g!==(g=k[0].vault_path)&&T(n,"data-path",g),x&8&&T(n,"data-tooltip-position",k[3]),x&1&&m!==(m=k[0].vault_path)&&T(n,"aria-label",m),x&3&&ce(n,"is-active",((A=k[1].plugin.lastDiffViewState)==null?void 0:A.file)==k[0].vault_path&&((y=k[1].plugin.lastDiffViewState)==null?void 0:y.hash))},i:ke,o:ke,d(k){k&&ne(e),S&&S.d(),w=!1,Ae(b)}}}function pj(t,e,n){let r,{diff:i}=e,{view:a}=e,s=[];window.setTimeout(()=>s.forEach(h=>(0,Sa.setIcon)(h,h.getAttr("data-icon"))),0);function o(h){var d;let p=a.app.vault.getAbstractFileByPath(i.vault_path);p instanceof Sa.TFile&&((d=Xt(a.app,h))===null||d===void 0||d.openFile(p).catch(g=>a.plugin.displayError(g)))}function l(h){var d;(d=Xt(a.app,h))===null||d===void 0||d.setViewState({type:Ct.type,active:!0,state:{file:i.path,staged:!1,hash:i.hash}})}function c(h){Er.call(this,t,h)}function u(h){je[h?"unshift":"push"](()=>{s[0]=h,n(2,s)})}let f=h=>{h.button==2?In(a.app,h,i.vault_path,a.leaf,"git-history"):l(h)};return t.$$set=h=>{"diff"in h&&n(0,i=h.diff),"view"in h&&n(1,a=h.view)},t.$$.update=()=>{t.$$.dirty&2&&n(3,r=a.leaf.getRoot().side=="left"?"right":"left")},[i,a,s,r,o,l,c,u,f]}var Jp=class extends Ve{constructor(e){super(),at(this,e,pj,dj,it,{diff:0,view:1},hj)}},nu=Jp;v();function mj(t){Nt(t,"svelte-1lnl15d","main.svelte-1lnl15d .nav-folder-title-content.svelte-1lnl15d{display:flex;align-items:center}")}function fk(t,e,n){let r=t.slice();return r[8]=e[n],r}function gj(t){let e,n,r,i,a,s,o,l=t[8].title+"",c,u,f,h,d,p,g;function m(){return t[7](t[8])}let w=!t[4][t[8].title]&&hk(t);return{c(){e=I("div"),n=I("div"),r=I("div"),i=J(),a=I("div"),a.innerHTML='',s=J(),o=I("div"),c=Te(l),f=J(),w&&w.c(),h=J(),T(r,"data-icon","folder"),Yt(r,"padding-right","5px"),Yt(r,"display","flex"),T(a,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(a,"is-collapsed",t[4][t[8].title]),T(o,"class","tree-item-inner nav-folder-title-content svelte-1lnl15d"),T(n,"class","tree-item-self is-clickable nav-folder-title"),T(n,"data-tooltip-position",t[5]),T(n,"aria-label",u=t[8].vaultPath),T(e,"class","tree-item nav-folder"),ce(e,"is-collapsed",t[4][t[8].title])},m(b,S){re(b,e,S),O(e,n),O(n,r),O(n,i),O(n,a),O(n,s),O(n,o),O(o,c),O(e,f),w&&w.m(e,null),O(e,h),d=!0,p||(g=te(n,"click",m),p=!0)},p(b,S){t=b,(!d||S&17)&&ce(a,"is-collapsed",t[4][t[8].title]),(!d||S&1)&&l!==(l=t[8].title+"")&&Oe(c,l),(!d||S&32)&&T(n,"data-tooltip-position",t[5]),(!d||S&1&&u!==(u=t[8].vaultPath))&&T(n,"aria-label",u),t[4][t[8].title]?w&&(Ce(),X(w,1,1,()=>{w=null}),Fe()):w?(w.p(t,S),S&17&&U(w,1)):(w=hk(t),w.c(),U(w,1),w.m(e,h)),(!d||S&17)&&ce(e,"is-collapsed",t[4][t[8].title])},i(b){d||(U(w),d=!0)},o(b){X(w),d=!1},d(b){b&&ne(e),w&&w.d(),p=!1,g()}}}function yj(t){let e,n,r,i;return n=new nu({props:{diff:t[8].data,view:t[2]}}),{c(){e=I("div"),He(n.$$.fragment),r=J()},m(a,s){re(a,e,s),De(n,e,null),O(e,r),i=!0},p(a,s){let o={};s&1&&(o.diff=a[8].data),s&4&&(o.view=a[2]),n.$set(o)},i(a){i||(U(n.$$.fragment,a),i=!0)},o(a){X(n.$$.fragment,a),i=!1},d(a){a&&ne(e),Be(n)}}}function hk(t){let e,n,r,i;return n=new ru({props:{hierarchy:t[8],plugin:t[1],view:t[2]}}),{c(){e=I("div"),He(n.$$.fragment),T(e,"class","tree-item-children nav-folder-children")},m(a,s){re(a,e,s),De(n,e,null),i=!0},p(a,s){let o={};s&1&&(o.hierarchy=a[8]),s&2&&(o.plugin=a[1]),s&4&&(o.view=a[2]),n.$set(o)},i(a){i||(U(n.$$.fragment,a),a&&wt(()=>{i&&(r||(r=bt(e,xt,{duration:150},!0)),r.run(1))}),i=!0)},o(a){X(n.$$.fragment,a),a&&(r||(r=bt(e,xt,{duration:150},!1)),r.run(0)),i=!1},d(a){a&&ne(e),Be(n),a&&r&&r.end()}}}function dk(t){let e,n,r,i,a=[yj,gj],s=[];function o(l,c){return l[8].data?0:1}return e=o(t,-1),n=s[e]=a[e](t),{c(){n.c(),r=wa()},m(l,c){s[e].m(l,c),re(l,r,c),i=!0},p(l,c){let u=e;e=o(l,c),e===u?s[e].p(l,c):(Ce(),X(s[u],1,1,()=>{s[u]=null}),Fe(),n=s[e],n?n.p(l,c):(n=s[e]=a[e](l),n.c()),U(n,1),n.m(r.parentNode,r))},i(l){i||(U(n),i=!0)},o(l){X(n),i=!1},d(l){l&&ne(r),s[e].d(l)}}}function vj(t){let e,n,r=tt(t[0].children),i=[];for(let s=0;sX(i[s],1,1,()=>{i[s]=null});return{c(){e=I("main");for(let s=0;sc(f);return t.$$set=f=>{"hierarchy"in f&&n(0,i=f.hierarchy),"plugin"in f&&n(1,a=f.plugin),"view"in f&&n(2,s=f.view),"topLevel"in f&&n(3,o=f.topLevel)},t.$$.update=()=>{t.$$.dirty&4&&n(5,r=s.leaf.getRoot().side=="left"?"right":"left")},[i,a,s,o,l,r,c,u]}var ru=class extends Ve{constructor(e){super(),at(this,e,wj,vj,it,{hierarchy:0,plugin:1,view:2,topLevel:3},mj)}},pk=ru;function mk(t,e,n){let r=t.slice();return r[9]=e[n],r}function gk(t){let e,n=t[0].refs.join(", ")+"",r;return{c(){e=I("div"),r=Te(n),T(e,"class","git-ref")},m(i,a){re(i,e,a),O(e,r)},p(i,a){a&1&&n!==(n=i[0].refs.join(", ")+"")&&Oe(r,n)},d(i){i&&ne(e)}}}function yk(t){let e,n=t[7](t[0])+"",r;return{c(){e=I("div"),r=Te(n),T(e,"class","git-author")},m(i,a){re(i,e,a),O(e,r)},p(i,a){a&1&&n!==(n=i[7](i[0])+"")&&Oe(r,n)},d(i){i&&ne(e)}}}function vk(t){let e,n=(0,io.moment)(t[0].date).format(t[3].settings.commitDateFormat)+"",r;return{c(){e=I("div"),r=Te(n),T(e,"class","git-date")},m(i,a){re(i,e,a),O(e,r)},p(i,a){a&9&&n!==(n=(0,io.moment)(i[0].date).format(i[3].settings.commitDateFormat)+"")&&Oe(r,n)},d(i){i&&ne(e)}}}function wk(t){let e,n,r,i,a,s=[xj,bj],o=[];function l(c,u){return c[2]?0:1}return n=l(t,-1),r=o[n]=s[n](t),{c(){e=I("div"),r.c(),T(e,"class","tree-item-children nav-folder-children")},m(c,u){re(c,e,u),o[n].m(e,null),a=!0},p(c,u){let f=n;n=l(c,u),n===f?o[n].p(c,u):(Ce(),X(o[f],1,1,()=>{o[f]=null}),Fe(),r=o[n],r?r.p(c,u):(r=o[n]=s[n](c),r.c()),U(r,1),r.m(e,null))},i(c){a||(U(r),c&&wt(()=>{a&&(i||(i=bt(e,xt,{duration:150},!0)),i.run(1))}),a=!0)},o(c){X(r),c&&(i||(i=bt(e,xt,{duration:150},!1)),i.run(0)),a=!1},d(c){c&&ne(e),o[n].d(),c&&i&&i.end()}}}function bj(t){let e,n,r=tt(t[0].diff.files),i=[];for(let s=0;sX(i[s],1,1,()=>{i[s]=null});return{c(){for(let s=0;s0&&gk(t),S=t[3].settings.authorInHistoryView!="hide"&&((A=t[0].author)==null?void 0:A.name)&&yk(t),k=t[3].settings.dateInHistoryView&&vk(t),x=!t[4]&&wk(t);return{c(){var y;e=I("main"),n=I("div"),r=I("div"),i=I("div"),i.innerHTML='',a=J(),s=I("div"),b&&b.c(),o=J(),S&&S.c(),l=J(),k&&k.c(),c=J(),u=I("div"),h=Te(f),p=J(),x&&x.c(),T(i,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(i,"is-collapsed",t[4]),T(u,"class","tree-item-inner nav-folder-title-content"),T(r,"class","tree-item-self is-clickable nav-folder-title"),T(r,"aria-label",d=`${t[0].refs.length>0?t[0].refs.join(", ")+` +`:""}${(y=t[0].author)==null?void 0:y.name} +${(0,io.moment)(t[0].date).format(t[3].settings.commitDateFormat)} +${t[0].message}`),T(r,"data-tooltip-position",t[5]),T(n,"class","tree-item nav-folder"),ce(n,"is-collapsed",t[4])},m(y,E){re(y,e,E),O(e,n),O(n,r),O(r,i),O(r,a),O(r,s),b&&b.m(s,null),O(s,o),S&&S.m(s,null),O(s,l),k&&k.m(s,null),O(s,c),O(s,u),O(u,h),O(n,p),x&&x.m(n,null),g=!0,m||(w=te(r,"click",t[8]),m=!0)},p(y,[E]){var _,C;(!g||E&16)&&ce(i,"is-collapsed",y[4]),y[0].refs.length>0?b?b.p(y,E):(b=gk(y),b.c(),b.m(s,o)):b&&(b.d(1),b=null),y[3].settings.authorInHistoryView!="hide"&&((_=y[0].author)!=null&&_.name)?S?S.p(y,E):(S=yk(y),S.c(),S.m(s,l)):S&&(S.d(1),S=null),y[3].settings.dateInHistoryView?k?k.p(y,E):(k=vk(y),k.c(),k.m(s,c)):k&&(k.d(1),k=null),(!g||E&1)&&f!==(f=y[0].message+"")&&Oe(h,f),(!g||E&9&&d!==(d=`${y[0].refs.length>0?y[0].refs.join(", ")+` +`:""}${(C=y[0].author)==null?void 0:C.name} +${(0,io.moment)(y[0].date).format(y[3].settings.commitDateFormat)} +${y[0].message}`))&&T(r,"aria-label",d),(!g||E&32)&&T(r,"data-tooltip-position",y[5]),y[4]?x&&(Ce(),X(x,1,1,()=>{x=null}),Fe()):x?(x.p(y,E),E&16&&U(x,1)):(x=wk(y),x.c(),U(x,1),x.m(n,null)),(!g||E&16)&&ce(n,"is-collapsed",y[4])},i(y){g||(U(x),g=!0)},o(y){X(x),g=!1},d(y){y&&ne(e),b&&b.d(),S&&S.d(),k&&k.d(),x&&x.d(),m=!1,w()}}}function Sj(t,e,n){let r,i,{log:a}=e,{view:s}=e,{showTree:o}=e,{plugin:l}=e,c=!0;function u(h){let d=h.author.name;if(l.settings.authorInHistoryView=="full")return d;if(l.settings.authorInHistoryView=="initials")return d.split(" ").filter(g=>g.length>0).map(g=>g[0].toUpperCase()).join("")}let f=()=>n(4,c=!c);return t.$$set=h=>{"log"in h&&n(0,a=h.log),"view"in h&&n(1,s=h.view),"showTree"in h&&n(2,o=h.showTree),"plugin"in h&&n(3,l=h.plugin)},t.$$.update=()=>{t.$$.dirty&9&&n(6,r={title:"",path:"",vaultPath:"",children:l.gitManager.getTreeStructure(a.diff.files)}),t.$$.dirty&2&&n(5,i=s.leaf.getRoot().side=="left"?"right":"left")},[a,s,o,l,c,i,r,u,f]}var Qp=class extends Ve{constructor(e){super(),at(this,e,Sj,_j,it,{log:0,view:1,showTree:2,plugin:3})}},xk=Qp;function _k(t,e,n){let r=t.slice();return r[13]=e[n],r}function Sk(t){let e,n,r=tt(t[6]),i=[];for(let s=0;sX(i[s],1,1,()=>{i[s]=null});return{c(){e=I("div");for(let s=0;s{h=null}),Fe())},i(d){c||(U(h),c=!0)},o(d){X(h),c=!1},d(d){d&&ne(e),t[8](null),t[10](null),h&&h.d(),u=!1,Ae(f)}}}function kj(t,e,n){let{plugin:r}=e,{view:i}=e,a,s=[],o,l=r.settings.treeStructure,c,u;c=i.app.workspace.on("obsidian-git:view-refresh",()=>void h().catch(console.error)),h().catch(console.error),r.app.workspace.onLayoutReady(()=>{window.setTimeout(()=>{s.forEach(m=>(0,iu.setIcon)(m,m.getAttr("data-icon"))),(0,iu.setIcon)(u,l?"list":"folder")},0)}),no(()=>{i.app.workspace.offref(c)});function f(){i.app.workspace.trigger("obsidian-git:refresh")}function h(){return _a(this,void 0,void 0,function*(){if(!r.gitReady){n(6,o=void 0);return}n(4,a=!0);let m=r.gitManager instanceof Le;n(6,o=yield r.gitManager.log(void 0,!1,m?50:10)),n(4,a=!1)})}function d(m){je[m?"unshift":"push"](()=>{u=m,n(3,u)})}let p=()=>{n(2,l=!l),n(0,r.settings.treeStructure=l,r),r.saveSettings()};function g(m){je[m?"unshift":"push"](()=>{s[6]=m,n(5,s)})}return t.$$set=m=>{"plugin"in m&&n(0,r=m.plugin),"view"in m&&n(1,i=m.view)},t.$$.update=()=>{t.$$.dirty&12&&u&&(u.empty(),(0,iu.setIcon)(u,l?"list":"folder"))},[r,i,l,u,a,s,o,f,d,p,g]}var em=class extends Ve{constructor(e){super(),at(this,e,kj,Ej,it,{plugin:0,view:1})}},kk=em;var ao=class extends Ak.ItemView{constructor(e,n){super(e),this.plugin=n,this.hoverPopover=null}getViewType(){return nn.type}getDisplayText(){return nn.name}getIcon(){return nn.icon}onClose(){var e;return(e=this._view)==null||e.$destroy(),super.onClose()}reload(){var e;(e=this._view)==null||e.$destroy(),this._view=new kk({target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};v();var Tk=require("obsidian"),au=class extends Tk.FuzzySuggestModal{constructor(n,r){super(n.app);this.branches=r;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(n){return n}onChooseItem(n,r){this.resolve(n)}openAndGetReslt(){return new Promise(n=>{this.resolve=n,this.open()})}onClose(){new Promise(n=>setTimeout(n,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};v();var Zk=require("obsidian");v();var Ta=require("obsidian");v();var Ck=require("obsidian"),kr=class extends Ck.Modal{constructor(n,r,i){super(n);this.deletion=r;this.filename=i;this.resolve=null}myOpen(){return this.open(),new Promise(n=>{this.resolve=n})}onOpen(){let{contentEl:n,titleEl:r}=this;r.setText(`${this.deletion?"Delete":"Discard"} this file?`),n.createEl("p").setText(`Do you really want to ${this.deletion?"delete":"discard the changes of"} "${this.filename}"`);let i=n.createDiv({cls:"modal-button-container"}),a=i.createEl("button",{cls:"mod-warning",text:this.deletion?"Delete":"Discard"});a.addEventListener("click",()=>{this.resolve&&this.resolve(!0),this.close()}),a.addEventListener("keypress",()=>{this.resolve&&this.resolve(!0),this.close()});let s=i.createEl("button",{text:"Cancel"});s.addEventListener("click",()=>(this.resolve&&this.resolve(!1),this.close())),s.addEventListener("keypress",()=>(this.resolve&&this.resolve(!1),this.close()))}onClose(){let{contentEl:n}=this;n.empty()}};v();var Ea=require("obsidian");v();v();var Aj=Ze(Fk()),Ar=require("obsidian");function si(t,e,n){let r=t.target;app.workspace.trigger("hover-link",{event:t,source:e.getViewType(),hoverParent:e,targetEl:r,linktext:n})}function Tj(t){Nt(t,"svelte-1wbh8tp","main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}")}function Mk(t){let e,n,r;return{c(){e=I("div"),T(e,"data-icon","go-to-file"),T(e,"aria-label","Open File"),T(e,"class","clickable-icon")},m(i,a){re(i,e,a),t[11](e),n||(r=[te(e,"auxclick",xe(t[5])),te(e,"click",xe(t[5]))],n=!0)},p:ke,d(i){i&&ne(e),t[11](null),n=!1,Ae(r)}}}function Cj(t){let e,n,r,i=Bt(t[0].vault_path)+"",a,s,o,l,c=t[1].app.vault.getAbstractFileByPath(t[0].vault_path)instanceof Ea.TFile,u,f,h,d,p,g,m=t[0].working_dir+"",w,b,S,k,x,A,y=c&&Mk(t);return{c(){var E,_,C;e=I("main"),n=I("div"),r=I("div"),a=Te(i),s=J(),o=I("div"),l=I("div"),y&&y.c(),u=J(),f=I("div"),h=J(),d=I("div"),p=J(),g=I("div"),w=Te(m),T(r,"class","tree-item-inner nav-file-title-content"),T(f,"data-icon","undo"),T(f,"aria-label","Discard"),T(f,"class","clickable-icon"),T(d,"data-icon","plus"),T(d,"aria-label","Stage"),T(d,"class","clickable-icon"),T(l,"class","buttons"),T(g,"class","type"),T(g,"data-type",b=t[0].working_dir),T(o,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-file-title svelte-1wbh8tp"),T(n,"data-path",S=t[0].vault_path),T(n,"data-tooltip-position",t[3]),T(n,"aria-label",k=t[0].vault_path),ce(n,"is-active",((E=t[1].plugin.lastDiffViewState)==null?void 0:E.file)==t[0].vault_path&&!((_=t[1].plugin.lastDiffViewState)!=null&&_.hash)&&!((C=t[1].plugin.lastDiffViewState)!=null&&C.staged)),T(e,"class","tree-item nav-file svelte-1wbh8tp")},m(E,_){re(E,e,_),O(e,n),O(n,r),O(r,a),O(n,s),O(n,o),O(o,l),y&&y.m(l,null),O(l,u),O(l,f),t[12](f),O(l,h),O(l,d),t[13](d),O(o,p),O(o,g),O(g,w),x||(A=[te(f,"click",xe(t[8])),te(d,"click",xe(t[6])),te(e,"mouseover",t[4]),te(e,"click",xe(t[7])),te(e,"auxclick",xe(t[14])),te(e,"focus",t[10])],x=!0)},p(E,[_]){var C,M,L;_&1&&i!==(i=Bt(E[0].vault_path)+"")&&Oe(a,i),_&3&&(c=E[1].app.vault.getAbstractFileByPath(E[0].vault_path)instanceof Ea.TFile),c?y?y.p(E,_):(y=Mk(E),y.c(),y.m(l,u)):y&&(y.d(1),y=null),_&1&&m!==(m=E[0].working_dir+"")&&Oe(w,m),_&1&&b!==(b=E[0].working_dir)&&T(g,"data-type",b),_&1&&S!==(S=E[0].vault_path)&&T(n,"data-path",S),_&8&&T(n,"data-tooltip-position",E[3]),_&1&&k!==(k=E[0].vault_path)&&T(n,"aria-label",k),_&3&&ce(n,"is-active",((C=E[1].plugin.lastDiffViewState)==null?void 0:C.file)==E[0].vault_path&&!((M=E[1].plugin.lastDiffViewState)!=null&&M.hash)&&!((L=E[1].plugin.lastDiffViewState)!=null&&L.staged))},i:ke,o:ke,d(E){E&&ne(e),y&&y.d(),t[12](null),t[13](null),x=!1,Ae(A)}}}function Fj(t,e,n){let r,{change:i}=e,{view:a}=e,{manager:s}=e,o=[];window.setTimeout(()=>o.forEach(b=>(0,Ea.setIcon)(b,b.getAttr("data-icon"))),0);function l(b){a.app.vault.getAbstractFileByPath(i.vault_path)&&si(b,a,i.vault_path)}function c(b){var S;let k=a.app.vault.getAbstractFileByPath(i.vault_path);k instanceof Ea.TFile&&((S=Xt(a.app,b))===null||S===void 0||S.openFile(k).catch(x=>a.plugin.displayError(x)))}function u(){s.stage(i.path,!1).catch(b=>a.plugin.displayError(b)).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")})}function f(b){var S;(S=Xt(a.app,b))===null||S===void 0||S.setViewState({type:Ct.type,active:!0,state:{file:i.path,staged:!1}})}function h(){let b=i.working_dir=="U";new kr(a.app,b,i.vault_path).myOpen().then(S=>{if(S===!0)return b?a.app.vault.adapter.remove(i.vault_path).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")}):s.discard(i.path).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")})},S=>a.plugin.displayError(S))}function d(b){Er.call(this,t,b)}function p(b){je[b?"unshift":"push"](()=>{o[1]=b,n(2,o)})}function g(b){je[b?"unshift":"push"](()=>{o[0]=b,n(2,o)})}function m(b){je[b?"unshift":"push"](()=>{o[2]=b,n(2,o)})}let w=b=>{b.button==2?In(a.app,b,i.vault_path,a.leaf,"git-source-control"):f(b)};return t.$$set=b=>{"change"in b&&n(0,i=b.change),"view"in b&&n(1,a=b.view),"manager"in b&&n(9,s=b.manager)},t.$$.update=()=>{t.$$.dirty&2&&n(3,r=a.leaf.getRoot().side=="left"?"right":"left")},[i,a,o,r,l,c,u,f,h,s,d,p,g,m,w]}var nm=class extends Ve{constructor(e){super(),at(this,e,Fj,Cj,it,{change:0,view:1,manager:9},Tj)}},su=nm;v();var Ok=require("obsidian");function Mj(t){Nt(t,"svelte-1wbh8tp","main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}")}function Oj(t){let e,n,r,i=Bt(t[0].vault_path)+"",a,s,o,l,c=t[0].working_dir+"",u,f,h,d,p,g;return{c(){e=I("main"),n=I("div"),r=I("div"),a=Te(i),s=J(),o=I("div"),l=I("span"),u=Te(c),T(r,"class","tree-item-inner nav-file-title-content"),T(l,"class","type"),T(l,"data-type",f=t[0].working_dir),T(o,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-file-title svelte-1wbh8tp"),T(n,"data-path",h=t[0].vault_path),T(n,"data-tooltip-position",t[2]),T(n,"aria-label",d=t[0].vault_path),T(e,"class","tree-item nav-file svelte-1wbh8tp")},m(m,w){re(m,e,w),O(e,n),O(n,r),O(r,a),O(n,s),O(n,o),O(o,l),O(l,u),p||(g=[te(e,"mouseover",t[3]),te(e,"click",xe(t[4])),te(e,"auxclick",xe(t[6])),te(e,"focus",t[5])],p=!0)},p(m,[w]){w&1&&i!==(i=Bt(m[0].vault_path)+"")&&Oe(a,i),w&1&&c!==(c=m[0].working_dir+"")&&Oe(u,c),w&1&&f!==(f=m[0].working_dir)&&T(l,"data-type",f),w&1&&h!==(h=m[0].vault_path)&&T(n,"data-path",h),w&4&&T(n,"data-tooltip-position",m[2]),w&1&&d!==(d=m[0].vault_path)&&T(n,"aria-label",d)},i:ke,o:ke,d(m){m&&ne(e),p=!1,Ae(g)}}}function Pj(t,e,n){let r,{change:i}=e,{view:a}=e;function s(u){a.app.vault.getAbstractFileByPath(i.vault_path)&&si(u,a,i.vault_path)}function o(u){var f;let h=a.app.vault.getAbstractFileByPath(i.vault_path);h instanceof Ok.TFile&&((f=Xt(a.app,u))===null||f===void 0||f.openFile(h).catch(d=>a.plugin.displayError(d)))}function l(u){Er.call(this,t,u)}let c=u=>{u.button==2?In(a.app,u,i.vault_path,a.leaf,"git-source-control"):o(u)};return t.$$set=u=>{"change"in u&&n(0,i=u.change),"view"in u&&n(1,a=u.view)},t.$$.update=()=>{t.$$.dirty&2&&n(2,r=a.leaf.getRoot().side=="left"?"right":"left")},[i,a,r,s,o,l,c]}var rm=class extends Ve{constructor(e){super(),at(this,e,Pj,Oj,it,{change:0,view:1},Mj)}},ou=rm;v();var ka=require("obsidian");function Ij(t){Nt(t,"svelte-1wbh8tp","main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}")}function Pk(t){let e,n,r;return{c(){e=I("div"),T(e,"data-icon","go-to-file"),T(e,"aria-label","Open File"),T(e,"class","clickable-icon")},m(i,a){re(i,e,a),t[10](e),n||(r=te(e,"click",xe(t[5])),n=!0)},p:ke,d(i){i&&ne(e),t[10](null),n=!1,r()}}}function Rj(t){let e,n,r,i=Bt(t[0].vault_path)+"",a,s,o,l,c=t[1].app.vault.getAbstractFileByPath(t[0].vault_path)instanceof ka.TFile,u,f,h,d,p=t[0].index+"",g,m,w,b,S,k,x=c&&Pk(t);return{c(){var A,y,E;e=I("main"),n=I("div"),r=I("div"),a=Te(i),s=J(),o=I("div"),l=I("div"),x&&x.c(),u=J(),f=I("div"),h=J(),d=I("div"),g=Te(p),T(r,"class","tree-item-inner nav-file-title-content"),T(f,"data-icon","minus"),T(f,"aria-label","Unstage"),T(f,"class","clickable-icon"),T(l,"class","buttons"),T(d,"class","type"),T(d,"data-type",m=t[0].index),T(o,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-file-title svelte-1wbh8tp"),T(n,"data-path",w=t[0].vault_path),T(n,"data-tooltip-position",t[3]),T(n,"aria-label",b=t[0].vault_path),ce(n,"is-active",((A=t[1].plugin.lastDiffViewState)==null?void 0:A.file)==t[0].vault_path&&!((y=t[1].plugin.lastDiffViewState)!=null&&y.hash)&&((E=t[1].plugin.lastDiffViewState)==null?void 0:E.staged)),T(e,"class","tree-item nav-file svelte-1wbh8tp")},m(A,y){re(A,e,y),O(e,n),O(n,r),O(r,a),O(n,s),O(n,o),O(o,l),x&&x.m(l,null),O(l,u),O(l,f),t[11](f),O(o,h),O(o,d),O(d,g),S||(k=[te(f,"click",xe(t[7])),te(e,"mouseover",t[4]),te(e,"focus",t[9]),te(e,"click",xe(t[6])),te(e,"auxclick",xe(t[12]))],S=!0)},p(A,[y]){var E,_,C;y&1&&i!==(i=Bt(A[0].vault_path)+"")&&Oe(a,i),y&3&&(c=A[1].app.vault.getAbstractFileByPath(A[0].vault_path)instanceof ka.TFile),c?x?x.p(A,y):(x=Pk(A),x.c(),x.m(l,u)):x&&(x.d(1),x=null),y&1&&p!==(p=A[0].index+"")&&Oe(g,p),y&1&&m!==(m=A[0].index)&&T(d,"data-type",m),y&1&&w!==(w=A[0].vault_path)&&T(n,"data-path",w),y&8&&T(n,"data-tooltip-position",A[3]),y&1&&b!==(b=A[0].vault_path)&&T(n,"aria-label",b),y&3&&ce(n,"is-active",((E=A[1].plugin.lastDiffViewState)==null?void 0:E.file)==A[0].vault_path&&!((_=A[1].plugin.lastDiffViewState)!=null&&_.hash)&&((C=A[1].plugin.lastDiffViewState)==null?void 0:C.staged))},i:ke,o:ke,d(A){A&&ne(e),x&&x.d(),t[11](null),S=!1,Ae(k)}}}function Lj(t,e,n){let r,{change:i}=e,{view:a}=e,{manager:s}=e,o=[];window.setTimeout(()=>o.forEach(m=>(0,ka.setIcon)(m,m.getAttr("data-icon"))),0);function l(m){a.app.vault.getFileByPath(i.vault_path)&&si(m,a,i.vault_path)}function c(m){var w;let b=a.app.vault.getAbstractFileByPath(i.vault_path);b instanceof ka.TFile&&((w=Xt(a.app,m))===null||w===void 0||w.openFile(b).catch(S=>a.plugin.displayError(S)))}function u(m){var w;(w=Xt(a.app,m))===null||w===void 0||w.setViewState({type:Ct.type,active:!0,state:{file:i.path,staged:!0}})}function f(){s.unstage(i.path,!1).catch(m=>a.plugin.displayError(m)).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")})}function h(m){Er.call(this,t,m)}function d(m){je[m?"unshift":"push"](()=>{o[1]=m,n(2,o)})}function p(m){je[m?"unshift":"push"](()=>{o[0]=m,n(2,o)})}let g=m=>{m.button==2?In(a.app,m,i.vault_path,a.leaf,"git-source-control"):u(m)};return t.$$set=m=>{"change"in m&&n(0,i=m.change),"view"in m&&n(1,a=m.view),"manager"in m&&n(8,s=m.manager)},t.$$.update=()=>{t.$$.dirty&2&&n(3,r=a.leaf.getRoot().side=="left"?"right":"left")},[i,a,o,r,l,c,u,f,s,h,d,p,g]}var im=class extends Ve{constructor(e){super(),at(this,e,Lj,Rj,it,{change:0,view:1,manager:8},Ij)}},lu=im;v();v();function Ik(t){let e,n,r,i="And "+(t[0].length-500)+" more files",a,s;return{c(){e=I("div"),n=I("div"),r=I("div"),a=Te(i),T(r,"class","tree-item-inner nav-file-title-content"),T(n,"class","tree-item-self nav-file-title"),T(n,"aria-label",s="And "+(t[0].length-500)+" more files"),T(e,"class","tree-item nav-file")},m(o,l){re(o,e,l),O(e,n),O(n,r),O(r,a)},p(o,l){l&1&&i!==(i="And "+(o[0].length-500)+" more files")&&Oe(a,i),l&1&&s!==(s="And "+(o[0].length-500)+" more files")&&T(n,"aria-label",s)},d(o){o&&ne(e)}}}function jj(t){let e,n=t[0].length>500&&Ik(t);return{c(){e=I("main"),n&&n.c()},m(r,i){re(r,e,i),n&&n.m(e,null)},p(r,[i]){r[0].length>500?n?n.p(r,i):(n=Ik(r),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:ke,o:ke,d(r){r&&ne(e),n&&n.d()}}}function Dj(t,e,n){let{files:r}=e;return t.$$set=i=>{"files"in i&&n(0,r=i.files)},[r]}var am=class extends Ve{constructor(e){super(),at(this,e,Dj,jj,it,{files:0})}},Aa=am;function Nj(t){Nt(t,"svelte-hup5mn","main.svelte-hup5mn .nav-folder-title.svelte-hup5mn{align-items:center}")}function Rk(t,e,n){let r=t.slice();return r[18]=e[n],r}function $j(t){let e,n,r,i,a,s,o,l=t[18].title+"",c,u,f,h,d,p,g,m,w,b,S;function k(C,M){return C[3]==0?zj:Uj}let x=k(t,-1),A=x(t),y=!t[5][t[18].title]&&Lk(t);function E(){return t[14](t[18])}function _(...C){return t[15](t[18],...C)}return{c(){e=I("div"),n=I("div"),r=I("div"),i=J(),a=I("div"),a.innerHTML='',s=J(),o=I("div"),c=Te(l),u=J(),f=I("div"),h=I("div"),A.c(),d=J(),p=I("div"),m=J(),y&&y.c(),T(r,"data-icon","folder"),Yt(r,"padding-right","5px"),Yt(r,"display","flex"),T(a,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(a,"is-collapsed",t[5][t[18].title]),T(o,"class","tree-item-inner nav-folder-title-content"),Yt(p,"width","11px"),T(h,"class","buttons"),T(f,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-folder-title svelte-hup5mn"),T(n,"data-tooltip-position",t[6]),T(n,"aria-label",g=t[18].vaultPath),T(e,"class","tree-item nav-folder"),ce(e,"is-collapsed",t[5][t[18].title])},m(C,M){re(C,e,M),O(e,n),O(n,r),O(n,i),O(n,a),O(n,s),O(n,o),O(o,c),O(n,u),O(n,f),O(f,h),A.m(h,null),O(h,d),O(h,p),O(e,m),y&&y.m(e,null),w=!0,b||(S=[te(e,"click",xe(E)),te(e,"auxclick",xe(_))],b=!0)},p(C,M){t=C,(!w||M&33)&&ce(a,"is-collapsed",t[5][t[18].title]),(!w||M&1)&&l!==(l=t[18].title+"")&&Oe(c,l),x===(x=k(t,M))&&A?A.p(t,M):(A.d(1),A=x(t),A&&(A.c(),A.m(h,d))),(!w||M&64)&&T(n,"data-tooltip-position",t[6]),(!w||M&1&&g!==(g=t[18].vaultPath))&&T(n,"aria-label",g),t[5][t[18].title]?y&&(Ce(),X(y,1,1,()=>{y=null}),Fe()):y?(y.p(t,M),M&33&&U(y,1)):(y=Lk(t),y.c(),U(y,1),y.m(e,null)),(!w||M&33)&&ce(e,"is-collapsed",t[5][t[18].title])},i(C){w||(U(y),w=!0)},o(C){X(y),w=!1},d(C){C&&ne(e),A.d(),y&&y.d(),b=!1,Ae(S)}}}function Hj(t){let e,n,r,i,a=[Wj,Vj,Gj],s=[];function o(l,c){return l[3]==0?0:l[3]==1?1:l[3]==2?2:-1}return~(n=o(t,-1))&&(r=s[n]=a[n](t)),{c(){e=I("div"),r&&r.c()},m(l,c){re(l,e,c),~n&&s[n].m(e,null),i=!0},p(l,c){let u=n;n=o(l,c),n===u?~n&&s[n].p(l,c):(r&&(Ce(),X(s[u],1,1,()=>{s[u]=null}),Fe()),~n?(r=s[n],r?r.p(l,c):(r=s[n]=a[n](l),r.c()),U(r,1),r.m(e,null)):r=null)},i(l){i||(U(r),i=!0)},o(l){X(r),i=!1},d(l){l&&ne(e),~n&&s[n].d()}}}function Uj(t){let e,n,r,i,a;function s(){return t[12](t[18])}function o(){return t[13](t[18])}return{c(){e=I("div"),e.innerHTML='',n=J(),r=I("div"),r.innerHTML='',T(e,"data-icon","undo"),T(e,"aria-label","Discard"),T(e,"class","clickable-icon"),T(r,"data-icon","plus"),T(r,"aria-label","Stage"),T(r,"class","clickable-icon")},m(l,c){re(l,e,c),re(l,n,c),re(l,r,c),i||(a=[te(e,"click",xe(s)),te(r,"click",xe(o))],i=!0)},p(l,c){t=l},d(l){l&&(ne(e),ne(n),ne(r)),i=!1,Ae(a)}}}function zj(t){let e,n,r;function i(){return t[11](t[18])}return{c(){e=I("div"),e.innerHTML='',T(e,"data-icon","minus"),T(e,"aria-label","Unstage"),T(e,"class","clickable-icon")},m(a,s){re(a,e,s),n||(r=te(e,"click",xe(i)),n=!0)},p(a,s){t=a},d(a){a&&ne(e),n=!1,r()}}}function Lk(t){let e,n,r,i;return n=new cu({props:{hierarchy:t[18],plugin:t[1],view:t[2],fileType:t[3]}}),{c(){e=I("div"),He(n.$$.fragment),T(e,"class","tree-item-children nav-folder-children")},m(a,s){re(a,e,s),De(n,e,null),i=!0},p(a,s){let o={};s&1&&(o.hierarchy=a[18]),s&2&&(o.plugin=a[1]),s&4&&(o.view=a[2]),s&8&&(o.fileType=a[3]),n.$set(o)},i(a){i||(U(n.$$.fragment,a),a&&wt(()=>{i&&(r||(r=bt(e,xt,{duration:150},!0)),r.run(1))}),i=!0)},o(a){X(n.$$.fragment,a),a&&(r||(r=bt(e,xt,{duration:150},!1)),r.run(0)),i=!1},d(a){a&&ne(e),Be(n),a&&r&&r.end()}}}function Gj(t){let e,n;return e=new ou({props:{change:t[18].data,view:t[2]}}),{c(){He(e.$$.fragment)},m(r,i){De(e,r,i),n=!0},p(r,i){let a={};i&1&&(a.change=r[18].data),i&4&&(a.view=r[2]),e.$set(a)},i(r){n||(U(e.$$.fragment,r),n=!0)},o(r){X(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function Vj(t){let e,n;return e=new su({props:{change:t[18].data,manager:t[1].gitManager,view:t[2]}}),{c(){He(e.$$.fragment)},m(r,i){De(e,r,i),n=!0},p(r,i){let a={};i&1&&(a.change=r[18].data),i&2&&(a.manager=r[1].gitManager),i&4&&(a.view=r[2]),e.$set(a)},i(r){n||(U(e.$$.fragment,r),n=!0)},o(r){X(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function Wj(t){let e,n;return e=new lu({props:{change:t[18].data,manager:t[1].gitManager,view:t[2]}}),{c(){He(e.$$.fragment)},m(r,i){De(e,r,i),n=!0},p(r,i){let a={};i&1&&(a.change=r[18].data),i&2&&(a.manager=r[1].gitManager),i&4&&(a.view=r[2]),e.$set(a)},i(r){n||(U(e.$$.fragment,r),n=!0)},o(r){X(e.$$.fragment,r),n=!1},d(r){Be(e,r)}}}function jk(t){let e,n,r,i,a=[Hj,$j],s=[];function o(l,c){return l[18].data?0:1}return e=o(t,-1),n=s[e]=a[e](t),{c(){n.c(),r=wa()},m(l,c){s[e].m(l,c),re(l,r,c),i=!0},p(l,c){let u=e;e=o(l,c),e===u?s[e].p(l,c):(Ce(),X(s[u],1,1,()=>{s[u]=null}),Fe(),n=s[e],n?n.p(l,c):(n=s[e]=a[e](l),n.c()),U(n,1),n.m(r.parentNode,r))},i(l){i||(U(n),i=!0)},o(l){X(n),i=!1},d(l){l&&ne(r),s[e].d(l)}}}function qj(t){let e,n,r,i,a=tt(vr(t[0].children,500)),s=[];for(let l=0;lX(s[l],1,1,()=>{s[l]=null});return r=new Aa({props:{files:t[0].children}}),{c(){e=I("main");for(let l=0;l100;function h(x){o.gitManager.stageAll({dir:x}).catch(A=>o.displayError(A)).finally(()=>{l.app.workspace.trigger("obsidian-git:refresh")})}function d(x){o.gitManager.unstageAll({dir:x}).catch(A=>o.displayError(A)).finally(()=>{l.app.workspace.trigger("obsidian-git:refresh")})}function p(x){new kr(l.app,!1,x.vaultPath).myOpen().then(A=>{if(A===!0)return o.gitManager.discardAll({dir:x.path,status:o.cachedStatus}).finally(()=>{l.app.workspace.trigger("obsidian-git:refresh")})},A=>o.displayError(A))}function g(x){n(5,f[x.title]=!f[x.title],f)}let m=x=>d(x.path),w=x=>p(x),b=x=>h(x.path),S=x=>g(x),k=(x,A)=>In(l.app,A,x.vaultPath,l.leaf,"git-source-control");return t.$$set=x=>{"hierarchy"in x&&n(0,s=x.hierarchy),"plugin"in x&&n(1,o=x.plugin),"view"in x&&n(2,l=x.view),"fileType"in x&&n(3,c=x.fileType),"topLevel"in x&&n(4,u=x.topLevel)},t.$$.update=()=>{t.$$.dirty&4&&n(6,r=l.leaf.getRoot().side=="left"?"right":"left")},[s,o,l,c,u,f,r,h,d,p,g,m,w,b,S,k]}var cu=class extends Ve{constructor(e){super(),at(this,e,Xj,qj,it,{hierarchy:0,plugin:1,view:2,fileType:3,topLevel:4},Nj)}},uu=cu;function Yj(t){Nt(t,"svelte-11adhly",`.commit-msg-input.svelte-11adhly.svelte-11adhly{width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field)}.git-commit-msg.svelte-11adhly.svelte-11adhly{position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto}main.svelte-11adhly .git-tools .files-count.svelte-11adhly{padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center}.nav-folder-title.svelte-11adhly.svelte-11adhly{align-items:center}.git-commit-msg-clear-button.svelte-11adhly.svelte-11adhly{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-11adhly.svelte-11adhly: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,");mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat}`)}function Dk(t,e,n){let r=t.slice();return r[42]=e[n],r}function Bk(t,e,n){let r=t.slice();return r[42]=e[n],r}function Nk(t,e,n){let r=t.slice();return r[47]=e[n],r}function $k(t){let e,n,r,i;return{c(){e=I("div"),T(e,"class","git-commit-msg-clear-button svelte-11adhly"),T(e,"aria-label",n="Clear")},m(a,s){re(a,e,s),r||(i=te(e,"click",t[34]),r=!0)},p:ke,d(a){a&&ne(e),r=!1,i()}}}function Hk(t){let e,n,r,i,a,s,o,l,c,u,f,h,d=t[6].staged.length+"",p,g,m,w,b,S,k,x,A,y,E,_,C,M,L,N,j=t[6].changed.length+"",Y,le,he,ie,Me,de,$=t[13]&&Uk(t),G=t[12]&&Gk(t),D=t[7].length>0&&Wk(t);return{c(){e=I("div"),n=I("div"),r=I("div"),i=I("div"),i.innerHTML='',a=J(),s=I("div"),s.textContent="Staged Changes",o=J(),l=I("div"),c=I("div"),u=I("div"),u.innerHTML='',f=J(),h=I("div"),p=Te(d),g=J(),$&&$.c(),m=J(),w=I("div"),b=I("div"),S=I("div"),S.innerHTML='',k=J(),x=I("div"),x.textContent="Changes",A=J(),y=I("div"),E=I("div"),_=I("div"),_.innerHTML='',C=J(),M=I("div"),M.innerHTML='',L=J(),N=I("div"),Y=Te(j),le=J(),G&&G.c(),he=J(),D&&D.c(),T(i,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(i,"is-collapsed",!t[13]),T(s,"class","tree-item-inner nav-folder-title-content"),T(u,"data-icon","minus"),T(u,"aria-label","Unstage"),T(u,"class","clickable-icon"),T(c,"class","buttons"),T(h,"class","files-count svelte-11adhly"),T(l,"class","git-tools"),T(r,"class","tree-item-self is-clickable nav-folder-title svelte-11adhly"),T(n,"class","staged tree-item nav-folder"),ce(n,"is-collapsed",!t[13]),T(S,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(S,"is-collapsed",!t[12]),T(x,"class","tree-item-inner nav-folder-title-content"),T(_,"data-icon","undo"),T(_,"aria-label","Discard"),T(_,"class","clickable-icon"),T(M,"data-icon","plus"),T(M,"aria-label","Stage"),T(M,"class","clickable-icon"),T(E,"class","buttons"),T(N,"class","files-count svelte-11adhly"),T(y,"class","git-tools"),T(b,"class","tree-item-self is-clickable nav-folder-title svelte-11adhly"),T(w,"class","changes tree-item nav-folder"),ce(w,"is-collapsed",!t[12]),T(e,"class","tree-item nav-folder mod-root")},m(se,Se){re(se,e,Se),O(e,n),O(n,r),O(r,i),O(r,a),O(r,s),O(r,o),O(r,l),O(l,c),O(c,u),t[35](u),O(l,f),O(l,h),O(h,p),O(n,g),$&&$.m(n,null),O(e,m),O(e,w),O(w,b),O(b,S),O(b,k),O(b,x),O(b,A),O(b,y),O(y,E),O(E,_),O(E,C),O(E,M),t[37](M),O(y,L),O(y,N),O(N,Y),O(w,le),G&&G.m(w,null),O(e,he),D&&D.m(e,null),ie=!0,Me||(de=[te(u,"click",xe(t[20])),te(r,"click",t[36]),te(_,"click",xe(t[23])),te(M,"click",xe(t[19])),te(b,"click",t[38])],Me=!0)},p(se,Se){(!ie||Se[0]&8192)&&ce(i,"is-collapsed",!se[13]),(!ie||Se[0]&64)&&d!==(d=se[6].staged.length+"")&&Oe(p,d),se[13]?$?($.p(se,Se),Se[0]&8192&&U($,1)):($=Uk(se),$.c(),U($,1),$.m(n,null)):$&&(Ce(),X($,1,1,()=>{$=null}),Fe()),(!ie||Se[0]&8192)&&ce(n,"is-collapsed",!se[13]),(!ie||Se[0]&4096)&&ce(S,"is-collapsed",!se[12]),(!ie||Se[0]&64)&&j!==(j=se[6].changed.length+"")&&Oe(Y,j),se[12]?G?(G.p(se,Se),Se[0]&4096&&U(G,1)):(G=Gk(se),G.c(),U(G,1),G.m(w,null)):G&&(Ce(),X(G,1,1,()=>{G=null}),Fe()),(!ie||Se[0]&4096)&&ce(w,"is-collapsed",!se[12]),se[7].length>0?D?(D.p(se,Se),Se[0]&128&&U(D,1)):(D=Wk(se),D.c(),U(D,1),D.m(e,null)):D&&(Ce(),X(D,1,1,()=>{D=null}),Fe())},i(se){ie||(U($),U(G),U(D),ie=!0)},o(se){X($),X(G),X(D),ie=!1},d(se){se&&ne(e),t[35](null),$&&$.d(),t[37](null),G&&G.d(),D&&D.d(),Me=!1,Ae(de)}}}function Uk(t){let e,n,r,i,a,s=[Kj,Zj],o=[];function l(c,u){return c[3]?0:1}return n=l(t,[-1,-1]),r=o[n]=s[n](t),{c(){e=I("div"),r.c(),T(e,"class","tree-item-children nav-folder-children")},m(c,u){re(c,e,u),o[n].m(e,null),a=!0},p(c,u){let f=n;n=l(c,u),n===f?o[n].p(c,u):(Ce(),X(o[f],1,1,()=>{o[f]=null}),Fe(),r=o[n],r?r.p(c,u):(r=o[n]=s[n](c),r.c()),U(r,1),r.m(e,null))},i(c){a||(U(r),c&&wt(()=>{a&&(i||(i=bt(e,xt,{duration:150},!0)),i.run(1))}),a=!0)},o(c){X(r),c&&(i||(i=bt(e,xt,{duration:150},!1)),i.run(0)),a=!1},d(c){c&&ne(e),o[n].d(),c&&i&&i.end()}}}function Zj(t){let e,n,r,i=tt(vr(t[6].staged,500)),a=[];for(let o=0;oX(a[o],1,1,()=>{a[o]=null});return n=new Aa({props:{files:t[6].staged}}),{c(){for(let o=0;o{o[f]=null}),Fe(),r=o[n],r?r.p(c,u):(r=o[n]=s[n](c),r.c()),U(r,1),r.m(e,null))},i(c){a||(U(r),c&&wt(()=>{a&&(i||(i=bt(e,xt,{duration:150},!0)),i.run(1))}),a=!0)},o(c){X(r),c&&(i||(i=bt(e,xt,{duration:150},!1)),i.run(0)),a=!1},d(c){c&&ne(e),o[n].d(),c&&i&&i.end()}}}function Jj(t){let e,n,r,i=tt(vr(t[6].changed,500)),a=[];for(let o=0;oX(a[o],1,1,()=>{a[o]=null});return n=new Aa({props:{files:t[6].changed}}),{c(){for(let o=0;o',i=J(),a=I("div"),a.textContent="Recently Pulled Files",s=J(),o=I("span"),c=Te(l),u=J(),p&&p.c(),T(r,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),T(a,"class","tree-item-inner nav-folder-title-content"),T(o,"class","tree-item-flair"),T(n,"class","tree-item-self is-clickable nav-folder-title svelte-11adhly"),T(e,"class","pulled nav-folder"),ce(e,"is-collapsed",!t[14])},m(g,m){re(g,e,m),O(e,n),O(n,r),O(n,i),O(n,a),O(n,s),O(n,o),O(o,c),O(e,u),p&&p.m(e,null),f=!0,h||(d=te(n,"click",t[39]),h=!0)},p(g,m){(!f||m[0]&128)&&l!==(l=g[7].length+"")&&Oe(c,l),g[14]?p?(p.p(g,m),m[0]&16384&&U(p,1)):(p=qk(g),p.c(),U(p,1),p.m(e,null)):p&&(Ce(),X(p,1,1,()=>{p=null}),Fe()),(!f||m[0]&16384)&&ce(e,"is-collapsed",!g[14])},i(g){f||(U(p),f=!0)},o(g){X(p),f=!1},d(g){g&&ne(e),p&&p.d(),h=!1,d()}}}function qk(t){let e,n,r,i,a,s=[t7,e7],o=[];function l(c,u){return c[3]?0:1}return n=l(t,[-1,-1]),r=o[n]=s[n](t),{c(){e=I("div"),r.c(),T(e,"class","tree-item-children nav-folder-children")},m(c,u){re(c,e,u),o[n].m(e,null),a=!0},p(c,u){let f=n;n=l(c,u),n===f?o[n].p(c,u):(Ce(),X(o[f],1,1,()=>{o[f]=null}),Fe(),r=o[n],r?r.p(c,u):(r=o[n]=s[n](c),r.c()),U(r,1),r.m(e,null))},i(c){a||(U(r),c&&wt(()=>{a&&(i||(i=bt(e,xt,{duration:150},!0)),i.run(1))}),a=!0)},o(c){X(r),c&&(i||(i=bt(e,xt,{duration:150},!1)),i.run(0)),a=!1},d(c){c&&ne(e),o[n].d(),c&&i&&i.end()}}}function e7(t){let e,n,r,i=tt(t[7]),a=[];for(let o=0;oX(a[o],1,1,()=>{a[o]=null});return n=new Aa({props:{files:t[7]}}),{c(){for(let o=0;o{j=null}),Fe())},i(Y){C||(U(j),C=!0)},o(Y){X(j),C=!1},d(Y){Y&&ne(e),t[24](null),t[25](null),t[26](null),t[27](null),t[28](null),t[29](null),t[30](null),t[32](null),N&&N.d(),j&&j.d(),M=!1,Ae(L)}}}function r7(t,e,n){let r,{plugin:i}=e,{view:a}=e,s,o,l=[],c=i.settings.commitMessage,u=[],f,h,d,p=!0,g=!0,m=!0,w=i.settings.treeStructure,b,S;S=a.app.workspace.on("obsidian-git:view-refresh",()=>void A().catch(console.error)),A().catch(console.error),i.app.workspace.onLayoutReady(()=>{window.setTimeout(()=>{u.forEach(ee=>(0,Ta.setIcon)(ee,ee.getAttr("data-icon"))),(0,Ta.setIcon)(b,w?"list":"folder")},0)}),no(()=>{a.app.workspace.offref(S)});function k(){return _a(this,void 0,void 0,function*(){if(n(5,s=!0),o){if(yield i.tools.hasTooBigFiles(o.staged))return i.setPluginState({gitAction:0}),!1;i.promiseQueue.addTask(()=>i.gitManager.commit({message:c}).then(()=>_a(this,void 0,void 0,function*(){c!==i.settings.commitMessage&&n(2,c=""),yield i.automaticsManager.setUpAutoCommitAndSync()})).finally(y))}})}function x(){n(5,s=!0),o&&i.promiseQueue.addTask(()=>i.commitAndSync(!1,!1,c).then(()=>{c!==i.settings.commitMessage&&n(2,c="")}).finally(y))}function A(){return _a(this,void 0,void 0,function*(){if(!i.gitReady){n(6,o=void 0);return}let ee=yield i.gitManager.getUnpushedCommits();if(u.forEach(Ie=>{var Ee,z;Ie&&(Ta.Platform.isMobile?(Ie.removeClass("button-border"),Ie.id=="push"&&ee>0&&Ie.addClass("button-border")):((Ee=Ie.firstElementChild)===null||Ee===void 0||Ee.removeAttribute("color"),Ie.id=="push"&&ee>0&&((z=Ie.firstElementChild)===null||z===void 0||z.setAttr("color","var(--text-accent)"))))}),n(6,o=i.cachedStatus),i.lastPulledFiles&&i.lastPulledFiles!=l&&(n(7,l=i.lastPulledFiles),n(11,d={title:"",path:"",vaultPath:"",children:i.gitManager.getTreeStructure(l)})),o){let Ie=(Ee,z)=>Ee.vault_path.split("/").last().localeCompare(Bt(z.vault_path));o.changed.sort(Ie),o.staged.sort(Ie),n(9,f={title:"",path:"",vaultPath:"",children:i.gitManager.getTreeStructure(o.changed)}),n(10,h={title:"",path:"",vaultPath:"",children:i.gitManager.getTreeStructure(o.staged)})}else n(9,f=void 0),n(10,h=void 0);n(5,s=i.loading)})}function y(){a.app.workspace.trigger("obsidian-git:refresh")}function E(){n(5,s=!0),i.promiseQueue.addTask(()=>i.gitManager.stageAll({status:o}).finally(y))}function _(){n(5,s=!0),i.promiseQueue.addTask(()=>i.gitManager.unstageAll({status:o}).finally(y))}function C(){n(5,s=!0),i.promiseQueue.addTask(()=>i.push().finally(y))}function M(){n(5,s=!0),i.promiseQueue.addTask(()=>i.pullChangesFromRemote().finally(y))}function L(){new kr(a.app,!1,i.gitManager.getRelativeVaultPath("/")).myOpen().then(ee=>{ee===!0&&i.promiseQueue.addTask(()=>i.gitManager.discardAll({status:i.cachedStatus}).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")}))},console.error)}function N(ee){je[ee?"unshift":"push"](()=>{u[5]=ee,n(8,u)})}function j(ee){je[ee?"unshift":"push"](()=>{u[0]=ee,n(8,u)})}function Y(ee){je[ee?"unshift":"push"](()=>{u[1]=ee,n(8,u)})}function le(ee){je[ee?"unshift":"push"](()=>{u[2]=ee,n(8,u)})}function he(ee){je[ee?"unshift":"push"](()=>{u[3]=ee,n(8,u)})}function ie(ee){je[ee?"unshift":"push"](()=>{u[4]=ee,n(8,u)})}function Me(ee){je[ee?"unshift":"push"](()=>{b=ee,n(4,b)})}let de=()=>{n(3,w=!w),n(0,i.settings.treeStructure=w,i),i.saveSettings()};function $(ee){je[ee?"unshift":"push"](()=>{u[6]=ee,n(8,u)})}function G(){c=this.value,n(2,c)}let D=()=>n(2,c="");function se(ee){je[ee?"unshift":"push"](()=>{u[8]=ee,n(8,u)})}let Se=()=>n(13,g=!g);function mt(ee){je[ee?"unshift":"push"](()=>{u[9]=ee,n(8,u)})}let be=()=>n(12,p=!p),st=()=>n(14,m=!m);return t.$$set=ee=>{"plugin"in ee&&n(0,i=ee.plugin),"view"in ee&&n(1,a=ee.view)},t.$$.update=()=>{t.$$.dirty[0]&24&&b&&(b.empty(),(0,Ta.setIcon)(b,w?"list":"folder")),t.$$.dirty[0]&4&&n(15,r=(c.match(/\n/g)||[]).length+1||1)},[i,a,c,w,b,s,o,l,u,f,h,d,p,g,m,r,k,x,y,E,_,C,M,L,N,j,Y,le,he,ie,Me,de,$,G,D,se,Se,mt,be,st]}var sm=class extends Ve{constructor(e){super(),at(this,e,r7,n7,it,{plugin:0,view:1},Yj,[-1,-1])}},Yk=sm;var oo=class extends Zk.ItemView{constructor(e,n){super(e),this.plugin=n,this.hoverPopover=null}getViewType(){return dt.type}getDisplayText(){return dt.name}getIcon(){return dt.icon}onClose(){var e;return(e=this._view)==null||e.$destroy(),super.onClose()}reload(){var e;(e=this._view)==null||e.$destroy(),this._view=new Yk({target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};v();var fu=class{constructor(e,n){this.statusBarEl=e;this.plugin=n;this.statusBarEl.addClass("mod-clickable"),this.statusBarEl.onClickEvent(r=>{this.plugin.switchBranch().catch(i=>n.displayError(i))})}async display(){if(this.plugin.gitReady){let e=await this.plugin.gitManager.branchInfo();e.current!=null?this.statusBarEl.setText(e.current):this.statusBarEl.empty()}else this.statusBarEl.empty()}remove(){this.statusBarEl.remove()}};v();var Kk=require("obsidian");var lo=class{constructor(e){this.plugin=e}async hasTooBigFiles(e){let n=await this.plugin.gitManager.branchInfo(),r=n.tracking?wr(n.tracking)[0]:null;if(r){let i=await this.plugin.gitManager.getRemoteUrl(r);if(i!=null&&i.includes("github.com")){let a=e.filter(s=>{let o=this.plugin.app.vault.getAbstractFileByPath(s.vault_path);return o instanceof Kk.TFile?o.stat.size>=1e8:!1});if(a.length>0)return this.plugin.displayError(`Did not commit, because following files are too big: ${a.map(s=>s.vault_path).join(` +`)}. Please remove them.`),!0}}return!1}async writeAndOpenFile(e){e!==void 0&&await this.plugin.app.vault.adapter.write(Vi,e);let n=!1;this.plugin.app.workspace.iterateAllLeaves(r=>{r.getDisplayText()!=""&&Vi.startsWith(r.getDisplayText())&&(n=!0)}),n||await this.plugin.app.workspace.openLinkText(Vi,"/",!0)}};var hu=class extends _e.Plugin{constructor(){super(...arguments);this.tools=new lo(this);this.state={gitAction:0,loading:!1,offlineMode:!1};this.gitReady=!1;this.promiseQueue=new Lc(this);this.loading=!1;this.intervalsToClear=[];this.lineAuthoringFeature=new Rc(this)}setPluginState(n){var r;this.state=Object.assign(this.state,n),(r=this.statusBar)==null||r.display()}async updateCachedStatus(){var n,r;return this.cachedStatus=await this.gitManager.status(),this.cachedStatus.conflicted.length>0?(this.localStorage.setConflict(!0),await((n=this.branchBar)==null?void 0:n.display())):(this.localStorage.setConflict(!1),await((r=this.branchBar)==null?void 0:r.display())),this.cachedStatus}async refresh(){if(!this.gitReady)return;let n=this.app.workspace.getLeavesOfType(dt.type),r=this.app.workspace.getLeavesOfType(nn.type);(this.settings.changedFilesInStatusBar||n.some(i=>{var a;return!((a=i.isDeferred)!=null&&a)})||r.some(i=>{var a;return!((a=i.isDeferred)!=null&&a)}))&&(this.loading=!0,this.app.workspace.trigger("obsidian-git:view-refresh"),await this.updateCachedStatus().catch(i=>this.displayError(i)),this.loading=!1,this.app.workspace.trigger("obsidian-git:view-refresh"))}refreshUpdatedHead(){this.lineAuthoringFeature.refreshLineAuthorViews()}async onload(){console.log("loading "+this.manifest.name+" plugin: v"+this.manifest.version),Gs.plugin=this,this.localStorage=new Hc(this),this.localStorage.migrate(),await this.loadSettings(),await this.migrateSettings(),this.settingsTab=new bc(this.app,this),this.addSettingTab(this.settingsTab),this.localStorage.getPluginDisabled()||(this.registerStuff(),this.app.workspace.onLayoutReady(()=>this.init({fromReload:!1}).catch(n=>this.displayError(n))))}onExternalSettingsChange(){this.reloadSettings().catch(n=>this.displayError(n))}async reloadSettings(){let n=JSON.stringify(this.settings);await this.loadSettings();let r=JSON.stringify(this.settings);n!==r&&(this.log("Reloading settings"),this.unloadPlugin(),await this.init({fromReload:!0}),this.app.workspace.getLeavesOfType(dt.type).forEach(i=>{var a;if(!((a=i.isDeferred)!=null&&a))return i.view.reload()}),this.app.workspace.getLeavesOfType(nn.type).forEach(i=>{var a;if(!((a=i.isDeferred)!=null&&a))return i.view.reload()}))}registerStuff(){this.registerEvent(this.app.workspace.on("obsidian-git:refresh",()=>{this.refresh().catch(n=>this.displayError(n))})),this.registerEvent(this.app.workspace.on("obsidian-git:head-change",()=>{this.refreshUpdatedHead()})),this.registerEvent(this.app.workspace.on("file-menu",(n,r,i)=>{this.handleFileMenu(n,r,i)})),this.registerEvent(this.app.workspace.on("active-leaf-change",n=>{this.handleViewActiveState(n)})),this.registerEvent(this.app.vault.on("modify",()=>{var n;this.debRefresh(),(n=this.autoCommitDebouncer)==null||n.call(this)})),this.registerEvent(this.app.vault.on("delete",()=>{var n;this.debRefresh(),(n=this.autoCommitDebouncer)==null||n.call(this)})),this.registerEvent(this.app.vault.on("create",()=>{var n;this.debRefresh(),(n=this.autoCommitDebouncer)==null||n.call(this)})),this.registerEvent(this.app.vault.on("rename",()=>{var n;this.debRefresh(),(n=this.autoCommitDebouncer)==null||n.call(this)})),this.registerView(dt.type,n=>new oo(n,this)),this.registerView(nn.type,n=>new ao(n,this)),this.registerView(Ct.type,n=>new ga(n,this)),this.addRibbonIcon("git-pull-request","Open Git source control",async()=>{var i;let n=this.app.workspace.getLeavesOfType(dt.type),r;n.length===0?(r=(i=this.app.workspace.getRightLeaf(!1))!=null?i:this.app.workspace.getLeaf(),await r.setViewState({type:dt.type})):r=n.first(),await this.app.workspace.revealLeaf(r),this.app.workspace.trigger("obsidian-git:refresh")}),this.registerHoverLinkSource(dt.type,{display:"Git View",defaultMod:!0}),this.lineAuthoringFeature.onLoadPlugin(),this.setRefreshDebouncer(),AE(this)}setRefreshDebouncer(){var n;(n=this.debRefresh)==null||n.cancel(),this.debRefresh=(0,_e.debounce)(()=>{this.settings.refreshSourceControl&&this.refresh().catch(console.error)},this.settings.refreshSourceControlTimer,!0)}async addFileToGitignore(n){return await this.app.vault.adapter.append(this.gitManager.getRelativeVaultPath(".gitignore"),` +`+this.gitManager.getRelativeRepoPath(n.path,!0)),this.refresh()}handleFileMenu(n,r,i){this.gitReady&&this.settings.showFileMenu&&r&&(this.settings.showFileMenu&&i=="file-explorer-context-menu"&&(n.addItem(a=>{a.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(s=>{this.promiseQueue.addTask(async()=>{r instanceof _e.TFile?await this.gitManager.stage(r.path,!0):await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(r.path,!0)}),this.displayMessage(`Staged ${r.path}`)})})}),n.addItem(a=>{a.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(s=>{this.promiseQueue.addTask(async()=>{r instanceof _e.TFile?await this.gitManager.unstage(r.path,!0):await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(r.path,!0)}),this.displayMessage(`Unstaged ${r.path}`)})})}),n.addItem(a=>{a.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(s=>{this.addFileToGitignore(r).catch(o=>this.displayError(o))})})),i=="git-source-control"&&n.addItem(a=>{a.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(s=>{this.addFileToGitignore(r).catch(o=>this.displayError(o))})}))}async migrateSettings(){this.settings.mergeOnPull!=null&&(this.settings.syncMethod=this.settings.mergeOnPull?"merge":"rebase",this.settings.mergeOnPull=void 0,await this.saveSettings()),this.settings.autoCommitMessage===void 0&&(this.settings.autoCommitMessage=this.settings.commitMessage,await this.saveSettings()),this.settings.gitPath!=null&&(this.localStorage.setGitPath(this.settings.gitPath),this.settings.gitPath=void 0,await this.saveSettings()),this.settings.username!=null&&(this.localStorage.setPassword(this.settings.username),this.settings.username=void 0,await this.saveSettings())}unloadPlugin(){var n,r;this.gitReady=!1,this.app.workspace.trigger("obsidian-git:refresh"),this.lineAuthoringFeature.deactivateFeature(),this.automaticsManager.unload(),(n=this.branchBar)==null||n.remove(),(r=this.statusBar)==null||r.remove();for(let i of this.intervalsToClear)window.clearInterval(i);this.intervalsToClear=[],this.debRefresh.cancel()}onunload(){this.unloadPlugin(),console.log("unloading "+this.manifest.name+" plugin")}async loadSettings(){let n=await this.loadData();n==null&&(n={showedMobileNotice:!0}),this.settings=Hw(Mn,n)}async saveSettings(){var n;(n=this.settingsTab)==null||n.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return _e.Platform.isDesktopApp}async init({fromReload:n=!1}){var r;if(this.settings.showStatusBar){let i=this.addStatusBarItem();this.statusBar=new jc(i,this),this.intervalsToClear.push(window.setInterval(()=>{var a;return(a=this.statusBar)==null?void 0:a.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Le(this),await this.gitManager.setGitInstance()):this.gitManager=new yn(this);let i=await this.gitManager.checkRequirements();switch(i){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new _e.Notice("Can't find a valid git repository. Please create one via the given command or clone an existing repo.",1e4);break;case"valid":if(this.gitReady=!0,this.setPluginState({gitAction:0}),_e.Platform.isDesktop&&this.settings.showBranchStatusBar){let a=this.addStatusBarItem();this.branchBar=new fu(a,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return void((s=this.branchBar)==null?void 0:s.display().catch(console.error))},6e4))}await((r=this.branchBar)==null?void 0:r.display()),this.lineAuthoringFeature.conditionallyActivateBySettings(),this.app.workspace.trigger("obsidian-git:refresh"),!n&&this.settings.autoPullOnBoot&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),this.automaticsManager=new Vs(this),await this.automaticsManager.init();break;default:this.log("Something weird happened. The 'checkRequirements' result is "+i)}}catch(i){this.displayError(i),console.error(i)}}async createNewRepo(){try{await this.gitManager.init(),new _e.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(n){this.displayError(n)}}async cloneNewRepo(){let r=await new Xe(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(r){let i="Vault Root",a=await new Xe(this,{options:this.gitManager instanceof yn?[i]:[],placeholder:"Enter directory for clone. It needs to be empty or not existent.",allowEmpty:this.gitManager instanceof yn}).openAndGetResult();if(a==null)return;if(a===i&&(a="."),a=(0,_e.normalizePath)(a),a==="/"&&(a="."),a==="."){let f=await new Xe(this,{options:["NO","YES"],placeholder:`Does your remote repo contain a ${this.app.vault.configDir} directory at the root?`,onlySelection:!0}).openAndGetResult();if(f===void 0){new _e.Notice("Aborted clone");return}else if(f==="YES"){let h="DELETE ALL YOUR LOCAL CONFIG AND PLUGINS";if(await new Xe(this,{options:["Abort clone",h],placeholder:`To avoid conflicts, the local ${this.app.vault.configDir} directory needs to be deleted.`,onlySelection:!0}).openAndGetResult()===h)await this.app.vault.adapter.rmdir(this.app.vault.configDir,!0);else{new _e.Notice("Aborted clone");return}}}let s=await new Xe(this,{placeholder:"Specify depth of clone. Leave empty for full clone.",allowEmpty:!0}).openAndGetResult(),o;if(s!==""&&(o=parseInt(s),isNaN(o))){new _e.Notice("Invalid depth. Aborting clone.");return}new _e.Notice(`Cloning new repo into "${a}"`);let l=this.settings.basePath,c=a&&a!==".";c&&(this.settings.basePath=a);try{await this.gitManager.clone(r,a,o),new _e.Notice("Cloned new repo."),new _e.Notice("Please restart Obsidian"),c&&await this.saveSettings()}catch(u){this.displayError(u),this.settings.basePath=l,await this.saveSettings()}}}async isAllInitialized(){return this.gitReady||await this.init({fromReload:!0}),this.gitReady}async pullChangesFromRemote(){if(!await this.isAllInitialized())return;let n=await this.pull();if(await this.automaticsManager.setUpAutoCommitAndSync(),n!==!1){if(n||this.displayMessage("Everything is up-to-date"),this.gitManager instanceof Le){let r=await this.updateCachedStatus();r.conflicted.length>0&&(this.displayError(`You have conflicts in ${r.conflicted.length} ${r.conflicted.length==1?"file":"files"}`),await this.handleConflict(r.conflicted))}this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0})}}async commitAndSync(n,r=!1,i){!await this.isAllInitialized()||(this.settings.syncMethod=="reset"&&this.settings.pullBeforePush&&await this.pull(),!await this.commit({fromAuto:n,requestCustomMessage:r,commitMessage:i}))||(this.settings.syncMethod!="reset"&&this.settings.pullBeforePush&&await this.pull(),this.settings.disablePush||(await this.remotesAreSet()&&await this.gitManager.canPush()?await this.push():this.displayMessage("No commits to push")),this.setPluginState({gitAction:0}))}async commit({fromAuto:n,requestCustomMessage:r=!1,onlyStaged:i=!1,commitMessage:a,amend:s=!1}){if(!await this.isAllInitialized())return!1;try{let o=this.localStorage.getConflict(),l,c,u;if(this.gitManager instanceof Le){if(await this.mayDeleteConflictFile(),c=await this.updateCachedStatus(),c.conflicted.length==0&&(o=!1),n&&c.conflicted.length>0)return this.displayError(`Did not commit, because you have conflicts in ${c.conflicted.length} ${c.conflicted.length==1?"file":"files"}. Please resolve them and commit per command.`),await this.handleConflict(c.conflicted),!1;l=[...c.changed,...c.staged]}else{if(n&&o)return this.displayError("Did not commit, because you have conflicts. Please resolve them and commit per command."),!1;if(o)await this.mayDeleteConflictFile(),c=await this.updateCachedStatus(),l=[...c.changed,...c.staged];else{let f=this.gitManager;i?l=await f.getStagedFiles():(u=await f.getUnstagedFiles(),l=u.map(({filepath:h})=>({vault_path:this.gitManager.getRelativeVaultPath(h)})))}}if(await this.tools.hasTooBigFiles(l))return this.setPluginState({gitAction:0}),!1;if(l.length!==0||o){let f=a!=null?a:a=n?this.settings.autoCommitMessage:this.settings.commitMessage;if(n&&this.settings.customMessageOnAutoBackup||r){!this.settings.disablePopups&&n&&new _e.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort");let p=await new Dc(this).openAndGetResult();if(p!=null&&p!=""&&p!="...")f=p;else return this.setPluginState({gitAction:0}),!1}let h;i?h=await this.gitManager.commit({message:f,amend:s}):h=await this.gitManager.commitAll({message:f,status:c,unstagedFiles:u,amend:s}),this.gitManager instanceof Le&&await this.updateCachedStatus();let d=!1;h===void 0&&(d=!0,h=l.length),await this.automaticsManager.setUpAutoCommitAndSync(),this.displayMessage(`Committed${d?" approx.":""} ${h} ${h==1?"file":"files"}`)}else this.displayMessage("No changes to commit");return this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(o){return this.displayError(o),!1}}async push(){if(!await this.isAllInitialized()||!await this.remotesAreSet())return!1;let n=this.localStorage.getConflict();try{this.gitManager instanceof Le&&await this.mayDeleteConflictFile();let r;if(this.gitManager instanceof Le&&(r=await this.updateCachedStatus()).conflicted.length>0)return this.displayError(`Cannot push. You have conflicts in ${r.conflicted.length} ${r.conflicted.length==1?"file":"files"}`),await this.handleConflict(r.conflicted),!1;if(this.gitManager instanceof yn&&n)return this.displayError("Cannot push. You have conflicts"),!1;this.log("Pushing....");let i=await this.gitManager.push();return i!==void 0&&(i>0?this.displayMessage(`Pushed ${i} ${i==1?"file":"files"} to remote`):this.displayMessage("No commits to push")),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(r){return r instanceof Wi?this.handleNoNetworkError(r):this.displayError(r),!1}}async pull(){if(!await this.remotesAreSet())return!1;try{this.log("Pulling....");let n=await this.gitManager.pull()||[];return this.setPluginState({offlineMode:!1}),n.length>0&&(this.displayMessage(`Pulled ${n.length} ${n.length==1?"file":"files"} from remote`),this.lastPulledFiles=n),n.length}catch(n){return this.displayError(n),!1}}async fetch(){if(await this.remotesAreSet())try{await this.gitManager.fetch(),this.displayMessage("Fetched from remote"),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh")}catch(n){this.displayError(n)}}async mayDeleteConflictFile(){let n=this.app.vault.getAbstractFileByPath(Vi);n&&(this.app.workspace.iterateAllLeaves(r=>{var i;r.view instanceof _e.MarkdownView&&((i=r.view.file)==null?void 0:i.path)==n.path&&r.detach()}),await this.app.vault.delete(n))}async stageFile(n){return await this.isAllInitialized()?(await this.gitManager.stage(n.path,!0),this.displayMessage(`Staged ${n.path}`),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async unstageFile(n){return await this.isAllInitialized()?(await this.gitManager.unstage(n.path,!0),this.displayMessage(`Unstaged ${n.path}`),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async switchBranch(){var i;if(!await this.isAllInitialized())return;let n=await this.gitManager.branchInfo(),r=await new au(this,n.branches).openAndGetReslt();if(r!=null)return await this.gitManager.checkout(r),this.displayMessage(`Switched to ${r}`),await((i=this.branchBar)==null?void 0:i.display()),r}async switchRemoteBranch(){var a;if(!await this.isAllInitialized())return;let n=await this.selectRemoteBranch()||"",[r,i]=wr(n);if(i!=null&&r!=null)return await this.gitManager.checkout(i,r),this.displayMessage(`Switched to ${n}`),await((a=this.branchBar)==null?void 0:a.display()),n}async createBranch(){var r;if(!await this.isAllInitialized())return;let n=await new Xe(this,{placeholder:"Create new branch"}).openAndGetResult();if(n!=null)return await this.gitManager.createBranch(n),this.displayMessage(`Created new branch ${n}`),await((r=this.branchBar)==null?void 0:r.display()),n}async deleteBranch(){var i;if(!await this.isAllInitialized())return;let n=await this.gitManager.branchInfo();n.current&&n.branches.remove(n.current);let r=await new Xe(this,{options:n.branches,placeholder:"Delete branch",onlySelection:!0}).openAndGetResult();if(r!=null){let a=!1;if(!await this.gitManager.branchIsMerged(r)){let o=await new Xe(this,{options:["YES","NO"],placeholder:"This branch isn't merged into HEAD. Force delete?",onlySelection:!0}).openAndGetResult();if(o!=="YES")return;a=o==="YES"}return await this.gitManager.deleteBranch(r,a),this.displayMessage(`Deleted branch ${r}`),await((i=this.branchBar)==null?void 0:i.display()),r}}async remotesAreSet(){return this.settings.updateSubmodules||(await this.gitManager.branchInfo()).tracking?!0:(new _e.Notice("No upstream branch is set. Please select one."),await this.setUpstreamBranch())}async setUpstreamBranch(){let n=await this.selectRemoteBranch();return n==null?(this.displayError("Aborted. No upstream-branch is set!",1e4),this.setPluginState({gitAction:0}),!1):(await this.gitManager.updateUpstreamBranch(n),this.displayMessage(`Set upstream branch to ${n}`),this.setPluginState({gitAction:0}),!0)}async discardAll(){await this.gitManager.discardAll({status:this.cachedStatus}),new _e.Notice("All local changes have been discarded. New files remain untouched.")}async handleConflict(n){this.localStorage.setConflict(!0);let r;n!==void 0&&(r=["# Conflicts","Please resolve them and commit them using the commands `Git: Commit all changes` followed by `Git: Push`","(This file will automatically be deleted before commit)","[[#Additional Instructions]] available below file list","",...n.map(i=>{let a=this.app.vault.getAbstractFileByPath(i);return a instanceof _e.TFile?`- [[${this.app.metadataCache.fileToLinktext(a,"/")}]]`:`- Not a file: ${i}`}),` # Additional Instructions I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text. @@ -44196,135 +318,8 @@ I strongly recommend to use "Source mode" for viewing the conflicted files. For ======= File changes in remote repository >>>>>>> origin/main -\`\`\`` - ]; - } - this.writeAndOpenFile(lines == null ? void 0 : lines.join("\n")); - } - async editRemotes() { - if (!await this.isAllInitialized()) - return; - const remotes = await this.gitManager.getRemotes(); - const nameModal = new GeneralModal({ - options: remotes, - placeholder: "Select or create a new remote by typing its name and selecting it" - }); - const remoteName = await nameModal.open(); - if (remoteName) { - const oldUrl = await this.gitManager.getRemoteUrl(remoteName); - const urlModal = new GeneralModal({ initialValue: oldUrl }); - const remoteURL = await urlModal.open(); - if (remoteURL) { - await this.gitManager.setRemote(remoteName, remoteURL); - return remoteName; - } - } - } - async selectRemoteBranch() { - let remotes = await this.gitManager.getRemotes(); - let selectedRemote; - if (remotes.length === 0) { - selectedRemote = await this.editRemotes(); - if (selectedRemote == void 0) { - remotes = await this.gitManager.getRemotes(); - } - } - const nameModal = new GeneralModal({ - options: remotes, - placeholder: "Select or create a new remote by typing its name and selecting it" - }); - const remoteName = selectedRemote != null ? selectedRemote : await nameModal.open(); - if (remoteName) { - this.displayMessage("Fetching remote branches"); - await this.gitManager.fetch(remoteName); - const branches = await this.gitManager.getRemoteBranches( - remoteName - ); - const branchModal = new GeneralModal({ - options: branches, - placeholder: "Select or create a new remote branch by typing its name and selecting it" - }); - return await branchModal.open(); - } - } - async removeRemote() { - if (!await this.isAllInitialized()) - return; - const remotes = await this.gitManager.getRemotes(); - const nameModal = new GeneralModal({ - options: remotes, - placeholder: "Select a remote" - }); - const remoteName = await nameModal.open(); - if (remoteName) { - this.gitManager.removeRemote(remoteName); - } - } - async writeAndOpenFile(text2) { - if (text2 !== void 0) { - await this.app.vault.adapter.write(this.conflictOutputFile, text2); - } - let fileIsAlreadyOpened = false; - this.app.workspace.iterateAllLeaves((leaf) => { - if (leaf.getDisplayText() != "" && this.conflictOutputFile.startsWith(leaf.getDisplayText())) { - fileIsAlreadyOpened = true; - } - }); - if (!fileIsAlreadyOpened) { - this.app.workspace.openLinkText(this.conflictOutputFile, "/", true); - } - } - handleViewActiveState(leaf) { - var _a2, _b; - if (!(leaf == null ? void 0 : leaf.view.getState().file)) - return; - const sourceControlLeaf = this.app.workspace.getLeavesOfType(SOURCE_CONTROL_VIEW_CONFIG.type).first(); - const historyLeaf = this.app.workspace.getLeavesOfType(HISTORY_VIEW_CONFIG.type).first(); - (_a2 = sourceControlLeaf == null ? void 0 : sourceControlLeaf.view.containerEl.querySelector(`div.nav-file-title.is-active`)) == null ? void 0 : _a2.removeClass("is-active"); - (_b = historyLeaf == null ? void 0 : historyLeaf.view.containerEl.querySelector(`div.nav-file-title.is-active`)) == null ? void 0 : _b.removeClass("is-active"); - if ((leaf == null ? void 0 : leaf.view) instanceof DiffView) { - const path2 = leaf.view.state.file; - this.lastDiffViewState = leaf.view.getState(); - let el; - if (sourceControlLeaf && leaf.view.state.staged) { - el = sourceControlLeaf.view.containerEl.querySelector( - `div.staged div.nav-file-title[data-path='${path2}']` - ); - } else if (sourceControlLeaf && leaf.view.state.staged === false && !leaf.view.state.hash) { - el = sourceControlLeaf.view.containerEl.querySelector( - `div.changes div.nav-file-title[data-path='${path2}']` - ); - } else if (historyLeaf && leaf.view.state.hash) { - el = historyLeaf.view.containerEl.querySelector( - `div.nav-file-title[data-path='${path2}']` - ); - } - el == null ? void 0 : el.addClass("is-active"); - } else { - this.lastDiffViewState = void 0; - } - } - // region: displaying / formatting messages - displayMessage(message, timeout = 4 * 1e3) { - var _a2; - (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); - if (!this.settings.disablePopups) { - new import_obsidian30.Notice(message, 5 * 1e3); - } - console.log(`git obsidian message: ${message}`); - } - displayError(message, timeout = 10 * 1e3) { - var _a2; - if (message instanceof Errors.UserCanceledError) { - new import_obsidian30.Notice("Aborted"); - return; - } - message = message.toString(); - new import_obsidian30.Notice(message, timeout); - console.log(`git obsidian error: ${message}`); - (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); - } -}; +\`\`\``]),await this.tools.writeAndOpenFile(r==null?void 0:r.join(` +`))}async editRemotes(){if(!await this.isAllInitialized())return;let n=await this.gitManager.getRemotes(),i=await new Xe(this,{options:n,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(i){let a=await this.gitManager.getRemoteUrl(i),o=await new Xe(this,{initialValue:a}).openAndGetResult();if(o)return await this.gitManager.setRemote(i,o),i}}async selectRemoteBranch(){let n=await this.gitManager.getRemotes(),r;n.length===0&&(r=await this.editRemotes(),r==null&&(n=await this.gitManager.getRemotes()));let i=new Xe(this,{options:n,placeholder:"Select or create a new remote by typing its name and selecting it"}),a=r!=null?r:await i.openAndGetResult();if(a){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(a);let s=await this.gitManager.getRemoteBranches(a);return await new Xe(this,{options:s,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult()}}async removeRemote(){if(!await this.isAllInitialized())return;let n=await this.gitManager.getRemotes(),i=await new Xe(this,{options:n,placeholder:"Select a remote"}).openAndGetResult();i&&await this.gitManager.removeRemote(i)}handleViewActiveState(n){var a,s;if(!(n!=null&&n.view.getState().file))return;let r=this.app.workspace.getLeavesOfType(dt.type).first(),i=this.app.workspace.getLeavesOfType(nn.type).first();if((a=r==null?void 0:r.view.containerEl.querySelector("div.nav-file-title.is-active"))==null||a.removeClass("is-active"),(s=i==null?void 0:i.view.containerEl.querySelector("div.nav-file-title.is-active"))==null||s.removeClass("is-active"),(n==null?void 0:n.view)instanceof ga){let o=n.view.state.file;this.lastDiffViewState=n.view.getState();let l;r&&n.view.state.staged?l=r.view.containerEl.querySelector(`div.staged div.nav-file-title[data-path='${o}']`):r&&n.view.state.staged===!1&&!n.view.state.hash?l=r.view.containerEl.querySelector(`div.changes div.nav-file-title[data-path='${o}']`):i&&n.view.state.hash&&(l=i.view.containerEl.querySelector(`div.nav-file-title[data-path='${o}']`)),l==null||l.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(n){this.state.offlineMode?this.log("Encountered network error, but already in offline mode"):this.displayError("Git: Going into offline mode. Future network errors will no longer be displayed.",2e3),this.setPluginState({gitAction:0,offlineMode:!0})}displayMessage(n,r=4*1e3){var i;(i=this.statusBar)==null||i.displayMessage(n.toLowerCase(),r),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!n.startsWith("No changes"))&&new _e.Notice(n,5*1e3),this.log(n)}displayError(n,r=10*1e3){var a;if(n instanceof hs.UserCanceledError){new _e.Notice("Aborted");return}let i;n instanceof Error?i=n:i=new Error(String(n)),this.setPluginState({gitAction:0}),new _e.Notice(i.message,r),console.error(`${this.manifest.id}:`,i.stack),(a=this.statusBar)==null||a.displayMessage(i.message.toLowerCase(),r)}log(...n){console.log(`${this.manifest.id}:`,...n)}}; /*! Bundled license information: ieee754/index.js: @@ -44361,3 +356,5 @@ feather-icons/dist/feather.js: http://jedwatson.github.io/classnames *) */ + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json index 31fee23..504a694 100644 --- a/.obsidian/plugins/obsidian-git/manifest.json +++ b/.obsidian/plugins/obsidian-git/manifest.json @@ -1,9 +1,10 @@ { + "author": "Vinzent", + "authorUrl": "https://github.com/Vinzent03", "id": "obsidian-git", - "name": "Obsidian Git", - "description": "Backup your vault with Git.", + "name": "Git", + "description": "Integrate Git version control with automatic backup and other advanced features.", "isDesktopOnly": false, "fundingUrl": "https://ko-fi.com/vinzent", - "js": "main.js", - "version": "2.22.1" + "version": "2.28.2" } diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css index c1d5065..abe81d4 100644 --- a/.obsidian/plugins/obsidian-git/styles.css +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -8,20 +8,20 @@ } } -.workspace-leaf-content[data-type='git-view'] .button-border { +.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 { +.workspace-leaf-content[data-type="git-view"] .view-content { padding: 0; } -.workspace-leaf-content[data-type='git-history-view'] .view-content { +.workspace-leaf-content[data-type="git-history-view"] .view-content { padding: 0; } -.loading>svg { +.loading > svg { animation: 2s linear infinite loading; transform-origin: 50% 50%; display: inline-block; @@ -39,6 +39,10 @@ margin-right: auto; } +.obsidian-git-disabled { + opacity: 0.5; +} + .obsidian-git-center-button { display: block; margin: 20px auto; @@ -77,6 +81,22 @@ height: auto; } +.is-active .git-tools .buttons > * { + color: var(--nav-item-color-active); +} + +.git-author { + color: var(--text-accent); +} + +.git-date { + color: var(--text-accent); +} + +.git-ref { + color: var(--text-accent); +} + .workspace-leaf-content[data-type="diff-view"] .d2h-d-none { display: none; } @@ -228,12 +248,18 @@ } .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, -.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + del { background-color: #ffb6ba; } .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, -.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + del { background-color: #8d232881; } @@ -249,13 +275,19 @@ } .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, -.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + ins { background-color: #97f295; text-align: left; } .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, -.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + ins { background-color: #1d921996; text-align: left; } @@ -376,19 +408,31 @@ color: var(--text-normal); } -.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-del.d2h-change { background-color: #fdf2d0; } -.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-del.d2h-change { background-color: #55492480; } -.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-ins.d2h-change { background-color: #ded; } -.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-ins.d2h-change { background-color: rgba(37, 78, 37, 0.418); } @@ -401,7 +445,9 @@ text-decoration: none; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a:visited { +.workspace-leaf-content[data-type="diff-view"] + .d2h-file-list-wrapper + a:visited { color: #3572b0; } @@ -427,13 +473,13 @@ padding: 0; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li { +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li { border-bottom: 1px solid var(--background-modifier-border); margin: 0; padding: 5px 10px; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li:last-child { +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child { border-bottom: none; } @@ -501,12 +547,20 @@ background-color: var(--background-secondary); } -.cm-gutterElement.obs-git-blame-gutter > div, .line-author-settings-preview { +.cm-gutterElement.obs-git-blame-gutter > div, +.line-author-settings-preview { /* delegate text color to settings */ - color: var(--obs-git-gutter-text); + color: var(--obs-git-gutter-text); font-family: monospace; height: 100%; /* ensure, that age-based background color occupies entire parent */ text-align: right; padding: 0px 6px 0px 6px; white-space: pre; /* Keep spaces and do not collapse them. */ } + +@media (max-width: 800px) { + /* hide git blame gutter not to superpose text */ + .cm-gutterElement.obs-git-blame-gutter { + display: none; + } +} diff --git a/.obsidian/plugins/obsidian-kanban/main.js b/.obsidian/plugins/obsidian-kanban/main.js new file mode 100644 index 0000000..9090d50 --- /dev/null +++ b/.obsidian/plugins/obsidian-kanban/main.js @@ -0,0 +1,153 @@ +var sF=Object.create;var Vs=Object.defineProperty;var lF=Object.getOwnPropertyDescriptor;var uF=Object.getOwnPropertyNames;var cF=Object.getPrototypeOf,dF=Object.prototype.hasOwnProperty;var fF=(e,t,r)=>t in e?Vs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var hF=(e,t)=>()=>(e&&(t=e(e=0)),t);var wn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rf=(e,t)=>{for(var r in t)Vs(e,r,{get:t[r],enumerable:!0})},av=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of uF(t))!dF.call(e,i)&&i!==r&&Vs(e,i,{get:()=>t[i],enumerable:!(n=lF(t,i))||n.enumerable});return e};var Ct=(e,t,r)=>(r=e!=null?sF(cF(e)):{},av(t||!e||!e.__esModule?Vs(r,"default",{value:e,enumerable:!0}):r,e)),ov=e=>av(Vs({},"__esModule",{value:!0}),e);var ur=(e,t,r)=>(fF(e,typeof t!="symbol"?t+"":t,r),r);var ln=wn((hi,Zv)=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});function Qr(e){return typeof e=="object"&&!("toString"in e)?Object.prototype.toString.call(e).slice(8,-1):e}var eI=typeof process=="object"&&!0;function Vr(e,t){if(!e)throw eI?new Error("Invariant failed"):new Error(t())}hi.invariant=Vr;var nh=Object.prototype.hasOwnProperty,tI=Array.prototype.splice,nI=Object.prototype.toString;function Ua(e){return nI.call(e).slice(8,-1)}var bu=Object.assign||function(e,t){return rh(t).forEach(function(r){nh.call(t,r)&&(e[r]=t[r])}),e},rh=typeof Object.getOwnPropertySymbols=="function"?function(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.keys(e)};function sa(e){return Array.isArray(e)?bu(e.constructor(e.length),e):Ua(e)==="Map"?new Map(e):Ua(e)==="Set"?new Set(e):e&&typeof e=="object"?bu(Object.create(Object.getPrototypeOf(e)),e):e}var Gv=function(){function e(){this.commands=bu({},rI),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(t,r){return t===r},this.update.newContext=function(){return new e().update}}return Object.defineProperty(e.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(t){this.update.isEquals=t},enumerable:!0,configurable:!0}),e.prototype.extend=function(t,r){this.commands[t]=r},e.prototype.update=function(t,r){var n=this,i=typeof r=="function"?{$apply:r}:r;Array.isArray(t)&&Array.isArray(i)||Vr(!Array.isArray(i),function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."}),Vr(typeof i=="object"&&i!==null,function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the "+("following commands: "+Object.keys(n.commands).join(", ")+".")});var a=t;return rh(i).forEach(function(o){if(nh.call(n.commands,o)){var s=t===a;a=n.commands[o](i[o],a,i,t),s&&n.isEquals(a,t)&&(a=t)}else{var u=Ua(t)==="Map"?n.update(t.get(o),i[o]):n.update(t[o],i[o]),l=Ua(a)==="Map"?a.get(o):a[o];(!n.isEquals(u,l)||typeof u=="undefined"&&!nh.call(t,o))&&(a===t&&(a=sa(t)),Ua(a)==="Map"?a.set(o,u):a[o]=u)}}),a},e}();hi.Context=Gv;var rI={$push:function(e,t,r){return jv(t,r,"$push"),e.length?t.concat(e):t},$unshift:function(e,t,r){return jv(t,r,"$unshift"),e.length?e.concat(t):t},$splice:function(e,t,r,n){return iI(t,r),e.forEach(function(i){Jv(i),t===n&&i.length&&(t=sa(n)),tI.apply(t,i)}),t},$set:function(e,t,r){return oI(r),e},$toggle:function(e,t){zs(e,"$toggle");var r=e.length?sa(t):t;return e.forEach(function(n){r[n]=!t[n]}),r},$unset:function(e,t,r,n){return zs(e,"$unset"),e.forEach(function(i){Object.hasOwnProperty.call(t,i)&&(t===n&&(t=sa(n)),delete t[i])}),t},$add:function(e,t,r,n){return qv(t,"$add"),zs(e,"$add"),Ua(t)==="Map"?e.forEach(function(i){var a=i[0],o=i[1];t===n&&t.get(a)!==o&&(t=sa(n)),t.set(a,o)}):e.forEach(function(i){t===n&&!t.has(i)&&(t=sa(n)),t.add(i)}),t},$remove:function(e,t,r,n){return qv(t,"$remove"),zs(e,"$remove"),e.forEach(function(i){t===n&&t.has(i)&&(t=sa(n)),t.delete(i)}),t},$merge:function(e,t,r,n){return sI(t,e),rh(e).forEach(function(i){e[i]!==t[i]&&(t===n&&(t=sa(n)),t[i]=e[i])}),t},$apply:function(e,t){return aI(e),e(t)}},ih=new Gv;hi.isEquals=ih.update.isEquals;hi.extend=ih.extend;hi.default=ih.update;hi.default.default=Zv.exports=bu(hi.default,hi);function jv(e,t,r){Vr(Array.isArray(e),function(){return"update(): expected target of "+Qr(r)+" to be an array; got "+Qr(e)+"."}),zs(t[r],r)}function zs(e,t){Vr(Array.isArray(e),function(){return"update(): expected spec of "+Qr(t)+" to be an array; got "+Qr(e)+". Did you forget to wrap your parameter in an array?"})}function iI(e,t){Vr(Array.isArray(e),function(){return"Expected $splice target to be an array; got "+Qr(e)}),Jv(t.$splice)}function Jv(e){Vr(Array.isArray(e),function(){return"update(): expected spec of $splice to be an array of arrays; got "+Qr(e)+". Did you forget to wrap your parameters in an array?"})}function aI(e){Vr(typeof e=="function",function(){return"update(): expected spec of $apply to be a function; got "+Qr(e)+"."})}function oI(e){Vr(Object.keys(e).length===1,function(){return"Cannot have more than one key in an object with $set"})}function sI(e,t){Vr(t&&typeof t=="object",function(){return"update(): $merge expects a spec of type 'object'; got "+Qr(t)}),Vr(e&&typeof e=="object",function(){return"update(): $merge expects a target of type 'object'; got "+Qr(e)})}function qv(e,t){var r=Ua(e);Vr(r==="Map"||r==="Set",function(){return"update(): "+Qr(t)+" expects a target of type Set or Map; got "+Qr(r)})}});var tw=wn((JB,ew)=>{"use strict";var lI=function(t){return uI(t)&&!cI(t)};function uI(e){return!!e&&typeof e=="object"}function cI(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||hI(e)}var dI=typeof Symbol=="function"&&Symbol.for,fI=dI?Symbol.for("react.element"):60103;function hI(e){return e.$$typeof===fI}function mI(e){return Array.isArray(e)?[]:{}}function Ks(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Mo(mI(e),e,t):e}function pI(e,t,r){return e.concat(t).map(function(n){return Ks(n,r)})}function gI(e,t){if(!t.customMerge)return Mo;var r=t.customMerge(e);return typeof r=="function"?r:Mo}function yI(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Qv(e){return Object.keys(e).concat(yI(e))}function Xv(e,t){try{return t in e}catch(r){return!1}}function vI(e,t){return Xv(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function wI(e,t,r){var n={};return r.isMergeableObject(e)&&Qv(e).forEach(function(i){n[i]=Ks(e[i],r)}),Qv(t).forEach(function(i){vI(e,i)||(Xv(e,i)&&r.isMergeableObject(t[i])?n[i]=gI(i,r)(e[i],t[i],r):n[i]=Ks(t[i],r))}),n}function Mo(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||pI,r.isMergeableObject=r.isMergeableObject||lI,r.cloneUnlessOtherwiseSpecified=Ks;var n=Array.isArray(t),i=Array.isArray(e),a=n===i;return a?n?r.arrayMerge(e,t,r):wI(e,t,r):Ks(t,r)}Mo.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return Mo(n,i,r)},{})};var bI=Mo;ew.exports=bI});var Db=wn((FU,Ch)=>{"use strict";var JA=Object.prototype.hasOwnProperty,cr="~";function al(){}Object.create&&(al.prototype=Object.create(null),new al().__proto__||(cr=!1));function ZA(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function bb(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var a=new ZA(r,n||e,i),o=cr?cr+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],a]:e._events[o].push(a):(e._events[o]=a,e._eventsCount++),e}function Ru(e,t){--e._eventsCount===0?e._events=new al:delete e._events[t]}function Xn(){this._events=new al,this._eventsCount=0}Xn.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)JA.call(r,n)&&t.push(cr?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};Xn.prototype.listeners=function(t){var r=cr?cr+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i{"use strict";"use restrict";var Ih=32;dn.INT_BITS=Ih;dn.INT_MAX=2147483647;dn.INT_MIN=-1<0)-(e<0)};dn.abs=function(e){var t=e>>Ih-1;return(e^t)-t};dn.min=function(e,t){return t^(e^t)&-(e65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1};dn.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0};dn.popCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24};function Fb(e){var t=32;return e&=-e,e&&t--,e&65535&&(t-=16),e&16711935&&(t-=8),e&252645135&&(t-=4),e&858993459&&(t-=2),e&1431655765&&(t-=1),t}dn.countTrailingZeros=Fb;dn.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1};dn.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)};dn.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var ll=new Array(256);(function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=r&1,--i;e[t]=n<>>8&255]<<16|ll[e>>>16&255]<<8|ll[e>>>24&255]};dn.interleave2=function(e,t){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t&=65535,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1};dn.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=(e|e>>>1)&858993459,e=(e|e>>>2)&252645135,e=(e|e>>>4)&16711935,e=(e|e>>>16)&65535,e<<16>>16};dn.interleave3=function(e,t,r){return e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,e|=t<<1,r&=1023,r=(r|r<<16)&4278190335,r=(r|r<<8)&251719695,r=(r|r<<4)&3272356035,r=(r|r<<2)&1227133513,e|r<<2};dn.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=(e|e>>>2)&3272356035,e=(e|e>>>4)&251719695,e=(e|e>>>8)&4278190335,e=(e|e>>>16)&1023,e<<22>>22};dn.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>Fb(e)+1}});var Ob=wn((lW,Ab)=>{"use strict";function Ib(e,t,r){var n=e[r]|0;if(n<=0)return[];var i=new Array(n),a;if(r===e.length-1)for(a=0;a0)return tO(e|0,t);break;case"object":if(typeof e.length=="number")return Ib(e,t,0);break}return[]}Ab.exports=nO});var eD={};Rf(eD,{Buffer:()=>fe,INSPECT_MAX_BYTES:()=>$b,SlowBuffer:()=>mO,isBuffer:()=>Qb,kMaxLength:()=>uO});function Hb(){Oh=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");a=e[s-2]==="="?2:e[s-1]==="="?1:0,o=new rO(s*3/4-a),n=a>0?s-4:s;var u=0;for(t=0,r=0;t>16&255,o[u++]=i>>8&255,o[u++]=i&255;return a===2?(i=Wr[e.charCodeAt(t)]<<2|Wr[e.charCodeAt(t+1)]>>4,o[u++]=i&255):a===1&&(i=Wr[e.charCodeAt(t)]<<10|Wr[e.charCodeAt(t+1)]<<4|Wr[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=i&255),o}function aO(e){return wi[e>>18&63]+wi[e>>12&63]+wi[e>>6&63]+wi[e&63]}function oO(e,t,r){for(var n,i=[],a=t;au?u:s+o));return n===1?(t=e[r-1],i+=wi[t>>2],i+=wi[t<<4&63],i+="=="):n===2&&(t=(e[r-2]<<8)+e[r-1],i+=wi[t>>10],i+=wi[t>>4&63],i+=wi[t<<2&63],i+="="),a.push(i),a.join("")}function Ku(e,t,r,n,i){var a,o,s=i*8-n-1,u=(1<>1,c=-7,d=r?i-1:0,m=r?-1:1,h=e[t+d];for(d+=m,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=a*256+e[t+d],d+=m,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=o*256+e[t+d],d+=m,c-=8);if(a===0)a=1-l;else{if(a===u)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(h?-1:1)*o*Math.pow(2,a-n)}function Bb(e,t,r,n,i,a){var o,s,u,l=a*8-i-1,c=(1<>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,g=n?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+d>=1?t+=m/u:t+=m*Math.pow(2,1-d),t*u>=2&&(o++,u/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o=o+d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(o=o<0;e[r+h]=o&255,h+=g,o/=256,l-=8);e[r+h-g]|=y*128}function Yu(){return fe.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Wi(e,t){if(Yu()=Yu())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Yu().toString(16)+" bytes");return e|0}function mO(e){return+e!=e&&(e=0),fe.alloc(+e)}function bi(e){return!!(e!=null&&e._isBuffer)}function Yb(e,t){if(bi(e))return e.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var r=e.length;if(r===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return zu(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Zb(e).length;default:if(n)return zu(e).length;t=(""+t).toLowerCase(),n=!0}}function pO(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return xO(this,t,r);case"utf8":case"utf-8":return jb(this,t,r);case"ascii":return EO(this,t,r);case"latin1":case"binary":return kO(this,t,r);case"base64":return DO(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return CO(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Ga(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function zb(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=fe.from(t,n)),bi(t))return t.length===0?-1:Nb(e,t,r,n,i);if(typeof t=="number")return t=t&255,fe.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Nb(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Nb(e,t,r,n,i){var a=1,o=e.length,s=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,r/=2}function u(h,g){return a===1?h[g]:h.readUInt16BE(g*a)}var l;if(i){var c=-1;for(l=r;lo&&(r=o-s),l=r;l>=0;l--){for(var d=!0,m=0;mi&&(n=i)):n=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var u,l,c,d;switch(s){case 1:a<128&&(o=a);break;case 2:u=e[i+1],(u&192)===128&&(d=(a&31)<<6|u&63,d>127&&(o=d));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(d=(a&15)<<12|(u&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(d=(a&15)<<18|(u&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return SO(n)}function SO(e){var t=e.length;if(t<=Rb)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function gr(e,t,r,n,i,a){if(!bi(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function ju(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}function qu(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}function qb(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Gb(e,t,r,n,i){return i||qb(e,t,r,4),Bb(e,t,r,n,23,4),r+4}function Jb(e,t,r,n,i){return i||qb(e,t,r,8),Bb(e,t,r,n,52,8),r+8}function MO(e){if(e=TO(e).replace(_O,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function TO(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function FO(e){return e<16?"0"+e.toString(16):e.toString(16)}function zu(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function IO(e){for(var t=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function Zb(e){return iO(MO(e))}function Gu(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function OO(e){return e!==e}function Qb(e){return e!=null&&(!!e._isBuffer||Xb(e)||LO(e))}function Xb(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function LO(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Xb(e.slice(0,0))}var wi,Wr,rO,Oh,sO,Vb,$b,Pb,lO,uO,Rb,_O,tD=hF(()=>{wi=[],Wr=[],rO=typeof Uint8Array!="undefined"?Uint8Array:Array,Oh=!1;sO={}.toString,Vb=Array.isArray||function(e){return sO.call(e)=="[object Array]"};$b=50,Pb=window;fe.TYPED_ARRAY_SUPPORT=Pb.TYPED_ARRAY_SUPPORT!==void 0?Pb.TYPED_ARRAY_SUPPORT:!0;lO=Yu(),uO=lO;fe.poolSize=8192;fe._augment=function(e){return e.__proto__=fe.prototype,e};fe.from=function(e,t,r){return Ub(null,e,t,r)};fe.TYPED_ARRAY_SUPPORT&&(fe.prototype.__proto__=Uint8Array.prototype,fe.__proto__=Uint8Array);fe.alloc=function(e,t,r){return cO(null,e,t,r)};fe.allocUnsafe=function(e){return Lh(null,e)};fe.allocUnsafeSlow=function(e){return Lh(null,e)};fe.isBuffer=Qb;fe.compare=function(t,r){if(!bi(t)||!bi(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,a=0,o=Math.min(n,i);a0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""};fe.prototype.compare=function(t,r,n,i,a){if(!bi(t))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var o=a-i,s=n-r,u=Math.min(o,s),l=this.slice(i,a),c=t.slice(r,n),d=0;da)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return gO(this,t,r,n);case"utf8":case"utf-8":return yO(this,t,r,n);case"ascii":return Kb(this,t,r,n);case"latin1":case"binary":return vO(this,t,r,n);case"base64":return wO(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bO(this,t,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};fe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Rb=4096;fe.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(a*=256);)i+=this[t+--r]*a;return i};fe.prototype.readUInt8=function(t,r){return r||Pn(t,1,this.length),this[t]};fe.prototype.readUInt16LE=function(t,r){return r||Pn(t,2,this.length),this[t]|this[t+1]<<8};fe.prototype.readUInt16BE=function(t,r){return r||Pn(t,2,this.length),this[t]<<8|this[t+1]};fe.prototype.readUInt32LE=function(t,r){return r||Pn(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};fe.prototype.readUInt32BE=function(t,r){return r||Pn(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};fe.prototype.readIntLE=function(t,r,n){t=t|0,r=r|0,n||Pn(t,r,this.length);for(var i=this[t],a=1,o=0;++o=a&&(i-=Math.pow(2,8*r)),i};fe.prototype.readIntBE=function(t,r,n){t=t|0,r=r|0,n||Pn(t,r,this.length);for(var i=r,a=1,o=this[t+--i];i>0&&(a*=256);)o+=this[t+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*r)),o};fe.prototype.readInt8=function(t,r){return r||Pn(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};fe.prototype.readInt16LE=function(t,r){r||Pn(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};fe.prototype.readInt16BE=function(t,r){r||Pn(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};fe.prototype.readInt32LE=function(t,r){return r||Pn(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};fe.prototype.readInt32BE=function(t,r){return r||Pn(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};fe.prototype.readFloatLE=function(t,r){return r||Pn(t,4,this.length),Ku(this,t,!0,23,4)};fe.prototype.readFloatBE=function(t,r){return r||Pn(t,4,this.length),Ku(this,t,!1,23,4)};fe.prototype.readDoubleLE=function(t,r){return r||Pn(t,8,this.length),Ku(this,t,!0,52,8)};fe.prototype.readDoubleBE=function(t,r){return r||Pn(t,8,this.length),Ku(this,t,!1,52,8)};fe.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;gr(this,t,r,n,a,0)}var o=1,s=0;for(this[r]=t&255;++s=0&&(s*=256);)this[r+o]=t/s&255;return r+n};fe.prototype.writeUInt8=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,1,255,0),fe.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=t&255,r+1};fe.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,65535,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):ju(this,t,r,!0),r+2};fe.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,65535,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):ju(this,t,r,!1),r+2};fe.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,4294967295,0),fe.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255):qu(this,t,r,!0),r+4};fe.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,4294967295,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):qu(this,t,r,!1),r+4};fe.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r|0,!i){var a=Math.pow(2,8*n-1);gr(this,t,r,n,a-1,-a)}var o=0,s=1,u=0;for(this[r]=t&255;++o>0)-u&255;return r+n};fe.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r|0,!i){var a=Math.pow(2,8*n-1);gr(this,t,r,n,a-1,-a)}var o=n-1,s=1,u=0;for(this[r+o]=t&255;--o>=0&&(s*=256);)t<0&&u===0&&this[r+o+1]!==0&&(u=1),this[r+o]=(t/s>>0)-u&255;return r+n};fe.prototype.writeInt8=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,1,127,-128),fe.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=t&255,r+1};fe.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,32767,-32768),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):ju(this,t,r,!0),r+2};fe.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,32767,-32768),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):ju(this,t,r,!1),r+2};fe.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,2147483647,-2147483648),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):qu(this,t,r,!0),r+4};fe.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):qu(this,t,r,!1),r+4};fe.prototype.writeFloatLE=function(t,r,n){return Gb(this,t,r,!0,n)};fe.prototype.writeFloatBE=function(t,r,n){return Gb(this,t,r,!1,n)};fe.prototype.writeDoubleLE=function(t,r,n){return Jb(this,t,r,!0,n)};fe.prototype.writeDoubleBE=function(t,r,n){return Jb(this,t,r,!1,n)};fe.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r=0;--o)t[o+r]=this[o+n];else if(a<1e3||!fe.TYPED_ARRAY_SUPPORT)for(o=0;o>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var o;if(typeof t=="number")for(o=r;o{var Ja=(tD(),ov(eD));if(Ja&&Ja.default){Ju.exports=Ja.default;for(let e in Ja)Ju.exports[e]=Ja[e]}else Ja&&(Ju.exports=Ja)});var Xu=wn(bt=>{"use strict";var pa=Wu(),Wn=Ob(),rD=nD().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:Wn([32,0]),UINT16:Wn([32,0]),UINT32:Wn([32,0]),BIGUINT64:Wn([32,0]),INT8:Wn([32,0]),INT16:Wn([32,0]),INT32:Wn([32,0]),BIGINT64:Wn([32,0]),FLOAT:Wn([32,0]),DOUBLE:Wn([32,0]),DATA:Wn([32,0]),UINT8C:Wn([32,0]),BUFFER:Wn([32,0])});var PO=typeof Uint8ClampedArray!="undefined",NO=typeof BigUint64Array!="undefined",RO=typeof BigInt64Array!="undefined",Sn=window.__TYPEDARRAY_POOL;Sn.UINT8C||(Sn.UINT8C=Wn([32,0]));Sn.BIGUINT64||(Sn.BIGUINT64=Wn([32,0]));Sn.BIGINT64||(Sn.BIGINT64=Wn([32,0]));Sn.BUFFER||(Sn.BUFFER=Wn([32,0]));var Zu=Sn.DATA,Qu=Sn.BUFFER;bt.free=function(t){if(rD.isBuffer(t))Qu[pa.log2(t.length)].push(t);else{if(Object.prototype.toString.call(t)!=="[object ArrayBuffer]"&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,n=pa.log2(r)|0;Zu[n].push(t)}};function iD(e){if(e){var t=e.length||e.byteLength,r=pa.log2(t);Zu[r].push(e)}}function HO(e){iD(e.buffer)}bt.freeUint8=bt.freeUint16=bt.freeUint32=bt.freeBigUint64=bt.freeInt8=bt.freeInt16=bt.freeInt32=bt.freeBigInt64=bt.freeFloat32=bt.freeFloat=bt.freeFloat64=bt.freeDouble=bt.freeUint8Clamped=bt.freeDataView=HO;bt.freeArrayBuffer=iD;bt.freeBuffer=function(t){Qu[pa.log2(t.length)].push(t)};bt.malloc=function(t,r){if(r===void 0||r==="arraybuffer")return yr(t);switch(r){case"uint8":return Nh(t);case"uint16":return aD(t);case"uint32":return oD(t);case"int8":return sD(t);case"int16":return lD(t);case"int32":return uD(t);case"float":case"float32":return cD(t);case"double":case"float64":return dD(t);case"uint8_clamped":return fD(t);case"bigint64":return mD(t);case"biguint64":return hD(t);case"buffer":return gD(t);case"data":case"dataview":return pD(t);default:return null}return null};function yr(t){var t=pa.nextPow2(t),r=pa.log2(t),n=Zu[r];return n.length>0?n.pop():new ArrayBuffer(t)}bt.mallocArrayBuffer=yr;function Nh(e){return new Uint8Array(yr(e),0,e)}bt.mallocUint8=Nh;function aD(e){return new Uint16Array(yr(2*e),0,e)}bt.mallocUint16=aD;function oD(e){return new Uint32Array(yr(4*e),0,e)}bt.mallocUint32=oD;function sD(e){return new Int8Array(yr(e),0,e)}bt.mallocInt8=sD;function lD(e){return new Int16Array(yr(2*e),0,e)}bt.mallocInt16=lD;function uD(e){return new Int32Array(yr(4*e),0,e)}bt.mallocInt32=uD;function cD(e){return new Float32Array(yr(4*e),0,e)}bt.mallocFloat32=bt.mallocFloat=cD;function dD(e){return new Float64Array(yr(8*e),0,e)}bt.mallocFloat64=bt.mallocDouble=dD;function fD(e){return PO?new Uint8ClampedArray(yr(e),0,e):Nh(e)}bt.mallocUint8Clamped=fD;function hD(e){return NO?new BigUint64Array(yr(8*e),0,e):null}bt.mallocBigUint64=hD;function mD(e){return RO?new BigInt64Array(yr(8*e),0,e):null}bt.mallocBigInt64=mD;function pD(e){return new DataView(yr(e),0,e)}bt.mallocDataView=pD;function gD(e){e=pa.nextPow2(e);var t=pa.log2(e),r=Qu[t];return r.length>0?r.pop():new rD(e)}bt.mallocBuffer=gD;bt.clearCache=function(){for(var t=0;t<32;++t)Sn.UINT8[t].length=0,Sn.UINT16[t].length=0,Sn.UINT32[t].length=0,Sn.INT8[t].length=0,Sn.INT16[t].length=0,Sn.INT32[t].length=0,Sn.FLOAT[t].length=0,Sn.DOUBLE[t].length=0,Sn.BIGUINT64[t].length=0,Sn.BIGINT64[t].length=0,Sn.UINT8C[t].length=0,Zu[t].length=0,Qu[t].length=0}});var DD=wn((dW,bD)=>{"use strict";bD.exports=BO;var tc=32;function BO(e,t){t<=4*tc?nc(0,t-1,e):rc(0,t-1,e)}function nc(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,u=n-2;s-- >e;){var l=r[u-2],c=r[u-1];if(lr[t+1]:!0}function ec(e,t,r,n){e*=2;var i=n[e];return i>1,s=o-n,u=o+n,l=i,c=s,d=o,m=u,h=a,g=e+1,y=t-1,v=0;Yi(l,c,r)&&(v=l,l=c,c=v),Yi(m,h,r)&&(v=m,m=h,h=v),Yi(l,d,r)&&(v=l,l=d,d=v),Yi(c,d,r)&&(v=c,c=d,d=v),Yi(l,m,r)&&(v=l,l=m,m=v),Yi(d,m,r)&&(v=d,d=m,m=v),Yi(c,h,r)&&(v=c,c=h,h=v),Yi(c,d,r)&&(v=c,c=d,d=v),Yi(m,h,r)&&(v=m,m=h,h=v);for(var D=r[2*c],I=r[2*c+1],C=r[2*m],x=r[2*m+1],O=2*l,A=2*d,P=2*h,B=2*i,G=2*o,J=2*a,Q=0;Q<2;++Q){var oe=r[O+Q],te=r[A+Q],re=r[P+Q];r[B+Q]=oe,r[G+Q]=te,r[J+Q]=re}vD(s,e,r),vD(u,t,r);for(var ne=g;ne<=y;++ne)if(ec(ne,D,I,r))ne!==g&&yD(ne,g,r),++g;else if(!ec(ne,C,x,r))for(;;)if(ec(y,C,x,r)){ec(y,D,I,r)?(VO(ne,g,y,r),++g,--y):(yD(ne,y,r),--y);break}else{if(--y{"use strict";SD.exports={init:UO,sweepBipartite:WO,sweepComplete:YO,scanBipartite:zO,scanComplete:KO};var En=Xu(),$O=Wu(),ic=DD(),Fr=1<<28,Qa=1024,Yn=En.mallocInt32(Qa),zi=En.mallocInt32(Qa),Ki=En.mallocInt32(Qa),Za=En.mallocInt32(Qa),Uo=En.mallocInt32(Qa),ul=En.mallocInt32(Qa),dt=En.mallocDouble(Qa*8);function UO(e){var t=$O.nextPow2(e);Yn.length>>1;ic(dt,I);for(var C=0,x=0,g=0;g=Fr)O=O-Fr|0,Wo(Ki,Za,x--,O);else if(O>=0)Wo(Yn,zi,C--,O);else if(O<=-Fr){O=-O-Fr|0;for(var A=0;A>>1;ic(dt,I);for(var C=0,x=0,O=0,g=0;g>1===dt[2*g+3]>>1&&(P=2,g+=1),A<0){for(var B=-(A>>1)-1,G=0;G>1)-1;P===0?Wo(Yn,zi,C--,B):P===1?Wo(Ki,Za,x--,B):P===2&&Wo(Uo,ul,O--,B)}}}function zO(e,t,r,n,i,a,o,s,u,l,c,d){var m=0,h=2*e,g=t,y=t+e,v=1,D=1;n?D=Fr:v=Fr;for(var I=i;I>>1;ic(dt,A);for(var P=0,I=0;I=Fr?(G=!n,C-=Fr):(G=!!n,C-=1),G)Yo(Yn,zi,P++,C);else{var J=d[C],Q=h*C,oe=c[Q+t+1],te=c[Q+t+1+e];e:for(var re=0;re>>1;ic(dt,C);for(var x=0,y=0;y=Fr)Yn[x++]=v-Fr;else{v-=1;var A=c[v],P=m*v,B=l[P+t+1],G=l[P+t+1+e];e:for(var J=0;J=0;--J)if(Yn[J]===v){for(var re=J+1;re{"use strict";var Xa="d",jo="ax",ED="vv",Hh="fp",cl="es",ac="rs",Uh="re",dl="rb",kD="ri",zo="rp",oc="bs",Wh="be",fl="bb",xD="bi",Ko="bp",Bh="rv",Vh="Q",$h=[Xa,jo,ED,ac,Uh,dl,kD,oc,Wh,fl,xD];function jO(e,t,r){var n="bruteForce"+(e?"Red":"Blue")+(t?"Flip":"")+(r?"Full":""),i=["function ",n,"(",$h.join(),"){","var ",cl,"=2*",Xa,";"],a="for(var i="+ac+","+zo+"="+cl+"*"+ac+";i<"+Uh+";++i,"+zo+"+="+cl+"){var x0="+dl+"["+jo+"+"+zo+"],x1="+dl+"["+jo+"+"+zo+"+"+Xa+"],xi="+kD+"[i];",o="for(var j="+oc+","+Ko+"="+cl+"*"+oc+";j<"+Wh+";++j,"+Ko+"+="+cl+"){var y0="+fl+"["+jo+"+"+Ko+"],"+(r?"y1="+fl+"["+jo+"+"+Ko+"+"+Xa+"],":"")+"yi="+xD+"[j];";return e?i.push(a,Vh,":",o):i.push(o,Vh,":",a),r?i.push("if(y1"+Wh+"-"+oc+"){"),e?(a(!0,!1),i.push("}else{"),a(!1,!1)):(i.push("if("+Hh+"){"),a(!0,!0),i.push("}else{"),a(!0,!1),i.push("}}else{if("+Hh+"){"),a(!1,!0),i.push("}else{"),a(!1,!1),i.push("}")),i.push("}}return "+t);var o=r.join("")+i.join(""),s=new Function(o);return s()}Yh.partial=CD(!1);Yh.full=CD(!0)});var zh=wn((mW,MD)=>{"use strict";MD.exports=GO;var qO="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m";function GO(e,t){var r="abcdef".split("").concat(t),n=[];return e.indexOf("lo")>=0&&n.push("lo=e[k+n]"),e.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(qO.replace("_",n.join()).replace("$",e)),Function.apply(void 0,r)}});var ID=wn((pW,FD)=>{"use strict";FD.exports=XO;var JO=zh(),TD=JO("lor&&i[d+t]>l;--c,d-=o){for(var m=d,h=d+o,g=0;g>>1,l=2*e,c=u,d=i[l*u+t];o=v?(c=y,d=v):g>=I?(c=h,d=g):(c=D,d=I):v>=I?(c=y,d=v):I>=g?(c=h,d=g):(c=D,d=I);for(var O=l*(s-1),A=l*c,C=0;C{"use strict";RD.exports=fL;var qo=Xu(),Kh=Wu(),PD=_D(),eL=PD.partial,tL=PD.full,ga=Rh(),nL=ID(),Go=zh(),AD=128,rL=1<<22,iL=1<<22,aL=Go("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),OD=Go("lo===p0",["p0"]),oL=Go("lo0;){l-=1;var m=l*jh,h=dr[m],g=dr[m+1],y=dr[m+2],v=dr[m+3],D=dr[m+4],I=dr[m+5],C=l*qh,x=eo[C],O=eo[C+1],A=I&1,P=!!(I&16),B=i,G=a,J=s,Q=u;if(A&&(B=s,G=u,J=i,Q=a),!(I&2&&(y=oL(e,h,g,y,B,G,O),g>=y))&&!(I&4&&(g=sL(e,h,g,y,B,G,x),g>=y))){var oe=y-g,te=D-v;if(P){if(e*oe*(oe+te){"use strict";$D.exports=yL;var ya=Xu(),sc=Rh(),hL=HD();function mL(e,t){for(var r=0;r>>1;if(!(o<=0)){var s,u=ya.mallocDouble(2*o*i),l=ya.mallocInt32(i);if(i=BD(e,o,u,l),i>0){if(o===1&&n)sc.init(i),s=sc.sweepComplete(o,r,0,i,u,l,0,i,u,l);else{var c=ya.mallocDouble(2*o*a),d=ya.mallocInt32(a);a=BD(t,o,c,d),a>0&&(sc.init(i+a),o===1?s=sc.sweepBipartite(o,r,0,i,u,l,0,a,c,d):s=hL(o,r,n,i,u,l,a,c,d),ya.free(c),ya.free(d))}ya.free(u),ya.free(l)}return s}}}var hl;function VD(e,t){hl.push([e,t])}function pL(e){return hl=[],lc(e,e,VD,!0),hl}function gL(e,t){return hl=[],lc(e,t,VD,!1),hl}function yL(e,t,r){var n;switch(arguments.length){case 1:return pL(e);case 2:return typeof t=="function"?lc(e,e,t,!0):gL(e,t);case 3:return lc(e,t,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}});var o0=wn(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});var on=require("obsidian"),Zh="YYYY-MM-DD",Qh="gggg-[W]ww",jD="YYYY-MM",qD="YYYY-[Q]Q",GD="YYYY";function pl(e){var r,n;let t=window.app.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r[e])==null?void 0:n.enabled)}function gl(){var e,t,r,n;try{let{internalPlugins:i,plugins:a}=window.app;if(pl("daily")){let{format:l,folder:c,template:d}=((t=(e=a.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:l||Zh,folder:(c==null?void 0:c.trim())||"",template:(d==null?void 0:d.trim())||""}}let{folder:o,format:s,template:u}=((n=(r=i.getPluginById("daily-notes"))==null?void 0:r.instance)==null?void 0:n.options)||{};return{format:s||Zh,folder:(o==null?void 0:o.trim())||"",template:(u==null?void 0:u.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function yl(){var e,t,r,n,i,a,o;try{let s=window.app.plugins,u=(e=s.getPlugin("calendar"))==null?void 0:e.options,l=(r=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.weekly;if(pl("weekly"))return{format:l.format||Qh,folder:((n=l.folder)==null?void 0:n.trim())||"",template:((i=l.template)==null?void 0:i.trim())||""};let c=u||{};return{format:c.weeklyNoteFormat||Qh,folder:((a=c.weeklyNoteFolder)==null?void 0:a.trim())||"",template:((o=c.weeklyNoteTemplate)==null?void 0:o.trim())||""}}catch(s){console.info("No custom weekly note settings found!",s)}}function vl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("monthly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.monthly)||{};return{format:a.format||jD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom monthly note settings found!",a)}}function wl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("quarterly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.quarterly)||{};return{format:a.format||qD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom quarterly note settings found!",a)}}function bl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("yearly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.yearly)||{};return{format:a.format||GD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom yearly note settings found!",a)}}function JD(...e){let t=[];for(let n=0,i=e.length;n{let I=n(),C=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return g&&C.add(parseInt(y,10),v),D?C.format(D.substring(1).trim()):C.format(a)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(a)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(a)));return t.foldManager.save(d,u),d}catch(d){console.error(`Failed to create file: '${c}'`,d),new on.Notice("Unable to create new file.")}}function AL(e,t){var r;return(r=t[ni(e,"day")])!=null?r:null}function OL(){let{vault:e}=window.app,{folder:t}=gl(),r=e.getAbstractFileByPath(on.normalizePath(t));if(!r)throw new Xh("Failed to find daily notes folder");let n={};return on.Vault.recurseChildren(r,i=>{if(i instanceof on.TFile){let a=Zo(i,"day");if(a){let o=ni(a,"day");n[o]=i}}}),n}var em=class extends Error{};function LL(){let{moment:e}=window,t=e.localeData()._week.dow,r=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)r.push(r.shift()),t--;return r}function PL(e){return LL().indexOf(e.toLowerCase())}async function e0(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=yl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*title\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(c,d,m)=>{let h=PL(d);return e.weekday(h).format(m.trim())}));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function NL(e,t){var r;return(r=t[ni(e,"week")])!=null?r:null}function RL(){let e={};if(!n0())return e;let{vault:t}=window.app,{folder:r}=yl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new em("Failed to find weekly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"week");if(a){let o=ni(a,"week");e[o]=i}}}),e}var tm=class extends Error{};async function t0(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=vl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function HL(e,t){var r;return(r=t[ni(e,"month")])!=null?r:null}function BL(){let e={};if(!r0())return e;let{vault:t}=window.app,{folder:r}=vl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new tm("Failed to find monthly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"month");if(a){let o=ni(a,"month");e[o]=i}}}),e}var nm=class extends Error{};async function VL(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=wl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function $L(e,t){var r;return(r=t[ni(e,"quarter")])!=null?r:null}function UL(){let e={};if(!i0())return e;let{vault:t}=window.app,{folder:r}=wl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new nm("Failed to find quarterly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"quarter");if(a){let o=ni(a,"quarter");e[o]=i}}}),e}var rm=class extends Error{};async function WL(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=bl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function YL(e,t){var r;return(r=t[ni(e,"year")])!=null?r:null}function zL(){let e={};if(!a0())return e;let{vault:t}=window.app,{folder:r}=bl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new rm("Failed to find yearly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"year");if(a){let o=ni(a,"year");e[o]=i}}}),e}function KL(){var n,i;let{app:e}=window,t=e.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let r=e.plugins.getPlugin("periodic-notes");return r&&((i=(n=r.settings)==null?void 0:n.daily)==null?void 0:i.enabled)}function n0(){var r,n;let{app:e}=window;if(e.plugins.getPlugin("calendar"))return!0;let t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.weekly)==null?void 0:n.enabled)}function r0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.monthly)==null?void 0:n.enabled)}function i0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.quarterly)==null?void 0:n.enabled)}function a0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.yearly)==null?void 0:n.enabled)}function jL(e){let t={day:gl,week:yl,month:vl,quarter:wl,year:bl}[e];return t()}function qL(e,t){return{day:XD,month:t0,week:e0}[e](t)}gt.DEFAULT_DAILY_NOTE_FORMAT=Zh;gt.DEFAULT_MONTHLY_NOTE_FORMAT=jD;gt.DEFAULT_QUARTERLY_NOTE_FORMAT=qD;gt.DEFAULT_WEEKLY_NOTE_FORMAT=Qh;gt.DEFAULT_YEARLY_NOTE_FORMAT=GD;gt.appHasDailyNotesPluginLoaded=KL;gt.appHasMonthlyNotesPluginLoaded=r0;gt.appHasQuarterlyNotesPluginLoaded=i0;gt.appHasWeeklyNotesPluginLoaded=n0;gt.appHasYearlyNotesPluginLoaded=a0;gt.createDailyNote=XD;gt.createMonthlyNote=t0;gt.createPeriodicNote=qL;gt.createQuarterlyNote=VL;gt.createWeeklyNote=e0;gt.createYearlyNote=WL;gt.getAllDailyNotes=OL;gt.getAllMonthlyNotes=BL;gt.getAllQuarterlyNotes=UL;gt.getAllWeeklyNotes=RL;gt.getAllYearlyNotes=zL;gt.getDailyNote=AL;gt.getDailyNoteSettings=gl;gt.getDateFromFile=Zo;gt.getDateFromPath=IL;gt.getDateUID=ni;gt.getMonthlyNote=HL;gt.getMonthlyNoteSettings=vl;gt.getPeriodicNoteSettings=jL;gt.getQuarterlyNote=$L;gt.getQuarterlyNoteSettings=wl;gt.getTemplateInfo=Jo;gt.getWeeklyNote=NL;gt.getWeeklyNoteSettings=yl;gt.getYearlyNote=YL;gt.getYearlyNoteSettings=bl});var Ic=wn(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});require("obsidian");var qi=class extends Error{},fm=class extends qi{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},hm=class extends qi{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},mm=class extends qi{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},ro=class extends qi{},yc=class extends qi{constructor(t){super(`Invalid unit ${t}`)}},vr=class extends qi{},Di=class extends qi{constructor(){super("Zone is an abstract class")}},_e="numeric",oi="short",Or="long",vc={year:_e,month:_e,day:_e},H0={year:_e,month:oi,day:_e},GL={year:_e,month:oi,day:_e,weekday:oi},B0={year:_e,month:Or,day:_e},V0={year:_e,month:Or,day:_e,weekday:Or},$0={hour:_e,minute:_e},U0={hour:_e,minute:_e,second:_e},W0={hour:_e,minute:_e,second:_e,timeZoneName:oi},Y0={hour:_e,minute:_e,second:_e,timeZoneName:Or},z0={hour:_e,minute:_e,hourCycle:"h23"},K0={hour:_e,minute:_e,second:_e,hourCycle:"h23"},j0={hour:_e,minute:_e,second:_e,hourCycle:"h23",timeZoneName:oi},q0={hour:_e,minute:_e,second:_e,hourCycle:"h23",timeZoneName:Or},G0={year:_e,month:_e,day:_e,hour:_e,minute:_e},J0={year:_e,month:_e,day:_e,hour:_e,minute:_e,second:_e},Z0={year:_e,month:oi,day:_e,hour:_e,minute:_e},Q0={year:_e,month:oi,day:_e,hour:_e,minute:_e,second:_e},JL={year:_e,month:oi,day:_e,weekday:oi,hour:_e,minute:_e},X0={year:_e,month:Or,day:_e,hour:_e,minute:_e,timeZoneName:oi},eS={year:_e,month:Or,day:_e,hour:_e,minute:_e,second:_e,timeZoneName:oi},tS={year:_e,month:Or,day:_e,weekday:Or,hour:_e,minute:_e,timeZoneName:Or},nS={year:_e,month:Or,day:_e,weekday:Or,hour:_e,minute:_e,second:_e,timeZoneName:Or},oo=class{get type(){throw new Di}get name(){throw new Di}get ianaName(){return this.name}get isUniversal(){throw new Di}offsetName(t,r){throw new Di}formatOffset(t,r){throw new Di}offset(t){throw new Di}equals(t){throw new Di}get isValid(){throw new Di}},im=null,wc=class e extends oo{static get instance(){return im===null&&(im=new e),im}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return iS(t,r,n)}formatOffset(t,r){return _l(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}},pc={};function ZL(e){return pc[e]||(pc[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),pc[e]}var QL={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function XL(e,t){let r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,a,o,s,u,l,c]=n;return[o,i,a,s,u,l,c]}function e2(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?g:1e3+g,(m-h)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},s0={};function t2(e,t={}){let r=JSON.stringify([e,t]),n=s0[r];return n||(n=new Intl.ListFormat(e,t),s0[r]=n),n}var pm={};function gm(e,t={}){let r=JSON.stringify([e,t]),n=pm[r];return n||(n=new Intl.DateTimeFormat(e,t),pm[r]=n),n}var ym={};function n2(e,t={}){let r=JSON.stringify([e,t]),n=ym[r];return n||(n=new Intl.NumberFormat(e,t),ym[r]=n),n}var vm={};function r2(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),a=vm[i];return a||(a=new Intl.RelativeTimeFormat(e,t),vm[i]=a),a}var xl=null;function i2(){return xl||(xl=new Intl.DateTimeFormat().resolvedOptions().locale,xl)}function a2(e){let t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(r===-1)return[e];{let n,i;try{n=gm(e).resolvedOptions(),i=e}catch(s){let u=e.substring(0,r);n=gm(u).resolvedOptions(),i=u}let{numberingSystem:a,calendar:o}=n;return[i,a,o]}}function o2(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function s2(e){let t=[];for(let r=1;r<=12;r++){let n=mt.utc(2009,r,1);t.push(e(n))}return t}function l2(e){let t=[];for(let r=1;r<=7;r++){let n=mt.utc(2016,11,13+r);t.push(e(n))}return t}function cc(e,t,r,n){let i=e.listingMode();return i==="error"?null:i==="en"?r(t):n(t)}function u2(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}var wm=class{constructor(t,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:i,floor:a,...o}=n;if(!r||Object.keys(o).length>0){let s={useGrouping:!1,...n};n.padTo>0&&(s.minimumIntegerDigits=n.padTo),this.inf=n2(t,s)}}format(t){if(this.inf){let r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{let r=this.floor?Math.floor(t):Om(t,3);return Tn(r,this.padTo)}}},bm=class{constructor(t,r,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let o=-1*(t.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&Da.create(s).valid?(i=s,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let a={...this.opts};a.timeZone=a.timeZone||i,this.dtf=gm(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},Dm=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&rS()&&(this.rtf=r2(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):x2(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},mn=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,r,n,i=!1){let a=t||hn.defaultLocale,o=a||(i?"en-US":i2()),s=r||hn.defaultNumberingSystem,u=n||hn.defaultOutputCalendar;return new e(o,s,u,a)}static resetCache(){xl=null,pm={},ym={},vm={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:n}={}){return e.create(t,r,n)}constructor(t,r,n,i){let[a,o,s]=a2(t);this.locale=a,this.numberingSystem=r||o||null,this.outputCalendar=n||s||null,this.intl=o2(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=u2(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1){return cc(this,t,sS,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=s2(a=>this.extract(a,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return cc(this,t,cS,()=>{let n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=r?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=l2(a=>this.extract(a,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return cc(this,void 0,()=>dS,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[mt.utc(2016,11,13,9),mt.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return cc(this,t,fS,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[mt.utc(-40,1,1),mt.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[t]})}extract(t,r,n){let i=this.dtFormatter(t,r),a=i.formatToParts(),o=a.find(s=>s.type.toLowerCase()===n);return o?o.value:null}numberFormatter(t={}){return new wm(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new bm(t,this.intl,r)}relFormatter(t={}){return new Dm(this.intl,this.isEnglish(),t)}listFormatter(t={}){return t2(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}},am=null,Kr=class e extends oo{static get utcInstance(){return am===null&&(am=new e(0)),am}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new e(Tc(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${_l(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${_l(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return _l(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}},Sm=class extends oo{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function ba(e,t){if(kt(e)||e===null)return t;if(e instanceof oo)return e;if(c2(e)){let r=e.toLowerCase();return r==="default"?t:r==="local"||r==="system"?wc.instance:r==="utc"||r==="gmt"?Kr.utcInstance:Kr.parseSpecifier(r)||Da.create(e)}else return ao(e)?Kr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Sm(e)}var l0=()=>Date.now(),u0="system",c0=null,d0=null,f0=null,h0=60,m0,hn=class{static get now(){return l0}static set now(t){l0=t}static set defaultZone(t){u0=t}static get defaultZone(){return ba(u0,wc.instance)}static get defaultLocale(){return c0}static set defaultLocale(t){c0=t}static get defaultNumberingSystem(){return d0}static set defaultNumberingSystem(t){d0=t}static get defaultOutputCalendar(){return f0}static set defaultOutputCalendar(t){f0=t}static get twoDigitCutoffYear(){return h0}static set twoDigitCutoffYear(t){h0=t%100}static get throwOnInvalid(){return m0}static set throwOnInvalid(t){m0=t}static resetCaches(){mn.resetCache(),Da.resetCache()}};function kt(e){return typeof e=="undefined"}function ao(e){return typeof e=="number"}function _c(e){return typeof e=="number"&&e%1===0}function c2(e){return typeof e=="string"}function d2(e){return Object.prototype.toString.call(e)==="[object Date]"}function rS(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function f2(e){return Array.isArray(e)?e:[e]}function p0(e,t,r){if(e.length!==0)return e.reduce((n,i)=>{let a=[t(i),i];return n&&r(n[0],a[0])===n[0]?n:a},null)[1]}function h2(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function rs(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ji(e,t,r){return _c(e)&&e>=t&&e<=r}function m2(e,t){return e-t*Math.floor(e/t)}function Tn(e,t=2){let r=e<0,n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function wa(e){if(!(kt(e)||e===null||e===""))return parseInt(e,10)}function to(e){if(!(kt(e)||e===null||e===""))return parseFloat(e)}function Am(e){if(!(kt(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Om(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function Fl(e){return e%4===0&&(e%100!==0||e%400===0)}function Cl(e){return Fl(e)?366:365}function bc(e,t){let r=m2(t-1,12)+1,n=e+(t-r)/12;return r===2?Fl(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Mc(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Dc(e){let t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,r=e-1,n=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return t===4||n===3?53:52}function Em(e){return e>99?e:e>hn.twoDigitCutoffYear?1900+e:2e3+e}function iS(e,t,r,n=null){let i=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(r,o).formatToParts(i).find(u=>u.type.toLowerCase()==="timezonename");return s?s.value:null}function Tc(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return r*60+i}function aS(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new vr(`Invalid unit value ${e}`);return t}function Sc(e,t){let r={};for(let n in e)if(rs(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=aS(i)}return r}function _l(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Tn(r,2)}:${Tn(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${Tn(r,2)}${Tn(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Fc(e){return h2(e,["hour","minute","second","millisecond"])}var p2=["January","February","March","April","May","June","July","August","September","October","November","December"],oS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g2=["J","F","M","A","M","J","J","A","S","O","N","D"];function sS(e){switch(e){case"narrow":return[...g2];case"short":return[...oS];case"long":return[...p2];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var lS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],uS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],y2=["M","T","W","T","F","S","S"];function cS(e){switch(e){case"narrow":return[...y2];case"short":return[...uS];case"long":return[...lS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var dS=["AM","PM"],v2=["Before Christ","Anno Domini"],w2=["BC","AD"],b2=["B","A"];function fS(e){switch(e){case"narrow":return[...b2];case"short":return[...w2];case"long":return[...v2];default:return null}}function D2(e){return dS[e.hour<12?0:1]}function S2(e,t){return cS(t)[e.weekday-1]}function E2(e,t){return sS(t)[e.month-1]}function k2(e,t){return fS(t)[e.year<0?0:1]}function x2(e,t,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&a){let d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${i[e][0]}`;case-1:return d?"yesterday":`last ${i[e][0]}`;case 0:return d?"today":`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),u=s===1,l=i[e],c=n?u?l[1]:l[2]||l[1]:u?i[e][0]:e;return o?`${s} ${c} ago`:`in ${s} ${c}`}function g0(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var C2={D:vc,DD:H0,DDD:B0,DDDD:V0,t:$0,tt:U0,ttt:W0,tttt:Y0,T:z0,TT:K0,TTT:j0,TTTT:q0,f:G0,ff:Z0,fff:X0,ffff:tS,F:J0,FF:Q0,FFF:eS,FFFF:nS},Ir=class e{static create(t,r={}){return new e(t,r)}static parseFormat(t){let r=null,n="",i=!1,a=[];for(let o=0;o0&&a.push({literal:i||/^\s+$/.test(n),val:n}),r=null,n="",i=!i):i||s===r?n+=s:(n.length>0&&a.push({literal:/^\s+$/.test(n),val:n}),n=s,r=s)}return n.length>0&&a.push({literal:i||/^\s+$/.test(n),val:n}),a}static macroTokenToFormatOpts(t){return C2[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}dtFormatter(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r})}formatDateTime(t,r){return this.dtFormatter(t,r).format()}formatDateTimeParts(t,r){return this.dtFormatter(t,r).formatToParts()}formatInterval(t,r){return this.dtFormatter(t.start,r).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r){return this.dtFormatter(t,r).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return Tn(t,r);let n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,r){let n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(h,g)=>this.loc.extract(t,h,g),o=h=>t.isOffsetFixed&&t.offset===0&&h.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,h.format):"",s=()=>n?D2(t):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(h,g)=>n?E2(t,h):a(g?{month:h}:{month:h,day:"numeric"},"month"),l=(h,g)=>n?S2(t,h):a(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),c=h=>{let g=e.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(t,g):h},d=h=>n?k2(t,h):a({era:h},"era"),m=h=>{switch(h){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return i?a({day:"numeric"},"day"):this.num(t.day);case"dd":return i?a({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?a({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?a({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return i?a({month:"numeric"},"month"):this.num(t.month);case"MM":return i?a({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return i?a({year:"numeric"},"year"):this.num(t.year);case"yy":return i?a({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?a({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?a({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(h)}};return g0(e.parseFormat(r),m)}formatDurationFromString(t,r){let n=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=u=>l=>{let c=n(l);return c?this.num(u.get(c),l.length):l},a=e.parseFormat(r),o=a.reduce((u,{literal:l,val:c})=>l?u:u.concat(c),[]),s=t.shiftTo(...o.map(n).filter(u=>u));return g0(a,i(s))}},Ar=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},hS=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function is(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function as(...e){return t=>e.reduce(([r,n,i],a)=>{let[o,s,u]=a(t,i);return[{...r,...o},s||n,u]},[{},null,1]).slice(0,2)}function os(e,...t){if(e==null)return[null,null];for(let[r,n]of t){let i=r.exec(e);if(i)return n(i)}return[null,null]}function mS(...e){return(t,r)=>{let n={},i;for(i=0;ih!==void 0&&(g||h&&c)?-h:h;return[{years:m(to(r)),months:m(to(n)),weeks:m(to(i)),days:m(to(a)),hours:m(to(o)),minutes:m(to(s)),seconds:m(to(u),u==="-0"),milliseconds:m(Am(l),d)}]}var B2={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Nm(e,t,r,n,i,a,o){let s={year:t.length===2?Em(wa(t)):wa(t),month:oS.indexOf(r)+1,day:wa(n),hour:wa(i),minute:wa(a)};return o&&(s.second=wa(o)),e&&(s.weekday=e.length>3?lS.indexOf(e)+1:uS.indexOf(e)+1),s}var V2=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function $2(e){let[,t,r,n,i,a,o,s,u,l,c,d]=e,m=Nm(t,i,n,r,a,o,s),h;return u?h=B2[u]:l?h=0:h=Tc(c,d),[m,new Kr(h)]}function U2(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var W2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Y2=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,z2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function y0(e){let[,t,r,n,i,a,o,s]=e;return[Nm(t,i,n,r,a,o,s),Kr.utcInstance]}function K2(e){let[,t,r,n,i,a,o,s]=e;return[Nm(t,s,r,n,i,a,o),Kr.utcInstance]}var j2=is(M2,Pm),q2=is(T2,Pm),G2=is(F2,Pm),J2=is(gS),vS=as(P2,ss,Il,Al),Z2=as(I2,ss,Il,Al),Q2=as(A2,ss,Il,Al),X2=as(ss,Il,Al);function eP(e){return os(e,[j2,vS],[q2,Z2],[G2,Q2],[J2,X2])}function tP(e){return os(U2(e),[V2,$2])}function nP(e){return os(e,[W2,y0],[Y2,y0],[z2,K2])}function rP(e){return os(e,[R2,H2])}var iP=as(ss);function aP(e){return os(e,[N2,iP])}var oP=is(O2,L2),sP=is(yS),lP=as(ss,Il,Al);function uP(e){return os(e,[oP,vS],[sP,lP])}var v0="Invalid Duration",wS={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},cP={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...wS},Yr=146097/400,Qo=146097/4800,dP={years:{quarters:4,months:12,weeks:Yr/7,days:Yr,hours:Yr*24,minutes:Yr*24*60,seconds:Yr*24*60*60,milliseconds:Yr*24*60*60*1e3},quarters:{months:3,weeks:Yr/28,days:Yr/4,hours:Yr*24/4,minutes:Yr*24*60/4,seconds:Yr*24*60*60/4,milliseconds:Yr*24*60*60*1e3/4},months:{weeks:Qo/7,days:Qo,hours:Qo*24,minutes:Qo*24*60,seconds:Qo*24*60*60,milliseconds:Qo*24*60*60*1e3},...wS},io=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],fP=io.slice(0).reverse();function va(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new He(n)}function bS(e,t){var n;let r=(n=t.milliseconds)!=null?n:0;for(let i of fP.slice(1))t[i]&&(r+=t[i]*e[i].milliseconds);return r}function w0(e,t){let r=bS(e,t)<0?-1:1;io.reduceRight((n,i)=>{if(kt(t[i]))return n;if(n){let a=t[n]*r,o=e[i][n],s=Math.floor(a/o);t[i]+=s*r,t[n]-=s*o*r}return i},null),io.reduce((n,i)=>{if(kt(t[i]))return n;if(n){let a=t[n]%1;t[n]-=a,t[i]+=a*e[n][i]}return i},null)}function hP(e){let t={};for(let[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}var He=class e{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,n=r?dP:cP;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||mn.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,r){return e.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new vr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:Sc(t,e.normalizeUnit),loc:mn.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(ao(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new vr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=rP(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){let[n]=aP(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new vr("need to specify a reason the Duration is invalid");let n=t instanceof Ar?t:new Ar(t,r);if(hn.throwOnInvalid)throw new mm(n);return new e({invalid:n})}static normalizeUnit(t){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!r)throw new yc(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ir.create(this.loc,n).formatDurationFromString(this,t):v0}toHuman(t={}){if(!this.isValid)return v0;let r=io.map(n=>{let i=this.values[n];return kt(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(i)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Om(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},mt.fromMillis(r,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.isValid?bS(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t),n={};for(let i of io)(rs(r.values,i)||rs(this.values,i))&&(n[i]=r.get(i)+this.get(i));return va(this,{values:n},!0)}minus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=aS(t(this.values[n],n));return va(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Sc(t,e.normalizeUnit)};return va(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:n,matrix:i}={}){let o={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:i,conversionAccuracy:n};return va(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return w0(this.matrix,t),va(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=hP(this.normalize().shiftToAll().toObject());return va(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>e.normalizeUnit(o));let r={},n={},i=this.toObject(),a;for(let o of io)if(t.indexOf(o)>=0){a=o;let s=0;for(let l in n)s+=this.matrix[l][o]*n[l],n[l]=0;ao(i[o])&&(s+=i[o]);let u=Math.trunc(s);r[o]=u,n[o]=(s*1e3-u*1e3)/1e3}else ao(i[o])&&(n[o]=i[o]);for(let o in n)n[o]!==0&&(r[a]+=o===a?n[o]:n[o]/this.matrix[a][o]);return w0(this.matrix,r),va(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return va(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(let n of io)if(!r(this.values[n],t.values[n]))return!1;return!0}},Xo="Invalid Interval";function mP(e,t){return!e||!e.isValid?ns.invalid("missing or invalid start"):!t||!t.isValid?ns.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?e.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];let r=t.map(El).filter(o=>this.contains(o)).sort(),n=[],{s:i}=this,a=0;for(;i+this.e?this.e:o;n.push(e.fromDateTimes(i,s)),i=s,a+=1}return n}splitBy(t){let r=He.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,i=1,a,o=[];for(;nu*i));a=+s>+this.e?this.e:s,o.push(e.fromDateTimes(n,a)),n=a,i+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let r=this.s>t.s?this.s:t.s,n=this.e=n?null:e.fromDateTimes(r,n)}union(t){if(!this.isValid)return this;let r=this.st.e?this.e:t.e;return e.fromDateTimes(r,n)}static merge(t){let[r,n]=t.sort((i,a)=>i.s-a.s).reduce(([i,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[i,a.union(o)]:[i.concat([a]),o]:[i,o],[[],null]);return n&&r.push(n),r}static xor(t){let r=null,n=0,i=[],a=t.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((u,l)=>u.time-l.time);for(let u of s)n+=u.type==="s"?1:-1,n===1?r=u.time:(r&&+r!=+u.time&&i.push(e.fromDateTimes(r,u.time)),r=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Xo}toLocaleString(t=vc,r={}){return this.isValid?Ir.create(this.s.loc.clone(r),t).formatInterval(this):Xo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Xo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Xo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Xo}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:Xo}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):He.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},es=class{static hasDST(t=hn.defaultZone){let r=mt.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return Da.isValidZone(t)}static normalizeZone(t){return ba(t,hn.defaultZone)}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||mn.create(r,n,a)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||mn.create(r,n,a)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||mn.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||mn.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return mn.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return mn.create(r,null,"gregory").eras(t)}static features(){return{relative:rS()}}};function b0(e,t){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(He.fromMillis(n).as("days"))}function pP(e,t,r){let n=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{let c=b0(u,l);return(c-c%7)/7}],["days",b0]],i={},a=e,o,s;for(let[u,l]of n)r.indexOf(u)>=0&&(o=u,i[u]=l(e,t),s=a.plus(i),s>t?(i[u]--,e=a.plus(i),e>t&&(s=e,i[u]--,e=a.plus(i))):e=s);return[e,i,s,o]}function gP(e,t,r,n){let[i,a,o,s]=pP(e,t,r),u=t-i,l=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);l.length===0&&(o0?He.fromMillis(u,n).shiftTo(...l).plus(c):c}var Rm={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},D0={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},yP=Rm.hanidec.replace(/[\[|\]]/g,"").split("");function vP(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=a&&n<=o&&(t+=n-a)}}return parseInt(t,10)}else return t}function ri({numberingSystem:e},t=""){return new RegExp(`${Rm[e||"latn"]}${t}`)}var wP="missing Intl.DateTimeFormat.formatToParts support";function Nt(e,t=r=>r){return{regex:e,deser:([r])=>t(vP(r))}}var bP="\xA0",DS=`[ ${bP}]`,SS=new RegExp(DS,"g");function DP(e){return e.replace(/\./g,"\\.?").replace(SS,DS)}function S0(e){return e.replace(/\./g,"").replace(SS," ").toLowerCase()}function ii(e,t){return e===null?null:{regex:RegExp(e.map(DP).join("|")),deser:([r])=>e.findIndex(n=>S0(r)===S0(n))+t}}function E0(e,t){return{regex:e,deser:([,r,n])=>Tc(r,n),groups:t}}function dc(e){return{regex:e,deser:([t])=>t}}function SP(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function EP(e,t){let r=ri(t),n=ri(t,"{2}"),i=ri(t,"{3}"),a=ri(t,"{4}"),o=ri(t,"{6}"),s=ri(t,"{1,2}"),u=ri(t,"{1,3}"),l=ri(t,"{1,6}"),c=ri(t,"{1,9}"),d=ri(t,"{2,4}"),m=ri(t,"{4,6}"),h=v=>({regex:RegExp(SP(v.val)),deser:([D])=>D,literal:!0}),y=(v=>{if(e.literal)return h(v);switch(v.val){case"G":return ii(t.eras("short"),0);case"GG":return ii(t.eras("long"),0);case"y":return Nt(l);case"yy":return Nt(d,Em);case"yyyy":return Nt(a);case"yyyyy":return Nt(m);case"yyyyyy":return Nt(o);case"M":return Nt(s);case"MM":return Nt(n);case"MMM":return ii(t.months("short",!0),1);case"MMMM":return ii(t.months("long",!0),1);case"L":return Nt(s);case"LL":return Nt(n);case"LLL":return ii(t.months("short",!1),1);case"LLLL":return ii(t.months("long",!1),1);case"d":return Nt(s);case"dd":return Nt(n);case"o":return Nt(u);case"ooo":return Nt(i);case"HH":return Nt(n);case"H":return Nt(s);case"hh":return Nt(n);case"h":return Nt(s);case"mm":return Nt(n);case"m":return Nt(s);case"q":return Nt(s);case"qq":return Nt(n);case"s":return Nt(s);case"ss":return Nt(n);case"S":return Nt(u);case"SSS":return Nt(i);case"u":return dc(c);case"uu":return dc(s);case"uuu":return Nt(r);case"a":return ii(t.meridiems(),0);case"kkkk":return Nt(a);case"kk":return Nt(d,Em);case"W":return Nt(s);case"WW":return Nt(n);case"E":case"c":return Nt(r);case"EEE":return ii(t.weekdays("short",!1),1);case"EEEE":return ii(t.weekdays("long",!1),1);case"ccc":return ii(t.weekdays("short",!0),1);case"cccc":return ii(t.weekdays("long",!0),1);case"Z":case"ZZ":return E0(new RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return E0(new RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return dc(/[a-z_+-/]{1,256}?/i);case" ":return dc(/[^\S\n\r]/);default:return h(v)}})(e)||{invalidReason:wP};return y.token=e,y}var kP={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function xP(e,t,r){let{type:n,value:i}=e;if(n==="literal"){let u=/^\s+$/.test(i);return{literal:!u,val:u?" ":i}}let a=t[n],o=n;n==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=r.hour12?"hour12":"hour24");let s=kP[o];if(typeof s=="object"&&(s=s[a]),s)return{literal:!1,val:s}}function CP(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function _P(e,t,r){let n=e.match(t);if(n){let i={},a=1;for(let o in r)if(rs(r,o)){let s=r[o],u=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(n.slice(a,a+u))),a+=u}return[n,i]}else return[n,{}]}function MP(e){let t=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,n;return kt(e.z)||(r=Da.create(e.z)),kt(e.Z)||(r||(r=new Kr(e.Z)),n=e.Z),kt(e.q)||(e.M=(e.q-1)*3+1),kt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),kt(e.u)||(e.S=Am(e.u)),[Object.keys(e).reduce((a,o)=>{let s=t(o);return s&&(a[s]=e[o]),a},{}),r,n]}var om=null;function TP(){return om||(om=mt.fromMillis(1555555555555)),om}function FP(e,t){if(e.literal)return e;let r=Ir.macroTokenToFormatOpts(e.val),n=xS(r,t);return n==null||n.includes(void 0)?e:n}function ES(e,t){return Array.prototype.concat(...e.map(r=>FP(r,t)))}function kS(e,t,r){let n=ES(Ir.parseFormat(r),e),i=n.map(o=>EP(o,e)),a=i.find(o=>o.invalidReason);if(a)return{input:t,tokens:n,invalidReason:a.invalidReason};{let[o,s]=CP(i),u=RegExp(o,"i"),[l,c]=_P(t,u,s),[d,m,h]=c?MP(c):[null,null,void 0];if(rs(c,"a")&&rs(c,"H"))throw new ro("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:u,rawMatches:l,matches:c,result:d,zone:m,specificOffset:h}}}function IP(e,t,r){let{result:n,zone:i,specificOffset:a,invalidReason:o}=kS(e,t,r);return[n,i,a,o]}function xS(e,t){if(!e)return null;let n=Ir.create(t,e).dtFormatter(TP()),i=n.formatToParts(),a=n.resolvedOptions();return i.map(o=>xP(o,e,a))}var CS=[0,31,59,90,120,151,181,212,243,273,304,334],_S=[0,31,60,91,121,152,182,213,244,274,305,335];function zr(e,t){return new Ar("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function MS(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return i===0?7:i}function TS(e,t,r){return r+(Fl(e)?_S:CS)[t-1]}function FS(e,t){let r=Fl(e)?_S:CS,n=r.findIndex(a=>aDc(t)?(s=t+1,o=1):s=t,{weekYear:s,weekNumber:o,weekday:a,...Fc(e)}}function k0(e){let{weekYear:t,weekNumber:r,weekday:n}=e,i=MS(t,1,4),a=Cl(t),o=r*7+n-i-3,s;o<1?(s=t-1,o+=Cl(s)):o>a?(s=t+1,o-=Cl(t)):s=t;let{month:u,day:l}=FS(s,o);return{year:s,month:u,day:l,...Fc(e)}}function sm(e){let{year:t,month:r,day:n}=e,i=TS(t,r,n);return{year:t,ordinal:i,...Fc(e)}}function x0(e){let{year:t,ordinal:r}=e,{month:n,day:i}=FS(t,r);return{year:t,month:n,day:i,...Fc(e)}}function AP(e){let t=_c(e.weekYear),r=ji(e.weekNumber,1,Dc(e.weekYear)),n=ji(e.weekday,1,7);return t?r?n?!1:zr("weekday",e.weekday):zr("week",e.week):zr("weekYear",e.weekYear)}function OP(e){let t=_c(e.year),r=ji(e.ordinal,1,Cl(e.year));return t?r?!1:zr("ordinal",e.ordinal):zr("year",e.year)}function IS(e){let t=_c(e.year),r=ji(e.month,1,12),n=ji(e.day,1,bc(e.year,e.month));return t?r?n?!1:zr("day",e.day):zr("month",e.month):zr("year",e.year)}function AS(e){let{hour:t,minute:r,second:n,millisecond:i}=e,a=ji(t,0,23)||t===24&&r===0&&n===0&&i===0,o=ji(r,0,59),s=ji(n,0,59),u=ji(i,0,999);return a?o?s?u?!1:zr("millisecond",i):zr("second",n):zr("minute",r):zr("hour",t)}var lm="Invalid DateTime",C0=864e13;function fc(e){return new Ar("unsupported zone",`the zone "${e.name}" is not supported`)}function um(e){return e.weekData===null&&(e.weekData=km(e.c)),e.weekData}function no(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new mt({...r,...t,old:r})}function OS(e,t,r){let n=e-t*60*1e3,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*60*1e3;let a=r.offset(n);return i===a?[n,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function hc(e,t){e+=t*60*1e3;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function gc(e,t,r){return OS(Mc(e),t,r)}function _0(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:n,month:i,day:Math.min(e.c.day,bc(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=He.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=Mc(a),[u,l]=OS(s,r,e.zone);return o!==0&&(u+=o,l=e.zone.offset(u)),{ts:u,o:l}}function Sl(e,t,r,n,i,a){let{setZone:o,zone:s}=r;if(e&&Object.keys(e).length!==0||t){let u=t||s,l=mt.fromObject(e,{...r,zone:u,specificOffset:a});return o?l:l.setZone(s)}else return mt.invalid(new Ar("unparsable",`the input "${i}" can't be parsed as ${n}`))}function mc(e,t,r=!0){return e.isValid?Ir.create(mn.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function cm(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=Tn(e.c.year,r?6:4),t?(n+="-",n+=Tn(e.c.month),n+="-",n+=Tn(e.c.day)):(n+=Tn(e.c.month),n+=Tn(e.c.day)),n}function M0(e,t,r,n,i,a){let o=Tn(e.c.hour);return t?(o+=":",o+=Tn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(o+=":")):o+=Tn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(o+=Tn(e.c.second),(e.c.millisecond!==0||!n)&&(o+=".",o+=Tn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!a?o+="Z":e.o<0?(o+="-",o+=Tn(Math.trunc(-e.o/60)),o+=":",o+=Tn(Math.trunc(-e.o%60))):(o+="+",o+=Tn(Math.trunc(e.o/60)),o+=":",o+=Tn(Math.trunc(e.o%60)))),a&&(o+="["+e.zone.ianaName+"]"),o}var LS={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},LP={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},PP={ordinal:1,hour:0,minute:0,second:0,millisecond:0},PS=["year","month","day","hour","minute","second","millisecond"],NP=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],RP=["year","ordinal","hour","minute","second","millisecond"];function T0(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new yc(e);return t}function F0(e,t){let r=ba(t.zone,hn.defaultZone),n=mn.fromObject(t),i=hn.now(),a,o;if(kt(e.year))a=i;else{for(let l of PS)kt(e[l])&&(e[l]=LS[l]);let s=IS(e)||AS(e);if(s)return mt.invalid(s);let u=r.offset(i);[a,o]=gc(e,u,r)}return new mt({ts:a,zone:r,loc:n,o})}function I0(e,t,r){let n=kt(r.round)?!0:r.round,i=(o,s)=>(o=Om(o,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(o,s)),a=o=>r.calendary?t.hasSame(e,o)?0:t.startOf(o).diff(e.startOf(o),o).get(o):t.diff(e,o).get(o);if(r.unit)return i(a(r.unit),r.unit);for(let o of r.units){let s=a(o);if(Math.abs(s)>=1)return i(s,o)}return i(e>t?-0:0,r.units[r.units.length-1])}function A0(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}var mt=class e{constructor(t){let r=t.zone||hn.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new Ar("invalid input"):null)||(r.isValid?null:fc(r));this.ts=kt(t.ts)?hn.now():t.ts;let i=null,a=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[i,a]=[t.old.c,t.old.o];else{let s=r.offset(this.ts);i=hc(this.ts,s),n=Number.isNaN(i.year)?new Ar("invalid input"):null,i=n?null:i,a=n?null:s}this._zone=r,this.loc=t.loc||mn.create(),this.invalid=n,this.weekData=null,this.c=i,this.o=a,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[t,r]=A0(arguments),[n,i,a,o,s,u,l]=r;return F0({year:n,month:i,day:a,hour:o,minute:s,second:u,millisecond:l},t)}static utc(){let[t,r]=A0(arguments),[n,i,a,o,s,u,l]=r;return t.zone=Kr.utcInstance,F0({year:n,month:i,day:a,hour:o,minute:s,second:u,millisecond:l},t)}static fromJSDate(t,r={}){let n=d2(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=ba(r.zone,hn.defaultZone);return i.isValid?new e({ts:n,zone:i,loc:mn.fromObject(r)}):e.invalid(fc(i))}static fromMillis(t,r={}){if(ao(t))return t<-C0||t>C0?e.invalid("Timestamp out of range"):new e({ts:t,zone:ba(r.zone,hn.defaultZone),loc:mn.fromObject(r)});throw new vr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(ao(t))return new e({ts:t*1e3,zone:ba(r.zone,hn.defaultZone),loc:mn.fromObject(r)});throw new vr("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=ba(r.zone,hn.defaultZone);if(!n.isValid)return e.invalid(fc(n));let i=hn.now(),a=kt(r.specificOffset)?n.offset(i):r.specificOffset,o=Sc(t,T0),s=!kt(o.ordinal),u=!kt(o.year),l=!kt(o.month)||!kt(o.day),c=u||l,d=o.weekYear||o.weekNumber,m=mn.fromObject(r);if((c||s)&&d)throw new ro("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new ro("Can't mix ordinal dates with month/day");let h=d||o.weekday&&!c,g,y,v=hc(i,a);h?(g=NP,y=LP,v=km(v)):s?(g=RP,y=PP,v=sm(v)):(g=PS,y=LS);let D=!1;for(let B of g){let G=o[B];kt(G)?D?o[B]=y[B]:o[B]=v[B]:D=!0}let I=h?AP(o):s?OP(o):IS(o),C=I||AS(o);if(C)return e.invalid(C);let x=h?k0(o):s?x0(o):o,[O,A]=gc(x,a,n),P=new e({ts:O,zone:n,o:A,loc:m});return o.weekday&&c&&t.weekday!==P.weekday?e.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${P.toISO()}`):P}static fromISO(t,r={}){let[n,i]=eP(t);return Sl(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=tP(t);return Sl(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=nP(t);return Sl(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(kt(t)||kt(r))throw new vr("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:a=null}=n,o=mn.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),[s,u,l,c]=IP(o,t,r);return c?e.invalid(c):Sl(s,u,n,`format ${r}`,t,l)}static fromString(t,r,n={}){return e.fromFormat(t,r,n)}static fromSQL(t,r={}){let[n,i]=uP(t);return Sl(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new vr("need to specify a reason the DateTime is invalid");let n=t instanceof Ar?t:new Ar(t,r);if(hn.throwOnInvalid)throw new fm(n);return new e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let n=xS(t,mn.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return ES(Ir.parseFormat(t),mn.fromObject(r)).map(i=>i.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?um(this).weekYear:NaN}get weekNumber(){return this.isValid?um(this).weekNumber:NaN}get weekday(){return this.isValid?um(this).weekday:NaN}get ordinal(){return this.isValid?sm(this.c).ordinal:NaN}get monthShort(){return this.isValid?es.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?es.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?es.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?es.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,r=6e4,n=Mc(this.c),i=this.zone.offset(n-t),a=this.zone.offset(n+t),o=this.zone.offset(n-i*r),s=this.zone.offset(n-a*r);if(o===s)return[this];let u=n-o*r,l=n-s*r,c=hc(u,o),d=hc(l,s);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[no(this,{ts:u}),no(this,{ts:l})]:[this]}get isInLeapYear(){return Fl(this.year)}get daysInMonth(){return bc(this.year,this.month)}get daysInYear(){return this.isValid?Cl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Dc(this.weekYear):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Ir.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(Kr.instance(t),r)}toLocal(){return this.setZone(hn.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=ba(t,hn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(r||n){let a=t.offset(this.ts),o=this.toObject();[i]=gc(o,a,t)}return no(this,{ts:i,zone:t})}else return e.invalid(fc(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return no(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Sc(t,T0),n=!kt(r.weekYear)||!kt(r.weekNumber)||!kt(r.weekday),i=!kt(r.ordinal),a=!kt(r.year),o=!kt(r.month)||!kt(r.day),s=a||o,u=r.weekYear||r.weekNumber;if((s||i)&&u)throw new ro("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&i)throw new ro("Can't mix ordinal dates with month/day");let l;n?l=k0({...km(this.c),...r}):kt(r.ordinal)?(l={...this.toObject(),...r},kt(r.day)&&(l.day=Math.min(bc(l.year,l.month),l.day))):l=x0({...sm(this.c),...r});let[c,d]=gc(l,this.o,this.zone);return no(this,{ts:c,o:d})}plus(t){if(!this.isValid)return this;let r=He.fromDurationLike(t);return no(this,_0(this,r))}minus(t){if(!this.isValid)return this;let r=He.fromDurationLike(t).negate();return no(this,_0(this,r))}startOf(t){if(!this.isValid)return this;let r={},n=He.normalizeUnit(t);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(n==="weeks"&&(r.weekday=1),n==="quarters"){let i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,r={}){return this.isValid?Ir.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,t):lm}toLocaleString(t=vc,r={}){return this.isValid?Ir.create(this.loc.clone(r),t).formatDateTime(this):lm}toLocaleParts(t={}){return this.isValid?Ir.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:r=!1,suppressMilliseconds:n=!1,includeOffset:i=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;let o=t==="extended",s=cm(this,o);return s+="T",s+=M0(this,o,r,n,i,a),s}toISODate({format:t="extended"}={}){return this.isValid?cm(this,t==="extended"):null}toISOWeekDate(){return mc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:r=!1,includeOffset:n=!0,includePrefix:i=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(i?"T":"")+M0(this,o==="extended",r,t,n,a):null}toRFC2822(){return mc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return mc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?cm(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:r=!1,includeOffsetSpace:n=!0}={}){let i="HH:mm:ss.SSS";return(r||t)&&(n&&(i+=" "),r?i+="z":t&&(i+="ZZ")),mc(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():lm}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};let r={...this.c};return t.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,r="milliseconds",n={}){if(!this.isValid||!t.isValid)return He.invalid("created by diffing an invalid DateTime");let i={locale:this.locale,numberingSystem:this.numberingSystem,...n},a=f2(r).map(He.normalizeUnit),o=t.valueOf()>this.valueOf(),s=o?this:t,u=o?t:this,l=gP(s,u,a,i);return o?l.negate():l}diffNow(t="milliseconds",r={}){return this.diff(e.now(),t,r)}until(t){return this.isValid?ns.fromDateTimes(this,t):this}hasSame(t,r){if(!this.isValid)return!1;let n=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(r)<=n&&n<=i.endOf(r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let r=t.base||e.fromObject({},{zone:this.zone}),n=t.padding?thisr.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new vr("max requires all arguments be DateTimes");return p0(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){let{locale:i=null,numberingSystem:a=null}=n,o=mn.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});return kS(o,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static get DATE_SHORT(){return vc}static get DATE_MED(){return H0}static get DATE_MED_WITH_WEEKDAY(){return GL}static get DATE_FULL(){return B0}static get DATE_HUGE(){return V0}static get TIME_SIMPLE(){return $0}static get TIME_WITH_SECONDS(){return U0}static get TIME_WITH_SHORT_OFFSET(){return W0}static get TIME_WITH_LONG_OFFSET(){return Y0}static get TIME_24_SIMPLE(){return z0}static get TIME_24_WITH_SECONDS(){return K0}static get TIME_24_WITH_SHORT_OFFSET(){return j0}static get TIME_24_WITH_LONG_OFFSET(){return q0}static get DATETIME_SHORT(){return G0}static get DATETIME_SHORT_WITH_SECONDS(){return J0}static get DATETIME_MED(){return Z0}static get DATETIME_MED_WITH_SECONDS(){return Q0}static get DATETIME_MED_WITH_WEEKDAY(){return JL}static get DATETIME_FULL(){return X0}static get DATETIME_FULL_WITH_SECONDS(){return eS}static get DATETIME_HUGE(){return tS}static get DATETIME_HUGE_WITH_SECONDS(){return nS}};function El(e){if(mt.isDateTime(e))return e;if(e&&e.valueOf&&ao(e.valueOf()))return mt.fromJSDate(e);if(e&&typeof e=="object")return mt.fromObject(e);throw new vr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var Hm={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},HP={allowHtml:!0};({...Hm,...HP});var xm=class e{constructor(t){ur(this,"value");ur(this,"successful");this.value=t,this.successful=!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}mapErr(t){return this}bimap(t,r){return this.map(t)}orElse(t){return this.value}cast(){return this}orElseThrow(t){return this.value}},Cm=class e{constructor(t){ur(this,"error");ur(this,"successful");this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new e(t(this.error))}bimap(t,r){return this.mapErr(r)}orElse(t){return t}cast(){return this}orElseThrow(t){throw t?new Error(t(this.error)):new Error(""+this.error)}},Ec;(function(e){function t(a){return new xm(a)}e.success=t;function r(a){return new Cm(a)}e.failure=r;function n(a,o,s){return a.successful?o.successful?s(a.value,o.value):r(o.error):r(a.error)}e.flatMap2=n;function i(a,o,s){return n(a,o,(u,l)=>t(s(u,l)))}e.map2=i})(Ec||(Ec={}));var BP=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"||typeof window!="undefined"?window:typeof self!="undefined"?self:{},kc={exports:{}};kc.exports;(function(e,t){(function(r,n){e.exports=n()})(typeof self!="undefined"?self:BP,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=0)}([function(r,n,i){function a(L){if(!(this instanceof a))return new a(L);this._=L}var o=a.prototype;function s(L,K){for(var ee=0;ee>7),buf:function(de){var ve=u(function(ge,M,H,q){return ge.concat(H===q.length-1?Buffer.from([M,0]).readUInt16BE(0):q.readUInt16BE(H))},[],de);return Buffer.from(l(function(ge){return(ge<<1&65535)>>8},ve))}(ee.buf)}}),ee}function d(){return typeof Buffer!="undefined"}function m(){if(!d())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function h(L){m();var K=u(function(ve,ge){return ve+ge},0,L);if(K%8!=0)throw new Error("The bits ["+L.join(", ")+"] add up to "+K+" which is not an even number of bytes; the total should be divisible by 8");var ee,ue=K/8,de=(ee=function(ve){return ve>48},u(function(ve,ge){return ve||(ee(ge)?ge:ve)},null,L));if(de)throw new Error(de+" bit range requested exceeds 48 bit (6 byte) Number max.");return new a(function(ve,ge){var M=ue+ge;return M>ve.length?B(ge,ue.toString()+" bytes"):P(M,u(function(H,q){var ie=c(q,H.buf);return{coll:H.coll.concat(ie.v),buf:ie.buf}},{coll:[],buf:ve.slice(ge,M)},L).coll)})}function g(L,K){return new a(function(ee,ue){return m(),ue+K>ee.length?B(ue,K+" bytes for "+L):P(ue+K,ee.slice(ue,ue+K))})}function y(L,K){if(typeof(ee=K)!="number"||Math.floor(ee)!==ee||K<0||K>6)throw new Error(L+" requires integer length in range [0, 6].");var ee}function v(L){return y("uintBE",L),g("uintBE("+L+")",L).map(function(K){return K.readUIntBE(0,L)})}function D(L){return y("uintLE",L),g("uintLE("+L+")",L).map(function(K){return K.readUIntLE(0,L)})}function I(L){return y("intBE",L),g("intBE("+L+")",L).map(function(K){return K.readIntBE(0,L)})}function C(L){return y("intLE",L),g("intLE("+L+")",L).map(function(K){return K.readIntLE(0,L)})}function x(L){return L instanceof a}function O(L){return{}.toString.call(L)==="[object Array]"}function A(L){return d()&&Buffer.isBuffer(L)}function P(L,K){return{status:!0,index:L,value:K,furthest:-1,expected:[]}}function B(L,K){return O(K)||(K=[K]),{status:!1,index:-1,value:null,furthest:L,expected:K}}function G(L,K){if(!K||L.furthest>K.furthest)return L;var ee=L.furthest===K.furthest?function(ue,de){if(function(){if(a._supportsSet!==void 0)return a._supportsSet;var ae=typeof Set!="undefined";return a._supportsSet=ae,ae}()&&Array.from){for(var ve=new Set(ue),ge=0;ge=0;){if(ge in ee){ue=ee[ge].line,ve===0&&(ve=ee[ge].lineStart);break}(L.charAt(ge)===` +`||L.charAt(ge)==="\r"&&L.charAt(ge+1)!==` +`)&&(de++,ve===0&&(ve=ge+1)),ge--}var M=ue+de,H=K-ve;return ee[K]={line:M,lineStart:ve},{offset:K,line:M+1,column:H+1}}function oe(L){if(!x(L))throw new Error("not a parser: "+L)}function te(L,K){return typeof L=="string"?L.charAt(K):L[K]}function re(L){if(typeof L!="number")throw new Error("not a number: "+L)}function ne(L){if(typeof L!="function")throw new Error("not a function: "+L)}function be(L){if(typeof L!="string")throw new Error("not a string: "+L)}var pe=2,De=3,Ce=8,U=5*Ce,Je=4*Ce,it=" ";function N(L,K){return new Array(K+1).join(L)}function Ze(L,K,ee){var ue=K-L.length;return ue<=0?L:N(ee,ue)+L}function It(L,K,ee,ue){return{from:L-K>0?L-K:0,to:L+ee>ue?ue:L+ee}}function Mt(L,K){var ee,ue,de,ve,ge,M=K.index,H=M.offset,q=1;if(H===L.length)return"Got the end of the input";if(A(L)){var ie=H-H%Ce,ye=H-ie,ce=It(ie,U,Je+Ce,L.length),ae=l(function(Te){return l(function(Ue){return Ze(Ue.toString(16),2,"0")},Te)},function(Te,Ue){var We=Te.length,Ft=[],Hn=0;if(We<=Ue)return[Te.slice()];for(var Ot=0;Ot=4&&(ee+=1),q=2,de=l(function(Te){return Te.length<=4?Te.join(" "):Te.slice(0,4).join(" ")+" "+Te.slice(4).join(" ")},ae),(ge=(8*(ve.to>0?ve.to-1:ve.to)).toString(16).length)<2&&(ge=2)}else{var Se=L.split(/\r\n|[\n\r\u2028\u2029]/);ee=M.column-1,ue=M.line-1,ve=It(ue,pe,De,Se.length),de=Se.slice(ve.from,ve.to),ge=ve.to.toString().length}var nt=ue-ve.from;return A(L)&&(ge=(8*(ve.to>0?ve.to-1:ve.to)).toString(16).length)<2&&(ge=2),u(function(Te,Ue,We){var Ft,Hn=We===nt,Ot=Hn?"> ":it;return Ft=A(L)?Ze((8*(ve.from+We)).toString(16),ge,"0"):Ze((ve.from+We+1).toString(),ge," "),[].concat(Te,[Ot+Ft+" | "+Ue],Hn?[it+N(" ",ge)+" | "+Ze("",ee," ")+N("^",q)]:[])},[],de).join(` +`)}function jt(L,K){return[` +`,"-- PARSING FAILED "+N("-",50),` + +`,Mt(L,K),` + +`,(ee=K.expected,ee.length===1?`Expected: + +`+ee[0]:`Expected one of the following: + +`+ee.join(", ")),` +`].join("");var ee}function vt(L){return L.flags!==void 0?L.flags:[L.global?"g":"",L.ignoreCase?"i":"",L.multiline?"m":"",L.unicode?"u":"",L.sticky?"y":""].join("")}function Wt(){for(var L=[].slice.call(arguments),K=L.length,ee=0;ee=2?re(K):K=0;var ee=function(de){return RegExp("^(?:"+de.source+")",vt(de))}(L),ue=""+L;return a(function(de,ve){var ge=ee.exec(de.slice(ve));if(ge){if(0<=K&&K<=ge.length){var M=ge[0],H=ge[K];return P(ve+M.length,H)}return B(ve,"valid match group (0 to "+ge.length+") in "+ue)}return B(ve,ue)})}function xn(L){return a(function(K,ee){return P(ee,L)})}function jn(L){return a(function(K,ee){return B(ee,L)})}function sn(L){if(x(L))return a(function(K,ee){var ue=L._(K,ee);return ue.index=ee,ue.value="",ue});if(typeof L=="string")return sn(yn(L));if(L instanceof RegExp)return sn(vn(L));throw new Error("not a string, regexp, or parser: "+L)}function Rt(L){return oe(L),a(function(K,ee){var ue=L._(K,ee),de=K.slice(ee,ue.index);return ue.status?B(ee,'not "'+de+'"'):P(ee,null)})}function Vt(L){return ne(L),a(function(K,ee){var ue=te(K,ee);return ee=L.length?B(K,"any character/byte"):P(K+1,te(L,K))}),rn=a(function(L,K){return P(L.length,L.slice(K))}),At=a(function(L,K){return K=0}).desc(K)},a.optWhitespace=Dt,a.Parser=a,a.range=function(L,K){return Vt(function(ee){return L<=ee&&ee<=K}).desc(L+"-"+K)},a.regex=vn,a.regexp=vn,a.sepBy=en,a.sepBy1=gn,a.seq=Wt,a.seqMap=Tt,a.seqObj=function(){for(var L,K={},ee=0,ue=(L=arguments,Array.prototype.slice.call(L)),de=ue.length,ve=0;ve255)throw new Error("Value specified to byte constructor ("+L+"=0x"+L.toString(16)+") is larger in value than a single byte.");var K=(L>15?"0x":"0x0")+L.toString(16);return a(function(ee,ue){var de=te(ee,ue);return de===L?P(ue+1,de):B(ue,K)})},buffer:function(L){return g("buffer",L).map(function(K){return Buffer.from(K)})},encodedString:function(L,K){return g("string",K).map(function(ee){return ee.toString(L)})},uintBE:v,uint8BE:v(1),uint16BE:v(2),uint32BE:v(4),uintLE:D,uint8LE:D(1),uint16LE:D(2),uint32LE:D(4),intBE:I,int8BE:I(1),int16BE:I(2),int32BE:I(4),intLE:C,int8LE:C(1),int16LE:C(2),int32LE:C(4),floatBE:g("floatBE",4).map(function(L){return L.readFloatBE(0)}),floatLE:g("floatLE",4).map(function(L){return L.readFloatLE(0)}),doubleBE:g("doubleBE",8).map(function(L){return L.readDoubleBE(0)}),doubleLE:g("doubleLE",8).map(function(L){return L.readDoubleLE(0)})},r.exports=a}])})})(kc,kc.exports);var W=kc.exports,Bm=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function NS(e){return e==null?e:e.shiftToAll().normalize()}function O0(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}W.alt(W.regex(new RegExp(Bm(),"")),W.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),W.whitespace.map(e=>"-"),W.any.map(e=>"")).many().map(e=>e.join(""));var VP=W.alt(W.regex(new RegExp(Bm(),"")),W.regex(/[0-9\p{Letter}_-]+/u),W.whitespace.map(e=>" "),W.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function $P(e){return VP.tryParse(e)}function UP(e){return e=NS(e),e=He.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t!=0))),e.toHuman()}var Ml;(function(e){function t(x,O=Hm,A=!1){let P=r(x);if(!P)return O.renderNullAs;switch(P.type){case"null":return O.renderNullAs;case"string":return P.value;case"number":case"boolean":return""+P.value;case"html":return P.value.outerHTML;case"widget":return P.value.markdown();case"link":return P.value.markdown();case"function":return"";case"array":let B="";return A&&(B+="["),B+=P.value.map(G=>t(G,O,!0)).join(", "),A&&(B+="]"),B;case"object":return"{ "+Object.entries(P.value).map(G=>G[0]+": "+t(G[1],O,!0)).join(", ")+" }";case"date":return P.value.second==0&&P.value.hour==0&&P.value.minute==0?P.value.toFormat(O.defaultDateFormat):P.value.toFormat(O.defaultDateTimeFormat);case"duration":return UP(P.value)}}e.toString=t;function r(x){return m(x)?{type:"null",value:x}:l(x)?{type:"number",value:x}:u(x)?{type:"string",value:x}:g(x)?{type:"boolean",value:x}:d(x)?{type:"duration",value:x}:c(x)?{type:"date",value:x}:v(x)?{type:"widget",value:x}:h(x)?{type:"array",value:x}:y(x)?{type:"link",value:x}:C(x)?{type:"function",value:x}:D(x)?{type:"html",value:x}:I(x)?{type:"object",value:x}:void 0}e.wrapValue=r;function n(x,O){if(I(x)){let A={};for(let[P,B]of Object.entries(x))A[P]=n(B,O);return A}else if(h(x)){let A=[];for(let P of x)A.push(n(P,O));return A}else return O(x)}e.mapLeaves=n;function i(x,O,A){var G,J;if(x===void 0&&(x=null),O===void 0&&(O=null),x===null&&O===null)return 0;if(x===null)return-1;if(O===null)return 1;let P=r(x),B=r(O);if(P===void 0&&B===void 0)return 0;if(P===void 0)return-1;if(B===void 0)return 1;if(P.type!=B.type)return P.type.localeCompare(B.type);if(P.value===B.value)return 0;switch(P.type){case"string":return P.value.localeCompare(B.value);case"number":return P.valueN,re=te(Q.path).localeCompare(te(oe.path));if(re!=0)return re;let ne=Q.type.localeCompare(oe.type);return ne!=0?ne:Q.subpath&&!oe.subpath?1:!Q.subpath&&oe.subpath?-1:!Q.subpath&&!oe.subpath?0:((G=Q.subpath)!=null?G:"").localeCompare((J=oe.subpath)!=null?J:"");case"date":return P.value0;case"boolean":return O.value;case"link":return!!O.value.path;case"date":return O.value.toMillis()!=0;case"duration":return O.value.as("seconds")!=0;case"object":return Object.keys(O.value).length>0;case"array":return O.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=o;function s(x){if(x==null)return x;if(e.isArray(x))return[].concat(x.map(O=>s(O)));if(e.isObject(x)){let O={};for(let[A,P]of Object.entries(x))O[A]=s(P);return O}else return x}e.deepCopy=s;function u(x){return typeof x=="string"}e.isString=u;function l(x){return typeof x=="number"}e.isNumber=l;function c(x){return x instanceof mt}e.isDate=c;function d(x){return x instanceof He}e.isDuration=d;function m(x){return x==null}e.isNull=m;function h(x){return Array.isArray(x)}e.isArray=h;function g(x){return typeof x=="boolean"}e.isBoolean=g;function y(x){return x instanceof xc}e.isLink=y;function v(x){return x instanceof Tl}e.isWidget=v;function D(x){return typeof HTMLElement!="undefined"?x instanceof HTMLElement:!1}e.isHtml=D;function I(x){return typeof x=="object"&&!D(x)&&!v(x)&&!h(x)&&!d(x)&&!c(x)&&!y(x)&&x!==void 0&&!m(x)}e.isObject=I;function C(x){return typeof x=="function"}e.isFunction=C})(Ml||(Ml={}));var L0;(function(e){function t(i){return Ml.isObject(i)&&Object.keys(i).length==2&&"key"in i&&"rows"in i}e.isElementGroup=t;function r(i){for(let a of i)if(!t(a))return!1;return!0}e.isGrouping=r;function n(i){if(r(i)){let a=0;for(let o of i)a+=n(o.rows);return a}else return i.length}e.count=n})(L0||(L0={}));var xc=class e{constructor(t){ur(this,"path");ur(this,"display");ur(this,"subpath");ur(this,"embed");ur(this,"type");Object.assign(this,t)}static file(t,r=!1,n){return new e({path:t,embed:r,display:n,subpath:void 0,type:"file"})}static infer(t,r=!1,n){if(t.includes("#^")){let i=t.split("#^");return e.block(i[0],i[1],r,n)}else if(t.includes("#")){let i=t.split("#");return e.header(i[0],i[1],r,n)}else return e.file(t,r,n)}static header(t,r,n,i){return new e({path:t,embed:n,display:i,subpath:$P(r),type:"header"})}static block(t,r,n,i){return new e({path:t,embed:n,display:i,subpath:r,type:"block"})}static fromObject(t){return new e(t)}equals(t){return t==null||t==null?!1:this.path==t.path&&this.type==t.type&&this.subpath==t.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(t){return new e(Object.assign({},this,{path:t}))}withDisplay(t){return new e(Object.assign({},this,{display:t}))}withHeader(t){return e.header(this.path,t,this.embed,this.display)}toFile(){return e.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new e(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new e(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+O0(this.path),(this.type=="header"||this.type=="block")&&(t+=" > "+this.subpath)),t+="]]",t}obsidianLink(){var r,n;let t=this.path.replaceAll("|","\\|");return this.type=="header"?t+"#"+((r=this.subpath)==null?void 0:r.replaceAll("|","\\|")):this.type=="block"?t+"#^"+((n=this.subpath)==null?void 0:n.replaceAll("|","\\|")):t}fileName(){return O0(this.path).replace(".md","")}},Tl=class{constructor(t){ur(this,"$widget");this.$widget=t}},_m=class extends Tl{constructor(r,n){super("dataview:list-pair");ur(this,"key");ur(this,"value");this.key=r,this.value=n}markdown(){return`${Ml.toString(this.key)}: ${Ml.toString(this.value)}`}},Mm=class extends Tl{constructor(r,n){super("dataview:external-link");ur(this,"url");ur(this,"display");this.url=r,this.display=n}markdown(){var r;return`[${(r=this.display)!=null?r:this.url}](${this.url})`}},P0;(function(e){function t(o,s){return new _m(o,s)}e.listPair=t;function r(o,s){return new Mm(o,s)}e.externalLink=r;function n(o){return o.$widget==="dataview:list-pair"}e.isListPair=n;function i(o){return o.$widget==="dataview:external-link"}e.isExternalLink=i;function a(o){return n(o)||i(o)}e.isBuiltin=a})(P0||(P0={}));var fn;(function(e){function t(m){return{type:"variable",name:m}}e.variable=t;function r(m){return{type:"literal",value:m}}e.literal=r;function n(m,h,g){return{type:"binaryop",left:m,op:h,right:g}}e.binaryOp=n;function i(m,h){return{type:"index",object:m,index:h}}e.index=i;function a(m){let h=m.split("."),g=e.variable(h[0]);for(let y=1;y"||m==">="||m=="!="||m=="="}e.isCompareOp=d,e.NULL=e.literal(null)})(fn||(fn={}));var Si;(function(e){function t(c){return{type:"tag",tag:c}}e.tag=t;function r(c){return{type:"csv",path:c}}e.csv=r;function n(c){return{type:"folder",folder:c}}e.folder=n;function i(c,d){return{type:"link",file:c,direction:d?"incoming":"outgoing"}}e.link=i;function a(c,d,m){return{type:"binaryop",left:c,op:d,right:m}}e.binaryOp=a;function o(c,d){return{type:"binaryop",left:c,op:"&",right:d}}e.and=o;function s(c,d){return{type:"binaryop",left:c,op:"|",right:d}}e.or=s;function u(c){return{type:"negate",child:c}}e.negate=u;function l(){return{type:"empty"}}e.empty=l})(Si||(Si={}));var N0=new RegExp(Bm(),""),Tm={year:He.fromObject({years:1}),years:He.fromObject({years:1}),yr:He.fromObject({years:1}),yrs:He.fromObject({years:1}),month:He.fromObject({months:1}),months:He.fromObject({months:1}),mo:He.fromObject({months:1}),mos:He.fromObject({months:1}),week:He.fromObject({weeks:1}),weeks:He.fromObject({weeks:1}),wk:He.fromObject({weeks:1}),wks:He.fromObject({weeks:1}),w:He.fromObject({weeks:1}),day:He.fromObject({days:1}),days:He.fromObject({days:1}),d:He.fromObject({days:1}),hour:He.fromObject({hours:1}),hours:He.fromObject({hours:1}),hr:He.fromObject({hours:1}),hrs:He.fromObject({hours:1}),h:He.fromObject({hours:1}),minute:He.fromObject({minutes:1}),minutes:He.fromObject({minutes:1}),min:He.fromObject({minutes:1}),mins:He.fromObject({minutes:1}),m:He.fromObject({minutes:1}),second:He.fromObject({seconds:1}),seconds:He.fromObject({seconds:1}),sec:He.fromObject({seconds:1}),secs:He.fromObject({seconds:1}),s:He.fromObject({seconds:1})},Fm={now:()=>mt.local(),today:()=>mt.local().startOf("day"),yesterday:()=>mt.local().startOf("day").minus(He.fromObject({days:1})),tomorrow:()=>mt.local().startOf("day").plus(He.fromObject({days:1})),sow:()=>mt.local().startOf("week"),"start-of-week":()=>mt.local().startOf("week"),eow:()=>mt.local().endOf("week"),"end-of-week":()=>mt.local().endOf("week"),soy:()=>mt.local().startOf("year"),"start-of-year":()=>mt.local().startOf("year"),eoy:()=>mt.local().endOf("year"),"end-of-year":()=>mt.local().endOf("year"),som:()=>mt.local().startOf("month"),"start-of-month":()=>mt.local().startOf("month"),eom:()=>mt.local().endOf("month"),"end-of-month":()=>mt.local().endOf("month")},Im=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function WP(e){let t=-1;for(;(t=e.indexOf("|",t+1))>=0;)if(!(t>0&&e[t-1]=="\\"))return[e.substring(0,t).replace(/\\\|/g,"|"),e.substring(t+1)];return[e.replace(/\\\|/g,"|"),void 0]}function YP(e){let[t,r]=WP(e);return xc.infer(t,!1,r)}function kl(e,t,r){return W.seqMap(e,W.seq(W.optWhitespace,t,W.optWhitespace,e).many(),(n,i)=>{if(i.length==0)return n;let a=r(n,i[0][1],i[0][3]);for(let o=1;o(i,a)=>{let o=e._(i,a);if(!o.status)return o;for(let s of t){let u=s(o.value)._(i,o.index);if(!u.status)return o;o=u}return o})}var ai=W.createLanguage({number:e=>W.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>W.string('"').then(W.alt(e.escapeCharacter,W.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(W.string('"')).desc("string"),escapeCharacter:e=>W.string("\\").then(W.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>W.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>W.seqMap(W.string("#"),W.alt(W.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,r)=>t+r.join("")).desc("tag ('#hello/stuff')"),identifier:e=>W.seqMap(W.alt(W.regexp(/\p{Letter}/u),W.regexp(N0).desc("text")),W.alt(W.regexp(/[0-9\p{Letter}_-]/u),W.regexp(N0).desc("text")).many(),(t,r)=>t+r.join("")).desc("variable identifier"),link:e=>W.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>YP(t)).desc("file link"),embedLink:e=>W.seqMap(W.string("!").atMost(1),e.link,(t,r)=>(t.length>0&&(r.embed=!0),r)).desc("file link"),binaryPlusMinus:e=>W.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>W.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>W.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>W.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>W.seqMap(W.regexp(/\d{4}/),W.string("-"),W.regexp(/\d{2}/),(t,r,n)=>mt.fromObject({year:Number.parseInt(t),month:Number.parseInt(n)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>W.alt(...Object.keys(Fm).sort((t,r)=>r.length-t.length).map(W.string)),date:e=>zP(e.rootDate,t=>W.seqMap(W.string("-"),W.regexp(/\d{2}/),(r,n)=>t.set({day:Number.parseInt(n)})),t=>W.seqMap(W.string("T"),W.regexp(/\d{2}/),(r,n)=>t.set({hour:Number.parseInt(n)})),t=>W.seqMap(W.string(":"),W.regexp(/\d{2}/),(r,n)=>t.set({minute:Number.parseInt(n)})),t=>W.seqMap(W.string(":"),W.regexp(/\d{2}/),(r,n)=>t.set({second:Number.parseInt(n)})),t=>W.alt(W.seqMap(W.string("."),W.regexp(/\d{3}/),(r,n)=>t.set({millisecond:Number.parseInt(n)})),W.succeed(t)),t=>W.alt(W.seqMap(W.string("+").or(W.string("-")),W.regexp(/\d{1,2}(:\d{2})?/),(r,n)=>t.setZone("UTC"+r+n,{keepLocalTime:!0})),W.seqMap(W.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),W.seqMap(W.string("["),W.regexp(/[0-9A-Za-z+-\/]+/u),W.string("]"),(r,n,i)=>t.setZone(n,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>W.alt(e.dateShorthand.map(t=>Fm[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>W.alt(...Object.keys(Tm).sort((t,r)=>r.length-t.length).map(W.string)),duration:e=>W.seqMap(e.number,W.optWhitespace,e.durationType,(t,r,n)=>Tm[n].mapUnits(i=>i*t)).sepBy1(W.string(",").trim(W.optWhitespace).or(W.optWhitespace)).map(t=>t.reduce((r,n)=>r.plus(n))).desc("duration like 4hr2min"),rawNull:e=>W.string("null"),tagSource:e=>e.tag.map(t=>Si.tag(t)),csvSource:e=>W.seqMap(W.string("csv(").skip(W.optWhitespace),e.string,W.string(")"),(t,r,n)=>Si.csv(r)),linkIncomingSource:e=>e.link.map(t=>Si.link(t.path,!0)),linkOutgoingSource:e=>W.seqMap(W.string("outgoing(").skip(W.optWhitespace),e.link,W.string(")"),(t,r,n)=>Si.link(r.path,!1)),folderSource:e=>e.string.map(t=>Si.folder(t)),parensSource:e=>W.seqMap(W.string("("),W.optWhitespace,e.source,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>n),negateSource:e=>W.seqMap(W.alt(W.string("-"),W.string("!")),e.atomSource,(t,r)=>Si.negate(r)),atomSource:e=>W.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>kl(e.atomSource,e.binaryBooleanOp.map(t=>t),Si.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>Im.includes(t.toUpperCase())?W.fail("Variable fields cannot be a keyword ("+Im.join(" or ")+")"):W.succeed(fn.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>fn.literal(t)).desc("number"),stringField:e=>e.string.map(t=>fn.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>fn.literal(t)).desc("boolean"),dateField:e=>W.seqMap(W.string("date("),W.optWhitespace,e.datePlus,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>fn.literal(n)).desc("date"),durationField:e=>W.seqMap(W.string("dur("),W.optWhitespace,e.duration,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>fn.literal(n)).desc("duration"),nullField:e=>e.rawNull.map(t=>fn.NULL),linkField:e=>e.link.map(t=>fn.literal(t)),listField:e=>e.field.sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("[").skip(W.optWhitespace),W.optWhitespace.then(W.string("]"))).map(t=>fn.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>W.seqMap(e.identifier.or(e.string),W.string(":").trim(W.optWhitespace),e.field,(t,r,n)=>({name:t,value:n})).sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("{").skip(W.optWhitespace),W.optWhitespace.then(W.string("}"))).map(t=>{let r={};for(let n of t)r[n.name]=n.value;return fn.object(r)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>W.alt(e.date,e.duration.map(t=>NS(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(W.string(",").trim(W.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>W.alt(W.seqMap(e.atomInlineField,W.string(",").trim(W.optWhitespace),e.inlineFieldList,(t,r,n)=>[t].concat(n)),e.atomInlineField),atomField:e=>W.alt(e.embedLink.map(t=>fn.literal(t)),e.negatedField,e.linkField,e.listField,e.objectField,e.lambdaField,e.parensField,e.boolField,e.numberField,e.stringField,e.dateField,e.durationField,e.nullField,e.variableField),indexField:e=>W.seqMap(e.atomField,W.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,r)=>{let n=t;for(let i of r)switch(i.type){case"dot":n=fn.index(n,fn.literal(i.field));break;case"index":n=fn.index(n,i.field);break;case"function":n=fn.func(n,i.fields);break}return n}),negatedField:e=>W.seqMap(W.string("!"),e.indexField,(t,r)=>fn.negate(r)).desc("negated field"),parensField:e=>W.seqMap(W.string("("),W.optWhitespace,e.field,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>n),lambdaField:e=>W.seqMap(e.identifier.sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("(").trim(W.optWhitespace),W.string(")").trim(W.optWhitespace)),W.string("=>").trim(W.optWhitespace),e.field,(t,r,n)=>({type:"lambda",arguments:t,value:n})),dotPostfix:e=>W.seqMap(W.string("."),e.identifier,(t,r)=>({type:"dot",field:r})),indexPostfix:e=>W.seqMap(W.string("["),W.optWhitespace,e.field,W.optWhitespace,W.string("]"),(t,r,n,i,a)=>({type:"index",field:n})),functionPostfix:e=>W.seqMap(W.string("("),W.optWhitespace,e.field.sepBy(W.string(",").trim(W.optWhitespace)),W.optWhitespace,W.string(")"),(t,r,n,i,a)=>({type:"function",fields:n})),binaryMulDivField:e=>kl(e.indexField,e.binaryMulDiv,fn.binaryOp),binaryPlusMinusField:e=>kl(e.binaryMulDivField,e.binaryPlusMinus,fn.binaryOp),binaryCompareField:e=>kl(e.binaryPlusMinusField,e.binaryCompareOp,fn.binaryOp),binaryBooleanField:e=>kl(e.binaryCompareField,e.binaryBooleanOp,fn.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function KP(e){try{return Ec.success(ai.field.tryParse(e))}catch(t){return Ec.failure(""+t)}}var Cc;(function(e){function t(n,i){return{name:n,field:i}}e.named=t;function r(n,i){return{field:n,direction:i}}e.sortBy=r})(Cc||(Cc={}));function jP(e){return W.custom((t,r)=>(n,i)=>{let a=e._(n,i);return a.status?Object.assign({},a,{value:[a.value,n.substring(i,a.index)]}):a})}function qP(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}function R0(e,t){return W.eof.map(e).or(W.whitespace.then(t))}var RS=W.createLanguage({queryType:e=>W.alt(W.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>W.seqMap(ai.field.skip(W.whitespace),W.regexp(/AS/i).skip(W.whitespace),ai.identifier.or(ai.string),(t,r,n)=>Cc.named(n,t)),comment:()=>W.Parser((e,t)=>{let r=e.substring(t);if(!r.startsWith("//"))return W.makeFailure(t,"Not a comment");r=r.split(` +`)[0];let n=r.substring(2).trim();return W.makeSuccess(t+r.length,n)}),namedField:e=>W.alt(e.explicitNamedField,jP(ai.field).map(([t,r])=>Cc.named(qP(r),t))),sortField:e=>W.seqMap(ai.field.skip(W.optWhitespace),W.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(t,r)=>{let n=r.length==0?"ascending":r[0].toLowerCase();return n=="desc"&&(n="descending"),n=="asc"&&(n="ascending"),{field:t,direction:n}}),headerClause:e=>e.queryType.chain(t=>{switch(t){case"table":return R0(()=>({type:t,fields:[],showId:!0}),W.seqMap(W.regexp(/WITHOUT\s+ID/i).skip(W.optWhitespace).atMost(1),W.sepBy(e.namedField,W.string(",").trim(W.optWhitespace)),(r,n)=>({type:t,fields:n,showId:r.length==0})));case"list":return R0(()=>({type:t,format:void 0,showId:!0}),W.seqMap(W.regexp(/WITHOUT\s+ID/i).skip(W.optWhitespace).atMost(1),ai.field.atMost(1),(r,n)=>({type:t,format:n.length==1?n[0]:void 0,showId:r.length==0})));case"task":return W.succeed({type:t});case"calendar":return W.whitespace.then(W.seqMap(e.namedField,r=>({type:t,showId:!0,field:r})));default:return W.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>W.seqMap(W.regexp(/FROM/i),W.whitespace,ai.source,(t,r,n)=>n),whereClause:e=>W.seqMap(W.regexp(/WHERE/i),W.whitespace,ai.field,(t,r,n)=>({type:"where",clause:n})).desc("WHERE "),sortByClause:e=>W.seqMap(W.regexp(/SORT/i),W.whitespace,e.sortField.sepBy1(W.string(",").trim(W.optWhitespace)),(t,r,n)=>({type:"sort",fields:n})).desc("SORT field [ASC/DESC]"),limitClause:e=>W.seqMap(W.regexp(/LIMIT/i),W.whitespace,ai.field,(t,r,n)=>({type:"limit",amount:n})).desc("LIMIT "),flattenClause:e=>W.seqMap(W.regexp(/FLATTEN/i).skip(W.whitespace),e.namedField,(t,r)=>({type:"flatten",field:r})).desc("FLATTEN [AS ]"),groupByClause:e=>W.seqMap(W.regexp(/GROUP BY/i).skip(W.whitespace),e.namedField,(t,r)=>({type:"group",field:r})).desc("GROUP BY [AS ]"),clause:e=>W.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>W.seqMap(e.headerClause.trim(dm),e.fromClause.trim(dm).atMost(1),e.clause.trim(dm).many(),(t,r,n)=>({header:t,source:r.length==0?Si.folder(""):r[0],operations:n,settings:Hm}))}),dm=W.alt(W.whitespace,RS.comment).many().map(e=>e.join("")),GP=e=>{var t;return e?(t=e.plugins.plugins.dataview)==null?void 0:t.api:window.DataviewAPI},JP=e=>e.plugins.enabledPlugins.has("dataview");Ei.DATE_SHORTHANDS=Fm;Ei.DURATION_TYPES=Tm;Ei.EXPRESSION=ai;Ei.KEYWORDS=Im;Ei.QUERY_LANGUAGE=RS;Ei.getAPI=GP;Ei.isPluginEnabled=JP;Ei.parseField=KP});var HS=wn((Vm,$m)=>{(function(e,t){typeof Vm=="object"&&typeof $m!="undefined"?$m.exports=t():typeof define=="function"&&define.amd?define(t):e.Mark=t()})(Vm,function(){"use strict";var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t=function(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")},r=function(){function s(u,l){for(var c=0;c1&&arguments[1]!==void 0?arguments[1]:!0,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5e3;t(this,s),this.ctx=u,this.iframes=l,this.exclude=c,this.iframesTimeout=d}return r(s,[{key:"getContexts",value:function(){var l=void 0,c=[];return typeof this.ctx=="undefined"||!this.ctx?l=[]:NodeList.prototype.isPrototypeOf(this.ctx)?l=Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?l=this.ctx:typeof this.ctx=="string"?l=Array.prototype.slice.call(document.querySelectorAll(this.ctx)):l=[this.ctx],l.forEach(function(d){var m=c.filter(function(h){return h.contains(d)}).length>0;c.indexOf(d)===-1&&!m&&c.push(d)}),c}},{key:"getIframeContents",value:function(l,c){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},m=void 0;try{var h=l.contentWindow;if(m=h.document,!h||!m)throw new Error("iframe inaccessible")}catch(g){d()}m&&c(m)}},{key:"isIframeBlank",value:function(l){var c="about:blank",d=l.getAttribute("src").trim(),m=l.contentWindow.location.href;return m===c&&d!==c&&d}},{key:"observeIframeLoad",value:function(l,c,d){var m=this,h=!1,g=null,y=function v(){if(!h){h=!0,activeWindow.clearTimeout(g);try{m.isIframeBlank(l)||(l.removeEventListener("load",v),m.getIframeContents(l,c,d))}catch(D){d()}}};l.addEventListener("load",y),g=activeWindow.setTimeout(y,this.iframesTimeout)}},{key:"onIframeReady",value:function(l,c,d){try{l.contentWindow.document.readyState==="complete"?this.isIframeBlank(l)?this.observeIframeLoad(l,c,d):this.getIframeContents(l,c,d):this.observeIframeLoad(l,c,d)}catch(m){d()}}},{key:"waitForIframes",value:function(l,c){var d=this,m=0;this.forEachIframe(l,function(){return!0},function(h){m++,d.waitForIframes(h.querySelector("html"),function(){--m||c()})},function(h){h||c()})}},{key:"forEachIframe",value:function(l,c,d){var m=this,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},g=l.querySelectorAll("iframe"),y=g.length,v=0;g=Array.prototype.slice.call(g);var D=function(){--y<=0&&h(v)};y||D(),g.forEach(function(I){s.matches(I,m.exclude)?D():m.onIframeReady(I,function(C){c(I)&&(v++,d(C)),D()},D)})}},{key:"createIterator",value:function(l,c,d){return document.createNodeIterator(l,c,d,!1)}},{key:"createInstanceOnIframe",value:function(l){return new s(l.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(l,c,d){var m=l.compareDocumentPosition(d),h=Node.DOCUMENT_POSITION_PRECEDING;if(m&h)if(c!==null){var g=c.compareDocumentPosition(d),y=Node.DOCUMENT_POSITION_FOLLOWING;if(g&y)return!0}else return!0;return!1}},{key:"getIteratorNode",value:function(l){var c=l.previousNode(),d=void 0;return c===null?d=l.nextNode():d=l.nextNode()&&l.nextNode(),{prevNode:c,node:d}}},{key:"checkIframeFilter",value:function(l,c,d,m){var h=!1,g=!1;return m.forEach(function(y,v){y.val===d&&(h=v,g=y.handled)}),this.compareNodeIframe(l,c,d)?(h===!1&&!g?m.push({val:d,handled:!0}):h!==!1&&!g&&(m[h].handled=!0),!0):(h===!1&&m.push({val:d,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(l,c,d,m){var h=this;l.forEach(function(g){g.handled||h.getIframeContents(g.val,function(y){h.createInstanceOnIframe(y).forEachNode(c,d,m)})})}},{key:"iterateThroughNodes",value:function(l,c,d,m,h){for(var g=this,y=this.createIterator(c,l,m),v=[],D=[],I=void 0,C=void 0,x=function(){var A=g.getIteratorNode(y);return C=A.prevNode,I=A.node,I};x();)this.iframes&&this.forEachIframe(c,function(O){return g.checkIframeFilter(I,C,O,v)},function(O){g.createInstanceOnIframe(O).forEachNode(l,function(A){return D.push(A)},m)}),D.push(I);D.forEach(function(O){d(O)}),this.iframes&&this.handleOpenIframes(v,l,d,m),h()}},{key:"forEachNode",value:function(l,c,d){var m=this,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},g=this.getContexts(),y=g.length;y||h(),g.forEach(function(v){var D=function(){m.iterateThroughNodes(l,v,c,d,function(){--y<=0&&h()})};m.iframes?m.waitForIframes(v,D):D()})}}],[{key:"matches",value:function(l,c){var d=typeof c=="string"?[c]:c,m=l.matches||l.matchesSelector||l.msMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.webkitMatchesSelector;if(m){var h=!1;return d.every(function(g){return m.call(l,g)?(h=!0,!1):!0}),h}else return!1}}]),s}(),a=function(){function s(u){t(this,s),this.ctx=u,this.ie=!1;var l=window.navigator.userAgent;(l.indexOf("MSIE")>-1||l.indexOf("Trident")>-1)&&(this.ie=!0)}return r(s,[{key:"log",value:function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"debug",d=this.opt.log;this.opt.debug&&(typeof d=="undefined"?"undefined":e(d))==="object"&&typeof d[c]=="function"&&d[c]("mark.js: "+l)}},{key:"escapeStr",value:function(l){return l.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(l){return this.opt.wildcards!=="disabled"&&(l=this.setupWildcardsRegExp(l)),l=this.escapeStr(l),Object.keys(this.opt.synonyms).length&&(l=this.createSynonymsRegExp(l)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.setupIgnoreJoinersRegExp(l)),this.opt.diacritics&&(l=this.createDiacriticsRegExp(l)),l=this.createMergedBlanksRegExp(l),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.createJoinersRegExp(l)),this.opt.wildcards!=="disabled"&&(l=this.createWildcardsRegExp(l)),l=this.createAccuracyRegExp(l),l}},{key:"createSynonymsRegExp",value:function(l){var c=this.opt.synonyms,d=this.opt.caseSensitive?"":"i",m=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var h in c)if(c.hasOwnProperty(h)){var g=c[h],y=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(h):this.escapeStr(h),v=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(g):this.escapeStr(g);y!==""&&v!==""&&(l=l.replace(new RegExp("("+this.escapeStr(y)+"|"+this.escapeStr(v)+")","gm"+d),m+("("+this.processSynomyms(y)+"|")+(this.processSynomyms(v)+")")+m))}return l}},{key:"processSynomyms",value:function(l){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.setupIgnoreJoinersRegExp(l)),l}},{key:"setupWildcardsRegExp",value:function(l){return l=l.replace(/(?:\\)*\?/g,function(c){return c.charAt(0)==="\\"?"?":""}),l.replace(/(?:\\)*\*/g,function(c){return c.charAt(0)==="\\"?"*":""})}},{key:"createWildcardsRegExp",value:function(l){var c=this.opt.wildcards==="withSpaces";return l.replace(/\u0001/g,c?"[\\S\\s]?":"\\S?").replace(/\u0002/g,c?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(l){return l.replace(/[^(|)\\]/g,function(c,d,m){var h=m.charAt(d+1);return/[(|)\\]/.test(h)||h===""?c:c+"\0"})}},{key:"createJoinersRegExp",value:function(l){var c=[],d=this.opt.ignorePunctuation;return Array.isArray(d)&&d.length&&c.push(this.escapeStr(d.join(""))),this.opt.ignoreJoiners&&c.push("\\u00ad\\u200b\\u200c\\u200d"),c.length?l.split(/\u0000+/).join("["+c.join("")+"]*"):l}},{key:"createDiacriticsRegExp",value:function(l){var c=this.opt.caseSensitive?"":"i",d=this.opt.caseSensitive?["a\xE0\xE1\u1EA3\xE3\u1EA1\u0103\u1EB1\u1EAF\u1EB3\u1EB5\u1EB7\xE2\u1EA7\u1EA5\u1EA9\u1EAB\u1EAD\xE4\xE5\u0101\u0105","A\xC0\xC1\u1EA2\xC3\u1EA0\u0102\u1EB0\u1EAE\u1EB2\u1EB4\u1EB6\xC2\u1EA6\u1EA4\u1EA8\u1EAA\u1EAC\xC4\xC5\u0100\u0104","c\xE7\u0107\u010D","C\xC7\u0106\u010C","d\u0111\u010F","D\u0110\u010E","e\xE8\xE9\u1EBB\u1EBD\u1EB9\xEA\u1EC1\u1EBF\u1EC3\u1EC5\u1EC7\xEB\u011B\u0113\u0119","E\xC8\xC9\u1EBA\u1EBC\u1EB8\xCA\u1EC0\u1EBE\u1EC2\u1EC4\u1EC6\xCB\u011A\u0112\u0118","i\xEC\xED\u1EC9\u0129\u1ECB\xEE\xEF\u012B","I\xCC\xCD\u1EC8\u0128\u1ECA\xCE\xCF\u012A","l\u0142","L\u0141","n\xF1\u0148\u0144","N\xD1\u0147\u0143","o\xF2\xF3\u1ECF\xF5\u1ECD\xF4\u1ED3\u1ED1\u1ED5\u1ED7\u1ED9\u01A1\u1EDF\u1EE1\u1EDB\u1EDD\u1EE3\xF6\xF8\u014D","O\xD2\xD3\u1ECE\xD5\u1ECC\xD4\u1ED2\u1ED0\u1ED4\u1ED6\u1ED8\u01A0\u1EDE\u1EE0\u1EDA\u1EDC\u1EE2\xD6\xD8\u014C","r\u0159","R\u0158","s\u0161\u015B\u0219\u015F","S\u0160\u015A\u0218\u015E","t\u0165\u021B\u0163","T\u0164\u021A\u0162","u\xF9\xFA\u1EE7\u0169\u1EE5\u01B0\u1EEB\u1EE9\u1EED\u1EEF\u1EF1\xFB\xFC\u016F\u016B","U\xD9\xDA\u1EE6\u0168\u1EE4\u01AF\u1EEA\u1EE8\u1EEC\u1EEE\u1EF0\xDB\xDC\u016E\u016A","y\xFD\u1EF3\u1EF7\u1EF9\u1EF5\xFF","Y\xDD\u1EF2\u1EF6\u1EF8\u1EF4\u0178","z\u017E\u017C\u017A","Z\u017D\u017B\u0179"]:["a\xE0\xE1\u1EA3\xE3\u1EA1\u0103\u1EB1\u1EAF\u1EB3\u1EB5\u1EB7\xE2\u1EA7\u1EA5\u1EA9\u1EAB\u1EAD\xE4\xE5\u0101\u0105A\xC0\xC1\u1EA2\xC3\u1EA0\u0102\u1EB0\u1EAE\u1EB2\u1EB4\u1EB6\xC2\u1EA6\u1EA4\u1EA8\u1EAA\u1EAC\xC4\xC5\u0100\u0104","c\xE7\u0107\u010DC\xC7\u0106\u010C","d\u0111\u010FD\u0110\u010E","e\xE8\xE9\u1EBB\u1EBD\u1EB9\xEA\u1EC1\u1EBF\u1EC3\u1EC5\u1EC7\xEB\u011B\u0113\u0119E\xC8\xC9\u1EBA\u1EBC\u1EB8\xCA\u1EC0\u1EBE\u1EC2\u1EC4\u1EC6\xCB\u011A\u0112\u0118","i\xEC\xED\u1EC9\u0129\u1ECB\xEE\xEF\u012BI\xCC\xCD\u1EC8\u0128\u1ECA\xCE\xCF\u012A","l\u0142L\u0141","n\xF1\u0148\u0144N\xD1\u0147\u0143","o\xF2\xF3\u1ECF\xF5\u1ECD\xF4\u1ED3\u1ED1\u1ED5\u1ED7\u1ED9\u01A1\u1EDF\u1EE1\u1EDB\u1EDD\u1EE3\xF6\xF8\u014DO\xD2\xD3\u1ECE\xD5\u1ECC\xD4\u1ED2\u1ED0\u1ED4\u1ED6\u1ED8\u01A0\u1EDE\u1EE0\u1EDA\u1EDC\u1EE2\xD6\xD8\u014C","r\u0159R\u0158","s\u0161\u015B\u0219\u015FS\u0160\u015A\u0218\u015E","t\u0165\u021B\u0163T\u0164\u021A\u0162","u\xF9\xFA\u1EE7\u0169\u1EE5\u01B0\u1EEB\u1EE9\u1EED\u1EEF\u1EF1\xFB\xFC\u016F\u016BU\xD9\xDA\u1EE6\u0168\u1EE4\u01AF\u1EEA\u1EE8\u1EEC\u1EEE\u1EF0\xDB\xDC\u016E\u016A","y\xFD\u1EF3\u1EF7\u1EF9\u1EF5\xFFY\xDD\u1EF2\u1EF6\u1EF8\u1EF4\u0178","z\u017E\u017C\u017AZ\u017D\u017B\u0179"],m=[];return l.split("").forEach(function(h){d.every(function(g){if(g.indexOf(h)!==-1){if(m.indexOf(g)>-1)return!1;l=l.replace(new RegExp("["+g+"]","gm"+c),"["+g+"]"),m.push(g)}return!0})}),l}},{key:"createMergedBlanksRegExp",value:function(l){return l.replace(/[\s]+/gmi,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(l){var c=this,d="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\xA1\xBF",m=this.opt.accuracy,h=typeof m=="string"?m:m.value,g=typeof m=="string"?[]:m.limiters,y="";switch(g.forEach(function(v){y+="|"+c.escapeStr(v)}),h){case"partially":default:return"()("+l+")";case"complementary":return y="\\s"+(y||this.escapeStr(d)),"()([^"+y+"]*"+l+"[^"+y+"]*)";case"exactly":return"(^|\\s"+y+")("+l+")(?=$|\\s"+y+")"}}},{key:"getSeparatedKeywords",value:function(l){var c=this,d=[];return l.forEach(function(m){c.opt.separateWordSearch?m.split(" ").forEach(function(h){h.trim()&&d.indexOf(h)===-1&&d.push(h)}):m.trim()&&d.indexOf(m)===-1&&d.push(m)}),{keywords:d.sort(function(m,h){return h.length-m.length}),length:d.length}}},{key:"isNumeric",value:function(l){return Number(parseFloat(l))==l}},{key:"checkRanges",value:function(l){var c=this;if(!Array.isArray(l)||Object.prototype.toString.call(l[0])!=="[object Object]")return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(l),[];var d=[],m=0;return l.sort(function(h,g){return h.start-g.start}).forEach(function(h){var g=c.callNoMatchOnInvalidRanges(h,m),y=g.start,v=g.end,D=g.valid;D&&(h.start=y,h.length=v-y,d.push(h),m=v)}),d}},{key:"callNoMatchOnInvalidRanges",value:function(l,c){var d=void 0,m=void 0,h=!1;return l&&typeof l.start!="undefined"?(d=parseInt(l.start,10),m=d+parseInt(l.length,10),this.isNumeric(l.start)&&this.isNumeric(l.length)&&m-c>0&&m-d>0?h=!0:(this.log("Ignoring invalid or overlapping range: "+(""+JSON.stringify(l))),this.opt.noMatch(l))):(this.log("Ignoring invalid range: "+JSON.stringify(l)),this.opt.noMatch(l)),{start:d,end:m,valid:h}}},{key:"checkWhitespaceRanges",value:function(l,c,d){var m=void 0,h=!0,g=d.length,y=c-g,v=parseInt(l.start,10)-y;return v=v>g?g:v,m=v+parseInt(l.length,10),m>g&&(m=g,this.log("End range automatically set to the max value of "+g)),v<0||m-v<0||v>g||m>g?(h=!1,this.log("Invalid range: "+JSON.stringify(l)),this.opt.noMatch(l)):d.substring(v,m).replace(/\s+/g,"")===""&&(h=!1,this.log("Skipping whitespace only range: "+JSON.stringify(l)),this.opt.noMatch(l)),{start:v,end:m,valid:h}}},{key:"getTextNodes",value:function(l){var c=this,d="",m=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(h){m.push({start:d.length,end:(d+=h.textContent).length,node:h})},function(h){return c.matchesExclude(h.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){l({value:d,nodes:m})})}},{key:"matchesExclude",value:function(l){return i.matches(l,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(l,c,d){var m=this.opt.element?this.opt.element:"mark",h=l.splitText(c),g=h.splitText(d-c),y=document.createElement(m);return y.setAttribute("data-markjs","true"),this.opt.className&&y.setAttribute("class",this.opt.className),y.textContent=h.textContent,h.parentNode.replaceChild(y,h),g}},{key:"wrapRangeInMappedTextNode",value:function(l,c,d,m,h){var g=this;l.nodes.every(function(y,v){var D=l.nodes[v+1];if(typeof D=="undefined"||D.start>c){if(!m(y.node))return!1;var I=c-y.start,C=(d>y.end?y.end:d)-y.start,x=l.value.substr(0,y.start),O=l.value.substr(C+y.start);if(y.node=g.wrapRangeInTextNode(y.node,I,C),l.value=x+O,l.nodes.forEach(function(A,P){P>=v&&(l.nodes[P].start>0&&P!==v&&(l.nodes[P].start-=C),l.nodes[P].end-=C)}),d-=C,h(y.node.previousSibling,y.start),d>y.end)c=y.end;else return!1}return!0})}},{key:"wrapMatches",value:function(l,c,d,m,h){var g=this,y=c===0?0:c+1;this.getTextNodes(function(v){v.nodes.forEach(function(D){D=D.node;for(var I=void 0;(I=l.exec(D.textContent))!==null&&I[y]!=="";)if(d(I[y],D)){var C=I.index;if(y!==0)for(var x=1;x{(function(e,t){typeof Um=="object"&&typeof ls!="undefined"?ls.exports=t():typeof define=="function"&&define.amd?define(t):e.moment=t()})(Um,function(){"use strict";var e;function t(){return e.apply(null,arguments)}function r(f){e=f}function n(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function i(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function a(f,p){return Object.prototype.hasOwnProperty.call(f,p)}function o(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;var p;for(p in f)if(a(f,p))return!1;return!0}function s(f){return f===void 0}function u(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function l(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function c(f,p){var w=[],S,F=f.length;for(S=0;S>>0,S;for(S=0;S0)for(w=0;w=0;return(j?w?"+":"":"-")+Math.pow(10,Math.max(0,F)).toString().substr(1)+S}var Ce=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,U=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Je={},it={};function N(f,p,w,S){var F=S;typeof S=="string"&&(F=function(){return this[S]()}),f&&(it[f]=F),p&&(it[p[0]]=function(){return De(F.apply(this,arguments),p[1],p[2])}),w&&(it[w]=function(){return this.localeData().ordinal(F.apply(this,arguments),f)})}function Ze(f){return f.match(/\[[\s\S]/)?f.replace(/^\[|\]$/g,""):f.replace(/\\/g,"")}function It(f){var p=f.match(Ce),w,S;for(w=0,S=p.length;w=0&&U.test(f);)f=f.replace(U,S),U.lastIndex=0,w-=1;return f}var vt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Wt(f){var p=this._longDateFormat[f],w=this._longDateFormat[f.toUpperCase()];return p||!w?p:(this._longDateFormat[f]=w.match(Ce).map(function(S){return S==="MMMM"||S==="MM"||S==="DD"||S==="dddd"?S.slice(1):S}).join(""),this._longDateFormat[f])}var Tt="Invalid date";function Jt(){return this._invalidDate}var en="%d",gn=/\d{1,2}/;function yn(f){return this._ordinal.replace("%d",f)}var vn={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function xn(f,p,w,S){var F=this._relativeTime[w];return Q(F)?F(f,p,w,S):F.replace(/%d/i,f)}function jn(f,p){var w=this._relativeTime[f>0?"future":"past"];return Q(w)?w(p):w.replace(/%s/i,p)}var sn={};function Rt(f,p){var w=f.toLowerCase();sn[w]=sn[w+"s"]=sn[p]=f}function Vt(f){return typeof f=="string"?sn[f]||sn[f.toLowerCase()]:void 0}function Sr(f){var p={},w,S;for(S in f)a(f,S)&&(w=Vt(S),w&&(p[w]=f[S]));return p}var Rr={};function Bt(f,p){Rr[f]=p}function Hr(f){var p=[],w;for(w in f)a(f,w)&&p.push({unit:w,priority:Rr[w]});return p.sort(function(S,F){return S.priority-F.priority}),p}function rn(f){return f%4===0&&f%100!==0||f%400===0}function At(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function Z(f){var p=+f,w=0;return p!==0&&isFinite(p)&&(w=At(p)),w}function me(f,p){return function(w){return w!=null?(at(this,f,w),t.updateOffset(this,p),this):Ie(this,f)}}function Ie(f,p){return f.isValid()?f._d["get"+(f._isUTC?"UTC":"")+p]():NaN}function at(f,p,w){f.isValid()&&!isNaN(w)&&(p==="FullYear"&&rn(f.year())&&f.month()===1&&f.date()===29?(w=Z(w),f._d["set"+(f._isUTC?"UTC":"")+p](w,f.month(),b(w,f.month()))):f._d["set"+(f._isUTC?"UTC":"")+p](w))}function Dt(f){return f=Vt(f),Q(this[f])?this[f]():this}function Cn(f,p){if(typeof f=="object"){f=Sr(f);var w=Hr(f),S,F=w.length;for(S=0;S68?1900:2e3)};var On=me("FullYear",!0);function Vn(){return rn(this.year())}function ki(f,p,w,S,F,j,se){var Pe;return f<100&&f>=0?(Pe=new Date(f+400,p,w,S,F,j,se),isFinite(Pe.getFullYear())&&Pe.setFullYear(f)):Pe=new Date(f,p,w,S,F,j,se),Pe}function kr(f){var p,w;return f<100&&f>=0?(w=Array.prototype.slice.call(arguments),w[0]=f+400,p=new Date(Date.UTC.apply(null,w)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(f)):p=new Date(Date.UTC.apply(null,arguments)),p}function Jr(f,p,w){var S=7+p-w,F=(7+kr(f,0,S).getUTCDay()-p)%7;return-F+S-1}function My(f,p,w,S,F){var j=(7+w-S)%7,se=Jr(f,S,F),Pe=1+7*(p-1)+j+se,ut,$t;return Pe<=0?(ut=f-1,$t=qt(ut)+Pe):Pe>qt(f)?(ut=f+1,$t=Pe-qt(f)):(ut=f,$t=Pe),{year:ut,dayOfYear:$t}}function Ns(f,p,w){var S=Jr(f.year(),p,w),F=Math.floor((f.dayOfYear()-S-1)/7)+1,j,se;return F<1?(se=f.year()-1,j=F+xi(se,p,w)):F>xi(f.year(),p,w)?(j=F-xi(f.year(),p,w),se=f.year()+1):(se=f.year(),j=F),{week:j,year:se}}function xi(f,p,w){var S=Jr(f,p,w),F=Jr(f+1,p,w);return(qt(f)-S+F)/7}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),Rt("week","w"),Rt("isoWeek","W"),Bt("week",5),Bt("isoWeek",5),ae("w",L),ae("ww",L,Ht),ae("W",L),ae("WW",L,Ht),Ft(["w","ww","W","WW"],function(f,p,w,S){p[S.substr(0,1)]=Z(f)});function j_(f){return Ns(f,this._week.dow,this._week.doy).week}var q_={dow:0,doy:6};function G_(){return this._week.dow}function J_(){return this._week.doy}function Z_(f){var p=this.localeData().week(this);return f==null?p:this.add((f-p)*7,"d")}function Q_(f){var p=Ns(this,1,4).week;return f==null?p:this.add((f-p)*7,"d")}N("d",0,"do","day"),N("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),N("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),N("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),Rt("day","d"),Rt("weekday","e"),Rt("isoWeekday","E"),Bt("day",11),Bt("weekday",11),Bt("isoWeekday",11),ae("d",L),ae("e",L),ae("E",L),ae("dd",function(f,p){return p.weekdaysMinRegex(f)}),ae("ddd",function(f,p){return p.weekdaysShortRegex(f)}),ae("dddd",function(f,p){return p.weekdaysRegex(f)}),Ft(["dd","ddd","dddd"],function(f,p,w,S){var F=w._locale.weekdaysParse(f,S,w._strict);F!=null?p.d=F:g(w).invalidWeekday=f}),Ft(["d","e","E"],function(f,p,w,S){p[S]=Z(f)});function X_(f,p){return typeof f!="string"?f:isNaN(f)?(f=p.weekdaysParse(f),typeof f=="number"?f:null):parseInt(f,10)}function e1(f,p){return typeof f=="string"?p.weekdaysParse(f)%7||7:isNaN(f)?null:f}function bf(f,p){return f.slice(p,7).concat(f.slice(0,p))}var t1="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ty="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),n1="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),r1=ye,i1=ye,a1=ye;function o1(f,p){var w=n(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return f===!0?bf(w,this._week.dow):f?w[f.day()]:w}function s1(f){return f===!0?bf(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort}function l1(f){return f===!0?bf(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin}function u1(f,p,w){var S,F,j,se=f.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],S=0;S<7;++S)j=m([2e3,1]).day(S),this._minWeekdaysParse[S]=this.weekdaysMin(j,"").toLocaleLowerCase(),this._shortWeekdaysParse[S]=this.weekdaysShort(j,"").toLocaleLowerCase(),this._weekdaysParse[S]=this.weekdays(j,"").toLocaleLowerCase();return w?p==="dddd"?(F=_.call(this._weekdaysParse,se),F!==-1?F:null):p==="ddd"?(F=_.call(this._shortWeekdaysParse,se),F!==-1?F:null):(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null):p==="dddd"?(F=_.call(this._weekdaysParse,se),F!==-1||(F=_.call(this._shortWeekdaysParse,se),F!==-1)?F:(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null)):p==="ddd"?(F=_.call(this._shortWeekdaysParse,se),F!==-1||(F=_.call(this._weekdaysParse,se),F!==-1)?F:(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null)):(F=_.call(this._minWeekdaysParse,se),F!==-1||(F=_.call(this._weekdaysParse,se),F!==-1)?F:(F=_.call(this._shortWeekdaysParse,se),F!==-1?F:null))}function c1(f,p,w){var S,F,j;if(this._weekdaysParseExact)return u1.call(this,f,p,w);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),S=0;S<7;S++){if(F=m([2e3,1]).day(S),w&&!this._fullWeekdaysParse[S]&&(this._fullWeekdaysParse[S]=new RegExp("^"+this.weekdays(F,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[S]=new RegExp("^"+this.weekdaysShort(F,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[S]=new RegExp("^"+this.weekdaysMin(F,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[S]||(j="^"+this.weekdays(F,"")+"|^"+this.weekdaysShort(F,"")+"|^"+this.weekdaysMin(F,""),this._weekdaysParse[S]=new RegExp(j.replace(".",""),"i")),w&&p==="dddd"&&this._fullWeekdaysParse[S].test(f))return S;if(w&&p==="ddd"&&this._shortWeekdaysParse[S].test(f))return S;if(w&&p==="dd"&&this._minWeekdaysParse[S].test(f))return S;if(!w&&this._weekdaysParse[S].test(f))return S}}function d1(f){if(!this.isValid())return f!=null?this:NaN;var p=this._isUTC?this._d.getUTCDay():this._d.getDay();return f!=null?(f=X_(f,this.localeData()),this.add(f-p,"d")):p}function f1(f){if(!this.isValid())return f!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return f==null?p:this.add(f-p,"d")}function h1(f){if(!this.isValid())return f!=null?this:NaN;if(f!=null){var p=e1(f,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function m1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=r1),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)}function p1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=i1),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function g1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=a1),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Df(){function f(lr,Fi){return Fi.length-lr.length}var p=[],w=[],S=[],F=[],j,se,Pe,ut,$t;for(j=0;j<7;j++)se=m([2e3,1]).day(j),Pe=Te(this.weekdaysMin(se,"")),ut=Te(this.weekdaysShort(se,"")),$t=Te(this.weekdays(se,"")),p.push(Pe),w.push(ut),S.push($t),F.push(Pe),F.push(ut),F.push($t);p.sort(f),w.sort(f),S.sort(f),F.sort(f),this._weekdaysRegex=new RegExp("^("+F.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function Sf(){return this.hours()%12||12}function y1(){return this.hours()||24}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,Sf),N("k",["kk",2],0,y1),N("hmm",0,0,function(){return""+Sf.apply(this)+De(this.minutes(),2)}),N("hmmss",0,0,function(){return""+Sf.apply(this)+De(this.minutes(),2)+De(this.seconds(),2)}),N("Hmm",0,0,function(){return""+this.hours()+De(this.minutes(),2)}),N("Hmmss",0,0,function(){return""+this.hours()+De(this.minutes(),2)+De(this.seconds(),2)});function Fy(f,p){N(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}Fy("a",!0),Fy("A",!1),Rt("hour","h"),Bt("hour",13);function Iy(f,p){return p._meridiemParse}ae("a",Iy),ae("A",Iy),ae("H",L),ae("h",L),ae("k",L),ae("HH",L,Ht),ae("hh",L,Ht),ae("kk",L,Ht),ae("hmm",K),ae("hmmss",ee),ae("Hmm",K),ae("Hmmss",ee),We(["H","HH"],Yt),We(["k","kk"],function(f,p,w){var S=Z(f);p[Yt]=S===24?0:S}),We(["a","A"],function(f,p,w){w._isPm=w._locale.isPM(f),w._meridiem=f}),We(["h","hh"],function(f,p,w){p[Yt]=Z(f),g(w).bigHour=!0}),We("hmm",function(f,p,w){var S=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S)),g(w).bigHour=!0}),We("hmmss",function(f,p,w){var S=f.length-4,F=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S,2)),p[Er]=Z(f.substr(F)),g(w).bigHour=!0}),We("Hmm",function(f,p,w){var S=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S))}),We("Hmmss",function(f,p,w){var S=f.length-4,F=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S,2)),p[Er]=Z(f.substr(F))});function v1(f){return(f+"").toLowerCase().charAt(0)==="p"}var w1=/[ap]\.?m?\.?/i,b1=me("Hours",!0);function D1(f,p,w){return f>11?w?"pm":"PM":w?"am":"AM"}var Ay={calendar:be,longDateFormat:vt,invalidDate:Tt,ordinal:en,dayOfMonthOrdinalParse:gn,relativeTime:vn,months:T,monthsShort:V,week:q_,weekdays:t1,weekdaysMin:n1,weekdaysShort:Ty,meridiemParse:w1},tn={},Rs={},Hs;function S1(f,p){var w,S=Math.min(f.length,p.length);for(w=0;w0;){if(F=nu(j.slice(0,w).join("-")),F)return F;if(S&&S.length>=w&&S1(j,S)>=w-1)break;w--}p++}return Hs}function k1(f){return f.match("^[^/\\\\]*$")!=null}function nu(f){var p=null,w;if(tn[f]===void 0&&typeof ls!="undefined"&&ls&&ls.exports&&k1(f))try{p=Hs._abbr,w=require,w("./locale/"+f),na(p)}catch(S){tn[f]=null}return tn[f]}function na(f,p){var w;return f&&(s(p)?w=Ci(f):w=Ef(f,p),w?Hs=w:typeof console!="undefined"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),Hs._abbr}function Ef(f,p){if(p!==null){var w,S=Ay;if(p.abbr=f,tn[f]!=null)J("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),S=tn[f]._config;else if(p.parentLocale!=null)if(tn[p.parentLocale]!=null)S=tn[p.parentLocale]._config;else if(w=nu(p.parentLocale),w!=null)S=w._config;else return Rs[p.parentLocale]||(Rs[p.parentLocale]=[]),Rs[p.parentLocale].push({name:f,config:p}),null;return tn[f]=new re(te(S,p)),Rs[f]&&Rs[f].forEach(function(F){Ef(F.name,F.config)}),na(f),tn[f]}else return delete tn[f],null}function x1(f,p){if(p!=null){var w,S,F=Ay;tn[f]!=null&&tn[f].parentLocale!=null?tn[f].set(te(tn[f]._config,p)):(S=nu(f),S!=null&&(F=S._config),p=te(F,p),S==null&&(p.abbr=f),w=new re(p),w.parentLocale=tn[f],tn[f]=w),na(f)}else tn[f]!=null&&(tn[f].parentLocale!=null?(tn[f]=tn[f].parentLocale,f===na()&&na(f)):tn[f]!=null&&delete tn[f]);return tn[f]}function Ci(f){var p;if(f&&f._locale&&f._locale._abbr&&(f=f._locale._abbr),!f)return Hs;if(!n(f)){if(p=nu(f),p)return p;f=[f]}return E1(f)}function C1(){return ne(tn)}function kf(f){var p,w=f._a;return w&&g(f).overflow===-2&&(p=w[or]<0||w[or]>11?or:w[sr]<1||w[sr]>b(w[Ot],w[or])?sr:w[Yt]<0||w[Yt]>24||w[Yt]===24&&(w[Bn]!==0||w[Er]!==0||w[Gr]!==0)?Yt:w[Bn]<0||w[Bn]>59?Bn:w[Er]<0||w[Er]>59?Er:w[Gr]<0||w[Gr]>999?Gr:-1,g(f)._overflowDayOfYear&&(psr)&&(p=sr),g(f)._overflowWeeks&&p===-1&&(p=tu),g(f)._overflowWeekday&&p===-1&&(p=z),g(f).overflow=p),f}var _1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,M1=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,T1=/Z|[+-]\d\d(?::?\d\d)?/,ru=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],xf=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],F1=/^\/?Date\((-?\d+)/i,I1=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,A1={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ly(f){var p,w,S=f._i,F=_1.exec(S)||M1.exec(S),j,se,Pe,ut,$t=ru.length,lr=xf.length;if(F){for(g(f).iso=!0,p=0,w=$t;pqt(se)||f._dayOfYear===0)&&(g(f)._overflowDayOfYear=!0),w=kr(se,0,f._dayOfYear),f._a[or]=w.getUTCMonth(),f._a[sr]=w.getUTCDate()),p=0;p<3&&f._a[p]==null;++p)f._a[p]=S[p]=F[p];for(;p<7;p++)f._a[p]=S[p]=f._a[p]==null?p===2?1:0:f._a[p];f._a[Yt]===24&&f._a[Bn]===0&&f._a[Er]===0&&f._a[Gr]===0&&(f._nextDay=!0,f._a[Yt]=0),f._d=(f._useUTC?kr:ki).apply(null,S),j=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[Yt]=24),f._w&&typeof f._w.d!="undefined"&&f._w.d!==j&&(g(f).weekdayMismatch=!0)}}function V1(f){var p,w,S,F,j,se,Pe,ut,$t;p=f._w,p.GG!=null||p.W!=null||p.E!=null?(j=1,se=4,w=bo(p.GG,f._a[Ot],Ns(Zt(),1,4).year),S=bo(p.W,1),F=bo(p.E,1),(F<1||F>7)&&(ut=!0)):(j=f._locale._week.dow,se=f._locale._week.doy,$t=Ns(Zt(),j,se),w=bo(p.gg,f._a[Ot],$t.year),S=bo(p.w,$t.week),p.d!=null?(F=p.d,(F<0||F>6)&&(ut=!0)):p.e!=null?(F=p.e+j,(p.e<0||p.e>6)&&(ut=!0)):F=j),S<1||S>xi(w,j,se)?g(f)._overflowWeeks=!0:ut!=null?g(f)._overflowWeekday=!0:(Pe=My(w,S,F,j,se),f._a[Ot]=Pe.year,f._dayOfYear=Pe.dayOfYear)}t.ISO_8601=function(){},t.RFC_2822=function(){};function _f(f){if(f._f===t.ISO_8601){Ly(f);return}if(f._f===t.RFC_2822){Py(f);return}f._a=[],g(f).empty=!0;var p=""+f._i,w,S,F,j,se,Pe=p.length,ut=0,$t,lr;for(F=jt(f._f,f._locale).match(Ce)||[],lr=F.length,w=0;w0&&g(f).unusedInput.push(se),p=p.slice(p.indexOf(S)+S.length),ut+=S.length),it[j]?(S?g(f).empty=!1:g(f).unusedTokens.push(j),Hn(j,S,f)):f._strict&&!S&&g(f).unusedTokens.push(j);g(f).charsLeftOver=Pe-ut,p.length>0&&g(f).unusedInput.push(p),f._a[Yt]<=12&&g(f).bigHour===!0&&f._a[Yt]>0&&(g(f).bigHour=void 0),g(f).parsedDateParts=f._a.slice(0),g(f).meridiem=f._meridiem,f._a[Yt]=$1(f._locale,f._a[Yt],f._meridiem),$t=g(f).era,$t!==null&&(f._a[Ot]=f._locale.erasConvertYear($t,f._a[Ot])),Cf(f),kf(f)}function $1(f,p,w){var S;return w==null?p:f.meridiemHour!=null?f.meridiemHour(p,w):(f.isPM!=null&&(S=f.isPM(w),S&&p<12&&(p+=12),!S&&p===12&&(p=0)),p)}function U1(f){var p,w,S,F,j,se,Pe=!1,ut=f._f.length;if(ut===0){g(f).invalidFormat=!0,f._d=new Date(NaN);return}for(F=0;Fthis?this:f:D()});function Hy(f,p){var w,S;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return Zt();for(w=p[0],S=1;Sthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function uM(){if(!s(this._isDSTShifted))return this._isDSTShifted;var f={},p;return x(f,this),f=Ny(f),f._a?(p=f._isUTC?m(f._a):Zt(f._a),this._isDSTShifted=this.isValid()&&eM(f._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function cM(){return this.isValid()?!this._isUTC:!1}function dM(){return this.isValid()?this._isUTC:!1}function Vy(){return this.isValid()?this._isUTC&&this._offset===0:!1}var fM=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,hM=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Zr(f,p){var w=f,S=null,F,j,se;return au(f)?w={ms:f._milliseconds,d:f._days,M:f._months}:u(f)||!isNaN(+f)?(w={},p?w[p]=+f:w.milliseconds=+f):(S=fM.exec(f))?(F=S[1]==="-"?-1:1,w={y:0,d:Z(S[sr])*F,h:Z(S[Yt])*F,m:Z(S[Bn])*F,s:Z(S[Er])*F,ms:Z(Mf(S[Gr]*1e3))*F}):(S=hM.exec(f))?(F=S[1]==="-"?-1:1,w={y:Ha(S[2],F),M:Ha(S[3],F),w:Ha(S[4],F),d:Ha(S[5],F),h:Ha(S[6],F),m:Ha(S[7],F),s:Ha(S[8],F)}):w==null?w={}:typeof w=="object"&&("from"in w||"to"in w)&&(se=mM(Zt(w.from),Zt(w.to)),w={},w.ms=se.milliseconds,w.M=se.months),j=new iu(w),au(f)&&a(f,"_locale")&&(j._locale=f._locale),au(f)&&a(f,"_isValid")&&(j._isValid=f._isValid),j}Zr.fn=iu.prototype,Zr.invalid=X1;function Ha(f,p){var w=f&&parseFloat(f.replace(",","."));return(isNaN(w)?0:w)*p}function $y(f,p){var w={};return w.months=p.month()-f.month()+(p.year()-f.year())*12,f.clone().add(w.months,"M").isAfter(p)&&--w.months,w.milliseconds=+p-+f.clone().add(w.months,"M"),w}function mM(f,p){var w;return f.isValid()&&p.isValid()?(p=Ff(p,f),f.isBefore(p)?w=$y(f,p):(w=$y(p,f),w.milliseconds=-w.milliseconds,w.months=-w.months),w):{milliseconds:0,months:0}}function Uy(f,p){return function(w,S){var F,j;return S!==null&&!isNaN(+S)&&(J(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),j=w,w=S,S=j),F=Zr(w,S),Wy(this,F,f),this}}function Wy(f,p,w,S){var F=p._milliseconds,j=Mf(p._days),se=Mf(p._months);f.isValid()&&(S=S==null?!0:S,se&&Qe(f,Ie(f,"Month")+se*w),j&&at(f,"Date",Ie(f,"Date")+j*w),F&&f._d.setTime(f._d.valueOf()+F*w),S&&t.updateOffset(f,j||se))}var pM=Uy(1,"add"),gM=Uy(-1,"subtract");function Yy(f){return typeof f=="string"||f instanceof String}function yM(f){return A(f)||l(f)||Yy(f)||u(f)||wM(f)||vM(f)||f===null||f===void 0}function vM(f){var p=i(f)&&!o(f),w=!1,S=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],F,j,se=S.length;for(F=0;Fw.valueOf():w.valueOf()9999?Mt(w,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Q(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Mt(w,"Z")):Mt(w,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function OM(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f="moment",p="",w,S,F,j;return this.isLocal()||(f=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),w="["+f+'("]',S=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",F="-MM-DD[T]HH:mm:ss.SSS",j=p+'[")]',this.format(w+S+F+j)}function LM(f){f||(f=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var p=Mt(this,f);return this.localeData().postformat(p)}function PM(f,p){return this.isValid()&&(A(f)&&f.isValid()||Zt(f).isValid())?Zr({to:this,from:f}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function NM(f){return this.from(Zt(),f)}function RM(f,p){return this.isValid()&&(A(f)&&f.isValid()||Zt(f).isValid())?Zr({from:this,to:f}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function HM(f){return this.to(Zt(),f)}function zy(f){var p;return f===void 0?this._locale._abbr:(p=Ci(f),p!=null&&(this._locale=p),this)}var Ky=B("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function jy(){return this._locale}var su=1e3,Do=60*su,lu=60*Do,qy=(365*400+97)*24*lu;function So(f,p){return(f%p+p)%p}function Gy(f,p,w){return f<100&&f>=0?new Date(f+400,p,w)-qy:new Date(f,p,w).valueOf()}function Jy(f,p,w){return f<100&&f>=0?Date.UTC(f+400,p,w)-qy:Date.UTC(f,p,w)}function BM(f){var p,w;if(f=Vt(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?Jy:Gy,f){case"year":p=w(this.year(),0,1);break;case"quarter":p=w(this.year(),this.month()-this.month()%3,1);break;case"month":p=w(this.year(),this.month(),1);break;case"week":p=w(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=w(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=So(p+(this._isUTC?0:this.utcOffset()*Do),lu);break;case"minute":p=this._d.valueOf(),p-=So(p,Do);break;case"second":p=this._d.valueOf(),p-=So(p,su);break}return this._d.setTime(p),t.updateOffset(this,!0),this}function VM(f){var p,w;if(f=Vt(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?Jy:Gy,f){case"year":p=w(this.year()+1,0,1)-1;break;case"quarter":p=w(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=w(this.year(),this.month()+1,1)-1;break;case"week":p=w(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=w(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=lu-So(p+(this._isUTC?0:this.utcOffset()*Do),lu)-1;break;case"minute":p=this._d.valueOf(),p+=Do-So(p,Do)-1;break;case"second":p=this._d.valueOf(),p+=su-So(p,su)-1;break}return this._d.setTime(p),t.updateOffset(this,!0),this}function $M(){return this._d.valueOf()-(this._offset||0)*6e4}function UM(){return Math.floor(this.valueOf()/1e3)}function WM(){return new Date(this.valueOf())}function YM(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]}function zM(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}}function KM(){return this.isValid()?this.toISOString():null}function jM(){return v(this)}function qM(){return d({},g(this))}function GM(){return g(this).overflow}function JM(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}N("N",0,0,"eraAbbr"),N("NN",0,0,"eraAbbr"),N("NNN",0,0,"eraAbbr"),N("NNNN",0,0,"eraName"),N("NNNNN",0,0,"eraNarrow"),N("y",["y",1],"yo","eraYear"),N("y",["yy",2],0,"eraYear"),N("y",["yyy",3],0,"eraYear"),N("y",["yyyy",4],0,"eraYear"),ae("N",Af),ae("NN",Af),ae("NNN",Af),ae("NNNN",sT),ae("NNNNN",lT),We(["N","NN","NNN","NNNN","NNNNN"],function(f,p,w,S){var F=w._locale.erasParse(f,S,w._strict);F?g(w).era=F:g(w).invalidEra=f}),ae("y",ge),ae("yy",ge),ae("yyy",ge),ae("yyyy",ge),ae("yo",uT),We(["y","yy","yyy","yyyy"],Ot),We(["yo"],function(f,p,w,S){var F;w._locale._eraYearOrdinalRegex&&(F=f.match(w._locale._eraYearOrdinalRegex)),w._locale.eraYearOrdinalParse?p[Ot]=w._locale.eraYearOrdinalParse(f,F):p[Ot]=parseInt(f,10)});function ZM(f,p){var w,S,F,j=this._eras||Ci("en")._eras;for(w=0,S=j.length;w=0)return j[S]}function XM(f,p){var w=f.since<=f.until?1:-1;return p===void 0?t(f.since).year():t(f.since).year()+(p-f.offset)*w}function eT(){var f,p,w,S=this.localeData().eras();for(f=0,p=S.length;fj&&(p=j),gT.call(this,f,p,w,S,F))}function gT(f,p,w,S,F){var j=My(f,p,w,S,F),se=kr(j.year,0,j.dayOfYear);return this.year(se.getUTCFullYear()),this.month(se.getUTCMonth()),this.date(se.getUTCDate()),this}N("Q",0,"Qo","quarter"),Rt("quarter","Q"),Bt("quarter",7),ae("Q",_n),We("Q",function(f,p){p[or]=(Z(f)-1)*3});function yT(f){return f==null?Math.ceil((this.month()+1)/3):this.month((f-1)*3+this.month()%3)}N("D",["DD",2],"Do","date"),Rt("date","D"),Bt("date",9),ae("D",L),ae("DD",L,Ht),ae("Do",function(f,p){return f?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),We(["D","DD"],sr),We("Do",function(f,p){p[sr]=Z(f.match(L)[0])});var Qy=me("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),Rt("dayOfYear","DDD"),Bt("dayOfYear",4),ae("DDD",ue),ae("DDDD",ar),We(["DDD","DDDD"],function(f,p,w){w._dayOfYear=Z(f)});function vT(f){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?p:this.add(f-p,"d")}N("m",["mm",2],0,"minute"),Rt("minute","m"),Bt("minute",14),ae("m",L),ae("mm",L,Ht),We(["m","mm"],Bn);var wT=me("Minutes",!1);N("s",["ss",2],0,"second"),Rt("second","s"),Bt("second",15),ae("s",L),ae("ss",L,Ht),We(["s","ss"],Er);var bT=me("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return this.millisecond()*10}),N(0,["SSSSS",5],0,function(){return this.millisecond()*100}),N(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),N(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),N(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),N(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Rt("millisecond","ms"),Bt("millisecond",16),ae("S",ue,_n),ae("SS",ue,Ht),ae("SSS",ue,ar);var ra,Xy;for(ra="SSSS";ra.length<=9;ra+="S")ae(ra,ge);function DT(f,p){p[Gr]=Z(("0."+f)*1e3)}for(ra="S";ra.length<=9;ra+="S")We(ra,DT);Xy=me("Milliseconds",!1),N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");function ST(){return this._isUTC?"UTC":""}function ET(){return this._isUTC?"Coordinated Universal Time":""}var we=O.prototype;we.add=pM,we.calendar=SM,we.clone=EM,we.diff=FM,we.endOf=VM,we.format=LM,we.from=PM,we.fromNow=NM,we.to=RM,we.toNow=HM,we.get=Dt,we.invalidAt=GM,we.isAfter=kM,we.isBefore=xM,we.isBetween=CM,we.isSame=_M,we.isSameOrAfter=MM,we.isSameOrBefore=TM,we.isValid=jM,we.lang=Ky,we.locale=zy,we.localeData=jy,we.max=j1,we.min=K1,we.parsingFlags=qM,we.set=Cn,we.startOf=BM,we.subtract=gM,we.toArray=YM,we.toObject=zM,we.toDate=WM,we.toISOString=AM,we.inspect=OM,typeof Symbol!="undefined"&&Symbol.for!=null&&(we[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),we.toJSON=KM,we.toString=IM,we.unix=UM,we.valueOf=$M,we.creationData=JM,we.eraName=eT,we.eraNarrow=tT,we.eraAbbr=nT,we.eraYear=rT,we.year=On,we.isLeapYear=Vn,we.weekYear=cT,we.isoWeekYear=dT,we.quarter=we.quarters=yT,we.month=ot,we.daysInMonth=qe,we.week=we.weeks=Z_,we.isoWeek=we.isoWeeks=Q_,we.weeksInYear=mT,we.weeksInWeekYear=pT,we.isoWeeksInYear=fT,we.isoWeeksInISOWeekYear=hT,we.date=Qy,we.day=we.days=d1,we.weekday=f1,we.isoWeekday=h1,we.dayOfYear=vT,we.hour=we.hours=b1,we.minute=we.minutes=wT,we.second=we.seconds=bT,we.millisecond=we.milliseconds=Xy,we.utcOffset=nM,we.utc=iM,we.local=aM,we.parseZone=oM,we.hasAlignedHourOffset=sM,we.isDST=lM,we.isLocal=cM,we.isUtcOffset=dM,we.isUtc=Vy,we.isUTC=Vy,we.zoneAbbr=ST,we.zoneName=ET,we.dates=B("dates accessor is deprecated. Use date instead.",Qy),we.months=B("months accessor is deprecated. Use month instead",ot),we.years=B("years accessor is deprecated. Use year instead",On),we.zone=B("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",rM),we.isDSTShifted=B("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",uM);function kT(f){return Zt(f*1e3)}function xT(){return Zt.apply(null,arguments).parseZone()}function ev(f){return f}var Lt=re.prototype;Lt.calendar=pe,Lt.longDateFormat=Wt,Lt.invalidDate=Jt,Lt.ordinal=yn,Lt.preparse=ev,Lt.postformat=ev,Lt.relativeTime=xn,Lt.pastFuture=jn,Lt.set=oe,Lt.eras=ZM,Lt.erasParse=QM,Lt.erasConvertYear=XM,Lt.erasAbbrRegex=aT,Lt.erasNameRegex=iT,Lt.erasNarrowRegex=oT,Lt.months=he,Lt.monthsShort=Me,Lt.monthsParse=Le,Lt.monthsRegex=st,Lt.monthsShortRegex=yt,Lt.week=j_,Lt.firstDayOfYear=J_,Lt.firstDayOfWeek=G_,Lt.weekdays=o1,Lt.weekdaysMin=l1,Lt.weekdaysShort=s1,Lt.weekdaysParse=c1,Lt.weekdaysRegex=m1,Lt.weekdaysShortRegex=p1,Lt.weekdaysMinRegex=g1,Lt.isPM=v1,Lt.meridiem=D1;function cu(f,p,w,S){var F=Ci(),j=m().set(S,p);return F[w](j,f)}function tv(f,p,w){if(u(f)&&(p=f,f=void 0),f=f||"",p!=null)return cu(f,p,w,"month");var S,F=[];for(S=0;S<12;S++)F[S]=cu(f,S,w,"month");return F}function Lf(f,p,w,S){typeof f=="boolean"?(u(p)&&(w=p,p=void 0),p=p||""):(p=f,w=p,f=!1,u(p)&&(w=p,p=void 0),p=p||"");var F=Ci(),j=f?F._week.dow:0,se,Pe=[];if(w!=null)return cu(p,(w+j)%7,S,"day");for(se=0;se<7;se++)Pe[se]=cu(p,(se+j)%7,S,"day");return Pe}function CT(f,p){return tv(f,p,"months")}function _T(f,p){return tv(f,p,"monthsShort")}function MT(f,p,w){return Lf(f,p,w,"weekdays")}function TT(f,p,w){return Lf(f,p,w,"weekdaysShort")}function FT(f,p,w){return Lf(f,p,w,"weekdaysMin")}na("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(f){var p=f%10,w=Z(f%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return f+w}}),t.lang=B("moment.lang is deprecated. Use moment.locale instead.",na),t.langData=B("moment.langData is deprecated. Use moment.localeData instead.",Ci);var _i=Math.abs;function IT(){var f=this._data;return this._milliseconds=_i(this._milliseconds),this._days=_i(this._days),this._months=_i(this._months),f.milliseconds=_i(f.milliseconds),f.seconds=_i(f.seconds),f.minutes=_i(f.minutes),f.hours=_i(f.hours),f.months=_i(f.months),f.years=_i(f.years),this}function nv(f,p,w,S){var F=Zr(p,w);return f._milliseconds+=S*F._milliseconds,f._days+=S*F._days,f._months+=S*F._months,f._bubble()}function AT(f,p){return nv(this,f,p,1)}function OT(f,p){return nv(this,f,p,-1)}function rv(f){return f<0?Math.floor(f):Math.ceil(f)}function LT(){var f=this._milliseconds,p=this._days,w=this._months,S=this._data,F,j,se,Pe,ut;return f>=0&&p>=0&&w>=0||f<=0&&p<=0&&w<=0||(f+=rv(Pf(w)+p)*864e5,p=0,w=0),S.milliseconds=f%1e3,F=At(f/1e3),S.seconds=F%60,j=At(F/60),S.minutes=j%60,se=At(j/60),S.hours=se%24,p+=At(se/24),ut=At(iv(p)),w+=ut,p-=rv(Pf(ut)),Pe=At(w/12),w%=12,S.days=p,S.months=w,S.years=Pe,this}function iv(f){return f*4800/146097}function Pf(f){return f*146097/4800}function PT(f){if(!this.isValid())return NaN;var p,w,S=this._milliseconds;if(f=Vt(f),f==="month"||f==="quarter"||f==="year")switch(p=this._days+S/864e5,w=this._months+iv(p),f){case"month":return w;case"quarter":return w/3;case"year":return w/12}else switch(p=this._days+Math.round(Pf(this._months)),f){case"week":return p/7+S/6048e5;case"day":return p+S/864e5;case"hour":return p*24+S/36e5;case"minute":return p*1440+S/6e4;case"second":return p*86400+S/1e3;case"millisecond":return Math.floor(p*864e5)+S;default:throw new Error("Unknown unit "+f)}}function NT(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Z(this._months/12)*31536e6:NaN}function Mi(f){return function(){return this.as(f)}}var RT=Mi("ms"),HT=Mi("s"),BT=Mi("m"),VT=Mi("h"),$T=Mi("d"),UT=Mi("w"),WT=Mi("M"),YT=Mi("Q"),zT=Mi("y");function KT(){return Zr(this)}function jT(f){return f=Vt(f),this.isValid()?this[f+"s"]():NaN}function Ba(f){return function(){return this.isValid()?this._data[f]:NaN}}var qT=Ba("milliseconds"),GT=Ba("seconds"),JT=Ba("minutes"),ZT=Ba("hours"),QT=Ba("days"),XT=Ba("months"),eF=Ba("years");function tF(){return At(this.days()/7)}var Ti=Math.round,Eo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nF(f,p,w,S,F){return F.relativeTime(p||1,!!w,f,S)}function rF(f,p,w,S){var F=Zr(f).abs(),j=Ti(F.as("s")),se=Ti(F.as("m")),Pe=Ti(F.as("h")),ut=Ti(F.as("d")),$t=Ti(F.as("M")),lr=Ti(F.as("w")),Fi=Ti(F.as("y")),ia=j<=w.ss&&["s",j]||j0,ia[4]=S,nF.apply(null,ia)}function iF(f){return f===void 0?Ti:typeof f=="function"?(Ti=f,!0):!1}function aF(f,p){return Eo[f]===void 0?!1:p===void 0?Eo[f]:(Eo[f]=p,f==="s"&&(Eo.ss=p-1),!0)}function oF(f,p){if(!this.isValid())return this.localeData().invalidDate();var w=!1,S=Eo,F,j;return typeof f=="object"&&(p=f,f=!1),typeof f=="boolean"&&(w=f),typeof p=="object"&&(S=Object.assign({},Eo,p),p.s!=null&&p.ss==null&&(S.ss=p.s-1)),F=this.localeData(),j=rF(this,!w,S,F),w&&(j=F.pastFuture(+this,j)),F.postformat(j)}var Nf=Math.abs;function ko(f){return(f>0)-(f<0)||+f}function du(){if(!this.isValid())return this.localeData().invalidDate();var f=Nf(this._milliseconds)/1e3,p=Nf(this._days),w=Nf(this._months),S,F,j,se,Pe=this.asSeconds(),ut,$t,lr,Fi;return Pe?(S=At(f/60),F=At(S/60),f%=60,S%=60,j=At(w/12),w%=12,se=f?f.toFixed(3).replace(/\.?0+$/,""):"",ut=Pe<0?"-":"",$t=ko(this._months)!==ko(Pe)?"-":"",lr=ko(this._days)!==ko(Pe)?"-":"",Fi=ko(this._milliseconds)!==ko(Pe)?"-":"",ut+"P"+(j?$t+j+"Y":"")+(w?$t+w+"M":"")+(p?lr+p+"D":"")+(F||S||f?"T":"")+(F?Fi+F+"H":"")+(S?Fi+S+"M":"")+(f?Fi+se+"S":"")):"P0D"}var xt=iu.prototype;xt.isValid=Q1,xt.abs=IT,xt.add=AT,xt.subtract=OT,xt.as=PT,xt.asMilliseconds=RT,xt.asSeconds=HT,xt.asMinutes=BT,xt.asHours=VT,xt.asDays=$T,xt.asWeeks=UT,xt.asMonths=WT,xt.asQuarters=YT,xt.asYears=zT,xt.valueOf=NT,xt._bubble=LT,xt.clone=KT,xt.get=jT,xt.milliseconds=qT,xt.seconds=GT,xt.minutes=JT,xt.hours=ZT,xt.days=QT,xt.weeks=tF,xt.months=XT,xt.years=eF,xt.humanize=oF,xt.toISOString=du,xt.toString=du,xt.toJSON=du,xt.locale=zy,xt.localeData=jy,xt.toIsoString=B("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",du),xt.lang=Ky,N("X",0,0,"unix"),N("x",0,0,"valueOf"),ae("x",M),ae("X",ie),We("X",function(f,p,w){w._d=new Date(parseFloat(f)*1e3)}),We("x",function(f,p,w){w._d=new Date(Z(f))});return t.version="2.29.4",r(Zt),t.fn=we,t.min=q1,t.max=G1,t.now=J1,t.utc=m,t.unix=kT,t.months=CT,t.isDate=l,t.locale=na,t.invalid=D,t.duration=Zr,t.isMoment=A,t.weekdays=MT,t.parseZone=xT,t.localeData=Ci,t.isDuration=au,t.monthsShort=_T,t.weekdaysMin=FT,t.defineLocale=Ef,t.updateLocale=x1,t.locales=C1,t.weekdaysShort=TT,t.normalizeUnits=Vt,t.relativeTimeRounding=iF,t.relativeTimeThreshold=aF,t.calendarFormat=DM,t.prototype=we,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})});var dx=wn((Fd,_g)=>{(function(t,r){typeof Fd=="object"&&typeof _g=="object"?_g.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Fd=="object"?Fd.Choices=r():t.Choices=r()})(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:a})},r.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,i){if(i&1&&(n=r(n)),i&8||i&4&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(var o in n)r.d(a,o,function(s){return n[s]}.bind(null,o));return a},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="/public/assets/scripts/",r(r.s=4)}([function(e,t,r){"use strict";var n=function(x){return i(x)&&!a(x)};function i(C){return!!C&&typeof C=="object"}function a(C){var x=Object.prototype.toString.call(C);return x==="[object RegExp]"||x==="[object Date]"||u(C)}var o=typeof Symbol=="function"&&Symbol.for,s=o?Symbol.for("react.element"):60103;function u(C){return C.$$typeof===s}function l(C){return Array.isArray(C)?[]:{}}function c(C,x){return x.clone!==!1&&x.isMergeableObject(C)?D(l(C),C,x):C}function d(C,x,O){return C.concat(x).map(function(A){return c(A,O)})}function m(C,x){if(!x.customMerge)return D;var O=x.customMerge(C);return typeof O=="function"?O:D}function h(C){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(C).filter(function(x){return C.propertyIsEnumerable(x)}):[]}function g(C){return Object.keys(C).concat(h(C))}function y(C,x){try{return x in C&&!(Object.hasOwnProperty.call(C,x)&&Object.propertyIsEnumerable.call(C,x))}catch(O){return!1}}function v(C,x,O){var A={};return O.isMergeableObject(C)&&g(C).forEach(function(P){A[P]=c(C[P],O)}),g(x).forEach(function(P){y(C,P)||(!O.isMergeableObject(x[P])||!C[P]?A[P]=c(x[P],O):A[P]=m(P,O)(C[P],x[P],O))}),A}function D(C,x,O){O=O||{},O.arrayMerge=O.arrayMerge||d,O.isMergeableObject=O.isMergeableObject||n,O.cloneUnlessOtherwiseSpecified=c;var A=Array.isArray(x),P=Array.isArray(C),B=A===P;return B?A?O.arrayMerge(C,x,O):v(C,x,O):c(x,O)}D.all=function(x,O){if(!Array.isArray(x))throw new Error("first argument should be an array");return x.reduce(function(A,P){return D(A,P,O)},{})};var I=D;e.exports=I},function(e,t,r){"use strict";(function(n,i){var a=r(3),o;typeof self!="undefined"?o=self:typeof window!="undefined"?o=window:typeof n!="undefined"?o=n:o=i;var s=Object(a.a)(o);t.a=s}).call(this,r(5),r(6)(e))},function(e,t,r){(function(n,i){e.exports=i()})(this,function(){return function(n){var i={};function a(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=n,a.c=i,a.d=function(o,s,u){a.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:u})},a.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,s){if(1&s&&(o=a(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(a.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var l in o)a.d(u,l,function(c){return o[c]}.bind(null,l));return u},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="",a(a.s=1)}([function(n,i){n.exports=function(a){return Array.isArray?Array.isArray(a):Object.prototype.toString.call(a)==="[object Array]"}},function(n,i,a){function o(m){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(m)}function s(m,h){for(var g=0;g1&&arguments[1]!==void 0?arguments[1]:{limit:!1};this._log(`--------- +Search pattern: "`.concat(v,'"'));var I=this._prepareSearchers(v),C=I.tokenSearchers,x=I.fullSearcher,O=this._search(C,x),A=O.weights,P=O.results;return this._computeScore(A,P),this.options.shouldSort&&this._sort(P),D.limit&&typeof D.limit=="number"&&(P=P.slice(0,D.limit)),this._format(P)}},{key:"_prepareSearchers",value:function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",D=[];if(this.options.tokenize)for(var I=v.split(this.options.tokenSeparator),C=0,x=I.length;C0&&arguments[0]!==void 0?arguments[0]:[],D=arguments.length>1?arguments[1]:void 0,I=this.list,C={},x=[];if(typeof I[0]=="string"){for(var O=0,A=I.length;O1)throw new Error("Key weight has to be > 0 and <= 1");te=te.name}else P[te]={weight:1};this._analyze({key:te,value:this.options.getFn(J,te),record:J,index:B},{resultMap:C,results:x,tokenSearchers:v,fullSearcher:D})}return{weights:P,results:x}}},{key:"_analyze",value:function(v,D){var I=v.key,C=v.arrayIndex,x=C===void 0?-1:C,O=v.value,A=v.record,P=v.index,B=D.tokenSearchers,G=B===void 0?[]:B,J=D.fullSearcher,Q=J===void 0?[]:J,oe=D.resultMap,te=oe===void 0?{}:oe,re=D.results,ne=re===void 0?[]:re;if(O!=null){var be=!1,pe=-1,De=0;if(typeof O=="string"){this._log(` +Key: `.concat(I===""?"-":I));var Ce=Q.search(O);if(this._log('Full text: "'.concat(O,'", score: ').concat(Ce.score)),this.options.tokenize){for(var U=O.split(this.options.tokenSeparator),Je=[],it=0;it-1&&(Jt=(Jt+pe)/2),this._log("Score average:",Jt);var en=!this.options.tokenize||!this.options.matchAllTokens||De>=G.length;if(this._log(` +Check Matches: `.concat(en)),(be||Ce.isMatch)&&en){var gn=te[P];gn?gn.output.push({key:I,arrayIndex:x,value:O,score:Jt,matchedIndices:Ce.matchedIndices}):(te[P]={item:A,output:[{key:I,arrayIndex:x,value:O,score:Jt,matchedIndices:Ce.matchedIndices}]},ne.push(te[P]))}}else if(c(O))for(var yn=0,vn=O.length;yn-1&&(be.arrayIndex=ne.arrayIndex),Q.matches.push(be)}}}),this.options.includeScore&&C.push(function(J,Q){Q.score=J.score});for(var x=0,O=v.length;xD)return s(y,this.pattern,I);var C=this.options,x=C.location,O=C.distance,A=C.threshold,P=C.findAllMatches,B=C.minMatchCharLength;return u(y,this.pattern,this.patternAlphabet,{location:x,distance:O,threshold:A,findAllMatches:P,minMatchCharLength:B})}}])&&o(m.prototype,h),g&&o(m,g),d}();n.exports=c},function(n,i){var a=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;n.exports=function(o,s){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:/ +/g,l=new RegExp(s.replace(a,"\\$&").replace(u,"|")),c=o.match(l),d=!!c,m=[];if(d)for(var h=0,g=c.length;h=it;It-=1){var Mt=It-1,jt=c[u.charAt(Mt)];if(jt&&(Q[Mt]=1),Ze[It]=(Ze[It+1]<<1|1)&jt,Ce!==0&&(Ze[It]|=(ne[It+1]|ne[It])<<1|1|ne[It+1]),Ze[It]&De&&(be=o(l,{errors:Ce,currentLocation:Mt,expectedLocation:A,distance:y}))<=B){if(B=be,(G=Mt)<=A)break;it=Math.max(1,2*A-G)}}if(o(l,{errors:Ce+1,currentLocation:A,expectedLocation:A,distance:y})>B)break;ne=Ze}return{isMatch:G>=0,score:be===0?.001:be,matchedIndices:s(Q,O)}}},function(n,i){n.exports=function(a,o){var s=o.errors,u=s===void 0?0:s,l=o.currentLocation,c=l===void 0?0:l,d=o.expectedLocation,m=d===void 0?0:d,h=o.distance,g=h===void 0?100:h,y=u/a.length,v=Math.abs(m-c);return g?y+v/g:v?1:y}},function(n,i){n.exports=function(){for(var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,s=[],u=-1,l=-1,c=0,d=a.length;c=o&&s.push([u,l]),u=-1)}return a[c-1]&&c-u>=o&&s.push([u,c-1]),s}},function(n,i){n.exports=function(a){for(var o={},s=a.length,u=0;u0)return"Unexpected "+(Y.length>1?"keys":"key")+" "+('"'+Y.join('", "')+'" found in '+V+". ")+"Expected to find one of the known reducer keys instead: "+('"'+T.join('", "')+'". Unexpected keys will be ignored.')}function y(z){Object.keys(z).forEach(function(k){var _=z[k],b=_(void 0,{type:l.INIT});if(typeof b=="undefined")throw new Error('Reducer "'+k+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof _(void 0,{type:l.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+k+'" returned undefined when probed with a random type. '+("Don't try to handle "+l.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function v(z){for(var k=Object.keys(z),_={},b=0;b-1?z.map(function(_){var b=_;return b.id===parseInt(k.choiceId,10)&&(b.selected=!0),b}):z;case"REMOVE_ITEM":return k.choiceId>-1?z.map(function(_){var b=_;return b.id===parseInt(k.choiceId,10)&&(b.selected=!1),b}):z;case"FILTER_CHOICES":return z.map(function(_){var b=_;return b.active=k.results.some(function(T){var V=T.item,Y=T.score;return V.id===b.id?(b.score=Y,!0):!1}),b});case"ACTIVATE_CHOICES":return z.map(function(_){var b=_;return b.active=k.active,b});case"CLEAR_CHOICES":return te;default:return z}}var ne={loading:!1},be=function(k,_){switch(k===void 0&&(k=ne),_.type){case"SET_IS_LOADING":return{loading:_.isLoading};default:return k}},pe=be,De=function(k,_){return Math.floor(Math.random()*(_-k)+k)},Ce=function(k){return Array.from({length:k},function(){return De(0,36).toString(36)}).join("")},U=function(k,_){var b=k.id||k.name&&k.name+"-"+Ce(2)||Ce(4);return b=b.replace(/(:|\.|\[|\]|,)/g,""),b=_+"-"+b,b},Je=function(k){return Object.prototype.toString.call(k).slice(8,-1)},it=function(k,_){return _!=null&&Je(_)===k},N=function(k,_){return _===void 0&&(_=document.createElement("div")),k.nextSibling?k.parentNode.insertBefore(_,k.nextSibling):k.parentNode.appendChild(_),_.appendChild(k)},Ze=function(k,_,b){if(b===void 0&&(b=1),!(!(k instanceof Element)||typeof _!="string")){for(var T=(b>0?"next":"previous")+"ElementSibling",V=k[T];V;){if(V.matches(_))return V;V=V[T]}return V}},It=function(k,_,b){if(b===void 0&&(b=1),!k)return!1;var T;return b>0?T=_.scrollTop+_.offsetHeight>=k.offsetTop+k.offsetHeight:T=k.offsetTop>=_.scrollTop,T},Mt=function(k){return typeof k!="string"?k:k.replace(/&/g,"&").replace(/>/g,"&rt;").replace(/"'+Mt(k)+'"'},maxItemText:function(k){return"Only "+k+" values can be added"},valueComparer:function(k,_){return k===_},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:Bt},rn={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice"},At={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL"},Z={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},me="text",Ie="select-one",at="select-multiple",Dt=4,Cn=function(){function z(_){var b=_.element,T=_.type,V=_.classNames,Y=_.position;this.element=b,this.classNames=V,this.type=T,this.position=Y,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var k=z.prototype;return k.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},k.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},k.shouldFlip=function(b){if(typeof b!="number")return!1;var T=!1;return this.position==="auto"?T=!window.matchMedia("(min-height: "+(b+1)+"px)").matches:this.position==="top"&&(T=!0),T},k.setActiveDescendant=function(b){this.element.setAttribute("aria-activedescendant",b)},k.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},k.open=function(b){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(b)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},k.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},k.focus=function(){this.isFocussed||this.element.focus()},k.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},k.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},k.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===Ie&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},k.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===Ie&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},k.wrap=function(b){N(b,this.element)},k.unwrap=function(b){this.element.parentNode.insertBefore(b,this.element),this.element.parentNode.removeChild(this.element)},k.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},k.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},k._onFocus=function(){this.isFocussed=!0},k._onBlur=function(){this.isFocussed=!1},z}();function _n(z,k){for(var _=0;_0?this.element.scrollTop+he-X:b.offsetTop;activeWindow.requestAnimationFrame(function(){V._animateScroll(Me,T)})}},k._scrollDown=function(b,T,V){var Y=(V-b)/T,X=Y>1?Y:1;this.element.scrollTop=b+X},k._scrollUp=function(b,T,V){var Y=(b-V)/T,X=Y>1?Y:1;this.element.scrollTop=b-X},k._animateScroll=function(b,T){var V=this,Y=Dt,X=this.element.scrollTop,le=!1;T>0?(this._scrollDown(X,Y,b),Xb&&(le=!0)),le&&activeWindow.requestAnimationFrame(function(){V._animateScroll(b,T)})},z}();function St(z,k){for(var _=0;_0?"treeitem":"option"),Object.assign(lt.dataset,{choice:"",id:Me,value:Ve,selectText:b}),qe?(lt.classList.add(le),lt.dataset.choiceDisabled="",lt.setAttribute("aria-disabled","true")):(lt.classList.add(Y),lt.dataset.choiceSelectable=""),lt},input:function(k,_){var b=k.input,T=k.inputCloned,V=Object.assign(document.createElement("input"),{type:"text",className:b+" "+T,autocomplete:"off",autocapitalize:"off",spellcheck:!1});return V.setAttribute("role","textbox"),V.setAttribute("aria-autocomplete","list"),V.setAttribute("aria-label",_),V},dropdown:function(k){var _=k.list,b=k.listDropdown,T=document.createElement("div");return T.classList.add(_,b),T.setAttribute("aria-expanded","false"),T},notice:function(k,_,b){var T=k.item,V=k.itemChoice,Y=k.noResults,X=k.noChoices;b===void 0&&(b="");var le=[T,V];return b==="no-choices"?le.push(X):b==="no-results"&&le.push(Y),Object.assign(document.createElement("div"),{innerHTML:_,className:le.join(" ")})},option:function(k){var _=k.label,b=k.value,T=k.customProperties,V=k.active,Y=k.disabled,X=new Option(_,b,!1,V);return T&&(X.dataset.customProperties=T),X.disabled=Y,X}},ye=ie,ce=function(k){var _=k.value,b=k.label,T=k.id,V=k.groupId,Y=k.disabled,X=k.elementId,le=k.customProperties,he=k.placeholder,Me=k.keyCode;return{type:At.ADD_CHOICE,value:_,label:b,id:T,groupId:V,disabled:Y,elementId:X,customProperties:le,placeholder:he,keyCode:Me}},ae=function(k){return{type:At.FILTER_CHOICES,results:k}},Se=function(k){return k===void 0&&(k=!0),{type:At.ACTIVATE_CHOICES,active:k}},nt=function(){return{type:At.CLEAR_CHOICES}},Te=function(k){var _=k.value,b=k.label,T=k.id,V=k.choiceId,Y=k.groupId,X=k.customProperties,le=k.placeholder,he=k.keyCode;return{type:At.ADD_ITEM,value:_,label:b,id:T,choiceId:V,groupId:Y,customProperties:X,placeholder:le,keyCode:he}},Ue=function(k,_){return{type:At.REMOVE_ITEM,id:k,choiceId:_}},We=function(k,_){return{type:At.HIGHLIGHT_ITEM,id:k,highlighted:_}},Ft=function(k){var _=k.value,b=k.id,T=k.active,V=k.disabled;return{type:At.ADD_GROUP,value:_,id:b,active:T,disabled:V}},Hn=function(){return{type:"CLEAR_ALL"}},Ot=function(k){return{type:"RESET_TO",state:k}},or=function(k){return{type:"SET_IS_LOADING",isLoading:k}};function sr(z,k){for(var _=0;_=0?this._store.getGroupById(X):null;return this._store.dispatch(We(V,!0)),T&&this.passedElement.triggerEvent(rn.highlightItem,{id:V,value:he,label:Ve,groupValue:Le&&Le.value?Le.value:null}),this},k.unhighlightItem=function(b){if(!b)return this;var T=b.id,V=b.groupId,Y=V===void 0?-1:V,X=b.value,le=X===void 0?"":X,he=b.label,Me=he===void 0?"":he,Ve=Y>=0?this._store.getGroupById(Y):null;return this._store.dispatch(We(T,!1)),this.passedElement.triggerEvent(rn.highlightItem,{id:T,value:le,label:Me,groupValue:Ve&&Ve.value?Ve.value:null}),this},k.highlightAll=function(){var b=this;return this._store.items.forEach(function(T){return b.highlightItem(T)}),this},k.unhighlightAll=function(){var b=this;return this._store.items.forEach(function(T){return b.unhighlightItem(T)}),this},k.removeActiveItemsByValue=function(b){var T=this;return this._store.activeItems.filter(function(V){return V.value===b}).forEach(function(V){return T._removeItem(V)}),this},k.removeActiveItems=function(b){var T=this;return this._store.activeItems.filter(function(V){var Y=V.id;return Y!==b}).forEach(function(V){return T._removeItem(V)}),this},k.removeHighlightedItems=function(b){var T=this;return b===void 0&&(b=!1),this._store.highlightedActiveItems.forEach(function(V){T._removeItem(V),b&&T._triggerChange(V.value)}),this},k.showDropdown=function(b){var T=this;return this.dropdown.isActive?this:(activeWindow.requestAnimationFrame(function(){T.dropdown.show(),T.containerOuter.open(T.dropdown.distanceFromTopWindow),!b&&T._canSearch&&T.input.focus(),T.passedElement.triggerEvent(rn.showDropdown,{})}),this)},k.hideDropdown=function(b){var T=this;return this.dropdown.isActive?(activeWindow.requestAnimationFrame(function(){T.dropdown.hide(),T.containerOuter.close(),!b&&T._canSearch&&(T.input.removeActiveDescendant(),T.input.blur()),T.passedElement.triggerEvent(rn.hideDropdown,{})}),this):this},k.getValue=function(b){b===void 0&&(b=!1);var T=this._store.activeItems.reduce(function(V,Y){var X=b?Y.value:Y;return V.push(X),V},[]);return this._isSelectOneElement?T[0]:T},k.setValue=function(b){var T=this;return this.initialised?(b.forEach(function(V){return T._setChoiceOrItem(V)}),this):this},k.setChoiceByValue=function(b){var T=this;if(!this.initialised||this._isTextElement)return this;var V=Array.isArray(b)?b:[b];return V.forEach(function(Y){return T._findAndSelectChoiceByValue(Y)}),this},k.setChoices=function(b,T,V,Y){var X=this;if(b===void 0&&(b=[]),T===void 0&&(T="value"),V===void 0&&(V="label"),Y===void 0&&(Y=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if(typeof T!="string"||!T)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(Y&&this.clearChoices(),typeof b=="function"){var le=b(this);if(typeof Promise=="function"&&le instanceof Promise)return new Promise(function(he){return activeWindow.requestAnimationFrame(he)}).then(function(){return X._handleLoadingState(!0)}).then(function(){return le}).then(function(he){return X.setChoices(he,T,V,Y)}).catch(function(he){X.config.silent||console.error(he)}).then(function(){return X._handleLoadingState(!1)}).then(function(){return X});if(!Array.isArray(le))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: "+typeof le);return this.setChoices(le,T,V,!1)}if(!Array.isArray(b))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),b.forEach(function(he){he.choices?X._addGroup({id:parseInt(he.id,10)||null,group:he,valueKey:T,labelKey:V}):X._addChoice({value:he[T],label:he[V],isSelected:he.selected,isDisabled:he.disabled,customProperties:he.customProperties,placeholder:he.placeholder})}),this._stopLoading(),this},k.clearChoices=function(){return this._store.dispatch(nt()),this},k.clearStore=function(){return this._store.dispatch(Hn()),this},k.clearInput=function(){var b=!this._isSelectOneElement;return this.input.clear(b),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch(Se(!0))),this},k._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var b=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,T=this._isSelectElement,V=this._currentState.items!==this._prevState.items;b&&(T&&this._renderChoices(),V&&this._renderItems(),this._prevState=this._currentState)}},k._renderChoices=function(){var b=this,T=this._store,V=T.activeGroups,Y=T.activeChoices,X=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&activeWindow.requestAnimationFrame(function(){return b.choiceList.scrollToTop()}),V.length>=1&&!this._isSearching){var le=Y.filter(function(Qe){return Qe.placeholder===!0&&Qe.groupId===-1});le.length>=1&&(X=this._createChoicesFragment(le,X)),X=this._createGroupsFragment(V,Y,X)}else Y.length>=1&&(X=this._createChoicesFragment(Y,X));if(X.childNodes&&X.childNodes.length>0){var he=this._store.activeItems,Me=this._canAddItem(he,this.input.value);Me.response?(this.choiceList.append(X),this._highlightChoice()):this.choiceList.append(this._getTemplate("notice",Me.notice))}else{var Ve,Le;this._isSearching?(Le=typeof this.config.noResultsText=="function"?this.config.noResultsText():this.config.noResultsText,Ve=this._getTemplate("notice",Le,"no-results")):(Le=typeof this.config.noChoicesText=="function"?this.config.noChoicesText():this.config.noChoicesText,Ve=this._getTemplate("notice",Le,"no-choices")),this.choiceList.append(Ve)}},k._renderItems=function(){var b=this._store.activeItems||[];this.itemList.clear();var T=this._createItemsFragment(b);T.childNodes&&this.itemList.append(T)},k._createGroupsFragment=function(b,T,V){var Y=this;V===void 0&&(V=document.createDocumentFragment());var X=function(he){return T.filter(function(Me){return Y._isSelectOneElement?Me.groupId===he.id:Me.groupId===he.id&&(Y.config.renderSelectedChoices==="always"||!Me.selected)})};return this.config.shouldSort&&b.sort(this.config.sorter),b.forEach(function(le){var he=X(le);if(he.length>=1){var Me=Y._getTemplate("choiceGroup",le);V.appendChild(Me),Y._createChoicesFragment(he,V,!0)}}),V},k._createChoicesFragment=function(b,T,V){var Y=this;T===void 0&&(T=document.createDocumentFragment()),V===void 0&&(V=!1);var X=this.config,le=X.renderSelectedChoices,he=X.searchResultLimit,Me=X.renderChoiceLimit,Ve=this._isSearching?Wt:this.config.sorter,Le=function(Vn){var ki=le==="auto"?Y._isSelectOneElement||!Vn.selected:!0;if(ki){var kr=Y._getTemplate("choice",Vn,Y.config.itemSelectText);T.appendChild(kr)}},Qe=b;le==="auto"&&!this._isSelectOneElement&&(Qe=b.filter(function(On){return!On.selected}));var ot=Qe.reduce(function(On,Vn){return Vn.placeholder?On.placeholderChoices.push(Vn):On.normalChoices.push(Vn),On},{placeholderChoices:[],normalChoices:[]}),qe=ot.placeholderChoices,yt=ot.normalChoices;(this.config.shouldSort||this._isSearching)&&yt.sort(Ve);var st=Qe.length,lt=this._isSelectOneElement?[].concat(qe,yt):yt;this._isSearching?st=he:Me&&Me>0&&!V&&(st=Me);for(var qt=0;qt=Y){var he=X?this._searchChoices(b):0;this.passedElement.triggerEvent(rn.search,{value:b,resultCount:he})}else le&&(this._isSearching=!1,this._store.dispatch(Se(!0)))}},k._canAddItem=function(b,T){var V=!0,Y=typeof this.config.addItemText=="function"?this.config.addItemText(T):this.config.addItemText;if(!this._isSelectOneElement){var X=Jt(b,T);this.config.maxItemCount>0&&this.config.maxItemCount<=b.length&&(V=!1,Y=typeof this.config.maxItemText=="function"?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&X&&V&&(V=!1,Y=typeof this.config.uniqueItemText=="function"?this.config.uniqueItemText(T):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&V&&typeof this.config.addItemFilter=="function"&&!this.config.addItemFilter(T)&&(V=!1,Y=typeof this.config.customAddItemText=="function"?this.config.customAddItemText(T):this.config.customAddItemText)}return{response:V,notice:Y}},k._searchChoices=function(b){var T=typeof b=="string"?b.trim():b,V=typeof this._currentValue=="string"?this._currentValue.trim():this._currentValue;if(T.length<1&&T===V+" ")return 0;var Y=this._store.searchableChoices,X=T,le=[].concat(this.config.searchFields),he=Object.assign(this.config.fuseOptions,{keys:le}),Me=new i.a(Y,he),Ve=Me.search(X);return this._currentValue=T,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch(ae(Ve)),Ve.length},k._addEventListeners=function(){var b=document,T=b.documentElement;T.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),T.addEventListener("click",this._onClick,{passive:!0}),T.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},k._removeEventListeners=function(){var b=document,T=b.documentElement;T.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),T.removeEventListener("click",this._onClick),T.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},k._onKeyDown=function(b){var T,V=b.target,Y=b.keyCode,X=b.ctrlKey,le=b.metaKey,he=this._store.activeItems,Me=this.input.isFocussed,Ve=this.dropdown.isActive,Le=this.itemList.hasChildren(),Qe=String.fromCharCode(Y),ot=Z.BACK_KEY,qe=Z.DELETE_KEY,yt=Z.ENTER_KEY,st=Z.A_KEY,lt=Z.ESC_KEY,qt=Z.UP_KEY,On=Z.DOWN_KEY,Vn=Z.PAGE_UP_KEY,ki=Z.PAGE_DOWN_KEY,kr=X||le;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(Qe)&&this.showDropdown();var Jr=(T={},T[st]=this._onAKey,T[yt]=this._onEnterKey,T[lt]=this._onEscapeKey,T[qt]=this._onDirectionKey,T[Vn]=this._onDirectionKey,T[On]=this._onDirectionKey,T[ki]=this._onDirectionKey,T[qe]=this._onDeleteKey,T[ot]=this._onDeleteKey,T);Jr[Y]&&Jr[Y]({event:b,target:V,keyCode:Y,metaKey:le,activeItems:he,hasFocusedInput:Me,hasActiveDropdown:Ve,hasItems:Le,hasCtrlDownKeyPressed:kr})},k._onKeyUp=function(b){var T=b.target,V=b.keyCode,Y=this.input.value,X=this._store.activeItems,le=this._canAddItem(X,Y),he=Z.BACK_KEY,Me=Z.DELETE_KEY;if(this._isTextElement){var Ve=le.notice&&Y;if(Ve){var Le=this._getTemplate("notice",le.notice);this.dropdown.element.innerHTML=Le.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0)}else{var Qe=(V===he||V===Me)&&!T.value,ot=!this._isTextElement&&this._isSearching,qe=this._canSearch&&le.response;Qe&&ot?(this._isSearching=!1,this._store.dispatch(Se(!0))):qe&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},k._onAKey=function(b){var T=b.hasItems,V=b.hasCtrlDownKeyPressed;if(V&&T){this._canSearch=!1;var Y=this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement;Y&&this.highlightAll()}},k._onEnterKey=function(b){var T=b.event,V=b.target,Y=b.activeItems,X=b.hasActiveDropdown,le=Z.ENTER_KEY,he=V.hasAttribute("data-button");if(this._isTextElement&&V.value){var Me=this.input.value,Ve=this._canAddItem(Y,Me);Ve.response&&(this.hideDropdown(!0),this._addItem({value:Me}),this._triggerChange(Me),this.clearInput())}if(he&&(this._handleButtonAction(Y,V),T.preventDefault()),X){var Le=this.dropdown.getChild("."+this.config.classNames.highlightedState);Le&&(Y[0]&&(Y[0].keyCode=le),this._handleChoiceAction(Y,Le)),T.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),T.preventDefault())},k._onEscapeKey=function(b){var T=b.hasActiveDropdown;T&&(this.hideDropdown(!0),this.containerOuter.focus())},k._onDirectionKey=function(b){var T=b.event,V=b.hasActiveDropdown,Y=b.keyCode,X=b.metaKey,le=Z.DOWN_KEY,he=Z.PAGE_UP_KEY,Me=Z.PAGE_DOWN_KEY;if(V||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var Ve=Y===le||Y===Me?1:-1,Le=X||Y===Me||Y===he,Qe="[data-choice-selectable]",ot;if(Le)Ve>0?ot=this.dropdown.element.querySelector(Qe+":last-of-type"):ot=this.dropdown.element.querySelector(Qe);else{var qe=this.dropdown.element.querySelector("."+this.config.classNames.highlightedState);qe?ot=Ze(qe,Qe,Ve):ot=this.dropdown.element.querySelector(Qe)}ot&&(It(ot,this.choiceList.element,Ve)||this.choiceList.scrollToChildElement(ot,Ve),this._highlightChoice(ot)),T.preventDefault()}},k._onDeleteKey=function(b){var T=b.event,V=b.target,Y=b.hasFocusedInput,X=b.activeItems;Y&&!V.value&&!this._isSelectOneElement&&(this._handleBackspace(X),T.preventDefault())},k._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},k._onTouchEnd=function(b){var T=b||b.touches[0],V=T.target,Y=this._wasTap&&this.containerOuter.element.contains(V);if(Y){var X=V===this.containerOuter.element||V===this.containerInner.element;X&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),b.stopPropagation()}this._wasTap=!0},k._onMouseDown=function(b){var T=b.target;if(T instanceof HTMLElement){if(Bn&&this.choiceList.element.contains(T)){var V=this.choiceList.element.firstElementChild,Y=this._direction==="ltr"?b.offsetX>=V.offsetWidth:b.offsetX0;Y&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0)}},k._onFocus=function(b){var T=this,V,Y=b.target,X=this.containerOuter.element.contains(Y);if(X){var le=(V={},V[me]=function(){Y===T.input.element&&T.containerOuter.addFocusState()},V[Ie]=function(){T.containerOuter.addFocusState(),Y===T.input.element&&T.showDropdown(!0)},V[at]=function(){Y===T.input.element&&(T.showDropdown(!0),T.containerOuter.addFocusState())},V);le[this.passedElement.element.type]()}},k._onBlur=function(b){var T=this,V=b.target,Y=this.containerOuter.element.contains(V);if(Y&&!this._isScrollingOnIe){var X,le=this._store.activeItems,he=le.some(function(Ve){return Ve.highlighted}),Me=(X={},X[me]=function(){V===T.input.element&&(T.containerOuter.removeFocusState(),he&&T.unhighlightAll(),T.hideDropdown(!0))},X[Ie]=function(){T.containerOuter.removeFocusState(),(V===T.input.element||V===T.containerOuter.element&&!T._canSearch)&&T.hideDropdown(!0)},X[at]=function(){V===T.input.element&&(T.containerOuter.removeFocusState(),T.hideDropdown(!0),he&&T.unhighlightAll())},X);Me[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},k._onFormReset=function(){this._store.dispatch(Ot(this._initialState))},k._highlightChoice=function(b){var T=this;b===void 0&&(b=null);var V=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(V.length){var Y=b,X=Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState));X.forEach(function(le){le.classList.remove(T.config.classNames.highlightedState),le.setAttribute("aria-selected","false")}),Y?this._highlightPosition=V.indexOf(Y):(V.length>this._highlightPosition?Y=V[this._highlightPosition]:Y=V[V.length-1],Y||(Y=V[0])),Y.classList.add(this.config.classNames.highlightedState),Y.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(rn.highlightChoice,{el:Y}),this.dropdown.isActive&&(this.input.setActiveDescendant(Y.id),this.containerOuter.setActiveDescendant(Y.id))}},k._addItem=function(b){var T=b.value,V=b.label,Y=V===void 0?null:V,X=b.choiceId,le=X===void 0?-1:X,he=b.groupId,Me=he===void 0?-1:he,Ve=b.customProperties,Le=Ve===void 0?null:Ve,Qe=b.placeholder,ot=Qe===void 0?!1:Qe,qe=b.keyCode,yt=qe===void 0?null:qe,st=typeof T=="string"?T.trim():T,lt=yt,qt=Le,On=this._store.items,Vn=Y||st,ki=le||-1,kr=Me>=0?this._store.getGroupById(Me):null,Jr=On?On.length+1:1;return this.config.prependValue&&(st=this.config.prependValue+st.toString()),this.config.appendValue&&(st+=this.config.appendValue.toString()),this._store.dispatch(Te({value:st,label:Vn,id:Jr,choiceId:ki,groupId:Me,customProperties:Le,placeholder:ot,keyCode:lt})),this._isSelectOneElement&&this.removeActiveItems(Jr),this.passedElement.triggerEvent(rn.addItem,{id:Jr,value:st,label:Vn,customProperties:qt,groupValue:kr&&kr.value?kr.value:void 0,keyCode:lt}),this},k._removeItem=function(b){if(!b||!it("Object",b))return this;var T=b.id,V=b.value,Y=b.label,X=b.choiceId,le=b.groupId,he=le>=0?this._store.getGroupById(le):null;return this._store.dispatch(Ue(T,X)),he&&he.value?this.passedElement.triggerEvent(rn.removeItem,{id:T,value:V,label:Y,groupValue:he.value}):this.passedElement.triggerEvent(rn.removeItem,{id:T,value:V,label:Y}),this},k._addChoice=function(b){var T=b.value,V=b.label,Y=V===void 0?null:V,X=b.isSelected,le=X===void 0?!1:X,he=b.isDisabled,Me=he===void 0?!1:he,Ve=b.groupId,Le=Ve===void 0?-1:Ve,Qe=b.customProperties,ot=Qe===void 0?null:Qe,qe=b.placeholder,yt=qe===void 0?!1:qe,st=b.keyCode,lt=st===void 0?null:st;if(!(typeof T=="undefined"||T===null)){var qt=this._store.choices,On=Y||T,Vn=qt?qt.length+1:1,ki=this._baseId+"-"+this._idNames.itemChoice+"-"+Vn;this._store.dispatch(ce({id:Vn,groupId:Le,elementId:ki,value:T,label:On,disabled:Me,customProperties:ot,placeholder:yt,keyCode:lt})),le&&this._addItem({value:T,label:On,choiceId:Vn,customProperties:ot,placeholder:yt,keyCode:lt})}},k._addGroup=function(b){var T=this,V=b.group,Y=b.id,X=b.valueKey,le=X===void 0?"value":X,he=b.labelKey,Me=he===void 0?"label":he,Ve=it("Object",V)?V.choices:Array.from(V.getElementsByTagName("OPTION")),Le=Y||Math.floor(new Date().valueOf()*Math.random()),Qe=V.disabled?V.disabled:!1;if(Ve){this._store.dispatch(Ft({value:V.label,id:Le,active:!0,disabled:Qe}));var ot=function(yt){var st=yt.disabled||yt.parentNode&&yt.parentNode.disabled;T._addChoice({value:yt[le],label:it("Object",yt)?yt[Me]:yt.innerHTML,isSelected:yt.selected,isDisabled:st,groupId:Le,customProperties:yt.customProperties,placeholder:yt.placeholder})};Ve.forEach(ot)}else this._store.dispatch(Ft({value:V.label,id:V.id,active:!1,disabled:V.disabled}))},k._getTemplate=function(b){var T;if(!b)return null;for(var V=this.config.classNames,Y=arguments.length,X=new Array(Y>1?Y-1:0),le=1;le{var IH=typeof Element!="undefined",AH=typeof Map=="function",OH=typeof Set=="function",LH=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function jd(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!jd(e[n],t[n]))return!1;return!0}var a;if(AH&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!jd(n.value[1],t.get(n.value[0])))return!1;return!0}if(OH&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(LH&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(IH&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!jd(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}pC.exports=function(t,r){try{return jd(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}});var S_=wn((Gne,Dy)=>{(function(){var e;typeof Dy!="undefined"?e=Dy.exports=n:e=function(){return this||(0,eval)("this")}(),e.format=n,e.vsprintf=r,typeof console!="undefined"&&typeof console.log=="function"&&(e.printf=t);function t(){console.log(n.apply(null,arguments))}function r(i,a){return n.apply(null,[i].concat(a))}function n(i){for(var a=1,o=[].slice.call(arguments),s=0,u=i.length,l="",c,d=!1,m,h,g=!1,y,v=function(){return o[a++]},D=function(){for(var I="";/\d/.test(i[s]);)I+=i[s++],c=i[s];return I.length>0?parseInt(I):null};swf});module.exports=ov(HB);function fu(e,t){let r=Object.keys(t).map(n=>mF(e,n,t[n]));return r.length===1?r[0]:function(){r.forEach(n=>n())}}function mF(e,t,r){let n=e[t],i=e.hasOwnProperty(t),a=r(n);return n&&Object.setPrototypeOf(a,n),Object.setPrototypeOf(o,a),e[t]=o,s;function o(...u){return a===n&&e[t]===o&&s(),a.apply(this,u)}function s(){e[t]===o&&(i?e[t]=n:delete e[t]),a!==n&&(a=n,Object.setPrototypeOf(o,n||Function))}}var Rn=require("obsidian");var Ws,Xe,cv,pF,Va,sv,dv,Hf,Wf,Bf,Vf,fv,Us={},hv=[],gF=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pu=Array.isArray;function Ii(e,t){for(var r in t)e[r]=t[r];return e}function mv(e){var t=e.parentNode;t&&t.removeChild(e)}function xr(e,t,r){var n,i,a,o={};for(a in t)a=="key"?n=t[a]:a=="ref"?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?Ws.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return $s(e,o,n,i,null)}function $s(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i==null?++cv:i,__i:-1,__u:0};return i==null&&Xe.vnode!=null&&Xe.vnode(a),a}function Yf(){return{current:null}}function ct(e){return e.children}function Br(e,t){this.props=e,this.context=t}function $a(e,t){if(t==null)return e.__?$a(e.__,e.__i+1):null;for(var r;tt&&Va.sort(Hf));mu.__r=0}function gv(e,t,r,n,i,a,o,s,u,l,c){var d,m,h,g,y,v=n&&n.__k||hv,D=t.length;for(r.__d=u,yF(r,t,v),u=r.__d,d=0;d0?$s(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,s=vF(i,r,o,c),i.__i=s,a=null,s!==-1&&(c--,(a=r[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof i.type!="function"&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?c>u-o?d+=s-o:d--:s(u!=null&&!(131072&u.__u)?1:0))for(;o>=0||s=0){if((u=t[o])&&!(131072&u.__u)&&i==u.key&&a===u.type)return o;o--}if(s2&&(s.children=arguments.length>3?Ws.call(arguments,2):r),$s(e.type,s,n||e.key,i||e.ref,null)}function aa(e,t){var r={__c:t="__cC"+fv++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(s){s.__e=!0,$f(s)})},this.sub=function(o){i.push(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),s&&s.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Ws=hv.slice,Xe={__e:function(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(s){e=s}throw e}},cv=0,pF=function(e){return e!=null&&e.constructor==null},Br.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ii({},this.state),typeof e=="function"&&(e=e(Ii({},r),this.props)),e&&Ii(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),$f(this))},Br.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$f(this))},Br.prototype.render=ct,Va=[],dv=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):activeWindow.setTimeout,Hf=function(e,t){return e.__v.__b-t.__v.__b},mu.__r=0,Wf=0,Bf=uv(!1),Vf=uv(!0),fv=0;var oa,Qt,qf,bv,Co=0,Mv=[],gu=[],an=Xe,Dv=an.__b,Sv=an.__r,Ev=an.diffed,kv=an.__c,xv=an.unmount,Cv=an.__;function _o(e,t){an.__h&&an.__h(Qt,e,Co||t),Co=0;var r=Qt.__H||(Qt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:gu}),r.__[e]}function Ne(e){return Co=1,Jf(Av,e)}function Jf(e,t,r){var n=_o(oa++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Av(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],l=n.t(u,s);u!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Qt,!Qt.u)){var i=function(s,u,l){if(!n.__c.__H)return!0;var c=n.__c.__H.__.filter(function(m){return!!m.__c});if(c.every(function(m){return!m.__N}))return!a||a.call(this,s,u,l);var d=!1;return c.forEach(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(d=!0)}}),!(!d&&n.__c.props===s)&&(!a||a.call(this,s,u,l))};Qt.u=!0;var a=Qt.shouldComponentUpdate,o=Qt.componentWillUpdate;Qt.componentWillUpdate=function(s,u,l){if(this.__e){var c=a;a=void 0,i(s,u,l),a=c}o&&o.call(this,s,u,l)},Qt.shouldComponentUpdate=i}return n.__N||n.__}function Ae(e,t){var r=_o(oa++,3);!an.__s&&Zf(r.__H,t)&&(r.__=e,r.i=t,Qt.__H.__h.push(r))}function Ai(e,t){var r=_o(oa++,4);!an.__s&&Zf(r.__H,t)&&(r.__=e,r.i=t,Qt.__h.push(r))}function Fe(e){return Co=5,Re(function(){return{current:e}},[])}function Tv(e,t,r){Co=6,Ai(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Re(e,t){var r=_o(oa++,7);return Zf(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Ye(e,t){return Co=8,Re(function(){return e},t)}function Ee(e){var t=Qt.context[e.__c],r=_o(oa++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(Qt)),t.props.value):e.__}function Fv(e,t){an.useDebugValue&&an.useDebugValue(t?t(e):e)}function Iv(){var e=_o(oa++,11);if(!e.__){for(var t=Qt.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function DF(){for(var e;e=Mv.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(yu),e.__H.__h.forEach(Gf),e.__H.__h=[]}catch(t){e.__H.__h=[],an.__e(t,e.__v)}}an.__b=function(e){Qt=null,Dv&&Dv(e)},an.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cv&&Cv(e,t)},an.__r=function(e){Sv&&Sv(e),oa=0;var t=(Qt=e.__c).__H;t&&(qf===Qt?(t.__h=[],Qt.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=gu,r.__N=r.i=void 0})):(t.__h.forEach(yu),t.__h.forEach(Gf),t.__h=[],oa=0)),qf=Qt},an.diffed=function(e){Ev&&Ev(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Mv.push(t)!==1&&bv===an.requestAnimationFrame||((bv=an.requestAnimationFrame)||SF)(DF)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==gu&&(r.__=r.__V),r.i=void 0,r.__V=gu})),qf=Qt=null},an.__c=function(e,t){t.some(function(r){try{r.__h.forEach(yu),r.__h=r.__h.filter(function(n){return!n.__||Gf(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],an.__e(n,r.__v)}}),kv&&kv(e,t)},an.unmount=function(e){xv&&xv(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{yu(n)}catch(i){t=i}}),r.__H=void 0,t&&an.__e(t,r.__v))};var _v=typeof activeWindow.requestAnimationFrame=="function";function SF(e){var t,r=function(){activeWindow.clearTimeout(n),_v&&activeWindow.cancelAnimationFrame(t),activeWindow.setTimeout(e)},n=activeWindow.setTimeout(r,100);_v&&(t=activeWindow.requestAnimationFrame(r))}function yu(e){var t=Qt,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Qt=t}function Gf(e){var t=Qt;e.__c=e.__(),Qt=t}function Zf(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Av(e,t){return typeof t=="function"?t(e):t}function $v(e,t){for(var r in t)e[r]=t[r];return e}function Xf(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function eh(e,t){this.props=e,this.context=t}function zt(e,t){function r(i){var a=this.props.ref,o=a==i.ref;return!o&&a&&(a.call?a(null):a.current=null),t?!t(this.props,i)||!o:Xf(this.props,i)}function n(i){return this.shouldComponentUpdate=r,xr(e,i)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(eh.prototype=new Br).isPureReactComponent=!0,eh.prototype.shouldComponentUpdate=function(e,t){return Xf(this.props,e)||Xf(this.state,t)};var Ov=Xe.__b;Xe.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ov&&Ov(e)};var EF=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function kF(e){function t(r){var n=$v({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=EF,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Lv=function(e,t){return e==null?null:fi(fi(e).map(t))},xF={map:Lv,forEach:Lv,count:function(e){return e?fi(e).length:0},only:function(e){var t=fi(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:fi},CF=Xe.__e;Xe.__e=function(e,t,r,n){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}CF(e,t,r,n)};var Pv=Xe.unmount;function Uv(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=$v({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Uv(n,t,r)})),e}function Wv(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Wv(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function vu(){this.__u=0,this.t=null,this.__b=null}function Yv(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function _F(e){var t,r,n;function i(a){if(t||(t=e()).then(function(o){r=o.default||o},function(o){n=o}),n)throw n;if(!r)throw t;return xr(r,a)}return i.displayName="Lazy",i.__f=!0,i}function Ys(){this.u=null,this.o=null}Xe.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Pv&&Pv(e)},(vu.prototype=new Br).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var i=Yv(n.__v),a=!1,o=function(){a||(a=!0,r.__R=null,i?i(s):s())};r.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Wv(u,u.__c.__P,u.__c.__O)}var l;for(n.setState({__a:n.__b=null});l=n.t.pop();)l.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(o,o)},vu.prototype.componentWillUnmount=function(){this.t=[]},vu.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Uv(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&xr(ct,null,e.fallback);return i&&(i.__u&=-33),[xr(ct,null,t.__a?null:e.children),i]};var Nv=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]>>1,1),t.i.removeChild(n)}}),xo(xr(MF,{context:t.context},e.__v),t.l)}function Oi(e,t){var r=xr(TF,{__v:e,i:t});return r.containerInfo=t,r}(Ys.prototype=new Br).__a=function(e){var t=this,r=Yv(t.__v),n=t.o.get(e);return n[0]++,function(i){var a=function(){t.props.revealOrder?(n.push(i),Nv(t,e,n)):i()};r?r(a):a()}},Ys.prototype.render=function(e){this.u=null,this.o=new Map;var t=fi(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},Ys.prototype.componentDidUpdate=Ys.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Nv(e,r,t)})};var zv=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,FF=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,IF=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,AF=/[A-Z0-9]/g,OF=typeof document!="undefined",LF=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Li(e,t,r){return t.__k==null&&(t.textContent=""),xo(e,t),typeof r=="function"&&r(),e?e.__c:null}function PF(e,t,r){return jf(e,t),typeof r=="function"&&r(),e?e.__c:null}Br.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Br.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Rv=Xe.event;function NF(){}function RF(){return this.cancelBubble}function HF(){return this.defaultPrevented}Xe.event=function(e){return Rv&&(e=Rv(e)),e.persist=NF,e.isPropagationStopped=RF,e.isDefaultPrevented=HF,e.nativeEvent=e};var th,BF={enumerable:!1,configurable:!0,get:function(){return this.class}},Hv=Xe.vnode;Xe.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={};for(var a in r){var o=r[a];if(!(a==="value"&&"defaultValue"in r&&o==null||OF&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&o===!0?o="":s==="translate"&&o==="no"?o=!1:s==="ondoubleclick"?a="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||LF(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":IF.test(a)?a=s:n.indexOf("-")===-1&&FF.test(a)?a=a.replace(AF,"-$&").toLowerCase():o===null&&(o=void 0):s=a="oninput",s==="oninput"&&i[a=s]&&(a="oninputCapture"),i[a]=o}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=fi(r.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=fi(r.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",BF)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=zv,Hv&&Hv(e)};var Bv=Xe.__r;Xe.__r=function(e){Bv&&Bv(e),th=e.__c};var Vv=Xe.diffed;Xe.diffed=function(e){Vv&&Vv(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),th=null};var VF={ReactCurrentDispatcher:{current:{readContext:function(e){return th.__n[e.__c].props.value}}}};function $F(e){return xr.bind(null,e)}function wu(e){return!!e&&e.$$typeof===zv}function UF(e){return wu(e)&&e.type===ct}function WF(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function YF(e){return wu(e)?wv.apply(null,arguments):e}function Pi(e){return!!e.__k&&(xo(null,e),!0)}function zF(e){return e&&(e.base||e.nodeType===1&&e)||null}var KF=function(e,t){return e(t)},jF=function(e,t){return e(t)},qF=ct;function Kv(e){e()}function GF(e){return e}function JF(){return[!1,Kv]}var ZF=Ai,QF=wu;function XF(e,t){var r=t(),n=Ne({h:{__:r,v:t}}),i=n[0].h,a=n[1];return Ai(function(){i.__=r,i.v=t,Qf(i)&&a({h:i})},[e,r,t]),Ae(function(){return Qf(i)&&a({h:i}),e(function(){Qf(i)&&a({h:i})})},[e]),r}function Qf(e){var t,r,n=e.v,i=e.__;try{var a=n();return!((t=i)===(r=a)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch(o){return!0}}var $e={useState:Ne,useId:Iv,useReducer:Jf,useEffect:Ae,useLayoutEffect:Ai,useInsertionEffect:ZF,useTransition:JF,useDeferredValue:GF,useSyncExternalStore:XF,startTransition:Kv,useRef:Fe,useImperativeHandle:Tv,useMemo:Re,useCallback:Ye,useContext:Ee,useDebugValue:Fv,version:"17.0.2",Children:xF,render:Li,hydrate:PF,unmountComponentAtNode:Pi,createPortal:Oi,createElement:xr,createContext:aa,createFactory:$F,cloneElement:YF,createRef:Yf,Fragment:ct,isValidElement:wu,isElement:QF,isFragment:UF,isMemo:WF,findDOMNode:zF,Component:Br,PureComponent:eh,memo:zt,forwardRef:kF,flushSync:jF,unstable_batchedUpdates:KF,StrictMode:qF,Suspense:vu,SuspenseList:Ys,lazy:_F,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:VF};function Ge(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,n;rn===i.length-1?r!==t[n]:r===t[n])}function SI(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function js(e,t){if(SI(e,t))return 2;if(!DI(e,t))return 3;let r=e.length-1;return e[r]=0;n--)r={children:{[e[n]]:r}};return r}function qs(e,t){let r=t;for(let n=e.length-2;n>=0;n--)r={children:{[e[n]]:r}};return r}function iw(e,t){let r=t?[e.last(),1,t]:[e.last(),1];return qs(e,{children:{$splice:[r]}})}function aw(e,t,r=0){return qs(e,{children:{$splice:[[e.last()+r,0,...t]]}})}function xI(e,t){return qs(e,{children:{$push:t}})}function CI(e,t){return qs(e,{children:{$unshift:t}})}function Ri(e,t,r,n,i){let a=n?n(un(e,t)):un(e,t),s=js(t,r)===1?-1:0,u=i==null?void 0:i(un(e,t)),l=iw(t,u),c=aw(r,Array.isArray(a)?a:[a],s),d=(0,rw.default)(l,c,{isMergeableObject:h=>Ni(h)||Array.isArray(h)});return(0,la.default)(e,d)}function mi(e,t,r){return(0,la.default)(e,iw(t,r))}function Xr(e,t,r){return(0,la.default)(e,aw(t,r))}function ah(e,t,r){return(0,la.default)(e,xI(t,r))}function ow(e,t,r){return(0,la.default)(e,CI(t,r))}function Du(e,t,r){return(0,la.default)(e,kI(t,r))}function oh(e,t,r){return(0,la.default)(e,qs(t,r))}var Gs=["MO","TU","WE","TH","FR","SA","SU"],Mn=function(){function e(t,r){if(r===0)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=r}return e.fromStr=function(t){return new e(Gs.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},e.prototype.toString=function(){var t=Gs[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e}();var Gt=function(e){return e!=null},Cr=function(e){return typeof e=="number"},sh=function(e){return typeof e=="string"&&Gs.includes(e)},$n=Array.isArray,$r=function(e,t){t===void 0&&(t=e),arguments.length===1&&(t=e,e=0);for(var r=[],n=e;n>0,n.length>t?String(n):(t=t-n.length,t>r.length&&(r+=wt(r,t/r.length)),r.slice(0,t)+String(n))}var lw=function(e,t,r){var n=e.split(t);return r?n.slice(0,r).concat([n.slice(r).join(t)]):n},qn=function(e,t){var r=e%t;return r*t<0?r+t:r},Su=function(e,t){return{div:Math.floor(e/t),mod:qn(e,t)}},_r=function(e){return!Gt(e)||e.length===0},bn=function(e){return!_r(e)},Et=function(e,t){return bn(e)&&e.indexOf(t)!==-1};var pi=function(e,t,r,n,i,a){return n===void 0&&(n=0),i===void 0&&(i=0),a===void 0&&(a=0),new Date(Date.UTC(e,t-1,r,n,i,a))},_I=[31,28,31,30,31,30,31,31,30,31,30,31],cw=1e3*60*60*24,Eu=9999,dw=pi(1970,1,1),MI=[6,0,1,2,3,4,5];var To=function(e){return e%4===0&&e%100!==0||e%400===0},lh=function(e){return e instanceof Date},Ya=function(e){return lh(e)&&!isNaN(e.getTime())};var TI=function(e,t){var r=e.getTime(),n=t.getTime(),i=r-n;return Math.round(i/cw)},Js=function(e){return TI(e,dw)},ku=function(e){return new Date(dw.getTime()+e*cw)},FI=function(e){var t=e.getUTCMonth();return t===1&&To(e.getUTCFullYear())?29:_I[t]},Hi=function(e){return MI[e.getUTCDay()]},uh=function(e,t){var r=pi(e,t+1,1);return[Hi(r),FI(r)]},xu=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},Cu=function(e){var t=new Date(e.getTime());return t},ch=function(e){for(var t=[],r=0;rthis.maxDate;if(this.method==="between"){if(r)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return r?!0:(this.add(t),!1);return this.add(t)},e.prototype.add=function(t){return this._result.push(t),!0},e.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),Vi=II;var dh=function(e,t){return dh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},dh(e,t)};function Io(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");dh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Un=function(){return Un=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function hw(){for(var e=[],t=0;tt[0].length)&&(t=a,r=i)}if(t!=null&&(this.text=this.text.substr(t[0].length),this.text===""&&(this.done=!0)),t==null){this.done=!0,this.symbol=null,this.value=null;return}}while(r==="SKIP");return this.symbol=r,this.value=t,!0},e.prototype.accept=function(t){if(this.symbol===t){if(this.value){var r=this.value;return this.nextSymbol(),r}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},e}();function Qs(e,t){t===void 0&&(t=za);var r={},n=new HI(t.tokens);if(!n.start(e))return null;return i(),r;function i(){n.expect("every");var m=n.acceptNumber();if(m&&(r.interval=parseInt(m[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":r.freq=Oe.DAILY,n.nextSymbol()&&(o(),d());break;case"weekday(s)":r.freq=Oe.WEEKLY,r.byweekday=[Oe.MO,Oe.TU,Oe.WE,Oe.TH,Oe.FR],n.nextSymbol(),o(),d();break;case"week(s)":r.freq=Oe.WEEKLY,n.nextSymbol()&&(a(),o(),d());break;case"hour(s)":r.freq=Oe.HOURLY,n.nextSymbol()&&(a(),d());break;case"minute(s)":r.freq=Oe.MINUTELY,n.nextSymbol()&&(a(),d());break;case"month(s)":r.freq=Oe.MONTHLY,n.nextSymbol()&&(a(),d());break;case"year(s)":r.freq=Oe.YEARLY,n.nextSymbol()&&(a(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":r.freq=Oe.WEEKLY;var h=n.symbol.substr(0,2).toUpperCase();if(r.byweekday=[Oe[h]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var g=u();if(!g)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");r.byweekday.push(Oe[g]),n.nextSymbol()}o(),c(),d();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(r.freq=Oe.YEARLY,r.bymonth=[s()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=s();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected month");r.bymonth.push(y),n.nextSymbol()}a(),d();break;default:throw new Error("Unknown symbol")}}function a(){var m=n.accept("on"),h=n.accept("the");if(m||h)do{var g=l(),y=u(),v=s();if(g)y?(n.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(Oe[y].nth(g))):(r.bymonthday||(r.bymonthday=[]),r.bymonthday.push(g),n.accept("day(s)"));else if(y)n.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(Oe[y]);else if(n.symbol==="weekday(s)")n.nextSymbol(),r.byweekday||(r.byweekday=[Oe.MO,Oe.TU,Oe.WE,Oe.TH,Oe.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var D=n.acceptNumber();if(!D)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(r.byweekno=[parseInt(D[0],10)];n.accept("comma");){if(D=n.acceptNumber(),!D)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");r.byweekno.push(parseInt(D[0],10))}}else if(v)n.nextSymbol(),r.bymonth||(r.bymonth=[]),r.bymonth.push(v);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function o(){var m=n.accept("at");if(m)do{var h=n.acceptNumber();if(!h)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(r.byhour=[parseInt(h[0],10)];n.accept("comma");){if(h=n.acceptNumber(),!h)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");r.byhour.push(parseInt(h[0],10))}}while(n.accept("comma")||n.accept("at"))}function s(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var m=parseInt(n.value[1],10);if(m<-366||m>366)throw new Error("Nth out of range: "+m);return n.nextSymbol(),n.accept("last")?-m:m;default:return!1}}function c(){n.accept("on"),n.accept("the");var m=l();if(m)for(r.bymonthday=[m],n.nextSymbol();n.accept("comma");){if(m=l(),!m)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");r.bymonthday.push(m),n.nextSymbol()}}function d(){if(n.symbol==="until"){var m=Date.parse(n.text);if(!m)throw new Error("Cannot parse until date:"+n.text);r.until=new Date(m)}else n.accept("for")&&(r.count=parseInt(n.value[0],10),n.expect("number"))}}var pt;(function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"})(pt||(pt={}));function Xs(e){return e12){var n=Math.floor(this.month/12),i=qn(this.month,12);this.month=i,this.year+=n,this.month===0&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(r,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+r*7:this.day+=-(this.getWeekday()-n)+r*7,this.fixDay()},t.prototype.addDaily=function(r){this.day+=r,this.fixDay()},t.prototype.addHours=function(r,n,i){for(n&&(this.hour+=Math.floor((23-this.hour)/r)*r);;){this.hour+=r;var a=Su(this.hour,24),o=a.div,s=a.mod;if(o&&(this.hour=s,this.addDaily(o)),_r(i)||Et(i,this.hour))break}},t.prototype.addMinutes=function(r,n,i,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/r)*r);;){this.minute+=r;var o=Su(this.minute,60),s=o.div,u=o.mod;if(s&&(this.minute=u,this.addHours(s,!1,i)),(_r(i)||Et(i,this.hour))&&(_r(a)||Et(a,this.minute)))break}},t.prototype.addSeconds=function(r,n,i,a,o){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/r)*r);;){this.second+=r;var s=Su(this.second,60),u=s.div,l=s.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,a)),(_r(i)||Et(i,this.hour))&&(_r(a)||Et(a,this.minute))&&(_r(o)||Et(o,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var r=uh(this.year,this.month-1)[1];if(!(this.day<=r))for(;this.day>r;){if(this.day-=r,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Eu))return;r=uh(this.year,this.month-1)[1]}}},t.prototype.add=function(r,n){var i=r.freq,a=r.interval,o=r.wkst,s=r.byhour,u=r.byminute,l=r.bysecond;switch(i){case pt.YEARLY:return this.addYears(a);case pt.MONTHLY:return this.addMonths(a);case pt.WEEKLY:return this.addWeekly(a,o);case pt.DAILY:return this.addDaily(a);case pt.HOURLY:return this.addHours(a,n,s);case pt.MINUTELY:return this.addMinutes(a,n,s,u);case pt.SECONDLY:return this.addSeconds(a,n,s,u,l)}},t}(Po);function hh(e){for(var t=[],r=Object.keys(e),n=0,i=r;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(t.byweekno||bn(t.byweekno)||bn(t.byyearday)||t.bymonthday||bn(t.bymonthday)||Gt(t.byweekday)||Gt(t.byeaster)))switch(t.freq){case Oe.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case Oe.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case Oe.WEEKLY:t.byweekday=[Hi(t.dtstart)];break}if(Gt(t.bymonth)&&!$n(t.bymonth)&&(t.bymonth=[t.bymonth]),Gt(t.byyearday)&&!$n(t.byyearday)&&Cr(t.byyearday)&&(t.byyearday=[t.byyearday]),!Gt(t.bymonthday))t.bymonthday=[],t.bynmonthday=[];else if($n(t.bymonthday)){for(var i=[],a=[],r=0;r0?i.push(n):n<0&&a.push(n)}t.bymonthday=i,t.bynmonthday=a}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);if(Gt(t.byweekno)&&!$n(t.byweekno)&&(t.byweekno=[t.byweekno]),!Gt(t.byweekday))t.bynweekday=null;else if(Cr(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(sh(t.byweekday))t.byweekday=[Mn.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof Mn)!t.byweekday.n||t.freq>Oe.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var o=[],s=[],r=0;rOe.MONTHLY?o.push(u.weekday):s.push([u.weekday,u.n])}t.byweekday=bn(o)?o:null,t.bynweekday=bn(s)?s:null}return Gt(t.byhour)?Cr(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq=4?(c=0,l=s.yearlen+qn(o-t.wkst,7)):l=n-c;for(var d=Math.floor(l/7),m=qn(l,7),h=Math.floor(d+m/4),g=0;g0&&y<=h){var v=void 0;y>1?(v=c+(y-1)*7,c!==u&&(v-=7-u)):v=c;for(var D=0;D<7&&(s.wnomask[v]=1,v++,s.wdaymask[v]!==t.wkst);D++);}}if(Et(t.byweekno,1)){var v=c+h*7;if(c!==u&&(v-=7-u),v=4?(x=0,A=O+qn(C-t.wkst,7)):A=n-c,I=Math.floor(52+qn(A,7)/4)}if(Et(t.byweekno,I))for(var v=0;va)return $i(e);if(I>=r){var C=Hw(I,t);if(!e.accept(C)||s&&(--s,!s))return $i(e)}}else for(var D=h;Da)return $i(e);if(I>=r){var C=Hw(I,t);if(!e.accept(C)||s&&(--s,!s))return $i(e)}}}if(t.interval===0||(u.add(t,y),u.year>Eu))return $i(e);Xs(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function JI(e,t,r){var n=r.bymonth,i=r.byweekno,a=r.byweekday,o=r.byeaster,s=r.bymonthday,u=r.bynmonthday,l=r.byyearday;return bn(n)&&!Et(n,e.mmask[t])||bn(i)&&!e.wnomask[t]||bn(a)&&!Et(a,e.wdaymask[t])||bn(e.nwdaymask)&&!e.nwdaymask[t]||o!==null&&!Et(e.eastermask,t)||(bn(s)||bn(u))&&!Et(s,e.mdaymask[t])&&!Et(u,e.nmdaymask[t])||bn(l)&&(t=e.yearlen&&!Et(l,t+1-e.yearlen)&&!Et(l,-e.nextyearlen+t-e.yearlen))}function Hw(e,t){return new Ka(e,t.tzid).rezonedDate()}function $i(e){return e.getValue()}function ZI(e,t,r,n,i){for(var a=!1,o=t;o=Oe.HOURLY&&bn(i)&&!Et(i,t.hour)||n>=Oe.MINUTELY&&bn(a)&&!Et(a,t.minute)||n>=Oe.SECONDLY&&bn(o)&&!Et(o,t.second)?[]:e.gettimeset(n)(t.hour,t.minute,t.second,t.millisecond)}var Ur={MO:new Mn(0),TU:new Mn(1),WE:new Mn(2),TH:new Mn(3),FR:new Mn(4),SA:new Mn(5),SU:new Mn(6)},el={freq:pt.YEARLY,dtstart:null,interval:1,wkst:Ur.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Dw=Object.keys(el),Oe=function(){function e(t,r){t===void 0&&(t={}),r===void 0&&(r=!1),this._cache=r?null:new kw,this.origOptions=hh(t);var n=ww(t).parsedOptions;this.options=n}return e.parseText=function(t,r){return Qs(t,r)},e.fromText=function(t,r){return pw(t,r)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(t){return _u(t,this.options)},e.prototype._cacheGet=function(t,r){return this._cache?this._cache._cacheGet(t,r):!1},e.prototype._cacheAdd=function(t,r,n){if(this._cache)return this._cache._cacheAdd(t,r,n)},e.prototype.all=function(t){if(t)return this._iter(new fh("all",{},t));var r=this._cacheGet("all");return r===!1&&(r=this._iter(new Vi("all",{})),this._cacheAdd("all",r)),r},e.prototype.between=function(t,r,n,i){if(n===void 0&&(n=!1),!Ya(t)||!Ya(r))throw new Error("Invalid date passed in to RRule.between");var a={before:r,after:t,inc:n};if(i)return this._iter(new fh("between",a,i));var o=this._cacheGet("between",a);return o===!1&&(o=this._iter(new Vi("between",a)),this._cacheAdd("between",o,a)),o},e.prototype.before=function(t,r){if(r===void 0&&(r=!1),!Ya(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:r},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new Vi("before",n)),this._cacheAdd("before",i,n)),i},e.prototype.after=function(t,r){if(r===void 0&&(r=!1),!Ya(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:r},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new Vi("after",n)),this._cacheAdd("after",i,n)),i},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return rl(this.origOptions)},e.prototype.toText=function(t,r,n){return gw(this,t,r,n)},e.prototype.isFullyConvertibleToText=function(){return yw(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=pt.YEARLY,e.MONTHLY=pt.MONTHLY,e.WEEKLY=pt.WEEKLY,e.DAILY=pt.DAILY,e.HOURLY=pt.HOURLY,e.MINUTELY=pt.MINUTELY,e.SECONDLY=pt.SECONDLY,e.MO=Ur.MO,e.TU=Ur.TU,e.WE=Ur.WE,e.TH=Ur.TH,e.FR=Ur.FR,e.SA=Ur.SA,e.SU=Ur.SU,e.parseString=nl,e.optionsToString=rl,e}();function Bw(e,t,r,n,i,a){var o={},s=e.accept;function u(m,h){r.forEach(function(g){g.between(m,h,!0).forEach(function(y){o[Number(y)]=!0})})}i.forEach(function(m){var h=new Ka(m,a).rezonedDate();o[Number(h)]=!0}),e.accept=function(m){var h=Number(m);return isNaN(h)?s.call(this,m):!o[h]&&(u(new Date(h-1),new Date(h+1)),!o[h])?(o[h]=!0,s.call(this,m)):!0},e.method==="between"&&(u(e.args.after,e.args.before),e.accept=function(m){var h=Number(m);return o[h]?!0:(o[h]=!0,s.call(this,m))});for(var l=0;l1||i.length||a.length||o.length){var c=new gh(l);return c.dtstart(s),c.tzid(u||void 0),n.forEach(function(m){c.rrule(new Oe(ph(m,s,u),l))}),i.forEach(function(m){c.rdate(m)}),a.forEach(function(m){c.exrule(new Oe(ph(m,s,u),l))}),o.forEach(function(m){c.exdate(m)}),t.compatible&&t.dtstart&&c.rdate(s),c}var d=n[0]||{};return new Oe(ph(d,d.dtstart||t.dtstart||s,d.tzid||t.tzid||u),l)}function Mu(e,t){return t===void 0&&(t={}),eA(e,tA(t))}function ph(e,t,r){return Un(Un({},e),{dtstart:t,tzid:r})}function tA(e){var t=[],r=Object.keys(e),n=Object.keys(Vw);if(r.forEach(function(i){Et(n,i)||t.push(i)}),t.length)throw new Error("Invalid options: "+t.join(", "));return Un(Un({},Vw),e)}function nA(e){if(e.indexOf(":")===-1)return{name:"RRULE",value:e};var t=lw(e,":",1),r=t[0],n=t[1];return{name:r,value:n}}function rA(e){var t=nA(e),r=t.name,n=t.value,i=r.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function iA(e,t){if(t===void 0&&(t=!1),e=e&&e.trim(),!e)throw new Error("Invalid empty string");if(!t)return e.split(/\s/);for(var r=e.split(` +`),n=0;n0&&i[0]===" "?(r[n-1]+=i.slice(1),r.splice(n,1)):n+=1:r.splice(n,1)}return r}function aA(e){e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function $w(e,t){return aA(t),e.split(",").map(function(r){return Zs(r)})}function Uw(e){var t=this;return function(r){if(r!==void 0&&(t["_".concat(e)]=r),t["_".concat(e)]!==void 0)return t["_".concat(e)];for(var n=0;n