@profoundlogic/coderflow-server 0.7.2 → 0.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-image/entrypoint.sh +7 -0
- package/dist/base-image/standard-instructions/memory-instructions.md +7 -0
- package/dist/coder-server.js +1 -1
- package/dist/config.js +1 -1
- package/dist/lib/agent-keepalive.js +1 -1
- package/dist/lib/agent-models.js +1 -1
- package/dist/lib/api-keys.js +1 -1
- package/dist/lib/apiKeys.js +1 -1
- package/dist/lib/app-server-ports.js +1 -1
- package/dist/lib/auto-judge.js +1 -1
- package/dist/lib/automation-service.js +1 -1
- package/dist/lib/basic-auth.js +1 -1
- package/dist/lib/bindings.js +1 -1
- package/dist/lib/build-history.js +1 -1
- package/dist/lib/build-output-service.js +1 -1
- package/dist/lib/build-scheduler.js +1 -1
- package/dist/lib/build-service.js +1 -1
- package/dist/lib/ca-certificates.js +1 -1
- package/dist/lib/claude-oauth-refresh.js +1 -1
- package/dist/lib/cli/build.js +1 -1
- package/dist/lib/cli/cleanup-users.js +1 -1
- package/dist/lib/cli/config-command.js +1 -1
- package/dist/lib/cli/config.js +1 -1
- package/dist/lib/cli/create-user.js +1 -1
- package/dist/lib/cli/grant-admin.js +1 -1
- package/dist/lib/cli/init.js +1 -1
- package/dist/lib/cli/jira.js +1 -1
- package/dist/lib/cli/license.js +1 -1
- package/dist/lib/cli/list-roles.js +1 -1
- package/dist/lib/cli/list-users.js +1 -1
- package/dist/lib/cli/server-manager.js +1 -1
- package/dist/lib/cli/set-password.js +1 -1
- package/dist/lib/config-migration.js +1 -1
- package/dist/lib/container-credential-sync.js +1 -1
- package/dist/lib/container-tokens.js +1 -1
- package/dist/lib/data-dir.js +1 -1
- package/dist/lib/deployment-history.js +1 -1
- package/dist/lib/deployment-service.js +1 -1
- package/dist/lib/docker-utils.js +1 -1
- package/dist/lib/email.js +1 -1
- package/dist/lib/emailTemplates.js +1 -1
- package/dist/lib/entitlement.js +1 -1
- package/dist/lib/external-connections.js +1 -1
- package/dist/lib/fetch-utils.js +1 -1
- package/dist/lib/git-commit-details-route.js +1 -1
- package/dist/lib/git-history-diff-guardrails.js +1 -1
- package/dist/lib/git-provider-service.js +1 -1
- package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
- package/dist/lib/git-provider-setup/index.js +1 -1
- package/dist/lib/git-provider-setup/setup-factory.js +1 -1
- package/dist/lib/git-provider-setup/setup-interface.js +1 -1
- package/dist/lib/git-providers/azure-devops-provider.js +1 -1
- package/dist/lib/git-providers/github-app-provider.js +1 -1
- package/dist/lib/git-providers/index.js +1 -1
- package/dist/lib/git-providers/provider-factory.js +1 -1
- package/dist/lib/git-providers/provider-interface.js +1 -1
- package/dist/lib/github-urls.js +1 -1
- package/dist/lib/group-objective-linking.js +1 -1
- package/dist/lib/ibmi-sync.js +1 -1
- package/dist/lib/jira-client.js +1 -1
- package/dist/lib/judge-blinding.js +1 -1
- package/dist/lib/logger.js +1 -1
- package/dist/lib/memory-utils.js +1 -0
- package/dist/lib/migration-to-scoped-rbac.js +1 -1
- package/dist/lib/model-fetcher.js +1 -1
- package/dist/lib/notifications.js +1 -1
- package/dist/lib/objective-context.js +1 -1
- package/dist/lib/oidc-auth.js +1 -1
- package/dist/lib/oidc-device-flow.js +1 -1
- package/dist/lib/passwordTokens.js +1 -1
- package/dist/lib/permission-resolver.js +1 -1
- package/dist/lib/pin-cascade.js +1 -1
- package/dist/lib/provider-accounts.js +1 -1
- package/dist/lib/provider-oauth.js +1 -1
- package/dist/lib/provider-profile.js +1 -1
- package/dist/lib/provider-token-refresh.js +1 -1
- package/dist/lib/rbac-user-state.js +1 -1
- package/dist/lib/request-url.js +1 -1
- package/dist/lib/rewind.js +1 -1
- package/dist/lib/role-definitions.js +1 -1
- package/dist/lib/roles.js +1 -1
- package/dist/lib/secrets.js +1 -1
- package/dist/lib/setup-repo-git-auth.js +1 -1
- package/dist/lib/state-capture.js +1 -1
- package/dist/lib/static-files.js +1 -1
- package/dist/lib/task-aliases.js +1 -1
- package/dist/lib/task-name-format.js +1 -1
- package/dist/lib/task-name-generator.js +1 -1
- package/dist/lib/task-source-metadata.js +1 -1
- package/dist/lib/teams.js +1 -1
- package/dist/lib/user-git-oauth.js +1 -1
- package/dist/lib/user-git-tokens.js +1 -1
- package/dist/lib/users.js +1 -1
- package/dist/middleware/requireAuth.js +1 -1
- package/dist/middleware/requireInit.js +1 -1
- package/dist/middleware/requirePermission.js +1 -1
- package/dist/package.json +1 -1
- package/dist/playwright.config.js +1 -1
- package/dist/playwright.task-terminal.config.js +1 -1
- package/dist/routes/apiKeys.js +1 -1
- package/dist/routes/auth-oidc.js +1 -1
- package/dist/routes/auth.js +1 -1
- package/dist/routes/automations.js +1 -1
- package/dist/routes/bindings.js +1 -1
- package/dist/routes/build.js +1 -1
- package/dist/routes/containers.js +1 -1
- package/dist/routes/deploy-task.js +1 -1
- package/dist/routes/environment-management.js +1 -1
- package/dist/routes/environments.js +1 -1
- package/dist/routes/external-skills.js +1 -1
- package/dist/routes/git-credentials.js +1 -1
- package/dist/routes/git-oauth.js +1 -1
- package/dist/routes/git-provider-setup.js +1 -1
- package/dist/routes/health.js +1 -1
- package/dist/routes/jira.js +1 -1
- package/dist/routes/objective-management.js +1 -1
- package/dist/routes/password.js +1 -1
- package/dist/routes/prompt.js +1 -1
- package/dist/routes/provider-auth.js +1 -1
- package/dist/routes/qa.js +1 -1
- package/dist/routes/roles.js +1 -1
- package/dist/routes/settings.js +1 -1
- package/dist/routes/skill-management.js +1 -1
- package/dist/routes/skills.js +1 -1
- package/dist/routes/tasks.js +1 -1
- package/dist/routes/teams.js +1 -1
- package/dist/routes/templates.js +1 -1
- package/dist/routes/test-task.js +1 -1
- package/dist/routes/test.js +1 -1
- package/dist/routes/users.js +1 -1
- package/dist/routes/visualizations.js +1 -1
- package/dist/scripts/create-user.js +1 -1
- package/dist/scripts/migrate-config-to-data-dir.js +1 -1
- package/dist/shipped-skills/memory-management/SKILL.md +103 -0
- package/dist/start.js +1 -1
- package/dist/web-ui/public/activity-detail-modal.js +1 -1
- package/dist/web-ui/public/activity-feed.js +1 -1
- package/dist/web-ui/public/activity-formatters.js +1 -1
- package/dist/web-ui/public/agent-event-parser.js +1 -1
- package/dist/web-ui/public/app.js +1 -1
- package/dist/web-ui/public/approve-dialog.js +1 -1
- package/dist/web-ui/public/automation-links.js +1 -1
- package/dist/web-ui/public/automation-schedule.js +1 -1
- package/dist/web-ui/public/comments-widget.js +1 -1
- package/dist/web-ui/public/diff-utils.js +1 -1
- package/dist/web-ui/public/docs/admin/ai-providers.md +5 -5
- package/dist/web-ui/public/environments.css +61 -0
- package/dist/web-ui/public/environments.html +114 -0
- package/dist/web-ui/public/environments.js +1 -1
- package/dist/web-ui/public/feedback-widget.css +15 -5
- package/dist/web-ui/public/feedback-widget.js +1 -1
- package/dist/web-ui/public/file-selection-tree.js +1 -1
- package/dist/web-ui/public/git-history-lazy-utils.js +1 -1
- package/dist/web-ui/public/git-history.js +1 -1
- package/dist/web-ui/public/git-status.js +1 -1
- package/dist/web-ui/public/ibmi-file-filter.js +1 -1
- package/dist/web-ui/public/index.html +20 -0
- package/dist/web-ui/public/index.js +1 -1
- package/dist/web-ui/public/login.js +1 -1
- package/dist/web-ui/public/markdown-editor.js +1 -1
- package/dist/web-ui/public/markdown-file-editor.js +1 -1
- package/dist/web-ui/public/modal-maximize.js +1 -1
- package/dist/web-ui/public/notifications.js +1 -1
- package/dist/web-ui/public/permissions.js +1 -1
- package/dist/web-ui/public/pr-dialog.js +1 -1
- package/dist/web-ui/public/roles.js +1 -1
- package/dist/web-ui/public/server-health.js +1 -1
- package/dist/web-ui/public/settings.html +1 -1
- package/dist/web-ui/public/settings.js +1 -1
- package/dist/web-ui/public/setup-password.js +1 -1
- package/dist/web-ui/public/skills.js +1 -1
- package/dist/web-ui/public/sse-client.js +1 -1
- package/dist/web-ui/public/sse-shared-worker.js +1 -1
- package/dist/web-ui/public/styles.css +25 -0
- package/dist/web-ui/public/task-judging-helpers.js +1 -1
- package/dist/web-ui/public/task.html +15 -1
- package/dist/web-ui/public/task.js +1 -1
- package/dist/web-ui/public/teams.js +1 -1
- package/dist/web-ui/public/terminal.js +1 -1
- package/dist/web-ui/public/theme.js +1 -1
- package/dist/web-ui/public/users.js +1 -1
- package/dist/web-ui/public/variant-grouping.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
function isLogOnlyTaskType(_0x407ae8){return _0x407ae8==='test'||_0x407ae8==='deploy';}export function createApproveDialogHTML(_0x556673='',_0x229814={}){const _0x39b7ab=_0x556673,_0x2a2fda=_0x229814['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0xe90182=_0x229814['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x553b79=_0x229814['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'approve-modal\x22\x20class=\x22'+_0x2a2fda+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-overlay\x22></div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-content\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2>Approve\x20Changes</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22modal-close\x22\x20id=\x22'+_0x39b7ab+'close-approve-modal\x22>×</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'approve-warning\x22\x20class=\x22'+_0xe90182+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x39b7ab+'approve-warning-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'approve-error\x22\x20class=\x22'+_0x553b79+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22error-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x39b7ab+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x39b7ab+'approve-repo-name\x22\x20class=\x22modal-repo\x22>Repository</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x39b7ab+'approve-stats\x22\x20class=\x22modal-stats\x22>0\x20files\x20changed</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'approve-branches\x22\x20class=\x22modal-branches\x22\x20hidden></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x39b7ab+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x39b7ab+'commit-message-input\x22\x20class=\x22commit-message-input\x22\x20rows=\x226\x22\x20placeholder=\x22Enter\x20commit\x20message...\x22></textarea>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20id=\x22'+_0x39b7ab+'multi-repo-note\x22\x20class=\x22field-hint\x22\x20hidden>This\x20commit\x20message\x20will\x20be\x20used\x20for\x20all\x20repositories\x20listed\x20above.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x39b7ab+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit\x20(rebase)</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x39b7ab+'push-after-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Push\x20to\x20remote\x20after\x20commit</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x39b7ab+'create-new-branch\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20new\x20branch</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'new-branch-input-container\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x39b7ab+'new-branch-name\x22\x20class=\x22new-branch-input\x22\x20placeholder=\x22Enter\x20new\x20branch\x20name...\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>A\x20new\x20branch\x20will\x20be\x20created\x20from\x20the\x20current\x20branch\x20before\x20committing.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'pr-option-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x39b7ab+'create-pull-request\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20pull\x20request</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22\x20id=\x22'+_0x39b7ab+'pr-hint\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20A\x20new\x20branch\x20will\x20be\x20created,\x20pushed,\x20and\x20a\x20pull\x20request\x20opened.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'ibmi-sync-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22approve-divider\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x39b7ab+'sync-to-ibmi\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Sync\x20to\x20IBM\x20i</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'ibmi-sync-fields\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x39b7ab+'ibmi-sync-library\x22>Library\x20name</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x39b7ab+'ibmi-sync-library\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYLIB\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'ibmi-sync-credentials-row\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x39b7ab+'ibmi-sync-user\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>User\x20profile</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x39b7ab+'ibmi-sync-user\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYUSER\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x39b7ab+'ibmi-sync-password\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>Password</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22password\x22\x20id=\x22'+_0x39b7ab+'ibmi-sync-password\x22\x20class=\x22new-branch-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Enter\x20password\x22\x20style=\x22width:\x20160px;\x22\x20autocomplete=\x22off\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'ibmi-sync-files-section\x22\x20style=\x22margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20style=\x22display:\x20block;\x20margin-bottom:\x204px;\x22>Files\x20to\x20sync</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x39b7ab+'ibmi-sync-file-tree\x22\x20class=\x22file-selection-tree-container\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22max-height:\x20250px;\x20overflow-y:\x20auto;\x20border:\x201px\x20solid\x20var(--border-color,\x20var(--color-border));\x20border-radius:\x204px;\x20padding:\x208px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-selection-summary\x22\x20id=\x22'+_0x39b7ab+'ibmi-sync-files-summary\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-ghost\x22\x20id=\x22'+_0x39b7ab+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x39b7ab+'confirm-approve\x22>Commit\x20Changes</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20';}export class ApproveDialog{constructor(_0x33edc8={}){this['prefix']=_0x33edc8['prefix']||'',this['onApprove']=_0x33edc8['onApprove'],this['onSync']=_0x33edc8['onSync'],this['onSuccess']=_0x33edc8['onSuccess'],this['onError']=_0x33edc8['onError'],this['onCreatePR']=_0x33edc8['onCreatePR'],this['showToast']=_0x33edc8['showToast']||(()=>{}),this['container']=_0x33edc8['container']||document['body'],this['useTaskPageStyles']=_0x33edc8['useTaskPageStyles']||![],this['baseUrl']=_0x33edc8['baseUrl']||'',this['coderflowAttribution']=_0x33edc8['coderflowAttribution'],this['onSyncToIbmi']=_0x33edc8['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x33edc8['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}['init'](){if(this['initialized'])return;const _0x4b4b92=document['createElement']('div');_0x4b4b92['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x4b4b92['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x23902e){return document['getElementById'](''+this['prefix']+_0x23902e);}['_bindEvents'](){const _0xb83f81=this['_el']('approve-modal'),_0x386c71=this['_el']('close-approve-modal'),_0x2ac157=this['_el']('cancel-approve'),_0x443cc8=this['_el']('confirm-approve'),_0x53f091=_0xb83f81?.['querySelector']('.modal-overlay'),_0x44ff36=this['_el']('create-new-branch'),_0x1cacf5=this['_el']('new-branch-input-container'),_0x439824=this['_el']('new-branch-name'),_0x1f4a4d=this['_el']('push-after-commit'),_0x136d89=this['_el']('create-pull-request'),_0x580aba=this['_el']('pr-hint');_0x386c71?.['addEventListener']('click',()=>this['hide']()),_0x2ac157?.['addEventListener']('click',()=>this['hide']()),_0x53f091?.['addEventListener']('click',()=>this['hide']()),_0x443cc8?.['addEventListener']('click',()=>this['_handleApprove']());_0x44ff36&&_0x44ff36['addEventListener']('change',()=>{_0x1cacf5&&(_0x1cacf5['hidden']=!_0x44ff36['checked']),_0x44ff36['checked']&&_0x439824&&_0x439824['focus']();});_0x136d89&&_0x1f4a4d&&_0x44ff36&&(_0x136d89['addEventListener']('change',()=>{this['_createPR']=_0x136d89['checked'];if(_0x136d89['checked']){_0x1f4a4d['checked']=!![],_0x1f4a4d['disabled']=!![],_0x44ff36['checked']=!![],_0x44ff36['disabled']=!![];_0x1cacf5&&(_0x1cacf5['hidden']=![]);if(_0x580aba)_0x580aba['hidden']=![];}else{_0x1f4a4d['disabled']=![],_0x44ff36['disabled']=![];if(_0x580aba)_0x580aba['hidden']=!![];}}),_0x1f4a4d['addEventListener']('change',()=>{if(!_0x1f4a4d['checked']&&_0x136d89['checked']){_0x136d89['checked']=![],this['_createPR']=![],_0x1f4a4d['disabled']=![],_0x44ff36['disabled']=![];if(_0x580aba)_0x580aba['hidden']=!![];}}));const _0x9104c=this['_el']('sync-to-ibmi');_0x9104c&&_0x9104c['addEventListener']('change',async _0x4f3999=>{const _0x4a93b1=this['_el']('ibmi-sync-fields');if(_0x4a93b1)_0x4a93b1['hidden']=!_0x4f3999['target']['checked'];if(_0x4f3999['target']['checked']){const _0x57bf06=this['_el']('ibmi-sync-library'),_0x1ea59c=localStorage['getItem']('coderflow_ibmi_sync_library');_0x1ea59c&&_0x57bf06&&!_0x57bf06['value']&&(_0x57bf06['value']=_0x1ea59c);const _0x24cdce=this['_el']('ibmi-sync-user');if(_0x24cdce&&!_0x24cdce['value']){const _0x1ba539=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x1ba539)_0x24cdce['value']=_0x1ba539;}const _0x511ea2=this['_el']('ibmi-sync-password');if(_0x511ea2)_0x511ea2['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0xce5fa5=>{_0xce5fa5['key']==='Escape'&&_0xb83f81&&!_0xb83f81['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x113a5e=this['_el']('ibmi-sync-file-tree'),_0x28da=this['_el']('ibmi-sync-files-summary');if(!_0x113a5e)return;_0x113a5e['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x28da)_0x28da['textContent']='';try{const {files:_0x2630b1,absolutePaths:_0x4358f5}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x2630b1,this['_syncAbsolutePaths']=_0x4358f5;if(_0x2630b1['length']===0x0){_0x113a5e['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x2c753e}=await import('./file-selection-tree.js'),{validateIbmiFile:_0xf0e6ec,hasKnownIbmiExtension:_0x509203}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x2c753e({'container':_0x113a5e,'files':_0x2630b1,'isPreselected':_0x5145ab=>{const {valid:_0x449fdb}=_0xf0e6ec(_0x5145ab);return _0x449fdb&&_0x509203(_0x5145ab);},'isDisabled':_0x1180cd=>{const {valid:_0x5d1f0a,reason:_0x1a9e6f}=_0xf0e6ec(_0x1180cd);return{'disabled':!_0x5d1f0a,'reason':_0x1a9e6f};},'isAutoCheckEligible':_0x14b130=>{const {valid:_0x1df6d5}=_0xf0e6ec(_0x14b130);return _0x1df6d5&&_0x509203(_0x14b130);},'onChange':_0x523226=>{_0x28da&&(_0x28da['textContent']=_0x523226['length']+'\x20of\x20'+_0x2630b1['length']+'\x20file'+(_0x2630b1['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x3af810){_0x113a5e['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x155902){const _0x3cfc1c=this['_el']('approve-error'),_0x1e63d4=this['_el']('approve-error-text');_0x3cfc1c&&_0x1e63d4&&(_0x1e63d4['textContent']=_0x155902,_0x3cfc1c['hidden']=![],_0x3cfc1c['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x1a5565=this['_el']('approve-error'),_0x522038=this['_el']('approve-error-text');_0x1a5565&&_0x522038&&(_0x1a5565['hidden']=!![],_0x522038['textContent']='');}['_displayBranchInfo'](_0xe1ad62,_0x56b23f={}){const _0x37a2e9=this['_el']('approve-branches');if(!_0x37a2e9)return;const _0xd07115=[];for(const _0x10129c of _0xe1ad62){_0x56b23f[_0x10129c['name']]&&_0xd07115['push']({'repo':_0x10129c['name'],'branch':_0x56b23f[_0x10129c['name']]});}if(_0xd07115['length']>0x0){_0x37a2e9['hidden']=![];if(_0xd07115['length']===0x1)_0x37a2e9['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0xd07115[0x0]['branch']+'</code></div>';else{const _0x347b8e=_0xd07115['map'](_0x9ce52d=>'<div\x20class=\x22branch-item\x22><strong>'+_0x9ce52d['repo']+':</strong>\x20<code>'+_0x9ce52d['branch']+'</code></div>')['join']('');_0x37a2e9['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x347b8e+'</div></div>';}}else _0x37a2e9['hidden']=!![],_0x37a2e9['innerHTML']='';}['showWarning'](_0x365d48){const _0x4a6936=this['_el']('approve-warning'),_0x5b1db7=this['_el']('approve-warning-text');_0x4a6936&&_0x5b1db7&&(_0x5b1db7['textContent']=_0x365d48,_0x4a6936['hidden']=![]);}['hideWarning'](){const _0x5b57a5=this['_el']('approve-warning'),_0x135fc4=this['_el']('approve-warning-text');_0x5b57a5&&_0x135fc4&&(_0x5b57a5['hidden']=!![],_0x135fc4['textContent']='');}['_stripCoAuthoredByLines'](_0xe2ae6c){return _0xe2ae6c['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0xf4c958){try{let _0x44763c;try{const _0x21c421=await fetch(this['baseUrl']+'/settings');if(_0x21c421['ok']){const _0x34cb02=await _0x21c421['json']();_0x44763c=_0x34cb02['coderflow_attribution']!==![];}}catch(_0x32b21c){}_0x44763c===undefined&&(this['coderflowAttribution']!==undefined?_0x44763c=this['coderflowAttribution']!==![]:_0x44763c=!![]);const _0x2586e4=this['_stripCoAuthoredByLines'](_0xf4c958);if(!_0x44763c)return _0x2586e4;const _0x2a7693='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x2586e4+_0x2a7693;}catch(_0x3b52d3){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x3b52d3),_0xf4c958;}}['show'](_0xa37668){!this['initialized']&&this['init']();this['taskData']=_0xa37668;const _0x344dee=this['_el']('approve-modal'),_0x4bb746=this['_el']('commit-message-input'),_0x1305e6=this['_el']('pull-before-commit'),_0xa7cddb=this['_el']('push-after-commit'),_0x110420=this['_el']('create-new-branch'),_0x111865=this['_el']('new-branch-input-container'),_0x2f3649=this['_el']('new-branch-name'),_0x3bb82c=this['_el']('approve-repo-name'),_0x103971=this['_el']('approve-stats'),_0x56e04c=this['_el']('multi-repo-note');if(!_0x344dee)return;this['hideError'](),this['hideWarning']();_0xa37668['warning']&&this['showWarning'](_0xa37668['warning']);const _0x52cdb3=_0xa37668['reposChanged']||[];if(_0x52cdb3['length']===0x0&&!_0xa37668['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x52cdb3,_0xa37668);const _0x3d253e=_0xa37668['commitMessage']||'',_0x294052=this['_stripCoAuthoredByLines'](_0x3d253e);_0x4bb746['value']=_0x294052;if(_0x1305e6)_0x1305e6['checked']=!![];if(_0xa7cddb)_0xa7cddb['checked']=!![];_0x110420&&(_0x110420['checked']=![]);_0x111865&&(_0x111865['hidden']=!![]);_0x2f3649&&(_0x2f3649['value']='');if(_0xa7cddb)_0xa7cddb['disabled']=![];if(_0x110420)_0x110420['disabled']=![];this['updatePRSupport'](_0xa37668['prSupported']===!![]);const _0x205c5a=this['_el']('ibmi-sync-section');if(_0x205c5a){_0x205c5a['hidden']=!_0xa37668['ibmiSyncAvailable'];const _0x597842=this['_el']('sync-to-ibmi'),_0x35a336=this['_el']('ibmi-sync-fields'),_0x3fb40c=this['_el']('ibmi-sync-library');if(_0x597842)_0x597842['checked']=![];if(_0x35a336)_0x35a336['hidden']=!![];if(_0x3fb40c)_0x3fb40c['value']='';const _0x3e783d=this['_el']('ibmi-sync-credentials-row');_0x3e783d&&(_0x3e783d['hidden']=!(_0xa37668['ibmiSyncAvailable']&&_0xa37668['syncCredentials']==='prompt'));}const _0x14d6b4=this['_el']('confirm-approve');_0xa37668['syncFirst']&&this['onSync']?(_0x14d6b4&&(_0x14d6b4['disabled']=!![],_0x14d6b4['textContent']='Syncing...'),this['_performSync']()):_0x14d6b4&&(_0x14d6b4['disabled']=![],_0x14d6b4['textContent']='Commit\x20Changes');_0x344dee['hidden']=![];const _0x327a2b=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x327a2b,'taskId':_0xa37668['taskId'],'originalCommitMessage':_0x294052}),setTimeout(()=>{_0x4bb746['focus'](),_0x4bb746['setSelectionRange'](0x0,_0x4bb746['value']['length']);},0x64);}['updatePRSupport'](_0x5e5267){const _0xa0a75a=this['_el']('pr-option-section'),_0x14fb5c=this['_el']('create-pull-request'),_0x28ff63=this['_el']('pr-hint'),_0x82d085=this['_el']('push-after-commit'),_0x1c0984=this['_el']('create-new-branch');if(!_0xa0a75a)return;if(_0x5e5267){_0xa0a75a['hidden']=![];_0x14fb5c&&!_0x14fb5c['disabled']&&(_0x14fb5c['checked']=![]);if(_0x28ff63)_0x28ff63['hidden']=!![];this['_createPR']=![];return;}_0x14fb5c?.['checked']&&(_0x14fb5c['checked']=![]);if(_0x28ff63)_0x28ff63['hidden']=!![];if(_0x82d085)_0x82d085['disabled']=![];if(_0x1c0984)_0x1c0984['disabled']=![];this['_createPR']=![],_0xa0a75a['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x5ebd14,taskId:_0x29f1f4,originalCommitMessage:_0x117703}){const _0x10191a=this['_el']('commit-message-input');if(!_0x10191a)return;const _0x378a8d=await this['_addAttributionIfEnabled'](_0x117703);if(_0x5ebd14!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x29f1f4)return;if(!this['isVisible']())return;const _0x17f883=_0x2358b0=>_0x2358b0['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x17f883(_0x10191a['value'])!==_0x17f883(_0x117703))return;_0x10191a['value']=_0x378a8d;}['_updateDisplay'](_0x3dd851,_0x4b59cc){const _0x18e33d=this['_el']('approve-repo-name'),_0x3c4a26=this['_el']('approve-stats'),_0x14a3b3=this['_el']('multi-repo-note');if(_0x3dd851['length']===0x0){if(_0x18e33d)_0x18e33d['textContent']='Syncing...';if(_0x3c4a26)_0x3c4a26['textContent']='';if(_0x14a3b3)_0x14a3b3['hidden']=!![];return;}const _0x3025c3=_0x3dd851['reduce']((_0x358e1b,_0x261a6b)=>_0x358e1b+(_0x261a6b['files_changed']||0x0),0x0),_0x52c0ce=_0x3dd851['reduce']((_0x2d3011,_0x4313d7)=>_0x2d3011+(_0x4313d7['lines_added']||0x0),0x0),_0x28bc64=_0x3dd851['reduce']((_0x1294c0,_0x2a6d6b)=>_0x1294c0+(_0x2a6d6b['lines_deleted']||0x0),0x0);if(_0x3dd851['length']===0x1){if(_0x18e33d)_0x18e33d['textContent']=_0x3dd851[0x0]?.['name']||'repository';if(_0x14a3b3)_0x14a3b3['hidden']=!![];}else{const _0x12c85a=_0x3dd851['map'](_0x3d7bd3=>_0x3d7bd3['name'])['join'](',\x20');if(_0x18e33d)_0x18e33d['textContent']=_0x3dd851['length']+'\x20repositories:\x20'+_0x12c85a;if(_0x14a3b3)_0x14a3b3['hidden']=![];}_0x3c4a26&&(_0x3c4a26['textContent']=_0x3025c3+'\x20file'+(_0x3025c3===0x1?'':'s')+'\x20changed\x20(+'+_0x52c0ce+'\x20-'+_0x28bc64+')'),this['_displayBranchInfo'](_0x3dd851,_0x4b59cc?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x44c95e=this['_el']('confirm-approve');try{const _0x432491=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x432491['repos_changed']){const _0x447dd1=this['taskData']['reposChanged']?.['length']||0x0,_0x4fa3a7=this['taskData']['reposChanged']?.['reduce']((_0x349c4f,_0x205958)=>_0x349c4f+(_0x205958['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x432491['repos_changed'];if(_0x432491['current_branches']){const _0x41305d={...this['taskData']['branches']||{}};for(const [_0x5175cf,_0x4a5642]of Object['entries'](_0x432491['current_branches'])){_0x4a5642?_0x41305d[_0x5175cf]=_0x4a5642:delete _0x41305d[_0x5175cf];}this['taskData']['branches']=_0x41305d;}this['_updateDisplay'](_0x432491['repos_changed'],this['taskData']);const _0x525c18=_0x432491['repos_changed']['length'],_0x2db86b=_0x432491['repos_changed']['reduce']((_0x41381c,_0x4fb55d)=>_0x41381c+(_0x4fb55d['files_changed']||0x0),0x0);(_0x2db86b>_0x4fa3a7||_0x525c18>_0x447dd1)&&this['showWarning'](this['taskData']['warning']?this['taskData']['warning']+'\x20Additional\x20changes\x20detected\x20since\x20last\x20sync.':'Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.');}_0x44c95e&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x44c95e['disabled']=!![],_0x44c95e['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x44c95e['disabled']=![],_0x44c95e['textContent']='Commit\x20Changes'));}catch(_0x18a278){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x18a278);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x18a278['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x44c95e&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x44c95e['disabled']=![],_0x44c95e['textContent']='Commit\x20Changes'):(_0x44c95e['disabled']=!![],_0x44c95e['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0xdfc1ca=this['_el']('approve-modal');_0xdfc1ca&&(_0xdfc1ca['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x50a4c0=this['_el']('commit-message-input'),_0x48e1c3=this['_el']('pull-before-commit'),_0x309ffd=this['_el']('push-after-commit'),_0x10675e=this['_el']('create-new-branch'),_0x407e51=this['_el']('new-branch-name'),_0x1a58ba=this['_el']('confirm-approve'),_0x6dc9d0=_0x50a4c0['value']['trim'](),_0x573b82=_0x48e1c3?.['checked']??!![],_0x2e9557=_0x309ffd?.['checked']??!![],_0x4a3e0f=_0x10675e?.['checked']||![],_0x302716=_0x407e51?.['value']['trim']()||'';this['hideError']();if(!_0x6dc9d0){this['showError']('Commit\x20message\x20is\x20required'),_0x50a4c0['focus']();return;}if(_0x4a3e0f&&!_0x302716){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x407e51?.['focus']();return;}if(_0x4a3e0f&&_0x302716){const _0x102987=/[\s~^:?*\[\\]/;if(_0x102987['test'](_0x302716)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x407e51?.['focus']();return;}}const _0x586ac7=this['_el']('sync-to-ibmi')?.['checked'];if(_0x586ac7){const _0x4a7726=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x4a7726){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x44d9e9=this['_syncFileTree']['getSelectedFiles']();if(_0x44d9e9['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x3c966c=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x3c966c){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x450959=this['_el']('ibmi-sync-password')?.['value'];if(!_0x450959){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x292b7e=_0x1a58ba?.['textContent']||'Commit\x20Changes';_0x1a58ba&&(_0x1a58ba['disabled']=!![],_0x4a3e0f?_0x1a58ba['textContent']='Creating\x20branch\x20&\x20committing...':_0x1a58ba['textContent']=_0x573b82?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x5db6e2={'commit_message':_0x6dc9d0,'pull':_0x573b82,'push':_0x2e9557};_0x4a3e0f&&_0x302716&&(_0x5db6e2['new_branch']=_0x302716);let _0x5a48b6=null;this['onApprove']&&(_0x5a48b6=await this['onApprove'](this['taskData']['taskId'],_0x5db6e2));let _0x10780e='Changes\x20committed';if(_0x4a3e0f)_0x10780e='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x302716+'\x27',_0x2e9557&&(_0x10780e+='\x20and\x20pushed');else{if(_0x573b82&&_0x2e9557)_0x10780e='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x573b82)_0x10780e='Changes\x20pulled\x20and\x20committed';else _0x2e9557&&(_0x10780e='Changes\x20committed\x20and\x20pushed');}}const _0x3aed21=this['_el']('sync-to-ibmi')?.['checked'];let _0x36bdab=null,_0x3055a5=null,_0xe39df6=null,_0x205123=null;if(_0x3aed21&&this['onSyncToIbmi']){_0x36bdab=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x3055a5=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0xe39df6=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0xff33cb=this['_syncFileTree']['getSelectedFiles']();_0x205123=_0xff33cb['map'](_0x5365a5=>{const _0x4e32db=this['_syncRelativeFiles']['indexOf'](_0x5365a5);return _0x4e32db>=0x0?this['_syncAbsolutePaths'][_0x4e32db]:_0x5365a5;});}}this['showToast'](_0x10780e,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x5a48b6||{});}catch(_0x1d54ab){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x1d54ab);}if(_0x3aed21&&this['onSyncToIbmi']&&_0x36bdab){localStorage['setItem']('coderflow_ibmi_sync_library',_0x36bdab);if(_0x3055a5)localStorage['setItem']('coderflow_ibmi_sync_user',_0x3055a5);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x36bdab,_0x3055a5,_0xe39df6,_0x205123);}catch(_0x3bcf6d){this['showToast']('Sync\x20failed:\x20'+_0x3bcf6d['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x355265){console['error']('Failed\x20to\x20approve\x20changes',_0x355265),this['showError']('Failed\x20to\x20commit:\x20'+_0x355265['message']),_0x1a58ba&&(_0x1a58ba['disabled']=![],_0x1a58ba['textContent']=_0x292b7e),this['onError']&&this['onError'](_0x355265);}}['isVisible'](){const _0x551a70=this['_el']('approve-modal');return _0x551a70&&!_0x551a70['hidden'];}['destroy'](){const _0x4d90bc=this['_el']('approve-modal');_0x4d90bc&&_0x4d90bc['remove'](),this['initialized']=![];}}export function getApproveState(_0x44a06d,_0x1dda13){if(!_0x44a06d)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x44a06d['taskType']))return{'canApprove':![],'reason':(_0x44a06d['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x4563fb=_0x1dda13?.['repos_changed']?.['length']>0x0,_0x1fd832=_0x44a06d['status']==='completed'||_0x44a06d['status']==='failed'||_0x44a06d['status']==='interrupted',_0xb57a8c=_0x44a06d['containerState']==='running',_0x56f421=_0x44a06d['approvedBy']!==undefined&&_0x44a06d['approvedBy']!==null;if(_0x56f421){const _0x22f647=_0x44a06d['approvedBy']['name']||_0x44a06d['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x22f647};}if(!_0x4563fb)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x1fd832)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x44a06d['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0xb57a8c)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
1
|
+
function isLogOnlyTaskType(_0x3e4f95){return _0x3e4f95==='test'||_0x3e4f95==='deploy';}export function createApproveDialogHTML(_0x39bd47='',_0x485eaa={}){const _0x1d14eb=_0x39bd47,_0x1fa4af=_0x485eaa['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x2dbcb4=_0x485eaa['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x47eee4=_0x485eaa['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'approve-modal\x22\x20class=\x22'+_0x1fa4af+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-overlay\x22></div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-content\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2>Approve\x20Changes</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22modal-close\x22\x20id=\x22'+_0x1d14eb+'close-approve-modal\x22>×</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'approve-warning\x22\x20class=\x22'+_0x2dbcb4+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x1d14eb+'approve-warning-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'approve-error\x22\x20class=\x22'+_0x47eee4+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22error-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x1d14eb+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x1d14eb+'approve-repo-name\x22\x20class=\x22modal-repo\x22>Repository</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x1d14eb+'approve-stats\x22\x20class=\x22modal-stats\x22>0\x20files\x20changed</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'approve-branches\x22\x20class=\x22modal-branches\x22\x20hidden></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x1d14eb+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x1d14eb+'commit-message-input\x22\x20class=\x22commit-message-input\x22\x20rows=\x226\x22\x20placeholder=\x22Enter\x20commit\x20message...\x22></textarea>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20id=\x22'+_0x1d14eb+'multi-repo-note\x22\x20class=\x22field-hint\x22\x20hidden>This\x20commit\x20message\x20will\x20be\x20used\x20for\x20all\x20repositories\x20listed\x20above.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x1d14eb+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit\x20(rebase)</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x1d14eb+'push-after-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Push\x20to\x20remote\x20after\x20commit</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x1d14eb+'create-new-branch\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20new\x20branch</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'new-branch-input-container\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x1d14eb+'new-branch-name\x22\x20class=\x22new-branch-input\x22\x20placeholder=\x22Enter\x20new\x20branch\x20name...\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>A\x20new\x20branch\x20will\x20be\x20created\x20from\x20the\x20current\x20branch\x20before\x20committing.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'pr-option-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x1d14eb+'create-pull-request\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20pull\x20request</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22\x20id=\x22'+_0x1d14eb+'pr-hint\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20A\x20new\x20branch\x20will\x20be\x20created,\x20pushed,\x20and\x20a\x20pull\x20request\x20opened.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'ibmi-sync-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22approve-divider\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x1d14eb+'sync-to-ibmi\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Sync\x20to\x20IBM\x20i</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'ibmi-sync-fields\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x1d14eb+'ibmi-sync-library\x22>Library\x20name</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x1d14eb+'ibmi-sync-library\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYLIB\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'ibmi-sync-credentials-row\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x1d14eb+'ibmi-sync-user\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>User\x20profile</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x1d14eb+'ibmi-sync-user\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYUSER\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x1d14eb+'ibmi-sync-password\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>Password</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22password\x22\x20id=\x22'+_0x1d14eb+'ibmi-sync-password\x22\x20class=\x22new-branch-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Enter\x20password\x22\x20style=\x22width:\x20160px;\x22\x20autocomplete=\x22off\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'ibmi-sync-files-section\x22\x20style=\x22margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20style=\x22display:\x20block;\x20margin-bottom:\x204px;\x22>Files\x20to\x20sync</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x1d14eb+'ibmi-sync-file-tree\x22\x20class=\x22file-selection-tree-container\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22max-height:\x20250px;\x20overflow-y:\x20auto;\x20border:\x201px\x20solid\x20var(--border-color,\x20var(--color-border));\x20border-radius:\x204px;\x20padding:\x208px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-selection-summary\x22\x20id=\x22'+_0x1d14eb+'ibmi-sync-files-summary\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-ghost\x22\x20id=\x22'+_0x1d14eb+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x1d14eb+'confirm-approve\x22>Commit\x20Changes</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20';}export class ApproveDialog{constructor(_0x439745={}){this['prefix']=_0x439745['prefix']||'',this['onApprove']=_0x439745['onApprove'],this['onSync']=_0x439745['onSync'],this['onSuccess']=_0x439745['onSuccess'],this['onError']=_0x439745['onError'],this['onCreatePR']=_0x439745['onCreatePR'],this['showToast']=_0x439745['showToast']||(()=>{}),this['container']=_0x439745['container']||document['body'],this['useTaskPageStyles']=_0x439745['useTaskPageStyles']||![],this['baseUrl']=_0x439745['baseUrl']||'',this['coderflowAttribution']=_0x439745['coderflowAttribution'],this['onSyncToIbmi']=_0x439745['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x439745['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}['init'](){if(this['initialized'])return;const _0x391385=document['createElement']('div');_0x391385['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x391385['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0xa8f5f7){return document['getElementById'](''+this['prefix']+_0xa8f5f7);}['_bindEvents'](){const _0x10bb70=this['_el']('approve-modal'),_0x490289=this['_el']('close-approve-modal'),_0x261906=this['_el']('cancel-approve'),_0x474084=this['_el']('confirm-approve'),_0x13358b=_0x10bb70?.['querySelector']('.modal-overlay'),_0xccf3ce=this['_el']('create-new-branch'),_0x22a72f=this['_el']('new-branch-input-container'),_0x6811c3=this['_el']('new-branch-name'),_0x22a7f4=this['_el']('push-after-commit'),_0x1c1eb5=this['_el']('create-pull-request'),_0x1fc314=this['_el']('pr-hint');_0x490289?.['addEventListener']('click',()=>this['hide']()),_0x261906?.['addEventListener']('click',()=>this['hide']()),_0x13358b?.['addEventListener']('click',()=>this['hide']()),_0x474084?.['addEventListener']('click',()=>this['_handleApprove']());_0xccf3ce&&_0xccf3ce['addEventListener']('change',()=>{_0x22a72f&&(_0x22a72f['hidden']=!_0xccf3ce['checked']),_0xccf3ce['checked']&&_0x6811c3&&_0x6811c3['focus']();});_0x1c1eb5&&_0x22a7f4&&_0xccf3ce&&(_0x1c1eb5['addEventListener']('change',()=>{this['_createPR']=_0x1c1eb5['checked'];if(_0x1c1eb5['checked']){_0x22a7f4['checked']=!![],_0x22a7f4['disabled']=!![],_0xccf3ce['checked']=!![],_0xccf3ce['disabled']=!![];_0x22a72f&&(_0x22a72f['hidden']=![]);if(_0x1fc314)_0x1fc314['hidden']=![];}else{_0x22a7f4['disabled']=![],_0xccf3ce['disabled']=![];if(_0x1fc314)_0x1fc314['hidden']=!![];}}),_0x22a7f4['addEventListener']('change',()=>{if(!_0x22a7f4['checked']&&_0x1c1eb5['checked']){_0x1c1eb5['checked']=![],this['_createPR']=![],_0x22a7f4['disabled']=![],_0xccf3ce['disabled']=![];if(_0x1fc314)_0x1fc314['hidden']=!![];}}));const _0x5e197a=this['_el']('sync-to-ibmi');_0x5e197a&&_0x5e197a['addEventListener']('change',async _0x31e8e4=>{const _0x5a7b57=this['_el']('ibmi-sync-fields');if(_0x5a7b57)_0x5a7b57['hidden']=!_0x31e8e4['target']['checked'];if(_0x31e8e4['target']['checked']){const _0x4e0a4b=this['_el']('ibmi-sync-library'),_0x534422=localStorage['getItem']('coderflow_ibmi_sync_library');_0x534422&&_0x4e0a4b&&!_0x4e0a4b['value']&&(_0x4e0a4b['value']=_0x534422);const _0x1ed38e=this['_el']('ibmi-sync-user');if(_0x1ed38e&&!_0x1ed38e['value']){const _0x22b9a9=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x22b9a9)_0x1ed38e['value']=_0x22b9a9;}const _0x2dafca=this['_el']('ibmi-sync-password');if(_0x2dafca)_0x2dafca['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0x1a679e=>{_0x1a679e['key']==='Escape'&&_0x10bb70&&!_0x10bb70['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x189b7c=this['_el']('ibmi-sync-file-tree'),_0x454f32=this['_el']('ibmi-sync-files-summary');if(!_0x189b7c)return;_0x189b7c['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x454f32)_0x454f32['textContent']='';try{const {files:_0x56c85e,absolutePaths:_0x3dff47}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x56c85e,this['_syncAbsolutePaths']=_0x3dff47;if(_0x56c85e['length']===0x0){_0x189b7c['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x5110c7}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x374e36,hasKnownIbmiExtension:_0x1e43e6}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x5110c7({'container':_0x189b7c,'files':_0x56c85e,'isPreselected':_0x438dfe=>{const {valid:_0x763f08}=_0x374e36(_0x438dfe);return _0x763f08&&_0x1e43e6(_0x438dfe);},'isDisabled':_0x569e4f=>{const {valid:_0x288752,reason:_0x2f87b7}=_0x374e36(_0x569e4f);return{'disabled':!_0x288752,'reason':_0x2f87b7};},'isAutoCheckEligible':_0x4daadf=>{const {valid:_0xb8c65f}=_0x374e36(_0x4daadf);return _0xb8c65f&&_0x1e43e6(_0x4daadf);},'onChange':_0x14e83f=>{_0x454f32&&(_0x454f32['textContent']=_0x14e83f['length']+'\x20of\x20'+_0x56c85e['length']+'\x20file'+(_0x56c85e['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x1e52c3){_0x189b7c['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0xfd8914){const _0x352735=this['_el']('approve-error'),_0x58bfc8=this['_el']('approve-error-text');_0x352735&&_0x58bfc8&&(_0x58bfc8['textContent']=_0xfd8914,_0x352735['hidden']=![],_0x352735['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x22b6d5=this['_el']('approve-error'),_0x4539f6=this['_el']('approve-error-text');_0x22b6d5&&_0x4539f6&&(_0x22b6d5['hidden']=!![],_0x4539f6['textContent']='');}['_displayBranchInfo'](_0x3bf077,_0x5ccdd5={}){const _0x110be4=this['_el']('approve-branches');if(!_0x110be4)return;const _0x1b73f1=[];for(const _0x1e7ad5 of _0x3bf077){_0x5ccdd5[_0x1e7ad5['name']]&&_0x1b73f1['push']({'repo':_0x1e7ad5['name'],'branch':_0x5ccdd5[_0x1e7ad5['name']]});}if(_0x1b73f1['length']>0x0){_0x110be4['hidden']=![];if(_0x1b73f1['length']===0x1)_0x110be4['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x1b73f1[0x0]['branch']+'</code></div>';else{const _0x500749=_0x1b73f1['map'](_0x23c64b=>'<div\x20class=\x22branch-item\x22><strong>'+_0x23c64b['repo']+':</strong>\x20<code>'+_0x23c64b['branch']+'</code></div>')['join']('');_0x110be4['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x500749+'</div></div>';}}else _0x110be4['hidden']=!![],_0x110be4['innerHTML']='';}['showWarning'](_0x5c0eef){const _0x4549ad=this['_el']('approve-warning'),_0x30e226=this['_el']('approve-warning-text');_0x4549ad&&_0x30e226&&(_0x30e226['textContent']=_0x5c0eef,_0x4549ad['hidden']=![]);}['hideWarning'](){const _0x103c9b=this['_el']('approve-warning'),_0x2eb6fd=this['_el']('approve-warning-text');_0x103c9b&&_0x2eb6fd&&(_0x103c9b['hidden']=!![],_0x2eb6fd['textContent']='');}['_stripCoAuthoredByLines'](_0x5380b4){return _0x5380b4['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x1a9503){try{let _0x366bdb;try{const _0xba2e8f=await fetch(this['baseUrl']+'/settings');if(_0xba2e8f['ok']){const _0x103863=await _0xba2e8f['json']();_0x366bdb=_0x103863['coderflow_attribution']!==![];}}catch(_0xe0f0c){}_0x366bdb===undefined&&(this['coderflowAttribution']!==undefined?_0x366bdb=this['coderflowAttribution']!==![]:_0x366bdb=!![]);const _0x2a2d88=this['_stripCoAuthoredByLines'](_0x1a9503);if(!_0x366bdb)return _0x2a2d88;const _0x4229a1='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x2a2d88+_0x4229a1;}catch(_0x36002c){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x36002c),_0x1a9503;}}['show'](_0xcaf2e9){!this['initialized']&&this['init']();this['taskData']=_0xcaf2e9;const _0x208c7f=this['_el']('approve-modal'),_0x5c86c1=this['_el']('commit-message-input'),_0x53d5fd=this['_el']('pull-before-commit'),_0x1d3295=this['_el']('push-after-commit'),_0x5c6beb=this['_el']('create-new-branch'),_0x131c22=this['_el']('new-branch-input-container'),_0x40d5f8=this['_el']('new-branch-name'),_0x54b14d=this['_el']('approve-repo-name'),_0x3f3869=this['_el']('approve-stats'),_0x569c56=this['_el']('multi-repo-note');if(!_0x208c7f)return;this['hideError'](),this['hideWarning']();_0xcaf2e9['warning']&&this['showWarning'](_0xcaf2e9['warning']);const _0x4c6d02=_0xcaf2e9['reposChanged']||[];if(_0x4c6d02['length']===0x0&&!_0xcaf2e9['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x4c6d02,_0xcaf2e9);const _0x37902d=_0xcaf2e9['commitMessage']||'',_0x19f25f=this['_stripCoAuthoredByLines'](_0x37902d);_0x5c86c1['value']=_0x19f25f;if(_0x53d5fd)_0x53d5fd['checked']=!![];if(_0x1d3295)_0x1d3295['checked']=!![];_0x5c6beb&&(_0x5c6beb['checked']=![]);_0x131c22&&(_0x131c22['hidden']=!![]);_0x40d5f8&&(_0x40d5f8['value']='');if(_0x1d3295)_0x1d3295['disabled']=![];if(_0x5c6beb)_0x5c6beb['disabled']=![];this['updatePRSupport'](_0xcaf2e9['prSupported']===!![]);const _0x35fb4e=this['_el']('ibmi-sync-section');if(_0x35fb4e){_0x35fb4e['hidden']=!_0xcaf2e9['ibmiSyncAvailable'];const _0x1a276f=this['_el']('sync-to-ibmi'),_0x155f72=this['_el']('ibmi-sync-fields'),_0xfc5578=this['_el']('ibmi-sync-library');if(_0x1a276f)_0x1a276f['checked']=![];if(_0x155f72)_0x155f72['hidden']=!![];if(_0xfc5578)_0xfc5578['value']='';const _0x6ec5ff=this['_el']('ibmi-sync-credentials-row');_0x6ec5ff&&(_0x6ec5ff['hidden']=!(_0xcaf2e9['ibmiSyncAvailable']&&_0xcaf2e9['syncCredentials']==='prompt'));}const _0x566e00=this['_el']('confirm-approve');_0xcaf2e9['syncFirst']&&this['onSync']?(_0x566e00&&(_0x566e00['disabled']=!![],_0x566e00['textContent']='Syncing...'),this['_performSync']()):_0x566e00&&(_0x566e00['disabled']=![],_0x566e00['textContent']='Commit\x20Changes');_0x208c7f['hidden']=![];const _0x4a43a5=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x4a43a5,'taskId':_0xcaf2e9['taskId'],'originalCommitMessage':_0x19f25f}),setTimeout(()=>{_0x5c86c1['focus'](),_0x5c86c1['setSelectionRange'](0x0,_0x5c86c1['value']['length']);},0x64);}['updatePRSupport'](_0x4ec2b4){const _0x4c389a=this['_el']('pr-option-section'),_0x4ef6da=this['_el']('create-pull-request'),_0x58ff25=this['_el']('pr-hint'),_0x2eb064=this['_el']('push-after-commit'),_0x1ac737=this['_el']('create-new-branch');if(!_0x4c389a)return;if(_0x4ec2b4){_0x4c389a['hidden']=![];_0x4ef6da&&!_0x4ef6da['disabled']&&(_0x4ef6da['checked']=![]);if(_0x58ff25)_0x58ff25['hidden']=!![];this['_createPR']=![];return;}_0x4ef6da?.['checked']&&(_0x4ef6da['checked']=![]);if(_0x58ff25)_0x58ff25['hidden']=!![];if(_0x2eb064)_0x2eb064['disabled']=![];if(_0x1ac737)_0x1ac737['disabled']=![];this['_createPR']=![],_0x4c389a['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x3d9f85,taskId:_0x29bfee,originalCommitMessage:_0x4930f7}){const _0x44e3bc=this['_el']('commit-message-input');if(!_0x44e3bc)return;const _0x24cc3e=await this['_addAttributionIfEnabled'](_0x4930f7);if(_0x3d9f85!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x29bfee)return;if(!this['isVisible']())return;const _0x461bd4=_0x51c11b=>_0x51c11b['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x461bd4(_0x44e3bc['value'])!==_0x461bd4(_0x4930f7))return;_0x44e3bc['value']=_0x24cc3e;}['_updateDisplay'](_0x3204c3,_0x16b3f4){const _0x1e66c1=this['_el']('approve-repo-name'),_0x34d4e5=this['_el']('approve-stats'),_0x506e98=this['_el']('multi-repo-note');if(_0x3204c3['length']===0x0){if(_0x1e66c1)_0x1e66c1['textContent']='Syncing...';if(_0x34d4e5)_0x34d4e5['textContent']='';if(_0x506e98)_0x506e98['hidden']=!![];return;}const _0x5d2877=_0x3204c3['reduce']((_0xc7a16f,_0x50588d)=>_0xc7a16f+(_0x50588d['files_changed']||0x0),0x0),_0x397bdb=_0x3204c3['reduce']((_0x550ba7,_0x9814ee)=>_0x550ba7+(_0x9814ee['lines_added']||0x0),0x0),_0x3fc844=_0x3204c3['reduce']((_0x5ec515,_0x2de2cb)=>_0x5ec515+(_0x2de2cb['lines_deleted']||0x0),0x0);if(_0x3204c3['length']===0x1){if(_0x1e66c1)_0x1e66c1['textContent']=_0x3204c3[0x0]?.['name']||'repository';if(_0x506e98)_0x506e98['hidden']=!![];}else{const _0x3e09d7=_0x3204c3['map'](_0x4e41ea=>_0x4e41ea['name'])['join'](',\x20');if(_0x1e66c1)_0x1e66c1['textContent']=_0x3204c3['length']+'\x20repositories:\x20'+_0x3e09d7;if(_0x506e98)_0x506e98['hidden']=![];}_0x34d4e5&&(_0x34d4e5['textContent']=_0x5d2877+'\x20file'+(_0x5d2877===0x1?'':'s')+'\x20changed\x20(+'+_0x397bdb+'\x20-'+_0x3fc844+')'),this['_displayBranchInfo'](_0x3204c3,_0x16b3f4?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x3a5fda=this['_el']('confirm-approve');try{const _0x1c5ab0=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x1c5ab0['repos_changed']){const _0x33a12a=this['taskData']['reposChanged']?.['length']||0x0,_0x546174=this['taskData']['reposChanged']?.['reduce']((_0x303972,_0x573607)=>_0x303972+(_0x573607['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x1c5ab0['repos_changed'];if(_0x1c5ab0['current_branches']){const _0x9eb082={...this['taskData']['branches']||{}};for(const [_0x514c4c,_0x59bdb8]of Object['entries'](_0x1c5ab0['current_branches'])){_0x59bdb8?_0x9eb082[_0x514c4c]=_0x59bdb8:delete _0x9eb082[_0x514c4c];}this['taskData']['branches']=_0x9eb082;}this['_updateDisplay'](_0x1c5ab0['repos_changed'],this['taskData']);const _0x5eaf28=_0x1c5ab0['repos_changed']['length'],_0x503e44=_0x1c5ab0['repos_changed']['reduce']((_0x54f09e,_0x20cfdd)=>_0x54f09e+(_0x20cfdd['files_changed']||0x0),0x0);(_0x503e44>_0x546174||_0x5eaf28>_0x33a12a)&&this['showWarning'](this['taskData']['warning']?this['taskData']['warning']+'\x20Additional\x20changes\x20detected\x20since\x20last\x20sync.':'Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.');}_0x3a5fda&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x3a5fda['disabled']=!![],_0x3a5fda['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x3a5fda['disabled']=![],_0x3a5fda['textContent']='Commit\x20Changes'));}catch(_0x11c184){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x11c184);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x11c184['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x3a5fda&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x3a5fda['disabled']=![],_0x3a5fda['textContent']='Commit\x20Changes'):(_0x3a5fda['disabled']=!![],_0x3a5fda['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x3fbc8d=this['_el']('approve-modal');_0x3fbc8d&&(_0x3fbc8d['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x33b438=this['_el']('commit-message-input'),_0x3ba37e=this['_el']('pull-before-commit'),_0x51f63d=this['_el']('push-after-commit'),_0x5b3f99=this['_el']('create-new-branch'),_0x44e4fc=this['_el']('new-branch-name'),_0xed7224=this['_el']('confirm-approve'),_0x72da4e=_0x33b438['value']['trim'](),_0x21471b=_0x3ba37e?.['checked']??!![],_0x5a69b5=_0x51f63d?.['checked']??!![],_0x255976=_0x5b3f99?.['checked']||![],_0x3add33=_0x44e4fc?.['value']['trim']()||'';this['hideError']();if(!_0x72da4e){this['showError']('Commit\x20message\x20is\x20required'),_0x33b438['focus']();return;}if(_0x255976&&!_0x3add33){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x44e4fc?.['focus']();return;}if(_0x255976&&_0x3add33){const _0x3288bf=/[\s~^:?*\[\\]/;if(_0x3288bf['test'](_0x3add33)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x44e4fc?.['focus']();return;}}const _0x24408a=this['_el']('sync-to-ibmi')?.['checked'];if(_0x24408a){const _0x5a2f69=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x5a2f69){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x1c8443=this['_syncFileTree']['getSelectedFiles']();if(_0x1c8443['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x1bed4d=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x1bed4d){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x4d4b4a=this['_el']('ibmi-sync-password')?.['value'];if(!_0x4d4b4a){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x20522f=_0xed7224?.['textContent']||'Commit\x20Changes';_0xed7224&&(_0xed7224['disabled']=!![],_0x255976?_0xed7224['textContent']='Creating\x20branch\x20&\x20committing...':_0xed7224['textContent']=_0x21471b?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x189ba1={'commit_message':_0x72da4e,'pull':_0x21471b,'push':_0x5a69b5};_0x255976&&_0x3add33&&(_0x189ba1['new_branch']=_0x3add33);let _0x1acbd2=null;this['onApprove']&&(_0x1acbd2=await this['onApprove'](this['taskData']['taskId'],_0x189ba1));let _0x5916a0='Changes\x20committed';if(_0x255976)_0x5916a0='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x3add33+'\x27',_0x5a69b5&&(_0x5916a0+='\x20and\x20pushed');else{if(_0x21471b&&_0x5a69b5)_0x5916a0='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x21471b)_0x5916a0='Changes\x20pulled\x20and\x20committed';else _0x5a69b5&&(_0x5916a0='Changes\x20committed\x20and\x20pushed');}}const _0x2a780e=this['_el']('sync-to-ibmi')?.['checked'];let _0x157f9c=null,_0x2976eb=null,_0x158430=null,_0x1c3c13=null;if(_0x2a780e&&this['onSyncToIbmi']){_0x157f9c=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x2976eb=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x158430=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x55d7a8=this['_syncFileTree']['getSelectedFiles']();_0x1c3c13=_0x55d7a8['map'](_0x540198=>{const _0x1c6762=this['_syncRelativeFiles']['indexOf'](_0x540198);return _0x1c6762>=0x0?this['_syncAbsolutePaths'][_0x1c6762]:_0x540198;});}}this['showToast'](_0x5916a0,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x1acbd2||{});}catch(_0x285ebe){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x285ebe);}if(_0x2a780e&&this['onSyncToIbmi']&&_0x157f9c){localStorage['setItem']('coderflow_ibmi_sync_library',_0x157f9c);if(_0x2976eb)localStorage['setItem']('coderflow_ibmi_sync_user',_0x2976eb);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x157f9c,_0x2976eb,_0x158430,_0x1c3c13);}catch(_0x248316){this['showToast']('Sync\x20failed:\x20'+_0x248316['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x20ff29){console['error']('Failed\x20to\x20approve\x20changes',_0x20ff29),this['showError']('Failed\x20to\x20commit:\x20'+_0x20ff29['message']),_0xed7224&&(_0xed7224['disabled']=![],_0xed7224['textContent']=_0x20522f),this['onError']&&this['onError'](_0x20ff29);}}['isVisible'](){const _0x5e8740=this['_el']('approve-modal');return _0x5e8740&&!_0x5e8740['hidden'];}['destroy'](){const _0x5f6020=this['_el']('approve-modal');_0x5f6020&&_0x5f6020['remove'](),this['initialized']=![];}}export function getApproveState(_0x40eb66,_0x5543a6){if(!_0x40eb66)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x40eb66['taskType']))return{'canApprove':![],'reason':(_0x40eb66['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x556c5e=_0x5543a6?.['repos_changed']?.['length']>0x0,_0x3d1581=_0x40eb66['status']==='completed'||_0x40eb66['status']==='failed'||_0x40eb66['status']==='interrupted',_0x5a8c61=_0x40eb66['containerState']==='running',_0x395888=_0x40eb66['approvedBy']!==undefined&&_0x40eb66['approvedBy']!==null;if(_0x395888){const _0x352128=_0x40eb66['approvedBy']['name']||_0x40eb66['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x352128};}if(!_0x556c5e)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x3d1581)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x40eb66['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x5a8c61)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function buildAutomationEnvironmentHref(
|
|
1
|
+
export function buildAutomationEnvironmentHref(_0x57079f,_0x3330e8){const _0x4d90d4=new URLSearchParams();_0x57079f&&_0x4d90d4['set']('env',String(_0x57079f));_0x4d90d4['set']('tab','automations');_0x3330e8&&_0x4d90d4['set']('automation',String(_0x3330e8));const _0x368312=_0x4d90d4['toString']();return'environments.html'+(_0x368312?'?'+_0x368312:'');}export function buildAutomationTaskFilterHref(_0x265a4e){const _0x5ec9c4=new URLSearchParams();_0x265a4e&&_0x5ec9c4['set']('automation',String(_0x265a4e));const _0x1a4abd=_0x5ec9c4['toString']();return'index.html'+(_0x1a4abd?'?'+_0x1a4abd:'');}export function parseAutomationDeepLinkParams(_0x55cf0a=''){const _0x3c60cb=new URLSearchParams(_0x55cf0a||'');return{'env':_0x3c60cb['get']('env'),'tab':_0x3c60cb['get']('tab'),'automation':_0x3c60cb['get']('automation')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':'1','monthlyHour':'0','monthlyMinute':'0','recurringInterval':'*/30\x20*\x20*\x20*\x20*','recurringStartHour':'','recurringEndHour':'','recurringDayToken':'*','customCron':''}),RECURRING_INTERVAL_STEPS=['2','4','6','8','12'];function createDefaultScheduleFormState(){return{...DEFAULT_SCHEDULE_FORM_STATE};}function parseBoundedInteger(
|
|
1
|
+
export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':'1','monthlyHour':'0','monthlyMinute':'0','recurringInterval':'*/30\x20*\x20*\x20*\x20*','recurringStartHour':'','recurringEndHour':'','recurringDayToken':'*','customCron':''}),RECURRING_INTERVAL_STEPS=['2','4','6','8','12'];function createDefaultScheduleFormState(){return{...DEFAULT_SCHEDULE_FORM_STATE};}function parseBoundedInteger(_0x22258e,_0x173841,_0x167032){const _0x3d3eac=Number['parseInt'](_0x22258e,0xa);if(!Number['isInteger'](_0x3d3eac)||_0x3d3eac<_0x173841||_0x3d3eac>_0x167032)return null;return _0x3d3eac;}function inferRecurringInterval(_0x4d7a7b,_0x28fd4c){if(_0x4d7a7b==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x4d7a7b==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x4d7a7b!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x28fd4c==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x28fd4c))return'0\x20*\x20*\x20*\x20*';for(const _0x344a77 of RECURRING_INTERVAL_STEPS){if(_0x28fd4c['startsWith']('*/'+_0x344a77)||_0x28fd4c['includes']('/'+_0x344a77))return'0\x20*/'+_0x344a77+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x59febf){const _0x7d8f1b=String(_0x59febf||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x7d8f1b)return{'start':'','end':''};const _0x38910e=parseBoundedInteger(_0x7d8f1b[0x1],0x0,0x17),_0xce4e69=parseBoundedInteger(_0x7d8f1b[0x2],0x0,0x17);if(_0x38910e===null||_0xce4e69===null||_0x38910e>_0xce4e69)return{'start':'','end':''};return{'start':String(_0x38910e),'end':String(_0xce4e69)};}export function parseAutomationScheduleToFormState(_0x2c99df){const _0x121f97=String(_0x2c99df||'')['trim'](),_0x2e6d98=createDefaultScheduleFormState(),_0x4088cf=_0x121f97['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x4088cf){const _0x45c525=parseBoundedInteger(_0x4088cf[0x1],0x0,0x3b),_0x98f546=parseBoundedInteger(_0x4088cf[0x2],0x0,0x17);if(_0x45c525!==null&&_0x98f546!==null)return _0x2e6d98['frequency']='daily',_0x2e6d98['dailyMinute']=String(_0x45c525),_0x2e6d98['dailyHour']=String(_0x98f546),_0x2e6d98;}const _0x41ad47=_0x121f97['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x41ad47){const _0x14a170=parseBoundedInteger(_0x41ad47[0x1],0x0,0x3b),_0x27b555=parseBoundedInteger(_0x41ad47[0x2],0x0,0x17),_0x44b607=parseBoundedInteger(_0x41ad47[0x3],0x0,0x7);if(_0x14a170!==null&&_0x27b555!==null&&_0x44b607!==null)return _0x2e6d98['frequency']='weekly',_0x2e6d98['weeklyMinute']=String(_0x14a170),_0x2e6d98['weeklyHour']=String(_0x27b555),_0x2e6d98['weeklyDay']=String(_0x44b607===0x7?0x0:_0x44b607),_0x2e6d98;}const _0x54b8d2=_0x121f97['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0x54b8d2){const _0x299e21=parseBoundedInteger(_0x54b8d2[0x1],0x0,0x3b),_0x31c3f0=parseBoundedInteger(_0x54b8d2[0x2],0x0,0x17),_0x6015cb=parseBoundedInteger(_0x54b8d2[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x299e21!==null&&_0x31c3f0!==null&&_0x6015cb!==null)return _0x2e6d98['frequency']='monthly',_0x2e6d98['monthlyMinute']=String(_0x299e21),_0x2e6d98['monthlyHour']=String(_0x31c3f0),_0x2e6d98['monthlyDay']=String(_0x6015cb),_0x2e6d98;}const _0x5369aa=_0x121f97['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x5369aa){const [,_0x3ad157,_0x1ff2a7,_0x579a95]=_0x5369aa;_0x2e6d98['frequency']='recurring',_0x2e6d98['recurringInterval']=inferRecurringInterval(_0x3ad157,_0x1ff2a7),_0x2e6d98['recurringDayToken']=String(_0x579a95||'')['trim']()||'*';const _0x1d5ae9=parseRecurringHourRange(_0x1ff2a7);return _0x2e6d98['recurringStartHour']=_0x1d5ae9['start'],_0x2e6d98['recurringEndHour']=_0x1d5ae9['end'],_0x2e6d98;}return _0x2e6d98['frequency']='custom',_0x2e6d98['customCron']=_0x121f97,_0x2e6d98;}export function buildAutomationCronFromFormState(_0x3f56e2={}){const _0x32f240=String(_0x3f56e2['frequency']||'daily');if(_0x32f240==='custom')return String(_0x3f56e2['customCron']||'')['trim']();if(_0x32f240==='daily'){const _0x11534c=String(_0x3f56e2['dailyHour']??'2'),_0x5a194e=String(_0x3f56e2['dailyMinute']??'0');return _0x5a194e+'\x20'+_0x11534c+'\x20*\x20*\x20*';}if(_0x32f240==='weekly'){const _0x2c546a=String(_0x3f56e2['weeklyDay']??'1'),_0x246acd=String(_0x3f56e2['weeklyHour']??'9'),_0x4da707=String(_0x3f56e2['weeklyMinute']??'0');return _0x4da707+'\x20'+_0x246acd+'\x20*\x20*\x20'+_0x2c546a;}if(_0x32f240==='monthly'){const _0x5d7226=String(_0x3f56e2['monthlyDay']??'1'),_0x47c96f=String(_0x3f56e2['monthlyHour']??'0'),_0x21d413=String(_0x3f56e2['monthlyMinute']??'0');return _0x21d413+'\x20'+_0x47c96f+'\x20'+_0x5d7226+'\x20*\x20*';}const _0x497c73=String(_0x3f56e2['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x2e364d='*/30',_0x108517='*']=_0x497c73['split'](/\s+/);let _0x440989=_0x108517;const _0x451f43=String(_0x3f56e2['recurringStartHour']??'')['trim'](),_0x555ba5=String(_0x3f56e2['recurringEndHour']??'')['trim']();if(_0x451f43!==''&&_0x555ba5!==''){const _0x4ac2af=Number['parseInt'](_0x451f43,0xa),_0x54711a=Number['parseInt'](_0x555ba5,0xa);if(Number['isInteger'](_0x4ac2af)&&Number['isInteger'](_0x54711a)&&_0x4ac2af<=_0x54711a){const _0x460328=_0x108517['match'](/^\*\/(\d+)$/);_0x460328?_0x440989=_0x4ac2af+'-'+_0x54711a+'/'+_0x460328[0x1]:_0x440989=_0x4ac2af+'-'+_0x54711a;}}const _0x5afd44=String(_0x3f56e2['recurringDayToken']??'*')['trim']()||'*';return _0x2e364d+'\x20'+_0x440989+'\x20*\x20*\x20'+_0x5afd44;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class CommentsWidget{constructor(_0x4b93ad,_0x904b50={}){this['container']=_0x4b93ad,this['options']={'taskId':_0x904b50['taskId']||null,'currentUserId':_0x904b50['currentUserId']||null,'compact':_0x904b50['compact']||![],'skipHeader':_0x904b50['skipHeader']||![],'onCommentsLoaded':_0x904b50['onCommentsLoaded']||null,'onCommentsChanged':_0x904b50['onCommentsChanged']||null,'enableAttachments':_0x904b50['enableAttachments']||![],'getAPI':_0x904b50['getAPI']||(()=>window['API'])},this['comments']=[],this['editor']=null,this['editingCommentId']=null,this['isLoading']=![],this['pendingAttachments']=[],this['existingAttachments']=[],this['init']();}['init'](){this['container']['innerHTML']='',this['container']['className']='comments-widget\x20'+(this['options']['compact']?'comments-widget-compact':''),this['createHeader'](),this['createCommentsList'](),this['createInputSection'](),this['options']['taskId']&&(this['loadComments'](),this['options']['enableAttachments']&&this['loadExistingAttachments']());}async['loadExistingAttachments'](){try{const _0x13bcb1=this['options']['getAPI'](),_0x59c8fe=await _0x13bcb1['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x59c8fe['attachments']||[];}catch(_0xf76f4d){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0xf76f4d),this['existingAttachments']=[];}}['createHeader'](){if(this['options']['skipHeader']){this['header']=null,this['isExpanded']=!![];return;}if(this['options']['compact']){this['header']=document['createElement']('div'),this['header']['className']='comments-header\x20comments-header-compact',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22comments-toggle-btn\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-toggle-icon\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-label\x22>Comments</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-badge\x22\x20id=\x22comments-count-badge\x22>0</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-chevron\x22\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x226\x209\x2012\x2015\x2018\x209\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']);const _0x3d6fb4=this['header']['querySelector']('.comments-toggle-btn');_0x3d6fb4['addEventListener']('click',()=>this['toggleExpanded']()),this['isExpanded']=![];}else this['header']=document['createElement']('div'),this['header']['className']='comments-header',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20class=\x22comments-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2218\x22\x20height=\x2218\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Comments\x20<span\x20class=\x22comments-count\x22\x20id=\x22comments-count\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</h3>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']),this['isExpanded']=!![];}['createCommentsList'](){this['commentsListWrapper']=document['createElement']('div'),this['commentsListWrapper']['className']='comments-list-wrapper',this['options']['compact']&&!this['isExpanded']&&(this['commentsListWrapper']['hidden']=!![]),this['commentsList']=document['createElement']('div'),this['commentsList']['className']='comments-list',this['commentsListWrapper']['appendChild'](this['commentsList']),this['container']['appendChild'](this['commentsListWrapper']);}['createInputSection'](){this['inputSection']=document['createElement']('div'),this['inputSection']['className']='comments-input-section';this['options']['compact']&&!this['isExpanded']&&(this['inputSection']['hidden']=!![]);const _0x562f5b=document['createElement']('div');_0x562f5b['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x562f5b['appendChild'](this['toolbar']);const _0x318e64=document['createElement']('div');_0x318e64['className']='comments-editor-placeholder',_0x562f5b['appendChild'](_0x318e64);const _0x379dfc=document['createElement']('div');_0x379dfc['className']='comments-input-actions',_0x379dfc['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-cancel-btn\x22\x20hidden>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-primary\x20btn-small\x20comments-submit-btn\x22\x20disabled>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-text\x22>Add\x20Comment</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-loading\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22spinner\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x2210\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x223\x22\x20stroke-dasharray=\x2231.4\x2031.4\x22\x20stroke-linecap=\x22round\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20',this['inputSection']['appendChild'](_0x562f5b),this['inputSection']['appendChild'](_0x379dfc),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x318e64),this['submitBtn']=_0x379dfc['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x379dfc['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x2654b8){const _0xa4aef=document['createElement']('textarea');_0xa4aef['placeholder']='Add\x20a\x20comment...',_0xa4aef['className']='comments-textarea',_0x2654b8['appendChild'](_0xa4aef);const _0x5262bf=window['MarkdownEditor'];if(!_0x5262bf){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0xe81ea0={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x2081a7=>{const _0x51ea31=_0x2081a7&&_0x2081a7['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x51ea31;},'fetchUsers':async()=>{const _0x10ebb3=this['options']['getAPI']();return _0x10ebb3['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0xe81ea0['onAddAttachments']=_0xc56f60=>{this['pendingAttachments']['push'](..._0xc56f60),this['submitBtn']['disabled']=![];},_0xe81ea0['resolveAttachmentUrl']=_0x11b6e7=>{const _0x3c6922=this['options']['getAPI']();return _0x3c6922['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x11b6e7);},_0xe81ea0['isAttachmentNameTaken']=_0x59604c=>{return this['pendingAttachments']['some'](_0x3e91a0=>_0x3e91a0['name']===_0x59604c)||this['existingAttachments']['some'](_0x5ee123=>_0x5ee123['name']===_0x59604c);});this['editor']=new _0x5262bf(_0xa4aef,_0xe81ea0);const _0x4943d2=this['editor']['editor'],_0x359a4f=this['editor']['toolbar'];_0x359a4f&&(_0x359a4f['classList']['add']('comments-toolbar-hidden'),_0x4943d2['addEventListener']('focus',()=>{_0x359a4f['classList']['remove']('comments-toolbar-hidden');}),_0x4943d2['addEventListener']('blur',_0x5845b2=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x359a4f['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x359a4f['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x2b4264=this['header']['querySelector']('.comments-chevron');_0x2b4264&&(_0x2b4264['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x3d0cfe){this['options']['taskId']=_0x3d0cfe,this['comments']=[],this['renderComments'](),_0x3d0cfe&&this['loadComments']();}async['loadComments'](){if(!this['options']['taskId']||this['isLoading'])return;this['isLoading']=!![],this['commentsList']['innerHTML']='<div\x20class=\x22comments-loading\x22>Loading\x20comments...</div>';try{const _0x418bd5=this['options']['getAPI'](),_0x5a71dc=await _0x418bd5['getComments'](this['options']['taskId']);this['comments']=_0x5a71dc['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x2fe41e){console['error']('Failed\x20to\x20load\x20comments:',_0x2fe41e),this['commentsList']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-error\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Failed\x20to\x20load\x20comments\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x22\x20onclick=\x22this.parentElement.parentElement.closest(\x27.comments-widget\x27).__widget.loadComments()\x22>Retry</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20';}finally{this['isLoading']=![];}}['renderComments'](){if(this['comments']['length']===0x0){this['commentsList']['innerHTML']='<div\x20class=\x22comments-empty\x22>No\x20comments\x20yet</div>';return;}this['commentsList']['innerHTML']='',this['comments']['forEach'](_0xe4931a=>{const _0x1ae487=this['createCommentElement'](_0xe4931a);this['commentsList']['appendChild'](_0x1ae487);});}['createCommentElement'](_0x3e2cce){const _0x30046c=document['createElement']('div');_0x30046c['className']='comment-item',_0x30046c['dataset']['commentId']=_0x3e2cce['id'];const _0x4a11ec=this['options']['currentUserId']&&_0x3e2cce['author']?.['userId']===this['options']['currentUserId'],_0x1b4c32=this['formatDate'](_0x3e2cce['createdAt']),_0xc3305e=_0x3e2cce['updatedAt']!==_0x3e2cce['createdAt'],_0x4141f0=this['resolveAttachmentUrls'](_0x3e2cce['content']);let _0x122026=window['marked']?window['marked']['parse'](_0x4141f0):_0x4141f0;_0x122026=this['renderMentions'](_0x122026),_0x30046c['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-author\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-author-name\x22>'+this['escapeHtml'](_0x3e2cce['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x3e2cce['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1b4c32+(_0xc3305e?'\x20(edited)':'')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x4a11ec?'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-actions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-edit-btn\x22\x20title=\x22Edit\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M11\x204H4a2\x202\x200\x200\x200-2\x202v14a2\x202\x200\x200\x200\x202\x202h14a2\x202\x200\x200\x200\x202-2v-7\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M18.5\x202.5a2.121\x202.121\x200\x200\x201\x203\x203L12\x2015l-4\x201\x201-4\x209.5-9.5z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-delete-btn\x22\x20title=\x22Delete\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x223\x206\x205\x206\x2021\x206\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M19\x206v14a2\x202\x200\x200\x201-2\x202H7a2\x202\x200\x200\x201-2-2V6m3\x200V4a2\x202\x200\x200\x201\x202-2h4a2\x202\x200\x200\x201\x202\x202v2\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20':'')+'\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-content\x22>'+_0x122026+'</div>\x0a\x20\x20\x20\x20';if(_0x4a11ec){const _0x2eb60b=_0x30046c['querySelector']('.comment-edit-btn'),_0x19c0e6=_0x30046c['querySelector']('.comment-delete-btn');_0x2eb60b?.['addEventListener']('click',()=>this['startEdit'](_0x3e2cce)),_0x19c0e6?.['addEventListener']('click',()=>this['deleteComment'](_0x3e2cce['id']));}return _0x30046c;}['formatDate'](_0x3f9245){const _0xb7ec15=new Date(_0x3f9245),_0x2da9f8=new Date(),_0xb732d1=_0x2da9f8-_0xb7ec15,_0x52e98a=Math['floor'](_0xb732d1/0xea60),_0x2738a5=Math['floor'](_0xb732d1/0x36ee80),_0x2f458c=Math['floor'](_0xb732d1/0x5265c00);if(_0x52e98a<0x1)return'just\x20now';if(_0x52e98a<0x3c)return _0x52e98a+'m\x20ago';if(_0x2738a5<0x18)return _0x2738a5+'h\x20ago';if(_0x2f458c<0x7)return _0x2f458c+'d\x20ago';return _0xb7ec15['toLocaleDateString']();}['escapeHtml'](_0x565c76){const _0x5c939d=document['createElement']('div');return _0x5c939d['textContent']=_0x565c76,_0x5c939d['innerHTML'];}['resolveAttachmentUrls'](_0x1225b1){if(!_0x1225b1||!this['options']['taskId'])return _0x1225b1;const _0x135b9e=this['options']['getAPI'](),_0x22c994=_0x135b9e['getBaseUrl']();let _0x28d947=String(_0x1225b1)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x13d470,_0x5e56f5)=>{const _0x45e0d3=String(_0x5e56f5||'')['trim']();if(!_0x45e0d3)return _0x13d470;let _0x5c791e=_0x45e0d3;try{_0x5c791e=decodeURIComponent(_0x45e0d3);}catch{}return']('+_0x22c994+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x5c791e)+')';});return _0x28d947;}['renderMentions'](_0x1e61ce){if(!_0x1e61ce)return _0x1e61ce;return String(_0x1e61ce)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x2b570a,_0x42a538,_0x34e503)=>{const _0x47d7fa=this['escapeHtml'](_0x34e503),_0x4751f1=this['escapeHtml'](_0x42a538);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x4751f1+'\x22>@'+_0x47d7fa+'</span>';});}['startEdit'](_0x53aa28){this['editingCommentId']=_0x53aa28['id'],this['editor']['setValue'](_0x53aa28['content']),this['editor']['focus'](),this['cancelBtn']['hidden']=![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Save',this['editor']['toolbar']&&this['editor']['toolbar']['classList']['remove']('comments-toolbar-hidden'),this['inputSection']['scrollIntoView']({'behavior':'smooth','block':'nearest'});}['cancelEdit'](){this['editingCommentId']=null,this['editor']['clear'](),this['cancelBtn']['hidden']=!![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Add\x20Comment',this['submitBtn']['disabled']=!![],this['editor']['toolbar']&&!this['editor']['getValue']()?.['trim']()&&this['editor']['toolbar']['classList']['add']('comments-toolbar-hidden');}async['handleSubmit'](){const _0x2f6bc1=this['editor']['getValue']()?.['trim']();if(!_0x2f6bc1&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x4b67b5=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x4b67b5['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x5085da=>({'name':_0x5085da['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x4a00af=await _0x4b67b5['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x2f6bc1),_0x47f984=this['comments']['findIndex'](_0x18dce9=>_0x18dce9['id']===this['editingCommentId']);_0x47f984!==-0x1&&(this['comments'][_0x47f984]=_0x4a00af['comment']);}else{const _0x568e5d=await _0x4b67b5['addComment'](this['options']['taskId'],_0x2f6bc1);this['comments']['push'](_0x568e5d['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x24da0c){console['error']('Failed\x20to\x20save\x20comment:',_0x24da0c),alert('Failed\x20to\x20save\x20comment:\x20'+_0x24da0c['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x4fab08){const _0x249763=await this['showDeleteConfirmModal']();if(!_0x249763)return;try{const _0x5bc429=this['options']['getAPI']();await _0x5bc429['deleteComment'](this['options']['taskId'],_0x4fab08),this['comments']=this['comments']['filter'](_0x2ad37c=>_0x2ad37c['id']!==_0x4fab08),this['renderComments'](),this['updateCount']();}catch(_0x5c6aa8){console['error']('Failed\x20to\x20delete\x20comment:',_0x5c6aa8),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x5c6aa8['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x54c37a=>{const _0x378459=document['createElement']('div');_0x378459['className']='comments-confirm-modal',_0x378459['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-backdrop\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-dialog\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3>Delete\x20Comment</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon\x20comments-confirm-close\x22\x20title=\x22Close\x22>×</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20this\x20comment?\x20This\x20action\x20cannot\x20be\x20undone.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-confirm-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-danger\x20btn-small\x20comments-confirm-delete\x22>Delete</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20',document['body']['appendChild'](_0x378459);const _0x525354=_0x50ccd5=>{document['removeEventListener']('keydown',_0x4752ab),_0x378459['remove'](),_0x54c37a(_0x50ccd5);},_0x4752ab=_0x3f6cfc=>{if(_0x3f6cfc['key']==='Escape')_0x525354(![]);};document['addEventListener']('keydown',_0x4752ab),_0x378459['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x525354(![])),_0x378459['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x525354(![])),_0x378459['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x525354(![])),_0x378459['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x525354(!![])),_0x378459['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x5d6938){this['submitBtn']['disabled']=_0x5d6938,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x5d6938,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x5d6938;}['updateCount'](){const _0x50872f=this['comments']['length'],_0x6f1a82=this['container']['querySelector']('#comments-count-badge');_0x6f1a82&&(_0x6f1a82['textContent']=_0x50872f,_0x6f1a82['hidden']=_0x50872f===0x0);const _0x285fd7=this['container']['querySelector']('#comments-count');_0x285fd7&&(_0x285fd7['textContent']=_0x50872f>0x0?'('+_0x50872f+')':''),this['options']['onCommentsChanged']&&this['options']['onCommentsChanged'](this['comments']);}['getCommentCount'](){return this['comments']['length'];}['destroy'](){this['editor']&&this['editor']['destroy'](),this['container']['innerHTML']='';}}CommentsWidget['prototype']['_attachToContainer']=function(){this['container']['__widget']=this;};typeof window!=='undefined'&&(window['CommentsWidget']=CommentsWidget);
|
|
1
|
+
export class CommentsWidget{constructor(_0x3dfb80,_0x541d47={}){this['container']=_0x3dfb80,this['options']={'taskId':_0x541d47['taskId']||null,'currentUserId':_0x541d47['currentUserId']||null,'compact':_0x541d47['compact']||![],'skipHeader':_0x541d47['skipHeader']||![],'onCommentsLoaded':_0x541d47['onCommentsLoaded']||null,'onCommentsChanged':_0x541d47['onCommentsChanged']||null,'enableAttachments':_0x541d47['enableAttachments']||![],'getAPI':_0x541d47['getAPI']||(()=>window['API'])},this['comments']=[],this['editor']=null,this['editingCommentId']=null,this['isLoading']=![],this['pendingAttachments']=[],this['existingAttachments']=[],this['init']();}['init'](){this['container']['innerHTML']='',this['container']['className']='comments-widget\x20'+(this['options']['compact']?'comments-widget-compact':''),this['createHeader'](),this['createCommentsList'](),this['createInputSection'](),this['options']['taskId']&&(this['loadComments'](),this['options']['enableAttachments']&&this['loadExistingAttachments']());}async['loadExistingAttachments'](){try{const _0x462955=this['options']['getAPI'](),_0x1abc6b=await _0x462955['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x1abc6b['attachments']||[];}catch(_0x3ee46e){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x3ee46e),this['existingAttachments']=[];}}['createHeader'](){if(this['options']['skipHeader']){this['header']=null,this['isExpanded']=!![];return;}if(this['options']['compact']){this['header']=document['createElement']('div'),this['header']['className']='comments-header\x20comments-header-compact',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22comments-toggle-btn\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-toggle-icon\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-label\x22>Comments</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-badge\x22\x20id=\x22comments-count-badge\x22>0</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-chevron\x22\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x226\x209\x2012\x2015\x2018\x209\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']);const _0x1d7ed7=this['header']['querySelector']('.comments-toggle-btn');_0x1d7ed7['addEventListener']('click',()=>this['toggleExpanded']()),this['isExpanded']=![];}else this['header']=document['createElement']('div'),this['header']['className']='comments-header',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20class=\x22comments-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2218\x22\x20height=\x2218\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M21\x2015a2\x202\x200\x200\x201-2\x202H7l-4\x204V5a2\x202\x200\x200\x201\x202-2h14a2\x202\x200\x200\x201\x202\x202z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Comments\x20<span\x20class=\x22comments-count\x22\x20id=\x22comments-count\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</h3>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']),this['isExpanded']=!![];}['createCommentsList'](){this['commentsListWrapper']=document['createElement']('div'),this['commentsListWrapper']['className']='comments-list-wrapper',this['options']['compact']&&!this['isExpanded']&&(this['commentsListWrapper']['hidden']=!![]),this['commentsList']=document['createElement']('div'),this['commentsList']['className']='comments-list',this['commentsListWrapper']['appendChild'](this['commentsList']),this['container']['appendChild'](this['commentsListWrapper']);}['createInputSection'](){this['inputSection']=document['createElement']('div'),this['inputSection']['className']='comments-input-section';this['options']['compact']&&!this['isExpanded']&&(this['inputSection']['hidden']=!![]);const _0x44cff0=document['createElement']('div');_0x44cff0['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x44cff0['appendChild'](this['toolbar']);const _0x327040=document['createElement']('div');_0x327040['className']='comments-editor-placeholder',_0x44cff0['appendChild'](_0x327040);const _0x38cb82=document['createElement']('div');_0x38cb82['className']='comments-input-actions',_0x38cb82['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-cancel-btn\x22\x20hidden>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-primary\x20btn-small\x20comments-submit-btn\x22\x20disabled>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-text\x22>Add\x20Comment</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-loading\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22spinner\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x2210\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x223\x22\x20stroke-dasharray=\x2231.4\x2031.4\x22\x20stroke-linecap=\x22round\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20',this['inputSection']['appendChild'](_0x44cff0),this['inputSection']['appendChild'](_0x38cb82),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x327040),this['submitBtn']=_0x38cb82['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x38cb82['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x5c31be){const _0x18a2d3=document['createElement']('textarea');_0x18a2d3['placeholder']='Add\x20a\x20comment...',_0x18a2d3['className']='comments-textarea',_0x5c31be['appendChild'](_0x18a2d3);const _0x3f5127=window['MarkdownEditor'];if(!_0x3f5127){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x19d20b={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x2601c8=>{const _0x19c572=_0x2601c8&&_0x2601c8['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x19c572;},'fetchUsers':async()=>{const _0x1857e8=this['options']['getAPI']();return _0x1857e8['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x19d20b['onAddAttachments']=_0x18b9c3=>{this['pendingAttachments']['push'](..._0x18b9c3),this['submitBtn']['disabled']=![];},_0x19d20b['resolveAttachmentUrl']=_0x2c5a35=>{const _0x507128=this['options']['getAPI']();return _0x507128['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x2c5a35);},_0x19d20b['isAttachmentNameTaken']=_0x5871bf=>{return this['pendingAttachments']['some'](_0x2b0348=>_0x2b0348['name']===_0x5871bf)||this['existingAttachments']['some'](_0x2d0c24=>_0x2d0c24['name']===_0x5871bf);});this['editor']=new _0x3f5127(_0x18a2d3,_0x19d20b);const _0x2fe461=this['editor']['editor'],_0x4ab159=this['editor']['toolbar'];_0x4ab159&&(_0x4ab159['classList']['add']('comments-toolbar-hidden'),_0x2fe461['addEventListener']('focus',()=>{_0x4ab159['classList']['remove']('comments-toolbar-hidden');}),_0x2fe461['addEventListener']('blur',_0x4a5499=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x4ab159['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x4ab159['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x45b6c7=this['header']['querySelector']('.comments-chevron');_0x45b6c7&&(_0x45b6c7['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x2534dc){this['options']['taskId']=_0x2534dc,this['comments']=[],this['renderComments'](),_0x2534dc&&this['loadComments']();}async['loadComments'](){if(!this['options']['taskId']||this['isLoading'])return;this['isLoading']=!![],this['commentsList']['innerHTML']='<div\x20class=\x22comments-loading\x22>Loading\x20comments...</div>';try{const _0x58f8e2=this['options']['getAPI'](),_0x221953=await _0x58f8e2['getComments'](this['options']['taskId']);this['comments']=_0x221953['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x21ec8e){console['error']('Failed\x20to\x20load\x20comments:',_0x21ec8e),this['commentsList']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-error\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Failed\x20to\x20load\x20comments\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x22\x20onclick=\x22this.parentElement.parentElement.closest(\x27.comments-widget\x27).__widget.loadComments()\x22>Retry</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20';}finally{this['isLoading']=![];}}['renderComments'](){if(this['comments']['length']===0x0){this['commentsList']['innerHTML']='<div\x20class=\x22comments-empty\x22>No\x20comments\x20yet</div>';return;}this['commentsList']['innerHTML']='',this['comments']['forEach'](_0x3f5224=>{const _0x5613b9=this['createCommentElement'](_0x3f5224);this['commentsList']['appendChild'](_0x5613b9);});}['createCommentElement'](_0x82fc3b){const _0x13dca9=document['createElement']('div');_0x13dca9['className']='comment-item',_0x13dca9['dataset']['commentId']=_0x82fc3b['id'];const _0x4cb43a=this['options']['currentUserId']&&_0x82fc3b['author']?.['userId']===this['options']['currentUserId'],_0x436df0=this['formatDate'](_0x82fc3b['createdAt']),_0x271197=_0x82fc3b['updatedAt']!==_0x82fc3b['createdAt'],_0x720e59=this['resolveAttachmentUrls'](_0x82fc3b['content']);let _0x18ca96=window['marked']?window['marked']['parse'](_0x720e59):_0x720e59;_0x18ca96=this['renderMentions'](_0x18ca96),_0x13dca9['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-author\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-author-name\x22>'+this['escapeHtml'](_0x82fc3b['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x82fc3b['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x436df0+(_0x271197?'\x20(edited)':'')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x4cb43a?'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-actions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-edit-btn\x22\x20title=\x22Edit\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M11\x204H4a2\x202\x200\x200\x200-2\x202v14a2\x202\x200\x200\x200\x202\x202h14a2\x202\x200\x200\x200\x202-2v-7\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M18.5\x202.5a2.121\x202.121\x200\x200\x201\x203\x203L12\x2015l-4\x201\x201-4\x209.5-9.5z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-delete-btn\x22\x20title=\x22Delete\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x223\x206\x205\x206\x2021\x206\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M19\x206v14a2\x202\x200\x200\x201-2\x202H7a2\x202\x200\x200\x201-2-2V6m3\x200V4a2\x202\x200\x200\x201\x202-2h4a2\x202\x200\x200\x201\x202\x202v2\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20':'')+'\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-content\x22>'+_0x18ca96+'</div>\x0a\x20\x20\x20\x20';if(_0x4cb43a){const _0x1794c7=_0x13dca9['querySelector']('.comment-edit-btn'),_0x3fcbb3=_0x13dca9['querySelector']('.comment-delete-btn');_0x1794c7?.['addEventListener']('click',()=>this['startEdit'](_0x82fc3b)),_0x3fcbb3?.['addEventListener']('click',()=>this['deleteComment'](_0x82fc3b['id']));}return _0x13dca9;}['formatDate'](_0x36f617){const _0x986c11=new Date(_0x36f617),_0x270ebf=new Date(),_0x4db0fd=_0x270ebf-_0x986c11,_0x468d09=Math['floor'](_0x4db0fd/0xea60),_0x36ba90=Math['floor'](_0x4db0fd/0x36ee80),_0x2ae3e5=Math['floor'](_0x4db0fd/0x5265c00);if(_0x468d09<0x1)return'just\x20now';if(_0x468d09<0x3c)return _0x468d09+'m\x20ago';if(_0x36ba90<0x18)return _0x36ba90+'h\x20ago';if(_0x2ae3e5<0x7)return _0x2ae3e5+'d\x20ago';return _0x986c11['toLocaleDateString']();}['escapeHtml'](_0x4458de){const _0x527d6e=document['createElement']('div');return _0x527d6e['textContent']=_0x4458de,_0x527d6e['innerHTML'];}['resolveAttachmentUrls'](_0x3438e0){if(!_0x3438e0||!this['options']['taskId'])return _0x3438e0;const _0x250084=this['options']['getAPI'](),_0x103e83=_0x250084['getBaseUrl']();let _0xcb01a4=String(_0x3438e0)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x35dc03,_0x317298)=>{const _0x550d0d=String(_0x317298||'')['trim']();if(!_0x550d0d)return _0x35dc03;let _0x5438b6=_0x550d0d;try{_0x5438b6=decodeURIComponent(_0x550d0d);}catch{}return']('+_0x103e83+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x5438b6)+')';});return _0xcb01a4;}['renderMentions'](_0x2b713a){if(!_0x2b713a)return _0x2b713a;return String(_0x2b713a)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x46ee53,_0x389959,_0x4d13af)=>{const _0x4e0ec1=this['escapeHtml'](_0x4d13af),_0x2327ce=this['escapeHtml'](_0x389959);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x2327ce+'\x22>@'+_0x4e0ec1+'</span>';});}['startEdit'](_0x55c174){this['editingCommentId']=_0x55c174['id'],this['editor']['setValue'](_0x55c174['content']),this['editor']['focus'](),this['cancelBtn']['hidden']=![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Save',this['editor']['toolbar']&&this['editor']['toolbar']['classList']['remove']('comments-toolbar-hidden'),this['inputSection']['scrollIntoView']({'behavior':'smooth','block':'nearest'});}['cancelEdit'](){this['editingCommentId']=null,this['editor']['clear'](),this['cancelBtn']['hidden']=!![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Add\x20Comment',this['submitBtn']['disabled']=!![],this['editor']['toolbar']&&!this['editor']['getValue']()?.['trim']()&&this['editor']['toolbar']['classList']['add']('comments-toolbar-hidden');}async['handleSubmit'](){const _0x5a2b65=this['editor']['getValue']()?.['trim']();if(!_0x5a2b65&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x34225f=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x34225f['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x1f8971=>({'name':_0x1f8971['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x1380d7=await _0x34225f['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x5a2b65),_0x492449=this['comments']['findIndex'](_0x10f05d=>_0x10f05d['id']===this['editingCommentId']);_0x492449!==-0x1&&(this['comments'][_0x492449]=_0x1380d7['comment']);}else{const _0x274471=await _0x34225f['addComment'](this['options']['taskId'],_0x5a2b65);this['comments']['push'](_0x274471['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x4ec505){console['error']('Failed\x20to\x20save\x20comment:',_0x4ec505),alert('Failed\x20to\x20save\x20comment:\x20'+_0x4ec505['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x2cb8a1){const _0x95a868=await this['showDeleteConfirmModal']();if(!_0x95a868)return;try{const _0x4cc824=this['options']['getAPI']();await _0x4cc824['deleteComment'](this['options']['taskId'],_0x2cb8a1),this['comments']=this['comments']['filter'](_0x46eb00=>_0x46eb00['id']!==_0x2cb8a1),this['renderComments'](),this['updateCount']();}catch(_0x7190bc){console['error']('Failed\x20to\x20delete\x20comment:',_0x7190bc),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x7190bc['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x18ebf6=>{const _0xa660af=document['createElement']('div');_0xa660af['className']='comments-confirm-modal',_0xa660af['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-backdrop\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-dialog\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3>Delete\x20Comment</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon\x20comments-confirm-close\x22\x20title=\x22Close\x22>×</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20this\x20comment?\x20This\x20action\x20cannot\x20be\x20undone.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-confirm-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-danger\x20btn-small\x20comments-confirm-delete\x22>Delete</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20',document['body']['appendChild'](_0xa660af);const _0x1ef1a3=_0x4c6be3=>{document['removeEventListener']('keydown',_0x1e90a0),_0xa660af['remove'](),_0x18ebf6(_0x4c6be3);},_0x1e90a0=_0x4b22c6=>{if(_0x4b22c6['key']==='Escape')_0x1ef1a3(![]);};document['addEventListener']('keydown',_0x1e90a0),_0xa660af['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x1ef1a3(![])),_0xa660af['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x1ef1a3(![])),_0xa660af['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x1ef1a3(![])),_0xa660af['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x1ef1a3(!![])),_0xa660af['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x1f09bf){this['submitBtn']['disabled']=_0x1f09bf,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x1f09bf,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x1f09bf;}['updateCount'](){const _0x1d6d6a=this['comments']['length'],_0x1cf4ca=this['container']['querySelector']('#comments-count-badge');_0x1cf4ca&&(_0x1cf4ca['textContent']=_0x1d6d6a,_0x1cf4ca['hidden']=_0x1d6d6a===0x0);const _0x3997a6=this['container']['querySelector']('#comments-count');_0x3997a6&&(_0x3997a6['textContent']=_0x1d6d6a>0x0?'('+_0x1d6d6a+')':''),this['options']['onCommentsChanged']&&this['options']['onCommentsChanged'](this['comments']);}['getCommentCount'](){return this['comments']['length'];}['destroy'](){this['editor']&&this['editor']['destroy'](),this['container']['innerHTML']='';}}CommentsWidget['prototype']['_attachToContainer']=function(){this['container']['__widget']=this;};typeof window!=='undefined'&&(window['CommentsWidget']=CommentsWidget);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Utils}from'./app.js';export function parsePatchContent(_0x331731){const _0x21967f=[],_0x3e6b9f=_0x331731['split']('\x0a');let _0x197710=null,_0xb9b032=null;for(const _0x6d61d2 of _0x3e6b9f){if(_0x6d61d2['startsWith']('diff\x20--git')){_0x197710&&_0xb9b032&&_0x197710['hunks']['push'](_0xb9b032);_0x197710&&_0x21967f['push'](_0x197710);const _0xdc2bb4=_0x6d61d2['match'](/diff --git a\/(.+?) b\/(.+)/);_0x197710={'oldPath':_0xdc2bb4?_0xdc2bb4[0x1]:'','newPath':_0xdc2bb4?_0xdc2bb4[0x2]:'','hunks':[],'isDeleted':![]},_0xb9b032=null;}else{if(_0x6d61d2['startsWith']('deleted\x20file\x20mode')&&_0x197710)_0x197710['isDeleted']=!![];else{if(_0x6d61d2['startsWith']('@@'))_0xb9b032&&_0x197710&&_0x197710['hunks']['push'](_0xb9b032),_0xb9b032={'header':_0x6d61d2,'lines':[]};else _0xb9b032&&_0xb9b032['lines']['push'](_0x6d61d2);}}}return _0x197710&&_0xb9b032&&_0x197710['hunks']['push'](_0xb9b032),_0x197710&&_0x21967f['push'](_0x197710),_0x21967f;}export function parseHunkHeader(_0x3ba3a4){const _0x58979e=_0x3ba3a4['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x58979e)return{'oldStart':parseInt(_0x58979e[0x1],0xa),'newStart':parseInt(_0x58979e[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x166e6c,_0x2817eb){const _0x2e4c23=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x2e4c23&&_0x2817eb)try{const _0x2936bb=_0x2e4c23['getLanguage'](_0x2817eb)?_0x2817eb:null;if(_0x2936bb)return _0x2e4c23['highlight'](_0x166e6c,{'language':_0x2936bb})['value'];}catch(_0x40fce0){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x40fce0);}return Utils['escapeHtml'](_0x166e6c);}export function getFileLanguage(_0x462ecc){const _0xb83217=_0x462ecc['split']('.')['pop']()['toLowerCase'](),_0x423104={'js':'javascript','jsx':'javascript','ts':'typescript','tsx':'typescript','py':'python','java':'java','c':'c','cpp':'cpp','cs':'csharp','go':'go','rs':'rust','php':'php','rb':'ruby','html':'xml','css':'css','json':'json','yml':'yaml','yaml':'yaml','md':'markdown','sh':'bash','bash':'bash'};return _0x423104[_0xb83217]||null;}export function computeWordDiff(_0x223801,_0x13877b){const _0x513180=_0x10e7d8=>{const _0x3e3597=[];let _0x60776f='',_0x3eb754=![];for(let _0x5596f3=0x0;_0x5596f3<_0x10e7d8['length'];_0x5596f3++){const _0x304e82=_0x10e7d8[_0x5596f3],_0x420697=/\s/['test'](_0x304e82);if(_0x60776f==='')_0x60776f=_0x304e82,_0x3eb754=_0x420697;else _0x420697===_0x3eb754?_0x60776f+=_0x304e82:(_0x3e3597['push'](_0x60776f),_0x60776f=_0x304e82,_0x3eb754=_0x420697);}return _0x60776f&&_0x3e3597['push'](_0x60776f),_0x3e3597;},_0x1a4990=_0x513180(_0x223801),_0x52845c=_0x513180(_0x13877b),_0x28a2cd=_0x1a4990['length'],_0x3c1a5f=_0x52845c['length'],_0x523c43=Array(_0x28a2cd+0x1)['fill'](null)['map'](()=>Array(_0x3c1a5f+0x1)['fill'](0x0));for(let _0x394ff9=0x1;_0x394ff9<=_0x28a2cd;_0x394ff9++){for(let _0x2b063b=0x1;_0x2b063b<=_0x3c1a5f;_0x2b063b++){_0x1a4990[_0x394ff9-0x1]===_0x52845c[_0x2b063b-0x1]?_0x523c43[_0x394ff9][_0x2b063b]=_0x523c43[_0x394ff9-0x1][_0x2b063b-0x1]+0x1:_0x523c43[_0x394ff9][_0x2b063b]=Math['max'](_0x523c43[_0x394ff9-0x1][_0x2b063b],_0x523c43[_0x394ff9][_0x2b063b-0x1]);}}const _0x56fcef={'old':[],'new':[]};let _0x568d4b=_0x28a2cd,_0x35f8f8=_0x3c1a5f;const _0x32131b=[],_0x230eb0=[];while(_0x568d4b>0x0||_0x35f8f8>0x0){if(_0x568d4b>0x0&&_0x35f8f8>0x0&&_0x1a4990[_0x568d4b-0x1]===_0x52845c[_0x35f8f8-0x1])_0x32131b['unshift']({'type':'equal','text':_0x1a4990[_0x568d4b-0x1]}),_0x230eb0['unshift']({'type':'equal','text':_0x52845c[_0x35f8f8-0x1]}),_0x568d4b--,_0x35f8f8--;else{if(_0x35f8f8>0x0&&(_0x568d4b===0x0||_0x523c43[_0x568d4b][_0x35f8f8-0x1]>=_0x523c43[_0x568d4b-0x1][_0x35f8f8]))_0x230eb0['unshift']({'type':'insert','text':_0x52845c[_0x35f8f8-0x1]}),_0x35f8f8--;else _0x568d4b>0x0&&(_0x32131b['unshift']({'type':'delete','text':_0x1a4990[_0x568d4b-0x1]}),_0x568d4b--);}}return _0x56fcef['old']=_0x32131b,_0x56fcef['new']=_0x230eb0,_0x56fcef;}export function renderDiffLineWithWordHighlight(_0x50af74,_0xc40dca,_0x4bd6ee,_0x57256f){if(!_0xc40dca||_0xc40dca['length']===0x0)return highlightDiffLine(_0x50af74,_0x57256f);let _0x301dca='';const _0x663920=_0x4bd6ee==='add'?'diff-word-add':'diff-word-remove',_0x36de68=_0x4bd6ee==='add'?'insert':'delete';for(const _0xf57e2e of _0xc40dca){const _0x4e8a42=Utils['escapeHtml'](_0xf57e2e['text']);_0xf57e2e['type']===_0x36de68?_0x301dca+='<span\x20class=\x22'+_0x663920+'\x22>'+_0x4e8a42+'</span>':_0x301dca+=_0x4e8a42;}return _0x301dca;}export function calculateDiffStats(_0x6665c5){let _0x441d6b=0x0,_0x1baf03=0x0,_0x2fea2e=0x0;return _0x6665c5['forEach'](_0x232ee4=>{let _0x5502d7=0x0,_0x2304cd=0x0;_0x232ee4['hunks']['forEach'](_0x1bd205=>{_0x1bd205['lines']['forEach'](_0x2f74df=>{if(_0x2f74df['startsWith']('+'))_0x5502d7+=0x1;else{if(_0x2f74df['startsWith']('-'))_0x2304cd+=0x1;}});}),(_0x5502d7+_0x2304cd>0x0||_0x232ee4['isDeleted'])&&(_0x2fea2e+=0x1),_0x441d6b+=_0x5502d7,_0x1baf03+=_0x2304cd;}),{'additions':_0x441d6b,'deletions':_0x1baf03,'files':_0x2fea2e};}export function getFileStatus(_0x5d019d,_0x3b5a1f,_0x1a61e8){if(_0x5d019d['isDeleted'])return'deleted';if(_0x3b5a1f>0x0&&_0x1a61e8===0x0)return'added';return'modified';}export function safeBase64(_0xecff43){try{return btoa(unescape(encodeURIComponent(_0xecff43)));}catch(_0x53f4a8){return btoa(_0xecff43);}}export function getStorageKey(_0x5ee82a,_0x23baf6){return _0x5ee82a+'-'+safeBase64(_0x23baf6);}export function getCollapsedState(_0x14287b,_0x3dff8d){const _0x54ed0c=localStorage['getItem'](getStorageKey(_0x14287b,_0x3dff8d));return _0x54ed0c==='true';}export function renderUnifiedDiff(_0x57ba9a,_0x4ddb17){return _0x57ba9a['map']((_0x241cd0,_0x550be2)=>{const _0x1da72f=_0x241cd0['newPath']||_0x241cd0['oldPath']||'unknown',_0x4ed433='diff-'+_0x4ddb17+'-'+_0x550be2,_0x258d6f=getFileLanguage(_0x1da72f),{additions:_0x2a6acb,deletions:_0x4df204}=calculateDiffStats([_0x241cd0]),_0x43eb33=getCollapsedState(_0x4ddb17,_0x1da72f),_0x5ba65d=getFileStatus(_0x241cd0,_0x2a6acb,_0x4df204),_0x2a2d76=_0x5ba65d==='added'?'A':_0x5ba65d==='deleted'?'D':'M',_0x2c32b6=_0x241cd0['hunks']['map'](_0x3adea1=>{const {oldStart:_0x3db60e,newStart:_0x30e2da}=parseHunkHeader(_0x3adea1['header']);let _0x37187f=_0x3db60e,_0x5961f6=_0x30e2da;const _0x5609ef=_0x3adea1['lines']['map'](_0x23bd2a=>({'line':_0x23bd2a,'type':_0x23bd2a['startsWith']('+')?'add':_0x23bd2a['startsWith']('-')?'remove':_0x23bd2a['startsWith']('\x5c')?'meta':'context'}));let _0x3eae38=0x0;while(_0x3eae38<_0x5609ef['length']){if(_0x5609ef[_0x3eae38]['type']==='remove'){let _0x4e173d=_0x3eae38,_0x48d1d9=_0x3eae38;while(_0x48d1d9<_0x5609ef['length']&&_0x5609ef[_0x48d1d9]['type']==='remove')_0x48d1d9++;let _0x3f212d=_0x48d1d9,_0x17eeca=_0x3f212d;while(_0x17eeca<_0x5609ef['length']&&_0x5609ef[_0x17eeca]['type']==='add')_0x17eeca++;const _0x166a94=_0x48d1d9-_0x4e173d,_0x5afc08=_0x17eeca-_0x3f212d,_0x1ff45c=Math['min'](_0x166a94,_0x5afc08);for(let _0x2388ff=0x0;_0x2388ff<_0x1ff45c;_0x2388ff++){const _0x3ae84c=_0x5609ef[_0x4e173d+_0x2388ff]['line']['substring'](0x1),_0x1d8631=_0x5609ef[_0x3f212d+_0x2388ff]['line']['substring'](0x1),_0x36c5dc=computeWordDiff(_0x3ae84c,_0x1d8631);_0x5609ef[_0x4e173d+_0x2388ff]['wordDiff']=_0x36c5dc['old'],_0x5609ef[_0x3f212d+_0x2388ff]['wordDiff']=_0x36c5dc['new'];}_0x3eae38=_0x17eeca;}else _0x3eae38++;}const _0x237b52=_0x5609ef['map'](_0x5b3099=>{const _0x4c7c5a=_0x5b3099['line'];if(_0x4c7c5a['startsWith']('+')){const _0x466ef7=_0x4c7c5a['substring'](0x1),_0x438042=_0x5b3099['wordDiff']?renderDiffLineWithWordHighlight(_0x466ef7,_0x5b3099['wordDiff'],'add',_0x258d6f):highlightDiffLine(_0x466ef7,_0x258d6f),_0xaf45b9='<div\x20class=\x22diff-line\x20diff-add\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x5961f6+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x438042+'</span></div>';return _0x5961f6+=0x1,_0xaf45b9;}if(_0x4c7c5a['startsWith']('-')){const _0x48909b=_0x4c7c5a['substring'](0x1),_0x617f35=_0x5b3099['wordDiff']?renderDiffLineWithWordHighlight(_0x48909b,_0x5b3099['wordDiff'],'remove',_0x258d6f):highlightDiffLine(_0x48909b,_0x258d6f),_0x27f5fc='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x37187f+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x617f35+'</span></div>';return _0x37187f+=0x1,_0x27f5fc;}if(_0x4c7c5a['startsWith']('\x5c'))return'<div\x20class=\x22diff-line\x20diff-meta\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22>'+Utils['escapeHtml'](_0x4c7c5a)+'</span></div>';const _0x5a2520=_0x4c7c5a['startsWith']('\x20')?_0x4c7c5a['substring'](0x1):_0x4c7c5a,_0x1fad85=highlightDiffLine(_0x5a2520,_0x258d6f),_0x4e121d='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x37187f+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x5961f6+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x1fad85+'</span></div>';return _0x37187f+=0x1,_0x5961f6+=0x1,_0x4e121d;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x3adea1['header'])+'</div>'+_0x237b52+'</div>';})['join'](''),_0x1152e4=_0x2c32b6||'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>No\x20textual\x20diff\x20available</div></div>';return'\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff\x22\x20id=\x22file-'+_0x4ed433+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x4ed433+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x1da72f)+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-status-badge\x20'+_0x5ba65d+'\x22>'+_0x2a2d76+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x1da72f)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-stat\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-add\x22>+'+_0x2a6acb+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x4df204+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22file-diff-toggle-btn\x22\x20data-diff-id=\x22'+_0x4ed433+'\x22\x20data-collapsed=\x22'+_0x43eb33+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x43eb33?'Expand':'Collapse')+'\x22></button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-content\x20'+(_0x43eb33?'collapsed':'')+'\x22\x20id=\x22'+_0x4ed433+'\x22>'+_0x1152e4+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
1
|
+
import{Utils}from'./app.js';export function parsePatchContent(_0x46cd9a){const _0xecdf89=[],_0x206f56=_0x46cd9a['split']('\x0a');let _0x571270=null,_0x50aae3=null;for(const _0x5862ba of _0x206f56){if(_0x5862ba['startsWith']('diff\x20--git')){_0x571270&&_0x50aae3&&_0x571270['hunks']['push'](_0x50aae3);_0x571270&&_0xecdf89['push'](_0x571270);const _0x47ab07=_0x5862ba['match'](/diff --git a\/(.+?) b\/(.+)/);_0x571270={'oldPath':_0x47ab07?_0x47ab07[0x1]:'','newPath':_0x47ab07?_0x47ab07[0x2]:'','hunks':[],'isDeleted':![]},_0x50aae3=null;}else{if(_0x5862ba['startsWith']('deleted\x20file\x20mode')&&_0x571270)_0x571270['isDeleted']=!![];else{if(_0x5862ba['startsWith']('@@'))_0x50aae3&&_0x571270&&_0x571270['hunks']['push'](_0x50aae3),_0x50aae3={'header':_0x5862ba,'lines':[]};else _0x50aae3&&_0x50aae3['lines']['push'](_0x5862ba);}}}return _0x571270&&_0x50aae3&&_0x571270['hunks']['push'](_0x50aae3),_0x571270&&_0xecdf89['push'](_0x571270),_0xecdf89;}export function parseHunkHeader(_0x3f8656){const _0x25d46a=_0x3f8656['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x25d46a)return{'oldStart':parseInt(_0x25d46a[0x1],0xa),'newStart':parseInt(_0x25d46a[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x362099,_0x416b43){const _0x5392cb=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x5392cb&&_0x416b43)try{const _0x3bf71f=_0x5392cb['getLanguage'](_0x416b43)?_0x416b43:null;if(_0x3bf71f)return _0x5392cb['highlight'](_0x362099,{'language':_0x3bf71f})['value'];}catch(_0x2d5e83){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x2d5e83);}return Utils['escapeHtml'](_0x362099);}export function getFileLanguage(_0x2b99be){const _0x34f4eb=_0x2b99be['split']('.')['pop']()['toLowerCase'](),_0x4aa45d={'js':'javascript','jsx':'javascript','ts':'typescript','tsx':'typescript','py':'python','java':'java','c':'c','cpp':'cpp','cs':'csharp','go':'go','rs':'rust','php':'php','rb':'ruby','html':'xml','css':'css','json':'json','yml':'yaml','yaml':'yaml','md':'markdown','sh':'bash','bash':'bash'};return _0x4aa45d[_0x34f4eb]||null;}export function computeWordDiff(_0x40008a,_0x1b3542){const _0x23929d=_0x3965e7=>{const _0x4497d2=[];let _0x4584bf='',_0x9fc635=![];for(let _0x136797=0x0;_0x136797<_0x3965e7['length'];_0x136797++){const _0xd73d07=_0x3965e7[_0x136797],_0x3849f5=/\s/['test'](_0xd73d07);if(_0x4584bf==='')_0x4584bf=_0xd73d07,_0x9fc635=_0x3849f5;else _0x3849f5===_0x9fc635?_0x4584bf+=_0xd73d07:(_0x4497d2['push'](_0x4584bf),_0x4584bf=_0xd73d07,_0x9fc635=_0x3849f5);}return _0x4584bf&&_0x4497d2['push'](_0x4584bf),_0x4497d2;},_0x3ef065=_0x23929d(_0x40008a),_0x26cf64=_0x23929d(_0x1b3542),_0x3c1aef=_0x3ef065['length'],_0x1dac61=_0x26cf64['length'],_0x16d64e=Array(_0x3c1aef+0x1)['fill'](null)['map'](()=>Array(_0x1dac61+0x1)['fill'](0x0));for(let _0x390036=0x1;_0x390036<=_0x3c1aef;_0x390036++){for(let _0x42ac38=0x1;_0x42ac38<=_0x1dac61;_0x42ac38++){_0x3ef065[_0x390036-0x1]===_0x26cf64[_0x42ac38-0x1]?_0x16d64e[_0x390036][_0x42ac38]=_0x16d64e[_0x390036-0x1][_0x42ac38-0x1]+0x1:_0x16d64e[_0x390036][_0x42ac38]=Math['max'](_0x16d64e[_0x390036-0x1][_0x42ac38],_0x16d64e[_0x390036][_0x42ac38-0x1]);}}const _0x3108c4={'old':[],'new':[]};let _0xd76ed2=_0x3c1aef,_0x48d8c8=_0x1dac61;const _0x272053=[],_0x577a93=[];while(_0xd76ed2>0x0||_0x48d8c8>0x0){if(_0xd76ed2>0x0&&_0x48d8c8>0x0&&_0x3ef065[_0xd76ed2-0x1]===_0x26cf64[_0x48d8c8-0x1])_0x272053['unshift']({'type':'equal','text':_0x3ef065[_0xd76ed2-0x1]}),_0x577a93['unshift']({'type':'equal','text':_0x26cf64[_0x48d8c8-0x1]}),_0xd76ed2--,_0x48d8c8--;else{if(_0x48d8c8>0x0&&(_0xd76ed2===0x0||_0x16d64e[_0xd76ed2][_0x48d8c8-0x1]>=_0x16d64e[_0xd76ed2-0x1][_0x48d8c8]))_0x577a93['unshift']({'type':'insert','text':_0x26cf64[_0x48d8c8-0x1]}),_0x48d8c8--;else _0xd76ed2>0x0&&(_0x272053['unshift']({'type':'delete','text':_0x3ef065[_0xd76ed2-0x1]}),_0xd76ed2--);}}return _0x3108c4['old']=_0x272053,_0x3108c4['new']=_0x577a93,_0x3108c4;}export function renderDiffLineWithWordHighlight(_0x3e815a,_0x5794b1,_0x3c1e52,_0x40c494){if(!_0x5794b1||_0x5794b1['length']===0x0)return highlightDiffLine(_0x3e815a,_0x40c494);let _0x229e8e='';const _0x4f5bbd=_0x3c1e52==='add'?'diff-word-add':'diff-word-remove',_0x283a14=_0x3c1e52==='add'?'insert':'delete';for(const _0x59f573 of _0x5794b1){const _0x1208cf=Utils['escapeHtml'](_0x59f573['text']);_0x59f573['type']===_0x283a14?_0x229e8e+='<span\x20class=\x22'+_0x4f5bbd+'\x22>'+_0x1208cf+'</span>':_0x229e8e+=_0x1208cf;}return _0x229e8e;}export function calculateDiffStats(_0x3b8509){let _0x45948c=0x0,_0x221cf3=0x0,_0x75b1f9=0x0;return _0x3b8509['forEach'](_0x52333b=>{let _0x40614b=0x0,_0x5cfc68=0x0;_0x52333b['hunks']['forEach'](_0x2d43b6=>{_0x2d43b6['lines']['forEach'](_0x2aaa16=>{if(_0x2aaa16['startsWith']('+'))_0x40614b+=0x1;else{if(_0x2aaa16['startsWith']('-'))_0x5cfc68+=0x1;}});}),(_0x40614b+_0x5cfc68>0x0||_0x52333b['isDeleted'])&&(_0x75b1f9+=0x1),_0x45948c+=_0x40614b,_0x221cf3+=_0x5cfc68;}),{'additions':_0x45948c,'deletions':_0x221cf3,'files':_0x75b1f9};}export function getFileStatus(_0xd82fa6,_0x490cc6,_0x6ee01b){if(_0xd82fa6['isDeleted'])return'deleted';if(_0x490cc6>0x0&&_0x6ee01b===0x0)return'added';return'modified';}export function safeBase64(_0x2964eb){try{return btoa(unescape(encodeURIComponent(_0x2964eb)));}catch(_0x20208e){return btoa(_0x2964eb);}}export function getStorageKey(_0x27c652,_0x2ecfc8){return _0x27c652+'-'+safeBase64(_0x2ecfc8);}export function getCollapsedState(_0x5d7bb6,_0x12b777){const _0x32aeb4=localStorage['getItem'](getStorageKey(_0x5d7bb6,_0x12b777));return _0x32aeb4==='true';}export function renderUnifiedDiff(_0x5b1747,_0x326022){return _0x5b1747['map']((_0x48f2ba,_0x6fcd64)=>{const _0x4293f4=_0x48f2ba['newPath']||_0x48f2ba['oldPath']||'unknown',_0x247dae='diff-'+_0x326022+'-'+_0x6fcd64,_0x44dc1c=getFileLanguage(_0x4293f4),{additions:_0x4643b9,deletions:_0x3a99fc}=calculateDiffStats([_0x48f2ba]),_0x509543=getCollapsedState(_0x326022,_0x4293f4),_0x3e090d=getFileStatus(_0x48f2ba,_0x4643b9,_0x3a99fc),_0x5cbe0f=_0x3e090d==='added'?'A':_0x3e090d==='deleted'?'D':'M',_0x520b5d=_0x48f2ba['hunks']['map'](_0x16fa02=>{const {oldStart:_0x530066,newStart:_0x358846}=parseHunkHeader(_0x16fa02['header']);let _0x41c2ed=_0x530066,_0x47424a=_0x358846;const _0x1a2f99=_0x16fa02['lines']['map'](_0x47b133=>({'line':_0x47b133,'type':_0x47b133['startsWith']('+')?'add':_0x47b133['startsWith']('-')?'remove':_0x47b133['startsWith']('\x5c')?'meta':'context'}));let _0xa3bce6=0x0;while(_0xa3bce6<_0x1a2f99['length']){if(_0x1a2f99[_0xa3bce6]['type']==='remove'){let _0x21cf80=_0xa3bce6,_0x466754=_0xa3bce6;while(_0x466754<_0x1a2f99['length']&&_0x1a2f99[_0x466754]['type']==='remove')_0x466754++;let _0x220c7f=_0x466754,_0x42dce6=_0x220c7f;while(_0x42dce6<_0x1a2f99['length']&&_0x1a2f99[_0x42dce6]['type']==='add')_0x42dce6++;const _0x454c8a=_0x466754-_0x21cf80,_0x3c537b=_0x42dce6-_0x220c7f,_0x43535d=Math['min'](_0x454c8a,_0x3c537b);for(let _0x1dc752=0x0;_0x1dc752<_0x43535d;_0x1dc752++){const _0x1d05b4=_0x1a2f99[_0x21cf80+_0x1dc752]['line']['substring'](0x1),_0x3910ea=_0x1a2f99[_0x220c7f+_0x1dc752]['line']['substring'](0x1),_0x50a4e1=computeWordDiff(_0x1d05b4,_0x3910ea);_0x1a2f99[_0x21cf80+_0x1dc752]['wordDiff']=_0x50a4e1['old'],_0x1a2f99[_0x220c7f+_0x1dc752]['wordDiff']=_0x50a4e1['new'];}_0xa3bce6=_0x42dce6;}else _0xa3bce6++;}const _0x57c9e1=_0x1a2f99['map'](_0x4caa21=>{const _0x29a99b=_0x4caa21['line'];if(_0x29a99b['startsWith']('+')){const _0x243abb=_0x29a99b['substring'](0x1),_0x54fcf5=_0x4caa21['wordDiff']?renderDiffLineWithWordHighlight(_0x243abb,_0x4caa21['wordDiff'],'add',_0x44dc1c):highlightDiffLine(_0x243abb,_0x44dc1c),_0x5af6b3='<div\x20class=\x22diff-line\x20diff-add\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x47424a+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x54fcf5+'</span></div>';return _0x47424a+=0x1,_0x5af6b3;}if(_0x29a99b['startsWith']('-')){const _0x59d01d=_0x29a99b['substring'](0x1),_0x15d3da=_0x4caa21['wordDiff']?renderDiffLineWithWordHighlight(_0x59d01d,_0x4caa21['wordDiff'],'remove',_0x44dc1c):highlightDiffLine(_0x59d01d,_0x44dc1c),_0x4fa070='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x41c2ed+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x15d3da+'</span></div>';return _0x41c2ed+=0x1,_0x4fa070;}if(_0x29a99b['startsWith']('\x5c'))return'<div\x20class=\x22diff-line\x20diff-meta\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22>'+Utils['escapeHtml'](_0x29a99b)+'</span></div>';const _0x17ef81=_0x29a99b['startsWith']('\x20')?_0x29a99b['substring'](0x1):_0x29a99b,_0x5e8828=highlightDiffLine(_0x17ef81,_0x44dc1c),_0x511763='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x41c2ed+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x47424a+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x5e8828+'</span></div>';return _0x41c2ed+=0x1,_0x47424a+=0x1,_0x511763;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x16fa02['header'])+'</div>'+_0x57c9e1+'</div>';})['join'](''),_0x580fb8=_0x520b5d||'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>No\x20textual\x20diff\x20available</div></div>';return'\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff\x22\x20id=\x22file-'+_0x247dae+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x247dae+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x4293f4)+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-status-badge\x20'+_0x3e090d+'\x22>'+_0x5cbe0f+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x4293f4)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-stat\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-add\x22>+'+_0x4643b9+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x3a99fc+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22file-diff-toggle-btn\x22\x20data-diff-id=\x22'+_0x247dae+'\x22\x20data-collapsed=\x22'+_0x509543+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x509543?'Expand':'Collapse')+'\x22></button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-content\x20'+(_0x509543?'collapsed':'')+'\x22\x20id=\x22'+_0x247dae+'\x22>'+_0x580fb8+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
@@ -13,7 +13,7 @@ CoderFlow supports multiple accounts per provider, allowing teams to:
|
|
|
13
13
|
- Switch between accounts as needed
|
|
14
14
|
- Automatically refresh tokens to maintain continuous access
|
|
15
15
|
|
|
16
|
-
Provider authentication is configured globally and applies to all environments. The active account for each provider is used when launching tasks.
|
|
16
|
+
Provider authentication is configured globally and applies to all environments. The active account for each provider is used when launching tasks, and you can leave a provider with no active account selected.
|
|
17
17
|
|
|
18
18
|
## Connecting Accounts
|
|
19
19
|
|
|
@@ -47,9 +47,9 @@ If you don't provide a label, the account email address is used when available.
|
|
|
47
47
|
|
|
48
48
|
The active account (marked with a green checkmark and "Active" badge) is used for all task execution with that provider.
|
|
49
49
|
|
|
50
|
-
To change the active account, click the **checkmark button** next to the account you want to activate.
|
|
50
|
+
To change the active account, click the **checkmark button** next to the account you want to activate. Click the active account's **checkmark button** again to clear the selection entirely.
|
|
51
51
|
|
|
52
|
-
Changing the active account immediately affects new task launches. Running tasks continue using the account they started with.
|
|
52
|
+
Changing or clearing the active account immediately affects new task launches. Running tasks continue using the account they started with.
|
|
53
53
|
|
|
54
54
|
### Renaming Accounts
|
|
55
55
|
|
|
@@ -62,7 +62,7 @@ Changing the active account immediately affects new task launches. Running tasks
|
|
|
62
62
|
1. Click the **Delete** (trash) icon next to the account
|
|
63
63
|
2. Confirm the removal
|
|
64
64
|
|
|
65
|
-
If you remove the active account,
|
|
65
|
+
If you remove the active account, no other account is auto-selected. Tasks using that provider will fail until you choose another active account or connect a new one.
|
|
66
66
|
|
|
67
67
|
## Token Refresh
|
|
68
68
|
|
|
@@ -113,7 +113,7 @@ When you change the active account in CoderFlow, the CLI credential files are up
|
|
|
113
113
|
|
|
114
114
|
### "Provider not configured" Error
|
|
115
115
|
|
|
116
|
-
This error appears when launching tasks if no account is connected for the required provider. Connect an account in **Settings → Provider Authentication**.
|
|
116
|
+
This error appears when launching tasks if no account is connected for the required provider, or if all connected accounts are currently unselected. Connect an account or mark one active in **Settings → Provider Authentication**.
|
|
117
117
|
|
|
118
118
|
### Authentication Expired
|
|
119
119
|
|
|
@@ -4695,3 +4695,64 @@ code {
|
|
|
4695
4695
|
.btn-ghost.danger {
|
|
4696
4696
|
color: var(--color-danger);
|
|
4697
4697
|
}
|
|
4698
|
+
|
|
4699
|
+
/* ============================================================
|
|
4700
|
+
MEMORY TAB
|
|
4701
|
+
============================================================ */
|
|
4702
|
+
|
|
4703
|
+
/* Memory table - full width with proper column spacing */
|
|
4704
|
+
.memory-table {
|
|
4705
|
+
width: 100%;
|
|
4706
|
+
border-collapse: collapse;
|
|
4707
|
+
}
|
|
4708
|
+
|
|
4709
|
+
.memory-table th,
|
|
4710
|
+
.memory-table td {
|
|
4711
|
+
padding: 10px 12px;
|
|
4712
|
+
text-align: left;
|
|
4713
|
+
border-bottom: 1px solid var(--color-border);
|
|
4714
|
+
font-size: 13px;
|
|
4715
|
+
}
|
|
4716
|
+
|
|
4717
|
+
.memory-table th {
|
|
4718
|
+
font-weight: 500;
|
|
4719
|
+
color: var(--color-text-secondary);
|
|
4720
|
+
font-size: 12px;
|
|
4721
|
+
text-transform: uppercase;
|
|
4722
|
+
letter-spacing: 0.03em;
|
|
4723
|
+
}
|
|
4724
|
+
|
|
4725
|
+
.memory-table tbody tr:hover {
|
|
4726
|
+
background: var(--color-surface-muted);
|
|
4727
|
+
}
|
|
4728
|
+
|
|
4729
|
+
.memory-actions {
|
|
4730
|
+
display: flex;
|
|
4731
|
+
gap: 2px;
|
|
4732
|
+
justify-content: flex-end;
|
|
4733
|
+
}
|
|
4734
|
+
|
|
4735
|
+
.memory-actions .btn-icon {
|
|
4736
|
+
width: 28px;
|
|
4737
|
+
height: 28px;
|
|
4738
|
+
color: var(--color-text-secondary);
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4741
|
+
.memory-actions .btn-icon:hover {
|
|
4742
|
+
color: var(--color-text);
|
|
4743
|
+
}
|
|
4744
|
+
|
|
4745
|
+
.memory-actions .memory-delete-btn:hover {
|
|
4746
|
+
color: var(--color-danger, #ef4444);
|
|
4747
|
+
background: rgba(239, 68, 68, 0.1);
|
|
4748
|
+
}
|
|
4749
|
+
|
|
4750
|
+
/* Memory modal - wider for editor toolbar */
|
|
4751
|
+
.memory-modal-content {
|
|
4752
|
+
max-width: 700px;
|
|
4753
|
+
}
|
|
4754
|
+
|
|
4755
|
+
/* Memory modal form spacing */
|
|
4756
|
+
.memory-modal-body .form-row + .form-row {
|
|
4757
|
+
margin-top: 16px;
|
|
4758
|
+
}
|