diff --git a/__tests__/unit/queue.test.ts b/__tests__/unit/queue.test.ts index 014a6c5..5c548c6 100644 --- a/__tests__/unit/queue.test.ts +++ b/__tests__/unit/queue.test.ts @@ -7,6 +7,7 @@ import { } from '../../src/__tests__/helpers' import {CommitAuthor} from '../../src/commit-author' +import {CommitInfo} from '../../src/commit-info' import {CommitOptions} from '../../src/commit-options' import {Queue} from '../../src/queue' import {QueueName} from '../../src/queue-name' @@ -49,6 +50,12 @@ async function createTestQueue(commitOptions: CommitOptions): Promise { } describe('Queue', () => { + it('could be empty', async () => { + const queue = await createTestQueue(commitOptionsForTests()) + + expect(queue.isEmpty()).toBe(true) + }) + it('should dispatch a new job', async () => { const queue = await createTestQueue(commitOptionsForTests()) @@ -59,6 +66,20 @@ describe('Queue', () => { expect(nextJob.payload()).toBe(dummyPayload()) }) + it('should fail when trying to create a job if the previous job has not finished yet', async () => { + const queue = await createTestQueue(commitOptionsForTests()) + + const commit = await queue.createJob(dummyPayload()) + + const fn = async (): Promise => { + return queue.createJob(dummyPayload()) + } + + const expectedError = `Can't create a new job. There is already a pending job in commit: ${commit.hash}` + + await expect(fn()).rejects.toThrowError(expectedError) + }) + it('should mark a job as finished', async () => { const queue = await createTestQueue(commitOptionsForTests()) @@ -70,6 +91,20 @@ describe('Queue', () => { expect(nextJob.isNull()).toBe(true) }) + it('should fail when trying to finish a job without any pending to finish job', async () => { + const queue = await createTestQueue(commitOptionsForTests()) + + const fn = async (): Promise => { + return queue.markJobAsFinished(dummyPayload()) + } + + const expectedError = `Can't mark job as finished. There isn't any pending job in queue: ${queue + .getName() + .toString()}` + + await expect(fn()).rejects.toThrowError(expectedError) + }) + it('should allow to specify the commit author', async () => { const queue = await createTestQueue(commitOptionsForTests()) @@ -133,4 +168,14 @@ describe('Queue', () => { await expect(fn()).rejects.toThrowError(expectedError) }) + + it('should return all the messages in the queue', async () => { + const queue = await createTestQueue(commitOptionsForTests()) + + await queue.createJob(dummyPayload()) + + const messages = queue.getMessages() + + expect(messages).toContain(queue.getLatestMessage()) + }) }) diff --git a/dist/index.js b/dist/index.js index b292757..0c49e1a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1173,6 +1173,9 @@ class Queue { buildCommitMessage(message) { return new commit_message_1.CommitMessage(commit_subject_1.CommitSubject.fromMessageAndQueueName(message, this.name), commit_body_1.CommitBody.fromMessage(message)); } + getName() { + return this.name; + } getGitRepoDir() { return this.gitRepo.getDir(); } diff --git a/dist/index.js.map b/dist/index.js.map index 69c02d5..dcc8e16 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3xHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtIA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../webpack://git-queue/./lib/commit-author.js","../webpack://git-queue/./lib/commit-body.js","../webpack://git-queue/./lib/commit-hash.js","../webpack://git-queue/./lib/commit-info.js","../webpack://git-queue/./lib/commit-message.js","../webpack://git-queue/./lib/commit-options.js","../webpack://git-queue/./lib/commit-subject-parser.js","../webpack://git-queue/./lib/commit-subject.js","../webpack://git-queue/./lib/committed-message-log.js","../webpack://git-queue/./lib/committed-message.js","../webpack://git-queue/./lib/context.js","../webpack://git-queue/./lib/email-address.js","../webpack://git-queue/./lib/error.js","../webpack://git-queue/./lib/errors.js","../webpack://git-queue/./lib/git-repo-dir.js","../webpack://git-queue/./lib/git-repo.js","../webpack://git-queue/./lib/gpg-env.js","../webpack://git-queue/./lib/main.js","../webpack://git-queue/./lib/message-key.js","../webpack://git-queue/./lib/message.js","../webpack://git-queue/./lib/queue-name.js","../webpack://git-queue/./lib/queue.js","../webpack://git-queue/./lib/signing-key-id.js","../webpack://git-queue/./lib/simple-git-factory.js","../webpack://git-queue/./node_modules/@actions/core/lib/command.js","../webpack://git-queue/./node_modules/@actions/core/lib/core.js","../webpack://git-queue/./node_modules/@actions/core/lib/file-command.js","../webpack://git-queue/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://git-queue/./node_modules/@actions/core/lib/utils.js","../webpack://git-queue/./node_modules/@actions/http-client/auth.js","../webpack://git-queue/./node_modules/@actions/http-client/index.js","../webpack://git-queue/./node_modules/@actions/http-client/proxy.js","../webpack://git-queue/./node_modules/@kwsites/file-exists/dist/index.js","../webpack://git-queue/./node_modules/@kwsites/file-exists/dist/src/index.js","../webpack://git-queue/./node_modules/@kwsites/promise-deferred/dist/index.js","../webpack://git-queue/./node_modules/debug/src/browser.js","../webpack://git-queue/./node_modules/debug/src/common.js","../webpack://git-queue/./node_modules/debug/src/index.js","../webpack://git-queue/./node_modules/debug/src/node.js","../webpack://git-queue/./node_modules/has-flag/index.js","../webpack://git-queue/./node_modules/ms/index.js","../webpack://git-queue/./node_modules/simple-git/dist/cjs/index.js","../webpack://git-queue/./node_modules/supports-color/index.js","../webpack://git-queue/./node_modules/tunnel/index.js","../webpack://git-queue/./node_modules/tunnel/lib/tunnel.js","../webpack://git-queue/external node-commonjs \"assert\"","../webpack://git-queue/external node-commonjs \"child_process\"","../webpack://git-queue/external node-commonjs \"events\"","../webpack://git-queue/external node-commonjs \"fs\"","../webpack://git-queue/external node-commonjs \"http\"","../webpack://git-queue/external node-commonjs \"https\"","../webpack://git-queue/external node-commonjs \"net\"","../webpack://git-queue/external node-commonjs \"os\"","../webpack://git-queue/external node-commonjs \"path\"","../webpack://git-queue/external node-commonjs \"tls\"","../webpack://git-queue/external node-commonjs \"tty\"","../webpack://git-queue/external node-commonjs \"util\"","../webpack://git-queue/webpack/bootstrap","../webpack://git-queue/webpack/runtime/compat","../webpack://git-queue/webpack/before-startup","../webpack://git-queue/webpack/startup","../webpack://git-queue/webpack/after-startup"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullCommitAuthor = exports.CommitAuthor = void 0;\nconst email_address_1 = require(\"./email-address\");\nconst NO_AUTHOR_NAME = '--no-author--';\nconst NO_AUTHOR_EMAIL = 'no-author@no-author.com';\nclass CommitAuthor {\n constructor(emailAddress) {\n this.emailAddress = emailAddress;\n }\n static fromEmailAddressString(emailAddress) {\n return new CommitAuthor(new email_address_1.EmailAddress(emailAddress));\n }\n static fromNameAndEmail(name, email) {\n return new CommitAuthor(email_address_1.EmailAddress.fromDisplayNameAndEmail(name, email));\n }\n getName() {\n return this.emailAddress.getDisplayName();\n }\n getEmail() {\n return this.emailAddress.getEmail();\n }\n toString() {\n return this.emailAddress.toString();\n }\n isNull() {\n return (this.getName() === NO_AUTHOR_NAME && this.getEmail() === NO_AUTHOR_EMAIL);\n }\n}\nexports.CommitAuthor = CommitAuthor;\nfunction nullCommitAuthor() {\n return CommitAuthor.fromNameAndEmail(NO_AUTHOR_NAME, NO_AUTHOR_EMAIL);\n}\nexports.nullCommitAuthor = nullCommitAuthor;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitBody = void 0;\nclass CommitBody {\n constructor(text) {\n this.text = text;\n }\n static fromMessage(message) {\n return new CommitBody(message.getPayload());\n }\n toString() {\n return this.text;\n }\n equalsTo(other) {\n return this.text === other.text;\n }\n}\nexports.CommitBody = CommitBody;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullCommitHash = exports.CommitHash = void 0;\nclass CommitHash {\n constructor(value) {\n // TODO: validation\n this.value = value;\n }\n getHash() {\n return this.value;\n }\n isNull() {\n return this.value === '';\n }\n equalsTo(other) {\n return this.value === other.value;\n }\n toString() {\n return this.value;\n }\n}\nexports.CommitHash = CommitHash;\nfunction nullCommitHash() {\n return new CommitHash('');\n}\nexports.nullCommitHash = nullCommitHash;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullCommitInfo = exports.CommitInfo = void 0;\nconst commit_hash_1 = require(\"./commit-hash\");\nclass CommitInfo {\n constructor(hash, date, message, refs, body, authorName, authorEmail) {\n this.hash = hash;\n this.date = date;\n this.message = message;\n this.refs = refs;\n this.body = body;\n this.authorName = authorName;\n this.authorEmail = authorEmail;\n }\n static fromDefaultLogFields(defaultLogFields) {\n return new CommitInfo(new commit_hash_1.CommitHash(defaultLogFields.hash), defaultLogFields.date, defaultLogFields.message, defaultLogFields.refs, defaultLogFields.body, defaultLogFields.author_name, defaultLogFields.author_email);\n }\n equalsTo(other) {\n return (this.hash.equalsTo(other.hash) &&\n this.date === other.date &&\n this.message === other.message &&\n this.refs === other.refs &&\n this.body === other.body &&\n this.authorName === other.authorName &&\n this.authorEmail === other.authorEmail);\n }\n}\nexports.CommitInfo = CommitInfo;\nfunction nullCommitInfo() {\n return new CommitInfo((0, commit_hash_1.nullCommitHash)(), '', '', '', '', '', '');\n}\nexports.nullCommitInfo = nullCommitInfo;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitMessage = void 0;\nconst commit_body_1 = require(\"./commit-body\");\nconst commit_subject_parser_1 = require(\"./commit-subject-parser\");\nclass CommitMessage {\n constructor(subject, body) {\n this.subject = subject;\n this.body = body;\n }\n static fromText(subject, body) {\n return new CommitMessage(commit_subject_parser_1.CommitSubjectParser.parseText(subject), new commit_body_1.CommitBody(body));\n }\n equalsTo(other) {\n return (this.subject.equalsTo(other.subject) && this.body.equalsTo(other.body));\n }\n forSimpleGit() {\n return [this.subject.toString(), this.body.toString()];\n }\n}\nexports.CommitMessage = CommitMessage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitOptions = void 0;\nclass CommitOptions {\n constructor(author, gpgSig, noGpgSig) {\n this.author = author;\n this.gpgSig = gpgSig;\n this.noGpgSig = noGpgSig;\n }\n forSimpleGit() {\n return Object.assign(Object.assign(Object.assign({ '--allow-empty': null }, (!this.author.isNull() && {\n '--author': `\"${this.author.toString()}\"`\n })), (!this.gpgSig.isNull() && {\n '--gpg-sign': this.gpgSig.toString()\n })), (this.noGpgSig && { '--no-gpg-sign': null }));\n }\n toString() {\n const allowEmpty = '--allow-empty';\n const author = this.author.isNull()\n ? ''\n : `--author=\"${this.author.toString()}\"`;\n const gpgSig = this.gpgSig.isNull()\n ? ''\n : `--gpg-sign=${this.gpgSig.toString()}`;\n const noGpgSig = this.noGpgSig ? '--no-gpg-sign' : '';\n return `${allowEmpty} ${author} ${gpgSig} ${noGpgSig}`;\n }\n}\nexports.CommitOptions = CommitOptions;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitSubjectParser = exports.commitSubjectBelongsToAQueue = exports.COMMIT_SUBJECT_JOB_REF_PREFIX = exports.COMMIT_SUBJECT_DELIMITER = exports.COMMIT_SUBJECT_PREFIX = void 0;\nconst errors_1 = require(\"./errors\");\nconst commit_hash_1 = require(\"./commit-hash\");\nconst commit_subject_1 = require(\"./commit-subject\");\nconst message_key_1 = require(\"./message-key\");\nconst queue_name_1 = require(\"./queue-name\");\nexports.COMMIT_SUBJECT_PREFIX = '📝';\nexports.COMMIT_SUBJECT_DELIMITER = ':';\nexports.COMMIT_SUBJECT_JOB_REF_PREFIX = 'job.ref.';\nfunction commitSubjectBelongsToAQueue(subject) {\n return CommitSubjectParser.commitSubjectBelongsToAQueue(subject);\n}\nexports.commitSubjectBelongsToAQueue = commitSubjectBelongsToAQueue;\nclass CommitSubjectParser {\n constructor(text) {\n this.text = text;\n }\n static commitSubjectBelongsToAQueue(subject) {\n return subject.startsWith(exports.COMMIT_SUBJECT_PREFIX);\n }\n static parseText(text) {\n const parser = new CommitSubjectParser(text);\n return new commit_subject_1.CommitSubject(parser.getMessageKey(), parser.getQueueName(), parser.getJobRef());\n }\n static toText(commitSubject) {\n const jobRef = commitSubject.getJobRef().isNull()\n ? ''\n : `${exports.COMMIT_SUBJECT_DELIMITER} ${exports.COMMIT_SUBJECT_JOB_REF_PREFIX}${commitSubject\n .getJobRef()\n .toString()}`;\n return `${exports.COMMIT_SUBJECT_PREFIX}${commitSubject\n .getMessageKey()\n .toString()}${exports.COMMIT_SUBJECT_DELIMITER} ${commitSubject\n .getQueueName()\n .toString()}${jobRef}`;\n }\n getQueueName() {\n const parts = this.text.split(exports.COMMIT_SUBJECT_DELIMITER);\n if (parts[1] === undefined) {\n throw new errors_1.MissingQueueNameInCommitSubjectError(this.text);\n }\n const queueName = parts[1].trim();\n if (queueName === '') {\n throw new errors_1.MissingQueueNameInCommitSubjectError(this.text);\n }\n return new queue_name_1.QueueName(parts[1].trim());\n }\n getMessageKey() {\n const queuePrefix = this.text.indexOf(exports.COMMIT_SUBJECT_PREFIX);\n const colonPos = this.text.indexOf(exports.COMMIT_SUBJECT_DELIMITER);\n const messageKey = this.text.substring(queuePrefix + exports.COMMIT_SUBJECT_PREFIX.length, colonPos);\n if (messageKey === '') {\n throw new errors_1.MissingMessageKeyInCommitSubjectError(this.text);\n }\n return new message_key_1.MessageKey(this.text.substring(queuePrefix + exports.COMMIT_SUBJECT_PREFIX.length, colonPos));\n }\n getJobRef() {\n const jobRef = this.text.indexOf(exports.COMMIT_SUBJECT_JOB_REF_PREFIX);\n const commitHash = this.text\n .substring(jobRef + exports.COMMIT_SUBJECT_JOB_REF_PREFIX.length)\n .trim();\n if (commitHash === '') {\n throw new errors_1.MissingCommitHashInJobReferenceError(this.text);\n }\n return new commit_hash_1.CommitHash(commitHash);\n }\n}\nexports.CommitSubjectParser = CommitSubjectParser;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitSubject = void 0;\nconst commit_subject_parser_1 = require(\"./commit-subject-parser\");\n/* The first line of a commit message.\n * Format: {COMMIT_SUBJECT_PREFIX}{MESSAGE_KEY}: {QUEUE_NAME}: job.ref.{COMMIT_HASH}\n * Example: 📝✅: queue_name: job.ref.1e31b549c630f806961a291b4e3d4a1471f37490\n */\nclass CommitSubject {\n constructor(messageKey, queueName, jobRef) {\n this.messageKey = messageKey;\n this.queueName = queueName;\n this.jobRef = jobRef;\n }\n static fromMessageAndQueueName(message, queueName) {\n return new CommitSubject(message.getKey(), queueName, message.getJobRef());\n }\n toString() {\n return commit_subject_parser_1.CommitSubjectParser.toText(this);\n }\n equalsTo(other) {\n return this.toString() === other.toString();\n }\n belongsToQueue(queueName) {\n return this.queueName.equalsTo(queueName);\n }\n getMessageKey() {\n return this.messageKey;\n }\n getQueueName() {\n return this.queueName;\n }\n getJobRef() {\n return this.jobRef;\n }\n}\nexports.CommitSubject = CommitSubject;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommittedMessageLog = void 0;\nconst committed_message_1 = require(\"./committed-message\");\nconst commit_info_1 = require(\"./commit-info\");\nconst commit_subject_parser_1 = require(\"./commit-subject-parser\");\n/**\n * A readonly list of ordered commit messages.\n * A memory version of `git log` command containing only queue commits.\n */\nclass CommittedMessageLog {\n constructor(messages) {\n this.messages = messages;\n }\n static filterQueueCommits(commits) {\n return commits.filter(commit => (0, commit_subject_parser_1.commitSubjectBelongsToAQueue)(commit.message));\n }\n static fromGitLogCommits(allCommits) {\n const onlyQueueCommits = this.filterQueueCommits(allCommits);\n const committedMessages = onlyQueueCommits.map(commit => committed_message_1.CommittedMessage.fromCommitInfo(commit_info_1.CommitInfo.fromDefaultLogFields(commit)));\n return new CommittedMessageLog(committedMessages);\n }\n getMessages() {\n return this.messages;\n }\n isEmpty() {\n return this.messages.length === 0;\n }\n getLatestMessage() {\n return this.isEmpty() ? (0, committed_message_1.nullMessage)() : this.messages[0];\n }\n findByCommit(commitHash) {\n const commits = this.messages.filter(message => message.commitHash().equalsTo(commitHash));\n if (commits.length === 0) {\n return (0, committed_message_1.nullMessage)();\n }\n return commits[0];\n }\n filterCommitsByQueue(queueName) {\n const filteredMessages = this.messages.filter(committedMessage => committedMessage.belongsToQueue(queueName));\n return new CommittedMessageLog(filteredMessages);\n }\n}\nexports.CommittedMessageLog = CommittedMessageLog;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullMessage = exports.JobFinishedCommittedMessage = exports.NewJobCommittedMessage = exports.NullCommittedMessage = exports.CommittedMessage = void 0;\nconst commit_info_1 = require(\"./commit-info\");\nconst commit_subject_parser_1 = require(\"./commit-subject-parser\");\nconst errors_1 = require(\"./errors\");\nclass CommittedMessage {\n constructor(commit) {\n this.commit = commit;\n }\n static fromCommitInfo(commit) {\n const messageKey = commit_subject_parser_1.CommitSubjectParser.parseText(commit.message).getMessageKey();\n switch (messageKey.toString()) {\n case '🈺': {\n return new NewJobCommittedMessage(commit);\n }\n case '✅': {\n return new JobFinishedCommittedMessage(commit);\n }\n }\n throw new errors_1.InvalidMessageKeyError(messageKey.toString());\n }\n commitInfo() {\n return this.commit;\n }\n commitHash() {\n return this.commit.hash;\n }\n commitSubject() {\n return commit_subject_parser_1.CommitSubjectParser.parseText(this.commit.message);\n }\n payload() {\n return this.commit.body.trim();\n }\n isNull() {\n return this instanceof NullCommittedMessage;\n }\n equalsTo(other) {\n return this.commit.equalsTo(other.commitInfo());\n }\n belongsToQueue(queueName) {\n return this.commitSubject().belongsToQueue(queueName);\n }\n}\nexports.CommittedMessage = CommittedMessage;\nclass NullCommittedMessage extends CommittedMessage {\n}\nexports.NullCommittedMessage = NullCommittedMessage;\nclass NewJobCommittedMessage extends CommittedMessage {\n}\nexports.NewJobCommittedMessage = NewJobCommittedMessage;\nclass JobFinishedCommittedMessage extends CommittedMessage {\n}\nexports.JobFinishedCommittedMessage = JobFinishedCommittedMessage;\nfunction nullMessage() {\n return new NullCommittedMessage((0, commit_info_1.nullCommitInfo)());\n}\nexports.nullMessage = nullMessage;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setOutput = exports.getInputs = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst command_1 = require(\"@actions/core/lib/command\");\nfunction getInputs() {\n return __awaiter(this, void 0, void 0, function* () {\n return {\n queueName: core.getInput('queue_name', { required: true }),\n action: core.getInput('action', { required: true }),\n jobPayload: core.getInput('job_payload', { required: false }),\n gitRepoDir: core.getInput('git_repo_dir', { required: false }),\n gitCommitAuthor: core.getInput('git_commit_author', { required: false }),\n gitCommitGpgSign: core.getInput('git_commit_gpg_sign', { required: false }),\n gitCommitNoGpgSign: core.getInput('git_commit_no_gpg_sign', { required: false }) === 'true'\n ? true\n : false\n };\n });\n}\nexports.getInputs = getInputs;\n// FIXME: Temp fix https://github.com/actions/toolkit/issues/777\nfunction setOutput(name, value) {\n (0, command_1.issueCommand)('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.emailIsValid = exports.EmailAddress = void 0;\n/*\n * Wrapper for RFC5322 email address.\n *\n * For example:\n *\n * A Committer \n * John Smith \n * committer@example.com\n *\n * For this app we only allow this formats:\n *\n * [NAME] \n * EMAIL\n *\n * NAME is optional.\n */\nclass EmailAddress {\n constructor(emailAddress) {\n this.displayName = this.extractDisplayName(emailAddress);\n this.email = this.extractEmail(emailAddress);\n if (!this.isValid(this.email)) {\n throw Error(`Invalid email: ${this.email}`);\n }\n }\n static fromDisplayNameAndEmail(displayName, email) {\n return new EmailAddress(`${displayName} <${email}>`);\n }\n getDisplayName() {\n return this.displayName;\n }\n getEmail() {\n return this.email;\n }\n toString() {\n if (this.displayName === '') {\n return this.email;\n }\n return `${this.displayName} <${this.email}>`;\n }\n extractDisplayName(emailAddress) {\n if (!this.containsDisplayName(emailAddress)) {\n return '';\n }\n const beginEmail = emailAddress.indexOf('<');\n const name = emailAddress.substring(0, beginEmail - 1);\n return name;\n }\n extractEmail(emailAddress) {\n if (!this.containsDisplayName(emailAddress)) {\n return emailAddress;\n }\n const firstChar = emailAddress.indexOf('<');\n const lastChar = emailAddress.indexOf('>');\n const email = emailAddress.substring(firstChar + 1, lastChar);\n return email;\n }\n isValid(email) {\n return emailIsValid(email);\n }\n containsDisplayName(emailAddress) {\n const firstChar = emailAddress.indexOf('<');\n const lastChar = emailAddress.indexOf('>');\n return firstChar !== -1 && lastChar !== -1;\n }\n}\nexports.EmailAddress = EmailAddress;\nfunction emailIsValid(email) {\n return /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@(([^<>().,;\\s@\"]+\\.{0,1})+([^<>().,;:\\s@\"]{2,}|[\\d.]+))$/.test(email);\n}\nexports.emailIsValid = emailIsValid;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getErrorMessage = void 0;\nfunction isErrorWithMessage(error) {\n return (typeof error === 'object' &&\n error !== null &&\n 'message' in error &&\n typeof error.message === 'string');\n}\nfunction toErrorWithMessage(maybeError) {\n if (isErrorWithMessage(maybeError))\n return maybeError;\n try {\n return new Error(JSON.stringify(maybeError));\n }\n catch (_a) {\n // fallback in case there's an error stringifying the maybeError\n // like with circular references for example.\n return new Error(String(maybeError));\n }\n}\nfunction getErrorMessage(error) {\n return toErrorWithMessage(error).message;\n}\nexports.getErrorMessage = getErrorMessage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GitDirNotInitializedError = exports.NoPendingJobsFoundError = exports.PendingJobsLimitReachedError = exports.InvalidMessageKeyError = exports.MissingCommitHashInJobReferenceError = exports.MissingMessageKeyInCommitSubjectError = exports.MissingQueueNameInCommitSubjectError = void 0;\nclass MissingQueueNameInCommitSubjectError extends Error {\n constructor(commitSubject) {\n super(`Missing queue name in commit subject: ${commitSubject}`);\n Object.setPrototypeOf(this, MissingQueueNameInCommitSubjectError.prototype);\n }\n}\nexports.MissingQueueNameInCommitSubjectError = MissingQueueNameInCommitSubjectError;\nclass MissingMessageKeyInCommitSubjectError extends Error {\n constructor(commitSubject) {\n super(`Missing message key in commit subject: ${commitSubject}`);\n Object.setPrototypeOf(this, MissingMessageKeyInCommitSubjectError.prototype);\n }\n}\nexports.MissingMessageKeyInCommitSubjectError = MissingMessageKeyInCommitSubjectError;\nclass MissingCommitHashInJobReferenceError extends Error {\n constructor(commitSubject) {\n super(`Missing commit hash in job reference in commit subject: ${commitSubject}`);\n Object.setPrototypeOf(this, MissingMessageKeyInCommitSubjectError.prototype);\n }\n}\nexports.MissingCommitHashInJobReferenceError = MissingCommitHashInJobReferenceError;\nclass InvalidMessageKeyError extends Error {\n constructor(messageKey) {\n super(`Invalid message key: ${messageKey}`);\n Object.setPrototypeOf(this, InvalidMessageKeyError.prototype);\n }\n}\nexports.InvalidMessageKeyError = InvalidMessageKeyError;\nclass PendingJobsLimitReachedError extends Error {\n constructor(commitHash) {\n super(`Can't create a new job. There is already a pending job in commit: ${commitHash}`);\n Object.setPrototypeOf(this, PendingJobsLimitReachedError.prototype);\n }\n}\nexports.PendingJobsLimitReachedError = PendingJobsLimitReachedError;\nclass NoPendingJobsFoundError extends Error {\n constructor(queueName) {\n super(`Can't mark job as finished. There isn't any pending job in queue: ${queueName}`);\n Object.setPrototypeOf(this, NoPendingJobsFoundError.prototype);\n }\n}\nexports.NoPendingJobsFoundError = NoPendingJobsFoundError;\nclass GitDirNotInitializedError extends Error {\n constructor(dir) {\n super(`Git dir: ${dir} has not been initialized`);\n Object.setPrototypeOf(this, GitDirNotInitializedError.prototype);\n }\n}\nexports.GitDirNotInitializedError = GitDirNotInitializedError;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GitRepoDir = void 0;\nclass GitRepoDir {\n constructor(dirPath) {\n // TODO: validate dir path\n this.dirPath = dirPath;\n }\n getDirPath() {\n return this.dirPath;\n }\n equalsTo(other) {\n return this.dirPath === other.dirPath;\n }\n}\nexports.GitRepoDir = GitRepoDir;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GitRepo = void 0;\nclass GitRepo {\n constructor(dir, git) {\n this.dir = dir;\n this.git = git;\n }\n isInitialized() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.git.checkIsRepo();\n });\n }\n getDir() {\n return this.dir;\n }\n getDirPath() {\n return this.dir.getDirPath();\n }\n init() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.git.init();\n });\n }\n env(name, value) {\n this.git.env(name, value);\n }\n getCurrentBranch() {\n return __awaiter(this, void 0, void 0, function* () {\n const status = yield this.git.status();\n return status.current;\n });\n }\n log() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.git.log();\n });\n }\n hasCommits() {\n return __awaiter(this, void 0, void 0, function* () {\n // TODO: find a better way to check if the repo has commits\n const currentBranch = yield this.getCurrentBranch();\n try {\n yield this.log();\n }\n catch (err) {\n if (err.message.includes(`fatal: your current branch '${currentBranch}' does not have any commits yet`)) {\n // No commits yet\n return false;\n }\n else {\n throw err;\n }\n }\n return true;\n });\n }\n commit(commitMessage, commitOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.git.commit(commitMessage.forSimpleGit(), commitOptions.forSimpleGit());\n });\n }\n}\nexports.GitRepo = GitRepo;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getGnupgHome = void 0;\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst getGnupgHome = () => __awaiter(void 0, void 0, void 0, function* () {\n if (process.env.GNUPGHOME) {\n return process.env.GNUPGHOME;\n }\n let homedir = path.join(process.env.HOME || '', '.gnupg');\n if (os.platform() === 'win32' && !process.env.HOME) {\n homedir = path.join(process.env.USERPROFILE || '', '.gnupg');\n }\n return homedir;\n});\nexports.getGnupgHome = getGnupgHome;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst context = __importStar(require(\"./context\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst commit_author_1 = require(\"./commit-author\");\nconst signing_key_id_1 = require(\"./signing-key-id\");\nconst commit_options_1 = require(\"./commit-options\");\nconst git_repo_1 = require(\"./git-repo\");\nconst git_repo_dir_1 = require(\"./git-repo-dir\");\nconst queue_1 = require(\"./queue\");\nconst queue_name_1 = require(\"./queue-name\");\nconst simple_git_factory_1 = require(\"./simple-git-factory\");\nconst error_1 = require(\"./error\");\nconst gpg_env_1 = require(\"./gpg-env\");\nconst ACTION_CREATE_JOB = 'create-job';\nconst ACTION_NEXT_JOB = 'next-job';\nconst ACTION_FINISH_JOB = 'finish-job';\nfunction actionOptions() {\n const options = [ACTION_CREATE_JOB, ACTION_NEXT_JOB, ACTION_FINISH_JOB];\n return options.join(', ');\n}\nfunction getCommitAuthorFromInputs(commitAuthor) {\n return __awaiter(this, void 0, void 0, function* () {\n if (commitAuthor) {\n return commit_author_1.CommitAuthor.fromEmailAddressString(commitAuthor);\n }\n return (0, commit_author_1.nullCommitAuthor)();\n });\n}\nfunction getSigningKeyIdFromInputs(signingKeyId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (signingKeyId) {\n return new signing_key_id_1.SigningKeyId(signingKeyId);\n }\n return (0, signing_key_id_1.nullSigningKeyId)();\n });\n}\nfunction getGitRepoDirFromInputs(gitRepoDir, cwd) {\n return __awaiter(this, void 0, void 0, function* () {\n if (gitRepoDir !== '') {\n return new git_repo_dir_1.GitRepoDir(gitRepoDir);\n }\n return new git_repo_dir_1.GitRepoDir(cwd);\n });\n}\nfunction getCommitOptionsFromInputs(inputs) {\n return __awaiter(this, void 0, void 0, function* () {\n const author = yield getCommitAuthorFromInputs(inputs.gitCommitAuthor);\n const gpgSign = yield getSigningKeyIdFromInputs(inputs.gitCommitGpgSign);\n const noGpgSig = inputs.gitCommitNoGpgSign;\n return new commit_options_1.CommitOptions(author, gpgSign, noGpgSig);\n });\n}\nfunction printDebugInfo(gitRepoDir, gnuPGHomeDir) {\n return __awaiter(this, void 0, void 0, function* () {\n yield core.group(`Debug info`, () => __awaiter(this, void 0, void 0, function* () {\n core.info(`git_repo_dir: ${gitRepoDir.getDirPath()}`);\n core.info(`gnupg_home_dir: ${gnuPGHomeDir}`);\n }));\n });\n}\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const inputs = yield context.getInputs();\n const gitRepoDir = yield getGitRepoDirFromInputs(inputs.gitRepoDir, process.cwd());\n const commitOptions = yield getCommitOptionsFromInputs(inputs);\n const gnuPGHomeDir = yield (0, gpg_env_1.getGnupgHome)();\n yield printDebugInfo(gitRepoDir, gnuPGHomeDir);\n const git = yield (0, simple_git_factory_1.createGitInstance)(gitRepoDir);\n const gitRepo = new git_repo_1.GitRepo(gitRepoDir, git);\n const queue = yield queue_1.Queue.create(new queue_name_1.QueueName(inputs.queueName), gitRepo, commitOptions);\n switch (inputs.action) {\n case ACTION_CREATE_JOB: {\n const createJobCommit = yield queue.createJob(inputs.jobPayload);\n yield core.group(`Setting outputs`, () => __awaiter(this, void 0, void 0, function* () {\n context.setOutput('job_created', true);\n context.setOutput('job_commit', createJobCommit.hash.toString());\n core.info(`job_created: true`);\n core.info(`job_commit: ${createJobCommit.hash}`);\n }));\n break;\n }\n case ACTION_NEXT_JOB: {\n const nextJob = queue.getNextJob();\n yield core.group(`Setting outputs`, () => __awaiter(this, void 0, void 0, function* () {\n context.setOutput('job_found', !nextJob.isNull());\n if (!nextJob.isNull()) {\n context.setOutput('job_commit', nextJob.commitHash().toString());\n context.setOutput('job_payload', nextJob.payload());\n core.info(`job_commit: ${nextJob.commitHash()}`);\n core.info(`job_payload: ${nextJob.payload()}`);\n }\n }));\n break;\n }\n case ACTION_FINISH_JOB: {\n const markJobAsFinishedCommit = yield queue.markJobAsFinished(inputs.jobPayload);\n yield core.group(`Setting outputs`, () => __awaiter(this, void 0, void 0, function* () {\n context.setOutput('job_finished', true);\n context.setOutput('job_commit', markJobAsFinishedCommit.hash.toString());\n core.info(`job_finished: true`);\n core.info(`job_commit: ${markJobAsFinishedCommit.hash}`);\n }));\n break;\n }\n default: {\n core.error(`Invalid action. Actions can only be: ${actionOptions()}`);\n }\n }\n }\n catch (error) {\n core.setFailed((0, error_1.getErrorMessage)(error));\n }\n });\n}\nrun();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MessageKey = void 0;\nclass MessageKey {\n constructor(id) {\n this.id = id;\n }\n equalsTo(other) {\n return this.id === other.id;\n }\n toString() {\n return this.id;\n }\n}\nexports.MessageKey = MessageKey;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JobFinishedMessage = exports.NewJobMessage = exports.Message = void 0;\nconst commit_hash_1 = require(\"./commit-hash\");\nconst message_key_1 = require(\"./message-key\");\nclass Message {\n constructor(payload, jobRef = (0, commit_hash_1.nullCommitHash)()) {\n this.payload = payload;\n this.jobRef = jobRef;\n }\n getPayload() {\n return this.payload;\n }\n getJobRef() {\n return this.jobRef;\n }\n hasJobRef() {\n return !this.jobRef.isNull();\n }\n}\nexports.Message = Message;\nclass NewJobMessage extends Message {\n getKey() {\n return new message_key_1.MessageKey('🈺');\n }\n}\nexports.NewJobMessage = NewJobMessage;\nclass JobFinishedMessage extends Message {\n getKey() {\n return new message_key_1.MessageKey('✅');\n }\n}\nexports.JobFinishedMessage = JobFinishedMessage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullQueueName = exports.QueueName = void 0;\nclass QueueName {\n constructor(value) {\n // TODO: validation. Issue -> https://github.com/Nautilus-Cyberneering/git-queue/issues/39\n this.value = value;\n }\n isNull() {\n return this.value === '';\n }\n equalsTo(other) {\n return this.value === other.value;\n }\n toString() {\n return this.value;\n }\n}\nexports.QueueName = QueueName;\nfunction nullQueueName() {\n return new QueueName('');\n}\nexports.nullQueueName = nullQueueName;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Queue = void 0;\nconst committed_message_1 = require(\"./committed-message\");\nconst errors_1 = require(\"./errors\");\nconst message_1 = require(\"./message\");\nconst commit_body_1 = require(\"./commit-body\");\nconst commit_hash_1 = require(\"./commit-hash\");\nconst commit_message_1 = require(\"./commit-message\");\nconst commit_subject_1 = require(\"./commit-subject\");\nconst committed_message_log_1 = require(\"./committed-message-log\");\nclass Queue {\n constructor(name, gitRepo, commitOptions) {\n this.name = name;\n this.gitRepo = gitRepo;\n this.commitOptions = commitOptions;\n this.committedMessages = committed_message_log_1.CommittedMessageLog.fromGitLogCommits([]);\n }\n static create(name, gitRepo, commitOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n const queue = new Queue(name, gitRepo, commitOptions);\n yield queue.loadMessagesFromGit();\n return queue;\n });\n }\n guardThatGitRepoHasBeenInitialized() {\n return __awaiter(this, void 0, void 0, function* () {\n const isInitialized = yield this.gitRepo.isInitialized();\n if (!isInitialized) {\n throw new errors_1.GitDirNotInitializedError(this.gitRepo.getDirPath());\n }\n });\n }\n guardThatThereAreNoPendingJobs() {\n if (!this.getNextJob().isNull()) {\n throw new errors_1.PendingJobsLimitReachedError(this.getNextJob().commitHash().toString());\n }\n }\n guardThatThereIsAPendingJob() {\n const pendingJob = this.getNextJob();\n if (pendingJob.isNull()) {\n throw new errors_1.NoPendingJobsFoundError(this.name.toString());\n }\n return pendingJob;\n }\n loadMessagesFromGit() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.guardThatGitRepoHasBeenInitialized();\n const noCommits = !(yield this.gitRepo.hasCommits()) ? true : false;\n if (noCommits) {\n return;\n }\n const logCommits = yield this.gitRepo.log();\n const allMessages = committed_message_log_1.CommittedMessageLog.fromGitLogCommits(logCommits.all);\n this.committedMessages = allMessages.filterCommitsByQueue(this.name);\n });\n }\n commitMessage(message) {\n return __awaiter(this, void 0, void 0, function* () {\n const commitMessage = this.buildCommitMessage(message);\n const commitResult = yield this.gitRepo.commit(commitMessage, this.commitOptions);\n yield this.loadMessagesFromGit();\n const committedMessage = this.findCommittedMessageByCommit(new commit_hash_1.CommitHash(commitResult.commit));\n return committedMessage.commitInfo();\n });\n }\n buildCommitMessage(message) {\n return new commit_message_1.CommitMessage(commit_subject_1.CommitSubject.fromMessageAndQueueName(message, this.name), commit_body_1.CommitBody.fromMessage(message));\n }\n getGitRepoDir() {\n return this.gitRepo.getDir();\n }\n getMessages() {\n return this.committedMessages.getMessages();\n }\n getLatestMessage() {\n return this.committedMessages.getLatestMessage();\n }\n isEmpty() {\n return this.committedMessages.isEmpty();\n }\n getNextJob() {\n const latestMessage = this.getLatestMessage();\n return latestMessage instanceof committed_message_1.NewJobCommittedMessage\n ? latestMessage\n : (0, committed_message_1.nullMessage)();\n }\n findCommittedMessageByCommit(commitHash) {\n return this.committedMessages.findByCommit(commitHash);\n }\n createJob(payload) {\n return __awaiter(this, void 0, void 0, function* () {\n this.guardThatThereAreNoPendingJobs();\n const message = new message_1.NewJobMessage(payload);\n return this.commitMessage(message);\n });\n }\n markJobAsFinished(payload) {\n return __awaiter(this, void 0, void 0, function* () {\n const pendingJob = this.guardThatThereIsAPendingJob();\n const message = new message_1.JobFinishedMessage(payload, pendingJob.commitHash());\n return this.commitMessage(message);\n });\n }\n}\nexports.Queue = Queue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullSigningKeyId = exports.SigningKeyId = void 0;\nclass SigningKeyId {\n constructor(id) {\n this.id = id;\n }\n equalsTo(other) {\n return this.id === other.id;\n }\n toString() {\n return this.id;\n }\n isNull() {\n return this.id === '';\n }\n}\nexports.SigningKeyId = SigningKeyId;\nfunction nullSigningKeyId() {\n return new SigningKeyId('');\n}\nexports.nullSigningKeyId = nullSigningKeyId;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createGitInstance = void 0;\nconst simple_git_1 = __importDefault(require(\"simple-git\"));\nfunction getGitConfig(key, git) {\n return __awaiter(this, void 0, void 0, function* () {\n const option = yield git.getConfig(key);\n if (option.value) {\n return option.value;\n }\n return null;\n });\n}\nfunction createGitInstance(gitRepoDir) {\n return __awaiter(this, void 0, void 0, function* () {\n const git = (0, simple_git_1.default)(gitRepoDir.getDirPath());\n /*\n * We need to pass the env vars to the child git process\n * because the user might want to use some env vars like:\n *\n * For GPG:\n * GNUPGHOME\n *\n * For git commit:\n * GIT_AUTHOR_NAME\n * GIT_AUTHOR_EMAIL\n * GIT_AUTHOR_DATE\n * GIT_COMMITTER_NAME\n * GIT_COMMITTER_EMAIL\n * GIT_COMMITTER_DATE\n *\n * TODO: Code review. Should we pass only the env vars used by git commit?\n */\n git.env(process.env);\n /*\n * It seems the `git` child process does not apply the global git config,\n * at least for the `git commit` command. You have to overwrite local config with the global.\n */\n const userName = yield getGitConfig('user.name', git);\n if (userName) {\n git.addConfig('user.name', userName);\n }\n const userEmail = yield getGitConfig('user.email', git);\n if (userEmail) {\n git.addConfig('user.email', userEmail);\n }\n const userSigningkey = yield getGitConfig('user.signingkey', git);\n if (userSigningkey) {\n git.addConfig('user.signingkey', userSigningkey);\n }\n const commitGpgsign = yield getGitConfig('commit.gpgsign', git);\n if (commitGpgsign) {\n git.addConfig('commit.gpgsign', commitGpgsign);\n }\n return git;\n });\n}\nexports.createGitInstance = createGitInstance;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n options.headers['Authorization'] =\n 'Basic ' +\n Buffer.from(this.username + ':' + this.password).toString('base64');\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n options.headers['Authorization'] =\n 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst http = require(\"http\");\nconst https = require(\"https\");\nconst pm = require(\"./proxy\");\nlet tunnel;\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return new Promise(async (resolve, reject) => {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n let parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n }\n get(requestUrl, additionalHeaders) {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n }\n del(requestUrl, additionalHeaders) {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n }\n post(requestUrl, data, additionalHeaders) {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n }\n patch(requestUrl, data, additionalHeaders) {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n }\n put(requestUrl, data, additionalHeaders) {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n }\n head(requestUrl, additionalHeaders) {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n async getJson(requestUrl, additionalHeaders = {}) {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n let res = await this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async postJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async putJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async patchJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n async request(verb, requestUrl, data, headers) {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n let parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n while (numTries < maxTries) {\n response = await this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (let i = 0; i < this.handlers.length; i++) {\n if (this.handlers[i].canHandleAuthentication(response)) {\n authenticationHandler = this.handlers[i];\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n let parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol == 'https:' &&\n parsedUrl.protocol != parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n await response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (let header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = await this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n await response.readBody();\n await this._performExponentialBackoff(numTries);\n }\n }\n return response;\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return new Promise((resolve, reject) => {\n let callbackForResult = function (err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n };\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof data === 'string') {\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n let parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n this.handlers.forEach(handler => {\n handler.prepareRequest(info.options);\n });\n }\n return info;\n }\n _mergeHeaders(headers) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n let proxyUrl = pm.getProxyUrl(parsedUrl);\n let useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (!!agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (!!this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n if (useProxy) {\n // If using proxy, need tunnel\n if (!tunnel) {\n tunnel = require('tunnel');\n }\n const agentOptions = {\n maxSockets: maxSockets,\n keepAlive: this._keepAlive,\n proxy: {\n ...((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n }),\n host: proxyUrl.hostname,\n port: proxyUrl.port\n }\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n }\n static dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n let a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n async _processResponse(res, options) {\n return new Promise(async (resolve, reject) => {\n const statusCode = res.message.statusCode;\n const response = {\n statusCode: statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode == HttpCodes.NotFound) {\n resolve(response);\n }\n let obj;\n let contents;\n // get the result from the body\n try {\n contents = await res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = 'Failed request: (' + statusCode + ')';\n }\n let err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n });\n }\n}\nexports.HttpClient = HttpClient;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getProxyUrl(reqUrl) {\n let usingSsl = reqUrl.protocol === 'https:';\n let proxyUrl;\n if (checkBypass(reqUrl)) {\n return proxyUrl;\n }\n let proxyVar;\n if (usingSsl) {\n proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n if (proxyVar) {\n proxyUrl = new URL(proxyVar);\n }\n return proxyUrl;\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n let upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (let upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./src\"));\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs_1 = require(\"fs\");\nconst debug_1 = __importDefault(require(\"debug\"));\nconst log = debug_1.default('@kwsites/file-exists');\nfunction check(path, isFile, isDirectory) {\n log(`checking %s`, path);\n try {\n const stat = fs_1.statSync(path);\n if (stat.isFile() && isFile) {\n log(`[OK] path represents a file`);\n return true;\n }\n if (stat.isDirectory() && isDirectory) {\n log(`[OK] path represents a directory`);\n return true;\n }\n log(`[FAIL] path represents something other than a file or directory`);\n return false;\n }\n catch (e) {\n if (e.code === 'ENOENT') {\n log(`[FAIL] path is not accessible: %o`, e);\n return false;\n }\n log(`[FATAL] %o`, e);\n throw e;\n }\n}\n/**\n * Synchronous validation of a path existing either as a file or as a directory.\n *\n * @param {string} path The path to check\n * @param {number} type One or both of the exported numeric constants\n */\nfunction exists(path, type = exports.READABLE) {\n return check(path, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);\n}\nexports.exists = exists;\n/**\n * Constant representing a file\n */\nexports.FILE = 1;\n/**\n * Constant representing a folder\n */\nexports.FOLDER = 2;\n/**\n * Constant representing either a file or a folder\n */\nexports.READABLE = exports.FILE + exports.FOLDER;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDeferred = exports.deferred = void 0;\n/**\n * Creates a new `DeferredPromise`\n *\n * ```typescript\n import {deferred} from '@kwsites/promise-deferred`;\n ```\n */\nfunction deferred() {\n let done;\n let fail;\n let status = 'pending';\n const promise = new Promise((_done, _fail) => {\n done = _done;\n fail = _fail;\n });\n return {\n promise,\n done(result) {\n if (status === 'pending') {\n status = 'resolved';\n done(result);\n }\n },\n fail(error) {\n if (status === 'pending') {\n status = 'rejected';\n fail(error);\n }\n },\n get fulfilled() {\n return status !== 'pending';\n },\n get status() {\n return status;\n },\n };\n}\nexports.deferred = deferred;\n/**\n * Alias of the exported `deferred` function, to help consumers wanting to use `deferred` as the\n * local variable name rather than the factory import name, without needing to rename on import.\n *\n * ```typescript\n import {createDeferred} from '@kwsites/promise-deferred`;\n ```\n */\nexports.createDeferred = deferred;\n/**\n * Default export allows use as:\n *\n * ```typescript\n import deferred from '@kwsites/promise-deferred`;\n ```\n */\nexports.default = deferred;\n//# sourceMappingURL=index.js.map","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __markAsModule = (target) => __defProp(target, \"__esModule\", { value: true });\nvar __esm = (fn, res) => function __init() {\n return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __reExport = (target, module2, copyDefault, desc) => {\n if (module2 && typeof module2 === \"object\" || typeof module2 === \"function\") {\n for (let key of __getOwnPropNames(module2))\n if (!__hasOwnProp.call(target, key) && (copyDefault || key !== \"default\"))\n __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });\n }\n return target;\n};\nvar __toESM = (module2, isNodeMode) => {\n return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, \"default\", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);\n};\nvar __toCommonJS = /* @__PURE__ */ ((cache) => {\n return (module2, temp) => {\n return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);\n };\n})(typeof WeakMap !== \"undefined\" ? /* @__PURE__ */ new WeakMap() : 0);\nvar __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\n\n// src/lib/errors/git-error.ts\nvar GitError;\nvar init_git_error = __esm({\n \"src/lib/errors/git-error.ts\"() {\n GitError = class extends Error {\n constructor(task, message) {\n super(message);\n this.task = task;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n };\n }\n});\n\n// src/lib/errors/git-response-error.ts\nvar GitResponseError;\nvar init_git_response_error = __esm({\n \"src/lib/errors/git-response-error.ts\"() {\n init_git_error();\n GitResponseError = class extends GitError {\n constructor(git, message) {\n super(void 0, message || String(git));\n this.git = git;\n }\n };\n }\n});\n\n// src/lib/errors/git-construct-error.ts\nvar GitConstructError;\nvar init_git_construct_error = __esm({\n \"src/lib/errors/git-construct-error.ts\"() {\n init_git_error();\n GitConstructError = class extends GitError {\n constructor(config, message) {\n super(void 0, message);\n this.config = config;\n }\n };\n }\n});\n\n// src/lib/errors/git-plugin-error.ts\nvar GitPluginError;\nvar init_git_plugin_error = __esm({\n \"src/lib/errors/git-plugin-error.ts\"() {\n init_git_error();\n GitPluginError = class extends GitError {\n constructor(task, plugin, message) {\n super(task, message);\n this.task = task;\n this.plugin = plugin;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n };\n }\n});\n\n// src/lib/errors/task-configuration-error.ts\nvar TaskConfigurationError;\nvar init_task_configuration_error = __esm({\n \"src/lib/errors/task-configuration-error.ts\"() {\n init_git_error();\n TaskConfigurationError = class extends GitError {\n constructor(message) {\n super(void 0, message);\n }\n };\n }\n});\n\n// src/lib/utils/util.ts\nfunction asFunction(source) {\n return typeof source === \"function\" ? source : NOOP;\n}\nfunction isUserFunction(source) {\n return typeof source === \"function\" && source !== NOOP;\n}\nfunction splitOn(input, char) {\n const index = input.indexOf(char);\n if (index <= 0) {\n return [input, \"\"];\n }\n return [\n input.substr(0, index),\n input.substr(index + 1)\n ];\n}\nfunction first(input, offset = 0) {\n return isArrayLike(input) && input.length > offset ? input[offset] : void 0;\n}\nfunction last(input, offset = 0) {\n if (isArrayLike(input) && input.length > offset) {\n return input[input.length - 1 - offset];\n }\n}\nfunction isArrayLike(input) {\n return !!(input && typeof input.length === \"number\");\n}\nfunction toLinesWithContent(input = \"\", trimmed2 = true, separator = \"\\n\") {\n return input.split(separator).reduce((output, line) => {\n const lineContent = trimmed2 ? line.trim() : line;\n if (lineContent) {\n output.push(lineContent);\n }\n return output;\n }, []);\n}\nfunction forEachLineWithContent(input, callback) {\n return toLinesWithContent(input, true).map((line) => callback(line));\n}\nfunction folderExists(path) {\n return (0, import_file_exists.exists)(path, import_file_exists.FOLDER);\n}\nfunction append(target, item) {\n if (Array.isArray(target)) {\n if (!target.includes(item)) {\n target.push(item);\n }\n } else {\n target.add(item);\n }\n return item;\n}\nfunction including(target, item) {\n if (Array.isArray(target) && !target.includes(item)) {\n target.push(item);\n }\n return target;\n}\nfunction remove(target, item) {\n if (Array.isArray(target)) {\n const index = target.indexOf(item);\n if (index >= 0) {\n target.splice(index, 1);\n }\n } else {\n target.delete(item);\n }\n return item;\n}\nfunction asArray(source) {\n return Array.isArray(source) ? source : [source];\n}\nfunction asStringArray(source) {\n return asArray(source).map(String);\n}\nfunction asNumber(source, onNaN = 0) {\n if (source == null) {\n return onNaN;\n }\n const num = parseInt(source, 10);\n return isNaN(num) ? onNaN : num;\n}\nfunction prefixedArray(input, prefix) {\n const output = [];\n for (let i = 0, max = input.length; i < max; i++) {\n output.push(prefix, input[i]);\n }\n return output;\n}\nfunction bufferToString(input) {\n return (Array.isArray(input) ? Buffer.concat(input) : input).toString(\"utf-8\");\n}\nfunction pick(source, properties) {\n return Object.assign({}, ...properties.map((property) => property in source ? { [property]: source[property] } : {}));\n}\nfunction delay(duration = 0) {\n return new Promise((done) => setTimeout(done, duration));\n}\nvar import_file_exists, NULL, NOOP, objectToString;\nvar init_util = __esm({\n \"src/lib/utils/util.ts\"() {\n import_file_exists = require(\"@kwsites/file-exists\");\n NULL = \"\\0\";\n NOOP = () => {\n };\n objectToString = Object.prototype.toString.call.bind(Object.prototype.toString);\n }\n});\n\n// src/lib/utils/argument-filters.ts\nfunction filterType(input, filter, def) {\n if (filter(input)) {\n return input;\n }\n return arguments.length > 2 ? def : void 0;\n}\nfunction filterPrimitives(input, omit) {\n return /number|string|boolean/.test(typeof input) && (!omit || !omit.includes(typeof input));\n}\nfunction filterPlainObject(input) {\n return !!input && objectToString(input) === \"[object Object]\";\n}\nfunction filterFunction(input) {\n return typeof input === \"function\";\n}\nvar filterArray, filterString, filterStringArray, filterStringOrStringArray, filterHasLength;\nvar init_argument_filters = __esm({\n \"src/lib/utils/argument-filters.ts\"() {\n init_util();\n filterArray = (input) => {\n return Array.isArray(input);\n };\n filterString = (input) => {\n return typeof input === \"string\";\n };\n filterStringArray = (input) => {\n return Array.isArray(input) && input.every(filterString);\n };\n filterStringOrStringArray = (input) => {\n return filterString(input) || Array.isArray(input) && input.every(filterString);\n };\n filterHasLength = (input) => {\n if (input == null || \"number|boolean|function\".includes(typeof input)) {\n return false;\n }\n return Array.isArray(input) || typeof input === \"string\" || typeof input.length === \"number\";\n };\n }\n});\n\n// src/lib/utils/exit-codes.ts\nvar ExitCodes;\nvar init_exit_codes = __esm({\n \"src/lib/utils/exit-codes.ts\"() {\n ExitCodes = /* @__PURE__ */ ((ExitCodes2) => {\n ExitCodes2[ExitCodes2[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExitCodes2[ExitCodes2[\"ERROR\"] = 1] = \"ERROR\";\n ExitCodes2[ExitCodes2[\"UNCLEAN\"] = 128] = \"UNCLEAN\";\n return ExitCodes2;\n })(ExitCodes || {});\n }\n});\n\n// src/lib/utils/git-output-streams.ts\nvar GitOutputStreams;\nvar init_git_output_streams = __esm({\n \"src/lib/utils/git-output-streams.ts\"() {\n GitOutputStreams = class {\n constructor(stdOut, stdErr) {\n this.stdOut = stdOut;\n this.stdErr = stdErr;\n }\n asStrings() {\n return new GitOutputStreams(this.stdOut.toString(\"utf8\"), this.stdErr.toString(\"utf8\"));\n }\n };\n }\n});\n\n// src/lib/utils/line-parser.ts\nvar LineParser, RemoteLineParser;\nvar init_line_parser = __esm({\n \"src/lib/utils/line-parser.ts\"() {\n LineParser = class {\n constructor(regExp, useMatches) {\n this.matches = [];\n this.parse = (line, target) => {\n this.resetMatches();\n if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {\n return false;\n }\n return this.useMatches(target, this.prepareMatches()) !== false;\n };\n this._regExp = Array.isArray(regExp) ? regExp : [regExp];\n if (useMatches) {\n this.useMatches = useMatches;\n }\n }\n useMatches(target, match) {\n throw new Error(`LineParser:useMatches not implemented`);\n }\n resetMatches() {\n this.matches.length = 0;\n }\n prepareMatches() {\n return this.matches;\n }\n addMatch(reg, index, line) {\n const matched = line && reg.exec(line);\n if (matched) {\n this.pushMatch(index, matched);\n }\n return !!matched;\n }\n pushMatch(_index, matched) {\n this.matches.push(...matched.slice(1));\n }\n };\n RemoteLineParser = class extends LineParser {\n addMatch(reg, index, line) {\n return /^remote:\\s/.test(String(line)) && super.addMatch(reg, index, line);\n }\n pushMatch(index, matched) {\n if (index > 0 || matched.length > 1) {\n super.pushMatch(index, matched);\n }\n }\n };\n }\n});\n\n// src/lib/utils/simple-git-options.ts\nfunction createInstanceConfig(...options) {\n const baseDir = process.cwd();\n const config = Object.assign(__spreadValues({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === \"object\" && o));\n config.baseDir = config.baseDir || baseDir;\n return config;\n}\nvar defaultOptions;\nvar init_simple_git_options = __esm({\n \"src/lib/utils/simple-git-options.ts\"() {\n defaultOptions = {\n binary: \"git\",\n maxConcurrentProcesses: 5,\n config: []\n };\n }\n});\n\n// src/lib/utils/task-options.ts\nfunction appendTaskOptions(options, commands = []) {\n if (!filterPlainObject(options)) {\n return commands;\n }\n return Object.keys(options).reduce((commands2, key) => {\n const value = options[key];\n if (filterPrimitives(value, [\"boolean\"])) {\n commands2.push(key + \"=\" + value);\n } else {\n commands2.push(key);\n }\n return commands2;\n }, commands);\n}\nfunction getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {\n const command = [];\n for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) {\n if (\"string|number\".includes(typeof args[i])) {\n command.push(String(args[i]));\n }\n }\n appendTaskOptions(trailingOptionsArgument(args), command);\n if (!objectOnly) {\n command.push(...trailingArrayArgument(args));\n }\n return command;\n}\nfunction trailingArrayArgument(args) {\n const hasTrailingCallback = typeof last(args) === \"function\";\n return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);\n}\nfunction trailingOptionsArgument(args) {\n const hasTrailingCallback = filterFunction(last(args));\n return filterType(last(args, hasTrailingCallback ? 1 : 0), filterPlainObject);\n}\nfunction trailingFunctionArgument(args, includeNoop = true) {\n const callback = asFunction(last(args));\n return includeNoop || isUserFunction(callback) ? callback : void 0;\n}\nvar init_task_options = __esm({\n \"src/lib/utils/task-options.ts\"() {\n init_argument_filters();\n init_util();\n }\n});\n\n// src/lib/utils/task-parser.ts\nfunction callTaskParser(parser3, streams) {\n return parser3(streams.stdOut, streams.stdErr);\n}\nfunction parseStringResponse(result, parsers11, ...texts) {\n texts.forEach((text) => {\n for (let lines = toLinesWithContent(text), i = 0, max = lines.length; i < max; i++) {\n const line = (offset = 0) => {\n if (i + offset >= max) {\n return;\n }\n return lines[i + offset];\n };\n parsers11.some(({ parse }) => parse(line, result));\n }\n });\n return result;\n}\nvar init_task_parser = __esm({\n \"src/lib/utils/task-parser.ts\"() {\n init_util();\n }\n});\n\n// src/lib/utils/index.ts\nvar utils_exports = {};\n__export(utils_exports, {\n ExitCodes: () => ExitCodes,\n GitOutputStreams: () => GitOutputStreams,\n LineParser: () => LineParser,\n NOOP: () => NOOP,\n NULL: () => NULL,\n RemoteLineParser: () => RemoteLineParser,\n append: () => append,\n appendTaskOptions: () => appendTaskOptions,\n asArray: () => asArray,\n asFunction: () => asFunction,\n asNumber: () => asNumber,\n asStringArray: () => asStringArray,\n bufferToString: () => bufferToString,\n callTaskParser: () => callTaskParser,\n createInstanceConfig: () => createInstanceConfig,\n delay: () => delay,\n filterArray: () => filterArray,\n filterFunction: () => filterFunction,\n filterHasLength: () => filterHasLength,\n filterPlainObject: () => filterPlainObject,\n filterPrimitives: () => filterPrimitives,\n filterString: () => filterString,\n filterStringArray: () => filterStringArray,\n filterStringOrStringArray: () => filterStringOrStringArray,\n filterType: () => filterType,\n first: () => first,\n folderExists: () => folderExists,\n forEachLineWithContent: () => forEachLineWithContent,\n getTrailingOptions: () => getTrailingOptions,\n including: () => including,\n isUserFunction: () => isUserFunction,\n last: () => last,\n objectToString: () => objectToString,\n parseStringResponse: () => parseStringResponse,\n pick: () => pick,\n prefixedArray: () => prefixedArray,\n remove: () => remove,\n splitOn: () => splitOn,\n toLinesWithContent: () => toLinesWithContent,\n trailingFunctionArgument: () => trailingFunctionArgument,\n trailingOptionsArgument: () => trailingOptionsArgument\n});\nvar init_utils = __esm({\n \"src/lib/utils/index.ts\"() {\n init_argument_filters();\n init_exit_codes();\n init_git_output_streams();\n init_line_parser();\n init_simple_git_options();\n init_task_options();\n init_task_parser();\n init_util();\n }\n});\n\n// src/lib/tasks/check-is-repo.ts\nvar check_is_repo_exports = {};\n__export(check_is_repo_exports, {\n CheckRepoActions: () => CheckRepoActions,\n checkIsBareRepoTask: () => checkIsBareRepoTask,\n checkIsRepoRootTask: () => checkIsRepoRootTask,\n checkIsRepoTask: () => checkIsRepoTask\n});\nfunction checkIsRepoTask(action) {\n switch (action) {\n case \"bare\" /* BARE */:\n return checkIsBareRepoTask();\n case \"root\" /* IS_REPO_ROOT */:\n return checkIsRepoRootTask();\n }\n const commands = [\"rev-parse\", \"--is-inside-work-tree\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser\n };\n}\nfunction checkIsRepoRootTask() {\n const commands = [\"rev-parse\", \"--git-dir\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser(path) {\n return /^\\.(git)?$/.test(path.trim());\n }\n };\n}\nfunction checkIsBareRepoTask() {\n const commands = [\"rev-parse\", \"--is-bare-repository\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser\n };\n}\nfunction isNotRepoMessage(error) {\n return /(Not a git repository|Kein Git-Repository)/i.test(String(error));\n}\nvar CheckRepoActions, onError, parser;\nvar init_check_is_repo = __esm({\n \"src/lib/tasks/check-is-repo.ts\"() {\n init_utils();\n CheckRepoActions = /* @__PURE__ */ ((CheckRepoActions2) => {\n CheckRepoActions2[\"BARE\"] = \"bare\";\n CheckRepoActions2[\"IN_TREE\"] = \"tree\";\n CheckRepoActions2[\"IS_REPO_ROOT\"] = \"root\";\n return CheckRepoActions2;\n })(CheckRepoActions || {});\n onError = ({ exitCode }, error, done, fail) => {\n if (exitCode === 128 /* UNCLEAN */ && isNotRepoMessage(error)) {\n return done(Buffer.from(\"false\"));\n }\n fail(error);\n };\n parser = (text) => {\n return text.trim() === \"true\";\n };\n }\n});\n\n// src/lib/responses/CleanSummary.ts\nfunction cleanSummaryParser(dryRun, text) {\n const summary = new CleanResponse(dryRun);\n const regexp = dryRun ? dryRunRemovalRegexp : removalRegexp;\n toLinesWithContent(text).forEach((line) => {\n const removed = line.replace(regexp, \"\");\n summary.paths.push(removed);\n (isFolderRegexp.test(removed) ? summary.folders : summary.files).push(removed);\n });\n return summary;\n}\nvar CleanResponse, removalRegexp, dryRunRemovalRegexp, isFolderRegexp;\nvar init_CleanSummary = __esm({\n \"src/lib/responses/CleanSummary.ts\"() {\n init_utils();\n CleanResponse = class {\n constructor(dryRun) {\n this.dryRun = dryRun;\n this.paths = [];\n this.files = [];\n this.folders = [];\n }\n };\n removalRegexp = /^[a-z]+\\s*/i;\n dryRunRemovalRegexp = /^[a-z]+\\s+[a-z]+\\s*/i;\n isFolderRegexp = /\\/$/;\n }\n});\n\n// src/lib/tasks/task.ts\nvar task_exports = {};\n__export(task_exports, {\n EMPTY_COMMANDS: () => EMPTY_COMMANDS,\n adhocExecTask: () => adhocExecTask,\n configurationErrorTask: () => configurationErrorTask,\n isBufferTask: () => isBufferTask,\n isEmptyTask: () => isEmptyTask,\n straightThroughBufferTask: () => straightThroughBufferTask,\n straightThroughStringTask: () => straightThroughStringTask\n});\nfunction adhocExecTask(parser3) {\n return {\n commands: EMPTY_COMMANDS,\n format: \"empty\",\n parser: parser3\n };\n}\nfunction configurationErrorTask(error) {\n return {\n commands: EMPTY_COMMANDS,\n format: \"empty\",\n parser() {\n throw typeof error === \"string\" ? new TaskConfigurationError(error) : error;\n }\n };\n}\nfunction straightThroughStringTask(commands, trimmed2 = false) {\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return trimmed2 ? String(text).trim() : text;\n }\n };\n}\nfunction straightThroughBufferTask(commands) {\n return {\n commands,\n format: \"buffer\",\n parser(buffer) {\n return buffer;\n }\n };\n}\nfunction isBufferTask(task) {\n return task.format === \"buffer\";\n}\nfunction isEmptyTask(task) {\n return task.format === \"empty\" || !task.commands.length;\n}\nvar EMPTY_COMMANDS;\nvar init_task = __esm({\n \"src/lib/tasks/task.ts\"() {\n init_task_configuration_error();\n EMPTY_COMMANDS = [];\n }\n});\n\n// src/lib/tasks/clean.ts\nvar clean_exports = {};\n__export(clean_exports, {\n CONFIG_ERROR_INTERACTIVE_MODE: () => CONFIG_ERROR_INTERACTIVE_MODE,\n CONFIG_ERROR_MODE_REQUIRED: () => CONFIG_ERROR_MODE_REQUIRED,\n CONFIG_ERROR_UNKNOWN_OPTION: () => CONFIG_ERROR_UNKNOWN_OPTION,\n CleanOptions: () => CleanOptions,\n cleanTask: () => cleanTask,\n cleanWithOptionsTask: () => cleanWithOptionsTask,\n isCleanOptionsArray: () => isCleanOptionsArray\n});\nfunction cleanWithOptionsTask(mode, customArgs) {\n const { cleanMode, options, valid } = getCleanOptions(mode);\n if (!cleanMode) {\n return configurationErrorTask(CONFIG_ERROR_MODE_REQUIRED);\n }\n if (!valid.options) {\n return configurationErrorTask(CONFIG_ERROR_UNKNOWN_OPTION + JSON.stringify(mode));\n }\n options.push(...customArgs);\n if (options.some(isInteractiveMode)) {\n return configurationErrorTask(CONFIG_ERROR_INTERACTIVE_MODE);\n }\n return cleanTask(cleanMode, options);\n}\nfunction cleanTask(mode, customArgs) {\n const commands = [\"clean\", `-${mode}`, ...customArgs];\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return cleanSummaryParser(mode === \"n\" /* DRY_RUN */, text);\n }\n };\n}\nfunction isCleanOptionsArray(input) {\n return Array.isArray(input) && input.every((test) => CleanOptionValues.has(test));\n}\nfunction getCleanOptions(input) {\n let cleanMode;\n let options = [];\n let valid = { cleanMode: false, options: true };\n input.replace(/[^a-z]i/g, \"\").split(\"\").forEach((char) => {\n if (isCleanMode(char)) {\n cleanMode = char;\n valid.cleanMode = true;\n } else {\n valid.options = valid.options && isKnownOption(options[options.length] = `-${char}`);\n }\n });\n return {\n cleanMode,\n options,\n valid\n };\n}\nfunction isCleanMode(cleanMode) {\n return cleanMode === \"f\" /* FORCE */ || cleanMode === \"n\" /* DRY_RUN */;\n}\nfunction isKnownOption(option) {\n return /^-[a-z]$/i.test(option) && CleanOptionValues.has(option.charAt(1));\n}\nfunction isInteractiveMode(option) {\n if (/^-[^\\-]/.test(option)) {\n return option.indexOf(\"i\") > 0;\n }\n return option === \"--interactive\";\n}\nvar CONFIG_ERROR_INTERACTIVE_MODE, CONFIG_ERROR_MODE_REQUIRED, CONFIG_ERROR_UNKNOWN_OPTION, CleanOptions, CleanOptionValues;\nvar init_clean = __esm({\n \"src/lib/tasks/clean.ts\"() {\n init_CleanSummary();\n init_utils();\n init_task();\n CONFIG_ERROR_INTERACTIVE_MODE = \"Git clean interactive mode is not supported\";\n CONFIG_ERROR_MODE_REQUIRED = 'Git clean mode parameter (\"n\" or \"f\") is required';\n CONFIG_ERROR_UNKNOWN_OPTION = \"Git clean unknown option found in: \";\n CleanOptions = /* @__PURE__ */ ((CleanOptions2) => {\n CleanOptions2[\"DRY_RUN\"] = \"n\";\n CleanOptions2[\"FORCE\"] = \"f\";\n CleanOptions2[\"IGNORED_INCLUDED\"] = \"x\";\n CleanOptions2[\"IGNORED_ONLY\"] = \"X\";\n CleanOptions2[\"EXCLUDING\"] = \"e\";\n CleanOptions2[\"QUIET\"] = \"q\";\n CleanOptions2[\"RECURSIVE\"] = \"d\";\n return CleanOptions2;\n })(CleanOptions || {});\n CleanOptionValues = /* @__PURE__ */ new Set([\"i\", ...asStringArray(Object.values(CleanOptions))]);\n }\n});\n\n// src/lib/responses/ConfigList.ts\nfunction configListParser(text) {\n const config = new ConfigList();\n for (const item of configParser(text)) {\n config.addValue(item.file, String(item.key), item.value);\n }\n return config;\n}\nfunction configGetParser(text, key) {\n let value = null;\n const values = [];\n const scopes = /* @__PURE__ */ new Map();\n for (const item of configParser(text, key)) {\n if (item.key !== key) {\n continue;\n }\n values.push(value = item.value);\n if (!scopes.has(item.file)) {\n scopes.set(item.file, []);\n }\n scopes.get(item.file).push(value);\n }\n return {\n key,\n paths: Array.from(scopes.keys()),\n scopes,\n value,\n values\n };\n}\nfunction configFilePath(filePath) {\n return filePath.replace(/^(file):/, \"\");\n}\nfunction* configParser(text, requestedKey = null) {\n const lines = text.split(\"\\0\");\n for (let i = 0, max = lines.length - 1; i < max; ) {\n const file = configFilePath(lines[i++]);\n let value = lines[i++];\n let key = requestedKey;\n if (value.includes(\"\\n\")) {\n const line = splitOn(value, \"\\n\");\n key = line[0];\n value = line[1];\n }\n yield { file, key, value };\n }\n}\nvar ConfigList;\nvar init_ConfigList = __esm({\n \"src/lib/responses/ConfigList.ts\"() {\n init_utils();\n ConfigList = class {\n constructor() {\n this.files = [];\n this.values = /* @__PURE__ */ Object.create(null);\n }\n get all() {\n if (!this._all) {\n this._all = this.files.reduce((all, file) => {\n return Object.assign(all, this.values[file]);\n }, {});\n }\n return this._all;\n }\n addFile(file) {\n if (!(file in this.values)) {\n const latest = last(this.files);\n this.values[file] = latest ? Object.create(this.values[latest]) : {};\n this.files.push(file);\n }\n return this.values[file];\n }\n addValue(file, key, value) {\n const values = this.addFile(file);\n if (!values.hasOwnProperty(key)) {\n values[key] = value;\n } else if (Array.isArray(values[key])) {\n values[key].push(value);\n } else {\n values[key] = [values[key], value];\n }\n this._all = void 0;\n }\n };\n }\n});\n\n// src/lib/tasks/config.ts\nfunction asConfigScope(scope, fallback) {\n if (typeof scope === \"string\" && GitConfigScope.hasOwnProperty(scope)) {\n return scope;\n }\n return fallback;\n}\nfunction addConfigTask(key, value, append2, scope) {\n const commands = [\"config\", `--${scope}`];\n if (append2) {\n commands.push(\"--add\");\n }\n commands.push(key, value);\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return text;\n }\n };\n}\nfunction getConfigTask(key, scope) {\n const commands = [\"config\", \"--null\", \"--show-origin\", \"--get-all\", key];\n if (scope) {\n commands.splice(1, 0, `--${scope}`);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return configGetParser(text, key);\n }\n };\n}\nfunction listConfigTask(scope) {\n const commands = [\"config\", \"--list\", \"--show-origin\", \"--null\"];\n if (scope) {\n commands.push(`--${scope}`);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return configListParser(text);\n }\n };\n}\nfunction config_default() {\n return {\n addConfig(key, value, ...rest) {\n return this._runTask(addConfigTask(key, value, rest[0] === true, asConfigScope(rest[1], \"local\" /* local */)), trailingFunctionArgument(arguments));\n },\n getConfig(key, scope) {\n return this._runTask(getConfigTask(key, asConfigScope(scope, void 0)), trailingFunctionArgument(arguments));\n },\n listConfig(...rest) {\n return this._runTask(listConfigTask(asConfigScope(rest[0], void 0)), trailingFunctionArgument(arguments));\n }\n };\n}\nvar GitConfigScope;\nvar init_config = __esm({\n \"src/lib/tasks/config.ts\"() {\n init_ConfigList();\n init_utils();\n GitConfigScope = /* @__PURE__ */ ((GitConfigScope2) => {\n GitConfigScope2[\"system\"] = \"system\";\n GitConfigScope2[\"global\"] = \"global\";\n GitConfigScope2[\"local\"] = \"local\";\n GitConfigScope2[\"worktree\"] = \"worktree\";\n return GitConfigScope2;\n })(GitConfigScope || {});\n }\n});\n\n// src/lib/tasks/grep.ts\nfunction grepQueryBuilder(...params) {\n return new GrepQuery().param(...params);\n}\nfunction parseGrep(grep) {\n const paths = /* @__PURE__ */ new Set();\n const results = {};\n forEachLineWithContent(grep, (input) => {\n const [path, line, preview] = input.split(NULL);\n paths.add(path);\n (results[path] = results[path] || []).push({\n line: asNumber(line),\n path,\n preview\n });\n });\n return {\n paths,\n results\n };\n}\nfunction grep_default() {\n return {\n grep(searchTerm) {\n const then = trailingFunctionArgument(arguments);\n const options = getTrailingOptions(arguments);\n for (const option of disallowedOptions) {\n if (options.includes(option)) {\n return this._runTask(configurationErrorTask(`git.grep: use of \"${option}\" is not supported.`), then);\n }\n }\n if (typeof searchTerm === \"string\") {\n searchTerm = grepQueryBuilder().param(searchTerm);\n }\n const commands = [\"grep\", \"--null\", \"-n\", \"--full-name\", ...options, ...searchTerm];\n return this._runTask({\n commands,\n format: \"utf-8\",\n parser(stdOut) {\n return parseGrep(stdOut);\n }\n }, then);\n }\n };\n}\nvar disallowedOptions, Query, _a, GrepQuery;\nvar init_grep = __esm({\n \"src/lib/tasks/grep.ts\"() {\n init_utils();\n init_task();\n disallowedOptions = [\"-h\"];\n Query = Symbol(\"grepQuery\");\n GrepQuery = class {\n constructor() {\n this[_a] = [];\n }\n *[(_a = Query, Symbol.iterator)]() {\n for (const query of this[Query]) {\n yield query;\n }\n }\n and(...and) {\n and.length && this[Query].push(\"--and\", \"(\", ...prefixedArray(and, \"-e\"), \")\");\n return this;\n }\n param(...param) {\n this[Query].push(...prefixedArray(param, \"-e\"));\n return this;\n }\n };\n }\n});\n\n// src/lib/tasks/reset.ts\nvar reset_exports = {};\n__export(reset_exports, {\n ResetMode: () => ResetMode,\n getResetMode: () => getResetMode,\n resetTask: () => resetTask\n});\nfunction resetTask(mode, customArgs) {\n const commands = [\"reset\"];\n if (isValidResetMode(mode)) {\n commands.push(`--${mode}`);\n }\n commands.push(...customArgs);\n return straightThroughStringTask(commands);\n}\nfunction getResetMode(mode) {\n if (isValidResetMode(mode)) {\n return mode;\n }\n switch (typeof mode) {\n case \"string\":\n case \"undefined\":\n return \"soft\" /* SOFT */;\n }\n return;\n}\nfunction isValidResetMode(mode) {\n return ResetModes.includes(mode);\n}\nvar ResetMode, ResetModes;\nvar init_reset = __esm({\n \"src/lib/tasks/reset.ts\"() {\n init_task();\n ResetMode = /* @__PURE__ */ ((ResetMode2) => {\n ResetMode2[\"MIXED\"] = \"mixed\";\n ResetMode2[\"SOFT\"] = \"soft\";\n ResetMode2[\"HARD\"] = \"hard\";\n ResetMode2[\"MERGE\"] = \"merge\";\n ResetMode2[\"KEEP\"] = \"keep\";\n return ResetMode2;\n })(ResetMode || {});\n ResetModes = Array.from(Object.values(ResetMode));\n }\n});\n\n// src/lib/api.ts\nvar api_exports = {};\n__export(api_exports, {\n CheckRepoActions: () => CheckRepoActions,\n CleanOptions: () => CleanOptions,\n GitConfigScope: () => GitConfigScope,\n GitConstructError: () => GitConstructError,\n GitError: () => GitError,\n GitPluginError: () => GitPluginError,\n GitResponseError: () => GitResponseError,\n ResetMode: () => ResetMode,\n TaskConfigurationError: () => TaskConfigurationError,\n grepQueryBuilder: () => grepQueryBuilder\n});\nvar init_api = __esm({\n \"src/lib/api.ts\"() {\n init_git_construct_error();\n init_git_error();\n init_git_plugin_error();\n init_git_response_error();\n init_task_configuration_error();\n init_check_is_repo();\n init_clean();\n init_config();\n init_grep();\n init_reset();\n }\n});\n\n// src/lib/plugins/command-config-prefixing-plugin.ts\nfunction commandConfigPrefixingPlugin(configuration) {\n const prefix = prefixedArray(configuration, \"-c\");\n return {\n type: \"spawn.args\",\n action(data) {\n return [...prefix, ...data];\n }\n };\n}\nvar init_command_config_prefixing_plugin = __esm({\n \"src/lib/plugins/command-config-prefixing-plugin.ts\"() {\n init_utils();\n }\n});\n\n// src/lib/plugins/completion-detection.plugin.ts\nfunction completionDetectionPlugin({\n onClose = true,\n onExit = 50\n} = {}) {\n function createEvents() {\n let exitCode = -1;\n const events = {\n close: (0, import_promise_deferred.deferred)(),\n closeTimeout: (0, import_promise_deferred.deferred)(),\n exit: (0, import_promise_deferred.deferred)(),\n exitTimeout: (0, import_promise_deferred.deferred)()\n };\n const result = Promise.race([\n onClose === false ? never : events.closeTimeout.promise,\n onExit === false ? never : events.exitTimeout.promise\n ]);\n configureTimeout(onClose, events.close, events.closeTimeout);\n configureTimeout(onExit, events.exit, events.exitTimeout);\n return {\n close(code) {\n exitCode = code;\n events.close.done();\n },\n exit(code) {\n exitCode = code;\n events.exit.done();\n },\n get exitCode() {\n return exitCode;\n },\n result\n };\n }\n function configureTimeout(flag, event, timeout) {\n if (flag === false) {\n return;\n }\n (flag === true ? event.promise : event.promise.then(() => delay(flag))).then(timeout.done);\n }\n return {\n type: \"spawn.after\",\n action(_0, _1) {\n return __async(this, arguments, function* (_data, { spawned, close }) {\n var _a2, _b;\n const events = createEvents();\n let deferClose = true;\n let quickClose = () => void (deferClose = false);\n (_a2 = spawned.stdout) == null ? void 0 : _a2.on(\"data\", quickClose);\n (_b = spawned.stderr) == null ? void 0 : _b.on(\"data\", quickClose);\n spawned.on(\"error\", quickClose);\n spawned.on(\"close\", (code) => events.close(code));\n spawned.on(\"exit\", (code) => events.exit(code));\n try {\n yield events.result;\n if (deferClose) {\n yield delay(50);\n }\n close(events.exitCode);\n } catch (err) {\n close(events.exitCode, err);\n }\n });\n }\n };\n}\nvar import_promise_deferred, never;\nvar init_completion_detection_plugin = __esm({\n \"src/lib/plugins/completion-detection.plugin.ts\"() {\n import_promise_deferred = require(\"@kwsites/promise-deferred\");\n init_utils();\n never = (0, import_promise_deferred.deferred)().promise;\n }\n});\n\n// src/lib/plugins/error-detection.plugin.ts\nfunction isTaskError(result) {\n return !!(result.exitCode && result.stdErr.length);\n}\nfunction getErrorMessage(result) {\n return Buffer.concat([...result.stdOut, ...result.stdErr]);\n}\nfunction errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) {\n return (error, result) => {\n if (!overwrite && error || !isError(result)) {\n return error;\n }\n return errorMessage(result);\n };\n}\nfunction errorDetectionPlugin(config) {\n return {\n type: \"task.error\",\n action(data, context) {\n const error = config(data.error, {\n stdErr: context.stdErr,\n stdOut: context.stdOut,\n exitCode: context.exitCode\n });\n if (Buffer.isBuffer(error)) {\n return { error: new GitError(void 0, error.toString(\"utf-8\")) };\n }\n return {\n error\n };\n }\n };\n}\nvar init_error_detection_plugin = __esm({\n \"src/lib/plugins/error-detection.plugin.ts\"() {\n init_git_error();\n }\n});\n\n// src/lib/plugins/plugin-store.ts\nvar PluginStore;\nvar init_plugin_store = __esm({\n \"src/lib/plugins/plugin-store.ts\"() {\n init_utils();\n PluginStore = class {\n constructor() {\n this.plugins = /* @__PURE__ */ new Set();\n }\n add(plugin) {\n const plugins = [];\n asArray(plugin).forEach((plugin2) => plugin2 && this.plugins.add(append(plugins, plugin2)));\n return () => {\n plugins.forEach((plugin2) => this.plugins.delete(plugin2));\n };\n }\n exec(type, data, context) {\n let output = data;\n const contextual = Object.freeze(Object.create(context));\n for (const plugin of this.plugins) {\n if (plugin.type === type) {\n output = plugin.action(output, contextual);\n }\n }\n return output;\n }\n };\n }\n});\n\n// src/lib/plugins/progress-monitor-plugin.ts\nfunction progressMonitorPlugin(progress) {\n const progressCommand = \"--progress\";\n const progressMethods = [\"checkout\", \"clone\", \"fetch\", \"pull\", \"push\"];\n const onProgress = {\n type: \"spawn.after\",\n action(_data, context) {\n var _a2;\n if (!context.commands.includes(progressCommand)) {\n return;\n }\n (_a2 = context.spawned.stderr) == null ? void 0 : _a2.on(\"data\", (chunk) => {\n const message = /^([\\s\\S]+?):\\s*(\\d+)% \\((\\d+)\\/(\\d+)\\)/.exec(chunk.toString(\"utf8\"));\n if (!message) {\n return;\n }\n progress({\n method: context.method,\n stage: progressEventStage(message[1]),\n progress: asNumber(message[2]),\n processed: asNumber(message[3]),\n total: asNumber(message[4])\n });\n });\n }\n };\n const onArgs = {\n type: \"spawn.args\",\n action(args, context) {\n if (!progressMethods.includes(context.method)) {\n return args;\n }\n return including(args, progressCommand);\n }\n };\n return [onArgs, onProgress];\n}\nfunction progressEventStage(input) {\n return String(input.toLowerCase().split(\" \", 1)) || \"unknown\";\n}\nvar init_progress_monitor_plugin = __esm({\n \"src/lib/plugins/progress-monitor-plugin.ts\"() {\n init_utils();\n }\n});\n\n// src/lib/plugins/simple-git-plugin.ts\nvar init_simple_git_plugin = __esm({\n \"src/lib/plugins/simple-git-plugin.ts\"() {\n }\n});\n\n// src/lib/plugins/spawn-options-plugin.ts\nfunction spawnOptionsPlugin(spawnOptions) {\n const options = pick(spawnOptions, [\"uid\", \"gid\"]);\n return {\n type: \"spawn.options\",\n action(data) {\n return __spreadValues(__spreadValues({}, options), data);\n }\n };\n}\nvar init_spawn_options_plugin = __esm({\n \"src/lib/plugins/spawn-options-plugin.ts\"() {\n init_utils();\n }\n});\n\n// src/lib/plugins/timout-plugin.ts\nfunction timeoutPlugin({ block }) {\n if (block > 0) {\n return {\n type: \"spawn.after\",\n action(_data, context) {\n var _a2, _b;\n let timeout;\n function wait() {\n timeout && clearTimeout(timeout);\n timeout = setTimeout(kill, block);\n }\n function stop() {\n var _a3, _b2;\n (_a3 = context.spawned.stdout) == null ? void 0 : _a3.off(\"data\", wait);\n (_b2 = context.spawned.stderr) == null ? void 0 : _b2.off(\"data\", wait);\n context.spawned.off(\"exit\", stop);\n context.spawned.off(\"close\", stop);\n }\n function kill() {\n stop();\n context.kill(new GitPluginError(void 0, \"timeout\", `block timeout reached`));\n }\n (_a2 = context.spawned.stdout) == null ? void 0 : _a2.on(\"data\", wait);\n (_b = context.spawned.stderr) == null ? void 0 : _b.on(\"data\", wait);\n context.spawned.on(\"exit\", stop);\n context.spawned.on(\"close\", stop);\n wait();\n }\n };\n }\n}\nvar init_timout_plugin = __esm({\n \"src/lib/plugins/timout-plugin.ts\"() {\n init_git_plugin_error();\n }\n});\n\n// src/lib/plugins/index.ts\nvar init_plugins = __esm({\n \"src/lib/plugins/index.ts\"() {\n init_command_config_prefixing_plugin();\n init_completion_detection_plugin();\n init_error_detection_plugin();\n init_plugin_store();\n init_progress_monitor_plugin();\n init_simple_git_plugin();\n init_spawn_options_plugin();\n init_timout_plugin();\n }\n});\n\n// src/lib/git-logger.ts\nfunction createLog() {\n return (0, import_debug.default)(\"simple-git\");\n}\nfunction prefixedLogger(to, prefix, forward) {\n if (!prefix || !String(prefix).replace(/\\s*/, \"\")) {\n return !forward ? to : (message, ...args) => {\n to(message, ...args);\n forward(message, ...args);\n };\n }\n return (message, ...args) => {\n to(`%s ${message}`, prefix, ...args);\n if (forward) {\n forward(message, ...args);\n }\n };\n}\nfunction childLoggerName(name, childDebugger, { namespace: parentNamespace }) {\n if (typeof name === \"string\") {\n return name;\n }\n const childNamespace = childDebugger && childDebugger.namespace || \"\";\n if (childNamespace.startsWith(parentNamespace)) {\n return childNamespace.substr(parentNamespace.length + 1);\n }\n return childNamespace || parentNamespace;\n}\nfunction createLogger(label, verbose, initialStep, infoDebugger = createLog()) {\n const labelPrefix = label && `[${label}]` || \"\";\n const spawned = [];\n const debugDebugger = typeof verbose === \"string\" ? infoDebugger.extend(verbose) : verbose;\n const key = childLoggerName(filterType(verbose, filterString), debugDebugger, infoDebugger);\n return step(initialStep);\n function sibling(name, initial) {\n return append(spawned, createLogger(label, key.replace(/^[^:]+/, name), initial, infoDebugger));\n }\n function step(phase) {\n const stepPrefix = phase && `[${phase}]` || \"\";\n const debug2 = debugDebugger && prefixedLogger(debugDebugger, stepPrefix) || NOOP;\n const info = prefixedLogger(infoDebugger, `${labelPrefix} ${stepPrefix}`, debug2);\n return Object.assign(debugDebugger ? debug2 : info, {\n label,\n sibling,\n info,\n step\n });\n }\n}\nvar import_debug;\nvar init_git_logger = __esm({\n \"src/lib/git-logger.ts\"() {\n import_debug = __toESM(require(\"debug\"));\n init_utils();\n import_debug.default.formatters.L = (value) => String(filterHasLength(value) ? value.length : \"-\");\n import_debug.default.formatters.B = (value) => {\n if (Buffer.isBuffer(value)) {\n return value.toString(\"utf8\");\n }\n return objectToString(value);\n };\n }\n});\n\n// src/lib/runners/tasks-pending-queue.ts\nvar _TasksPendingQueue, TasksPendingQueue;\nvar init_tasks_pending_queue = __esm({\n \"src/lib/runners/tasks-pending-queue.ts\"() {\n init_git_error();\n init_git_logger();\n _TasksPendingQueue = class {\n constructor(logLabel = \"GitExecutor\") {\n this.logLabel = logLabel;\n this._queue = /* @__PURE__ */ new Map();\n }\n withProgress(task) {\n return this._queue.get(task);\n }\n createProgress(task) {\n const name = _TasksPendingQueue.getName(task.commands[0]);\n const logger = createLogger(this.logLabel, name);\n return {\n task,\n logger,\n name\n };\n }\n push(task) {\n const progress = this.createProgress(task);\n progress.logger(\"Adding task to the queue, commands = %o\", task.commands);\n this._queue.set(task, progress);\n return progress;\n }\n fatal(err) {\n for (const [task, { logger }] of Array.from(this._queue.entries())) {\n if (task === err.task) {\n logger.info(`Failed %o`, err);\n logger(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`);\n } else {\n logger.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`, err.message);\n }\n this.complete(task);\n }\n if (this._queue.size !== 0) {\n throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`);\n }\n }\n complete(task) {\n const progress = this.withProgress(task);\n if (progress) {\n this._queue.delete(task);\n }\n }\n attempt(task) {\n const progress = this.withProgress(task);\n if (!progress) {\n throw new GitError(void 0, \"TasksPendingQueue: attempt called for an unknown task\");\n }\n progress.logger(\"Starting task\");\n return progress;\n }\n static getName(name = \"empty\") {\n return `task:${name}:${++_TasksPendingQueue.counter}`;\n }\n };\n TasksPendingQueue = _TasksPendingQueue;\n TasksPendingQueue.counter = 0;\n }\n});\n\n// src/lib/runners/git-executor-chain.ts\nfunction pluginContext(task, commands) {\n return {\n method: first(task.commands) || \"\",\n commands\n };\n}\nfunction onErrorReceived(target, logger) {\n return (err) => {\n logger(`[ERROR] child process exception %o`, err);\n target.push(Buffer.from(String(err.stack), \"ascii\"));\n };\n}\nfunction onDataReceived(target, name, logger, output) {\n return (buffer) => {\n logger(`%s received %L bytes`, name, buffer);\n output(`%B`, buffer);\n target.push(buffer);\n };\n}\nvar import_child_process, GitExecutorChain;\nvar init_git_executor_chain = __esm({\n \"src/lib/runners/git-executor-chain.ts\"() {\n import_child_process = require(\"child_process\");\n init_git_error();\n init_task();\n init_utils();\n init_tasks_pending_queue();\n GitExecutorChain = class {\n constructor(_executor, _scheduler, _plugins) {\n this._executor = _executor;\n this._scheduler = _scheduler;\n this._plugins = _plugins;\n this._chain = Promise.resolve();\n this._queue = new TasksPendingQueue();\n }\n get binary() {\n return this._executor.binary;\n }\n get cwd() {\n return this._cwd || this._executor.cwd;\n }\n set cwd(cwd) {\n this._cwd = cwd;\n }\n get env() {\n return this._executor.env;\n }\n get outputHandler() {\n return this._executor.outputHandler;\n }\n chain() {\n return this;\n }\n push(task) {\n this._queue.push(task);\n return this._chain = this._chain.then(() => this.attemptTask(task));\n }\n attemptTask(task) {\n return __async(this, null, function* () {\n const onScheduleComplete = yield this._scheduler.next();\n const onQueueComplete = () => this._queue.complete(task);\n try {\n const { logger } = this._queue.attempt(task);\n return yield isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger);\n } catch (e) {\n throw this.onFatalException(task, e);\n } finally {\n onQueueComplete();\n onScheduleComplete();\n }\n });\n }\n onFatalException(task, e) {\n const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));\n this._chain = Promise.resolve();\n this._queue.fatal(gitError);\n return gitError;\n }\n attemptRemoteTask(task, logger) {\n return __async(this, null, function* () {\n const args = this._plugins.exec(\"spawn.args\", [...task.commands], pluginContext(task, task.commands));\n const raw = yield this.gitResponse(task, this.binary, args, this.outputHandler, logger.step(\"SPAWN\"));\n const outputStreams = yield this.handleTaskData(task, args, raw, logger.step(\"HANDLE\"));\n logger(`passing response to task's parser as a %s`, task.format);\n if (isBufferTask(task)) {\n return callTaskParser(task.parser, outputStreams);\n }\n return callTaskParser(task.parser, outputStreams.asStrings());\n });\n }\n attemptEmptyTask(task, logger) {\n return __async(this, null, function* () {\n logger(`empty task bypassing child process to call to task's parser`);\n return task.parser(this);\n });\n }\n handleTaskData(task, args, result, logger) {\n const { exitCode, rejection, stdOut, stdErr } = result;\n return new Promise((done, fail) => {\n logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode);\n const { error } = this._plugins.exec(\"task.error\", { error: rejection }, __spreadValues(__spreadValues({}, pluginContext(task, args)), result));\n if (error && task.onError) {\n logger.info(`exitCode=%s handling with custom error handler`);\n return task.onError(result, error, (newStdOut) => {\n logger.info(`custom error handler treated as success`);\n logger(`custom error returned a %s`, objectToString(newStdOut));\n done(new GitOutputStreams(Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut, Buffer.concat(stdErr)));\n }, fail);\n }\n if (error) {\n logger.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`, exitCode, stdErr.length, rejection);\n return fail(error);\n }\n logger.info(`retrieving task output complete`);\n done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));\n });\n }\n gitResponse(task, command, args, outputHandler, logger) {\n return __async(this, null, function* () {\n const outputLogger = logger.sibling(\"output\");\n const spawnOptions = this._plugins.exec(\"spawn.options\", {\n cwd: this.cwd,\n env: this.env,\n windowsHide: true\n }, pluginContext(task, task.commands));\n return new Promise((done) => {\n const stdOut = [];\n const stdErr = [];\n let rejection;\n logger.info(`%s %o`, command, args);\n logger(\"%O\", spawnOptions);\n const spawned = (0, import_child_process.spawn)(command, args, spawnOptions);\n spawned.stdout.on(\"data\", onDataReceived(stdOut, \"stdOut\", logger, outputLogger.step(\"stdOut\")));\n spawned.stderr.on(\"data\", onDataReceived(stdErr, \"stdErr\", logger, outputLogger.step(\"stdErr\")));\n spawned.on(\"error\", onErrorReceived(stdErr, logger));\n if (outputHandler) {\n logger(`Passing child process stdOut/stdErr to custom outputHandler`);\n outputHandler(command, spawned.stdout, spawned.stderr, [...args]);\n }\n this._plugins.exec(\"spawn.after\", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {\n spawned,\n close(exitCode, reason) {\n done({\n stdOut,\n stdErr,\n exitCode,\n rejection: rejection || reason\n });\n },\n kill(reason) {\n if (spawned.killed) {\n return;\n }\n rejection = reason;\n spawned.kill(\"SIGINT\");\n }\n }));\n });\n });\n }\n };\n }\n});\n\n// src/lib/runners/git-executor.ts\nvar git_executor_exports = {};\n__export(git_executor_exports, {\n GitExecutor: () => GitExecutor\n});\nvar GitExecutor;\nvar init_git_executor = __esm({\n \"src/lib/runners/git-executor.ts\"() {\n init_git_executor_chain();\n GitExecutor = class {\n constructor(binary = \"git\", cwd, _scheduler, _plugins) {\n this.binary = binary;\n this.cwd = cwd;\n this._scheduler = _scheduler;\n this._plugins = _plugins;\n this._chain = new GitExecutorChain(this, this._scheduler, this._plugins);\n }\n chain() {\n return new GitExecutorChain(this, this._scheduler, this._plugins);\n }\n push(task) {\n return this._chain.push(task);\n }\n };\n }\n});\n\n// src/lib/task-callback.ts\nfunction taskCallback(task, response, callback = NOOP) {\n const onSuccess = (data) => {\n callback(null, data);\n };\n const onError2 = (err) => {\n if ((err == null ? void 0 : err.task) === task) {\n callback(err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err, void 0);\n }\n };\n response.then(onSuccess, onError2);\n}\nfunction addDeprecationNoticeToError(err) {\n let log = (name) => {\n console.warn(`simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`);\n log = NOOP;\n };\n return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {}));\n function descriptorReducer(all, name) {\n if (name in err) {\n return all;\n }\n all[name] = {\n enumerable: false,\n configurable: false,\n get() {\n log(name);\n return err.git[name];\n }\n };\n return all;\n }\n}\nvar init_task_callback = __esm({\n \"src/lib/task-callback.ts\"() {\n init_git_response_error();\n init_utils();\n }\n});\n\n// src/lib/tasks/change-working-directory.ts\nfunction changeWorkingDirectoryTask(directory, root) {\n return adhocExecTask((instance) => {\n if (!folderExists(directory)) {\n throw new Error(`Git.cwd: cannot change to non-directory \"${directory}\"`);\n }\n return (root || instance).cwd = directory;\n });\n}\nvar init_change_working_directory = __esm({\n \"src/lib/tasks/change-working-directory.ts\"() {\n init_utils();\n init_task();\n }\n});\n\n// src/lib/tasks/hash-object.ts\nfunction hashObjectTask(filePath, write) {\n const commands = [\"hash-object\", filePath];\n if (write) {\n commands.push(\"-w\");\n }\n return straightThroughStringTask(commands, true);\n}\nvar init_hash_object = __esm({\n \"src/lib/tasks/hash-object.ts\"() {\n init_task();\n }\n});\n\n// src/lib/responses/InitSummary.ts\nfunction parseInit(bare, path, text) {\n const response = String(text).trim();\n let result;\n if (result = initResponseRegex.exec(response)) {\n return new InitSummary(bare, path, false, result[1]);\n }\n if (result = reInitResponseRegex.exec(response)) {\n return new InitSummary(bare, path, true, result[1]);\n }\n let gitDir = \"\";\n const tokens = response.split(\" \");\n while (tokens.length) {\n const token = tokens.shift();\n if (token === \"in\") {\n gitDir = tokens.join(\" \");\n break;\n }\n }\n return new InitSummary(bare, path, /^re/i.test(response), gitDir);\n}\nvar InitSummary, initResponseRegex, reInitResponseRegex;\nvar init_InitSummary = __esm({\n \"src/lib/responses/InitSummary.ts\"() {\n InitSummary = class {\n constructor(bare, path, existing, gitDir) {\n this.bare = bare;\n this.path = path;\n this.existing = existing;\n this.gitDir = gitDir;\n }\n };\n initResponseRegex = /^Init.+ repository in (.+)$/;\n reInitResponseRegex = /^Rein.+ in (.+)$/;\n }\n});\n\n// src/lib/tasks/init.ts\nfunction hasBareCommand(command) {\n return command.includes(bareCommand);\n}\nfunction initTask(bare = false, path, customArgs) {\n const commands = [\"init\", ...customArgs];\n if (bare && !hasBareCommand(commands)) {\n commands.splice(1, 0, bareCommand);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return parseInit(commands.includes(\"--bare\"), path, text);\n }\n };\n}\nvar bareCommand;\nvar init_init = __esm({\n \"src/lib/tasks/init.ts\"() {\n init_InitSummary();\n bareCommand = \"--bare\";\n }\n});\n\n// src/lib/responses/DiffSummary.ts\nvar DiffSummary;\nvar init_DiffSummary = __esm({\n \"src/lib/responses/DiffSummary.ts\"() {\n DiffSummary = class {\n constructor() {\n this.changed = 0;\n this.deletions = 0;\n this.insertions = 0;\n this.files = [];\n }\n };\n }\n});\n\n// src/lib/parsers/parse-diff-summary.ts\nfunction parseDiffResult(stdOut) {\n const lines = stdOut.trim().split(\"\\n\");\n const status = new DiffSummary();\n readSummaryLine(status, lines.pop());\n for (let i = 0, max = lines.length; i < max; i++) {\n const line = lines[i];\n textFileChange(line, status) || binaryFileChange(line, status);\n }\n return status;\n}\nfunction readSummaryLine(status, summary) {\n (summary || \"\").trim().split(\", \").forEach(function(text) {\n const summary2 = /(\\d+)\\s([a-z]+)/.exec(text);\n if (!summary2) {\n return;\n }\n summaryType(status, summary2[2], parseInt(summary2[1], 10));\n });\n}\nfunction summaryType(status, key, value) {\n const match = /([a-z]+?)s?\\b/.exec(key);\n if (!match || !statusUpdate[match[1]]) {\n return;\n }\n statusUpdate[match[1]](status, value);\n}\nfunction textFileChange(input, { files }) {\n const line = input.trim().match(/^(.+)\\s+\\|\\s+(\\d+)(\\s+[+\\-]+)?$/);\n if (line) {\n var alterations = (line[3] || \"\").trim();\n files.push({\n file: line[1].trim(),\n changes: parseInt(line[2], 10),\n insertions: alterations.replace(/-/g, \"\").length,\n deletions: alterations.replace(/\\+/g, \"\").length,\n binary: false\n });\n return true;\n }\n return false;\n}\nfunction binaryFileChange(input, { files }) {\n const line = input.match(/^(.+) \\|\\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)$/);\n if (line) {\n files.push({\n file: line[1].trim(),\n before: +line[2],\n after: +line[3],\n binary: true\n });\n return true;\n }\n return false;\n}\nvar statusUpdate;\nvar init_parse_diff_summary = __esm({\n \"src/lib/parsers/parse-diff-summary.ts\"() {\n init_DiffSummary();\n statusUpdate = {\n file(status, value) {\n status.changed = value;\n },\n deletion(status, value) {\n status.deletions = value;\n },\n insertion(status, value) {\n status.insertions = value;\n }\n };\n }\n});\n\n// src/lib/parsers/parse-list-log-summary.ts\nfunction lineBuilder(tokens, fields) {\n return fields.reduce((line, field, index) => {\n line[field] = tokens[index] || \"\";\n return line;\n }, /* @__PURE__ */ Object.create({ diff: null }));\n}\nfunction createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNames) {\n return function(stdOut) {\n const all = toLinesWithContent(stdOut, true, START_BOUNDARY).map(function(item) {\n const lineDetail = item.trim().split(COMMIT_BOUNDARY);\n const listLogLine = lineBuilder(lineDetail[0].trim().split(splitter), fields);\n if (lineDetail.length > 1 && !!lineDetail[1].trim()) {\n listLogLine.diff = parseDiffResult(lineDetail[1]);\n }\n return listLogLine;\n });\n return {\n all,\n latest: all.length && all[0] || null,\n total: all.length\n };\n };\n}\nvar START_BOUNDARY, COMMIT_BOUNDARY, SPLITTER, defaultFieldNames;\nvar init_parse_list_log_summary = __esm({\n \"src/lib/parsers/parse-list-log-summary.ts\"() {\n init_utils();\n init_parse_diff_summary();\n START_BOUNDARY = \"\\xF2\\xF2\\xF2\\xF2\\xF2\\xF2 \";\n COMMIT_BOUNDARY = \" \\xF2\\xF2\";\n SPLITTER = \" \\xF2 \";\n defaultFieldNames = [\"hash\", \"date\", \"message\", \"refs\", \"author_name\", \"author_email\"];\n }\n});\n\n// src/lib/tasks/log.ts\nfunction prettyFormat(format, splitter) {\n const fields = [];\n const formatStr = [];\n Object.keys(format).forEach((field) => {\n fields.push(field);\n formatStr.push(String(format[field]));\n });\n return [\n fields,\n formatStr.join(splitter)\n ];\n}\nfunction userOptions(input) {\n return Object.keys(input).reduce((out, key) => {\n if (!(key in excludeOptions)) {\n out[key] = input[key];\n }\n return out;\n }, {});\n}\nfunction parseLogOptions(opt = {}, customArgs = []) {\n const splitter = filterType(opt.splitter, filterString, SPLITTER);\n const format = !filterPrimitives(opt.format) && opt.format ? opt.format : {\n hash: \"%H\",\n date: opt.strictDate === false ? \"%ai\" : \"%aI\",\n message: \"%s\",\n refs: \"%D\",\n body: opt.multiLine ? \"%B\" : \"%b\",\n author_name: opt.mailMap !== false ? \"%aN\" : \"%an\",\n author_email: opt.mailMap !== false ? \"%aE\" : \"%ae\"\n };\n const [fields, formatStr] = prettyFormat(format, splitter);\n const suffix = [];\n const command = [\n `--pretty=format:${START_BOUNDARY}${formatStr}${COMMIT_BOUNDARY}`,\n ...customArgs\n ];\n const maxCount = opt.n || opt[\"max-count\"] || opt.maxCount;\n if (maxCount) {\n command.push(`--max-count=${maxCount}`);\n }\n if (opt.from && opt.to) {\n const rangeOperator = opt.symmetric !== false ? \"...\" : \"..\";\n suffix.push(`${opt.from}${rangeOperator}${opt.to}`);\n }\n if (filterString(opt.file)) {\n suffix.push(\"--follow\", opt.file);\n }\n appendTaskOptions(userOptions(opt), command);\n return {\n fields,\n splitter,\n commands: [\n ...command,\n ...suffix\n ]\n };\n}\nfunction logTask(splitter, fields, customArgs) {\n return {\n commands: [\"log\", ...customArgs],\n format: \"utf-8\",\n parser: createListLogSummaryParser(splitter, fields)\n };\n}\nfunction log_default() {\n return {\n log(...rest) {\n const next = trailingFunctionArgument(arguments);\n const task = rejectDeprecatedSignatures(...rest) || createLogTask(parseLogOptions(trailingOptionsArgument(arguments), filterType(arguments[0], filterArray)));\n return this._runTask(task, next);\n }\n };\n function createLogTask(options) {\n return logTask(options.splitter, options.fields, options.commands);\n }\n function rejectDeprecatedSignatures(from, to) {\n return filterString(from) && filterString(to) && configurationErrorTask(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`);\n }\n}\nvar excludeOptions;\nvar init_log = __esm({\n \"src/lib/tasks/log.ts\"() {\n init_parse_list_log_summary();\n init_utils();\n init_task();\n excludeOptions = /* @__PURE__ */ ((excludeOptions2) => {\n excludeOptions2[excludeOptions2[\"--pretty\"] = 0] = \"--pretty\";\n excludeOptions2[excludeOptions2[\"max-count\"] = 1] = \"max-count\";\n excludeOptions2[excludeOptions2[\"maxCount\"] = 2] = \"maxCount\";\n excludeOptions2[excludeOptions2[\"n\"] = 3] = \"n\";\n excludeOptions2[excludeOptions2[\"file\"] = 4] = \"file\";\n excludeOptions2[excludeOptions2[\"format\"] = 5] = \"format\";\n excludeOptions2[excludeOptions2[\"from\"] = 6] = \"from\";\n excludeOptions2[excludeOptions2[\"to\"] = 7] = \"to\";\n excludeOptions2[excludeOptions2[\"splitter\"] = 8] = \"splitter\";\n excludeOptions2[excludeOptions2[\"symmetric\"] = 9] = \"symmetric\";\n excludeOptions2[excludeOptions2[\"mailMap\"] = 10] = \"mailMap\";\n excludeOptions2[excludeOptions2[\"multiLine\"] = 11] = \"multiLine\";\n excludeOptions2[excludeOptions2[\"strictDate\"] = 12] = \"strictDate\";\n return excludeOptions2;\n })(excludeOptions || {});\n }\n});\n\n// src/lib/responses/MergeSummary.ts\nvar MergeSummaryConflict, MergeSummaryDetail;\nvar init_MergeSummary = __esm({\n \"src/lib/responses/MergeSummary.ts\"() {\n MergeSummaryConflict = class {\n constructor(reason, file = null, meta) {\n this.reason = reason;\n this.file = file;\n this.meta = meta;\n }\n toString() {\n return `${this.file}:${this.reason}`;\n }\n };\n MergeSummaryDetail = class {\n constructor() {\n this.conflicts = [];\n this.merges = [];\n this.result = \"success\";\n }\n get failed() {\n return this.conflicts.length > 0;\n }\n get reason() {\n return this.result;\n }\n toString() {\n if (this.conflicts.length) {\n return `CONFLICTS: ${this.conflicts.join(\", \")}`;\n }\n return \"OK\";\n }\n };\n }\n});\n\n// src/lib/responses/PullSummary.ts\nvar PullSummary, PullFailedSummary;\nvar init_PullSummary = __esm({\n \"src/lib/responses/PullSummary.ts\"() {\n PullSummary = class {\n constructor() {\n this.remoteMessages = {\n all: []\n };\n this.created = [];\n this.deleted = [];\n this.files = [];\n this.deletions = {};\n this.insertions = {};\n this.summary = {\n changes: 0,\n deletions: 0,\n insertions: 0\n };\n }\n };\n PullFailedSummary = class {\n constructor() {\n this.remote = \"\";\n this.hash = {\n local: \"\",\n remote: \"\"\n };\n this.branch = {\n local: \"\",\n remote: \"\"\n };\n this.message = \"\";\n }\n toString() {\n return this.message;\n }\n };\n }\n});\n\n// src/lib/parsers/parse-remote-objects.ts\nfunction objectEnumerationResult(remoteMessages) {\n return remoteMessages.objects = remoteMessages.objects || {\n compressing: 0,\n counting: 0,\n enumerating: 0,\n packReused: 0,\n reused: { count: 0, delta: 0 },\n total: { count: 0, delta: 0 }\n };\n}\nfunction asObjectCount(source) {\n const count = /^\\s*(\\d+)/.exec(source);\n const delta = /delta (\\d+)/i.exec(source);\n return {\n count: asNumber(count && count[1] || \"0\"),\n delta: asNumber(delta && delta[1] || \"0\")\n };\n}\nvar remoteMessagesObjectParsers;\nvar init_parse_remote_objects = __esm({\n \"src/lib/parsers/parse-remote-objects.ts\"() {\n init_utils();\n remoteMessagesObjectParsers = [\n new RemoteLineParser(/^remote:\\s*(enumerating|counting|compressing) objects: (\\d+),/i, (result, [action, count]) => {\n const key = action.toLowerCase();\n const enumeration = objectEnumerationResult(result.remoteMessages);\n Object.assign(enumeration, { [key]: asNumber(count) });\n }),\n new RemoteLineParser(/^remote:\\s*(enumerating|counting|compressing) objects: \\d+% \\(\\d+\\/(\\d+)\\),/i, (result, [action, count]) => {\n const key = action.toLowerCase();\n const enumeration = objectEnumerationResult(result.remoteMessages);\n Object.assign(enumeration, { [key]: asNumber(count) });\n }),\n new RemoteLineParser(/total ([^,]+), reused ([^,]+), pack-reused (\\d+)/i, (result, [total, reused, packReused]) => {\n const objects = objectEnumerationResult(result.remoteMessages);\n objects.total = asObjectCount(total);\n objects.reused = asObjectCount(reused);\n objects.packReused = asNumber(packReused);\n })\n ];\n }\n});\n\n// src/lib/parsers/parse-remote-messages.ts\nfunction parseRemoteMessages(_stdOut, stdErr) {\n return parseStringResponse({ remoteMessages: new RemoteMessageSummary() }, parsers, stdErr);\n}\nvar parsers, RemoteMessageSummary;\nvar init_parse_remote_messages = __esm({\n \"src/lib/parsers/parse-remote-messages.ts\"() {\n init_utils();\n init_parse_remote_objects();\n parsers = [\n new RemoteLineParser(/^remote:\\s*(.+)$/, (result, [text]) => {\n result.remoteMessages.all.push(text.trim());\n return false;\n }),\n ...remoteMessagesObjectParsers,\n new RemoteLineParser([/create a (?:pull|merge) request/i, /\\s(https?:\\/\\/\\S+)$/], (result, [pullRequestUrl]) => {\n result.remoteMessages.pullRequestUrl = pullRequestUrl;\n }),\n new RemoteLineParser([/found (\\d+) vulnerabilities.+\\(([^)]+)\\)/i, /\\s(https?:\\/\\/\\S+)$/], (result, [count, summary, url]) => {\n result.remoteMessages.vulnerabilities = {\n count: asNumber(count),\n summary,\n url\n };\n })\n ];\n RemoteMessageSummary = class {\n constructor() {\n this.all = [];\n }\n };\n }\n});\n\n// src/lib/parsers/parse-pull.ts\nfunction parsePullErrorResult(stdOut, stdErr) {\n const pullError = parseStringResponse(new PullFailedSummary(), errorParsers, stdOut, stdErr);\n return pullError.message && pullError;\n}\nvar FILE_UPDATE_REGEX, SUMMARY_REGEX, ACTION_REGEX, parsers2, errorParsers, parsePullDetail, parsePullResult;\nvar init_parse_pull = __esm({\n \"src/lib/parsers/parse-pull.ts\"() {\n init_PullSummary();\n init_utils();\n init_parse_remote_messages();\n FILE_UPDATE_REGEX = /^\\s*(.+?)\\s+\\|\\s+\\d+\\s*(\\+*)(-*)/;\n SUMMARY_REGEX = /(\\d+)\\D+((\\d+)\\D+\\(\\+\\))?(\\D+(\\d+)\\D+\\(-\\))?/;\n ACTION_REGEX = /^(create|delete) mode \\d+ (.+)/;\n parsers2 = [\n new LineParser(FILE_UPDATE_REGEX, (result, [file, insertions, deletions]) => {\n result.files.push(file);\n if (insertions) {\n result.insertions[file] = insertions.length;\n }\n if (deletions) {\n result.deletions[file] = deletions.length;\n }\n }),\n new LineParser(SUMMARY_REGEX, (result, [changes, , insertions, , deletions]) => {\n if (insertions !== void 0 || deletions !== void 0) {\n result.summary.changes = +changes || 0;\n result.summary.insertions = +insertions || 0;\n result.summary.deletions = +deletions || 0;\n return true;\n }\n return false;\n }),\n new LineParser(ACTION_REGEX, (result, [action, file]) => {\n append(result.files, file);\n append(action === \"create\" ? result.created : result.deleted, file);\n })\n ];\n errorParsers = [\n new LineParser(/^from\\s(.+)$/i, (result, [remote]) => void (result.remote = remote)),\n new LineParser(/^fatal:\\s(.+)$/, (result, [message]) => void (result.message = message)),\n new LineParser(/([a-z0-9]+)\\.\\.([a-z0-9]+)\\s+(\\S+)\\s+->\\s+(\\S+)$/, (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => {\n result.branch.local = branchLocal;\n result.hash.local = hashLocal;\n result.branch.remote = branchRemote;\n result.hash.remote = hashRemote;\n })\n ];\n parsePullDetail = (stdOut, stdErr) => {\n return parseStringResponse(new PullSummary(), parsers2, stdOut, stdErr);\n };\n parsePullResult = (stdOut, stdErr) => {\n return Object.assign(new PullSummary(), parsePullDetail(stdOut, stdErr), parseRemoteMessages(stdOut, stdErr));\n };\n }\n});\n\n// src/lib/parsers/parse-merge.ts\nvar parsers3, parseMergeResult, parseMergeDetail;\nvar init_parse_merge = __esm({\n \"src/lib/parsers/parse-merge.ts\"() {\n init_MergeSummary();\n init_utils();\n init_parse_pull();\n parsers3 = [\n new LineParser(/^Auto-merging\\s+(.+)$/, (summary, [autoMerge]) => {\n summary.merges.push(autoMerge);\n }),\n new LineParser(/^CONFLICT\\s+\\((.+)\\): Merge conflict in (.+)$/, (summary, [reason, file]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, file));\n }),\n new LineParser(/^CONFLICT\\s+\\((.+\\/delete)\\): (.+) deleted in (.+) and/, (summary, [reason, file, deleteRef]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef }));\n }),\n new LineParser(/^CONFLICT\\s+\\((.+)\\):/, (summary, [reason]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, null));\n }),\n new LineParser(/^Automatic merge failed;\\s+(.+)$/, (summary, [result]) => {\n summary.result = result;\n })\n ];\n parseMergeResult = (stdOut, stdErr) => {\n return Object.assign(parseMergeDetail(stdOut, stdErr), parsePullResult(stdOut, stdErr));\n };\n parseMergeDetail = (stdOut) => {\n return parseStringResponse(new MergeSummaryDetail(), parsers3, stdOut);\n };\n }\n});\n\n// src/lib/tasks/merge.ts\nfunction mergeTask(customArgs) {\n if (!customArgs.length) {\n return configurationErrorTask(\"Git.merge requires at least one option\");\n }\n return {\n commands: [\"merge\", ...customArgs],\n format: \"utf-8\",\n parser(stdOut, stdErr) {\n const merge = parseMergeResult(stdOut, stdErr);\n if (merge.failed) {\n throw new GitResponseError(merge);\n }\n return merge;\n }\n };\n}\nvar init_merge = __esm({\n \"src/lib/tasks/merge.ts\"() {\n init_git_response_error();\n init_parse_merge();\n init_task();\n }\n});\n\n// src/lib/parsers/parse-push.ts\nfunction pushResultPushedItem(local, remote, status) {\n const deleted = status.includes(\"deleted\");\n const tag = status.includes(\"tag\") || /^refs\\/tags/.test(local);\n const alreadyUpdated = !status.includes(\"new\");\n return {\n deleted,\n tag,\n branch: !tag,\n new: !alreadyUpdated,\n alreadyUpdated,\n local,\n remote\n };\n}\nvar parsers4, parsePushResult, parsePushDetail;\nvar init_parse_push = __esm({\n \"src/lib/parsers/parse-push.ts\"() {\n init_utils();\n init_parse_remote_messages();\n parsers4 = [\n new LineParser(/^Pushing to (.+)$/, (result, [repo]) => {\n result.repo = repo;\n }),\n new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {\n result.ref = __spreadProps(__spreadValues({}, result.ref || {}), {\n local\n });\n }),\n new LineParser(/^[*-=]\\s+([^:]+):(\\S+)\\s+\\[(.+)]$/, (result, [local, remote, type]) => {\n result.pushed.push(pushResultPushedItem(local, remote, type));\n }),\n new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, (result, [local, remote, remoteName]) => {\n result.branch = __spreadProps(__spreadValues({}, result.branch || {}), {\n local,\n remote,\n remoteName\n });\n }),\n new LineParser(/^([^:]+):(\\S+)\\s+([a-z0-9]+)\\.\\.([a-z0-9]+)$/, (result, [local, remote, from, to]) => {\n result.update = {\n head: {\n local,\n remote\n },\n hash: {\n from,\n to\n }\n };\n })\n ];\n parsePushResult = (stdOut, stdErr) => {\n const pushDetail = parsePushDetail(stdOut, stdErr);\n const responseDetail = parseRemoteMessages(stdOut, stdErr);\n return __spreadValues(__spreadValues({}, pushDetail), responseDetail);\n };\n parsePushDetail = (stdOut, stdErr) => {\n return parseStringResponse({ pushed: [] }, parsers4, stdOut, stdErr);\n };\n }\n});\n\n// src/lib/tasks/push.ts\nvar push_exports = {};\n__export(push_exports, {\n pushTagsTask: () => pushTagsTask,\n pushTask: () => pushTask\n});\nfunction pushTagsTask(ref = {}, customArgs) {\n append(customArgs, \"--tags\");\n return pushTask(ref, customArgs);\n}\nfunction pushTask(ref = {}, customArgs) {\n const commands = [\"push\", ...customArgs];\n if (ref.branch) {\n commands.splice(1, 0, ref.branch);\n }\n if (ref.remote) {\n commands.splice(1, 0, ref.remote);\n }\n remove(commands, \"-v\");\n append(commands, \"--verbose\");\n append(commands, \"--porcelain\");\n return {\n commands,\n format: \"utf-8\",\n parser: parsePushResult\n };\n}\nvar init_push = __esm({\n \"src/lib/tasks/push.ts\"() {\n init_parse_push();\n init_utils();\n }\n});\n\n// src/lib/responses/FileStatusSummary.ts\nvar fromPathRegex, FileStatusSummary;\nvar init_FileStatusSummary = __esm({\n \"src/lib/responses/FileStatusSummary.ts\"() {\n fromPathRegex = /^(.+) -> (.+)$/;\n FileStatusSummary = class {\n constructor(path, index, working_dir) {\n this.path = path;\n this.index = index;\n this.working_dir = working_dir;\n if (index + working_dir === \"R\") {\n const detail = fromPathRegex.exec(path) || [null, path, path];\n this.from = detail[1] || \"\";\n this.path = detail[2] || \"\";\n }\n }\n };\n }\n});\n\n// src/lib/responses/StatusSummary.ts\nfunction renamedFile(line) {\n const detail = /^(.+) -> (.+)$/.exec(line);\n if (!detail) {\n return {\n from: line,\n to: line\n };\n }\n return {\n from: String(detail[1]),\n to: String(detail[2])\n };\n}\nfunction parser2(indexX, indexY, handler) {\n return [`${indexX}${indexY}`, handler];\n}\nfunction conflicts(indexX, ...indexY) {\n return indexY.map((y) => parser2(indexX, y, (result, file) => append(result.conflicted, file)));\n}\nfunction splitLine(result, lineStr) {\n const trimmed2 = lineStr.trim();\n switch (\" \") {\n case trimmed2.charAt(2):\n return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));\n case trimmed2.charAt(1):\n return data(\" \" /* NONE */, trimmed2.charAt(0), trimmed2.substr(2));\n default:\n return;\n }\n function data(index, workingDir, path) {\n const raw = `${index}${workingDir}`;\n const handler = parsers5.get(raw);\n if (handler) {\n handler(result, path);\n }\n if (raw !== \"##\" && raw !== \"!!\") {\n result.files.push(new FileStatusSummary(path, index, workingDir));\n }\n }\n}\nvar StatusSummary, parsers5, parseStatusSummary;\nvar init_StatusSummary = __esm({\n \"src/lib/responses/StatusSummary.ts\"() {\n init_utils();\n init_FileStatusSummary();\n StatusSummary = class {\n constructor() {\n this.not_added = [];\n this.conflicted = [];\n this.created = [];\n this.deleted = [];\n this.ignored = void 0;\n this.modified = [];\n this.renamed = [];\n this.files = [];\n this.staged = [];\n this.ahead = 0;\n this.behind = 0;\n this.current = null;\n this.tracking = null;\n this.detached = false;\n this.isClean = () => {\n return !this.files.length;\n };\n }\n };\n parsers5 = new Map([\n parser2(\" \" /* NONE */, \"A\" /* ADDED */, (result, file) => append(result.created, file)),\n parser2(\" \" /* NONE */, \"D\" /* DELETED */, (result, file) => append(result.deleted, file)),\n parser2(\" \" /* NONE */, \"M\" /* MODIFIED */, (result, file) => append(result.modified, file)),\n parser2(\"A\" /* ADDED */, \" \" /* NONE */, (result, file) => append(result.created, file) && append(result.staged, file)),\n parser2(\"A\" /* ADDED */, \"M\" /* MODIFIED */, (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)),\n parser2(\"D\" /* DELETED */, \" \" /* NONE */, (result, file) => append(result.deleted, file) && append(result.staged, file)),\n parser2(\"M\" /* MODIFIED */, \" \" /* NONE */, (result, file) => append(result.modified, file) && append(result.staged, file)),\n parser2(\"M\" /* MODIFIED */, \"M\" /* MODIFIED */, (result, file) => append(result.modified, file) && append(result.staged, file)),\n parser2(\"R\" /* RENAMED */, \" \" /* NONE */, (result, file) => {\n append(result.renamed, renamedFile(file));\n }),\n parser2(\"R\" /* RENAMED */, \"M\" /* MODIFIED */, (result, file) => {\n const renamed = renamedFile(file);\n append(result.renamed, renamed);\n append(result.modified, renamed.to);\n }),\n parser2(\"!\" /* IGNORED */, \"!\" /* IGNORED */, (_result, _file) => {\n append(_result.ignored = _result.ignored || [], _file);\n }),\n parser2(\"?\" /* UNTRACKED */, \"?\" /* UNTRACKED */, (result, file) => append(result.not_added, file)),\n ...conflicts(\"A\" /* ADDED */, \"A\" /* ADDED */, \"U\" /* UNMERGED */),\n ...conflicts(\"D\" /* DELETED */, \"D\" /* DELETED */, \"U\" /* UNMERGED */),\n ...conflicts(\"U\" /* UNMERGED */, \"A\" /* ADDED */, \"D\" /* DELETED */, \"U\" /* UNMERGED */),\n [\"##\", (result, line) => {\n const aheadReg = /ahead (\\d+)/;\n const behindReg = /behind (\\d+)/;\n const currentReg = /^(.+?(?=(?:\\.{3}|\\s|$)))/;\n const trackingReg = /\\.{3}(\\S*)/;\n const onEmptyBranchReg = /\\son\\s([\\S]+)$/;\n let regexResult;\n regexResult = aheadReg.exec(line);\n result.ahead = regexResult && +regexResult[1] || 0;\n regexResult = behindReg.exec(line);\n result.behind = regexResult && +regexResult[1] || 0;\n regexResult = currentReg.exec(line);\n result.current = regexResult && regexResult[1];\n regexResult = trackingReg.exec(line);\n result.tracking = regexResult && regexResult[1];\n regexResult = onEmptyBranchReg.exec(line);\n result.current = regexResult && regexResult[1] || result.current;\n result.detached = /\\(no branch\\)/.test(line);\n }]\n ]);\n parseStatusSummary = function(text) {\n const lines = text.trim().split(\"\\n\");\n const status = new StatusSummary();\n for (let i = 0, l = lines.length; i < l; i++) {\n splitLine(status, lines[i]);\n }\n return status;\n };\n }\n});\n\n// src/lib/tasks/status.ts\nfunction statusTask(customArgs) {\n return {\n format: \"utf-8\",\n commands: [\"status\", \"--porcelain\", \"-b\", \"-u\", ...customArgs],\n parser(text) {\n return parseStatusSummary(text);\n }\n };\n}\nvar init_status = __esm({\n \"src/lib/tasks/status.ts\"() {\n init_StatusSummary();\n }\n});\n\n// src/lib/simple-git-api.ts\nvar simple_git_api_exports = {};\n__export(simple_git_api_exports, {\n SimpleGitApi: () => SimpleGitApi\n});\nvar SimpleGitApi;\nvar init_simple_git_api = __esm({\n \"src/lib/simple-git-api.ts\"() {\n init_task_callback();\n init_change_working_directory();\n init_config();\n init_grep();\n init_hash_object();\n init_init();\n init_log();\n init_merge();\n init_push();\n init_status();\n init_task();\n init_utils();\n SimpleGitApi = class {\n constructor(_executor) {\n this._executor = _executor;\n }\n _runTask(task, then) {\n const chain = this._executor.chain();\n const promise = chain.push(task);\n if (then) {\n taskCallback(task, promise, then);\n }\n return Object.create(this, {\n then: { value: promise.then.bind(promise) },\n catch: { value: promise.catch.bind(promise) },\n _executor: { value: chain }\n });\n }\n add(files) {\n return this._runTask(straightThroughStringTask([\"add\", ...asArray(files)]), trailingFunctionArgument(arguments));\n }\n cwd(directory) {\n const next = trailingFunctionArgument(arguments);\n if (typeof directory === \"string\") {\n return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next);\n }\n if (typeof (directory == null ? void 0 : directory.path) === \"string\") {\n return this._runTask(changeWorkingDirectoryTask(directory.path, directory.root && this._executor || void 0), next);\n }\n return this._runTask(configurationErrorTask(\"Git.cwd: workingDirectory must be supplied as a string\"), next);\n }\n hashObject(path, write) {\n return this._runTask(hashObjectTask(path, write === true), trailingFunctionArgument(arguments));\n }\n init(bare) {\n return this._runTask(initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)), trailingFunctionArgument(arguments));\n }\n merge() {\n return this._runTask(mergeTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));\n }\n mergeFromTo(remote, branch) {\n if (!(filterString(remote) && filterString(branch))) {\n return this._runTask(configurationErrorTask(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`));\n }\n return this._runTask(mergeTask([remote, branch, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments, false));\n }\n outputHandler(handler) {\n this._executor.outputHandler = handler;\n return this;\n }\n push() {\n const task = pushTask({\n remote: filterType(arguments[0], filterString),\n branch: filterType(arguments[1], filterString)\n }, getTrailingOptions(arguments));\n return this._runTask(task, trailingFunctionArgument(arguments));\n }\n stash() {\n return this._runTask(straightThroughStringTask([\"stash\", ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments));\n }\n status() {\n return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));\n }\n };\n Object.assign(SimpleGitApi.prototype, config_default(), grep_default(), log_default());\n }\n});\n\n// src/lib/runners/scheduler.ts\nvar scheduler_exports = {};\n__export(scheduler_exports, {\n Scheduler: () => Scheduler\n});\nvar import_promise_deferred2, createScheduledTask, Scheduler;\nvar init_scheduler = __esm({\n \"src/lib/runners/scheduler.ts\"() {\n init_utils();\n import_promise_deferred2 = require(\"@kwsites/promise-deferred\");\n init_git_logger();\n createScheduledTask = (() => {\n let id = 0;\n return () => {\n id++;\n const { promise, done } = (0, import_promise_deferred2.createDeferred)();\n return {\n promise,\n done,\n id\n };\n };\n })();\n Scheduler = class {\n constructor(concurrency = 2) {\n this.concurrency = concurrency;\n this.logger = createLogger(\"\", \"scheduler\");\n this.pending = [];\n this.running = [];\n this.logger(`Constructed, concurrency=%s`, concurrency);\n }\n schedule() {\n if (!this.pending.length || this.running.length >= this.concurrency) {\n this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`, this.pending.length, this.running.length, this.concurrency);\n return;\n }\n const task = append(this.running, this.pending.shift());\n this.logger(`Attempting id=%s`, task.id);\n task.done(() => {\n this.logger(`Completing id=`, task.id);\n remove(this.running, task);\n this.schedule();\n });\n }\n next() {\n const { promise, id } = append(this.pending, createScheduledTask());\n this.logger(`Scheduling id=%s`, id);\n this.schedule();\n return promise;\n }\n };\n }\n});\n\n// src/lib/tasks/apply-patch.ts\nvar apply_patch_exports = {};\n__export(apply_patch_exports, {\n applyPatchTask: () => applyPatchTask\n});\nfunction applyPatchTask(patches, customArgs) {\n return straightThroughStringTask([\"apply\", ...customArgs, ...patches]);\n}\nvar init_apply_patch = __esm({\n \"src/lib/tasks/apply-patch.ts\"() {\n init_task();\n }\n});\n\n// src/lib/responses/BranchDeleteSummary.ts\nfunction branchDeletionSuccess(branch, hash) {\n return {\n branch,\n hash,\n success: true\n };\n}\nfunction branchDeletionFailure(branch) {\n return {\n branch,\n hash: null,\n success: false\n };\n}\nvar BranchDeletionBatch;\nvar init_BranchDeleteSummary = __esm({\n \"src/lib/responses/BranchDeleteSummary.ts\"() {\n BranchDeletionBatch = class {\n constructor() {\n this.all = [];\n this.branches = {};\n this.errors = [];\n }\n get success() {\n return !this.errors.length;\n }\n };\n }\n});\n\n// src/lib/parsers/parse-branch-delete.ts\nfunction hasBranchDeletionError(data, processExitCode) {\n return processExitCode === 1 /* ERROR */ && deleteErrorRegex.test(data);\n}\nvar deleteSuccessRegex, deleteErrorRegex, parsers6, parseBranchDeletions;\nvar init_parse_branch_delete = __esm({\n \"src/lib/parsers/parse-branch-delete.ts\"() {\n init_BranchDeleteSummary();\n init_utils();\n deleteSuccessRegex = /(\\S+)\\s+\\(\\S+\\s([^)]+)\\)/;\n deleteErrorRegex = /^error[^']+'([^']+)'/m;\n parsers6 = [\n new LineParser(deleteSuccessRegex, (result, [branch, hash]) => {\n const deletion = branchDeletionSuccess(branch, hash);\n result.all.push(deletion);\n result.branches[branch] = deletion;\n }),\n new LineParser(deleteErrorRegex, (result, [branch]) => {\n const deletion = branchDeletionFailure(branch);\n result.errors.push(deletion);\n result.all.push(deletion);\n result.branches[branch] = deletion;\n })\n ];\n parseBranchDeletions = (stdOut, stdErr) => {\n return parseStringResponse(new BranchDeletionBatch(), parsers6, stdOut, stdErr);\n };\n }\n});\n\n// src/lib/responses/BranchSummary.ts\nvar BranchSummaryResult;\nvar init_BranchSummary = __esm({\n \"src/lib/responses/BranchSummary.ts\"() {\n BranchSummaryResult = class {\n constructor() {\n this.all = [];\n this.branches = {};\n this.current = \"\";\n this.detached = false;\n }\n push(current, detached, name, commit, label) {\n if (current) {\n this.detached = detached;\n this.current = name;\n }\n this.all.push(name);\n this.branches[name] = {\n current,\n name,\n commit,\n label\n };\n }\n };\n }\n});\n\n// src/lib/parsers/parse-branch.ts\nfunction parseBranchSummary(stdOut) {\n return parseStringResponse(new BranchSummaryResult(), parsers7, stdOut);\n}\nvar parsers7;\nvar init_parse_branch = __esm({\n \"src/lib/parsers/parse-branch.ts\"() {\n init_BranchSummary();\n init_utils();\n parsers7 = [\n new LineParser(/^(\\*\\s)?\\((?:HEAD )?detached (?:from|at) (\\S+)\\)\\s+([a-z0-9]+)\\s(.*)$/, (result, [current, name, commit, label]) => {\n result.push(!!current, true, name, commit, label);\n }),\n new LineParser(/^(\\*\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$/s, (result, [current, name, commit, label]) => {\n result.push(!!current, false, name, commit, label);\n })\n ];\n }\n});\n\n// src/lib/tasks/branch.ts\nvar branch_exports = {};\n__export(branch_exports, {\n branchLocalTask: () => branchLocalTask,\n branchTask: () => branchTask,\n containsDeleteBranchCommand: () => containsDeleteBranchCommand,\n deleteBranchTask: () => deleteBranchTask,\n deleteBranchesTask: () => deleteBranchesTask\n});\nfunction containsDeleteBranchCommand(commands) {\n const deleteCommands = [\"-d\", \"-D\", \"--delete\"];\n return commands.some((command) => deleteCommands.includes(command));\n}\nfunction branchTask(customArgs) {\n const isDelete = containsDeleteBranchCommand(customArgs);\n const commands = [\"branch\", ...customArgs];\n if (commands.length === 1) {\n commands.push(\"-a\");\n }\n if (!commands.includes(\"-v\")) {\n commands.splice(1, 0, \"-v\");\n }\n return {\n format: \"utf-8\",\n commands,\n parser(stdOut, stdErr) {\n if (isDelete) {\n return parseBranchDeletions(stdOut, stdErr).all[0];\n }\n return parseBranchSummary(stdOut);\n }\n };\n}\nfunction branchLocalTask() {\n const parser3 = parseBranchSummary;\n return {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\"],\n parser: parser3\n };\n}\nfunction deleteBranchesTask(branches, forceDelete = false) {\n return {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\", forceDelete ? \"-D\" : \"-d\", ...branches],\n parser(stdOut, stdErr) {\n return parseBranchDeletions(stdOut, stdErr);\n },\n onError({ exitCode, stdOut }, error, done, fail) {\n if (!hasBranchDeletionError(String(error), exitCode)) {\n return fail(error);\n }\n done(stdOut);\n }\n };\n}\nfunction deleteBranchTask(branch, forceDelete = false) {\n const task = {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\", forceDelete ? \"-D\" : \"-d\", branch],\n parser(stdOut, stdErr) {\n return parseBranchDeletions(stdOut, stdErr).branches[branch];\n },\n onError({ exitCode, stdErr, stdOut }, error, _, fail) {\n if (!hasBranchDeletionError(String(error), exitCode)) {\n return fail(error);\n }\n throw new GitResponseError(task.parser(bufferToString(stdOut), bufferToString(stdErr)), String(error));\n }\n };\n return task;\n}\nvar init_branch = __esm({\n \"src/lib/tasks/branch.ts\"() {\n init_git_response_error();\n init_parse_branch_delete();\n init_parse_branch();\n init_utils();\n }\n});\n\n// src/lib/responses/CheckIgnore.ts\nvar parseCheckIgnore;\nvar init_CheckIgnore = __esm({\n \"src/lib/responses/CheckIgnore.ts\"() {\n parseCheckIgnore = (text) => {\n return text.split(/\\n/g).map((line) => line.trim()).filter((file) => !!file);\n };\n }\n});\n\n// src/lib/tasks/check-ignore.ts\nvar check_ignore_exports = {};\n__export(check_ignore_exports, {\n checkIgnoreTask: () => checkIgnoreTask\n});\nfunction checkIgnoreTask(paths) {\n return {\n commands: [\"check-ignore\", ...paths],\n format: \"utf-8\",\n parser: parseCheckIgnore\n };\n}\nvar init_check_ignore = __esm({\n \"src/lib/tasks/check-ignore.ts\"() {\n init_CheckIgnore();\n }\n});\n\n// src/lib/tasks/clone.ts\nvar clone_exports = {};\n__export(clone_exports, {\n cloneMirrorTask: () => cloneMirrorTask,\n cloneTask: () => cloneTask\n});\nfunction cloneTask(repo, directory, customArgs) {\n const commands = [\"clone\", ...customArgs];\n if (typeof repo === \"string\") {\n commands.push(repo);\n }\n if (typeof directory === \"string\") {\n commands.push(directory);\n }\n return straightThroughStringTask(commands);\n}\nfunction cloneMirrorTask(repo, directory, customArgs) {\n append(customArgs, \"--mirror\");\n return cloneTask(repo, directory, customArgs);\n}\nvar init_clone = __esm({\n \"src/lib/tasks/clone.ts\"() {\n init_task();\n init_utils();\n }\n});\n\n// src/lib/parsers/parse-commit.ts\nfunction parseCommitResult(stdOut) {\n const result = {\n author: null,\n branch: \"\",\n commit: \"\",\n root: false,\n summary: {\n changes: 0,\n insertions: 0,\n deletions: 0\n }\n };\n return parseStringResponse(result, parsers8, stdOut);\n}\nvar parsers8;\nvar init_parse_commit = __esm({\n \"src/lib/parsers/parse-commit.ts\"() {\n init_utils();\n parsers8 = [\n new LineParser(/^\\[([^\\s]+)( \\([^)]+\\))? ([^\\]]+)/, (result, [branch, root, commit]) => {\n result.branch = branch;\n result.commit = commit;\n result.root = !!root;\n }),\n new LineParser(/\\s*Author:\\s(.+)/i, (result, [author]) => {\n const parts = author.split(\"<\");\n const email = parts.pop();\n if (!email || !email.includes(\"@\")) {\n return;\n }\n result.author = {\n email: email.substr(0, email.length - 1),\n name: parts.join(\"<\").trim()\n };\n }),\n new LineParser(/(\\d+)[^,]*(?:,\\s*(\\d+)[^,]*)(?:,\\s*(\\d+))/g, (result, [changes, insertions, deletions]) => {\n result.summary.changes = parseInt(changes, 10) || 0;\n result.summary.insertions = parseInt(insertions, 10) || 0;\n result.summary.deletions = parseInt(deletions, 10) || 0;\n }),\n new LineParser(/^(\\d+)[^,]*(?:,\\s*(\\d+)[^(]+\\(([+-]))?/, (result, [changes, lines, direction]) => {\n result.summary.changes = parseInt(changes, 10) || 0;\n const count = parseInt(lines, 10) || 0;\n if (direction === \"-\") {\n result.summary.deletions = count;\n } else if (direction === \"+\") {\n result.summary.insertions = count;\n }\n })\n ];\n }\n});\n\n// src/lib/tasks/commit.ts\nvar commit_exports = {};\n__export(commit_exports, {\n commitTask: () => commitTask\n});\nfunction commitTask(message, files, customArgs) {\n const commands = [\"commit\"];\n message.forEach((m) => commands.push(\"-m\", m));\n commands.push(...files, ...customArgs);\n return {\n commands,\n format: \"utf-8\",\n parser: parseCommitResult\n };\n}\nvar init_commit = __esm({\n \"src/lib/tasks/commit.ts\"() {\n init_parse_commit();\n }\n});\n\n// src/lib/tasks/diff.ts\nvar diff_exports = {};\n__export(diff_exports, {\n diffSummaryTask: () => diffSummaryTask\n});\nfunction diffSummaryTask(customArgs) {\n return {\n commands: [\"diff\", \"--stat=4096\", ...customArgs],\n format: \"utf-8\",\n parser(stdOut) {\n return parseDiffResult(stdOut);\n }\n };\n}\nvar init_diff = __esm({\n \"src/lib/tasks/diff.ts\"() {\n init_parse_diff_summary();\n }\n});\n\n// src/lib/parsers/parse-fetch.ts\nfunction parseFetchResult(stdOut, stdErr) {\n const result = {\n raw: stdOut,\n remote: null,\n branches: [],\n tags: []\n };\n return parseStringResponse(result, parsers9, stdOut, stdErr);\n}\nvar parsers9;\nvar init_parse_fetch = __esm({\n \"src/lib/parsers/parse-fetch.ts\"() {\n init_utils();\n parsers9 = [\n new LineParser(/From (.+)$/, (result, [remote]) => {\n result.remote = remote;\n }),\n new LineParser(/\\* \\[new branch]\\s+(\\S+)\\s*-> (.+)$/, (result, [name, tracking]) => {\n result.branches.push({\n name,\n tracking\n });\n }),\n new LineParser(/\\* \\[new tag]\\s+(\\S+)\\s*-> (.+)$/, (result, [name, tracking]) => {\n result.tags.push({\n name,\n tracking\n });\n })\n ];\n }\n});\n\n// src/lib/tasks/fetch.ts\nvar fetch_exports = {};\n__export(fetch_exports, {\n fetchTask: () => fetchTask\n});\nfunction fetchTask(remote, branch, customArgs) {\n const commands = [\"fetch\", ...customArgs];\n if (remote && branch) {\n commands.push(remote, branch);\n }\n return {\n commands,\n format: \"utf-8\",\n parser: parseFetchResult\n };\n}\nvar init_fetch = __esm({\n \"src/lib/tasks/fetch.ts\"() {\n init_parse_fetch();\n }\n});\n\n// src/lib/parsers/parse-move.ts\nfunction parseMoveResult(stdOut) {\n return parseStringResponse({ moves: [] }, parsers10, stdOut);\n}\nvar parsers10;\nvar init_parse_move = __esm({\n \"src/lib/parsers/parse-move.ts\"() {\n init_utils();\n parsers10 = [\n new LineParser(/^Renaming (.+) to (.+)$/, (result, [from, to]) => {\n result.moves.push({ from, to });\n })\n ];\n }\n});\n\n// src/lib/tasks/move.ts\nvar move_exports = {};\n__export(move_exports, {\n moveTask: () => moveTask\n});\nfunction moveTask(from, to) {\n return {\n commands: [\"mv\", \"-v\", ...asArray(from), to],\n format: \"utf-8\",\n parser: parseMoveResult\n };\n}\nvar init_move = __esm({\n \"src/lib/tasks/move.ts\"() {\n init_parse_move();\n init_utils();\n }\n});\n\n// src/lib/tasks/pull.ts\nvar pull_exports = {};\n__export(pull_exports, {\n pullTask: () => pullTask\n});\nfunction pullTask(remote, branch, customArgs) {\n const commands = [\"pull\", ...customArgs];\n if (remote && branch) {\n commands.splice(1, 0, remote, branch);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(stdOut, stdErr) {\n return parsePullResult(stdOut, stdErr);\n },\n onError(result, _error, _done, fail) {\n const pullError = parsePullErrorResult(bufferToString(result.stdOut), bufferToString(result.stdErr));\n if (pullError) {\n return fail(new GitResponseError(pullError));\n }\n fail(_error);\n }\n };\n}\nvar init_pull = __esm({\n \"src/lib/tasks/pull.ts\"() {\n init_git_response_error();\n init_parse_pull();\n init_utils();\n }\n});\n\n// src/lib/responses/GetRemoteSummary.ts\nfunction parseGetRemotes(text) {\n const remotes = {};\n forEach(text, ([name]) => remotes[name] = { name });\n return Object.values(remotes);\n}\nfunction parseGetRemotesVerbose(text) {\n const remotes = {};\n forEach(text, ([name, url, purpose]) => {\n if (!remotes.hasOwnProperty(name)) {\n remotes[name] = {\n name,\n refs: { fetch: \"\", push: \"\" }\n };\n }\n if (purpose && url) {\n remotes[name].refs[purpose.replace(/[^a-z]/g, \"\")] = url;\n }\n });\n return Object.values(remotes);\n}\nfunction forEach(text, handler) {\n forEachLineWithContent(text, (line) => handler(line.split(/\\s+/)));\n}\nvar init_GetRemoteSummary = __esm({\n \"src/lib/responses/GetRemoteSummary.ts\"() {\n init_utils();\n }\n});\n\n// src/lib/tasks/remote.ts\nvar remote_exports = {};\n__export(remote_exports, {\n addRemoteTask: () => addRemoteTask,\n getRemotesTask: () => getRemotesTask,\n listRemotesTask: () => listRemotesTask,\n remoteTask: () => remoteTask,\n removeRemoteTask: () => removeRemoteTask\n});\nfunction addRemoteTask(remoteName, remoteRepo, customArgs = []) {\n return straightThroughStringTask([\"remote\", \"add\", ...customArgs, remoteName, remoteRepo]);\n}\nfunction getRemotesTask(verbose) {\n const commands = [\"remote\"];\n if (verbose) {\n commands.push(\"-v\");\n }\n return {\n commands,\n format: \"utf-8\",\n parser: verbose ? parseGetRemotesVerbose : parseGetRemotes\n };\n}\nfunction listRemotesTask(customArgs = []) {\n const commands = [...customArgs];\n if (commands[0] !== \"ls-remote\") {\n commands.unshift(\"ls-remote\");\n }\n return straightThroughStringTask(commands);\n}\nfunction remoteTask(customArgs = []) {\n const commands = [...customArgs];\n if (commands[0] !== \"remote\") {\n commands.unshift(\"remote\");\n }\n return straightThroughStringTask(commands);\n}\nfunction removeRemoteTask(remoteName) {\n return straightThroughStringTask([\"remote\", \"remove\", remoteName]);\n}\nvar init_remote = __esm({\n \"src/lib/tasks/remote.ts\"() {\n init_GetRemoteSummary();\n init_task();\n }\n});\n\n// src/lib/tasks/stash-list.ts\nvar stash_list_exports = {};\n__export(stash_list_exports, {\n stashListTask: () => stashListTask\n});\nfunction stashListTask(opt = {}, customArgs) {\n const options = parseLogOptions(opt);\n const parser3 = createListLogSummaryParser(options.splitter, options.fields);\n return {\n commands: [\"stash\", \"list\", ...options.commands, ...customArgs],\n format: \"utf-8\",\n parser: parser3\n };\n}\nvar init_stash_list = __esm({\n \"src/lib/tasks/stash-list.ts\"() {\n init_parse_list_log_summary();\n init_log();\n }\n});\n\n// src/lib/tasks/sub-module.ts\nvar sub_module_exports = {};\n__export(sub_module_exports, {\n addSubModuleTask: () => addSubModuleTask,\n initSubModuleTask: () => initSubModuleTask,\n subModuleTask: () => subModuleTask,\n updateSubModuleTask: () => updateSubModuleTask\n});\nfunction addSubModuleTask(repo, path) {\n return subModuleTask([\"add\", repo, path]);\n}\nfunction initSubModuleTask(customArgs) {\n return subModuleTask([\"init\", ...customArgs]);\n}\nfunction subModuleTask(customArgs) {\n const commands = [...customArgs];\n if (commands[0] !== \"submodule\") {\n commands.unshift(\"submodule\");\n }\n return straightThroughStringTask(commands);\n}\nfunction updateSubModuleTask(customArgs) {\n return subModuleTask([\"update\", ...customArgs]);\n}\nvar init_sub_module = __esm({\n \"src/lib/tasks/sub-module.ts\"() {\n init_task();\n }\n});\n\n// src/lib/responses/TagList.ts\nfunction singleSorted(a, b) {\n const aIsNum = isNaN(a);\n const bIsNum = isNaN(b);\n if (aIsNum !== bIsNum) {\n return aIsNum ? 1 : -1;\n }\n return aIsNum ? sorted(a, b) : 0;\n}\nfunction sorted(a, b) {\n return a === b ? 0 : a > b ? 1 : -1;\n}\nfunction trimmed(input) {\n return input.trim();\n}\nfunction toNumber(input) {\n if (typeof input === \"string\") {\n return parseInt(input.replace(/^\\D+/g, \"\"), 10) || 0;\n }\n return 0;\n}\nvar TagList, parseTagList;\nvar init_TagList = __esm({\n \"src/lib/responses/TagList.ts\"() {\n TagList = class {\n constructor(all, latest) {\n this.all = all;\n this.latest = latest;\n }\n };\n parseTagList = function(data, customSort = false) {\n const tags = data.split(\"\\n\").map(trimmed).filter(Boolean);\n if (!customSort) {\n tags.sort(function(tagA, tagB) {\n const partsA = tagA.split(\".\");\n const partsB = tagB.split(\".\");\n if (partsA.length === 1 || partsB.length === 1) {\n return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));\n }\n for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) {\n const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i]));\n if (diff) {\n return diff;\n }\n }\n return 0;\n });\n }\n const latest = customSort ? tags[0] : [...tags].reverse().find((tag) => tag.indexOf(\".\") >= 0);\n return new TagList(tags, latest);\n };\n }\n});\n\n// src/lib/tasks/tag.ts\nvar tag_exports = {};\n__export(tag_exports, {\n addAnnotatedTagTask: () => addAnnotatedTagTask,\n addTagTask: () => addTagTask,\n tagListTask: () => tagListTask\n});\nfunction tagListTask(customArgs = []) {\n const hasCustomSort = customArgs.some((option) => /^--sort=/.test(option));\n return {\n format: \"utf-8\",\n commands: [\"tag\", \"-l\", ...customArgs],\n parser(text) {\n return parseTagList(text, hasCustomSort);\n }\n };\n}\nfunction addTagTask(name) {\n return {\n format: \"utf-8\",\n commands: [\"tag\", name],\n parser() {\n return { name };\n }\n };\n}\nfunction addAnnotatedTagTask(name, tagMessage) {\n return {\n format: \"utf-8\",\n commands: [\"tag\", \"-a\", \"-m\", tagMessage, name],\n parser() {\n return { name };\n }\n };\n}\nvar init_tag = __esm({\n \"src/lib/tasks/tag.ts\"() {\n init_TagList();\n }\n});\n\n// src/git.js\nvar require_git = __commonJS({\n \"src/git.js\"(exports2, module2) {\n var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));\n var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));\n var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));\n var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));\n var {\n asArray: asArray2,\n filterArray: filterArray2,\n filterPrimitives: filterPrimitives2,\n filterString: filterString2,\n filterStringOrStringArray: filterStringOrStringArray2,\n filterType: filterType2,\n getTrailingOptions: getTrailingOptions2,\n trailingFunctionArgument: trailingFunctionArgument2,\n trailingOptionsArgument: trailingOptionsArgument2\n } = (init_utils(), __toCommonJS(utils_exports));\n var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS(apply_patch_exports));\n var { branchTask: branchTask2, branchLocalTask: branchLocalTask2, deleteBranchesTask: deleteBranchesTask2, deleteBranchTask: deleteBranchTask2 } = (init_branch(), __toCommonJS(branch_exports));\n var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));\n var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));\n var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports));\n var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));\n var { commitTask: commitTask2 } = (init_commit(), __toCommonJS(commit_exports));\n var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));\n var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));\n var { moveTask: moveTask2 } = (init_move(), __toCommonJS(move_exports));\n var { pullTask: pullTask2 } = (init_pull(), __toCommonJS(pull_exports));\n var { pushTagsTask: pushTagsTask2 } = (init_push(), __toCommonJS(push_exports));\n var { addRemoteTask: addRemoteTask2, getRemotesTask: getRemotesTask2, listRemotesTask: listRemotesTask2, remoteTask: remoteTask2, removeRemoteTask: removeRemoteTask2 } = (init_remote(), __toCommonJS(remote_exports));\n var { getResetMode: getResetMode2, resetTask: resetTask2 } = (init_reset(), __toCommonJS(reset_exports));\n var { stashListTask: stashListTask2 } = (init_stash_list(), __toCommonJS(stash_list_exports));\n var { addSubModuleTask: addSubModuleTask2, initSubModuleTask: initSubModuleTask2, subModuleTask: subModuleTask2, updateSubModuleTask: updateSubModuleTask2 } = (init_sub_module(), __toCommonJS(sub_module_exports));\n var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS(tag_exports));\n var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS(task_exports));\n function Git2(options, plugins) {\n this._executor = new GitExecutor2(options.binary, options.baseDir, new Scheduler2(options.maxConcurrentProcesses), plugins);\n }\n (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2;\n Git2.prototype.customBinary = function(command) {\n this._executor.binary = command;\n return this;\n };\n Git2.prototype.env = function(name, value) {\n if (arguments.length === 1 && typeof name === \"object\") {\n this._executor.env = name;\n } else {\n (this._executor.env = this._executor.env || {})[name] = value;\n }\n return this;\n };\n Git2.prototype.stashList = function(options) {\n return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments));\n };\n function createCloneTask(api, task, repoPath, localPath) {\n if (typeof repoPath !== \"string\") {\n return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);\n }\n return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));\n }\n Git2.prototype.clone = function() {\n return this._runTask(createCloneTask(\"clone\", cloneTask2, ...arguments), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.mirror = function() {\n return this._runTask(createCloneTask(\"mirror\", cloneMirrorTask2, ...arguments), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.mv = function(from, to) {\n return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkoutLatestTag = function(then) {\n var git = this;\n return this.pull(function() {\n git.tags(function(err, tags) {\n git.checkout(tags.latest, then);\n });\n });\n };\n Git2.prototype.commit = function(message, files, options, then) {\n const next = trailingFunctionArgument2(arguments);\n if (!filterStringOrStringArray2(message)) {\n return this._runTask(configurationErrorTask2(\"git.commit: requires the commit message to be supplied as a string/string[]\"), next);\n }\n return this._runTask(commitTask2(asArray2(message), asArray2(filterType2(files, filterStringOrStringArray2, [])), [...filterType2(options, filterArray2, []), ...getTrailingOptions2(arguments, 0, true)]), next);\n };\n Git2.prototype.pull = function(remote, branch, options, then) {\n return this._runTask(pullTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.fetch = function(remote, branch) {\n return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.silent = function(silence) {\n console.warn(\"simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3\");\n return this;\n };\n Git2.prototype.tags = function(options, then) {\n return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.rebase = function() {\n return this._runTask(straightThroughStringTask2([\"rebase\", ...getTrailingOptions2(arguments)]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.reset = function(mode) {\n return this._runTask(resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.revert = function(commit) {\n const next = trailingFunctionArgument2(arguments);\n if (typeof commit !== \"string\") {\n return this._runTask(configurationErrorTask2(\"Commit must be a string\"), next);\n }\n return this._runTask(straightThroughStringTask2([\"revert\", ...getTrailingOptions2(arguments, 0, true), commit]), next);\n };\n Git2.prototype.addTag = function(name) {\n const task = typeof name === \"string\" ? addTagTask2(name) : configurationErrorTask2(\"Git.addTag requires a tag name\");\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.addAnnotatedTag = function(tagName, tagMessage) {\n return this._runTask(addAnnotatedTagTask2(tagName, tagMessage), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkout = function() {\n const commands = [\"checkout\", ...getTrailingOptions2(arguments, true)];\n return this._runTask(straightThroughStringTask2(commands), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkoutBranch = function(branchName, startPoint, then) {\n return this.checkout([\"-b\", branchName, startPoint], trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkoutLocalBranch = function(branchName, then) {\n return this.checkout([\"-b\", branchName], trailingFunctionArgument2(arguments));\n };\n Git2.prototype.deleteLocalBranch = function(branchName, forceDelete, then) {\n return this._runTask(deleteBranchTask2(branchName, typeof forceDelete === \"boolean\" ? forceDelete : false), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.deleteLocalBranches = function(branchNames, forceDelete, then) {\n return this._runTask(deleteBranchesTask2(branchNames, typeof forceDelete === \"boolean\" ? forceDelete : false), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.branch = function(options, then) {\n return this._runTask(branchTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.branchLocal = function(then) {\n return this._runTask(branchLocalTask2(), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.raw = function(commands) {\n const createRestCommands = !Array.isArray(commands);\n const command = [].slice.call(createRestCommands ? arguments : commands, 0);\n for (let i = 0; i < command.length && createRestCommands; i++) {\n if (!filterPrimitives2(command[i])) {\n command.splice(i, command.length - i);\n break;\n }\n }\n command.push(...getTrailingOptions2(arguments, 0, true));\n var next = trailingFunctionArgument2(arguments);\n if (!command.length) {\n return this._runTask(configurationErrorTask2(\"Raw: must supply one or more command to execute\"), next);\n }\n return this._runTask(straightThroughStringTask2(command), next);\n };\n Git2.prototype.submoduleAdd = function(repo, path, then) {\n return this._runTask(addSubModuleTask2(repo, path), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.submoduleUpdate = function(args, then) {\n return this._runTask(updateSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.submoduleInit = function(args, then) {\n return this._runTask(initSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.subModule = function(options, then) {\n return this._runTask(subModuleTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.listRemote = function() {\n return this._runTask(listRemotesTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.addRemote = function(remoteName, remoteRepo, then) {\n return this._runTask(addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.removeRemote = function(remoteName, then) {\n return this._runTask(removeRemoteTask2(remoteName), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.getRemotes = function(verbose, then) {\n return this._runTask(getRemotesTask2(verbose === true), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.remote = function(options, then) {\n return this._runTask(remoteTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.tag = function(options, then) {\n const command = getTrailingOptions2(arguments);\n if (command[0] !== \"tag\") {\n command.unshift(\"tag\");\n }\n return this._runTask(straightThroughStringTask2(command), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.updateServerInfo = function(then) {\n return this._runTask(straightThroughStringTask2([\"update-server-info\"]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.pushTags = function(remote, then) {\n const task = pushTagsTask2({ remote: filterType2(remote, filterString2) }, getTrailingOptions2(arguments));\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.rm = function(files) {\n return this._runTask(straightThroughStringTask2([\"rm\", \"-f\", ...asArray2(files)]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.rmKeepLocal = function(files) {\n return this._runTask(straightThroughStringTask2([\"rm\", \"--cached\", ...asArray2(files)]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.catFile = function(options, then) {\n return this._catFile(\"utf-8\", arguments);\n };\n Git2.prototype.binaryCatFile = function() {\n return this._catFile(\"buffer\", arguments);\n };\n Git2.prototype._catFile = function(format, args) {\n var handler = trailingFunctionArgument2(args);\n var command = [\"cat-file\"];\n var options = args[0];\n if (typeof options === \"string\") {\n return this._runTask(configurationErrorTask2(\"Git.catFile: options must be supplied as an array of strings\"), handler);\n }\n if (Array.isArray(options)) {\n command.push.apply(command, options);\n }\n const task = format === \"buffer\" ? straightThroughBufferTask2(command) : straightThroughStringTask2(command);\n return this._runTask(task, handler);\n };\n Git2.prototype.diff = function(options, then) {\n const task = filterString2(options) ? configurationErrorTask2(\"git.diff: supplying options as a single string is no longer supported, switch to an array of strings\") : straightThroughStringTask2([\"diff\", ...getTrailingOptions2(arguments)]);\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.diffSummary = function() {\n return this._runTask(diffSummaryTask2(getTrailingOptions2(arguments, 1)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.applyPatch = function(patches) {\n const task = !filterStringOrStringArray2(patches) ? configurationErrorTask2(`git.applyPatch requires one or more string patches as the first argument`) : applyPatchTask2(asArray2(patches), getTrailingOptions2([].slice.call(arguments, 1)));\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.revparse = function() {\n const commands = [\"rev-parse\", ...getTrailingOptions2(arguments, true)];\n return this._runTask(straightThroughStringTask2(commands, true), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.show = function(options, then) {\n return this._runTask(straightThroughStringTask2([\"show\", ...getTrailingOptions2(arguments, 1)]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.clean = function(mode, options, then) {\n const usingCleanOptionsArray = isCleanOptionsArray2(mode);\n const cleanMode = usingCleanOptionsArray && mode.join(\"\") || filterType2(mode, filterString2) || \"\";\n const customArgs = getTrailingOptions2([].slice.call(arguments, usingCleanOptionsArray ? 1 : 0));\n return this._runTask(cleanWithOptionsTask2(cleanMode, customArgs), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.exec = function(then) {\n const task = {\n commands: [],\n format: \"utf-8\",\n parser() {\n if (typeof then === \"function\") {\n then();\n }\n }\n };\n return this._runTask(task);\n };\n Git2.prototype.clearQueue = function() {\n return this;\n };\n Git2.prototype.checkIgnore = function(pathnames, then) {\n return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkIsRepo = function(checkType, then) {\n return this._runTask(checkIsRepoTask2(filterType2(checkType, filterString2)), trailingFunctionArgument2(arguments));\n };\n module2.exports = Git2;\n }\n});\n\n// src/lib/git-factory.ts\nvar git_factory_exports = {};\n__export(git_factory_exports, {\n esModuleFactory: () => esModuleFactory,\n gitExportFactory: () => gitExportFactory,\n gitInstanceFactory: () => gitInstanceFactory\n});\nfunction esModuleFactory(defaultExport) {\n return Object.defineProperties(defaultExport, {\n __esModule: { value: true },\n default: { value: defaultExport }\n });\n}\nfunction gitExportFactory(factory, extra) {\n return Object.assign(function(...args) {\n return factory.apply(null, args);\n }, api_exports, extra || {});\n}\nfunction gitInstanceFactory(baseDir, options) {\n const plugins = new PluginStore();\n const config = createInstanceConfig(baseDir && (typeof baseDir === \"string\" ? { baseDir } : baseDir) || {}, options);\n if (!folderExists(config.baseDir)) {\n throw new GitConstructError(config, `Cannot use simple-git on a directory that does not exist`);\n }\n if (Array.isArray(config.config)) {\n plugins.add(commandConfigPrefixingPlugin(config.config));\n }\n plugins.add(completionDetectionPlugin(config.completion));\n config.progress && plugins.add(progressMonitorPlugin(config.progress));\n config.timeout && plugins.add(timeoutPlugin(config.timeout));\n config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));\n plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));\n config.errors && plugins.add(errorDetectionPlugin(config.errors));\n return new Git(config, plugins);\n}\nvar Git;\nvar init_git_factory = __esm({\n \"src/lib/git-factory.ts\"() {\n init_api();\n init_plugins();\n init_utils();\n Git = require_git();\n }\n});\n\n// src/lib/runners/promise-wrapped.ts\nvar promise_wrapped_exports = {};\n__export(promise_wrapped_exports, {\n gitP: () => gitP\n});\nfunction gitP(...args) {\n let git;\n let chain = Promise.resolve();\n try {\n git = gitInstanceFactory(...args);\n } catch (e) {\n chain = Promise.reject(e);\n }\n function builderReturn() {\n return promiseApi;\n }\n function chainReturn() {\n return chain;\n }\n const promiseApi = [...functionNamesBuilderApi, ...functionNamesPromiseApi].reduce((api, name) => {\n const isAsync = functionNamesPromiseApi.includes(name);\n const valid = isAsync ? asyncWrapper(name, git) : syncWrapper(name, git, api);\n const alternative = isAsync ? chainReturn : builderReturn;\n Object.defineProperty(api, name, {\n enumerable: false,\n configurable: false,\n value: git ? valid : alternative\n });\n return api;\n }, {});\n return promiseApi;\n function asyncWrapper(fn, git2) {\n return function(...args2) {\n if (typeof args2[args2.length] === \"function\") {\n throw new TypeError(\"Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to \" + fn);\n }\n return chain.then(function() {\n return new Promise(function(resolve, reject) {\n const callback = (err, result) => {\n if (err) {\n return reject(toError(err));\n }\n resolve(result);\n };\n args2.push(callback);\n git2[fn].apply(git2, args2);\n });\n });\n };\n }\n function syncWrapper(fn, git2, api) {\n return (...args2) => {\n git2[fn](...args2);\n return api;\n };\n }\n}\nfunction toError(error) {\n if (error instanceof Error) {\n return error;\n }\n if (typeof error === \"string\") {\n return new Error(error);\n }\n return new GitResponseError(error);\n}\nvar functionNamesBuilderApi, functionNamesPromiseApi;\nvar init_promise_wrapped = __esm({\n \"src/lib/runners/promise-wrapped.ts\"() {\n init_git_response_error();\n init_git_factory();\n functionNamesBuilderApi = [\n \"customBinary\",\n \"env\",\n \"outputHandler\",\n \"silent\"\n ];\n functionNamesPromiseApi = [\n \"add\",\n \"addAnnotatedTag\",\n \"addConfig\",\n \"addRemote\",\n \"addTag\",\n \"applyPatch\",\n \"binaryCatFile\",\n \"branch\",\n \"branchLocal\",\n \"catFile\",\n \"checkIgnore\",\n \"checkIsRepo\",\n \"checkout\",\n \"checkoutBranch\",\n \"checkoutLatestTag\",\n \"checkoutLocalBranch\",\n \"clean\",\n \"clone\",\n \"commit\",\n \"cwd\",\n \"deleteLocalBranch\",\n \"deleteLocalBranches\",\n \"diff\",\n \"diffSummary\",\n \"exec\",\n \"fetch\",\n \"getRemotes\",\n \"init\",\n \"listConfig\",\n \"listRemote\",\n \"log\",\n \"merge\",\n \"mergeFromTo\",\n \"mirror\",\n \"mv\",\n \"pull\",\n \"push\",\n \"pushTags\",\n \"raw\",\n \"rebase\",\n \"remote\",\n \"removeRemote\",\n \"reset\",\n \"revert\",\n \"revparse\",\n \"rm\",\n \"rmKeepLocal\",\n \"show\",\n \"stash\",\n \"stashList\",\n \"status\",\n \"subModule\",\n \"submoduleAdd\",\n \"submoduleInit\",\n \"submoduleUpdate\",\n \"tag\",\n \"tags\",\n \"updateServerInfo\"\n ];\n }\n});\n\n// src/index.js\nvar { gitP: gitP2 } = (init_promise_wrapped(), __toCommonJS(promise_wrapped_exports));\nvar { esModuleFactory: esModuleFactory2, gitInstanceFactory: gitInstanceFactory2, gitExportFactory: gitExportFactory2 } = (init_git_factory(), __toCommonJS(git_factory_exports));\nmodule.exports = esModuleFactory2(gitExportFactory2(gitInstanceFactory2, { gitP: gitP2 }));\n//# sourceMappingURL=index.js.map\n","'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","module.exports = require(\"assert\");","module.exports = require(\"child_process\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"tls\");","module.exports = require(\"tty\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(3109);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index.js","mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACpCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACnDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACrEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACvCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxhBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;AC5QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;AC3xHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACtIA;;;;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACvQA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC7BA;AACA;;;;AEDA;AACA;AACA;AACA","sources":["../webpack://git-queue/./lib/commit-author.js","../webpack://git-queue/./lib/commit-body.js","../webpack://git-queue/./lib/commit-hash.js","../webpack://git-queue/./lib/commit-info.js","../webpack://git-queue/./lib/commit-message.js","../webpack://git-queue/./lib/commit-options.js","../webpack://git-queue/./lib/commit-subject-parser.js","../webpack://git-queue/./lib/commit-subject.js","../webpack://git-queue/./lib/committed-message-log.js","../webpack://git-queue/./lib/committed-message.js","../webpack://git-queue/./lib/context.js","../webpack://git-queue/./lib/email-address.js","../webpack://git-queue/./lib/error.js","../webpack://git-queue/./lib/errors.js","../webpack://git-queue/./lib/git-repo-dir.js","../webpack://git-queue/./lib/git-repo.js","../webpack://git-queue/./lib/gpg-env.js","../webpack://git-queue/./lib/main.js","../webpack://git-queue/./lib/message-key.js","../webpack://git-queue/./lib/message.js","../webpack://git-queue/./lib/queue-name.js","../webpack://git-queue/./lib/queue.js","../webpack://git-queue/./lib/signing-key-id.js","../webpack://git-queue/./lib/simple-git-factory.js","../webpack://git-queue/./node_modules/@actions/core/lib/command.js","../webpack://git-queue/./node_modules/@actions/core/lib/core.js","../webpack://git-queue/./node_modules/@actions/core/lib/file-command.js","../webpack://git-queue/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://git-queue/./node_modules/@actions/core/lib/utils.js","../webpack://git-queue/./node_modules/@actions/http-client/auth.js","../webpack://git-queue/./node_modules/@actions/http-client/index.js","../webpack://git-queue/./node_modules/@actions/http-client/proxy.js","../webpack://git-queue/./node_modules/@kwsites/file-exists/dist/index.js","../webpack://git-queue/./node_modules/@kwsites/file-exists/dist/src/index.js","../webpack://git-queue/./node_modules/@kwsites/promise-deferred/dist/index.js","../webpack://git-queue/./node_modules/debug/src/browser.js","../webpack://git-queue/./node_modules/debug/src/common.js","../webpack://git-queue/./node_modules/debug/src/index.js","../webpack://git-queue/./node_modules/debug/src/node.js","../webpack://git-queue/./node_modules/has-flag/index.js","../webpack://git-queue/./node_modules/ms/index.js","../webpack://git-queue/./node_modules/simple-git/dist/cjs/index.js","../webpack://git-queue/./node_modules/supports-color/index.js","../webpack://git-queue/./node_modules/tunnel/index.js","../webpack://git-queue/./node_modules/tunnel/lib/tunnel.js","../webpack://git-queue/external node-commonjs \"assert\"","../webpack://git-queue/external node-commonjs \"child_process\"","../webpack://git-queue/external node-commonjs \"events\"","../webpack://git-queue/external node-commonjs \"fs\"","../webpack://git-queue/external node-commonjs \"http\"","../webpack://git-queue/external node-commonjs \"https\"","../webpack://git-queue/external node-commonjs \"net\"","../webpack://git-queue/external node-commonjs \"os\"","../webpack://git-queue/external node-commonjs \"path\"","../webpack://git-queue/external node-commonjs \"tls\"","../webpack://git-queue/external node-commonjs \"tty\"","../webpack://git-queue/external node-commonjs \"util\"","../webpack://git-queue/webpack/bootstrap","../webpack://git-queue/webpack/runtime/compat","../webpack://git-queue/webpack/before-startup","../webpack://git-queue/webpack/startup","../webpack://git-queue/webpack/after-startup"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullCommitAuthor = exports.CommitAuthor = void 0;\nconst email_address_1 = require(\"./email-address\");\nconst NO_AUTHOR_NAME = '--no-author--';\nconst NO_AUTHOR_EMAIL = 'no-author@no-author.com';\nclass CommitAuthor {\n constructor(emailAddress) {\n this.emailAddress = emailAddress;\n }\n static fromEmailAddressString(emailAddress) {\n return new CommitAuthor(new email_address_1.EmailAddress(emailAddress));\n }\n static fromNameAndEmail(name, email) {\n return new CommitAuthor(email_address_1.EmailAddress.fromDisplayNameAndEmail(name, email));\n }\n getName() {\n return this.emailAddress.getDisplayName();\n }\n getEmail() {\n return this.emailAddress.getEmail();\n }\n toString() {\n return this.emailAddress.toString();\n }\n isNull() {\n return (this.getName() === NO_AUTHOR_NAME && this.getEmail() === NO_AUTHOR_EMAIL);\n }\n}\nexports.CommitAuthor = CommitAuthor;\nfunction nullCommitAuthor() {\n return CommitAuthor.fromNameAndEmail(NO_AUTHOR_NAME, NO_AUTHOR_EMAIL);\n}\nexports.nullCommitAuthor = nullCommitAuthor;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitBody = void 0;\nclass CommitBody {\n constructor(text) {\n this.text = text;\n }\n static fromMessage(message) {\n return new CommitBody(message.getPayload());\n }\n toString() {\n return this.text;\n }\n equalsTo(other) {\n return this.text === other.text;\n }\n}\nexports.CommitBody = CommitBody;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullCommitHash = exports.CommitHash = void 0;\nclass CommitHash {\n constructor(value) {\n // TODO: validation\n this.value = value;\n }\n getHash() {\n return this.value;\n }\n isNull() {\n return this.value === '';\n }\n equalsTo(other) {\n return this.value === other.value;\n }\n toString() {\n return this.value;\n }\n}\nexports.CommitHash = CommitHash;\nfunction nullCommitHash() {\n return new CommitHash('');\n}\nexports.nullCommitHash = nullCommitHash;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullCommitInfo = exports.CommitInfo = void 0;\nconst commit_hash_1 = require(\"./commit-hash\");\nclass CommitInfo {\n constructor(hash, date, message, refs, body, authorName, authorEmail) {\n this.hash = hash;\n this.date = date;\n this.message = message;\n this.refs = refs;\n this.body = body;\n this.authorName = authorName;\n this.authorEmail = authorEmail;\n }\n static fromDefaultLogFields(defaultLogFields) {\n return new CommitInfo(new commit_hash_1.CommitHash(defaultLogFields.hash), defaultLogFields.date, defaultLogFields.message, defaultLogFields.refs, defaultLogFields.body, defaultLogFields.author_name, defaultLogFields.author_email);\n }\n equalsTo(other) {\n return (this.hash.equalsTo(other.hash) &&\n this.date === other.date &&\n this.message === other.message &&\n this.refs === other.refs &&\n this.body === other.body &&\n this.authorName === other.authorName &&\n this.authorEmail === other.authorEmail);\n }\n}\nexports.CommitInfo = CommitInfo;\nfunction nullCommitInfo() {\n return new CommitInfo((0, commit_hash_1.nullCommitHash)(), '', '', '', '', '', '');\n}\nexports.nullCommitInfo = nullCommitInfo;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitMessage = void 0;\nconst commit_body_1 = require(\"./commit-body\");\nconst commit_subject_parser_1 = require(\"./commit-subject-parser\");\nclass CommitMessage {\n constructor(subject, body) {\n this.subject = subject;\n this.body = body;\n }\n static fromText(subject, body) {\n return new CommitMessage(commit_subject_parser_1.CommitSubjectParser.parseText(subject), new commit_body_1.CommitBody(body));\n }\n equalsTo(other) {\n return (this.subject.equalsTo(other.subject) && this.body.equalsTo(other.body));\n }\n forSimpleGit() {\n return [this.subject.toString(), this.body.toString()];\n }\n}\nexports.CommitMessage = CommitMessage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitOptions = void 0;\nclass CommitOptions {\n constructor(author, gpgSig, noGpgSig) {\n this.author = author;\n this.gpgSig = gpgSig;\n this.noGpgSig = noGpgSig;\n }\n forSimpleGit() {\n return Object.assign(Object.assign(Object.assign({ '--allow-empty': null }, (!this.author.isNull() && {\n '--author': `\"${this.author.toString()}\"`\n })), (!this.gpgSig.isNull() && {\n '--gpg-sign': this.gpgSig.toString()\n })), (this.noGpgSig && { '--no-gpg-sign': null }));\n }\n toString() {\n const allowEmpty = '--allow-empty';\n const author = this.author.isNull()\n ? ''\n : `--author=\"${this.author.toString()}\"`;\n const gpgSig = this.gpgSig.isNull()\n ? ''\n : `--gpg-sign=${this.gpgSig.toString()}`;\n const noGpgSig = this.noGpgSig ? '--no-gpg-sign' : '';\n return `${allowEmpty} ${author} ${gpgSig} ${noGpgSig}`;\n }\n}\nexports.CommitOptions = CommitOptions;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitSubjectParser = exports.commitSubjectBelongsToAQueue = exports.COMMIT_SUBJECT_JOB_REF_PREFIX = exports.COMMIT_SUBJECT_DELIMITER = exports.COMMIT_SUBJECT_PREFIX = void 0;\nconst errors_1 = require(\"./errors\");\nconst commit_hash_1 = require(\"./commit-hash\");\nconst commit_subject_1 = require(\"./commit-subject\");\nconst message_key_1 = require(\"./message-key\");\nconst queue_name_1 = require(\"./queue-name\");\nexports.COMMIT_SUBJECT_PREFIX = '📝';\nexports.COMMIT_SUBJECT_DELIMITER = ':';\nexports.COMMIT_SUBJECT_JOB_REF_PREFIX = 'job.ref.';\nfunction commitSubjectBelongsToAQueue(subject) {\n return CommitSubjectParser.commitSubjectBelongsToAQueue(subject);\n}\nexports.commitSubjectBelongsToAQueue = commitSubjectBelongsToAQueue;\nclass CommitSubjectParser {\n constructor(text) {\n this.text = text;\n }\n static commitSubjectBelongsToAQueue(subject) {\n return subject.startsWith(exports.COMMIT_SUBJECT_PREFIX);\n }\n static parseText(text) {\n const parser = new CommitSubjectParser(text);\n return new commit_subject_1.CommitSubject(parser.getMessageKey(), parser.getQueueName(), parser.getJobRef());\n }\n static toText(commitSubject) {\n const jobRef = commitSubject.getJobRef().isNull()\n ? ''\n : `${exports.COMMIT_SUBJECT_DELIMITER} ${exports.COMMIT_SUBJECT_JOB_REF_PREFIX}${commitSubject\n .getJobRef()\n .toString()}`;\n return `${exports.COMMIT_SUBJECT_PREFIX}${commitSubject\n .getMessageKey()\n .toString()}${exports.COMMIT_SUBJECT_DELIMITER} ${commitSubject\n .getQueueName()\n .toString()}${jobRef}`;\n }\n getQueueName() {\n const parts = this.text.split(exports.COMMIT_SUBJECT_DELIMITER);\n if (parts[1] === undefined) {\n throw new errors_1.MissingQueueNameInCommitSubjectError(this.text);\n }\n const queueName = parts[1].trim();\n if (queueName === '') {\n throw new errors_1.MissingQueueNameInCommitSubjectError(this.text);\n }\n return new queue_name_1.QueueName(parts[1].trim());\n }\n getMessageKey() {\n const queuePrefix = this.text.indexOf(exports.COMMIT_SUBJECT_PREFIX);\n const colonPos = this.text.indexOf(exports.COMMIT_SUBJECT_DELIMITER);\n const messageKey = this.text.substring(queuePrefix + exports.COMMIT_SUBJECT_PREFIX.length, colonPos);\n if (messageKey === '') {\n throw new errors_1.MissingMessageKeyInCommitSubjectError(this.text);\n }\n return new message_key_1.MessageKey(this.text.substring(queuePrefix + exports.COMMIT_SUBJECT_PREFIX.length, colonPos));\n }\n getJobRef() {\n const jobRef = this.text.indexOf(exports.COMMIT_SUBJECT_JOB_REF_PREFIX);\n const commitHash = this.text\n .substring(jobRef + exports.COMMIT_SUBJECT_JOB_REF_PREFIX.length)\n .trim();\n if (commitHash === '') {\n throw new errors_1.MissingCommitHashInJobReferenceError(this.text);\n }\n return new commit_hash_1.CommitHash(commitHash);\n }\n}\nexports.CommitSubjectParser = CommitSubjectParser;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommitSubject = void 0;\nconst commit_subject_parser_1 = require(\"./commit-subject-parser\");\n/* The first line of a commit message.\n * Format: {COMMIT_SUBJECT_PREFIX}{MESSAGE_KEY}: {QUEUE_NAME}: job.ref.{COMMIT_HASH}\n * Example: 📝✅: queue_name: job.ref.1e31b549c630f806961a291b4e3d4a1471f37490\n */\nclass CommitSubject {\n constructor(messageKey, queueName, jobRef) {\n this.messageKey = messageKey;\n this.queueName = queueName;\n this.jobRef = jobRef;\n }\n static fromMessageAndQueueName(message, queueName) {\n return new CommitSubject(message.getKey(), queueName, message.getJobRef());\n }\n toString() {\n return commit_subject_parser_1.CommitSubjectParser.toText(this);\n }\n equalsTo(other) {\n return this.toString() === other.toString();\n }\n belongsToQueue(queueName) {\n return this.queueName.equalsTo(queueName);\n }\n getMessageKey() {\n return this.messageKey;\n }\n getQueueName() {\n return this.queueName;\n }\n getJobRef() {\n return this.jobRef;\n }\n}\nexports.CommitSubject = CommitSubject;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommittedMessageLog = void 0;\nconst committed_message_1 = require(\"./committed-message\");\nconst commit_info_1 = require(\"./commit-info\");\nconst commit_subject_parser_1 = require(\"./commit-subject-parser\");\n/**\n * A readonly list of ordered commit messages.\n * A memory version of `git log` command containing only queue commits.\n */\nclass CommittedMessageLog {\n constructor(messages) {\n this.messages = messages;\n }\n static filterQueueCommits(commits) {\n return commits.filter(commit => (0, commit_subject_parser_1.commitSubjectBelongsToAQueue)(commit.message));\n }\n static fromGitLogCommits(allCommits) {\n const onlyQueueCommits = this.filterQueueCommits(allCommits);\n const committedMessages = onlyQueueCommits.map(commit => committed_message_1.CommittedMessage.fromCommitInfo(commit_info_1.CommitInfo.fromDefaultLogFields(commit)));\n return new CommittedMessageLog(committedMessages);\n }\n getMessages() {\n return this.messages;\n }\n isEmpty() {\n return this.messages.length === 0;\n }\n getLatestMessage() {\n return this.isEmpty() ? (0, committed_message_1.nullMessage)() : this.messages[0];\n }\n findByCommit(commitHash) {\n const commits = this.messages.filter(message => message.commitHash().equalsTo(commitHash));\n if (commits.length === 0) {\n return (0, committed_message_1.nullMessage)();\n }\n return commits[0];\n }\n filterCommitsByQueue(queueName) {\n const filteredMessages = this.messages.filter(committedMessage => committedMessage.belongsToQueue(queueName));\n return new CommittedMessageLog(filteredMessages);\n }\n}\nexports.CommittedMessageLog = CommittedMessageLog;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullMessage = exports.JobFinishedCommittedMessage = exports.NewJobCommittedMessage = exports.NullCommittedMessage = exports.CommittedMessage = void 0;\nconst commit_info_1 = require(\"./commit-info\");\nconst commit_subject_parser_1 = require(\"./commit-subject-parser\");\nconst errors_1 = require(\"./errors\");\nclass CommittedMessage {\n constructor(commit) {\n this.commit = commit;\n }\n static fromCommitInfo(commit) {\n const messageKey = commit_subject_parser_1.CommitSubjectParser.parseText(commit.message).getMessageKey();\n switch (messageKey.toString()) {\n case '🈺': {\n return new NewJobCommittedMessage(commit);\n }\n case '✅': {\n return new JobFinishedCommittedMessage(commit);\n }\n }\n throw new errors_1.InvalidMessageKeyError(messageKey.toString());\n }\n commitInfo() {\n return this.commit;\n }\n commitHash() {\n return this.commit.hash;\n }\n commitSubject() {\n return commit_subject_parser_1.CommitSubjectParser.parseText(this.commit.message);\n }\n payload() {\n return this.commit.body.trim();\n }\n isNull() {\n return this instanceof NullCommittedMessage;\n }\n equalsTo(other) {\n return this.commit.equalsTo(other.commitInfo());\n }\n belongsToQueue(queueName) {\n return this.commitSubject().belongsToQueue(queueName);\n }\n}\nexports.CommittedMessage = CommittedMessage;\nclass NullCommittedMessage extends CommittedMessage {\n}\nexports.NullCommittedMessage = NullCommittedMessage;\nclass NewJobCommittedMessage extends CommittedMessage {\n}\nexports.NewJobCommittedMessage = NewJobCommittedMessage;\nclass JobFinishedCommittedMessage extends CommittedMessage {\n}\nexports.JobFinishedCommittedMessage = JobFinishedCommittedMessage;\nfunction nullMessage() {\n return new NullCommittedMessage((0, commit_info_1.nullCommitInfo)());\n}\nexports.nullMessage = nullMessage;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setOutput = exports.getInputs = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst command_1 = require(\"@actions/core/lib/command\");\nfunction getInputs() {\n return __awaiter(this, void 0, void 0, function* () {\n return {\n queueName: core.getInput('queue_name', { required: true }),\n action: core.getInput('action', { required: true }),\n jobPayload: core.getInput('job_payload', { required: false }),\n gitRepoDir: core.getInput('git_repo_dir', { required: false }),\n gitCommitAuthor: core.getInput('git_commit_author', { required: false }),\n gitCommitGpgSign: core.getInput('git_commit_gpg_sign', { required: false }),\n gitCommitNoGpgSign: core.getInput('git_commit_no_gpg_sign', { required: false }) === 'true'\n ? true\n : false\n };\n });\n}\nexports.getInputs = getInputs;\n// FIXME: Temp fix https://github.com/actions/toolkit/issues/777\nfunction setOutput(name, value) {\n (0, command_1.issueCommand)('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.emailIsValid = exports.EmailAddress = void 0;\n/*\n * Wrapper for RFC5322 email address.\n *\n * For example:\n *\n * A Committer \n * John Smith \n * committer@example.com\n *\n * For this app we only allow this formats:\n *\n * [NAME] \n * EMAIL\n *\n * NAME is optional.\n */\nclass EmailAddress {\n constructor(emailAddress) {\n this.displayName = this.extractDisplayName(emailAddress);\n this.email = this.extractEmail(emailAddress);\n if (!this.isValid(this.email)) {\n throw Error(`Invalid email: ${this.email}`);\n }\n }\n static fromDisplayNameAndEmail(displayName, email) {\n return new EmailAddress(`${displayName} <${email}>`);\n }\n getDisplayName() {\n return this.displayName;\n }\n getEmail() {\n return this.email;\n }\n toString() {\n if (this.displayName === '') {\n return this.email;\n }\n return `${this.displayName} <${this.email}>`;\n }\n extractDisplayName(emailAddress) {\n if (!this.containsDisplayName(emailAddress)) {\n return '';\n }\n const beginEmail = emailAddress.indexOf('<');\n const name = emailAddress.substring(0, beginEmail - 1);\n return name;\n }\n extractEmail(emailAddress) {\n if (!this.containsDisplayName(emailAddress)) {\n return emailAddress;\n }\n const firstChar = emailAddress.indexOf('<');\n const lastChar = emailAddress.indexOf('>');\n const email = emailAddress.substring(firstChar + 1, lastChar);\n return email;\n }\n isValid(email) {\n return emailIsValid(email);\n }\n containsDisplayName(emailAddress) {\n const firstChar = emailAddress.indexOf('<');\n const lastChar = emailAddress.indexOf('>');\n return firstChar !== -1 && lastChar !== -1;\n }\n}\nexports.EmailAddress = EmailAddress;\nfunction emailIsValid(email) {\n return /^(([^<>()[\\].,;:\\s@\"]+(\\.[^<>()[\\].,;:\\s@\"]+)*)|(\".+\"))@(([^<>().,;\\s@\"]+\\.{0,1})+([^<>().,;:\\s@\"]{2,}|[\\d.]+))$/.test(email);\n}\nexports.emailIsValid = emailIsValid;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getErrorMessage = void 0;\nfunction isErrorWithMessage(error) {\n return (typeof error === 'object' &&\n error !== null &&\n 'message' in error &&\n typeof error.message === 'string');\n}\nfunction toErrorWithMessage(maybeError) {\n if (isErrorWithMessage(maybeError))\n return maybeError;\n try {\n return new Error(JSON.stringify(maybeError));\n }\n catch (_a) {\n // fallback in case there's an error stringifying the maybeError\n // like with circular references for example.\n return new Error(String(maybeError));\n }\n}\nfunction getErrorMessage(error) {\n return toErrorWithMessage(error).message;\n}\nexports.getErrorMessage = getErrorMessage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GitDirNotInitializedError = exports.NoPendingJobsFoundError = exports.PendingJobsLimitReachedError = exports.InvalidMessageKeyError = exports.MissingCommitHashInJobReferenceError = exports.MissingMessageKeyInCommitSubjectError = exports.MissingQueueNameInCommitSubjectError = void 0;\nclass MissingQueueNameInCommitSubjectError extends Error {\n constructor(commitSubject) {\n super(`Missing queue name in commit subject: ${commitSubject}`);\n Object.setPrototypeOf(this, MissingQueueNameInCommitSubjectError.prototype);\n }\n}\nexports.MissingQueueNameInCommitSubjectError = MissingQueueNameInCommitSubjectError;\nclass MissingMessageKeyInCommitSubjectError extends Error {\n constructor(commitSubject) {\n super(`Missing message key in commit subject: ${commitSubject}`);\n Object.setPrototypeOf(this, MissingMessageKeyInCommitSubjectError.prototype);\n }\n}\nexports.MissingMessageKeyInCommitSubjectError = MissingMessageKeyInCommitSubjectError;\nclass MissingCommitHashInJobReferenceError extends Error {\n constructor(commitSubject) {\n super(`Missing commit hash in job reference in commit subject: ${commitSubject}`);\n Object.setPrototypeOf(this, MissingMessageKeyInCommitSubjectError.prototype);\n }\n}\nexports.MissingCommitHashInJobReferenceError = MissingCommitHashInJobReferenceError;\nclass InvalidMessageKeyError extends Error {\n constructor(messageKey) {\n super(`Invalid message key: ${messageKey}`);\n Object.setPrototypeOf(this, InvalidMessageKeyError.prototype);\n }\n}\nexports.InvalidMessageKeyError = InvalidMessageKeyError;\nclass PendingJobsLimitReachedError extends Error {\n constructor(commitHash) {\n super(`Can't create a new job. There is already a pending job in commit: ${commitHash}`);\n Object.setPrototypeOf(this, PendingJobsLimitReachedError.prototype);\n }\n}\nexports.PendingJobsLimitReachedError = PendingJobsLimitReachedError;\nclass NoPendingJobsFoundError extends Error {\n constructor(queueName) {\n super(`Can't mark job as finished. There isn't any pending job in queue: ${queueName}`);\n Object.setPrototypeOf(this, NoPendingJobsFoundError.prototype);\n }\n}\nexports.NoPendingJobsFoundError = NoPendingJobsFoundError;\nclass GitDirNotInitializedError extends Error {\n constructor(dir) {\n super(`Git dir: ${dir} has not been initialized`);\n Object.setPrototypeOf(this, GitDirNotInitializedError.prototype);\n }\n}\nexports.GitDirNotInitializedError = GitDirNotInitializedError;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GitRepoDir = void 0;\nclass GitRepoDir {\n constructor(dirPath) {\n // TODO: validate dir path\n this.dirPath = dirPath;\n }\n getDirPath() {\n return this.dirPath;\n }\n equalsTo(other) {\n return this.dirPath === other.dirPath;\n }\n}\nexports.GitRepoDir = GitRepoDir;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GitRepo = void 0;\nclass GitRepo {\n constructor(dir, git) {\n this.dir = dir;\n this.git = git;\n }\n isInitialized() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.git.checkIsRepo();\n });\n }\n getDir() {\n return this.dir;\n }\n getDirPath() {\n return this.dir.getDirPath();\n }\n init() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.git.init();\n });\n }\n env(name, value) {\n this.git.env(name, value);\n }\n getCurrentBranch() {\n return __awaiter(this, void 0, void 0, function* () {\n const status = yield this.git.status();\n return status.current;\n });\n }\n log() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.git.log();\n });\n }\n hasCommits() {\n return __awaiter(this, void 0, void 0, function* () {\n // TODO: find a better way to check if the repo has commits\n const currentBranch = yield this.getCurrentBranch();\n try {\n yield this.log();\n }\n catch (err) {\n if (err.message.includes(`fatal: your current branch '${currentBranch}' does not have any commits yet`)) {\n // No commits yet\n return false;\n }\n else {\n throw err;\n }\n }\n return true;\n });\n }\n commit(commitMessage, commitOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield this.git.commit(commitMessage.forSimpleGit(), commitOptions.forSimpleGit());\n });\n }\n}\nexports.GitRepo = GitRepo;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getGnupgHome = void 0;\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst getGnupgHome = () => __awaiter(void 0, void 0, void 0, function* () {\n if (process.env.GNUPGHOME) {\n return process.env.GNUPGHOME;\n }\n let homedir = path.join(process.env.HOME || '', '.gnupg');\n if (os.platform() === 'win32' && !process.env.HOME) {\n homedir = path.join(process.env.USERPROFILE || '', '.gnupg');\n }\n return homedir;\n});\nexports.getGnupgHome = getGnupgHome;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst context = __importStar(require(\"./context\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst commit_author_1 = require(\"./commit-author\");\nconst signing_key_id_1 = require(\"./signing-key-id\");\nconst commit_options_1 = require(\"./commit-options\");\nconst git_repo_1 = require(\"./git-repo\");\nconst git_repo_dir_1 = require(\"./git-repo-dir\");\nconst queue_1 = require(\"./queue\");\nconst queue_name_1 = require(\"./queue-name\");\nconst simple_git_factory_1 = require(\"./simple-git-factory\");\nconst error_1 = require(\"./error\");\nconst gpg_env_1 = require(\"./gpg-env\");\nconst ACTION_CREATE_JOB = 'create-job';\nconst ACTION_NEXT_JOB = 'next-job';\nconst ACTION_FINISH_JOB = 'finish-job';\nfunction actionOptions() {\n const options = [ACTION_CREATE_JOB, ACTION_NEXT_JOB, ACTION_FINISH_JOB];\n return options.join(', ');\n}\nfunction getCommitAuthorFromInputs(commitAuthor) {\n return __awaiter(this, void 0, void 0, function* () {\n if (commitAuthor) {\n return commit_author_1.CommitAuthor.fromEmailAddressString(commitAuthor);\n }\n return (0, commit_author_1.nullCommitAuthor)();\n });\n}\nfunction getSigningKeyIdFromInputs(signingKeyId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (signingKeyId) {\n return new signing_key_id_1.SigningKeyId(signingKeyId);\n }\n return (0, signing_key_id_1.nullSigningKeyId)();\n });\n}\nfunction getGitRepoDirFromInputs(gitRepoDir, cwd) {\n return __awaiter(this, void 0, void 0, function* () {\n if (gitRepoDir !== '') {\n return new git_repo_dir_1.GitRepoDir(gitRepoDir);\n }\n return new git_repo_dir_1.GitRepoDir(cwd);\n });\n}\nfunction getCommitOptionsFromInputs(inputs) {\n return __awaiter(this, void 0, void 0, function* () {\n const author = yield getCommitAuthorFromInputs(inputs.gitCommitAuthor);\n const gpgSign = yield getSigningKeyIdFromInputs(inputs.gitCommitGpgSign);\n const noGpgSig = inputs.gitCommitNoGpgSign;\n return new commit_options_1.CommitOptions(author, gpgSign, noGpgSig);\n });\n}\nfunction printDebugInfo(gitRepoDir, gnuPGHomeDir) {\n return __awaiter(this, void 0, void 0, function* () {\n yield core.group(`Debug info`, () => __awaiter(this, void 0, void 0, function* () {\n core.info(`git_repo_dir: ${gitRepoDir.getDirPath()}`);\n core.info(`gnupg_home_dir: ${gnuPGHomeDir}`);\n }));\n });\n}\nfunction run() {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const inputs = yield context.getInputs();\n const gitRepoDir = yield getGitRepoDirFromInputs(inputs.gitRepoDir, process.cwd());\n const commitOptions = yield getCommitOptionsFromInputs(inputs);\n const gnuPGHomeDir = yield (0, gpg_env_1.getGnupgHome)();\n yield printDebugInfo(gitRepoDir, gnuPGHomeDir);\n const git = yield (0, simple_git_factory_1.createGitInstance)(gitRepoDir);\n const gitRepo = new git_repo_1.GitRepo(gitRepoDir, git);\n const queue = yield queue_1.Queue.create(new queue_name_1.QueueName(inputs.queueName), gitRepo, commitOptions);\n switch (inputs.action) {\n case ACTION_CREATE_JOB: {\n const createJobCommit = yield queue.createJob(inputs.jobPayload);\n yield core.group(`Setting outputs`, () => __awaiter(this, void 0, void 0, function* () {\n context.setOutput('job_created', true);\n context.setOutput('job_commit', createJobCommit.hash.toString());\n core.info(`job_created: true`);\n core.info(`job_commit: ${createJobCommit.hash}`);\n }));\n break;\n }\n case ACTION_NEXT_JOB: {\n const nextJob = queue.getNextJob();\n yield core.group(`Setting outputs`, () => __awaiter(this, void 0, void 0, function* () {\n context.setOutput('job_found', !nextJob.isNull());\n if (!nextJob.isNull()) {\n context.setOutput('job_commit', nextJob.commitHash().toString());\n context.setOutput('job_payload', nextJob.payload());\n core.info(`job_commit: ${nextJob.commitHash()}`);\n core.info(`job_payload: ${nextJob.payload()}`);\n }\n }));\n break;\n }\n case ACTION_FINISH_JOB: {\n const markJobAsFinishedCommit = yield queue.markJobAsFinished(inputs.jobPayload);\n yield core.group(`Setting outputs`, () => __awaiter(this, void 0, void 0, function* () {\n context.setOutput('job_finished', true);\n context.setOutput('job_commit', markJobAsFinishedCommit.hash.toString());\n core.info(`job_finished: true`);\n core.info(`job_commit: ${markJobAsFinishedCommit.hash}`);\n }));\n break;\n }\n default: {\n core.error(`Invalid action. Actions can only be: ${actionOptions()}`);\n }\n }\n }\n catch (error) {\n core.setFailed((0, error_1.getErrorMessage)(error));\n }\n });\n}\nrun();\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MessageKey = void 0;\nclass MessageKey {\n constructor(id) {\n this.id = id;\n }\n equalsTo(other) {\n return this.id === other.id;\n }\n toString() {\n return this.id;\n }\n}\nexports.MessageKey = MessageKey;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.JobFinishedMessage = exports.NewJobMessage = exports.Message = void 0;\nconst commit_hash_1 = require(\"./commit-hash\");\nconst message_key_1 = require(\"./message-key\");\nclass Message {\n constructor(payload, jobRef = (0, commit_hash_1.nullCommitHash)()) {\n this.payload = payload;\n this.jobRef = jobRef;\n }\n getPayload() {\n return this.payload;\n }\n getJobRef() {\n return this.jobRef;\n }\n hasJobRef() {\n return !this.jobRef.isNull();\n }\n}\nexports.Message = Message;\nclass NewJobMessage extends Message {\n getKey() {\n return new message_key_1.MessageKey('🈺');\n }\n}\nexports.NewJobMessage = NewJobMessage;\nclass JobFinishedMessage extends Message {\n getKey() {\n return new message_key_1.MessageKey('✅');\n }\n}\nexports.JobFinishedMessage = JobFinishedMessage;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullQueueName = exports.QueueName = void 0;\nclass QueueName {\n constructor(value) {\n // TODO: validation. Issue -> https://github.com/Nautilus-Cyberneering/git-queue/issues/39\n this.value = value;\n }\n isNull() {\n return this.value === '';\n }\n equalsTo(other) {\n return this.value === other.value;\n }\n toString() {\n return this.value;\n }\n}\nexports.QueueName = QueueName;\nfunction nullQueueName() {\n return new QueueName('');\n}\nexports.nullQueueName = nullQueueName;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Queue = void 0;\nconst committed_message_1 = require(\"./committed-message\");\nconst errors_1 = require(\"./errors\");\nconst message_1 = require(\"./message\");\nconst commit_body_1 = require(\"./commit-body\");\nconst commit_hash_1 = require(\"./commit-hash\");\nconst commit_message_1 = require(\"./commit-message\");\nconst commit_subject_1 = require(\"./commit-subject\");\nconst committed_message_log_1 = require(\"./committed-message-log\");\nclass Queue {\n constructor(name, gitRepo, commitOptions) {\n this.name = name;\n this.gitRepo = gitRepo;\n this.commitOptions = commitOptions;\n this.committedMessages = committed_message_log_1.CommittedMessageLog.fromGitLogCommits([]);\n }\n static create(name, gitRepo, commitOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n const queue = new Queue(name, gitRepo, commitOptions);\n yield queue.loadMessagesFromGit();\n return queue;\n });\n }\n guardThatGitRepoHasBeenInitialized() {\n return __awaiter(this, void 0, void 0, function* () {\n const isInitialized = yield this.gitRepo.isInitialized();\n if (!isInitialized) {\n throw new errors_1.GitDirNotInitializedError(this.gitRepo.getDirPath());\n }\n });\n }\n guardThatThereAreNoPendingJobs() {\n if (!this.getNextJob().isNull()) {\n throw new errors_1.PendingJobsLimitReachedError(this.getNextJob().commitHash().toString());\n }\n }\n guardThatThereIsAPendingJob() {\n const pendingJob = this.getNextJob();\n if (pendingJob.isNull()) {\n throw new errors_1.NoPendingJobsFoundError(this.name.toString());\n }\n return pendingJob;\n }\n loadMessagesFromGit() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.guardThatGitRepoHasBeenInitialized();\n const noCommits = !(yield this.gitRepo.hasCommits()) ? true : false;\n if (noCommits) {\n return;\n }\n const logCommits = yield this.gitRepo.log();\n const allMessages = committed_message_log_1.CommittedMessageLog.fromGitLogCommits(logCommits.all);\n this.committedMessages = allMessages.filterCommitsByQueue(this.name);\n });\n }\n commitMessage(message) {\n return __awaiter(this, void 0, void 0, function* () {\n const commitMessage = this.buildCommitMessage(message);\n const commitResult = yield this.gitRepo.commit(commitMessage, this.commitOptions);\n yield this.loadMessagesFromGit();\n const committedMessage = this.findCommittedMessageByCommit(new commit_hash_1.CommitHash(commitResult.commit));\n return committedMessage.commitInfo();\n });\n }\n buildCommitMessage(message) {\n return new commit_message_1.CommitMessage(commit_subject_1.CommitSubject.fromMessageAndQueueName(message, this.name), commit_body_1.CommitBody.fromMessage(message));\n }\n getName() {\n return this.name;\n }\n getGitRepoDir() {\n return this.gitRepo.getDir();\n }\n getMessages() {\n return this.committedMessages.getMessages();\n }\n getLatestMessage() {\n return this.committedMessages.getLatestMessage();\n }\n isEmpty() {\n return this.committedMessages.isEmpty();\n }\n getNextJob() {\n const latestMessage = this.getLatestMessage();\n return latestMessage instanceof committed_message_1.NewJobCommittedMessage\n ? latestMessage\n : (0, committed_message_1.nullMessage)();\n }\n findCommittedMessageByCommit(commitHash) {\n return this.committedMessages.findByCommit(commitHash);\n }\n createJob(payload) {\n return __awaiter(this, void 0, void 0, function* () {\n this.guardThatThereAreNoPendingJobs();\n const message = new message_1.NewJobMessage(payload);\n return this.commitMessage(message);\n });\n }\n markJobAsFinished(payload) {\n return __awaiter(this, void 0, void 0, function* () {\n const pendingJob = this.guardThatThereIsAPendingJob();\n const message = new message_1.JobFinishedMessage(payload, pendingJob.commitHash());\n return this.commitMessage(message);\n });\n }\n}\nexports.Queue = Queue;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.nullSigningKeyId = exports.SigningKeyId = void 0;\nclass SigningKeyId {\n constructor(id) {\n this.id = id;\n }\n equalsTo(other) {\n return this.id === other.id;\n }\n toString() {\n return this.id;\n }\n isNull() {\n return this.id === '';\n }\n}\nexports.SigningKeyId = SigningKeyId;\nfunction nullSigningKeyId() {\n return new SigningKeyId('');\n}\nexports.nullSigningKeyId = nullSigningKeyId;\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createGitInstance = void 0;\nconst simple_git_1 = __importDefault(require(\"simple-git\"));\nfunction getGitConfig(key, git) {\n return __awaiter(this, void 0, void 0, function* () {\n const option = yield git.getConfig(key);\n if (option.value) {\n return option.value;\n }\n return null;\n });\n}\nfunction createGitInstance(gitRepoDir) {\n return __awaiter(this, void 0, void 0, function* () {\n const git = (0, simple_git_1.default)(gitRepoDir.getDirPath());\n /*\n * We need to pass the env vars to the child git process\n * because the user might want to use some env vars like:\n *\n * For GPG:\n * GNUPGHOME\n *\n * For git commit:\n * GIT_AUTHOR_NAME\n * GIT_AUTHOR_EMAIL\n * GIT_AUTHOR_DATE\n * GIT_COMMITTER_NAME\n * GIT_COMMITTER_EMAIL\n * GIT_COMMITTER_DATE\n *\n * TODO: Code review. Should we pass only the env vars used by git commit?\n */\n git.env(process.env);\n /*\n * It seems the `git` child process does not apply the global git config,\n * at least for the `git commit` command. You have to overwrite local config with the global.\n */\n const userName = yield getGitConfig('user.name', git);\n if (userName) {\n git.addConfig('user.name', userName);\n }\n const userEmail = yield getGitConfig('user.email', git);\n if (userEmail) {\n git.addConfig('user.email', userEmail);\n }\n const userSigningkey = yield getGitConfig('user.signingkey', git);\n if (userSigningkey) {\n git.addConfig('user.signingkey', userSigningkey);\n }\n const commitGpgsign = yield getGitConfig('commit.gpgsign', git);\n if (commitGpgsign) {\n git.addConfig('commit.gpgsign', commitGpgsign);\n }\n return git;\n });\n}\nexports.createGitInstance = createGitInstance;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n options.headers['Authorization'] =\n 'Basic ' +\n Buffer.from(this.username + ':' + this.password).toString('base64');\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n options.headers['Authorization'] =\n 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst http = require(\"http\");\nconst https = require(\"https\");\nconst pm = require(\"./proxy\");\nlet tunnel;\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return new Promise(async (resolve, reject) => {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n let parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n }\n get(requestUrl, additionalHeaders) {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n }\n del(requestUrl, additionalHeaders) {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n }\n post(requestUrl, data, additionalHeaders) {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n }\n patch(requestUrl, data, additionalHeaders) {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n }\n put(requestUrl, data, additionalHeaders) {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n }\n head(requestUrl, additionalHeaders) {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n async getJson(requestUrl, additionalHeaders = {}) {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n let res = await this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async postJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async putJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async patchJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n async request(verb, requestUrl, data, headers) {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n let parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n while (numTries < maxTries) {\n response = await this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (let i = 0; i < this.handlers.length; i++) {\n if (this.handlers[i].canHandleAuthentication(response)) {\n authenticationHandler = this.handlers[i];\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n let parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol == 'https:' &&\n parsedUrl.protocol != parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n await response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (let header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = await this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n await response.readBody();\n await this._performExponentialBackoff(numTries);\n }\n }\n return response;\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return new Promise((resolve, reject) => {\n let callbackForResult = function (err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n };\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof data === 'string') {\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n let parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n this.handlers.forEach(handler => {\n handler.prepareRequest(info.options);\n });\n }\n return info;\n }\n _mergeHeaders(headers) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n let proxyUrl = pm.getProxyUrl(parsedUrl);\n let useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (!!agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (!!this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n if (useProxy) {\n // If using proxy, need tunnel\n if (!tunnel) {\n tunnel = require('tunnel');\n }\n const agentOptions = {\n maxSockets: maxSockets,\n keepAlive: this._keepAlive,\n proxy: {\n ...((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n }),\n host: proxyUrl.hostname,\n port: proxyUrl.port\n }\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n }\n static dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n let a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n async _processResponse(res, options) {\n return new Promise(async (resolve, reject) => {\n const statusCode = res.message.statusCode;\n const response = {\n statusCode: statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode == HttpCodes.NotFound) {\n resolve(response);\n }\n let obj;\n let contents;\n // get the result from the body\n try {\n contents = await res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = 'Failed request: (' + statusCode + ')';\n }\n let err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n });\n }\n}\nexports.HttpClient = HttpClient;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getProxyUrl(reqUrl) {\n let usingSsl = reqUrl.protocol === 'https:';\n let proxyUrl;\n if (checkBypass(reqUrl)) {\n return proxyUrl;\n }\n let proxyVar;\n if (usingSsl) {\n proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n if (proxyVar) {\n proxyUrl = new URL(proxyVar);\n }\n return proxyUrl;\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n let upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (let upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__export(require(\"./src\"));\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs_1 = require(\"fs\");\nconst debug_1 = __importDefault(require(\"debug\"));\nconst log = debug_1.default('@kwsites/file-exists');\nfunction check(path, isFile, isDirectory) {\n log(`checking %s`, path);\n try {\n const stat = fs_1.statSync(path);\n if (stat.isFile() && isFile) {\n log(`[OK] path represents a file`);\n return true;\n }\n if (stat.isDirectory() && isDirectory) {\n log(`[OK] path represents a directory`);\n return true;\n }\n log(`[FAIL] path represents something other than a file or directory`);\n return false;\n }\n catch (e) {\n if (e.code === 'ENOENT') {\n log(`[FAIL] path is not accessible: %o`, e);\n return false;\n }\n log(`[FATAL] %o`, e);\n throw e;\n }\n}\n/**\n * Synchronous validation of a path existing either as a file or as a directory.\n *\n * @param {string} path The path to check\n * @param {number} type One or both of the exported numeric constants\n */\nfunction exists(path, type = exports.READABLE) {\n return check(path, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);\n}\nexports.exists = exists;\n/**\n * Constant representing a file\n */\nexports.FILE = 1;\n/**\n * Constant representing a folder\n */\nexports.FOLDER = 2;\n/**\n * Constant representing either a file or a folder\n */\nexports.READABLE = exports.FILE + exports.FOLDER;\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createDeferred = exports.deferred = void 0;\n/**\n * Creates a new `DeferredPromise`\n *\n * ```typescript\n import {deferred} from '@kwsites/promise-deferred`;\n ```\n */\nfunction deferred() {\n let done;\n let fail;\n let status = 'pending';\n const promise = new Promise((_done, _fail) => {\n done = _done;\n fail = _fail;\n });\n return {\n promise,\n done(result) {\n if (status === 'pending') {\n status = 'resolved';\n done(result);\n }\n },\n fail(error) {\n if (status === 'pending') {\n status = 'rejected';\n fail(error);\n }\n },\n get fulfilled() {\n return status !== 'pending';\n },\n get status() {\n return status;\n },\n };\n}\nexports.deferred = deferred;\n/**\n * Alias of the exported `deferred` function, to help consumers wanting to use `deferred` as the\n * local variable name rather than the factory import name, without needing to rename on import.\n *\n * ```typescript\n import {createDeferred} from '@kwsites/promise-deferred`;\n ```\n */\nexports.createDeferred = deferred;\n/**\n * Default export allows use as:\n *\n * ```typescript\n import deferred from '@kwsites/promise-deferred`;\n ```\n */\nexports.default = deferred;\n//# sourceMappingURL=index.js.map","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\t\tlet namespacesCache;\n\t\tlet enabledCache;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => {\n\t\t\t\tif (enableOverride !== null) {\n\t\t\t\t\treturn enableOverride;\n\t\t\t\t}\n\t\t\t\tif (namespacesCache !== createDebug.namespaces) {\n\t\t\t\t\tnamespacesCache = createDebug.namespaces;\n\t\t\t\t\tenabledCache = createDebug.enabled(namespace);\n\t\t\t\t}\n\n\t\t\t\treturn enabledCache;\n\t\t\t},\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\t\tcreateDebug.namespaces = namespaces;\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","/**\n * Detect Electron renderer / nwjs process, which is node, but we should\n * treat as a browser.\n */\n\nif (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {\n\tmodule.exports = require('./browser.js');\n} else {\n\tmodule.exports = require('./node.js');\n}\n","/**\n * Module dependencies.\n */\n\nconst tty = require('tty');\nconst util = require('util');\n\n/**\n * This is the Node.js implementation of `debug()`.\n */\n\nexports.init = init;\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.destroy = util.deprecate(\n\t() => {},\n\t'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'\n);\n\n/**\n * Colors.\n */\n\nexports.colors = [6, 2, 3, 4, 5, 1];\n\ntry {\n\t// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)\n\t// eslint-disable-next-line import/no-extraneous-dependencies\n\tconst supportsColor = require('supports-color');\n\n\tif (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {\n\t\texports.colors = [\n\t\t\t20,\n\t\t\t21,\n\t\t\t26,\n\t\t\t27,\n\t\t\t32,\n\t\t\t33,\n\t\t\t38,\n\t\t\t39,\n\t\t\t40,\n\t\t\t41,\n\t\t\t42,\n\t\t\t43,\n\t\t\t44,\n\t\t\t45,\n\t\t\t56,\n\t\t\t57,\n\t\t\t62,\n\t\t\t63,\n\t\t\t68,\n\t\t\t69,\n\t\t\t74,\n\t\t\t75,\n\t\t\t76,\n\t\t\t77,\n\t\t\t78,\n\t\t\t79,\n\t\t\t80,\n\t\t\t81,\n\t\t\t92,\n\t\t\t93,\n\t\t\t98,\n\t\t\t99,\n\t\t\t112,\n\t\t\t113,\n\t\t\t128,\n\t\t\t129,\n\t\t\t134,\n\t\t\t135,\n\t\t\t148,\n\t\t\t149,\n\t\t\t160,\n\t\t\t161,\n\t\t\t162,\n\t\t\t163,\n\t\t\t164,\n\t\t\t165,\n\t\t\t166,\n\t\t\t167,\n\t\t\t168,\n\t\t\t169,\n\t\t\t170,\n\t\t\t171,\n\t\t\t172,\n\t\t\t173,\n\t\t\t178,\n\t\t\t179,\n\t\t\t184,\n\t\t\t185,\n\t\t\t196,\n\t\t\t197,\n\t\t\t198,\n\t\t\t199,\n\t\t\t200,\n\t\t\t201,\n\t\t\t202,\n\t\t\t203,\n\t\t\t204,\n\t\t\t205,\n\t\t\t206,\n\t\t\t207,\n\t\t\t208,\n\t\t\t209,\n\t\t\t214,\n\t\t\t215,\n\t\t\t220,\n\t\t\t221\n\t\t];\n\t}\n} catch (error) {\n\t// Swallow - we only care if `supports-color` is available; it doesn't have to be.\n}\n\n/**\n * Build up the default `inspectOpts` object from the environment variables.\n *\n * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js\n */\n\nexports.inspectOpts = Object.keys(process.env).filter(key => {\n\treturn /^debug_/i.test(key);\n}).reduce((obj, key) => {\n\t// Camel-case\n\tconst prop = key\n\t\t.substring(6)\n\t\t.toLowerCase()\n\t\t.replace(/_([a-z])/g, (_, k) => {\n\t\t\treturn k.toUpperCase();\n\t\t});\n\n\t// Coerce string value into JS value\n\tlet val = process.env[key];\n\tif (/^(yes|on|true|enabled)$/i.test(val)) {\n\t\tval = true;\n\t} else if (/^(no|off|false|disabled)$/i.test(val)) {\n\t\tval = false;\n\t} else if (val === 'null') {\n\t\tval = null;\n\t} else {\n\t\tval = Number(val);\n\t}\n\n\tobj[prop] = val;\n\treturn obj;\n}, {});\n\n/**\n * Is stdout a TTY? Colored output is enabled when `true`.\n */\n\nfunction useColors() {\n\treturn 'colors' in exports.inspectOpts ?\n\t\tBoolean(exports.inspectOpts.colors) :\n\t\ttty.isatty(process.stderr.fd);\n}\n\n/**\n * Adds ANSI color escape codes if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\tconst {namespace: name, useColors} = this;\n\n\tif (useColors) {\n\t\tconst c = this.color;\n\t\tconst colorCode = '\\u001B[3' + (c < 8 ? c : '8;5;' + c);\n\t\tconst prefix = ` ${colorCode};1m${name} \\u001B[0m`;\n\n\t\targs[0] = prefix + args[0].split('\\n').join('\\n' + prefix);\n\t\targs.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\\u001B[0m');\n\t} else {\n\t\targs[0] = getDate() + name + ' ' + args[0];\n\t}\n}\n\nfunction getDate() {\n\tif (exports.inspectOpts.hideDate) {\n\t\treturn '';\n\t}\n\treturn new Date().toISOString() + ' ';\n}\n\n/**\n * Invokes `util.format()` with the specified arguments and writes to stderr.\n */\n\nfunction log(...args) {\n\treturn process.stderr.write(util.format(...args) + '\\n');\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\tif (namespaces) {\n\t\tprocess.env.DEBUG = namespaces;\n\t} else {\n\t\t// If you set a process.env field to null or undefined, it gets cast to the\n\t\t// string 'null' or 'undefined'. Just delete instead.\n\t\tdelete process.env.DEBUG;\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n\treturn process.env.DEBUG;\n}\n\n/**\n * Init logic for `debug` instances.\n *\n * Create a new `inspectOpts` object in case `useColors` is set\n * differently for a particular `debug` instance.\n */\n\nfunction init(debug) {\n\tdebug.inspectOpts = {};\n\n\tconst keys = Object.keys(exports.inspectOpts);\n\tfor (let i = 0; i < keys.length; i++) {\n\t\tdebug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %o to `util.inspect()`, all on a single line.\n */\n\nformatters.o = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts)\n\t\t.split('\\n')\n\t\t.map(str => str.trim())\n\t\t.join(' ');\n};\n\n/**\n * Map %O to `util.inspect()`, allowing multiple lines if needed.\n */\n\nformatters.O = function (v) {\n\tthis.inspectOpts.colors = this.useColors;\n\treturn util.inspect(v, this.inspectOpts);\n};\n","'use strict';\n\nmodule.exports = (flag, argv = process.argv) => {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n};\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __markAsModule = (target) => __defProp(target, \"__esModule\", { value: true });\nvar __esm = (fn, res) => function __init() {\n return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __reExport = (target, module2, copyDefault, desc) => {\n if (module2 && typeof module2 === \"object\" || typeof module2 === \"function\") {\n for (let key of __getOwnPropNames(module2))\n if (!__hasOwnProp.call(target, key) && (copyDefault || key !== \"default\"))\n __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });\n }\n return target;\n};\nvar __toESM = (module2, isNodeMode) => {\n return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, \"default\", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);\n};\nvar __toCommonJS = /* @__PURE__ */ ((cache) => {\n return (module2, temp) => {\n return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);\n };\n})(typeof WeakMap !== \"undefined\" ? /* @__PURE__ */ new WeakMap() : 0);\nvar __async = (__this, __arguments, generator) => {\n return new Promise((resolve, reject) => {\n var fulfilled = (value) => {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n };\n var rejected = (value) => {\n try {\n step(generator.throw(value));\n } catch (e) {\n reject(e);\n }\n };\n var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);\n step((generator = generator.apply(__this, __arguments)).next());\n });\n};\n\n// src/lib/errors/git-error.ts\nvar GitError;\nvar init_git_error = __esm({\n \"src/lib/errors/git-error.ts\"() {\n GitError = class extends Error {\n constructor(task, message) {\n super(message);\n this.task = task;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n };\n }\n});\n\n// src/lib/errors/git-response-error.ts\nvar GitResponseError;\nvar init_git_response_error = __esm({\n \"src/lib/errors/git-response-error.ts\"() {\n init_git_error();\n GitResponseError = class extends GitError {\n constructor(git, message) {\n super(void 0, message || String(git));\n this.git = git;\n }\n };\n }\n});\n\n// src/lib/errors/git-construct-error.ts\nvar GitConstructError;\nvar init_git_construct_error = __esm({\n \"src/lib/errors/git-construct-error.ts\"() {\n init_git_error();\n GitConstructError = class extends GitError {\n constructor(config, message) {\n super(void 0, message);\n this.config = config;\n }\n };\n }\n});\n\n// src/lib/errors/git-plugin-error.ts\nvar GitPluginError;\nvar init_git_plugin_error = __esm({\n \"src/lib/errors/git-plugin-error.ts\"() {\n init_git_error();\n GitPluginError = class extends GitError {\n constructor(task, plugin, message) {\n super(task, message);\n this.task = task;\n this.plugin = plugin;\n Object.setPrototypeOf(this, new.target.prototype);\n }\n };\n }\n});\n\n// src/lib/errors/task-configuration-error.ts\nvar TaskConfigurationError;\nvar init_task_configuration_error = __esm({\n \"src/lib/errors/task-configuration-error.ts\"() {\n init_git_error();\n TaskConfigurationError = class extends GitError {\n constructor(message) {\n super(void 0, message);\n }\n };\n }\n});\n\n// src/lib/utils/util.ts\nfunction asFunction(source) {\n return typeof source === \"function\" ? source : NOOP;\n}\nfunction isUserFunction(source) {\n return typeof source === \"function\" && source !== NOOP;\n}\nfunction splitOn(input, char) {\n const index = input.indexOf(char);\n if (index <= 0) {\n return [input, \"\"];\n }\n return [\n input.substr(0, index),\n input.substr(index + 1)\n ];\n}\nfunction first(input, offset = 0) {\n return isArrayLike(input) && input.length > offset ? input[offset] : void 0;\n}\nfunction last(input, offset = 0) {\n if (isArrayLike(input) && input.length > offset) {\n return input[input.length - 1 - offset];\n }\n}\nfunction isArrayLike(input) {\n return !!(input && typeof input.length === \"number\");\n}\nfunction toLinesWithContent(input = \"\", trimmed2 = true, separator = \"\\n\") {\n return input.split(separator).reduce((output, line) => {\n const lineContent = trimmed2 ? line.trim() : line;\n if (lineContent) {\n output.push(lineContent);\n }\n return output;\n }, []);\n}\nfunction forEachLineWithContent(input, callback) {\n return toLinesWithContent(input, true).map((line) => callback(line));\n}\nfunction folderExists(path) {\n return (0, import_file_exists.exists)(path, import_file_exists.FOLDER);\n}\nfunction append(target, item) {\n if (Array.isArray(target)) {\n if (!target.includes(item)) {\n target.push(item);\n }\n } else {\n target.add(item);\n }\n return item;\n}\nfunction including(target, item) {\n if (Array.isArray(target) && !target.includes(item)) {\n target.push(item);\n }\n return target;\n}\nfunction remove(target, item) {\n if (Array.isArray(target)) {\n const index = target.indexOf(item);\n if (index >= 0) {\n target.splice(index, 1);\n }\n } else {\n target.delete(item);\n }\n return item;\n}\nfunction asArray(source) {\n return Array.isArray(source) ? source : [source];\n}\nfunction asStringArray(source) {\n return asArray(source).map(String);\n}\nfunction asNumber(source, onNaN = 0) {\n if (source == null) {\n return onNaN;\n }\n const num = parseInt(source, 10);\n return isNaN(num) ? onNaN : num;\n}\nfunction prefixedArray(input, prefix) {\n const output = [];\n for (let i = 0, max = input.length; i < max; i++) {\n output.push(prefix, input[i]);\n }\n return output;\n}\nfunction bufferToString(input) {\n return (Array.isArray(input) ? Buffer.concat(input) : input).toString(\"utf-8\");\n}\nfunction pick(source, properties) {\n return Object.assign({}, ...properties.map((property) => property in source ? { [property]: source[property] } : {}));\n}\nfunction delay(duration = 0) {\n return new Promise((done) => setTimeout(done, duration));\n}\nvar import_file_exists, NULL, NOOP, objectToString;\nvar init_util = __esm({\n \"src/lib/utils/util.ts\"() {\n import_file_exists = require(\"@kwsites/file-exists\");\n NULL = \"\\0\";\n NOOP = () => {\n };\n objectToString = Object.prototype.toString.call.bind(Object.prototype.toString);\n }\n});\n\n// src/lib/utils/argument-filters.ts\nfunction filterType(input, filter, def) {\n if (filter(input)) {\n return input;\n }\n return arguments.length > 2 ? def : void 0;\n}\nfunction filterPrimitives(input, omit) {\n return /number|string|boolean/.test(typeof input) && (!omit || !omit.includes(typeof input));\n}\nfunction filterPlainObject(input) {\n return !!input && objectToString(input) === \"[object Object]\";\n}\nfunction filterFunction(input) {\n return typeof input === \"function\";\n}\nvar filterArray, filterString, filterStringArray, filterStringOrStringArray, filterHasLength;\nvar init_argument_filters = __esm({\n \"src/lib/utils/argument-filters.ts\"() {\n init_util();\n filterArray = (input) => {\n return Array.isArray(input);\n };\n filterString = (input) => {\n return typeof input === \"string\";\n };\n filterStringArray = (input) => {\n return Array.isArray(input) && input.every(filterString);\n };\n filterStringOrStringArray = (input) => {\n return filterString(input) || Array.isArray(input) && input.every(filterString);\n };\n filterHasLength = (input) => {\n if (input == null || \"number|boolean|function\".includes(typeof input)) {\n return false;\n }\n return Array.isArray(input) || typeof input === \"string\" || typeof input.length === \"number\";\n };\n }\n});\n\n// src/lib/utils/exit-codes.ts\nvar ExitCodes;\nvar init_exit_codes = __esm({\n \"src/lib/utils/exit-codes.ts\"() {\n ExitCodes = /* @__PURE__ */ ((ExitCodes2) => {\n ExitCodes2[ExitCodes2[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExitCodes2[ExitCodes2[\"ERROR\"] = 1] = \"ERROR\";\n ExitCodes2[ExitCodes2[\"UNCLEAN\"] = 128] = \"UNCLEAN\";\n return ExitCodes2;\n })(ExitCodes || {});\n }\n});\n\n// src/lib/utils/git-output-streams.ts\nvar GitOutputStreams;\nvar init_git_output_streams = __esm({\n \"src/lib/utils/git-output-streams.ts\"() {\n GitOutputStreams = class {\n constructor(stdOut, stdErr) {\n this.stdOut = stdOut;\n this.stdErr = stdErr;\n }\n asStrings() {\n return new GitOutputStreams(this.stdOut.toString(\"utf8\"), this.stdErr.toString(\"utf8\"));\n }\n };\n }\n});\n\n// src/lib/utils/line-parser.ts\nvar LineParser, RemoteLineParser;\nvar init_line_parser = __esm({\n \"src/lib/utils/line-parser.ts\"() {\n LineParser = class {\n constructor(regExp, useMatches) {\n this.matches = [];\n this.parse = (line, target) => {\n this.resetMatches();\n if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {\n return false;\n }\n return this.useMatches(target, this.prepareMatches()) !== false;\n };\n this._regExp = Array.isArray(regExp) ? regExp : [regExp];\n if (useMatches) {\n this.useMatches = useMatches;\n }\n }\n useMatches(target, match) {\n throw new Error(`LineParser:useMatches not implemented`);\n }\n resetMatches() {\n this.matches.length = 0;\n }\n prepareMatches() {\n return this.matches;\n }\n addMatch(reg, index, line) {\n const matched = line && reg.exec(line);\n if (matched) {\n this.pushMatch(index, matched);\n }\n return !!matched;\n }\n pushMatch(_index, matched) {\n this.matches.push(...matched.slice(1));\n }\n };\n RemoteLineParser = class extends LineParser {\n addMatch(reg, index, line) {\n return /^remote:\\s/.test(String(line)) && super.addMatch(reg, index, line);\n }\n pushMatch(index, matched) {\n if (index > 0 || matched.length > 1) {\n super.pushMatch(index, matched);\n }\n }\n };\n }\n});\n\n// src/lib/utils/simple-git-options.ts\nfunction createInstanceConfig(...options) {\n const baseDir = process.cwd();\n const config = Object.assign(__spreadValues({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === \"object\" && o));\n config.baseDir = config.baseDir || baseDir;\n return config;\n}\nvar defaultOptions;\nvar init_simple_git_options = __esm({\n \"src/lib/utils/simple-git-options.ts\"() {\n defaultOptions = {\n binary: \"git\",\n maxConcurrentProcesses: 5,\n config: []\n };\n }\n});\n\n// src/lib/utils/task-options.ts\nfunction appendTaskOptions(options, commands = []) {\n if (!filterPlainObject(options)) {\n return commands;\n }\n return Object.keys(options).reduce((commands2, key) => {\n const value = options[key];\n if (filterPrimitives(value, [\"boolean\"])) {\n commands2.push(key + \"=\" + value);\n } else {\n commands2.push(key);\n }\n return commands2;\n }, commands);\n}\nfunction getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {\n const command = [];\n for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) {\n if (\"string|number\".includes(typeof args[i])) {\n command.push(String(args[i]));\n }\n }\n appendTaskOptions(trailingOptionsArgument(args), command);\n if (!objectOnly) {\n command.push(...trailingArrayArgument(args));\n }\n return command;\n}\nfunction trailingArrayArgument(args) {\n const hasTrailingCallback = typeof last(args) === \"function\";\n return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);\n}\nfunction trailingOptionsArgument(args) {\n const hasTrailingCallback = filterFunction(last(args));\n return filterType(last(args, hasTrailingCallback ? 1 : 0), filterPlainObject);\n}\nfunction trailingFunctionArgument(args, includeNoop = true) {\n const callback = asFunction(last(args));\n return includeNoop || isUserFunction(callback) ? callback : void 0;\n}\nvar init_task_options = __esm({\n \"src/lib/utils/task-options.ts\"() {\n init_argument_filters();\n init_util();\n }\n});\n\n// src/lib/utils/task-parser.ts\nfunction callTaskParser(parser3, streams) {\n return parser3(streams.stdOut, streams.stdErr);\n}\nfunction parseStringResponse(result, parsers11, ...texts) {\n texts.forEach((text) => {\n for (let lines = toLinesWithContent(text), i = 0, max = lines.length; i < max; i++) {\n const line = (offset = 0) => {\n if (i + offset >= max) {\n return;\n }\n return lines[i + offset];\n };\n parsers11.some(({ parse }) => parse(line, result));\n }\n });\n return result;\n}\nvar init_task_parser = __esm({\n \"src/lib/utils/task-parser.ts\"() {\n init_util();\n }\n});\n\n// src/lib/utils/index.ts\nvar utils_exports = {};\n__export(utils_exports, {\n ExitCodes: () => ExitCodes,\n GitOutputStreams: () => GitOutputStreams,\n LineParser: () => LineParser,\n NOOP: () => NOOP,\n NULL: () => NULL,\n RemoteLineParser: () => RemoteLineParser,\n append: () => append,\n appendTaskOptions: () => appendTaskOptions,\n asArray: () => asArray,\n asFunction: () => asFunction,\n asNumber: () => asNumber,\n asStringArray: () => asStringArray,\n bufferToString: () => bufferToString,\n callTaskParser: () => callTaskParser,\n createInstanceConfig: () => createInstanceConfig,\n delay: () => delay,\n filterArray: () => filterArray,\n filterFunction: () => filterFunction,\n filterHasLength: () => filterHasLength,\n filterPlainObject: () => filterPlainObject,\n filterPrimitives: () => filterPrimitives,\n filterString: () => filterString,\n filterStringArray: () => filterStringArray,\n filterStringOrStringArray: () => filterStringOrStringArray,\n filterType: () => filterType,\n first: () => first,\n folderExists: () => folderExists,\n forEachLineWithContent: () => forEachLineWithContent,\n getTrailingOptions: () => getTrailingOptions,\n including: () => including,\n isUserFunction: () => isUserFunction,\n last: () => last,\n objectToString: () => objectToString,\n parseStringResponse: () => parseStringResponse,\n pick: () => pick,\n prefixedArray: () => prefixedArray,\n remove: () => remove,\n splitOn: () => splitOn,\n toLinesWithContent: () => toLinesWithContent,\n trailingFunctionArgument: () => trailingFunctionArgument,\n trailingOptionsArgument: () => trailingOptionsArgument\n});\nvar init_utils = __esm({\n \"src/lib/utils/index.ts\"() {\n init_argument_filters();\n init_exit_codes();\n init_git_output_streams();\n init_line_parser();\n init_simple_git_options();\n init_task_options();\n init_task_parser();\n init_util();\n }\n});\n\n// src/lib/tasks/check-is-repo.ts\nvar check_is_repo_exports = {};\n__export(check_is_repo_exports, {\n CheckRepoActions: () => CheckRepoActions,\n checkIsBareRepoTask: () => checkIsBareRepoTask,\n checkIsRepoRootTask: () => checkIsRepoRootTask,\n checkIsRepoTask: () => checkIsRepoTask\n});\nfunction checkIsRepoTask(action) {\n switch (action) {\n case \"bare\" /* BARE */:\n return checkIsBareRepoTask();\n case \"root\" /* IS_REPO_ROOT */:\n return checkIsRepoRootTask();\n }\n const commands = [\"rev-parse\", \"--is-inside-work-tree\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser\n };\n}\nfunction checkIsRepoRootTask() {\n const commands = [\"rev-parse\", \"--git-dir\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser(path) {\n return /^\\.(git)?$/.test(path.trim());\n }\n };\n}\nfunction checkIsBareRepoTask() {\n const commands = [\"rev-parse\", \"--is-bare-repository\"];\n return {\n commands,\n format: \"utf-8\",\n onError,\n parser\n };\n}\nfunction isNotRepoMessage(error) {\n return /(Not a git repository|Kein Git-Repository)/i.test(String(error));\n}\nvar CheckRepoActions, onError, parser;\nvar init_check_is_repo = __esm({\n \"src/lib/tasks/check-is-repo.ts\"() {\n init_utils();\n CheckRepoActions = /* @__PURE__ */ ((CheckRepoActions2) => {\n CheckRepoActions2[\"BARE\"] = \"bare\";\n CheckRepoActions2[\"IN_TREE\"] = \"tree\";\n CheckRepoActions2[\"IS_REPO_ROOT\"] = \"root\";\n return CheckRepoActions2;\n })(CheckRepoActions || {});\n onError = ({ exitCode }, error, done, fail) => {\n if (exitCode === 128 /* UNCLEAN */ && isNotRepoMessage(error)) {\n return done(Buffer.from(\"false\"));\n }\n fail(error);\n };\n parser = (text) => {\n return text.trim() === \"true\";\n };\n }\n});\n\n// src/lib/responses/CleanSummary.ts\nfunction cleanSummaryParser(dryRun, text) {\n const summary = new CleanResponse(dryRun);\n const regexp = dryRun ? dryRunRemovalRegexp : removalRegexp;\n toLinesWithContent(text).forEach((line) => {\n const removed = line.replace(regexp, \"\");\n summary.paths.push(removed);\n (isFolderRegexp.test(removed) ? summary.folders : summary.files).push(removed);\n });\n return summary;\n}\nvar CleanResponse, removalRegexp, dryRunRemovalRegexp, isFolderRegexp;\nvar init_CleanSummary = __esm({\n \"src/lib/responses/CleanSummary.ts\"() {\n init_utils();\n CleanResponse = class {\n constructor(dryRun) {\n this.dryRun = dryRun;\n this.paths = [];\n this.files = [];\n this.folders = [];\n }\n };\n removalRegexp = /^[a-z]+\\s*/i;\n dryRunRemovalRegexp = /^[a-z]+\\s+[a-z]+\\s*/i;\n isFolderRegexp = /\\/$/;\n }\n});\n\n// src/lib/tasks/task.ts\nvar task_exports = {};\n__export(task_exports, {\n EMPTY_COMMANDS: () => EMPTY_COMMANDS,\n adhocExecTask: () => adhocExecTask,\n configurationErrorTask: () => configurationErrorTask,\n isBufferTask: () => isBufferTask,\n isEmptyTask: () => isEmptyTask,\n straightThroughBufferTask: () => straightThroughBufferTask,\n straightThroughStringTask: () => straightThroughStringTask\n});\nfunction adhocExecTask(parser3) {\n return {\n commands: EMPTY_COMMANDS,\n format: \"empty\",\n parser: parser3\n };\n}\nfunction configurationErrorTask(error) {\n return {\n commands: EMPTY_COMMANDS,\n format: \"empty\",\n parser() {\n throw typeof error === \"string\" ? new TaskConfigurationError(error) : error;\n }\n };\n}\nfunction straightThroughStringTask(commands, trimmed2 = false) {\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return trimmed2 ? String(text).trim() : text;\n }\n };\n}\nfunction straightThroughBufferTask(commands) {\n return {\n commands,\n format: \"buffer\",\n parser(buffer) {\n return buffer;\n }\n };\n}\nfunction isBufferTask(task) {\n return task.format === \"buffer\";\n}\nfunction isEmptyTask(task) {\n return task.format === \"empty\" || !task.commands.length;\n}\nvar EMPTY_COMMANDS;\nvar init_task = __esm({\n \"src/lib/tasks/task.ts\"() {\n init_task_configuration_error();\n EMPTY_COMMANDS = [];\n }\n});\n\n// src/lib/tasks/clean.ts\nvar clean_exports = {};\n__export(clean_exports, {\n CONFIG_ERROR_INTERACTIVE_MODE: () => CONFIG_ERROR_INTERACTIVE_MODE,\n CONFIG_ERROR_MODE_REQUIRED: () => CONFIG_ERROR_MODE_REQUIRED,\n CONFIG_ERROR_UNKNOWN_OPTION: () => CONFIG_ERROR_UNKNOWN_OPTION,\n CleanOptions: () => CleanOptions,\n cleanTask: () => cleanTask,\n cleanWithOptionsTask: () => cleanWithOptionsTask,\n isCleanOptionsArray: () => isCleanOptionsArray\n});\nfunction cleanWithOptionsTask(mode, customArgs) {\n const { cleanMode, options, valid } = getCleanOptions(mode);\n if (!cleanMode) {\n return configurationErrorTask(CONFIG_ERROR_MODE_REQUIRED);\n }\n if (!valid.options) {\n return configurationErrorTask(CONFIG_ERROR_UNKNOWN_OPTION + JSON.stringify(mode));\n }\n options.push(...customArgs);\n if (options.some(isInteractiveMode)) {\n return configurationErrorTask(CONFIG_ERROR_INTERACTIVE_MODE);\n }\n return cleanTask(cleanMode, options);\n}\nfunction cleanTask(mode, customArgs) {\n const commands = [\"clean\", `-${mode}`, ...customArgs];\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return cleanSummaryParser(mode === \"n\" /* DRY_RUN */, text);\n }\n };\n}\nfunction isCleanOptionsArray(input) {\n return Array.isArray(input) && input.every((test) => CleanOptionValues.has(test));\n}\nfunction getCleanOptions(input) {\n let cleanMode;\n let options = [];\n let valid = { cleanMode: false, options: true };\n input.replace(/[^a-z]i/g, \"\").split(\"\").forEach((char) => {\n if (isCleanMode(char)) {\n cleanMode = char;\n valid.cleanMode = true;\n } else {\n valid.options = valid.options && isKnownOption(options[options.length] = `-${char}`);\n }\n });\n return {\n cleanMode,\n options,\n valid\n };\n}\nfunction isCleanMode(cleanMode) {\n return cleanMode === \"f\" /* FORCE */ || cleanMode === \"n\" /* DRY_RUN */;\n}\nfunction isKnownOption(option) {\n return /^-[a-z]$/i.test(option) && CleanOptionValues.has(option.charAt(1));\n}\nfunction isInteractiveMode(option) {\n if (/^-[^\\-]/.test(option)) {\n return option.indexOf(\"i\") > 0;\n }\n return option === \"--interactive\";\n}\nvar CONFIG_ERROR_INTERACTIVE_MODE, CONFIG_ERROR_MODE_REQUIRED, CONFIG_ERROR_UNKNOWN_OPTION, CleanOptions, CleanOptionValues;\nvar init_clean = __esm({\n \"src/lib/tasks/clean.ts\"() {\n init_CleanSummary();\n init_utils();\n init_task();\n CONFIG_ERROR_INTERACTIVE_MODE = \"Git clean interactive mode is not supported\";\n CONFIG_ERROR_MODE_REQUIRED = 'Git clean mode parameter (\"n\" or \"f\") is required';\n CONFIG_ERROR_UNKNOWN_OPTION = \"Git clean unknown option found in: \";\n CleanOptions = /* @__PURE__ */ ((CleanOptions2) => {\n CleanOptions2[\"DRY_RUN\"] = \"n\";\n CleanOptions2[\"FORCE\"] = \"f\";\n CleanOptions2[\"IGNORED_INCLUDED\"] = \"x\";\n CleanOptions2[\"IGNORED_ONLY\"] = \"X\";\n CleanOptions2[\"EXCLUDING\"] = \"e\";\n CleanOptions2[\"QUIET\"] = \"q\";\n CleanOptions2[\"RECURSIVE\"] = \"d\";\n return CleanOptions2;\n })(CleanOptions || {});\n CleanOptionValues = /* @__PURE__ */ new Set([\"i\", ...asStringArray(Object.values(CleanOptions))]);\n }\n});\n\n// src/lib/responses/ConfigList.ts\nfunction configListParser(text) {\n const config = new ConfigList();\n for (const item of configParser(text)) {\n config.addValue(item.file, String(item.key), item.value);\n }\n return config;\n}\nfunction configGetParser(text, key) {\n let value = null;\n const values = [];\n const scopes = /* @__PURE__ */ new Map();\n for (const item of configParser(text, key)) {\n if (item.key !== key) {\n continue;\n }\n values.push(value = item.value);\n if (!scopes.has(item.file)) {\n scopes.set(item.file, []);\n }\n scopes.get(item.file).push(value);\n }\n return {\n key,\n paths: Array.from(scopes.keys()),\n scopes,\n value,\n values\n };\n}\nfunction configFilePath(filePath) {\n return filePath.replace(/^(file):/, \"\");\n}\nfunction* configParser(text, requestedKey = null) {\n const lines = text.split(\"\\0\");\n for (let i = 0, max = lines.length - 1; i < max; ) {\n const file = configFilePath(lines[i++]);\n let value = lines[i++];\n let key = requestedKey;\n if (value.includes(\"\\n\")) {\n const line = splitOn(value, \"\\n\");\n key = line[0];\n value = line[1];\n }\n yield { file, key, value };\n }\n}\nvar ConfigList;\nvar init_ConfigList = __esm({\n \"src/lib/responses/ConfigList.ts\"() {\n init_utils();\n ConfigList = class {\n constructor() {\n this.files = [];\n this.values = /* @__PURE__ */ Object.create(null);\n }\n get all() {\n if (!this._all) {\n this._all = this.files.reduce((all, file) => {\n return Object.assign(all, this.values[file]);\n }, {});\n }\n return this._all;\n }\n addFile(file) {\n if (!(file in this.values)) {\n const latest = last(this.files);\n this.values[file] = latest ? Object.create(this.values[latest]) : {};\n this.files.push(file);\n }\n return this.values[file];\n }\n addValue(file, key, value) {\n const values = this.addFile(file);\n if (!values.hasOwnProperty(key)) {\n values[key] = value;\n } else if (Array.isArray(values[key])) {\n values[key].push(value);\n } else {\n values[key] = [values[key], value];\n }\n this._all = void 0;\n }\n };\n }\n});\n\n// src/lib/tasks/config.ts\nfunction asConfigScope(scope, fallback) {\n if (typeof scope === \"string\" && GitConfigScope.hasOwnProperty(scope)) {\n return scope;\n }\n return fallback;\n}\nfunction addConfigTask(key, value, append2, scope) {\n const commands = [\"config\", `--${scope}`];\n if (append2) {\n commands.push(\"--add\");\n }\n commands.push(key, value);\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return text;\n }\n };\n}\nfunction getConfigTask(key, scope) {\n const commands = [\"config\", \"--null\", \"--show-origin\", \"--get-all\", key];\n if (scope) {\n commands.splice(1, 0, `--${scope}`);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return configGetParser(text, key);\n }\n };\n}\nfunction listConfigTask(scope) {\n const commands = [\"config\", \"--list\", \"--show-origin\", \"--null\"];\n if (scope) {\n commands.push(`--${scope}`);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return configListParser(text);\n }\n };\n}\nfunction config_default() {\n return {\n addConfig(key, value, ...rest) {\n return this._runTask(addConfigTask(key, value, rest[0] === true, asConfigScope(rest[1], \"local\" /* local */)), trailingFunctionArgument(arguments));\n },\n getConfig(key, scope) {\n return this._runTask(getConfigTask(key, asConfigScope(scope, void 0)), trailingFunctionArgument(arguments));\n },\n listConfig(...rest) {\n return this._runTask(listConfigTask(asConfigScope(rest[0], void 0)), trailingFunctionArgument(arguments));\n }\n };\n}\nvar GitConfigScope;\nvar init_config = __esm({\n \"src/lib/tasks/config.ts\"() {\n init_ConfigList();\n init_utils();\n GitConfigScope = /* @__PURE__ */ ((GitConfigScope2) => {\n GitConfigScope2[\"system\"] = \"system\";\n GitConfigScope2[\"global\"] = \"global\";\n GitConfigScope2[\"local\"] = \"local\";\n GitConfigScope2[\"worktree\"] = \"worktree\";\n return GitConfigScope2;\n })(GitConfigScope || {});\n }\n});\n\n// src/lib/tasks/grep.ts\nfunction grepQueryBuilder(...params) {\n return new GrepQuery().param(...params);\n}\nfunction parseGrep(grep) {\n const paths = /* @__PURE__ */ new Set();\n const results = {};\n forEachLineWithContent(grep, (input) => {\n const [path, line, preview] = input.split(NULL);\n paths.add(path);\n (results[path] = results[path] || []).push({\n line: asNumber(line),\n path,\n preview\n });\n });\n return {\n paths,\n results\n };\n}\nfunction grep_default() {\n return {\n grep(searchTerm) {\n const then = trailingFunctionArgument(arguments);\n const options = getTrailingOptions(arguments);\n for (const option of disallowedOptions) {\n if (options.includes(option)) {\n return this._runTask(configurationErrorTask(`git.grep: use of \"${option}\" is not supported.`), then);\n }\n }\n if (typeof searchTerm === \"string\") {\n searchTerm = grepQueryBuilder().param(searchTerm);\n }\n const commands = [\"grep\", \"--null\", \"-n\", \"--full-name\", ...options, ...searchTerm];\n return this._runTask({\n commands,\n format: \"utf-8\",\n parser(stdOut) {\n return parseGrep(stdOut);\n }\n }, then);\n }\n };\n}\nvar disallowedOptions, Query, _a, GrepQuery;\nvar init_grep = __esm({\n \"src/lib/tasks/grep.ts\"() {\n init_utils();\n init_task();\n disallowedOptions = [\"-h\"];\n Query = Symbol(\"grepQuery\");\n GrepQuery = class {\n constructor() {\n this[_a] = [];\n }\n *[(_a = Query, Symbol.iterator)]() {\n for (const query of this[Query]) {\n yield query;\n }\n }\n and(...and) {\n and.length && this[Query].push(\"--and\", \"(\", ...prefixedArray(and, \"-e\"), \")\");\n return this;\n }\n param(...param) {\n this[Query].push(...prefixedArray(param, \"-e\"));\n return this;\n }\n };\n }\n});\n\n// src/lib/tasks/reset.ts\nvar reset_exports = {};\n__export(reset_exports, {\n ResetMode: () => ResetMode,\n getResetMode: () => getResetMode,\n resetTask: () => resetTask\n});\nfunction resetTask(mode, customArgs) {\n const commands = [\"reset\"];\n if (isValidResetMode(mode)) {\n commands.push(`--${mode}`);\n }\n commands.push(...customArgs);\n return straightThroughStringTask(commands);\n}\nfunction getResetMode(mode) {\n if (isValidResetMode(mode)) {\n return mode;\n }\n switch (typeof mode) {\n case \"string\":\n case \"undefined\":\n return \"soft\" /* SOFT */;\n }\n return;\n}\nfunction isValidResetMode(mode) {\n return ResetModes.includes(mode);\n}\nvar ResetMode, ResetModes;\nvar init_reset = __esm({\n \"src/lib/tasks/reset.ts\"() {\n init_task();\n ResetMode = /* @__PURE__ */ ((ResetMode2) => {\n ResetMode2[\"MIXED\"] = \"mixed\";\n ResetMode2[\"SOFT\"] = \"soft\";\n ResetMode2[\"HARD\"] = \"hard\";\n ResetMode2[\"MERGE\"] = \"merge\";\n ResetMode2[\"KEEP\"] = \"keep\";\n return ResetMode2;\n })(ResetMode || {});\n ResetModes = Array.from(Object.values(ResetMode));\n }\n});\n\n// src/lib/api.ts\nvar api_exports = {};\n__export(api_exports, {\n CheckRepoActions: () => CheckRepoActions,\n CleanOptions: () => CleanOptions,\n GitConfigScope: () => GitConfigScope,\n GitConstructError: () => GitConstructError,\n GitError: () => GitError,\n GitPluginError: () => GitPluginError,\n GitResponseError: () => GitResponseError,\n ResetMode: () => ResetMode,\n TaskConfigurationError: () => TaskConfigurationError,\n grepQueryBuilder: () => grepQueryBuilder\n});\nvar init_api = __esm({\n \"src/lib/api.ts\"() {\n init_git_construct_error();\n init_git_error();\n init_git_plugin_error();\n init_git_response_error();\n init_task_configuration_error();\n init_check_is_repo();\n init_clean();\n init_config();\n init_grep();\n init_reset();\n }\n});\n\n// src/lib/plugins/command-config-prefixing-plugin.ts\nfunction commandConfigPrefixingPlugin(configuration) {\n const prefix = prefixedArray(configuration, \"-c\");\n return {\n type: \"spawn.args\",\n action(data) {\n return [...prefix, ...data];\n }\n };\n}\nvar init_command_config_prefixing_plugin = __esm({\n \"src/lib/plugins/command-config-prefixing-plugin.ts\"() {\n init_utils();\n }\n});\n\n// src/lib/plugins/completion-detection.plugin.ts\nfunction completionDetectionPlugin({\n onClose = true,\n onExit = 50\n} = {}) {\n function createEvents() {\n let exitCode = -1;\n const events = {\n close: (0, import_promise_deferred.deferred)(),\n closeTimeout: (0, import_promise_deferred.deferred)(),\n exit: (0, import_promise_deferred.deferred)(),\n exitTimeout: (0, import_promise_deferred.deferred)()\n };\n const result = Promise.race([\n onClose === false ? never : events.closeTimeout.promise,\n onExit === false ? never : events.exitTimeout.promise\n ]);\n configureTimeout(onClose, events.close, events.closeTimeout);\n configureTimeout(onExit, events.exit, events.exitTimeout);\n return {\n close(code) {\n exitCode = code;\n events.close.done();\n },\n exit(code) {\n exitCode = code;\n events.exit.done();\n },\n get exitCode() {\n return exitCode;\n },\n result\n };\n }\n function configureTimeout(flag, event, timeout) {\n if (flag === false) {\n return;\n }\n (flag === true ? event.promise : event.promise.then(() => delay(flag))).then(timeout.done);\n }\n return {\n type: \"spawn.after\",\n action(_0, _1) {\n return __async(this, arguments, function* (_data, { spawned, close }) {\n var _a2, _b;\n const events = createEvents();\n let deferClose = true;\n let quickClose = () => void (deferClose = false);\n (_a2 = spawned.stdout) == null ? void 0 : _a2.on(\"data\", quickClose);\n (_b = spawned.stderr) == null ? void 0 : _b.on(\"data\", quickClose);\n spawned.on(\"error\", quickClose);\n spawned.on(\"close\", (code) => events.close(code));\n spawned.on(\"exit\", (code) => events.exit(code));\n try {\n yield events.result;\n if (deferClose) {\n yield delay(50);\n }\n close(events.exitCode);\n } catch (err) {\n close(events.exitCode, err);\n }\n });\n }\n };\n}\nvar import_promise_deferred, never;\nvar init_completion_detection_plugin = __esm({\n \"src/lib/plugins/completion-detection.plugin.ts\"() {\n import_promise_deferred = require(\"@kwsites/promise-deferred\");\n init_utils();\n never = (0, import_promise_deferred.deferred)().promise;\n }\n});\n\n// src/lib/plugins/error-detection.plugin.ts\nfunction isTaskError(result) {\n return !!(result.exitCode && result.stdErr.length);\n}\nfunction getErrorMessage(result) {\n return Buffer.concat([...result.stdOut, ...result.stdErr]);\n}\nfunction errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) {\n return (error, result) => {\n if (!overwrite && error || !isError(result)) {\n return error;\n }\n return errorMessage(result);\n };\n}\nfunction errorDetectionPlugin(config) {\n return {\n type: \"task.error\",\n action(data, context) {\n const error = config(data.error, {\n stdErr: context.stdErr,\n stdOut: context.stdOut,\n exitCode: context.exitCode\n });\n if (Buffer.isBuffer(error)) {\n return { error: new GitError(void 0, error.toString(\"utf-8\")) };\n }\n return {\n error\n };\n }\n };\n}\nvar init_error_detection_plugin = __esm({\n \"src/lib/plugins/error-detection.plugin.ts\"() {\n init_git_error();\n }\n});\n\n// src/lib/plugins/plugin-store.ts\nvar PluginStore;\nvar init_plugin_store = __esm({\n \"src/lib/plugins/plugin-store.ts\"() {\n init_utils();\n PluginStore = class {\n constructor() {\n this.plugins = /* @__PURE__ */ new Set();\n }\n add(plugin) {\n const plugins = [];\n asArray(plugin).forEach((plugin2) => plugin2 && this.plugins.add(append(plugins, plugin2)));\n return () => {\n plugins.forEach((plugin2) => this.plugins.delete(plugin2));\n };\n }\n exec(type, data, context) {\n let output = data;\n const contextual = Object.freeze(Object.create(context));\n for (const plugin of this.plugins) {\n if (plugin.type === type) {\n output = plugin.action(output, contextual);\n }\n }\n return output;\n }\n };\n }\n});\n\n// src/lib/plugins/progress-monitor-plugin.ts\nfunction progressMonitorPlugin(progress) {\n const progressCommand = \"--progress\";\n const progressMethods = [\"checkout\", \"clone\", \"fetch\", \"pull\", \"push\"];\n const onProgress = {\n type: \"spawn.after\",\n action(_data, context) {\n var _a2;\n if (!context.commands.includes(progressCommand)) {\n return;\n }\n (_a2 = context.spawned.stderr) == null ? void 0 : _a2.on(\"data\", (chunk) => {\n const message = /^([\\s\\S]+?):\\s*(\\d+)% \\((\\d+)\\/(\\d+)\\)/.exec(chunk.toString(\"utf8\"));\n if (!message) {\n return;\n }\n progress({\n method: context.method,\n stage: progressEventStage(message[1]),\n progress: asNumber(message[2]),\n processed: asNumber(message[3]),\n total: asNumber(message[4])\n });\n });\n }\n };\n const onArgs = {\n type: \"spawn.args\",\n action(args, context) {\n if (!progressMethods.includes(context.method)) {\n return args;\n }\n return including(args, progressCommand);\n }\n };\n return [onArgs, onProgress];\n}\nfunction progressEventStage(input) {\n return String(input.toLowerCase().split(\" \", 1)) || \"unknown\";\n}\nvar init_progress_monitor_plugin = __esm({\n \"src/lib/plugins/progress-monitor-plugin.ts\"() {\n init_utils();\n }\n});\n\n// src/lib/plugins/simple-git-plugin.ts\nvar init_simple_git_plugin = __esm({\n \"src/lib/plugins/simple-git-plugin.ts\"() {\n }\n});\n\n// src/lib/plugins/spawn-options-plugin.ts\nfunction spawnOptionsPlugin(spawnOptions) {\n const options = pick(spawnOptions, [\"uid\", \"gid\"]);\n return {\n type: \"spawn.options\",\n action(data) {\n return __spreadValues(__spreadValues({}, options), data);\n }\n };\n}\nvar init_spawn_options_plugin = __esm({\n \"src/lib/plugins/spawn-options-plugin.ts\"() {\n init_utils();\n }\n});\n\n// src/lib/plugins/timout-plugin.ts\nfunction timeoutPlugin({ block }) {\n if (block > 0) {\n return {\n type: \"spawn.after\",\n action(_data, context) {\n var _a2, _b;\n let timeout;\n function wait() {\n timeout && clearTimeout(timeout);\n timeout = setTimeout(kill, block);\n }\n function stop() {\n var _a3, _b2;\n (_a3 = context.spawned.stdout) == null ? void 0 : _a3.off(\"data\", wait);\n (_b2 = context.spawned.stderr) == null ? void 0 : _b2.off(\"data\", wait);\n context.spawned.off(\"exit\", stop);\n context.spawned.off(\"close\", stop);\n }\n function kill() {\n stop();\n context.kill(new GitPluginError(void 0, \"timeout\", `block timeout reached`));\n }\n (_a2 = context.spawned.stdout) == null ? void 0 : _a2.on(\"data\", wait);\n (_b = context.spawned.stderr) == null ? void 0 : _b.on(\"data\", wait);\n context.spawned.on(\"exit\", stop);\n context.spawned.on(\"close\", stop);\n wait();\n }\n };\n }\n}\nvar init_timout_plugin = __esm({\n \"src/lib/plugins/timout-plugin.ts\"() {\n init_git_plugin_error();\n }\n});\n\n// src/lib/plugins/index.ts\nvar init_plugins = __esm({\n \"src/lib/plugins/index.ts\"() {\n init_command_config_prefixing_plugin();\n init_completion_detection_plugin();\n init_error_detection_plugin();\n init_plugin_store();\n init_progress_monitor_plugin();\n init_simple_git_plugin();\n init_spawn_options_plugin();\n init_timout_plugin();\n }\n});\n\n// src/lib/git-logger.ts\nfunction createLog() {\n return (0, import_debug.default)(\"simple-git\");\n}\nfunction prefixedLogger(to, prefix, forward) {\n if (!prefix || !String(prefix).replace(/\\s*/, \"\")) {\n return !forward ? to : (message, ...args) => {\n to(message, ...args);\n forward(message, ...args);\n };\n }\n return (message, ...args) => {\n to(`%s ${message}`, prefix, ...args);\n if (forward) {\n forward(message, ...args);\n }\n };\n}\nfunction childLoggerName(name, childDebugger, { namespace: parentNamespace }) {\n if (typeof name === \"string\") {\n return name;\n }\n const childNamespace = childDebugger && childDebugger.namespace || \"\";\n if (childNamespace.startsWith(parentNamespace)) {\n return childNamespace.substr(parentNamespace.length + 1);\n }\n return childNamespace || parentNamespace;\n}\nfunction createLogger(label, verbose, initialStep, infoDebugger = createLog()) {\n const labelPrefix = label && `[${label}]` || \"\";\n const spawned = [];\n const debugDebugger = typeof verbose === \"string\" ? infoDebugger.extend(verbose) : verbose;\n const key = childLoggerName(filterType(verbose, filterString), debugDebugger, infoDebugger);\n return step(initialStep);\n function sibling(name, initial) {\n return append(spawned, createLogger(label, key.replace(/^[^:]+/, name), initial, infoDebugger));\n }\n function step(phase) {\n const stepPrefix = phase && `[${phase}]` || \"\";\n const debug2 = debugDebugger && prefixedLogger(debugDebugger, stepPrefix) || NOOP;\n const info = prefixedLogger(infoDebugger, `${labelPrefix} ${stepPrefix}`, debug2);\n return Object.assign(debugDebugger ? debug2 : info, {\n label,\n sibling,\n info,\n step\n });\n }\n}\nvar import_debug;\nvar init_git_logger = __esm({\n \"src/lib/git-logger.ts\"() {\n import_debug = __toESM(require(\"debug\"));\n init_utils();\n import_debug.default.formatters.L = (value) => String(filterHasLength(value) ? value.length : \"-\");\n import_debug.default.formatters.B = (value) => {\n if (Buffer.isBuffer(value)) {\n return value.toString(\"utf8\");\n }\n return objectToString(value);\n };\n }\n});\n\n// src/lib/runners/tasks-pending-queue.ts\nvar _TasksPendingQueue, TasksPendingQueue;\nvar init_tasks_pending_queue = __esm({\n \"src/lib/runners/tasks-pending-queue.ts\"() {\n init_git_error();\n init_git_logger();\n _TasksPendingQueue = class {\n constructor(logLabel = \"GitExecutor\") {\n this.logLabel = logLabel;\n this._queue = /* @__PURE__ */ new Map();\n }\n withProgress(task) {\n return this._queue.get(task);\n }\n createProgress(task) {\n const name = _TasksPendingQueue.getName(task.commands[0]);\n const logger = createLogger(this.logLabel, name);\n return {\n task,\n logger,\n name\n };\n }\n push(task) {\n const progress = this.createProgress(task);\n progress.logger(\"Adding task to the queue, commands = %o\", task.commands);\n this._queue.set(task, progress);\n return progress;\n }\n fatal(err) {\n for (const [task, { logger }] of Array.from(this._queue.entries())) {\n if (task === err.task) {\n logger.info(`Failed %o`, err);\n logger(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`);\n } else {\n logger.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`, err.message);\n }\n this.complete(task);\n }\n if (this._queue.size !== 0) {\n throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`);\n }\n }\n complete(task) {\n const progress = this.withProgress(task);\n if (progress) {\n this._queue.delete(task);\n }\n }\n attempt(task) {\n const progress = this.withProgress(task);\n if (!progress) {\n throw new GitError(void 0, \"TasksPendingQueue: attempt called for an unknown task\");\n }\n progress.logger(\"Starting task\");\n return progress;\n }\n static getName(name = \"empty\") {\n return `task:${name}:${++_TasksPendingQueue.counter}`;\n }\n };\n TasksPendingQueue = _TasksPendingQueue;\n TasksPendingQueue.counter = 0;\n }\n});\n\n// src/lib/runners/git-executor-chain.ts\nfunction pluginContext(task, commands) {\n return {\n method: first(task.commands) || \"\",\n commands\n };\n}\nfunction onErrorReceived(target, logger) {\n return (err) => {\n logger(`[ERROR] child process exception %o`, err);\n target.push(Buffer.from(String(err.stack), \"ascii\"));\n };\n}\nfunction onDataReceived(target, name, logger, output) {\n return (buffer) => {\n logger(`%s received %L bytes`, name, buffer);\n output(`%B`, buffer);\n target.push(buffer);\n };\n}\nvar import_child_process, GitExecutorChain;\nvar init_git_executor_chain = __esm({\n \"src/lib/runners/git-executor-chain.ts\"() {\n import_child_process = require(\"child_process\");\n init_git_error();\n init_task();\n init_utils();\n init_tasks_pending_queue();\n GitExecutorChain = class {\n constructor(_executor, _scheduler, _plugins) {\n this._executor = _executor;\n this._scheduler = _scheduler;\n this._plugins = _plugins;\n this._chain = Promise.resolve();\n this._queue = new TasksPendingQueue();\n }\n get binary() {\n return this._executor.binary;\n }\n get cwd() {\n return this._cwd || this._executor.cwd;\n }\n set cwd(cwd) {\n this._cwd = cwd;\n }\n get env() {\n return this._executor.env;\n }\n get outputHandler() {\n return this._executor.outputHandler;\n }\n chain() {\n return this;\n }\n push(task) {\n this._queue.push(task);\n return this._chain = this._chain.then(() => this.attemptTask(task));\n }\n attemptTask(task) {\n return __async(this, null, function* () {\n const onScheduleComplete = yield this._scheduler.next();\n const onQueueComplete = () => this._queue.complete(task);\n try {\n const { logger } = this._queue.attempt(task);\n return yield isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger);\n } catch (e) {\n throw this.onFatalException(task, e);\n } finally {\n onQueueComplete();\n onScheduleComplete();\n }\n });\n }\n onFatalException(task, e) {\n const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));\n this._chain = Promise.resolve();\n this._queue.fatal(gitError);\n return gitError;\n }\n attemptRemoteTask(task, logger) {\n return __async(this, null, function* () {\n const args = this._plugins.exec(\"spawn.args\", [...task.commands], pluginContext(task, task.commands));\n const raw = yield this.gitResponse(task, this.binary, args, this.outputHandler, logger.step(\"SPAWN\"));\n const outputStreams = yield this.handleTaskData(task, args, raw, logger.step(\"HANDLE\"));\n logger(`passing response to task's parser as a %s`, task.format);\n if (isBufferTask(task)) {\n return callTaskParser(task.parser, outputStreams);\n }\n return callTaskParser(task.parser, outputStreams.asStrings());\n });\n }\n attemptEmptyTask(task, logger) {\n return __async(this, null, function* () {\n logger(`empty task bypassing child process to call to task's parser`);\n return task.parser(this);\n });\n }\n handleTaskData(task, args, result, logger) {\n const { exitCode, rejection, stdOut, stdErr } = result;\n return new Promise((done, fail) => {\n logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode);\n const { error } = this._plugins.exec(\"task.error\", { error: rejection }, __spreadValues(__spreadValues({}, pluginContext(task, args)), result));\n if (error && task.onError) {\n logger.info(`exitCode=%s handling with custom error handler`);\n return task.onError(result, error, (newStdOut) => {\n logger.info(`custom error handler treated as success`);\n logger(`custom error returned a %s`, objectToString(newStdOut));\n done(new GitOutputStreams(Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut, Buffer.concat(stdErr)));\n }, fail);\n }\n if (error) {\n logger.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`, exitCode, stdErr.length, rejection);\n return fail(error);\n }\n logger.info(`retrieving task output complete`);\n done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));\n });\n }\n gitResponse(task, command, args, outputHandler, logger) {\n return __async(this, null, function* () {\n const outputLogger = logger.sibling(\"output\");\n const spawnOptions = this._plugins.exec(\"spawn.options\", {\n cwd: this.cwd,\n env: this.env,\n windowsHide: true\n }, pluginContext(task, task.commands));\n return new Promise((done) => {\n const stdOut = [];\n const stdErr = [];\n let rejection;\n logger.info(`%s %o`, command, args);\n logger(\"%O\", spawnOptions);\n const spawned = (0, import_child_process.spawn)(command, args, spawnOptions);\n spawned.stdout.on(\"data\", onDataReceived(stdOut, \"stdOut\", logger, outputLogger.step(\"stdOut\")));\n spawned.stderr.on(\"data\", onDataReceived(stdErr, \"stdErr\", logger, outputLogger.step(\"stdErr\")));\n spawned.on(\"error\", onErrorReceived(stdErr, logger));\n if (outputHandler) {\n logger(`Passing child process stdOut/stdErr to custom outputHandler`);\n outputHandler(command, spawned.stdout, spawned.stderr, [...args]);\n }\n this._plugins.exec(\"spawn.after\", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {\n spawned,\n close(exitCode, reason) {\n done({\n stdOut,\n stdErr,\n exitCode,\n rejection: rejection || reason\n });\n },\n kill(reason) {\n if (spawned.killed) {\n return;\n }\n rejection = reason;\n spawned.kill(\"SIGINT\");\n }\n }));\n });\n });\n }\n };\n }\n});\n\n// src/lib/runners/git-executor.ts\nvar git_executor_exports = {};\n__export(git_executor_exports, {\n GitExecutor: () => GitExecutor\n});\nvar GitExecutor;\nvar init_git_executor = __esm({\n \"src/lib/runners/git-executor.ts\"() {\n init_git_executor_chain();\n GitExecutor = class {\n constructor(binary = \"git\", cwd, _scheduler, _plugins) {\n this.binary = binary;\n this.cwd = cwd;\n this._scheduler = _scheduler;\n this._plugins = _plugins;\n this._chain = new GitExecutorChain(this, this._scheduler, this._plugins);\n }\n chain() {\n return new GitExecutorChain(this, this._scheduler, this._plugins);\n }\n push(task) {\n return this._chain.push(task);\n }\n };\n }\n});\n\n// src/lib/task-callback.ts\nfunction taskCallback(task, response, callback = NOOP) {\n const onSuccess = (data) => {\n callback(null, data);\n };\n const onError2 = (err) => {\n if ((err == null ? void 0 : err.task) === task) {\n callback(err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err, void 0);\n }\n };\n response.then(onSuccess, onError2);\n}\nfunction addDeprecationNoticeToError(err) {\n let log = (name) => {\n console.warn(`simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`);\n log = NOOP;\n };\n return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {}));\n function descriptorReducer(all, name) {\n if (name in err) {\n return all;\n }\n all[name] = {\n enumerable: false,\n configurable: false,\n get() {\n log(name);\n return err.git[name];\n }\n };\n return all;\n }\n}\nvar init_task_callback = __esm({\n \"src/lib/task-callback.ts\"() {\n init_git_response_error();\n init_utils();\n }\n});\n\n// src/lib/tasks/change-working-directory.ts\nfunction changeWorkingDirectoryTask(directory, root) {\n return adhocExecTask((instance) => {\n if (!folderExists(directory)) {\n throw new Error(`Git.cwd: cannot change to non-directory \"${directory}\"`);\n }\n return (root || instance).cwd = directory;\n });\n}\nvar init_change_working_directory = __esm({\n \"src/lib/tasks/change-working-directory.ts\"() {\n init_utils();\n init_task();\n }\n});\n\n// src/lib/tasks/hash-object.ts\nfunction hashObjectTask(filePath, write) {\n const commands = [\"hash-object\", filePath];\n if (write) {\n commands.push(\"-w\");\n }\n return straightThroughStringTask(commands, true);\n}\nvar init_hash_object = __esm({\n \"src/lib/tasks/hash-object.ts\"() {\n init_task();\n }\n});\n\n// src/lib/responses/InitSummary.ts\nfunction parseInit(bare, path, text) {\n const response = String(text).trim();\n let result;\n if (result = initResponseRegex.exec(response)) {\n return new InitSummary(bare, path, false, result[1]);\n }\n if (result = reInitResponseRegex.exec(response)) {\n return new InitSummary(bare, path, true, result[1]);\n }\n let gitDir = \"\";\n const tokens = response.split(\" \");\n while (tokens.length) {\n const token = tokens.shift();\n if (token === \"in\") {\n gitDir = tokens.join(\" \");\n break;\n }\n }\n return new InitSummary(bare, path, /^re/i.test(response), gitDir);\n}\nvar InitSummary, initResponseRegex, reInitResponseRegex;\nvar init_InitSummary = __esm({\n \"src/lib/responses/InitSummary.ts\"() {\n InitSummary = class {\n constructor(bare, path, existing, gitDir) {\n this.bare = bare;\n this.path = path;\n this.existing = existing;\n this.gitDir = gitDir;\n }\n };\n initResponseRegex = /^Init.+ repository in (.+)$/;\n reInitResponseRegex = /^Rein.+ in (.+)$/;\n }\n});\n\n// src/lib/tasks/init.ts\nfunction hasBareCommand(command) {\n return command.includes(bareCommand);\n}\nfunction initTask(bare = false, path, customArgs) {\n const commands = [\"init\", ...customArgs];\n if (bare && !hasBareCommand(commands)) {\n commands.splice(1, 0, bareCommand);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(text) {\n return parseInit(commands.includes(\"--bare\"), path, text);\n }\n };\n}\nvar bareCommand;\nvar init_init = __esm({\n \"src/lib/tasks/init.ts\"() {\n init_InitSummary();\n bareCommand = \"--bare\";\n }\n});\n\n// src/lib/responses/DiffSummary.ts\nvar DiffSummary;\nvar init_DiffSummary = __esm({\n \"src/lib/responses/DiffSummary.ts\"() {\n DiffSummary = class {\n constructor() {\n this.changed = 0;\n this.deletions = 0;\n this.insertions = 0;\n this.files = [];\n }\n };\n }\n});\n\n// src/lib/parsers/parse-diff-summary.ts\nfunction parseDiffResult(stdOut) {\n const lines = stdOut.trim().split(\"\\n\");\n const status = new DiffSummary();\n readSummaryLine(status, lines.pop());\n for (let i = 0, max = lines.length; i < max; i++) {\n const line = lines[i];\n textFileChange(line, status) || binaryFileChange(line, status);\n }\n return status;\n}\nfunction readSummaryLine(status, summary) {\n (summary || \"\").trim().split(\", \").forEach(function(text) {\n const summary2 = /(\\d+)\\s([a-z]+)/.exec(text);\n if (!summary2) {\n return;\n }\n summaryType(status, summary2[2], parseInt(summary2[1], 10));\n });\n}\nfunction summaryType(status, key, value) {\n const match = /([a-z]+?)s?\\b/.exec(key);\n if (!match || !statusUpdate[match[1]]) {\n return;\n }\n statusUpdate[match[1]](status, value);\n}\nfunction textFileChange(input, { files }) {\n const line = input.trim().match(/^(.+)\\s+\\|\\s+(\\d+)(\\s+[+\\-]+)?$/);\n if (line) {\n var alterations = (line[3] || \"\").trim();\n files.push({\n file: line[1].trim(),\n changes: parseInt(line[2], 10),\n insertions: alterations.replace(/-/g, \"\").length,\n deletions: alterations.replace(/\\+/g, \"\").length,\n binary: false\n });\n return true;\n }\n return false;\n}\nfunction binaryFileChange(input, { files }) {\n const line = input.match(/^(.+) \\|\\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)$/);\n if (line) {\n files.push({\n file: line[1].trim(),\n before: +line[2],\n after: +line[3],\n binary: true\n });\n return true;\n }\n return false;\n}\nvar statusUpdate;\nvar init_parse_diff_summary = __esm({\n \"src/lib/parsers/parse-diff-summary.ts\"() {\n init_DiffSummary();\n statusUpdate = {\n file(status, value) {\n status.changed = value;\n },\n deletion(status, value) {\n status.deletions = value;\n },\n insertion(status, value) {\n status.insertions = value;\n }\n };\n }\n});\n\n// src/lib/parsers/parse-list-log-summary.ts\nfunction lineBuilder(tokens, fields) {\n return fields.reduce((line, field, index) => {\n line[field] = tokens[index] || \"\";\n return line;\n }, /* @__PURE__ */ Object.create({ diff: null }));\n}\nfunction createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNames) {\n return function(stdOut) {\n const all = toLinesWithContent(stdOut, true, START_BOUNDARY).map(function(item) {\n const lineDetail = item.trim().split(COMMIT_BOUNDARY);\n const listLogLine = lineBuilder(lineDetail[0].trim().split(splitter), fields);\n if (lineDetail.length > 1 && !!lineDetail[1].trim()) {\n listLogLine.diff = parseDiffResult(lineDetail[1]);\n }\n return listLogLine;\n });\n return {\n all,\n latest: all.length && all[0] || null,\n total: all.length\n };\n };\n}\nvar START_BOUNDARY, COMMIT_BOUNDARY, SPLITTER, defaultFieldNames;\nvar init_parse_list_log_summary = __esm({\n \"src/lib/parsers/parse-list-log-summary.ts\"() {\n init_utils();\n init_parse_diff_summary();\n START_BOUNDARY = \"\\xF2\\xF2\\xF2\\xF2\\xF2\\xF2 \";\n COMMIT_BOUNDARY = \" \\xF2\\xF2\";\n SPLITTER = \" \\xF2 \";\n defaultFieldNames = [\"hash\", \"date\", \"message\", \"refs\", \"author_name\", \"author_email\"];\n }\n});\n\n// src/lib/tasks/log.ts\nfunction prettyFormat(format, splitter) {\n const fields = [];\n const formatStr = [];\n Object.keys(format).forEach((field) => {\n fields.push(field);\n formatStr.push(String(format[field]));\n });\n return [\n fields,\n formatStr.join(splitter)\n ];\n}\nfunction userOptions(input) {\n return Object.keys(input).reduce((out, key) => {\n if (!(key in excludeOptions)) {\n out[key] = input[key];\n }\n return out;\n }, {});\n}\nfunction parseLogOptions(opt = {}, customArgs = []) {\n const splitter = filterType(opt.splitter, filterString, SPLITTER);\n const format = !filterPrimitives(opt.format) && opt.format ? opt.format : {\n hash: \"%H\",\n date: opt.strictDate === false ? \"%ai\" : \"%aI\",\n message: \"%s\",\n refs: \"%D\",\n body: opt.multiLine ? \"%B\" : \"%b\",\n author_name: opt.mailMap !== false ? \"%aN\" : \"%an\",\n author_email: opt.mailMap !== false ? \"%aE\" : \"%ae\"\n };\n const [fields, formatStr] = prettyFormat(format, splitter);\n const suffix = [];\n const command = [\n `--pretty=format:${START_BOUNDARY}${formatStr}${COMMIT_BOUNDARY}`,\n ...customArgs\n ];\n const maxCount = opt.n || opt[\"max-count\"] || opt.maxCount;\n if (maxCount) {\n command.push(`--max-count=${maxCount}`);\n }\n if (opt.from && opt.to) {\n const rangeOperator = opt.symmetric !== false ? \"...\" : \"..\";\n suffix.push(`${opt.from}${rangeOperator}${opt.to}`);\n }\n if (filterString(opt.file)) {\n suffix.push(\"--follow\", opt.file);\n }\n appendTaskOptions(userOptions(opt), command);\n return {\n fields,\n splitter,\n commands: [\n ...command,\n ...suffix\n ]\n };\n}\nfunction logTask(splitter, fields, customArgs) {\n return {\n commands: [\"log\", ...customArgs],\n format: \"utf-8\",\n parser: createListLogSummaryParser(splitter, fields)\n };\n}\nfunction log_default() {\n return {\n log(...rest) {\n const next = trailingFunctionArgument(arguments);\n const task = rejectDeprecatedSignatures(...rest) || createLogTask(parseLogOptions(trailingOptionsArgument(arguments), filterType(arguments[0], filterArray)));\n return this._runTask(task, next);\n }\n };\n function createLogTask(options) {\n return logTask(options.splitter, options.fields, options.commands);\n }\n function rejectDeprecatedSignatures(from, to) {\n return filterString(from) && filterString(to) && configurationErrorTask(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`);\n }\n}\nvar excludeOptions;\nvar init_log = __esm({\n \"src/lib/tasks/log.ts\"() {\n init_parse_list_log_summary();\n init_utils();\n init_task();\n excludeOptions = /* @__PURE__ */ ((excludeOptions2) => {\n excludeOptions2[excludeOptions2[\"--pretty\"] = 0] = \"--pretty\";\n excludeOptions2[excludeOptions2[\"max-count\"] = 1] = \"max-count\";\n excludeOptions2[excludeOptions2[\"maxCount\"] = 2] = \"maxCount\";\n excludeOptions2[excludeOptions2[\"n\"] = 3] = \"n\";\n excludeOptions2[excludeOptions2[\"file\"] = 4] = \"file\";\n excludeOptions2[excludeOptions2[\"format\"] = 5] = \"format\";\n excludeOptions2[excludeOptions2[\"from\"] = 6] = \"from\";\n excludeOptions2[excludeOptions2[\"to\"] = 7] = \"to\";\n excludeOptions2[excludeOptions2[\"splitter\"] = 8] = \"splitter\";\n excludeOptions2[excludeOptions2[\"symmetric\"] = 9] = \"symmetric\";\n excludeOptions2[excludeOptions2[\"mailMap\"] = 10] = \"mailMap\";\n excludeOptions2[excludeOptions2[\"multiLine\"] = 11] = \"multiLine\";\n excludeOptions2[excludeOptions2[\"strictDate\"] = 12] = \"strictDate\";\n return excludeOptions2;\n })(excludeOptions || {});\n }\n});\n\n// src/lib/responses/MergeSummary.ts\nvar MergeSummaryConflict, MergeSummaryDetail;\nvar init_MergeSummary = __esm({\n \"src/lib/responses/MergeSummary.ts\"() {\n MergeSummaryConflict = class {\n constructor(reason, file = null, meta) {\n this.reason = reason;\n this.file = file;\n this.meta = meta;\n }\n toString() {\n return `${this.file}:${this.reason}`;\n }\n };\n MergeSummaryDetail = class {\n constructor() {\n this.conflicts = [];\n this.merges = [];\n this.result = \"success\";\n }\n get failed() {\n return this.conflicts.length > 0;\n }\n get reason() {\n return this.result;\n }\n toString() {\n if (this.conflicts.length) {\n return `CONFLICTS: ${this.conflicts.join(\", \")}`;\n }\n return \"OK\";\n }\n };\n }\n});\n\n// src/lib/responses/PullSummary.ts\nvar PullSummary, PullFailedSummary;\nvar init_PullSummary = __esm({\n \"src/lib/responses/PullSummary.ts\"() {\n PullSummary = class {\n constructor() {\n this.remoteMessages = {\n all: []\n };\n this.created = [];\n this.deleted = [];\n this.files = [];\n this.deletions = {};\n this.insertions = {};\n this.summary = {\n changes: 0,\n deletions: 0,\n insertions: 0\n };\n }\n };\n PullFailedSummary = class {\n constructor() {\n this.remote = \"\";\n this.hash = {\n local: \"\",\n remote: \"\"\n };\n this.branch = {\n local: \"\",\n remote: \"\"\n };\n this.message = \"\";\n }\n toString() {\n return this.message;\n }\n };\n }\n});\n\n// src/lib/parsers/parse-remote-objects.ts\nfunction objectEnumerationResult(remoteMessages) {\n return remoteMessages.objects = remoteMessages.objects || {\n compressing: 0,\n counting: 0,\n enumerating: 0,\n packReused: 0,\n reused: { count: 0, delta: 0 },\n total: { count: 0, delta: 0 }\n };\n}\nfunction asObjectCount(source) {\n const count = /^\\s*(\\d+)/.exec(source);\n const delta = /delta (\\d+)/i.exec(source);\n return {\n count: asNumber(count && count[1] || \"0\"),\n delta: asNumber(delta && delta[1] || \"0\")\n };\n}\nvar remoteMessagesObjectParsers;\nvar init_parse_remote_objects = __esm({\n \"src/lib/parsers/parse-remote-objects.ts\"() {\n init_utils();\n remoteMessagesObjectParsers = [\n new RemoteLineParser(/^remote:\\s*(enumerating|counting|compressing) objects: (\\d+),/i, (result, [action, count]) => {\n const key = action.toLowerCase();\n const enumeration = objectEnumerationResult(result.remoteMessages);\n Object.assign(enumeration, { [key]: asNumber(count) });\n }),\n new RemoteLineParser(/^remote:\\s*(enumerating|counting|compressing) objects: \\d+% \\(\\d+\\/(\\d+)\\),/i, (result, [action, count]) => {\n const key = action.toLowerCase();\n const enumeration = objectEnumerationResult(result.remoteMessages);\n Object.assign(enumeration, { [key]: asNumber(count) });\n }),\n new RemoteLineParser(/total ([^,]+), reused ([^,]+), pack-reused (\\d+)/i, (result, [total, reused, packReused]) => {\n const objects = objectEnumerationResult(result.remoteMessages);\n objects.total = asObjectCount(total);\n objects.reused = asObjectCount(reused);\n objects.packReused = asNumber(packReused);\n })\n ];\n }\n});\n\n// src/lib/parsers/parse-remote-messages.ts\nfunction parseRemoteMessages(_stdOut, stdErr) {\n return parseStringResponse({ remoteMessages: new RemoteMessageSummary() }, parsers, stdErr);\n}\nvar parsers, RemoteMessageSummary;\nvar init_parse_remote_messages = __esm({\n \"src/lib/parsers/parse-remote-messages.ts\"() {\n init_utils();\n init_parse_remote_objects();\n parsers = [\n new RemoteLineParser(/^remote:\\s*(.+)$/, (result, [text]) => {\n result.remoteMessages.all.push(text.trim());\n return false;\n }),\n ...remoteMessagesObjectParsers,\n new RemoteLineParser([/create a (?:pull|merge) request/i, /\\s(https?:\\/\\/\\S+)$/], (result, [pullRequestUrl]) => {\n result.remoteMessages.pullRequestUrl = pullRequestUrl;\n }),\n new RemoteLineParser([/found (\\d+) vulnerabilities.+\\(([^)]+)\\)/i, /\\s(https?:\\/\\/\\S+)$/], (result, [count, summary, url]) => {\n result.remoteMessages.vulnerabilities = {\n count: asNumber(count),\n summary,\n url\n };\n })\n ];\n RemoteMessageSummary = class {\n constructor() {\n this.all = [];\n }\n };\n }\n});\n\n// src/lib/parsers/parse-pull.ts\nfunction parsePullErrorResult(stdOut, stdErr) {\n const pullError = parseStringResponse(new PullFailedSummary(), errorParsers, stdOut, stdErr);\n return pullError.message && pullError;\n}\nvar FILE_UPDATE_REGEX, SUMMARY_REGEX, ACTION_REGEX, parsers2, errorParsers, parsePullDetail, parsePullResult;\nvar init_parse_pull = __esm({\n \"src/lib/parsers/parse-pull.ts\"() {\n init_PullSummary();\n init_utils();\n init_parse_remote_messages();\n FILE_UPDATE_REGEX = /^\\s*(.+?)\\s+\\|\\s+\\d+\\s*(\\+*)(-*)/;\n SUMMARY_REGEX = /(\\d+)\\D+((\\d+)\\D+\\(\\+\\))?(\\D+(\\d+)\\D+\\(-\\))?/;\n ACTION_REGEX = /^(create|delete) mode \\d+ (.+)/;\n parsers2 = [\n new LineParser(FILE_UPDATE_REGEX, (result, [file, insertions, deletions]) => {\n result.files.push(file);\n if (insertions) {\n result.insertions[file] = insertions.length;\n }\n if (deletions) {\n result.deletions[file] = deletions.length;\n }\n }),\n new LineParser(SUMMARY_REGEX, (result, [changes, , insertions, , deletions]) => {\n if (insertions !== void 0 || deletions !== void 0) {\n result.summary.changes = +changes || 0;\n result.summary.insertions = +insertions || 0;\n result.summary.deletions = +deletions || 0;\n return true;\n }\n return false;\n }),\n new LineParser(ACTION_REGEX, (result, [action, file]) => {\n append(result.files, file);\n append(action === \"create\" ? result.created : result.deleted, file);\n })\n ];\n errorParsers = [\n new LineParser(/^from\\s(.+)$/i, (result, [remote]) => void (result.remote = remote)),\n new LineParser(/^fatal:\\s(.+)$/, (result, [message]) => void (result.message = message)),\n new LineParser(/([a-z0-9]+)\\.\\.([a-z0-9]+)\\s+(\\S+)\\s+->\\s+(\\S+)$/, (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => {\n result.branch.local = branchLocal;\n result.hash.local = hashLocal;\n result.branch.remote = branchRemote;\n result.hash.remote = hashRemote;\n })\n ];\n parsePullDetail = (stdOut, stdErr) => {\n return parseStringResponse(new PullSummary(), parsers2, stdOut, stdErr);\n };\n parsePullResult = (stdOut, stdErr) => {\n return Object.assign(new PullSummary(), parsePullDetail(stdOut, stdErr), parseRemoteMessages(stdOut, stdErr));\n };\n }\n});\n\n// src/lib/parsers/parse-merge.ts\nvar parsers3, parseMergeResult, parseMergeDetail;\nvar init_parse_merge = __esm({\n \"src/lib/parsers/parse-merge.ts\"() {\n init_MergeSummary();\n init_utils();\n init_parse_pull();\n parsers3 = [\n new LineParser(/^Auto-merging\\s+(.+)$/, (summary, [autoMerge]) => {\n summary.merges.push(autoMerge);\n }),\n new LineParser(/^CONFLICT\\s+\\((.+)\\): Merge conflict in (.+)$/, (summary, [reason, file]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, file));\n }),\n new LineParser(/^CONFLICT\\s+\\((.+\\/delete)\\): (.+) deleted in (.+) and/, (summary, [reason, file, deleteRef]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef }));\n }),\n new LineParser(/^CONFLICT\\s+\\((.+)\\):/, (summary, [reason]) => {\n summary.conflicts.push(new MergeSummaryConflict(reason, null));\n }),\n new LineParser(/^Automatic merge failed;\\s+(.+)$/, (summary, [result]) => {\n summary.result = result;\n })\n ];\n parseMergeResult = (stdOut, stdErr) => {\n return Object.assign(parseMergeDetail(stdOut, stdErr), parsePullResult(stdOut, stdErr));\n };\n parseMergeDetail = (stdOut) => {\n return parseStringResponse(new MergeSummaryDetail(), parsers3, stdOut);\n };\n }\n});\n\n// src/lib/tasks/merge.ts\nfunction mergeTask(customArgs) {\n if (!customArgs.length) {\n return configurationErrorTask(\"Git.merge requires at least one option\");\n }\n return {\n commands: [\"merge\", ...customArgs],\n format: \"utf-8\",\n parser(stdOut, stdErr) {\n const merge = parseMergeResult(stdOut, stdErr);\n if (merge.failed) {\n throw new GitResponseError(merge);\n }\n return merge;\n }\n };\n}\nvar init_merge = __esm({\n \"src/lib/tasks/merge.ts\"() {\n init_git_response_error();\n init_parse_merge();\n init_task();\n }\n});\n\n// src/lib/parsers/parse-push.ts\nfunction pushResultPushedItem(local, remote, status) {\n const deleted = status.includes(\"deleted\");\n const tag = status.includes(\"tag\") || /^refs\\/tags/.test(local);\n const alreadyUpdated = !status.includes(\"new\");\n return {\n deleted,\n tag,\n branch: !tag,\n new: !alreadyUpdated,\n alreadyUpdated,\n local,\n remote\n };\n}\nvar parsers4, parsePushResult, parsePushDetail;\nvar init_parse_push = __esm({\n \"src/lib/parsers/parse-push.ts\"() {\n init_utils();\n init_parse_remote_messages();\n parsers4 = [\n new LineParser(/^Pushing to (.+)$/, (result, [repo]) => {\n result.repo = repo;\n }),\n new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {\n result.ref = __spreadProps(__spreadValues({}, result.ref || {}), {\n local\n });\n }),\n new LineParser(/^[*-=]\\s+([^:]+):(\\S+)\\s+\\[(.+)]$/, (result, [local, remote, type]) => {\n result.pushed.push(pushResultPushedItem(local, remote, type));\n }),\n new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, (result, [local, remote, remoteName]) => {\n result.branch = __spreadProps(__spreadValues({}, result.branch || {}), {\n local,\n remote,\n remoteName\n });\n }),\n new LineParser(/^([^:]+):(\\S+)\\s+([a-z0-9]+)\\.\\.([a-z0-9]+)$/, (result, [local, remote, from, to]) => {\n result.update = {\n head: {\n local,\n remote\n },\n hash: {\n from,\n to\n }\n };\n })\n ];\n parsePushResult = (stdOut, stdErr) => {\n const pushDetail = parsePushDetail(stdOut, stdErr);\n const responseDetail = parseRemoteMessages(stdOut, stdErr);\n return __spreadValues(__spreadValues({}, pushDetail), responseDetail);\n };\n parsePushDetail = (stdOut, stdErr) => {\n return parseStringResponse({ pushed: [] }, parsers4, stdOut, stdErr);\n };\n }\n});\n\n// src/lib/tasks/push.ts\nvar push_exports = {};\n__export(push_exports, {\n pushTagsTask: () => pushTagsTask,\n pushTask: () => pushTask\n});\nfunction pushTagsTask(ref = {}, customArgs) {\n append(customArgs, \"--tags\");\n return pushTask(ref, customArgs);\n}\nfunction pushTask(ref = {}, customArgs) {\n const commands = [\"push\", ...customArgs];\n if (ref.branch) {\n commands.splice(1, 0, ref.branch);\n }\n if (ref.remote) {\n commands.splice(1, 0, ref.remote);\n }\n remove(commands, \"-v\");\n append(commands, \"--verbose\");\n append(commands, \"--porcelain\");\n return {\n commands,\n format: \"utf-8\",\n parser: parsePushResult\n };\n}\nvar init_push = __esm({\n \"src/lib/tasks/push.ts\"() {\n init_parse_push();\n init_utils();\n }\n});\n\n// src/lib/responses/FileStatusSummary.ts\nvar fromPathRegex, FileStatusSummary;\nvar init_FileStatusSummary = __esm({\n \"src/lib/responses/FileStatusSummary.ts\"() {\n fromPathRegex = /^(.+) -> (.+)$/;\n FileStatusSummary = class {\n constructor(path, index, working_dir) {\n this.path = path;\n this.index = index;\n this.working_dir = working_dir;\n if (index + working_dir === \"R\") {\n const detail = fromPathRegex.exec(path) || [null, path, path];\n this.from = detail[1] || \"\";\n this.path = detail[2] || \"\";\n }\n }\n };\n }\n});\n\n// src/lib/responses/StatusSummary.ts\nfunction renamedFile(line) {\n const detail = /^(.+) -> (.+)$/.exec(line);\n if (!detail) {\n return {\n from: line,\n to: line\n };\n }\n return {\n from: String(detail[1]),\n to: String(detail[2])\n };\n}\nfunction parser2(indexX, indexY, handler) {\n return [`${indexX}${indexY}`, handler];\n}\nfunction conflicts(indexX, ...indexY) {\n return indexY.map((y) => parser2(indexX, y, (result, file) => append(result.conflicted, file)));\n}\nfunction splitLine(result, lineStr) {\n const trimmed2 = lineStr.trim();\n switch (\" \") {\n case trimmed2.charAt(2):\n return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));\n case trimmed2.charAt(1):\n return data(\" \" /* NONE */, trimmed2.charAt(0), trimmed2.substr(2));\n default:\n return;\n }\n function data(index, workingDir, path) {\n const raw = `${index}${workingDir}`;\n const handler = parsers5.get(raw);\n if (handler) {\n handler(result, path);\n }\n if (raw !== \"##\" && raw !== \"!!\") {\n result.files.push(new FileStatusSummary(path, index, workingDir));\n }\n }\n}\nvar StatusSummary, parsers5, parseStatusSummary;\nvar init_StatusSummary = __esm({\n \"src/lib/responses/StatusSummary.ts\"() {\n init_utils();\n init_FileStatusSummary();\n StatusSummary = class {\n constructor() {\n this.not_added = [];\n this.conflicted = [];\n this.created = [];\n this.deleted = [];\n this.ignored = void 0;\n this.modified = [];\n this.renamed = [];\n this.files = [];\n this.staged = [];\n this.ahead = 0;\n this.behind = 0;\n this.current = null;\n this.tracking = null;\n this.detached = false;\n this.isClean = () => {\n return !this.files.length;\n };\n }\n };\n parsers5 = new Map([\n parser2(\" \" /* NONE */, \"A\" /* ADDED */, (result, file) => append(result.created, file)),\n parser2(\" \" /* NONE */, \"D\" /* DELETED */, (result, file) => append(result.deleted, file)),\n parser2(\" \" /* NONE */, \"M\" /* MODIFIED */, (result, file) => append(result.modified, file)),\n parser2(\"A\" /* ADDED */, \" \" /* NONE */, (result, file) => append(result.created, file) && append(result.staged, file)),\n parser2(\"A\" /* ADDED */, \"M\" /* MODIFIED */, (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)),\n parser2(\"D\" /* DELETED */, \" \" /* NONE */, (result, file) => append(result.deleted, file) && append(result.staged, file)),\n parser2(\"M\" /* MODIFIED */, \" \" /* NONE */, (result, file) => append(result.modified, file) && append(result.staged, file)),\n parser2(\"M\" /* MODIFIED */, \"M\" /* MODIFIED */, (result, file) => append(result.modified, file) && append(result.staged, file)),\n parser2(\"R\" /* RENAMED */, \" \" /* NONE */, (result, file) => {\n append(result.renamed, renamedFile(file));\n }),\n parser2(\"R\" /* RENAMED */, \"M\" /* MODIFIED */, (result, file) => {\n const renamed = renamedFile(file);\n append(result.renamed, renamed);\n append(result.modified, renamed.to);\n }),\n parser2(\"!\" /* IGNORED */, \"!\" /* IGNORED */, (_result, _file) => {\n append(_result.ignored = _result.ignored || [], _file);\n }),\n parser2(\"?\" /* UNTRACKED */, \"?\" /* UNTRACKED */, (result, file) => append(result.not_added, file)),\n ...conflicts(\"A\" /* ADDED */, \"A\" /* ADDED */, \"U\" /* UNMERGED */),\n ...conflicts(\"D\" /* DELETED */, \"D\" /* DELETED */, \"U\" /* UNMERGED */),\n ...conflicts(\"U\" /* UNMERGED */, \"A\" /* ADDED */, \"D\" /* DELETED */, \"U\" /* UNMERGED */),\n [\"##\", (result, line) => {\n const aheadReg = /ahead (\\d+)/;\n const behindReg = /behind (\\d+)/;\n const currentReg = /^(.+?(?=(?:\\.{3}|\\s|$)))/;\n const trackingReg = /\\.{3}(\\S*)/;\n const onEmptyBranchReg = /\\son\\s([\\S]+)$/;\n let regexResult;\n regexResult = aheadReg.exec(line);\n result.ahead = regexResult && +regexResult[1] || 0;\n regexResult = behindReg.exec(line);\n result.behind = regexResult && +regexResult[1] || 0;\n regexResult = currentReg.exec(line);\n result.current = regexResult && regexResult[1];\n regexResult = trackingReg.exec(line);\n result.tracking = regexResult && regexResult[1];\n regexResult = onEmptyBranchReg.exec(line);\n result.current = regexResult && regexResult[1] || result.current;\n result.detached = /\\(no branch\\)/.test(line);\n }]\n ]);\n parseStatusSummary = function(text) {\n const lines = text.trim().split(\"\\n\");\n const status = new StatusSummary();\n for (let i = 0, l = lines.length; i < l; i++) {\n splitLine(status, lines[i]);\n }\n return status;\n };\n }\n});\n\n// src/lib/tasks/status.ts\nfunction statusTask(customArgs) {\n return {\n format: \"utf-8\",\n commands: [\"status\", \"--porcelain\", \"-b\", \"-u\", ...customArgs],\n parser(text) {\n return parseStatusSummary(text);\n }\n };\n}\nvar init_status = __esm({\n \"src/lib/tasks/status.ts\"() {\n init_StatusSummary();\n }\n});\n\n// src/lib/simple-git-api.ts\nvar simple_git_api_exports = {};\n__export(simple_git_api_exports, {\n SimpleGitApi: () => SimpleGitApi\n});\nvar SimpleGitApi;\nvar init_simple_git_api = __esm({\n \"src/lib/simple-git-api.ts\"() {\n init_task_callback();\n init_change_working_directory();\n init_config();\n init_grep();\n init_hash_object();\n init_init();\n init_log();\n init_merge();\n init_push();\n init_status();\n init_task();\n init_utils();\n SimpleGitApi = class {\n constructor(_executor) {\n this._executor = _executor;\n }\n _runTask(task, then) {\n const chain = this._executor.chain();\n const promise = chain.push(task);\n if (then) {\n taskCallback(task, promise, then);\n }\n return Object.create(this, {\n then: { value: promise.then.bind(promise) },\n catch: { value: promise.catch.bind(promise) },\n _executor: { value: chain }\n });\n }\n add(files) {\n return this._runTask(straightThroughStringTask([\"add\", ...asArray(files)]), trailingFunctionArgument(arguments));\n }\n cwd(directory) {\n const next = trailingFunctionArgument(arguments);\n if (typeof directory === \"string\") {\n return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next);\n }\n if (typeof (directory == null ? void 0 : directory.path) === \"string\") {\n return this._runTask(changeWorkingDirectoryTask(directory.path, directory.root && this._executor || void 0), next);\n }\n return this._runTask(configurationErrorTask(\"Git.cwd: workingDirectory must be supplied as a string\"), next);\n }\n hashObject(path, write) {\n return this._runTask(hashObjectTask(path, write === true), trailingFunctionArgument(arguments));\n }\n init(bare) {\n return this._runTask(initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)), trailingFunctionArgument(arguments));\n }\n merge() {\n return this._runTask(mergeTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));\n }\n mergeFromTo(remote, branch) {\n if (!(filterString(remote) && filterString(branch))) {\n return this._runTask(configurationErrorTask(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`));\n }\n return this._runTask(mergeTask([remote, branch, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments, false));\n }\n outputHandler(handler) {\n this._executor.outputHandler = handler;\n return this;\n }\n push() {\n const task = pushTask({\n remote: filterType(arguments[0], filterString),\n branch: filterType(arguments[1], filterString)\n }, getTrailingOptions(arguments));\n return this._runTask(task, trailingFunctionArgument(arguments));\n }\n stash() {\n return this._runTask(straightThroughStringTask([\"stash\", ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments));\n }\n status() {\n return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));\n }\n };\n Object.assign(SimpleGitApi.prototype, config_default(), grep_default(), log_default());\n }\n});\n\n// src/lib/runners/scheduler.ts\nvar scheduler_exports = {};\n__export(scheduler_exports, {\n Scheduler: () => Scheduler\n});\nvar import_promise_deferred2, createScheduledTask, Scheduler;\nvar init_scheduler = __esm({\n \"src/lib/runners/scheduler.ts\"() {\n init_utils();\n import_promise_deferred2 = require(\"@kwsites/promise-deferred\");\n init_git_logger();\n createScheduledTask = (() => {\n let id = 0;\n return () => {\n id++;\n const { promise, done } = (0, import_promise_deferred2.createDeferred)();\n return {\n promise,\n done,\n id\n };\n };\n })();\n Scheduler = class {\n constructor(concurrency = 2) {\n this.concurrency = concurrency;\n this.logger = createLogger(\"\", \"scheduler\");\n this.pending = [];\n this.running = [];\n this.logger(`Constructed, concurrency=%s`, concurrency);\n }\n schedule() {\n if (!this.pending.length || this.running.length >= this.concurrency) {\n this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`, this.pending.length, this.running.length, this.concurrency);\n return;\n }\n const task = append(this.running, this.pending.shift());\n this.logger(`Attempting id=%s`, task.id);\n task.done(() => {\n this.logger(`Completing id=`, task.id);\n remove(this.running, task);\n this.schedule();\n });\n }\n next() {\n const { promise, id } = append(this.pending, createScheduledTask());\n this.logger(`Scheduling id=%s`, id);\n this.schedule();\n return promise;\n }\n };\n }\n});\n\n// src/lib/tasks/apply-patch.ts\nvar apply_patch_exports = {};\n__export(apply_patch_exports, {\n applyPatchTask: () => applyPatchTask\n});\nfunction applyPatchTask(patches, customArgs) {\n return straightThroughStringTask([\"apply\", ...customArgs, ...patches]);\n}\nvar init_apply_patch = __esm({\n \"src/lib/tasks/apply-patch.ts\"() {\n init_task();\n }\n});\n\n// src/lib/responses/BranchDeleteSummary.ts\nfunction branchDeletionSuccess(branch, hash) {\n return {\n branch,\n hash,\n success: true\n };\n}\nfunction branchDeletionFailure(branch) {\n return {\n branch,\n hash: null,\n success: false\n };\n}\nvar BranchDeletionBatch;\nvar init_BranchDeleteSummary = __esm({\n \"src/lib/responses/BranchDeleteSummary.ts\"() {\n BranchDeletionBatch = class {\n constructor() {\n this.all = [];\n this.branches = {};\n this.errors = [];\n }\n get success() {\n return !this.errors.length;\n }\n };\n }\n});\n\n// src/lib/parsers/parse-branch-delete.ts\nfunction hasBranchDeletionError(data, processExitCode) {\n return processExitCode === 1 /* ERROR */ && deleteErrorRegex.test(data);\n}\nvar deleteSuccessRegex, deleteErrorRegex, parsers6, parseBranchDeletions;\nvar init_parse_branch_delete = __esm({\n \"src/lib/parsers/parse-branch-delete.ts\"() {\n init_BranchDeleteSummary();\n init_utils();\n deleteSuccessRegex = /(\\S+)\\s+\\(\\S+\\s([^)]+)\\)/;\n deleteErrorRegex = /^error[^']+'([^']+)'/m;\n parsers6 = [\n new LineParser(deleteSuccessRegex, (result, [branch, hash]) => {\n const deletion = branchDeletionSuccess(branch, hash);\n result.all.push(deletion);\n result.branches[branch] = deletion;\n }),\n new LineParser(deleteErrorRegex, (result, [branch]) => {\n const deletion = branchDeletionFailure(branch);\n result.errors.push(deletion);\n result.all.push(deletion);\n result.branches[branch] = deletion;\n })\n ];\n parseBranchDeletions = (stdOut, stdErr) => {\n return parseStringResponse(new BranchDeletionBatch(), parsers6, stdOut, stdErr);\n };\n }\n});\n\n// src/lib/responses/BranchSummary.ts\nvar BranchSummaryResult;\nvar init_BranchSummary = __esm({\n \"src/lib/responses/BranchSummary.ts\"() {\n BranchSummaryResult = class {\n constructor() {\n this.all = [];\n this.branches = {};\n this.current = \"\";\n this.detached = false;\n }\n push(current, detached, name, commit, label) {\n if (current) {\n this.detached = detached;\n this.current = name;\n }\n this.all.push(name);\n this.branches[name] = {\n current,\n name,\n commit,\n label\n };\n }\n };\n }\n});\n\n// src/lib/parsers/parse-branch.ts\nfunction parseBranchSummary(stdOut) {\n return parseStringResponse(new BranchSummaryResult(), parsers7, stdOut);\n}\nvar parsers7;\nvar init_parse_branch = __esm({\n \"src/lib/parsers/parse-branch.ts\"() {\n init_BranchSummary();\n init_utils();\n parsers7 = [\n new LineParser(/^(\\*\\s)?\\((?:HEAD )?detached (?:from|at) (\\S+)\\)\\s+([a-z0-9]+)\\s(.*)$/, (result, [current, name, commit, label]) => {\n result.push(!!current, true, name, commit, label);\n }),\n new LineParser(/^(\\*\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$/s, (result, [current, name, commit, label]) => {\n result.push(!!current, false, name, commit, label);\n })\n ];\n }\n});\n\n// src/lib/tasks/branch.ts\nvar branch_exports = {};\n__export(branch_exports, {\n branchLocalTask: () => branchLocalTask,\n branchTask: () => branchTask,\n containsDeleteBranchCommand: () => containsDeleteBranchCommand,\n deleteBranchTask: () => deleteBranchTask,\n deleteBranchesTask: () => deleteBranchesTask\n});\nfunction containsDeleteBranchCommand(commands) {\n const deleteCommands = [\"-d\", \"-D\", \"--delete\"];\n return commands.some((command) => deleteCommands.includes(command));\n}\nfunction branchTask(customArgs) {\n const isDelete = containsDeleteBranchCommand(customArgs);\n const commands = [\"branch\", ...customArgs];\n if (commands.length === 1) {\n commands.push(\"-a\");\n }\n if (!commands.includes(\"-v\")) {\n commands.splice(1, 0, \"-v\");\n }\n return {\n format: \"utf-8\",\n commands,\n parser(stdOut, stdErr) {\n if (isDelete) {\n return parseBranchDeletions(stdOut, stdErr).all[0];\n }\n return parseBranchSummary(stdOut);\n }\n };\n}\nfunction branchLocalTask() {\n const parser3 = parseBranchSummary;\n return {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\"],\n parser: parser3\n };\n}\nfunction deleteBranchesTask(branches, forceDelete = false) {\n return {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\", forceDelete ? \"-D\" : \"-d\", ...branches],\n parser(stdOut, stdErr) {\n return parseBranchDeletions(stdOut, stdErr);\n },\n onError({ exitCode, stdOut }, error, done, fail) {\n if (!hasBranchDeletionError(String(error), exitCode)) {\n return fail(error);\n }\n done(stdOut);\n }\n };\n}\nfunction deleteBranchTask(branch, forceDelete = false) {\n const task = {\n format: \"utf-8\",\n commands: [\"branch\", \"-v\", forceDelete ? \"-D\" : \"-d\", branch],\n parser(stdOut, stdErr) {\n return parseBranchDeletions(stdOut, stdErr).branches[branch];\n },\n onError({ exitCode, stdErr, stdOut }, error, _, fail) {\n if (!hasBranchDeletionError(String(error), exitCode)) {\n return fail(error);\n }\n throw new GitResponseError(task.parser(bufferToString(stdOut), bufferToString(stdErr)), String(error));\n }\n };\n return task;\n}\nvar init_branch = __esm({\n \"src/lib/tasks/branch.ts\"() {\n init_git_response_error();\n init_parse_branch_delete();\n init_parse_branch();\n init_utils();\n }\n});\n\n// src/lib/responses/CheckIgnore.ts\nvar parseCheckIgnore;\nvar init_CheckIgnore = __esm({\n \"src/lib/responses/CheckIgnore.ts\"() {\n parseCheckIgnore = (text) => {\n return text.split(/\\n/g).map((line) => line.trim()).filter((file) => !!file);\n };\n }\n});\n\n// src/lib/tasks/check-ignore.ts\nvar check_ignore_exports = {};\n__export(check_ignore_exports, {\n checkIgnoreTask: () => checkIgnoreTask\n});\nfunction checkIgnoreTask(paths) {\n return {\n commands: [\"check-ignore\", ...paths],\n format: \"utf-8\",\n parser: parseCheckIgnore\n };\n}\nvar init_check_ignore = __esm({\n \"src/lib/tasks/check-ignore.ts\"() {\n init_CheckIgnore();\n }\n});\n\n// src/lib/tasks/clone.ts\nvar clone_exports = {};\n__export(clone_exports, {\n cloneMirrorTask: () => cloneMirrorTask,\n cloneTask: () => cloneTask\n});\nfunction cloneTask(repo, directory, customArgs) {\n const commands = [\"clone\", ...customArgs];\n if (typeof repo === \"string\") {\n commands.push(repo);\n }\n if (typeof directory === \"string\") {\n commands.push(directory);\n }\n return straightThroughStringTask(commands);\n}\nfunction cloneMirrorTask(repo, directory, customArgs) {\n append(customArgs, \"--mirror\");\n return cloneTask(repo, directory, customArgs);\n}\nvar init_clone = __esm({\n \"src/lib/tasks/clone.ts\"() {\n init_task();\n init_utils();\n }\n});\n\n// src/lib/parsers/parse-commit.ts\nfunction parseCommitResult(stdOut) {\n const result = {\n author: null,\n branch: \"\",\n commit: \"\",\n root: false,\n summary: {\n changes: 0,\n insertions: 0,\n deletions: 0\n }\n };\n return parseStringResponse(result, parsers8, stdOut);\n}\nvar parsers8;\nvar init_parse_commit = __esm({\n \"src/lib/parsers/parse-commit.ts\"() {\n init_utils();\n parsers8 = [\n new LineParser(/^\\[([^\\s]+)( \\([^)]+\\))? ([^\\]]+)/, (result, [branch, root, commit]) => {\n result.branch = branch;\n result.commit = commit;\n result.root = !!root;\n }),\n new LineParser(/\\s*Author:\\s(.+)/i, (result, [author]) => {\n const parts = author.split(\"<\");\n const email = parts.pop();\n if (!email || !email.includes(\"@\")) {\n return;\n }\n result.author = {\n email: email.substr(0, email.length - 1),\n name: parts.join(\"<\").trim()\n };\n }),\n new LineParser(/(\\d+)[^,]*(?:,\\s*(\\d+)[^,]*)(?:,\\s*(\\d+))/g, (result, [changes, insertions, deletions]) => {\n result.summary.changes = parseInt(changes, 10) || 0;\n result.summary.insertions = parseInt(insertions, 10) || 0;\n result.summary.deletions = parseInt(deletions, 10) || 0;\n }),\n new LineParser(/^(\\d+)[^,]*(?:,\\s*(\\d+)[^(]+\\(([+-]))?/, (result, [changes, lines, direction]) => {\n result.summary.changes = parseInt(changes, 10) || 0;\n const count = parseInt(lines, 10) || 0;\n if (direction === \"-\") {\n result.summary.deletions = count;\n } else if (direction === \"+\") {\n result.summary.insertions = count;\n }\n })\n ];\n }\n});\n\n// src/lib/tasks/commit.ts\nvar commit_exports = {};\n__export(commit_exports, {\n commitTask: () => commitTask\n});\nfunction commitTask(message, files, customArgs) {\n const commands = [\"commit\"];\n message.forEach((m) => commands.push(\"-m\", m));\n commands.push(...files, ...customArgs);\n return {\n commands,\n format: \"utf-8\",\n parser: parseCommitResult\n };\n}\nvar init_commit = __esm({\n \"src/lib/tasks/commit.ts\"() {\n init_parse_commit();\n }\n});\n\n// src/lib/tasks/diff.ts\nvar diff_exports = {};\n__export(diff_exports, {\n diffSummaryTask: () => diffSummaryTask\n});\nfunction diffSummaryTask(customArgs) {\n return {\n commands: [\"diff\", \"--stat=4096\", ...customArgs],\n format: \"utf-8\",\n parser(stdOut) {\n return parseDiffResult(stdOut);\n }\n };\n}\nvar init_diff = __esm({\n \"src/lib/tasks/diff.ts\"() {\n init_parse_diff_summary();\n }\n});\n\n// src/lib/parsers/parse-fetch.ts\nfunction parseFetchResult(stdOut, stdErr) {\n const result = {\n raw: stdOut,\n remote: null,\n branches: [],\n tags: []\n };\n return parseStringResponse(result, parsers9, stdOut, stdErr);\n}\nvar parsers9;\nvar init_parse_fetch = __esm({\n \"src/lib/parsers/parse-fetch.ts\"() {\n init_utils();\n parsers9 = [\n new LineParser(/From (.+)$/, (result, [remote]) => {\n result.remote = remote;\n }),\n new LineParser(/\\* \\[new branch]\\s+(\\S+)\\s*-> (.+)$/, (result, [name, tracking]) => {\n result.branches.push({\n name,\n tracking\n });\n }),\n new LineParser(/\\* \\[new tag]\\s+(\\S+)\\s*-> (.+)$/, (result, [name, tracking]) => {\n result.tags.push({\n name,\n tracking\n });\n })\n ];\n }\n});\n\n// src/lib/tasks/fetch.ts\nvar fetch_exports = {};\n__export(fetch_exports, {\n fetchTask: () => fetchTask\n});\nfunction fetchTask(remote, branch, customArgs) {\n const commands = [\"fetch\", ...customArgs];\n if (remote && branch) {\n commands.push(remote, branch);\n }\n return {\n commands,\n format: \"utf-8\",\n parser: parseFetchResult\n };\n}\nvar init_fetch = __esm({\n \"src/lib/tasks/fetch.ts\"() {\n init_parse_fetch();\n }\n});\n\n// src/lib/parsers/parse-move.ts\nfunction parseMoveResult(stdOut) {\n return parseStringResponse({ moves: [] }, parsers10, stdOut);\n}\nvar parsers10;\nvar init_parse_move = __esm({\n \"src/lib/parsers/parse-move.ts\"() {\n init_utils();\n parsers10 = [\n new LineParser(/^Renaming (.+) to (.+)$/, (result, [from, to]) => {\n result.moves.push({ from, to });\n })\n ];\n }\n});\n\n// src/lib/tasks/move.ts\nvar move_exports = {};\n__export(move_exports, {\n moveTask: () => moveTask\n});\nfunction moveTask(from, to) {\n return {\n commands: [\"mv\", \"-v\", ...asArray(from), to],\n format: \"utf-8\",\n parser: parseMoveResult\n };\n}\nvar init_move = __esm({\n \"src/lib/tasks/move.ts\"() {\n init_parse_move();\n init_utils();\n }\n});\n\n// src/lib/tasks/pull.ts\nvar pull_exports = {};\n__export(pull_exports, {\n pullTask: () => pullTask\n});\nfunction pullTask(remote, branch, customArgs) {\n const commands = [\"pull\", ...customArgs];\n if (remote && branch) {\n commands.splice(1, 0, remote, branch);\n }\n return {\n commands,\n format: \"utf-8\",\n parser(stdOut, stdErr) {\n return parsePullResult(stdOut, stdErr);\n },\n onError(result, _error, _done, fail) {\n const pullError = parsePullErrorResult(bufferToString(result.stdOut), bufferToString(result.stdErr));\n if (pullError) {\n return fail(new GitResponseError(pullError));\n }\n fail(_error);\n }\n };\n}\nvar init_pull = __esm({\n \"src/lib/tasks/pull.ts\"() {\n init_git_response_error();\n init_parse_pull();\n init_utils();\n }\n});\n\n// src/lib/responses/GetRemoteSummary.ts\nfunction parseGetRemotes(text) {\n const remotes = {};\n forEach(text, ([name]) => remotes[name] = { name });\n return Object.values(remotes);\n}\nfunction parseGetRemotesVerbose(text) {\n const remotes = {};\n forEach(text, ([name, url, purpose]) => {\n if (!remotes.hasOwnProperty(name)) {\n remotes[name] = {\n name,\n refs: { fetch: \"\", push: \"\" }\n };\n }\n if (purpose && url) {\n remotes[name].refs[purpose.replace(/[^a-z]/g, \"\")] = url;\n }\n });\n return Object.values(remotes);\n}\nfunction forEach(text, handler) {\n forEachLineWithContent(text, (line) => handler(line.split(/\\s+/)));\n}\nvar init_GetRemoteSummary = __esm({\n \"src/lib/responses/GetRemoteSummary.ts\"() {\n init_utils();\n }\n});\n\n// src/lib/tasks/remote.ts\nvar remote_exports = {};\n__export(remote_exports, {\n addRemoteTask: () => addRemoteTask,\n getRemotesTask: () => getRemotesTask,\n listRemotesTask: () => listRemotesTask,\n remoteTask: () => remoteTask,\n removeRemoteTask: () => removeRemoteTask\n});\nfunction addRemoteTask(remoteName, remoteRepo, customArgs = []) {\n return straightThroughStringTask([\"remote\", \"add\", ...customArgs, remoteName, remoteRepo]);\n}\nfunction getRemotesTask(verbose) {\n const commands = [\"remote\"];\n if (verbose) {\n commands.push(\"-v\");\n }\n return {\n commands,\n format: \"utf-8\",\n parser: verbose ? parseGetRemotesVerbose : parseGetRemotes\n };\n}\nfunction listRemotesTask(customArgs = []) {\n const commands = [...customArgs];\n if (commands[0] !== \"ls-remote\") {\n commands.unshift(\"ls-remote\");\n }\n return straightThroughStringTask(commands);\n}\nfunction remoteTask(customArgs = []) {\n const commands = [...customArgs];\n if (commands[0] !== \"remote\") {\n commands.unshift(\"remote\");\n }\n return straightThroughStringTask(commands);\n}\nfunction removeRemoteTask(remoteName) {\n return straightThroughStringTask([\"remote\", \"remove\", remoteName]);\n}\nvar init_remote = __esm({\n \"src/lib/tasks/remote.ts\"() {\n init_GetRemoteSummary();\n init_task();\n }\n});\n\n// src/lib/tasks/stash-list.ts\nvar stash_list_exports = {};\n__export(stash_list_exports, {\n stashListTask: () => stashListTask\n});\nfunction stashListTask(opt = {}, customArgs) {\n const options = parseLogOptions(opt);\n const parser3 = createListLogSummaryParser(options.splitter, options.fields);\n return {\n commands: [\"stash\", \"list\", ...options.commands, ...customArgs],\n format: \"utf-8\",\n parser: parser3\n };\n}\nvar init_stash_list = __esm({\n \"src/lib/tasks/stash-list.ts\"() {\n init_parse_list_log_summary();\n init_log();\n }\n});\n\n// src/lib/tasks/sub-module.ts\nvar sub_module_exports = {};\n__export(sub_module_exports, {\n addSubModuleTask: () => addSubModuleTask,\n initSubModuleTask: () => initSubModuleTask,\n subModuleTask: () => subModuleTask,\n updateSubModuleTask: () => updateSubModuleTask\n});\nfunction addSubModuleTask(repo, path) {\n return subModuleTask([\"add\", repo, path]);\n}\nfunction initSubModuleTask(customArgs) {\n return subModuleTask([\"init\", ...customArgs]);\n}\nfunction subModuleTask(customArgs) {\n const commands = [...customArgs];\n if (commands[0] !== \"submodule\") {\n commands.unshift(\"submodule\");\n }\n return straightThroughStringTask(commands);\n}\nfunction updateSubModuleTask(customArgs) {\n return subModuleTask([\"update\", ...customArgs]);\n}\nvar init_sub_module = __esm({\n \"src/lib/tasks/sub-module.ts\"() {\n init_task();\n }\n});\n\n// src/lib/responses/TagList.ts\nfunction singleSorted(a, b) {\n const aIsNum = isNaN(a);\n const bIsNum = isNaN(b);\n if (aIsNum !== bIsNum) {\n return aIsNum ? 1 : -1;\n }\n return aIsNum ? sorted(a, b) : 0;\n}\nfunction sorted(a, b) {\n return a === b ? 0 : a > b ? 1 : -1;\n}\nfunction trimmed(input) {\n return input.trim();\n}\nfunction toNumber(input) {\n if (typeof input === \"string\") {\n return parseInt(input.replace(/^\\D+/g, \"\"), 10) || 0;\n }\n return 0;\n}\nvar TagList, parseTagList;\nvar init_TagList = __esm({\n \"src/lib/responses/TagList.ts\"() {\n TagList = class {\n constructor(all, latest) {\n this.all = all;\n this.latest = latest;\n }\n };\n parseTagList = function(data, customSort = false) {\n const tags = data.split(\"\\n\").map(trimmed).filter(Boolean);\n if (!customSort) {\n tags.sort(function(tagA, tagB) {\n const partsA = tagA.split(\".\");\n const partsB = tagB.split(\".\");\n if (partsA.length === 1 || partsB.length === 1) {\n return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));\n }\n for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) {\n const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i]));\n if (diff) {\n return diff;\n }\n }\n return 0;\n });\n }\n const latest = customSort ? tags[0] : [...tags].reverse().find((tag) => tag.indexOf(\".\") >= 0);\n return new TagList(tags, latest);\n };\n }\n});\n\n// src/lib/tasks/tag.ts\nvar tag_exports = {};\n__export(tag_exports, {\n addAnnotatedTagTask: () => addAnnotatedTagTask,\n addTagTask: () => addTagTask,\n tagListTask: () => tagListTask\n});\nfunction tagListTask(customArgs = []) {\n const hasCustomSort = customArgs.some((option) => /^--sort=/.test(option));\n return {\n format: \"utf-8\",\n commands: [\"tag\", \"-l\", ...customArgs],\n parser(text) {\n return parseTagList(text, hasCustomSort);\n }\n };\n}\nfunction addTagTask(name) {\n return {\n format: \"utf-8\",\n commands: [\"tag\", name],\n parser() {\n return { name };\n }\n };\n}\nfunction addAnnotatedTagTask(name, tagMessage) {\n return {\n format: \"utf-8\",\n commands: [\"tag\", \"-a\", \"-m\", tagMessage, name],\n parser() {\n return { name };\n }\n };\n}\nvar init_tag = __esm({\n \"src/lib/tasks/tag.ts\"() {\n init_TagList();\n }\n});\n\n// src/git.js\nvar require_git = __commonJS({\n \"src/git.js\"(exports2, module2) {\n var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));\n var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));\n var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));\n var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));\n var {\n asArray: asArray2,\n filterArray: filterArray2,\n filterPrimitives: filterPrimitives2,\n filterString: filterString2,\n filterStringOrStringArray: filterStringOrStringArray2,\n filterType: filterType2,\n getTrailingOptions: getTrailingOptions2,\n trailingFunctionArgument: trailingFunctionArgument2,\n trailingOptionsArgument: trailingOptionsArgument2\n } = (init_utils(), __toCommonJS(utils_exports));\n var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS(apply_patch_exports));\n var { branchTask: branchTask2, branchLocalTask: branchLocalTask2, deleteBranchesTask: deleteBranchesTask2, deleteBranchTask: deleteBranchTask2 } = (init_branch(), __toCommonJS(branch_exports));\n var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));\n var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));\n var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports));\n var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));\n var { commitTask: commitTask2 } = (init_commit(), __toCommonJS(commit_exports));\n var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));\n var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));\n var { moveTask: moveTask2 } = (init_move(), __toCommonJS(move_exports));\n var { pullTask: pullTask2 } = (init_pull(), __toCommonJS(pull_exports));\n var { pushTagsTask: pushTagsTask2 } = (init_push(), __toCommonJS(push_exports));\n var { addRemoteTask: addRemoteTask2, getRemotesTask: getRemotesTask2, listRemotesTask: listRemotesTask2, remoteTask: remoteTask2, removeRemoteTask: removeRemoteTask2 } = (init_remote(), __toCommonJS(remote_exports));\n var { getResetMode: getResetMode2, resetTask: resetTask2 } = (init_reset(), __toCommonJS(reset_exports));\n var { stashListTask: stashListTask2 } = (init_stash_list(), __toCommonJS(stash_list_exports));\n var { addSubModuleTask: addSubModuleTask2, initSubModuleTask: initSubModuleTask2, subModuleTask: subModuleTask2, updateSubModuleTask: updateSubModuleTask2 } = (init_sub_module(), __toCommonJS(sub_module_exports));\n var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS(tag_exports));\n var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS(task_exports));\n function Git2(options, plugins) {\n this._executor = new GitExecutor2(options.binary, options.baseDir, new Scheduler2(options.maxConcurrentProcesses), plugins);\n }\n (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2;\n Git2.prototype.customBinary = function(command) {\n this._executor.binary = command;\n return this;\n };\n Git2.prototype.env = function(name, value) {\n if (arguments.length === 1 && typeof name === \"object\") {\n this._executor.env = name;\n } else {\n (this._executor.env = this._executor.env || {})[name] = value;\n }\n return this;\n };\n Git2.prototype.stashList = function(options) {\n return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments));\n };\n function createCloneTask(api, task, repoPath, localPath) {\n if (typeof repoPath !== \"string\") {\n return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);\n }\n return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));\n }\n Git2.prototype.clone = function() {\n return this._runTask(createCloneTask(\"clone\", cloneTask2, ...arguments), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.mirror = function() {\n return this._runTask(createCloneTask(\"mirror\", cloneMirrorTask2, ...arguments), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.mv = function(from, to) {\n return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkoutLatestTag = function(then) {\n var git = this;\n return this.pull(function() {\n git.tags(function(err, tags) {\n git.checkout(tags.latest, then);\n });\n });\n };\n Git2.prototype.commit = function(message, files, options, then) {\n const next = trailingFunctionArgument2(arguments);\n if (!filterStringOrStringArray2(message)) {\n return this._runTask(configurationErrorTask2(\"git.commit: requires the commit message to be supplied as a string/string[]\"), next);\n }\n return this._runTask(commitTask2(asArray2(message), asArray2(filterType2(files, filterStringOrStringArray2, [])), [...filterType2(options, filterArray2, []), ...getTrailingOptions2(arguments, 0, true)]), next);\n };\n Git2.prototype.pull = function(remote, branch, options, then) {\n return this._runTask(pullTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.fetch = function(remote, branch) {\n return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.silent = function(silence) {\n console.warn(\"simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3\");\n return this;\n };\n Git2.prototype.tags = function(options, then) {\n return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.rebase = function() {\n return this._runTask(straightThroughStringTask2([\"rebase\", ...getTrailingOptions2(arguments)]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.reset = function(mode) {\n return this._runTask(resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.revert = function(commit) {\n const next = trailingFunctionArgument2(arguments);\n if (typeof commit !== \"string\") {\n return this._runTask(configurationErrorTask2(\"Commit must be a string\"), next);\n }\n return this._runTask(straightThroughStringTask2([\"revert\", ...getTrailingOptions2(arguments, 0, true), commit]), next);\n };\n Git2.prototype.addTag = function(name) {\n const task = typeof name === \"string\" ? addTagTask2(name) : configurationErrorTask2(\"Git.addTag requires a tag name\");\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.addAnnotatedTag = function(tagName, tagMessage) {\n return this._runTask(addAnnotatedTagTask2(tagName, tagMessage), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkout = function() {\n const commands = [\"checkout\", ...getTrailingOptions2(arguments, true)];\n return this._runTask(straightThroughStringTask2(commands), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkoutBranch = function(branchName, startPoint, then) {\n return this.checkout([\"-b\", branchName, startPoint], trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkoutLocalBranch = function(branchName, then) {\n return this.checkout([\"-b\", branchName], trailingFunctionArgument2(arguments));\n };\n Git2.prototype.deleteLocalBranch = function(branchName, forceDelete, then) {\n return this._runTask(deleteBranchTask2(branchName, typeof forceDelete === \"boolean\" ? forceDelete : false), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.deleteLocalBranches = function(branchNames, forceDelete, then) {\n return this._runTask(deleteBranchesTask2(branchNames, typeof forceDelete === \"boolean\" ? forceDelete : false), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.branch = function(options, then) {\n return this._runTask(branchTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.branchLocal = function(then) {\n return this._runTask(branchLocalTask2(), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.raw = function(commands) {\n const createRestCommands = !Array.isArray(commands);\n const command = [].slice.call(createRestCommands ? arguments : commands, 0);\n for (let i = 0; i < command.length && createRestCommands; i++) {\n if (!filterPrimitives2(command[i])) {\n command.splice(i, command.length - i);\n break;\n }\n }\n command.push(...getTrailingOptions2(arguments, 0, true));\n var next = trailingFunctionArgument2(arguments);\n if (!command.length) {\n return this._runTask(configurationErrorTask2(\"Raw: must supply one or more command to execute\"), next);\n }\n return this._runTask(straightThroughStringTask2(command), next);\n };\n Git2.prototype.submoduleAdd = function(repo, path, then) {\n return this._runTask(addSubModuleTask2(repo, path), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.submoduleUpdate = function(args, then) {\n return this._runTask(updateSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.submoduleInit = function(args, then) {\n return this._runTask(initSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.subModule = function(options, then) {\n return this._runTask(subModuleTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.listRemote = function() {\n return this._runTask(listRemotesTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.addRemote = function(remoteName, remoteRepo, then) {\n return this._runTask(addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.removeRemote = function(remoteName, then) {\n return this._runTask(removeRemoteTask2(remoteName), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.getRemotes = function(verbose, then) {\n return this._runTask(getRemotesTask2(verbose === true), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.remote = function(options, then) {\n return this._runTask(remoteTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.tag = function(options, then) {\n const command = getTrailingOptions2(arguments);\n if (command[0] !== \"tag\") {\n command.unshift(\"tag\");\n }\n return this._runTask(straightThroughStringTask2(command), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.updateServerInfo = function(then) {\n return this._runTask(straightThroughStringTask2([\"update-server-info\"]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.pushTags = function(remote, then) {\n const task = pushTagsTask2({ remote: filterType2(remote, filterString2) }, getTrailingOptions2(arguments));\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.rm = function(files) {\n return this._runTask(straightThroughStringTask2([\"rm\", \"-f\", ...asArray2(files)]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.rmKeepLocal = function(files) {\n return this._runTask(straightThroughStringTask2([\"rm\", \"--cached\", ...asArray2(files)]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.catFile = function(options, then) {\n return this._catFile(\"utf-8\", arguments);\n };\n Git2.prototype.binaryCatFile = function() {\n return this._catFile(\"buffer\", arguments);\n };\n Git2.prototype._catFile = function(format, args) {\n var handler = trailingFunctionArgument2(args);\n var command = [\"cat-file\"];\n var options = args[0];\n if (typeof options === \"string\") {\n return this._runTask(configurationErrorTask2(\"Git.catFile: options must be supplied as an array of strings\"), handler);\n }\n if (Array.isArray(options)) {\n command.push.apply(command, options);\n }\n const task = format === \"buffer\" ? straightThroughBufferTask2(command) : straightThroughStringTask2(command);\n return this._runTask(task, handler);\n };\n Git2.prototype.diff = function(options, then) {\n const task = filterString2(options) ? configurationErrorTask2(\"git.diff: supplying options as a single string is no longer supported, switch to an array of strings\") : straightThroughStringTask2([\"diff\", ...getTrailingOptions2(arguments)]);\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.diffSummary = function() {\n return this._runTask(diffSummaryTask2(getTrailingOptions2(arguments, 1)), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.applyPatch = function(patches) {\n const task = !filterStringOrStringArray2(patches) ? configurationErrorTask2(`git.applyPatch requires one or more string patches as the first argument`) : applyPatchTask2(asArray2(patches), getTrailingOptions2([].slice.call(arguments, 1)));\n return this._runTask(task, trailingFunctionArgument2(arguments));\n };\n Git2.prototype.revparse = function() {\n const commands = [\"rev-parse\", ...getTrailingOptions2(arguments, true)];\n return this._runTask(straightThroughStringTask2(commands, true), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.show = function(options, then) {\n return this._runTask(straightThroughStringTask2([\"show\", ...getTrailingOptions2(arguments, 1)]), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.clean = function(mode, options, then) {\n const usingCleanOptionsArray = isCleanOptionsArray2(mode);\n const cleanMode = usingCleanOptionsArray && mode.join(\"\") || filterType2(mode, filterString2) || \"\";\n const customArgs = getTrailingOptions2([].slice.call(arguments, usingCleanOptionsArray ? 1 : 0));\n return this._runTask(cleanWithOptionsTask2(cleanMode, customArgs), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.exec = function(then) {\n const task = {\n commands: [],\n format: \"utf-8\",\n parser() {\n if (typeof then === \"function\") {\n then();\n }\n }\n };\n return this._runTask(task);\n };\n Git2.prototype.clearQueue = function() {\n return this;\n };\n Git2.prototype.checkIgnore = function(pathnames, then) {\n return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments));\n };\n Git2.prototype.checkIsRepo = function(checkType, then) {\n return this._runTask(checkIsRepoTask2(filterType2(checkType, filterString2)), trailingFunctionArgument2(arguments));\n };\n module2.exports = Git2;\n }\n});\n\n// src/lib/git-factory.ts\nvar git_factory_exports = {};\n__export(git_factory_exports, {\n esModuleFactory: () => esModuleFactory,\n gitExportFactory: () => gitExportFactory,\n gitInstanceFactory: () => gitInstanceFactory\n});\nfunction esModuleFactory(defaultExport) {\n return Object.defineProperties(defaultExport, {\n __esModule: { value: true },\n default: { value: defaultExport }\n });\n}\nfunction gitExportFactory(factory, extra) {\n return Object.assign(function(...args) {\n return factory.apply(null, args);\n }, api_exports, extra || {});\n}\nfunction gitInstanceFactory(baseDir, options) {\n const plugins = new PluginStore();\n const config = createInstanceConfig(baseDir && (typeof baseDir === \"string\" ? { baseDir } : baseDir) || {}, options);\n if (!folderExists(config.baseDir)) {\n throw new GitConstructError(config, `Cannot use simple-git on a directory that does not exist`);\n }\n if (Array.isArray(config.config)) {\n plugins.add(commandConfigPrefixingPlugin(config.config));\n }\n plugins.add(completionDetectionPlugin(config.completion));\n config.progress && plugins.add(progressMonitorPlugin(config.progress));\n config.timeout && plugins.add(timeoutPlugin(config.timeout));\n config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));\n plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));\n config.errors && plugins.add(errorDetectionPlugin(config.errors));\n return new Git(config, plugins);\n}\nvar Git;\nvar init_git_factory = __esm({\n \"src/lib/git-factory.ts\"() {\n init_api();\n init_plugins();\n init_utils();\n Git = require_git();\n }\n});\n\n// src/lib/runners/promise-wrapped.ts\nvar promise_wrapped_exports = {};\n__export(promise_wrapped_exports, {\n gitP: () => gitP\n});\nfunction gitP(...args) {\n let git;\n let chain = Promise.resolve();\n try {\n git = gitInstanceFactory(...args);\n } catch (e) {\n chain = Promise.reject(e);\n }\n function builderReturn() {\n return promiseApi;\n }\n function chainReturn() {\n return chain;\n }\n const promiseApi = [...functionNamesBuilderApi, ...functionNamesPromiseApi].reduce((api, name) => {\n const isAsync = functionNamesPromiseApi.includes(name);\n const valid = isAsync ? asyncWrapper(name, git) : syncWrapper(name, git, api);\n const alternative = isAsync ? chainReturn : builderReturn;\n Object.defineProperty(api, name, {\n enumerable: false,\n configurable: false,\n value: git ? valid : alternative\n });\n return api;\n }, {});\n return promiseApi;\n function asyncWrapper(fn, git2) {\n return function(...args2) {\n if (typeof args2[args2.length] === \"function\") {\n throw new TypeError(\"Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to \" + fn);\n }\n return chain.then(function() {\n return new Promise(function(resolve, reject) {\n const callback = (err, result) => {\n if (err) {\n return reject(toError(err));\n }\n resolve(result);\n };\n args2.push(callback);\n git2[fn].apply(git2, args2);\n });\n });\n };\n }\n function syncWrapper(fn, git2, api) {\n return (...args2) => {\n git2[fn](...args2);\n return api;\n };\n }\n}\nfunction toError(error) {\n if (error instanceof Error) {\n return error;\n }\n if (typeof error === \"string\") {\n return new Error(error);\n }\n return new GitResponseError(error);\n}\nvar functionNamesBuilderApi, functionNamesPromiseApi;\nvar init_promise_wrapped = __esm({\n \"src/lib/runners/promise-wrapped.ts\"() {\n init_git_response_error();\n init_git_factory();\n functionNamesBuilderApi = [\n \"customBinary\",\n \"env\",\n \"outputHandler\",\n \"silent\"\n ];\n functionNamesPromiseApi = [\n \"add\",\n \"addAnnotatedTag\",\n \"addConfig\",\n \"addRemote\",\n \"addTag\",\n \"applyPatch\",\n \"binaryCatFile\",\n \"branch\",\n \"branchLocal\",\n \"catFile\",\n \"checkIgnore\",\n \"checkIsRepo\",\n \"checkout\",\n \"checkoutBranch\",\n \"checkoutLatestTag\",\n \"checkoutLocalBranch\",\n \"clean\",\n \"clone\",\n \"commit\",\n \"cwd\",\n \"deleteLocalBranch\",\n \"deleteLocalBranches\",\n \"diff\",\n \"diffSummary\",\n \"exec\",\n \"fetch\",\n \"getRemotes\",\n \"init\",\n \"listConfig\",\n \"listRemote\",\n \"log\",\n \"merge\",\n \"mergeFromTo\",\n \"mirror\",\n \"mv\",\n \"pull\",\n \"push\",\n \"pushTags\",\n \"raw\",\n \"rebase\",\n \"remote\",\n \"removeRemote\",\n \"reset\",\n \"revert\",\n \"revparse\",\n \"rm\",\n \"rmKeepLocal\",\n \"show\",\n \"stash\",\n \"stashList\",\n \"status\",\n \"subModule\",\n \"submoduleAdd\",\n \"submoduleInit\",\n \"submoduleUpdate\",\n \"tag\",\n \"tags\",\n \"updateServerInfo\"\n ];\n }\n});\n\n// src/index.js\nvar { gitP: gitP2 } = (init_promise_wrapped(), __toCommonJS(promise_wrapped_exports));\nvar { esModuleFactory: esModuleFactory2, gitInstanceFactory: gitInstanceFactory2, gitExportFactory: gitExportFactory2 } = (init_git_factory(), __toCommonJS(git_factory_exports));\nmodule.exports = esModuleFactory2(gitExportFactory2(gitInstanceFactory2, { gitP: gitP2 }));\n//# sourceMappingURL=index.js.map\n","'use strict';\nconst os = require('os');\nconst tty = require('tty');\nconst hasFlag = require('has-flag');\n\nconst {env} = process;\n\nlet forceColor;\nif (hasFlag('no-color') ||\n\thasFlag('no-colors') ||\n\thasFlag('color=false') ||\n\thasFlag('color=never')) {\n\tforceColor = 0;\n} else if (hasFlag('color') ||\n\thasFlag('colors') ||\n\thasFlag('color=true') ||\n\thasFlag('color=always')) {\n\tforceColor = 1;\n}\n\nif ('FORCE_COLOR' in env) {\n\tif (env.FORCE_COLOR === 'true') {\n\t\tforceColor = 1;\n\t} else if (env.FORCE_COLOR === 'false') {\n\t\tforceColor = 0;\n\t} else {\n\t\tforceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3\n\t};\n}\n\nfunction supportsColor(haveStream, streamIsTTY) {\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (hasFlag('color=16m') ||\n\t\thasFlag('color=full') ||\n\t\thasFlag('color=truecolor')) {\n\t\treturn 3;\n\t}\n\n\tif (hasFlag('color=256')) {\n\t\treturn 2;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10 &&\n\t\t\tNumber(osRelease[2]) >= 10586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app':\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\tcase 'Apple_Terminal':\n\t\t\t\treturn 2;\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nfunction getSupportLevel(stream) {\n\tconst level = supportsColor(stream, stream && stream.isTTY);\n\treturn translateLevel(level);\n}\n\nmodule.exports = {\n\tsupportsColor: getSupportLevel,\n\tstdout: translateLevel(supportsColor(true, tty.isatty(1))),\n\tstderr: translateLevel(supportsColor(true, tty.isatty(2)))\n};\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","module.exports = require(\"assert\");","module.exports = require(\"child_process\");","module.exports = require(\"events\");","module.exports = require(\"fs\");","module.exports = require(\"http\");","module.exports = require(\"https\");","module.exports = require(\"net\");","module.exports = require(\"os\");","module.exports = require(\"path\");","module.exports = require(\"tls\");","module.exports = require(\"tty\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\tvar threw = true;\n\ttry {\n\t\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\t\tthrew = false;\n\t} finally {\n\t\tif(threw) delete __webpack_module_cache__[moduleId];\n\t}\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","\nif (typeof __webpack_require__ !== 'undefined') __webpack_require__.ab = __dirname + \"/\";","","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(3109);\n",""],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/src/queue.ts b/src/queue.ts index a0b9543..5126f3c 100644 --- a/src/queue.ts +++ b/src/queue.ts @@ -111,6 +111,10 @@ export class Queue { ) } + getName(): QueueName { + return this.name + } + getGitRepoDir(): GitRepoDir { return this.gitRepo.getDir() }