asta-ui 0.9.9 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/asta.css +2 -2
- package/css/asta.js +2693 -1
- package/css/components.css +3467 -5
- package/css/runtime/saas.css +333 -0
- package/css/runtime/saas.js +2690 -0
- package/css/src/core.css +5 -5
- package/css/src/saas.css +3162 -0
- package/css/tokens.css +27 -0
- package/dist/accordion-aui-143.d.ts +2 -0
- package/dist/accordion-aui-143.js +10 -0
- package/dist/accordion-aui-144.d.ts +2 -0
- package/dist/accordion-aui-144.js +10 -0
- package/dist/agent-plan-aui-197.d.ts +2 -0
- package/dist/agent-plan-aui-197.js +10 -0
- package/dist/agent-plan-aui-198.d.ts +2 -0
- package/dist/agent-plan-aui-198.js +10 -0
- package/dist/ai-chat-aui-215.d.ts +2 -0
- package/dist/ai-chat-aui-215.js +10 -0
- package/dist/ai-chat-aui-216.d.ts +2 -0
- package/dist/ai-chat-aui-216.js +9 -0
- package/dist/alert-aui-107.d.ts +2 -0
- package/dist/alert-aui-107.js +9 -0
- package/dist/alert-aui-108.d.ts +2 -0
- package/dist/alert-aui-108.js +9 -0
- package/dist/announcement-bar-aui-181.d.ts +2 -0
- package/dist/announcement-bar-aui-181.js +10 -0
- package/dist/announcement-bar-aui-182.d.ts +2 -0
- package/dist/announcement-bar-aui-182.js +10 -0
- package/dist/api-keys-aui-241.d.ts +2 -0
- package/dist/api-keys-aui-241.js +10 -0
- package/dist/api-keys-aui-242.d.ts +2 -0
- package/dist/api-keys-aui-242.js +9 -0
- package/dist/audit-log-aui-071.d.ts +2 -0
- package/dist/audit-log-aui-071.js +9 -0
- package/dist/audit-log-aui-072.d.ts +2 -0
- package/dist/audit-log-aui-072.js +10 -0
- package/dist/audit-log.d.ts +2 -0
- package/dist/audit-log.js +13 -0
- package/dist/avatar-aui-093.d.ts +2 -0
- package/dist/avatar-aui-093.js +10 -0
- package/dist/avatar-aui-094.d.ts +2 -0
- package/dist/avatar-aui-094.js +9 -0
- package/dist/avatar-group-aui-121.d.ts +2 -0
- package/dist/avatar-group-aui-121.js +10 -0
- package/dist/avatar-group-aui-122.d.ts +2 -0
- package/dist/avatar-group-aui-122.js +11 -0
- package/dist/badge-aui-091.d.ts +2 -0
- package/dist/badge-aui-091.js +11 -0
- package/dist/badge-aui-092.d.ts +2 -0
- package/dist/badge-aui-092.js +9 -0
- package/dist/base/accordion-aui-143.d.ts +2 -0
- package/dist/base/accordion-aui-143.js +10 -0
- package/dist/base/accordion-aui-144.d.ts +2 -0
- package/dist/base/accordion-aui-144.js +10 -0
- package/dist/base/agent-plan-aui-197.d.ts +2 -0
- package/dist/base/agent-plan-aui-197.js +10 -0
- package/dist/base/agent-plan-aui-198.d.ts +2 -0
- package/dist/base/agent-plan-aui-198.js +10 -0
- package/dist/base/ai-chat-aui-215.d.ts +2 -0
- package/dist/base/ai-chat-aui-215.js +10 -0
- package/dist/base/ai-chat-aui-216.d.ts +2 -0
- package/dist/base/ai-chat-aui-216.js +9 -0
- package/dist/base/alert-aui-107.d.ts +2 -0
- package/dist/base/alert-aui-107.js +9 -0
- package/dist/base/alert-aui-108.d.ts +2 -0
- package/dist/base/alert-aui-108.js +9 -0
- package/dist/base/announcement-bar-aui-181.d.ts +2 -0
- package/dist/base/announcement-bar-aui-181.js +10 -0
- package/dist/base/announcement-bar-aui-182.d.ts +2 -0
- package/dist/base/announcement-bar-aui-182.js +10 -0
- package/dist/base/api-keys-aui-241.d.ts +2 -0
- package/dist/base/api-keys-aui-241.js +10 -0
- package/dist/base/api-keys-aui-242.d.ts +2 -0
- package/dist/base/api-keys-aui-242.js +9 -0
- package/dist/base/audit-log-aui-071.d.ts +2 -0
- package/dist/base/audit-log-aui-071.js +9 -0
- package/dist/base/audit-log-aui-072.d.ts +2 -0
- package/dist/base/audit-log-aui-072.js +10 -0
- package/dist/base/audit-log.d.ts +2 -0
- package/dist/base/audit-log.js +13 -0
- package/dist/base/avatar-aui-093.d.ts +2 -0
- package/dist/base/avatar-aui-093.js +10 -0
- package/dist/base/avatar-aui-094.d.ts +2 -0
- package/dist/base/avatar-aui-094.js +9 -0
- package/dist/base/avatar-group-aui-121.d.ts +2 -0
- package/dist/base/avatar-group-aui-121.js +10 -0
- package/dist/base/avatar-group-aui-122.d.ts +2 -0
- package/dist/base/avatar-group-aui-122.js +11 -0
- package/dist/base/badge-aui-091.d.ts +2 -0
- package/dist/base/badge-aui-091.js +11 -0
- package/dist/base/badge-aui-092.d.ts +2 -0
- package/dist/base/badge-aui-092.js +9 -0
- package/dist/base/billing-aui-233.d.ts +2 -0
- package/dist/base/billing-aui-233.js +12 -0
- package/dist/base/billing-aui-234.d.ts +2 -0
- package/dist/base/billing-aui-234.js +10 -0
- package/dist/base/billing.js +2 -2
- package/dist/base/breadcrumb-aui-109.d.ts +2 -0
- package/dist/base/breadcrumb-aui-109.js +9 -0
- package/dist/base/breadcrumb-aui-110.d.ts +2 -0
- package/dist/base/breadcrumb-aui-110.js +10 -0
- package/dist/base/button.js +1 -1
- package/dist/base/cancel-flow-aui-087.d.ts +2 -0
- package/dist/base/cancel-flow-aui-087.js +10 -0
- package/dist/base/cancel-flow-aui-088.d.ts +2 -0
- package/dist/base/cancel-flow-aui-088.js +10 -0
- package/dist/base/cancel-flow.d.ts +2 -0
- package/dist/base/cancel-flow.js +9 -0
- package/dist/base/carousel-aui-161.d.ts +2 -0
- package/dist/base/carousel-aui-161.js +9 -0
- package/dist/base/carousel-aui-162.d.ts +2 -0
- package/dist/base/carousel-aui-162.js +9 -0
- package/dist/base/chart-card-aui-225.d.ts +2 -0
- package/dist/base/chart-card-aui-225.js +10 -0
- package/dist/base/chart-card-aui-226.d.ts +2 -0
- package/dist/base/chart-card-aui-226.js +9 -0
- package/dist/base/checkout-aui-219.d.ts +2 -0
- package/dist/base/checkout-aui-219.js +10 -0
- package/dist/base/checkout-aui-220.d.ts +2 -0
- package/dist/base/checkout-aui-220.js +10 -0
- package/dist/base/checkout.js +2 -2
- package/dist/base/citations-aui-193.d.ts +2 -0
- package/dist/base/citations-aui-193.js +10 -0
- package/dist/base/citations-aui-194.d.ts +2 -0
- package/dist/base/citations-aui-194.js +10 -0
- package/dist/base/color-picker-aui-119.d.ts +2 -0
- package/dist/base/color-picker-aui-119.js +13 -0
- package/dist/base/color-picker-aui-120.d.ts +2 -0
- package/dist/base/color-picker-aui-120.js +13 -0
- package/dist/base/command-palette-aui-201.d.ts +2 -0
- package/dist/base/command-palette-aui-201.js +9 -0
- package/dist/base/command-palette-aui-202.d.ts +2 -0
- package/dist/base/command-palette-aui-202.js +9 -0
- package/dist/base/comments-aui-213.d.ts +2 -0
- package/dist/base/comments-aui-213.js +10 -0
- package/dist/base/comments-aui-214.d.ts +2 -0
- package/dist/base/comments-aui-214.js +10 -0
- package/dist/base/comments.js +2 -2
- package/dist/base/context-menu-aui-167.d.ts +2 -0
- package/dist/base/context-menu-aui-167.js +9 -0
- package/dist/base/context-menu-aui-168.d.ts +2 -0
- package/dist/base/context-menu-aui-168.js +9 -0
- package/dist/base/context-meter-aui-131.d.ts +2 -0
- package/dist/base/context-meter-aui-131.js +10 -0
- package/dist/base/context-meter-aui-132.d.ts +2 -0
- package/dist/base/context-meter-aui-132.js +10 -0
- package/dist/base/cookie-consent-aui-189.d.ts +2 -0
- package/dist/base/cookie-consent-aui-189.js +10 -0
- package/dist/base/cookie-consent-aui-190.d.ts +2 -0
- package/dist/base/cookie-consent-aui-190.js +10 -0
- package/dist/base/cookie-consent.js +3 -3
- package/dist/base/copy-button-aui-113.d.ts +2 -0
- package/dist/base/copy-button-aui-113.js +10 -0
- package/dist/base/copy-button-aui-114.d.ts +2 -0
- package/dist/base/copy-button-aui-114.js +9 -0
- package/dist/base/countdown-aui-125.d.ts +2 -0
- package/dist/base/countdown-aui-125.js +10 -0
- package/dist/base/countdown-aui-126.d.ts +2 -0
- package/dist/base/countdown-aui-126.js +9 -0
- package/dist/base/data-table-aui-205.d.ts +2 -0
- package/dist/base/data-table-aui-205.js +10 -0
- package/dist/base/data-table-aui-206.d.ts +2 -0
- package/dist/base/data-table-aui-206.js +10 -0
- package/dist/base/dialog-aui-149.d.ts +2 -0
- package/dist/base/dialog-aui-149.js +10 -0
- package/dist/base/dialog-aui-150.d.ts +2 -0
- package/dist/base/dialog-aui-150.js +10 -0
- package/dist/base/drawer-aui-157.d.ts +2 -0
- package/dist/base/drawer-aui-157.js +9 -0
- package/dist/base/drawer-aui-158.d.ts +2 -0
- package/dist/base/drawer-aui-158.js +9 -0
- package/dist/base/dropdown-menu-aui-141.d.ts +2 -0
- package/dist/base/dropdown-menu-aui-141.js +9 -0
- package/dist/base/dropdown-menu-aui-142.d.ts +2 -0
- package/dist/base/dropdown-menu-aui-142.js +12 -0
- package/dist/base/dropdown-menu.js +2 -2
- package/dist/base/empty-state-aui-165.d.ts +2 -0
- package/dist/base/empty-state-aui-165.js +10 -0
- package/dist/base/empty-state-aui-166.d.ts +2 -0
- package/dist/base/empty-state-aui-166.js +10 -0
- package/dist/base/empty-state.js +2 -2
- package/dist/base/event-calendar-aui-217.d.ts +2 -0
- package/dist/base/event-calendar-aui-217.js +10 -0
- package/dist/base/event-calendar-aui-218.d.ts +2 -0
- package/dist/base/event-calendar-aui-218.js +9 -0
- package/dist/base/feature-flags-aui-079.d.ts +2 -0
- package/dist/base/feature-flags-aui-079.js +10 -0
- package/dist/base/feature-flags-aui-080.d.ts +2 -0
- package/dist/base/feature-flags-aui-080.js +10 -0
- package/dist/base/feature-flags.d.ts +2 -0
- package/dist/base/feature-flags.js +14 -0
- package/dist/base/field-aui-139.d.ts +2 -0
- package/dist/base/field-aui-139.js +9 -0
- package/dist/base/field-aui-140.d.ts +2 -0
- package/dist/base/field-aui-140.js +9 -0
- package/dist/base/file-card-aui-173.d.ts +2 -0
- package/dist/base/file-card-aui-173.js +10 -0
- package/dist/base/file-card-aui-174.d.ts +2 -0
- package/dist/base/file-card-aui-174.js +9 -0
- package/dist/base/file-manager-aui-231.d.ts +2 -0
- package/dist/base/file-manager-aui-231.js +10 -0
- package/dist/base/file-manager-aui-232.d.ts +2 -0
- package/dist/base/file-manager-aui-232.js +10 -0
- package/dist/base/file-manager.js +2 -2
- package/dist/base/file-upload-aui-153.d.ts +2 -0
- package/dist/base/file-upload-aui-153.js +10 -0
- package/dist/base/file-upload-aui-154.d.ts +2 -0
- package/dist/base/file-upload-aui-154.js +9 -0
- package/dist/base/footer.js +2 -2
- package/dist/base/hover-card-aui-169.d.ts +2 -0
- package/dist/base/hover-card-aui-169.js +9 -0
- package/dist/base/hover-card-aui-170.d.ts +2 -0
- package/dist/base/hover-card-aui-170.js +10 -0
- package/dist/base/image-compare-aui-179.d.ts +2 -0
- package/dist/base/image-compare-aui-179.js +10 -0
- package/dist/base/image-compare-aui-180.d.ts +2 -0
- package/dist/base/image-compare-aui-180.js +9 -0
- package/dist/base/inbox-aui-229.d.ts +2 -0
- package/dist/base/inbox-aui-229.js +10 -0
- package/dist/base/inbox-aui-230.d.ts +2 -0
- package/dist/base/inbox-aui-230.js +10 -0
- package/dist/base/inbox.js +2 -2
- package/dist/base/inline-edit-aui-123.d.ts +2 -0
- package/dist/base/inline-edit-aui-123.js +10 -0
- package/dist/base/inline-edit-aui-124.d.ts +2 -0
- package/dist/base/inline-edit-aui-124.js +10 -0
- package/dist/base/integrations-aui-081.d.ts +2 -0
- package/dist/base/integrations-aui-081.js +11 -0
- package/dist/base/integrations-aui-082.d.ts +2 -0
- package/dist/base/integrations-aui-082.js +11 -0
- package/dist/base/integrations.d.ts +2 -0
- package/dist/base/integrations.js +11 -0
- package/dist/base/invoice-aui-227.d.ts +2 -0
- package/dist/base/invoice-aui-227.js +10 -0
- package/dist/base/invoice-aui-228.d.ts +2 -0
- package/dist/base/invoice-aui-228.js +10 -0
- package/dist/base/invoice.js +2 -2
- package/dist/base/kanban-aui-209.d.ts +2 -0
- package/dist/base/kanban-aui-209.js +9 -0
- package/dist/base/kanban-aui-210.d.ts +2 -0
- package/dist/base/kanban-aui-210.js +10 -0
- package/dist/base/kbd-aui-095.d.ts +2 -0
- package/dist/base/kbd-aui-095.js +11 -0
- package/dist/base/kbd-aui-096.d.ts +2 -0
- package/dist/base/kbd-aui-096.js +11 -0
- package/dist/base/menubar-aui-183.d.ts +2 -0
- package/dist/base/menubar-aui-183.js +9 -0
- package/dist/base/menubar-aui-184.d.ts +2 -0
- package/dist/base/menubar-aui-184.js +9 -0
- package/dist/base/meter-aui-127.d.ts +2 -0
- package/dist/base/meter-aui-127.js +9 -0
- package/dist/base/meter-aui-128.d.ts +2 -0
- package/dist/base/meter-aui-128.js +9 -0
- package/dist/base/model-picker-aui-191.d.ts +2 -0
- package/dist/base/model-picker-aui-191.js +9 -0
- package/dist/base/model-picker-aui-192.d.ts +2 -0
- package/dist/base/model-picker-aui-192.js +9 -0
- package/dist/base/motion-button-aui-089.d.ts +2 -0
- package/dist/base/motion-button-aui-089.js +9 -0
- package/dist/base/motion-button-aui-090.d.ts +2 -0
- package/dist/base/motion-button-aui-090.js +9 -0
- package/dist/base/navbar.js +2 -2
- package/dist/base/notification-center-aui-223.d.ts +2 -0
- package/dist/base/notification-center-aui-223.js +10 -0
- package/dist/base/notification-center-aui-224.d.ts +2 -0
- package/dist/base/notification-center-aui-224.js +10 -0
- package/dist/base/number-input-aui-147.d.ts +2 -0
- package/dist/base/number-input-aui-147.js +9 -0
- package/dist/base/number-input-aui-148.d.ts +2 -0
- package/dist/base/number-input-aui-148.js +10 -0
- package/dist/base/onboarding-aui-211.d.ts +2 -0
- package/dist/base/onboarding-aui-211.js +9 -0
- package/dist/base/onboarding-aui-212.d.ts +2 -0
- package/dist/base/onboarding-aui-212.js +10 -0
- package/dist/base/onboarding.js +2 -2
- package/dist/base/pagination-aui-111.d.ts +2 -0
- package/dist/base/pagination-aui-111.js +10 -0
- package/dist/base/pagination-aui-112.d.ts +2 -0
- package/dist/base/pagination-aui-112.js +9 -0
- package/dist/base/phone-input-aui-185.d.ts +2 -0
- package/dist/base/phone-input-aui-185.js +11 -0
- package/dist/base/phone-input-aui-186.d.ts +2 -0
- package/dist/base/phone-input-aui-186.js +11 -0
- package/dist/base/popover-aui-155.d.ts +2 -0
- package/dist/base/popover-aui-155.js +10 -0
- package/dist/base/popover-aui-156.d.ts +2 -0
- package/dist/base/popover-aui-156.js +10 -0
- package/dist/base/pricing.js +2 -2
- package/dist/base/progress-aui-105.d.ts +2 -0
- package/dist/base/progress-aui-105.js +10 -0
- package/dist/base/progress-aui-106.d.ts +2 -0
- package/dist/base/progress-aui-106.js +10 -0
- package/dist/base/prompt-composer-aui-237.d.ts +2 -0
- package/dist/base/prompt-composer-aui-237.js +10 -0
- package/dist/base/prompt-composer-aui-238.d.ts +2 -0
- package/dist/base/prompt-composer-aui-238.js +10 -0
- package/dist/base/properties-panel-aui-199.d.ts +2 -0
- package/dist/base/properties-panel-aui-199.js +10 -0
- package/dist/base/properties-panel-aui-200.d.ts +2 -0
- package/dist/base/properties-panel-aui-200.js +9 -0
- package/dist/base/range-slider-aui-117.d.ts +2 -0
- package/dist/base/range-slider-aui-117.js +10 -0
- package/dist/base/range-slider-aui-118.d.ts +2 -0
- package/dist/base/range-slider-aui-118.js +9 -0
- package/dist/base/rating-aui-103.d.ts +2 -0
- package/dist/base/rating-aui-103.js +10 -0
- package/dist/base/rating-aui-104.d.ts +2 -0
- package/dist/base/rating-aui-104.js +10 -0
- package/dist/base/roles-permissions-aui-073.d.ts +2 -0
- package/dist/base/roles-permissions-aui-073.js +10 -0
- package/dist/base/roles-permissions-aui-074.d.ts +2 -0
- package/dist/base/roles-permissions-aui-074.js +10 -0
- package/dist/base/roles-permissions.d.ts +2 -0
- package/dist/base/roles-permissions.js +9 -0
- package/dist/base/scrub-input-aui-133.d.ts +2 -0
- package/dist/base/scrub-input-aui-133.js +9 -0
- package/dist/base/scrub-input-aui-134.d.ts +2 -0
- package/dist/base/scrub-input-aui-134.js +9 -0
- package/dist/base/security-settings-aui-075.d.ts +2 -0
- package/dist/base/security-settings-aui-075.js +10 -0
- package/dist/base/security-settings-aui-076.d.ts +2 -0
- package/dist/base/security-settings-aui-076.js +10 -0
- package/dist/base/security-settings.d.ts +2 -0
- package/dist/base/security-settings.js +10 -0
- package/dist/base/segmented-control-aui-135.d.ts +2 -0
- package/dist/base/segmented-control-aui-135.js +9 -0
- package/dist/base/segmented-control-aui-136.d.ts +2 -0
- package/dist/base/segmented-control-aui-136.js +9 -0
- package/dist/base/settings-panel-aui-203.d.ts +2 -0
- package/dist/base/settings-panel-aui-203.js +9 -0
- package/dist/base/settings-panel-aui-204.d.ts +2 -0
- package/dist/base/settings-panel-aui-204.js +10 -0
- package/dist/base/settings-panel.js +2 -2
- package/dist/base/sidebar-aui-207.d.ts +2 -0
- package/dist/base/sidebar-aui-207.js +9 -0
- package/dist/base/sidebar-aui-208.d.ts +2 -0
- package/dist/base/sidebar-aui-208.js +9 -0
- package/dist/base/sign-in.js +2 -2
- package/dist/base/skeleton-aui-101.d.ts +2 -0
- package/dist/base/skeleton-aui-101.js +10 -0
- package/dist/base/skeleton-aui-102.d.ts +2 -0
- package/dist/base/skeleton-aui-102.js +12 -0
- package/dist/base/sortable-list-aui-187.d.ts +2 -0
- package/dist/base/sortable-list-aui-187.js +9 -0
- package/dist/base/sortable-list-aui-188.d.ts +2 -0
- package/dist/base/sortable-list-aui-188.js +9 -0
- package/dist/base/spinner-aui-097.d.ts +2 -0
- package/dist/base/spinner-aui-097.js +9 -0
- package/dist/base/spinner-aui-098.d.ts +2 -0
- package/dist/base/spinner-aui-098.js +10 -0
- package/dist/base/stat-card-aui-163.d.ts +2 -0
- package/dist/base/stat-card-aui-163.js +10 -0
- package/dist/base/stat-card-aui-164.d.ts +2 -0
- package/dist/base/stat-card-aui-164.js +9 -0
- package/dist/base/status-page-aui-083.d.ts +2 -0
- package/dist/base/status-page-aui-083.js +10 -0
- package/dist/base/status-page-aui-084.d.ts +2 -0
- package/dist/base/status-page-aui-084.js +10 -0
- package/dist/base/status-page.d.ts +2 -0
- package/dist/base/status-page.js +10 -0
- package/dist/base/stepper-aui-151.d.ts +2 -0
- package/dist/base/stepper-aui-151.js +10 -0
- package/dist/base/stepper-aui-152.d.ts +2 -0
- package/dist/base/stepper-aui-152.js +10 -0
- package/dist/base/switch.js +1 -1
- package/dist/base/tabs-aui-137.d.ts +2 -0
- package/dist/base/tabs-aui-137.js +9 -0
- package/dist/base/tabs-aui-138.d.ts +2 -0
- package/dist/base/tabs-aui-138.js +10 -0
- package/dist/base/team-members-aui-221.d.ts +2 -0
- package/dist/base/team-members-aui-221.js +11 -0
- package/dist/base/team-members-aui-222.d.ts +2 -0
- package/dist/base/team-members-aui-222.js +10 -0
- package/dist/base/team-members.js +2 -2
- package/dist/base/testimonials-aui-235.d.ts +2 -0
- package/dist/base/testimonials-aui-235.js +10 -0
- package/dist/base/testimonials-aui-236.d.ts +2 -0
- package/dist/base/testimonials-aui-236.js +10 -0
- package/dist/base/thinking-aui-129.d.ts +2 -0
- package/dist/base/thinking-aui-129.js +10 -0
- package/dist/base/thinking-aui-130.d.ts +2 -0
- package/dist/base/thinking-aui-130.js +9 -0
- package/dist/base/timeline-aui-159.d.ts +2 -0
- package/dist/base/timeline-aui-159.js +11 -0
- package/dist/base/timeline-aui-160.d.ts +2 -0
- package/dist/base/timeline-aui-160.js +9 -0
- package/dist/base/toast-aui-145.d.ts +2 -0
- package/dist/base/toast-aui-145.js +9 -0
- package/dist/base/toast-aui-146.d.ts +2 -0
- package/dist/base/toast-aui-146.js +12 -0
- package/dist/base/toggle-group-aui-115.d.ts +2 -0
- package/dist/base/toggle-group-aui-115.js +11 -0
- package/dist/base/toggle-group-aui-116.d.ts +2 -0
- package/dist/base/toggle-group-aui-116.js +9 -0
- package/dist/base/tool-approval-aui-195.d.ts +2 -0
- package/dist/base/tool-approval-aui-195.js +10 -0
- package/dist/base/tool-approval-aui-196.d.ts +2 -0
- package/dist/base/tool-approval-aui-196.js +10 -0
- package/dist/base/tool-dock-aui-177.d.ts +2 -0
- package/dist/base/tool-dock-aui-177.js +9 -0
- package/dist/base/tool-dock-aui-178.d.ts +2 -0
- package/dist/base/tool-dock-aui-178.js +10 -0
- package/dist/base/tooltip-aui-099.d.ts +2 -0
- package/dist/base/tooltip-aui-099.js +9 -0
- package/dist/base/tooltip-aui-100.d.ts +2 -0
- package/dist/base/tooltip-aui-100.js +9 -0
- package/dist/base/trace-waterfall-aui-239.d.ts +2 -0
- package/dist/base/trace-waterfall-aui-239.js +9 -0
- package/dist/base/trace-waterfall-aui-240.d.ts +2 -0
- package/dist/base/trace-waterfall-aui-240.js +9 -0
- package/dist/base/tree-view-aui-171.d.ts +2 -0
- package/dist/base/tree-view-aui-171.js +9 -0
- package/dist/base/tree-view-aui-172.d.ts +2 -0
- package/dist/base/tree-view-aui-172.js +10 -0
- package/dist/base/usage-overview-aui-069.d.ts +2 -0
- package/dist/base/usage-overview-aui-069.js +10 -0
- package/dist/base/usage-overview-aui-070.d.ts +2 -0
- package/dist/base/usage-overview-aui-070.js +10 -0
- package/dist/base/usage-overview.d.ts +2 -0
- package/dist/base/usage-overview.js +10 -0
- package/dist/base/webhooks-aui-077.d.ts +2 -0
- package/dist/base/webhooks-aui-077.js +10 -0
- package/dist/base/webhooks-aui-078.d.ts +2 -0
- package/dist/base/webhooks-aui-078.js +10 -0
- package/dist/base/webhooks.d.ts +2 -0
- package/dist/base/webhooks.js +10 -0
- package/dist/base/whats-new-aui-085.d.ts +2 -0
- package/dist/base/whats-new-aui-085.js +10 -0
- package/dist/base/whats-new-aui-086.d.ts +2 -0
- package/dist/base/whats-new-aui-086.js +9 -0
- package/dist/base/whats-new.d.ts +2 -0
- package/dist/base/whats-new.js +15 -0
- package/dist/base/workspace-switcher-aui-175.d.ts +2 -0
- package/dist/base/workspace-switcher-aui-175.js +9 -0
- package/dist/base/workspace-switcher-aui-176.d.ts +2 -0
- package/dist/base/workspace-switcher-aui-176.js +9 -0
- package/dist/base.js +1239 -125
- package/dist/billing-aui-233.d.ts +2 -0
- package/dist/billing-aui-233.js +12 -0
- package/dist/billing-aui-234.d.ts +2 -0
- package/dist/billing-aui-234.js +10 -0
- package/dist/billing.js +2 -2
- package/dist/breadcrumb-aui-109.d.ts +2 -0
- package/dist/breadcrumb-aui-109.js +9 -0
- package/dist/breadcrumb-aui-110.d.ts +2 -0
- package/dist/breadcrumb-aui-110.js +10 -0
- package/dist/button.js +1 -1
- package/dist/cancel-flow-aui-087.d.ts +2 -0
- package/dist/cancel-flow-aui-087.js +10 -0
- package/dist/cancel-flow-aui-088.d.ts +2 -0
- package/dist/cancel-flow-aui-088.js +10 -0
- package/dist/cancel-flow.d.ts +2 -0
- package/dist/cancel-flow.js +9 -0
- package/dist/carousel-aui-161.d.ts +2 -0
- package/dist/carousel-aui-161.js +9 -0
- package/dist/carousel-aui-162.d.ts +2 -0
- package/dist/carousel-aui-162.js +9 -0
- package/dist/chart-card-aui-225.d.ts +2 -0
- package/dist/chart-card-aui-225.js +10 -0
- package/dist/chart-card-aui-226.d.ts +2 -0
- package/dist/chart-card-aui-226.js +9 -0
- package/dist/checkout-aui-219.d.ts +2 -0
- package/dist/checkout-aui-219.js +10 -0
- package/dist/checkout-aui-220.d.ts +2 -0
- package/dist/checkout-aui-220.js +10 -0
- package/dist/checkout.js +2 -2
- package/dist/{chunk-5ZQ6PMJT.js → chunk-22ILG5VV.js} +2 -2
- package/dist/chunk-23EWWQ3Y.js +111 -0
- package/dist/chunk-2ETENLLY.js +156 -0
- package/dist/chunk-2KXQFWGS.js +269 -0
- package/dist/{chunk-B6KIW23F.js → chunk-2RUX5OTU.js} +1 -1
- package/dist/{chunk-BQL7HJSV.js → chunk-2U3WJCWO.js} +1 -1
- package/dist/chunk-32BY5RC4.js +330 -0
- package/dist/chunk-3D6SQU5R.js +115 -0
- package/dist/{chunk-KEPRNTOF.js → chunk-3F4MIHEK.js} +1 -1
- package/dist/chunk-3GEWK5XT.js +204 -0
- package/dist/chunk-3L7E3255.js +162 -0
- package/dist/chunk-3QHXG6FW.js +228 -0
- package/dist/chunk-3QXDPHRK.js +282 -0
- package/dist/chunk-3UGT5EYC.js +167 -0
- package/dist/chunk-3VRDAU5C.js +162 -0
- package/dist/chunk-3YAVOB4C.js +184 -0
- package/dist/chunk-44BVNT7X.js +237 -0
- package/dist/chunk-44LIMETZ.js +159 -0
- package/dist/chunk-46NYTVKS.js +195 -0
- package/dist/chunk-47HI4B6B.js +256 -0
- package/dist/chunk-4CNBG72C.js +256 -0
- package/dist/chunk-4FT4XE5E.js +190 -0
- package/dist/chunk-4RHHI2A6.js +155 -0
- package/dist/chunk-4TLYVD6I.js +155 -0
- package/dist/chunk-56MU4LQU.js +161 -0
- package/dist/chunk-5BHTODRR.js +151 -0
- package/dist/{chunk-E6HAVXWS.js → chunk-5CD5RMFF.js} +1 -1
- package/dist/chunk-5DKBUC4O.js +195 -0
- package/dist/chunk-5H7MWXN4.js +439 -0
- package/dist/chunk-5IKSMRNL.js +152 -0
- package/dist/chunk-5IN3XZ54.js +117 -0
- package/dist/chunk-5SRENDOL.js +149 -0
- package/dist/chunk-5ZPBPHMT.js +290 -0
- package/dist/chunk-62ZR5JFG.js +199 -0
- package/dist/chunk-6AKVEMGV.js +167 -0
- package/dist/chunk-6J4IRQNU.js +433 -0
- package/dist/chunk-6N6W2NNL.js +204 -0
- package/dist/chunk-6NW4NQX2.js +221 -0
- package/dist/chunk-6PYYSG6C.js +120 -0
- package/dist/chunk-6XQVFVVU.js +85 -0
- package/dist/chunk-6YSE5UDT.js +412 -0
- package/dist/chunk-75MJJVD4.js +276 -0
- package/dist/{chunk-3PSV752Q.js → chunk-7E5ZWVOH.js} +1 -1
- package/dist/chunk-7GCP7OO2.js +75 -0
- package/dist/chunk-7PUHEBP6.js +157 -0
- package/dist/chunk-7U7272IB.js +206 -0
- package/dist/{chunk-5EYHX66O.js → chunk-7YF3BCAH.js} +1 -1
- package/dist/chunk-A44L4WI5.js +164 -0
- package/dist/chunk-AKW6V2M3.js +161 -0
- package/dist/chunk-AOZ3CKBU.js +154 -0
- package/dist/chunk-AQIJYAZH.js +245 -0
- package/dist/chunk-AQQAJVBE.js +199 -0
- package/dist/chunk-B36BFGVY.js +195 -0
- package/dist/chunk-B5632XPB.js +118 -0
- package/dist/chunk-BIAK6K4Z.js +237 -0
- package/dist/chunk-BKM2BPNE.js +105 -0
- package/dist/chunk-BN3PQYDM.js +178 -0
- package/dist/{chunk-WYFRNK6S.js → chunk-BT7K6WI5.js} +1 -1
- package/dist/{chunk-Y5NPX36Y.js → chunk-BTSLCG3J.js} +1 -1
- package/dist/chunk-BV6EI7NZ.js +149 -0
- package/dist/chunk-CBBHTHUR.js +242 -0
- package/dist/chunk-CBTX2ZL3.js +162 -0
- package/dist/chunk-CDJELHJE.js +152 -0
- package/dist/chunk-CE6PESJJ.js +199 -0
- package/dist/chunk-CG4IXAMD.js +124 -0
- package/dist/chunk-CLWDJTFR.js +217 -0
- package/dist/chunk-COMZRBJG.js +204 -0
- package/dist/chunk-CT5JZRT6.js +203 -0
- package/dist/chunk-CUU4TM5K.js +182 -0
- package/dist/chunk-CXJLC4QP.js +173 -0
- package/dist/{chunk-IVTOFG7I.js → chunk-CYU52LAD.js} +1 -1
- package/dist/chunk-D2OJGMRI.js +216 -0
- package/dist/chunk-D3ZPZDDB.js +83 -0
- package/dist/chunk-D7E2L5T2.js +208 -0
- package/dist/chunk-DBS72N66.js +184 -0
- package/dist/chunk-DBXRVCJ7.js +182 -0
- package/dist/chunk-DNC3TKXG.js +276 -0
- package/dist/chunk-DPRLEWJV.js +116 -0
- package/dist/{chunk-LUDI3KWR.js → chunk-DQNJLPQZ.js} +1 -1
- package/dist/chunk-DTNSTD47.js +146 -0
- package/dist/{chunk-TCCKCLEZ.js → chunk-DUAMPG7T.js} +1 -1
- package/dist/{chunk-TXHOOVX7.js → chunk-E4ZM7ZFL.js} +1 -1
- package/dist/chunk-EARCNYPG.js +375 -0
- package/dist/chunk-EK264O5G.js +179 -0
- package/dist/chunk-EKRNT34P.js +433 -0
- package/dist/chunk-EMBSKPTF.js +256 -0
- package/dist/chunk-ETXJI76W.js +217 -0
- package/dist/chunk-EWZW4YYH.js +197 -0
- package/dist/chunk-F2CVYXSM.js +265 -0
- package/dist/chunk-F2P42M4R.js +75 -0
- package/dist/chunk-F3FSB237.js +151 -0
- package/dist/chunk-F6KQSAFI.js +147 -0
- package/dist/chunk-F7QDMSE7.js +212 -0
- package/dist/chunk-FD6L6QOY.js +206 -0
- package/dist/chunk-FDDGDWCQ.js +261 -0
- package/dist/chunk-FHASONL2.js +204 -0
- package/dist/chunk-FHKXLESU.js +152 -0
- package/dist/chunk-FK3LBC4N.js +290 -0
- package/dist/chunk-FQLR4R6E.js +105 -0
- package/dist/chunk-FT66OTRI.js +247 -0
- package/dist/chunk-G4CMTRRS.js +116 -0
- package/dist/chunk-GAV642LQ.js +95 -0
- package/dist/chunk-GFZ7HXS3.js +144 -0
- package/dist/chunk-GKJIPWDZ.js +98 -0
- package/dist/chunk-GL3CEPXZ.js +113 -0
- package/dist/chunk-GLY773XR.js +265 -0
- package/dist/chunk-GO3ML6CS.js +158 -0
- package/dist/chunk-GPYTCOA3.js +217 -0
- package/dist/chunk-GTEIG36P.js +177 -0
- package/dist/chunk-GTSJGBSX.js +200 -0
- package/dist/chunk-GWX4FIYE.js +176 -0
- package/dist/chunk-GXRC2WSE.js +149 -0
- package/dist/chunk-H3HZJTM4.js +149 -0
- package/dist/chunk-H3PQQL5R.js +162 -0
- package/dist/chunk-HDOUY5RX.js +152 -0
- package/dist/chunk-HFOFQBBA.js +364 -0
- package/dist/chunk-HG4AZIAT.js +195 -0
- package/dist/{chunk-Z3PHHGUZ.js → chunk-HGQK3XJB.js} +1 -1
- package/dist/{chunk-3QC5SYGC.js → chunk-HKNI3L5Q.js} +1 -1
- package/dist/chunk-HNCGN6RP.js +158 -0
- package/dist/{chunk-MUURQUEM.js → chunk-HON5QYW7.js} +1 -1
- package/dist/chunk-HP6I7ABB.js +178 -0
- package/dist/chunk-HVTUOECI.js +291 -0
- package/dist/chunk-HX7OA7HR.js +246 -0
- package/dist/chunk-HXAUSPRL.js +144 -0
- package/dist/chunk-HZZQOODR.js +218 -0
- package/dist/chunk-IAKX4RFT.js +159 -0
- package/dist/chunk-IB4Y3OQC.js +201 -0
- package/dist/chunk-IGBXOYXT.js +251 -0
- package/dist/chunk-IIDYNQDP.js +247 -0
- package/dist/chunk-ILC5BM5S.js +180 -0
- package/dist/chunk-IQOSUA7R.js +230 -0
- package/dist/chunk-IQPUUNU6.js +151 -0
- package/dist/{chunk-URXTC4RD.js → chunk-IS35SPLR.js} +1 -1
- package/dist/chunk-ISEEO32S.js +186 -0
- package/dist/chunk-ISZSSLFO.js +250 -0
- package/dist/chunk-IVFCLJ65.js +80 -0
- package/dist/chunk-IX3FPFWA.js +182 -0
- package/dist/chunk-J4GTA2QZ.js +276 -0
- package/dist/chunk-J6SBWSMV.js +201 -0
- package/dist/chunk-J72ITZHM.js +133 -0
- package/dist/chunk-JAPU5PZ3.js +210 -0
- package/dist/chunk-JAUWTCZA.js +247 -0
- package/dist/chunk-JCWKRHUF.js +187 -0
- package/dist/{chunk-3AJ4EBSV.js → chunk-JIQIQ7IZ.js} +1 -1
- package/dist/chunk-JJTEIYPY.js +121 -0
- package/dist/chunk-JLRCNJVP.js +269 -0
- package/dist/chunk-JPG2YUGA.js +241 -0
- package/dist/chunk-JPZLGCCT.js +206 -0
- package/dist/chunk-JSJA6CMO.js +228 -0
- package/dist/chunk-JTBYA3OH.js +162 -0
- package/dist/chunk-JVGAZEJC.js +276 -0
- package/dist/{chunk-GQZPSVLB.js → chunk-JZNZUL3S.js} +1 -1
- package/dist/chunk-K2II4HG2.js +174 -0
- package/dist/chunk-K2TX7OOF.js +156 -0
- package/dist/chunk-K5T7OEVV.js +174 -0
- package/dist/chunk-KGWP422P.js +98 -0
- package/dist/chunk-KIFZ4XYQ.js +108 -0
- package/dist/chunk-KJBPLUNL.js +192 -0
- package/dist/chunk-KLBYI6FG.js +193 -0
- package/dist/{chunk-XWQNDAL5.js → chunk-KMYHXVOF.js} +1 -1
- package/dist/chunk-KPERBVIP.js +185 -0
- package/dist/chunk-KSIPLRRO.js +154 -0
- package/dist/chunk-KTEU3EOJ.js +193 -0
- package/dist/chunk-KUN462PF.js +142 -0
- package/dist/{chunk-KKDIIZQG.js → chunk-KY6XHDJY.js} +1 -1
- package/dist/chunk-L26GEETE.js +132 -0
- package/dist/chunk-L7ANCVLW.js +210 -0
- package/dist/{chunk-JZJWB5CQ.js → chunk-LBUUCJQE.js} +1 -1
- package/dist/chunk-LE3NNINY.js +187 -0
- package/dist/chunk-LL5YS72V.js +144 -0
- package/dist/chunk-LMHSZB4Y.js +140 -0
- package/dist/chunk-LN5ZBLVS.js +204 -0
- package/dist/chunk-LUWCN6M6.js +149 -0
- package/dist/chunk-LW5UBK6L.js +117 -0
- package/dist/chunk-LX5MWEGA.js +132 -0
- package/dist/chunk-M56L4FV4.js +140 -0
- package/dist/chunk-MAGDDLBW.js +90 -0
- package/dist/chunk-MEADFUX2.js +153 -0
- package/dist/chunk-MFPKAMOG.js +130 -0
- package/dist/chunk-MHV54X35.js +151 -0
- package/dist/{chunk-5A36JYGI.js → chunk-MJ7U3HGA.js} +1 -1
- package/dist/chunk-MLZAEZMV.js +174 -0
- package/dist/chunk-MMV7D47H.js +208 -0
- package/dist/chunk-MNV5NHCJ.js +149 -0
- package/dist/chunk-MO4XEB63.js +121 -0
- package/dist/chunk-MR6YPSOY.js +173 -0
- package/dist/chunk-MRD6HKGW.js +76 -0
- package/dist/chunk-MRVHBF5O.js +118 -0
- package/dist/chunk-MSZVUVPQ.js +65 -0
- package/dist/chunk-MXZYTPO5.js +186 -0
- package/dist/chunk-MZXACKNO.js +168 -0
- package/dist/{chunk-W3AUNR4J.js → chunk-N3ZDCARL.js} +1 -1
- package/dist/chunk-NBU75HIT.js +166 -0
- package/dist/chunk-NEE3G3HR.js +223 -0
- package/dist/chunk-NH7JJL7P.js +119 -0
- package/dist/chunk-NITHEUYC.js +265 -0
- package/dist/chunk-NKDXTOTG.js +424 -0
- package/dist/chunk-NOQWUNQJ.js +118 -0
- package/dist/chunk-NRWZWWZA.js +245 -0
- package/dist/chunk-NU2A7BDW.js +115 -0
- package/dist/chunk-NUZDJ357.js +197 -0
- package/dist/chunk-NVFGWPTA.js +412 -0
- package/dist/chunk-NYMUK4ML.js +179 -0
- package/dist/chunk-O2TK3C6N.js +161 -0
- package/dist/chunk-O3RBVK7O.js +164 -0
- package/dist/chunk-O4UZVMRX.js +83 -0
- package/dist/chunk-O57UPOOF.js +89 -0
- package/dist/chunk-OHMQ3PBV.js +83 -0
- package/dist/chunk-OIAFEBJ3.js +242 -0
- package/dist/chunk-OIVL2EYT.js +206 -0
- package/dist/chunk-OJFNVSP6.js +200 -0
- package/dist/chunk-OKPO3E2E.js +230 -0
- package/dist/chunk-OOI2PB4O.js +119 -0
- package/dist/chunk-OOTOPYNI.js +119 -0
- package/dist/chunk-ORUP57TE.js +120 -0
- package/dist/chunk-OSDUNR6C.js +157 -0
- package/dist/chunk-OSJ4BZGF.js +184 -0
- package/dist/chunk-OSZ4CYA7.js +174 -0
- package/dist/chunk-OTAZYAWP.js +133 -0
- package/dist/chunk-P452DGOG.js +364 -0
- package/dist/chunk-PEHA2D2Q.js +116 -0
- package/dist/{chunk-H3LVWLBS.js → chunk-PFKHMDTK.js} +1 -1
- package/dist/{chunk-AF2WLL3H.js → chunk-PGMKVOVX.js} +2 -2
- package/dist/chunk-PGW37WH6.js +130 -0
- package/dist/chunk-PMGANSWQ.js +174 -0
- package/dist/chunk-PUGLGN3Y.js +123 -0
- package/dist/chunk-PUYW5BP2.js +203 -0
- package/dist/chunk-PV5B432D.js +285 -0
- package/dist/chunk-PVYQ6FSK.js +211 -0
- package/dist/chunk-PYDVGESH.js +183 -0
- package/dist/chunk-PZTP52WH.js +199 -0
- package/dist/chunk-Q7WEVW7Q.js +265 -0
- package/dist/chunk-QC2ET4I2.js +291 -0
- package/dist/chunk-QEIROKZM.js +189 -0
- package/dist/chunk-QGQQL3R7.js +203 -0
- package/dist/chunk-QIJ2C3Y3.js +186 -0
- package/dist/{chunk-WSYMYSW3.js → chunk-QIZHAGI4.js} +1 -1
- package/dist/{chunk-HBKB2GXI.js → chunk-QJH5ZLJ7.js} +1 -1
- package/dist/chunk-QML4ECKC.js +103 -0
- package/dist/chunk-QRM26V2R.js +204 -0
- package/dist/chunk-QY3WUUJQ.js +141 -0
- package/dist/chunk-R4N5MVCA.js +165 -0
- package/dist/chunk-R635J37J.js +199 -0
- package/dist/chunk-RCO6UZVU.js +199 -0
- package/dist/chunk-RDHKZCRP.js +159 -0
- package/dist/chunk-REECP5W2.js +166 -0
- package/dist/chunk-RJRILG6Z.js +158 -0
- package/dist/chunk-RLGU3BAH.js +247 -0
- package/dist/chunk-RMZJK2GV.js +186 -0
- package/dist/chunk-RU3COGOU.js +185 -0
- package/dist/chunk-RUQZODSY.js +190 -0
- package/dist/chunk-S3CRPILZ.js +149 -0
- package/dist/chunk-SCDZXEWG.js +182 -0
- package/dist/chunk-SFVMISGU.js +184 -0
- package/dist/chunk-SL3HDDGE.js +259 -0
- package/dist/chunk-STKIMVGX.js +141 -0
- package/dist/chunk-SUWGV23S.js +211 -0
- package/dist/chunk-SYDNCJ7C.js +154 -0
- package/dist/chunk-SZZL6IIK.js +143 -0
- package/dist/chunk-T3QB7UFP.js +208 -0
- package/dist/chunk-TGCNNZK5.js +179 -0
- package/dist/chunk-TH6WOUGQ.js +161 -0
- package/dist/{chunk-Q2QV62WV.js → chunk-TKXFGPCY.js} +1 -1
- package/dist/chunk-TNJ5REKO.js +261 -0
- package/dist/chunk-TO2VZQPO.js +179 -0
- package/dist/chunk-TQPIT2NK.js +147 -0
- package/dist/chunk-TQUHEZ2G.js +179 -0
- package/dist/{chunk-GTRJUSVK.js → chunk-TSYFDGCR.js} +1 -1
- package/dist/chunk-TVAFHJ3A.js +185 -0
- package/dist/chunk-TX76FDVC.js +211 -0
- package/dist/chunk-U2CTOPPM.js +196 -0
- package/dist/chunk-U2EQEZZI.js +173 -0
- package/dist/chunk-U6WUO4FI.js +259 -0
- package/dist/chunk-U77RQXF7.js +221 -0
- package/dist/chunk-UHT6UPRI.js +121 -0
- package/dist/chunk-UNWQUAGA.js +276 -0
- package/dist/chunk-URHPEK7W.js +234 -0
- package/dist/chunk-UY6NQ7PH.js +189 -0
- package/dist/chunk-V3D2HW3V.js +107 -0
- package/dist/chunk-V5NGRQSK.js +158 -0
- package/dist/{chunk-QKMSLSS6.js → chunk-V5SXW6U7.js} +1 -1
- package/dist/chunk-VYMBTNQR.js +189 -0
- package/dist/chunk-VYQU55XD.js +103 -0
- package/dist/chunk-W3G5OHVN.js +545 -0
- package/dist/{chunk-HSDMCZMX.js → chunk-W5ZXNQUJ.js} +2 -2
- package/dist/chunk-WAQTHFIN.js +223 -0
- package/dist/chunk-WEKJIUSM.js +276 -0
- package/dist/chunk-WFPOTRV2.js +162 -0
- package/dist/chunk-WNXFWEUG.js +166 -0
- package/dist/chunk-WO4NUNUP.js +72 -0
- package/dist/chunk-WPHSKHJN.js +78 -0
- package/dist/{chunk-FC54ZZOS.js → chunk-WQM3JDLU.js} +1 -1
- package/dist/chunk-WQMLPER4.js +187 -0
- package/dist/chunk-WUUECGPE.js +247 -0
- package/dist/chunk-WUXU3S5N.js +140 -0
- package/dist/chunk-WVK5GECZ.js +122 -0
- package/dist/chunk-WXJOF3CX.js +186 -0
- package/dist/chunk-X4ABJNZL.js +204 -0
- package/dist/chunk-X6J4DRSE.js +186 -0
- package/dist/chunk-XEVEPCZ2.js +433 -0
- package/dist/chunk-XIVINNUT.js +209 -0
- package/dist/chunk-XKJJLODR.js +83 -0
- package/dist/chunk-XKQFWB4Z.js +424 -0
- package/dist/chunk-XMRBEPCY.js +154 -0
- package/dist/chunk-XMSZRP6S.js +177 -0
- package/dist/{chunk-M6UUAF25.js → chunk-XQQ2USYE.js} +1 -1
- package/dist/chunk-XSJF5HAE.js +234 -0
- package/dist/chunk-XY3QFIPY.js +216 -0
- package/dist/chunk-Y465JAOG.js +247 -0
- package/dist/chunk-Y4IQA5Z7.js +196 -0
- package/dist/chunk-YBHXPZUP.js +185 -0
- package/dist/{chunk-XSNQN67K.js → chunk-YE6GLSZ4.js} +1 -1
- package/dist/chunk-YFP4QSLO.js +241 -0
- package/dist/chunk-YPG64NY6.js +179 -0
- package/dist/chunk-YPYTX4QE.js +172 -0
- package/dist/chunk-YSIC77ML.js +113 -0
- package/dist/chunk-YUNGCCCL.js +123 -0
- package/dist/chunk-YYL6ZWEJ.js +374 -0
- package/dist/chunk-Z3PAQOUS.js +199 -0
- package/dist/chunk-ZFJHR7ZA.js +218 -0
- package/dist/chunk-ZH3W4QOE.js +189 -0
- package/dist/chunk-ZM6ZCLBP.js +121 -0
- package/dist/chunk-ZNDGNCN7.js +124 -0
- package/dist/chunk-ZT64XOMR.js +248 -0
- package/dist/chunk-ZYE3IBTN.js +250 -0
- package/dist/citations-aui-193.d.ts +2 -0
- package/dist/citations-aui-193.js +10 -0
- package/dist/citations-aui-194.d.ts +2 -0
- package/dist/citations-aui-194.js +10 -0
- package/dist/color-picker-aui-119.d.ts +2 -0
- package/dist/color-picker-aui-119.js +13 -0
- package/dist/color-picker-aui-120.d.ts +2 -0
- package/dist/color-picker-aui-120.js +13 -0
- package/dist/command-palette-aui-201.d.ts +2 -0
- package/dist/command-palette-aui-201.js +9 -0
- package/dist/command-palette-aui-202.d.ts +2 -0
- package/dist/command-palette-aui-202.js +9 -0
- package/dist/comments-aui-213.d.ts +2 -0
- package/dist/comments-aui-213.js +10 -0
- package/dist/comments-aui-214.d.ts +2 -0
- package/dist/comments-aui-214.js +10 -0
- package/dist/comments.js +2 -2
- package/dist/context-menu-aui-167.d.ts +2 -0
- package/dist/context-menu-aui-167.js +9 -0
- package/dist/context-menu-aui-168.d.ts +2 -0
- package/dist/context-menu-aui-168.js +9 -0
- package/dist/context-meter-aui-131.d.ts +2 -0
- package/dist/context-meter-aui-131.js +10 -0
- package/dist/context-meter-aui-132.d.ts +2 -0
- package/dist/context-meter-aui-132.js +10 -0
- package/dist/cookie-consent-aui-189.d.ts +2 -0
- package/dist/cookie-consent-aui-189.js +10 -0
- package/dist/cookie-consent-aui-190.d.ts +2 -0
- package/dist/cookie-consent-aui-190.js +10 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/copy-button-aui-113.d.ts +2 -0
- package/dist/copy-button-aui-113.js +10 -0
- package/dist/copy-button-aui-114.d.ts +2 -0
- package/dist/copy-button-aui-114.js +9 -0
- package/dist/countdown-aui-125.d.ts +2 -0
- package/dist/countdown-aui-125.js +10 -0
- package/dist/countdown-aui-126.d.ts +2 -0
- package/dist/countdown-aui-126.js +9 -0
- package/dist/data-table-aui-205.d.ts +2 -0
- package/dist/data-table-aui-205.js +10 -0
- package/dist/data-table-aui-206.d.ts +2 -0
- package/dist/data-table-aui-206.js +10 -0
- package/dist/dialog-aui-149.d.ts +2 -0
- package/dist/dialog-aui-149.js +10 -0
- package/dist/dialog-aui-150.d.ts +2 -0
- package/dist/dialog-aui-150.js +10 -0
- package/dist/drawer-aui-157.d.ts +2 -0
- package/dist/drawer-aui-157.js +9 -0
- package/dist/drawer-aui-158.d.ts +2 -0
- package/dist/drawer-aui-158.js +9 -0
- package/dist/dropdown-menu-aui-141.d.ts +2 -0
- package/dist/dropdown-menu-aui-141.js +9 -0
- package/dist/dropdown-menu-aui-142.d.ts +2 -0
- package/dist/dropdown-menu-aui-142.js +12 -0
- package/dist/dropdown-menu.js +2 -2
- package/dist/empty-state-aui-165.d.ts +2 -0
- package/dist/empty-state-aui-165.js +10 -0
- package/dist/empty-state-aui-166.d.ts +2 -0
- package/dist/empty-state-aui-166.js +10 -0
- package/dist/empty-state.js +2 -2
- package/dist/event-calendar-aui-217.d.ts +2 -0
- package/dist/event-calendar-aui-217.js +10 -0
- package/dist/event-calendar-aui-218.d.ts +2 -0
- package/dist/event-calendar-aui-218.js +9 -0
- package/dist/feature-flags-aui-079.d.ts +2 -0
- package/dist/feature-flags-aui-079.js +10 -0
- package/dist/feature-flags-aui-080.d.ts +2 -0
- package/dist/feature-flags-aui-080.js +10 -0
- package/dist/feature-flags.d.ts +2 -0
- package/dist/feature-flags.js +14 -0
- package/dist/field-aui-139.d.ts +2 -0
- package/dist/field-aui-139.js +9 -0
- package/dist/field-aui-140.d.ts +2 -0
- package/dist/field-aui-140.js +9 -0
- package/dist/file-card-aui-173.d.ts +2 -0
- package/dist/file-card-aui-173.js +10 -0
- package/dist/file-card-aui-174.d.ts +2 -0
- package/dist/file-card-aui-174.js +9 -0
- package/dist/file-manager-aui-231.d.ts +2 -0
- package/dist/file-manager-aui-231.js +10 -0
- package/dist/file-manager-aui-232.d.ts +2 -0
- package/dist/file-manager-aui-232.js +10 -0
- package/dist/file-manager.js +2 -2
- package/dist/file-upload-aui-153.d.ts +2 -0
- package/dist/file-upload-aui-153.js +10 -0
- package/dist/file-upload-aui-154.d.ts +2 -0
- package/dist/file-upload-aui-154.js +9 -0
- package/dist/footer.js +2 -2
- package/dist/hover-card-aui-169.d.ts +2 -0
- package/dist/hover-card-aui-169.js +9 -0
- package/dist/hover-card-aui-170.d.ts +2 -0
- package/dist/hover-card-aui-170.js +10 -0
- package/dist/image-compare-aui-179.d.ts +2 -0
- package/dist/image-compare-aui-179.js +10 -0
- package/dist/image-compare-aui-180.d.ts +2 -0
- package/dist/image-compare-aui-180.js +9 -0
- package/dist/inbox-aui-229.d.ts +2 -0
- package/dist/inbox-aui-229.js +10 -0
- package/dist/inbox-aui-230.d.ts +2 -0
- package/dist/inbox-aui-230.js +10 -0
- package/dist/inbox.js +2 -2
- package/dist/index.js +1238 -124
- package/dist/inline-edit-aui-123.d.ts +2 -0
- package/dist/inline-edit-aui-123.js +10 -0
- package/dist/inline-edit-aui-124.d.ts +2 -0
- package/dist/inline-edit-aui-124.js +10 -0
- package/dist/integrations-aui-081.d.ts +2 -0
- package/dist/integrations-aui-081.js +11 -0
- package/dist/integrations-aui-082.d.ts +2 -0
- package/dist/integrations-aui-082.js +11 -0
- package/dist/integrations.d.ts +2 -0
- package/dist/integrations.js +11 -0
- package/dist/invoice-aui-227.d.ts +2 -0
- package/dist/invoice-aui-227.js +10 -0
- package/dist/invoice-aui-228.d.ts +2 -0
- package/dist/invoice-aui-228.js +10 -0
- package/dist/invoice.js +2 -2
- package/dist/kanban-aui-209.d.ts +2 -0
- package/dist/kanban-aui-209.js +9 -0
- package/dist/kanban-aui-210.d.ts +2 -0
- package/dist/kanban-aui-210.js +10 -0
- package/dist/kbd-aui-095.d.ts +2 -0
- package/dist/kbd-aui-095.js +11 -0
- package/dist/kbd-aui-096.d.ts +2 -0
- package/dist/kbd-aui-096.js +11 -0
- package/dist/menubar-aui-183.d.ts +2 -0
- package/dist/menubar-aui-183.js +9 -0
- package/dist/menubar-aui-184.d.ts +2 -0
- package/dist/menubar-aui-184.js +9 -0
- package/dist/meter-aui-127.d.ts +2 -0
- package/dist/meter-aui-127.js +9 -0
- package/dist/meter-aui-128.d.ts +2 -0
- package/dist/meter-aui-128.js +9 -0
- package/dist/model-picker-aui-191.d.ts +2 -0
- package/dist/model-picker-aui-191.js +9 -0
- package/dist/model-picker-aui-192.d.ts +2 -0
- package/dist/model-picker-aui-192.js +9 -0
- package/dist/motion-button-aui-089.d.ts +2 -0
- package/dist/motion-button-aui-089.js +9 -0
- package/dist/motion-button-aui-090.d.ts +2 -0
- package/dist/motion-button-aui-090.js +9 -0
- package/dist/navbar.js +2 -2
- package/dist/notification-center-aui-223.d.ts +2 -0
- package/dist/notification-center-aui-223.js +10 -0
- package/dist/notification-center-aui-224.d.ts +2 -0
- package/dist/notification-center-aui-224.js +10 -0
- package/dist/number-input-aui-147.d.ts +2 -0
- package/dist/number-input-aui-147.js +9 -0
- package/dist/number-input-aui-148.d.ts +2 -0
- package/dist/number-input-aui-148.js +10 -0
- package/dist/onboarding-aui-211.d.ts +2 -0
- package/dist/onboarding-aui-211.js +9 -0
- package/dist/onboarding-aui-212.d.ts +2 -0
- package/dist/onboarding-aui-212.js +10 -0
- package/dist/onboarding.js +2 -2
- package/dist/pagination-aui-111.d.ts +2 -0
- package/dist/pagination-aui-111.js +10 -0
- package/dist/pagination-aui-112.d.ts +2 -0
- package/dist/pagination-aui-112.js +9 -0
- package/dist/phone-input-aui-185.d.ts +2 -0
- package/dist/phone-input-aui-185.js +11 -0
- package/dist/phone-input-aui-186.d.ts +2 -0
- package/dist/phone-input-aui-186.js +11 -0
- package/dist/popover-aui-155.d.ts +2 -0
- package/dist/popover-aui-155.js +10 -0
- package/dist/popover-aui-156.d.ts +2 -0
- package/dist/popover-aui-156.js +10 -0
- package/dist/pricing.js +2 -2
- package/dist/progress-aui-105.d.ts +2 -0
- package/dist/progress-aui-105.js +10 -0
- package/dist/progress-aui-106.d.ts +2 -0
- package/dist/progress-aui-106.js +10 -0
- package/dist/prompt-composer-aui-237.d.ts +2 -0
- package/dist/prompt-composer-aui-237.js +10 -0
- package/dist/prompt-composer-aui-238.d.ts +2 -0
- package/dist/prompt-composer-aui-238.js +10 -0
- package/dist/properties-panel-aui-199.d.ts +2 -0
- package/dist/properties-panel-aui-199.js +10 -0
- package/dist/properties-panel-aui-200.d.ts +2 -0
- package/dist/properties-panel-aui-200.js +9 -0
- package/dist/range-slider-aui-117.d.ts +2 -0
- package/dist/range-slider-aui-117.js +10 -0
- package/dist/range-slider-aui-118.d.ts +2 -0
- package/dist/range-slider-aui-118.js +9 -0
- package/dist/rating-aui-103.d.ts +2 -0
- package/dist/rating-aui-103.js +10 -0
- package/dist/rating-aui-104.d.ts +2 -0
- package/dist/rating-aui-104.js +10 -0
- package/dist/roles-permissions-aui-073.d.ts +2 -0
- package/dist/roles-permissions-aui-073.js +10 -0
- package/dist/roles-permissions-aui-074.d.ts +2 -0
- package/dist/roles-permissions-aui-074.js +10 -0
- package/dist/roles-permissions.d.ts +2 -0
- package/dist/roles-permissions.js +9 -0
- package/dist/scrub-input-aui-133.d.ts +2 -0
- package/dist/scrub-input-aui-133.js +9 -0
- package/dist/scrub-input-aui-134.d.ts +2 -0
- package/dist/scrub-input-aui-134.js +9 -0
- package/dist/security-settings-aui-075.d.ts +2 -0
- package/dist/security-settings-aui-075.js +10 -0
- package/dist/security-settings-aui-076.d.ts +2 -0
- package/dist/security-settings-aui-076.js +10 -0
- package/dist/security-settings.d.ts +2 -0
- package/dist/security-settings.js +10 -0
- package/dist/segmented-control-aui-135.d.ts +2 -0
- package/dist/segmented-control-aui-135.js +9 -0
- package/dist/segmented-control-aui-136.d.ts +2 -0
- package/dist/segmented-control-aui-136.js +9 -0
- package/dist/settings-panel-aui-203.d.ts +2 -0
- package/dist/settings-panel-aui-203.js +9 -0
- package/dist/settings-panel-aui-204.d.ts +2 -0
- package/dist/settings-panel-aui-204.js +10 -0
- package/dist/settings-panel.js +2 -2
- package/dist/sidebar-aui-207.d.ts +2 -0
- package/dist/sidebar-aui-207.js +9 -0
- package/dist/sidebar-aui-208.d.ts +2 -0
- package/dist/sidebar-aui-208.js +9 -0
- package/dist/sign-in.js +2 -2
- package/dist/skeleton-aui-101.d.ts +2 -0
- package/dist/skeleton-aui-101.js +10 -0
- package/dist/skeleton-aui-102.d.ts +2 -0
- package/dist/skeleton-aui-102.js +12 -0
- package/dist/sortable-list-aui-187.d.ts +2 -0
- package/dist/sortable-list-aui-187.js +9 -0
- package/dist/sortable-list-aui-188.d.ts +2 -0
- package/dist/sortable-list-aui-188.js +9 -0
- package/dist/spinner-aui-097.d.ts +2 -0
- package/dist/spinner-aui-097.js +9 -0
- package/dist/spinner-aui-098.d.ts +2 -0
- package/dist/spinner-aui-098.js +10 -0
- package/dist/stat-card-aui-163.d.ts +2 -0
- package/dist/stat-card-aui-163.js +10 -0
- package/dist/stat-card-aui-164.d.ts +2 -0
- package/dist/stat-card-aui-164.js +9 -0
- package/dist/status-page-aui-083.d.ts +2 -0
- package/dist/status-page-aui-083.js +10 -0
- package/dist/status-page-aui-084.d.ts +2 -0
- package/dist/status-page-aui-084.js +10 -0
- package/dist/status-page.d.ts +2 -0
- package/dist/status-page.js +10 -0
- package/dist/stepper-aui-151.d.ts +2 -0
- package/dist/stepper-aui-151.js +10 -0
- package/dist/stepper-aui-152.d.ts +2 -0
- package/dist/stepper-aui-152.js +10 -0
- package/dist/tabs-aui-137.d.ts +2 -0
- package/dist/tabs-aui-137.js +9 -0
- package/dist/tabs-aui-138.d.ts +2 -0
- package/dist/tabs-aui-138.js +10 -0
- package/dist/team-members-aui-221.d.ts +2 -0
- package/dist/team-members-aui-221.js +11 -0
- package/dist/team-members-aui-222.d.ts +2 -0
- package/dist/team-members-aui-222.js +10 -0
- package/dist/team-members.js +2 -2
- package/dist/testimonials-aui-235.d.ts +2 -0
- package/dist/testimonials-aui-235.js +10 -0
- package/dist/testimonials-aui-236.d.ts +2 -0
- package/dist/testimonials-aui-236.js +10 -0
- package/dist/thinking-aui-129.d.ts +2 -0
- package/dist/thinking-aui-129.js +10 -0
- package/dist/thinking-aui-130.d.ts +2 -0
- package/dist/thinking-aui-130.js +9 -0
- package/dist/timeline-aui-159.d.ts +2 -0
- package/dist/timeline-aui-159.js +11 -0
- package/dist/timeline-aui-160.d.ts +2 -0
- package/dist/timeline-aui-160.js +9 -0
- package/dist/toast-aui-145.d.ts +2 -0
- package/dist/toast-aui-145.js +9 -0
- package/dist/toast-aui-146.d.ts +2 -0
- package/dist/toast-aui-146.js +12 -0
- package/dist/toggle-group-aui-115.d.ts +2 -0
- package/dist/toggle-group-aui-115.js +11 -0
- package/dist/toggle-group-aui-116.d.ts +2 -0
- package/dist/toggle-group-aui-116.js +9 -0
- package/dist/tool-approval-aui-195.d.ts +2 -0
- package/dist/tool-approval-aui-195.js +10 -0
- package/dist/tool-approval-aui-196.d.ts +2 -0
- package/dist/tool-approval-aui-196.js +10 -0
- package/dist/tool-dock-aui-177.d.ts +2 -0
- package/dist/tool-dock-aui-177.js +9 -0
- package/dist/tool-dock-aui-178.d.ts +2 -0
- package/dist/tool-dock-aui-178.js +10 -0
- package/dist/tooltip-aui-099.d.ts +2 -0
- package/dist/tooltip-aui-099.js +9 -0
- package/dist/tooltip-aui-100.d.ts +2 -0
- package/dist/tooltip-aui-100.js +9 -0
- package/dist/trace-waterfall-aui-239.d.ts +2 -0
- package/dist/trace-waterfall-aui-239.js +9 -0
- package/dist/trace-waterfall-aui-240.d.ts +2 -0
- package/dist/trace-waterfall-aui-240.js +9 -0
- package/dist/tree-view-aui-171.d.ts +2 -0
- package/dist/tree-view-aui-171.js +9 -0
- package/dist/tree-view-aui-172.d.ts +2 -0
- package/dist/tree-view-aui-172.js +10 -0
- package/dist/types/components/kit/audit-log.d.ts +78 -0
- package/dist/types/components/kit/base/audit-log.d.ts +78 -0
- package/dist/types/components/kit/base/feature-flags.d.ts +61 -0
- package/dist/types/components/kit/base/status-page.d.ts +62 -0
- package/dist/types/components/kit/base/usage-overview.d.ts +56 -0
- package/dist/types/components/kit/base/variants/accordion-aui-143.d.ts +22 -0
- package/dist/types/components/kit/base/variants/accordion-aui-144.d.ts +30 -0
- package/dist/types/components/kit/base/variants/agent-plan-aui-197.d.ts +30 -0
- package/dist/types/components/kit/base/variants/agent-plan-aui-198.d.ts +25 -0
- package/dist/types/components/kit/base/variants/ai-chat-aui-215.d.ts +32 -0
- package/dist/types/components/kit/base/variants/announcement-bar-aui-181.d.ts +25 -0
- package/dist/types/components/kit/base/variants/announcement-bar-aui-182.d.ts +21 -0
- package/dist/types/components/kit/base/variants/api-keys-aui-241.d.ts +33 -0
- package/dist/types/components/kit/base/variants/audit-log-aui-072.d.ts +34 -0
- package/dist/types/components/kit/base/variants/avatar-aui-093.d.ts +23 -0
- package/dist/types/components/kit/base/variants/avatar-group-aui-121.d.ts +28 -0
- package/dist/types/components/kit/base/variants/avatar-group-aui-122.d.ts +31 -0
- package/dist/types/components/kit/base/variants/billing-aui-233.d.ts +37 -0
- package/dist/types/components/kit/base/variants/billing-aui-234.d.ts +46 -0
- package/dist/types/components/kit/base/variants/breadcrumb-aui-110.d.ts +18 -0
- package/dist/types/components/kit/base/variants/cancel-flow-aui-087.d.ts +34 -0
- package/dist/types/components/kit/base/variants/cancel-flow-aui-088.d.ts +30 -0
- package/dist/types/components/kit/base/variants/checkout-aui-219.d.ts +41 -0
- package/dist/types/components/kit/base/variants/checkout-aui-220.d.ts +43 -0
- package/dist/types/components/kit/base/variants/citations-aui-193.d.ts +29 -0
- package/dist/types/components/kit/base/variants/citations-aui-194.d.ts +29 -0
- package/dist/types/components/kit/base/variants/comments-aui-213.d.ts +35 -0
- package/dist/types/components/kit/base/variants/comments-aui-214.d.ts +40 -0
- package/dist/types/components/kit/base/variants/context-meter-aui-131.d.ts +24 -0
- package/dist/types/components/kit/base/variants/context-meter-aui-132.d.ts +28 -0
- package/dist/types/components/kit/base/variants/cookie-consent-aui-189.d.ts +32 -0
- package/dist/types/components/kit/base/variants/cookie-consent-aui-190.d.ts +34 -0
- package/dist/types/components/kit/base/variants/copy-button-aui-113.d.ts +24 -0
- package/dist/types/components/kit/base/variants/countdown-aui-125.d.ts +25 -0
- package/dist/types/components/kit/base/variants/data-table-aui-205.d.ts +41 -0
- package/dist/types/components/kit/base/variants/data-table-aui-206.d.ts +33 -0
- package/dist/types/components/kit/base/variants/dialog-aui-149.d.ts +24 -0
- package/dist/types/components/kit/base/variants/dialog-aui-150.d.ts +33 -0
- package/dist/types/components/kit/base/variants/dropdown-menu-aui-142.d.ts +45 -0
- package/dist/types/components/kit/base/variants/empty-state-aui-165.d.ts +34 -0
- package/dist/types/components/kit/base/variants/empty-state-aui-166.d.ts +36 -0
- package/dist/types/components/kit/base/variants/event-calendar-aui-217.d.ts +32 -0
- package/dist/types/components/kit/base/variants/feature-flags-aui-079.d.ts +38 -0
- package/dist/types/components/kit/base/variants/feature-flags-aui-080.d.ts +29 -0
- package/dist/types/components/kit/base/variants/file-card-aui-173.d.ts +24 -0
- package/dist/types/components/kit/base/variants/file-manager-aui-231.d.ts +32 -0
- package/dist/types/components/kit/base/variants/file-manager-aui-232.d.ts +29 -0
- package/dist/types/components/kit/base/variants/file-upload-aui-153.d.ts +30 -0
- package/dist/types/components/kit/base/variants/hover-card-aui-170.d.ts +32 -0
- package/dist/types/components/kit/base/variants/image-compare-aui-179.d.ts +29 -0
- package/dist/types/components/kit/base/variants/inbox-aui-229.d.ts +31 -0
- package/dist/types/components/kit/base/variants/inbox-aui-230.d.ts +31 -0
- package/dist/types/components/kit/base/variants/inline-edit-aui-123.d.ts +32 -0
- package/dist/types/components/kit/base/variants/inline-edit-aui-124.d.ts +23 -0
- package/dist/types/components/kit/base/variants/integrations-aui-081.d.ts +41 -0
- package/dist/types/components/kit/base/variants/integrations-aui-082.d.ts +46 -0
- package/dist/types/components/kit/base/variants/invoice-aui-227.d.ts +40 -0
- package/dist/types/components/kit/base/variants/invoice-aui-228.d.ts +43 -0
- package/dist/types/components/kit/base/variants/kanban-aui-210.d.ts +32 -0
- package/dist/types/components/kit/base/variants/kbd-aui-095.d.ts +28 -0
- package/dist/types/components/kit/base/variants/kbd-aui-096.d.ts +21 -0
- package/dist/types/components/kit/base/variants/notification-center-aui-223.d.ts +36 -0
- package/dist/types/components/kit/base/variants/notification-center-aui-224.d.ts +37 -0
- package/dist/types/components/kit/base/variants/number-input-aui-148.d.ts +24 -0
- package/dist/types/components/kit/base/variants/onboarding-aui-212.d.ts +38 -0
- package/dist/types/components/kit/base/variants/pagination-aui-111.d.ts +27 -0
- package/dist/types/components/kit/base/variants/phone-input-aui-185.d.ts +25 -0
- package/dist/types/components/kit/base/variants/phone-input-aui-186.d.ts +33 -0
- package/dist/types/components/kit/base/variants/popover-aui-155.d.ts +33 -0
- package/dist/types/components/kit/base/variants/popover-aui-156.d.ts +38 -0
- package/dist/types/components/kit/base/variants/progress-aui-105.d.ts +32 -0
- package/dist/types/components/kit/base/variants/progress-aui-106.d.ts +29 -0
- package/dist/types/components/kit/base/variants/prompt-composer-aui-237.d.ts +26 -0
- package/dist/types/components/kit/base/variants/prompt-composer-aui-238.d.ts +33 -0
- package/dist/types/components/kit/base/variants/properties-panel-aui-199.d.ts +30 -0
- package/dist/types/components/kit/base/variants/range-slider-aui-117.d.ts +35 -0
- package/dist/types/components/kit/base/variants/rating-aui-103.d.ts +25 -0
- package/dist/types/components/kit/base/variants/rating-aui-104.d.ts +20 -0
- package/dist/types/components/kit/base/variants/roles-permissions-aui-073.d.ts +39 -0
- package/dist/types/components/kit/base/variants/roles-permissions-aui-074.d.ts +31 -0
- package/dist/types/components/kit/base/variants/security-settings-aui-075.d.ts +29 -0
- package/dist/types/components/kit/base/variants/security-settings-aui-076.d.ts +33 -0
- package/dist/types/components/kit/base/variants/settings-panel-aui-204.d.ts +26 -0
- package/dist/types/components/kit/base/variants/skeleton-aui-101.d.ts +38 -0
- package/dist/types/components/kit/base/variants/skeleton-aui-102.d.ts +30 -0
- package/dist/types/components/kit/base/variants/spinner-aui-098.d.ts +25 -0
- package/dist/types/components/kit/base/variants/stat-card-aui-163.d.ts +26 -0
- package/dist/types/components/kit/base/variants/status-page-aui-083.d.ts +25 -0
- package/dist/types/components/kit/base/variants/status-page-aui-084.d.ts +32 -0
- package/dist/types/components/kit/base/variants/stepper-aui-151.d.ts +34 -0
- package/dist/types/components/kit/base/variants/stepper-aui-152.d.ts +29 -0
- package/dist/types/components/kit/base/variants/tabs-aui-138.d.ts +33 -0
- package/dist/types/components/kit/base/variants/team-members-aui-221.d.ts +33 -0
- package/dist/types/components/kit/base/variants/team-members-aui-222.d.ts +26 -0
- package/dist/types/components/kit/base/variants/testimonials-aui-235.d.ts +29 -0
- package/dist/types/components/kit/base/variants/testimonials-aui-236.d.ts +33 -0
- package/dist/types/components/kit/base/variants/thinking-aui-129.d.ts +28 -0
- package/dist/types/components/kit/base/variants/timeline-aui-159.d.ts +33 -0
- package/dist/types/components/kit/base/variants/toast-aui-146.d.ts +38 -0
- package/dist/types/components/kit/base/variants/tool-approval-aui-195.d.ts +34 -0
- package/dist/types/components/kit/base/variants/tool-approval-aui-196.d.ts +41 -0
- package/dist/types/components/kit/base/variants/tool-dock-aui-178.d.ts +24 -0
- package/dist/types/components/kit/base/variants/tree-view-aui-172.d.ts +31 -0
- package/dist/types/components/kit/base/variants/usage-overview-aui-069.d.ts +40 -0
- package/dist/types/components/kit/base/variants/usage-overview-aui-070.d.ts +30 -0
- package/dist/types/components/kit/base/variants/webhooks-aui-077.d.ts +39 -0
- package/dist/types/components/kit/base/variants/webhooks-aui-078.d.ts +37 -0
- package/dist/types/components/kit/base/variants/whats-new-aui-085.d.ts +35 -0
- package/dist/types/components/kit/cancel-flow.d.ts +67 -0
- package/dist/types/components/kit/feature-flags.d.ts +61 -0
- package/dist/types/components/kit/integrations.d.ts +59 -0
- package/dist/types/components/kit/roles-permissions.d.ts +51 -0
- package/dist/types/components/kit/security-settings.d.ts +52 -0
- package/dist/types/components/kit/status-page.d.ts +62 -0
- package/dist/types/components/kit/usage-overview.d.ts +56 -0
- package/dist/types/components/kit/variants/accordion-aui-143.d.ts +22 -0
- package/dist/types/components/kit/variants/accordion-aui-144.d.ts +30 -0
- package/dist/types/components/kit/variants/agent-plan-aui-197.d.ts +30 -0
- package/dist/types/components/kit/variants/agent-plan-aui-198.d.ts +25 -0
- package/dist/types/components/kit/variants/ai-chat-aui-215.d.ts +32 -0
- package/dist/types/components/kit/variants/ai-chat-aui-216.d.ts +31 -0
- package/dist/types/components/kit/variants/alert-aui-107.d.ts +26 -0
- package/dist/types/components/kit/variants/alert-aui-108.d.ts +37 -0
- package/dist/types/components/kit/variants/announcement-bar-aui-181.d.ts +25 -0
- package/dist/types/components/kit/variants/announcement-bar-aui-182.d.ts +21 -0
- package/dist/types/components/kit/variants/api-keys-aui-241.d.ts +33 -0
- package/dist/types/components/kit/variants/api-keys-aui-242.d.ts +38 -0
- package/dist/types/components/kit/variants/audit-log-aui-071.d.ts +37 -0
- package/dist/types/components/kit/variants/audit-log-aui-072.d.ts +34 -0
- package/dist/types/components/kit/variants/avatar-aui-093.d.ts +23 -0
- package/dist/types/components/kit/variants/avatar-aui-094.d.ts +29 -0
- package/dist/types/components/kit/variants/avatar-group-aui-121.d.ts +28 -0
- package/dist/types/components/kit/variants/avatar-group-aui-122.d.ts +31 -0
- package/dist/types/components/kit/variants/badge-aui-091.d.ts +31 -0
- package/dist/types/components/kit/variants/badge-aui-092.d.ts +26 -0
- package/dist/types/components/kit/variants/billing-aui-233.d.ts +37 -0
- package/dist/types/components/kit/variants/billing-aui-234.d.ts +46 -0
- package/dist/types/components/kit/variants/breadcrumb-aui-109.d.ts +31 -0
- package/dist/types/components/kit/variants/breadcrumb-aui-110.d.ts +18 -0
- package/dist/types/components/kit/variants/cancel-flow-aui-087.d.ts +34 -0
- package/dist/types/components/kit/variants/cancel-flow-aui-088.d.ts +30 -0
- package/dist/types/components/kit/variants/carousel-aui-161.d.ts +26 -0
- package/dist/types/components/kit/variants/carousel-aui-162.d.ts +21 -0
- package/dist/types/components/kit/variants/chart-card-aui-225.d.ts +38 -0
- package/dist/types/components/kit/variants/chart-card-aui-226.d.ts +29 -0
- package/dist/types/components/kit/variants/checkout-aui-219.d.ts +41 -0
- package/dist/types/components/kit/variants/checkout-aui-220.d.ts +43 -0
- package/dist/types/components/kit/variants/citations-aui-193.d.ts +29 -0
- package/dist/types/components/kit/variants/citations-aui-194.d.ts +29 -0
- package/dist/types/components/kit/variants/color-picker-aui-119.d.ts +33 -0
- package/dist/types/components/kit/variants/color-picker-aui-120.d.ts +32 -0
- package/dist/types/components/kit/variants/command-palette-aui-201.d.ts +39 -0
- package/dist/types/components/kit/variants/command-palette-aui-202.d.ts +33 -0
- package/dist/types/components/kit/variants/comments-aui-213.d.ts +35 -0
- package/dist/types/components/kit/variants/comments-aui-214.d.ts +40 -0
- package/dist/types/components/kit/variants/context-menu-aui-167.d.ts +45 -0
- package/dist/types/components/kit/variants/context-menu-aui-168.d.ts +42 -0
- package/dist/types/components/kit/variants/context-meter-aui-131.d.ts +24 -0
- package/dist/types/components/kit/variants/context-meter-aui-132.d.ts +28 -0
- package/dist/types/components/kit/variants/cookie-consent-aui-189.d.ts +32 -0
- package/dist/types/components/kit/variants/cookie-consent-aui-190.d.ts +34 -0
- package/dist/types/components/kit/variants/copy-button-aui-113.d.ts +24 -0
- package/dist/types/components/kit/variants/copy-button-aui-114.d.ts +24 -0
- package/dist/types/components/kit/variants/countdown-aui-125.d.ts +25 -0
- package/dist/types/components/kit/variants/countdown-aui-126.d.ts +22 -0
- package/dist/types/components/kit/variants/data-table-aui-205.d.ts +41 -0
- package/dist/types/components/kit/variants/data-table-aui-206.d.ts +33 -0
- package/dist/types/components/kit/variants/dialog-aui-149.d.ts +24 -0
- package/dist/types/components/kit/variants/dialog-aui-150.d.ts +33 -0
- package/dist/types/components/kit/variants/drawer-aui-157.d.ts +28 -0
- package/dist/types/components/kit/variants/drawer-aui-158.d.ts +27 -0
- package/dist/types/components/kit/variants/dropdown-menu-aui-141.d.ts +31 -0
- package/dist/types/components/kit/variants/dropdown-menu-aui-142.d.ts +45 -0
- package/dist/types/components/kit/variants/empty-state-aui-165.d.ts +34 -0
- package/dist/types/components/kit/variants/empty-state-aui-166.d.ts +36 -0
- package/dist/types/components/kit/variants/event-calendar-aui-217.d.ts +32 -0
- package/dist/types/components/kit/variants/event-calendar-aui-218.d.ts +42 -0
- package/dist/types/components/kit/variants/feature-flags-aui-079.d.ts +38 -0
- package/dist/types/components/kit/variants/feature-flags-aui-080.d.ts +29 -0
- package/dist/types/components/kit/variants/field-aui-139.d.ts +37 -0
- package/dist/types/components/kit/variants/field-aui-140.d.ts +21 -0
- package/dist/types/components/kit/variants/file-card-aui-173.d.ts +24 -0
- package/dist/types/components/kit/variants/file-card-aui-174.d.ts +27 -0
- package/dist/types/components/kit/variants/file-manager-aui-231.d.ts +32 -0
- package/dist/types/components/kit/variants/file-manager-aui-232.d.ts +29 -0
- package/dist/types/components/kit/variants/file-upload-aui-153.d.ts +30 -0
- package/dist/types/components/kit/variants/file-upload-aui-154.d.ts +29 -0
- package/dist/types/components/kit/variants/hover-card-aui-169.d.ts +36 -0
- package/dist/types/components/kit/variants/hover-card-aui-170.d.ts +32 -0
- package/dist/types/components/kit/variants/image-compare-aui-179.d.ts +29 -0
- package/dist/types/components/kit/variants/image-compare-aui-180.d.ts +29 -0
- package/dist/types/components/kit/variants/inbox-aui-229.d.ts +31 -0
- package/dist/types/components/kit/variants/inbox-aui-230.d.ts +31 -0
- package/dist/types/components/kit/variants/inline-edit-aui-123.d.ts +32 -0
- package/dist/types/components/kit/variants/inline-edit-aui-124.d.ts +23 -0
- package/dist/types/components/kit/variants/integrations-aui-081.d.ts +41 -0
- package/dist/types/components/kit/variants/integrations-aui-082.d.ts +46 -0
- package/dist/types/components/kit/variants/invoice-aui-227.d.ts +40 -0
- package/dist/types/components/kit/variants/invoice-aui-228.d.ts +43 -0
- package/dist/types/components/kit/variants/kanban-aui-209.d.ts +35 -0
- package/dist/types/components/kit/variants/kanban-aui-210.d.ts +32 -0
- package/dist/types/components/kit/variants/kbd-aui-095.d.ts +28 -0
- package/dist/types/components/kit/variants/kbd-aui-096.d.ts +21 -0
- package/dist/types/components/kit/variants/menubar-aui-183.d.ts +43 -0
- package/dist/types/components/kit/variants/menubar-aui-184.d.ts +40 -0
- package/dist/types/components/kit/variants/meter-aui-127.d.ts +29 -0
- package/dist/types/components/kit/variants/meter-aui-128.d.ts +32 -0
- package/dist/types/components/kit/variants/model-picker-aui-191.d.ts +34 -0
- package/dist/types/components/kit/variants/model-picker-aui-192.d.ts +36 -0
- package/dist/types/components/kit/variants/motion-button-aui-089.d.ts +25 -0
- package/dist/types/components/kit/variants/motion-button-aui-090.d.ts +24 -0
- package/dist/types/components/kit/variants/notification-center-aui-223.d.ts +36 -0
- package/dist/types/components/kit/variants/notification-center-aui-224.d.ts +37 -0
- package/dist/types/components/kit/variants/number-input-aui-147.d.ts +31 -0
- package/dist/types/components/kit/variants/number-input-aui-148.d.ts +24 -0
- package/dist/types/components/kit/variants/onboarding-aui-211.d.ts +30 -0
- package/dist/types/components/kit/variants/onboarding-aui-212.d.ts +38 -0
- package/dist/types/components/kit/variants/pagination-aui-111.d.ts +27 -0
- package/dist/types/components/kit/variants/pagination-aui-112.d.ts +25 -0
- package/dist/types/components/kit/variants/phone-input-aui-185.d.ts +25 -0
- package/dist/types/components/kit/variants/phone-input-aui-186.d.ts +33 -0
- package/dist/types/components/kit/variants/popover-aui-155.d.ts +33 -0
- package/dist/types/components/kit/variants/popover-aui-156.d.ts +38 -0
- package/dist/types/components/kit/variants/progress-aui-105.d.ts +32 -0
- package/dist/types/components/kit/variants/progress-aui-106.d.ts +29 -0
- package/dist/types/components/kit/variants/prompt-composer-aui-237.d.ts +26 -0
- package/dist/types/components/kit/variants/prompt-composer-aui-238.d.ts +33 -0
- package/dist/types/components/kit/variants/properties-panel-aui-199.d.ts +30 -0
- package/dist/types/components/kit/variants/properties-panel-aui-200.d.ts +40 -0
- package/dist/types/components/kit/variants/range-slider-aui-117.d.ts +35 -0
- package/dist/types/components/kit/variants/range-slider-aui-118.d.ts +39 -0
- package/dist/types/components/kit/variants/rating-aui-103.d.ts +25 -0
- package/dist/types/components/kit/variants/rating-aui-104.d.ts +20 -0
- package/dist/types/components/kit/variants/roles-permissions-aui-073.d.ts +39 -0
- package/dist/types/components/kit/variants/roles-permissions-aui-074.d.ts +31 -0
- package/dist/types/components/kit/variants/scrub-input-aui-133.d.ts +23 -0
- package/dist/types/components/kit/variants/scrub-input-aui-134.d.ts +29 -0
- package/dist/types/components/kit/variants/security-settings-aui-075.d.ts +29 -0
- package/dist/types/components/kit/variants/security-settings-aui-076.d.ts +33 -0
- package/dist/types/components/kit/variants/segmented-control-aui-135.d.ts +27 -0
- package/dist/types/components/kit/variants/segmented-control-aui-136.d.ts +29 -0
- package/dist/types/components/kit/variants/settings-panel-aui-203.d.ts +33 -0
- package/dist/types/components/kit/variants/settings-panel-aui-204.d.ts +26 -0
- package/dist/types/components/kit/variants/sidebar-aui-207.d.ts +39 -0
- package/dist/types/components/kit/variants/sidebar-aui-208.d.ts +47 -0
- package/dist/types/components/kit/variants/skeleton-aui-101.d.ts +38 -0
- package/dist/types/components/kit/variants/skeleton-aui-102.d.ts +30 -0
- package/dist/types/components/kit/variants/sortable-list-aui-187.d.ts +30 -0
- package/dist/types/components/kit/variants/sortable-list-aui-188.d.ts +35 -0
- package/dist/types/components/kit/variants/spinner-aui-097.d.ts +21 -0
- package/dist/types/components/kit/variants/spinner-aui-098.d.ts +25 -0
- package/dist/types/components/kit/variants/stat-card-aui-163.d.ts +26 -0
- package/dist/types/components/kit/variants/stat-card-aui-164.d.ts +37 -0
- package/dist/types/components/kit/variants/status-page-aui-083.d.ts +25 -0
- package/dist/types/components/kit/variants/status-page-aui-084.d.ts +32 -0
- package/dist/types/components/kit/variants/stepper-aui-151.d.ts +34 -0
- package/dist/types/components/kit/variants/stepper-aui-152.d.ts +29 -0
- package/dist/types/components/kit/variants/tabs-aui-137.d.ts +33 -0
- package/dist/types/components/kit/variants/tabs-aui-138.d.ts +33 -0
- package/dist/types/components/kit/variants/team-members-aui-221.d.ts +33 -0
- package/dist/types/components/kit/variants/team-members-aui-222.d.ts +26 -0
- package/dist/types/components/kit/variants/testimonials-aui-235.d.ts +29 -0
- package/dist/types/components/kit/variants/testimonials-aui-236.d.ts +33 -0
- package/dist/types/components/kit/variants/thinking-aui-129.d.ts +28 -0
- package/dist/types/components/kit/variants/thinking-aui-130.d.ts +23 -0
- package/dist/types/components/kit/variants/timeline-aui-159.d.ts +33 -0
- package/dist/types/components/kit/variants/timeline-aui-160.d.ts +28 -0
- package/dist/types/components/kit/variants/toast-aui-145.d.ts +27 -0
- package/dist/types/components/kit/variants/toast-aui-146.d.ts +38 -0
- package/dist/types/components/kit/variants/toggle-group-aui-115.d.ts +23 -0
- package/dist/types/components/kit/variants/toggle-group-aui-116.d.ts +27 -0
- package/dist/types/components/kit/variants/tool-approval-aui-195.d.ts +34 -0
- package/dist/types/components/kit/variants/tool-approval-aui-196.d.ts +41 -0
- package/dist/types/components/kit/variants/tool-dock-aui-177.d.ts +31 -0
- package/dist/types/components/kit/variants/tool-dock-aui-178.d.ts +24 -0
- package/dist/types/components/kit/variants/tooltip-aui-099.d.ts +21 -0
- package/dist/types/components/kit/variants/tooltip-aui-100.d.ts +28 -0
- package/dist/types/components/kit/variants/trace-waterfall-aui-239.d.ts +33 -0
- package/dist/types/components/kit/variants/trace-waterfall-aui-240.d.ts +38 -0
- package/dist/types/components/kit/variants/tree-view-aui-171.d.ts +18 -0
- package/dist/types/components/kit/variants/tree-view-aui-172.d.ts +31 -0
- package/dist/types/components/kit/variants/usage-overview-aui-069.d.ts +40 -0
- package/dist/types/components/kit/variants/usage-overview-aui-070.d.ts +30 -0
- package/dist/types/components/kit/variants/webhooks-aui-077.d.ts +39 -0
- package/dist/types/components/kit/variants/webhooks-aui-078.d.ts +37 -0
- package/dist/types/components/kit/variants/whats-new-aui-085.d.ts +35 -0
- package/dist/types/components/kit/variants/whats-new-aui-086.d.ts +31 -0
- package/dist/types/components/kit/variants/workspace-switcher-aui-175.d.ts +29 -0
- package/dist/types/components/kit/variants/workspace-switcher-aui-176.d.ts +38 -0
- package/dist/types/components/kit/webhooks.d.ts +69 -0
- package/dist/types/components/kit/whats-new.d.ts +74 -0
- package/dist/types/packages/asta-ui/src/accordion-aui-143.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/accordion-aui-144.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/agent-plan-aui-197.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/agent-plan-aui-198.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/ai-chat-aui-215.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/ai-chat-aui-216.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/alert-aui-107.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/alert-aui-108.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/announcement-bar-aui-181.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/announcement-bar-aui-182.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/api-keys-aui-241.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/api-keys-aui-242.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/audit-log-aui-071.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/audit-log-aui-072.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/audit-log.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-aui-093.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-aui-094.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-group-aui-121.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-group-aui-122.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/badge-aui-091.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/badge-aui-092.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/accordion-aui-143.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/accordion-aui-144.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/agent-plan-aui-197.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/agent-plan-aui-198.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/ai-chat-aui-215.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/ai-chat-aui-216.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/alert-aui-107.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/alert-aui-108.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/announcement-bar-aui-181.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/announcement-bar-aui-182.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/api-keys-aui-241.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/api-keys-aui-242.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/audit-log-aui-071.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/audit-log-aui-072.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/audit-log.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-aui-093.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-aui-094.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-group-aui-121.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-group-aui-122.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/badge-aui-091.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/badge-aui-092.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/billing-aui-233.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/billing-aui-234.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/breadcrumb-aui-109.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/breadcrumb-aui-110.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cancel-flow-aui-087.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cancel-flow-aui-088.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cancel-flow.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/carousel-aui-161.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/carousel-aui-162.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/chart-card-aui-225.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/chart-card-aui-226.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/checkout-aui-219.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/checkout-aui-220.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/citations-aui-193.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/citations-aui-194.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/color-picker-aui-119.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/color-picker-aui-120.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/command-palette-aui-201.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/command-palette-aui-202.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/comments-aui-213.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/comments-aui-214.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-menu-aui-167.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-menu-aui-168.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-meter-aui-131.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-meter-aui-132.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cookie-consent-aui-189.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cookie-consent-aui-190.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/copy-button-aui-113.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/copy-button-aui-114.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/countdown-aui-125.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/countdown-aui-126.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/data-table-aui-205.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/data-table-aui-206.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dialog-aui-149.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dialog-aui-150.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/drawer-aui-157.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/drawer-aui-158.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dropdown-menu-aui-141.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dropdown-menu-aui-142.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/empty-state-aui-165.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/empty-state-aui-166.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/event-calendar-aui-217.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/event-calendar-aui-218.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/feature-flags-aui-079.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/feature-flags-aui-080.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/feature-flags.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/field-aui-139.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/field-aui-140.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-card-aui-173.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-card-aui-174.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-manager-aui-231.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-manager-aui-232.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-upload-aui-153.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-upload-aui-154.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/hover-card-aui-169.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/hover-card-aui-170.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/image-compare-aui-179.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/image-compare-aui-180.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inbox-aui-229.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inbox-aui-230.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inline-edit-aui-123.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inline-edit-aui-124.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/integrations-aui-081.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/integrations-aui-082.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/integrations.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/invoice-aui-227.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/invoice-aui-228.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kanban-aui-209.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kanban-aui-210.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kbd-aui-095.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kbd-aui-096.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/menubar-aui-183.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/menubar-aui-184.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/meter-aui-127.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/meter-aui-128.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/model-picker-aui-191.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/model-picker-aui-192.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/motion-button-aui-089.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/motion-button-aui-090.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/notification-center-aui-223.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/notification-center-aui-224.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/number-input-aui-147.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/number-input-aui-148.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/onboarding-aui-211.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/onboarding-aui-212.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/pagination-aui-111.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/pagination-aui-112.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/phone-input-aui-185.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/phone-input-aui-186.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/popover-aui-155.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/popover-aui-156.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/progress-aui-105.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/progress-aui-106.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/prompt-composer-aui-237.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/prompt-composer-aui-238.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/properties-panel-aui-199.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/properties-panel-aui-200.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/range-slider-aui-117.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/range-slider-aui-118.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/rating-aui-103.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/rating-aui-104.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/roles-permissions-aui-073.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/roles-permissions-aui-074.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/roles-permissions.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/scrub-input-aui-133.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/scrub-input-aui-134.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/security-settings-aui-075.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/security-settings-aui-076.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/security-settings.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/segmented-control-aui-135.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/segmented-control-aui-136.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/settings-panel-aui-203.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/settings-panel-aui-204.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sidebar-aui-207.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sidebar-aui-208.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/skeleton-aui-101.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/skeleton-aui-102.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sortable-list-aui-187.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sortable-list-aui-188.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/spinner-aui-097.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/spinner-aui-098.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stat-card-aui-163.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stat-card-aui-164.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/status-page-aui-083.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/status-page-aui-084.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/status-page.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stepper-aui-151.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stepper-aui-152.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tabs-aui-137.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tabs-aui-138.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/team-members-aui-221.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/team-members-aui-222.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/testimonials-aui-235.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/testimonials-aui-236.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/thinking-aui-129.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/thinking-aui-130.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/timeline-aui-159.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/timeline-aui-160.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toast-aui-145.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toast-aui-146.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toggle-group-aui-115.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toggle-group-aui-116.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-approval-aui-195.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-approval-aui-196.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-dock-aui-177.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-dock-aui-178.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tooltip-aui-099.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tooltip-aui-100.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/trace-waterfall-aui-239.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/trace-waterfall-aui-240.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tree-view-aui-171.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tree-view-aui-172.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/usage-overview-aui-069.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/usage-overview-aui-070.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/usage-overview.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/webhooks-aui-077.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/webhooks-aui-078.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/webhooks.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/whats-new-aui-085.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/whats-new-aui-086.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/whats-new.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/workspace-switcher-aui-175.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/workspace-switcher-aui-176.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base.d.ts +369 -1
- package/dist/types/packages/asta-ui/src/billing-aui-233.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/billing-aui-234.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/breadcrumb-aui-109.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/breadcrumb-aui-110.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cancel-flow-aui-087.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cancel-flow-aui-088.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cancel-flow.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/carousel-aui-161.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/carousel-aui-162.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/chart-card-aui-225.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/chart-card-aui-226.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/checkout-aui-219.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/checkout-aui-220.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/citations-aui-193.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/citations-aui-194.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/color-picker-aui-119.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/color-picker-aui-120.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/command-palette-aui-201.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/command-palette-aui-202.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/comments-aui-213.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/comments-aui-214.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-menu-aui-167.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-menu-aui-168.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-meter-aui-131.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-meter-aui-132.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cookie-consent-aui-189.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cookie-consent-aui-190.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/copy-button-aui-113.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/copy-button-aui-114.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/countdown-aui-125.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/countdown-aui-126.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/data-table-aui-205.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/data-table-aui-206.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dialog-aui-149.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dialog-aui-150.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/drawer-aui-157.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/drawer-aui-158.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dropdown-menu-aui-141.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dropdown-menu-aui-142.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/empty-state-aui-165.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/empty-state-aui-166.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/event-calendar-aui-217.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/event-calendar-aui-218.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/feature-flags-aui-079.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/feature-flags-aui-080.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/feature-flags.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/field-aui-139.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/field-aui-140.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-card-aui-173.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-card-aui-174.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-manager-aui-231.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-manager-aui-232.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-upload-aui-153.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-upload-aui-154.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/hover-card-aui-169.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/hover-card-aui-170.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/image-compare-aui-179.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/image-compare-aui-180.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/inbox-aui-229.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/inbox-aui-230.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/index.d.ts +369 -1
- package/dist/types/packages/asta-ui/src/inline-edit-aui-123.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/inline-edit-aui-124.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/integrations-aui-081.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/integrations-aui-082.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/integrations.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/invoice-aui-227.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/invoice-aui-228.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kanban-aui-209.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kanban-aui-210.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kbd-aui-095.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kbd-aui-096.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/menubar-aui-183.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/menubar-aui-184.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/meter-aui-127.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/meter-aui-128.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/model-picker-aui-191.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/model-picker-aui-192.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/motion-button-aui-089.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/motion-button-aui-090.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/notification-center-aui-223.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/notification-center-aui-224.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/number-input-aui-147.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/number-input-aui-148.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/onboarding-aui-211.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/onboarding-aui-212.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/pagination-aui-111.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/pagination-aui-112.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/phone-input-aui-185.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/phone-input-aui-186.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/popover-aui-155.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/popover-aui-156.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/progress-aui-105.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/progress-aui-106.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/prompt-composer-aui-237.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/prompt-composer-aui-238.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/properties-panel-aui-199.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/properties-panel-aui-200.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/range-slider-aui-117.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/range-slider-aui-118.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/rating-aui-103.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/rating-aui-104.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/roles-permissions-aui-073.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/roles-permissions-aui-074.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/roles-permissions.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/scrub-input-aui-133.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/scrub-input-aui-134.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/security-settings-aui-075.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/security-settings-aui-076.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/security-settings.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/segmented-control-aui-135.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/segmented-control-aui-136.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/settings-panel-aui-203.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/settings-panel-aui-204.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sidebar-aui-207.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sidebar-aui-208.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/skeleton-aui-101.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/skeleton-aui-102.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sortable-list-aui-187.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sortable-list-aui-188.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/spinner-aui-097.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/spinner-aui-098.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stat-card-aui-163.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stat-card-aui-164.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/status-page-aui-083.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/status-page-aui-084.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/status-page.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stepper-aui-151.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stepper-aui-152.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tabs-aui-137.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tabs-aui-138.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/team-members-aui-221.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/team-members-aui-222.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/testimonials-aui-235.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/testimonials-aui-236.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/thinking-aui-129.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/thinking-aui-130.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/timeline-aui-159.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/timeline-aui-160.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toast-aui-145.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toast-aui-146.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toggle-group-aui-115.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toggle-group-aui-116.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-approval-aui-195.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-approval-aui-196.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-dock-aui-177.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-dock-aui-178.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tooltip-aui-099.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tooltip-aui-100.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/trace-waterfall-aui-239.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/trace-waterfall-aui-240.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tree-view-aui-171.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tree-view-aui-172.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/usage-overview-aui-069.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/usage-overview-aui-070.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/usage-overview.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/webhooks-aui-077.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/webhooks-aui-078.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/webhooks.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/whats-new-aui-085.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/whats-new-aui-086.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/whats-new.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/workspace-switcher-aui-175.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/workspace-switcher-aui-176.d.ts +2 -0
- package/dist/usage-overview-aui-069.d.ts +2 -0
- package/dist/usage-overview-aui-069.js +10 -0
- package/dist/usage-overview-aui-070.d.ts +2 -0
- package/dist/usage-overview-aui-070.js +10 -0
- package/dist/usage-overview.d.ts +2 -0
- package/dist/usage-overview.js +10 -0
- package/dist/webhooks-aui-077.d.ts +2 -0
- package/dist/webhooks-aui-077.js +10 -0
- package/dist/webhooks-aui-078.d.ts +2 -0
- package/dist/webhooks-aui-078.js +10 -0
- package/dist/webhooks.d.ts +2 -0
- package/dist/webhooks.js +10 -0
- package/dist/whats-new-aui-085.d.ts +2 -0
- package/dist/whats-new-aui-085.js +10 -0
- package/dist/whats-new-aui-086.d.ts +2 -0
- package/dist/whats-new-aui-086.js +9 -0
- package/dist/whats-new.d.ts +2 -0
- package/dist/whats-new.js +15 -0
- package/dist/workspace-switcher-aui-175.d.ts +2 -0
- package/dist/workspace-switcher-aui-175.js +9 -0
- package/dist/workspace-switcher-aui-176.d.ts +2 -0
- package/dist/workspace-switcher-aui-176.js +9 -0
- package/package.json +1 -1
package/css/asta.js
CHANGED
|
@@ -439,7 +439,7 @@
|
|
|
439
439
|
else boot();
|
|
440
440
|
document.addEventListener("htmx:afterSettle", (e) => scan(e.detail?.elt?.parentElement || document));
|
|
441
441
|
|
|
442
|
-
window.asta = { toast, open: (id) => open(byId(id)), close: (id) => close(byId(id)), version: "0.
|
|
442
|
+
window.asta = { toast, open: (id) => open(byId(id)), close: (id) => close(byId(id)), version: "0.11.0" };
|
|
443
443
|
})();
|
|
444
444
|
|
|
445
445
|
/* ---- runtime/agent.js ---- */
|
|
@@ -6600,3 +6600,2695 @@
|
|
|
6600
6600
|
else watch();
|
|
6601
6601
|
document.addEventListener("htmx:afterSettle", watch);
|
|
6602
6602
|
})();
|
|
6603
|
+
|
|
6604
|
+
/* ---- runtime/saas.js ---- */
|
|
6605
|
+
/* SaaS organisms: usage overview, audit log, roles and permissions, security settings, webhooks, feature flags,
|
|
6606
|
+
* integrations, status page, what's new, cancel flow.
|
|
6607
|
+
* Event delegation on document, so markup swapped in by htmx works without re-init. Each block below documents its
|
|
6608
|
+
* data-* hooks and the "asta:*" events it fires; see css/examples/<slug>.html for the wiring.
|
|
6609
|
+
*/
|
|
6610
|
+
(() => {
|
|
6611
|
+
if (window.astaSaas) return;
|
|
6612
|
+
window.astaSaas = true;
|
|
6613
|
+
const el = (e) => (e.target instanceof Element ? e.target : null);
|
|
6614
|
+
const near = (e, sel) => el(e)?.closest(sel) ?? null;
|
|
6615
|
+
const fire = (node, name, detail) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, detail }));
|
|
6616
|
+
|
|
6617
|
+
/* ---------- usage-overview ---------- */
|
|
6618
|
+
/* ---------- Usage overview ----------
|
|
6619
|
+
* [data-asta-usage] (data-start="YYYY-MM-DD", data-days, data-elapsed for the period shown)
|
|
6620
|
+
* [data-asta-usage-period="this|last|prev|next"] sets aria-pressed on the two segment buttons and fires
|
|
6621
|
+
* "asta:usage-period" with detail.period. Put hx-get on those buttons to swap in the other period.
|
|
6622
|
+
* [data-asta-usage-select] picks a meter: aria-pressed, data-selected on its row, and the chart redraws from the
|
|
6623
|
+
* row's data-daily, data-included, data-label, data-unit, data-compact and data-level (a level such as seats).
|
|
6624
|
+
* [data-asta-usage-plot] shows a tip on hover and reads days with ←/→, Home, End. Esc hides the tip.
|
|
6625
|
+
* [data-asta-usage-alert] opens the row's alert form, checked on blur and submit (a whole number 1–200). Without
|
|
6626
|
+
* hx-post or action it saves after a moment; either way it fires "asta:usage-alert" with detail.id and
|
|
6627
|
+
* detail.threshold (null for [data-asta-usage-alert-remove]). Esc closes the form.
|
|
6628
|
+
*/
|
|
6629
|
+
{
|
|
6630
|
+
const uNear = (e, sel) => (e.target instanceof Element ? e.target.closest(sel) : null);
|
|
6631
|
+
const uFire = (node, name, detail) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, detail }));
|
|
6632
|
+
const uFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
6633
|
+
// Formatters are built once.
|
|
6634
|
+
const NUM = new Intl.NumberFormat("en-US", { maximumFractionDigits: 1 });
|
|
6635
|
+
const COMPACT = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 });
|
|
6636
|
+
const DAYF = new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric", timeZone: "UTC" });
|
|
6637
|
+
const W = 20;
|
|
6638
|
+
const H = 160;
|
|
6639
|
+
|
|
6640
|
+
const say = (root, text) => {
|
|
6641
|
+
const s = root.querySelector("[data-asta-usage-status]");
|
|
6642
|
+
if (s) s.textContent = text;
|
|
6643
|
+
};
|
|
6644
|
+
const niceMax = (v) => {
|
|
6645
|
+
if (v <= 0) return 1;
|
|
6646
|
+
const p = 10 ** Math.floor(Math.log10(v));
|
|
6647
|
+
return ([1, 2, 2.5, 5, 10].find((s) => s * p >= v) ?? 10) * p;
|
|
6648
|
+
};
|
|
6649
|
+
|
|
6650
|
+
// Everything the chart needs, read from the row and the root.
|
|
6651
|
+
function model(root, li) {
|
|
6652
|
+
const d = li.dataset;
|
|
6653
|
+
const n = Number(root.dataset.days) || 30;
|
|
6654
|
+
const level = d.level !== undefined;
|
|
6655
|
+
const included = Number(d.included) || 0;
|
|
6656
|
+
const start = Date.parse(root.dataset.start || "") || Date.now();
|
|
6657
|
+
return {
|
|
6658
|
+
n,
|
|
6659
|
+
level,
|
|
6660
|
+
label: d.label || "Usage",
|
|
6661
|
+
unit: d.unit || "",
|
|
6662
|
+
compact: d.compact !== undefined,
|
|
6663
|
+
elapsed: Math.min(n, Number(root.dataset.elapsed) || n),
|
|
6664
|
+
daily: (d.daily || "").split(",").filter(Boolean).map(Number),
|
|
6665
|
+
perDay: level ? included : included / n,
|
|
6666
|
+
day: (i) => DAYF.format(new Date(start + i * 86_400_000)),
|
|
6667
|
+
};
|
|
6668
|
+
}
|
|
6669
|
+
const amount = (m, v) => `${(m.compact ? COMPACT : NUM).format(v)}${m.unit ? ` ${m.unit}` : ""}`;
|
|
6670
|
+
const short = (m, v) => (m.compact || v >= 10_000 ? COMPACT : NUM).format(v);
|
|
6671
|
+
function describe(m, i) {
|
|
6672
|
+
const v = m.daily[i];
|
|
6673
|
+
if (i >= m.elapsed || v === undefined) return `${m.day(i)}: no data yet`;
|
|
6674
|
+
return `${m.day(i)}: ${amount(m, v)}, ${m.perDay > 0 ? Math.round((v / m.perDay) * 100) : 0}% of the daily ${m.level ? "limit" : "pace"}`;
|
|
6675
|
+
}
|
|
6676
|
+
|
|
6677
|
+
function draw(root, li) {
|
|
6678
|
+
const chart = root.querySelector("[data-asta-usage-chart]");
|
|
6679
|
+
const plot = chart?.querySelector("[data-asta-usage-plot]");
|
|
6680
|
+
if (!plot) return;
|
|
6681
|
+
const m = model(root, li);
|
|
6682
|
+
const top = niceMax(Math.max(m.perDay, ...m.daily) * 1.1);
|
|
6683
|
+
const y = (v) => H - (v / top) * H;
|
|
6684
|
+
const ns = "http://www.w3.org/2000/svg";
|
|
6685
|
+
const svg = document.createElementNS(ns, "svg");
|
|
6686
|
+
svg.setAttribute("viewBox", `0 0 ${m.n * W} ${H}`);
|
|
6687
|
+
svg.setAttribute("preserveAspectRatio", "none");
|
|
6688
|
+
svg.setAttribute("aria-hidden", "true");
|
|
6689
|
+
const add = (tag, attrs) => {
|
|
6690
|
+
const node = document.createElementNS(ns, tag);
|
|
6691
|
+
for (const k in attrs) node.setAttribute(k, attrs[k]);
|
|
6692
|
+
svg.append(node);
|
|
6693
|
+
return node;
|
|
6694
|
+
};
|
|
6695
|
+
for (const t of [0, 0.5, 1]) add("line", { x1: 0, x2: m.n * W, y1: H * t, y2: H * t, "vector-effect": "non-scaling-stroke" });
|
|
6696
|
+
for (let i = 0; i < m.n; i++) {
|
|
6697
|
+
const v = m.daily[i];
|
|
6698
|
+
const future = i >= m.elapsed || v === undefined;
|
|
6699
|
+
const h = future ? 2 : Math.max(2, H - y(v));
|
|
6700
|
+
const r = add("rect", { x: i * W + 3, width: W - 6, y: H - h, height: h, rx: 2, "data-day": i });
|
|
6701
|
+
if (future) r.setAttribute("data-future", "");
|
|
6702
|
+
else {
|
|
6703
|
+
if (v > m.perDay) r.setAttribute("data-over", "");
|
|
6704
|
+
r.style.animationDelay = `${Math.min(i * 14, 400)}ms`;
|
|
6705
|
+
}
|
|
6706
|
+
}
|
|
6707
|
+
add("line", { x1: 0, x2: m.n * W, y1: y(m.perDay), y2: y(m.perDay), "stroke-width": 1.5, "stroke-dasharray": "5 4", "vector-effect": "non-scaling-stroke", "data-pace": "" });
|
|
6708
|
+
for (let i = 0; i < m.n; i++) add("rect", { x: i * W, width: W, height: H, fill: "transparent", "data-hit": i });
|
|
6709
|
+
plot.querySelector("svg")?.replaceWith(svg);
|
|
6710
|
+
|
|
6711
|
+
const ys = chart.querySelectorAll(".asta-usage-overview-yaxis > span");
|
|
6712
|
+
[top, top / 2, 0].forEach((v, i) => ys[i] && (ys[i].textContent = short(m, v)));
|
|
6713
|
+
const pace = plot.querySelector(".asta-usage-overview-pace");
|
|
6714
|
+
if (pace) {
|
|
6715
|
+
pace.style.top = `${(y(m.perDay) / H) * 100}%`;
|
|
6716
|
+
pace.textContent = `${m.level ? "Included" : "Daily pace"} ${short(m, m.perDay)}`;
|
|
6717
|
+
}
|
|
6718
|
+
const x = plot.querySelector(".asta-usage-overview-xaxis");
|
|
6719
|
+
if (x) {
|
|
6720
|
+
x.textContent = "";
|
|
6721
|
+
const n = m.n;
|
|
6722
|
+
for (const d of [0, 7, 14, 21, n - 1].filter((d, i, a) => d < n && a.indexOf(d) === i && (d === n - 1 || n - 1 - d > 3))) {
|
|
6723
|
+
const s = document.createElement("span");
|
|
6724
|
+
s.style.left = `${((d + 0.5) / n) * 100}%`;
|
|
6725
|
+
s.textContent = m.day(d);
|
|
6726
|
+
x.append(s);
|
|
6727
|
+
}
|
|
6728
|
+
}
|
|
6729
|
+
const head = chart.querySelector(".asta-usage-overview-chart-head");
|
|
6730
|
+
if (head) {
|
|
6731
|
+
head.querySelector("h4").textContent = `${m.label} per day`;
|
|
6732
|
+
head.querySelector("p").textContent = m.level ? "Included limit" : "Daily pace that stays within the plan";
|
|
6733
|
+
}
|
|
6734
|
+
const used = li.dataset.used ? Number(li.dataset.used) : m.daily.reduce((a, b) => a + b, 0);
|
|
6735
|
+
plot.setAttribute("aria-label", `${m.label} per day. ${amount(m, used)} of ${amount(m, Number(li.dataset.included) || 0)}. Arrow keys move between days.`);
|
|
6736
|
+
plot._m = m;
|
|
6737
|
+
tip(plot, null);
|
|
6738
|
+
}
|
|
6739
|
+
|
|
6740
|
+
// Server-rendered charts read their model on first use.
|
|
6741
|
+
function ensure(plot) {
|
|
6742
|
+
const root = plot.closest("[data-asta-usage]");
|
|
6743
|
+
const li = root?.querySelector(".asta-usage-overview-meter[data-selected]");
|
|
6744
|
+
if (!plot._m && li) plot._m = model(root, li);
|
|
6745
|
+
return plot._m;
|
|
6746
|
+
}
|
|
6747
|
+
|
|
6748
|
+
function tip(plot, i) {
|
|
6749
|
+
if (i !== null) ensure(plot);
|
|
6750
|
+
const box = plot.querySelector(".asta-usage-overview-tip");
|
|
6751
|
+
plot.querySelectorAll("rect[data-on]").forEach((r) => r.removeAttribute("data-on"));
|
|
6752
|
+
plot._i = i;
|
|
6753
|
+
if (i === null || !plot._m) {
|
|
6754
|
+
plot.removeAttribute("data-active");
|
|
6755
|
+
if (box) box.hidden = true;
|
|
6756
|
+
return;
|
|
6757
|
+
}
|
|
6758
|
+
const m = plot._m;
|
|
6759
|
+
plot.setAttribute("data-active", "");
|
|
6760
|
+
plot.querySelector(`rect[data-day="${i}"]`)?.setAttribute("data-on", "");
|
|
6761
|
+
if (!box) return;
|
|
6762
|
+
box.hidden = false;
|
|
6763
|
+
box.textContent = describe(m, i);
|
|
6764
|
+
box.style.left = `${((i + 0.5) / m.n) * 100}%`;
|
|
6765
|
+
box.style.transform = `translateX(${i < 3 ? -12 : i > m.n - 4 ? -88 : -50}%)`;
|
|
6766
|
+
}
|
|
6767
|
+
|
|
6768
|
+
function openAlert(li) {
|
|
6769
|
+
const form = li.querySelector("[data-asta-usage-alert-form]");
|
|
6770
|
+
const btn = li.querySelector("[data-asta-usage-alert]");
|
|
6771
|
+
if (!form) return;
|
|
6772
|
+
form.hidden = false;
|
|
6773
|
+
btn?.setAttribute("aria-expanded", "true");
|
|
6774
|
+
const input = form.querySelector("input[name=threshold]");
|
|
6775
|
+
if (input) input.value = btn?.dataset.value || "80";
|
|
6776
|
+
showMsg(form, null);
|
|
6777
|
+
form.querySelector(".asta-usage-overview-alert-error")?.setAttribute("hidden", "");
|
|
6778
|
+
form.querySelector("[data-asta-usage-alert-remove]")?.toggleAttribute("hidden", !btn?.dataset.value);
|
|
6779
|
+
uFocus(input);
|
|
6780
|
+
}
|
|
6781
|
+
function closeAlert(li, focus = true) {
|
|
6782
|
+
const form = li.querySelector("[data-asta-usage-alert-form]");
|
|
6783
|
+
const btn = li.querySelector("[data-asta-usage-alert]");
|
|
6784
|
+
if (form) form.hidden = true;
|
|
6785
|
+
btn?.setAttribute("aria-expanded", "false");
|
|
6786
|
+
if (focus) uFocus(btn);
|
|
6787
|
+
}
|
|
6788
|
+
function showMsg(form, error) {
|
|
6789
|
+
const input = form.querySelector("input[name=threshold]");
|
|
6790
|
+
const msg = form.querySelector(".asta-usage-overview-msg");
|
|
6791
|
+
if (error) input?.setAttribute("aria-invalid", "true");
|
|
6792
|
+
else input?.removeAttribute("aria-invalid");
|
|
6793
|
+
if (!msg) return;
|
|
6794
|
+
msg.toggleAttribute("data-error", !!error);
|
|
6795
|
+
const text = msg.querySelector("span:last-child") ?? msg;
|
|
6796
|
+
text.textContent = error || msg.dataset.hint || "";
|
|
6797
|
+
}
|
|
6798
|
+
function check(form) {
|
|
6799
|
+
const v = form.querySelector("input[name=threshold]")?.value ?? "";
|
|
6800
|
+
const n = Number(v);
|
|
6801
|
+
const error = v.trim() === "" || !Number.isInteger(n) || n < 1 || n > 200 ? "Enter a whole number from 1 to 200." : null;
|
|
6802
|
+
showMsg(form, error);
|
|
6803
|
+
return !error;
|
|
6804
|
+
}
|
|
6805
|
+
function setAlert(root, li, value) {
|
|
6806
|
+
const btn = li.querySelector("[data-asta-usage-alert]");
|
|
6807
|
+
const label = li.dataset.label || "this meter";
|
|
6808
|
+
if (btn) {
|
|
6809
|
+
btn.toggleAttribute("data-set", value !== null);
|
|
6810
|
+
if (value === null) delete btn.dataset.value;
|
|
6811
|
+
else btn.dataset.value = String(value);
|
|
6812
|
+
const text = btn.querySelector("span:last-child");
|
|
6813
|
+
if (text) text.textContent = value === null ? "Set alert" : `At ${value}%`;
|
|
6814
|
+
btn.setAttribute("aria-label", value === null ? `Set alert for ${label}` : `Alert for ${label} at ${value}%. Change alert`);
|
|
6815
|
+
}
|
|
6816
|
+
closeAlert(li);
|
|
6817
|
+
say(root, value === null ? `Alert for ${label} removed.` : `Alert saved. We'll email you when ${label} reaches ${value}%.`);
|
|
6818
|
+
uFire(li, "asta:usage-alert", { id: li.dataset.id, threshold: value });
|
|
6819
|
+
}
|
|
6820
|
+
// Demo save: a short wait so the busy state shows, then the button takes the new value.
|
|
6821
|
+
function demoSave(root, li, value) {
|
|
6822
|
+
const submit = li.querySelector(".asta-usage-overview-alert button[type=submit]");
|
|
6823
|
+
const label = submit?.textContent;
|
|
6824
|
+
if (submit) {
|
|
6825
|
+
submit.disabled = true;
|
|
6826
|
+
submit.setAttribute("aria-busy", "true");
|
|
6827
|
+
submit.textContent = "Saving…";
|
|
6828
|
+
}
|
|
6829
|
+
setTimeout(() => {
|
|
6830
|
+
if (submit) {
|
|
6831
|
+
submit.disabled = false;
|
|
6832
|
+
submit.removeAttribute("aria-busy");
|
|
6833
|
+
submit.textContent = label;
|
|
6834
|
+
}
|
|
6835
|
+
setAlert(root, li, value);
|
|
6836
|
+
}, 600);
|
|
6837
|
+
}
|
|
6838
|
+
|
|
6839
|
+
document.addEventListener("click", (e) => {
|
|
6840
|
+
const root = uNear(e, "[data-asta-usage]");
|
|
6841
|
+
if (!root) return;
|
|
6842
|
+
const li = uNear(e, ".asta-usage-overview-meter");
|
|
6843
|
+
const period = uNear(e, "[data-asta-usage-period]");
|
|
6844
|
+
if (period) {
|
|
6845
|
+
const v = period.getAttribute("data-asta-usage-period");
|
|
6846
|
+
if (v === "this" || v === "last") root.querySelectorAll(".asta-usage-overview-segment > button").forEach((b) => b.setAttribute("aria-pressed", String(b === period)));
|
|
6847
|
+
uFire(root, "asta:usage-period", { period: v });
|
|
6848
|
+
} else if (li && uNear(e, "[data-asta-usage-select]")) {
|
|
6849
|
+
root.querySelectorAll(".asta-usage-overview-meter").forEach((row) => {
|
|
6850
|
+
row.toggleAttribute("data-selected", row === li);
|
|
6851
|
+
row.querySelector("[data-asta-usage-select]")?.setAttribute("aria-pressed", String(row === li));
|
|
6852
|
+
});
|
|
6853
|
+
draw(root, li);
|
|
6854
|
+
say(root, `Showing ${li.dataset.label || "usage"} per day.`);
|
|
6855
|
+
uFire(li, "asta:usage-meter", { id: li.dataset.id });
|
|
6856
|
+
} else if (li && uNear(e, "[data-asta-usage-alert]")) {
|
|
6857
|
+
if (li.querySelector("[data-asta-usage-alert-form]")?.hidden === false) closeAlert(li);
|
|
6858
|
+
else openAlert(li);
|
|
6859
|
+
} else if (li && uNear(e, "[data-asta-usage-alert-remove]")) demoSave(root, li, null);
|
|
6860
|
+
});
|
|
6861
|
+
|
|
6862
|
+
// Capture phase, so an invalid form never reaches htmx or the browser.
|
|
6863
|
+
document.addEventListener(
|
|
6864
|
+
"submit",
|
|
6865
|
+
(e) => {
|
|
6866
|
+
const form = e.target instanceof HTMLFormElement && e.target.matches("[data-asta-usage-alert-form]") ? e.target : null;
|
|
6867
|
+
const li = form?.closest(".asta-usage-overview-meter");
|
|
6868
|
+
const root = form?.closest("[data-asta-usage]");
|
|
6869
|
+
if (!li || !root) return;
|
|
6870
|
+
if (!check(form)) {
|
|
6871
|
+
e.preventDefault();
|
|
6872
|
+
e.stopPropagation();
|
|
6873
|
+
uFocus(form.querySelector("input[name=threshold]"));
|
|
6874
|
+
return;
|
|
6875
|
+
}
|
|
6876
|
+
const remote = form.hasAttribute("action") || [...form.attributes].some((a) => /^(hx|data-hx)-(post|put)$/.test(a.name));
|
|
6877
|
+
if (!remote) {
|
|
6878
|
+
e.preventDefault();
|
|
6879
|
+
demoSave(root, li, Number(form.querySelector("input[name=threshold]").value));
|
|
6880
|
+
}
|
|
6881
|
+
},
|
|
6882
|
+
true,
|
|
6883
|
+
);
|
|
6884
|
+
|
|
6885
|
+
document.addEventListener("focusout", (e) => {
|
|
6886
|
+
const form = uNear(e, "[data-asta-usage-alert-form]");
|
|
6887
|
+
if (form && e.target.matches("input[name=threshold]")) check(form);
|
|
6888
|
+
const plot = uNear(e, "[data-asta-usage-plot]");
|
|
6889
|
+
if (plot && e.target === plot) tip(plot, null);
|
|
6890
|
+
});
|
|
6891
|
+
|
|
6892
|
+
document.addEventListener("pointerover", (e) => {
|
|
6893
|
+
const hit = uNear(e, "[data-asta-usage-plot] rect[data-hit]");
|
|
6894
|
+
if (hit) tip(hit.closest("[data-asta-usage-plot]"), Number(hit.getAttribute("data-hit")));
|
|
6895
|
+
});
|
|
6896
|
+
document.addEventListener("pointerout", (e) => {
|
|
6897
|
+
const plot = uNear(e, "[data-asta-usage-plot]");
|
|
6898
|
+
if (plot && !(e.relatedTarget instanceof Node && plot.contains(e.relatedTarget))) tip(plot, null);
|
|
6899
|
+
});
|
|
6900
|
+
|
|
6901
|
+
document.addEventListener("keydown", (e) => {
|
|
6902
|
+
const root = uNear(e, "[data-asta-usage]");
|
|
6903
|
+
if (!root) return;
|
|
6904
|
+
const form = uNear(e, "[data-asta-usage-alert-form]");
|
|
6905
|
+
if (form && e.key === "Escape") {
|
|
6906
|
+
e.preventDefault();
|
|
6907
|
+
closeAlert(form.closest(".asta-usage-overview-meter"));
|
|
6908
|
+
return;
|
|
6909
|
+
}
|
|
6910
|
+
const plot = e.target instanceof Element && e.target.matches("[data-asta-usage-plot]") ? e.target : null;
|
|
6911
|
+
if (!plot) return;
|
|
6912
|
+
const m = ensure(plot);
|
|
6913
|
+
if (!m) return;
|
|
6914
|
+
const last = Math.max(0, m.elapsed - 1);
|
|
6915
|
+
const cur = plot._i ?? null;
|
|
6916
|
+
const k = e.key;
|
|
6917
|
+
const next = k === "ArrowLeft" ? (cur ?? last + 1) - 1 : k === "ArrowRight" ? (cur ?? -1) + 1 : k === "Home" ? 0 : k === "End" ? last : k === "Escape" ? -1 : null;
|
|
6918
|
+
if (next === null) return;
|
|
6919
|
+
e.preventDefault();
|
|
6920
|
+
if (next < 0) return tip(plot, null);
|
|
6921
|
+
const i = Math.min(last, next);
|
|
6922
|
+
tip(plot, i);
|
|
6923
|
+
say(root, describe(m, i));
|
|
6924
|
+
});
|
|
6925
|
+
}
|
|
6926
|
+
|
|
6927
|
+
/* ---------- audit-log ---------- */
|
|
6928
|
+
/* ---------- Audit log ----------
|
|
6929
|
+
* [data-asta-audit] (data-range-default): rows are li.asta-audit-log-row with data-id, data-type, data-actor and
|
|
6930
|
+
* data-at (ISO time). [data-asta-audit-search] (Escape clears), [data-asta-audit-actor], the .asta-audit-log-range
|
|
6931
|
+
* buttons (data-range="24h|7d|30d") and the .asta-audit-log-chip toggles (data-type) filter rows in place: day
|
|
6932
|
+
* counts, the total, [data-asta-audit-clear] and .asta-audit-log-empty follow, and "asta:audit-filter" fires with
|
|
6933
|
+
* detail { query, actor, types, range } (answer it with hx-get if the server filters).
|
|
6934
|
+
* .asta-audit-log-summary opens its detail (one at a time). Escape inside closes it, arrows/Home/End move between rows.
|
|
6935
|
+
* [data-asta-audit-export] fires cancelable "asta:audit-export" with detail.rows; unless cancelled it downloads a CSV
|
|
6936
|
+
* of the shown rows. [data-asta-audit-more]: with hx-get, htmx adds the next page's day sections (hx-target="previous
|
|
6937
|
+
* .asta-audit-log-empty" hx-swap="beforebegin") and asta.js re-filters after the swap. Without it, the next template[data-asta-audit-page] is added after a short wait; when none are left the
|
|
6938
|
+
* button gives way to the end note. Fires "asta:audit-more".
|
|
6939
|
+
* data-now (ISO) on the root anchors the ranges. Without it, ranges count from the viewer's clock and
|
|
6940
|
+
* time[data-ago] labels are refreshed from datetime once a minute while the log is on screen. */
|
|
6941
|
+
{
|
|
6942
|
+
const auEl = (e) => (e.target instanceof Element ? e.target : null);
|
|
6943
|
+
const auNear = (e, sel) => auEl(e)?.closest(sel) ?? null;
|
|
6944
|
+
const auFire = (node, name, detail, cancelable = false) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, cancelable, detail }));
|
|
6945
|
+
const auFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
6946
|
+
const auRoot = (e) => auNear(e, "[data-asta-audit]");
|
|
6947
|
+
const AU_DAY = 86_400_000;
|
|
6948
|
+
const AU_RANGE = { "24h": AU_DAY, "7d": 7 * AU_DAY, "30d": 30 * AU_DAY };
|
|
6949
|
+
// data-now (ISO) anchors the ranges to the time the server rendered the page.
|
|
6950
|
+
const auNow = (root) => Date.parse(root.dataset.now ?? "") || Date.now();
|
|
6951
|
+
const auCount = (n) => `${n} ${n === 1 ? "event" : "events"}`;
|
|
6952
|
+
const auSay = (root, text) => {
|
|
6953
|
+
const s = root.querySelector("[data-asta-audit-status]");
|
|
6954
|
+
if (s) s.textContent = text;
|
|
6955
|
+
};
|
|
6956
|
+
|
|
6957
|
+
function auFilters(root) {
|
|
6958
|
+
return {
|
|
6959
|
+
query: (root.querySelector("[data-asta-audit-search]")?.value ?? "").trim().toLowerCase(),
|
|
6960
|
+
actor: root.querySelector("[data-asta-audit-actor]")?.value || null,
|
|
6961
|
+
types: [...root.querySelectorAll(".asta-audit-log-chip[aria-pressed=true]")].map((c) => c.dataset.type),
|
|
6962
|
+
range: root.querySelector(".asta-audit-log-range [aria-pressed=true]")?.dataset.range ?? "30d",
|
|
6963
|
+
};
|
|
6964
|
+
}
|
|
6965
|
+
|
|
6966
|
+
function auApply(root, announce) {
|
|
6967
|
+
const f = auFilters(root);
|
|
6968
|
+
const since = auNow(root) - (AU_RANGE[f.range] ?? Infinity);
|
|
6969
|
+
let total = 0;
|
|
6970
|
+
for (const day of root.querySelectorAll(".asta-audit-log-day")) {
|
|
6971
|
+
let n = 0;
|
|
6972
|
+
for (const row of day.querySelectorAll(".asta-audit-log-row")) {
|
|
6973
|
+
const at = Date.parse(row.dataset.at ?? "");
|
|
6974
|
+
const ok =
|
|
6975
|
+
(!Number.isFinite(at) || at >= since) &&
|
|
6976
|
+
(!f.actor || row.dataset.actor === f.actor) &&
|
|
6977
|
+
(!f.types.length || f.types.includes(row.dataset.type)) &&
|
|
6978
|
+
(!f.query || row.textContent.toLowerCase().includes(f.query));
|
|
6979
|
+
row.hidden = !ok;
|
|
6980
|
+
if (ok) n++;
|
|
6981
|
+
}
|
|
6982
|
+
day.hidden = n === 0;
|
|
6983
|
+
const c = day.querySelector(".asta-audit-log-day-head > span");
|
|
6984
|
+
if (c) c.textContent = auCount(n);
|
|
6985
|
+
total += n;
|
|
6986
|
+
}
|
|
6987
|
+
const active = !!f.query || !!f.actor || f.types.length > 0 || f.range !== (root.dataset.rangeDefault ?? "30d");
|
|
6988
|
+
const count = root.querySelector("[data-asta-audit-count]");
|
|
6989
|
+
if (count) count.textContent = auCount(total);
|
|
6990
|
+
root.querySelector(".asta-audit-log-tail [data-asta-audit-clear]")?.toggleAttribute("hidden", !active);
|
|
6991
|
+
const empty = root.querySelector(".asta-audit-log-empty");
|
|
6992
|
+
if (empty) empty.hidden = total > 0;
|
|
6993
|
+
const exp = root.querySelector("[data-asta-audit-export]");
|
|
6994
|
+
if (exp) exp.disabled = total === 0;
|
|
6995
|
+
if (announce) {
|
|
6996
|
+
clearTimeout(root._auSay);
|
|
6997
|
+
root._auSay = setTimeout(() => auSay(root, `${auCount(total)} match`), 600);
|
|
6998
|
+
auFire(root, "asta:audit-filter", { ...f });
|
|
6999
|
+
}
|
|
7000
|
+
return total;
|
|
7001
|
+
}
|
|
7002
|
+
|
|
7003
|
+
function auToggle(root, summary, focusBack) {
|
|
7004
|
+
const open = summary.getAttribute("aria-expanded") !== "true";
|
|
7005
|
+
for (const s of root.querySelectorAll(".asta-audit-log-summary[aria-expanded=true]")) {
|
|
7006
|
+
s.setAttribute("aria-expanded", "false");
|
|
7007
|
+
document.getElementById(s.getAttribute("aria-controls"))?.setAttribute("hidden", "");
|
|
7008
|
+
}
|
|
7009
|
+
summary.setAttribute("aria-expanded", String(open));
|
|
7010
|
+
const panel = document.getElementById(summary.getAttribute("aria-controls"));
|
|
7011
|
+
if (panel) panel.hidden = !open;
|
|
7012
|
+
if (focusBack) auFocus(summary);
|
|
7013
|
+
}
|
|
7014
|
+
|
|
7015
|
+
function auClear(root) {
|
|
7016
|
+
const search = root.querySelector("[data-asta-audit-search]");
|
|
7017
|
+
if (search) search.value = "";
|
|
7018
|
+
const actor = root.querySelector("[data-asta-audit-actor]");
|
|
7019
|
+
if (actor) actor.value = "";
|
|
7020
|
+
root.querySelectorAll(".asta-audit-log-chip").forEach((c) => c.setAttribute("aria-pressed", "false"));
|
|
7021
|
+
const def = root.dataset.rangeDefault ?? "30d";
|
|
7022
|
+
root.querySelectorAll(".asta-audit-log-range [data-range]").forEach((b) => b.setAttribute("aria-pressed", String(b.dataset.range === def)));
|
|
7023
|
+
auApply(root, true);
|
|
7024
|
+
auFocus(search);
|
|
7025
|
+
}
|
|
7026
|
+
|
|
7027
|
+
function auCsv(rows) {
|
|
7028
|
+
const q = (v) => (/[",\n]/.test(v) ? `"${v.replace(/"/g, '""')}"` : v);
|
|
7029
|
+
const line = (r) => [r.id, r.at, r.actor, r.type, r.text].map((v) => q(String(v ?? ""))).join(",");
|
|
7030
|
+
return ["id,time,actor,type,event", ...rows.map(line)].join("\n");
|
|
7031
|
+
}
|
|
7032
|
+
|
|
7033
|
+
function auExport(root, btn) {
|
|
7034
|
+
const rows = [...root.querySelectorAll(".asta-audit-log-row:not([hidden])")].map((r) => ({
|
|
7035
|
+
id: r.dataset.id,
|
|
7036
|
+
at: r.dataset.at,
|
|
7037
|
+
actor: r.dataset.actor,
|
|
7038
|
+
type: r.dataset.type,
|
|
7039
|
+
text: r.querySelector(".asta-audit-log-text")?.textContent.trim().replace(/\s+/g, " "),
|
|
7040
|
+
}));
|
|
7041
|
+
if (!auFire(root, "asta:audit-export", { rows }, true)) return;
|
|
7042
|
+
const url = URL.createObjectURL(new Blob([auCsv(rows)], { type: "text/csv;charset=utf-8" }));
|
|
7043
|
+
Object.assign(document.createElement("a"), { href: url, download: `audit-log-${new Date().toISOString().slice(0, 10)}.csv` }).click();
|
|
7044
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
7045
|
+
auSay(root, `Exported ${auCount(rows.length)} as CSV.`);
|
|
7046
|
+
const label = btn.querySelector("[data-label]");
|
|
7047
|
+
if (label) {
|
|
7048
|
+
label.textContent = "Exported";
|
|
7049
|
+
clearTimeout(btn._auT);
|
|
7050
|
+
btn._auT = setTimeout(() => (label.textContent = "Export CSV"), 2000);
|
|
7051
|
+
}
|
|
7052
|
+
}
|
|
7053
|
+
|
|
7054
|
+
function auMore(root, btn) {
|
|
7055
|
+
auFire(root, "asta:audit-more");
|
|
7056
|
+
const remote = [...btn.attributes].some((a) => /^(hx|data-hx)-(get|post)$/.test(a.name));
|
|
7057
|
+
if (remote) return;
|
|
7058
|
+
const tpl = root.querySelector("template[data-asta-audit-page]");
|
|
7059
|
+
const label = btn.querySelector("[data-label]") ?? btn;
|
|
7060
|
+
btn.disabled = true;
|
|
7061
|
+
btn.setAttribute("aria-busy", "true");
|
|
7062
|
+
label.textContent = "Loading…";
|
|
7063
|
+
setTimeout(() => {
|
|
7064
|
+
btn.disabled = false;
|
|
7065
|
+
btn.removeAttribute("aria-busy");
|
|
7066
|
+
label.textContent = "Load older activity";
|
|
7067
|
+
const before = new Set(root.querySelectorAll(".asta-audit-log-row"));
|
|
7068
|
+
if (tpl) {
|
|
7069
|
+
root.querySelector(".asta-audit-log-empty")?.before(tpl.content.cloneNode(true));
|
|
7070
|
+
tpl.remove();
|
|
7071
|
+
}
|
|
7072
|
+
const fresh = [...root.querySelectorAll(".asta-audit-log-row")].filter((r) => !before.has(r));
|
|
7073
|
+
auApply(root, false);
|
|
7074
|
+
auSay(root, fresh.length ? `Loaded ${auCount(fresh.length)}.` : "No older events.");
|
|
7075
|
+
if (!root.querySelector("template[data-asta-audit-page]")) {
|
|
7076
|
+
btn.hidden = true;
|
|
7077
|
+
root.querySelector("[data-asta-audit-end]")?.removeAttribute("hidden");
|
|
7078
|
+
}
|
|
7079
|
+
auFocus(fresh.find((r) => !r.hidden)?.querySelector(".asta-audit-log-summary") ?? btn);
|
|
7080
|
+
}, 700);
|
|
7081
|
+
}
|
|
7082
|
+
|
|
7083
|
+
document.addEventListener("click", (e) => {
|
|
7084
|
+
const root = auRoot(e);
|
|
7085
|
+
if (!root) return;
|
|
7086
|
+
const summary = auNear(e, ".asta-audit-log-summary");
|
|
7087
|
+
const chip = auNear(e, ".asta-audit-log-chip");
|
|
7088
|
+
const range = auNear(e, ".asta-audit-log-range [data-range]");
|
|
7089
|
+
if (summary) auToggle(root, summary, false);
|
|
7090
|
+
else if (chip) {
|
|
7091
|
+
chip.setAttribute("aria-pressed", String(chip.getAttribute("aria-pressed") !== "true"));
|
|
7092
|
+
auApply(root, true);
|
|
7093
|
+
} else if (range) {
|
|
7094
|
+
root.querySelectorAll(".asta-audit-log-range [data-range]").forEach((b) => b.setAttribute("aria-pressed", String(b === range)));
|
|
7095
|
+
auApply(root, true);
|
|
7096
|
+
} else if (auNear(e, "[data-asta-audit-clear]")) auClear(root);
|
|
7097
|
+
else if (auNear(e, "[data-asta-audit-export]")) auExport(root, auNear(e, "[data-asta-audit-export]"));
|
|
7098
|
+
else if (auNear(e, "[data-asta-audit-more]")) auMore(root, auNear(e, "[data-asta-audit-more]"));
|
|
7099
|
+
});
|
|
7100
|
+
|
|
7101
|
+
document.addEventListener("input", (e) => {
|
|
7102
|
+
const root = auRoot(e);
|
|
7103
|
+
if (root && auNear(e, "[data-asta-audit-search],[data-asta-audit-actor]")) auApply(root, true);
|
|
7104
|
+
});
|
|
7105
|
+
|
|
7106
|
+
document.addEventListener("keydown", (e) => {
|
|
7107
|
+
const root = auRoot(e);
|
|
7108
|
+
if (!root) return;
|
|
7109
|
+
if (e.key === "Escape") {
|
|
7110
|
+
const search = auNear(e, "[data-asta-audit-search]");
|
|
7111
|
+
if (search?.value) {
|
|
7112
|
+
e.preventDefault();
|
|
7113
|
+
search.value = "";
|
|
7114
|
+
auApply(root, true);
|
|
7115
|
+
return;
|
|
7116
|
+
}
|
|
7117
|
+
const panel = auNear(e, ".asta-audit-log-detail");
|
|
7118
|
+
const summary = panel && root.querySelector(`[aria-controls="${panel.id}"]`);
|
|
7119
|
+
if (summary) {
|
|
7120
|
+
e.preventDefault();
|
|
7121
|
+
auToggle(root, summary, true);
|
|
7122
|
+
}
|
|
7123
|
+
return;
|
|
7124
|
+
}
|
|
7125
|
+
const at = auNear(e, ".asta-audit-log-summary");
|
|
7126
|
+
if (!at || !["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
|
|
7127
|
+
const rows = [...root.querySelectorAll(".asta-audit-log-row:not([hidden]) > .asta-audit-log-summary")];
|
|
7128
|
+
const i = rows.indexOf(at);
|
|
7129
|
+
e.preventDefault();
|
|
7130
|
+
rows[{ ArrowDown: Math.min(i + 1, rows.length - 1), ArrowUp: Math.max(i - 1, 0), Home: 0, End: rows.length - 1 }[e.key]]?.focus();
|
|
7131
|
+
});
|
|
7132
|
+
|
|
7133
|
+
// Server pages swapped in by htmx get the current filters.
|
|
7134
|
+
document.addEventListener("htmx:afterSettle", (e) => {
|
|
7135
|
+
const root = auRoot(e);
|
|
7136
|
+
if (root) auApply(root, false);
|
|
7137
|
+
});
|
|
7138
|
+
|
|
7139
|
+
// Relative times stay fresh: once a minute, only for logs on screen and only while the tab is visible.
|
|
7140
|
+
const auAgo = (ms) => {
|
|
7141
|
+
const s = Math.max(0, ms / 1000);
|
|
7142
|
+
if (s < 60) return "Just now";
|
|
7143
|
+
if (s < 3600) return `${Math.floor(s / 60)} min ago`;
|
|
7144
|
+
if (s < 86400) return `${Math.floor(s / 3600)} h ago`;
|
|
7145
|
+
return `${Math.floor(s / 86400)} d ago`;
|
|
7146
|
+
};
|
|
7147
|
+
const auSeen = new Set();
|
|
7148
|
+
let auTimer = 0;
|
|
7149
|
+
function auTick() {
|
|
7150
|
+
if (document.hidden) return;
|
|
7151
|
+
for (const root of auSeen) {
|
|
7152
|
+
if (!root.isConnected || root.dataset.now) continue;
|
|
7153
|
+
root.querySelectorAll("time[data-ago]").forEach((t) => {
|
|
7154
|
+
const at = Date.parse(t.getAttribute("datetime") ?? "");
|
|
7155
|
+
if (Number.isFinite(at) && Date.now() - at < 30 * AU_DAY) t.textContent = auAgo(Date.now() - at);
|
|
7156
|
+
});
|
|
7157
|
+
}
|
|
7158
|
+
}
|
|
7159
|
+
const auIo = new IntersectionObserver((list) => {
|
|
7160
|
+
list.forEach((en) => (en.isIntersecting && en.target.isConnected ? auSeen.add(en.target) : auSeen.delete(en.target)));
|
|
7161
|
+
if (auSeen.size && !auTimer) auTimer = setInterval(auTick, 60_000);
|
|
7162
|
+
else if (!auSeen.size && auTimer) auTimer = (clearInterval(auTimer), 0);
|
|
7163
|
+
});
|
|
7164
|
+
const auWatch = () =>
|
|
7165
|
+
document.querySelectorAll("[data-asta-audit]:not([data-au-watched])").forEach((r) => {
|
|
7166
|
+
r.setAttribute("data-au-watched", "");
|
|
7167
|
+
auIo.observe(r);
|
|
7168
|
+
auApply(r, false);
|
|
7169
|
+
});
|
|
7170
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", auWatch);
|
|
7171
|
+
else auWatch();
|
|
7172
|
+
document.addEventListener("htmx:load", auWatch);
|
|
7173
|
+
}
|
|
7174
|
+
|
|
7175
|
+
/* ---------- roles-permissions ---------- */
|
|
7176
|
+
/* ---------- Roles and permissions ----------
|
|
7177
|
+
* [data-asta-roles] (data-pick): the matrix lives in a [data-asta-roles-matrix] form with checkboxes
|
|
7178
|
+
* name="grant" value="<role>:<permission>". The `checked` attribute is the saved state, so changes are counted
|
|
7179
|
+
* against it. [data-asta-roles-toggle] collapses a group (data-collapsed on its tbody), [data-asta-roles-all] sets
|
|
7180
|
+
* a whole group for one role (data-mixed while partly on), locked boxes (aria-disabled) never change. Arrow keys,
|
|
7181
|
+
* Home and End move across the grid. [data-asta-roles-pick] picks the column shown on phones. [data-asta-roles-add]
|
|
7182
|
+
* opens the add form: a name and a role to copy, then a new column (data-new). [data-asta-roles-remove] hides a
|
|
7183
|
+
* column (data-removed). The bar ([data-asta-roles-bar]) counts changes; Discard puts the saved state back. Save
|
|
7184
|
+
* submits the matrix form: with hx-post or action it goes to your server and the bar follows the request, without
|
|
7185
|
+
* them it fires "asta:roles-save" with detail { grants, roles, removed } (call preventDefault and dispatch
|
|
7186
|
+
* "asta:roles-saved" or "asta:roles-failed" on the section when done) or pretends to save.
|
|
7187
|
+
*/
|
|
7188
|
+
{
|
|
7189
|
+
const tgt = (e) => (e.target instanceof Element ? e.target : null);
|
|
7190
|
+
const up = (e, sel) => tgt(e)?.closest(sel) ?? null;
|
|
7191
|
+
const emit = (node, name, detail) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, cancelable: true, detail }));
|
|
7192
|
+
const soon = (node) => node && requestAnimationFrame(() => node.focus());
|
|
7193
|
+
const say = (root, text) => {
|
|
7194
|
+
const s = root.querySelector("[data-asta-roles-status]");
|
|
7195
|
+
if (s) s.textContent = text;
|
|
7196
|
+
};
|
|
7197
|
+
const tableOf = (root) => root.querySelector(".asta-roles-permissions-table");
|
|
7198
|
+
const heads = (root) => [...(tableOf(root)?.tHead?.rows[0]?.cells ?? [])];
|
|
7199
|
+
const roleAt = (root, i) => heads(root)[i];
|
|
7200
|
+
const roleName = (th) => th?.querySelector(".asta-roles-permissions-role-name")?.textContent.trim() ?? "";
|
|
7201
|
+
const boxes = (root) => [...root.querySelectorAll("input[name=grant]")];
|
|
7202
|
+
const live = (input) => !input.closest("td")?.hasAttribute("data-removed");
|
|
7203
|
+
|
|
7204
|
+
// A group box mirrors the permission boxes of its column: on, off or mixed.
|
|
7205
|
+
function syncGroup(tbody, col) {
|
|
7206
|
+
const all = tbody.rows[0]?.cells[col]?.querySelector("[data-asta-roles-all]");
|
|
7207
|
+
if (!all) return;
|
|
7208
|
+
const ins = [...tbody.querySelectorAll(".asta-roles-permissions-row")].map((tr) => tr.cells[col]?.querySelector("input")).filter(Boolean);
|
|
7209
|
+
const on = ins.filter((i) => i.checked).length;
|
|
7210
|
+
all.checked = on > 0 && on === ins.length;
|
|
7211
|
+
all.indeterminate = on > 0 && on < ins.length;
|
|
7212
|
+
all.toggleAttribute("data-mixed", all.indeterminate);
|
|
7213
|
+
}
|
|
7214
|
+
function syncAll(root) {
|
|
7215
|
+
for (const tb of tableOf(root)?.tBodies ?? []) for (let c = 1; c < (tb.rows[0]?.cells.length ?? 0); c++) syncGroup(tb, c);
|
|
7216
|
+
}
|
|
7217
|
+
|
|
7218
|
+
// Count changes against the saved state and show the bar while there are any.
|
|
7219
|
+
function refresh(root) {
|
|
7220
|
+
let n = 0;
|
|
7221
|
+
for (const i of boxes(root)) {
|
|
7222
|
+
const td = i.closest("td");
|
|
7223
|
+
const newCol = roleAt(root, td.cellIndex)?.hasAttribute("data-new");
|
|
7224
|
+
const changed = live(i) && !newCol && i.checked !== i.defaultChecked;
|
|
7225
|
+
td.toggleAttribute("data-dirty", changed);
|
|
7226
|
+
if (changed) n++;
|
|
7227
|
+
}
|
|
7228
|
+
n += heads(root).filter((th) => th.hasAttribute("data-new") || th.hasAttribute("data-removed")).length;
|
|
7229
|
+
const bar = root.querySelector("[data-asta-roles-bar]");
|
|
7230
|
+
if (!bar || bar.dataset.state === "saving") return n;
|
|
7231
|
+
if (n) {
|
|
7232
|
+
bar.dataset.state = "idle";
|
|
7233
|
+
bar.hidden = false;
|
|
7234
|
+
bar.querySelector("[data-asta-roles-count]").textContent = `${n} unsaved ${n === 1 ? "change" : "changes"}`;
|
|
7235
|
+
bar.querySelector(".asta-roles-permissions-save").textContent = "Save changes";
|
|
7236
|
+
} else if (bar.dataset.state !== "saved") bar.hidden = true;
|
|
7237
|
+
return n;
|
|
7238
|
+
}
|
|
7239
|
+
|
|
7240
|
+
function setBar(root, state) {
|
|
7241
|
+
const bar = root.querySelector("[data-asta-roles-bar]");
|
|
7242
|
+
if (!bar) return;
|
|
7243
|
+
clearTimeout(bar._astaT);
|
|
7244
|
+
bar.dataset.state = state;
|
|
7245
|
+
bar.hidden = false;
|
|
7246
|
+
const save = bar.querySelector(".asta-roles-permissions-save");
|
|
7247
|
+
bar.querySelectorAll("button").forEach((b) => (b.disabled = state === "saving"));
|
|
7248
|
+
save.toggleAttribute("aria-busy", state === "saving");
|
|
7249
|
+
save.textContent = state === "saving" ? "Saving…" : state === "failed" ? "Try again" : "Save changes";
|
|
7250
|
+
const text = { saved: "Changes saved", failed: "Couldn't save. Your changes are still here." }[state];
|
|
7251
|
+
if (text) bar.querySelector("[data-asta-roles-count]").textContent = text;
|
|
7252
|
+
say(root, state === "saving" ? "Saving changes…" : text ?? "");
|
|
7253
|
+
if (state === "saved") bar._astaT = setTimeout(() => bar.dataset.state === "saved" && (bar.hidden = true), 2400);
|
|
7254
|
+
}
|
|
7255
|
+
|
|
7256
|
+
// After a save the current state becomes the saved one: removed columns go, new ones settle.
|
|
7257
|
+
function commit(root) {
|
|
7258
|
+
for (const i of boxes(root)) i.defaultChecked = i.checked;
|
|
7259
|
+
root.querySelectorAll("[data-removed]").forEach((n) => n.remove());
|
|
7260
|
+
root.querySelectorAll("option[hidden]").forEach((o) => o.remove());
|
|
7261
|
+
heads(root).forEach((th) => th.removeAttribute("data-new"));
|
|
7262
|
+
root.querySelectorAll("input[name=removeRole], input[name=newRole]").forEach((n) => n.remove());
|
|
7263
|
+
heads(root).forEach((th) => th.querySelector(".asta-roles-permissions-role-meta")?.textContent === "New, not saved" && (th.querySelector(".asta-roles-permissions-role-meta").textContent = "Custom"));
|
|
7264
|
+
renumber(root);
|
|
7265
|
+
setBar(root, "saved");
|
|
7266
|
+
soon(root.querySelector('.asta-roles-permissions-table [tabindex="0"]'));
|
|
7267
|
+
}
|
|
7268
|
+
function discard(root) {
|
|
7269
|
+
for (const i of boxes(root)) i.checked = i.defaultChecked;
|
|
7270
|
+
// Right to left, so dropping a column doesn't shift the ones still to check.
|
|
7271
|
+
heads(root).reverse().forEach((th) => th.hasAttribute("data-new") && dropColumn(root, th.cellIndex, true));
|
|
7272
|
+
root.querySelectorAll("[data-asta-roles-pick] option").forEach((o) => !heads(root).some((th) => th.dataset.role === o.dataset.role) && o.remove());
|
|
7273
|
+
root.querySelectorAll("[data-removed]").forEach((n) => n.removeAttribute("data-removed"));
|
|
7274
|
+
root.querySelectorAll("option[hidden]").forEach((o) => (o.hidden = false));
|
|
7275
|
+
root.querySelectorAll("input[name=removeRole]").forEach((n) => n.remove());
|
|
7276
|
+
renumber(root);
|
|
7277
|
+
syncAll(root);
|
|
7278
|
+
refresh(root);
|
|
7279
|
+
say(root, "Changes discarded.");
|
|
7280
|
+
soon(root.querySelector('.asta-roles-permissions-table [tabindex="0"]') ?? root.querySelector("[data-asta-roles-pick]"));
|
|
7281
|
+
}
|
|
7282
|
+
|
|
7283
|
+
// Picker options carry column numbers; keep them right after columns come and go.
|
|
7284
|
+
function renumber(root) {
|
|
7285
|
+
const pick = root.querySelector("[data-asta-roles-pick]");
|
|
7286
|
+
if (!pick) return;
|
|
7287
|
+
const cols = heads(root);
|
|
7288
|
+
for (const o of pick.options) {
|
|
7289
|
+
const c = cols.findIndex((th) => th.dataset.role === o.dataset.role);
|
|
7290
|
+
if (c > 0) o.value = String(c);
|
|
7291
|
+
}
|
|
7292
|
+
if (!cols[Number(root.dataset.pick)] || cols[Number(root.dataset.pick)].hasAttribute("data-removed")) {
|
|
7293
|
+
const first = cols.findIndex((th, c) => c > 0 && !th.hasAttribute("data-locked") && !th.hasAttribute("data-removed"));
|
|
7294
|
+
root.dataset.pick = String(first > 0 ? first : 1);
|
|
7295
|
+
}
|
|
7296
|
+
pick.value = root.dataset.pick;
|
|
7297
|
+
}
|
|
7298
|
+
|
|
7299
|
+
function dropColumn(root, c, hard) {
|
|
7300
|
+
for (const tr of tableOf(root).rows) {
|
|
7301
|
+
const cell = tr.cells[c];
|
|
7302
|
+
if (!cell) continue;
|
|
7303
|
+
if (hard) cell.remove();
|
|
7304
|
+
else cell.setAttribute("data-removed", "");
|
|
7305
|
+
}
|
|
7306
|
+
}
|
|
7307
|
+
function removeRole(root, th) {
|
|
7308
|
+
const c = th.cellIndex;
|
|
7309
|
+
const name = roleName(th);
|
|
7310
|
+
const opt = root.querySelector(`[data-asta-roles-pick] option[data-role="${CSS.escape(th.dataset.role)}"]`);
|
|
7311
|
+
if (th.hasAttribute("data-new")) {
|
|
7312
|
+
dropColumn(root, c, true);
|
|
7313
|
+
opt?.remove();
|
|
7314
|
+
} else {
|
|
7315
|
+
dropColumn(root, c, false);
|
|
7316
|
+
if (opt) opt.hidden = true;
|
|
7317
|
+
const hid = Object.assign(document.createElement("input"), { type: "hidden", name: "removeRole", value: th.dataset.role });
|
|
7318
|
+
root.querySelector("[data-asta-roles-matrix]")?.append(hid);
|
|
7319
|
+
}
|
|
7320
|
+
renumber(root);
|
|
7321
|
+
refresh(root);
|
|
7322
|
+
say(root, `${name} role removed. Discard to bring it back.`);
|
|
7323
|
+
soon(root.querySelector("[data-asta-roles-add]"));
|
|
7324
|
+
}
|
|
7325
|
+
|
|
7326
|
+
// A new column is a copy of the first editable one, with the boxes of the role it copies (or none).
|
|
7327
|
+
function addRole(root, name, from) {
|
|
7328
|
+
const cols = heads(root);
|
|
7329
|
+
const base = cols.findIndex((th, c) => c > 0 && !th.hasAttribute("data-locked"));
|
|
7330
|
+
if (base < 0) return;
|
|
7331
|
+
const src = from ? cols.findIndex((th) => th.dataset.role === from) : -1;
|
|
7332
|
+
const id = `role-${Date.now().toString(36)}`;
|
|
7333
|
+
const at = cols.length;
|
|
7334
|
+
for (const tr of tableOf(root).rows) {
|
|
7335
|
+
const cell = tr.cells[base].cloneNode(true);
|
|
7336
|
+
cell.removeAttribute("data-dirty");
|
|
7337
|
+
cell.removeAttribute("data-removed");
|
|
7338
|
+
tr.append(cell);
|
|
7339
|
+
if (tr.parentElement.tagName === "THEAD") {
|
|
7340
|
+
cell.dataset.role = id;
|
|
7341
|
+
cell.setAttribute("data-new", "");
|
|
7342
|
+
cell.removeAttribute("data-locked");
|
|
7343
|
+
cell.querySelector(".asta-roles-permissions-role-name").textContent = name;
|
|
7344
|
+
cell.querySelector(".asta-roles-permissions-role-name").title = name;
|
|
7345
|
+
cell.querySelector(".asta-roles-permissions-role-meta").textContent = "New, not saved";
|
|
7346
|
+
cell.querySelector(".asta-roles-permissions-remove")?.remove();
|
|
7347
|
+
const x = root.querySelector("template[data-asta-roles-remove]")?.content.firstElementChild?.cloneNode(true);
|
|
7348
|
+
if (x) {
|
|
7349
|
+
x.setAttribute("aria-label", `Remove ${name} role`);
|
|
7350
|
+
cell.querySelector(".asta-roles-permissions-role").append(x);
|
|
7351
|
+
}
|
|
7352
|
+
cell.append(Object.assign(document.createElement("input"), { type: "hidden", name: "newRole", value: `${id}:${name}` }));
|
|
7353
|
+
continue;
|
|
7354
|
+
}
|
|
7355
|
+
const input = cell.querySelector("input[type=checkbox]");
|
|
7356
|
+
if (!input) continue;
|
|
7357
|
+
const was = src > 0 ? tr.cells[src]?.querySelector("input[type=checkbox]") : null;
|
|
7358
|
+
input.checked = input.defaultChecked = false;
|
|
7359
|
+
input.checked = !!was?.checked;
|
|
7360
|
+
input.tabIndex = -1;
|
|
7361
|
+
if (input.name === "grant") input.value = `${id}:${input.value.split(":").slice(1).join(":")}`;
|
|
7362
|
+
const label = input.getAttribute("aria-label");
|
|
7363
|
+
if (label) input.setAttribute("aria-label", label.replace(/ for .*$/, ` for ${name}`));
|
|
7364
|
+
}
|
|
7365
|
+
const pick = root.querySelector("[data-asta-roles-pick]");
|
|
7366
|
+
if (pick) pick.append(Object.assign(document.createElement("option"), { value: String(at), textContent: `${name} · New, not saved` }));
|
|
7367
|
+
pick?.lastElementChild?.setAttribute("data-role", id);
|
|
7368
|
+
root.dataset.pick = String(at);
|
|
7369
|
+
renumber(root);
|
|
7370
|
+
syncAll(root);
|
|
7371
|
+
refresh(root);
|
|
7372
|
+
say(root, `${name} role added${src > 0 ? ` with the permissions of ${roleName(cols[src])}` : ""}.`);
|
|
7373
|
+
const head = roleAt(root, at)?.querySelector(".asta-roles-permissions-role-name");
|
|
7374
|
+
if (head && head.getClientRects().length) {
|
|
7375
|
+
head.tabIndex = -1;
|
|
7376
|
+
soon(head);
|
|
7377
|
+
} else soon(pick);
|
|
7378
|
+
}
|
|
7379
|
+
|
|
7380
|
+
// The add form: a name that is filled in and not taken, checked on submit and again on blur once wrong.
|
|
7381
|
+
function checkName(root, form) {
|
|
7382
|
+
const input = form.querySelector("input[name=roleName]");
|
|
7383
|
+
const msg = document.getElementById(input.getAttribute("aria-describedby"));
|
|
7384
|
+
const name = input.value.trim();
|
|
7385
|
+
const taken = heads(root).some((th) => !th.hasAttribute("data-removed") && roleName(th).toLowerCase() === name.toLowerCase());
|
|
7386
|
+
const err = !name ? msg?.dataset.errorEmpty : taken ? msg?.dataset.errorTaken : "";
|
|
7387
|
+
if (err) input.setAttribute("aria-invalid", "true");
|
|
7388
|
+
else input.removeAttribute("aria-invalid");
|
|
7389
|
+
if (msg) {
|
|
7390
|
+
msg.toggleAttribute("data-error", !!err);
|
|
7391
|
+
msg.querySelector("span").textContent = err || msg.dataset.hint;
|
|
7392
|
+
}
|
|
7393
|
+
return err ? null : name;
|
|
7394
|
+
}
|
|
7395
|
+
function openAdd(root, open) {
|
|
7396
|
+
const form = root.querySelector("[data-asta-roles-form]");
|
|
7397
|
+
const btn = root.querySelector("[data-asta-roles-add]");
|
|
7398
|
+
if (!form) return;
|
|
7399
|
+
form.hidden = !open;
|
|
7400
|
+
btn?.setAttribute("aria-expanded", String(open));
|
|
7401
|
+
if (open) {
|
|
7402
|
+
const sel = form.querySelector("select[name=copyFrom]");
|
|
7403
|
+
if (sel) {
|
|
7404
|
+
sel.length = 1;
|
|
7405
|
+
for (const th of heads(root).slice(1)) {
|
|
7406
|
+
if (th.hasAttribute("data-removed")) continue;
|
|
7407
|
+
sel.append(Object.assign(document.createElement("option"), { value: th.dataset.role, textContent: roleName(th) }));
|
|
7408
|
+
}
|
|
7409
|
+
}
|
|
7410
|
+
soon(form.querySelector("input[name=roleName]"));
|
|
7411
|
+
} else {
|
|
7412
|
+
form.reset();
|
|
7413
|
+
const input = form.querySelector("input[name=roleName]");
|
|
7414
|
+
if (input) {
|
|
7415
|
+
input.removeAttribute("aria-invalid");
|
|
7416
|
+
const msg = document.getElementById(input.getAttribute("aria-describedby"));
|
|
7417
|
+
msg?.removeAttribute("data-error");
|
|
7418
|
+
if (msg) msg.querySelector("span").textContent = msg.dataset.hint;
|
|
7419
|
+
}
|
|
7420
|
+
soon(btn);
|
|
7421
|
+
}
|
|
7422
|
+
}
|
|
7423
|
+
|
|
7424
|
+
function toggleGroup(tbody) {
|
|
7425
|
+
const btn = tbody.querySelector("[data-asta-roles-toggle]");
|
|
7426
|
+
const open = btn.getAttribute("aria-expanded") !== "true";
|
|
7427
|
+
btn.setAttribute("aria-expanded", String(open));
|
|
7428
|
+
tbody.toggleAttribute("data-collapsed", !open);
|
|
7429
|
+
// Keep one tab stop: if it sat in a hidden row, hand it to the toggle.
|
|
7430
|
+
const stop = tableOf(tbody.closest("[data-asta-roles]")).querySelector('[tabindex="0"]');
|
|
7431
|
+
if (!stop || !stop.getClientRects().length) {
|
|
7432
|
+
if (stop) stop.tabIndex = -1;
|
|
7433
|
+
btn.tabIndex = 0;
|
|
7434
|
+
}
|
|
7435
|
+
}
|
|
7436
|
+
|
|
7437
|
+
document.addEventListener("click", (e) => {
|
|
7438
|
+
const root = up(e, "[data-asta-roles]");
|
|
7439
|
+
if (!root) return;
|
|
7440
|
+
const input = up(e, ".asta-roles-permissions-table input[type=checkbox], .asta-roles-permissions-box input");
|
|
7441
|
+
if (input?.getAttribute("aria-disabled") === "true") return e.preventDefault();
|
|
7442
|
+
if (up(e, "[data-asta-roles-toggle]")) toggleGroup(up(e, "tbody"));
|
|
7443
|
+
else if (up(e, "[data-asta-roles-add]")) openAdd(root, root.querySelector("[data-asta-roles-form]")?.hidden ?? false);
|
|
7444
|
+
else if (up(e, "[data-asta-roles-cancel]")) openAdd(root, false);
|
|
7445
|
+
else if (up(e, "[data-asta-roles-remove]")) removeRole(root, up(e, "th"));
|
|
7446
|
+
else if (up(e, "[data-asta-roles-discard]")) discard(root);
|
|
7447
|
+
});
|
|
7448
|
+
|
|
7449
|
+
document.addEventListener("change", (e) => {
|
|
7450
|
+
const root = up(e, "[data-asta-roles]");
|
|
7451
|
+
if (!root) return;
|
|
7452
|
+
const t = tgt(e);
|
|
7453
|
+
if (t.matches("[data-asta-roles-pick]")) {
|
|
7454
|
+
root.dataset.pick = t.value;
|
|
7455
|
+
return;
|
|
7456
|
+
}
|
|
7457
|
+
if (!(t instanceof HTMLInputElement) || t.type !== "checkbox") return;
|
|
7458
|
+
const td = t.closest("td");
|
|
7459
|
+
const tbody = t.closest("tbody");
|
|
7460
|
+
const role = roleName(roleAt(root, td.cellIndex));
|
|
7461
|
+
if (t.matches("[data-asta-roles-all]")) {
|
|
7462
|
+
const on = t.checked;
|
|
7463
|
+
for (const tr of tbody.querySelectorAll(".asta-roles-permissions-row")) {
|
|
7464
|
+
const i = tr.cells[td.cellIndex]?.querySelector("input");
|
|
7465
|
+
if (i && i.getAttribute("aria-disabled") !== "true") i.checked = on;
|
|
7466
|
+
}
|
|
7467
|
+
say(root, `${on ? "All" : "No"} ${tbody.querySelector("[data-asta-roles-toggle]")?.dataset.label ?? ""} permissions for ${role}.`);
|
|
7468
|
+
} else {
|
|
7469
|
+
const label = t.closest("tr").querySelector(".asta-roles-permissions-label")?.textContent ?? "";
|
|
7470
|
+
say(root, `${label} ${t.checked ? "allowed" : "removed"} for ${role}.`);
|
|
7471
|
+
}
|
|
7472
|
+
syncGroup(tbody, td.cellIndex);
|
|
7473
|
+
refresh(root);
|
|
7474
|
+
});
|
|
7475
|
+
|
|
7476
|
+
document.addEventListener("focusout", (e) => {
|
|
7477
|
+
const form = up(e, "[data-asta-roles-form]");
|
|
7478
|
+
if (form && tgt(e).matches("input[name=roleName][aria-invalid]")) checkName(form.closest("[data-asta-roles]"), form);
|
|
7479
|
+
});
|
|
7480
|
+
|
|
7481
|
+
// Arrow keys move one cell (skipping hidden rows and empty first cells), Home/End go to the row's ends,
|
|
7482
|
+
// Ctrl+Home/End to the grid's corners. Esc closes the add form.
|
|
7483
|
+
const focusables = (tr) => [...tr.cells].map((c) => (c.hasAttribute("data-removed") ? null : c.querySelector("button[data-asta-roles-toggle], input[type=checkbox]")));
|
|
7484
|
+
document.addEventListener("keydown", (e) => {
|
|
7485
|
+
const root = up(e, "[data-asta-roles]");
|
|
7486
|
+
if (!root) return;
|
|
7487
|
+
if (e.key === "Escape" && up(e, "[data-asta-roles-form]")) {
|
|
7488
|
+
e.preventDefault();
|
|
7489
|
+
return openAdd(root, false);
|
|
7490
|
+
}
|
|
7491
|
+
const t = tgt(e);
|
|
7492
|
+
const tr = t.closest(".asta-roles-permissions-table tbody tr");
|
|
7493
|
+
if (!tr || !/^(Arrow(Up|Down|Left|Right)|Home|End)$/.test(e.key)) return;
|
|
7494
|
+
const rows = [...tableOf(root).tBodies].flatMap((tb) => [...tb.rows]).filter((r) => r.getClientRects().length);
|
|
7495
|
+
let r = rows.indexOf(tr);
|
|
7496
|
+
let c = focusables(tr).indexOf(t);
|
|
7497
|
+
if (r < 0 || c < 0) return;
|
|
7498
|
+
e.preventDefault();
|
|
7499
|
+
const at = (ri, ci) => (rows[ri] ? focusables(rows[ri])[ci] : null);
|
|
7500
|
+
let next = null;
|
|
7501
|
+
if (e.key === "Home" || e.key === "End") {
|
|
7502
|
+
if (e.ctrlKey) r = e.key === "Home" ? 0 : rows.length - 1;
|
|
7503
|
+
const list = focusables(rows[r]);
|
|
7504
|
+
next = e.key === "Home" ? list.find(Boolean) : list.findLast(Boolean);
|
|
7505
|
+
} else if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
7506
|
+
const d = e.key === "ArrowLeft" ? -1 : 1;
|
|
7507
|
+
for (c += d; c >= 0 && c < tr.cells.length && !next; c += d) next = at(r, c);
|
|
7508
|
+
} else {
|
|
7509
|
+
const d = e.key === "ArrowUp" ? -1 : 1;
|
|
7510
|
+
for (r += d; r >= 0 && r < rows.length && !next; r += d) next = at(r, c);
|
|
7511
|
+
}
|
|
7512
|
+
if (!next || !next.getClientRects().length) return;
|
|
7513
|
+
root.querySelectorAll('.asta-roles-permissions-table [tabindex="0"]').forEach((n) => (n.tabIndex = -1));
|
|
7514
|
+
next.tabIndex = 0;
|
|
7515
|
+
next.focus();
|
|
7516
|
+
});
|
|
7517
|
+
|
|
7518
|
+
// Capture phase, so an invalid add form never reaches htmx, and the matrix shows its saving state first.
|
|
7519
|
+
document.addEventListener(
|
|
7520
|
+
"submit",
|
|
7521
|
+
(e) => {
|
|
7522
|
+
const form = e.target instanceof HTMLFormElement ? e.target : null;
|
|
7523
|
+
const root = form?.closest("[data-asta-roles]");
|
|
7524
|
+
if (!root) return;
|
|
7525
|
+
const remote = form.hasAttribute("action") || [...form.attributes].some((a) => /^(hx|data-hx)-(post|put|patch)$/.test(a.name));
|
|
7526
|
+
if (form.matches("[data-asta-roles-form]")) {
|
|
7527
|
+
const name = checkName(root, form);
|
|
7528
|
+
if (!name) {
|
|
7529
|
+
e.preventDefault();
|
|
7530
|
+
e.stopPropagation();
|
|
7531
|
+
soon(form.querySelector("input[name=roleName]"));
|
|
7532
|
+
return;
|
|
7533
|
+
}
|
|
7534
|
+
if (remote) return;
|
|
7535
|
+
e.preventDefault();
|
|
7536
|
+
const from = form.querySelector("select[name=copyFrom]")?.value;
|
|
7537
|
+
form.hidden = true;
|
|
7538
|
+
form.reset();
|
|
7539
|
+
root.querySelector("[data-asta-roles-add]")?.setAttribute("aria-expanded", "false");
|
|
7540
|
+
addRole(root, name, from);
|
|
7541
|
+
return;
|
|
7542
|
+
}
|
|
7543
|
+
if (!form.matches("[data-asta-roles-matrix]")) return;
|
|
7544
|
+
setBar(root, "saving");
|
|
7545
|
+
if (remote) return;
|
|
7546
|
+
e.preventDefault();
|
|
7547
|
+
const grants = {};
|
|
7548
|
+
for (const i of boxes(root)) {
|
|
7549
|
+
if (!live(i) || !i.checked) continue;
|
|
7550
|
+
const [role, ...p] = i.value.split(":");
|
|
7551
|
+
(grants[role] ??= []).push(p.join(":"));
|
|
7552
|
+
}
|
|
7553
|
+
const roles = heads(root).slice(1).filter((th) => !th.hasAttribute("data-removed")).map((th) => ({ id: th.dataset.role, name: roleName(th), new: th.hasAttribute("data-new") }));
|
|
7554
|
+
const removed = heads(root).filter((th) => th.hasAttribute("data-removed")).map((th) => th.dataset.role);
|
|
7555
|
+
if (emit(root, "asta:roles-save", { grants, roles, removed })) setTimeout(() => commit(root), 700);
|
|
7556
|
+
},
|
|
7557
|
+
true,
|
|
7558
|
+
);
|
|
7559
|
+
document.addEventListener("asta:roles-saved", (e) => e.target.matches?.("[data-asta-roles]") && commit(e.target));
|
|
7560
|
+
document.addEventListener("asta:roles-failed", (e) => e.target.matches?.("[data-asta-roles]") && setBar(e.target, "failed"));
|
|
7561
|
+
document.addEventListener("htmx:afterRequest", (e) => {
|
|
7562
|
+
const form = e.detail?.elt;
|
|
7563
|
+
if (!(form instanceof Element) || !form.matches("[data-asta-roles-matrix]")) return;
|
|
7564
|
+
const root = form.closest("[data-asta-roles]");
|
|
7565
|
+
if (e.detail.successful) commit(root);
|
|
7566
|
+
else setBar(root, "failed");
|
|
7567
|
+
});
|
|
7568
|
+
|
|
7569
|
+
// Group boxes start mixed from data-mixed; the property only exists in JS.
|
|
7570
|
+
const mixed = () => document.querySelectorAll("[data-asta-roles] input[data-mixed]").forEach((i) => (i.indeterminate = true));
|
|
7571
|
+
document.addEventListener("htmx:load", mixed);
|
|
7572
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", mixed, { once: true });
|
|
7573
|
+
else mixed();
|
|
7574
|
+
}
|
|
7575
|
+
|
|
7576
|
+
/* ---------- security-settings ---------- */
|
|
7577
|
+
/* ---------- Security settings ----------
|
|
7578
|
+
* [data-asta-security]: the two-factor card ([data-state] off|setup|codes|on) shows the [data-show~=state] parts.
|
|
7579
|
+
* [data-asta-security-2fa-start] opens setup, the [data-asta-security-verify] form checks for 6 digits (spaces and
|
|
7580
|
+
* dashes from a paste are dropped), [data-asta-security-codes-done] finishes, [data-asta-security-codes-download]
|
|
7581
|
+
* saves the codes as .txt. [data-asta-security-ask] (aria-controls) opens a confirm strip whose
|
|
7582
|
+
* [data-asta-security-go] runs its data-action: 2fa-off, passkey-remove or signout-others. [data-asta-security-signout]
|
|
7583
|
+
* signs one session out, [data-asta-security-passkey-add] adds one. Each fires "asta:security" with detail.action
|
|
7584
|
+
* (and detail.id / detail.code). A form or button with hx-* or action is left to the server; without one the demo
|
|
7585
|
+
* runs locally after a short wait. Uses near() and fire() from the shared runtime helpers.
|
|
7586
|
+
*/
|
|
7587
|
+
const ssRoot = (e) => near(e, "[data-asta-security]");
|
|
7588
|
+
const ssFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
7589
|
+
const ssServer = (node) => !!node && [...node.attributes].some((a) => a.name.startsWith("hx-") || a.name === "action");
|
|
7590
|
+
const ssAlnum = "abcdefghjkmnpqrstuvwxyz23456789";
|
|
7591
|
+
const ssPick = (n) => Array.from({ length: n }, () => ssAlnum[Math.floor(Math.random() * ssAlnum.length)]).join("");
|
|
7592
|
+
const ssSay = (root, text) => {
|
|
7593
|
+
const live = root.querySelector("[data-asta-security-status]");
|
|
7594
|
+
if (live) live.textContent = text;
|
|
7595
|
+
};
|
|
7596
|
+
// Mark a button busy for the demo wait, swapping in its data-busy-text and putting its content back after.
|
|
7597
|
+
const ssIdle = new WeakMap();
|
|
7598
|
+
function ssBusy(btn, on) {
|
|
7599
|
+
if (!btn) return;
|
|
7600
|
+
if (on && btn.dataset.busyText) {
|
|
7601
|
+
ssIdle.set(btn, btn.innerHTML);
|
|
7602
|
+
btn.textContent = btn.dataset.busyText;
|
|
7603
|
+
} else if (!on && ssIdle.has(btn)) {
|
|
7604
|
+
btn.innerHTML = ssIdle.get(btn);
|
|
7605
|
+
ssIdle.delete(btn);
|
|
7606
|
+
}
|
|
7607
|
+
btn.toggleAttribute("aria-busy", on);
|
|
7608
|
+
btn.disabled = on;
|
|
7609
|
+
}
|
|
7610
|
+
const ssLater = (btn, ms, done) => {
|
|
7611
|
+
ssBusy(btn, true);
|
|
7612
|
+
setTimeout(() => {
|
|
7613
|
+
ssBusy(btn, false);
|
|
7614
|
+
done();
|
|
7615
|
+
}, ms);
|
|
7616
|
+
};
|
|
7617
|
+
|
|
7618
|
+
function ssState(card, state) {
|
|
7619
|
+
card.dataset.state = state;
|
|
7620
|
+
card.querySelectorAll("[data-show]").forEach((n) => (n.hidden = !n.dataset.show.split(" ").includes(state)));
|
|
7621
|
+
card.querySelectorAll(".asta-security-settings-status").forEach((s) => s.toggleAttribute("data-on", state === "on" || state === "codes"));
|
|
7622
|
+
}
|
|
7623
|
+
function ssMsg(msg, error) {
|
|
7624
|
+
if (!msg) return;
|
|
7625
|
+
msg.toggleAttribute("data-error", !!error);
|
|
7626
|
+
const text = msg.querySelector("span:last-child") ?? msg;
|
|
7627
|
+
text.textContent = error || msg.dataset.hint || "";
|
|
7628
|
+
}
|
|
7629
|
+
function ssAsk(btn, open) {
|
|
7630
|
+
const strip = btn && document.getElementById(btn.getAttribute("aria-controls"));
|
|
7631
|
+
if (!strip) return;
|
|
7632
|
+
strip.hidden = !open;
|
|
7633
|
+
btn.setAttribute("aria-expanded", String(open));
|
|
7634
|
+
ssFocus(open ? strip.querySelector("[data-asta-security-keep]") : btn);
|
|
7635
|
+
}
|
|
7636
|
+
const ssAsker = (strip) => strip && strip.id && document.querySelector(`[data-asta-security-ask][aria-controls="${strip.id}"]`);
|
|
7637
|
+
|
|
7638
|
+
function ssCount(root) {
|
|
7639
|
+
const list = root.querySelector("[data-asta-security-sessions]");
|
|
7640
|
+
const n = list ? list.querySelectorAll(".asta-security-settings-row:not([data-current])").length : 0;
|
|
7641
|
+
const slot = root.querySelector("[data-slot=others]");
|
|
7642
|
+
if (slot) slot.textContent = n ? `${n} other ${n === 1 ? "session" : "sessions"}` : "Only this device is signed in.";
|
|
7643
|
+
const ask = root.querySelector('[data-asta-security-ask][aria-controls][data-for="others"]');
|
|
7644
|
+
if (ask) ask.disabled = !n;
|
|
7645
|
+
}
|
|
7646
|
+
|
|
7647
|
+
function ssGo(root, strip) {
|
|
7648
|
+
const card = strip.closest(".asta-security-settings-2fa");
|
|
7649
|
+
const row = strip.closest(".asta-security-settings-row");
|
|
7650
|
+
const action = strip.dataset.action;
|
|
7651
|
+
const id = row?.dataset.id;
|
|
7652
|
+
fire(root, "asta:security", { action, id });
|
|
7653
|
+
const go = strip.querySelector("[data-asta-security-go]");
|
|
7654
|
+
if (ssServer(go)) return;
|
|
7655
|
+
ssLater(go, 700, () => {
|
|
7656
|
+
strip.hidden = true;
|
|
7657
|
+
if (action === "2fa-off" && card) {
|
|
7658
|
+
ssAsker(strip)?.setAttribute("aria-expanded", "false");
|
|
7659
|
+
ssState(card, "off");
|
|
7660
|
+
ssSay(root, "Two-factor authentication is off.");
|
|
7661
|
+
ssFocus(card.querySelector("[data-asta-security-2fa-start]"));
|
|
7662
|
+
} else if (action === "passkey-remove" && row) {
|
|
7663
|
+
const list = row.parentElement;
|
|
7664
|
+
row.remove();
|
|
7665
|
+
if (list && !list.children.length) list.closest(".asta-security-settings-card")?.querySelector(".asta-security-settings-empty")?.removeAttribute("hidden");
|
|
7666
|
+
ssSay(root, "Passkey removed.");
|
|
7667
|
+
ssFocus(root.querySelector("[data-asta-security-passkey-add]"));
|
|
7668
|
+
} else if (action === "signout-others") {
|
|
7669
|
+
root.querySelectorAll("[data-asta-security-sessions] > .asta-security-settings-row:not([data-current])").forEach((r) => r.remove());
|
|
7670
|
+
ssAsker(strip)?.setAttribute("aria-expanded", "false");
|
|
7671
|
+
ssCount(root);
|
|
7672
|
+
ssSay(root, "Signed out of the other sessions.");
|
|
7673
|
+
ssFocus(root.querySelector("[data-asta-security-sessions-heading]"));
|
|
7674
|
+
}
|
|
7675
|
+
});
|
|
7676
|
+
}
|
|
7677
|
+
|
|
7678
|
+
function ssVerify(root, form, e) {
|
|
7679
|
+
const input = form.querySelector("input[name=code]");
|
|
7680
|
+
const msg = input && document.getElementById(input.getAttribute("aria-describedby"));
|
|
7681
|
+
const code = (input?.value ?? "").replace(/\D/g, "");
|
|
7682
|
+
if (code.length !== 6) {
|
|
7683
|
+
// Capture phase, so htmx never sees an invalid submit.
|
|
7684
|
+
e.preventDefault();
|
|
7685
|
+
e.stopImmediatePropagation();
|
|
7686
|
+
input?.setAttribute("aria-invalid", "true");
|
|
7687
|
+
ssMsg(msg, msg?.dataset.errorText ?? "Enter the 6 digits from your authenticator app.");
|
|
7688
|
+
return input?.focus();
|
|
7689
|
+
}
|
|
7690
|
+
fire(root, "asta:security", { action: "2fa-verify", code });
|
|
7691
|
+
if (ssServer(form)) return;
|
|
7692
|
+
e.preventDefault();
|
|
7693
|
+
ssLater(form.querySelector("[type=submit]"), 700, () => {
|
|
7694
|
+
if (code === "000000") {
|
|
7695
|
+
input.setAttribute("aria-invalid", "true");
|
|
7696
|
+
ssMsg(msg, msg?.dataset.mismatchText ?? "That code didn't match. Try the newest code in your app.");
|
|
7697
|
+
ssSay(root, "That code didn't match.");
|
|
7698
|
+
return input.focus();
|
|
7699
|
+
}
|
|
7700
|
+
const card = form.closest(".asta-security-settings-2fa");
|
|
7701
|
+
const list = card?.querySelector(".asta-security-settings-codes-list");
|
|
7702
|
+
if (list) {
|
|
7703
|
+
list.textContent = "";
|
|
7704
|
+
const codes = Array.from({ length: 10 }, () => `${ssPick(4)}-${ssPick(4)}`);
|
|
7705
|
+
for (const c of codes) list.append(Object.assign(document.createElement("li"), { textContent: c }));
|
|
7706
|
+
card.querySelector(".asta-security-settings-codes [data-asta-copy]")?.setAttribute("data-asta-copy", codes.join("\n"));
|
|
7707
|
+
}
|
|
7708
|
+
if (card) ssState(card, "codes");
|
|
7709
|
+
ssSay(root, "Two-factor is on. Save your recovery codes now, they won't be shown again.");
|
|
7710
|
+
ssFocus(card?.querySelector(".asta-security-settings-codes [data-asta-copy]"));
|
|
7711
|
+
});
|
|
7712
|
+
}
|
|
7713
|
+
|
|
7714
|
+
document.addEventListener("click", (e) => {
|
|
7715
|
+
const root = ssRoot(e);
|
|
7716
|
+
if (!root) return;
|
|
7717
|
+
const card = near(e, ".asta-security-settings-2fa");
|
|
7718
|
+
const row = near(e, ".asta-security-settings-row");
|
|
7719
|
+
let btn;
|
|
7720
|
+
if (card && (btn = near(e, "[data-asta-security-2fa-start]"))) {
|
|
7721
|
+
fire(root, "asta:security", { action: "2fa-start" });
|
|
7722
|
+
const open = () => {
|
|
7723
|
+
ssState(card, "setup");
|
|
7724
|
+
ssSay(root, "Scan the code, then type the 6-digit code from your app.");
|
|
7725
|
+
ssFocus(card.querySelector("input[name=code]"));
|
|
7726
|
+
};
|
|
7727
|
+
// With hx-* the server swaps a fresh secret into the setup panel while it opens.
|
|
7728
|
+
if (ssServer(btn)) open();
|
|
7729
|
+
else ssLater(btn, 500, open);
|
|
7730
|
+
} else if (card && near(e, "[data-asta-security-cancel]")) {
|
|
7731
|
+
ssState(card, "off");
|
|
7732
|
+
ssFocus(card.querySelector("[data-asta-security-2fa-start]"));
|
|
7733
|
+
} else if (card && near(e, "[data-asta-security-codes-done]")) {
|
|
7734
|
+
ssState(card, "on");
|
|
7735
|
+
ssSay(root, "Recovery codes hidden.");
|
|
7736
|
+
ssFocus(card.querySelector("[data-asta-security-ask]"));
|
|
7737
|
+
} else if (card && near(e, "[data-asta-security-codes-download]")) {
|
|
7738
|
+
const codes = [...card.querySelectorAll(".asta-security-settings-codes-list li")].map((li) => li.textContent);
|
|
7739
|
+
fire(root, "asta:security", { action: "codes-download", codes });
|
|
7740
|
+
const url = URL.createObjectURL(new Blob([`Recovery codes. Each one works once.\n\n${codes.join("\n")}\n`], { type: "text/plain" }));
|
|
7741
|
+
Object.assign(document.createElement("a"), { href: url, download: "recovery-codes.txt" }).click();
|
|
7742
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
7743
|
+
} else if ((btn = near(e, "[data-asta-security-ask]"))) {
|
|
7744
|
+
ssAsk(btn, btn.getAttribute("aria-expanded") !== "true");
|
|
7745
|
+
} else if ((btn = near(e, "[data-asta-security-keep]"))) {
|
|
7746
|
+
ssAsk(ssAsker(btn.closest(".asta-security-settings-confirm")), false);
|
|
7747
|
+
} else if ((btn = near(e, "[data-asta-security-go]"))) {
|
|
7748
|
+
ssGo(root, btn.closest(".asta-security-settings-confirm"));
|
|
7749
|
+
} else if (row && (btn = near(e, "[data-asta-security-signout]"))) {
|
|
7750
|
+
fire(root, "asta:security", { action: "signout", id: row.dataset.id });
|
|
7751
|
+
if (ssServer(btn)) return;
|
|
7752
|
+
row.setAttribute("data-busy", "");
|
|
7753
|
+
ssLater(btn, 700, () => {
|
|
7754
|
+
const next = row.nextElementSibling ?? row.previousElementSibling;
|
|
7755
|
+
row.remove();
|
|
7756
|
+
ssCount(root);
|
|
7757
|
+
ssSay(root, "Session signed out.");
|
|
7758
|
+
ssFocus(next?.querySelector("[data-asta-security-signout]") ?? root.querySelector("[data-asta-security-sessions-heading]"));
|
|
7759
|
+
});
|
|
7760
|
+
} else if ((btn = near(e, "[data-asta-security-passkey-add]"))) {
|
|
7761
|
+
fire(root, "asta:security", { action: "passkey-add" });
|
|
7762
|
+
if (ssServer(btn)) return;
|
|
7763
|
+
ssLater(btn, 900, () => {
|
|
7764
|
+
const tpl = root.querySelector("template[data-asta-security-passkey]");
|
|
7765
|
+
const list = root.querySelector("[data-asta-security-passkeys]");
|
|
7766
|
+
if (!tpl || !list) return;
|
|
7767
|
+
const li = tpl.content.firstElementChild.cloneNode(true);
|
|
7768
|
+
const uid = `ss-pk-${Date.now().toString(36)}`;
|
|
7769
|
+
li.dataset.id = uid;
|
|
7770
|
+
li.querySelector("[data-asta-security-ask]")?.setAttribute("aria-controls", `${uid}-confirm`);
|
|
7771
|
+
const strip = li.querySelector(".asta-security-settings-confirm");
|
|
7772
|
+
if (strip) strip.id = `${uid}-confirm`;
|
|
7773
|
+
const date = li.querySelector("[data-slot=added]");
|
|
7774
|
+
if (date) date.textContent = `Added ${new Date().toLocaleDateString("en-US", { month: "short", day: "numeric" })} · Not used yet`;
|
|
7775
|
+
list.append(li);
|
|
7776
|
+
list.closest(".asta-security-settings-card")?.querySelector(".asta-security-settings-empty")?.setAttribute("hidden", "");
|
|
7777
|
+
ssSay(root, "Passkey added.");
|
|
7778
|
+
});
|
|
7779
|
+
}
|
|
7780
|
+
});
|
|
7781
|
+
|
|
7782
|
+
document.addEventListener("submit", (e) => {
|
|
7783
|
+
const form = e.target instanceof HTMLFormElement && e.target.matches("[data-asta-security-verify]") ? e.target : null;
|
|
7784
|
+
const root = form?.closest("[data-asta-security]");
|
|
7785
|
+
if (form && root) ssVerify(root, form, e);
|
|
7786
|
+
}, true);
|
|
7787
|
+
// Digits only, but never block a paste: spaces and dashes are dropped as they come in.
|
|
7788
|
+
document.addEventListener("input", (e) => {
|
|
7789
|
+
const t = e.target;
|
|
7790
|
+
if (!(t instanceof HTMLInputElement) || !t.matches("[data-asta-security-verify] input[name=code]")) return;
|
|
7791
|
+
const clean = t.value.replace(/\D/g, "").slice(0, 6);
|
|
7792
|
+
if (clean !== t.value) t.value = clean;
|
|
7793
|
+
if (t.hasAttribute("aria-invalid")) {
|
|
7794
|
+
t.removeAttribute("aria-invalid");
|
|
7795
|
+
ssMsg(document.getElementById(t.getAttribute("aria-describedby")), null);
|
|
7796
|
+
}
|
|
7797
|
+
});
|
|
7798
|
+
// Escape closes a confirm strip, or leaves setup.
|
|
7799
|
+
document.addEventListener("keydown", (e) => {
|
|
7800
|
+
if (e.key !== "Escape") return;
|
|
7801
|
+
const strip = near(e, "[data-asta-security] .asta-security-settings-confirm");
|
|
7802
|
+
if (strip) {
|
|
7803
|
+
e.preventDefault();
|
|
7804
|
+
return ssAsk(ssAsker(strip), false);
|
|
7805
|
+
}
|
|
7806
|
+
const setup = near(e, "[data-asta-security] .asta-security-settings-setup");
|
|
7807
|
+
const card = setup?.closest(".asta-security-settings-2fa");
|
|
7808
|
+
if (card) {
|
|
7809
|
+
e.preventDefault();
|
|
7810
|
+
ssState(card, "off");
|
|
7811
|
+
ssFocus(card.querySelector("[data-asta-security-2fa-start]"));
|
|
7812
|
+
}
|
|
7813
|
+
});
|
|
7814
|
+
|
|
7815
|
+
/* ---------- webhooks ---------- */
|
|
7816
|
+
/* ---------- Webhooks ----------
|
|
7817
|
+
* Webhooks [data-asta-webhooks]: [data-asta-webhooks-create|cancel] open and close the add form, checked on submit
|
|
7818
|
+
* (an https URL, one event at least). Group boxes [data-asta-webhooks-all="invoice"] tick their events and
|
|
7819
|
+
* show a dash when only some are ticked. Without hx-post or action the form adds a demo endpoint from
|
|
7820
|
+
* <template data-asta-webhooks-item> and <template data-asta-webhooks-detail>, then fires
|
|
7821
|
+
* "asta:webhook-create". Items (.asta-webhooks-item, arrows move) pick the detail panel they control.
|
|
7822
|
+
* The switch fires "asta:webhook-toggle" {id, enabled}. [data-asta-webhooks-reveal] swaps the masked secret
|
|
7823
|
+
* for data-secret. [data-asta-webhooks-test] and [data-asta-webhooks-retry] are async: without hx-* they
|
|
7824
|
+
* fake a result, otherwise the server answers. [data-asta-webhooks-delete|keep|confirm] ask, then fire
|
|
7825
|
+
* "asta:webhook-delete" {id} and remove the endpoint.
|
|
7826
|
+
* Uses near, fire and el from the top of this file. */
|
|
7827
|
+
|
|
7828
|
+
const whRoot = (e) => near(e, "[data-asta-webhooks]");
|
|
7829
|
+
const whSoon = (node) => node && requestAnimationFrame(() => node.focus());
|
|
7830
|
+
const whRemote = (n) => !!n && (n.hasAttribute("action") || [...n.attributes].some((a) => /^(hx|data-hx)-(get|post|put|patch|delete)$/.test(a.name)));
|
|
7831
|
+
const whHost = (u) => u.replace(/^https?:\/\//, "");
|
|
7832
|
+
const whWait = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
7833
|
+
const WH_ICON = {
|
|
7834
|
+
enabled: "M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12ZM5.5 8.3l1.7 1.7 3.3-3.4",
|
|
7835
|
+
disabled: "M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12ZM6.75 6v4M9.25 6v4",
|
|
7836
|
+
failing: "M8 2.5 14 13H2zM8 6.5v3M8 11.2h.01",
|
|
7837
|
+
};
|
|
7838
|
+
const WH_WORD = { enabled: "Enabled", disabled: "Disabled", failing: "Failing" };
|
|
7839
|
+
const whSvg = (d) => `<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
7840
|
+
|
|
7841
|
+
function whStatus(node, s) {
|
|
7842
|
+
if (!node) return;
|
|
7843
|
+
node.dataset.status = s;
|
|
7844
|
+
node.innerHTML = `${whSvg(WH_ICON[s])}${WH_WORD[s]}`;
|
|
7845
|
+
}
|
|
7846
|
+
|
|
7847
|
+
/* Form */
|
|
7848
|
+
const whForm = (root) => root.querySelector("[data-asta-webhooks-form]");
|
|
7849
|
+
const whCreate = (root) => root.querySelector("[data-asta-webhooks-create]");
|
|
7850
|
+
function whMsg(msg, text) {
|
|
7851
|
+
if (!msg) return;
|
|
7852
|
+
msg.toggleAttribute("data-error", !!text);
|
|
7853
|
+
msg.querySelector("span:last-child").textContent = text || msg.dataset.hint;
|
|
7854
|
+
}
|
|
7855
|
+
const msgOf = (n) => n && document.getElementById(n.getAttribute("aria-describedby"));
|
|
7856
|
+
function whOpen(root) {
|
|
7857
|
+
const form = whForm(root);
|
|
7858
|
+
if (!form) return;
|
|
7859
|
+
form.hidden = false;
|
|
7860
|
+
whCreate(root)?.setAttribute("aria-expanded", "true");
|
|
7861
|
+
whSoon(form.querySelector("input[name=url]"));
|
|
7862
|
+
}
|
|
7863
|
+
function whClose(root, focus = true) {
|
|
7864
|
+
const form = whForm(root);
|
|
7865
|
+
if (!form) return;
|
|
7866
|
+
form.hidden = true;
|
|
7867
|
+
form.reset();
|
|
7868
|
+
form.querySelectorAll("[data-asta-webhooks-all]").forEach((b) => (b.indeterminate = false));
|
|
7869
|
+
form.querySelectorAll("[aria-invalid]").forEach((n) => n.removeAttribute("aria-invalid"));
|
|
7870
|
+
form.querySelectorAll(".asta-webhooks-msg").forEach((m) => whMsg(m, ""));
|
|
7871
|
+
form.querySelector(".asta-webhooks-alert")?.setAttribute("hidden", "");
|
|
7872
|
+
whCreate(root)?.setAttribute("aria-expanded", "false");
|
|
7873
|
+
if (focus) whSoon(whCreate(root));
|
|
7874
|
+
}
|
|
7875
|
+
function whUrlError(root, value) {
|
|
7876
|
+
const s = value.trim();
|
|
7877
|
+
if (!s) return "Enter the URL that should receive events.";
|
|
7878
|
+
let u;
|
|
7879
|
+
try {
|
|
7880
|
+
u = new URL(s);
|
|
7881
|
+
} catch {
|
|
7882
|
+
return "Enter a full URL, like https://api.yourapp.com/webhooks.";
|
|
7883
|
+
}
|
|
7884
|
+
if (u.protocol !== "https:") return "Use an https:// URL. Events carry customer data.";
|
|
7885
|
+
if ([...root.querySelectorAll(".asta-webhooks-item")].some((b) => b.dataset.url === u.href)) return "This URL already has an endpoint.";
|
|
7886
|
+
return "";
|
|
7887
|
+
}
|
|
7888
|
+
function whShowUrl(root, input) {
|
|
7889
|
+
const err = whUrlError(root, input.value);
|
|
7890
|
+
if (err) input.setAttribute("aria-invalid", "true");
|
|
7891
|
+
else input.removeAttribute("aria-invalid");
|
|
7892
|
+
whMsg(msgOf(input), err);
|
|
7893
|
+
return err;
|
|
7894
|
+
}
|
|
7895
|
+
function whCheck(root, form) {
|
|
7896
|
+
const url = form.querySelector("input[name=url]");
|
|
7897
|
+
const events = [...form.querySelectorAll("input[name=events]")];
|
|
7898
|
+
const urlErr = url ? whShowUrl(root, url) : "";
|
|
7899
|
+
const noEvent = events.length > 0 && !events.some((n) => n.checked);
|
|
7900
|
+
whMsg(msgOf(form.querySelector(".asta-webhooks-events")), noEvent ? "Pick at least one event." : "");
|
|
7901
|
+
if (urlErr) url.focus();
|
|
7902
|
+
else if (noEvent) form.querySelector("[data-asta-webhooks-all]")?.focus();
|
|
7903
|
+
return !urlErr && !noEvent;
|
|
7904
|
+
}
|
|
7905
|
+
// A group box reflects its events: ticked, empty or a dash.
|
|
7906
|
+
function whSync(group) {
|
|
7907
|
+
const all = group.querySelector("[data-asta-webhooks-all]");
|
|
7908
|
+
const evs = [...group.querySelectorAll("input[name=events]")];
|
|
7909
|
+
const n = evs.filter((x) => x.checked).length;
|
|
7910
|
+
if (all) {
|
|
7911
|
+
all.checked = n === evs.length;
|
|
7912
|
+
all.indeterminate = n > 0 && n < evs.length;
|
|
7913
|
+
}
|
|
7914
|
+
const form = group.closest("form");
|
|
7915
|
+
const msg = form && msgOf(form.querySelector(".asta-webhooks-events"));
|
|
7916
|
+
if (msg && !msg.hasAttribute("data-error")) {
|
|
7917
|
+
const total = form.querySelectorAll("input[name=events]:checked").length;
|
|
7918
|
+
msg.querySelector("span:last-child").textContent = `${total ? `${total} selected. ` : ""}${msg.dataset.hint}`;
|
|
7919
|
+
}
|
|
7920
|
+
}
|
|
7921
|
+
|
|
7922
|
+
function whFill(node, map) {
|
|
7923
|
+
node.querySelectorAll("[data-slot]").forEach((n) => (n.textContent = map[n.dataset.slot] ?? n.textContent));
|
|
7924
|
+
}
|
|
7925
|
+
function whDemoCreate(root, form) {
|
|
7926
|
+
const itemTpl = root.querySelector("template[data-asta-webhooks-item]");
|
|
7927
|
+
const detailTpl = root.querySelector("template[data-asta-webhooks-detail]");
|
|
7928
|
+
const list = root.querySelector(".asta-webhooks-list");
|
|
7929
|
+
if (!itemTpl || !detailTpl || !list) return;
|
|
7930
|
+
const url = new URL(form.querySelector("input[name=url]").value.trim()).href;
|
|
7931
|
+
const description = form.querySelector("input[name=description]")?.value.trim() ?? "";
|
|
7932
|
+
const events = [...form.querySelectorAll("input[name=events]:checked")].map((n) => n.value);
|
|
7933
|
+
const id = `we${Date.now().toString(36)}`;
|
|
7934
|
+
const secret = `whsec_demo_${Math.random().toString(36).slice(2, 14)}${Math.random().toString(36).slice(2, 14)}`;
|
|
7935
|
+
const map = { url, host: whHost(url), description: description || "No description", meta: `${events.length} ${events.length === 1 ? "event" : "events"}${description ? ` · ${description}` : ""}`, count: `${events.length} events subscribed`, secret: `${secret.slice(0, 6)}${"•".repeat(14)}${secret.slice(-4)}` };
|
|
7936
|
+
const li = itemTpl.content.firstElementChild.cloneNode(true);
|
|
7937
|
+
const detail = detailTpl.content.firstElementChild.cloneNode(true);
|
|
7938
|
+
whFill(li, map);
|
|
7939
|
+
whFill(detail, map);
|
|
7940
|
+
const btn = li.querySelector(".asta-webhooks-item");
|
|
7941
|
+
btn.dataset.url = url;
|
|
7942
|
+
btn.setAttribute("aria-controls", `${id}-d`);
|
|
7943
|
+
btn.querySelector(".asta-webhooks-url")?.setAttribute("title", url);
|
|
7944
|
+
detail.id = `${id}-d`;
|
|
7945
|
+
detail.dataset.id = id;
|
|
7946
|
+
detail.hidden = true;
|
|
7947
|
+
const code = detail.querySelector("[data-secret]");
|
|
7948
|
+
if (code) code.dataset.secret = secret;
|
|
7949
|
+
detail.querySelector("[data-asta-copy]")?.setAttribute("data-asta-copy", secret);
|
|
7950
|
+
list.prepend(li);
|
|
7951
|
+
list.parentElement.append(detail);
|
|
7952
|
+
whClose(root, false);
|
|
7953
|
+
fire(root, "asta:webhook-create", { url, events, description });
|
|
7954
|
+
whSelect(root, btn);
|
|
7955
|
+
whSoon(detail.querySelector("h4"));
|
|
7956
|
+
}
|
|
7957
|
+
|
|
7958
|
+
/* List and detail */
|
|
7959
|
+
function whSelect(root, btn, reveal = false) {
|
|
7960
|
+
root.querySelectorAll(".asta-webhooks-item").forEach((b) => {
|
|
7961
|
+
const on = b === btn;
|
|
7962
|
+
b.toggleAttribute("aria-current", on);
|
|
7963
|
+
if (on) b.setAttribute("aria-current", "true");
|
|
7964
|
+
const panel = document.getElementById(b.getAttribute("aria-controls"));
|
|
7965
|
+
if (panel) panel.hidden = !on;
|
|
7966
|
+
});
|
|
7967
|
+
const panel = document.getElementById(btn.getAttribute("aria-controls"));
|
|
7968
|
+
// Stacked layout: bring the detail into view.
|
|
7969
|
+
if (reveal && panel && root.clientWidth < 760) {
|
|
7970
|
+
const smooth = !matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
7971
|
+
requestAnimationFrame(() => panel.scrollIntoView({ block: "start", behavior: smooth ? "smooth" : "auto" }));
|
|
7972
|
+
}
|
|
7973
|
+
}
|
|
7974
|
+
const itemFor = (root, detail) => root.querySelector(`.asta-webhooks-item[aria-controls="${detail.id}"]`);
|
|
7975
|
+
|
|
7976
|
+
function whToggle(root, sw) {
|
|
7977
|
+
const detail = sw.closest(".asta-webhooks-detail");
|
|
7978
|
+
const on = sw.getAttribute("aria-checked") !== "true";
|
|
7979
|
+
sw.setAttribute("aria-checked", String(on));
|
|
7980
|
+
const failing = detail.dataset.failing !== undefined;
|
|
7981
|
+
const s = !on ? "disabled" : failing ? "failing" : "enabled";
|
|
7982
|
+
whStatus(detail.querySelector(".asta-webhooks-status"), s);
|
|
7983
|
+
whStatus(itemFor(root, detail)?.querySelector(".asta-webhooks-status"), s);
|
|
7984
|
+
const test = detail.querySelector("[data-asta-webhooks-test]");
|
|
7985
|
+
if (test) test.disabled = !on;
|
|
7986
|
+
fire(detail, "asta:webhook-toggle", { id: detail.dataset.id, enabled: on });
|
|
7987
|
+
}
|
|
7988
|
+
|
|
7989
|
+
const WH_CODE = { 200: "OK", 201: "Created", 202: "Accepted", 204: "No content", 400: "Bad request", 401: "Unauthorized", 404: "Not found", 429: "Too many requests", 500: "Server error", 502: "Bad gateway", 503: "Unavailable", 504: "Gateway timeout" };
|
|
7990
|
+
const whWord = (c) => (c ? WH_CODE[c] ?? (c < 300 ? "Success" : c < 500 ? "Client error" : "Server error") : "No response");
|
|
7991
|
+
|
|
7992
|
+
function whDelivery(event, status, ms) {
|
|
7993
|
+
const li = document.createElement("li");
|
|
7994
|
+
li.className = "asta-webhooks-delivery";
|
|
7995
|
+
if (!(status >= 200 && status < 300)) li.setAttribute("data-failed", "");
|
|
7996
|
+
li.innerHTML = `<code></code><span class="asta-webhooks-dmeta"><span class="asta-webhooks-code">${whSvg(WH_ICON.enabled)}${whSvg(WH_ICON.failing)}<span></span></span><span>${ms} ms</span><span>Just now</span></span><span class="asta-webhooks-daction"><button type="button" class="asta-btn asta-btn-ghost asta-btn-xs" data-asta-webhooks-retry><span class="asta-btn-label">Retry</span><span class="asta-btn-spinner" aria-hidden="true">${whSvg("M8 2a6 6 0 1 0 6 6")}</span></button><span data-when="failed">Still failing</span><span data-when="ok">${whSvg("m3.5 8.5 3 3 6-7")}Retried</span></span>`;
|
|
7997
|
+
li.querySelector("code").textContent = event;
|
|
7998
|
+
li.querySelector(".asta-webhooks-code > span").textContent = `${status ?? "—"} ${whWord(status)}`;
|
|
7999
|
+
li.querySelector("[data-asta-webhooks-retry]").setAttribute("aria-label", `Retry ${event}`);
|
|
8000
|
+
return li;
|
|
8001
|
+
}
|
|
8002
|
+
|
|
8003
|
+
async function whTest(root, btn) {
|
|
8004
|
+
const detail = btn.closest(".asta-webhooks-detail");
|
|
8005
|
+
const out = detail.querySelector(".asta-webhooks-result");
|
|
8006
|
+
btn.setAttribute("aria-busy", "true");
|
|
8007
|
+
btn.disabled = true;
|
|
8008
|
+
await whWait(900);
|
|
8009
|
+
const failing = detail.dataset.failing !== undefined;
|
|
8010
|
+
const status = failing ? 502 : 200;
|
|
8011
|
+
const ms = failing ? 1204 : 90 + Math.round(Math.random() * 120);
|
|
8012
|
+
btn.removeAttribute("aria-busy");
|
|
8013
|
+
btn.disabled = false;
|
|
8014
|
+
if (out) {
|
|
8015
|
+
out.innerHTML = `<span${failing ? "" : " data-ok"}>${whSvg(failing ? WH_ICON.failing : WH_ICON.enabled)}<span></span></span>`;
|
|
8016
|
+
out.querySelector("span > span").textContent = `${failing ? "Test failed" : "Test delivered"}: ${status} ${whWord(status)} in ${ms} ms`;
|
|
8017
|
+
}
|
|
8018
|
+
detail.querySelector(".asta-webhooks-dlist")?.prepend(whDelivery("test.ping", status, ms));
|
|
8019
|
+
fire(detail, "asta:webhook-test", { id: detail.dataset.id, status });
|
|
8020
|
+
}
|
|
8021
|
+
|
|
8022
|
+
async function whRetry(btn) {
|
|
8023
|
+
const li = btn.closest(".asta-webhooks-delivery");
|
|
8024
|
+
const detail = btn.closest(".asta-webhooks-detail");
|
|
8025
|
+
li.dataset.retry = "pending";
|
|
8026
|
+
btn.setAttribute("aria-busy", "true");
|
|
8027
|
+
btn.disabled = true;
|
|
8028
|
+
await whWait(900);
|
|
8029
|
+
// Demo: a failing endpoint fails its first retry, then succeeds.
|
|
8030
|
+
const n = Number(li.dataset.tries || 0) + 1;
|
|
8031
|
+
li.dataset.tries = String(n);
|
|
8032
|
+
const ok = !(detail?.dataset.failing !== undefined && n === 1);
|
|
8033
|
+
const status = ok ? 200 : 500;
|
|
8034
|
+
btn.removeAttribute("aria-busy");
|
|
8035
|
+
btn.disabled = false;
|
|
8036
|
+
li.dataset.retry = ok ? "ok" : "failed";
|
|
8037
|
+
li.toggleAttribute("data-failed", !ok);
|
|
8038
|
+
const code = li.querySelector(".asta-webhooks-code > span:last-child");
|
|
8039
|
+
if (code) code.textContent = `${status} ${whWord(status)}`;
|
|
8040
|
+
const meta = li.querySelectorAll(".asta-webhooks-dmeta > span");
|
|
8041
|
+
if (meta[1]) meta[1].textContent = `${ok ? 156 : 912} ms`;
|
|
8042
|
+
if (meta[2]) meta[2].textContent = "Just now";
|
|
8043
|
+
fire(li, "asta:webhook-retry", { id: detail?.dataset.id, delivery: li.dataset.id, status });
|
|
8044
|
+
if (!ok) whSoon(btn);
|
|
8045
|
+
else whSoon(detail?.querySelector("h4"));
|
|
8046
|
+
}
|
|
8047
|
+
|
|
8048
|
+
function whAsk(detail, open) {
|
|
8049
|
+
const confirm = detail.querySelector(".asta-webhooks-confirm");
|
|
8050
|
+
const btn = detail.querySelector("[data-asta-webhooks-delete]");
|
|
8051
|
+
if (!confirm) return;
|
|
8052
|
+
confirm.hidden = !open;
|
|
8053
|
+
btn?.setAttribute("aria-expanded", String(open));
|
|
8054
|
+
whSoon(open ? confirm.querySelector("[data-asta-webhooks-keep]") : btn);
|
|
8055
|
+
}
|
|
8056
|
+
function whDelete(root, detail) {
|
|
8057
|
+
const item = itemFor(root, detail);
|
|
8058
|
+
const li = item?.closest("li");
|
|
8059
|
+
const next = (li?.nextElementSibling ?? li?.previousElementSibling)?.querySelector(".asta-webhooks-item");
|
|
8060
|
+
fire(root, "asta:webhook-delete", { id: detail.dataset.id });
|
|
8061
|
+
li?.remove();
|
|
8062
|
+
detail.remove();
|
|
8063
|
+
if (next) {
|
|
8064
|
+
whSelect(root, next);
|
|
8065
|
+
whSoon(next);
|
|
8066
|
+
} else whSoon(whCreate(root));
|
|
8067
|
+
}
|
|
8068
|
+
|
|
8069
|
+
document.addEventListener("click", (e) => {
|
|
8070
|
+
const root = whRoot(e);
|
|
8071
|
+
if (!root) return;
|
|
8072
|
+
const detail = near(e, ".asta-webhooks-detail");
|
|
8073
|
+
const item = near(e, ".asta-webhooks-item");
|
|
8074
|
+
if (near(e, "[data-asta-webhooks-create]")) {
|
|
8075
|
+
const form = whForm(root);
|
|
8076
|
+
if (form && !form.hidden) form.querySelector("input[name=url]")?.focus();
|
|
8077
|
+
else whOpen(root);
|
|
8078
|
+
} else if (near(e, "[data-asta-webhooks-cancel]")) whClose(root);
|
|
8079
|
+
else if (item) whSelect(root, item, true);
|
|
8080
|
+
else if (!detail) return;
|
|
8081
|
+
else if (near(e, ".asta-webhooks-switch")) whToggle(root, near(e, ".asta-webhooks-switch"));
|
|
8082
|
+
else if (near(e, "[data-asta-webhooks-reveal]")) {
|
|
8083
|
+
const btn = near(e, "[data-asta-webhooks-reveal]");
|
|
8084
|
+
const code = detail.querySelector("[data-secret]");
|
|
8085
|
+
const show = btn.getAttribute("aria-pressed") !== "true";
|
|
8086
|
+
btn.setAttribute("aria-pressed", String(show));
|
|
8087
|
+
btn.querySelector(".asta-btn-label").textContent = show ? "Hide" : "Reveal";
|
|
8088
|
+
if (code) {
|
|
8089
|
+
code.dataset.masked ??= code.textContent;
|
|
8090
|
+
code.textContent = show ? code.dataset.secret : code.dataset.masked;
|
|
8091
|
+
}
|
|
8092
|
+
} else if (near(e, "[data-asta-webhooks-test]") && !whRemote(near(e, "[data-asta-webhooks-test]"))) whTest(root, near(e, "[data-asta-webhooks-test]"));
|
|
8093
|
+
else if (near(e, "[data-asta-webhooks-retry]") && !whRemote(near(e, "[data-asta-webhooks-retry]"))) whRetry(near(e, "[data-asta-webhooks-retry]"));
|
|
8094
|
+
else if (near(e, "[data-asta-webhooks-delete]")) whAsk(detail, true);
|
|
8095
|
+
else if (near(e, "[data-asta-webhooks-keep]")) whAsk(detail, false);
|
|
8096
|
+
else if (near(e, "[data-asta-webhooks-confirm]")) whDelete(root, detail);
|
|
8097
|
+
});
|
|
8098
|
+
|
|
8099
|
+
document.addEventListener("change", (e) => {
|
|
8100
|
+
if (!whRoot(e)) return;
|
|
8101
|
+
const t = el(e);
|
|
8102
|
+
const group = t?.closest(".asta-webhooks-group");
|
|
8103
|
+
if (!group) return;
|
|
8104
|
+
if (t.matches("[data-asta-webhooks-all]")) group.querySelectorAll("input[name=events]").forEach((n) => (n.checked = t.checked));
|
|
8105
|
+
whSync(group);
|
|
8106
|
+
});
|
|
8107
|
+
|
|
8108
|
+
// Errors show on blur and submit, never while typing; a shown error clears once the value is fixed.
|
|
8109
|
+
document.addEventListener("focusout", (e) => {
|
|
8110
|
+
const root = whRoot(e);
|
|
8111
|
+
const t = el(e);
|
|
8112
|
+
if (root && t?.matches("[data-asta-webhooks-form] input[name=url]") && t.value.trim()) whShowUrl(root, t);
|
|
8113
|
+
});
|
|
8114
|
+
document.addEventListener("input", (e) => {
|
|
8115
|
+
const root = whRoot(e);
|
|
8116
|
+
const t = el(e);
|
|
8117
|
+
if (root && t?.matches("[data-asta-webhooks-form] input[name=url][aria-invalid]") && !whUrlError(root, t.value)) {
|
|
8118
|
+
t.removeAttribute("aria-invalid");
|
|
8119
|
+
whMsg(msgOf(t), "");
|
|
8120
|
+
}
|
|
8121
|
+
});
|
|
8122
|
+
|
|
8123
|
+
// Capture phase, so an invalid form never reaches htmx or the browser.
|
|
8124
|
+
document.addEventListener(
|
|
8125
|
+
"submit",
|
|
8126
|
+
(e) => {
|
|
8127
|
+
const form = e.target instanceof HTMLFormElement && e.target.matches("[data-asta-webhooks-form]") ? e.target : null;
|
|
8128
|
+
const root = form?.closest("[data-asta-webhooks]");
|
|
8129
|
+
if (!root) return;
|
|
8130
|
+
if (!whCheck(root, form)) {
|
|
8131
|
+
e.preventDefault();
|
|
8132
|
+
e.stopPropagation();
|
|
8133
|
+
return;
|
|
8134
|
+
}
|
|
8135
|
+
if (!whRemote(form)) {
|
|
8136
|
+
e.preventDefault();
|
|
8137
|
+
whDemoCreate(root, form);
|
|
8138
|
+
}
|
|
8139
|
+
},
|
|
8140
|
+
true,
|
|
8141
|
+
);
|
|
8142
|
+
|
|
8143
|
+
document.addEventListener("keydown", (e) => {
|
|
8144
|
+
const root = whRoot(e);
|
|
8145
|
+
if (!root) return;
|
|
8146
|
+
if (e.key === "Escape") {
|
|
8147
|
+
if (near(e, "[data-asta-webhooks-form]")) {
|
|
8148
|
+
e.preventDefault();
|
|
8149
|
+
whClose(root);
|
|
8150
|
+
} else if (near(e, ".asta-webhooks-confirm")) {
|
|
8151
|
+
e.preventDefault();
|
|
8152
|
+
whAsk(near(e, ".asta-webhooks-detail"), false);
|
|
8153
|
+
}
|
|
8154
|
+
return;
|
|
8155
|
+
}
|
|
8156
|
+
const item = near(e, ".asta-webhooks-item");
|
|
8157
|
+
if (!item || !["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
|
|
8158
|
+
const items = [...root.querySelectorAll(".asta-webhooks-item")];
|
|
8159
|
+
const i = items.indexOf(item);
|
|
8160
|
+
const n = e.key === "ArrowDown" ? i + 1 : e.key === "ArrowUp" ? i - 1 : e.key === "Home" ? 0 : items.length - 1;
|
|
8161
|
+
const next = items[Math.max(0, Math.min(items.length - 1, n))];
|
|
8162
|
+
e.preventDefault();
|
|
8163
|
+
whSelect(root, next);
|
|
8164
|
+
next.focus();
|
|
8165
|
+
});
|
|
8166
|
+
|
|
8167
|
+
/* ---------- feature-flags ---------- */
|
|
8168
|
+
/* ---------- Feature flags ----------
|
|
8169
|
+
* Feature flags [data-asta-flags data-env="staging" data-url?]: rows keep their state in data-development,
|
|
8170
|
+
* data-staging and data-production ("on 25"). The environment radios [data-asta-flags-env] re-render every
|
|
8171
|
+
* switch, bar, env strip and rollout field. [data-asta-flags-search] and the [data-asta-flags-filter] radios
|
|
8172
|
+
* (all, on, off, stale) hide rows, update [data-count] and show [data-asta-flags-empty]. [data-asta-flags-expand]
|
|
8173
|
+
* opens the row panel. The switch [data-asta-flags-switch] and [data-asta-flags-save] change the current
|
|
8174
|
+
* environment; in production they ask first in .asta-feature-flags-confirm ([data-asta-flags-keep|confirm],
|
|
8175
|
+
* Esc keeps). Changes are optimistic: with data-url asta.js POSTs JSON {key, env, on|rollout|rules} and rolls
|
|
8176
|
+
* back on a non-2xx answer; it always fires "asta:flag-change" {key, env, change, rollback()}. Rules are added
|
|
8177
|
+
* by [data-asta-flags-addrule] and removed by [data-asta-flags-rule-remove]. [data-asta-flags-create|cancel]
|
|
8178
|
+
* open and close the new flag form, checked on submit. Without hx-post or action it adds a row from
|
|
8179
|
+
* <template data-asta-flags-row> and fires "asta:flag-create" {key, name}.
|
|
8180
|
+
* Uses near, fire and el from the top of this file. */
|
|
8181
|
+
|
|
8182
|
+
const ffRoot = (e) => near(e, "[data-asta-flags]");
|
|
8183
|
+
const ffSoon = (node) => node && requestAnimationFrame(() => node.focus());
|
|
8184
|
+
const ffRemote = (n) => !!n && (n.hasAttribute("action") || [...n.attributes].some((a) => /^(hx|data-hx)-(get|post|put|patch|delete)$/.test(a.name)));
|
|
8185
|
+
const ffEsc = (s) => s.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
|
|
8186
|
+
const FF_ENV = { development: ["Development", "Dev"], staging: ["Staging", "Staging"], production: ["Production", "Prod"] };
|
|
8187
|
+
const FF_KEY = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
8188
|
+
const FF_ATTRS = [
|
|
8189
|
+
["Workspace plan", ["is", "is not"], "Growth"],
|
|
8190
|
+
["Email", ["ends with", "is"], "@astabyte.com"],
|
|
8191
|
+
["Country", ["is", "is not"], "ID"],
|
|
8192
|
+
];
|
|
8193
|
+
const ffSlug = (s) => s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48);
|
|
8194
|
+
const ffEnv = (root) => root.dataset.env || "staging";
|
|
8195
|
+
const ffGet = (row, env) => {
|
|
8196
|
+
const [s, n] = (row.dataset[env] || "off 100").split(" ");
|
|
8197
|
+
return { on: s === "on", rollout: Math.max(0, Math.min(100, Number(n) || 0)) };
|
|
8198
|
+
};
|
|
8199
|
+
const ffSet = (row, env, st) => (row.dataset[env] = `${st.on ? "on" : "off"} ${st.rollout}`);
|
|
8200
|
+
const ffRules = (row) =>
|
|
8201
|
+
[...row.querySelectorAll(".asta-feature-flags-rule")].map((li) => ({ attribute: li.dataset.attribute, operator: li.dataset.operator, value: li.dataset.value }));
|
|
8202
|
+
|
|
8203
|
+
function ffSay(root, msg) {
|
|
8204
|
+
const s = root.querySelector("[data-asta-flags-status]");
|
|
8205
|
+
if (s) s.textContent = msg;
|
|
8206
|
+
}
|
|
8207
|
+
|
|
8208
|
+
// Paint one row for the current environment.
|
|
8209
|
+
function ffPaint(row) {
|
|
8210
|
+
const root = row.closest("[data-asta-flags]");
|
|
8211
|
+
const env = ffEnv(root);
|
|
8212
|
+
const { on, rollout } = ffGet(row, env);
|
|
8213
|
+
const sw = row.querySelector("[data-asta-flags-switch]");
|
|
8214
|
+
if (sw) {
|
|
8215
|
+
sw.checked = on;
|
|
8216
|
+
sw.setAttribute("aria-label", `${row.dataset.key} in ${FF_ENV[env][0]}`);
|
|
8217
|
+
}
|
|
8218
|
+
const bar = row.querySelector(".asta-feature-flags-bar > span");
|
|
8219
|
+
if (bar) {
|
|
8220
|
+
bar.style.setProperty("--value", String(rollout / 100));
|
|
8221
|
+
bar.toggleAttribute("data-on", on);
|
|
8222
|
+
}
|
|
8223
|
+
const text = row.querySelector("[data-asta-flags-amount-text]");
|
|
8224
|
+
if (text) text.innerHTML = `${rollout}%${on ? "" : "<span> · off</span>"}`;
|
|
8225
|
+
row.querySelectorAll(".asta-feature-flags-envs > [data-env]").forEach((s) => {
|
|
8226
|
+
const st = ffGet(row, s.dataset.env);
|
|
8227
|
+
s.toggleAttribute("data-on", st.on);
|
|
8228
|
+
s.setAttribute("aria-current", String(s.dataset.env === env));
|
|
8229
|
+
s.textContent = `${FF_ENV[s.dataset.env][1]} ${st.on ? "on" : "off"}`;
|
|
8230
|
+
});
|
|
8231
|
+
const label = row.querySelector("[data-env-label]");
|
|
8232
|
+
if (label) label.textContent = FF_ENV[env][0];
|
|
8233
|
+
ffDraft(row, rollout);
|
|
8234
|
+
}
|
|
8235
|
+
|
|
8236
|
+
// Put the rollout fields back to a value and hide Save / Reset.
|
|
8237
|
+
function ffDraft(row, n) {
|
|
8238
|
+
const amount = row.querySelector(".asta-feature-flags-amount");
|
|
8239
|
+
if (!amount) return;
|
|
8240
|
+
const range = amount.querySelector("[data-asta-flags-range]");
|
|
8241
|
+
const num = amount.querySelector("[data-asta-flags-percent]");
|
|
8242
|
+
if (range) {
|
|
8243
|
+
range.value = String(n);
|
|
8244
|
+
range.dispatchEvent(new Event("input", { bubbles: true }));
|
|
8245
|
+
}
|
|
8246
|
+
if (num) num.value = String(n);
|
|
8247
|
+
amount.removeAttribute("data-dirty");
|
|
8248
|
+
}
|
|
8249
|
+
|
|
8250
|
+
// Hide rows that don't match the search and filter, then update the counts and the empty state.
|
|
8251
|
+
function ffApply(root) {
|
|
8252
|
+
const env = ffEnv(root);
|
|
8253
|
+
const q = (root.querySelector("[data-asta-flags-search]")?.value || "").trim().toLowerCase();
|
|
8254
|
+
const filter = root.querySelector("[data-asta-flags-filter] input:checked")?.value || "all";
|
|
8255
|
+
const rows = [...root.querySelectorAll(".asta-feature-flags-row")];
|
|
8256
|
+
const counts = { all: 0, on: 0, off: 0, stale: 0 };
|
|
8257
|
+
let shown = 0;
|
|
8258
|
+
for (const row of rows) {
|
|
8259
|
+
const match = !q || row.textContent.toLowerCase().includes(q);
|
|
8260
|
+
const on = ffGet(row, env).on;
|
|
8261
|
+
const test = { all: true, on, off: !on, stale: row.hasAttribute("data-stale") };
|
|
8262
|
+
if (match) for (const k in counts) counts[k] += test[k] ? 1 : 0;
|
|
8263
|
+
const show = match && test[filter];
|
|
8264
|
+
row.hidden = !show;
|
|
8265
|
+
shown += show ? 1 : 0;
|
|
8266
|
+
}
|
|
8267
|
+
root.querySelectorAll("[data-count]").forEach((c) => (c.textContent = String(counts[c.dataset.count] ?? 0)));
|
|
8268
|
+
const empty = root.querySelector("[data-asta-flags-empty]");
|
|
8269
|
+
if (empty) {
|
|
8270
|
+
const none = rows.length === 0;
|
|
8271
|
+
const [title, line] = empty.querySelectorAll("p");
|
|
8272
|
+
if (title) title.textContent = none ? "No feature flags yet" : "No flags match";
|
|
8273
|
+
if (line) line.textContent = none ? "Create one to ship code dark." : "Try another search or filter.";
|
|
8274
|
+
empty.querySelector("[data-asta-flags-clear]")?.toggleAttribute("hidden", none);
|
|
8275
|
+
empty.hidden = shown > 0;
|
|
8276
|
+
}
|
|
8277
|
+
}
|
|
8278
|
+
|
|
8279
|
+
const ffWhat = (row, env, change) =>
|
|
8280
|
+
change.rules
|
|
8281
|
+
? `save targeting for ${row.dataset.key}`
|
|
8282
|
+
: change.on !== undefined
|
|
8283
|
+
? `turn ${change.on ? "on" : "off"} ${row.dataset.key} in ${FF_ENV[env][0]}`
|
|
8284
|
+
: `set ${row.dataset.key} to ${change.rollout}% in ${FF_ENV[env][0]}`;
|
|
8285
|
+
|
|
8286
|
+
// Optimistic save: apply now, put the old state back if the server says no.
|
|
8287
|
+
function ffCommit(row, change, before) {
|
|
8288
|
+
const root = row.closest("[data-asta-flags]");
|
|
8289
|
+
const env = ffEnv(root);
|
|
8290
|
+
const key = row.dataset.key;
|
|
8291
|
+
const old = before ?? { state: row.dataset[env], rules: row.querySelector(".asta-feature-flags-rules > ul")?.innerHTML };
|
|
8292
|
+
if (!change.rules) ffSet(row, env, { ...ffGet(row, env), ...change });
|
|
8293
|
+
const err = row.querySelector(".asta-feature-flags-error");
|
|
8294
|
+
if (err) err.hidden = true;
|
|
8295
|
+
row.setAttribute("data-saving", "");
|
|
8296
|
+
ffPaint(row);
|
|
8297
|
+
ffApply(root);
|
|
8298
|
+
let done = false;
|
|
8299
|
+
const finish = (ok) => {
|
|
8300
|
+
if (done) return;
|
|
8301
|
+
done = true;
|
|
8302
|
+
row.removeAttribute("data-saving");
|
|
8303
|
+
if (ok) return ffSay(root, `Saved changes to ${key}.`);
|
|
8304
|
+
row.dataset[env] = old.state;
|
|
8305
|
+
const ul = row.querySelector(".asta-feature-flags-rules > ul");
|
|
8306
|
+
if (change.rules && ul && old.rules !== undefined) ul.innerHTML = old.rules;
|
|
8307
|
+
ffPaint(row);
|
|
8308
|
+
ffApply(root);
|
|
8309
|
+
const msg = `Couldn't ${ffWhat(row, env, change)}. It's back to how it was. Try again.`;
|
|
8310
|
+
if (err) {
|
|
8311
|
+
err.querySelector("span").textContent = msg;
|
|
8312
|
+
err.hidden = false;
|
|
8313
|
+
}
|
|
8314
|
+
ffSay(root, msg);
|
|
8315
|
+
};
|
|
8316
|
+
fire(row, "asta:flag-change", { key, env, change, rollback: () => finish(false) });
|
|
8317
|
+
const url = root.dataset.url;
|
|
8318
|
+
if (!url) return setTimeout(() => finish(true), 400);
|
|
8319
|
+
fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ key, env, ...change }) })
|
|
8320
|
+
.then((r) => finish(r.ok))
|
|
8321
|
+
.catch(() => finish(false));
|
|
8322
|
+
}
|
|
8323
|
+
|
|
8324
|
+
// Production asks first.
|
|
8325
|
+
function ffRequest(row, change) {
|
|
8326
|
+
const root = row.closest("[data-asta-flags]");
|
|
8327
|
+
if (ffEnv(root) !== "production") return ffCommit(row, change);
|
|
8328
|
+
const box = row.querySelector(".asta-feature-flags-confirm");
|
|
8329
|
+
if (!box) return ffCommit(row, change);
|
|
8330
|
+
const key = row.dataset.key;
|
|
8331
|
+
box._ffChange = change;
|
|
8332
|
+
box.querySelector("[data-asta-flags-question]").textContent =
|
|
8333
|
+
change.on !== undefined ? `Turn ${change.on ? "on" : "off"} ${key} in Production?` : `Set ${key} to ${change.rollout}% in Production?`;
|
|
8334
|
+
box.querySelector("[data-asta-flags-confirm]").textContent = change.on !== undefined ? `Turn ${change.on ? "on" : "off"}` : `Set to ${change.rollout}%`;
|
|
8335
|
+
box.hidden = false;
|
|
8336
|
+
row.querySelector("[data-asta-flags-switch]")?.setAttribute("disabled", "");
|
|
8337
|
+
ffSoon(box.querySelector("[data-asta-flags-keep]"));
|
|
8338
|
+
}
|
|
8339
|
+
|
|
8340
|
+
function ffSettle(row, go) {
|
|
8341
|
+
const box = row.querySelector(".asta-feature-flags-confirm");
|
|
8342
|
+
if (!box || box.hidden) return;
|
|
8343
|
+
const change = box._ffChange;
|
|
8344
|
+
box.hidden = true;
|
|
8345
|
+
box._ffChange = null;
|
|
8346
|
+
const sw = row.querySelector("[data-asta-flags-switch]");
|
|
8347
|
+
sw?.removeAttribute("disabled");
|
|
8348
|
+
if (go && change) ffCommit(row, change);
|
|
8349
|
+
ffSoon(change && change.rollout !== undefined ? row.querySelector("[data-asta-flags-percent]") : sw);
|
|
8350
|
+
}
|
|
8351
|
+
|
|
8352
|
+
function ffAmount(row) {
|
|
8353
|
+
const amount = row.querySelector(".asta-feature-flags-amount");
|
|
8354
|
+
const num = amount?.querySelector("[data-asta-flags-percent]");
|
|
8355
|
+
const n = Math.max(0, Math.min(100, Math.round(Number(num?.value) || 0)));
|
|
8356
|
+
const cur = ffGet(row, ffEnv(row.closest("[data-asta-flags]"))).rollout;
|
|
8357
|
+
const save = amount?.querySelector("[data-asta-flags-save]");
|
|
8358
|
+
if (save) save.textContent = `Save ${n}%`;
|
|
8359
|
+
amount?.toggleAttribute("data-dirty", n !== cur);
|
|
8360
|
+
return n;
|
|
8361
|
+
}
|
|
8362
|
+
|
|
8363
|
+
function ffRuleHtml(a, o, v) {
|
|
8364
|
+
return `<li class="asta-feature-flags-rule" data-new data-attribute="${ffEsc(a)}" data-operator="${ffEsc(o)}" data-value="${ffEsc(v)}"><span>${ffEsc(a)} <i>${ffEsc(o)}</i> <code>${ffEsc(v)}</code></span><button type="button" class="asta-btn asta-btn-ghost asta-btn-xs asta-btn-icon" data-asta-flags-rule-remove aria-label="Remove rule ${ffEsc(`${a} ${o} ${v}`)}"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4.5 4.5 7 7M11.5 4.5l-7 7"/></svg></button></li>`;
|
|
8365
|
+
}
|
|
8366
|
+
|
|
8367
|
+
function ffMsg(input, text) {
|
|
8368
|
+
const msg = input && document.getElementById(input.getAttribute("aria-describedby") || "");
|
|
8369
|
+
if (!input) return;
|
|
8370
|
+
input.setAttribute("aria-invalid", String(!!text));
|
|
8371
|
+
if (!msg) return;
|
|
8372
|
+
msg.toggleAttribute("data-error", !!text);
|
|
8373
|
+
if (msg.hasAttribute("data-hint")) msg.hidden = false;
|
|
8374
|
+
else msg.hidden = !text;
|
|
8375
|
+
msg.querySelector("span").textContent = text || msg.dataset.hint || "";
|
|
8376
|
+
}
|
|
8377
|
+
|
|
8378
|
+
function ffCheckKey(root, key) {
|
|
8379
|
+
if (!key) return "Enter a key.";
|
|
8380
|
+
if (!FF_KEY.test(key)) return "Use lowercase letters, numbers and single dashes, like new-checkout.";
|
|
8381
|
+
if ([...root.querySelectorAll(".asta-feature-flags-row")].some((r) => r.dataset.key === key)) return "A flag with this key already exists.";
|
|
8382
|
+
return "";
|
|
8383
|
+
}
|
|
8384
|
+
|
|
8385
|
+
function ffOpen(root, open) {
|
|
8386
|
+
const form = root.querySelector("[data-asta-flags-form]");
|
|
8387
|
+
const btn = root.querySelector("[data-asta-flags-create]");
|
|
8388
|
+
if (!form) return;
|
|
8389
|
+
form.hidden = !open;
|
|
8390
|
+
btn?.setAttribute("aria-expanded", String(open));
|
|
8391
|
+
if (open) return ffSoon(form.querySelector("[name=name]"));
|
|
8392
|
+
form.reset();
|
|
8393
|
+
delete form.dataset.touched;
|
|
8394
|
+
form.querySelectorAll("input").forEach((i) => ffMsg(i, ""));
|
|
8395
|
+
const alert = form.querySelector("[data-asta-flags-alert]");
|
|
8396
|
+
if (alert) alert.hidden = true;
|
|
8397
|
+
ffSoon(btn);
|
|
8398
|
+
}
|
|
8399
|
+
|
|
8400
|
+
document.addEventListener("change", (e) => {
|
|
8401
|
+
const root = ffRoot(e);
|
|
8402
|
+
if (!root) return;
|
|
8403
|
+
const t = el(e);
|
|
8404
|
+
if (near(e, "[data-asta-flags-env]") && t.checked) {
|
|
8405
|
+
root.dataset.env = t.value;
|
|
8406
|
+
root.querySelectorAll(".asta-feature-flags-confirm:not([hidden])").forEach((b) => ffSettle(b.closest(".asta-feature-flags-row"), false));
|
|
8407
|
+
root.querySelectorAll(".asta-feature-flags-row").forEach(ffPaint);
|
|
8408
|
+
ffApply(root);
|
|
8409
|
+
return ffSay(root, `Showing ${FF_ENV[t.value][0]}.`);
|
|
8410
|
+
}
|
|
8411
|
+
if (near(e, "[data-asta-flags-filter]")) return ffApply(root);
|
|
8412
|
+
if (t.matches("[data-asta-flags-switch]")) {
|
|
8413
|
+
const row = t.closest(".asta-feature-flags-row");
|
|
8414
|
+
const want = t.checked;
|
|
8415
|
+
t.checked = !want; // stays put until the change is saved or confirmed
|
|
8416
|
+
return ffRequest(row, { on: want });
|
|
8417
|
+
}
|
|
8418
|
+
if (t.matches("[data-asta-flags-attr]")) {
|
|
8419
|
+
const [, ops, ph] = FF_ATTRS[Number(t.value)] || FF_ATTRS[0];
|
|
8420
|
+
const form = t.closest("form");
|
|
8421
|
+
form.elements.operator.innerHTML = ops.map((o) => `<option>${ffEsc(o)}</option>`).join("");
|
|
8422
|
+
form.elements.value.placeholder = `e.g. ${ph}`;
|
|
8423
|
+
ffMsg(form.elements.value, "");
|
|
8424
|
+
}
|
|
8425
|
+
});
|
|
8426
|
+
|
|
8427
|
+
document.addEventListener("input", (e) => {
|
|
8428
|
+
const root = ffRoot(e);
|
|
8429
|
+
if (!root) return;
|
|
8430
|
+
const t = el(e);
|
|
8431
|
+
if (t.matches("[data-asta-flags-search]")) return ffApply(root);
|
|
8432
|
+
if (t.matches("[data-asta-flags-range]") && e.isTrusted) {
|
|
8433
|
+
const row = t.closest(".asta-feature-flags-row");
|
|
8434
|
+
row.querySelector("[data-asta-flags-percent]").value = t.value;
|
|
8435
|
+
return ffAmount(row);
|
|
8436
|
+
}
|
|
8437
|
+
if (t.matches("[data-asta-flags-percent]")) return ffAmount(t.closest(".asta-feature-flags-row"));
|
|
8438
|
+
const form = t.closest("[data-asta-flags-form]");
|
|
8439
|
+
if (!form) return;
|
|
8440
|
+
if (t.name === "key") form.dataset.touched = "";
|
|
8441
|
+
if (t.name === "name" && !("touched" in form.dataset)) form.elements.key.value = ffSlug(t.value);
|
|
8442
|
+
});
|
|
8443
|
+
|
|
8444
|
+
document.addEventListener(
|
|
8445
|
+
"blur",
|
|
8446
|
+
(e) => {
|
|
8447
|
+
const root = ffRoot(e);
|
|
8448
|
+
const t = el(e);
|
|
8449
|
+
if (!root || !t) return;
|
|
8450
|
+
if (t.matches("[data-asta-flags-percent]")) {
|
|
8451
|
+
const row = t.closest(".asta-feature-flags-row");
|
|
8452
|
+
const n = ffAmount(row);
|
|
8453
|
+
t.value = String(n);
|
|
8454
|
+
const range = row.querySelector("[data-asta-flags-range]");
|
|
8455
|
+
range.value = String(n);
|
|
8456
|
+
range.dispatchEvent(new Event("input", { bubbles: true }));
|
|
8457
|
+
return;
|
|
8458
|
+
}
|
|
8459
|
+
const form = t.closest("[data-asta-flags-form]");
|
|
8460
|
+
if (form && t.name === "key" && t.value) ffMsg(t, ffCheckKey(root, t.value));
|
|
8461
|
+
if (form && t.name === "name" && t.value.trim() && t.getAttribute("aria-invalid") === "true") ffMsg(t, "");
|
|
8462
|
+
},
|
|
8463
|
+
true,
|
|
8464
|
+
);
|
|
8465
|
+
|
|
8466
|
+
document.addEventListener("click", (e) => {
|
|
8467
|
+
const root = ffRoot(e);
|
|
8468
|
+
if (!root) return;
|
|
8469
|
+
const row = near(e, ".asta-feature-flags-row");
|
|
8470
|
+
if (near(e, "[data-asta-flags-create]")) return ffOpen(root, root.querySelector("[data-asta-flags-form]")?.hidden ?? false);
|
|
8471
|
+
if (near(e, "[data-asta-flags-cancel]")) return ffOpen(root, false);
|
|
8472
|
+
if (near(e, "[data-asta-flags-clear]")) {
|
|
8473
|
+
const s = root.querySelector("[data-asta-flags-search]");
|
|
8474
|
+
if (s) s.value = "";
|
|
8475
|
+
const all = root.querySelector("[data-asta-flags-filter] input[value=all]");
|
|
8476
|
+
if (all) all.checked = true;
|
|
8477
|
+
all?.dispatchEvent(new Event("change", { bubbles: true }));
|
|
8478
|
+
ffApply(root);
|
|
8479
|
+
return ffSoon(s);
|
|
8480
|
+
}
|
|
8481
|
+
if (!row) return;
|
|
8482
|
+
const expand = near(e, "[data-asta-flags-expand]");
|
|
8483
|
+
if (expand) {
|
|
8484
|
+
const open = expand.getAttribute("aria-expanded") !== "true";
|
|
8485
|
+
expand.setAttribute("aria-expanded", String(open));
|
|
8486
|
+
const panel = row.querySelector(".asta-feature-flags-panel");
|
|
8487
|
+
if (panel) panel.hidden = !open;
|
|
8488
|
+
return;
|
|
8489
|
+
}
|
|
8490
|
+
if (near(e, "[data-asta-flags-keep]")) return ffSettle(row, false);
|
|
8491
|
+
if (near(e, "[data-asta-flags-confirm]")) return ffSettle(row, true);
|
|
8492
|
+
if (near(e, "[data-asta-flags-dismiss]")) {
|
|
8493
|
+
row.querySelector(".asta-feature-flags-error").hidden = true;
|
|
8494
|
+
return ffSoon(row.querySelector("[data-asta-flags-switch]"));
|
|
8495
|
+
}
|
|
8496
|
+
if (near(e, "[data-asta-flags-save]")) return ffRequest(row, { rollout: ffAmount(row) });
|
|
8497
|
+
if (near(e, "[data-asta-flags-reset]")) {
|
|
8498
|
+
ffDraft(row, ffGet(row, ffEnv(root)).rollout);
|
|
8499
|
+
return ffSoon(row.querySelector("[data-asta-flags-percent]"));
|
|
8500
|
+
}
|
|
8501
|
+
const remove = near(e, "[data-asta-flags-rule-remove]");
|
|
8502
|
+
if (remove) {
|
|
8503
|
+
const ul = remove.closest("ul");
|
|
8504
|
+
const before = { state: row.dataset[ffEnv(root)], rules: ul.innerHTML };
|
|
8505
|
+
const li = remove.closest("li");
|
|
8506
|
+
const next = li.nextElementSibling || li.previousElementSibling;
|
|
8507
|
+
li.remove();
|
|
8508
|
+
ffCommit(row, { rules: ffRules(row) }, before);
|
|
8509
|
+
ffSoon(next?.querySelector("button") || row.querySelector("[data-asta-flags-addrule] [name=value]"));
|
|
8510
|
+
}
|
|
8511
|
+
});
|
|
8512
|
+
|
|
8513
|
+
document.addEventListener("submit", (e) => {
|
|
8514
|
+
const root = ffRoot(e);
|
|
8515
|
+
if (!root) return;
|
|
8516
|
+
const add = near(e, "[data-asta-flags-addrule]");
|
|
8517
|
+
if (add) {
|
|
8518
|
+
e.preventDefault();
|
|
8519
|
+
const row = add.closest(".asta-feature-flags-row");
|
|
8520
|
+
const input = add.elements.value;
|
|
8521
|
+
const v = input.value.trim();
|
|
8522
|
+
const [attr, , ph] = FF_ATTRS[Number(add.elements.attribute.value)] || FF_ATTRS[0];
|
|
8523
|
+
if (!v) {
|
|
8524
|
+
ffMsg(input, `Enter a value, like ${ph}.`);
|
|
8525
|
+
return ffSoon(input);
|
|
8526
|
+
}
|
|
8527
|
+
ffMsg(input, "");
|
|
8528
|
+
const ul = row.querySelector(".asta-feature-flags-rules > ul");
|
|
8529
|
+
const before = { state: row.dataset[ffEnv(root)], rules: ul.innerHTML };
|
|
8530
|
+
ul.insertAdjacentHTML("beforeend", ffRuleHtml(attr, add.elements.operator.value, v));
|
|
8531
|
+
input.value = "";
|
|
8532
|
+
ffCommit(row, { rules: ffRules(row) }, before);
|
|
8533
|
+
return ffSoon(input);
|
|
8534
|
+
}
|
|
8535
|
+
const form = near(e, "[data-asta-flags-form]");
|
|
8536
|
+
if (!form) return;
|
|
8537
|
+
const name = form.elements.name;
|
|
8538
|
+
const key = form.elements.key;
|
|
8539
|
+
const nameErr = name.value.trim() ? "" : "Give the flag a name.";
|
|
8540
|
+
const keyErr = ffCheckKey(root, key.value);
|
|
8541
|
+
ffMsg(name, nameErr);
|
|
8542
|
+
ffMsg(key, keyErr);
|
|
8543
|
+
if (nameErr || keyErr) {
|
|
8544
|
+
e.preventDefault();
|
|
8545
|
+
return ffSoon(nameErr ? name : key);
|
|
8546
|
+
}
|
|
8547
|
+
if (ffRemote(form)) return; // the server answers with the new row
|
|
8548
|
+
e.preventDefault();
|
|
8549
|
+
const tpl = root.querySelector("template[data-asta-flags-row]");
|
|
8550
|
+
const list = root.querySelector(".asta-feature-flags-list");
|
|
8551
|
+
if (!tpl || !list) {
|
|
8552
|
+
form.querySelector("[data-asta-flags-alert]").hidden = false;
|
|
8553
|
+
return;
|
|
8554
|
+
}
|
|
8555
|
+
const k = key.value;
|
|
8556
|
+
const n = ffEsc(name.value.trim());
|
|
8557
|
+
list.insertAdjacentHTML(
|
|
8558
|
+
"afterbegin",
|
|
8559
|
+
tpl.innerHTML.replaceAll("__key__", k).replaceAll("__name__", n).replaceAll("__owner__", ffEsc(root.dataset.owner || "You")),
|
|
8560
|
+
);
|
|
8561
|
+
const row = list.firstElementChild;
|
|
8562
|
+
row.setAttribute("data-new", "");
|
|
8563
|
+
const s = root.querySelector("[data-asta-flags-search]");
|
|
8564
|
+
if (s) s.value = "";
|
|
8565
|
+
const all = root.querySelector("[data-asta-flags-filter] input[value=all]");
|
|
8566
|
+
if (all) all.checked = true;
|
|
8567
|
+
ffPaint(row);
|
|
8568
|
+
ffApply(root);
|
|
8569
|
+
fire(root, "asta:flag-create", { key: k, name: name.value.trim() });
|
|
8570
|
+
ffSay(root, `Flag ${k} created, off everywhere.`);
|
|
8571
|
+
ffOpen(root, false);
|
|
8572
|
+
ffSoon(row.querySelector("[data-asta-flags-switch]"));
|
|
8573
|
+
});
|
|
8574
|
+
|
|
8575
|
+
document.addEventListener("keydown", (e) => {
|
|
8576
|
+
const root = ffRoot(e);
|
|
8577
|
+
if (!root || e.key !== "Escape") return;
|
|
8578
|
+
if (near(e, "[data-asta-flags-form]")) {
|
|
8579
|
+
e.preventDefault();
|
|
8580
|
+
return ffOpen(root, false);
|
|
8581
|
+
}
|
|
8582
|
+
const confirm = near(e, ".asta-feature-flags-confirm");
|
|
8583
|
+
if (confirm) {
|
|
8584
|
+
e.preventDefault();
|
|
8585
|
+
ffSettle(confirm.closest(".asta-feature-flags-row"), false);
|
|
8586
|
+
}
|
|
8587
|
+
});
|
|
8588
|
+
|
|
8589
|
+
document.addEventListener("keydown", (e) => {
|
|
8590
|
+
if (e.key !== "Enter" || !el(e)?.matches("[data-asta-flags-percent]")) return;
|
|
8591
|
+
e.preventDefault();
|
|
8592
|
+
const row = near(e, ".asta-feature-flags-row");
|
|
8593
|
+
const n = ffAmount(row);
|
|
8594
|
+
if (n !== ffGet(row, ffEnv(row.closest("[data-asta-flags]"))).rollout) ffRequest(row, { rollout: n });
|
|
8595
|
+
});
|
|
8596
|
+
|
|
8597
|
+
/* ---------- integrations ---------- */
|
|
8598
|
+
/* ---------- Integrations ----------
|
|
8599
|
+
* [data-asta-integrations]: [data-asta-integrations-search] filters by name and description (Escape clears),
|
|
8600
|
+
* [role=tab][data-category] picks a category (arrows, Home, End), [data-asta-integrations-filter] (aria-pressed)
|
|
8601
|
+
* keeps connected apps only. Counts, the sr-only heading and the empty state follow.
|
|
8602
|
+
* Cards (.asta-integrations-card, data-id, data-connected, data-state):
|
|
8603
|
+
* Connect fires "asta:integration-connect" (cancelable, detail.id, detail.resolve({ account }), detail.reject(msg)).
|
|
8604
|
+
* Call preventDefault() and settle it yourself, or put hx-post on the button and swap the card from the server.
|
|
8605
|
+
* Otherwise it pretends: waits and connects (data-demo-fail on the card fails the first try).
|
|
8606
|
+
* Disconnect asks inline, then fires "asta:integration-disconnect" the same way. Manage fires
|
|
8607
|
+
* "asta:integration-manage" with detail.id. */
|
|
8608
|
+
{
|
|
8609
|
+
const igEl = (e) => (e.target instanceof Element ? e.target : null);
|
|
8610
|
+
const igNear = (e, sel) => igEl(e)?.closest(sel) ?? null;
|
|
8611
|
+
const igFire = (node, name, detail, cancelable = false) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, cancelable, detail }));
|
|
8612
|
+
const igFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
8613
|
+
const say = (root, text) => {
|
|
8614
|
+
const s = root.querySelector("[data-asta-integrations-status]");
|
|
8615
|
+
if (s) s.textContent = text;
|
|
8616
|
+
};
|
|
8617
|
+
const nameOf = (card) => card.dataset.name || card.querySelector(".asta-integrations-name")?.textContent?.trim() || "App";
|
|
8618
|
+
const remote = (btn) => !!btn && [...btn.attributes].some((a) => /^(hx|data-hx)-(post|put|delete|get)$/.test(a.name));
|
|
8619
|
+
|
|
8620
|
+
function filter(root) {
|
|
8621
|
+
const input = root.querySelector("[data-asta-integrations-search]");
|
|
8622
|
+
const raw = input?.value.trim() ?? "";
|
|
8623
|
+
const q = raw.toLowerCase();
|
|
8624
|
+
const only = root.querySelector("[data-asta-integrations-filter]")?.getAttribute("aria-pressed") === "true";
|
|
8625
|
+
const tab = root.querySelector('[role=tab][aria-selected="true"]')?.dataset.category ?? "all";
|
|
8626
|
+
const cards = [...root.querySelectorAll(".asta-integrations-card")];
|
|
8627
|
+
const match = (c) => (!q || c.textContent.toLowerCase().includes(q)) && (!only || c.hasAttribute("data-connected"));
|
|
8628
|
+
const counts = { all: 0 };
|
|
8629
|
+
let shown = 0;
|
|
8630
|
+
for (const c of cards) {
|
|
8631
|
+
const ok = match(c);
|
|
8632
|
+
if (ok) {
|
|
8633
|
+
counts.all++;
|
|
8634
|
+
counts[c.dataset.category] = (counts[c.dataset.category] ?? 0) + 1;
|
|
8635
|
+
}
|
|
8636
|
+
const show = ok && (tab === "all" || c.dataset.category === tab);
|
|
8637
|
+
c.hidden = !show;
|
|
8638
|
+
if (show) shown++;
|
|
8639
|
+
}
|
|
8640
|
+
root.querySelectorAll("[role=tab][data-category] [data-count]").forEach((n) => (n.textContent = String(counts[n.closest("[role=tab]").dataset.category] ?? 0)));
|
|
8641
|
+
const conn = root.querySelector("[data-asta-integrations-filter] .asta-integrations-num");
|
|
8642
|
+
if (conn) conn.textContent = String(cards.filter((c) => c.hasAttribute("data-connected")).length);
|
|
8643
|
+
root.querySelector("[data-asta-integrations-clear]")?.toggleAttribute("hidden", !raw);
|
|
8644
|
+
const tabLabel = root.querySelector('[role=tab][aria-selected="true"]')?.firstChild?.textContent?.trim();
|
|
8645
|
+
const heading = root.querySelector("[data-asta-integrations-heading]");
|
|
8646
|
+
if (heading) heading.textContent = `${shown} ${shown === 1 ? "integration" : "integrations"}${tab !== "all" && tabLabel ? ` in ${tabLabel}` : ""}${raw ? ` matching ${raw}` : ""}`;
|
|
8647
|
+
const empty = root.querySelector(".asta-integrations-empty");
|
|
8648
|
+
if (empty) {
|
|
8649
|
+
empty.hidden = shown > 0;
|
|
8650
|
+
empty.dataset.reason = q ? "search" : only ? "connected" : "none";
|
|
8651
|
+
empty.querySelectorAll("[data-slot=query]").forEach((n) => (n.textContent = raw));
|
|
8652
|
+
}
|
|
8653
|
+
}
|
|
8654
|
+
|
|
8655
|
+
function setState(card, state) {
|
|
8656
|
+
if (state) card.dataset.state = state;
|
|
8657
|
+
else card.removeAttribute("data-state");
|
|
8658
|
+
const btn = card.querySelector("[data-asta-integrations-connect]");
|
|
8659
|
+
if (btn) {
|
|
8660
|
+
const busy = state === "connecting";
|
|
8661
|
+
for (const a of ["aria-busy", "aria-disabled"]) {
|
|
8662
|
+
if (busy) btn.setAttribute(a, "true");
|
|
8663
|
+
else btn.removeAttribute(a);
|
|
8664
|
+
}
|
|
8665
|
+
}
|
|
8666
|
+
}
|
|
8667
|
+
function fail(root, card, message) {
|
|
8668
|
+
const p = card.querySelector(".asta-integrations-alert [data-slot=message]");
|
|
8669
|
+
const text = message || `Couldn't reach ${nameOf(card)}. Check that you're signed in there, then try again.`;
|
|
8670
|
+
if (p) p.textContent = text;
|
|
8671
|
+
setState(card, "error");
|
|
8672
|
+
say(root, `${nameOf(card)} didn't connect. ${text}`);
|
|
8673
|
+
igFocus(card.querySelector("[data-asta-integrations-retry]"));
|
|
8674
|
+
}
|
|
8675
|
+
function connected(root, card, account) {
|
|
8676
|
+
card.setAttribute("data-connected", "");
|
|
8677
|
+
if (account) {
|
|
8678
|
+
const slot = card.querySelector(".asta-integrations-meta > span");
|
|
8679
|
+
if (slot) slot.textContent = ` · ${account}`;
|
|
8680
|
+
}
|
|
8681
|
+
setState(card, null);
|
|
8682
|
+
say(root, `${nameOf(card)} connected.`);
|
|
8683
|
+
filter(root);
|
|
8684
|
+
igFocus(card.querySelector("[data-asta-integrations-manage]"));
|
|
8685
|
+
}
|
|
8686
|
+
function disconnected(root, card) {
|
|
8687
|
+
card.removeAttribute("data-connected");
|
|
8688
|
+
setState(card, null);
|
|
8689
|
+
say(root, `${nameOf(card)} disconnected.`);
|
|
8690
|
+
filter(root);
|
|
8691
|
+
igFocus(card.hidden ? root.querySelector("[data-asta-integrations-heading]") : card.querySelector("[data-asta-integrations-connect]"));
|
|
8692
|
+
}
|
|
8693
|
+
|
|
8694
|
+
// Runs one side of the flow: an event a server can take over, htmx, or the demo.
|
|
8695
|
+
function run(root, card, kind) {
|
|
8696
|
+
const out = kind === "connect";
|
|
8697
|
+
const btn = card.querySelector(out ? "[data-asta-integrations-connect]" : "[data-asta-integrations-confirm]");
|
|
8698
|
+
setState(card, out ? "connecting" : "disconnecting");
|
|
8699
|
+
say(root, `${out ? "Connecting" : "Disconnecting"} ${nameOf(card)}…`);
|
|
8700
|
+
if (!out) igFocus(card.querySelector(".asta-integrations-busy button"));
|
|
8701
|
+
let settled = false;
|
|
8702
|
+
const resolve = (r) => {
|
|
8703
|
+
if (settled || !card.isConnected) return;
|
|
8704
|
+
settled = true;
|
|
8705
|
+
if (out) connected(root, card, r?.account);
|
|
8706
|
+
else disconnected(root, card);
|
|
8707
|
+
};
|
|
8708
|
+
const reject = (msg) => {
|
|
8709
|
+
if (settled || !card.isConnected) return;
|
|
8710
|
+
settled = true;
|
|
8711
|
+
if (out) return fail(root, card, msg);
|
|
8712
|
+
fail(root, card, msg || `Couldn't disconnect ${nameOf(card)}. It's still connected. Try again in a moment.`);
|
|
8713
|
+
};
|
|
8714
|
+
const taken = !igFire(card, `asta:integration-${kind}`, { id: card.dataset.id, resolve, reject }, true);
|
|
8715
|
+
if (taken || remote(btn)) return;
|
|
8716
|
+
setTimeout(() => {
|
|
8717
|
+
if (out && card.hasAttribute("data-demo-fail")) {
|
|
8718
|
+
card.removeAttribute("data-demo-fail");
|
|
8719
|
+
return reject(card.dataset.demoFail || "");
|
|
8720
|
+
}
|
|
8721
|
+
resolve();
|
|
8722
|
+
}, out ? 900 : 700);
|
|
8723
|
+
}
|
|
8724
|
+
|
|
8725
|
+
document.addEventListener("click", (e) => {
|
|
8726
|
+
const root = igNear(e, "[data-asta-integrations]");
|
|
8727
|
+
if (!root) return;
|
|
8728
|
+
const card = igNear(e, ".asta-integrations-card");
|
|
8729
|
+
const tab = igNear(e, "[role=tab][data-category]");
|
|
8730
|
+
if (tab) {
|
|
8731
|
+
root.querySelectorAll("[role=tab][data-category]").forEach((t) => {
|
|
8732
|
+
const on = t === tab;
|
|
8733
|
+
t.setAttribute("aria-selected", String(on));
|
|
8734
|
+
t.tabIndex = on ? 0 : -1;
|
|
8735
|
+
});
|
|
8736
|
+
root.querySelector("[role=tabpanel]")?.setAttribute("aria-labelledby", tab.id);
|
|
8737
|
+
filter(root);
|
|
8738
|
+
} else if (igNear(e, "[data-asta-integrations-filter]")) {
|
|
8739
|
+
const f = igNear(e, "[data-asta-integrations-filter]");
|
|
8740
|
+
f.setAttribute("aria-pressed", String(f.getAttribute("aria-pressed") !== "true"));
|
|
8741
|
+
filter(root);
|
|
8742
|
+
} else if (igNear(e, "[data-asta-integrations-clear]")) {
|
|
8743
|
+
const input = root.querySelector("[data-asta-integrations-search]");
|
|
8744
|
+
if (input) input.value = "";
|
|
8745
|
+
filter(root);
|
|
8746
|
+
say(root, "Search cleared.");
|
|
8747
|
+
igFocus(input);
|
|
8748
|
+
} else if (igNear(e, "[data-asta-integrations-showall]")) {
|
|
8749
|
+
const f = root.querySelector("[data-asta-integrations-filter]");
|
|
8750
|
+
f?.setAttribute("aria-pressed", "false");
|
|
8751
|
+
filter(root);
|
|
8752
|
+
igFocus(f);
|
|
8753
|
+
} else if (!card) return;
|
|
8754
|
+
else if (igNear(e, "[data-asta-integrations-connect]")) {
|
|
8755
|
+
if (card.dataset.state !== "connecting") run(root, card, "connect");
|
|
8756
|
+
} else if (igNear(e, "[data-asta-integrations-retry]")) {
|
|
8757
|
+
run(root, card, card.hasAttribute("data-connected") ? "disconnect" : "connect");
|
|
8758
|
+
if (!card.hasAttribute("data-connected")) igFocus(card.querySelector("[data-asta-integrations-connect]"));
|
|
8759
|
+
} else if (igNear(e, "[data-asta-integrations-dismiss]")) {
|
|
8760
|
+
setState(card, null);
|
|
8761
|
+
igFocus(card.querySelector(card.hasAttribute("data-connected") ? "[data-asta-integrations-disconnect]" : "[data-asta-integrations-connect]"));
|
|
8762
|
+
} else if (igNear(e, "[data-asta-integrations-disconnect]")) {
|
|
8763
|
+
setState(card, "confirm");
|
|
8764
|
+
igFocus(card.querySelector("[data-asta-integrations-keep]"));
|
|
8765
|
+
} else if (igNear(e, "[data-asta-integrations-keep]")) {
|
|
8766
|
+
setState(card, null);
|
|
8767
|
+
igFocus(card.querySelector("[data-asta-integrations-disconnect]"));
|
|
8768
|
+
} else if (igNear(e, "[data-asta-integrations-confirm]")) run(root, card, "disconnect");
|
|
8769
|
+
else if (igNear(e, "[data-asta-integrations-manage]")) {
|
|
8770
|
+
say(root, `Opening ${nameOf(card)} settings.`);
|
|
8771
|
+
igFire(card, "asta:integration-manage", { id: card.dataset.id });
|
|
8772
|
+
}
|
|
8773
|
+
});
|
|
8774
|
+
|
|
8775
|
+
document.addEventListener("input", (e) => {
|
|
8776
|
+
const root = igNear(e, "[data-asta-integrations]");
|
|
8777
|
+
if (root && igNear(e, "[data-asta-integrations-search]")) filter(root);
|
|
8778
|
+
});
|
|
8779
|
+
|
|
8780
|
+
document.addEventListener("keydown", (e) => {
|
|
8781
|
+
const root = igNear(e, "[data-asta-integrations]");
|
|
8782
|
+
if (!root) return;
|
|
8783
|
+
const search = igNear(e, "[data-asta-integrations-search]");
|
|
8784
|
+
if (search && e.key === "Escape" && search.value) {
|
|
8785
|
+
e.preventDefault();
|
|
8786
|
+
search.value = "";
|
|
8787
|
+
filter(root);
|
|
8788
|
+
say(root, "Search cleared.");
|
|
8789
|
+
return;
|
|
8790
|
+
}
|
|
8791
|
+
if (e.key === "Escape" && igNear(e, ".asta-integrations-confirm")) {
|
|
8792
|
+
e.preventDefault();
|
|
8793
|
+
const card = igNear(e, ".asta-integrations-card");
|
|
8794
|
+
setState(card, null);
|
|
8795
|
+
igFocus(card.querySelector("[data-asta-integrations-disconnect]"));
|
|
8796
|
+
return;
|
|
8797
|
+
}
|
|
8798
|
+
const tab = igNear(e, "[role=tab][data-category]");
|
|
8799
|
+
if (!tab) return;
|
|
8800
|
+
const tabs = [...root.querySelectorAll("[role=tab][data-category]")];
|
|
8801
|
+
const i = tabs.indexOf(tab);
|
|
8802
|
+
const n = e.key === "ArrowRight" ? (i + 1) % tabs.length : e.key === "ArrowLeft" ? (i - 1 + tabs.length) % tabs.length : e.key === "Home" ? 0 : e.key === "End" ? tabs.length - 1 : -1;
|
|
8803
|
+
if (n < 0) return;
|
|
8804
|
+
e.preventDefault();
|
|
8805
|
+
tabs[n].click();
|
|
8806
|
+
tabs[n].focus();
|
|
8807
|
+
});
|
|
8808
|
+
|
|
8809
|
+
// htmx swapped a card or the whole section: recount.
|
|
8810
|
+
document.addEventListener("htmx:afterSettle", (e) => {
|
|
8811
|
+
const root = igNear(e, "[data-asta-integrations]") ?? (e.target instanceof Element ? e.target.querySelector("[data-asta-integrations]") : null);
|
|
8812
|
+
if (root) filter(root);
|
|
8813
|
+
});
|
|
8814
|
+
}
|
|
8815
|
+
|
|
8816
|
+
/* ---------- status-page ---------- */
|
|
8817
|
+
/* ---------- Status page ----------
|
|
8818
|
+
* [data-asta-status] (data-today="YYYY-MM-DD", the newest bar's day in UTC):
|
|
8819
|
+
* [data-asta-status-strip] is one tab stop. Arrows move a day, PageUp/PageDown a week, Home/End the ends,
|
|
8820
|
+
* skipping bars hidden by the range or the narrow view. Hover or focus shows .asta-status-page-tip with the date,
|
|
8821
|
+
* uptime and incident from each <i>'s data-s, data-u and data-t. Labels are written on first use.
|
|
8822
|
+
* [data-asta-status-subscribe] checks the email on blur and submit. With hx-post or action it goes to your server
|
|
8823
|
+
* (swap in the .asta-status-page-done markup); without, it waits a moment, shows the done state and fires
|
|
8824
|
+
* "asta:status-subscribe" with detail.email. [data-asta-status-again] brings the form back. */
|
|
8825
|
+
{
|
|
8826
|
+
const sel = (e, s) => (e.target instanceof Element ? e.target.closest(s) : null);
|
|
8827
|
+
const WORD = { "": "Operational", d: "Degraded", x: "Outage", m: "Maintenance", n: "No data" };
|
|
8828
|
+
const UPTIME = { "": 100, d: 99.5, x: 97, m: 100 };
|
|
8829
|
+
const dayFmt = new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric", year: "numeric", timeZone: "UTC" });
|
|
8830
|
+
const bars = (strip) => [...strip.children].filter((n) => n.tagName === "I");
|
|
8831
|
+
// Only on key presses and pointer entry, never per frame.
|
|
8832
|
+
const visible = (strip) => bars(strip).filter((b) => b.offsetParent !== null);
|
|
8833
|
+
const tipOf = (strip) => strip.parentElement?.querySelector(".asta-status-page-tip");
|
|
8834
|
+
|
|
8835
|
+
function info(bar) {
|
|
8836
|
+
const s = bar.dataset.s ?? "";
|
|
8837
|
+
const all = bars(bar.parentElement);
|
|
8838
|
+
const today = Date.parse(`${bar.closest("[data-asta-status]")?.dataset.today ?? ""}T00:00:00Z`);
|
|
8839
|
+
const age = all.length - 1 - all.indexOf(bar);
|
|
8840
|
+
const date = dayFmt.format(new Date((Number.isNaN(today) ? Date.now() : today) - age * 86_400_000));
|
|
8841
|
+
const u = Number(bar.dataset.u ?? UPTIME[s]);
|
|
8842
|
+
const pct = u >= 99.995 ? "100%" : `${(Math.floor(u * 100) / 100).toFixed(2)}%`;
|
|
8843
|
+
return { date, word: WORD[s] ?? WORD[""], pct: s === "n" ? "" : pct, incident: bar.dataset.t ?? (s === "n" ? "Not tracked yet" : "No incidents") };
|
|
8844
|
+
}
|
|
8845
|
+
|
|
8846
|
+
function label(strip) {
|
|
8847
|
+
if (strip.dataset.labelled) return;
|
|
8848
|
+
strip.dataset.labelled = "";
|
|
8849
|
+
const id = strip.id || (strip.id = `asta-sp-${Math.random().toString(36).slice(2, 8)}`);
|
|
8850
|
+
bars(strip).forEach((b, i) => {
|
|
8851
|
+
const d = info(b);
|
|
8852
|
+
b.id ||= `${id}-${i}`;
|
|
8853
|
+
b.setAttribute("aria-label", `${d.date}: ${d.word}${d.pct && `, ${d.pct} uptime`}${b.dataset.t ? `, ${b.dataset.t}` : ""}`);
|
|
8854
|
+
});
|
|
8855
|
+
}
|
|
8856
|
+
|
|
8857
|
+
function show(strip, bar) {
|
|
8858
|
+
const tip = tipOf(strip);
|
|
8859
|
+
if (!tip) return;
|
|
8860
|
+
if (!bar) {
|
|
8861
|
+
tip.hidden = true;
|
|
8862
|
+
return;
|
|
8863
|
+
}
|
|
8864
|
+
const d = info(bar);
|
|
8865
|
+
const b = document.createElement("b");
|
|
8866
|
+
b.textContent = d.date;
|
|
8867
|
+
const w = document.createElement("span");
|
|
8868
|
+
w.textContent = d.pct ? `${d.word} · ${d.pct} uptime` : d.word;
|
|
8869
|
+
const t = document.createElement("span");
|
|
8870
|
+
t.textContent = d.incident;
|
|
8871
|
+
tip.replaceChildren(b, w, t);
|
|
8872
|
+
const vis = visible(strip);
|
|
8873
|
+
const frac = vis.indexOf(bar) / Math.max(1, vis.length - 1);
|
|
8874
|
+
tip.dataset.align = frac < 0.2 ? "start" : frac > 0.8 ? "end" : "";
|
|
8875
|
+
tip.style.left = `${frac < 0.2 ? bar.offsetLeft : frac > 0.8 ? bar.offsetLeft + bar.offsetWidth : bar.offsetLeft + bar.offsetWidth / 2}px`;
|
|
8876
|
+
tip.hidden = false;
|
|
8877
|
+
}
|
|
8878
|
+
|
|
8879
|
+
function select(strip, bar) {
|
|
8880
|
+
bars(strip).forEach((b) => b.setAttribute("aria-selected", String(b === bar)));
|
|
8881
|
+
strip.setAttribute("aria-activedescendant", bar.id);
|
|
8882
|
+
show(strip, bar);
|
|
8883
|
+
}
|
|
8884
|
+
const current = (strip) => {
|
|
8885
|
+
const vis = visible(strip);
|
|
8886
|
+
const on = strip.querySelector('i[aria-selected="true"]');
|
|
8887
|
+
return on && vis.includes(on) ? on : vis[vis.length - 1];
|
|
8888
|
+
};
|
|
8889
|
+
|
|
8890
|
+
document.addEventListener("focusin", (e) => {
|
|
8891
|
+
const strip = sel(e, "[data-asta-status-strip]");
|
|
8892
|
+
if (!strip || e.target !== strip) return;
|
|
8893
|
+
label(strip);
|
|
8894
|
+
const bar = current(strip);
|
|
8895
|
+
if (bar) select(strip, bar);
|
|
8896
|
+
});
|
|
8897
|
+
document.addEventListener("focusout", (e) => {
|
|
8898
|
+
const strip = sel(e, "[data-asta-status-strip]");
|
|
8899
|
+
if (strip && e.target === strip && !strip.hasAttribute("data-hover")) show(strip, null);
|
|
8900
|
+
const input = sel(e, "[data-asta-status-subscribe] input[type=email]");
|
|
8901
|
+
if (input?.value) check(input);
|
|
8902
|
+
});
|
|
8903
|
+
document.addEventListener("keydown", (e) => {
|
|
8904
|
+
const strip = sel(e, "[data-asta-status-strip]");
|
|
8905
|
+
if (!strip || e.target !== strip) return;
|
|
8906
|
+
const step = { ArrowLeft: -1, ArrowRight: 1, PageUp: -7, PageDown: 7 }[e.key];
|
|
8907
|
+
if (!step && e.key !== "Home" && e.key !== "End") return;
|
|
8908
|
+
e.preventDefault();
|
|
8909
|
+
const vis = visible(strip);
|
|
8910
|
+
const at = vis.indexOf(current(strip));
|
|
8911
|
+
const next = step ? Math.min(Math.max(at + step, 0), vis.length - 1) : e.key === "Home" ? 0 : vis.length - 1;
|
|
8912
|
+
strip.removeAttribute("data-hover");
|
|
8913
|
+
vis.forEach((b) => b.removeAttribute("data-shown"));
|
|
8914
|
+
if (vis[next]) select(strip, vis[next]);
|
|
8915
|
+
});
|
|
8916
|
+
document.addEventListener("pointerover", (e) => {
|
|
8917
|
+
const bar = sel(e, "[data-asta-status-strip] > i");
|
|
8918
|
+
if (!bar) return;
|
|
8919
|
+
const strip = bar.parentElement;
|
|
8920
|
+
label(strip);
|
|
8921
|
+
strip.setAttribute("data-hover", "");
|
|
8922
|
+
strip.querySelector("i[data-shown]")?.removeAttribute("data-shown");
|
|
8923
|
+
bar.setAttribute("data-shown", "");
|
|
8924
|
+
show(strip, bar);
|
|
8925
|
+
});
|
|
8926
|
+
document.addEventListener(
|
|
8927
|
+
"pointerleave",
|
|
8928
|
+
(e) => {
|
|
8929
|
+
if (!(e.target instanceof Element) || !e.target.matches("[data-asta-status-strip]")) return;
|
|
8930
|
+
const strip = e.target;
|
|
8931
|
+
strip.removeAttribute("data-hover");
|
|
8932
|
+
strip.querySelector("i[data-shown]")?.removeAttribute("data-shown");
|
|
8933
|
+
show(strip, document.activeElement === strip ? current(strip) : null);
|
|
8934
|
+
},
|
|
8935
|
+
true,
|
|
8936
|
+
);
|
|
8937
|
+
|
|
8938
|
+
// Subscribe. The hint line keeps its texts in data-hint, data-error-empty, data-error-invalid and data-error-failed.
|
|
8939
|
+
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
|
|
8940
|
+
function say(msg, key) {
|
|
8941
|
+
if (!msg) return;
|
|
8942
|
+
msg.toggleAttribute("data-error", key !== "hint");
|
|
8943
|
+
const text = msg.querySelector("span:last-child") ?? msg;
|
|
8944
|
+
text.textContent = msg.dataset[key === "hint" ? "hint" : `error${key[0].toUpperCase()}${key.slice(1)}`] ?? "";
|
|
8945
|
+
}
|
|
8946
|
+
function check(input) {
|
|
8947
|
+
const v = input.value.trim();
|
|
8948
|
+
const bad = !v ? "empty" : EMAIL.test(v) ? null : "invalid";
|
|
8949
|
+
if (bad) input.setAttribute("aria-invalid", "true");
|
|
8950
|
+
else input.removeAttribute("aria-invalid");
|
|
8951
|
+
say(document.getElementById(input.getAttribute("aria-describedby")), bad ?? "hint");
|
|
8952
|
+
return !bad;
|
|
8953
|
+
}
|
|
8954
|
+
|
|
8955
|
+
document.addEventListener("input", (e) => {
|
|
8956
|
+
const input = sel(e, "[data-asta-status-subscribe] input[type=email]");
|
|
8957
|
+
if (input?.getAttribute("aria-invalid") === "true" && EMAIL.test(input.value.trim())) check(input);
|
|
8958
|
+
});
|
|
8959
|
+
|
|
8960
|
+
// Capture phase, so an invalid address never reaches htmx or the browser.
|
|
8961
|
+
document.addEventListener(
|
|
8962
|
+
"submit",
|
|
8963
|
+
(e) => {
|
|
8964
|
+
const form = e.target instanceof HTMLFormElement && e.target.matches("[data-asta-status-subscribe]") ? e.target : null;
|
|
8965
|
+
const input = form?.querySelector("input[type=email]");
|
|
8966
|
+
if (!input) return;
|
|
8967
|
+
if (!check(input)) {
|
|
8968
|
+
e.preventDefault();
|
|
8969
|
+
e.stopPropagation();
|
|
8970
|
+
input.focus();
|
|
8971
|
+
return;
|
|
8972
|
+
}
|
|
8973
|
+
const remote = form.hasAttribute("action") || [...form.attributes].some((a) => /^(hx|data-hx)-(post|put)$/.test(a.name));
|
|
8974
|
+
if (remote) return;
|
|
8975
|
+
e.preventDefault();
|
|
8976
|
+
const btn = form.querySelector("[type=submit]");
|
|
8977
|
+
const idle = btn?.textContent;
|
|
8978
|
+
if (btn) {
|
|
8979
|
+
btn.disabled = true;
|
|
8980
|
+
btn.setAttribute("aria-busy", "true");
|
|
8981
|
+
btn.textContent = btn.dataset.busy ?? "Subscribing…";
|
|
8982
|
+
}
|
|
8983
|
+
const email = input.value.trim();
|
|
8984
|
+
setTimeout(() => {
|
|
8985
|
+
if (btn) {
|
|
8986
|
+
btn.disabled = false;
|
|
8987
|
+
btn.removeAttribute("aria-busy");
|
|
8988
|
+
btn.textContent = idle;
|
|
8989
|
+
}
|
|
8990
|
+
const done = form.parentElement?.querySelector(".asta-status-page-done");
|
|
8991
|
+
if (done) {
|
|
8992
|
+
done.querySelectorAll("[data-slot=email]").forEach((n) => (n.textContent = email));
|
|
8993
|
+
form.hidden = true;
|
|
8994
|
+
done.hidden = false;
|
|
8995
|
+
}
|
|
8996
|
+
const live = form.parentElement?.querySelector("[data-asta-status-live]");
|
|
8997
|
+
if (live) live.textContent = `Subscribed. We sent a confirmation link to ${email}.`;
|
|
8998
|
+
form.dispatchEvent(new CustomEvent("asta:status-subscribe", { bubbles: true, detail: { email } }));
|
|
8999
|
+
}, 700);
|
|
9000
|
+
},
|
|
9001
|
+
true,
|
|
9002
|
+
);
|
|
9003
|
+
|
|
9004
|
+
document.addEventListener("click", (e) => {
|
|
9005
|
+
const again = sel(e, "[data-asta-status-again]");
|
|
9006
|
+
const done = again?.closest(".asta-status-page-done");
|
|
9007
|
+
const form = done?.parentElement?.querySelector("[data-asta-status-subscribe]");
|
|
9008
|
+
if (!form) return;
|
|
9009
|
+
done.hidden = true;
|
|
9010
|
+
form.hidden = false;
|
|
9011
|
+
form.reset();
|
|
9012
|
+
const input = form.querySelector("input[type=email]");
|
|
9013
|
+
if (input) {
|
|
9014
|
+
input.removeAttribute("aria-invalid");
|
|
9015
|
+
say(document.getElementById(input.getAttribute("aria-describedby")), "hint");
|
|
9016
|
+
requestAnimationFrame(() => input.focus());
|
|
9017
|
+
}
|
|
9018
|
+
});
|
|
9019
|
+
}
|
|
9020
|
+
|
|
9021
|
+
/* ---------- what's new ---------- */
|
|
9022
|
+
/* ---------- Changelog ----------
|
|
9023
|
+
* [data-asta-whats-new] (data-page-size): [data-asta-whats-new-tag] buttons and the [data-asta-whats-new-search]
|
|
9024
|
+
* field filter entries by data-tags and text. .asta-whats-new-more expands a long entry. .asta-whats-new-react
|
|
9025
|
+
* toggles a thumbs-up and fires "asta:whats-new-react" with detail.id and detail.reacted.
|
|
9026
|
+
* [data-asta-whats-new-read] clears data-unread and fires "asta:whats-new-read" with detail.ids.
|
|
9027
|
+
* [data-asta-whats-new-load] reveals the next li[data-later] entries, or fires "asta:whats-new-more" when none are
|
|
9028
|
+
* left (answer it with hx-get + hx-swap="beforeend" on the list).
|
|
9029
|
+
* [data-asta-whats-new-pop]: the .asta-whats-new-trigger opens the panel; Esc, an outside click or tabbing away
|
|
9030
|
+
* closes it and focus goes back to the trigger.
|
|
9031
|
+
* Uses near() and fire() from the top of this file. */
|
|
9032
|
+
|
|
9033
|
+
const clRoot = (e) => near(e, "[data-asta-whats-new]");
|
|
9034
|
+
const clFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
9035
|
+
const clEntries = (root) => [...root.querySelectorAll(".asta-whats-new-entry")];
|
|
9036
|
+
|
|
9037
|
+
function clApply(root) {
|
|
9038
|
+
const tag = root.querySelector("[data-asta-whats-new-tag][aria-pressed=true]")?.dataset.astaChangelogTag ?? "all";
|
|
9039
|
+
const q = (root.querySelector("[data-asta-whats-new-search]")?.value ?? "").trim().toLowerCase();
|
|
9040
|
+
let shown = 0;
|
|
9041
|
+
for (const li of clEntries(root)) {
|
|
9042
|
+
const ok = (tag === "all" || (li.dataset.tags ?? "").split(" ").includes(tag)) && (!q || li.textContent.toLowerCase().includes(q));
|
|
9043
|
+
li.hidden = !ok || li.hasAttribute("data-later");
|
|
9044
|
+
if (ok) shown++;
|
|
9045
|
+
}
|
|
9046
|
+
const none = root.querySelector(".asta-whats-new-nomatch");
|
|
9047
|
+
if (none) {
|
|
9048
|
+
none.hidden = shown > 0;
|
|
9049
|
+
const text = none.querySelector("[data-slot=query]");
|
|
9050
|
+
if (text) text.textContent = q ? `No updates match “${q}”` : "No updates with this tag yet";
|
|
9051
|
+
}
|
|
9052
|
+
const load = root.querySelector(".asta-whats-new-loadmore");
|
|
9053
|
+
if (load) load.hidden = shown === 0 || ((tag !== "all" || q) && !clEntries(root).some((li) => li.hasAttribute("data-later")));
|
|
9054
|
+
const live = root.querySelector("[data-asta-whats-new-status]");
|
|
9055
|
+
if (live) live.textContent = `${shown} ${shown === 1 ? "update" : "updates"}`;
|
|
9056
|
+
}
|
|
9057
|
+
|
|
9058
|
+
// Marks read everywhere on the page, so a header popover and the full list stay in step.
|
|
9059
|
+
function clMarkRead(scope) {
|
|
9060
|
+
const all = [...document.querySelectorAll("[data-asta-whats-new], [data-asta-whats-new-pop]")];
|
|
9061
|
+
const items = [...scope.querySelectorAll("[data-unread]")];
|
|
9062
|
+
all.forEach((r) => {
|
|
9063
|
+
r.querySelectorAll("[data-unread]").forEach((n) => n.removeAttribute("data-unread"));
|
|
9064
|
+
r.querySelectorAll("[data-asta-whats-new-read], .asta-whats-new-count, .asta-whats-new-badge").forEach((n) => (n.hidden = true));
|
|
9065
|
+
});
|
|
9066
|
+
const live = scope.querySelector("[data-asta-whats-new-status]");
|
|
9067
|
+
if (live) live.textContent = `${items.length} ${items.length === 1 ? "update" : "updates"} marked as read.`;
|
|
9068
|
+
fire(scope, "asta:whats-new-read", { ids: items.map((n) => n.dataset.id).filter(Boolean) });
|
|
9069
|
+
}
|
|
9070
|
+
|
|
9071
|
+
function clLoad(root, btn) {
|
|
9072
|
+
const size = Number(root.dataset.pageSize) || 4;
|
|
9073
|
+
const later = clEntries(root).filter((li) => li.hasAttribute("data-later")).slice(0, size);
|
|
9074
|
+
if (!later.length) return fire(root, "asta:whats-new-more", {});
|
|
9075
|
+
later.forEach((li) => li.removeAttribute("data-later"));
|
|
9076
|
+
clApply(root);
|
|
9077
|
+
clFocus(later.find((li) => !li.hidden)?.querySelector(".asta-whats-new-entry-title"));
|
|
9078
|
+
if (!clEntries(root).some((li) => li.hasAttribute("data-later")) && !btn.hasAttribute("hx-get")) btn.closest(".asta-whats-new-loadmore").hidden = true;
|
|
9079
|
+
}
|
|
9080
|
+
|
|
9081
|
+
function clPop(pop, open, focus = true) {
|
|
9082
|
+
const trigger = pop.querySelector(".asta-whats-new-trigger");
|
|
9083
|
+
const panel = pop.querySelector(".asta-whats-new-panel");
|
|
9084
|
+
if (!trigger || !panel || panel.hidden === !open) return;
|
|
9085
|
+
panel.hidden = !open;
|
|
9086
|
+
trigger.setAttribute("aria-expanded", String(open));
|
|
9087
|
+
if (open) clFocus(panel);
|
|
9088
|
+
else if (focus) clFocus(trigger);
|
|
9089
|
+
}
|
|
9090
|
+
|
|
9091
|
+
document.addEventListener("click", (e) => {
|
|
9092
|
+
const pop = near(e, "[data-asta-whats-new-pop]");
|
|
9093
|
+
document.querySelectorAll("[data-asta-whats-new-pop]").forEach((p) => p !== pop && clPop(p, false, false));
|
|
9094
|
+
if (pop) {
|
|
9095
|
+
if (near(e, ".asta-whats-new-trigger")) clPop(pop, pop.querySelector(".asta-whats-new-panel")?.hidden ?? false);
|
|
9096
|
+
else if (near(e, "[data-asta-whats-new-read]")) {
|
|
9097
|
+
clMarkRead(pop);
|
|
9098
|
+
clFocus(pop.querySelector(".asta-whats-new-panel"));
|
|
9099
|
+
}
|
|
9100
|
+
return;
|
|
9101
|
+
}
|
|
9102
|
+
const root = clRoot(e);
|
|
9103
|
+
if (!root) return;
|
|
9104
|
+
const filter = near(e, "[data-asta-whats-new-tag]");
|
|
9105
|
+
const more = near(e, ".asta-whats-new-more");
|
|
9106
|
+
const react = near(e, ".asta-whats-new-react");
|
|
9107
|
+
if (filter) {
|
|
9108
|
+
root.querySelectorAll("[data-asta-whats-new-tag]").forEach((b) => b.setAttribute("aria-pressed", String(b === filter)));
|
|
9109
|
+
clApply(root);
|
|
9110
|
+
} else if (more) {
|
|
9111
|
+
const open = more.getAttribute("aria-expanded") !== "true";
|
|
9112
|
+
more.setAttribute("aria-expanded", String(open));
|
|
9113
|
+
const rest = document.getElementById(more.getAttribute("aria-controls"));
|
|
9114
|
+
if (rest) rest.hidden = !open;
|
|
9115
|
+
} else if (react) {
|
|
9116
|
+
const on = react.getAttribute("aria-pressed") !== "true";
|
|
9117
|
+
const n = react.querySelector("[data-slot=count]");
|
|
9118
|
+
const count = Math.max(0, Number(n?.textContent || 0) + (on ? 1 : -1));
|
|
9119
|
+
react.setAttribute("aria-pressed", String(on));
|
|
9120
|
+
if (n) n.textContent = String(count);
|
|
9121
|
+
react.setAttribute("aria-label", `Helpful, ${count} ${count === 1 ? "person" : "people"}`);
|
|
9122
|
+
fire(react, "asta:whats-new-react", { id: react.closest("[data-id]")?.dataset.id, reacted: on });
|
|
9123
|
+
} else if (near(e, "[data-asta-whats-new-read]")) {
|
|
9124
|
+
clMarkRead(root);
|
|
9125
|
+
clFocus(root.querySelector(".asta-whats-new-title"));
|
|
9126
|
+
} else if (near(e, "[data-asta-whats-new-clear]")) {
|
|
9127
|
+
root.querySelectorAll("[data-asta-whats-new-tag]").forEach((b) => b.setAttribute("aria-pressed", String(b.dataset.astaChangelogTag === "all")));
|
|
9128
|
+
const field = root.querySelector("[data-asta-whats-new-search]");
|
|
9129
|
+
if (field) field.value = "";
|
|
9130
|
+
clApply(root);
|
|
9131
|
+
clFocus(field);
|
|
9132
|
+
} else if (near(e, "[data-asta-whats-new-load]")) clLoad(root, near(e, "[data-asta-whats-new-load]"));
|
|
9133
|
+
});
|
|
9134
|
+
|
|
9135
|
+
document.addEventListener("input", (e) => {
|
|
9136
|
+
const root = clRoot(e);
|
|
9137
|
+
if (root && e.target.matches?.("[data-asta-whats-new-search]")) clApply(root);
|
|
9138
|
+
});
|
|
9139
|
+
|
|
9140
|
+
document.addEventListener("keydown", (e) => {
|
|
9141
|
+
if (e.key !== "Escape") return;
|
|
9142
|
+
const pop = near(e, "[data-asta-whats-new-pop]");
|
|
9143
|
+
if (pop && !pop.querySelector(".asta-whats-new-panel")?.hidden) {
|
|
9144
|
+
e.preventDefault();
|
|
9145
|
+
clPop(pop, false);
|
|
9146
|
+
return;
|
|
9147
|
+
}
|
|
9148
|
+
const field = near(e, "[data-asta-whats-new-search]");
|
|
9149
|
+
if (field?.value) {
|
|
9150
|
+
e.preventDefault();
|
|
9151
|
+
field.value = "";
|
|
9152
|
+
clApply(clRoot(e));
|
|
9153
|
+
}
|
|
9154
|
+
});
|
|
9155
|
+
|
|
9156
|
+
// Tabbing out of the popover closes it without pulling focus back.
|
|
9157
|
+
document.addEventListener("focusout", (e) => {
|
|
9158
|
+
const pop = near(e, "[data-asta-whats-new-pop]");
|
|
9159
|
+
if (pop && e.relatedTarget instanceof Node && !pop.contains(e.relatedTarget)) clPop(pop, false, false);
|
|
9160
|
+
});
|
|
9161
|
+
|
|
9162
|
+
/* ---------- cancel-flow ---------- */
|
|
9163
|
+
/* ---------- Cancel subscription ----------
|
|
9164
|
+
* [data-asta-cancel]: [data-asta-cancel-next] checks a reason is picked and shows the offer named by the radio's
|
|
9165
|
+
* data-offer. [data-asta-cancel-back|continue] move between steps. [data-asta-cancel-accept|confirm|resubscribe|export]
|
|
9166
|
+
* fire the cancelable "asta:cancel-accept", "asta:cancel", "asta:cancel-resubscribe" and "asta:cancel-export" with
|
|
9167
|
+
* detail.done(ok). Unhandled, the demo waits a moment and succeeds. [data-asta-cancel-keep] fires "asta:cancel-keep".
|
|
9168
|
+
* Uses near() and fire() from the shared helpers above. Block-scoped so its names stay local. */
|
|
9169
|
+
{
|
|
9170
|
+
const ORDER = ["reason", "offer", "confirm", "done"];
|
|
9171
|
+
const cfFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
9172
|
+
const cfPanels = (root) => [...root.querySelectorAll(".asta-cancel-flow-panel")];
|
|
9173
|
+
const cfPanel = (root) => cfPanels(root).find((p) => !p.hidden);
|
|
9174
|
+
const cfSay = (root, text) => {
|
|
9175
|
+
const s = root.querySelector("[data-asta-cancel-status]");
|
|
9176
|
+
if (s) s.textContent = text;
|
|
9177
|
+
};
|
|
9178
|
+
|
|
9179
|
+
function cfChoice(root) {
|
|
9180
|
+
const r = root.querySelector("input[name=reason]:checked");
|
|
9181
|
+
const detail = root.querySelector(".asta-cancel-flow-other textarea")?.value.trim();
|
|
9182
|
+
const months = Number(root.querySelector("select[name=months]")?.value) || 1;
|
|
9183
|
+
return { reason: r?.value ?? "", offer: r?.dataset.offer ?? "talk", months, ...(r?.value === "other" && detail ? { detail } : {}) };
|
|
9184
|
+
}
|
|
9185
|
+
|
|
9186
|
+
// Show one panel, sync the step list and land focus on the new heading.
|
|
9187
|
+
function cfShow(root, name, dir = "next") {
|
|
9188
|
+
root.querySelector(".asta-cancel-flow-stage")?.setAttribute("data-dir", dir);
|
|
9189
|
+
cfPanels(root).forEach((p) => (p.hidden = p.dataset.panel !== name));
|
|
9190
|
+
const step = ORDER.includes(name) ? name : "done";
|
|
9191
|
+
const at = ORDER.indexOf(step);
|
|
9192
|
+
root.querySelectorAll(".asta-cancel-flow-steps > li").forEach((li, i) => {
|
|
9193
|
+
const state = i < at || (step === "done" && i === at) ? "done" : i === at ? "current" : "todo";
|
|
9194
|
+
li.dataset.state = state;
|
|
9195
|
+
if (i === at) li.setAttribute("aria-current", "step");
|
|
9196
|
+
else li.removeAttribute("aria-current");
|
|
9197
|
+
const sr = li.querySelector("[data-slot=state]");
|
|
9198
|
+
if (sr) sr.textContent = state === "done" ? ", completed" : state === "current" ? ", current step" : "";
|
|
9199
|
+
});
|
|
9200
|
+
root.querySelectorAll(".asta-cancel-flow-alert").forEach((a) => (a.hidden = true));
|
|
9201
|
+
cfFocus(cfPanel(root)?.querySelector(".asta-cancel-flow-heading"));
|
|
9202
|
+
}
|
|
9203
|
+
|
|
9204
|
+
// The offer panel shows the block for the picked reason and borrows its heading and accept label.
|
|
9205
|
+
function cfOffer(root) {
|
|
9206
|
+
const { offer } = cfChoice(root);
|
|
9207
|
+
const panel = root.querySelector('[data-panel="offer"]');
|
|
9208
|
+
if (!panel) return;
|
|
9209
|
+
let shown = null;
|
|
9210
|
+
panel.querySelectorAll("[data-offer-panel]").forEach((o) => {
|
|
9211
|
+
o.hidden = o.dataset.offerPanel !== offer;
|
|
9212
|
+
if (!o.hidden) shown = o;
|
|
9213
|
+
});
|
|
9214
|
+
const heading = panel.querySelector(".asta-cancel-flow-heading");
|
|
9215
|
+
if (shown && heading) heading.textContent = shown.dataset.title || heading.textContent;
|
|
9216
|
+
const label = panel.querySelector("[data-asta-cancel-accept] .asta-btn-label");
|
|
9217
|
+
if (shown && label) label.textContent = shown.dataset.accept || label.textContent;
|
|
9218
|
+
}
|
|
9219
|
+
|
|
9220
|
+
function cfMsg(root, on) {
|
|
9221
|
+
const msg = root.querySelector(".asta-cancel-flow-msg");
|
|
9222
|
+
if (!msg) return;
|
|
9223
|
+
msg.toggleAttribute("data-error", on);
|
|
9224
|
+
const text = msg.querySelector("span:last-child");
|
|
9225
|
+
if (text) text.textContent = on ? msg.dataset.errorText : msg.dataset.hint;
|
|
9226
|
+
}
|
|
9227
|
+
|
|
9228
|
+
// Busy button, the rest of the panel disabled, then hand done(ok) to whoever handles the event.
|
|
9229
|
+
function cfRun(root, btn, name, then) {
|
|
9230
|
+
const panel = cfPanel(root);
|
|
9231
|
+
const buttons = [...(panel?.querySelectorAll("button") ?? [])];
|
|
9232
|
+
const alert = panel?.querySelector(".asta-cancel-flow-alert");
|
|
9233
|
+
if (alert) alert.hidden = true;
|
|
9234
|
+
btn.setAttribute("aria-busy", "true");
|
|
9235
|
+
buttons.forEach((b) => (b.disabled = true));
|
|
9236
|
+
let settled = false;
|
|
9237
|
+
const done = (ok) => {
|
|
9238
|
+
if (settled) return;
|
|
9239
|
+
settled = true;
|
|
9240
|
+
btn.removeAttribute("aria-busy");
|
|
9241
|
+
buttons.forEach((b) => (b.disabled = false));
|
|
9242
|
+
if (ok !== false) return then();
|
|
9243
|
+
if (alert) alert.hidden = false;
|
|
9244
|
+
cfFocus(btn);
|
|
9245
|
+
};
|
|
9246
|
+
const ev = new CustomEvent(name, { bubbles: true, cancelable: true, detail: { ...cfChoice(root), done } });
|
|
9247
|
+
root.dispatchEvent(ev);
|
|
9248
|
+
if (!ev.defaultPrevented) setTimeout(() => done(true), 800);
|
|
9249
|
+
}
|
|
9250
|
+
|
|
9251
|
+
document.addEventListener("click", (e) => {
|
|
9252
|
+
const root = near(e, "[data-asta-cancel]");
|
|
9253
|
+
if (!root) return;
|
|
9254
|
+
const btn = near(e, "button");
|
|
9255
|
+
if (!btn || btn.disabled) return;
|
|
9256
|
+
const at = cfPanel(root)?.dataset.panel;
|
|
9257
|
+
if (btn.matches("[data-asta-cancel-next]")) {
|
|
9258
|
+
if (!cfChoice(root).reason) {
|
|
9259
|
+
cfMsg(root, true);
|
|
9260
|
+
cfSay(root, "Pick a reason to continue.");
|
|
9261
|
+
root.querySelector("input[name=reason]")?.focus();
|
|
9262
|
+
return;
|
|
9263
|
+
}
|
|
9264
|
+
cfOffer(root);
|
|
9265
|
+
cfShow(root, "offer");
|
|
9266
|
+
} else if (btn.matches("[data-asta-cancel-back]")) cfShow(root, at === "confirm" ? "offer" : "reason", "back");
|
|
9267
|
+
else if (btn.matches("[data-asta-cancel-continue]")) cfShow(root, "confirm");
|
|
9268
|
+
else if (btn.matches("[data-asta-cancel-keep]")) fire(root, "asta:cancel-keep", cfChoice(root));
|
|
9269
|
+
else if (btn.matches("[data-asta-cancel-accept]"))
|
|
9270
|
+
cfRun(root, btn, "asta:cancel-accept", () => {
|
|
9271
|
+
const { offer, months } = cfChoice(root);
|
|
9272
|
+
root.querySelectorAll('[data-panel="kept-pause"] [data-slot=months]').forEach((n) => (n.textContent = `${months} ${months === 1 ? "month" : "months"}`));
|
|
9273
|
+
cfShow(root, `kept-${offer}`);
|
|
9274
|
+
});
|
|
9275
|
+
else if (btn.matches("[data-asta-cancel-confirm]")) cfRun(root, btn, "asta:cancel", () => cfShow(root, "done"));
|
|
9276
|
+
else if (btn.matches("[data-asta-cancel-resubscribe]")) cfRun(root, btn, "asta:cancel-resubscribe", () => cfShow(root, "back"));
|
|
9277
|
+
else if (btn.matches("[data-asta-cancel-export]"))
|
|
9278
|
+
cfRun(root, btn, "asta:cancel-export", () => {
|
|
9279
|
+
const label = btn.querySelector(".asta-btn-label");
|
|
9280
|
+
if (label && btn.dataset.doneLabel) label.textContent = btn.dataset.doneLabel;
|
|
9281
|
+
btn.disabled = true;
|
|
9282
|
+
const note = cfPanel(root)?.querySelector("small[data-done-text]");
|
|
9283
|
+
if (note) note.textContent = note.dataset.doneText;
|
|
9284
|
+
cfSay(root, "Export started. We'll email you a download link.");
|
|
9285
|
+
});
|
|
9286
|
+
});
|
|
9287
|
+
|
|
9288
|
+
// Picking a reason clears the error.
|
|
9289
|
+
document.addEventListener("change", (e) => {
|
|
9290
|
+
const root = near(e, "[data-asta-cancel]");
|
|
9291
|
+
if (root && e.target instanceof HTMLInputElement && e.target.name === "reason") cfMsg(root, false);
|
|
9292
|
+
});
|
|
9293
|
+
}
|
|
9294
|
+
})();
|