@profoundlogic/coderflow-server 0.5.5 → 0.5.6
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/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/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-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/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/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/environments.js +1 -1
- package/dist/web-ui/public/feedback-widget.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/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/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.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/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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function isLogOnlyTaskType(_0x2ef193){return _0x2ef193==='test'||_0x2ef193==='deploy';}export function createApproveDialogHTML(_0x27a9d1='',_0x558936={}){const _0x5652ad=_0x27a9d1,_0x4acccb=_0x558936['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x44b06f=_0x558936['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x474b41=_0x558936['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x5652ad+'approve-modal\x22\x20class=\x22'+_0x4acccb+'\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'+_0x5652ad+'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'+_0x5652ad+'approve-warning\x22\x20class=\x22'+_0x44b06f+'\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'+_0x5652ad+'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'+_0x5652ad+'approve-error\x22\x20class=\x22'+_0x474b41+'\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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'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'+_0x5652ad+'ibmi-sync-library-row\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'+_0x5652ad+'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'+_0x5652ad+'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</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'+_0x5652ad+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x5652ad+'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(_0x43187f={}){this['prefix']=_0x43187f['prefix']||'',this['onApprove']=_0x43187f['onApprove'],this['onSync']=_0x43187f['onSync'],this['onSuccess']=_0x43187f['onSuccess'],this['onError']=_0x43187f['onError'],this['onCreatePR']=_0x43187f['onCreatePR'],this['showToast']=_0x43187f['showToast']||(()=>{}),this['container']=_0x43187f['container']||document['body'],this['useTaskPageStyles']=_0x43187f['useTaskPageStyles']||![],this['baseUrl']=_0x43187f['baseUrl']||'',this['coderflowAttribution']=_0x43187f['coderflowAttribution'],this['onSyncToIbmi']=_0x43187f['onSyncToIbmi']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0;}['init'](){if(this['initialized'])return;const _0x556c50=document['createElement']('div');_0x556c50['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x556c50['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x4afe3e){return document['getElementById'](''+this['prefix']+_0x4afe3e);}['_bindEvents'](){const _0x124745=this['_el']('approve-modal'),_0x246d7a=this['_el']('close-approve-modal'),_0x2024d7=this['_el']('cancel-approve'),_0x35aa3d=this['_el']('confirm-approve'),_0xa823c9=_0x124745?.['querySelector']('.modal-overlay'),_0x153740=this['_el']('create-new-branch'),_0x48ef43=this['_el']('new-branch-input-container'),_0x16e595=this['_el']('new-branch-name'),_0x571336=this['_el']('push-after-commit'),_0x52019d=this['_el']('create-pull-request'),_0x310e42=this['_el']('pr-hint');_0x246d7a?.['addEventListener']('click',()=>this['hide']()),_0x2024d7?.['addEventListener']('click',()=>this['hide']()),_0xa823c9?.['addEventListener']('click',()=>this['hide']()),_0x35aa3d?.['addEventListener']('click',()=>this['_handleApprove']());_0x153740&&_0x153740['addEventListener']('change',()=>{_0x48ef43&&(_0x48ef43['hidden']=!_0x153740['checked']),_0x153740['checked']&&_0x16e595&&_0x16e595['focus']();});_0x52019d&&_0x571336&&_0x153740&&(_0x52019d['addEventListener']('change',()=>{this['_createPR']=_0x52019d['checked'];if(_0x52019d['checked']){_0x571336['checked']=!![],_0x571336['disabled']=!![],_0x153740['checked']=!![],_0x153740['disabled']=!![];_0x48ef43&&(_0x48ef43['hidden']=![]);if(_0x310e42)_0x310e42['hidden']=![];}else{_0x571336['disabled']=![],_0x153740['disabled']=![];if(_0x310e42)_0x310e42['hidden']=!![];}}),_0x571336['addEventListener']('change',()=>{if(!_0x571336['checked']&&_0x52019d['checked']){_0x52019d['checked']=![],this['_createPR']=![],_0x571336['disabled']=![],_0x153740['disabled']=![];if(_0x310e42)_0x310e42['hidden']=!![];}}));const _0x3390b9=this['_el']('sync-to-ibmi');_0x3390b9&&_0x3390b9['addEventListener']('change',_0x215092=>{const _0x57950d=this['_el']('ibmi-sync-library-row');if(_0x57950d)_0x57950d['hidden']=!_0x215092['target']['checked'];if(_0x215092['target']['checked']){const _0x4ee3b1=this['_el']('ibmi-sync-library'),_0x427a53=localStorage['getItem']('coderflow_ibmi_sync_library');_0x427a53&&_0x4ee3b1&&!_0x4ee3b1['value']&&(_0x4ee3b1['value']=_0x427a53);}}),document['addEventListener']('keydown',_0x1820e6=>{_0x1820e6['key']==='Escape'&&_0x124745&&!_0x124745['hidden']&&this['hide']();});}['showError'](_0x2cedad){const _0x545bc1=this['_el']('approve-error'),_0x3061cf=this['_el']('approve-error-text');_0x545bc1&&_0x3061cf&&(_0x3061cf['textContent']=_0x2cedad,_0x545bc1['hidden']=![],_0x545bc1['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x495551=this['_el']('approve-error'),_0x768190=this['_el']('approve-error-text');_0x495551&&_0x768190&&(_0x495551['hidden']=!![],_0x768190['textContent']='');}['_displayBranchInfo'](_0x2a9e79,_0x24f484={}){const _0xc11aa4=this['_el']('approve-branches');if(!_0xc11aa4)return;const _0x1aac0e=[];for(const _0x661e07 of _0x2a9e79){_0x24f484[_0x661e07['name']]&&_0x1aac0e['push']({'repo':_0x661e07['name'],'branch':_0x24f484[_0x661e07['name']]});}if(_0x1aac0e['length']>0x0){_0xc11aa4['hidden']=![];if(_0x1aac0e['length']===0x1)_0xc11aa4['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x1aac0e[0x0]['branch']+'</code></div>';else{const _0x5a3a08=_0x1aac0e['map'](_0x249d65=>'<div\x20class=\x22branch-item\x22><strong>'+_0x249d65['repo']+':</strong>\x20<code>'+_0x249d65['branch']+'</code></div>')['join']('');_0xc11aa4['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x5a3a08+'</div></div>';}}else _0xc11aa4['hidden']=!![],_0xc11aa4['innerHTML']='';}['showWarning'](_0x4da6f3){const _0x160e87=this['_el']('approve-warning'),_0x218366=this['_el']('approve-warning-text');_0x160e87&&_0x218366&&(_0x218366['textContent']=_0x4da6f3,_0x160e87['hidden']=![]);}['hideWarning'](){const _0x9255d8=this['_el']('approve-warning'),_0x6ecc84=this['_el']('approve-warning-text');_0x9255d8&&_0x6ecc84&&(_0x9255d8['hidden']=!![],_0x6ecc84['textContent']='');}['_stripCoAuthoredByLines'](_0x14a5c7){return _0x14a5c7['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x527cea){try{let _0x5e3d74;try{const _0x1c95a4=await fetch(this['baseUrl']+'/settings');if(_0x1c95a4['ok']){const _0x24076e=await _0x1c95a4['json']();_0x5e3d74=_0x24076e['coderflow_attribution']!==![];}}catch(_0x498472){}_0x5e3d74===undefined&&(this['coderflowAttribution']!==undefined?_0x5e3d74=this['coderflowAttribution']!==![]:_0x5e3d74=!![]);const _0x12881f=this['_stripCoAuthoredByLines'](_0x527cea);if(!_0x5e3d74)return _0x12881f;const _0x3c117f='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x12881f+_0x3c117f;}catch(_0x2df288){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x2df288),_0x527cea;}}['show'](_0x49fafe){!this['initialized']&&this['init']();this['taskData']=_0x49fafe;const _0x1f2f9d=this['_el']('approve-modal'),_0x5c6876=this['_el']('commit-message-input'),_0x56571a=this['_el']('pull-before-commit'),_0x1e0131=this['_el']('push-after-commit'),_0x241e90=this['_el']('create-new-branch'),_0x2d4eac=this['_el']('new-branch-input-container'),_0xb3b157=this['_el']('new-branch-name'),_0x3d0791=this['_el']('approve-repo-name'),_0x3d818b=this['_el']('approve-stats'),_0x44ed58=this['_el']('multi-repo-note');if(!_0x1f2f9d)return;this['hideError'](),this['hideWarning']();_0x49fafe['warning']&&this['showWarning'](_0x49fafe['warning']);const _0x45cbfe=_0x49fafe['reposChanged']||[];if(_0x45cbfe['length']===0x0&&!_0x49fafe['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x45cbfe,_0x49fafe);const _0x4f3d33=_0x49fafe['commitMessage']||'',_0x181423=this['_stripCoAuthoredByLines'](_0x4f3d33);_0x5c6876['value']=_0x181423;if(_0x56571a)_0x56571a['checked']=!![];if(_0x1e0131)_0x1e0131['checked']=!![];_0x241e90&&(_0x241e90['checked']=![]);_0x2d4eac&&(_0x2d4eac['hidden']=!![]);_0xb3b157&&(_0xb3b157['value']='');if(_0x1e0131)_0x1e0131['disabled']=![];if(_0x241e90)_0x241e90['disabled']=![];this['updatePRSupport'](_0x49fafe['prSupported']===!![]);const _0x11ee62=this['_el']('ibmi-sync-section');if(_0x11ee62){_0x11ee62['hidden']=!_0x49fafe['ibmiSyncAvailable'];const _0x5b0577=this['_el']('sync-to-ibmi'),_0x1a0504=this['_el']('ibmi-sync-library-row'),_0x3cc1ef=this['_el']('ibmi-sync-library');if(_0x5b0577)_0x5b0577['checked']=![];if(_0x1a0504)_0x1a0504['hidden']=!![];if(_0x3cc1ef)_0x3cc1ef['value']='';}const _0x30c1cf=this['_el']('confirm-approve');_0x49fafe['syncFirst']&&this['onSync']?(_0x30c1cf&&(_0x30c1cf['disabled']=!![],_0x30c1cf['textContent']='Syncing...'),this['_performSync']()):_0x30c1cf&&(_0x30c1cf['disabled']=![],_0x30c1cf['textContent']='Commit\x20Changes');_0x1f2f9d['hidden']=![];const _0x2bf935=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x2bf935,'taskId':_0x49fafe['taskId'],'originalCommitMessage':_0x181423}),setTimeout(()=>{_0x5c6876['focus'](),_0x5c6876['setSelectionRange'](0x0,_0x5c6876['value']['length']);},0x64);}['updatePRSupport'](_0x35b425){const _0x46f62e=this['_el']('pr-option-section'),_0x465566=this['_el']('create-pull-request'),_0x1d16c0=this['_el']('pr-hint'),_0x2f5ec0=this['_el']('push-after-commit'),_0x55c896=this['_el']('create-new-branch');if(!_0x46f62e)return;if(_0x35b425){_0x46f62e['hidden']=![];_0x465566&&!_0x465566['disabled']&&(_0x465566['checked']=![]);if(_0x1d16c0)_0x1d16c0['hidden']=!![];this['_createPR']=![];return;}_0x465566?.['checked']&&(_0x465566['checked']=![]);if(_0x1d16c0)_0x1d16c0['hidden']=!![];if(_0x2f5ec0)_0x2f5ec0['disabled']=![];if(_0x55c896)_0x55c896['disabled']=![];this['_createPR']=![],_0x46f62e['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0xfd85f3,taskId:_0x48cb64,originalCommitMessage:_0x10a7ce}){const _0x11adf3=this['_el']('commit-message-input');if(!_0x11adf3)return;const _0x498199=await this['_addAttributionIfEnabled'](_0x10a7ce);if(_0xfd85f3!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x48cb64)return;if(!this['isVisible']())return;const _0x5bd027=_0x185a98=>_0x185a98['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x5bd027(_0x11adf3['value'])!==_0x5bd027(_0x10a7ce))return;_0x11adf3['value']=_0x498199;}['_updateDisplay'](_0xcc775f,_0x4f0ea9){const _0x298215=this['_el']('approve-repo-name'),_0x404fd7=this['_el']('approve-stats'),_0x431d1f=this['_el']('multi-repo-note');if(_0xcc775f['length']===0x0){if(_0x298215)_0x298215['textContent']='Syncing...';if(_0x404fd7)_0x404fd7['textContent']='';if(_0x431d1f)_0x431d1f['hidden']=!![];return;}const _0x5c011d=_0xcc775f['reduce']((_0x1dba7b,_0x573bc3)=>_0x1dba7b+(_0x573bc3['files_changed']||0x0),0x0),_0x33de7f=_0xcc775f['reduce']((_0xc64d08,_0x3c9153)=>_0xc64d08+(_0x3c9153['lines_added']||0x0),0x0),_0x5c5fb5=_0xcc775f['reduce']((_0x378017,_0x123b73)=>_0x378017+(_0x123b73['lines_deleted']||0x0),0x0);if(_0xcc775f['length']===0x1){if(_0x298215)_0x298215['textContent']=_0xcc775f[0x0]?.['name']||'repository';if(_0x431d1f)_0x431d1f['hidden']=!![];}else{const _0x1de0b1=_0xcc775f['map'](_0x1f337f=>_0x1f337f['name'])['join'](',\x20');if(_0x298215)_0x298215['textContent']=_0xcc775f['length']+'\x20repositories:\x20'+_0x1de0b1;if(_0x431d1f)_0x431d1f['hidden']=![];}_0x404fd7&&(_0x404fd7['textContent']=_0x5c011d+'\x20file'+(_0x5c011d===0x1?'':'s')+'\x20changed\x20(+'+_0x33de7f+'\x20-'+_0x5c5fb5+')'),this['_displayBranchInfo'](_0xcc775f,_0x4f0ea9?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x17599c=this['_el']('confirm-approve');try{const _0x2919de=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x2919de['repos_changed']){const _0x2ddd6b=this['taskData']['reposChanged']?.['length']||0x0,_0x21e513=this['taskData']['reposChanged']?.['reduce']((_0x5a49c8,_0x521ec7)=>_0x5a49c8+(_0x521ec7['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x2919de['repos_changed'],this['_updateDisplay'](_0x2919de['repos_changed'],this['taskData']);const _0x3d327d=_0x2919de['repos_changed']['length'],_0xa7cb88=_0x2919de['repos_changed']['reduce']((_0x5b6270,_0x2c196f)=>_0x5b6270+(_0x2c196f['files_changed']||0x0),0x0);(_0xa7cb88>_0x21e513||_0x3d327d>_0x2ddd6b)&&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.');}_0x17599c&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x17599c['disabled']=!![],_0x17599c['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x17599c['disabled']=![],_0x17599c['textContent']='Commit\x20Changes'));}catch(_0x1d2cfe){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x1d2cfe);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x1d2cfe['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x17599c&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x17599c['disabled']=![],_0x17599c['textContent']='Commit\x20Changes'):(_0x17599c['disabled']=!![],_0x17599c['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x3988cc=this['_el']('approve-modal');_0x3988cc&&(_0x3988cc['hidden']=!![]);}async['_handleApprove'](){const _0x1bb740=this['_el']('commit-message-input'),_0x415953=this['_el']('pull-before-commit'),_0x40ed2e=this['_el']('push-after-commit'),_0x2190e2=this['_el']('create-new-branch'),_0x19d8f6=this['_el']('new-branch-name'),_0x1ae003=this['_el']('confirm-approve'),_0x4098d5=_0x1bb740['value']['trim'](),_0x549087=_0x415953?.['checked']??!![],_0x56db22=_0x40ed2e?.['checked']??!![],_0x12b864=_0x2190e2?.['checked']||![],_0x16d019=_0x19d8f6?.['value']['trim']()||'';this['hideError']();if(!_0x4098d5){this['showError']('Commit\x20message\x20is\x20required'),_0x1bb740['focus']();return;}if(_0x12b864&&!_0x16d019){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x19d8f6?.['focus']();return;}if(_0x12b864&&_0x16d019){const _0x555b8a=/[\s~^:?*\[\\]/;if(_0x555b8a['test'](_0x16d019)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x19d8f6?.['focus']();return;}}const _0x4f7fdb=this['_el']('sync-to-ibmi')?.['checked'];if(_0x4f7fdb){const _0x334651=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x334651){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}}const _0x4cb978=_0x1ae003?.['textContent']||'Commit\x20Changes';_0x1ae003&&(_0x1ae003['disabled']=!![],_0x12b864?_0x1ae003['textContent']='Creating\x20branch\x20&\x20committing...':_0x1ae003['textContent']=_0x549087?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x39386a={'commit_message':_0x4098d5,'pull':_0x549087,'push':_0x56db22};_0x12b864&&_0x16d019&&(_0x39386a['new_branch']=_0x16d019);let _0x10f41f=null;this['onApprove']&&(_0x10f41f=await this['onApprove'](this['taskData']['taskId'],_0x39386a));let _0x229e2f='Changes\x20committed';if(_0x12b864)_0x229e2f='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x16d019+'\x27',_0x56db22&&(_0x229e2f+='\x20and\x20pushed');else{if(_0x549087&&_0x56db22)_0x229e2f='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x549087)_0x229e2f='Changes\x20pulled\x20and\x20committed';else _0x56db22&&(_0x229e2f='Changes\x20committed\x20and\x20pushed');}}this['showToast'](_0x229e2f,'success'),this['hide']();this['_createPR']&&this['onCreatePR']&&this['onCreatePR'](this['taskData']['taskId'],_0x10f41f||{});const _0x11be85=this['_el']('sync-to-ibmi')?.['checked'];if(_0x11be85&&this['onSyncToIbmi']){const _0x1e898a=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase']();if(_0x1e898a){localStorage['setItem']('coderflow_ibmi_sync_library',_0x1e898a);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x1e898a);}catch(_0x4b8a58){this['showToast']('Sync\x20failed:\x20'+_0x4b8a58['message'],'error');}}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x1325da){console['error']('Failed\x20to\x20approve\x20changes',_0x1325da),this['showError']('Failed\x20to\x20commit:\x20'+_0x1325da['message']),_0x1ae003&&(_0x1ae003['disabled']=![],_0x1ae003['textContent']=_0x4cb978),this['onError']&&this['onError'](_0x1325da);}}['isVisible'](){const _0x1b70aa=this['_el']('approve-modal');return _0x1b70aa&&!_0x1b70aa['hidden'];}['destroy'](){const _0x935de0=this['_el']('approve-modal');_0x935de0&&_0x935de0['remove'](),this['initialized']=![];}}export function getApproveState(_0x1dbcfd,_0x41eb91){if(!_0x1dbcfd)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x1dbcfd['taskType']))return{'canApprove':![],'reason':(_0x1dbcfd['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x43316a=_0x41eb91?.['repos_changed']?.['length']>0x0,_0x3bf5e8=_0x1dbcfd['status']==='completed'||_0x1dbcfd['status']==='failed'||_0x1dbcfd['status']==='interrupted',_0x4f4f9d=_0x1dbcfd['containerState']==='running',_0x1b9234=_0x1dbcfd['approvedBy']!==undefined&&_0x1dbcfd['approvedBy']!==null;if(_0x1b9234){const _0x1d8fd8=_0x1dbcfd['approvedBy']['name']||_0x1dbcfd['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x1d8fd8};}if(!_0x43316a)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x3bf5e8)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x1dbcfd['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x4f4f9d)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
1
|
+
function isLogOnlyTaskType(_0x82ec37){return _0x82ec37==='test'||_0x82ec37==='deploy';}export function createApproveDialogHTML(_0x57c074='',_0x2db3d4={}){const _0x2bdbf0=_0x57c074,_0x342b27=_0x2db3d4['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x52bf27=_0x2db3d4['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x169321=_0x2db3d4['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x2bdbf0+'approve-modal\x22\x20class=\x22'+_0x342b27+'\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'+_0x2bdbf0+'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'+_0x2bdbf0+'approve-warning\x22\x20class=\x22'+_0x52bf27+'\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'+_0x2bdbf0+'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'+_0x2bdbf0+'approve-error\x22\x20class=\x22'+_0x169321+'\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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'ibmi-sync-library-row\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'+_0x2bdbf0+'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'+_0x2bdbf0+'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</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'+_0x2bdbf0+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x2bdbf0+'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(_0x411a81={}){this['prefix']=_0x411a81['prefix']||'',this['onApprove']=_0x411a81['onApprove'],this['onSync']=_0x411a81['onSync'],this['onSuccess']=_0x411a81['onSuccess'],this['onError']=_0x411a81['onError'],this['onCreatePR']=_0x411a81['onCreatePR'],this['showToast']=_0x411a81['showToast']||(()=>{}),this['container']=_0x411a81['container']||document['body'],this['useTaskPageStyles']=_0x411a81['useTaskPageStyles']||![],this['baseUrl']=_0x411a81['baseUrl']||'',this['coderflowAttribution']=_0x411a81['coderflowAttribution'],this['onSyncToIbmi']=_0x411a81['onSyncToIbmi']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0;}['init'](){if(this['initialized'])return;const _0x39d8c0=document['createElement']('div');_0x39d8c0['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x39d8c0['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x525b41){return document['getElementById'](''+this['prefix']+_0x525b41);}['_bindEvents'](){const _0x4fc892=this['_el']('approve-modal'),_0x32546c=this['_el']('close-approve-modal'),_0x27d5cb=this['_el']('cancel-approve'),_0x1daa20=this['_el']('confirm-approve'),_0x4e5c4e=_0x4fc892?.['querySelector']('.modal-overlay'),_0x238af7=this['_el']('create-new-branch'),_0x293545=this['_el']('new-branch-input-container'),_0x2650b8=this['_el']('new-branch-name'),_0x42c500=this['_el']('push-after-commit'),_0x10f503=this['_el']('create-pull-request'),_0x51ac49=this['_el']('pr-hint');_0x32546c?.['addEventListener']('click',()=>this['hide']()),_0x27d5cb?.['addEventListener']('click',()=>this['hide']()),_0x4e5c4e?.['addEventListener']('click',()=>this['hide']()),_0x1daa20?.['addEventListener']('click',()=>this['_handleApprove']());_0x238af7&&_0x238af7['addEventListener']('change',()=>{_0x293545&&(_0x293545['hidden']=!_0x238af7['checked']),_0x238af7['checked']&&_0x2650b8&&_0x2650b8['focus']();});_0x10f503&&_0x42c500&&_0x238af7&&(_0x10f503['addEventListener']('change',()=>{this['_createPR']=_0x10f503['checked'];if(_0x10f503['checked']){_0x42c500['checked']=!![],_0x42c500['disabled']=!![],_0x238af7['checked']=!![],_0x238af7['disabled']=!![];_0x293545&&(_0x293545['hidden']=![]);if(_0x51ac49)_0x51ac49['hidden']=![];}else{_0x42c500['disabled']=![],_0x238af7['disabled']=![];if(_0x51ac49)_0x51ac49['hidden']=!![];}}),_0x42c500['addEventListener']('change',()=>{if(!_0x42c500['checked']&&_0x10f503['checked']){_0x10f503['checked']=![],this['_createPR']=![],_0x42c500['disabled']=![],_0x238af7['disabled']=![];if(_0x51ac49)_0x51ac49['hidden']=!![];}}));const _0x5d8f21=this['_el']('sync-to-ibmi');_0x5d8f21&&_0x5d8f21['addEventListener']('change',_0x4748d3=>{const _0x4485d1=this['_el']('ibmi-sync-library-row');if(_0x4485d1)_0x4485d1['hidden']=!_0x4748d3['target']['checked'];if(_0x4748d3['target']['checked']){const _0x62d24d=this['_el']('ibmi-sync-library'),_0xcf557e=localStorage['getItem']('coderflow_ibmi_sync_library');_0xcf557e&&_0x62d24d&&!_0x62d24d['value']&&(_0x62d24d['value']=_0xcf557e);}}),document['addEventListener']('keydown',_0x1bc4f9=>{_0x1bc4f9['key']==='Escape'&&_0x4fc892&&!_0x4fc892['hidden']&&this['hide']();});}['showError'](_0x366b0a){const _0xbddb91=this['_el']('approve-error'),_0x477722=this['_el']('approve-error-text');_0xbddb91&&_0x477722&&(_0x477722['textContent']=_0x366b0a,_0xbddb91['hidden']=![],_0xbddb91['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x42bf7b=this['_el']('approve-error'),_0xb287e1=this['_el']('approve-error-text');_0x42bf7b&&_0xb287e1&&(_0x42bf7b['hidden']=!![],_0xb287e1['textContent']='');}['_displayBranchInfo'](_0x4c61fb,_0x34fa62={}){const _0x1f577e=this['_el']('approve-branches');if(!_0x1f577e)return;const _0x33f61e=[];for(const _0x18dedd of _0x4c61fb){_0x34fa62[_0x18dedd['name']]&&_0x33f61e['push']({'repo':_0x18dedd['name'],'branch':_0x34fa62[_0x18dedd['name']]});}if(_0x33f61e['length']>0x0){_0x1f577e['hidden']=![];if(_0x33f61e['length']===0x1)_0x1f577e['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x33f61e[0x0]['branch']+'</code></div>';else{const _0x42944b=_0x33f61e['map'](_0x50a253=>'<div\x20class=\x22branch-item\x22><strong>'+_0x50a253['repo']+':</strong>\x20<code>'+_0x50a253['branch']+'</code></div>')['join']('');_0x1f577e['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x42944b+'</div></div>';}}else _0x1f577e['hidden']=!![],_0x1f577e['innerHTML']='';}['showWarning'](_0x247988){const _0x181b15=this['_el']('approve-warning'),_0x2bc9ee=this['_el']('approve-warning-text');_0x181b15&&_0x2bc9ee&&(_0x2bc9ee['textContent']=_0x247988,_0x181b15['hidden']=![]);}['hideWarning'](){const _0x32aa83=this['_el']('approve-warning'),_0x17129b=this['_el']('approve-warning-text');_0x32aa83&&_0x17129b&&(_0x32aa83['hidden']=!![],_0x17129b['textContent']='');}['_stripCoAuthoredByLines'](_0x480836){return _0x480836['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x447266){try{let _0x3d7550;try{const _0x4b2d14=await fetch(this['baseUrl']+'/settings');if(_0x4b2d14['ok']){const _0x3d5025=await _0x4b2d14['json']();_0x3d7550=_0x3d5025['coderflow_attribution']!==![];}}catch(_0x46fab0){}_0x3d7550===undefined&&(this['coderflowAttribution']!==undefined?_0x3d7550=this['coderflowAttribution']!==![]:_0x3d7550=!![]);const _0xa96fe9=this['_stripCoAuthoredByLines'](_0x447266);if(!_0x3d7550)return _0xa96fe9;const _0x57c021='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0xa96fe9+_0x57c021;}catch(_0x111448){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x111448),_0x447266;}}['show'](_0x4e9471){!this['initialized']&&this['init']();this['taskData']=_0x4e9471;const _0x190b9a=this['_el']('approve-modal'),_0x24ee19=this['_el']('commit-message-input'),_0x5a6324=this['_el']('pull-before-commit'),_0x4ef27a=this['_el']('push-after-commit'),_0x73676c=this['_el']('create-new-branch'),_0x2679f1=this['_el']('new-branch-input-container'),_0x599ced=this['_el']('new-branch-name'),_0x4e47a1=this['_el']('approve-repo-name'),_0x1c98c3=this['_el']('approve-stats'),_0x395ca4=this['_el']('multi-repo-note');if(!_0x190b9a)return;this['hideError'](),this['hideWarning']();_0x4e9471['warning']&&this['showWarning'](_0x4e9471['warning']);const _0x187ba4=_0x4e9471['reposChanged']||[];if(_0x187ba4['length']===0x0&&!_0x4e9471['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x187ba4,_0x4e9471);const _0x2505d1=_0x4e9471['commitMessage']||'',_0x4a11c9=this['_stripCoAuthoredByLines'](_0x2505d1);_0x24ee19['value']=_0x4a11c9;if(_0x5a6324)_0x5a6324['checked']=!![];if(_0x4ef27a)_0x4ef27a['checked']=!![];_0x73676c&&(_0x73676c['checked']=![]);_0x2679f1&&(_0x2679f1['hidden']=!![]);_0x599ced&&(_0x599ced['value']='');if(_0x4ef27a)_0x4ef27a['disabled']=![];if(_0x73676c)_0x73676c['disabled']=![];this['updatePRSupport'](_0x4e9471['prSupported']===!![]);const _0x1288de=this['_el']('ibmi-sync-section');if(_0x1288de){_0x1288de['hidden']=!_0x4e9471['ibmiSyncAvailable'];const _0x188f61=this['_el']('sync-to-ibmi'),_0x14efc8=this['_el']('ibmi-sync-library-row'),_0x24233e=this['_el']('ibmi-sync-library');if(_0x188f61)_0x188f61['checked']=![];if(_0x14efc8)_0x14efc8['hidden']=!![];if(_0x24233e)_0x24233e['value']='';}const _0x251474=this['_el']('confirm-approve');_0x4e9471['syncFirst']&&this['onSync']?(_0x251474&&(_0x251474['disabled']=!![],_0x251474['textContent']='Syncing...'),this['_performSync']()):_0x251474&&(_0x251474['disabled']=![],_0x251474['textContent']='Commit\x20Changes');_0x190b9a['hidden']=![];const _0x3b264f=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x3b264f,'taskId':_0x4e9471['taskId'],'originalCommitMessage':_0x4a11c9}),setTimeout(()=>{_0x24ee19['focus'](),_0x24ee19['setSelectionRange'](0x0,_0x24ee19['value']['length']);},0x64);}['updatePRSupport'](_0x569fbd){const _0x4c8563=this['_el']('pr-option-section'),_0xe1ad21=this['_el']('create-pull-request'),_0x2245da=this['_el']('pr-hint'),_0x5c085d=this['_el']('push-after-commit'),_0x48ab49=this['_el']('create-new-branch');if(!_0x4c8563)return;if(_0x569fbd){_0x4c8563['hidden']=![];_0xe1ad21&&!_0xe1ad21['disabled']&&(_0xe1ad21['checked']=![]);if(_0x2245da)_0x2245da['hidden']=!![];this['_createPR']=![];return;}_0xe1ad21?.['checked']&&(_0xe1ad21['checked']=![]);if(_0x2245da)_0x2245da['hidden']=!![];if(_0x5c085d)_0x5c085d['disabled']=![];if(_0x48ab49)_0x48ab49['disabled']=![];this['_createPR']=![],_0x4c8563['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x595e15,taskId:_0x23d927,originalCommitMessage:_0x1179fe}){const _0x30834d=this['_el']('commit-message-input');if(!_0x30834d)return;const _0x4ceff0=await this['_addAttributionIfEnabled'](_0x1179fe);if(_0x595e15!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x23d927)return;if(!this['isVisible']())return;const _0x216f5e=_0x3248f5=>_0x3248f5['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x216f5e(_0x30834d['value'])!==_0x216f5e(_0x1179fe))return;_0x30834d['value']=_0x4ceff0;}['_updateDisplay'](_0x24bba1,_0x32bdaa){const _0x5e587a=this['_el']('approve-repo-name'),_0x1f3d25=this['_el']('approve-stats'),_0x19898c=this['_el']('multi-repo-note');if(_0x24bba1['length']===0x0){if(_0x5e587a)_0x5e587a['textContent']='Syncing...';if(_0x1f3d25)_0x1f3d25['textContent']='';if(_0x19898c)_0x19898c['hidden']=!![];return;}const _0x46c187=_0x24bba1['reduce']((_0x4bb14f,_0x24c55e)=>_0x4bb14f+(_0x24c55e['files_changed']||0x0),0x0),_0x354966=_0x24bba1['reduce']((_0x495eeb,_0x8c41fc)=>_0x495eeb+(_0x8c41fc['lines_added']||0x0),0x0),_0x3bf256=_0x24bba1['reduce']((_0x27255e,_0x460e96)=>_0x27255e+(_0x460e96['lines_deleted']||0x0),0x0);if(_0x24bba1['length']===0x1){if(_0x5e587a)_0x5e587a['textContent']=_0x24bba1[0x0]?.['name']||'repository';if(_0x19898c)_0x19898c['hidden']=!![];}else{const _0x599b36=_0x24bba1['map'](_0x5e5ce8=>_0x5e5ce8['name'])['join'](',\x20');if(_0x5e587a)_0x5e587a['textContent']=_0x24bba1['length']+'\x20repositories:\x20'+_0x599b36;if(_0x19898c)_0x19898c['hidden']=![];}_0x1f3d25&&(_0x1f3d25['textContent']=_0x46c187+'\x20file'+(_0x46c187===0x1?'':'s')+'\x20changed\x20(+'+_0x354966+'\x20-'+_0x3bf256+')'),this['_displayBranchInfo'](_0x24bba1,_0x32bdaa?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x44d0b2=this['_el']('confirm-approve');try{const _0x511445=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x511445['repos_changed']){const _0x5cf7f=this['taskData']['reposChanged']?.['length']||0x0,_0x3f8e4a=this['taskData']['reposChanged']?.['reduce']((_0x1951d8,_0x326e34)=>_0x1951d8+(_0x326e34['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x511445['repos_changed'],this['_updateDisplay'](_0x511445['repos_changed'],this['taskData']);const _0x181c9b=_0x511445['repos_changed']['length'],_0x56702b=_0x511445['repos_changed']['reduce']((_0x2da276,_0x5a65f4)=>_0x2da276+(_0x5a65f4['files_changed']||0x0),0x0);(_0x56702b>_0x3f8e4a||_0x181c9b>_0x5cf7f)&&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.');}_0x44d0b2&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x44d0b2['disabled']=!![],_0x44d0b2['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x44d0b2['disabled']=![],_0x44d0b2['textContent']='Commit\x20Changes'));}catch(_0x4f5b8f){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x4f5b8f);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x4f5b8f['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x44d0b2&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x44d0b2['disabled']=![],_0x44d0b2['textContent']='Commit\x20Changes'):(_0x44d0b2['disabled']=!![],_0x44d0b2['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x12250f=this['_el']('approve-modal');_0x12250f&&(_0x12250f['hidden']=!![]);}async['_handleApprove'](){const _0x5ad562=this['_el']('commit-message-input'),_0x243bb1=this['_el']('pull-before-commit'),_0x2a7e9a=this['_el']('push-after-commit'),_0x33706e=this['_el']('create-new-branch'),_0x21a63e=this['_el']('new-branch-name'),_0x7d30a9=this['_el']('confirm-approve'),_0xeb5ec7=_0x5ad562['value']['trim'](),_0x39130f=_0x243bb1?.['checked']??!![],_0x92288b=_0x2a7e9a?.['checked']??!![],_0x5d8782=_0x33706e?.['checked']||![],_0x572e4f=_0x21a63e?.['value']['trim']()||'';this['hideError']();if(!_0xeb5ec7){this['showError']('Commit\x20message\x20is\x20required'),_0x5ad562['focus']();return;}if(_0x5d8782&&!_0x572e4f){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x21a63e?.['focus']();return;}if(_0x5d8782&&_0x572e4f){const _0x50b632=/[\s~^:?*\[\\]/;if(_0x50b632['test'](_0x572e4f)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x21a63e?.['focus']();return;}}const _0x482e6d=this['_el']('sync-to-ibmi')?.['checked'];if(_0x482e6d){const _0x1ab691=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x1ab691){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}}const _0x27f7a6=_0x7d30a9?.['textContent']||'Commit\x20Changes';_0x7d30a9&&(_0x7d30a9['disabled']=!![],_0x5d8782?_0x7d30a9['textContent']='Creating\x20branch\x20&\x20committing...':_0x7d30a9['textContent']=_0x39130f?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x102079={'commit_message':_0xeb5ec7,'pull':_0x39130f,'push':_0x92288b};_0x5d8782&&_0x572e4f&&(_0x102079['new_branch']=_0x572e4f);let _0x3fdceb=null;this['onApprove']&&(_0x3fdceb=await this['onApprove'](this['taskData']['taskId'],_0x102079));let _0x2700ea='Changes\x20committed';if(_0x5d8782)_0x2700ea='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x572e4f+'\x27',_0x92288b&&(_0x2700ea+='\x20and\x20pushed');else{if(_0x39130f&&_0x92288b)_0x2700ea='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x39130f)_0x2700ea='Changes\x20pulled\x20and\x20committed';else _0x92288b&&(_0x2700ea='Changes\x20committed\x20and\x20pushed');}}this['showToast'](_0x2700ea,'success'),this['hide']();this['_createPR']&&this['onCreatePR']&&this['onCreatePR'](this['taskData']['taskId'],_0x3fdceb||{});const _0x330305=this['_el']('sync-to-ibmi')?.['checked'];if(_0x330305&&this['onSyncToIbmi']){const _0x282c02=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase']();if(_0x282c02){localStorage['setItem']('coderflow_ibmi_sync_library',_0x282c02);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x282c02);}catch(_0x347b88){this['showToast']('Sync\x20failed:\x20'+_0x347b88['message'],'error');}}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x6eb039){console['error']('Failed\x20to\x20approve\x20changes',_0x6eb039),this['showError']('Failed\x20to\x20commit:\x20'+_0x6eb039['message']),_0x7d30a9&&(_0x7d30a9['disabled']=![],_0x7d30a9['textContent']=_0x27f7a6),this['onError']&&this['onError'](_0x6eb039);}}['isVisible'](){const _0x538cc8=this['_el']('approve-modal');return _0x538cc8&&!_0x538cc8['hidden'];}['destroy'](){const _0x153190=this['_el']('approve-modal');_0x153190&&_0x153190['remove'](),this['initialized']=![];}}export function getApproveState(_0x1337f1,_0x5807b3){if(!_0x1337f1)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x1337f1['taskType']))return{'canApprove':![],'reason':(_0x1337f1['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0xd096c4=_0x5807b3?.['repos_changed']?.['length']>0x0,_0xdcd068=_0x1337f1['status']==='completed'||_0x1337f1['status']==='failed'||_0x1337f1['status']==='interrupted',_0x1aad0d=_0x1337f1['containerState']==='running',_0x3b11b6=_0x1337f1['approvedBy']!==undefined&&_0x1337f1['approvedBy']!==null;if(_0x3b11b6){const _0x5da413=_0x1337f1['approvedBy']['name']||_0x1337f1['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x5da413};}if(!_0xd096c4)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0xdcd068)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x1337f1['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x1aad0d)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function buildAutomationEnvironmentHref(
|
|
1
|
+
export function buildAutomationEnvironmentHref(_0x2f1a1c,_0x3cffb1){const _0x275f12=new URLSearchParams();_0x2f1a1c&&_0x275f12['set']('env',String(_0x2f1a1c));_0x275f12['set']('tab','automations');_0x3cffb1&&_0x275f12['set']('automation',String(_0x3cffb1));const _0x50f102=_0x275f12['toString']();return'environments.html'+(_0x50f102?'?'+_0x50f102:'');}export function buildAutomationTaskFilterHref(_0x3a7046){const _0x4aedba=new URLSearchParams();_0x3a7046&&_0x4aedba['set']('automation',String(_0x3a7046));const _0x146907=_0x4aedba['toString']();return'index.html'+(_0x146907?'?'+_0x146907:'');}export function parseAutomationDeepLinkParams(_0x45134e=''){const _0x24e501=new URLSearchParams(_0x45134e||'');return{'env':_0x24e501['get']('env'),'tab':_0x24e501['get']('tab'),'automation':_0x24e501['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(_0x463ac2,_0x273b91,_0x3a8f5b){const _0x581340=Number['parseInt'](_0x463ac2,0xa);if(!Number['isInteger'](_0x581340)||_0x581340<_0x273b91||_0x581340>_0x3a8f5b)return null;return _0x581340;}function inferRecurringInterval(_0x5db439,_0x250b6d){if(_0x5db439==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x5db439==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x5db439!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x250b6d==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x250b6d))return'0\x20*\x20*\x20*\x20*';for(const _0x20ab66 of RECURRING_INTERVAL_STEPS){if(_0x250b6d['startsWith']('*/'+_0x20ab66)||_0x250b6d['includes']('/'+_0x20ab66))return'0\x20*/'+_0x20ab66+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0xcff39a){const _0x1e6412=String(_0xcff39a||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x1e6412)return{'start':'','end':''};const _0x6576d2=parseBoundedInteger(_0x1e6412[0x1],0x0,0x17),_0x38d937=parseBoundedInteger(_0x1e6412[0x2],0x0,0x17);if(_0x6576d2===null||_0x38d937===null||_0x6576d2>_0x38d937)return{'start':'','end':''};return{'start':String(_0x6576d2),'end':String(_0x38d937)};}export function parseAutomationScheduleToFormState(_0x34bc76){const _0x4d5040=String(_0x34bc76||'')['trim'](),_0x49a250=createDefaultScheduleFormState(),_0x2bacf8=_0x4d5040['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x2bacf8){const _0x1c35fe=parseBoundedInteger(_0x2bacf8[0x1],0x0,0x3b),_0x500ebf=parseBoundedInteger(_0x2bacf8[0x2],0x0,0x17);if(_0x1c35fe!==null&&_0x500ebf!==null)return _0x49a250['frequency']='daily',_0x49a250['dailyMinute']=String(_0x1c35fe),_0x49a250['dailyHour']=String(_0x500ebf),_0x49a250;}const _0x1967b2=_0x4d5040['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x1967b2){const _0x2ddb57=parseBoundedInteger(_0x1967b2[0x1],0x0,0x3b),_0x2cf7f8=parseBoundedInteger(_0x1967b2[0x2],0x0,0x17),_0x5d55b5=parseBoundedInteger(_0x1967b2[0x3],0x0,0x7);if(_0x2ddb57!==null&&_0x2cf7f8!==null&&_0x5d55b5!==null)return _0x49a250['frequency']='weekly',_0x49a250['weeklyMinute']=String(_0x2ddb57),_0x49a250['weeklyHour']=String(_0x2cf7f8),_0x49a250['weeklyDay']=String(_0x5d55b5===0x7?0x0:_0x5d55b5),_0x49a250;}const _0x890679=_0x4d5040['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0x890679){const _0x2be466=parseBoundedInteger(_0x890679[0x1],0x0,0x3b),_0xed9fde=parseBoundedInteger(_0x890679[0x2],0x0,0x17),_0x10202d=parseBoundedInteger(_0x890679[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x2be466!==null&&_0xed9fde!==null&&_0x10202d!==null)return _0x49a250['frequency']='monthly',_0x49a250['monthlyMinute']=String(_0x2be466),_0x49a250['monthlyHour']=String(_0xed9fde),_0x49a250['monthlyDay']=String(_0x10202d),_0x49a250;}const _0x15b59d=_0x4d5040['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x15b59d){const [,_0x50a477,_0x3f99d5,_0x1a581d]=_0x15b59d;_0x49a250['frequency']='recurring',_0x49a250['recurringInterval']=inferRecurringInterval(_0x50a477,_0x3f99d5),_0x49a250['recurringDayToken']=String(_0x1a581d||'')['trim']()||'*';const _0x1b31c1=parseRecurringHourRange(_0x3f99d5);return _0x49a250['recurringStartHour']=_0x1b31c1['start'],_0x49a250['recurringEndHour']=_0x1b31c1['end'],_0x49a250;}return _0x49a250['frequency']='custom',_0x49a250['customCron']=_0x4d5040,_0x49a250;}export function buildAutomationCronFromFormState(_0x178dc9={}){const _0x5db385=String(_0x178dc9['frequency']||'daily');if(_0x5db385==='custom')return String(_0x178dc9['customCron']||'')['trim']();if(_0x5db385==='daily'){const _0x3a3519=String(_0x178dc9['dailyHour']??'2'),_0x3fec95=String(_0x178dc9['dailyMinute']??'0');return _0x3fec95+'\x20'+_0x3a3519+'\x20*\x20*\x20*';}if(_0x5db385==='weekly'){const _0x456d87=String(_0x178dc9['weeklyDay']??'1'),_0x5b0d07=String(_0x178dc9['weeklyHour']??'9'),_0x2d4843=String(_0x178dc9['weeklyMinute']??'0');return _0x2d4843+'\x20'+_0x5b0d07+'\x20*\x20*\x20'+_0x456d87;}if(_0x5db385==='monthly'){const _0xfbf051=String(_0x178dc9['monthlyDay']??'1'),_0x2e41e0=String(_0x178dc9['monthlyHour']??'0'),_0x4fd6ed=String(_0x178dc9['monthlyMinute']??'0');return _0x4fd6ed+'\x20'+_0x2e41e0+'\x20'+_0xfbf051+'\x20*\x20*';}const _0x58a280=String(_0x178dc9['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x2352d1='*/30',_0x48acee='*']=_0x58a280['split'](/\s+/);let _0x4e9e35=_0x48acee;const _0x116841=String(_0x178dc9['recurringStartHour']??'')['trim'](),_0x443bc1=String(_0x178dc9['recurringEndHour']??'')['trim']();if(_0x116841!==''&&_0x443bc1!==''){const _0xf431ac=Number['parseInt'](_0x116841,0xa),_0x571463=Number['parseInt'](_0x443bc1,0xa);if(Number['isInteger'](_0xf431ac)&&Number['isInteger'](_0x571463)&&_0xf431ac<=_0x571463){const _0x17df97=_0x48acee['match'](/^\*\/(\d+)$/);_0x17df97?_0x4e9e35=_0xf431ac+'-'+_0x571463+'/'+_0x17df97[0x1]:_0x4e9e35=_0xf431ac+'-'+_0x571463;}}const _0x25c5d8=String(_0x178dc9['recurringDayToken']??'*')['trim']()||'*';return _0x2352d1+'\x20'+_0x4e9e35+'\x20*\x20*\x20'+_0x25c5d8;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class CommentsWidget{constructor(_0x327653,_0x21e8be={}){this['container']=_0x327653,this['options']={'taskId':_0x21e8be['taskId']||null,'currentUserId':_0x21e8be['currentUserId']||null,'compact':_0x21e8be['compact']||![],'skipHeader':_0x21e8be['skipHeader']||![],'onCommentsLoaded':_0x21e8be['onCommentsLoaded']||null,'onCommentsChanged':_0x21e8be['onCommentsChanged']||null,'enableAttachments':_0x21e8be['enableAttachments']||![],'getAPI':_0x21e8be['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 _0x30a0de=this['options']['getAPI'](),_0x32ac96=await _0x30a0de['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x32ac96['attachments']||[];}catch(_0xffbaf3){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0xffbaf3),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 _0x22fcce=this['header']['querySelector']('.comments-toggle-btn');_0x22fcce['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 _0x1d9baa=document['createElement']('div');_0x1d9baa['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x1d9baa['appendChild'](this['toolbar']);const _0x1fe571=document['createElement']('div');_0x1fe571['className']='comments-editor-placeholder',_0x1d9baa['appendChild'](_0x1fe571);const _0x3c4b2f=document['createElement']('div');_0x3c4b2f['className']='comments-input-actions',_0x3c4b2f['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'](_0x1d9baa),this['inputSection']['appendChild'](_0x3c4b2f),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x1fe571),this['submitBtn']=_0x3c4b2f['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x3c4b2f['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x558090){const _0x5d49f3=document['createElement']('textarea');_0x5d49f3['placeholder']='Add\x20a\x20comment...',_0x5d49f3['className']='comments-textarea',_0x558090['appendChild'](_0x5d49f3);const _0xf4c6a1=window['MarkdownEditor'];if(!_0xf4c6a1){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x3d2feb={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0xcf533b=>{const _0x35c06c=_0xcf533b&&_0xcf533b['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x35c06c;},'fetchUsers':async()=>{const _0x4fb35c=this['options']['getAPI']();return _0x4fb35c['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x3d2feb['onAddAttachments']=_0x376711=>{this['pendingAttachments']['push'](..._0x376711),this['submitBtn']['disabled']=![];},_0x3d2feb['resolveAttachmentUrl']=_0x8eae01=>{const _0x4c86be=this['options']['getAPI']();return _0x4c86be['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x8eae01);},_0x3d2feb['isAttachmentNameTaken']=_0x4d2be0=>{return this['pendingAttachments']['some'](_0x2f535b=>_0x2f535b['name']===_0x4d2be0)||this['existingAttachments']['some'](_0x44959f=>_0x44959f['name']===_0x4d2be0);});this['editor']=new _0xf4c6a1(_0x5d49f3,_0x3d2feb);const _0x4a94d4=this['editor']['editor'],_0x40b372=this['editor']['toolbar'];_0x40b372&&(_0x40b372['classList']['add']('comments-toolbar-hidden'),_0x4a94d4['addEventListener']('focus',()=>{_0x40b372['classList']['remove']('comments-toolbar-hidden');}),_0x4a94d4['addEventListener']('blur',_0x3f4098=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x40b372['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x40b372['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x24a364=this['header']['querySelector']('.comments-chevron');_0x24a364&&(_0x24a364['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x38669b){this['options']['taskId']=_0x38669b,this['comments']=[],this['renderComments'](),_0x38669b&&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 _0x1a414a=this['options']['getAPI'](),_0x23af7d=await _0x1a414a['getComments'](this['options']['taskId']);this['comments']=_0x23af7d['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x1c73c4){console['error']('Failed\x20to\x20load\x20comments:',_0x1c73c4),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'](_0x463052=>{const _0x4f0ba5=this['createCommentElement'](_0x463052);this['commentsList']['appendChild'](_0x4f0ba5);});}['createCommentElement'](_0x3550b0){const _0x574401=document['createElement']('div');_0x574401['className']='comment-item',_0x574401['dataset']['commentId']=_0x3550b0['id'];const _0x4a7b8d=this['options']['currentUserId']&&_0x3550b0['author']?.['userId']===this['options']['currentUserId'],_0x328a26=this['formatDate'](_0x3550b0['createdAt']),_0x43ab2e=_0x3550b0['updatedAt']!==_0x3550b0['createdAt'],_0x11a2b8=this['resolveAttachmentUrls'](_0x3550b0['content']);let _0x73d699=window['marked']?window['marked']['parse'](_0x11a2b8):_0x11a2b8;_0x73d699=this['renderMentions'](_0x73d699),_0x574401['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'](_0x3550b0['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x3550b0['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x328a26+(_0x43ab2e?'\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'+(_0x4a7b8d?'\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>'+_0x73d699+'</div>\x0a\x20\x20\x20\x20';if(_0x4a7b8d){const _0x50e72e=_0x574401['querySelector']('.comment-edit-btn'),_0x27b195=_0x574401['querySelector']('.comment-delete-btn');_0x50e72e?.['addEventListener']('click',()=>this['startEdit'](_0x3550b0)),_0x27b195?.['addEventListener']('click',()=>this['deleteComment'](_0x3550b0['id']));}return _0x574401;}['formatDate'](_0x11abb2){const _0x253b97=new Date(_0x11abb2),_0x3e18a7=new Date(),_0x1e3902=_0x3e18a7-_0x253b97,_0x2ba056=Math['floor'](_0x1e3902/0xea60),_0x520aa4=Math['floor'](_0x1e3902/0x36ee80),_0x2de4e5=Math['floor'](_0x1e3902/0x5265c00);if(_0x2ba056<0x1)return'just\x20now';if(_0x2ba056<0x3c)return _0x2ba056+'m\x20ago';if(_0x520aa4<0x18)return _0x520aa4+'h\x20ago';if(_0x2de4e5<0x7)return _0x2de4e5+'d\x20ago';return _0x253b97['toLocaleDateString']();}['escapeHtml'](_0x5a981a){const _0x2ccd3c=document['createElement']('div');return _0x2ccd3c['textContent']=_0x5a981a,_0x2ccd3c['innerHTML'];}['resolveAttachmentUrls'](_0x562e62){if(!_0x562e62||!this['options']['taskId'])return _0x562e62;const _0x2eb4fe=this['options']['getAPI'](),_0x546fde=_0x2eb4fe['getBaseUrl']();let _0xd205b0=String(_0x562e62)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x335c20,_0x456669)=>{const _0x315e37=String(_0x456669||'')['trim']();if(!_0x315e37)return _0x335c20;let _0x50a8b2=_0x315e37;try{_0x50a8b2=decodeURIComponent(_0x315e37);}catch{}return']('+_0x546fde+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x50a8b2)+')';});return _0xd205b0;}['renderMentions'](_0x494543){if(!_0x494543)return _0x494543;return String(_0x494543)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x3bcb90,_0x170772,_0x46e3d9)=>{const _0x1968c7=this['escapeHtml'](_0x46e3d9),_0x3e870b=this['escapeHtml'](_0x170772);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x3e870b+'\x22>@'+_0x1968c7+'</span>';});}['startEdit'](_0x5e5830){this['editingCommentId']=_0x5e5830['id'],this['editor']['setValue'](_0x5e5830['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 _0x41afdd=this['editor']['getValue']()?.['trim']();if(!_0x41afdd&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x590910=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x590910['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x42e9aa=>({'name':_0x42e9aa['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x5308fb=await _0x590910['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x41afdd),_0x42c5b5=this['comments']['findIndex'](_0x8054bb=>_0x8054bb['id']===this['editingCommentId']);_0x42c5b5!==-0x1&&(this['comments'][_0x42c5b5]=_0x5308fb['comment']);}else{const _0x28e488=await _0x590910['addComment'](this['options']['taskId'],_0x41afdd);this['comments']['push'](_0x28e488['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x1455be){console['error']('Failed\x20to\x20save\x20comment:',_0x1455be),alert('Failed\x20to\x20save\x20comment:\x20'+_0x1455be['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x366a5d){const _0x1e6bbc=await this['showDeleteConfirmModal']();if(!_0x1e6bbc)return;try{const _0x19436b=this['options']['getAPI']();await _0x19436b['deleteComment'](this['options']['taskId'],_0x366a5d),this['comments']=this['comments']['filter'](_0x35b369=>_0x35b369['id']!==_0x366a5d),this['renderComments'](),this['updateCount']();}catch(_0x89fadd){console['error']('Failed\x20to\x20delete\x20comment:',_0x89fadd),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x89fadd['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x49dafa=>{const _0xf92f9c=document['createElement']('div');_0xf92f9c['className']='comments-confirm-modal',_0xf92f9c['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'](_0xf92f9c);const _0x177b7e=_0x4a0d2a=>{document['removeEventListener']('keydown',_0x2a940c),_0xf92f9c['remove'](),_0x49dafa(_0x4a0d2a);},_0x2a940c=_0x2d5764=>{if(_0x2d5764['key']==='Escape')_0x177b7e(![]);};document['addEventListener']('keydown',_0x2a940c),_0xf92f9c['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x177b7e(![])),_0xf92f9c['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x177b7e(![])),_0xf92f9c['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x177b7e(![])),_0xf92f9c['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x177b7e(!![])),_0xf92f9c['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x5b332b){this['submitBtn']['disabled']=_0x5b332b,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x5b332b,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x5b332b;}['updateCount'](){const _0x5929f1=this['comments']['length'],_0x2a135a=this['container']['querySelector']('#comments-count-badge');_0x2a135a&&(_0x2a135a['textContent']=_0x5929f1,_0x2a135a['hidden']=_0x5929f1===0x0);const _0x2837c=this['container']['querySelector']('#comments-count');_0x2837c&&(_0x2837c['textContent']=_0x5929f1>0x0?'('+_0x5929f1+')':''),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(_0x2cbf71,_0xcec66e={}){this['container']=_0x2cbf71,this['options']={'taskId':_0xcec66e['taskId']||null,'currentUserId':_0xcec66e['currentUserId']||null,'compact':_0xcec66e['compact']||![],'skipHeader':_0xcec66e['skipHeader']||![],'onCommentsLoaded':_0xcec66e['onCommentsLoaded']||null,'onCommentsChanged':_0xcec66e['onCommentsChanged']||null,'enableAttachments':_0xcec66e['enableAttachments']||![],'getAPI':_0xcec66e['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 _0x527780=this['options']['getAPI'](),_0x367f36=await _0x527780['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x367f36['attachments']||[];}catch(_0x741bc7){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x741bc7),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 _0x40cde4=this['header']['querySelector']('.comments-toggle-btn');_0x40cde4['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 _0x2a1783=document['createElement']('div');_0x2a1783['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x2a1783['appendChild'](this['toolbar']);const _0x2ec9ad=document['createElement']('div');_0x2ec9ad['className']='comments-editor-placeholder',_0x2a1783['appendChild'](_0x2ec9ad);const _0xbc0c2b=document['createElement']('div');_0xbc0c2b['className']='comments-input-actions',_0xbc0c2b['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'](_0x2a1783),this['inputSection']['appendChild'](_0xbc0c2b),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x2ec9ad),this['submitBtn']=_0xbc0c2b['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0xbc0c2b['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x1a4dfb){const _0x1e40d3=document['createElement']('textarea');_0x1e40d3['placeholder']='Add\x20a\x20comment...',_0x1e40d3['className']='comments-textarea',_0x1a4dfb['appendChild'](_0x1e40d3);const _0x49362a=window['MarkdownEditor'];if(!_0x49362a){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x4628f2={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x5e9057=>{const _0x142255=_0x5e9057&&_0x5e9057['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x142255;},'fetchUsers':async()=>{const _0x4928d0=this['options']['getAPI']();return _0x4928d0['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x4628f2['onAddAttachments']=_0x266685=>{this['pendingAttachments']['push'](..._0x266685),this['submitBtn']['disabled']=![];},_0x4628f2['resolveAttachmentUrl']=_0x4ff25e=>{const _0xb504c7=this['options']['getAPI']();return _0xb504c7['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x4ff25e);},_0x4628f2['isAttachmentNameTaken']=_0x2ae39f=>{return this['pendingAttachments']['some'](_0x39c370=>_0x39c370['name']===_0x2ae39f)||this['existingAttachments']['some'](_0x492ce6=>_0x492ce6['name']===_0x2ae39f);});this['editor']=new _0x49362a(_0x1e40d3,_0x4628f2);const _0x452d95=this['editor']['editor'],_0x325ce8=this['editor']['toolbar'];_0x325ce8&&(_0x325ce8['classList']['add']('comments-toolbar-hidden'),_0x452d95['addEventListener']('focus',()=>{_0x325ce8['classList']['remove']('comments-toolbar-hidden');}),_0x452d95['addEventListener']('blur',_0xbbc898=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x325ce8['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x325ce8['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0xc87ef2=this['header']['querySelector']('.comments-chevron');_0xc87ef2&&(_0xc87ef2['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x41bc75){this['options']['taskId']=_0x41bc75,this['comments']=[],this['renderComments'](),_0x41bc75&&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 _0xa5fb5c=this['options']['getAPI'](),_0xb707ec=await _0xa5fb5c['getComments'](this['options']['taskId']);this['comments']=_0xb707ec['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x34fb00){console['error']('Failed\x20to\x20load\x20comments:',_0x34fb00),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'](_0x208287=>{const _0x350088=this['createCommentElement'](_0x208287);this['commentsList']['appendChild'](_0x350088);});}['createCommentElement'](_0x241424){const _0x5a7c05=document['createElement']('div');_0x5a7c05['className']='comment-item',_0x5a7c05['dataset']['commentId']=_0x241424['id'];const _0x444190=this['options']['currentUserId']&&_0x241424['author']?.['userId']===this['options']['currentUserId'],_0xbb7bb3=this['formatDate'](_0x241424['createdAt']),_0x2f09b7=_0x241424['updatedAt']!==_0x241424['createdAt'],_0x406e3d=this['resolveAttachmentUrls'](_0x241424['content']);let _0x2b4db0=window['marked']?window['marked']['parse'](_0x406e3d):_0x406e3d;_0x2b4db0=this['renderMentions'](_0x2b4db0),_0x5a7c05['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'](_0x241424['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x241424['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0xbb7bb3+(_0x2f09b7?'\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'+(_0x444190?'\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>'+_0x2b4db0+'</div>\x0a\x20\x20\x20\x20';if(_0x444190){const _0x59a0c6=_0x5a7c05['querySelector']('.comment-edit-btn'),_0x260856=_0x5a7c05['querySelector']('.comment-delete-btn');_0x59a0c6?.['addEventListener']('click',()=>this['startEdit'](_0x241424)),_0x260856?.['addEventListener']('click',()=>this['deleteComment'](_0x241424['id']));}return _0x5a7c05;}['formatDate'](_0x3fa594){const _0x5697e5=new Date(_0x3fa594),_0x506fca=new Date(),_0x2eab3e=_0x506fca-_0x5697e5,_0x593154=Math['floor'](_0x2eab3e/0xea60),_0x596060=Math['floor'](_0x2eab3e/0x36ee80),_0x4acaa6=Math['floor'](_0x2eab3e/0x5265c00);if(_0x593154<0x1)return'just\x20now';if(_0x593154<0x3c)return _0x593154+'m\x20ago';if(_0x596060<0x18)return _0x596060+'h\x20ago';if(_0x4acaa6<0x7)return _0x4acaa6+'d\x20ago';return _0x5697e5['toLocaleDateString']();}['escapeHtml'](_0x3b8012){const _0x5d9b70=document['createElement']('div');return _0x5d9b70['textContent']=_0x3b8012,_0x5d9b70['innerHTML'];}['resolveAttachmentUrls'](_0xbdbf9a){if(!_0xbdbf9a||!this['options']['taskId'])return _0xbdbf9a;const _0x4fff4b=this['options']['getAPI'](),_0x1998b0=_0x4fff4b['getBaseUrl']();let _0x15ed82=String(_0xbdbf9a)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x4d85be,_0x33d367)=>{const _0x1a2f10=String(_0x33d367||'')['trim']();if(!_0x1a2f10)return _0x4d85be;let _0x4e2860=_0x1a2f10;try{_0x4e2860=decodeURIComponent(_0x1a2f10);}catch{}return']('+_0x1998b0+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x4e2860)+')';});return _0x15ed82;}['renderMentions'](_0x5a806f){if(!_0x5a806f)return _0x5a806f;return String(_0x5a806f)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x1d96a0,_0x57f15e,_0x50ecd4)=>{const _0x4c147f=this['escapeHtml'](_0x50ecd4),_0x39c66a=this['escapeHtml'](_0x57f15e);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x39c66a+'\x22>@'+_0x4c147f+'</span>';});}['startEdit'](_0x5dc479){this['editingCommentId']=_0x5dc479['id'],this['editor']['setValue'](_0x5dc479['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 _0x1bbe86=this['editor']['getValue']()?.['trim']();if(!_0x1bbe86&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x154f04=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x154f04['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x38d4d8=>({'name':_0x38d4d8['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0xa4918d=await _0x154f04['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x1bbe86),_0x2e7e20=this['comments']['findIndex'](_0x5ed65b=>_0x5ed65b['id']===this['editingCommentId']);_0x2e7e20!==-0x1&&(this['comments'][_0x2e7e20]=_0xa4918d['comment']);}else{const _0x332942=await _0x154f04['addComment'](this['options']['taskId'],_0x1bbe86);this['comments']['push'](_0x332942['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x538472){console['error']('Failed\x20to\x20save\x20comment:',_0x538472),alert('Failed\x20to\x20save\x20comment:\x20'+_0x538472['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x3b6561){const _0x579d2d=await this['showDeleteConfirmModal']();if(!_0x579d2d)return;try{const _0x5853a9=this['options']['getAPI']();await _0x5853a9['deleteComment'](this['options']['taskId'],_0x3b6561),this['comments']=this['comments']['filter'](_0x290395=>_0x290395['id']!==_0x3b6561),this['renderComments'](),this['updateCount']();}catch(_0x302510){console['error']('Failed\x20to\x20delete\x20comment:',_0x302510),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x302510['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x51692f=>{const _0x110ae0=document['createElement']('div');_0x110ae0['className']='comments-confirm-modal',_0x110ae0['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'](_0x110ae0);const _0x1caed8=_0x2e7c29=>{document['removeEventListener']('keydown',_0x15a087),_0x110ae0['remove'](),_0x51692f(_0x2e7c29);},_0x15a087=_0x11d79e=>{if(_0x11d79e['key']==='Escape')_0x1caed8(![]);};document['addEventListener']('keydown',_0x15a087),_0x110ae0['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x1caed8(![])),_0x110ae0['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x1caed8(![])),_0x110ae0['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x1caed8(![])),_0x110ae0['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x1caed8(!![])),_0x110ae0['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x135e96){this['submitBtn']['disabled']=_0x135e96,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x135e96,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x135e96;}['updateCount'](){const _0x1e8570=this['comments']['length'],_0x553a02=this['container']['querySelector']('#comments-count-badge');_0x553a02&&(_0x553a02['textContent']=_0x1e8570,_0x553a02['hidden']=_0x1e8570===0x0);const _0x2f1836=this['container']['querySelector']('#comments-count');_0x2f1836&&(_0x2f1836['textContent']=_0x1e8570>0x0?'('+_0x1e8570+')':''),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(_0xad2bfc){const _0x16b4af=[],_0x4ee658=_0xad2bfc['split']('\x0a');let _0x34f259=null,_0x4c72a9=null;for(const _0x25ad7e of _0x4ee658){if(_0x25ad7e['startsWith']('diff\x20--git')){_0x34f259&&_0x4c72a9&&_0x34f259['hunks']['push'](_0x4c72a9);_0x34f259&&_0x16b4af['push'](_0x34f259);const _0x465113=_0x25ad7e['match'](/diff --git a\/(.+?) b\/(.+)/);_0x34f259={'oldPath':_0x465113?_0x465113[0x1]:'','newPath':_0x465113?_0x465113[0x2]:'','hunks':[],'isDeleted':![]},_0x4c72a9=null;}else{if(_0x25ad7e['startsWith']('deleted\x20file\x20mode')&&_0x34f259)_0x34f259['isDeleted']=!![];else{if(_0x25ad7e['startsWith']('@@'))_0x4c72a9&&_0x34f259&&_0x34f259['hunks']['push'](_0x4c72a9),_0x4c72a9={'header':_0x25ad7e,'lines':[]};else _0x4c72a9&&_0x4c72a9['lines']['push'](_0x25ad7e);}}}return _0x34f259&&_0x4c72a9&&_0x34f259['hunks']['push'](_0x4c72a9),_0x34f259&&_0x16b4af['push'](_0x34f259),_0x16b4af;}export function parseHunkHeader(_0x1eb7b3){const _0x6f01ba=_0x1eb7b3['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x6f01ba)return{'oldStart':parseInt(_0x6f01ba[0x1],0xa),'newStart':parseInt(_0x6f01ba[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x574d9e,_0x258226){const _0x493343=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x493343&&_0x258226)try{const _0x4566d9=_0x493343['getLanguage'](_0x258226)?_0x258226:null;if(_0x4566d9)return _0x493343['highlight'](_0x574d9e,{'language':_0x4566d9})['value'];}catch(_0x156117){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x156117);}return Utils['escapeHtml'](_0x574d9e);}export function getFileLanguage(_0xb8c706){const _0x5ec915=_0xb8c706['split']('.')['pop']()['toLowerCase'](),_0x41ca10={'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 _0x41ca10[_0x5ec915]||null;}export function computeWordDiff(_0x23bed4,_0x407936){const _0x599e27=_0x345099=>{const _0x38678e=[];let _0x2eaaee='',_0x3ea5bd=![];for(let _0x14abf1=0x0;_0x14abf1<_0x345099['length'];_0x14abf1++){const _0xf6c02c=_0x345099[_0x14abf1],_0x298d56=/\s/['test'](_0xf6c02c);if(_0x2eaaee==='')_0x2eaaee=_0xf6c02c,_0x3ea5bd=_0x298d56;else _0x298d56===_0x3ea5bd?_0x2eaaee+=_0xf6c02c:(_0x38678e['push'](_0x2eaaee),_0x2eaaee=_0xf6c02c,_0x3ea5bd=_0x298d56);}return _0x2eaaee&&_0x38678e['push'](_0x2eaaee),_0x38678e;},_0x28b852=_0x599e27(_0x23bed4),_0x325274=_0x599e27(_0x407936),_0x315ff7=_0x28b852['length'],_0x1a4378=_0x325274['length'],_0x22848e=Array(_0x315ff7+0x1)['fill'](null)['map'](()=>Array(_0x1a4378+0x1)['fill'](0x0));for(let _0x26fdae=0x1;_0x26fdae<=_0x315ff7;_0x26fdae++){for(let _0x479588=0x1;_0x479588<=_0x1a4378;_0x479588++){_0x28b852[_0x26fdae-0x1]===_0x325274[_0x479588-0x1]?_0x22848e[_0x26fdae][_0x479588]=_0x22848e[_0x26fdae-0x1][_0x479588-0x1]+0x1:_0x22848e[_0x26fdae][_0x479588]=Math['max'](_0x22848e[_0x26fdae-0x1][_0x479588],_0x22848e[_0x26fdae][_0x479588-0x1]);}}const _0x39cd83={'old':[],'new':[]};let _0x1d0feb=_0x315ff7,_0x47f617=_0x1a4378;const _0x56ca56=[],_0x4f6fb9=[];while(_0x1d0feb>0x0||_0x47f617>0x0){if(_0x1d0feb>0x0&&_0x47f617>0x0&&_0x28b852[_0x1d0feb-0x1]===_0x325274[_0x47f617-0x1])_0x56ca56['unshift']({'type':'equal','text':_0x28b852[_0x1d0feb-0x1]}),_0x4f6fb9['unshift']({'type':'equal','text':_0x325274[_0x47f617-0x1]}),_0x1d0feb--,_0x47f617--;else{if(_0x47f617>0x0&&(_0x1d0feb===0x0||_0x22848e[_0x1d0feb][_0x47f617-0x1]>=_0x22848e[_0x1d0feb-0x1][_0x47f617]))_0x4f6fb9['unshift']({'type':'insert','text':_0x325274[_0x47f617-0x1]}),_0x47f617--;else _0x1d0feb>0x0&&(_0x56ca56['unshift']({'type':'delete','text':_0x28b852[_0x1d0feb-0x1]}),_0x1d0feb--);}}return _0x39cd83['old']=_0x56ca56,_0x39cd83['new']=_0x4f6fb9,_0x39cd83;}export function renderDiffLineWithWordHighlight(_0x4aa8f7,_0xe3a38f,_0x43808e,_0x49d2df){if(!_0xe3a38f||_0xe3a38f['length']===0x0)return highlightDiffLine(_0x4aa8f7,_0x49d2df);let _0x38c952='';const _0x330f7f=_0x43808e==='add'?'diff-word-add':'diff-word-remove',_0x3a889e=_0x43808e==='add'?'insert':'delete';for(const _0x4771ed of _0xe3a38f){const _0x17d41b=Utils['escapeHtml'](_0x4771ed['text']);_0x4771ed['type']===_0x3a889e?_0x38c952+='<span\x20class=\x22'+_0x330f7f+'\x22>'+_0x17d41b+'</span>':_0x38c952+=_0x17d41b;}return _0x38c952;}export function calculateDiffStats(_0xa46704){let _0x3028d7=0x0,_0x552ecd=0x0,_0x3d3856=0x0;return _0xa46704['forEach'](_0x448322=>{let _0x3d099d=0x0,_0x55858c=0x0;_0x448322['hunks']['forEach'](_0x436e74=>{_0x436e74['lines']['forEach'](_0xb95432=>{if(_0xb95432['startsWith']('+'))_0x3d099d+=0x1;else{if(_0xb95432['startsWith']('-'))_0x55858c+=0x1;}});}),(_0x3d099d+_0x55858c>0x0||_0x448322['isDeleted'])&&(_0x3d3856+=0x1),_0x3028d7+=_0x3d099d,_0x552ecd+=_0x55858c;}),{'additions':_0x3028d7,'deletions':_0x552ecd,'files':_0x3d3856};}export function getFileStatus(_0x53918e,_0x437255,_0x45dbdd){if(_0x53918e['isDeleted'])return'deleted';if(_0x437255>0x0&&_0x45dbdd===0x0)return'added';return'modified';}export function safeBase64(_0x57e551){try{return btoa(unescape(encodeURIComponent(_0x57e551)));}catch(_0xc873e8){return btoa(_0x57e551);}}export function getStorageKey(_0x520165,_0x201a7a){return _0x520165+'-'+safeBase64(_0x201a7a);}export function getCollapsedState(_0x3d5171,_0x4a3ec1){const _0x327976=localStorage['getItem'](getStorageKey(_0x3d5171,_0x4a3ec1));return _0x327976==='true';}export function renderUnifiedDiff(_0x22aebf,_0x5c2285){return _0x22aebf['map']((_0x467806,_0x427458)=>{const _0x3d7cfe=_0x467806['newPath']||_0x467806['oldPath']||'unknown',_0x26020e='diff-'+_0x5c2285+'-'+_0x427458,_0x4b0476=getFileLanguage(_0x3d7cfe),{additions:_0x182c9d,deletions:_0x5986f8}=calculateDiffStats([_0x467806]),_0x51dd9e=getCollapsedState(_0x5c2285,_0x3d7cfe),_0x431469=getFileStatus(_0x467806,_0x182c9d,_0x5986f8),_0x35f1db=_0x431469==='added'?'A':_0x431469==='deleted'?'D':'M',_0x4d7a9b=_0x467806['hunks']['map'](_0xe9f519=>{const {oldStart:_0x275294,newStart:_0x26ad43}=parseHunkHeader(_0xe9f519['header']);let _0x43f34a=_0x275294,_0x1892f8=_0x26ad43;const _0x1d622b=_0xe9f519['lines']['map'](_0x4bcb23=>({'line':_0x4bcb23,'type':_0x4bcb23['startsWith']('+')?'add':_0x4bcb23['startsWith']('-')?'remove':_0x4bcb23['startsWith']('\x5c')?'meta':'context'}));let _0x55258b=0x0;while(_0x55258b<_0x1d622b['length']){if(_0x1d622b[_0x55258b]['type']==='remove'){let _0x34b441=_0x55258b,_0x160be5=_0x55258b;while(_0x160be5<_0x1d622b['length']&&_0x1d622b[_0x160be5]['type']==='remove')_0x160be5++;let _0x42cb81=_0x160be5,_0x5dedc0=_0x42cb81;while(_0x5dedc0<_0x1d622b['length']&&_0x1d622b[_0x5dedc0]['type']==='add')_0x5dedc0++;const _0x3cd9c2=_0x160be5-_0x34b441,_0x3a5d2d=_0x5dedc0-_0x42cb81,_0x39e130=Math['min'](_0x3cd9c2,_0x3a5d2d);for(let _0x2e7fd6=0x0;_0x2e7fd6<_0x39e130;_0x2e7fd6++){const _0x12bad4=_0x1d622b[_0x34b441+_0x2e7fd6]['line']['substring'](0x1),_0x147f67=_0x1d622b[_0x42cb81+_0x2e7fd6]['line']['substring'](0x1),_0x44b47e=computeWordDiff(_0x12bad4,_0x147f67);_0x1d622b[_0x34b441+_0x2e7fd6]['wordDiff']=_0x44b47e['old'],_0x1d622b[_0x42cb81+_0x2e7fd6]['wordDiff']=_0x44b47e['new'];}_0x55258b=_0x5dedc0;}else _0x55258b++;}const _0x3f9051=_0x1d622b['map'](_0x5493b5=>{const _0x2dc474=_0x5493b5['line'];if(_0x2dc474['startsWith']('+')){const _0x56b64f=_0x2dc474['substring'](0x1),_0x2a94db=_0x5493b5['wordDiff']?renderDiffLineWithWordHighlight(_0x56b64f,_0x5493b5['wordDiff'],'add',_0x4b0476):highlightDiffLine(_0x56b64f,_0x4b0476),_0x524cdd='<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>'+_0x1892f8+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x2a94db+'</span></div>';return _0x1892f8+=0x1,_0x524cdd;}if(_0x2dc474['startsWith']('-')){const _0xf4283a=_0x2dc474['substring'](0x1),_0x5750b3=_0x5493b5['wordDiff']?renderDiffLineWithWordHighlight(_0xf4283a,_0x5493b5['wordDiff'],'remove',_0x4b0476):highlightDiffLine(_0xf4283a,_0x4b0476),_0x13b700='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x43f34a+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x5750b3+'</span></div>';return _0x43f34a+=0x1,_0x13b700;}if(_0x2dc474['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'](_0x2dc474)+'</span></div>';const _0x3ac1fd=_0x2dc474['startsWith']('\x20')?_0x2dc474['substring'](0x1):_0x2dc474,_0x1a495e=highlightDiffLine(_0x3ac1fd,_0x4b0476),_0xb7a0f1='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x43f34a+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x1892f8+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x1a495e+'</span></div>';return _0x43f34a+=0x1,_0x1892f8+=0x1,_0xb7a0f1;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0xe9f519['header'])+'</div>'+_0x3f9051+'</div>';})['join'](''),_0x5888c5=_0x4d7a9b||'<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-'+_0x26020e+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x26020e+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x3d7cfe)+'\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'+_0x431469+'\x22>'+_0x35f1db+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x3d7cfe)+'</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>+'+_0x182c9d+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x5986f8+'</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'+_0x26020e+'\x22\x20data-collapsed=\x22'+_0x51dd9e+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x51dd9e?'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'+(_0x51dd9e?'collapsed':'')+'\x22\x20id=\x22'+_0x26020e+'\x22>'+_0x5888c5+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
1
|
+
import{Utils}from'./app.js';export function parsePatchContent(_0x31b005){const _0x2f9d74=[],_0x51f138=_0x31b005['split']('\x0a');let _0x2a0147=null,_0x558572=null;for(const _0x5b5d00 of _0x51f138){if(_0x5b5d00['startsWith']('diff\x20--git')){_0x2a0147&&_0x558572&&_0x2a0147['hunks']['push'](_0x558572);_0x2a0147&&_0x2f9d74['push'](_0x2a0147);const _0x10c04d=_0x5b5d00['match'](/diff --git a\/(.+?) b\/(.+)/);_0x2a0147={'oldPath':_0x10c04d?_0x10c04d[0x1]:'','newPath':_0x10c04d?_0x10c04d[0x2]:'','hunks':[],'isDeleted':![]},_0x558572=null;}else{if(_0x5b5d00['startsWith']('deleted\x20file\x20mode')&&_0x2a0147)_0x2a0147['isDeleted']=!![];else{if(_0x5b5d00['startsWith']('@@'))_0x558572&&_0x2a0147&&_0x2a0147['hunks']['push'](_0x558572),_0x558572={'header':_0x5b5d00,'lines':[]};else _0x558572&&_0x558572['lines']['push'](_0x5b5d00);}}}return _0x2a0147&&_0x558572&&_0x2a0147['hunks']['push'](_0x558572),_0x2a0147&&_0x2f9d74['push'](_0x2a0147),_0x2f9d74;}export function parseHunkHeader(_0x462b76){const _0x3b8fa7=_0x462b76['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x3b8fa7)return{'oldStart':parseInt(_0x3b8fa7[0x1],0xa),'newStart':parseInt(_0x3b8fa7[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x26586d,_0x426f7d){const _0x513d0e=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x513d0e&&_0x426f7d)try{const _0x519151=_0x513d0e['getLanguage'](_0x426f7d)?_0x426f7d:null;if(_0x519151)return _0x513d0e['highlight'](_0x26586d,{'language':_0x519151})['value'];}catch(_0x12379c){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x12379c);}return Utils['escapeHtml'](_0x26586d);}export function getFileLanguage(_0x23323b){const _0x2a6c25=_0x23323b['split']('.')['pop']()['toLowerCase'](),_0x18b772={'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 _0x18b772[_0x2a6c25]||null;}export function computeWordDiff(_0x3d4d83,_0x247441){const _0xfba2ec=_0x3d2f25=>{const _0x4a35d0=[];let _0x390650='',_0x5535fb=![];for(let _0xf6f6d4=0x0;_0xf6f6d4<_0x3d2f25['length'];_0xf6f6d4++){const _0x16ed33=_0x3d2f25[_0xf6f6d4],_0x169280=/\s/['test'](_0x16ed33);if(_0x390650==='')_0x390650=_0x16ed33,_0x5535fb=_0x169280;else _0x169280===_0x5535fb?_0x390650+=_0x16ed33:(_0x4a35d0['push'](_0x390650),_0x390650=_0x16ed33,_0x5535fb=_0x169280);}return _0x390650&&_0x4a35d0['push'](_0x390650),_0x4a35d0;},_0x2b117a=_0xfba2ec(_0x3d4d83),_0x26e408=_0xfba2ec(_0x247441),_0x4461d0=_0x2b117a['length'],_0x4702c5=_0x26e408['length'],_0x592de0=Array(_0x4461d0+0x1)['fill'](null)['map'](()=>Array(_0x4702c5+0x1)['fill'](0x0));for(let _0x1fe8b4=0x1;_0x1fe8b4<=_0x4461d0;_0x1fe8b4++){for(let _0x1f4bea=0x1;_0x1f4bea<=_0x4702c5;_0x1f4bea++){_0x2b117a[_0x1fe8b4-0x1]===_0x26e408[_0x1f4bea-0x1]?_0x592de0[_0x1fe8b4][_0x1f4bea]=_0x592de0[_0x1fe8b4-0x1][_0x1f4bea-0x1]+0x1:_0x592de0[_0x1fe8b4][_0x1f4bea]=Math['max'](_0x592de0[_0x1fe8b4-0x1][_0x1f4bea],_0x592de0[_0x1fe8b4][_0x1f4bea-0x1]);}}const _0x2c3c3e={'old':[],'new':[]};let _0x323f46=_0x4461d0,_0x49612c=_0x4702c5;const _0x18b544=[],_0x26578c=[];while(_0x323f46>0x0||_0x49612c>0x0){if(_0x323f46>0x0&&_0x49612c>0x0&&_0x2b117a[_0x323f46-0x1]===_0x26e408[_0x49612c-0x1])_0x18b544['unshift']({'type':'equal','text':_0x2b117a[_0x323f46-0x1]}),_0x26578c['unshift']({'type':'equal','text':_0x26e408[_0x49612c-0x1]}),_0x323f46--,_0x49612c--;else{if(_0x49612c>0x0&&(_0x323f46===0x0||_0x592de0[_0x323f46][_0x49612c-0x1]>=_0x592de0[_0x323f46-0x1][_0x49612c]))_0x26578c['unshift']({'type':'insert','text':_0x26e408[_0x49612c-0x1]}),_0x49612c--;else _0x323f46>0x0&&(_0x18b544['unshift']({'type':'delete','text':_0x2b117a[_0x323f46-0x1]}),_0x323f46--);}}return _0x2c3c3e['old']=_0x18b544,_0x2c3c3e['new']=_0x26578c,_0x2c3c3e;}export function renderDiffLineWithWordHighlight(_0x238e18,_0x4490d5,_0x2009c7,_0x5deed1){if(!_0x4490d5||_0x4490d5['length']===0x0)return highlightDiffLine(_0x238e18,_0x5deed1);let _0x576f6e='';const _0x455296=_0x2009c7==='add'?'diff-word-add':'diff-word-remove',_0x4a26d5=_0x2009c7==='add'?'insert':'delete';for(const _0x1b9c22 of _0x4490d5){const _0x1ef294=Utils['escapeHtml'](_0x1b9c22['text']);_0x1b9c22['type']===_0x4a26d5?_0x576f6e+='<span\x20class=\x22'+_0x455296+'\x22>'+_0x1ef294+'</span>':_0x576f6e+=_0x1ef294;}return _0x576f6e;}export function calculateDiffStats(_0x8bdf1c){let _0x356f11=0x0,_0x13727c=0x0,_0xdea4c8=0x0;return _0x8bdf1c['forEach'](_0x4f111f=>{let _0xdb27c6=0x0,_0x4c518e=0x0;_0x4f111f['hunks']['forEach'](_0x2f9cac=>{_0x2f9cac['lines']['forEach'](_0x5b234b=>{if(_0x5b234b['startsWith']('+'))_0xdb27c6+=0x1;else{if(_0x5b234b['startsWith']('-'))_0x4c518e+=0x1;}});}),(_0xdb27c6+_0x4c518e>0x0||_0x4f111f['isDeleted'])&&(_0xdea4c8+=0x1),_0x356f11+=_0xdb27c6,_0x13727c+=_0x4c518e;}),{'additions':_0x356f11,'deletions':_0x13727c,'files':_0xdea4c8};}export function getFileStatus(_0x49c978,_0x7a501a,_0x3b2191){if(_0x49c978['isDeleted'])return'deleted';if(_0x7a501a>0x0&&_0x3b2191===0x0)return'added';return'modified';}export function safeBase64(_0x197cf9){try{return btoa(unescape(encodeURIComponent(_0x197cf9)));}catch(_0xdebf49){return btoa(_0x197cf9);}}export function getStorageKey(_0x204af9,_0x54f1b7){return _0x204af9+'-'+safeBase64(_0x54f1b7);}export function getCollapsedState(_0x2fb978,_0x4259c6){const _0x19b28c=localStorage['getItem'](getStorageKey(_0x2fb978,_0x4259c6));return _0x19b28c==='true';}export function renderUnifiedDiff(_0x335087,_0x59b16e){return _0x335087['map']((_0x42b271,_0x46087a)=>{const _0x4e1946=_0x42b271['newPath']||_0x42b271['oldPath']||'unknown',_0xe9d8da='diff-'+_0x59b16e+'-'+_0x46087a,_0x449788=getFileLanguage(_0x4e1946),{additions:_0x4819c8,deletions:_0x454ad3}=calculateDiffStats([_0x42b271]),_0x3c379e=getCollapsedState(_0x59b16e,_0x4e1946),_0x3b3931=getFileStatus(_0x42b271,_0x4819c8,_0x454ad3),_0x578182=_0x3b3931==='added'?'A':_0x3b3931==='deleted'?'D':'M',_0x316ee8=_0x42b271['hunks']['map'](_0x5dec1f=>{const {oldStart:_0x20bf73,newStart:_0x3a7d39}=parseHunkHeader(_0x5dec1f['header']);let _0x35b509=_0x20bf73,_0xb98b47=_0x3a7d39;const _0x1b8ccb=_0x5dec1f['lines']['map'](_0x3bcb0b=>({'line':_0x3bcb0b,'type':_0x3bcb0b['startsWith']('+')?'add':_0x3bcb0b['startsWith']('-')?'remove':_0x3bcb0b['startsWith']('\x5c')?'meta':'context'}));let _0xa22516=0x0;while(_0xa22516<_0x1b8ccb['length']){if(_0x1b8ccb[_0xa22516]['type']==='remove'){let _0x24e247=_0xa22516,_0x4240c7=_0xa22516;while(_0x4240c7<_0x1b8ccb['length']&&_0x1b8ccb[_0x4240c7]['type']==='remove')_0x4240c7++;let _0x5566bf=_0x4240c7,_0x375cba=_0x5566bf;while(_0x375cba<_0x1b8ccb['length']&&_0x1b8ccb[_0x375cba]['type']==='add')_0x375cba++;const _0x5b8e31=_0x4240c7-_0x24e247,_0x3d92b1=_0x375cba-_0x5566bf,_0x140139=Math['min'](_0x5b8e31,_0x3d92b1);for(let _0x2a5b34=0x0;_0x2a5b34<_0x140139;_0x2a5b34++){const _0x5041d6=_0x1b8ccb[_0x24e247+_0x2a5b34]['line']['substring'](0x1),_0xa44c19=_0x1b8ccb[_0x5566bf+_0x2a5b34]['line']['substring'](0x1),_0x3563fb=computeWordDiff(_0x5041d6,_0xa44c19);_0x1b8ccb[_0x24e247+_0x2a5b34]['wordDiff']=_0x3563fb['old'],_0x1b8ccb[_0x5566bf+_0x2a5b34]['wordDiff']=_0x3563fb['new'];}_0xa22516=_0x375cba;}else _0xa22516++;}const _0x8a35f5=_0x1b8ccb['map'](_0x11d47c=>{const _0x286996=_0x11d47c['line'];if(_0x286996['startsWith']('+')){const _0xedebea=_0x286996['substring'](0x1),_0x455bda=_0x11d47c['wordDiff']?renderDiffLineWithWordHighlight(_0xedebea,_0x11d47c['wordDiff'],'add',_0x449788):highlightDiffLine(_0xedebea,_0x449788),_0x26346d='<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>'+_0xb98b47+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x455bda+'</span></div>';return _0xb98b47+=0x1,_0x26346d;}if(_0x286996['startsWith']('-')){const _0x5576a4=_0x286996['substring'](0x1),_0x1dbfa2=_0x11d47c['wordDiff']?renderDiffLineWithWordHighlight(_0x5576a4,_0x11d47c['wordDiff'],'remove',_0x449788):highlightDiffLine(_0x5576a4,_0x449788),_0x117513='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x35b509+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x1dbfa2+'</span></div>';return _0x35b509+=0x1,_0x117513;}if(_0x286996['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'](_0x286996)+'</span></div>';const _0x9dc6e8=_0x286996['startsWith']('\x20')?_0x286996['substring'](0x1):_0x286996,_0x479923=highlightDiffLine(_0x9dc6e8,_0x449788),_0x58845e='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x35b509+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0xb98b47+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x479923+'</span></div>';return _0x35b509+=0x1,_0xb98b47+=0x1,_0x58845e;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x5dec1f['header'])+'</div>'+_0x8a35f5+'</div>';})['join'](''),_0x318928=_0x316ee8||'<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-'+_0xe9d8da+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0xe9d8da+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x4e1946)+'\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'+_0x3b3931+'\x22>'+_0x578182+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x4e1946)+'</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>+'+_0x4819c8+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x454ad3+'</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'+_0xe9d8da+'\x22\x20data-collapsed=\x22'+_0x3c379e+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x3c379e?'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'+(_0x3c379e?'collapsed':'')+'\x22\x20id=\x22'+_0xe9d8da+'\x22>'+_0x318928+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|