{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "modal",
  "type": "registry:ui",
  "title": "<ui-modal>",
  "description": "Carbon-style modal built on the native `<dialog>` + showModal(), which gives us the top layer, an inert page behind, a focus trap, Esc handling and focus return for free. Copied from @purpurabog/ui 2.3.0; the package is the maintained source, this copy is yours to change. Icons from the Carbon Design System (Apache-2.0, © IBM Corp.; see THIRD-PARTY-NOTICES.md in the package).",
  "dependencies": [
    "lit@^3.3.0"
  ],
  "registryDependencies": [
    "@kanok-ui/core-modal",
    "@kanok-ui/core-overlay",
    "@kanok-ui/shared-element",
    "@kanok-ui/shared-events",
    "@kanok-ui/shared-field",
    "@kanok-ui/shared-focus-ring",
    "@kanok-ui/shared-localize",
    "@kanok-ui/shared-quiet-focus",
    "@kanok-ui/shared-slots",
    "@kanok-ui/tokens"
  ],
  "files": [
    {
      "path": "src/primitives/modal/modal.ts",
      "type": "registry:ui",
      "target": "components/ui/primitives/modal/modal.ts",
      "content": "import { html, css, nothing, type ReactiveElement } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { SlotController } from '../shared/slots.ts';\nimport { uid } from '../shared/field.ts';\nimport { LocalizeController } from '../shared/localize.ts';\nimport type { CloseDetail } from '../shared/events.ts';\nimport { UiElement } from '../shared/element.ts';\nimport { focusRing, focusRingInset } from '../shared/focus-ring.ts';\nimport { focusQuietly } from '../shared/quiet-focus.ts';\nimport { FOCUSABLE, closesOnOutsideClick, isOutside, leastDestructive, type ModalCloseReason } from '../../core/modal.ts';\nimport { closeOverlay, isTopOverlay, lockScroll, openOverlay, unlockScroll, type OverlayLayer } from '../../core/overlay.ts';\n\n/** A footer button's Carbon kind (`variant` is the alias). */\nconst kindOf = (el: Element) => el.getAttribute('kind') ?? el.getAttribute('variant');\n\nexport type { ModalCloseReason } from '../../core/modal.ts';\n\n/**\n * Carbon-style modal built on the native `<dialog>` + showModal(), which gives us the\n * top layer, an inert page behind, a focus trap, Esc handling and focus return for free.\n *\n * Put `autofocus` on the element that should receive focus first; otherwise, as Carbon (cds-modal /\n * React Modal, traced key by key), the first focusable control in the body gets it, then the first\n * footer button, then the close button — or, with `alert`, the least destructive footer button.\n * Tab cycles inside the dialog; Esc closes and focus returns to the control that opened it. Over other overlays (a\n * side panel, a tearsheet, another modal) one Esc closes only the topmost, and a vetoed close stays vetoed however\n * often Esc is pressed.\n *\n * - `alert`: role=\"alertdialog\" for confirmations that interrupt (e.g. delete); the body\n *   becomes the description.\n * - A body that overflows becomes a focusable, labelled region so keyboard users can scroll it.\n * - Outside clicks (Carbon): a modal with footer buttons (transactional) never closes on a click\n *   outside it, so typed input isn't lost; a passive modal (no footer) does, unless `persistent`.\n *\n * @slot - Body content\n * @slot label - Small label above the heading (the row renders only when slotted)\n * @slot footer - Action buttons (laid out full-bleed, Carbon style)\n * @slot header-actions - Controls at the top end of the header, beside the close button (one 48px button fits)\n * @fires ui-request-close - Cancelable; detail: { reason }. preventDefault() keeps it open.\n * @fires ui-close - After the modal has closed\n * @csspart dialog - The native `<dialog>` panel\n * @csspart header - Header row\n * @csspart header-actions - Wrapper of the `header-actions` slot\n * @csspart label - The small label above the heading\n * @csspart heading - The heading\n * @csspart close-button - The × button\n * @csspart body - Scrollable body\n * @csspart footer - Footer holding the action buttons\n * @cssprop --ui-modal-radius - Corner radius (default 0; Kanok: 12px)\n * @cssprop --ui-modal-shadow - `box-shadow` of the box (default none)\n * @cssprop --ui-modal-scrim - The overlay behind the box (default `rgb(22 22 22 / 0.5)`)\n * @cssprop --ui-overlay-background - The box's surface, shared by every floating surface (default layer 1)\n * @cssprop --ui-overlay-border - The box's border, shared by modal, side panel and tearsheet (default none)\n * @cssprop --ui-modal-footer-gap - Gap between footer buttons (default none: they touch)\n * @cssprop --ui-modal-footer-height - Footer `min-height` (default 64px)\n * @cssprop --ui-modal-footer-padding - Footer padding (default 0: full-bleed buttons)\n * @cssprop --ui-modal-footer-border - Border above the footer (default none)\n * @cssprop --ui-modal-button-flex - `flex` of each footer button (default `0 1 50%`: halves)\n * @cssprop --ui-modal-button-height - Height of the footer buttons (default 64px)\n * @cssprop --ui-modal-button-align - `align-items` of their content (default `flex-start`: text at the top)\n * @cssprop --ui-modal-button-padding-top - Their top padding (default 14px)\n * @cssprop --ui-close-size - Size of the × button (default 48px; Kanok: 32px)\n * @cssprop --ui-close-inset - Margin that sets the × in from the corner (default 0; Kanok: 8px)\n * @cssprop --ui-icon-control-radius - Corners of the ×, its hover fill and its ring (default 0; Kanok: round)\n * @cssprop --ui-focus-offset - `outline-offset` of the ×'s focus ring (default -2px: inside; Kanok: 2px outside)\n * @cssprop --ui-modal-body-focus-radius - Corners of the scrolling body's focus ring (default 0; Kanok: 6px)\n */\n@customElement('ui-modal')\nexport class UiModal extends UiElement {\n    static override readonly styles = css`\n        dialog {\n            box-sizing: border-box;\n            width: min(100% - 2 * var(--ui-space-md), 672px);\n            max-height: min(100% - 2 * var(--ui-space-xxl), 768px);\n            padding: 0;\n            /* --ui-overlay-border / -background: a design can outline and raise every floating surface alike (Carbon: none, layer 1) */\n            border: var(--ui-overlay-border, none);\n            border-radius: var(--ui-modal-radius, var(--ui-radius-none));\n            background-color: var(--ui-overlay-background, var(--ui-surface-1));\n            box-shadow: var(--ui-modal-shadow, none);\n            color: var(--ui-ink);\n            font-family: var(--ui-font-family);\n            /* on the dialog, not only while [open]: a closing one stays on screen while it fades out */\n            flex-direction: column;\n        }\n\n        dialog[open] {\n            display: flex;\n        }\n\n        :host([size='sm']) dialog {\n            width: min(100% - 2 * var(--ui-space-md), 480px);\n        }\n\n        :host([size='lg']) dialog {\n            width: min(100% - 2 * var(--ui-space-md), 1056px);\n        }\n\n        dialog::backdrop {\n            background-color: var(--ui-modal-scrim, rgb(22 22 22 / 0.5)); /* Carbon's modal overlay; a design can tint it */\n        }\n\n        /*\n         * Carbon modal: 240ms, the box drops 24px into place while it and the overlay fade in (entrance expressive),\n         * and goes back out after closing (exit expressive) where the browser can keep a closing dialog in the top\n         * layer (overlay). Reduced motion: none.\n         */\n        @media (prefers-reduced-motion: no-preference) {\n            dialog {\n                opacity: 0;\n                transform: translateY(-24px);\n                transition:\n                    opacity var(--ui-duration-moderate-02) cubic-bezier(0.4, 0.14, 1, 1),\n                    transform var(--ui-duration-moderate-02) cubic-bezier(0.4, 0.14, 1, 1);\n            }\n\n            dialog::backdrop {\n                opacity: 0;\n                transition: opacity var(--ui-duration-moderate-02) cubic-bezier(0.4, 0.14, 1, 1);\n            }\n\n            dialog[open],\n            dialog[open]::backdrop {\n                opacity: 1;\n                transition-timing-function: cubic-bezier(0, 0, 0.3, 1);\n            }\n\n            dialog[open] {\n                transform: none;\n            }\n\n            @starting-style {\n                dialog[open],\n                dialog[open]::backdrop {\n                    opacity: 0;\n                }\n\n                dialog[open] {\n                    transform: translateY(-24px);\n                }\n            }\n\n            @supports (overlay: auto) {\n                /* where a modal one sits, also while it closes (no longer :modal) */\n                dialog {\n                    position: fixed;\n                    inset: 0;\n                    transition-property: opacity, transform, overlay, display;\n                    transition-behavior: allow-discrete;\n                }\n\n                dialog::backdrop {\n                    transition-property: opacity, overlay, display;\n                    transition-behavior: allow-discrete;\n                }\n            }\n        }\n\n        header {\n            position: relative;\n            padding: var(--ui-space-md) 48px var(--ui-space-xs) var(--ui-space-md); /* Carbon: 16px 48px 0 16px + 8px margin */\n        }\n\n        .eyebrow {\n            margin: 0 0 var(--ui-space-xxs);\n            font: var(--ui-font-caption);\n            letter-spacing: var(--ui-tracking-caption);\n            color: var(--ui-ink-muted);\n        }\n\n        h2 {\n            margin: 0;\n            padding-inline-end: calc(20% - 48px); /* Carbon modal-header__heading */\n            font: var(--ui-font-subhead);\n        }\n\n        header.has-actions {\n            padding-inline-end: 96px;\n        }\n\n        .header-actions {\n            position: absolute;\n            top: 0;\n            inset-inline-end: 48px;\n            display: flex;\n            align-items: center;\n            height: 48px;\n        }\n\n        /* --ui-close-size / --ui-close-inset / --ui-icon-control-radius: a design can make it a smaller round button set in from the corner (Carbon: a 48px square in the corner) */\n        .close {\n            position: absolute;\n            top: 0;\n            inset-inline-end: 0;\n            display: grid;\n            place-items: center;\n            width: var(--ui-close-size, 48px);\n            height: var(--ui-close-size, 48px);\n            margin: var(--ui-close-inset, 0);\n            padding: 0;\n            border: none;\n            border-radius: var(--ui-icon-control-radius, 0);\n            background: transparent;\n            color: var(--ui-ink);\n            cursor: pointer;\n            transition: background-color var(--ui-duration-moderate) var(--ui-easing); /* Carbon .cds--modal-close */\n        }\n\n        .close:hover {\n            background-color: var(--ui-ghost-hover);\n        }\n\n        .close:focus-visible {\n            ${focusRing}\n        }\n\n        /* focused on opening right after a click (shared/quiet-focus): no keyboard ring in Kanok */\n        .close[data-quiet-focus]:focus-visible {\n            outline-color: var(--ui-pointer-focus, var(--ui-focus));\n        }\n\n        .close svg {\n            width: 20px;\n            height: 20px;\n            fill: currentColor;\n        }\n\n        .body {\n            flex: 1;\n            overflow-y: auto;\n            padding: var(--ui-space-xs) var(--ui-space-md) var(--ui-space-xxl);\n            font: var(--ui-font-body);\n            letter-spacing: var(--ui-tracking-body);\n            outline: none;\n        }\n\n        /* the scrolling region: the ring inside, in the box's corners (--ui-modal-body-focus-radius; Carbon: square) */\n        .body:focus-visible {\n            ${focusRingInset}\n            border-radius: var(--ui-modal-body-focus-radius, 0);\n        }\n\n        /*\n         * Carbon modal footer: 64px tall, buttons take half each (one button = right half), text at the top.\n         * --ui-modal-footer-* / --ui-modal-button-* let a design use ordinary buttons at the end, under a rule.\n         */\n        footer {\n            display: flex;\n            justify-content: flex-end;\n            gap: var(--ui-modal-footer-gap, normal);\n            min-height: var(--ui-modal-footer-height, 64px);\n            padding: var(--ui-modal-footer-padding, 0px);\n            border-block-start: var(--ui-modal-footer-border, none);\n        }\n\n        footer[hidden] {\n            display: none;\n        }\n\n        ::slotted([slot='footer']) {\n            flex: var(--ui-modal-button-flex, 0 1 50%);\n            --ui-field-height-lg: var(--ui-modal-button-height, 64px); /* the modal makes its footer buttons lg */\n            --ui-button-align: var(--ui-modal-button-align, flex-start);\n            --ui-button-padding-top: var(--ui-modal-button-padding-top, 14px);\n        }\n\n        @media (forced-colors: active) {\n            dialog {\n                border: 1px solid CanvasText;\n            }\n        }\n    `;\n\n    @property({ type: Boolean, reflect: true }) open = false;\n\n\n    private readonly localize = new LocalizeController(this);\n\n    @property() heading = '';\n\n    /** Accessible name when there is no heading (Carbon `aria-label`); the `label` slot is used before it. */\n    @property() label = '';\n\n    /** Dialog width (Carbon modal sizes): sm 480px, md 672px, lg 1056px — never wider than the viewport minus 16px a side. */\n    @property({ reflect: true }) size: 'sm' | 'md' | 'lg' = 'md';\n\n    /** A passive modal (no footer) ignores outside clicks too; one with footer buttons always does (Carbon). */\n    @property({ type: Boolean }) persistent = false;\n\n    /** Accessible name for the close button. */\n    @property({ attribute: 'close-label' }) closeLabel = '';\n\n    /** Interrupting confirmation: role=\"alertdialog\", focus starts on the safest action. */\n    @property({ type: Boolean, reflect: true }) alert = false;\n\n    @state() private bodyScrollable = false;\n\n    @query('dialog') private readonly dialog!: HTMLDialogElement;\n\n    @query('.body') private readonly body!: HTMLElement;\n\n    @query('.content') private readonly content!: HTMLElement;\n\n    private resizeObserver?: ResizeObserver;\n\n    /** Created on connect (none at construction, for server rendering); re-observed after the element moves. */\n    private observeSize() {\n        this.resizeObserver ??= new ResizeObserver(() => {\n            this.bodyScrollable = this.body.scrollHeight > this.body.clientHeight + 1;\n        });\n        this.resizeObserver.observe(this.body);\n        this.resizeObserver.observe(this.content);\n    }\n\n    private readonly headingId = uid('ui-modal-heading');\n    private readonly labelId = uid('ui-modal-label');\n    private readonly bodyId = uid('ui-modal-body');\n    private hasFooter = false;\n    private pointerDownOnBackdrop = false;\n    /** Shown, on the overlay stack and holding the page still; cleared (once) by finishClose. */\n    private active = false;\n    /** A `<form method=\"dialog\">` inside is closing the dialog: honour it, as before. */\n    private formClosing = false;\n    /** Its place on the page's overlay stack: Esc reaches it only while it is the topmost layer. */\n    private readonly layer: OverlayLayer = { escape: () => this.requestClose('escape'), modal: true };\n\n    show() {\n        this.open = true;\n    }\n\n    close() {\n        this.open = false;\n    }\n\n    /** Ask to close — fires cancelable `ui-request-close` first. */\n    requestClose(reason: ModalCloseReason) {\n        const event = new CustomEvent('ui-request-close', {\n            detail: { reason },\n            bubbles: true,\n            composed: true,\n            cancelable: true,\n        });\n        if (this.dispatchEvent(event)) this.open = false;\n    }\n\n    protected override updated(changed: Map<string, unknown>) {\n        if (!changed.has('open')) return;\n        if (this.open && !this.dialog.open) {\n            this.dialog.showModal();\n            void this.focusWhenReady();\n            this.active = true;\n            openOverlay(this.layer, globalThis);\n            lockScroll(this, document.documentElement);\n        } else if (!this.open && this.dialog.open) {\n            this.dialog.close();\n            this.finishClose();\n        }\n    }\n\n    override connectedCallback() {\n        super.connectedCallback();\n        if (this.hasUpdated) this.observeSize();\n    }\n\n    override firstUpdated() {\n        this.observeSize();\n    }\n\n    override disconnectedCallback() {\n        super.disconnectedCallback();\n        this.resizeObserver?.disconnect();\n        this.finishClose();\n    }\n\n    /**\n     * Initial focus once the elements inside have rendered: a modal open from its first render would\n     * otherwise find its `ui-button`s without their inner button yet and fall back to ×.\n     */\n    private async focusWhenReady() {\n        const pending = [...this.querySelectorAll('*')].map((el) => (el as Partial<ReactiveElement>).updateComplete).filter((p): p is Promise<boolean> => p !== undefined);\n        if (pending.length) await Promise.all(pending);\n        if (this.open) this.focusInitial();\n    }\n\n    /** Carbon: the first focusable control in the body, else the first footer button, else × (the native dialog would pick × as it comes first). */\n    private focusInitial() {\n        // the native dialog's autofocus only looks in its own (shadow) tree, not at slotted content\n        const chosen = this.querySelector<HTMLElement>('[autofocus]');\n        if (chosen) {\n            focusQuietly(chosen);\n            return;\n        }\n        if (this.alert) {\n            this.focusLeastDestructive();\n            return;\n        }\n        const inBody = (el: Element) => {\n            for (let n: Element | null = el; n && n !== this; n = n.parentElement) if (n.hasAttribute('slot')) return false;\n            return true;\n        };\n        const focusable = (el: HTMLElement) => el.matches(FOCUSABLE) || (!!el.shadowRoot?.delegatesFocus && !el.hasAttribute('disabled'));\n        const took = (el: HTMLElement) => {\n            focusQuietly(el); // opened by a click: no keyboard ring in Kanok\n            return el.matches(':focus-within');\n        };\n        const bodyControl = [...this.querySelectorAll<HTMLElement>('*')].find((el) => inBody(el) && focusable(el) && took(el));\n        if (bodyControl) return;\n        const footer = this.querySelector<HTMLElement>('[slot=\"footer\"]');\n        if (footer && took(footer)) return;\n        focusQuietly(this.shadowRoot?.querySelector<HTMLElement>('.close'));\n    }\n\n    /** Alert dialogs start on the safest action (e.g. Cancel), unless the page chose `autofocus`. */\n    private focusLeastDestructive() {\n        if (this.querySelector('[autofocus]')) return;\n        const actions = [...this.querySelectorAll<HTMLElement>('[slot=\"footer\"]')];\n        focusQuietly(actions[leastDestructive(actions.map(kindOf))]);\n    }\n\n    /** Idempotent cleanup — runs on our own close and on the native `close` event. */\n    private finishClose() {\n        if (!this.active) return;\n        this.active = false;\n        closeOverlay(this.layer);\n        unlockScroll(this, document.documentElement);\n        this.dispatchEvent(new Event('ui-close', { bubbles: true, composed: true }));\n    }\n\n    /**\n     * A close request the page's Esc listener didn't take (Esc is routed there, core/overlay.ts; this is e.g. Android's\n     * back gesture): through requestClose, so the app can veto it, and only when this is the topmost layer.\n     */\n    private onCancel(event: Event) {\n        event.preventDefault();\n        if (isTopOverlay(this.layer)) this.requestClose('escape');\n    }\n\n    private onSubmit(event: SubmitEvent) {\n        const form = event.target as HTMLFormElement;\n        this.formClosing = (event.submitter?.getAttribute('formmethod') ?? form.getAttribute('method'))?.toLowerCase() === 'dialog';\n    }\n\n    /**\n     * The dialog closed. Our own close has already set `open` false. A `<form method=\"dialog\">` inside closes it: keep\n     * `open` in sync. Anything else that closed it without asking (the browser's close watcher after a vetoed Esc) is\n     * a request: vetoed, the dialog opens again.\n     */\n    private onClose() {\n        if (this.open && !this.formClosing) {\n            const request = new CustomEvent('ui-request-close', { detail: { reason: 'escape' }, bubbles: true, composed: true, cancelable: true });\n            if (!this.dispatchEvent(request)) {\n                this.dialog.showModal();\n                this.focusInitial();\n                return;\n            }\n        }\n        this.formClosing = false;\n        this.open = false;\n        this.finishClose();\n    }\n\n    // Only treat it as a backdrop click when press and release both land outside the panel,\n    // so drag-selecting text out of the dialog doesn't close it.\n    private onPointerDown(event: PointerEvent) {\n        this.pointerDownOnBackdrop = event.target === this.dialog && this.isOutside(event);\n    }\n\n    /** Carbon: transactional modals (footer buttons) never close on an outside click; passive ones do unless `persistent`. */\n    private get closesOnOutsideClick() {\n        return closesOnOutsideClick(this.persistent, !!this.querySelector(':scope > [slot=\"footer\"]'));\n    }\n\n    private onClick(event: MouseEvent) {\n        if (!this.closesOnOutsideClick || !this.pointerDownOnBackdrop) return;\n        if (event.target === this.dialog && this.isOutside(event)) this.requestClose('backdrop');\n    }\n\n    private isOutside(event: MouseEvent) {\n        return isOutside(this.dialog.getBoundingClientRect(), event.clientX, event.clientY);\n    }\n\n    @state() private hasHeaderActions = false;\n\n    private readonly slots = new SlotController(this);\n\n    private readonly onHeaderActionsSlotChange = (event: Event) => {\n        this.hasHeaderActions = (event.target as HTMLSlotElement).assignedElements().length > 0;\n    };\n\n    private onFooterSlotChange(event: Event) {\n        this.hasFooter = (event.target as HTMLSlotElement).assignedElements().length > 0;\n        this.requestUpdate();\n    }\n\n    /** Focus inside the open dialog (the least destructive control, as on open). */\n    override focus(options?: FocusOptions) {\n        if (!this.open) {\n            super.focus(options);\n            return;\n        }\n        const actions = [...this.querySelectorAll<HTMLElement>('[slot=\"footer\"]')];\n        const safe = actions[leastDestructive(actions.map(kindOf))] ?? actions[0];\n        (safe ?? this.shadowRoot?.querySelector<HTMLElement>('.close') ?? this.dialog).focus(options);\n    }\n\n    /** The heading names the dialog; without one the `label` slot does. */\n    private get nameId() {\n        if (this.heading) return this.headingId;\n        return this.slots.has('label') ? this.labelId : undefined;\n    }\n\n    override render() {\n        return html`\n            <dialog\n                part=\"dialog\"\n                role=${this.alert ? 'alertdialog' : nothing}\n                aria-labelledby=${this.nameId ?? nothing}\n                aria-label=${!this.nameId && this.label ? this.label : nothing}\n                aria-describedby=${this.alert ? this.bodyId : nothing}\n                @cancel=${this.onCancel}\n                @close=${this.onClose}\n                @submit=${this.onSubmit}\n                @pointerdown=${this.onPointerDown}\n                @click=${this.onClick}\n            >\n                <header part=\"header\" class=${this.hasHeaderActions ? 'has-actions' : ''}>\n                    <div class=\"header-actions\" part=\"header-actions\">\n                        <slot name=\"header-actions\" @slotchange=${this.onHeaderActionsSlotChange}></slot>\n                    </div>\n                    ${this.slots.has('label') ? html`<p class=\"eyebrow\" part=\"label\" id=${this.labelId}><slot name=\"label\"></slot></p>` : nothing}\n                    ${this.heading ? html`<h2 id=${this.headingId} part=\"heading\">${this.heading}</h2>` : nothing}\n                    <button class=\"close\" part=\"close-button\" type=\"button\" tabindex=\"0\" aria-label=${this.closeLabel || this.localize.t.common.close} @click=${() => this.requestClose('close-button')}>\n                        <svg viewBox=\"0 0 32 32\" aria-hidden=\"true\">\n                            <path d=\"M24 9.4 22.6 8 16 14.6 9.4 8 8 9.4l6.6 6.6L8 22.6 9.4 24l6.6-6.6 6.6 6.6 1.4-1.4-6.6-6.6z\" />\n                        </svg>\n                    </button>\n                </header>\n                <div\n                    class=\"body\"\n                    part=\"body\"\n                    id=${this.bodyId}\n                    tabindex=${this.bodyScrollable ? 0 : nothing}\n                    role=${this.bodyScrollable ? 'region' : nothing}\n                    aria-labelledby=${this.bodyScrollable && this.heading ? this.headingId : nothing}\n                >\n                    <div class=\"content\"><slot></slot></div>\n                </div>\n                <footer part=\"footer\" ?hidden=${!this.hasFooter}>\n                    <slot name=\"footer\" @slotchange=${this.onFooterSlotChange}></slot>\n                </footer>\n            </dialog>\n        `;\n    }\n}\n\nexport interface UiModalEventMap extends HTMLElementEventMap {\n    'ui-close': Event;\n    'ui-request-close': CustomEvent<CloseDetail<ModalCloseReason>>;\n}\n\n/** Typed listeners for UiModal's events (declaration merging with the class). */\nexport interface UiModal {\n    addEventListener<K extends keyof UiModalEventMap>(type: K, listener: (this: UiModal, event: UiModalEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;\n    addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n    removeEventListener<K extends keyof UiModalEventMap>(type: K, listener: (this: UiModal, event: UiModalEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;\n    removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare global {\n    interface HTMLElementTagNameMap {\n        'ui-modal': UiModal;\n    }\n}\n"
    }
  ]
}
