sliccy 6.160.0 → 6.162.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/.vite/manifest.json +182 -182
- package/dist/ui/assets/CLAUDE-BMBoR1hd.js +1 -0
- package/dist/ui/assets/CLAUDE-Bzu6oiWk.js +1 -0
- package/dist/ui/assets/MEMORY-Dr4c78r_.js +166 -0
- package/dist/ui/assets/SKILL-3ejR48eL.js +1 -0
- package/dist/ui/assets/{SKILL--iIJifMo.js → SKILL-C8DJkgFD.js} +1 -1
- package/dist/ui/assets/{SKILL-C9vwCrkC.js → SKILL-DYIL6DC-.js} +1 -1
- package/dist/ui/assets/{account-store-DPAcrOEJ.js → account-store-BwJF_V2e.js} +1 -1
- package/dist/ui/assets/{account-store-CePsk1tE.js → account-store-D-2d-wgE.js} +1 -1
- package/dist/ui/assets/{adobe-F53GCc9n.js → adobe-CjbAgmPl.js} +1 -1
- package/dist/ui/assets/{adobe-Bvqv_vJm.js → adobe-CwwqYoOU.js} +1 -1
- package/dist/ui/assets/{agent-bridge-DpJWjVUx.js → agent-bridge-BVKW1qEQ.js} +1 -1
- package/dist/ui/assets/{agent-panels-Bpvd01mi.js → agent-panels-CgbsDe7X.js} +1 -1
- package/dist/ui/assets/{apply-layout-CmnuIkY2.js → apply-layout-DwcfGHFm.js} +1 -1
- package/dist/ui/assets/{apps-8FivzUqm.js → apps-DevRtS09.js} +1 -1
- package/dist/ui/assets/{azure-openai-B2sC1XOD.js → azure-openai-BliiJJ3h.js} +1 -1
- package/dist/ui/assets/{azure-openai-Cn7AH3A6.js → azure-openai-JgQOdxTB.js} +1 -1
- package/dist/ui/assets/{backend-hostfs-DqmJEcF_.js → backend-hostfs-BeGMZ35g.js} +1 -1
- package/dist/ui/assets/{budget-usage-source-BihSbvk7.js → budget-usage-source-DtWNqYUy.js} +1 -1
- package/dist/ui/assets/{safe-buffer-OLJ0qaLt.js → buffer-B5d1xHaH.js} +1 -3
- package/dist/ui/assets/{safe-buffer-iah92gQe.js → buffer-DvhmllZ2.js} +1 -1
- package/dist/ui/assets/{bunny-probe-BVjp9oI9.js → bunny-probe-6xn_IAte.js} +1 -1
- package/dist/ui/assets/{bunny-run-E1D0_zTi.js → bunny-run-Czew2bZ0.js} +1 -1
- package/dist/ui/assets/{cdp-D3UrQPUf.js → cdp-Bt4Tc7Bs.js} +1 -1
- package/dist/ui/assets/{cerebras-DhjIiWyi.js → cerebras-B22qDyni.js} +1 -1
- package/dist/ui/assets/{cerebras-ByMgPfBR.js → cerebras-CjBby1u2.js} +1 -1
- package/dist/ui/assets/{composer-speech-CCafIYaS.js → composer-speech-BYeMN2uA.js} +1 -1
- package/dist/ui/assets/cone-memory-budget-Cmi9vXV5.js +15 -0
- package/dist/ui/assets/{connect-surface-BtbKFUb5.js → connect-surface-CHdfpKbm.js} +1 -1
- package/dist/ui/assets/{directed-approval-B4L-vOCr.js → directed-approval-DgyI3qOn.js} +1 -1
- package/dist/ui/assets/dist-BF1NH9lB.js +12 -0
- package/dist/ui/assets/dist-DQ0MhOxL.js +18 -0
- package/dist/ui/assets/{ensure-speech-assets-CqXifaHm.js → ensure-speech-assets-B3Nm2ohf.js} +1 -1
- package/dist/ui/assets/{fast-path-CbwpSWFJ.js → fast-path-CYxpDuii.js} +1 -1
- package/dist/ui/assets/{fs-DTEzNGFj.js → fs-CAQbIrYC.js} +1 -1
- package/dist/ui/assets/{fs-C2PDa-R-.js → fs-CCWZwfa6.js} +2 -2
- package/dist/ui/assets/{gelatiere-store-DA2wk9nw.js → gelatiere-store-BEP-eJ5h.js} +1 -1
- package/dist/ui/assets/{gelatiere-unit-DnbLwJqw.js → gelatiere-unit-yX_VWKxi.js} +1 -1
- package/dist/ui/assets/{github-BrfLcXzp.js → github-CUN_AUAu.js} +2 -2
- package/dist/ui/assets/{github-Ch77E2eB.js → github-DqE3SYB2.js} +1 -1
- package/dist/ui/assets/{github-auth-Bl0cyP8q.js → github-auth-E8mpeEdU.js} +1 -1
- package/dist/ui/assets/{github-copilot-Byhq1asv.js → github-copilot-BuEa5EIS.js} +1 -1
- package/dist/ui/assets/{github-copilot-g_xQkEpH.js → github-copilot-u9f-sT4d.js} +1 -1
- package/dist/ui/assets/{github-install-CR-EXBOY.js → github-install-BO46TS1H.js} +1 -1
- package/dist/ui/assets/{github-zip-CZFONhEX.js → github-zip-DeYRWuaP.js} +1 -1
- package/dist/ui/assets/{hear-BqVRH3XT.js → hear-Ow1sQFnW.js} +1 -1
- package/dist/ui/assets/{help-CeQBO5ly.js → help-7-ZCR2Cf.js} +1 -1
- package/dist/ui/assets/{installer-CscPxUWv.js → installer-DoomA9a4.js} +1 -1
- package/dist/ui/assets/{instruction-frontmatter-Bk64dayp.js → instruction-frontmatter-B48EsYtA.js} +1 -1
- package/dist/ui/assets/isomorphic-git-B7et_8Xe.js +69 -0
- package/dist/ui/assets/isomorphic-git-D2fV6xS-.js +86 -0
- package/dist/ui/assets/js-realm-worker-DRvMA0wv.js +50 -0
- package/dist/ui/assets/jsh-runtime-extensions-CBxhvxKk.js +1 -0
- package/dist/ui/assets/{just-bash-compat-_TMo8UnL.js → just-bash-compat-BwD6SoTi.js} +1 -1
- package/dist/ui/assets/{kernel-worker-D5e27k_H.js → kernel-worker-BOn7PAWS.js} +592 -589
- package/dist/ui/assets/{local-llm-BxA-EjNc.js → local-llm-B7QocwR-.js} +1 -1
- package/dist/ui/assets/{local-llm-DVwaDboP.js → local-llm-ws8kUvz8.js} +1 -1
- package/dist/ui/assets/{main-C8zDPux3.js → main-C3kY4qwt.js} +3 -3
- package/dist/ui/assets/{main-cherry-1oiJGSBV.js → main-cherry-CXJmoiKT.js} +1 -1
- package/dist/ui/assets/memory-budget-Bcf7Eolo.js +1 -0
- package/dist/ui/assets/memory-curation-seam-BeoDnTPF.js +1 -0
- package/dist/ui/assets/memory-write-execute-BOjUkUIG.js +1 -0
- package/dist/ui/assets/{mount-BlETha9u.js → mount-DLXo0YLf.js} +3 -3
- package/dist/ui/assets/{mount-Q9lauj2u.js → mount-eaKpsekX.js} +1 -1
- package/dist/ui/assets/{mount-recovery-CU6Z8MmL.js → mount-recovery-LNDCBESm.js} +1 -1
- package/dist/ui/assets/{mv-B4NndPT_.js → mv-DRuZuDHt.js} +1 -1
- package/dist/ui/assets/{new-session-D-Zk9tIn.js → new-session-BR07Cwue.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-BGs1unaJ.js → oauth-bootstrap-CU5n9CrT.js} +2 -2
- package/dist/ui/assets/{onboarding-orchestrator-OioRQySZ.js → onboarding-orchestrator-DlvPySOw.js} +1 -1
- package/dist/ui/assets/{openai-codex-BdoYi7iZ.js → openai-codex-DVTuUFEt.js} +1 -1
- package/dist/ui/assets/{openai-codex-Ct104eE-.js → openai-codex-zNStwguM.js} +1 -1
- package/dist/ui/assets/{openrouter-BIaQ_JPl.js → openrouter-AATG6x2d.js} +1 -1
- package/dist/ui/assets/{openrouter-CcjhTCut.js → openrouter-RXJx-CYE.js} +1 -1
- package/dist/ui/assets/{openrouter-free-yA8q16HI.js → openrouter-free-3g-OS9Vd.js} +1 -1
- package/dist/ui/assets/{openrouter-free-DYDeRUsd.js → openrouter-free-BgEXTfii.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-DHnxPM5g.js → openrouter-oauth-6T6RMMKm.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-Uz0CNKvE.js → openrouter-oauth-BrunARs4.js} +1 -1
- package/dist/ui/assets/{opfs-mount-BdgSw31f.js → opfs-mount-Bs3Og1U8.js} +1 -1
- package/dist/ui/assets/{opfs-mount-DPyMX6Hw.js → opfs-mount-DqcCV6-e.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-IKhcZB2s.js → panel-rpc-handlers-C-ZrezVh.js} +2 -2
- package/dist/ui/assets/{panelize-shell-CfVDQ-qe.js → panelize-shell-Dqtsa7Xq.js} +1 -1
- package/dist/ui/assets/{pi-edit-execution-BO0Lb6Bm.js → pi-edit-execution-DqI6084r.js} +1 -1
- package/dist/ui/assets/{provider-CLIT77GF.js → provider-BzyjK17E.js} +2 -2
- package/dist/ui/assets/{provider-CgB8UlPB.js → provider-DEvcJ1Rc.js} +1 -1
- package/dist/ui/assets/provider-settings-CnvkRFSY.js +1 -0
- package/dist/ui/assets/provider-store-access-DFdeZeqD.js +1 -0
- package/dist/ui/assets/provider-store-access-Dwd6xV_i.js +1 -0
- package/dist/ui/assets/{providers-B5Xll24v.js → providers-DgV0i5wM.js} +1 -1
- package/dist/ui/assets/{providers-rH3sC6oE.js → providers-yJqf8FSl.js} +2 -2
- package/dist/ui/assets/{quick-llm-COj8uXB2.js → quick-llm-C0pknm6K.js} +1 -1
- package/dist/ui/assets/{recovery-screen-CcMWjF2S.js → recovery-screen-Drmpqp_Z.js} +1 -1
- package/dist/ui/assets/run-BCXMG6On.js +51 -0
- package/dist/ui/assets/{run-CTBcQwZc.js → run-BaLqrV2X.js} +1 -1
- package/dist/ui/assets/{run-DlNq_C45.js → run-BhxHz3xC.js} +1 -1
- package/dist/ui/assets/{run-BscXvZLR.js → run-CokQiUCf.js} +2 -2
- package/dist/ui/assets/{run-hAyl9Ys1.js → run-DWBPrvVI.js} +1 -1
- package/dist/ui/assets/{run-B5YOTTPD.js → run-Dfw_vahy.js} +2 -2
- package/dist/ui/assets/{run-DZd7hQTI.js → run-Dmi_q7LV.js} +1 -1
- package/dist/ui/assets/{run-C2zohVN-.js → run-DsHniFDx.js} +1 -1
- package/dist/ui/assets/{run-EhsZ6l-Q.js → run-iJ1NIefU.js} +2 -2
- package/dist/ui/assets/{session-jsonl-BD9cCIxh.js → session-jsonl-r3PC72gG.js} +1 -1
- package/dist/ui/assets/{setup-feature-flags-remote-BaDtxdhu.js → setup-feature-flags-remote-DvyEZpD7.js} +1 -1
- package/dist/ui/assets/{silent-renew-backoff-lXJyJbee.js → silent-renew-backoff-GAYBElLu.js} +1 -1
- package/dist/ui/assets/{skills-D9k7heyN.js → skills-83dSm0AA.js} +2 -2
- package/dist/ui/assets/slicc-version-C0gkt5sw.js +1 -0
- package/dist/ui/assets/{snapshot-D9frRFAl.js → snapshot-DIIE5zIj.js} +1 -1
- package/dist/ui/assets/{snapshot-features-CY1ojLDt.js → snapshot-features-CH_5YuGq.js} +1 -1
- package/dist/ui/assets/{soundscape-PjAXFwP2.js → soundscape-CzP0cXwy.js} +1 -1
- package/dist/ui/assets/{speak-BW-CzB9F.js → speak-BYzFS7Ty.js} +1 -1
- package/dist/ui/assets/{sprinkle-manager-AAdiFto8.js → sprinkle-manager-BLUZduNz.js} +1 -1
- package/dist/ui/assets/{sprinkle-renderer-Cko0du4q.js → sprinkle-renderer-Cb03w_WD.js} +1 -1
- package/dist/ui/assets/{src-D-Mukt_a.js → src-Dt9AZ03D.js} +72 -72
- package/dist/ui/assets/{state-CKVexu66.js → state-Bj9Ub2SV.js} +1 -1
- package/dist/ui/assets/{store-Bs0ibRcP.js → store-8BTj1fD_.js} +1 -1
- package/dist/ui/assets/{store-CYOzMNQy.js → store-tmEfD0Rj.js} +1 -1
- package/dist/ui/assets/{sudo-5OEj45QA.js → sudo-DAoppDTf.js} +1 -1
- package/dist/ui/assets/{sync-dialog-Du0XIfD-.js → sync-dialog-BWiv-UZX.js} +1 -1
- package/dist/ui/assets/{transformers-env-DGjj5kTt.js → transformers-env-CZ7GObfi.js} +1 -1
- package/dist/ui/assets/{tray-sidecar-A9Q-zHbK.js → tray-sidecar-2VKSK6f1.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-E2JgYQa5.js → upgrade-detection-CPCrBCMa.js} +1 -1
- package/dist/ui/assets/{upskill-lick-skip-DbVexxZ4.js → upskill-lick-skip-CfQOyKFq.js} +1 -1
- package/dist/ui/assets/{voice-reply-FtqAqhy7.js → voice-reply-CkUBH04W.js} +1 -1
- package/dist/ui/assets/{wc-attach-DRll9Q8i.js → wc-attach-LnXYOiuQ.js} +2 -2
- package/dist/ui/assets/{wc-extension-B-yWHpR3.js → wc-extension-BiiJ1PC-.js} +2 -2
- package/dist/ui/assets/{wc-follower-8rcv-JrF.js → wc-follower-BPYn7Q3s.js} +3 -3
- package/dist/ui/assets/{wc-follower-oauth-CRapUStT.js → wc-follower-oauth-CCa8xLk0.js} +1 -1
- package/dist/ui/assets/{wc-gelatiere-CDF-kir7.js → wc-gelatiere-C1nVt4q0.js} +1 -1
- package/dist/ui/assets/{wc-live-D6R6V53U.js → wc-live-yBrQM63g.js} +66 -46
- package/dist/ui/assets/{wc-nav-oZP2a0A6.js → wc-nav-DwwSSgiM.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-BXrB58p3.js → wc-onboarding-COGCiwOu.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-SK_3lU2F.js → wc-placeholder-DYKS2mOy.js} +3 -3
- package/dist/ui/assets/{wc-secret-request-CoDENWqo.js → wc-secret-request-5YT8-1DJ.js} +1 -1
- package/dist/ui/assets/{wc-settings-Cg7k2K63.js → wc-settings-C91SZgPn.js} +3 -3
- package/dist/ui/assets/{wc-shell-fKAJRrUB.js → wc-shell-Bk_epkuk.js} +5 -5
- package/dist/ui/assets/{wc-shortcut-config-DtC8GuwC.js → wc-shortcut-config-Bs4LcqFL.js} +1 -1
- package/dist/ui/assets/{wc-shortcuts-Cxkm0n34.js → wc-shortcuts-CkiPB7Y_.js} +2 -2
- package/dist/ui/assets/{wc-sprinkles-C8Aqfch9.js → wc-sprinkles-B8NqZJDQ.js} +2 -2
- package/dist/ui/assets/{wc-transcript-export-u6ksMoo8.js → wc-transcript-export-BU4kXlKC.js} +2 -2
- package/dist/ui/assets/{wc-tray-ClOYh25L.js → wc-tray-DZnAKRIm.js} +4 -4
- package/dist/ui/assets/welcome-detection-Cd3WyOoe.js +1 -0
- package/dist/ui/assets/{whisper-session-CxYUomzX.js → whisper-session-BetvCfEP.js} +2 -2
- package/dist/ui/assets/{xai-grok-DjNkGSkX.js → xai-grok-BF8jP9SN.js} +1 -1
- package/dist/ui/assets/{xai-grok-BmowpkDG.js → xai-grok-DjlUbdZA.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/ui/packages/webapp/index.html +3 -3
- package/package.json +4 -3
- package/dist/ui/assets/CLAUDE-DT25ppH5.js +0 -1
- package/dist/ui/assets/CLAUDE-I9G_dHp6.js +0 -1
- package/dist/ui/assets/DREAMING-DKcamfu0.js +0 -74
- package/dist/ui/assets/MEMORY-C8tCnvqV.js +0 -146
- package/dist/ui/assets/SKILL-BkCuZ1rT.js +0 -1
- package/dist/ui/assets/cone-memory-budget-ieIsscyt.js +0 -15
- package/dist/ui/assets/dist-0AIPb7H_.js +0 -12
- package/dist/ui/assets/dist-xOOa94QU.js +0 -18
- package/dist/ui/assets/isomorphic-git-Cgji39_P.js +0 -69
- package/dist/ui/assets/isomorphic-git-DRUhmZ5u.js +0 -84
- package/dist/ui/assets/js-realm-worker-CEmMP54m.js +0 -50
- package/dist/ui/assets/jsh-runtime-extensions-Bz5AwpQL.js +0 -1
- package/dist/ui/assets/memory-budget-CIVoqHgl.js +0 -1
- package/dist/ui/assets/memory-curation-seam-DlAyIfCr.js +0 -1
- package/dist/ui/assets/provider-settings-OCnlAtDl.js +0 -1
- package/dist/ui/assets/provider-store-access-CyRQ8v9r.js +0 -1
- package/dist/ui/assets/provider-store-access-I5hKcP3f.js +0 -1
- package/dist/ui/assets/run-DAdFvQnN.js +0 -50
- package/dist/ui/assets/slicc-version-Cd9e4zUy.js +0 -1
- package/dist/ui/assets/welcome-detection-BKAK_ts0.js +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import{i as e,t}from"./rolldown-runtime-Dd_uD5pT.js";import{t as n}from"./buffer-DvhmllZ2.js";var r=t(((e,t)=>{t.exports=typeof Object.create==`function`?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),i=t(((e,t)=>{var r=n(),i=r.Buffer;function a(e,t){for(var n in e)t[n]=e[n]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(a(r,e),e.Buffer=o);function o(e,t,n){return i(e,t,n)}o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return i(e,t,n)},o.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var r=i(e);return t===void 0?r.fill(0):typeof n==`string`?r.fill(t,n):r.fill(t),r},o.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return i(e)},o.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r.SlowBuffer(e)}})),a=t(((e,t)=>{var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)==`[object Array]`}})),o=t(((e,t)=>{t.exports=TypeError})),s=t(((e,t)=>{t.exports=Object})),c=t(((e,t)=>{t.exports=Error})),l=t(((e,t)=>{t.exports=EvalError})),u=t(((e,t)=>{t.exports=RangeError})),d=t(((e,t)=>{t.exports=ReferenceError})),f=t(((e,t)=>{t.exports=SyntaxError})),p=t(((e,t)=>{t.exports=URIError})),m=t(((e,t)=>{t.exports=Math.abs})),h=t(((e,t)=>{t.exports=Math.floor})),g=t(((e,t)=>{t.exports=Math.max})),_=t(((e,t)=>{t.exports=Math.min})),v=t(((e,t)=>{t.exports=Math.pow})),y=t(((e,t)=>{t.exports=Math.round})),b=t(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),x=t(((e,t)=>{var n=b();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),S=t(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),C=t(((e,t)=>{var n=S();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),w=t(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),T=t(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,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]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),E=t(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=T();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),D=t(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),O=t(((e,t)=>{t.exports=s().getPrototypeOf||null})),k=t(((e,t)=>{var n=Object.prototype.toString,r=Math.max,i=`[object Function]`,a=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},o=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},s=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||n.apply(t)!==i)throw TypeError(`Function.prototype.bind called on incompatible `+t);for(var c=o(arguments,1),l,u=function(){if(this instanceof l){var n=t.apply(this,a(c,arguments));return Object(n)===n?n:this}return t.apply(e,a(c,arguments))},d=r(0,t.length-c.length),f=[],p=0;p<d;p++)f[p]=`$`+p;if(l=Function(`binder`,`return function (`+s(f,`,`)+`){ return binder.apply(this,arguments); }`)(u),t.prototype){var m=function(){};m.prototype=t.prototype,l.prototype=new m,m.prototype=null}return l}})),A=t(((e,t)=>{var n=k();t.exports=Function.prototype.bind||n})),j=t(((e,t)=>{t.exports=Function.prototype.call})),M=t(((e,t)=>{t.exports=Function.prototype.apply})),ee=t(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),te=t(((e,t)=>{var n=A(),r=M(),i=j();t.exports=ee()||n.call(i,r)})),ne=t(((e,t)=>{var n=A(),r=o(),i=j(),a=te();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}})),re=t(((e,t)=>{var n=ne(),r=C(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`&&function(e){return s(e==null?e:o(e))}})),ie=t(((e,t)=>{var n=D(),r=O(),i=re();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),ae=t(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=A().call(n,r)})),oe=t(((e,t)=>{var n,r=s(),i=c(),a=l(),b=u(),S=d(),T=f(),k=o(),ee=p(),te=m(),ne=h(),re=g(),oe=_(),se=v(),ce=y(),le=x(),N=Function,P=function(e){try{return N(`"use strict"; return (`+e+`).constructor;`)()}catch{}},ue=C(),de=w(),fe=function(){throw new k},pe=ue?function(){try{return arguments.callee,fe}catch{try{return ue(arguments,`callee`).get}catch{return fe}}}():fe,F=E()(),I=ie(),me=O(),he=D(),L=M(),R=j(),ge={},_e=typeof Uint8Array>`u`||!I?n:I(Uint8Array),z={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":F&&I?I([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":ge,"%AsyncGenerator%":ge,"%AsyncGeneratorFunction%":ge,"%AsyncIteratorPrototype%":ge,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":N,"%GeneratorFunction%":ge,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":F&&I?I(I([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!F||!I?n:I(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":ue,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":b,"%ReferenceError%":S,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!F||!I?n:I(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":F&&I?I(``[Symbol.iterator]()):n,"%Symbol%":F?Symbol:n,"%SyntaxError%":T,"%ThrowTypeError%":pe,"%TypedArray%":_e,"%TypeError%":k,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":ee,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":R,"%Function.prototype.apply%":L,"%Object.defineProperty%":de,"%Object.getPrototypeOf%":me,"%Math.abs%":te,"%Math.floor%":ne,"%Math.max%":re,"%Math.min%":oe,"%Math.pow%":se,"%Math.round%":ce,"%Math.sign%":le,"%Reflect.getPrototypeOf%":he};if(I)try{null.error}catch(e){z[`%Error.prototype%`]=I(I(e))}var ve=function e(t){var n;if(t===`%AsyncFunction%`)n=P(`async function () {}`);else if(t===`%GeneratorFunction%`)n=P(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=P(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&I&&(n=I(i.prototype))}return z[t]=n,n},B={__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`]},V=A(),H=ae(),U=V.call(R,Array.prototype.concat),ye=V.call(L,Array.prototype.splice),W=V.call(R,String.prototype.replace),G=V.call(R,String.prototype.slice),be=V.call(R,RegExp.prototype.exec),xe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Se=/\\(\\)?/g,Ce=function(e){var t=G(e,0,1),n=G(e,-1);if(t===`%`&&n!==`%`)throw new T("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new T("invalid intrinsic syntax, expected opening `%`");var r=[];return W(e,xe,function(e,t,n,i){r[r.length]=n?W(i,Se,`$1`):t||e}),r},K=function(e,t){var n=e,r;if(H(B,n)&&(r=B[n],n=`%`+r[0]+`%`),H(z,n)){var i=z[n];if(i===ge&&(i=ve(n)),i===void 0&&!t)throw new k(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new T(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new k(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new k(`"allowMissing" argument must be a boolean`);if(be(/^%?[^%]*%?$/,e)===null)throw new T("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ce(e),r=n.length>0?n[0]:``,i=K(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,c=i.alias;c&&(r=c[0],ye(n,U([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var d=n[l],f=G(d,0,1),p=G(d,-1);if((f===`"`||f===`'`||f==="`"||p===`"`||p===`'`||p==="`")&&f!==p)throw new T(`property names with quotes must have matching quotes`);if((d===`constructor`||!u)&&(s=!0),r+=`.`+d,a=`%`+r+`%`,H(z,a))o=z[a];else if(o!=null){if(!(d in o)){if(!t)throw new k(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(ue&&l+1>=n.length){var m=ue(o,d);u=!!m,o=u&&`get`in m&&!(`originalValue`in m.get)?m.get:o[d]}else u=H(o,d),o=o[d];u&&!s&&(z[a]=o)}}return o}})),se=t(((e,t)=>{var n=oe(),r=ne(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),ce=t(((e,t)=>{var n=Function.prototype.toString,r=typeof Reflect==`object`&&Reflect!==null&&Reflect.apply,i,a;if(typeof r==`function`&&typeof Object.defineProperty==`function`)try{i=Object.defineProperty({},"length",{get:function(){throw a}}),a={},r(function(){throw 42},null,i)}catch(e){e!==a&&(r=null)}else r=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch{return!1}},c=function(e){try{return!s(e)&&(n.call(e),!0)}catch{return!1}},l=Object.prototype.toString,u=`[object Object]`,d=`[object Function]`,f=`[object GeneratorFunction]`,p=`[object HTMLAllCollection]`,m=`[object HTML document.all class]`,h=`[object HTMLCollection]`,g=typeof Symbol==`function`&&!!Symbol.toStringTag,_=!(0 in[,]),v=function(){return!1};if(typeof document==`object`){var y=document.all;l.call(y)===l.call(document.all)&&(v=function(e){if((_||!e)&&(e===void 0||typeof e==`object`))try{var t=l.call(e);return(t===p||t===m||t===h||t===u)&&e(``)==null}catch{}return!1})}t.exports=r?function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;try{r(e,null,i)}catch(e){if(e!==a)return!1}return!s(e)&&c(e)}:function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;if(g)return c(e);if(s(e))return!1;var t=l.call(e);return t!==d&&t!==f&&!/^\[object HTML/.test(t)?!1:c(e)}})),le=t(((e,t)=>{var n=ce(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,n){for(var r=0,a=e.length;r<a;r++)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))},o=function(e,t,n){for(var r=0,i=e.length;r<i;r++)n==null?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},s=function(e,t,n){for(var r in e)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))};function c(e){return r.call(e)===`[object Array]`}t.exports=function(e,t,r){if(!n(t))throw TypeError(`iterator must be a function`);var i;arguments.length>=3&&(i=r),c(e)?a(e,t,i):typeof e==`string`?o(e,t,i):s(e,t,i)}})),N=t(((e,t)=>{t.exports=[`Float16Array`,`Float32Array`,`Float64Array`,`Int8Array`,`Int16Array`,`Int32Array`,`Uint8Array`,`Uint8ClampedArray`,`Uint16Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`]})),P=t(((e,t)=>{var n=N(),r=globalThis;t.exports=function(){for(var e=[],t=0;t<n.length;t++)typeof r[n[t]]==`function`&&(e[e.length]=n[t]);return e}})),ue=t(((e,t)=>{var n=w(),r=f(),i=o(),a=C();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}})),de=t(((e,t)=>{var n=w(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r})),fe=t(((e,t)=>{var n=oe(),r=ue(),i=de()(),a=C(),s=o(),c=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new s("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||c(t)!==t)throw new s("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(o=!1),u&&!u.writable&&(l=!1)}return(o||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}})),pe=t(((e,t)=>{var n=A(),r=M(),i=te();t.exports=function(){return i(n,r,arguments)}})),F=t(((e,t)=>{var n=fe(),r=w(),i=ne(),a=pe();t.exports=function(e){var t=i(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},r?r(t.exports,`apply`,{value:a}):t.exports.apply=a})),I=t(((e,t)=>{var n=T();t.exports=function(){return n()&&!!Symbol.toStringTag}})),me=t(((e,t)=>{var n=le(),r=P(),i=F(),a=se(),o=C(),s=ie(),c=a(`Object.prototype.toString`),l=I()(),u=globalThis,d=r(),f=a(`String.prototype.slice`),p=a(`Array.prototype.indexOf`,!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},m={__proto__:null};l&&o&&s?n(d,function(e){var t=new u[e];if(Symbol.toStringTag in t&&s){var n=s(t),r=o(n,Symbol.toStringTag);if(!r&&n&&(r=o(s(n),Symbol.toStringTag)),r&&r.get){var a=i(r.get);m[`$`+e]=a}}}):n(d,function(e){var t=new u[e],n=t.slice||t.set;if(n){var r=i(n);m[`$`+e]=r}});var h=function(e){var t=!1;return n(m,function(n,r){if(!t)try{`$`+n(e)===r&&(t=f(r,1))}catch{}}),t},g=function(e){var t=!1;return n(m,function(n,r){if(!t)try{n(e),t=f(r,1)}catch{}}),t};t.exports=function(e){if(!e||typeof e!=`object`)return!1;if(!l){var t=f(c(e),8,-1);return p(d,t)>-1?t:t===`Object`&&g(e)}return o?h(e):null}})),he=t(((e,t)=>{var n=me();t.exports=function(e){return!!n(e)}})),L=t(((e,t)=>{var n=o(),r=se()(`TypedArray.prototype.buffer`,!0),i=he();t.exports=r||function(e){if(!i(e))throw new n(`Not a Typed Array`);return e.buffer}})),R=t(((e,t)=>{var n=i().Buffer,r=a(),o=L(),s=ArrayBuffer.isView||function(e){try{return o(e),!0}catch{return!1}},c=typeof Uint8Array<`u`,l=typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`,u=l&&(n.prototype instanceof Uint8Array||n.TYPED_ARRAY_SUPPORT);t.exports=function(e,t){if(n.isBuffer(e))return e.constructor&&!(`isBuffer`in e)?n.from(e):e;if(typeof e==`string`)return n.from(e,t);if(l&&s(e)){if(e.byteLength===0)return n.alloc(0);if(u){var i=n.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var a=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=n.from(a);if(o.length===e.byteLength)return o}if(c&&e instanceof Uint8Array)return n.from(e);var d=r(e);if(d)for(var f=0;f<e.length;f+=1){var p=e[f];if(typeof p!=`number`||p<0||p>255||~~p!==p)throw RangeError(`Array items must be numbers in the range 0-255.`)}if(d||n.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e))return n.from(e);throw TypeError(`The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.`)}})),ge=t(((e,t)=>{var n=i().Buffer,r=R();function a(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}a.prototype.update=function(e,t){e=r(e,t||`utf8`);for(var n=this._block,i=this._blockSize,a=e.length,o=this._len,s=0;s<a;){for(var c=o%i,l=Math.min(a-s,i-c),u=0;u<l;u++)n[c+u]=e[s+u];o+=l,s+=l,o%i===0&&this._update(n)}return this._len+=a,this},a.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=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 e?a.toString(e):a},a.prototype._update=function(){throw Error(`_update must be implemented by subclass`)},t.exports=a})),_e=t(((e,t)=>{var n=r(),a=ge(),o=i().Buffer,s=[1518500249,1859775393,-1894007588,-899497514],c=Array(80);function l(){this.init(),this._w=c,a.call(this,64,56)}n(l,a),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function u(e){return e<<1|e>>>31}function d(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function p(e,t,n,r){return e===0?t&n|~t&r:e===2?t&n|t&r|n&r:t^n^r}l.prototype._update=function(e){for(var t=this._w,n=this._a|0,r=this._b|0,i=this._c|0,a=this._d|0,o=this._e|0,c=0;c<16;++c)t[c]=e.readInt32BE(c*4);for(;c<80;++c)t[c]=u(t[c-3]^t[c-8]^t[c-14]^t[c-16]);for(var l=0;l<80;++l){var m=~~(l/20),h=d(n)+p(m,r,i,a)+o+t[l]+s[m]|0;o=a,a=i,i=f(r),r=n,n=h}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=o+this._e|0},l.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e},t.exports=l})),z=t(((e,t)=>{var n=function(e){if(e||={},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>`u`||process.domain===void 0)throw 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=e.timeout||n.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||n.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||n.DEFAULT_MAX_EXECUTION_TIME,this.maxPending=e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?e.maxPending:n.DEFAULT_MAX_PENDING};n.DEFAULT_TIMEOUT=0,n.DEFAULT_MAX_OCCUPATION_TIME=0,n.DEFAULT_MAX_EXECUTION_TIME=0,n.DEFAULT_MAX_PENDING=1e3,n.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var i=null,a=null,o=null;typeof n!=`function`&&(r=n,n=null,o=new this.Promise(function(e,t){i=e,a=t})),r||={};var s=!1,c=null,l=null,u=null,d=this,f=function(t,r,c){l&&=(clearTimeout(l),null),u&&=(clearTimeout(u),null),t&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||=(o?r?a(r):i(c):typeof n==`function`&&n(r,c),!0),t&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},p=function(n){if(s)return f(n);c&&=(clearTimeout(c),null),d.domainReentrant&&n&&(d.domains[e]=process.domain);var i=r.maxExecutionTime||d.maxExecutionTime;if(i&&(u=setTimeout(function(){d.queues[e]&&f(n,Error(`Maximum execution time is exceeded `+e))},i)),t.length===1){var a=!1;try{t(function(e,t){a||(a=!0,f(n,e,t))})}catch(e){a||(a=!0,f(n,e))}}else d._promiseTry(function(){return t()}).then(function(e){f(n,void 0,e)},function(e){f(n,e)})};d.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],p(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])p(!1);else if(d.queues[e].length>=m)f(!1,Error(`Too many pending tasks in queue `+e));else{var h=function(){p(!0)};r.skipQueue?d.queues[e].unshift(h):d.queues[e].push(h);var g=r.timeout||d.timeout;g&&(c=setTimeout(function(){c=null,f(!1,Error(`async-lock timed out in queue `+e))},g))}var _=r.maxOccupationTime||d.maxOccupationTime;if(_&&(l=setTimeout(function(){d.queues[e]&&f(!1,Error(`Maximum occupation time is exceeded in queue `+e))},_)),o)return o},n.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},n.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},n.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},t.exports=n})),ve=t(((e,t)=>{t.exports=z()})),B=t((e=>{(function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`1.2.2`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t();function r(e){var t=0,n=0,r=0,i=typeof Int32Array<`u`?new Int32Array(4096):Array(4096);for(r=0;r!=256;++r)i[r]=e[r];for(r=0;r!=256;++r)for(n=e[r],t=256+r;t<4096;t+=256)n=i[t]=n>>>8^e[n&255];var a=[];for(r=1;r!=16;++r)a[r-1]=typeof Int32Array<`u`?i.subarray(r*256,r*256+256):i.slice(r*256,r*256+256);return a}var i=r(n),a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14];function b(e,t){for(var r=t^-1,i=0,a=e.length;i<a;)r=r>>>8^n[(r^e.charCodeAt(i++))&255];return~r}function x(e,t){for(var r=t^-1,i=e.length-15,b=0;b<i;)r=y[e[b++]^r&255]^v[e[b++]^r>>8&255]^_[e[b++]^r>>16&255]^g[e[b++]^r>>>24]^h[e[b++]]^m[e[b++]]^p[e[b++]]^f[e[b++]]^d[e[b++]]^u[e[b++]]^l[e[b++]]^c[e[b++]]^s[e[b++]]^o[e[b++]]^a[e[b++]]^n[e[b++]];for(i+=15;b<i;)r=r>>>8^n[(r^e[b++])&255];return~r}function S(e,t){for(var r=t^-1,i=0,a=e.length,o=0,s=0;i<a;)o=e.charCodeAt(i++),o<128?r=r>>>8^n[(r^o)&255]:o<2048?(r=r>>>8^n[(r^(192|o>>6&31))&255],r=r>>>8^n[(r^(128|o&63))&255]):o>=55296&&o<57344?(o=(o&1023)+64,s=e.charCodeAt(i++)&1023,r=r>>>8^n[(r^(240|o>>8&7))&255],r=r>>>8^n[(r^(128|o>>2&63))&255],r=r>>>8^n[(r^(128|s>>6&15|(o&3)<<4))&255],r=r>>>8^n[(r^(128|s&63))&255]):(r=r>>>8^n[(r^(224|o>>12&15))&255],r=r>>>8^n[(r^(128|o>>6&63))&255],r=r>>>8^n[(r^(128|o&63))&255]);return~r}e.table=n,e.bstr=b,e.buf=x,e.str=S})})),V=t((e=>{var t=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!=`object`)throw TypeError(r+`must be non-object`);for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},i={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})),H=t((e=>{var t=V(),n=4,r=0,i=1,a=2;function o(e){for(var t=e.length;--t>=0;)e[t]=0}var s=0,c=1,l=2,u=3,d=258,f=29,p=256,m=p+1+f,h=30,g=19,_=2*m+1,v=15,y=16,b=7,x=256,S=16,C=17,w=18,T=[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],E=[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],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=512,A=Array((m+2)*2);o(A);var j=Array(h*2);o(j);var M=Array(k);o(M);var ee=Array(d-u+1);o(ee);var te=Array(f);o(te);var ne=Array(h);o(ne);function re(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var ie,ae,oe;function se(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ce(e){return e<256?M[e]:M[256+(e>>>7)]}function le(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function N(e,t,n){e.bi_valid>y-n?(e.bi_buf|=t<<e.bi_valid&65535,le(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=n-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function P(e,t,n){N(e,n[t*2],n[t*2+1])}function ue(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function de(e){e.bi_valid===16?(le(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function fe(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=v;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<_;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function pe(e,t,n){var r=Array(v+1),i=0,a,o;for(a=1;a<=v;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=ue(r[s]++,s))}}function F(){var e,t,n,r,i,a=Array(v+1);for(n=0,r=0;r<f-1;r++)for(te[r]=n,e=0;e<1<<T[r];e++)ee[n++]=r;for(ee[n-1]=r,i=0,r=0;r<16;r++)for(ne[r]=i,e=0;e<1<<E[r];e++)M[i++]=r;for(i>>=7;r<h;r++)for(ne[r]=i<<7,e=0;e<1<<E[r]-7;e++)M[256+i++]=r;for(t=0;t<=v;t++)a[t]=0;for(e=0;e<=143;)A[e*2+1]=8,e++,a[8]++;for(;e<=255;)A[e*2+1]=9,e++,a[9]++;for(;e<=279;)A[e*2+1]=7,e++,a[7]++;for(;e<=287;)A[e*2+1]=8,e++,a[8]++;for(pe(A,m+1,a),e=0;e<h;e++)j[e*2+1]=5,j[e*2]=ue(e,5);ie=new re(A,T,p+1,m,v),ae=new re(j,E,0,h,v),oe=new re([],D,0,g,b)}function I(e){var t;for(t=0;t<m;t++)e.dyn_ltree[t*2]=0;for(t=0;t<h;t++)e.dyn_dtree[t*2]=0;for(t=0;t<g;t++)e.bl_tree[t*2]=0;e.dyn_ltree[x*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function me(e){e.bi_valid>8?le(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function he(e,n,r,i){me(e),i&&(le(e,r),le(e,~r)),t.arraySet(e.pending_buf,e.window,n,r,e.pending),e.pending+=r}function L(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function R(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&L(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!L(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function ge(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?P(e,i,t):(o=ee[i],P(e,o+p+1,t),s=T[o],s!==0&&(i-=te[o],N(e,i,s)),r--,o=ce(r),P(e,o,n),s=E[o],s!==0&&(r-=ne[o],N(e,r,s)));while(a<e.last_lit);P(e,x,t)}function _e(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=_,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)R(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],R(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,R(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],fe(e,t),pe(n,c,e.bl_count)}function z(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[C*2]++:e.bl_tree[w*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[S*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function ve(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do P(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(P(e,C,e.bl_tree),N(e,s-3,3)):(P(e,w,e.bl_tree),N(e,s-11,7)):(a!==i&&(P(e,a,e.bl_tree),s--),P(e,S,e.bl_tree),N(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function B(e){var t;for(z(e,e.dyn_ltree,e.l_desc.max_code),z(e,e.dyn_dtree,e.d_desc.max_code),_e(e,e.bl_desc),t=g-1;t>=3&&e.bl_tree[O[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function H(e,t,n,r){var i;for(N(e,t-257,5),N(e,n-1,5),N(e,r-4,4),i=0;i<r;i++)N(e,e.bl_tree[O[i]*2+1],3);ve(e,e.dyn_ltree,t-1),ve(e,e.dyn_dtree,n-1)}function U(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return r;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return i;for(n=32;n<p;n++)if(e.dyn_ltree[n*2]!==0)return i;return r}var ye=!1;function W(e){ye||=(F(),!0),e.l_desc=new se(e.dyn_ltree,ie),e.d_desc=new se(e.dyn_dtree,ae),e.bl_desc=new se(e.bl_tree,oe),e.bi_buf=0,e.bi_valid=0,I(e)}function G(e,t,n,r){N(e,(s<<1)+ +!!r,3),he(e,t,n,!0)}function be(e){N(e,c<<1,3),P(e,x,A),de(e)}function xe(e,t,r,i){var o,s,u=0;e.level>0?(e.strm.data_type===a&&(e.strm.data_type=U(e)),_e(e,e.l_desc),_e(e,e.d_desc),u=B(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?G(e,t,r,i):e.strategy===n||s===o?(N(e,(c<<1)+ +!!i,3),ge(e,A,j)):(N(e,(l<<1)+ +!!i,3),H(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),ge(e,e.dyn_ltree,e.dyn_dtree)),I(e),i&&me(e)}function Se(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(ee[n]+p+1)*2]++,e.dyn_dtree[ce(t)*2]++),e.last_lit===e.lit_bufsize-1}e._tr_init=W,e._tr_stored_block=G,e._tr_flush_block=xe,e._tr_tally=Se,e._tr_align=be})),U=t(((e,t)=>{function n(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}t.exports=n})),ye=t(((e,t)=>{function n(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var r=n();function i(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[(e^t[s])&255];return e^-1}t.exports=i})),W=t(((e,t)=>{t.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`}})),G=t((e=>{var t=V(),n=H(),r=U(),i=ye(),a=W(),o=0,s=1,c=3,l=4,u=5,d=0,f=1,p=-2,m=-3,h=-5,g=-1,_=1,v=2,y=3,b=4,x=0,S=2,C=8,w=9,T=15,E=8,D=286,O=30,k=19,A=2*D+1,j=15,M=3,ee=258,te=ee+M+1,ne=32,re=42,ie=69,ae=73,oe=91,se=103,ce=113,le=666,N=1,P=2,ue=3,de=4,fe=3;function pe(e,t){return e.msg=a[t],t}function F(e){return(e<<1)-(e>4?9:0)}function I(e){for(var t=e.length;--t>=0;)e[t]=0}function me(e){var n=e.state,r=n.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(t.arraySet(e.output,n.pending_buf,n.pending_out,r,e.next_out),e.next_out+=r,n.pending_out+=r,e.total_out+=r,e.avail_out-=r,n.pending-=r,n.pending===0&&(n.pending_out=0))}function he(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,me(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function ge(e,n,a,o){var s=e.avail_in;return s>o&&(s=o),s===0?0:(e.avail_in-=s,t.arraySet(n,e.input,e.next_in,s,a),e.state.wrap===1?e.adler=r(e.adler,n,s,a):e.state.wrap===2&&(e.adler=i(e.adler,n,s,a)),e.next_in+=s,e.total_in+=s,s)}function _e(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-te?e.strstart-(e.w_size-te):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+ee,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,l[i+o]===m&&l[i+o-1]===p&&l[i]===l[r]&&l[++i]===l[r+1]){r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=ee-(f-r),r=f-ee,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function z(e){var n=e.w_size,r,i,a,o,s;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-te)){t.arraySet(e.window,e.window,n,n,0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,r=i;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--i);i=n,r=i;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--i);o+=n}if(e.strm.avail_in===0)break;if(i=ge(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=M)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+M-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<M)););}while(e.lookahead<te&&e.strm.avail_in!==0)}function ve(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(z(e),e.lookahead===0&&t===o)return N;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,he(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-te&&(he(e,!1),e.strm.avail_out===0))return N}return e.insert=0,t===l?(he(e,!0),e.strm.avail_out===0?ue:de):(e.strstart>e.block_start&&(he(e,!1),e.strm.avail_out),N)}function B(e,t){for(var r,i;;){if(e.lookahead<te){if(z(e),e.lookahead<te&&t===o)return N;if(e.lookahead===0)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-te&&(e.match_length=_e(e,r)),e.match_length>=M){if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask}else i=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(he(e,!1),e.strm.avail_out===0))return N}return e.insert=e.strstart<M-1?e.strstart:M-1,t===l?(he(e,!0),e.strm.avail_out===0?ue:de):e.last_lit&&(he(e,!1),e.strm.avail_out===0)?N:P}function G(e,t){for(var r,i,a;;){if(e.lookahead<te){if(z(e),e.lookahead<te&&t===o)return N;if(e.lookahead===0)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=M-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-te&&(e.match_length=_e(e,r),e.match_length<=5&&(e.strategy===_||e.match_length===M&&e.strstart-e.match_start>4096)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-M,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=M-1,e.strstart++,i&&(he(e,!1),e.strm.avail_out===0))return N}else if(e.match_available){if(i=n._tr_tally(e,0,e.window[e.strstart-1]),i&&he(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return N}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(i=n._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<M-1?e.strstart:M-1,t===l?(he(e,!0),e.strm.avail_out===0?ue:de):e.last_lit&&(he(e,!1),e.strm.avail_out===0)?N:P}function be(e,t){for(var r,i,a,s,c=e.window;;){if(e.lookahead<=ee){if(z(e),e.lookahead<=ee&&t===o)return N;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=M&&e.strstart>0&&(a=e.strstart-1,i=c[a],i===c[++a]&&i===c[++a]&&i===c[++a])){s=e.strstart+ee;do;while(i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&a<s);e.match_length=ee-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(r=n._tr_tally(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(he(e,!1),e.strm.avail_out===0))return N}return e.insert=0,t===l?(he(e,!0),e.strm.avail_out===0?ue:de):e.last_lit&&(he(e,!1),e.strm.avail_out===0)?N:P}function xe(e,t){for(var r;;){if(e.lookahead===0&&(z(e),e.lookahead===0)){if(t===o)return N;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(he(e,!1),e.strm.avail_out===0))return N}return e.insert=0,t===l?(he(e,!0),e.strm.avail_out===0?ue:de):e.last_lit&&(he(e,!1),e.strm.avail_out===0)?N:P}function Se(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var Ce=[new Se(0,0,0,0,ve),new Se(4,4,8,4,B),new Se(4,5,16,8,B),new Se(4,6,32,32,B),new Se(4,4,16,16,G),new Se(8,16,32,32,G),new Se(8,16,128,128,G),new Se(8,32,128,256,G),new Se(32,128,258,1024,G),new Se(32,258,258,4096,G)];function K(e){e.window_size=2*e.w_size,I(e.head),e.max_lazy_match=Ce[e.level].max_lazy,e.good_match=Ce[e.level].good_length,e.nice_match=Ce[e.level].nice_length,e.max_chain_length=Ce[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0}function we(){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=C,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 t.Buf16(A*2),this.dyn_dtree=new t.Buf16((2*O+1)*2),this.bl_tree=new t.Buf16((2*k+1)*2),I(this.dyn_ltree),I(this.dyn_dtree),I(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(j+1),this.heap=new t.Buf16(2*D+1),I(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*D+1),I(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 Te(e){var t;return!e||!e.state?pe(e,p):(e.total_in=e.total_out=0,e.data_type=S,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?re:ce,e.adler=t.wrap===2?0:1,t.last_flush=o,n._tr_init(t),d)}function Ee(e){var t=Te(e);return t===d&&K(e.state),t}function De(e,t){return!e||!e.state||e.state.wrap!==2?p:(e.state.gzhead=t,d)}function Oe(e,n,r,i,a,o){if(!e)return p;var s=1;if(n===g&&(n=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>w||r!==C||i<8||i>15||n<0||n>9||o<0||o>b)return pe(e,p);i===8&&(i=9);var c=new we;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+M-1)/M),c.window=new t.Buf8(c.w_size*2),c.head=new t.Buf16(c.hash_size),c.prev=new t.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new t.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=n,c.strategy=o,c.method=r,Ee(e)}function ke(e,t){return Oe(e,t,C,T,E,x)}function Ae(e,t){var r,a,m,g;if(!e||!e.state||t>u||t<0)return e?pe(e,p):p;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===le&&t!==l)return pe(e,e.avail_out===0?h:p);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===re){if(a.wrap===2)e.adler=0,L(a,31),L(a,139),L(a,8),a.gzhead?(L(a,+!!a.gzhead.text+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),L(a,a.gzhead.time&255),L(a,a.gzhead.time>>8&255),L(a,a.gzhead.time>>16&255),L(a,a.gzhead.time>>24&255),L(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),L(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(L(a,a.gzhead.extra.length&255),L(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=i(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=ie):(L(a,0),L(a,0),L(a,0),L(a,0),L(a,0),L(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),L(a,fe),a.status=ce);else{var _=C+(a.w_bits-8<<4)<<8,b=-1;b=a.strategy>=v||a.level<2?0:a.level<6?1:a.level===6?2:3,_|=b<<6,a.strstart!==0&&(_|=ne),_+=31-_%31,a.status=ce,R(a,_),a.strstart!==0&&(R(a,e.adler>>>16),R(a,e.adler&65535)),e.adler=1}}if(a.status===ie){if(a.gzhead.extra){for(m=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),me(e),m=a.pending,a.pending===a.pending_buf_size));)L(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=ae)}else a.status=ae}if(a.status===ae){if(a.gzhead.name){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),me(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.name.length?a.gzhead.name.charCodeAt(a.gzindex++)&255:0,L(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.gzindex=0,a.status=oe)}else a.status=oe}if(a.status===oe){if(a.gzhead.comment){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),me(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.comment.length?a.gzhead.comment.charCodeAt(a.gzindex++)&255:0,L(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.status=se)}else a.status=se}if(a.status===se&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&me(e),a.pending+2<=a.pending_buf_size&&(L(a,e.adler&255),L(a,e.adler>>8&255),e.adler=0,a.status=ce)):a.status=ce),a.pending!==0){if(me(e),e.avail_out===0)return a.last_flush=-1,d}else if(e.avail_in===0&&F(t)<=F(r)&&t!==l)return pe(e,h);if(a.status===le&&e.avail_in!==0)return pe(e,h);if(e.avail_in!==0||a.lookahead!==0||t!==o&&a.status!==le){var x=a.strategy===v?xe(a,t):a.strategy===y?be(a,t):Ce[a.level].func(a,t);if((x===ue||x===de)&&(a.status=le),x===N||x===ue)return e.avail_out===0&&(a.last_flush=-1),d;if(x===P&&(t===s?n._tr_align(a):t!==u&&(n._tr_stored_block(a,0,0,!1),t===c&&(I(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),me(e),e.avail_out===0))return a.last_flush=-1,d}return t===l?a.wrap<=0?f:(a.wrap===2?(L(a,e.adler&255),L(a,e.adler>>8&255),L(a,e.adler>>16&255),L(a,e.adler>>24&255),L(a,e.total_in&255),L(a,e.total_in>>8&255),L(a,e.total_in>>16&255),L(a,e.total_in>>24&255)):(R(a,e.adler>>>16),R(a,e.adler&65535)),me(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending===0?f:d):d}function je(e){var t;return!e||!e.state?p:(t=e.state.status,t!==re&&t!==ie&&t!==ae&&t!==oe&&t!==se&&t!==ce&&t!==le?pe(e,p):(e.state=null,t===ce?pe(e,m):d))}function Me(e,n){var i=n.length,a,o,s,c,l,u,f,m;if(!e||!e.state||(a=e.state,c=a.wrap,c===2||c===1&&a.status!==re||a.lookahead))return p;for(c===1&&(e.adler=r(e.adler,n,i,0)),a.wrap=0,i>=a.w_size&&(c===0&&(I(a.head),a.strstart=0,a.block_start=0,a.insert=0),m=new t.Buf8(a.w_size),t.arraySet(m,n,i-a.w_size,a.w_size,0),n=m,i=a.w_size),l=e.avail_in,u=e.next_in,f=e.input,e.avail_in=i,e.next_in=0,e.input=n,z(a);a.lookahead>=M;){o=a.strstart,s=a.lookahead-(M-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[o+M-1])&a.hash_mask,a.prev[o&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=o,o++;while(--s);a.strstart=o,a.lookahead=M-1,z(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=M-1,a.match_available=0,e.next_in=u,e.input=f,e.avail_in=l,a.wrap=c,d}e.deflateInit=ke,e.deflateInit2=Oe,e.deflateReset=Ee,e.deflateResetKeep=Te,e.deflateSetHeader=De,e.deflate=Ae,e.deflateEnd=je,e.deflateSetDictionary=Me,e.deflateInfo=`pako deflate (from Nodeca project)`})),be=t((e=>{var t=V(),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var i=new t.Buf8(256),a=0;a<256;a++)i[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;i[254]=i[254]=1,e.string2buf=function(e){var n,r,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(n=new t.Buf8(c),o=0,a=0;o<c;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),r<128?n[o++]=r:r<2048?(n[o++]=192|r>>>6,n[o++]=128|r&63):r<65536?(n[o++]=224|r>>>12,n[o++]=128|r>>>6&63,n[o++]=128|r&63):(n[o++]=240|r>>>18,n[o++]=128|r>>>12&63,n[o++]=128|r>>>6&63,n[o++]=128|r&63);return n};function o(e,i){if(i<65534&&(e.subarray&&r||!e.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(e,i));for(var a=``,o=0;o<i;o++)a+=String.fromCharCode(e[o]);return a}e.buf2binstring=function(e){return o(e,e.length)},e.binstring2buf=function(e){for(var n=new t.Buf8(e.length),r=0,i=n.length;r<i;r++)n[r]=e.charCodeAt(r);return n},e.buf2string=function(e,t){var n,r,a,s,c=t||e.length,l=Array(c*2);for(r=0,n=0;n<c;){if(a=e[n++],a<128){l[r++]=a;continue}if(s=i[a],s>4){l[r++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<c;)a=a<<6|e[n++]&63,s--;if(s>1){l[r++]=65533;continue}a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|a&1023)}return o(l,r)},e.utf8border=function(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+i[e[n]]>t?n:t}})),xe=t(((e,t)=>{function n(){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}t.exports=n})),Se=t((e=>{var t=G(),n=V(),r=be(),i=W(),a=xe(),o=Object.prototype.toString,s=0,c=4,l=0,u=1,d=2,f=-1,p=0,m=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:f,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:``},e||{});var s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var c=t.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(c!==l)throw Error(i[c]);if(s.header&&t.deflateSetHeader(this.strm,s.header),s.dictionary){var u=typeof s.dictionary==`string`?r.string2buf(s.dictionary):o.call(s.dictionary)===`[object ArrayBuffer]`?new Uint8Array(s.dictionary):s.dictionary;if(c=t.deflateSetDictionary(this.strm,u),c!==l)throw Error(i[c]);this._dict_set=!0}}h.prototype.push=function(e,i){var a=this.strm,f=this.options.chunkSize,p,m;if(this.ended)return!1;m=i===~~i?i:i===!0?c:s,a.input=typeof e==`string`?r.string2buf(e):o.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new n.Buf8(f),a.next_out=0,a.avail_out=f),p=t.deflate(a,m),p!==u&&p!==l)return this.onEnd(p),this.ended=!0,!1;(a.avail_out===0||a.avail_in===0&&(m===c||m===d))&&(this.options.to===`string`?this.onData(r.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||a.avail_out===0)&&p!==u);return m===c?(p=t.deflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===l):m!==d||(this.onEnd(l),a.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===l&&(this.result=this.options.to===`string`?this.chunks.join(``):n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function g(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||i[n.err];return n.result}function _(e,t){return t||={},t.raw=!0,g(e,t)}function v(e,t){return t||={},t.gzip=!0,g(e,t)}e.Deflate=h,e.deflate=g,e.deflateRaw=_,e.gzip=v})),Ce=t(((e,t)=>{t.exports=function(e,t){var n=e.state,r=e.next_in,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.input,E;i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,f=n.window,p=n.hold,m=n.bits,h=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;top:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];dolen:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b===0)E[a++]=y&65535;else if(b&16){x=y&65535,b&=15,b&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];dodist:for(;;){if(b=y>>>24,p>>>=b,m-=b,b=y>>>16&255,b&16){if(S=y&65535,b&=15,m<b&&(p+=T[r++]<<m,m+=8,m<b&&(p+=T[r++]<<m,m+=8)),S+=p&(1<<b)-1,S>c){e.msg=`invalid distance too far back`,n.mode=30;break top}if(p>>>=b,m-=b,b=a-o,S>b){if(b=S-b,b>u&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break top}if(C=0,w=f,d===0){if(C+=l-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,b-=d,b<x){x-=b;do E[a++]=f[C++];while(--b);if(C=0,d<x){b=d,x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}}}else if(C+=d-b,b<x){x-=b;do E[a++]=f[C++];while(--b);C=a-S,w=E}for(;x>2;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],x>1&&(E[a++]=w[C++]))}else{C=a-S;do E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],x-=3;while(x>2);x&&(E[a++]=E[C++],x>1&&(E[a++]=E[C++]))}}else if(b&64){e.msg=`invalid distance code`,n.mode=30;break top}else{y=g[(y&65535)+(p&(1<<b)-1)];continue dodist}break}}else if(!(b&64)){y=h[(y&65535)+(p&(1<<b)-1)];continue dolen}else if(b&32){n.mode=12;break top}else{e.msg=`invalid literal/length code`,n.mode=30;break top}break}}while(r<i&&a<s);x=m>>3,r-=x,m-=x<<3,p&=(1<<m)-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?5+(i-r):5-(r-i),e.avail_out=a<s?257+(s-a):257-(a-s),n.hold=p,n.bits=m}})),K=t(((e,t)=>{var n=V(),r=15,i=852,a=592,o=0,s=1,c=2,l=[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],u=[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],d=[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],f=[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];t.exports=function(e,t,p,m,h,g,_,v){var y=v.bits,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A,j,M,ee,te,ne=null,re=0,ie,ae=new n.Buf16(r+1),oe=new n.Buf16(r+1),se=null,ce=0,le,N,P;for(b=0;b<=r;b++)ae[b]=0;for(x=0;x<m;x++)ae[t[p+x]]++;for(w=y,C=r;C>=1&&ae[C]===0;C--);if(w>C&&(w=C),C===0)return h[g++]=20971520,h[g++]=20971520,v.bits=1,0;for(S=1;S<C&&ae[S]===0;S++);for(w<S&&(w=S),D=1,b=1;b<=r;b++)if(D<<=1,D-=ae[b],D<0)return-1;if(D>0&&(e===o||C!==1))return-1;for(oe[1]=0,b=1;b<r;b++)oe[b+1]=oe[b]+ae[b];for(x=0;x<m;x++)t[p+x]!==0&&(_[oe[t[p+x]]++]=x);if(e===o?(ne=se=_,ie=19):e===s?(ne=l,re-=257,se=u,ce-=257,ie=256):(ne=d,se=f,ie=-1),k=0,x=0,b=S,te=g,T=w,E=0,M=-1,O=1<<w,ee=O-1,e===s&&O>i||e===c&&O>a)return 1;for(;;){le=b-E,_[x]<ie?(N=0,P=_[x]):_[x]>ie?(N=se[ce+_[x]],P=ne[re+_[x]]):(N=96,P=0),A=1<<b-E,j=1<<T,S=j;do j-=A,h[te+(k>>E)+j]=le<<24|N<<16|P|0;while(j!==0);for(A=1<<b-1;k&A;)A>>=1;if(A===0?k=0:(k&=A-1,k+=A),x++,--ae[b]===0){if(b===C)break;b=t[p+_[x]]}if(b>w&&(k&ee)!==M){for(E===0&&(E=w),te+=S,T=b-E,D=1<<T;T+E<C&&(D-=ae[T+E],!(D<=0));)T++,D<<=1;if(O+=1<<T,e===s&&O>i||e===c&&O>a)return 1;M=k&ee,h[M]=w<<24|T<<16|te-g|0}}return k!==0&&(h[te+k]=b-E<<24|4194304),v.bits=w,0}})),we=t((e=>{var t=V(),n=U(),r=ye(),i=Ce(),a=K(),o=0,s=1,c=2,l=4,u=5,d=6,f=0,p=1,m=2,h=-2,g=-3,_=-4,v=-5,y=8,b=1,x=2,S=3,C=4,w=5,T=6,E=7,D=8,O=9,k=10,A=11,j=12,M=13,ee=14,te=15,ne=16,re=17,ie=18,ae=19,oe=20,se=21,ce=22,le=23,N=24,P=25,ue=26,de=27,fe=28,pe=29,F=30,I=31,me=32,he=852,L=592,R=15;function ge(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function _e(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function z(e){var n;return!e||!e.state?h:(n=e.state,e.total_in=e.total_out=n.total=0,e.msg=``,n.wrap&&(e.adler=n.wrap&1),n.mode=b,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new t.Buf32(he),n.distcode=n.distdyn=new t.Buf32(L),n.sane=1,n.back=-1,f)}function ve(e){var t;return!e||!e.state?h:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,z(e))}function B(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?h:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,ve(e))}function H(e,t){var n,r;return e?(r=new _e,e.state=r,r.window=null,n=B(e,t),n!==f&&(e.state=null),n):h}function W(e){return H(e,R)}var G=!0,be,xe;function Se(e){if(G){var n;for(be=new t.Buf32(512),xe=new t.Buf32(32),n=0;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(a(s,e.lens,0,288,be,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;a(c,e.lens,0,32,xe,0,e.work,{bits:5}),G=!1}e.lencode=be,e.lenbits=9,e.distcode=xe,e.distbits=5}function we(e,n,r,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new t.Buf8(o.wsize)),i>=o.wsize?(t.arraySet(o.window,n,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>i&&(a=i),t.arraySet(o.window,n,r-i,a,o.wnext),i-=a,i?(t.arraySet(o.window,n,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}function Te(e,he){var L,R,_e,z,ve,B,V,H,U,ye,W,G,be,xe,Ce=0,K,Te,Ee,De,Oe,ke,Ae,je,Me=new t.Buf8(4),Ne,Pe,Fe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return h;L=e.state,L.mode===j&&(L.mode=M),ve=e.next_out,_e=e.output,V=e.avail_out,z=e.next_in,R=e.input,B=e.avail_in,H=L.hold,U=L.bits,ye=B,W=V,je=f;inf_leave:for(;;)switch(L.mode){case b:if(L.wrap===0){L.mode=M;break}for(;U<16;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(L.wrap&2&&H===35615){L.check=0,Me[0]=H&255,Me[1]=H>>>8&255,L.check=r(L.check,Me,2,0),H=0,U=0,L.mode=x;break}if(L.flags=0,L.head&&(L.head.done=!1),!(L.wrap&1)||(((H&255)<<8)+(H>>8))%31){e.msg=`incorrect header check`,L.mode=F;break}if((H&15)!==y){e.msg=`unknown compression method`,L.mode=F;break}if(H>>>=4,U-=4,Ae=(H&15)+8,L.wbits===0)L.wbits=Ae;else if(Ae>L.wbits){e.msg=`invalid window size`,L.mode=F;break}L.dmax=1<<Ae,e.adler=L.check=1,L.mode=H&512?k:j,H=0,U=0;break;case x:for(;U<16;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(L.flags=H,(L.flags&255)!==y){e.msg=`unknown compression method`,L.mode=F;break}if(L.flags&57344){e.msg=`unknown header flags set`,L.mode=F;break}L.head&&(L.head.text=H>>8&1),L.flags&512&&(Me[0]=H&255,Me[1]=H>>>8&255,L.check=r(L.check,Me,2,0)),H=0,U=0,L.mode=S;case S:for(;U<32;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}L.head&&(L.head.time=H),L.flags&512&&(Me[0]=H&255,Me[1]=H>>>8&255,Me[2]=H>>>16&255,Me[3]=H>>>24&255,L.check=r(L.check,Me,4,0)),H=0,U=0,L.mode=C;case C:for(;U<16;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}L.head&&(L.head.xflags=H&255,L.head.os=H>>8),L.flags&512&&(Me[0]=H&255,Me[1]=H>>>8&255,L.check=r(L.check,Me,2,0)),H=0,U=0,L.mode=w;case w:if(L.flags&1024){for(;U<16;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}L.length=H,L.head&&(L.head.extra_len=H),L.flags&512&&(Me[0]=H&255,Me[1]=H>>>8&255,L.check=r(L.check,Me,2,0)),H=0,U=0}else L.head&&(L.head.extra=null);L.mode=T;case T:if(L.flags&1024&&(G=L.length,G>B&&(G=B),G&&(L.head&&(Ae=L.head.extra_len-L.length,L.head.extra||(L.head.extra=Array(L.head.extra_len)),t.arraySet(L.head.extra,R,z,G,Ae)),L.flags&512&&(L.check=r(L.check,R,G,z)),B-=G,z+=G,L.length-=G),L.length))break inf_leave;L.length=0,L.mode=E;case E:if(L.flags&2048){if(B===0)break inf_leave;G=0;do Ae=R[z+G++],L.head&&Ae&&L.length<65536&&(L.head.name+=String.fromCharCode(Ae));while(Ae&&G<B);if(L.flags&512&&(L.check=r(L.check,R,G,z)),B-=G,z+=G,Ae)break inf_leave}else L.head&&(L.head.name=null);L.length=0,L.mode=D;case D:if(L.flags&4096){if(B===0)break inf_leave;G=0;do Ae=R[z+G++],L.head&&Ae&&L.length<65536&&(L.head.comment+=String.fromCharCode(Ae));while(Ae&&G<B);if(L.flags&512&&(L.check=r(L.check,R,G,z)),B-=G,z+=G,Ae)break inf_leave}else L.head&&(L.head.comment=null);L.mode=O;case O:if(L.flags&512){for(;U<16;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(H!==(L.check&65535)){e.msg=`header crc mismatch`,L.mode=F;break}H=0,U=0}L.head&&(L.head.hcrc=L.flags>>9&1,L.head.done=!0),e.adler=L.check=0,L.mode=j;break;case k:for(;U<32;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}e.adler=L.check=ge(H),H=0,U=0,L.mode=A;case A:if(L.havedict===0)return e.next_out=ve,e.avail_out=V,e.next_in=z,e.avail_in=B,L.hold=H,L.bits=U,m;e.adler=L.check=1,L.mode=j;case j:if(he===u||he===d)break inf_leave;case M:if(L.last){H>>>=U&7,U-=U&7,L.mode=de;break}for(;U<3;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}switch(L.last=H&1,H>>>=1,--U,H&3){case 0:L.mode=ee;break;case 1:if(Se(L),L.mode=oe,he===d){H>>>=2,U-=2;break inf_leave}break;case 2:L.mode=re;break;case 3:e.msg=`invalid block type`,L.mode=F}H>>>=2,U-=2;break;case ee:for(H>>>=U&7,U-=U&7;U<32;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if((H&65535)!=(H>>>16^65535)){e.msg=`invalid stored block lengths`,L.mode=F;break}if(L.length=H&65535,H=0,U=0,L.mode=te,he===d)break inf_leave;case te:L.mode=ne;case ne:if(G=L.length,G){if(G>B&&(G=B),G>V&&(G=V),G===0)break inf_leave;t.arraySet(_e,R,z,G,ve),B-=G,z+=G,V-=G,ve+=G,L.length-=G;break}L.mode=j;break;case re:for(;U<14;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(L.nlen=(H&31)+257,H>>>=5,U-=5,L.ndist=(H&31)+1,H>>>=5,U-=5,L.ncode=(H&15)+4,H>>>=4,U-=4,L.nlen>286||L.ndist>30){e.msg=`too many length or distance symbols`,L.mode=F;break}L.have=0,L.mode=ie;case ie:for(;L.have<L.ncode;){for(;U<3;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}L.lens[Fe[L.have++]]=H&7,H>>>=3,U-=3}for(;L.have<19;)L.lens[Fe[L.have++]]=0;if(L.lencode=L.lendyn,L.lenbits=7,Ne={bits:L.lenbits},je=a(o,L.lens,0,19,L.lencode,0,L.work,Ne),L.lenbits=Ne.bits,je){e.msg=`invalid code lengths set`,L.mode=F;break}L.have=0,L.mode=ae;case ae:for(;L.have<L.nlen+L.ndist;){for(;Ce=L.lencode[H&(1<<L.lenbits)-1],K=Ce>>>24,Te=Ce>>>16&255,Ee=Ce&65535,!(K<=U);){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(Ee<16)H>>>=K,U-=K,L.lens[L.have++]=Ee;else{if(Ee===16){for(Pe=K+2;U<Pe;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(H>>>=K,U-=K,L.have===0){e.msg=`invalid bit length repeat`,L.mode=F;break}Ae=L.lens[L.have-1],G=3+(H&3),H>>>=2,U-=2}else if(Ee===17){for(Pe=K+3;U<Pe;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}H>>>=K,U-=K,Ae=0,G=3+(H&7),H>>>=3,U-=3}else{for(Pe=K+7;U<Pe;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}H>>>=K,U-=K,Ae=0,G=11+(H&127),H>>>=7,U-=7}if(L.have+G>L.nlen+L.ndist){e.msg=`invalid bit length repeat`,L.mode=F;break}for(;G--;)L.lens[L.have++]=Ae}}if(L.mode===F)break;if(L.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,L.mode=F;break}if(L.lenbits=9,Ne={bits:L.lenbits},je=a(s,L.lens,0,L.nlen,L.lencode,0,L.work,Ne),L.lenbits=Ne.bits,je){e.msg=`invalid literal/lengths set`,L.mode=F;break}if(L.distbits=6,L.distcode=L.distdyn,Ne={bits:L.distbits},je=a(c,L.lens,L.nlen,L.ndist,L.distcode,0,L.work,Ne),L.distbits=Ne.bits,je){e.msg=`invalid distances set`,L.mode=F;break}if(L.mode=oe,he===d)break inf_leave;case oe:L.mode=se;case se:if(B>=6&&V>=258){e.next_out=ve,e.avail_out=V,e.next_in=z,e.avail_in=B,L.hold=H,L.bits=U,i(e,W),ve=e.next_out,_e=e.output,V=e.avail_out,z=e.next_in,R=e.input,B=e.avail_in,H=L.hold,U=L.bits,L.mode===j&&(L.back=-1);break}for(L.back=0;Ce=L.lencode[H&(1<<L.lenbits)-1],K=Ce>>>24,Te=Ce>>>16&255,Ee=Ce&65535,!(K<=U);){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(Te&&!(Te&240)){for(De=K,Oe=Te,ke=Ee;Ce=L.lencode[ke+((H&(1<<De+Oe)-1)>>De)],K=Ce>>>24,Te=Ce>>>16&255,Ee=Ce&65535,!(De+K<=U);){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}H>>>=De,U-=De,L.back+=De}if(H>>>=K,U-=K,L.back+=K,L.length=Ee,Te===0){L.mode=ue;break}if(Te&32){L.back=-1,L.mode=j;break}if(Te&64){e.msg=`invalid literal/length code`,L.mode=F;break}L.extra=Te&15,L.mode=ce;case ce:if(L.extra){for(Pe=L.extra;U<Pe;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}L.length+=H&(1<<L.extra)-1,H>>>=L.extra,U-=L.extra,L.back+=L.extra}L.was=L.length,L.mode=le;case le:for(;Ce=L.distcode[H&(1<<L.distbits)-1],K=Ce>>>24,Te=Ce>>>16&255,Ee=Ce&65535,!(K<=U);){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(!(Te&240)){for(De=K,Oe=Te,ke=Ee;Ce=L.distcode[ke+((H&(1<<De+Oe)-1)>>De)],K=Ce>>>24,Te=Ce>>>16&255,Ee=Ce&65535,!(De+K<=U);){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}H>>>=De,U-=De,L.back+=De}if(H>>>=K,U-=K,L.back+=K,Te&64){e.msg=`invalid distance code`,L.mode=F;break}L.offset=Ee,L.extra=Te&15,L.mode=N;case N:if(L.extra){for(Pe=L.extra;U<Pe;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}L.offset+=H&(1<<L.extra)-1,H>>>=L.extra,U-=L.extra,L.back+=L.extra}if(L.offset>L.dmax){e.msg=`invalid distance too far back`,L.mode=F;break}L.mode=P;case P:if(V===0)break inf_leave;if(G=W-V,L.offset>G){if(G=L.offset-G,G>L.whave&&L.sane){e.msg=`invalid distance too far back`,L.mode=F;break}G>L.wnext?(G-=L.wnext,be=L.wsize-G):be=L.wnext-G,G>L.length&&(G=L.length),xe=L.window}else xe=_e,be=ve-L.offset,G=L.length;G>V&&(G=V),V-=G,L.length-=G;do _e[ve++]=xe[be++];while(--G);L.length===0&&(L.mode=se);break;case ue:if(V===0)break inf_leave;_e[ve++]=L.length,V--,L.mode=se;break;case de:if(L.wrap){for(;U<32;){if(B===0)break inf_leave;B--,H|=R[z++]<<U,U+=8}if(W-=V,e.total_out+=W,L.total+=W,W&&(e.adler=L.check=L.flags?r(L.check,_e,W,ve-W):n(L.check,_e,W,ve-W)),W=V,(L.flags?H:ge(H))!==L.check){e.msg=`incorrect data check`,L.mode=F;break}H=0,U=0}L.mode=fe;case fe:if(L.wrap&&L.flags){for(;U<32;){if(B===0)break inf_leave;B--,H+=R[z++]<<U,U+=8}if(H!==(L.total&4294967295)){e.msg=`incorrect length check`,L.mode=F;break}H=0,U=0}L.mode=pe;case pe:je=p;break inf_leave;case F:je=g;break inf_leave;case I:return _;case me:default:return h}return e.next_out=ve,e.avail_out=V,e.next_in=z,e.avail_in=B,L.hold=H,L.bits=U,(L.wsize||W!==e.avail_out&&L.mode<F&&(L.mode<de||he!==l))&&we(e,e.output,e.next_out,W-e.avail_out)?(L.mode=I,_):(ye-=e.avail_in,W-=e.avail_out,e.total_in+=ye,e.total_out+=W,L.total+=W,L.wrap&&W&&(e.adler=L.check=L.flags?r(L.check,_e,W,e.next_out-W):n(L.check,_e,W,e.next_out-W)),e.data_type=L.bits+(L.last?64:0)+(L.mode===j?128:0)+(L.mode===oe||L.mode===te?256:0),(ye===0&&W===0||he===l)&&je===f&&(je=v),je)}function Ee(e){if(!e||!e.state)return h;var t=e.state;return t.window&&=null,e.state=null,f}function De(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?h:(n.head=t,t.done=!1,f)}function Oe(e,t){var r=t.length,i,a,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==A)?h:i.mode===A&&(a=1,a=n(a,t,r,0),a!==i.check)?g:(o=we(e,t,r,r),o?(i.mode=I,_):(i.havedict=1,f))}e.inflateReset=ve,e.inflateReset2=B,e.inflateResetKeep=z,e.inflateInit=W,e.inflateInit2=H,e.inflate=Te,e.inflateEnd=Ee,e.inflateGetHeader=De,e.inflateSetDictionary=Oe,e.inflateInfo=`pako inflate (from Nodeca project)`})),Te=t(((e,t)=>{t.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}})),Ee=t(((e,t)=>{function n(){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}t.exports=n})),De=t((e=>{var t=we(),n=V(),r=be(),i=Te(),a=W(),o=xe(),s=Ee(),c=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:``},e||{});var u=this.options;u.raw&&u.windowBits>=0&&u.windowBits<16&&(u.windowBits=-u.windowBits,u.windowBits===0&&(u.windowBits=-15)),u.windowBits>=0&&u.windowBits<16&&!(e&&e.windowBits)&&(u.windowBits+=32),u.windowBits>15&&u.windowBits<48&&(u.windowBits&15||(u.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var d=t.inflateInit2(this.strm,u.windowBits);if(d!==i.Z_OK||(this.header=new s,t.inflateGetHeader(this.strm,this.header),u.dictionary&&(typeof u.dictionary==`string`?u.dictionary=r.string2buf(u.dictionary):c.call(u.dictionary)===`[object ArrayBuffer]`&&(u.dictionary=new Uint8Array(u.dictionary)),u.raw&&(d=t.inflateSetDictionary(this.strm,u.dictionary),d!==i.Z_OK))))throw Error(a[d])}l.prototype.push=function(e,a){var o=this.strm,s=this.options.chunkSize,l=this.options.dictionary,u,d,f,p,m,h=!1;if(this.ended)return!1;d=a===~~a?a:a===!0?i.Z_FINISH:i.Z_NO_FLUSH,o.input=typeof e==`string`?r.binstring2buf(e):c.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new n.Buf8(s),o.next_out=0,o.avail_out=s),u=t.inflate(o,i.Z_NO_FLUSH),u===i.Z_NEED_DICT&&l&&(u=t.inflateSetDictionary(this.strm,l)),u===i.Z_BUF_ERROR&&h===!0&&(u=i.Z_OK,h=!1),u!==i.Z_STREAM_END&&u!==i.Z_OK)return this.onEnd(u),this.ended=!0,!1;o.next_out&&(o.avail_out===0||u===i.Z_STREAM_END||o.avail_in===0&&(d===i.Z_FINISH||d===i.Z_SYNC_FLUSH))&&(this.options.to===`string`?(f=r.utf8border(o.output,o.next_out),p=o.next_out-f,m=r.buf2string(o.output,f),o.next_out=p,o.avail_out=s-p,p&&n.arraySet(o.output,o.output,f,p,0),this.onData(m)):this.onData(n.shrinkBuf(o.output,o.next_out))),o.avail_in===0&&o.avail_out===0&&(h=!0)}while((o.avail_in>0||o.avail_out===0)&&u!==i.Z_STREAM_END);return u===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(u=t.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===i.Z_OK):d!==i.Z_SYNC_FLUSH||(this.onEnd(i.Z_OK),o.avail_out=0,!0)},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){e===i.Z_OK&&(this.result=this.options.to===`string`?this.chunks.join(``):n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function u(e,t){var n=new l(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}function d(e,t){return t||={},t.raw=!0,u(e,t)}e.Inflate=l,e.inflate=u,e.inflateRaw=d,e.ungzip=u})),Oe=t(((e,t)=>{var n=V().assign,r=Se(),i=De(),a=Te(),o={};n(o,r,i,a),t.exports=o})),ke=t(((e,t)=>{var n=(e,t)=>function(...n){let r=t.promiseModule;return new r((r,i)=>{t.multiArgs?n.push((...e)=>{t.errorFirst?e[0]?i(e):(e.shift(),r(e)):r(e)}):t.errorFirst?n.push((e,t)=>{e?i(e):r(t)}):n.push(r),e.apply(this,n)})};t.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=typeof e;if(e===null||r!==`object`&&r!==`function`)throw TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?`null`:r}\``);let i=e=>{let n=t=>typeof t==`string`?e===t:t.test(e);return t.include?t.include.some(n):!t.exclude.some(n)},a;a=r===`function`?function(...r){return t.excludeMain?e(...r):n(e,t).apply(this,r)}:Object.create(Object.getPrototypeOf(e));for(let r in e){let o=e[r];a[r]=typeof o==`function`&&i(r)?n(o,t):o}return a}})),Ae=t(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}var r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.*\/|^\.+$/,l=`node-ignore`;typeof Symbol<`u`&&(l=Symbol.for(`node-ignore`));var u=l,d=(e,t,n)=>Object.defineProperty(e,t,{value:n}),f=/([0-z])-([0-z])/g,p=()=>!1,m=e=>e.replace(f,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),h=e=>{let{length:t}=e;return e.slice(0,t-t%2)},g=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${h(r)}${i}`:i===`]`&&r.length%2==0?`[${m(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],_=Object.create(null),v=(e,t)=>{let n=_[e];return n||(n=g.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),_[e]=n),t?new RegExp(n,`i`):new RegExp(n)},y=e=>typeof e==`string`,b=e=>e&&y(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,x=e=>e.split(s),S=class{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}},C=(e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(a,`!`).replace(o,`#`);let i=v(e,t);return new S(n,e,r,i)},w=(e,t)=>{throw new t(e)},T=(e,t,n)=>y(e)?e?!T.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),E=e=>c.test(e);T.isNotRelative=E,T.convert=e=>e;var D=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){d(this,u,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[u]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(b(e)){let t=C(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(y(e)?x(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&T.convert(e);return T(i,e,this._allowRelativePaths?p:w),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},O=e=>new D(e);if(O.isPathValid=e=>T(e&&T.convert(e),e,p),O.default=O,t.exports=O,typeof process<`u`&&({}.IGNORE_TEST_WIN32||process.platform===`win32`)){T.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;T.isNotRelative=t=>e.test(t)||E(t)}})),je=t(((e,t)=>{function n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function r(e,t,r){return t=t instanceof RegExp?t:new RegExp(n(t),`g`),e.replace(t,r)}t.exports={clean:function(e){if(typeof e!=`string`)throw Error(`Expected a string, received: `+e);return e=r(e,`./`,`/`),e=r(e,`..`,`.`),e=r(e,` `,`-`),e=r(e,/^[~^:?*\\\-]/g,``),e=r(e,/[~^:?*\\]/g,`-`),e=r(e,/[~^:?*\\\-]$/g,``),e=r(e,`@{`,`-`),e=r(e,/\.$/g,``),e=r(e,/\/$/g,``),e=r(e,/\.lock$/g,``),e}}})),Me=t(((e,t)=>{t.exports=function(e,t){var n=e,r=t,i=n.length,a=r.length,o=!1,s=null,c=i+1,l=[],u=[],d=[],f=``,p=-1,m=0,h=1,g,_,v=function(){i>=a&&(g=n,_=i,n=r,r=g,i=a,a=_,o=!0,c=i+1)},y=function(e,t,n){return{x:e,y:t,k:n}},b=function(e,t){return{elem:e,t}},x=function(e,t,o){var s=t>o?l[e-1+c]:l[e+1+c],d,f=Math.max(t,o);for(d=f-e;d<i&&f<a&&n[d]===r[f];)++d,++f;return l[e+c]=u.length,u[u.length]=new y(d,f,s),f},S=function(e){var t=i=1,i,a=s=0,s,c;for(c=e.length-1;c>=0;--c)for(;a<e[c].x||s<e[c].y;)e[c].y-e[c].x>s-a?(o?d[d.length]=new b(r[s],p):d[d.length]=new b(r[s],h),++i,++s):e[c].y-e[c].x<s-a?(o?d[d.length]=new b(n[a],h):d[d.length]=new b(n[a],p),++t,++a):(d[d.length]=new b(n[a],m),f+=n[a],++t,++i,++a,++s)};return v(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return s},getlcs:function(){return f},getses:function(){return d},compose:function(){var e=a-i,t=i+a+3,n={},r,o,d,f,p;for(f=0;f<t;++f)n[f]=-1,l[f]=-1;r=-1;do{for(++r,p=-r;p<=e-1;++p)n[p+c]=x(p,n[p-1+c]+1,n[p+1+c]);for(p=e+r;p>=e+1;--p)n[p+c]=x(p,n[p-1+c]+1,n[p+1+c]);n[e+c]=x(e,n[e-1+c]+1,n[e+1+c])}while(n[e+c]!==a);for(s=e+2*r,o=l[e+c],d=[];o!==-1;)d[d.length]=new y(u[o].x,u[o].y,null),o=u[o].k;S(d)}}}})),Ne=t(((e,t)=>{var n=Me();function r(e,t){var r=new n(e,t);r.compose();for(var i=r.getses(),a,o,s=e.length-1,c=t.length-1,l=i.length-1;l>=0;--l)i[l].t===r.SES_COMMON?(o?(o.chain={file1index:s,file2index:c,chain:null},o=o.chain):(a={file1index:s,file2index:c,chain:null},o=a),s--,c--):i[l].t===r.SES_DELETE?s--:i[l].t===r.SES_ADD&&c--;var u={file1index:-1,file2index:-1,chain:null};return o?(o.chain=u,a):u}function i(e,t){for(var n=[],i=e.length,a=t.length,o=r(e,t);o!==null;o=o.chain){var s=i-o.file1index-1,c=a-o.file2index-1;i=o.file1index,a=o.file2index,(s||c)&&n.push({file1:[i+1,s],file2:[a+1,c]})}return n.reverse(),n}function a(e,t,n){var r,a=i(t,e),o=i(t,n),s=[];function c(e,t){s.push([e.file1[0],t,e.file1[1],e.file2[0],e.file2[1]])}for(r=0;r<a.length;r++)c(a[r],0);for(r=0;r<o.length;r++)c(o[r],2);s.sort(function(e,t){return e[0]-t[0]});var l=[],u=0;function d(e){e>u&&(l.push([1,u,e-u]),u=e)}for(var f=0;f<s.length;f++){for(var p=f,m=s[f],h=m[0],g=h+m[2];f<s.length-1;){var _=s[f+1],v=_[0];if(v>g)break;g=Math.max(g,v+_[2]),f++}if(d(h),p==f)m[4]>0&&l.push([m[1],m[3],m[4]]);else{var y={0:[e.length,-1,t.length,-1],2:[n.length,-1,t.length,-1]};for(r=p;r<=f;r++){m=s[r];var b=y[m[1]],x=m[0],S=x+m[2],C=m[3],w=C+m[4];b[0]=Math.min(C,b[0]),b[1]=Math.max(w,b[1]),b[2]=Math.min(x,b[2]),b[3]=Math.max(S,b[3])}var T=y[0][0]+(h-y[0][2]),E=y[0][1]+(g-y[0][3]),D=y[2][0]+(h-y[2][2]),O=y[2][1]+(g-y[2][3]);l.push([-1,T,E-T,h,g-h,D,O-D])}u=g}return d(t.length),l}function o(e,t,n){var r=[],i=[e,t,n],o=a(e,t,n),s=[];function c(){s.length&&r.push({ok:s}),s=[]}function l(e){for(var t=0;t<e.length;t++)s.push(e[t])}function u(t){if(t[2]!=t[6])return!0;for(var r=t[1],i=t[5],a=0;a<t[2];a++)if(e[a+r]!=n[a+i])return!0;return!1}for(var d=0;d<o.length;d++){var f=o[d],p=f[0];p==-1?u(f)?(c(),r.push({conflict:{a:e.slice(f[1],f[1]+f[2]),aIndex:f[1],o:t.slice(f[3],f[3]+f[4]),oIndex:f[3],b:n.slice(f[5],f[5]+f[6]),bIndex:f[5]}})):l(i[0].slice(f[1],f[1]+f[2])):l(i[p].slice(f[1],f[1]+f[2]))}return c(),r}t.exports=o})),Pe=e(_e(),1),Fe=e(ve(),1),Ie=e(B(),1),Le=e(Oe(),1),Re=e(ke(),1),ze=e(Ae(),1),Be=e(je(),1),Ve=e(Ne(),1),q=class e 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(t){let n=new e(t.message);return n.code=t.code,n.data=t.data,n.caller=t.caller,n.stack=t.stack,n}get isIsomorphicGitError(){return!0}},He=class e extends q{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.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=e.code,this.data={filepaths:t}}};He.code=`UnmergedPathsError`;var J=class e extends q{constructor(t){super(`An internal error caused this command to fail.\n\nIf you're using an application that depends on isomorphic-git, please report this error to that application's developers.\n\nIf you're a developer and you believe this is a bug in isomorphic-git, please file an issue at https://github.com/isomorphic-git/isomorphic-git/issues with a minimal reproduction, version and environment details, and this error message: ${t}`),this.code=this.name=e.code,this.data={message:t}}};J.code=`InternalError`;var Ue=class e extends q{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=e.code,this.data={filepath:t}}};Ue.code=`UnsafeFilepathError`;var We=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let t=this.buffer.slice(this._start,this._start+e);return this._start+=e,t}toString(e,t){let n=this.buffer.toString(e,this._start,this._start+t);return this._start+=t,n}write(e,t,n){let r=this.buffer.write(e,this._start,t,n);return this._start+=t,r}copy(e,t,n){let r=e.copy(this.buffer,this._start,t,n);return this._start+=r,r}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let t=this.buffer.writeUInt8(e,this._start);return this._start+=1,t}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let t=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,t}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let t=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,t}};function Ge(e,t){return-(e<t)||+(e>t)}function Ke(e,t){return Ge(e.path,t.path)}function qe(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let n=e&511;return n=n&73?493:420,t!==8&&(n=0),(t<<12)+n}var Je=2**32;function Ye(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];n===void 0&&(n=r.valueOf());let i=Math.floor(n/1e3);return[i,(n-i*1e3)*1e6]}function Xe(e){let[t,n]=Ye(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[r,i]=Ye(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%Je,ctimeNanoseconds:n%Je,mtimeSeconds:r%Je,mtimeNanoseconds:i%Je,dev:e.dev%Je,ino:e.ino%Je,mode:qe(e.mode%Je),uid:e.uid%Je,gid:e.gid%Je,size:e.size>-1?e.size%Je:0}}function Ze(e){let t=``;for(let n of new Uint8Array(e))n<16&&(t+=`0`),t+=n.toString(16);return t}var Qe=null;async function $e(e){return Qe===null&&(Qe=await nt()),Qe?tt(e):et(e)}function et(e){return new Pe.default().update(e).digest(`hex`)}async function tt(e){return Ze(await crypto.subtle.digest(`SHA-1`,e))}async function nt(){try{return await tt(new Uint8Array([]))===`da39a3ee5e6b4b0d3255bfef95601890afd80709`}catch{}return!1}function rt(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function it(e){let t=e.flags;return t.extended=!1,t.nameLength=Math.min(Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}var at=class e{constructor(e,t){this._dirty=!1,this._unmergedPaths=t||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let t=this._entries.get(e.path);t||=(this._entries.set(e.path,e),e),t.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(t){if(Buffer.isBuffer(t))return e.fromBuffer(t);if(t===null)return new e(null);throw new J(`invalid type passed to GitIndex.from`)}static async fromBuffer(t){if(t.length===0)throw new J(`Index file is empty (.git/index)`);let n=new e,r=new We(t),i=r.toString(`utf8`,4);if(i!==`DIRC`)throw new J(`Invalid dircache magic file number: ${i}`);let a=await $e(t.slice(0,-20)),o=t.slice(-20).toString(`hex`);if(o!==a)throw new J(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${a}`);let s=r.readUInt32BE();if(s!==2)throw new J(`Unsupported dircache version: ${s}`);let c=r.readUInt32BE(),l=0;for(;!r.eof()&&l<c;){let e={};e.ctimeSeconds=r.readUInt32BE(),e.ctimeNanoseconds=r.readUInt32BE(),e.mtimeSeconds=r.readUInt32BE(),e.mtimeNanoseconds=r.readUInt32BE(),e.dev=r.readUInt32BE(),e.ino=r.readUInt32BE(),e.mode=r.readUInt32BE(),e.uid=r.readUInt32BE(),e.gid=r.readUInt32BE(),e.size=r.readUInt32BE(),e.oid=r.slice(20).toString(`hex`),e.flags=rt(r.readUInt16BE());let i=t.indexOf(0,r.tell()+1)-r.tell();if(i<1)throw new J(`Got a path length of: ${i}`);if(e.path=r.toString(`utf8`,i),e.path.includes(`..\\`)||e.path.includes(`../`))throw new Ue(e.path);let a=8-(r.tell()-12)%8;for(a===0&&(a=8);a--;){let t=r.readUInt8();if(t!==0)throw new J(`Expected 1-8 null characters but got '${t}' after ${e.path}`);if(r.eof())throw new J(`Unexpected end of file`)}e.stages=[],n._addEntry(e),l++}return n}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(Ke)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(e=>e):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:t,oid:n,stage:r=0}){t||={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0},t=Xe(t);let i=Buffer.from(e),a={ctimeSeconds:t.ctimeSeconds,ctimeNanoseconds:t.ctimeNanoseconds,mtimeSeconds:t.mtimeSeconds,mtimeNanoseconds:t.mtimeNanoseconds,dev:t.dev,ino:t.ino,mode:t.mode||33188,uid:t.uid,gid:t.gid,size:t.size,path:e,oid:n,flags:{assumeValid:!1,extended:!1,stage:r,nameLength:i.length<4095?i.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let t of this._entries.keys())t.startsWith(e+`/`)&&this._entries.delete(t);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(`
|
|
2
|
+
`)}static async _entryToBuffer(e){let t=Buffer.from(e.path),n=Math.ceil((62+t.length+1)/8)*8,r=Buffer.alloc(n),i=new We(r),a=Xe(e);return i.writeUInt32BE(a.ctimeSeconds),i.writeUInt32BE(a.ctimeNanoseconds),i.writeUInt32BE(a.mtimeSeconds),i.writeUInt32BE(a.mtimeNanoseconds),i.writeUInt32BE(a.dev),i.writeUInt32BE(a.ino),i.writeUInt32BE(a.mode),i.writeUInt32BE(a.uid),i.writeUInt32BE(a.gid),i.writeUInt32BE(a.size),i.write(e.oid,20,`hex`),i.writeUInt16BE(it(e)),i.write(e.path,t.length,`utf8`),r}async toObject(){let t=Buffer.alloc(12),n=new We(t);n.write(`DIRC`,4,`utf8`),n.writeUInt32BE(2),n.writeUInt32BE(this.entriesFlat.length);let r=[];for(let t of this.entries)if(r.push(e._entryToBuffer(t)),t.stages.length>1)for(let n of t.stages)n&&n!==t&&r.push(e._entryToBuffer(n));r=await Promise.all(r);let i=Buffer.concat(r),a=Buffer.concat([t,i]),o=await $e(a);return Buffer.concat([a,Buffer.from(o,`hex`)])}};function ot(e,t,n=!0,r=!0){let i=Xe(e),a=Xe(t);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 st;function ct(){return st===void 0&&(st=new Fe.default({maxPending:1/0})),st}function lt(e,t){return ct().acquire(e,t)}var ut=Symbol(`IndexCache`);function dt(){return{map:new Map,stats:new Map}}async function ft(e,t,n){let[r,i]=await Promise.all([e.lstat(t),e.read(t)]),a=await at.from(i);n.map.set(t,a),n.stats.set(t,r)}async function pt(e,t,n){let r=n.stats.get(t);if(r===void 0)return!0;if(r===null)return!1;let i=await e.lstat(t);return i!==null&&ot(r,i)}var mt=class{static async acquire({fs:e,gitdir:t,cache:n,allowUnmerged:r=!0},i){n[ut]||(n[ut]=dt());let a=`${t}/index`,o,s=[];return await lt(a,async()=>{let t=n[ut];await pt(e,a,t)&&await ft(e,a,t);let c=t.map.get(a);if(s=c.unmergedPaths,s.length&&!r)throw new He(s);if(o=await i(c),c._dirty){let n=await c.toObject();await e.write(a,n),t.stats.set(a,await e.lstat(a)),c._dirty=!1}}),o}};function ht(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>-1&&(e=e.slice(t+1)),e}function gt(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t===-1?`.`:t===0?`/`:e.slice(0,t)}function _t(e){let t=new Map,n=function(e){if(!t.has(e)){let r={type:`tree`,fullpath:e,basename:ht(e),metadata:{},children:[]};t.set(e,r),r.parent=n(gt(e)),r.parent&&r.parent!==r&&r.parent.children.push(r)}return t.get(e)},r=function(e,r){if(!t.has(e)){let i={type:`blob`,fullpath:e,basename:ht(e),metadata:r,parent:n(gt(e)),children:[]};i.parent&&i.parent.children.push(i),t.set(e,i)}return t.get(e)};n(`.`);for(let t of e)r(t.path,t);return t}function vt(e){switch(e){case 16384:return`tree`;case 33188:return`blob`;case 33261:return`blob`;case 40960:return`blob`;case 57344:return`commit`}throw new J(`Unexpected GitTree entry mode: ${e.toString(8)}`)}var yt=class{constructor({fs:e,gitdir:t,cache:n}){this.treePromise=mt.acquire({fs:e,gitdir:t,cache:n},async function(e){return _t(e.entries)});let r=this;this.ConstructEntry=class{constructor(e){this._fullpath=e,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return r.type(this)}async mode(){return r.mode(this)}async stat(){return r.stat(this)}async content(){return r.content(this)}async oid(){return r.oid(this)}}}async readdir(e){let t=e._fullpath,n=(await this.treePromise).get(t);if(!n||n.type===`blob`)return null;if(n.type!==`tree`)throw Error(`ENOTDIR: not a directory, scandir '${t}'`);let r=n.children.map(e=>e.fullpath);return r.sort(Ge),r}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 t=(await this.treePromise).get(e._fullpath);if(!t)throw Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=t.type===`tree`?{}:Xe(t.metadata);e._type=t.type===`tree`?`tree`:vt(n.mode),e._mode=n.mode,e._stat=t.type===`tree`?void 0:n}return e._stat}async content(e){}async oid(e){return e._oid===!1&&(e._oid=(await this.treePromise).get(e._fullpath).metadata.oid),e._oid}},bt=Symbol(`GitWalkSymbol`);function xt(){let e=Object.create(null);return Object.defineProperty(e,bt,{value:function({fs:e,gitdir:t,cache:n}){return new yt({fs:e,gitdir:t,cache:n})}}),Object.freeze(e),e}var St=class e extends q{constructor(t){super(`Could not find ${t}.`),this.code=this.name=e.code,this.data={what:t}}};St.code=`NotFoundError`;var Ct=class e extends q{constructor(t,n,r,i){super(`Object ${t} ${i?`at ${i}`:``}was anticipated to be a ${r} but it is a ${n}.`),this.code=this.name=e.code,this.data={oid:t,actual:n,expected:r,filepath:i}}};Ct.code=`ObjectTypeError`;var wt=class e extends q{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=e.code,this.data={value:t}}};wt.code=`InvalidOidError`;var Tt=class e extends q{constructor(t,n){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${n}".)`),this.code=this.name=e.code,this.data={ref:t,suggestion:n}}};Tt.code=`InvalidRefNameError`;var Et=class e extends q{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
|
|
3
|
+
[remote "${t}"]
|
|
4
|
+
\tfetch = +refs/heads/*:refs/remotes/origin/*
|
|
5
|
+
`),this.code=this.name=e.code,this.data={remote:t}}};Et.code=`NoRefspecError`;var Dt=class e{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let t=null;this.parsedConfig=e.trim().split(`
|
|
6
|
+
`).map(e=>{if(/^\s*#/.test(e))return{line:e,comment:!0};let n=e.indexOf(` `);if(e.startsWith(`^`)){let n=e.slice(1);return this.refs.set(t+`^{}`,n),{line:e,ref:t,peeled:n}}{let r=e.slice(0,n);return t=e.slice(n+1),this.refs.set(t,r),{line:e,ref:t,oid:r}}})}return this}static from(t){return new e(t)}delete(e){this.parsedConfig=this.parsedConfig.filter(t=>t.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(`
|
|
7
|
+
`)+`
|
|
8
|
+
`}},Ot=class e{constructor({remotePath:e,localPath:t,force:n,matchPrefix:r}){Object.assign(this,{remotePath:e,localPath:t,force:n,matchPrefix:r})}static from(t){let[n,r,i,a,o]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s=n===`+`,c=i===`*`;if(c!==(o===`*`))throw new J(`Invalid refspec`);return new e({remotePath:r,localPath:a,force:s,matchPrefix:c})}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}},kt=class e{constructor(e=[]){this.rules=e}static from(t){let n=[];for(let e of t)n.push(Ot.from(e));return new e(n)}add(e){let t=Ot.from(e);this.rules.push(t)}translate(e){let t=[];for(let n of this.rules)for(let r of e){let e=n.translate(r);e&&t.push([r,e])}return t}translateOne(e){let t=null;for(let n of this.rules){let r=n.translate(e);r&&(t=r)}return t}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,``))}};function At(e,t){let n=e.replace(/\^\{\}$/,``),r=t.replace(/\^\{\}$/,``),i=-(n<r)||+(n>r);return i===0?e.endsWith(`^{}`)?1:-1:i}function jt(e,t){let n=``,r=0,i=-1,a=0,o=`\0`;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n.at(-1)!==`.`||n.at(-2)!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length!==0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function Mt(e){return e.length>=2&&/^[a-zA-Z]:/.test(e)?e.slice(0,2):null}function Nt(e){if(!e.length)return`.`;e=e.replace(/\\/g,`/`);let t=Mt(e),n=e[0]===`/`||t!==null&&e[2]===`/`,r=e.at(-1)===`/`,i=jt(t?e.slice(2):e,!n);if(!i.length){let e=t?n?t+`/`:t:n?`/`:`.`;return r&&!n?e+`/`:e}return r&&(i+=`/`),t?n?`${t}/${i}`:`${t}${i}`:n?`/${i}`:i}function Y(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n].replace(/\\/g,`/`);r.length!==0&&(/^[a-zA-Z]:\//.test(r)||t===void 0?t=r:t+=`/`+r)}return t===void 0?`.`:Nt(t)}var Pt=e=>{if(typeof e==`number`)return e;e=e.toLowerCase();let t=parseInt(e);return e.endsWith(`k`)&&(t*=1024),e.endsWith(`m`)&&(t*=1048576),e.endsWith(`g`)&&(t*=1073741824),t},Ft=e=>{if(typeof e==`boolean`)return e;if(e=e.trim().toLowerCase(),e===`true`||e===`yes`||e===`on`)return!0;if(e===`false`||e===`no`||e===`off`)return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${e}`)},It={core:{filemode:Ft,bare:Ft,logallrefupdates:Ft,symlinks:Ft,ignorecase:Ft,bigFileThreshold:Pt}},Lt=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,Rt=/^[A-Za-z0-9-.]+$/,zt=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,Bt=/^[A-Za-z][A-Za-z-]*$/,Vt=/^(.*?)( *[#;].*)$/,Ht=e=>{let t=Lt.exec(e);if(t!=null){let[e,n]=t.slice(1);return[e,n]}return null},Ut=e=>{let t=zt.exec(e);if(t!=null){let[e,n=`true`]=t.slice(1);return[e,Kt(Wt(n))]}return null},Wt=e=>{let t=Vt.exec(e);if(t==null)return e;let[n,r]=t.slice(1);return Gt(n)&&Gt(r)?`${n}${r}`:n},Gt=e=>(e.match(/(?:^|[^\\])"/g)||[]).length%2!=0,Kt=e=>e.split(``).reduce((e,t,n,r)=>{let i=t===`"`&&r[n-1]!==`\\`,a=t===`\\`&&r[n+1]===`"`;return i||a?e:e+t},``),qt=e=>e==null?null:e.toLowerCase(),Jt=(e,t,n)=>[qt(e),t,qt(n)].filter(e=>e!=null).join(`.`),Yt=e=>{let t=e.split(`.`),n=t.shift(),r=t.pop(),i=t.length?t.join(`.`):void 0;return{section:n,subsection:i,name:r,path:Jt(n,i,r),sectionPath:Jt(n,i,null),isSection:!!n}},Xt=(e,t)=>e.reduce((e,n,r)=>t(n)?r:e,-1),Zt=class e{constructor(e){let t=null,n=null;this.parsedConfig=e?e.split(`
|
|
9
|
+
`).map(e=>{let r=null,i=null,a=e.trim(),o=Ht(a),s=o!=null;if(s)[t,n]=o;else{let e=Ut(a);e!=null&&([r,i]=e)}let c=Jt(t,n,r);return{line:e,isSection:s,section:t,subsection:n,name:r,value:i,path:c}}):[]}static from(t){return new e(t)}async get(e,t=!1){let n=Yt(e).path,r=this.parsedConfig.filter(e=>e.path===n).map(({section:e,name:t,value:n})=>{let r=It[e]&&It[e][t];return r?r(n):n});return t?r:r.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(t=>t.isSection&&t.section===e).map(e=>e.subsection)}async deleteSection(e,t){this.parsedConfig=this.parsedConfig.filter(n=>n.section!==e||n.subsection!==t)}async append(e,t){return this.set(e,t,!0)}async set(e,t,n=!1){let{section:r,subsection:i,name:a,path:o,sectionPath:s,isSection:c}=Yt(e),l=Xt(this.parsedConfig,e=>e.path===o);if(t==null)l!==-1&&this.parsedConfig.splice(l,1);else if(l!==-1){let e=this.parsedConfig[l],r=Object.assign({},e,{name:a,value:t,modified:!0});n?this.parsedConfig.splice(l+1,0,r):this.parsedConfig[l]=r}else{let e=this.parsedConfig.findIndex(e=>e.path===s),n={section:r,subsection:i,name:a,value:t,modified:!0,path:o};if(Rt.test(r)&&Bt.test(a)){if(e>=0)this.parsedConfig.splice(e+1,0,n);else{let e={isSection:c,section:r,subsection:i,modified:!0,path:s};this.parsedConfig.push(e,n)}}}}toString(){return this.parsedConfig.map(({line:e,section:t,subsection:n,name:r,value:i,modified:a=!1})=>a?r!=null&&i!=null?typeof i==`string`&&/[#;]/.test(i)?`\t${r} = "${i}"`:`\t${r} = ${i}`:n==null?`[${t}]`:`[${t} "${n}"]`:e).join(`
|
|
10
|
+
`)}},Qt=class{static async get({fs:e,gitdir:t}){let n=await e.read(`${t}/config`,{encoding:`utf8`});return Zt.from(n)}static async save({fs:e,gitdir:t,config:n}){await e.write(`${t}/config`,n.toString(),{encoding:`utf8`})}},$t=e=>[`${e}`,`refs/${e}`,`refs/tags/${e}`,`refs/heads/${e}`,`refs/remotes/${e}`,`refs/remotes/${e}/HEAD`],en=[`config`,`description`,`index`,`shallow`,`commondir`];function tn(e){if(en.includes(e))throw new Tt(e,`refs/heads/${e}`)}var X=class e{static async updateRemoteRefs({fs:t,gitdir:n,remote:r,refs:i,symrefs:a,tags:o,refspecs:s=void 0,prune:c=!1,pruneTags:l=!1}){for(let e of i.values())if(!e.match(/[0-9a-f]{40}/))throw new wt(e);let u=await Qt.get({fs:t,gitdir:n});if(!s){if(s=await u.getall(`remote.${r}.fetch`),s.length===0)throw new Et(r);s.unshift(`+HEAD:refs/remotes/${r}/HEAD`)}let d=kt.from(s),f=new Map,p=d.translate([...i.keys()]),m=[];for(let[e,t]of d.translate([...a.keys()])){let n=d.translateOne(a.get(e));n&&m.push([t,`ref: ${n}`])}for(let[,e]of p)tn(e);for(let[e]of m)tn(e);if(l){let r=await e.listRefs({fs:t,gitdir:n,filepath:`refs/tags`});await e.deleteRefs({fs:t,gitdir:n,refs:r.map(e=>`refs/tags/${e}`)})}if(o){for(let r of i.keys())if(r.startsWith(`refs/tags`)&&!r.endsWith(`^{}`)&&!await e.exists({fs:t,gitdir:n,ref:r})){let e=i.get(r);f.set(r,e)}}for(let[e,t]of p){let n=i.get(e);f.set(t,n)}for(let[e,t]of m)f.set(e,t);let h=[];if(c){for(let r of d.localNamespaces()){let i=(await e.listRefs({fs:t,gitdir:n,filepath:r})).map(e=>`${r}/${e}`);for(let e of i)f.has(e)||h.push(e)}h.length>0&&await e.deleteRefs({fs:t,gitdir:n,refs:h})}for(let[e,r]of f)await lt(e,async()=>t.write(Y(n,e),`${r.trim()}\n`,`utf8`));return{pruned:h}}static async writeRef({fs:e,gitdir:t,ref:n,value:r}){if(tn(n),!r.match(/[0-9a-f]{40}/))throw new wt(r);await lt(n,async()=>e.write(Y(t,n),`${r.trim()}\n`,`utf8`))}static async writeSymbolicRef({fs:e,gitdir:t,ref:n,value:r}){tn(n),await lt(n,async()=>e.write(Y(t,n),`ref: ${r.trim()}\n`,`utf8`))}static async deleteRef({fs:t,gitdir:n,ref:r}){return e.deleteRefs({fs:t,gitdir:n,refs:[r]})}static async deleteRefs({fs:e,gitdir:t,refs:n}){n.forEach(tn),await Promise.all(n.map(n=>e.rm(Y(t,n))));let r=await lt(`packed-refs`,async()=>e.read(`${t}/packed-refs`,{encoding:`utf8`})),i=Dt.from(r),a=i.refs.size;for(let e of n)i.refs.has(e)&&i.delete(e);i.refs.size<a&&(r=i.toString(),await lt(`packed-refs`,async()=>e.write(`${t}/packed-refs`,r,{encoding:`utf8`})))}static async resolve({fs:t,gitdir:n,ref:r,depth:i=void 0,visited:a=new Set}){if(i!==void 0&&(i--,i===-1))return r;if(r.startsWith(`ref: `))return r=r.slice(5),e.resolve({fs:t,gitdir:n,ref:r,depth:i,visited:a});if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;let o=await e.packedRefs({fs:t,gitdir:n}),s=$t(r).filter(e=>!en.includes(e));for(let r of s){let s=await lt(r,async()=>await t.read(`${n}/${r}`,{encoding:`utf8`})||o.get(r));if(s){if(a.has(r))throw new J(`Circular reference detected while resolving ref "${r}"`);return a.add(r),e.resolve({fs:t,gitdir:n,ref:s.trim(),depth:i,visited:a})}}throw new St(r)}static async isUnbornBranch({fs:t,gitdir:n,ref:r}){let i;try{i=await e.resolve({fs:t,gitdir:n,ref:`HEAD`,depth:2})}catch{return!1}return i.startsWith(`refs/heads/`)?r===`HEAD`||$t(r).includes(i):!1}static async exists({fs:t,gitdir:n,ref:r}){try{return await e.expand({fs:t,gitdir:n,ref:r}),!0}catch{return!1}}static async expand({fs:t,gitdir:n,ref:r}){if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;let i=await e.packedRefs({fs:t,gitdir:n}),a=$t(r).filter(e=>!en.includes(e));for(let e of a)if(await lt(e,async()=>t.exists(`${n}/${e}`))||i.has(e))return e;throw new St(r)}static async expandAgainstMap({ref:e,map:t}){let n=$t(e);for(let e of n)if(await t.has(e))return e;throw new St(e)}static resolveAgainstMap({ref:t,fullref:n=t,depth:r=void 0,map:i}){if(r!==void 0&&(r--,r===-1))return{fullref:n,oid:t};if(t.startsWith(`ref: `))return t=t.slice(5),e.resolveAgainstMap({ref:t,fullref:n,depth:r,map:i});if(t.length===40&&/[0-9a-f]{40}/.test(t))return{fullref:n,oid:t};let a=$t(t);for(let t of a){let n=i.get(t);if(n)return e.resolveAgainstMap({ref:n.trim(),fullref:t,depth:r,map:i})}throw new St(t)}static async packedRefs({fs:e,gitdir:t}){let n=await lt(`packed-refs`,async()=>e.read(`${t}/packed-refs`,{encoding:`utf8`}));return Dt.from(n).refs}static async listRefs({fs:t,gitdir:n,filepath:r}){let i=e.packedRefs({fs:t,gitdir:n}),a=null;try{a=await t.readdirDeep(`${n}/${r}`),a=a.map(e=>e.replace(`${n}/${r}/`,``))}catch{a=[]}for(let e of(await i).keys())e.startsWith(r)&&(e=e.replace(r+`/`,``),a.includes(e)||a.push(e));return a.sort(At),a}static async listBranches({fs:t,gitdir:n,remote:r}){return r?e.listRefs({fs:t,gitdir:n,filepath:`refs/remotes/${r}`}):e.listRefs({fs:t,gitdir:n,filepath:`refs/heads`})}static async listTags({fs:t,gitdir:n}){return(await e.listRefs({fs:t,gitdir:n,filepath:`refs/tags`})).filter(e=>!e.endsWith(`^{}`))}};function nn(e,t){return Ge(rn(e),rn(t))}function rn(e){return e.mode===`040000`?e.path+`/`:e.path}function an(e){switch(e){case`040000`:return`tree`;case`100644`:return`blob`;case`100755`:return`blob`;case`120000`:return`blob`;case`160000`:return`commit`}throw new J(`Unexpected GitTree entry mode: ${e}`)}function on(e){let t=[],n=0;for(;n<e.length;){let r=e.indexOf(32,n);if(r===-1)throw new J(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next space character.`);let i=e.indexOf(0,n);if(i===-1)throw new J(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next null character.`);let a=e.slice(n,r).toString(`utf8`);a===`40000`&&(a=`040000`);let o=an(a),s=e.slice(r+1,i).toString(`utf8`),c=s.replace(/[\u200C-\u200F\u202A-\u202E\u206A-\u206F\uFEFF]/g,``),l=c.split(`:`)[0].toLowerCase().replace(/[. ]+$/,``);if(s.includes(`\\`)||s.includes(`/`)||c===`.`||c===`..`||l===`.git`||/^\.?git~[1-9]$/.test(l))throw new Ue(s);let u=e.slice(i+1,i+21).toString(`hex`);n=i+21,t.push({mode:a,path:s,oid:u,type:o})}return t}function sn(e){if(typeof e==`number`&&(e=e.toString(8)),e.match(/^0?4.*/))return`040000`;if(e.match(/^1006.*/))return`100644`;if(e.match(/^1007.*/))return`100755`;if(e.match(/^120.*/))return`120000`;if(e.match(/^160.*/))return`160000`;throw new J(`Could not understand file mode: ${e}`)}function cn(e){return!e.oid&&e.sha&&(e.oid=e.sha),e.mode=sn(e.mode),e.type||=an(e.mode),e}var ln=class e{constructor(e){if(Buffer.isBuffer(e))this._entries=on(e);else if(Array.isArray(e))this._entries=e.map(cn);else throw new J(`invalid type passed to GitTree constructor`);this._entries.sort(Ke)}static from(t){return new e(t)}render(){return this._entries.map(e=>`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(`
|
|
11
|
+
`)}toObject(){let e=[...this._entries];return e.sort(nn),Buffer.concat(e.map(e=>{let t=Buffer.from(e.mode.replace(/^0/,``)),n=Buffer.from(` `),r=Buffer.from(e.path,`utf8`),i=Buffer.from([0]),a=Buffer.from(e.oid,`hex`);return Buffer.concat([t,n,r,i,a])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},un=class{static wrap({type:e,object:t}){let n=`${e} ${t.length}\x00`,r=n.length,i=r+t.length,a=new Uint8Array(i);for(let e=0;e<r;e++)a[e]=n.charCodeAt(e);return a.set(t,r),a}static unwrap(e){let t=e.indexOf(32),n=e.indexOf(0),r=e.slice(0,t).toString(`utf8`),i=e.slice(t+1,n).toString(`utf8`),a=e.length-(n+1);if(parseInt(i)!==a)throw new J(`Length mismatch: expected ${i} bytes but got ${a} instead.`);return{type:r,object:Buffer.from(e.slice(n+1))}}};async function dn({fs:e,gitdir:t,oid:n}){let r=`objects/${n.slice(0,2)}/${n.slice(2)}`,i=await e.read(`${t}/${r}`);return i?{object:i,format:`deflated`,source:r}:null}function fn(e,t){let n=new We(e),r=pn(n);if(r!==t.byteLength)throw new J(`applyDelta expected source buffer to be ${r} bytes but the provided buffer was ${t.length} bytes`);let i=pn(n),a,o=hn(n,t);if(o.byteLength===i)a=o;else{let e=[o],r=o.byteLength;for(;!n.eof();){let i=hn(n,t);e.push(i),r+=i.byteLength}if(i!==r)throw new J(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${r} bytes`);a=Buffer.concat(e,i)}return a}function pn(e){let t=0,n=0,r=null;do r=e.readUInt8(),t|=(r&127)<<n,n+=7;while(r&128);return t}function mn(e,t,n){let r=0,i=0;for(;n--;)t&1&&(r|=e.readUInt8()<<i),t>>=1,i+=8;return r}function hn(e,t){let n=e.readUInt8();if(n&128){let r=mn(e,n&15,4),i=mn(e,(n&112)>>4,3);return i===0&&(i=65536),t.slice(r,r+i)}return e.slice(n)}function gn(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function _n(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:gn(e)}var vn=class{constructor(e){if(typeof Buffer>`u`)throw Error(`Missing Buffer dependency`);this.stream=_n(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:t}=await this.stream.next();return e&&(this._ended=!0,!t)?Buffer.alloc(0):(t&&=Buffer.from(t),t)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let t=[this.buffer];for(;this.cursor+e>yn(t);){let e=await this._next();if(this._ended)break;t.push(e)}this.buffer=Buffer.concat(t)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};function yn(e){return e.reduce((e,t)=>e+t.length,0)}async function bn(e,t){let n=new vn(e),r=await n.read(4);if(r=r.toString(`utf8`),r!==`PACK`)throw new J(`Invalid PACK header '${r}'`);let i=await n.read(4);if(i=i.readUInt32BE(0),i!==2)throw new J(`Invalid packfile version: ${i}`);let a=await n.read(4);if(a=a.readUInt32BE(0),!(a<1))for(;!n.eof()&&a--;){let e=n.tell(),{type:r,length:i,ofs:o,reference:s}=await xn(n),c=new Le.default.Inflate;for(;!c.result;){let l=await n.chunk();if(!l)break;if(c.push(l,!1),c.err)throw new J(`Pako error: ${c.msg}`);if(c.result){if(c.result.length!==i)throw new J(`Inflated object size is different from that stated in packfile.`);await n.undo(),await n.read(l.length-c.strm.avail_in);let u=n.tell();await t({data:c.result,type:r,num:a,offset:e,end:u,reference:s,ofs:o})}}}}async function xn(e){let t=await e.byte(),n=t>>4&7,r=t&15;if(t&128){let n=4;do t=await e.byte(),r|=(t&127)<<n,n+=7;while(t&128)}let i,a;if(n===6){let n=0;i=0;let r=[];do t=await e.byte(),i|=(t&127)<<n,n+=7,r.push(t);while(t&128);a=Buffer.from(r)}return n===7&&(a=await e.read(20)),{type:n,length:r,ofs:i,reference:a}}var Sn=!1;async function Cn(e){return Sn===null&&(Sn=Tn()),Sn?wn(e):Le.default.inflate(e)}async function wn(e){let t=new DecompressionStream(`deflate`),n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}function Tn(){try{if(new DecompressionStream(`deflate`))return!0}catch{}return!1}function En(e){let t=[],n=0,r=0;do{n=e.readUInt8();let i=n&127;t.push(i),r=n&128}while(r);return t.reduce((e,t)=>e+1<<7|t,-1)}function Dn(e,t){let n=t,r=4,i=null;do i=e.readUInt8(),n|=(i&127)<<r,r+=7;while(i&128);return n}var On=class e{constructor(e){Object.assign(this,e),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:n}){let r=new We(t);if(r.slice(4).toString(`hex`)!==`ff744f63`)return;let i=r.readUInt32BE();if(i!==2)throw new J(`Unable to read version ${i} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2147483648)throw new J(`To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.`);r.seek(r.tell()+1020);let a=r.readUInt32BE(),o=[];for(let e=0;e<a;e++){let t=r.slice(20).toString(`hex`);o[e]=t}r.seek(r.tell()+4*a);let s=new Map;for(let e=0;e<a;e++)s.set(o[e],r.readUInt32BE());let c=r.slice(20).toString(`hex`);return new e({hashes:o,crcs:{},offsets:s,packfileSha:c,getExternalRefDelta:n})}static async fromPack({pack:t,getExternalRefDelta:n,onProgress:r}){let i={1:`commit`,2:`tree`,3:`blob`,4:`tag`,6:`ofs-delta`,7:`ref-delta`},a={},o=t.slice(-20).toString(`hex`),s=[],c={},l=new Map,u=null,d=null;await bn([t],async({data:e,type:t,reference:n,offset:o,num:s})=>{u===null&&(u=s);let c=Math.floor((u-s)*100/u);c!==d&&r&&await r({phase:`Receiving objects`,loaded:u-s,total:u}),d=c,t=i[t],([`commit`,`tree`,`blob`,`tag`].includes(t)||t===`ofs-delta`||t===`ref-delta`)&&(a[o]={type:t,offset:o})});let f=Object.keys(a).map(Number);for(let[e,n]of f.entries()){let r=e+1===f.length?t.byteLength-20:f[e+1],i=a[n],o=Ie.default.buf(t.slice(n,r))>>>0;i.end=r,i.crc=o}let p=new e({pack:Promise.resolve(t),packfileSha:o,crcs:c,hashes:s,offsets:l,getExternalRefDelta:n});d=null;let m=0,h=[0,0,0,0,0,0,0,0,0,0,0,0];for(let e in a){e=Number(e);let t=Math.floor(m*100/u);t!==d&&r&&await r({phase:`Resolving deltas`,loaded:m,total:u}),m++,d=t;let n=a[e];if(!n.oid)try{p.readDepth=0,p.externalReadDepth=0;let{type:t,object:r}=await p.readSlice({start:e});h[p.readDepth]+=1;let i=await $e(un.wrap({type:t,object:r}));n.oid=i,s.push(i),l.set(i,e),c[i]=n.crc}catch{continue}}return s.sort(),p}async toBuffer(){let e=[],t=(t,n)=>{e.push(Buffer.from(t,n))};t(`ff744f63`,`hex`),t(`00000002`,`hex`);let n=new We(Buffer.alloc(1024));for(let e=0;e<256;e++){let t=0;for(let n of this.hashes)parseInt(n.slice(0,2),16)<=e&&t++;n.writeUInt32BE(t)}e.push(n.buffer);for(let e of this.hashes)t(e,`hex`);let r=new We(Buffer.alloc(this.hashes.length*4));for(let e of this.hashes)r.writeUInt32BE(this.crcs[e]);e.push(r.buffer);let i=new We(Buffer.alloc(this.hashes.length*4));for(let e of this.hashes)i.writeUInt32BE(this.offsets.get(e));e.push(i.buffer),t(this.packfileSha,`hex`);let a=Buffer.concat(e),o=await $e(a),s=Buffer.alloc(20);return s.write(o,`hex`),Buffer.concat([a,s])}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 J(`Could not read object ${e} from packfile`)}let t=this.offsets.get(e);return this.readSlice({start:t})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let t={16:`commit`,32:`tree`,48:`blob`,64:`tag`,96:`ofs_delta`,112:`ref_delta`},n=await this.pack;if(!n)throw new J(`Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.`);let r=n.slice(e),i=new We(r),a=i.readUInt8(),o=a&112,s=t[o];if(s===void 0)throw new J(`Unrecognized type: 0b`+o.toString(2));let c=a&15,l=c;a&128&&(l=Dn(i,c));let u=null,d=null;if(s===`ofs_delta`){let t=e-En(i);({object:u,type:s}=await this.readSlice({start:t}))}if(s===`ref_delta`){let e=i.slice(20).toString(`hex`);({object:u,type:s}=await this.read({oid:e}))}let f=r.slice(i.tell());if(d=Buffer.from(await Cn(f)),d.byteLength!==l)throw new J(`Packfile told us object would have length ${l} but it had length ${d.byteLength}`);return u&&(d=Buffer.from(fn(d,u))),this.readDepth>3&&(this.offsetCache[e]={type:s,object:d}),{type:s,format:`content`,object:d}}},kn=Symbol(`PackfileCache`);async function An({fs:e,filename:t,getExternalRefDelta:n,emitter:r,emitterPrefix:i}){let a=await e.read(t);return On.fromIdx({idx:a,getExternalRefDelta:n})}function jn({fs:e,cache:t,filename:n,getExternalRefDelta:r,emitter:i,emitterPrefix:a}){t[kn]||(t[kn]=new Map);let o=t[kn].get(n);return o||(o=An({fs:e,filename:n,getExternalRefDelta:r,emitter:i,emitterPrefix:a}),t[kn].set(n,o)),o}async function Mn(e,{start:t=0,end:n=e.length}={}){return $e(e.subarray(t,n))}var Nn=0;async function Pn({pack:e,p:t,deep:n}){let r=t.packfileSha,i=e.subarray(-20),a=Array.from(i).map(e=>e.toString(16).padStart(2,`0`)).join(``);if(a!==r)throw new J(`Packfile trailer mismatch: expected ${r}, got ${a}. The packfile may be corrupted.`);if(n){let t=await Mn(e,{start:0,end:e.length-20});if(t!==r)throw new J(`Packfile payload corrupted: calculated ${t} but expected ${r}. The packfile may have been tampered with.`)}t._checksumVerified=!0}async function Fn({fs:e,cache:t,gitdir:n,oid:r,format:i=`content`,getExternalRefDelta:a}){let o=await e.readdir(Y(n,`objects/pack`));o=o.filter(e=>e.endsWith(`.idx`));for(let i of o){let o=`${n}/objects/pack/${i}`,s=await jn({fs:e,cache:t,filename:o,getExternalRefDelta:a});if(s.error)throw new J(s.error);if(s.offsets.has(r)){let n=o.replace(/idx$/,`pack`);s.pack||=e.read(n);let c=await s.pack;if(!c)throw s.pack=null,new J(`Could not read packfile at ${n}. The file may be missing, corrupted, or too large to read into memory.`);let l=!(t&&t.skipDeepPackVerification);(!s._verification||l&&!s._deepVerified)&&(s._deepVerified=l,s._verification=Pn({pack:c,p:s,deep:l})),await s._verification,s._lastUsedAt=++Nn;let u=await s.read({oid:r,getExternalRefDelta:a});return u.format=`content`,u.source=`objects/pack/${i.replace(/idx$/,`pack`)}`,u}}return null}async function In({fs:e,cache:t,gitdir:n,oid:r,format:i=`content`}){if(![`deflated`,`wrapped`,`content`].includes(i))throw new J(`invalid requested format "${i}"`);let a=r=>In({fs:e,cache:t,gitdir:n,oid:r}),o;if(r===`4b825dc642cb6eb9a060e54bf8d69288fbee4904`&&(o={format:`wrapped`,object:Buffer.from(`tree 0\0`)}),o||=await dn({fs:e,gitdir:n,oid:r}),!o){if(o=await Fn({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:a}),!o)throw new St(r);return o}if(i===`deflated`||(o.format===`deflated`&&(o.object=Buffer.from(await Cn(o.object)),o.format=`wrapped`),i===`wrapped`))return o;let s=await $e(o.object);if(s!==r)throw new J(`SHA check failed! Expected ${r}, computed ${s}`);let{object:c,type:l}=un.unwrap(o.object);return o.type=l,o.object=c,o.format=`content`,o}var Ln=class e extends q{constructor(t,n,r=!0){super(`Failed to create ${t} at ${n} because it already exists.${r?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:``}`),this.code=this.name=e.code,this.data={noun:t,where:n,canForce:r}}};Ln.code=`AlreadyExistsError`;var Rn=class e extends q{constructor(t,n,r){super(`Found multiple ${t} matching "${n}" (${r.join(`, `)}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=e.code,this.data={nouns:t,short:n,matches:r}}};Rn.code=`AmbiguousError`;var zn=class e extends q{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(`, `)}`),this.code=this.name=e.code,this.data={filepaths:t}}};zn.code=`CheckoutConflictError`;var Bn=class e extends q{constructor(t,n){super(`Cannot cherry-pick merge commit ${t}. Merge commits have ${n} parents and require specifying which parent to use as the base.`),this.code=this.name=e.code,this.data={oid:t,parentCount:n}}};Bn.code=`CherryPickMergeCommitError`;var Vn=class e extends q{constructor(t){super(`Cannot cherry-pick root commit ${t}. Root commits have no parents.`),this.code=this.name=e.code,this.data={oid:t}}};Vn.code=`CherryPickRootCommitError`;var Hn=class e extends q{constructor(t,n){super(`Failed to checkout "${t}" because commit ${n} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=e.code,this.data={ref:t,oid:n}}};Hn.code=`CommitNotFetchedError`;var Un=class e extends q{constructor(){super(`Cannot create an empty commit when disallowEmpty is true.`),this.code=this.name=e.code,this.data={}}};Un.code=`EmptyCommitError`;var Wn=class e extends q{constructor(){super(`Empty response from git server.`),this.code=this.name=e.code,this.data={}}};Wn.code=`EmptyServerResponseError`;var Gn=class e extends q{constructor(){super(`A simple fast-forward merge was not possible.`),this.code=this.name=e.code,this.data={}}};Gn.code=`FastForwardError`;var Kn=class e extends q{constructor(t,n){super(`One or more branches were not updated: ${t}`),this.code=this.name=e.code,this.data={prettyDetails:t,result:n}}};Kn.code=`GitPushError`;var qn=class e extends q{constructor(t,n,r){super(`HTTP Error: ${t} ${n}`),this.code=this.name=e.code,this.data={statusCode:t,statusMessage:n,response:r}}};qn.code=`HttpError`;var Jn=class e extends q{constructor(t){let n=`invalid filepath`;t===`leading-slash`||t===`trailing-slash`?n=`"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.`:t===`directory`&&(n=`"filepath" should not be a directory.`),super(n),this.code=this.name=e.code,this.data={reason:t}}};Jn.code=`InvalidFilepathError`;var Yn=class e extends q{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=e.code,this.data={depth:t}}};Yn.code=`MaxDepthError`;var Xn=class e extends q{constructor(){super(`Merges with conflicts are not supported yet.`),this.code=this.name=e.code,this.data={}}};Xn.code=`MergeNotSupportedError`;var Zn=class e extends q{constructor(t,n,r,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=e.code,this.data={filepaths:t,bothModified:n,deleteByUs:r,deleteByTheirs:i}}};Zn.code=`MergeConflictError`;var Qn=class e extends q{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=e.code,this.data={role:t}}};Qn.code=`MissingNameError`;var $n=class e extends q{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=e.code,this.data={parameter:t}}};$n.code=`MissingParameterError`;var er=class e extends q{constructor(t){super(`There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more`),this.code=this.name=e.code,this.data={errors:t},this.errors=t}};er.code=`MultipleGitError`;var tr=class e extends q{constructor(t,n){super(`Expected "${t}" but received "${n}".`),this.code=this.name=e.code,this.data={expected:t,actual:n}}};tr.code=`ParseError`;var nr=class e extends q{constructor(t){let n=``;t===`not-fast-forward`?n=` because it was not a simple fast-forward`:t===`tag-exists`&&(n=` because tag already exists`),super(`Push rejected${n}. Use "force: true" to override.`),this.code=this.name=e.code,this.data={reason:t}}};nr.code=`PushRejectedError`;var rr=class e extends q{constructor(t,n){super(`Remote does not support the "${t}" so the "${n}" parameter cannot be used.`),this.code=this.name=e.code,this.data={capability:t,parameter:n}}};rr.code=`RemoteCapabilityError`;var ir=class e extends q{constructor(t,n){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=e.code,this.data={preview:t,response:n}}};ir.code=`SmartHttpError`;var ar=class e extends q{constructor(t,n,r){super(`Git remote "${t}" uses an unrecognized transport protocol: "${n}"`),this.code=this.name=e.code,this.data={url:t,transport:n,suggestion:r}}};ar.code=`UnknownTransportError`;var or=class e extends q{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=e.code,this.data={url:t}}};or.code=`UrlParseError`;var sr=class e extends q{constructor(){super(`The operation was canceled.`),this.code=this.name=e.code,this.data={}}};sr.code=`UserCanceledError`;var cr=class e extends q{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=e.code,this.data={filepath:t}}};cr.code=`IndexResetError`;var lr=class e extends q{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=e.code,this.data={ref:t}}};lr.code=`NoCommitError`;var ur=Object.freeze({__proto__:null,AlreadyExistsError:Ln,AmbiguousError:Rn,CheckoutConflictError:zn,CherryPickMergeCommitError:Bn,CherryPickRootCommitError:Vn,CommitNotFetchedError:Hn,EmptyCommitError:Un,EmptyServerResponseError:Wn,FastForwardError:Gn,GitPushError:Kn,HttpError:qn,InternalError:J,InvalidFilepathError:Jn,InvalidOidError:wt,InvalidRefNameError:Tt,MaxDepthError:Yn,MergeNotSupportedError:Xn,MergeConflictError:Zn,MissingNameError:Qn,MissingParameterError:$n,MultipleGitError:er,NoRefspecError:Et,NotFoundError:St,ObjectTypeError:Ct,ParseError:tr,PushRejectedError:nr,RemoteCapabilityError:rr,SmartHttpError:ir,UnknownTransportError:ar,UnsafeFilepathError:Ue,UrlParseError:or,UserCanceledError:sr,UnmergedPathsError:He,IndexResetError:cr,NoCommitError:lr});function dr({name:e,email:t,timestamp:n,timezoneOffset:r}){return r=fr(r),`${e} <${t}> ${n} ${r}`}function fr(e){let t=pr(mr(e));e=Math.abs(e);let n=Math.floor(e/60);e-=n*60;let r=String(n),i=String(e);return r.length<2&&(r=`0`+r),i.length<2&&(i=`0`+i),(t===-1?`-`:`+`)+r+i}function pr(e){return Math.sign(e)||(Object.is(e,-0)?-1:1)}function mr(e){return e===0?e:-e}function hr(e){return e=e.replace(/\r/g,``),e=e.replace(/^\n+/,``),e=e.replace(/\n+$/,``)+`
|
|
12
|
+
`,e}function gr(e){let[,t,n,r,i]=e.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:t,email:n,timestamp:Number(r),timezoneOffset:_r(i)}}function _r(e){let[,t,n,r]=e.match(/(\+|-)(\d\d)(\d\d)/);return r=(t===`+`?1:-1)*(Number(n)*60+Number(r)),vr(r)}function vr(e){return e===0?e:-e}var yr=class e{constructor(t){if(typeof t==`string`)this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString(`utf8`);else if(typeof t==`object`)this._tag=e.render(t);else throw new J(`invalid type passed to GitAnnotatedTag constructor`)}static from(t){return new e(t)}static render(e){return`object ${e.object}
|
|
13
|
+
type ${e.type}
|
|
14
|
+
tag ${e.tag}
|
|
15
|
+
tagger ${dr(e.tagger)}
|
|
16
|
+
|
|
17
|
+
${e.message}
|
|
18
|
+
${e.gpgsig?e.gpgsig:``}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
|
19
|
+
|
|
20
|
+
`))}message(){let e=this.withoutSignature();return e.slice(e.indexOf(`
|
|
21
|
+
|
|
22
|
+
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(`
|
|
23
|
+
`),t=[];for(let n of e)n[0]===` `?t[t.length-1]+=`
|
|
24
|
+
`+n.slice(1):t.push(n);let n={};for(let e of t){let t=e.slice(0,e.indexOf(` `)),r=e.slice(e.indexOf(` `)+1);Array.isArray(n[t])?n[t].push(r):n[t]=r}return n.tagger&&=gr(n.tagger),n.committer&&=gr(n.committer),n}withoutSignature(){let e=hr(this._tag);return e.indexOf(`
|
|
25
|
+
-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(`
|
|
26
|
+
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
|
27
|
+
-----BEGIN PGP SIGNATURE-----`)!==-1)return hr(this._tag.slice(this._tag.indexOf(`-----BEGIN PGP SIGNATURE-----`),this._tag.indexOf(`-----END PGP SIGNATURE-----`)+27))}payload(){return this.withoutSignature()+`
|
|
28
|
+
`}toObject(){return Buffer.from(this._tag,`utf8`)}static async sign(t,n,r){let i=t.payload(),{signature:a}=await n({payload:i,secretKey:r});a=hr(a);let o=i+a;return e.from(o)}};function br(e){return e.trim().split(`
|
|
29
|
+
`).map(e=>` `+e).join(`
|
|
30
|
+
`)+`
|
|
31
|
+
`}function xr(e){return e.split(`
|
|
32
|
+
`).map(e=>e.replace(/^ /,``)).join(`
|
|
33
|
+
`)}var Sr=class e{constructor(t){if(typeof t==`string`)this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString(`utf8`);else if(typeof t==`object`)this._commit=e.render(t);else throw new J(`invalid type passed to GitCommit constructor`)}static fromPayloadSignature({payload:t,signature:n}){let r=e.justHeaders(t),i=e.justMessage(t),a=hr(r+`
|
|
34
|
+
gpgsig`+br(n)+`
|
|
35
|
+
`+i);return new e(a)}static from(t){return new e(t)}toObject(){return Buffer.from(this._commit,`utf8`)}headers(){return this.parseHeaders()}message(){return e.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return hr(e.slice(e.indexOf(`
|
|
36
|
+
|
|
37
|
+
`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(`
|
|
38
|
+
|
|
39
|
+
`))}parseHeaders(){let t=e.justHeaders(this._commit).split(`
|
|
40
|
+
`),n=[];for(let e of t)e[0]===` `?n[n.length-1]+=`
|
|
41
|
+
`+e.slice(1):n.push(e);let r={parent:[]};for(let e of n){let t=e.slice(0,e.indexOf(` `)),n=e.slice(e.indexOf(` `)+1);Array.isArray(r[t])?r[t].push(n):r[t]=n}return r.author&&=gr(r.author),r.committer&&=gr(r.committer),r}static renderHeaders(e){let t=``;if(e.tree?t+=`tree ${e.tree}\n`:t+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
|
42
|
+
`,e.parent){if(e.parent.length===void 0)throw new J(`commit 'parent' property should be an array`);for(let n of e.parent)t+=`parent ${n}\n`}let n=e.author;t+=`author ${dr(n)}\n`;let r=e.committer||e.author;return t+=`committer ${dr(r)}\n`,e.gpgsig&&(t+=`gpgsig`+br(e.gpgsig)),t}static render(t){return e.renderHeaders(t)+`
|
|
43
|
+
`+hr(t.message)}render(){return this._commit}withoutSignature(){let e=hr(this._commit);if(e.indexOf(`
|
|
44
|
+
gpgsig`)===-1)return e;let t=e.slice(0,e.indexOf(`
|
|
45
|
+
gpgsig`)),n=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
|
|
46
|
+
`)+28);return hr(t+`
|
|
47
|
+
`+n)}isolateSignature(){return xr(this._commit.slice(this._commit.indexOf(`-----BEGIN PGP SIGNATURE-----`),this._commit.indexOf(`-----END PGP SIGNATURE-----`)+27))}static async sign(t,n,r){let i=t.withoutSignature(),a=e.justMessage(t._commit),{signature:o}=await n({payload:i,secretKey:r});o=hr(o);let s=e.justHeaders(t._commit)+`
|
|
48
|
+
gpgsig`+br(o)+`
|
|
49
|
+
`+a;return e.from(s)}};async function Cr({fs:e,cache:t,gitdir:n,oid:r}){if(r===`4b825dc642cb6eb9a060e54bf8d69288fbee4904`)return{tree:ln.from([]),oid:r};let{type:i,object:a}=await In({fs:e,cache:t,gitdir:n,oid:r});if(i===`tag`)return r=yr.from(a).parse().object,Cr({fs:e,cache:t,gitdir:n,oid:r});if(i===`commit`)return r=Sr.from(a).parse().tree,Cr({fs:e,cache:t,gitdir:n,oid:r});if(i!==`tree`)throw new Ct(r,i,`tree`);return{tree:ln.from(a),oid:r}}var wr=class{constructor({fs:e,gitdir:t,ref:n,cache:r}){this.fs=e,this.cache=r,this.gitdir=t,this.mapPromise=(async()=>{let r=new Map,i;try{i=await X.resolve({fs:e,gitdir:t,ref:n})}catch(r){if(r instanceof St&&await X.isUnbornBranch({fs:e,gitdir:t,ref:n}))i=`4b825dc642cb6eb9a060e54bf8d69288fbee4904`;else throw r}let a=await Cr({fs:e,cache:this.cache,gitdir:t,oid:i});return a.type=`tree`,a.mode=`40000`,r.set(`.`,a),r})();let i=this;this.ConstructEntry=class{constructor(e){this._fullpath=e,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(e){let t=e._fullpath,{fs:n,cache:r,gitdir:i}=this,a=await this.mapPromise,o=a.get(t);if(!o)throw Error(`No obj for ${t}`);let s=o.oid;if(!s)throw Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!==`tree`)return null;let{type:c,object:l}=await In({fs:n,cache:r,gitdir:i,oid:s});if(c!==o.type)throw new Ct(s,c,o.type);let u=ln.from(l);for(let e of u)a.set(Y(t,e.path),e);return u.entries().map(e=>Y(t,e.path))}async type(e){if(e._type===!1){let{type:t}=(await this.mapPromise).get(e._fullpath);e._type=t}return e._type}async mode(e){if(e._mode===!1){let{mode:t}=(await this.mapPromise).get(e._fullpath);e._mode=qe(parseInt(t,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let t=await this.mapPromise,{fs:n,cache:r,gitdir:i}=this,a=t.get(e._fullpath).oid,{type:o,object:s}=await In({fs:n,cache:r,gitdir:i,oid:a});e._content=o===`blob`?new Uint8Array(s):void 0}return e._content}async oid(e){return e._oid===!1&&(e._oid=(await this.mapPromise).get(e._fullpath).oid),e._oid}};function Tr({ref:e=`HEAD`}={}){let t=Object.create(null);return Object.defineProperty(t,bt,{value:function({fs:t,gitdir:n,cache:r}){return new wr({fs:t,gitdir:n,ref:e,cache:r})}}),Object.freeze(t),t}var Er=class{constructor({fs:e,dir:t,gitdir:n,cache:r,refresh:i=!0}){this.fs=e,this.cache=r,this.dir=t,this.gitdir=n,this.refresh=i,this.config=null;let a=this;this.ConstructEntry=class{constructor(e){this._fullpath=e,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){if(await e.type()!==`tree`)return null;let t=e._fullpath,{fs:n,dir:r}=this,i=await n.readdir(Y(r,t));return i===null?null:i.map(e=>Y(t,e))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:t,dir:n}=this,r=await t.lstat(`${n}/${e._fullpath}`);if(!r)throw Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let i=r.isDirectory()?`tree`:`blob`;i===`blob`&&!r.isFile()&&!r.isSymbolicLink()&&(i=`special`),e._type=i,r=Xe(r),e._mode=r.mode,r.size===-1&&e._actualSize&&(r.size=e._actualSize),e._stat=r}return e._stat}async content(e){if(e._content===!1){let{fs:t,dir:n,gitdir:r}=this;if(await e.type()===`tree`)e._content=void 0;else{let i;if(await e.mode()>>12==10)i=await t.readlink(`${n}/${e._fullpath}`);else{let a=await(await this._getGitConfig(t,r)).get(`core.autocrlf`);i=await t.read(`${n}/${e._fullpath}`,{autocrlf:a})}e._actualSize=i.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(i)}}return e._content}async oid(e){if(e._oid===!1){let t=this,{fs:n,gitdir:r,cache:i}=this,a;await mt.acquire({fs:n,gitdir:r,cache:i},async function(i){let o=i.entriesMap.get(e._fullpath),s=await e.stat(),c=await(await t._getGitConfig(n,r)).get(`core.filemode`),l=typeof process<`u`?process.platform!==`win32`:!0;if(!o||ot(s,o,c,l)){let n=await e.content();n===void 0?a=void 0:(a=await $e(un.wrap({type:`blob`,object:n})),t.refresh&&o&&a===o.oid&&(!c||s.mode===o.mode)&&ot(s,o,c,l)&&i.insert({filepath:e._fullpath,stats:s,oid:a}))}else a=o.oid}),e._oid=a}return e._oid}async _getGitConfig(e,t){return this.config||=await Qt.get({fs:e,gitdir:t}),this.config}};function Dr({refresh:e=!0}={}){let t=Object.create(null);return Object.defineProperty(t,bt,{value:function({fs:t,dir:n,gitdir:r,cache:i}){return new Er({fs:t,dir:n,gitdir:r,cache:i,refresh:e})}}),Object.freeze(t),t}function Or(e,t){let n=t-e;return Array.from({length:n},(t,n)=>e+n)}var kr=Array.prototype.flat===void 0?e=>e.reduce((e,t)=>e.concat(t),[]):e=>e.flat(),Ar=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null||e<this.value)&&(this.value=e)}reset(){this.value=null}};function*jr(e){let t=new Ar,n,r=[],i=e.length;for(let n=0;n<i;n++)r[n]=e[n].next().value,r[n]!==void 0&&t.consider(r[n]);if(t.value!==null)for(;;){let a=[];n=t.value,t.reset();for(let o=0;o<i;o++)r[o]!==void 0&&r[o]===n?(a[o]=r[o],r[o]=e[o].next().value):a[o]=null,r[o]!==void 0&&t.consider(r[o]);if(yield a,t.value===null)return}}async function Mr({fs:e,cache:t,dir:n,gitdir:r,trees:i,map:a=async(e,t)=>t,reduce:o=async(e,t)=>{let n=kr(t);return e!==void 0&&n.unshift(e),n},iterate:s=(e,t)=>Promise.all([...t].map(e))}){let c=i.map(i=>i[bt]({fs:e,dir:n,gitdir:r,cache:t})),l=Array(c.length).fill(`.`),u=Or(0,c.length),d=async e=>(u.forEach(t=>{let n=e[t];e[t]=n&&new c[t].ConstructEntry(n)}),{entries:e,children:jr((await Promise.all(u.map(t=>{let n=e[t];return n?c[t].readdir(n):[]}))).map(e=>(e===null?[]:e)[Symbol.iterator]()))}),f=async e=>{let{entries:t,children:n}=await d(e),r=t.find(e=>e&&e._fullpath)._fullpath,i=await a(r,t);if(i!==null){let e=await s(f,n);return e=e.filter(e=>e!==void 0),o(i,e)}};return f(l)}async function Nr(e,t,n=10){try{await e(t)}catch(r){if(r===null||r.code===`EEXIST`)return;if(r.code!==`ENOENT`)throw r;let i=gt(t);if(i===`.`||i===`/`||i===t)throw r;await Nr(e,i,n);for(let r=0;;r++)try{await e(t);return}catch(e){if(e===null||e.code===`EEXIST`)return;if(e.code===`ENOENT`&&r<n){await new Promise(e=>setTimeout(e,0));continue}throw e}}}async function Pr(e,t){let n=await e.readdir(t);n==null?await e.rm(t):n.length?await Promise.all(n.map(n=>{let r=Y(t,n);return e.lstat(r).then(t=>{if(t)return t.isDirectory()?Pr(e,r):e.rm(r)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function Fr(e){return Ir(e)&&Lr(e.then)&&Lr(e.catch)}function Ir(e){return e&&typeof e==`object`}function Lr(e){return typeof e==`function`}function Rr(e){return Fr((e=>{try{return e.readFile().catch(e=>e)}catch(e){return e}})(e))}var zr=[`readFile`,`writeFile`,`mkdir`,`rmdir`,`unlink`,`stat`,`lstat`,`readdir`,`readlink`,`symlink`];function Br(e,t){if(Rr(t))for(let n of zr)e[`_${n}`]=t[n].bind(t);else for(let n of zr)e[`_${n}`]=(0,Re.default)(t[n].bind(t));Rr(t)?(t.cp&&(e._cp=t.cp.bind(t)),e._rm=t.rm?t.rm.bind(t):t.rmdir.length>1?t.rmdir.bind(t):Pr.bind(null,e)):(t.cp&&(e._cp=(0,Re.default)(t.cp.bind(t))),e._rm=t.rm?(0,Re.default)(t.rm.bind(t)):t.rmdir.length>2?(0,Re.default)(t.rmdir.bind(t)):Pr.bind(null,e))}var Z=class{constructor(e){if(e._original_unwrapped_fs!==void 0)return e;let t=Object.getOwnPropertyDescriptor(e,`promises`);t&&t.enumerable?Br(this,e.promises):Br(this,e),this._original_unwrapped_fs=e}async exists(e,t={}){try{return await this._stat(e),!0}catch(e){if(e.code===`ENOENT`||e.code===`ENOTDIR`||(e.code||``).includes(`ENS`))return!1;throw console.log(`Unhandled error in "FileSystem.exists()" function`,e),e}}async read(e,t={}){try{let n=await this._readFile(e,t);if(t.autocrlf===`true`)try{n=new TextDecoder(`utf8`,{fatal:!0}).decode(n),n=n.replace(/\r\n/g,`
|
|
50
|
+
`),n=new TextEncoder().encode(n)}catch{}return typeof n!=`string`&&(n=Buffer.from(n)),n}catch{return null}}async write(e,t,n={}){try{await this._writeFile(e,t,n)}catch{await this.mkdir(gt(e)),await this._writeFile(e,t,n)}}async mkdir(e){await Nr(this._mkdir,e)}async rm(e){try{await this._unlink(e)}catch(e){if(e.code!==`ENOENT`)throw e}}async rmdir(e,t){try{t&&t.recursive?await this._rm(e,t):await this._rmdir(e)}catch(e){if(e.code!==`ENOENT`)throw e}}async readdir(e){try{let t=await this._readdir(e);return t.sort(Ge),t}catch(e){return e.code===`ENOTDIR`?null:[]}}async readdirDeep(e){let t=await this._readdir(e);return(await Promise.all(t.map(async t=>{let n=e+`/`+t;return(await this._stat(n)).isDirectory()?this.readdirDeep(n):n}))).reduce((e,t)=>e.concat(t),[])}async lstat(e){try{return await this._lstat(e)}catch(e){if(e.code===`ENOENT`||(e.code||``).includes(`ENS`))return null;throw e}}async readlink(e,t={encoding:`buffer`}){try{let n=await this._readlink(e,t);return Buffer.isBuffer(n)?n:Buffer.from(n)}catch(e){if(e.code===`ENOENT`||(e.code||``).includes(`ENS`))return null;throw e}}async writelink(e,t){return this._symlink(t.toString(`utf8`),e)}};function Q(e,t){if(t===void 0)throw new $n(e)}function Vr(e){return e.startsWith(`/`)||/^[a-zA-Z]:[\\/]/.test(e)}async function $({fsp:e,dotgit:t}){Q(`fsp`,e),Q(`dotgit`,t);let n=await e._stat(t).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return n.isDirectory()?t:n.isFile()?e._readFile(t,`utf8`).then(e=>e.trimRight().substr(8)).then(e=>Vr(e)?e:Y(gt(t),e)):t}async function Hr(e,t){return!e&&!t?!1:e&&!t||!e&&t?!0:!(await e.type()===`tree`&&await t.type()===`tree`||await e.type()===await t.type()&&await e.mode()===await t.mode()&&await e.oid()===await t.oid())}async function Ur({fs:e,dir:t,gitdir:n=Y(t,`.git`),commit:r=`HEAD`,cache:i={}}){try{Q(`fs`,e),Q(`dir`,t),Q(`gitdir`,n);let a=new Z(e),o=[Tr({ref:r}),Dr(),xt()],s=[],c=await $({fsp:a,dotgit:n});await mt.acquire({fs:a,gitdir:c,cache:i},async function(e){s=e.unmergedPaths});let l=await Mr({fs:a,cache:i,dir:t,gitdir:c,trees:o,map:async function(e,[t,n,r]){let i=!await Hr(n,r),a=s.includes(e),o=!await Hr(r,t);if(i||a)return t?{path:e,mode:await t.mode(),oid:await t.oid(),type:await t.type(),content:await t.content()}:void 0;if(o)return!1;throw new cr(e)}});await mt.acquire({fs:a,gitdir:c,cache:i},async function(e){for(let n of l)if(n!==!1){if(!n){await a.rmdir(`${t}/${n.path}`,{recursive:!0}),e.delete({filepath:n.path});continue}if(n.type===`blob`){let r=new TextDecoder().decode(n.content);await a.write(`${t}/${n.path}`,r,{mode:n.mode}),e.insert({filepath:n.path,oid:n.oid,stage:0})}}})}catch(e){throw e.caller=`git.abortMerge`,e}}var Wr=class{static async isIgnored({fs:e,dir:t,gitdir:n=Y(t,`.git`),filepath:r}){if(ht(r)===`.git`)return!0;if(r===`.`)return!1;let i=``,a=Y(n,`info`,`exclude`);await e.exists(a)&&(i=await e.read(a,`utf8`));let o=[{gitignore:Y(t,`.gitignore`),filepath:r}],s=r.split(`/`).filter(Boolean);for(let e=1;e<s.length;e++){let n=s.slice(0,e).join(`/`),r=s.slice(e).join(`/`);o.push({gitignore:Y(t,n,`.gitignore`),filepath:r})}let c=!1;for(let t of o){let n;try{n=await e.read(t.gitignore,`utf8`)}catch(e){if(e.code===`NOENT`)continue}let r=(0,ze.default)().add(i);r.add(n);let a=gt(t.filepath);if(a!==`.`&&r.ignores(a))return!0;c=c?!r.test(t.filepath).unignored:r.test(t.filepath).ignored}return c}};async function Gr({fs:e,gitdir:t,object:n,format:r,oid:i}){if(r!==`deflated`)throw new J(`GitObjectStoreLoose expects objects to write to be in deflated format`);let a=`${t}/${`objects/${i.slice(0,2)}/${i.slice(2)}`}`;await e.exists(a)||await e.write(a,n)}var Kr=null;async function qr(e){return Kr===null&&(Kr=Yr()),Kr?Jr(e):Le.default.deflate(e)}async function Jr(e){let t=new CompressionStream(`deflate`),n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}function Yr(){try{return new CompressionStream(`deflate`).writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}async function Xr({fs:e,gitdir:t,type:n,object:r,format:i=`content`,oid:a=void 0,dryRun:o=!1}){return i!==`deflated`&&(i!==`wrapped`&&(r=un.wrap({type:n,object:r})),a=await $e(r),r=Buffer.from(await qr(r))),o||await Gr({fs:e,gitdir:t,object:r,format:`deflated`,oid:a}),a}function Zr(e){let t;for(;~(t=e.indexOf(92));)e[t]=47;return e}async function Qr({fs:e,dir:t,gitdir:n=Y(t,`.git`),filepath:r,cache:i={},force:a=!1,parallel:o=!0}){try{Q(`fs`,e),Q(`dir`,t),Q(`gitdir`,n),Q(`filepath`,r);let s=new Z(e),c=await $({fsp:s,dotgit:n});await mt.acquire({fs:s,gitdir:c,cache:i},async e=>{let n=await(await Qt.get({fs:s,gitdir:c})).get(`core.autocrlf`);return ei({dir:t,gitdir:c,fs:s,filepath:r,index:e,force:a,parallel:o,autocrlf:n})})}catch(e){throw e.caller=`git.add`,e}}function $r(e,t){if(e.has({filepath:t}))return!0;let n=`${t}/`;for(let t of e.entriesMap.keys())if(t.startsWith(n))return!0;return!1}async function ei({dir:e,gitdir:t,fs:n,filepath:r,index:i,force:a,parallel:o,autocrlf:s}){r=Array.isArray(r)?r:[r];let c=r.map(async r=>{if(!a&&!$r(i,r)&&await Wr.isIgnored({fs:n,dir:e,gitdir:t,filepath:r}))return;let c=await n.lstat(Y(e,r));if(!c)throw new St(r);if(c.isDirectory()){let c=await n.readdir(Y(e,r));if(o){let l=c.map(c=>ei({dir:e,gitdir:t,fs:n,filepath:[Y(r,c)],index:i,force:a,parallel:o,autocrlf:s}));await Promise.all(l)}else for(let l of c)await ei({dir:e,gitdir:t,fs:n,filepath:[Y(r,l)],index:i,force:a,parallel:o,autocrlf:s})}else{let a=c.isSymbolicLink()?await n.readlink(Y(e,r)).then(Zr):await n.read(Y(e,r),{autocrlf:s});if(a===null)throw new St(r);let o=await Xr({fs:n,gitdir:t,type:`blob`,object:a});i.insert({filepath:r,stats:c,oid:o})}}),l=await Promise.allSettled(c),u=l.filter(e=>e.status===`rejected`).map(e=>e.reason);if(u.length>1)throw new er(u);if(u.length===1)throw u[0];return l.filter(e=>e.status===`fulfilled`&&e.value).map(e=>e.value)}async function ti({fs:e,gitdir:t,path:n}){return(await Qt.get({fs:e,gitdir:t})).get(n)}function ni(e,...t){for(let n of t)if(n)for(let t of Object.keys(n)){let r=n[t];r!==void 0&&(e[t]=r)}return e}async function ri({fs:e,gitdir:t,author:n,commit:r}){let i=Math.floor(Date.now()/1e3),a=ni({},{name:await ti({fs:e,gitdir:t,path:`user.name`}),email:await ti({fs:e,gitdir:t,path:`user.email`})||``,timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},r?r.author:void 0,n);if(a.name!==void 0)return a}async function ii({fs:e,gitdir:t,author:n,committer:r,commit:i}){let a=Math.floor(Date.now()/1e3),o=ni({},{name:await ti({fs:e,gitdir:t,path:`user.name`}),email:await ti({fs:e,gitdir:t,path:`user.email`})||``,timestamp:a,timezoneOffset:new Date(a*1e3).getTimezoneOffset()},i?i.committer:void 0,n,r);if(o.name!==void 0)return o}async function ai({fs:e,cache:t,gitdir:n,oid:r}){let{type:i,object:a}=await In({fs:e,cache:t,gitdir:n,oid:r});if(i===`tag`)return r=yr.from(a).parse().object,ai({fs:e,cache:t,gitdir:n,oid:r});if(i!==`commit`)throw new Ct(r,i,`commit`);return{commit:Sr.from(a),oid:r}}async function oi({fs:e,cache:t,gitdir:n,oid:r}){let{commit:i,oid:a}=await ai({fs:e,cache:t,gitdir:n,oid:r});return{oid:a,commit:i.parse(),payload:i.withoutSignature()}}var si=`4b825dc642cb6eb9a060e54bf8d69288fbee4904`;async function ci({fs:e,cache:t,onSign:n,gitdir:r,message:i,author:a,committer:o,signingKey:s,amend:c=!1,dryRun:l=!1,noUpdateBranch:u=!1,disallowEmpty:d=!1,ref:f,parent:p,tree:m}){let h=!1,g=!1;f||=(g=!(await e.read(`${r}/HEAD`,{encoding:`utf8`})).startsWith(`ref:`),await X.resolve({fs:e,gitdir:r,ref:`HEAD`,depth:2}));let _,v;try{_=await X.resolve({fs:e,gitdir:r,ref:f}),v=await oi({fs:e,gitdir:r,oid:_,cache:{}})}catch{h=!0}if(c&&h)throw new lr(f);let y=c?await ri({fs:e,gitdir:r,author:a,commit:v.commit}):await ri({fs:e,gitdir:r,author:a});if(!y)throw new Qn(`author`);let b=c?await ii({fs:e,gitdir:r,author:y,committer:o,commit:v.commit}):await ii({fs:e,gitdir:r,author:y,committer:o});if(!b)throw new Qn(`committer`);return mt.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async function(t){let a=_t(t.entries).get(`.`);if(m||=await li({fs:e,gitdir:r,inode:a,dryRun:l}),p=p?await Promise.all(p.map(t=>X.resolve({fs:e,gitdir:r,ref:t}))):c?v.commit.parent:_?[_]:[],d&&!c&&(h&&m===si||!h&&m===v.commit.tree))throw new Un;if(!i){if(c)i=v.commit.message;else throw new $n(`message`)}let o=Sr.from({tree:m,parent:p,author:y,committer:b,message:i});s&&(o=await Sr.sign(o,n,s));let x=await Xr({fs:e,gitdir:r,type:`commit`,object:o.toObject(),dryRun:l});return!u&&!l&&await X.writeRef({fs:e,gitdir:r,ref:g?`HEAD`:f,value:x}),x})}async function li({fs:e,gitdir:t,inode:n,dryRun:r}){let i=n.children;for(let n of i)n.type===`tree`&&(n.metadata.mode=`040000`,n.metadata.oid=await li({fs:e,gitdir:t,inode:n,dryRun:r}));let a=i.map(e=>({mode:e.metadata.mode,path:e.basename,oid:e.metadata.oid,type:e.type}));return await Xr({fs:e,gitdir:t,type:`tree`,object:ln.from(a).toObject(),dryRun:r})}async function ui({fs:e,cache:t,gitdir:n,oid:r,filepath:i}){return(await di({fs:e,cache:t,gitdir:n,oid:r,filepath:i})).oid}async function di({fs:e,cache:t,gitdir:n,oid:r,filepath:i}){if(i.startsWith(`/`))throw new Jn(`leading-slash`);if(i.endsWith(`/`))throw new Jn(`trailing-slash`);let a=r,o=await Cr({fs:e,cache:t,gitdir:n,oid:r}),s=o.tree;return i===``?{mode:`040000`,oid:o.oid,path:``,type:`tree`}:fi({fs:e,cache:t,gitdir:n,tree:s,pathArray:i.split(`/`),oid:a,filepath:i})}async function fi({fs:e,cache:t,gitdir:n,tree:r,pathArray:i,oid:a,filepath:o}){let s=i.shift();for(let c of r)if(c.path===s){if(i.length===0)return c;{let{type:s,object:l}=await In({fs:e,cache:t,gitdir:n,oid:c.oid});if(s!==`tree`)throw new Ct(a,s,`tree`,o);return r=ln.from(l),fi({fs:e,cache:t,gitdir:n,tree:r,pathArray:i,oid:a,filepath:o})}}throw new St(`file or directory found at "${a}:${o}"`)}async function pi({fs:e,cache:t,gitdir:n,oid:r,filepath:i=void 0}){i!==void 0&&(r=await ui({fs:e,cache:t,gitdir:n,oid:r,filepath:i}));let{tree:a,oid:o}=await Cr({fs:e,cache:t,gitdir:n,oid:r});return{oid:o,tree:a.entries()}}async function mi({fs:e,gitdir:t,tree:n}){return await Xr({fs:e,gitdir:t,type:`tree`,object:ln.from(n).toObject(),format:`content`})}async function hi({fs:e,cache:t,onSign:n,gitdir:r,ref:i,oid:a,note:o,force:s,author:c,committer:l,signingKey:u}){let d;try{d=await X.resolve({gitdir:r,fs:e,ref:i})}catch(e){if(!(e instanceof St))throw e}let f=(await pi({fs:e,cache:t,gitdir:r,oid:d||`4b825dc642cb6eb9a060e54bf8d69288fbee4904`})).tree;if(s)f=f.filter(e=>e.path!==a);else for(let e of f)if(e.path===a)throw new Ln(`note`,a);typeof o==`string`&&(o=Buffer.from(o,`utf8`));let p=await Xr({fs:e,gitdir:r,type:`blob`,object:o,format:`content`});return f.push({mode:`100644`,path:a,oid:p,type:`blob`}),await ci({fs:e,cache:t,onSign:n,gitdir:r,ref:i,tree:await mi({fs:e,gitdir:r,tree:f}),parent:d&&[d],message:`Note added by 'isomorphic-git addNote'
|
|
51
|
+
`,author:c,committer:l,signingKey:u})}async function gi({fs:e,onSign:t,dir:n,gitdir:r=Y(n,`.git`),ref:i=`refs/notes/commits`,oid:a,note:o,force:s,author:c,committer:l,signingKey:u,cache:d={}}){try{Q(`fs`,e),Q(`gitdir`,r),Q(`oid`,a),Q(`note`,o),u&&Q(`onSign`,t);let n=new Z(e),f=await ri({fs:n,gitdir:r,author:c});if(!f)throw new Qn(`author`);let p=await ii({fs:n,gitdir:r,author:f,committer:l});if(!p)throw new Qn(`committer`);return await hi({fs:n,cache:d,onSign:t,gitdir:await $({fsp:n,dotgit:r}),ref:i,oid:a,note:o,force:s,author:f,committer:p,signingKey:u})}catch(e){throw e.caller=`git.addNote`,e}}var _i=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function vi(e,t){if(typeof e!=`string`)throw TypeError(`Reference name must be a string`);return!_i.test(e)&&(!!t||e.includes(`/`))}async function yi({fs:e,gitdir:t,remote:n,url:r,force:i}){if(!vi(n,!0))throw new Tt(n,Be.default.clean(n));let a=await Qt.get({fs:e,gitdir:t});if(!i&&(await a.getSubsections(`remote`)).includes(n)&&r!==await a.get(`remote.${n}.url`))throw new Ln(`remote`,n);await a.set(`remote.${n}.url`,r),await a.set(`remote.${n}.fetch`,`+refs/heads/*:refs/remotes/${n}/*`),await Qt.save({fs:e,gitdir:t,config:a})}async function bi({fs:e,dir:t,gitdir:n=Y(t,`.git`),remote:r,url:i,force:a=!1}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`remote`,r),Q(`url`,i);let t=new Z(e);return await yi({fs:t,gitdir:await $({fsp:t,dotgit:n}),remote:r,url:i,force:a})}catch(e){throw e.caller=`git.addRemote`,e}}async function xi({fs:e,cache:t,onSign:n,gitdir:r,ref:i,tagger:a,message:o=i,gpgsig:s,object:c,signingKey:l,force:u=!1}){if(i=i.startsWith(`refs/tags/`)?i:`refs/tags/${i}`,!u&&await X.exists({fs:e,gitdir:r,ref:i}))throw new Ln(`tag`,i);let d=await X.resolve({fs:e,gitdir:r,ref:c||`HEAD`}),{type:f}=await In({fs:e,cache:t,gitdir:r,oid:d}),p=yr.from({object:d,type:f,tag:i.replace(`refs/tags/`,``),tagger:a,message:o,gpgsig:s});l&&(p=await yr.sign(p,n,l));let m=await Xr({fs:e,gitdir:r,type:`tag`,object:p.toObject()});await X.writeRef({fs:e,gitdir:r,ref:i,value:m})}async function Si({fs:e,onSign:t,dir:n,gitdir:r=Y(n,`.git`),ref:i,tagger:a,message:o=i,gpgsig:s,object:c,signingKey:l,force:u=!1,cache:d={}}){try{Q(`fs`,e),Q(`gitdir`,r),Q(`ref`,i),l&&Q(`onSign`,t);let n=new Z(e),f=await $({fsp:n,dotgit:r}),p=await ri({fs:n,gitdir:f,author:a});if(!p)throw new Qn(`tagger`);return await xi({fs:n,cache:d,onSign:t,gitdir:f,ref:i,tagger:p,message:o,gpgsig:s,object:c,signingKey:l,force:u})}catch(e){throw e.caller=`git.annotatedTag`,e}}async function Ci({fs:e,gitdir:t,ref:n,object:r,checkout:i=!1,force:a=!1}){if(!vi(n,!0))throw new Tt(n,Be.default.clean(n));let o=`refs/heads/${n}`;if(!a&&await X.exists({fs:e,gitdir:t,ref:o}))throw new Ln(`branch`,n,!1);let s;try{s=await X.resolve({fs:e,gitdir:t,ref:r||`HEAD`})}catch{}s&&await X.writeRef({fs:e,gitdir:t,ref:o,value:s}),i&&await X.writeSymbolicRef({fs:e,gitdir:t,ref:`HEAD`,value:o})}async function wi({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r,object:i,checkout:a=!1,force:o=!1}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r);let t=new Z(e);return await Ci({fs:t,gitdir:await $({fsp:t,dotgit:n}),ref:r,object:i,checkout:a,force:o})}catch(e){throw e.caller=`git.branch`,e}}async function Ti(e,t,n){let r=n.split(`/`);r.pop();let i=t;for(let t of r){if(t===``||t===`.`)continue;i=`${i}/${t}`;let r=await e.lstat(i);if(r&&r.isSymbolicLink())throw new Ue(n)}}var Ei=(e,t)=>{if(e===`.`||t==null||t.length===0||t===`.`)return!0;let n=t.endsWith(`/`)?t.slice(0,-1):t;return n===`.`?!0:n.length>=e.length?n===e||n.startsWith(`${e}/`):e.startsWith(`${n}/`)};async function Di({fs:e,cache:t,onProgress:n,onPostCheckout:r,dir:i,gitdir:a,remote:o,ref:s,filepaths:c,noCheckout:l,noUpdateHead:u,dryRun:d,force:f,track:p=!0,restoreFromIndex:m=!1,nonBlocking:h=!1,batchSize:g=100}){let _;if(r)try{_=await X.resolve({fs:e,gitdir:a,ref:`HEAD`})}catch{_=`0000000000000000000000000000000000000000`}let v;try{v=await X.resolve({fs:e,gitdir:a,ref:s})}catch(t){if(s===`HEAD`)throw t;let n=`${o}/${s}`;if(v=await X.resolve({fs:e,gitdir:a,ref:n}),p){let t=await Qt.get({fs:e,gitdir:a});await t.set(`branch.${s}.remote`,o),await t.set(`branch.${s}.merge`,`refs/heads/${s}`),await Qt.save({fs:e,gitdir:a,config:t})}await X.writeRef({fs:e,gitdir:a,ref:`refs/heads/${s}`,value:v})}if(!l){let o;try{o=await Oi({fs:e,cache:t,onProgress:n,dir:i,gitdir:a,ref:s,force:f,filepaths:c,restoreFromIndex:m})}catch(e){throw e instanceof St&&e.data.what===v?new Hn(s,v):e}let l=o.filter(([e])=>e===`conflict`).map(([e,t])=>t);if(l.length>0)throw new zn(l);let u=o.filter(([e])=>e===`error`).map(([e,t])=>t);if(u.length>0)throw new J(u.join(`, `));if(d){r&&await r({previousHead:_,newHead:v,type:c!=null&&c.length>0?`file`:`branch`});return}let p=0,y=o.length;if(await mt.acquire({fs:e,gitdir:a,cache:t},async function(t){await Promise.all(o.filter(([e])=>e===`delete`||e===`delete-index`).map(async function([r,a]){let o=`${i}/${a}`;r===`delete`&&await e.rm(o),t.delete({filepath:a}),n&&await n({phase:`Updating workdir`,loaded:++p,total:y})}))}),await mt.acquire({fs:e,gitdir:a,cache:t},async function(t){for(let[r,a]of o)if(r===`rmdir`||r===`rmdir-index`){let o=`${i}/${a}`;try{r===`rmdir`&&await e.rmdir(o),t.delete({filepath:a}),n&&await n({phase:`Updating workdir`,loaded:++p,total:y})}catch(e){if(e.code===`ENOTEMPTY`)console.log(`Did not delete ${a} because directory is not empty`);else throw e}}}),await Promise.all(o.filter(([e])=>e===`mkdir`||e===`mkdir-index`).map(async function([t,r]){let a=`${i}/${r}`;await Ti(e,i,r),await e.mkdir(a),n&&await n({phase:`Updating workdir`,loaded:++p,total:y})})),h){let r=await ji(`Update Working Dir`,o.filter(([e])=>e===`create`||e===`create-index`||e===`update`||e===`mkdir-index`).map(([n,r,o,s,c])=>()=>Ai({fs:e,cache:t,gitdir:a,dir:i},[n,r,o,s,c])),n,g);await mt.acquire({fs:e,gitdir:a,cache:t,allowUnmerged:!0},async function(e){await ji(`Update Index`,r.map(([t,n,r])=>()=>ki({index:e,fullpath:t,oid:n,stats:r})),n,g)})}else await mt.acquire({fs:e,gitdir:a,cache:t,allowUnmerged:!0},async function(r){let s=await Promise.allSettled(o.filter(([e])=>e===`create`||e===`create-index`||e===`update`||e===`mkdir-index`).map(async function([o,s,c,l,u]){let d=`${i}/${s}`;if(o!==`create-index`&&o!==`mkdir-index`){await Ti(e,i,s);let{object:n}=await In({fs:e,cache:t,gitdir:a,oid:c});if(u&&await e.rm(d),l===33188)await e.write(d,n);else if(l===33261)await e.write(d,n,{mode:511});else if(l===40960)await e.writelink(d,n);else throw new J(`Invalid mode 0o${l.toString(8)} detected in blob ${c}`)}let f=await e.lstat(d);l===33261&&(f.mode=493),o===`mkdir-index`&&(f.mode=57344),r.insert({filepath:s,stats:f,oid:c}),n&&await n({phase:`Updating workdir`,loaded:++p,total:y})})),c=[];for(let e of s)e.status===`rejected`&&(c.push(e.reason),console.error(`[isomorphic-git checkout] task rejected:`,e.reason?.stack??e.reason));if(c.length>0)throw new er(c)});r&&await r({previousHead:_,newHead:v,type:c!=null&&c.length>0?`file`:`branch`})}if(!u){let t=await X.expand({fs:e,gitdir:a,ref:s});t.startsWith(`refs/heads`)?await X.writeSymbolicRef({fs:e,gitdir:a,ref:`HEAD`,value:t}):await X.writeRef({fs:e,gitdir:a,ref:`HEAD`,value:v})}}async function Oi({fs:e,cache:t,onProgress:n,dir:r,gitdir:i,ref:a,force:o,filepaths:s,restoreFromIndex:c}){let l=0;return Mr({fs:e,cache:t,dir:r,gitdir:i,trees:[c?xt():Tr({ref:a}),Dr(),xt()],map:async function(e,[t,r,i]){if(e!==`.`){if(s&&!s.some(t=>Ei(e,t)))return null;switch(n&&await n({phase:`Analyzing workdir`,loaded:++l}),[!!i,!!t,!!r].map(Number).join(``)){case`000`:return;case`001`:return!c&&o&&s&&s.includes(e)?[`delete`,e]:void 0;case`010`:switch(await t.type()){case`tree`:return[`mkdir`,e];case`blob`:return[`create`,e,await t.oid(),await t.mode()];case`commit`:return[`mkdir-index`,e,await t.oid(),await t.mode()];default:return[`error`,`new entry Unhandled type ${await t.type()}`]}case`011`:switch(`${await t.type()}-${await r.type()}`){case`tree-tree`:return;case`tree-blob`:case`blob-tree`:return[`conflict`,e];case`blob-blob`:return await t.oid()===await r.oid()?await t.mode()===await r.mode()?[`create-index`,e,await t.oid(),await t.mode()]:o?[`update`,e,await t.oid(),await t.mode(),!0]:[`conflict`,e]:o?[`update`,e,await t.oid(),await t.mode(),await t.mode()!==await r.mode()]:[`conflict`,e];case`commit-tree`:return;case`commit-blob`:return[`conflict`,e];default:return[`error`,`new entry Unhandled type ${t.type}`]}case`100`:return[`delete-index`,e];case`101`:switch(await i.type()){case`tree`:return[`rmdir-index`,e];case`blob`:return await i.oid()===await r.oid()||o?[`delete`,e]:[`conflict`,e];case`commit`:return[`rmdir-index`,e];default:return[`error`,`delete entry Unhandled type ${await i.type()}`]}case`110`:case`111`:switch(`${await i.type()}-${await t.type()}`){case`tree-tree`:return;case`blob-blob`:if(await i.oid()===await t.oid()&&await i.mode()===await t.mode()&&!o)return;if(r){if(await r.oid()!==await i.oid()&&await r.oid()!==await t.oid())return o?[`update`,e,await t.oid(),await t.mode(),await t.mode()!==await r.mode()]:[`conflict`,e]}else if(o)return[`update`,e,await t.oid(),await t.mode(),await t.mode()!==await i.mode()];return await t.mode()===await i.mode()?await t.oid()===await i.oid()?void 0:[`update`,e,await t.oid(),await t.mode(),!1]:[`update`,e,await t.oid(),await t.mode(),!0];case`tree-blob`:return[`update-dir-to-blob`,e,await t.oid()];case`blob-tree`:return[`update-blob-to-tree`,e];case`commit-commit`:return[`mkdir-index`,e,await t.oid(),await t.mode()];default:return[`error`,`update entry Unhandled type ${await i.type()}-${await t.type()}`]}}}},reduce:async function(e,t){return t=kr(t),e?e&&e[0]===`rmdir`?(t.push(e),t):(t.unshift(e),t):t}})}async function ki({index:e,fullpath:t,stats:n,oid:r}){try{e.insert({filepath:t,stats:n,oid:r})}catch(e){console.warn(`Error inserting ${t} into index:`,e)}}async function Ai({fs:e,cache:t,gitdir:n,dir:r},[i,a,o,s,c]){let l=`${r}/${a}`;if(i!==`create-index`&&i!==`mkdir-index`){await Ti(e,r,a);let{object:i}=await In({fs:e,cache:t,gitdir:n,oid:o});if(c&&await e.rm(l),s===33188)await e.write(l,i);else if(s===33261)await e.write(l,i,{mode:511});else if(s===40960)await e.writelink(l,i);else throw new J(`Invalid mode 0o${s.toString(8)} detected in blob ${o}`)}let u=await e.lstat(l);return s===33261&&(u.mode=493),i===`mkdir-index`&&(u.mode=57344),[a,o,u]}async function ji(e,t,n,r){let i=[],a=[];for(let o=0;o<t.length;o+=r){let s=t.slice(o,o+r).map(e=>e());(await Promise.allSettled(s)).forEach(t=>{t.status===`fulfilled`?i.push(t.value):(a.push(t.reason),console.error(`[isomorphic-git ${e}] task rejected:`,t.reason?.stack??t.reason))}),n&&await n({phase:`Updating workdir`,loaded:o+s.length,total:t.length})}if(a.length>0)throw new er(a);return i}async function Mi({fs:e,onProgress:t,onPostCheckout:n,dir:r,gitdir:i=Y(r,`.git`),remote:a=`origin`,ref:o,filepaths:s,noCheckout:c=!1,noUpdateHead:l=o===void 0,dryRun:u=!1,force:d=!1,track:f=!0,cache:p={},nonBlocking:m=!1,batchSize:h=100}){try{Q(`fs`,e),Q(`dir`,r),Q(`gitdir`,i);let g=o||`HEAD`,_=o===void 0&&s!=null&&s.length>0,v=new Z(e);return await Di({fs:v,cache:p,onProgress:t,onPostCheckout:n,dir:r,gitdir:await $({fsp:v,dotgit:i}),remote:a,ref:g,filepaths:s,noCheckout:c,noUpdateHead:l,dryRun:u,force:d,track:f,restoreFromIndex:_,nonBlocking:m,batchSize:h})}catch(e){throw e.caller=`git.checkout`,e}}var Ni=/^.*(\r?\n|$)/gm;function Pi({branches:e,contents:t}){let n=e[1],r=e[2],i=t[0],a=t[1],o=t[2],s=a.match(Ni),c=i.match(Ni),l=o.match(Ni),u=(0,Ve.default)(s,c,l),d=``,f=!0;for(let e of u)e.ok&&(d+=e.ok.join(``)),e.conflict&&(f=!1,d+=`${`<`.repeat(7)} ${n}\n`,d+=e.conflict.a.join(``),d+=`${`=`.repeat(7)}\n`,d+=e.conflict.b.join(``),d+=`${`>`.repeat(7)} ${r}\n`);return{cleanMerge:f,mergedText:d}}async function Fi({fs:e,cache:t,dir:n,gitdir:r=Y(n,`.git`),index:i,ourOid:a,baseOid:o,theirOid:s,ourName:c=`ours`,baseName:l=`base`,theirName:u=`theirs`,dryRun:d=!1,abortOnConflict:f=!0,mergeDriver:p}){let m=Tr({ref:a}),h=Tr({ref:o}),g=Tr({ref:s}),_=[],v=[],y=[],b=[],x=await Mr({fs:e,cache:t,dir:n,gitdir:r,trees:[m,h,g],map:async function(t,[n,a,o]){let s=ht(t);switch(`${await Hr(n,a)}-${await Hr(o,a)}`){case`false-false`:return{mode:await a.mode(),path:s,oid:await a.oid(),type:await a.type()};case`false-true`:return!o&&await n.type()===`tree`?{mode:await n.mode(),path:s,oid:await n.oid(),type:await n.type()}:o?{mode:await o.mode(),path:s,oid:await o.oid(),type:await o.type()}:void 0;case`true-false`:return!n&&await o.type()===`tree`?{mode:await o.mode(),path:s,oid:await o.oid(),type:await o.type()}:n?{mode:await n.mode(),path:s,oid:await n.oid(),type:await n.type()}:void 0;case`true-true`:if(n&&o&&await n.type()===`tree`&&await o.type()===`tree`)return{mode:await n.mode(),path:s,oid:await n.oid(),type:`tree`};if(n&&o&&await n.type()===`blob`&&await o.type()===`blob`)return Ii({fs:e,gitdir:r,path:s,ours:n,base:a,theirs:o,ourName:c,baseName:l,theirName:u,mergeDriver:p}).then(async e=>{if(e.cleanMerge)f||i.insert({filepath:t,oid:e.mergeResult.oid,stage:0});else if(_.push(t),v.push(t),!f){let e=``;a&&await a.type()===`blob`&&(e=await a.oid());let r=await n.oid(),s=await o.oid();i.delete({filepath:t}),e&&i.insert({filepath:t,oid:e,stage:1}),i.insert({filepath:t,oid:r,stage:2}),i.insert({filepath:t,oid:s,stage:3})}return e.mergeResult});if(a&&!n&&o&&await a.type()===`blob`&&await o.type()===`blob`){if(_.push(t),y.push(t),!f){let e=await a.oid(),n=await o.oid();i.delete({filepath:t}),i.insert({filepath:t,oid:e,stage:1}),i.insert({filepath:t,oid:n,stage:3})}return{mode:await o.mode(),oid:await o.oid(),type:`blob`,path:s}}if(a&&n&&!o&&await a.type()===`blob`&&await n.type()===`blob`){if(_.push(t),b.push(t),!f){let e=await a.oid(),r=await n.oid();i.delete({filepath:t}),i.insert({filepath:t,oid:e,stage:1}),i.insert({filepath:t,oid:r,stage:2})}return{mode:await n.mode(),oid:await n.oid(),type:`blob`,path:s}}if(a&&!n&&!o&&(await a.type()===`blob`||await a.type()===`tree`))return;throw new Xn}},reduce:_.length!==0&&(!n||f)?void 0:async(t,n)=>{let i=n.filter(Boolean);if(t&&!(t&&t.type===`tree`&&i.length===0&&t.path!==`.`))return(i.length>0||t.path===`.`&&i.length===0)&&(t.oid=await Xr({fs:e,gitdir:r,type:`tree`,object:new ln(i).toObject(),dryRun:d})),t}});return _.length===0?x.oid:(n&&!f&&await Mr({fs:e,cache:t,dir:n,gitdir:r,trees:[Tr({ref:x.oid})],map:async function(t,[r]){let i=`${n}/${t}`;if(await r.type()===`blob`){let t=await r.mode(),n=await r.content();await e.write(i,n,{mode:t})}return!0}}),new Zn(_,v,y,b))}async function Ii({fs:e,gitdir:t,path:n,ours:r,base:i,theirs:a,ourName:o,theirName:s,baseName:c,dryRun:l,mergeDriver:u=Pi}){let d=`blob`,f=`100755`,p=``,m=``;i&&await i.type()===`blob`&&(f=await i.mode(),p=await i.oid(),m=Buffer.from(await i.content()).toString(`utf8`));let h=f===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:d}};if(await r.oid()===p)return{cleanMerge:!0,mergeResult:{mode:h,path:n,oid:await a.oid(),type:d}};if(await a.oid()===p)return{cleanMerge:!0,mergeResult:{mode:h,path:n,oid:await r.oid(),type:d}};let g=Buffer.from(await r.content()).toString(`utf8`),_=Buffer.from(await a.content()).toString(`utf8`),{mergedText:v,cleanMerge:y}=await u({branches:[c,o,s],contents:[m,g,_],path:n});return{cleanMerge:y,mergeResult:{mode:h,path:n,oid:await Xr({fs:e,gitdir:t,type:`blob`,object:Buffer.from(v,`utf8`),dryRun:l}),type:d}}}var Li={stage:xt,workdir:Dr};async function Ri(e,t,n,r,i=null){let a=Y(n,r),o=await e.lstat(a);if(!o)throw new St(a);if(o.isDirectory())throw new J(`${a}: file expected, but found directory`);let s=i?await dn({fs:e,gitdir:t,oid:i}):void 0,c=s?i:void 0;return s||await lt(a,async()=>{let n=o.isSymbolicLink()?await e.readlink(a).then(Zr):await e.read(a);if(n===null)throw new St(a);c=await Xr({fs:e,gitdir:t,type:`blob`,object:n})}),c}async function zi({fs:e,dir:t,gitdir:n,entries:r}){async function i(r){return r.type===`tree`?r.oid||(r.oid=await mi({fs:e,gitdir:n,tree:await Promise.all(r.children.map(i))}),r.mode=16384):r.type===`blob`&&(r.oid=await Ri(e,n,t,r.path,r.oid),r.mode=33188),r.path=r.path.split(`/`).pop(),r}return Promise.all(r.map(i))}async function Bi({fs:e,dir:t,gitdir:n,treePair:r}){let i=r[1]===`stage`,a=r.map(e=>typeof e==`string`?Li[e]():e),o=[],s=await Mr({fs:e,cache:{},dir:t,gitdir:n,trees:a,map:async(r,[i,a])=>{if(!(r===`.`||await Wr.isIgnored({fs:e,dir:t,gitdir:n,filepath:r}))&&a)return(!i||await i.oid()!==await a.oid()&&await a.oid()!==void 0)&&o.push([i,a]),{mode:await a.mode(),path:r,oid:await a.oid(),type:await a.type()}},reduce:async(e,t)=>(t=t.filter(Boolean),e?(e.children=t,e):t.length>0?t:void 0),iterate:async(n,r)=>{let a=[];for(let n of r){let[r,s]=n;i?s&&(await e.exists(`${t}/${s.toString()}`)?a.push(n):o.push([null,s])):r&&(s?a.push(n):o.push([r,null]))}return a.length?Promise.all(a.map(n)):[]}});return o.length===0||s.length===0?null:mi({fs:e,gitdir:n,tree:(await zi({fs:e,dir:t,gitdir:n,entries:s})).filter(Boolean).map(e=>({mode:e.mode,path:e.path,oid:e.oid,type:e.type}))})}async function Vi({fs:e,dir:t,gitdir:n,stashCommit:r,parentCommit:i,wasStaged:a}){let o=[],s=[],c=await Mr({fs:e,cache:{},dir:t,gitdir:n,trees:[Tr({ref:i}),Tr({ref:r})],map:async(r,[i,c])=>{if(r===`.`||await Wr.isIgnored({fs:e,dir:t,gitdir:n,filepath:r}))return;let l=c?await c.type():await i.type();if(l!==`tree`&&l!==`blob`)return;if(!c&&i){let e=l===`tree`?`rmdir`:`rm`;return l===`tree`&&o.push(r),l===`blob`&&a&&s.push({filepath:r,oid:await i.oid()}),{method:e,filepath:r}}let u=await c.oid();if(!i||await i.oid()!==u)return l===`tree`?{method:`mkdir`,filepath:r}:(a&&s.push({filepath:r,oid:u,stats:await e.lstat(Y(t,r))}),{method:`write`,filepath:r,oid:u})}});await lt(n,async()=>{for(let r of c){let i=Y(t,r.filepath);switch(r.method){case`rmdir`:await e.rmdir(i);break;case`mkdir`:await Ti(e,t,r.filepath),await e.mkdir(i);break;case`rm`:await e.rm(i);break;case`write`:if(!o.some(e=>i.startsWith(e))){await Ti(e,t,r.filepath);let{object:a}=await In({fs:e,cache:{},gitdir:n,oid:r.oid});await e.exists(i)&&await e.rm(i),await e.write(i,a)}}}}),await mt.acquire({fs:e,gitdir:n,cache:{}},async e=>{s.forEach(({filepath:t,stats:n,oid:r})=>{e.insert({filepath:t,stats:n,oid:r})})})}async function Hi({fs:e,cache:t,dir:n,gitdir:r,oid:i,dryRun:a=!1,noUpdateBranch:o=!1,abortOnConflict:s=!0,committer:c,mergeDriver:l}){let{commit:u,oid:d}=await oi({fs:e,cache:t,gitdir:r,oid:i});if(u.parent.length>1)throw new Bn(d,u.parent.length);if(u.parent.length===0)throw new Vn(d);let f=await X.resolve({fs:e,gitdir:r,ref:`HEAD`}),{commit:p}=await oi({fs:e,cache:t,gitdir:r,oid:f}),m=u.parent[0],{commit:h}=await oi({fs:e,cache:t,gitdir:r,oid:m}),g=await mt.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async i=>Fi({fs:e,cache:t,dir:n,gitdir:r,index:i,ourOid:p.tree,baseOid:h.tree,theirOid:u.tree,ourName:`HEAD`,baseName:`parent of ${d.slice(0,7)}`,theirName:d.slice(0,7),dryRun:a,abortOnConflict:s,mergeDriver:l}));if(g instanceof Zn)throw g;let _=await ci({fs:e,cache:t,gitdir:r,message:u.message,tree:g,parent:[f],author:u.author,committer:c,dryRun:a,noUpdateBranch:o});return n&&!a&&!o&&await Vi({fs:e,dir:n,gitdir:r,stashCommit:_,parentCommit:f,wasStaged:!0}),_}async function Ui({fs:e,dir:t,gitdir:n=Y(t,`.git`),oid:r,cache:i={},committer:a,dryRun:o=!1,noUpdateBranch:s=!1,abortOnConflict:c=!0,mergeDriver:l}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oid`,r);let u=new Z(e),d=await $({fsp:u,dotgit:n}),{commit:f}=await oi({fs:u,cache:i,gitdir:d,oid:r});if(f.parent&&f.parent.length>1)return await Hi({fs:u,cache:i,dir:t,gitdir:d,oid:r,dryRun:o,noUpdateBranch:s,abortOnConflict:c,committer:void 0,mergeDriver:l});let p=await ii({fs:u,gitdir:d,committer:a});if(!p)throw new Qn(`committer`);return await Hi({fs:u,cache:i,dir:t,gitdir:d,oid:r,dryRun:o,noUpdateBranch:s,abortOnConflict:c,committer:p,mergeDriver:l})}catch(e){throw e.caller=`git.cherryPick`,e}}var Wi=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function Gi(e){let t=Wi.exec(e);return t?t[1]===`remotes/`&&e.endsWith(`/HEAD`)?t[2].slice(0,-5):t[2]:e}async function Ki({fs:e,gitdir:t,fullname:n=!1,test:r=!1}){let i=await X.resolve({fs:e,gitdir:t,ref:`HEAD`,depth:2});if(r)try{await X.resolve({fs:e,gitdir:t,ref:i})}catch{return}if(i.startsWith(`refs/`))return n?i:Gi(i)}function qi(e){return e=e.replace(/^[^/@:]+@([^/@:]+):/,`https://$1/`),e=e.replace(/^ssh:\/\//,`https://`),e}function Ji({username:e=``,password:t=``}){return`Basic ${Buffer.from(`${e}:${t}`).toString(`base64`)}`}async function Yi(e,t){let n=_n(e);for(;;){let{value:e,done:r}=await n.next();if(e&&await t(e),r)break}n.return&&n.return()}async function Xi(e){let t=0,n=[];await Yi(e,e=>{n.push(e),t+=e.byteLength});let r=new Uint8Array(t),i=0;for(let e of n)r.set(e,i),i+=e.byteLength;return r}var Zi=/^(https?:\/\/)([^/?#]+)@/i;function Qi(e){let t=e.match(Zi);return t==null?{url:e,auth:{}}:{url:e.replace(Zi,`$1`),auth:$i(e,t[2])}}function $i(e,t){let n=ea(e),r=t.indexOf(`:`)!==-1;if(n!==null)return{username:ta(n.username),password:r?ta(n.password):void 0};let i=t.indexOf(`:`);return{username:r?t.slice(0,i):t,password:r?t.slice(i+1):void 0}}function ea(e){if(typeof URL!=`function`)return null;try{return new URL(e)}catch{return null}}function ta(e){try{return decodeURIComponent(e)}catch{return e}}function na(e,t){let n=t.toString(16);return`0`.repeat(e-n.length)+n}var ra=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 t=na(4,e.length+4);return Buffer.concat([Buffer.from(t,`utf8`),e])}static streamReader(e){let t=new vn(e);return async function(){try{let e=await t.read(4);return e==null||(e=parseInt(e.toString(`utf8`),16),e===0||e===1?null:await t.read(e-4)??!0)}catch(t){return e.error=t,!0}}}};async function ia(e){let t={},n;for(;n=await e(),n!==!0;){if(n===null)continue;n=n.toString(`utf8`).replace(/\n$/,``);let e=n.indexOf(`=`);if(e>-1){let r=n.slice(0,e);t[r]=n.slice(e+1)}else t[n]=!0}return{protocolVersion:2,capabilities2:t}}async function aa(e,{service:t}){let n=new Set,r=new Map,i=new Map,a=ra.streamReader(e),o=await a();for(;o===null;)o=await a();if(o===!0)throw new Wn;if(o.includes(`version 2`))return ia(a);if(o.toString(`utf8`).replace(/\n$/,``)!==`# service=${t}`)throw new tr(`# service=${t}\\n`,o.toString(`utf8`));let s=await a();for(;s===null;)s=await a();if(s===!0)return{capabilities:n,refs:r,symrefs:i};if(s=s.toString(`utf8`),s.includes(`version 2`))return ia(a);let[c,l]=oa(s,`\0`,`\\x00`);if(l.split(` `).map(e=>n.add(e)),c!==`0000000000000000000000000000000000000000 capabilities^{}`){let[e,t]=oa(c,` `,` `);for(r.set(t,e);;){let e=await a();if(e===!0)break;if(e!==null){let[t,n]=oa(e.toString(`utf8`),` `,` `);r.set(n,t)}}}for(let e of n)if(e.startsWith(`symref=`)){let t=e.match(/symref=([^:]+):(.*)/);t.length===3&&i.set(t[1],t[2])}return{protocolVersion:1,capabilities:n,refs:r,symrefs:i}}function oa(e,t,n){let r=e.trim().split(t);if(r.length!==2)throw new tr(`Two strings separated by '${n}'`,e.toString(`utf8`));return r}var sa=(e,t)=>e.endsWith(`?`)?`${e}${t}`:`${e}/${t.replace(/^https?:\/\//,``)}`,ca=(e,t)=>{(t.username||t.password)&&(e.Authorization=Ji(t)),t.headers&&Object.assign(e,t.headers)},la=async e=>{try{let t=Buffer.from(await Xi(e.body)),n=t.toString(`utf8`);return{preview:n.length<256?n:n.slice(0,256)+`...`,response:n,data:t}}catch{return{}}},ua=class{static async capabilities(){return[`discover`,`connect`]}static async discover({http:e,onProgress:t,onAuth:n,onAuthSuccess:r,onAuthFailure:i,corsProxy:a,service:o,url:s,headers:c,protocolVersion:l}){let{url:u,auth:d}=Qi(s),f=a?sa(a,u):u;(d.username||d.password)&&(c.Authorization=Ji(d)),l===2&&(c[`Git-Protocol`]=`version=2`);let p,m,h=!1;do if(p=await e.request({onProgress:t,method:`GET`,url:`${f}/info/refs?service=${o}`,headers:c}),m=!1,p.statusCode===401||p.statusCode===203){let e=h?i:n;if(e){if(d=await e(u,{...d,headers:{...c}}),d&&d.cancel)throw new sr;d&&(ca(c,d),h=!0,m=!0)}}else p.statusCode===200&&h&&r&&await r(u,d);while(m);if(p.statusCode!==200){let{response:e}=await la(p);throw new qn(p.statusCode,p.statusMessage,e)}if(p.headers[`content-type`]===`application/x-${o}-advertisement`){let e=await aa(p.body,{service:o});return e.auth=d,e}{let{preview:e,response:t,data:n}=await la(p);try{let e=await aa([n],{service:o});return e.auth=d,e}catch{throw new ir(e,t)}}}static async connect({http:e,onProgress:t,corsProxy:n,service:r,url:i,auth:a,body:o,headers:s}){let c=Qi(i);c&&(i=c.url),n&&(i=sa(n,i)),s[`content-type`]=`application/x-${r}-request`,s.accept=`application/x-${r}-result`,ca(s,a);let l=await e.request({onProgress:t,method:`POST`,url:`${i}/${r}`,body:o,headers:s});if(l.statusCode!==200){let{response:e}=la(l);throw new qn(l.statusCode,l.statusMessage,e)}return l}},da=class{static getRemoteHelperFor({url:e}){let t=new Map;t.set(`http`,ua),t.set(`https`,ua);let n=pa({url:e});if(!n)throw new or(e);if(t.has(n.transport))return t.get(n.transport);throw new ar(e,n.transport,n.transport===`ssh`?qi(e):void 0)}},fa=/^[^/@:]+@[^/@:]+:/;function pa({url:e}){if(fa.test(e))return{transport:`ssh`,address:e};let t=e.match(/(\w+)(:\/\/|::)(.*)/);if(t!==null){if(t[2]===`://`)return{transport:t[1],address:t[0]};if(t[2]===`::`)return{transport:t[1],address:t[3]}}}var ma=class{static async read({fs:e,gitdir:t}){let n=Y(t,`shallow`),r=new Set;return await lt(n,async function(){let t=await e.read(n,{encoding:`utf8`});if(t===null||t.trim()===``)return r;t.trim().split(`
|
|
52
|
+
`).map(e=>r.add(e))}),r}static async write({fs:e,gitdir:t,oids:n}){let r=Y(t,`shallow`);if(n.size>0){let t=[...n].join(`
|
|
53
|
+
`)+`
|
|
54
|
+
`;await lt(r,async function(){await e.write(r,t,{encoding:`utf8`})})}else await lt(r,async function(){await e.rm(r)})}};async function ha({fs:e,gitdir:t,oid:n}){let r=`objects/${n.slice(0,2)}/${n.slice(2)}`;return e.exists(`${t}/${r}`)}async function ga({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i}){let a=await e.readdir(Y(n,`objects/pack`));a=a.filter(e=>e.endsWith(`.idx`));for(let o of a){let a=await jn({fs:e,cache:t,filename:`${n}/objects/pack/${o}`,getExternalRefDelta:i});if(a.error)throw new J(a.error);if(a.offsets.has(r))return!0}return!1}async function _a({fs:e,cache:t,gitdir:n,oid:r,format:i=`content`}){let a=r=>In({fs:e,cache:t,gitdir:n,oid:r}),o=await ha({fs:e,gitdir:n,oid:r});return o||=await ga({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:a}),o}function va({config:e,onAuth:t}){return t&&(async(n,r)=>{let i=r.username||await e.get(`credential.${n}.username`);return t(n,i?{...r,username:i}:r)})}function ya(e){return e.slice(0,12).toString(`hex`)===`5041434b0000000200000000`}function ba(e,t){let n=e.map(e=>e.split(`=`,1)[0]);return t.filter(e=>{let t=e.split(`=`,1)[0];return n.includes(t)})}var xa={name:`isomorphic-git`,version:`1.41.9`,agent:`git/isomorphic-git@1.41.9`},Sa=class{constructor(){this._queue=[]}write(e){if(this._ended)throw Error(`You cannot write to a FIFO that has already been ended!`);if(this._waiting){let t=this._waiting;this._waiting=null,t({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error(`You cannot call read until the previous call to read has returned!`);return new Promise(e=>{this._waiting=e})}};function Ca(e){let t=e.indexOf(`\r`),n=e.indexOf(`
|
|
55
|
+
`);return t===-1&&n===-1?-1:t===-1?n+1:n===-1?t+1:n===t+1?n+1:Math.min(t,n)+1}function wa(e){let t=new Sa,n=``;return(async()=>{await Yi(e,e=>{for(e=e.toString(`utf8`),n+=e;;){let e=Ca(n);if(e===-1||e===n.length&&n[e-1]===`\r`)break;t.write(n.slice(0,e)),n=n.slice(e)}}),n.length>0&&t.write(n),t.end()})(),t}var Ta=class{static demux(e){let t=ra.streamReader(e),n=new Sa,r=new Sa,i=new Sa,a=async function(){let o=await t();if(o===null)return a();if(o===!0){n.end(),i.end(),e.error?r.destroy(e.error):r.end();return}switch(o[0]){case 1:r.write(o.slice(1));break;case 2:i.write(o.slice(1));break;case 3:{let e=o.slice(1);i.write(e),n.end(),i.end(),r.destroy(Error(e.toString(`utf8`)));return}default:n.write(o)}a()};return a(),{packetlines:n,packfile:r,progress:i}}};async function Ea(e){let{packetlines:t,packfile:n,progress:r}=Ta.demux(e),i=[],a=[],o=[],s=!1,c=!1;return new Promise((l,u)=>{Yi(t,t=>{let d=t.toString(`utf8`).trim();if(d.startsWith(`shallow`)){let e=d.slice(-41).trim();e.length!==40&&u(new wt(e)),i.push(e)}else if(d.startsWith(`unshallow`)){let e=d.slice(-41).trim();e.length!==40&&u(new wt(e)),a.push(e)}else if(d.startsWith(`ACK`)){let[,e,t]=d.split(` `);o.push({oid:e,status:t}),t||(c=!0)}else d.startsWith(`NAK`)?(s=!0,c=!0):(c=!0,s=!0);c&&(e.error?u(e.error):l({shallows:i,unshallows:a,acks:o,nak:s,packfile:n,progress:r}))}).finally(()=>{c||(e.error?u(e.error):l({shallows:i,unshallows:a,acks:o,nak:s,packfile:n,progress:r}))})})}function Da({capabilities:e=[],wants:t=[],haves:n=[],shallows:r=[],depth:i=null,since:a=null,exclude:o=[]}){let s=[];t=[...new Set(t)];let c=` ${e.join(` `)}`;for(let e of t)s.push(ra.encode(`want ${e}${c}\n`)),c=``;for(let e of r)s.push(ra.encode(`shallow ${e}\n`));i!==null&&s.push(ra.encode(`deepen ${i}\n`)),a!==null&&s.push(ra.encode(`deepen-since ${Math.floor(a.valueOf()/1e3)}\n`));for(let e of o)s.push(ra.encode(`deepen-not ${e}\n`));s.push(ra.flush());for(let e of n)s.push(ra.encode(`have ${e}\n`));return s.push(ra.encode(`done
|
|
56
|
+
`)),s}async function Oa({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:c,ref:l,remoteRef:u,remote:d,url:f,corsProxy:p,depth:m=null,since:h=null,exclude:g=[],relative:_=!1,tags:v=!1,singleBranch:y=!1,headers:b={},prune:x=!1,pruneTags:S=!1}){let C=l||await Ki({fs:e,gitdir:c,test:!0}),w=await Qt.get({fs:e,gitdir:c}),T=d||C&&await w.get(`branch.${C}.remote`)||`origin`,E=f||await w.get(`remote.${T}.url`);if(E===void 0)throw new $n(`remote OR url`);let D=u||C&&await w.get(`branch.${C}.merge`)||l||`HEAD`;p===void 0&&(p=await w.get(`http.corsProxy`));let O=da.getRemoteHelperFor({url:E}),k=await O.discover({http:n,onAuth:va({config:w,onAuth:a}),onAuthSuccess:o,onAuthFailure:va({config:w,onAuth:s}),corsProxy:p,service:`git-upload-pack`,url:E,headers:b,protocolVersion:1}),A=k.auth,j=k.refs;if(j.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(m!==null&&!k.capabilities.has(`shallow`))throw new rr(`shallow`,`depth`);if(h!==null&&!k.capabilities.has(`deepen-since`))throw new rr(`deepen-since`,`since`);if(g.length>0&&!k.capabilities.has(`deepen-not`))throw new rr(`deepen-not`,`exclude`);if(_===!0&&!k.capabilities.has(`deepen-relative`))throw new rr(`deepen-relative`,`relative`);let{oid:M,fullref:ee}=X.resolveAgainstMap({ref:D,map:j});for(let e of j.keys())e===ee||e===`HEAD`||e.startsWith(`refs/heads/`)||v&&e.startsWith(`refs/tags/`)||j.delete(e);let te=ba([...k.capabilities],[`multi_ack_detailed`,`no-done`,`side-band-64k`,`ofs-delta`,`agent=${xa.agent}`]);_&&te.push(`deepen-relative`);let ne=y?[M]:j.values(),re=y?[C]:await X.listRefs({fs:e,gitdir:c,filepath:`refs`}),ie=[];for(let n of re)try{n=await X.expand({fs:e,gitdir:c,ref:n});let r=await X.resolve({fs:e,gitdir:c,ref:n});await _a({fs:e,cache:t,gitdir:c,oid:r})&&ie.push(r)}catch{}ie=[...new Set(ie)];let ae=await ma.read({fs:e,gitdir:c}),oe=k.capabilities.has(`shallow`)?[...ae]:[],se=Da({capabilities:te,wants:ne,haves:ie,shallows:oe,depth:m,since:h,exclude:g}),ce=Buffer.from(await Xi(se)),le=await O.connect({http:n,onProgress:r,corsProxy:p,service:`git-upload-pack`,url:E,auth:A,body:[ce],headers:b}),N=await Ea(le.body);le.headers&&(N.headers=le.headers);for(let n of N.shallows)if(!ae.has(n))try{let{object:r}=await In({fs:e,cache:t,gitdir:c,oid:n}),i=new Sr(r),a=await Promise.all(i.headers().parent.map(n=>_a({fs:e,cache:t,gitdir:c,oid:n})));a.length===0||a.every(e=>e)||ae.add(n)}catch{ae.add(n)}for(let e of N.unshallows)ae.delete(e);if(await ma.write({fs:e,gitdir:c,oids:ae}),y){let t=new Map([[ee,M]]),n=new Map,r=10,i=ee;for(;r--;){let e=k.symrefs.get(i);if(e===void 0)break;n.set(i,e),i=e}let a=j.get(i);a&&t.set(i,a);let{pruned:o}=await X.updateRemoteRefs({fs:e,gitdir:c,remote:T,refs:t,symrefs:n,tags:v,prune:x});x&&(N.pruned=o)}else{let{pruned:t}=await X.updateRemoteRefs({fs:e,gitdir:c,remote:T,refs:j,symrefs:k.symrefs,tags:v,prune:x,pruneTags:S});x&&(N.pruned=t)}if(N.HEAD=k.symrefs.get(`HEAD`),N.HEAD===void 0){let{oid:e}=X.resolveAgainstMap({ref:`HEAD`,map:j});for(let[t,n]of j.entries())if(t!==`HEAD`&&n===e){N.HEAD=t;break}}N.FETCH_HEAD={oid:M,description:`${ee.startsWith(`refs/tags`)?`tag`:`branch`} '${Gi(ee)}' of ${E}`},(r||i)&&Yi(wa(N.progress),async e=>{if(i&&await i(e),r){let t=e.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);t&&await r({phase:t[1].trim(),loaded:parseInt(t[2],10),total:parseInt(t[3],10)})}});let P=Buffer.from(await Xi(N.packfile));if(le.body.error)throw le.body.error;let ue=P.slice(-20).toString(`hex`),de={defaultBranch:N.HEAD,fetchHead:N.FETCH_HEAD.oid,fetchHeadDescription:N.FETCH_HEAD.description};if(N.headers&&(de.headers=N.headers),x&&(de.pruned=N.pruned),ue!==``&&!ya(P)){de.packfile=`objects/pack/pack-${ue}.pack`;let n=Y(c,de.packfile);await e.write(n,P);let i=await On.fromPack({pack:P,getExternalRefDelta:n=>In({fs:e,cache:t,gitdir:c,oid:n}),onProgress:r});await e.write(n.replace(/\.pack$/,`.idx`),await i.toBuffer())}return de}async function ka({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:Y(n,`.git`),defaultBranch:i=`master`}){if(await e.exists(r+`/config`))return;let a=[`hooks`,`info`,`objects/info`,`objects/pack`,`refs/heads`,`refs/tags`];a=a.map(e=>r+`/`+e);for(let t of a)await e.mkdir(t);await e.write(r+`/config`,`[core]
|
|
57
|
+
repositoryformatversion = 0
|
|
58
|
+
filemode = false
|
|
59
|
+
\tbare = ${t}\n`+(t?``:` logallrefupdates = true
|
|
60
|
+
`)+` symlinks = false
|
|
61
|
+
ignorecase = true
|
|
62
|
+
`),await e.write(r+`/HEAD`,`ref: refs/heads/${i}\n`)}async function Aa({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,onPostCheckout:c,dir:l,gitdir:u,url:d,corsProxy:f,ref:p,remote:m,depth:h,since:g,exclude:_,relative:v,singleBranch:y,noCheckout:b,noTags:x,headers:S,nonBlocking:C,batchSize:w=100}){try{if(await ka({fs:e,gitdir:u}),await yi({fs:e,gitdir:u,remote:m,url:d,force:!1}),f){let t=await Qt.get({fs:e,gitdir:u});await t.set(`http.corsProxy`,f),await Qt.save({fs:e,gitdir:u,config:t})}let{defaultBranch:T,fetchHead:E}=await Oa({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:u,ref:p,remote:m,corsProxy:f,depth:h,since:g,exclude:_,relative:v,singleBranch:y,headers:S,tags:!x});if(E===null)return;p||=T,p=p.replace(`refs/heads/`,``),await Di({fs:e,cache:t,onProgress:r,onPostCheckout:c,dir:l,gitdir:u,ref:p,remote:m,noCheckout:b,nonBlocking:C,batchSize:w})}catch(t){throw await e.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>void 0),t}}async function ja({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:s,dir:c,gitdir:l=Y(c,`.git`),url:u,corsProxy:d=void 0,ref:f=void 0,remote:p=`origin`,depth:m=void 0,since:h=void 0,exclude:g=[],relative:_=!1,singleBranch:v=!1,noCheckout:y=!1,noTags:b=!1,headers:x={},cache:S={},nonBlocking:C=!1,batchSize:w=100}){try{Q(`fs`,e),Q(`http`,t),Q(`gitdir`,l),y||Q(`dir`,c),Q(`url`,u);let T=new Z(e);return await Aa({fs:T,cache:S,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:s,dir:c,gitdir:await $({fsp:T,dotgit:l}),url:u,corsProxy:d,ref:f,remote:p,depth:m,since:h,exclude:g,relative:_,singleBranch:v,noCheckout:y,noTags:b,headers:x,nonBlocking:C,batchSize:w})}catch(e){throw e.caller=`git.clone`,e}}async function Ma({fs:e,onSign:t,dir:n,gitdir:r=Y(n,`.git`),message:i,author:a,committer:o,signingKey:s,amend:c=!1,dryRun:l=!1,noUpdateBranch:u=!1,disallowEmpty:d=!1,ref:f,parent:p,tree:m,cache:h={}}){try{Q(`fs`,e),c||Q(`message`,i),s&&Q(`onSign`,t);let n=new Z(e);return await ci({fs:n,cache:h,onSign:t,gitdir:await $({fsp:n,dotgit:r}),message:i,author:a,committer:o,signingKey:s,amend:c,dryRun:l,noUpdateBranch:u,disallowEmpty:d,ref:f,parent:p,tree:m})}catch(e){throw e.caller=`git.commit`,e}}async function Na({fs:e,dir:t,gitdir:n=Y(t,`.git`),fullname:r=!1,test:i=!1}){try{Q(`fs`,e),Q(`gitdir`,n);let t=new Z(e);return await Ki({fs:t,gitdir:await $({fsp:t,dotgit:n}),fullname:r,test:i})}catch(e){throw e.caller=`git.currentBranch`,e}}async function Pa({fs:e,gitdir:t,ref:n}){if(n=n.startsWith(`refs/heads/`)?n:`refs/heads/${n}`,!await X.exists({fs:e,gitdir:t,ref:n}))throw new St(n);let r=await X.expand({fs:e,gitdir:t,ref:n});if(r===await Ki({fs:e,gitdir:t,fullname:!0})){let n=await X.resolve({fs:e,gitdir:t,ref:r});await X.writeRef({fs:e,gitdir:t,ref:`HEAD`,value:n})}await X.deleteRef({fs:e,gitdir:t,ref:r});let i=Gi(n),a=await Qt.get({fs:e,gitdir:t});await a.deleteSection(`branch`,i),await Qt.save({fs:e,gitdir:t,config:a})}async function Fa({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r}){try{Q(`fs`,e),Q(`ref`,r);let t=new Z(e);return await Pa({fs:t,gitdir:await $({fsp:t,dotgit:n}),ref:r})}catch(e){throw e.caller=`git.deleteBranch`,e}}async function Ia({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r}){try{Q(`fs`,e),Q(`ref`,r);let t=new Z(e),i=await $({fsp:t,dotgit:n});await X.deleteRef({fs:t,gitdir:i,ref:r})}catch(e){throw e.caller=`git.deleteRef`,e}}async function La({fs:e,gitdir:t,remote:n}){let r=await Qt.get({fs:e,gitdir:t});await r.deleteSection(`remote`,n),await Qt.save({fs:e,gitdir:t,config:r})}async function Ra({fs:e,dir:t,gitdir:n=Y(t,`.git`),remote:r}){try{Q(`fs`,e),Q(`remote`,r);let t=new Z(e);return await La({fs:t,gitdir:await $({fsp:t,dotgit:n}),remote:r})}catch(e){throw e.caller=`git.deleteRemote`,e}}async function za({fs:e,gitdir:t,ref:n}){n=n.startsWith(`refs/tags/`)?n:`refs/tags/${n}`,await X.deleteRef({fs:e,gitdir:t,ref:n})}async function Ba({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r}){try{Q(`fs`,e),Q(`ref`,r);let t=new Z(e);return await za({fs:t,gitdir:await $({fsp:t,dotgit:n}),ref:r})}catch(e){throw e.caller=`git.deleteTag`,e}}async function Va({fs:e,gitdir:t,oid:n}){let r=n.slice(0,2);return(await e.readdir(`${t}/objects/${r}`)).map(e=>`${r}${e}`).filter(e=>e.startsWith(n))}async function Ha({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i}){let a=[],o=await e.readdir(Y(n,`objects/pack`));o=o.filter(e=>e.endsWith(`.idx`));for(let s of o){let o=await jn({fs:e,cache:t,filename:`${n}/objects/pack/${s}`,getExternalRefDelta:i});if(o.error)throw new J(o.error);for(let e of o.offsets.keys())e.startsWith(r)&&a.push(e)}return a}async function Ua({fs:e,cache:t,gitdir:n,oid:r}){let i=r=>In({fs:e,cache:t,gitdir:n,oid:r}),a=await Va({fs:e,gitdir:n,oid:r}),o=await Ha({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i});for(let e of o)a.indexOf(e)===-1&&a.push(e);if(a.length===1)return a[0];throw a.length>1?new Rn(`oids`,r,a):new St(`an object matching "${r}"`)}async function Wa({fs:e,dir:t,gitdir:n=Y(t,`.git`),oid:r,cache:i={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oid`,r);let t=new Z(e);return await Ua({fs:t,cache:i,gitdir:await $({fsp:t,dotgit:n}),oid:r})}catch(e){throw e.caller=`git.expandOid`,e}}async function Ga({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r);let t=new Z(e),i=await $({fsp:t,dotgit:n});return await X.expand({fs:t,gitdir:i,ref:r})}catch(e){throw e.caller=`git.expandRef`,e}}async function Ka({fs:e,cache:t,gitdir:n,oids:r}){let i={},a=r.length,o=new Set,s=new Map,c=await ma.read({fs:e,gitdir:n}),l=async r=>{if(s.has(r))return s.get(r);let{object:i,type:a}=await In({fs:e,cache:t,gitdir:n,oid:r});if(a!==`commit`)throw new Ct(r,a,`commit`);let{parent:o}=Sr.from(i).parseHeaders(),l=c.has(r)?[]:o;return s.set(r,l),l},u=r.map((e,t)=>({index:t,oid:e}));for(;u.length;){for(let{oid:e,index:t}of u)await l(e),i[e]||(i[e]=new Set),i[e].add(t),i[e].size===a&&o.add(e);let e=new Map;for(let{oid:t,index:n}of u)if(!o.has(t))for(let r of await l(t))(!i[r]||!i[r].has(n))&&e.set(r+`:`+n,{oid:r,index:n});u=Array.from(e.values())}if(o.size<2)return[...o];let d=new Set;for(let e of o){let t=[...await l(e)],n=new Set;for(;t.length;){let e=t.pop();n.has(e)||(n.add(e),o.has(e)?d.add(e):t.push(...await l(e)))}}return[...o].filter(e=>!d.has(e))}async function qa({fs:e,cache:t,dir:n,gitdir:r,ours:i,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:c=!1,noUpdateBranch:l=!1,abortOnConflict:u=!0,message:d,author:f,committer:p,signingKey:m,onSign:h,mergeDriver:g,allowUnrelatedHistories:_=!1}){i===void 0&&(i=await Ki({fs:e,gitdir:r,fullname:!0})),i=await X.expand({fs:e,gitdir:r,ref:i}),a=await X.expand({fs:e,gitdir:r,ref:a});let v=await X.resolve({fs:e,gitdir:r,ref:i}),y=await X.resolve({fs:e,gitdir:r,ref:a}),b=await Ka({fs:e,cache:t,gitdir:r,oids:[v,y]});if(b.length!==1){if(b.length===0&&_)b.push(`4b825dc642cb6eb9a060e54bf8d69288fbee4904`);else throw new Xn}let x=b[0];if(x===y)return{oid:v,alreadyMerged:!0};if(o&&x===v)return!c&&!l&&await X.writeRef({fs:e,gitdir:r,ref:i,value:y}),{oid:y,fastForward:!0};{if(s)throw new Gn;let o=await mt.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async o=>Fi({fs:e,cache:t,dir:n,gitdir:r,index:o,ourOid:v,theirOid:y,baseOid:x,ourName:Gi(i),baseName:`base`,theirName:Gi(a),dryRun:c,abortOnConflict:u,mergeDriver:g}));if(o instanceof Zn)throw o;return d||=`Merge branch '${Gi(a)}' into ${Gi(i)}`,{oid:await ci({fs:e,cache:t,gitdir:r,message:d,ref:i,tree:o,parent:[v,y],author:f,committer:p,signingKey:m,onSign:h,dryRun:c,noUpdateBranch:l}),tree:o,mergeCommit:!0}}}async function Ja({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,dir:c,gitdir:l,ref:u,url:d,remote:f,remoteRef:p,prune:m,pruneTags:h,fastForward:g,fastForwardOnly:_,corsProxy:v,singleBranch:y,headers:b,author:x,committer:S,signingKey:C}){try{if(!u){let t=await Ki({fs:e,gitdir:l});if(!t)throw new $n(`ref`);u=t}let{fetchHead:w,fetchHeadDescription:T}=await Oa({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,gitdir:l,corsProxy:v,ref:u,url:d,remote:f,remoteRef:p,singleBranch:y,headers:b,prune:m,pruneTags:h});await qa({fs:e,cache:t,gitdir:l,ours:u,theirs:w,fastForward:g,fastForwardOnly:_,message:`Merge ${T}`,author:x,committer:S,signingKey:C,dryRun:!1,noUpdateBranch:!1}),await Di({fs:e,cache:t,onProgress:r,dir:c,gitdir:l,ref:u,remote:f,noCheckout:!1})}catch(e){throw e.caller=`git.pull`,e}}async function Ya({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=Y(s,`.git`),ref:l,url:u,remote:d,remoteRef:f,corsProxy:p,singleBranch:m,headers:h={},cache:g={}}){try{Q(`fs`,e),Q(`http`,t),Q(`gitdir`,c);let _={name:``,email:``,timestamp:Date.now(),timezoneOffset:0},v=new Z(e);return await Ja({fs:v,cache:g,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:await $({fsp:v,dotgit:c}),ref:l,url:u,remote:d,remoteRef:f,fastForwardOnly:!0,corsProxy:p,singleBranch:m,headers:h,author:_,committer:_})}catch(e){throw e.caller=`git.fastForward`,e}}async function Xa({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=Y(s,`.git`),ref:l,remote:u,remoteRef:d,url:f,corsProxy:p,depth:m=null,since:h=null,exclude:g=[],relative:_=!1,tags:v=!1,singleBranch:y=!1,headers:b={},prune:x=!1,pruneTags:S=!1,cache:C={}}){try{Q(`fs`,e),Q(`http`,t),Q(`gitdir`,c);let s=new Z(e);return await Oa({fs:s,cache:C,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,gitdir:await $({fsp:s,dotgit:c}),ref:l,remote:u,remoteRef:d,url:f,corsProxy:p,depth:m,since:h,exclude:g,relative:_,tags:v,singleBranch:y,headers:b,prune:x,pruneTags:S})}catch(e){throw e.caller=`git.fetch`,e}}async function Za({fs:e,dir:t,gitdir:n=Y(t,`.git`),oids:r,cache:i={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oids`,r);let t=new Z(e);return await Ka({fs:t,cache:i,gitdir:await $({fsp:t,dotgit:n}),oids:r})}catch(e){throw e.caller=`git.findMergeBase`,e}}async function Qa({fs:e,filepath:t}){if(await e.exists(Y(t,`.git`)))return t;{let n=gt(t);if(n===t)throw new St(`git root for ${t}`);return Qa({fs:e,filepath:n})}}async function $a({fs:e,filepath:t}){try{return Q(`fs`,e),Q(`filepath`,t),await Qa({fs:new Z(e),filepath:t})}catch(e){throw e.caller=`git.findRoot`,e}}async function eo({fs:e,dir:t,gitdir:n=Y(t,`.git`),path:r}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`path`,r);let t=new Z(e);return await ti({fs:t,gitdir:await $({fsp:t,dotgit:n}),path:r})}catch(e){throw e.caller=`git.getConfig`,e}}async function to({fs:e,gitdir:t,path:n}){return(await Qt.get({fs:e,gitdir:t})).getall(n)}async function no({fs:e,dir:t,gitdir:n=Y(t,`.git`),path:r}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`path`,r);let t=new Z(e);return await to({fs:t,gitdir:await $({fsp:t,dotgit:n}),path:r})}catch(e){throw e.caller=`git.getConfigAll`,e}}async function ro({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:o={},forPush:s=!1}){try{Q(`http`,e),Q(`url`,a);let c=await da.getRemoteHelperFor({url:a}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:s?`git-receive-pack`:`git-upload-pack`,url:a,headers:o,protocolVersion:1}),l={capabilities:[...c.capabilities]};for(let[e,t]of c.refs){let n=e.split(`/`),r=n.pop(),i=l;for(let e of n)i[e]=i[e]||{},i=i[e];i[r]=t}for(let[e,t]of c.symrefs){let n=e.split(`/`),r=n.pop(),i=l;for(let e of n)i[e]=i[e]||{},i=i[e];i[r]=t}return l}catch(e){throw e.caller=`git.getRemoteInfo`,e}}function io(e,t,n,r){let i=[];for(let[a,o]of e.refs){if(t&&!a.startsWith(t))continue;if(a.endsWith(`^{}`)){if(r){let e=a.replace(`^{}`,``),t=i[i.length-1],n=t?.ref===e?t:i.find(t=>t.ref===e);n!==void 0&&(n.peeled=o)}continue}let s={ref:a,oid:o};n&&e.symrefs.has(a)&&(s.target=e.symrefs.get(a)),i.push(s)}return i}async function ao({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:o={},forPush:s=!1,protocolVersion:c=2}){try{Q(`http`,e),Q(`url`,a);let l=await da.getRemoteHelperFor({url:a}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:s?`git-receive-pack`:`git-upload-pack`,url:a,headers:o,protocolVersion:c});if(l.protocolVersion===2)return{protocolVersion:l.protocolVersion,capabilities:l.capabilities2};let u={};for(let e of l.capabilities){let[t,n]=e.split(`=`);u[t]=n||!0}return{protocolVersion:1,capabilities:u,refs:io(l,void 0,!0,!0)}}catch(e){throw e.caller=`git.getRemoteInfo2`,e}}async function oo({type:e,object:t,format:n=`content`,oid:r=void 0}){return n!==`deflated`&&(n!==`wrapped`&&(t=un.wrap({type:e,object:t})),r=await $e(t)),{oid:r,object:t}}async function so({object:e}){try{Q(`object`,e),typeof e==`string`?e=Buffer.from(e,`utf8`):e instanceof Uint8Array||(e=new Uint8Array(e));let t=`blob`,{oid:n,object:r}=await oo({type:t,format:`content`,object:e});return{oid:n,type:t,object:r,format:`wrapped`}}catch(e){throw e.caller=`git.hashBlob`,e}}async function co({fs:e,cache:t,onProgress:n,dir:r,gitdir:i,filepath:a}){try{a=Y(r,a);let o=await e.read(a),s=await On.fromPack({pack:o,getExternalRefDelta:n=>In({fs:e,cache:t,gitdir:i,oid:n}),onProgress:n});return await e.write(a.replace(/\.pack$/,`.idx`),await s.toBuffer()),{oids:[...s.hashes]}}catch(e){throw e.caller=`git.indexPack`,e}}async function lo({fs:e,onProgress:t,dir:n,gitdir:r=Y(n,`.git`),filepath:i,cache:a={}}){try{Q(`fs`,e),Q(`dir`,n),Q(`gitdir`,n),Q(`filepath`,i);let o=new Z(e);return await co({fs:o,cache:a,onProgress:t,dir:n,gitdir:await $({fsp:o,dotgit:r}),filepath:i})}catch(e){throw e.caller=`git.indexPack`,e}}async function uo({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:Y(n,`.git`),defaultBranch:i=`master`}){try{Q(`fs`,e),Q(`gitdir`,r),t||Q(`dir`,n);let a=new Z(e);return await ka({fs:a,bare:t,dir:n,gitdir:await $({fsp:a,dotgit:r}),defaultBranch:i})}catch(e){throw e.caller=`git.init`,e}}async function fo({fs:e,cache:t,gitdir:n,oid:r,ancestor:i,depth:a}){let o=await ma.read({fs:e,gitdir:n});if(!r)throw new $n(`oid`);if(!i)throw new $n(`ancestor`);if(r===i)return!1;let s=[r],c=new Set,l=0;for(;s.length;){if(l++===a)throw new Yn(a);let r=s.shift(),{type:u,object:d}=await In({fs:e,cache:t,gitdir:n,oid:r});if(u!==`commit`)throw new Ct(r,u,`commit`);let f=Sr.from(d).parse();for(let e of f.parent)if(e===i)return!0;if(!o.has(r))for(let e of f.parent)c.has(e)||(s.push(e),c.add(e))}return!1}async function po({fs:e,dir:t,gitdir:n=Y(t,`.git`),oid:r,ancestor:i,depth:a=-1,cache:o={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oid`,r),Q(`ancestor`,i);let t=new Z(e);return await fo({fs:t,cache:o,gitdir:await $({fsp:t,dotgit:n}),oid:r,ancestor:i,depth:a})}catch(e){throw e.caller=`git.isDescendent`,e}}async function mo({fs:e,dir:t,gitdir:n=Y(t,`.git`),filepath:r}){try{Q(`fs`,e),Q(`dir`,t),Q(`gitdir`,n),Q(`filepath`,r);let i=new Z(e),a=await $({fsp:i,dotgit:n});return Wr.isIgnored({fs:i,dir:t,gitdir:a,filepath:r})}catch(e){throw e.caller=`git.isIgnored`,e}}async function ho({fs:e,dir:t,gitdir:n=Y(t,`.git`),remote:r}){try{Q(`fs`,e),Q(`gitdir`,n);let t=new Z(e),i=await $({fsp:t,dotgit:n});return X.listBranches({fs:t,gitdir:i,remote:r})}catch(e){throw e.caller=`git.listBranches`,e}}async function go({fs:e,gitdir:t,ref:n,cache:r}){if(n){let i=await X.resolve({gitdir:t,fs:e,ref:n}),a=[];return await _o({fs:e,cache:r,gitdir:t,oid:i,filenames:a,prefix:``}),a}return mt.acquire({fs:e,gitdir:t,cache:r},async function(e){return e.entries.map(e=>e.path)})}async function _o({fs:e,cache:t,gitdir:n,oid:r,filenames:i,prefix:a}){let{tree:o}=await pi({fs:e,cache:t,gitdir:n,oid:r});for(let r of o)r.type===`tree`?await _o({fs:e,cache:t,gitdir:n,oid:r.oid,filenames:i,prefix:Y(a,r.path)}):i.push(Y(a,r.path))}async function vo({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r,cache:i={}}){try{Q(`fs`,e),Q(`gitdir`,n);let t=new Z(e);return await go({fs:t,cache:i,gitdir:await $({fsp:t,dotgit:n}),ref:r})}catch(e){throw e.caller=`git.listFiles`,e}}async function yo({fs:e,cache:t,gitdir:n,ref:r}){let i;try{i=await X.resolve({gitdir:n,fs:e,ref:r})}catch(e){if(e instanceof St)return[]}return(await pi({fs:e,cache:t,gitdir:n,oid:i})).tree.map(e=>({target:e.path,note:e.oid}))}async function bo({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r=`refs/notes/commits`,cache:i={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r);let t=new Z(e);return await yo({fs:t,cache:i,gitdir:await $({fsp:t,dotgit:n}),ref:r})}catch(e){throw e.caller=`git.listNotes`,e}}async function xo({fs:e,dir:t,gitdir:n=Y(t,`.git`),filepath:r}){try{Q(`fs`,e),Q(`gitdir`,n);let t=new Z(e),i=await $({fsp:t,dotgit:n});return X.listRefs({fs:t,gitdir:i,filepath:r})}catch(e){throw e.caller=`git.listRefs`,e}}async function So({fs:e,gitdir:t}){let n=await Qt.get({fs:e,gitdir:t}),r=await n.getSubsections(`remote`);return Promise.all(r.map(async e=>({remote:e,url:await n.get(`remote.${e}.url`)})))}async function Co({fs:e,dir:t,gitdir:n=Y(t,`.git`)}){try{Q(`fs`,e),Q(`gitdir`,n);let t=new Z(e);return await So({fs:t,gitdir:await $({fsp:t,dotgit:n})})}catch(e){throw e.caller=`git.listRemotes`,e}}async function wo(e){let t=ra.streamReader(e),n=[],r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString(`utf8`).replace(/\n$/,``);let[e,t,...i]=r.split(` `),a={ref:t,oid:e};for(let e of i){let[t,n]=e.split(`:`);t===`symref-target`?a.target=n:t===`peeled`&&(a.peeled=n)}n.push(a)}return n}async function To({prefix:e,symrefs:t,peelTags:n}){let r=[];return r.push(ra.encode(`command=ls-refs
|
|
63
|
+
`)),r.push(ra.encode(`agent=${xa.agent}\n`)),(n||t||e)&&r.push(ra.delim()),n&&r.push(ra.encode(`peel`)),t&&r.push(ra.encode(`symrefs`)),e&&r.push(ra.encode(`ref-prefix ${e}`)),r.push(ra.flush()),r}async function Eo({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:o={},forPush:s=!1,protocolVersion:c=2,prefix:l,symrefs:u,peelTags:d}){try{Q(`http`,e),Q(`url`,a);let f=await ua.discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:s?`git-receive-pack`:`git-upload-pack`,url:a,headers:o,protocolVersion:c});if(f.protocolVersion===1)return io(f,l,u,d);let p=await To({prefix:l,symrefs:u,peelTags:d});return wo((await ua.connect({http:e,auth:f.auth,headers:o,corsProxy:i,service:s?`git-receive-pack`:`git-upload-pack`,url:a,body:p})).body)}catch(e){throw e.caller=`git.listServerRefs`,e}}async function Do({fs:e,dir:t,gitdir:n=Y(t,`.git`)}){try{Q(`fs`,e),Q(`gitdir`,n);let t=new Z(e),r=await $({fsp:t,dotgit:n});return X.listTags({fs:t,gitdir:r})}catch(e){throw e.caller=`git.listTags`,e}}function Oo(e,t){return e.committer.timestamp-t.committer.timestamp}var ko=`e69de29bb2d1d6434b8b29ae775ad8c2e48c5391`;async function Ao({fs:e,cache:t,gitdir:n,oid:r,fileId:i}){if(i===ko)return;let a=r,o,s=await Cr({fs:e,cache:t,gitdir:n,oid:r}),c=s.tree;return i===s.oid?o=s.path:(o=await jo({fs:e,cache:t,gitdir:n,tree:c,fileId:i,oid:a}),Array.isArray(o)&&(o.length===0?o=void 0:o.length===1&&(o=o[0]))),o}async function jo({fs:e,cache:t,gitdir:n,tree:r,fileId:i,oid:a,filepaths:o=[],parentPath:s=``}){let c=r.entries().map(function(r){let c;return r.oid===i?(c=Y(s,r.path),o.push(c)):r.type===`tree`&&(c=In({fs:e,cache:t,gitdir:n,oid:r.oid}).then(function({object:c}){return jo({fs:e,cache:t,gitdir:n,tree:ln.from(c),fileId:i,oid:a,filepaths:o,parentPath:Y(s,r.path)})})),c});return await Promise.all(c),o}async function Mo({fs:e,cache:t,gitdir:n,filepath:r,ref:i,depth:a,since:o,force:s,follow:c,includeChanges:l}){let u=o===void 0?void 0:Math.floor(o.valueOf()/1e3),d=[],f=await ma.read({fs:e,gitdir:n}),p=[await oi({fs:e,cache:t,gitdir:n,oid:await X.resolve({fs:e,gitdir:n,ref:i})})],m,h,g,_;function v(e){_&&r&&d.push(e)}for(;p.length>0;){let i=p.pop();if(u!==void 0&&i.commit.committer.timestamp<=u)break;if(r){let a;try{a=await di({fs:e,cache:t,gitdir:n,oid:i.commit.tree,filepath:r}),g&&(m!==a.oid||h!==a.mode)&&d.push(g),m=a.oid,h=a.mode,g=i,_=!0}catch(a){if(a instanceof St){let o=c&&m;if(o&&(o=await Ao({fs:e,cache:t,gitdir:n,oid:i.commit.tree,fileId:m}),o)){if(Array.isArray(o)){if(g){let i=await Ao({fs:e,cache:t,gitdir:n,oid:g.commit.tree,fileId:m});if(Array.isArray(i)){if(o=o.filter(e=>i.indexOf(e)===-1),o.length===1)o=o[0],r=o,g&&d.push(g);else{o=!1,g&&d.push(g);break}}}}else r=o,g&&d.push(g)}if(!o){if(_&&m&&(d.push(g),!s))break;if(!s&&!c)throw a}g=i,_=!1}else throw a}}else d.push(i);if(a!==void 0&&d.length===a){v(i);break}if(!f.has(i.oid))for(let r of i.commit.parent){let i=await oi({fs:e,cache:t,gitdir:n,oid:r});p.map(e=>e.oid).includes(i.oid)||p.push(i)}p.length===0&&v(i),p.sort((e,t)=>Oo(e.commit,t.commit))}if(l)for(let r of d)r.commit.changes=await No({fs:e,cache:t,gitdir:n,commit:r,shallow:f.has(r.oid)});return d}async function No({fs:e,cache:t,gitdir:n,commit:r,shallow:i}){let a=i||!r.commit.parent[0]?`4b825dc642cb6eb9a060e54bf8d69288fbee4904`:r.commit.parent[0];return Mr({fs:e,cache:t,gitdir:n,trees:[Tr({ref:r.oid}),Tr({ref:a})],map:async(e,[t,n])=>{let[r,i]=await Promise.all([t&&t.type(),n&&n.type()]);if(r===`tree`)return i&&i!==`tree`?[null,await n.oid(),e]:void 0;if(i===`tree`)return r?[await t.oid(),null,e]:void 0;let[a,o]=await Promise.all([t?t.oid():null,n?n.oid():null]);if(a!==o)return[a,o,e]}})}async function Po({fs:e,dir:t,gitdir:n=Y(t,`.git`),filepath:r,ref:i=`HEAD`,depth:a,since:o,force:s,follow:c,includeChanges:l=!1,cache:u={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,i);let t=new Z(e);return await Mo({fs:t,cache:u,gitdir:await $({fsp:t,dotgit:n}),filepath:r,ref:i,depth:a,since:o,force:s,follow:c,includeChanges:l})}catch(e){throw e.caller=`git.log`,e}}async function Fo({fs:e,onSign:t,dir:n,gitdir:r=Y(n,`.git`),ours:i,theirs:a,fastForward:o=!0,fastForwardOnly:s=!1,dryRun:c=!1,noUpdateBranch:l=!1,abortOnConflict:u=!0,message:d,author:f,committer:p,signingKey:m,cache:h={},mergeDriver:g,allowUnrelatedHistories:_=!1}){try{Q(`fs`,e),m&&Q(`onSign`,t);let v=new Z(e),y=await $({fsp:v,dotgit:r}),b=await ri({fs:v,gitdir:y,author:f});if(!b&&(!s||!o))throw new Qn(`author`);let x=await ii({fs:v,gitdir:y,author:b,committer:p});if(!x&&(!s||!o))throw new Qn(`committer`);return await qa({fs:v,cache:h,dir:n,gitdir:y,ours:i,theirs:a,fastForward:o,fastForwardOnly:s,dryRun:c,noUpdateBranch:l,abortOnConflict:u,message:d,author:b,committer:x,signingKey:m,onSign:t,mergeDriver:g,allowUnrelatedHistories:_})}catch(e){throw e.caller=`git.merge`,e}}var Io={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function Lo({fs:e,cache:t,dir:n,gitdir:r=Y(n,`.git`),oids:i}){let a=new Pe.default,o=[];function s(e,t){let n=Buffer.from(e,t);o.push(n),a.update(n)}async function c({stype:e,object:t}){let n=Io[e],r=t.length,i=r>15?128:0,a=r&15;r>>>=4;let o=(i|n|a).toString(16);for(s(o,`hex`);i;)i=r>127?128:0,o=i|r&127,s(na(2,o),`hex`),r>>>=7;s(Buffer.from(await qr(t)))}s(`PACK`),s(`00000002`,`hex`),s(na(8,i.length),`hex`);for(let n of i){let{type:i,object:a}=await In({fs:e,cache:t,gitdir:r,oid:n});await c({write:s,object:a,stype:i})}let l=a.digest();return o.push(l),o}async function Ro({fs:e,cache:t,gitdir:n,oids:r,write:i}){let a=await Lo({fs:e,cache:t,gitdir:n,oids:r}),o=Buffer.from(await Xi(a)),s=`pack-${o.slice(-20).toString(`hex`)}.pack`;return i?(await e.write(Y(n,`objects/pack/${s}`),o),{filename:s}):{filename:s,packfile:new Uint8Array(o)}}async function zo({fs:e,dir:t,gitdir:n=Y(t,`.git`),oids:r,write:i=!1,cache:a={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oids`,r);let t=new Z(e);return await Ro({fs:t,cache:a,gitdir:await $({fsp:t,dotgit:n}),oids:r,write:i})}catch(e){throw e.caller=`git.packObjects`,e}}async function Bo({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:c=Y(s,`.git`),ref:l,url:u,remote:d,remoteRef:f,prune:p=!1,pruneTags:m=!1,fastForward:h=!0,fastForwardOnly:g=!1,corsProxy:_,singleBranch:v,headers:y={},author:b,committer:x,signingKey:S,cache:C={}}){try{Q(`fs`,e),Q(`gitdir`,c);let w=new Z(e),T=await $({fsp:w,dotgit:c}),E=await ri({fs:w,gitdir:T,author:b});if(!E)throw new Qn(`author`);let D=await ii({fs:w,gitdir:T,author:E,committer:x});if(!D)throw new Qn(`committer`);return await Ja({fs:w,cache:C,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,dir:s,gitdir:T,ref:l,url:u,remote:d,remoteRef:f,fastForward:h,fastForwardOnly:g,corsProxy:_,singleBranch:v,headers:y,author:E,committer:D,signingKey:S,prune:p,pruneTags:m})}catch(e){throw e.caller=`git.pull`,e}}async function Vo({fs:e,cache:t,dir:n,gitdir:r=Y(n,`.git`),start:i,finish:a}){let o=await ma.read({fs:e,gitdir:r}),s=new Set,c=new Set;for(let t of i)s.add(await X.resolve({fs:e,gitdir:r,ref:t}));for(let t of a)try{let n=await X.resolve({fs:e,gitdir:r,ref:t});c.add(n)}catch{}let l=new Set;async function u(n){l.add(n);let{type:i,object:a}=await In({fs:e,cache:t,gitdir:r,oid:n});if(i===`tag`){let e=yr.from(a).headers().object;return u(e)}if(i!==`commit`)throw new Ct(n,i,`commit`);if(!o.has(n))for(n of Sr.from(a).headers().parent)!c.has(n)&&!l.has(n)&&await u(n)}for(let e of s)await u(e);return l}async function Ho({fs:e,cache:t,dir:n,gitdir:r=Y(n,`.git`),oids:i}){let a=new Set;async function o(n){if(a.has(n))return;a.add(n);let{type:i,object:s}=await In({fs:e,cache:t,gitdir:r,oid:n});if(i===`tag`){let e=yr.from(s).headers().object;await o(e)}else if(i===`commit`){let e=Sr.from(s).headers().tree;await o(e)}else if(i===`tree`){let e=ln.from(s);for(let t of e)t.type===`blob`&&a.add(t.oid),t.type===`tree`&&await o(t.oid)}}for(let e of i)await o(e);return a}async function Uo(e){let t={},n=``,r=ra.streamReader(e),i=await r();for(;i!==!0;)i!==null&&(n+=i.toString(`utf8`)+`
|
|
64
|
+
`),i=await r();let a=n.toString(`utf8`).split(`
|
|
65
|
+
`);if(i=a.shift(),!i.startsWith(`unpack `))throw new tr(`unpack ok" or "unpack [error message]`,i);t.ok=i===`unpack ok`,t.ok||(t.error=i.slice(7)),t.refs={};for(let e of a){if(e.trim()===``)continue;let n=e.slice(0,2),r=e.slice(3),i=r.indexOf(` `);i===-1&&(i=r.length);let a=r.slice(0,i),o=r.slice(i+1);t.refs[a]={ok:n===`ok`,error:o}}return t}async function Wo({capabilities:e=[],triplets:t=[]}){let n=[],r=`\x00 ${e.join(` `)}`;for(let e of t)n.push(ra.encode(`${e.oldoid} ${e.oid} ${e.fullRef}${r}\n`)),r=``;return n.push(ra.flush()),n}async function Go({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:o,onAuthFailure:s,onPrePush:c,gitdir:l,ref:u,remoteRef:d,remote:f,url:p,force:m=!1,delete:h=!1,corsProxy:g,headers:_={}}){let v=u||await Ki({fs:e,gitdir:l});if(v===void 0)throw new $n(`ref`);let y=await Qt.get({fs:e,gitdir:l});f=f||await y.get(`branch.${v}.pushRemote`)||await y.get(`remote.pushDefault`)||await y.get(`branch.${v}.remote`)||`origin`;let b=p||await y.get(`remote.${f}.pushurl`)||await y.get(`remote.${f}.url`);if(b===void 0)throw new $n(`remote OR url`);let x=d||await y.get(`branch.${v}.merge`);if(b===void 0)throw new $n(`remoteRef`);g===void 0&&(g=await y.get(`http.corsProxy`));let S=await X.expand({fs:e,gitdir:l,ref:v}),C=h?`0000000000000000000000000000000000000000`:await X.resolve({fs:e,gitdir:l,ref:S}),w=da.getRemoteHelperFor({url:b}),T=await w.discover({http:n,onAuth:va({config:y,onAuth:a}),onAuthSuccess:o,onAuthFailure:va({config:y,onAuth:s}),corsProxy:g,service:`git-receive-pack`,url:b,headers:_,protocolVersion:1}),E=T.auth,D;if(!x)D=S;else try{D=await X.expandAgainstMap({ref:x,map:T.refs})}catch(e){if(e instanceof St)D=x.startsWith(`refs/`)?x:`refs/heads/${x}`;else throw e}let O=T.refs.get(D)||`0000000000000000000000000000000000000000`;if(c&&!await c({remote:f,url:b,localRef:{ref:h?`(delete)`:S,oid:C},remoteRef:{ref:D,oid:O}}))throw new sr;let k=!T.capabilities.has(`no-thin`),A=new Set;if(!h){let n=[...T.refs.values()],r=new Set;if(O!==`0000000000000000000000000000000000000000`){let i=await Ka({fs:e,cache:t,gitdir:l,oids:[C,O]});for(let e of i)n.push(e);k&&(r=await Ho({fs:e,cache:t,gitdir:l,oids:i}))}if(n.includes(C)||(A=await Ho({fs:e,cache:t,gitdir:l,oids:await Vo({fs:e,cache:t,gitdir:l,start:[C],finish:n})})),k){try{let n=await X.resolve({fs:e,gitdir:l,ref:`refs/remotes/${f}/HEAD`,depth:2}),{oid:i}=await X.resolveAgainstMap({ref:n.replace(`refs/remotes/${f}/`,``),fullref:n,map:T.refs}),a=[i];for(let n of await Ho({fs:e,cache:t,gitdir:l,oids:a}))r.add(n)}catch{}for(let e of r)A.delete(e)}if(C===O&&(m=!0),!m){if(S.startsWith(`refs/tags`)&&O!==`0000000000000000000000000000000000000000`)throw new nr(`tag-exists`);if(C!==`0000000000000000000000000000000000000000`&&O!==`0000000000000000000000000000000000000000`&&!await fo({fs:e,cache:t,gitdir:l,oid:C,ancestor:O,depth:-1}))throw new nr(`not-fast-forward`)}}let j=await Wo({capabilities:ba([...T.capabilities],[`report-status`,`side-band-64k`,`agent=${xa.agent}`]),triplets:[{oldoid:O,oid:C,fullRef:D}]}),M=h?[]:await Lo({fs:e,cache:t,gitdir:l,oids:[...A]}),ee=await w.connect({http:n,onProgress:r,corsProxy:g,service:`git-receive-pack`,url:b,auth:E,headers:_,body:[...j,...M]}),{packfile:te,progress:ne}=await Ta.demux(ee.body);i&&Yi(wa(ne),async e=>{await i(e)});let re=await Uo(te);if(ee.headers&&(re.headers=ee.headers),f&&re.ok&&re.refs[D].ok&&!S.startsWith(`refs/tags`)){let t=`refs/remotes/${f}/${D.replace(`refs/heads`,``)}`;h?await X.deleteRef({fs:e,gitdir:l,ref:t}):await X.writeRef({fs:e,gitdir:l,ref:t,value:C})}if(re.ok&&Object.values(re.refs).every(e=>e.ok))return re;throw new Kn(Object.entries(re.refs).filter(([e,t])=>!t.ok).map(([e,t])=>`\n - ${e}: ${t.error}`).join(``),re)}async function Ko({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,onPrePush:s,dir:c,gitdir:l=Y(c,`.git`),ref:u,remoteRef:d,remote:f=`origin`,url:p,force:m=!1,delete:h=!1,corsProxy:g,headers:_={},cache:v={}}){try{Q(`fs`,e),Q(`http`,t),Q(`gitdir`,l);let c=new Z(e);return await Go({fs:c,cache:v,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:o,onPrePush:s,gitdir:await $({fsp:c,dotgit:l}),ref:u,remoteRef:d,remote:f,url:p,force:m,delete:h,corsProxy:g,headers:_})}catch(e){throw e.caller=`git.push`,e}}async function qo({fs:e,cache:t,gitdir:n,oid:r}){let{type:i,object:a}=await In({fs:e,cache:t,gitdir:n,oid:r});if(i===`tag`)return r=yr.from(a).parse().object,qo({fs:e,cache:t,gitdir:n,oid:r});if(i!==`blob`)throw new Ct(r,i,`blob`);return{oid:r,blob:new Uint8Array(a)}}async function Jo({fs:e,cache:t,gitdir:n,oid:r,filepath:i=void 0}){return i!==void 0&&(r=await ui({fs:e,cache:t,gitdir:n,oid:r,filepath:i})),await qo({fs:e,cache:t,gitdir:n,oid:r})}async function Yo({fs:e,dir:t,gitdir:n=Y(t,`.git`),oid:r,filepath:i,cache:a={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oid`,r);let t=new Z(e);return await Jo({fs:t,cache:a,gitdir:await $({fsp:t,dotgit:n}),oid:r,filepath:i})}catch(e){throw e.caller=`git.readBlob`,e}}async function Xo({fs:e,dir:t,gitdir:n=Y(t,`.git`),oid:r,cache:i={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oid`,r);let t=new Z(e);return await oi({fs:t,cache:i,gitdir:await $({fsp:t,dotgit:n}),oid:r})}catch(e){throw e.caller=`git.readCommit`,e}}async function Zo({fs:e,cache:t,gitdir:n,ref:r=`refs/notes/commits`,oid:i}){let{blob:a}=await Jo({fs:e,cache:t,gitdir:n,oid:await X.resolve({gitdir:n,fs:e,ref:r}),filepath:i});return a}async function Qo({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r=`refs/notes/commits`,oid:i,cache:a={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r),Q(`oid`,i);let t=new Z(e);return await Zo({fs:t,cache:a,gitdir:await $({fsp:t,dotgit:n}),ref:r,oid:i})}catch(e){throw e.caller=`git.readNote`,e}}async function $o({fs:e,dir:t,gitdir:n=Y(t,`.git`),oid:r,format:i=`parsed`,filepath:a=void 0,encoding:o=void 0,cache:s={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oid`,r);let t=new Z(e),c=await $({fsp:t,dotgit:n});a!==void 0&&(r=await ui({fs:t,cache:s,gitdir:c,oid:r,filepath:a}));let l=await In({fs:t,cache:s,gitdir:c,oid:r,format:i===`parsed`?`content`:i});if(l.oid=r,i===`parsed`)switch(l.format=`parsed`,l.type){case`commit`:l.object=Sr.from(l.object).parse();break;case`tree`:l.object=ln.from(l.object).entries();break;case`blob`:o?l.object=l.object.toString(o):(l.object=new Uint8Array(l.object),l.format=`content`);break;case`tag`:l.object=yr.from(l.object).parse();break;default:throw new Ct(l.oid,l.type,`blob|commit|tag|tree`)}else(l.format===`deflated`||l.format===`wrapped`)&&(l.type=l.format);return l}catch(e){throw e.caller=`git.readObject`,e}}async function es({fs:e,cache:t,gitdir:n,oid:r}){let{type:i,object:a}=await In({fs:e,cache:t,gitdir:n,oid:r,format:`content`});if(i!==`tag`)throw new Ct(r,i,`tag`);let o=yr.from(a);return{oid:r,tag:o.parse(),payload:o.payload()}}async function ts({fs:e,dir:t,gitdir:n=Y(t,`.git`),oid:r,cache:i={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oid`,r);let t=new Z(e);return await es({fs:t,cache:i,gitdir:await $({fsp:t,dotgit:n}),oid:r})}catch(e){throw e.caller=`git.readTag`,e}}async function ns({fs:e,dir:t,gitdir:n=Y(t,`.git`),oid:r,filepath:i=void 0,cache:a={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`oid`,r);let t=new Z(e);return await pi({fs:t,cache:a,gitdir:await $({fsp:t,dotgit:n}),oid:r,filepath:i})}catch(e){throw e.caller=`git.readTree`,e}}async function rs({fs:e,dir:t,gitdir:n=Y(t,`.git`),filepath:r,cache:i={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`filepath`,r);let t=new Z(e),a=await $({fsp:t,dotgit:n});await mt.acquire({fs:t,gitdir:a,cache:i},async function(e){e.delete({filepath:r})})}catch(e){throw e.caller=`git.remove`,e}}async function is({fs:e,cache:t,onSign:n,gitdir:r,ref:i=`refs/notes/commits`,oid:a,author:o,committer:s,signingKey:c}){let l;try{l=await X.resolve({gitdir:r,fs:e,ref:i})}catch(e){if(!(e instanceof St))throw e}let u=(await pi({fs:e,cache:t,gitdir:r,oid:l||`4b825dc642cb6eb9a060e54bf8d69288fbee4904`})).tree;return u=u.filter(e=>e.path!==a),await ci({fs:e,cache:t,onSign:n,gitdir:r,ref:i,tree:await mi({fs:e,gitdir:r,tree:u}),parent:l&&[l],message:`Note removed by 'isomorphic-git removeNote'
|
|
66
|
+
`,author:o,committer:s,signingKey:c})}async function as({fs:e,onSign:t,dir:n,gitdir:r=Y(n,`.git`),ref:i=`refs/notes/commits`,oid:a,author:o,committer:s,signingKey:c,cache:l={}}){try{Q(`fs`,e),Q(`gitdir`,r),Q(`oid`,a);let n=new Z(e),u=await $({fsp:n,dotgit:r}),d=await ri({fs:n,gitdir:u,author:o});if(!d)throw new Qn(`author`);let f=await ii({fs:n,gitdir:u,author:d,committer:s});if(!f)throw new Qn(`committer`);return await is({fs:n,cache:l,onSign:t,gitdir:u,ref:i,oid:a,author:d,committer:f,signingKey:c})}catch(e){throw e.caller=`git.removeNote`,e}}async function os({fs:e,gitdir:t,oldref:n,ref:r,checkout:i=!1}){if(!vi(r,!0))throw new Tt(r,Be.default.clean(r));if(!vi(n,!0))throw new Tt(n,Be.default.clean(n));let a=`refs/heads/${n}`,o=`refs/heads/${r}`;if(await X.exists({fs:e,gitdir:t,ref:o}))throw new Ln(`branch`,r,!1);let s=await X.resolve({fs:e,gitdir:t,ref:a,depth:1});await X.writeRef({fs:e,gitdir:t,ref:o,value:s}),await X.deleteRef({fs:e,gitdir:t,ref:a});let c=await Ki({fs:e,gitdir:t,fullname:!0})===a;(i||c)&&await X.writeSymbolicRef({fs:e,gitdir:t,ref:`HEAD`,value:o})}async function ss({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r,oldref:i,checkout:a=!1}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r),Q(`oldref`,i);let t=new Z(e);return await os({fs:t,gitdir:await $({fsp:t,dotgit:n}),ref:r,oldref:i,checkout:a})}catch(e){throw e.caller=`git.renameBranch`,e}}async function cs({gitdir:e,type:t,object:n}){return $e(un.wrap({type:t,object:n}))}async function ls({fs:e,dir:t,gitdir:n=Y(t,`.git`),filepath:r,ref:i,cache:a={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`filepath`,r);let o=new Z(e),s=await $({fsp:o,dotgit:n}),c,l;try{c=await X.resolve({fs:o,gitdir:s,ref:i||`HEAD`})}catch(e){if(i)throw e}if(c)try{c=await ui({fs:o,cache:a,gitdir:s,oid:c,filepath:r})}catch{c=null}let u={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},d=t&&await o.read(Y(t,r));d&&(l=await cs({gitdir:s,type:`blob`,object:d}),c===l&&(u=await o.lstat(Y(t,r)))),await mt.acquire({fs:o,gitdir:s,cache:a},async function(e){e.delete({filepath:r}),c&&e.insert({filepath:r,stats:u,oid:c})})}catch(e){throw e.caller=`git.reset`,e}}async function us({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r,depth:i}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r);let t=new Z(e),a=await $({fsp:t,dotgit:n});return await X.resolve({fs:t,gitdir:a,ref:r,depth:i})}catch(e){throw e.caller=`git.resolveRef`,e}}async function ds({fs:e,dir:t,gitdir:n=Y(t,`.git`),path:r,value:i,append:a=!1}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`path`,r);let t=new Z(e),o=await $({fsp:t,dotgit:n}),s=await Qt.get({fs:t,gitdir:o});a?await s.append(r,i):await s.set(r,i),await Qt.save({fs:t,gitdir:o,config:s})}catch(e){throw e.caller=`git.setConfig`,e}}async function fs({fs:e,gitdir:t,commit:n}){return await Xr({fs:e,gitdir:t,type:`commit`,object:Sr.from(n).toObject(),format:`content`})}var ps=class e{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),n=Math.abs(e%60).toString().padStart(2,`0`);return`${e>0?`-`:`+`}${t.toString().padStart(2,`0`)}${n}`}static createStashReflogEntry(t,n,r){let i=t.name.replace(/\s/g,``),a=Math.floor(Date.now()/1e3),o=e.timezoneOffsetForRefLogEntry;return`0000000000000000000000000000000000000000 ${n} ${i} ${t.email} ${a} ${o}\t${r}\n`}static getStashReflogEntry(e,t=!1){return e.split(`
|
|
67
|
+
`).filter(e=>e).reverse().map((e,n)=>t?`stash@{${n}}: ${e.split(` `)[1]}`:e)}},ms=class e{constructor({fs:e,dir:t,gitdir:n=Y(t,`.git`)}){Object.assign(this,{fs:e,dir:t,gitdir:n,_author:null})}static get refStash(){return`refs/stash`}static get refLogsStash(){return`logs/refs/stash`}get refStashPath(){return Y(this.gitdir,e.refStash)}get refLogsStashPath(){return Y(this.gitdir,e.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await ri({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Qn(`author`);return this._author}async getStashSHA(e,t){return await this.fs.exists(this.refStashPath)?(t||await this.readStashReflogs({parsed:!1}))[e].split(` `)[1]:null}async writeStashCommit({message:e,tree:t,parent:n}){return fs({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:t,parent:n,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let t=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>t.length-1))throw new Tt(`stash@${e}`,`number that is in range of [0, num of stash pushed]`);let n=await this.getStashSHA(e,t);return n?oi({fs:this.fs,cache:{},gitdir:this.gitdir,oid:n}):{}}async writeStashRef(t){return X.writeRef({fs:this.fs,gitdir:this.gitdir,ref:e.refStash,value:t})}async writeStashReflogEntry({stashCommit:e,message:t}){let n=await this.getAuthor(),r=ps.createStashReflogEntry(n,e,t),i=this.refLogsStashPath;await lt(i,async()=>{let e=await this.fs.exists(i)?await this.fs.read(i,`utf8`):``;await this.fs.write(i,e+r,`utf8`)})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let t=await this.fs.read(this.refLogsStashPath,`utf8`);return ps.getStashReflogEntry(t,e)}};async function hs({fs:e,dir:t,gitdir:n,message:r=``}){let i=new ms({fs:e,dir:t,gitdir:n});await i.getAuthor();let a=await Ki({fs:e,gitdir:n,fullname:!1}),o=await X.resolve({fs:e,gitdir:n,ref:`HEAD`}),s=(await Xo({fs:e,dir:t,gitdir:n,oid:o})).commit.message,c=[o],l=null,u=Tr({ref:`HEAD`}),d=await Bi({fs:e,dir:t,gitdir:n,treePair:[Tr({ref:`HEAD`}),`stage`]});if(d){let e=await i.writeStashCommit({message:`stash-Index: WIP on ${a} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(e),l=d,u=xt()}let f=await Bi({fs:e,dir:t,gitdir:n,treePair:[u,`workdir`]});if(f){let e=await i.writeStashCommit({message:`stash-WorkDir: WIP on ${a} - ${new Date().toISOString()}`,tree:f,parent:[c[c.length-1]]});c.push(e),l=f}if(!l||!d&&!f)throw new St(`changes, nothing to stash`);let p=(r.trim()||`WIP on ${a}`)+`: ${o.substring(0,7)} ${s}`;return{stashCommit:await i.writeStashCommit({message:p,tree:l,parent:c}),stashMsg:p,branch:a,stashMgr:i}}async function gs({fs:e,dir:t,gitdir:n,message:r=``}){let{stashCommit:i,stashMsg:a,branch:o,stashMgr:s}=await hs({fs:e,dir:t,gitdir:n,message:r});return await s.writeStashRef(i),await s.writeStashReflogEntry({stashCommit:i,message:a}),await Mi({fs:e,dir:t,gitdir:n,ref:o,track:!1,force:!0}),i}async function _s({fs:e,dir:t,gitdir:n,message:r=``}){let{stashCommit:i}=await hs({fs:e,dir:t,gitdir:n,message:r});return i}async function vs({fs:e,dir:t,gitdir:n,refIdx:r=0}){let i=await new ms({fs:e,dir:t,gitdir:n}).readStashCommit(r),{parent:a=null}=i.commit?i.commit:{};if(!(!a||!Array.isArray(a)))for(let r=0;r<a.length-1;r++){let i=(await oi({fs:e,cache:{},gitdir:n,oid:a[r+1]})).commit.message.startsWith(`stash-Index`);await Vi({fs:e,dir:t,gitdir:n,stashCommit:a[r+1],parentCommit:a[r],wasStaged:i})}}async function ys({fs:e,dir:t,gitdir:n,refIdx:r=0}){let i=new ms({fs:e,dir:t,gitdir:n});if(!(await i.readStashCommit(r)).commit)return;let a=i.refStashPath;await lt(a,async()=>{await e.exists(a)&&await e.rm(a)});let o=await i.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(r,1);let s=i.refLogsStashPath;await lt(s,async()=>{if(o.length){await e.write(s,o.reverse().join(`
|
|
68
|
+
`)+`
|
|
69
|
+
`,`utf8`);let t=o[o.length-1].split(` `)[1];await i.writeStashRef(t)}else await e.rm(s)})}async function bs({fs:e,dir:t,gitdir:n}){return new ms({fs:e,dir:t,gitdir:n}).readStashReflogs({parsed:!0})}async function xs({fs:e,dir:t,gitdir:n}){let r=new ms({fs:e,dir:t,gitdir:n}),i=[r.refStashPath,r.refLogsStashPath];await lt(i,async()=>{await Promise.all(i.map(async t=>{if(await e.exists(t))return e.rm(t)}))})}async function Ss({fs:e,dir:t,gitdir:n,refIdx:r=0}){await vs({fs:e,dir:t,gitdir:n,refIdx:r}),await ys({fs:e,dir:t,gitdir:n,refIdx:r})}async function Cs({fs:e,dir:t,gitdir:n=Y(t,`.git`),op:r=`push`,message:i=``,refIdx:a=0}){Q(`fs`,e),Q(`dir`,t),Q(`gitdir`,n),Q(`op`,r);let o={push:gs,apply:vs,drop:ys,list:bs,clear:xs,pop:Ss,create:_s},s=[`apply`,`drop`,`pop`];try{let c=new Z(e),l=await $({fsp:c,dotgit:n});[`refs`,`logs`,`logs/refs`].map(e=>Y(l,e)).forEach(async e=>{await c.exists(e)||await c.mkdir(e)});let u=o[r];if(u){if(s.includes(r)&&a<0)throw new Tt(`stash@${a}`,`number that is in range of [0, num of stash pushed]`);return await u({fs:c,dir:t,gitdir:l,message:i,refIdx:a})}throw Error(`To be implemented: ${r}`)}catch(e){throw e.caller=`git.stash`,e}}async function ws({fs:e,dir:t,gitdir:n=Y(t,`.git`),filepath:r,cache:i={},refresh:a=!0}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`filepath`,r);let o=new Z(e),s=await $({fsp:o,dotgit:n}),c=await Ts({fs:o,cache:i,gitdir:s,tree:await Es({fs:o,cache:i,gitdir:s}),path:r}),l=await mt.acquire({fs:o,gitdir:s,cache:i},async function(e){for(let t of e)if(t.path===r)return t;return null});if(c===null&&l===null&&await Wr.isIgnored({fs:o,gitdir:s,dir:t,filepath:r}))return`ignored`;let u=await o.lstat(Y(t,r)),d=c!==null,f=l!==null,p=u!==null,m=async()=>{if(f&&!ot(l,u))return l.oid;{let e=await(await Qt.get({fs:o,gitdir:s})).get(`core.autocrlf`),n=await o.read(Y(t,r),{autocrlf:e}),c=await cs({gitdir:s,type:`blob`,object:n});return a&&f&&l.oid===c&&u.size!==-1&&mt.acquire({fs:o,gitdir:s,cache:i},async function(e){e.insert({filepath:r,stats:u,oid:c})}),c}};if(!d&&!p&&!f)return`absent`;if(!d&&!p&&f)return`*absent`;if(!d&&p&&!f)return`*added`;if(!d&&p&&f)return await m()===l.oid?`added`:`*added`;if(d&&!p&&!f)return`deleted`;if(d&&!p&&f)return l.oid,`*deleted`;if(d&&p&&!f)return await m()===c?`*undeleted`:`*undeletemodified`;if(d&&p&&f){let e=await m();return e===c?e===l.oid?`unmodified`:`*unmodified`:e===l.oid?`modified`:`*modified`}}catch(e){throw e.caller=`git.status`,e}}async function Ts({fs:e,cache:t,gitdir:n,tree:r,path:i}){typeof i==`string`&&(i=i.split(`/`));let a=i.shift();for(let o of r)if(o.path===a){if(i.length===0)return o.oid;let{type:r,object:a}=await In({fs:e,cache:t,gitdir:n,oid:o.oid});if(r===`tree`)return Ts({fs:e,cache:t,gitdir:n,tree:ln.from(a),path:i});if(r===`blob`)throw new Ct(o.oid,r,`blob`,i.join(`/`))}return null}async function Es({fs:e,cache:t,gitdir:n}){let r;try{r=await X.resolve({fs:e,gitdir:n,ref:`HEAD`})}catch(e){if(e instanceof St)return[]}let{tree:i}=await pi({fs:e,cache:t,gitdir:n,oid:r});return i}async function Ds({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r=`HEAD`,filepaths:i=[`.`],filter:a,cache:o={},ignored:s=!1,refresh:c=!0}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r);let l=new Z(e);return await Mr({fs:l,cache:o,dir:t,gitdir:await $({fsp:l,dotgit:n}),trees:[Tr({ref:r}),Dr({refresh:c}),xt()],map:async function(e,[n,r,o]){if(!n&&!o&&r&&!s&&await Wr.isIgnored({fs:l,dir:t,filepath:e})||!i.some(t=>Ei(e,t)))return null;if(a&&!a(e))return;let[c,u,d]=await Promise.all([n&&n.type(),r&&r.type(),o&&o.type()]),f=[c,u,d].includes(`blob`);if((c===`tree`||c===`special`)&&!f)return;if(c===`commit`)return null;if((u===`tree`||u===`special`)&&!f)return;if(d===`commit`)return null;if((d===`tree`||d===`special`)&&!f)return;let p=c===`blob`?await n.oid():void 0,m=d===`blob`?await o.oid():void 0,h;c!==`blob`&&u===`blob`&&d!==`blob`?h=`42`:u===`blob`&&(h=await r.oid());let g=[void 0,p,h,m],_=g.map(e=>g.indexOf(e));return _.shift(),[e,..._]}})}catch(e){throw e.caller=`git.statusMatrix`,e}}async function Os({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r,object:i,force:a=!1}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r);let t=new Z(e);if(r===void 0)throw new $n(`ref`);r=r.startsWith(`refs/tags/`)?r:`refs/tags/${r}`;let o=await $({fsp:t,dotgit:n}),s=await X.resolve({fs:t,gitdir:o,ref:i||`HEAD`});if(!a&&await X.exists({fs:t,gitdir:o,ref:r}))throw new Ln(`tag`,r);await X.writeRef({fs:t,gitdir:o,ref:r,value:s})}catch(e){throw e.caller=`git.tag`,e}}async function ks({fs:e,dir:t,gitdir:n=Y(t,`.git`),cache:r={},filepath:i,oid:a,mode:o,add:s,remove:c,force:l}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`filepath`,i);let u=new Z(e),d=await $({fsp:u,dotgit:n});if(c)return await mt.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!l){let e=await u.lstat(Y(t,i));if(e){if(e.isDirectory())throw new Jn(`directory`);return}}e.has({filepath:i})&&e.delete({filepath:i})});let f;if(!a){if(f=await u.lstat(Y(t,i)),!f)throw new St(`file at "${i}" on disk and "remove" not set`);if(f.isDirectory())throw new Jn(`directory`)}return await mt.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!s&&!e.has({filepath:i}))throw new St(`file at "${i}" in index and "add" not set`);let n;if(a)n={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:o,uid:0,gid:0,size:0};else{n=f;let e=n.isSymbolicLink()?await u.readlink(Y(t,i)):await u.read(Y(t,i));a=await Xr({fs:u,gitdir:d,type:`blob`,format:`content`,object:e})}return e.insert({filepath:i,oid:a,stats:n}),a})}catch(e){throw e.caller=`git.updateIndex`,e}}function As(){try{return xa.version}catch(e){throw e.caller=`git.version`,e}}async function js({fs:e,dir:t,gitdir:n=Y(t,`.git`),trees:r,map:i,reduce:a,iterate:o,cache:s={}}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`trees`,r);let c=new Z(e);return await Mr({fs:c,cache:s,dir:t,gitdir:await $({fsp:c,dotgit:n}),trees:r,map:i,reduce:a,iterate:o})}catch(e){throw e.caller=`git.walk`,e}}async function Ms({fs:e,dir:t,gitdir:n=Y(t,`.git`),blob:r}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`blob`,r);let t=new Z(e);return await Xr({fs:t,gitdir:await $({fsp:t,dotgit:n}),type:`blob`,object:r,format:`content`})}catch(e){throw e.caller=`git.writeBlob`,e}}async function Ns({fs:e,dir:t,gitdir:n=Y(t,`.git`),commit:r}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`commit`,r);let t=new Z(e);return await fs({fs:t,gitdir:await $({fsp:t,dotgit:n}),commit:r})}catch(e){throw e.caller=`git.writeCommit`,e}}async function Ps({fs:e,dir:t,gitdir:n=Y(t,`.git`),type:r,object:i,format:a=`parsed`,oid:o,encoding:s=void 0}){try{let t=new Z(e),c=await $({fsp:t,dotgit:n});if(a===`parsed`){switch(r){case`commit`:i=Sr.from(i).toObject();break;case`tree`:i=ln.from(i).toObject();break;case`blob`:i=Buffer.from(i,s);break;case`tag`:i=yr.from(i).toObject();break;default:throw new Ct(o||``,r,`blob|commit|tag|tree`)}a=`content`}return o=await Xr({fs:t,gitdir:c,type:r,object:i,oid:o,format:a}),o}catch(e){throw e.caller=`git.writeObject`,e}}async function Fs({fs:e,dir:t,gitdir:n=Y(t,`.git`),ref:r,value:i,force:a=!1,symbolic:o=!1}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`ref`,r),Q(`value`,i);let t=new Z(e);if(!vi(r,!0))throw new Tt(r,Be.default.clean(r));let s=await $({fsp:t,dotgit:n});if(!a&&await X.exists({fs:t,gitdir:s,ref:r}))throw new Ln(`ref`,r);o?await X.writeSymbolicRef({fs:t,gitdir:s,ref:r,value:i}):(i=await X.resolve({fs:t,gitdir:s,ref:i}),await X.writeRef({fs:t,gitdir:s,ref:r,value:i}))}catch(e){throw e.caller=`git.writeRef`,e}}async function Is({fs:e,gitdir:t,tag:n}){return await Xr({fs:e,gitdir:t,type:`tag`,object:yr.from(n).toObject(),format:`content`})}async function Ls({fs:e,dir:t,gitdir:n=Y(t,`.git`),tag:r}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`tag`,r);let t=new Z(e);return await Is({fs:t,gitdir:await $({fsp:t,dotgit:n}),tag:r})}catch(e){throw e.caller=`git.writeTag`,e}}async function Rs({fs:e,dir:t,gitdir:n=Y(t,`.git`),tree:r}){try{Q(`fs`,e),Q(`gitdir`,n),Q(`tree`,r);let t=new Z(e);return await mi({fs:t,gitdir:await $({fsp:t,dotgit:n}),tree:r})}catch(e){throw e.caller=`git.writeTree`,e}}var zs={Errors:ur,STAGE:xt,TREE:Tr,WORKDIR:Dr,add:Qr,abortMerge:Ur,addNote:gi,addRemote:bi,annotatedTag:Si,branch:wi,cherryPick:Ui,checkout:Mi,clone:ja,commit:Ma,getConfig:eo,getConfigAll:no,setConfig:ds,currentBranch:Na,deleteBranch:Fa,deleteRef:Ia,deleteRemote:Ra,deleteTag:Ba,expandOid:Wa,expandRef:Ga,fastForward:Ya,fetch:Xa,findMergeBase:Za,findRoot:$a,getRemoteInfo:ro,getRemoteInfo2:ao,hashBlob:so,indexPack:lo,init:uo,isDescendent:po,isIgnored:mo,listBranches:ho,listFiles:vo,listNotes:bo,listRefs:xo,listRemotes:Co,listServerRefs:Eo,listTags:Do,log:Po,merge:Fo,packObjects:zo,pull:Bo,push:Ko,readBlob:Yo,readCommit:Xo,readNote:Qo,readObject:$o,readTag:ts,readTree:ns,remove:rs,removeNote:as,renameBranch:ss,resetIndex:ls,updateIndex:ks,resolveRef:us,status:ws,statusMatrix:Ds,tag:Os,version:As,walk:js,writeBlob:Ms,writeCommit:Ns,writeObject:Ps,writeRef:Fs,writeTag:Ls,writeTree:Rs,stash:Cs};export{ur as Errors,xt as STAGE,Tr as TREE,Dr as WORKDIR,Ur as abortMerge,Qr as add,gi as addNote,bi as addRemote,Si as annotatedTag,wi as branch,Mi as checkout,Ui as cherryPick,ja as clone,Ma as commit,Na as currentBranch,zs as default,Fa as deleteBranch,Ia as deleteRef,Ra as deleteRemote,Ba as deleteTag,Wa as expandOid,Ga as expandRef,Ya as fastForward,Xa as fetch,Za as findMergeBase,$a as findRoot,eo as getConfig,no as getConfigAll,ro as getRemoteInfo,ao as getRemoteInfo2,so as hashBlob,lo as indexPack,uo as init,po as isDescendent,mo as isIgnored,ho as listBranches,vo as listFiles,bo as listNotes,xo as listRefs,Co as listRemotes,Eo as listServerRefs,Do as listTags,Po as log,Fo as merge,zo as packObjects,Bo as pull,Ko as push,Yo as readBlob,Xo as readCommit,Qo as readNote,$o as readObject,ts as readTag,ns as readTree,rs as remove,as as removeNote,ss as renameBranch,ls as resetIndex,us as resolveRef,ds as setConfig,Cs as stash,ws as status,Ds as statusMatrix,Os as tag,ks as updateIndex,As as version,js as walk,Ms as writeBlob,Ns as writeCommit,Ps as writeObject,Fs as writeRef,Ls as writeTag,Rs as writeTree};
|