jekyll-v4-theme-primer 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.md +22 -0
- data/README.md +116 -0
- data/_includes/.gitkeep +1 -0
- data/_includes/head-custom-google-analytics.html +10 -0
- data/_includes/head-custom.html +9 -0
- data/_includes/theme.html +11 -0
- data/_layouts/default.html +29 -0
- data/_layouts/home.html +4 -0
- data/_layouts/page.html +4 -0
- data/_layouts/post.html +4 -0
- data/_sass/@primer/css/actionlist/action-list-item-divider.scss +48 -0
- data/_sass/@primer/css/actionlist/action-list-item.scss +593 -0
- data/_sass/@primer/css/actionlist/action-list-tree.scss +118 -0
- data/_sass/@primer/css/actionlist/action-list-variables.scss +8 -0
- data/_sass/@primer/css/actionlist/action-list.scss +67 -0
- data/_sass/@primer/css/actionlist/index.scss +6 -0
- data/_sass/@primer/css/alerts/flash.scss +1 -0
- data/_sass/@primer/css/alerts/index.scss +3 -0
- data/_sass/@primer/css/autocomplete/autocomplete.scss +1 -0
- data/_sass/@primer/css/autocomplete/index.scss +4 -0
- data/_sass/@primer/css/autocomplete/suggester.scss +92 -0
- data/_sass/@primer/css/avatars/avatar-parent-child.scss +17 -0
- data/_sass/@primer/css/avatars/avatar-stack.scss +1 -0
- data/_sass/@primer/css/avatars/avatar.scss +1 -0
- data/_sass/@primer/css/avatars/circle-badge.scss +55 -0
- data/_sass/@primer/css/avatars/index.scss +7 -0
- data/_sass/@primer/css/base/base.scss +160 -0
- data/_sass/@primer/css/base/index.scss +6 -0
- data/_sass/@primer/css/base/kbd.scss +19 -0
- data/_sass/@primer/css/base/normalize.scss +381 -0
- data/_sass/@primer/css/base/octicons.scss +6 -0
- data/_sass/@primer/css/base/typography-base.scss +89 -0
- data/_sass/@primer/css/blankslate/blankslate.scss +1 -0
- data/_sass/@primer/css/blankslate/index.scss +2 -0
- data/_sass/@primer/css/box/box-overlay.scss +42 -0
- data/_sass/@primer/css/box/box.scss +1 -0
- data/_sass/@primer/css/box/index.scss +3 -0
- data/_sass/@primer/css/branch-name/branch-name.scss +31 -0
- data/_sass/@primer/css/branch-name/index.scss +3 -0
- data/_sass/@primer/css/breadcrumb/breadcrumb.scss +1 -0
- data/_sass/@primer/css/breadcrumb/index.scss +3 -0
- data/_sass/@primer/css/buttons/button-group.scss +92 -0
- data/_sass/@primer/css/buttons/button.scss +340 -0
- data/_sass/@primer/css/buttons/index.scss +4 -0
- data/_sass/@primer/css/buttons/misc.scss +231 -0
- data/_sass/@primer/css/color-modes/index.scss +12 -0
- data/_sass/@primer/css/color-modes/native.scss +22 -0
- data/_sass/@primer/css/color-modes/themes/dark.scss +6 -0
- data/_sass/@primer/css/color-modes/themes/dark_colorblind.scss +6 -0
- data/_sass/@primer/css/color-modes/themes/dark_dimmed.scss +6 -0
- data/_sass/@primer/css/color-modes/themes/dark_high_contrast.scss +6 -0
- data/_sass/@primer/css/color-modes/themes/dark_tritanopia.scss +6 -0
- data/_sass/@primer/css/color-modes/themes/light.scss +6 -0
- data/_sass/@primer/css/color-modes/themes/light_colorblind.scss +6 -0
- data/_sass/@primer/css/color-modes/themes/light_high_contrast.scss +6 -0
- data/_sass/@primer/css/color-modes/themes/light_tritanopia.scss +6 -0
- data/_sass/@primer/css/core/index.scss +30 -0
- data/_sass/@primer/css/dropdown/dropdown.scss +1 -0
- data/_sass/@primer/css/dropdown/index.scss +2 -0
- data/_sass/@primer/css/forms/FormControl.scss +1 -0
- data/_sass/@primer/css/forms/form-control.scss +267 -0
- data/_sass/@primer/css/forms/form-group.scss +287 -0
- data/_sass/@primer/css/forms/form-select.scss +46 -0
- data/_sass/@primer/css/forms/form-validation.scss +369 -0
- data/_sass/@primer/css/forms/index.scss +9 -0
- data/_sass/@primer/css/forms/input-group.scss +71 -0
- data/_sass/@primer/css/forms/radio-group.scss +62 -0
- data/_sass/@primer/css/header/header.scss +47 -0
- data/_sass/@primer/css/header/index.scss +2 -0
- data/_sass/@primer/css/index.scss +19 -0
- data/_sass/@primer/css/labels/counters.scss +1 -0
- data/_sass/@primer/css/labels/diffstat.scss +37 -0
- data/_sass/@primer/css/labels/index.scss +7 -0
- data/_sass/@primer/css/labels/issue-labels.scss +23 -0
- data/_sass/@primer/css/labels/labels.scss +1 -0
- data/_sass/@primer/css/labels/mixins.scss +37 -0
- data/_sass/@primer/css/labels/states.scss +1 -0
- data/_sass/@primer/css/layout/app-frame.scss +156 -0
- data/_sass/@primer/css/layout/container.scss +30 -0
- data/_sass/@primer/css/layout/grid-offset.scss +20 -0
- data/_sass/@primer/css/layout/grid.scss +65 -0
- data/_sass/@primer/css/layout/index.scss +8 -0
- data/_sass/@primer/css/layout/layout.scss +1 -0
- data/_sass/@primer/css/layout/page-layout.scss +413 -0
- data/_sass/@primer/css/layout/stack.scss +220 -0
- data/_sass/@primer/css/links/index.scss +3 -0
- data/_sass/@primer/css/links/link.scss +60 -0
- data/_sass/@primer/css/loaders/index.scss +2 -0
- data/_sass/@primer/css/loaders/loaders.scss +19 -0
- data/_sass/@primer/css/markdown/blob-csv.scss +29 -0
- data/_sass/@primer/css/markdown/code.scss +77 -0
- data/_sass/@primer/css/markdown/footnotes.scss +55 -0
- data/_sass/@primer/css/markdown/headings.scss +96 -0
- data/_sass/@primer/css/markdown/images.scss +130 -0
- data/_sass/@primer/css/markdown/index.scss +9 -0
- data/_sass/@primer/css/markdown/lists.scss +98 -0
- data/_sass/@primer/css/markdown/markdown-body.scss +96 -0
- data/_sass/@primer/css/markdown/tables.scss +36 -0
- data/_sass/@primer/css/marketing/buttons/button.scss +164 -0
- data/_sass/@primer/css/marketing/buttons/index.scss +3 -0
- data/_sass/@primer/css/marketing/index.scss +15 -0
- data/_sass/@primer/css/marketing/links/index.scss +3 -0
- data/_sass/@primer/css/marketing/links/link.scss +50 -0
- data/_sass/@primer/css/marketing/support/index.scss +2 -0
- data/_sass/@primer/css/marketing/support/variables.scss +127 -0
- data/_sass/@primer/css/marketing/type/index.scss +3 -0
- data/_sass/@primer/css/marketing/type/typography.scss +118 -0
- data/_sass/@primer/css/marketing/utilities/animations.scss +51 -0
- data/_sass/@primer/css/marketing/utilities/borders.scss +4 -0
- data/_sass/@primer/css/marketing/utilities/filters.scss +3 -0
- data/_sass/@primer/css/marketing/utilities/index.scss +6 -0
- data/_sass/@primer/css/marketing/utilities/layout.scss +51 -0
- data/_sass/@primer/css/navigation/filter-list.scss +82 -0
- data/_sass/@primer/css/navigation/index.scss +8 -0
- data/_sass/@primer/css/navigation/menu.scss +1 -0
- data/_sass/@primer/css/navigation/sidenav.scss +99 -0
- data/_sass/@primer/css/navigation/subnav.scss +146 -0
- data/_sass/@primer/css/navigation/tabnav.scss +1 -0
- data/_sass/@primer/css/navigation/underline-nav.scss +1 -0
- data/_sass/@primer/css/overlay/index.scss +2 -0
- data/_sass/@primer/css/overlay/overlay.scss +1 -0
- data/_sass/@primer/css/pagination/index.scss +3 -0
- data/_sass/@primer/css/pagination/pagination.scss +156 -0
- data/_sass/@primer/css/popover/index.scss +3 -0
- data/_sass/@primer/css/popover/popover.scss +1 -0
- data/_sass/@primer/css/primitives/index.scss +10 -0
- data/_sass/@primer/css/primitives/temp-typography-tokens.scss +22 -0
- data/_sass/@primer/css/product/index.scss +28 -0
- data/_sass/@primer/css/progress/index.scss +3 -0
- data/_sass/@primer/css/progress/progress.scss +1 -0
- data/_sass/@primer/css/select-menu/index.scss +3 -0
- data/_sass/@primer/css/select-menu/select-menu.scss +463 -0
- data/_sass/@primer/css/subhead/index.scss +3 -0
- data/_sass/@primer/css/subhead/subhead.scss +1 -0
- data/_sass/@primer/css/support/index.scss +10 -0
- data/_sass/@primer/css/support/mixins/color-modes.scss +109 -0
- data/_sass/@primer/css/support/mixins/layout.scss +58 -0
- data/_sass/@primer/css/support/mixins/misc.scss +73 -0
- data/_sass/@primer/css/support/mixins/typography.scss +91 -0
- data/_sass/@primer/css/support/variables/layout.scss +230 -0
- data/_sass/@primer/css/support/variables/misc.scss +18 -0
- data/_sass/@primer/css/support/variables/typography.scss +43 -0
- data/_sass/@primer/css/table-object/index.scss +1 -0
- data/_sass/@primer/css/table-object/table-object.scss +23 -0
- data/_sass/@primer/css/timeline/index.scss +2 -0
- data/_sass/@primer/css/timeline/timeline-item.scss +1 -0
- data/_sass/@primer/css/toasts/index.scss +2 -0
- data/_sass/@primer/css/toasts/toasts.scss +127 -0
- data/_sass/@primer/css/toggle-switch/index.scss +2 -0
- data/_sass/@primer/css/toggle-switch/toggle-switch.scss +1 -0
- data/_sass/@primer/css/tooltips/index.scss +2 -0
- data/_sass/@primer/css/tooltips/tooltips.scss +281 -0
- data/_sass/@primer/css/truncate/index.scss +2 -0
- data/_sass/@primer/css/truncate/truncate.scss +2 -0
- data/_sass/@primer/css/utilities/animations.scss +196 -0
- data/_sass/@primer/css/utilities/borders.scss +74 -0
- data/_sass/@primer/css/utilities/box-shadow.scss +25 -0
- data/_sass/@primer/css/utilities/colors.scss +95 -0
- data/_sass/@primer/css/utilities/details.scss +105 -0
- data/_sass/@primer/css/utilities/flexbox.scss +52 -0
- data/_sass/@primer/css/utilities/index.scss +14 -0
- data/_sass/@primer/css/utilities/layout.scss +96 -0
- data/_sass/@primer/css/utilities/margin.scss +71 -0
- data/_sass/@primer/css/utilities/padding.scss +56 -0
- data/_sass/@primer/css/utilities/typography.scss +332 -0
- data/_sass/@primer/css/utilities/visibility-display.scss +123 -0
- data/_sass/@primer/primitives/dist/scss/colors/_dark.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/colors/_dark_colorblind.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/colors/_dark_dimmed.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/colors/_dark_high_contrast.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/colors/_dark_tritanopia.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/colors/_light.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/colors/_light_colorblind.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/colors/_light_high_contrast.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/colors/_light_tritanopia.scss +443 -0
- data/_sass/@primer/primitives/dist/scss/spacing/_normal.scss +11 -0
- data/_sass/@primer/primitives/dist/scss/typography/_normal.scss +15 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/base/size/size.scss +21 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/base/typography/typography.scss +8 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/functional/size/border.scss +14 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/functional/size/breakpoints.scss +10 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/functional/size/size-coarse.scss +7 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/functional/size/size-fine.scss +7 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/functional/size/size.scss +51 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/functional/size/viewport.scss +10 -0
- data/_sass/@primer/primitives/tokens-v2-private/scss/tokens/functional/typography/typography.scss +44 -0
- data/_sass/@primer/view-components/LICENSE.txt +21 -0
- data/_sass/@primer/view-components/README.md +17 -0
- data/_sass/@primer/view-components/app/assets/javascripts/primer_view_components.js +2 -0
- data/_sass/@primer/view-components/app/assets/javascripts/primer_view_components.js.map +1 -0
- data/_sass/@primer/view-components/app/assets/styles/primer_view_components.css +3 -0
- data/_sass/@primer/view-components/app/assets/styles/primer_view_components.css.map +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/action_list.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/action_list.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/auto_complete.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/auto_complete.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/banner.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/banner.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/button_marketing.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/button_marketing.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/dialog.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/dialog.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/dropdown/menu.d.ts +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/dropdown/menu.js +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/dropdown.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/dropdown.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/dropdown.d.ts +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/dropdown.js +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/image_crop.d.ts +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/image_crop.js +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/layout.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/layout.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/menu.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/menu.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/modal_dialog.d.ts +18 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/modal_dialog.js +150 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/nav_list.d.ts +25 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/nav_list.js +130 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/segmented_control.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/segmented_control.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/segmented_control.d.ts +12 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/segmented_control.js +47 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/tab_nav.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/tab_nav.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/text_field.css +3 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/text_field.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/toggle_switch.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/toggle_switch.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/toggle_switch.d.ts +29 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/toggle_switch.js +144 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/tool_tip.d.ts +25 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/tool_tip.js +389 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/underline_nav.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/underline_nav.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/x_banner.d.ts +11 -0
- data/_sass/@primer/view-components/app/components/primer/alpha/x_banner.js +35 -0
- data/_sass/@primer/view-components/app/components/primer/beta/auto_complete/auto_complete.d.ts +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/auto_complete/auto_complete.js +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/avatar.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/avatar.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/avatar_stack.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/avatar_stack.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/blankslate.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/blankslate.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/border_box.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/border_box.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/breadcrumbs.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/breadcrumbs.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/button.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/button.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/clipboard_copy.d.ts +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/clipboard_copy.js +43 -0
- data/_sass/@primer/view-components/app/components/primer/beta/counter.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/counter.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/flash.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/flash.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/label.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/label.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/link.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/link.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/popover.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/popover.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/progress_bar.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/progress_bar.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/truncate.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/beta/truncate.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/local_time.d.ts +1 -0
- data/_sass/@primer/view-components/app/components/primer/local_time.js +1 -0
- data/_sass/@primer/view-components/app/components/primer/primer.d.ts +15 -0
- data/_sass/@primer/view-components/app/components/primer/primer.js +15 -0
- data/_sass/@primer/view-components/app/components/primer/state_component.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/state_component.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/subhead_component.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/subhead_component.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/tab_container_component.d.ts +1 -0
- data/_sass/@primer/view-components/app/components/primer/tab_container_component.js +1 -0
- data/_sass/@primer/view-components/app/components/primer/time_ago_component.d.ts +1 -0
- data/_sass/@primer/view-components/app/components/primer/time_ago_component.js +1 -0
- data/_sass/@primer/view-components/app/components/primer/timeline_item_component.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/timeline_item_component.css.json +1 -0
- data/_sass/@primer/view-components/app/components/primer/truncate.css +1 -0
- data/_sass/@primer/view-components/app/components/primer/truncate.css.json +1 -0
- data/_sass/@primer/view-components/lib/primer/forms/primer_multi_input.d.ts +10 -0
- data/_sass/@primer/view-components/lib/primer/forms/primer_multi_input.js +45 -0
- data/_sass/@primer/view-components/lib/primer/forms/primer_text_field.d.ts +1 -0
- data/_sass/@primer/view-components/lib/primer/forms/primer_text_field.js +62 -0
- data/_sass/@primer/view-components/package.json +95 -0
- data/_sass/@primer/view-components/static/arguments.json +2586 -0
- data/_sass/@primer/view-components/static/audited_at.json +100 -0
- data/_sass/@primer/view-components/static/constants.json +1157 -0
- data/_sass/@primer/view-components/static/statuses.json +100 -0
- data/_sass/jekyll-theme-primer.scss +8 -0
- data/_sass/primer.scss +4 -0
- data/_sass/rouge.scss +213 -0
- data/assets/css/style.scss +4 -0
- metadata +444 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 GitHub
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<p align="center">
|
2
|
+
<img width="300px" alt="Primer ViewComponents Logo" src="/static/assets/view-components.svg">
|
3
|
+
</p>
|
4
|
+
|
5
|
+
<h1 align="center">Primer ViewComponents</h1>
|
6
|
+
|
7
|
+
<p align="center">ViewComponents for the Primer Design System.</p>
|
8
|
+
|
9
|
+
_Note: This library is under active pre-1.0 development. Breaking changes are likely in patch releases._
|
10
|
+
|
11
|
+
## Documentation
|
12
|
+
|
13
|
+
Visit [https://primer.style/view-components/](https://primer.style/view-components/) to view documentation.
|
14
|
+
|
15
|
+
## License
|
16
|
+
|
17
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -0,0 +1,2 @@
|
|
1
|
+
!function(){"use strict";class DetailsMenuElement extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const s=this.parentElement;if(!s)return;const c=s.querySelector("summary");c&&(c.setAttribute("aria-haspopup","menu"),c.hasAttribute("role")||c.setAttribute("role","button"));const f=[n(s,"compositionstart",(t=>h(this,t))),n(s,"compositionend",(t=>h(this,t))),n(s,"click",(t=>l(s,t))),n(s,"change",(t=>l(s,t))),n(s,"keydown",(e=>function(e,n,i){if(!(i instanceof KeyboardEvent))return;if(e.querySelector("details[open]"))return;const o=t.get(n);if(!o||o.isComposing)return;const s=i.target instanceof Element&&"SUMMARY"===i.target.tagName;switch(i.key){case"Escape":e.hasAttribute("open")&&(d(e),i.preventDefault(),i.stopPropagation());break;case"ArrowDown":{s&&!e.hasAttribute("open")&&e.setAttribute("open","");const t=r(e,!0);t&&t.focus(),i.preventDefault()}break;case"ArrowUp":{s&&!e.hasAttribute("open")&&e.setAttribute("open","");const t=r(e,!1);t&&t.focus(),i.preventDefault()}break;case"n":if(a&&i.ctrlKey){const t=r(e,!0);t&&t.focus(),i.preventDefault()}break;case"p":if(a&&i.ctrlKey){const t=r(e,!1);t&&t.focus(),i.preventDefault()}break;case" ":case"Enter":{const t=document.activeElement;t instanceof HTMLElement&&u(t)&&t.closest("details")===e&&(i.preventDefault(),i.stopPropagation(),t.click())}}}(s,this,e))),n(s,"toggle",(()=>i(s,this)),{once:!0}),n(s,"toggle",(()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const n=e.closest("details");n&&n!==t&&!n.contains(t)&&n.removeAttribute("open")}}(s))),this.preload?n(s,"mouseover",(()=>i(s,this)),{once:!0}):e,...o(s)];t.set(this,{subscriptions:f,loaded:!1,isComposing:!1})}disconnectedCallback(){const e=t.get(this);if(e){t.delete(this);for(const t of e.subscriptions)t.unsubscribe()}}}const t=new WeakMap,e={unsubscribe(){}};function n(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function i(e,n){const i=n.getAttribute("src");if(!i)return;const o=t.get(n);if(!o)return;if(o.loaded)return;o.loaded=!0;const r=n.querySelector("include-fragment");r&&!r.hasAttribute("src")&&(r.addEventListener("loadend",(()=>s(e))),r.setAttribute("src",i))}function o(t){let e=!1;return[n(t,"mousedown",(()=>e=!0)),n(t,"keydown",(()=>e=!1)),n(t,"toggle",(()=>{t.hasAttribute("open")&&(s(t)||e||function(t){const e=document.activeElement;if(e&&u(e)&&t.contains(e))return;const n=r(t,!0);n&&n.focus()}(t))}))]}function s(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function r(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),i=document.activeElement,o=i instanceof HTMLElement?n.indexOf(i):-1,s=e?n[o+1]:n[o-1],r=e?n[0]:n[n.length-1];return s||r}const a=navigator.userAgent.match(/Macintosh/);function l(t,e){const n=e.target;if(n instanceof Element&&n.closest("details")===t)if("click"===e.type){const e=n.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const i=e.querySelector("input");if("LABEL"===e.tagName&&n===i)return;"LABEL"===e.tagName&&i&&!i.checked||c(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&c(e,t)}}function c(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");if(!n)return;n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(i)n.textContent=i;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=(n===t).toString();e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",i)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&d(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function u(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function d(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function h(e,n){const i=t.get(e);i&&(i.isComposing="compositionstart"===n.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const f=new WeakMap,m=new WeakMap,p=new WeakMap;function b(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=p.get(e)||{};if(!n||!i)return;let o=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?o=-1:"ArrowRight"===t.key&&(o=1);else if(m.has(e)&&t instanceof MouseEvent){const n=m.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(m.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=m.get(e);o=n-r,s=i-a}if(0!==o||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+o),i.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),i.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,T(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)m.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];m.set(e,{dragStartX:n,dragStartY:i})}}function g(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=w(e);if(!(n instanceof ImageCropElement))return;const{box:i}=p.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return y(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,f.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=f.get(n);if(!e)return;s=t.pageX-e.startX-o.left-window.pageXOffset,r=t.pageY-e.startY-o.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=f.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&E(n,s,r,!(t instanceof KeyboardEvent))}function w(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function v(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=w(e);if(!(n instanceof ImageCropElement))return;const{box:i}=p.get(n)||{};if(!i)return;const o=t.target;if(o instanceof HTMLElement)if(o.hasAttribute("data-direction")){const e=o.getAttribute("data-direction")||"";n.addEventListener("mousemove",g),n.addEventListener("touchmove",g,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),f.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),g(t)}else n.addEventListener("mousemove",b),n.addEventListener("touchmove",b,{passive:!0})}function E(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=f.get(t);if(!s)return;const{box:r,image:a}=p.get(t)||{};if(!r||!a)return;o=Math.min(o,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const l=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,c=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${l}px`,r.style.top=`${c}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,T(t,{x:l,y:c,width:o,height:o})}function y(t){const{image:e}=p.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);f.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),E(t,n,n)}function A(t){const e=t.currentTarget;e instanceof ImageCropElement&&(m.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",g),e.removeEventListener("mousemove",b),e.removeEventListener("touchmove",g),e.removeEventListener("touchmove",b))}function T(t,e){const{image:n}=p.get(t)||{};if(!n)return;const i=n.naturalWidth/n.width;for(const n in e){const o=Math.round(e[n]*i);e[n]=o;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=o.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(p.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML='\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: \' \';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class="crop-wrapper">\n <img width="100%" class="crop-image" alt="">\n <div class="crop-container">\n <div data-crop-box class="crop-box">\n <div class="crop-outline"></div>\n <div data-direction="nw" class="handle nw"></div>\n <div data-direction="ne" class="handle ne"></div>\n <div data-direction="sw" class="handle sw"></div>\n <div data-direction="se" class="handle se"></div>\n </div>\n </div>\n</div>\n';const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const n=t.querySelector("img");n instanceof HTMLImageElement&&(p.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,y(this)})),this.addEventListener("mouseleave",A),this.addEventListener("touchend",A),this.addEventListener("mouseup",A),e.addEventListener("mousedown",v),e.addEventListener("touchstart",v,{passive:!0}),this.addEventListener("keydown",b),this.addEventListener("keydown",g),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=p.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}function M(t,e,n,i){var o,s=arguments.length,r=s<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,n,r):o(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function k(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)}function x(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const L={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]},C={start:["end","center"],end:["start","center"],center:["end","start"]};function S(t,e,n={}){const i=function(t){let e=t.parentNode;for(;null!==e;){if(e instanceof HTMLElement&&"static"!==getComputedStyle(e).position)return e;e=e.parentNode}return document.body}(t),o=function(t){let e=t;for(;null!==e&&e!==document.body;){if("visible"!==getComputedStyle(e).overflow)break;e=e.parentNode}const n=e!==document.body&&e instanceof HTMLElement?e:document.body,i=n.getBoundingClientRect(),o=getComputedStyle(n),[s,r,a,l]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:i.top+s,left:i.left+r,width:i.width-a-r,height:Math.max(i.height-s-l,n===document.body?window.innerHeight:-1/0)}}(i),s=getComputedStyle(i),r=i.getBoundingClientRect(),[a,l]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,i,{side:o,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:l}){const c={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=F(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=L[o];let f=0;if(r){let t=o;for(;f<r.length&&P(t,u,c,n);){const o=r[f++];t=o,u=F(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=C[s];let p=0;if(m){let t=s;for(;p<m.length&&$(t,u,c,n);){const o=m[p++];t=o,u=F(n,i,d,o,a,l),u.top-=e.top,u.left-=e.left,h=o}}u.top<c.top&&(u.top=c.top),u.left<c.left&&(u.left=c.left),u.left+n.width>t.width+c.left&&(u.left=t.width+c.left-n.width),r&&f<r.length&&u.top+n.height>t.height+c.top&&(u.top=t.height+c.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(o,{top:r.top+a,left:r.left+l},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,i,o,s;const r=null!==(e=t.side)&&void 0!==e?e:I,a=null!==(n=t.align)&&void 0!==n?n:D;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:H,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?R:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:O}}(n))}const I="outside-bottom",D="start",H=4,R=4,O=!1;function F(t,e,n,i,o,s){const r=e.left+e.width,a=e.top+e.height;let l=-1,c=-1;return"outside-top"===n?l=e.top-o-t.height:"outside-bottom"===n?l=a+o:"outside-left"===n?c=e.left-o-t.width:"outside-right"===n&&(c=r+o),"outside-top"!==n&&"outside-bottom"!==n||(c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?l=e.top+o:"inside-bottom"===n?l=a-o-t.height:"inside-left"===n?c=e.left+o:"inside-right"===n?c=r-o-t.width:"inside-center"===n&&(c=(r+e.left)/2-t.width/2+o),"inside-top"===n||"inside-bottom"===n?c="start"===i?e.left+s:"center"===i?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(l="start"===i?e.top+s:"center"===i?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:l,left:c}}function P(t,e,n,i){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+i.height>n.height+n.top:e.left<n.left||e.left+i.width>n.width+n.left}function $(t,e,n,i){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+i.width>n.left+n.width||e.left<n.left:void 0}function q(t,e=!1){return function*(t,e={}){var n,i;const o=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(i=e.onlyTabbable)&&void 0!==i&&i?W:N,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,o)&&(yield t),e.reverse){let t=r.lastChild();for(;t;)a=t,t=r.lastChild()}else a=r.firstChild();for(;a instanceof HTMLElement;)yield a,a=e.reverse?r.previousNode():r.nextNode();e.reverse&&s(t,o)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function N(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,i=t.hidden,o=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||i||o||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),i=0===t.getClientRects().length;if(e||n||i)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function W(t,e=!1){return N(t,e)&&"-1"!==t.getAttribute("tabindex")}let B=!1;function Y(){}try{const t=Object.create({},{signal:{get(){B=!0}}});window.addEventListener("test",Y,t),window.removeEventListener("test",Y,t)}catch(t){}B||(function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,n,i){return"object"==typeof i&&"signal"in i&&i.signal instanceof AbortSignal&&t.call(i.signal,"abort",(()=>{this.removeEventListener(e,n,i)})),t.call(this,e,n,i)}}(),B=!0);const j=[];let X;function K(t,e,n){const i=new AbortController,o=null!=n?n:i.signal;t.setAttribute("data-focus-trap","active");const s=document.createElement("span");s.setAttribute("class","sentinel"),s.setAttribute("tabindex","0"),s.setAttribute("aria-hidden","true"),s.onfocus=()=>{const e=q(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function l(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&W(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=q(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=q(t);null==e||e.focus()},t.prepend(s),t.append(r);const c=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(o);if(X){const t=X;X.container.setAttribute("data-focus-trap","suspended"),X.controller.abort(),j.push(t)}c.signal.addEventListener("abort",(()=>{X=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=j.findIndex((e=>e.container===t));n>=0&&j.splice(n,1),function(){const t=j.pop();t&&K(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),X={container:t,controller:c,initialFocus:e,originalSignal:o};const u=j.findIndex((e=>e.container===t));if(u>=0&&j.splice(u,1),!n)return i}var V,z,U,Z;function _(t){document.activeElement!==t&&(null==t||t.focus())}const G=[];function J(t){const e=t.target,n=null==e?void 0:e.closest("button");let i=null==n?void 0:n.getAttribute("data-show-dialog-id");if(n&&i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const o=G[G.length-1];if(!o)return;const s=!e.closest(`#${o.getAttribute("id")}`);n?(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(G.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(G.pop(),o.close(!0))):s&&(G.pop(),o.close())}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),V.add(this),z.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,i,o;if(t){if(this.open)return;this.setAttribute("open",""),null===(e=k(this,V,"a",U))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.overflow="hidden",k(this,z,"f").signal.aborted&&x(this,z,new AbortController,"f"),K(this,void 0,k(this,z,"f").signal),G.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=k(this,V,"a",U))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.overflow="initial",k(this,z,"f").abort();const t=(null===(i=this.openButton)||void 0===i?void 0:i.closest("details"))||(null===(o=this.openButton)||void 0===o?void 0:o.closest("action-menu"));_(t?q(t):this.openButton),this.openButton=null}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),document.addEventListener("click",J),this.addEventListener("keydown",(t=>k(this,V,"m",Z).call(this,t)))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}z=new WeakMap,V=new WeakSet,U=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},Z=function(t){if(t instanceof KeyboardEvent&&!t.isComposing)switch(t.key){case"Escape":this.open&&(this.close(),t.preventDefault(),t.stopPropagation())}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));const Q=new WeakSet;function tt(t){it(t),nt(t)}const et=new WeakMap;function nt(t=document){if(et.has(t))return et.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)rt(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&it(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,et.delete(t),n.disconnect()}};return et.set(t,i),i}function it(t){for(const e of t.querySelectorAll("[data-action]"))rt(e);t instanceof Element&&t.hasAttribute("data-action")&&rt(t)}function ot(t){const e=t.currentTarget;for(const n of st(e))if(t.type===n.type){const i=e.closest(n.tag);Q.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&Q.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*st(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),n=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,n),method:e.slice(n+1)||"handleEvent"}||"handleEvent"}}function rt(t){for(const e of st(t))t.addEventListener(e.type,ot)}const at=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),lt=(t,e="property")=>{const n=at(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const ct="attr",ut=new WeakSet;function dt(t,e){if(ut.has(t))return;ut.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=mt(n,ct));for(const n of e){const e=t[n],o=lt(`${i}${n}`);let s={configurable:!0,get(){return this.getAttribute(o)||""},set(t){this.setAttribute(o,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(o)||0)},set(t){this.setAttribute(o,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(o)},set(t){this.toggleAttribute(o,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(o)&&s.set.call(t,e)}}const ht=Symbol.for("catalyst");class ft{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const i=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,i)};const o=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,i){e.attributeChangedCallback(this,t,n,i,o)};let s=t.observedAttributes||[];Object.defineProperty(t,"observedAttributes",{configurable:!0,get(){return e.observedAttributes(this,s)},set(t){s=t}}),function(t){let e=t.observedAttributes||[];const n=t.attrPrefix??"data-",i=t=>lt(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...mt(t.prototype,ct)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=at(t.name).replace(/-element$/,"");try{window.customElements.define(e,t),window[t.name]=customElements.get(e)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),function(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),dt(t),function(t){Q.add(t),t.shadowRoot&&tt(t.shadowRoot),it(t),nt(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&tt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){dt(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function mt(t,e){if(!Object.prototype.hasOwnProperty.call(t,ht)){const e=t[ht],n=t[ht]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[ht];return n.has(e)||n.set(e,new Set),n.get(e)}function pt(t,e){mt(t,"target").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase();if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!i.closest(n))return i;for(const i of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(i.closest(n)===t)return i}(this,e)}})}function bt(t,e){mt(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),i=[];if(t.shadowRoot)for(const o of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)||i.push(o);for(const o of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))o.closest(n)===t&&i.push(o);return i}(this,e)}})}function gt(t){new ft(t)}new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},i=()=>e.abort();document.addEventListener("mousedown",i,n),document.addEventListener("touchstart",i,n),document.addEventListener("keydown",i,n),document.addEventListener("pointerdown",i,n)}));let wt=class NavListElement extends HTMLElement{connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false")}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0:t.getAttribute("aria-expanded"))}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let i;this.showMoreDisabled=!0;try{const t=new URL(this.paginationSrc,window.location.origin);this.currentPage++,t.searchParams.append("page",this.currentPage.toString());const e=await fetch(t);if(!e.ok)return;i=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const o=this.parseHTML(document,i);null===(e=null==o?void 0:o.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(o,this.showMoreItem),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}parseHTML(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)}};var vt,Et;M([pt],wt.prototype,"list",void 0),M([pt],wt.prototype,"showMoreItem",void 0),M([bt],wt.prototype,"focusMarkers",void 0),wt=M([gt],wt);let yt=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),vt.add(this)}connectedCallback(){k(this,vt,"m",Et).call(this)}select(t){var e,n;const i=t.currentTarget;for(const t of this.items)t.classList.remove("SegmentedControl-item--selected"),null===(e=t.querySelector("[aria-current]"))||void 0===e||e.setAttribute("aria-current","false");null===(n=i.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),i.setAttribute("aria-current","true")}};function At(t,e=0,{start:n=!1,middle:i=!1,once:o=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:o=!1}={}){let s,r=0,a=!1;function l(...c){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,c),o&&l.cancel()}),i?e-u:e))}return l.cancel=()=>{clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}vt=new WeakSet,Et=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},M([bt],yt.prototype,"items",void 0),yt=M([gt],yt),window.customElements.get("segmented-control")||(window.SegmentedControlElement=yt,window.customElements.define("segmented-control",yt));let Tt=class ToggleSwitchElement extends HTMLElement{get src(){const t=this.getAttribute("src");if(!t)return null;const e=this.ownerDocument.createElement("a");return e.href=t,e.href}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||null}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}isRemote(){return null!=this.src}toggle(){this.isDisabled()||(this.isRemote()?(this.setLoadingState(),this.submitForm()):this.performToggle())}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-checked","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-checked","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-checked")}isOff(){return!this.isOn()}isDisabled(){return"true"===this.switch.getAttribute("aria-disabled")}disable(){this.switch.setAttribute("aria-disabled","true")}enable(){this.switch.setAttribute("aria-disabled","false")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.disable(),this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden")}setSuccessState(){this.setFinishedState(!1)}setErrorState(){this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden"),this.enable()}async submitForm(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"0":"1");try{if(!this.src)throw new Error("invalid src");(await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})).ok?(this.setSuccessState(),this.performToggle()):this.setErrorState()}catch(t){this.setErrorState()}}};var Mt,kt,xt,Lt,Ct,St,It,Dt,Ht;M([pt],Tt.prototype,"switch",void 0),M([pt],Tt.prototype,"loadingSpinner",void 0),M([pt],Tt.prototype,"errorIcon",void 0),M([function(t=0,e={}){return(n,i,o)=>{if(!o||"function"!=typeof o.value)throw new Error("debounce can only decorate functions");const s=o.value;o.value=At(s,t,e),Object.defineProperty(n,i,o)}}(300)],Tt.prototype,"submitForm",null),Tt=M([gt],Tt),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Tt,window.customElements.define("toggle-switch",Tt));const Rt="tooltip-open",Ot="sr-only",Ft=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Mt.add(this),kt.set(this,void 0),xt.set(this,"center"),Lt.set(this,"outside-bottom"),Ct.set(this,!1)}styles(){return'\n :host {\n position: absolute;\n z-index: 1000000;\n padding: .5em .75em;\n font: normal normal 11px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";\n -webkit-font-smoothing: subpixel-antialiased;\n color: var(--color-fg-on-emphasis);\n text-align: center;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-wrap: break-word;\n white-space: pre;\n background: var(--color-neutral-emphasis-plus);\n border-radius: 6px;\n opacity: 0;\n max-width: 250px;\n word-wrap: break-word;\n white-space: normal;\n width: max-content;\n }\n\n :host:before{\n position: absolute;\n z-index: 1000001;\n color: var(--color-neutral-emphasis-plus);\n content: "";\n border: 6px solid transparent;\n opacity: 0\n }\n\n @keyframes tooltip-appear {\n from {\n opacity: 0\n }\n to {\n opacity: 1\n }\n }\n\n :host:after{\n position: absolute;\n display: block;\n right: 0;\n left: 0;\n height: 12px;\n content: ""\n }\n\n :host(.tooltip-open),\n :host(.tooltip-open):before {\n animation-name: tooltip-appear;\n animation-duration: .1s;\n animation-fill-mode: forwards;\n animation-timing-function: ease-in;\n animation-delay: .4s\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-n):before {\n right: 50%;\n margin-right: -6px;\n }\n\n :host(.tooltip-s):before,\n :host(.tooltip-se):before,\n :host(.tooltip-sw):before {\n bottom: 100%;\n border-bottom-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-s):after,\n :host(.tooltip-se):after,\n :host(.tooltip-sw):after {\n bottom: 100%\n }\n\n :host(.tooltip-n):before,\n :host(.tooltip-ne):before,\n :host(.tooltip-nw):before {\n top: 100%;\n border-top-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-n):after,\n :host(.tooltip-ne):after,\n :host(.tooltip-nw):after {\n top: 100%\n }\n\n :host(.tooltip-se):before,\n :host(.tooltip-ne):before {\n left: 0;\n margin-left: 6px;\n }\n\n :host(.tooltip-sw):before,\n :host(.tooltip-nw):before {\n right: 0;\n margin-right: 6px;\n }\n\n :host(.tooltip-w):before {\n top: 50%;\n bottom: 50%;\n left: 100%;\n margin-top: -6px;\n border-left-color: var(--color-neutral-emphasis-plus)\n }\n\n :host(.tooltip-e):before {\n top: 50%;\n right: 100%;\n bottom: 50%;\n margin-top: -6px;\n border-right-color: var(--color-neutral-emphasis-plus)\n }\n '}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get type(){return"label"===this.getAttribute("data-type")?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return this.getAttribute("data-direction")||"s"}set direction(t){this.setAttribute("data-direction",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}set hiddenFromView(t){this.classList.toggle(Ot,t),this.isConnected&&k(this,Mt,"m",St).call(this)}get hiddenFromView(){return this.classList.contains(Ot)}connectedCallback(){var t;if(k(this,Mt,"m",It).call(this),k(this,Mt,"m",Dt).call(this),!this.shadowRoot){this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}if(this.hiddenFromView=!0,x(this,Ct,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=k(this,kt,"f"))||void 0===t||t.abort(),x(this,kt,new AbortController,"f");const{signal:e}=k(this,kt,"f");this.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("mouseenter",this,{signal:e}),this.control.addEventListener("mouseleave",this,{signal:e}),this.control.addEventListener("focus",this,{signal:e}),this.control.addEventListener("blur",this,{signal:e}),this.ownerDocument.addEventListener("keydown",this,{signal:e}),k(this,Mt,"m",St).call(this)}disconnectedCallback(){var t;null===(t=k(this,kt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hiddenFromView?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hiddenFromView=!0:"keydown"!==t.type||"Escape"!==t.key||this.hiddenFromView||(this.hiddenFromView=!0):this.hiddenFromView=!1)}attributeChangedCallback(t){this.isConnected&&("id"===t||"data-type"===t?k(this,Mt,"m",It).call(this):"data-direction"===t&&k(this,Mt,"m",Dt).call(this))}}kt=new WeakMap,xt=new WeakMap,Lt=new WeakMap,Ct=new WeakMap,Mt=new WeakSet,St=function(){if(this.hiddenFromView)this.classList.remove(Rt,...Ft);else{this.classList.add(Rt);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);k(this,Mt,"m",Ht).call(this)}},It=function(){if(this.id&&this.control)if("label"===this.type){let t=this.control.getAttribute("aria-labelledby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-labelledby",t),this.setAttribute("aria-hidden","true")}else{let t=this.control.getAttribute("aria-describedby");t=t?t.split(" ").includes(this.id)?`${t}`:`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}},Dt=function(){this.classList.remove(...Ft);const t=this.direction;"n"===t?(x(this,xt,"center","f"),x(this,Lt,"outside-top","f")):"ne"===t?(x(this,xt,"start","f"),x(this,Lt,"outside-top","f")):"e"===t?(x(this,xt,"center","f"),x(this,Lt,"outside-right","f")):"se"===t?(x(this,xt,"start","f"),x(this,Lt,"outside-bottom","f")):"s"===t?(x(this,xt,"center","f"),x(this,Lt,"outside-bottom","f")):"sw"===t?(x(this,xt,"end","f"),x(this,Lt,"outside-bottom","f")):"w"===t?(x(this,xt,"center","f"),x(this,Lt,"outside-left","f")):"nw"===t&&(x(this,xt,"end","f"),x(this,Lt,"outside-top","f"))},Ht=function(){if(!this.control)return;if(!k(this,Ct,"f")||this.hiddenFromView)return;this.style.left="0px";const t=S(this,this.control,{side:k(this,Lt,"f"),align:k(this,xt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let i="s";i="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===n?"n":"start"===n?"ne":"nw":"center"===n?"s":"start"===n?"se":"sw",this.classList.add(`tooltip-${i}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let Pt=class XBannerElement extends HTMLElement{dismiss(){if(this.shouldReappear())return this.style.setProperty("visibility","hidden"),void setTimeout((()=>{this.style.setProperty("visibility","visible")}),2e3);const t=this.parentElement;t&&t.removeChild(this)}shouldReappear(){return"true"===this.getAttribute("data-reappear")}};M([pt],Pt.prototype,"titleText",void 0),Pt=M([gt],Pt),window.customElements.get("x-banner")||(window.XBannerElement=Pt,window.customElements.define("x-banner",Pt));const $t=!!navigator.userAgent.match(/Macintosh/);class qt{constructor(t,e){this.input=t,this.list=e,this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=t=>function(t,e){if(t.shiftKey||t.metaKey||t.altKey)return;if(!$t&&t.ctrlKey)return;if(e.isComposing)return;switch(t.key){case"Enter":case"Tab":(function(t,e){const n=e.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||n.click(),!0)})(e.input,e.list)&&t.preventDefault();break;case"Escape":e.clearSelection();break;case"ArrowDown":e.navigate(1),t.preventDefault();break;case"ArrowUp":e.navigate(-1),t.preventDefault();break;case"n":$t&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":$t&&t.ctrlKey&&(e.navigate(-1),t.preventDefault());break;default:if(t.ctrlKey)break;e.clearSelection()}}(t,this),this.compositionEventHandler=t=>function(t,e){e.isComposing="compositionstart"===t.type;if(!document.getElementById(e.input.getAttribute("aria-controls")||""))return;e.clearSelection()}(t,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Nt)}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Nt)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Wt)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Wt),i=n.indexOf(e);if(i===n.length-1&&1===t||0===i&&-1===t)return this.clearSelection(),void this.input.focus();let o=1===t?0:n.length-1;if(e&&i>=0){const e=i+t;e>=0&&e<n.length&&(o=e)}const s=n[o];if(s)for(const t of n)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),Bt(this.list,s)):t.setAttribute("aria-selected","false")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.setAttribute("aria-selected","false")}}function Nt(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(e)}function Wt(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Bt(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;return o>=n&&s<=i})(t,e)||(t.scrollTop=e.offsetTop)}const Yt=window.testScreenReaderDelay||100;class jt{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new qt(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=document.getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=n.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const t=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(null==t?void 0:t.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.hidden=!0,this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),null===(o=this.clearButton)||void 0===o||o.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),"true"===this.input.getAttribute("aria-expanded")&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.container.open=!1}onKeydown(t){if("Enter"===t.key&&this.container.open&&this.autoselectEnabled){const e=this.results.children[0];e&&(t.stopPropagation(),t.preventDefault(),this.onCommit({target:e}))}if("Escape"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowUp"===t.key&&this.container.open)this.container.open=!1,t.stopPropagation(),t.preventDefault();else if(t.altKey&&"ArrowDown"===t.key&&!this.container.open){if(!this.input.value.trim())return;this.container.open=!0,t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement))return;if(this.container.open=!1,e instanceof HTMLAnchorElement)return;const n=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=n,n||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout((()=>{this.feedback&&(this.feedback.textContent=t)}),Yt)}fetchResults(){const t=this.input.value.trim();if(!t)return void(this.container.open=!1);const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=this.results.querySelectorAll('[role="option"]'),n=!!e.length,i=e.length,[o]=e,s=null==o?void 0:o.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${i} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${i||"No"} results.`),this.container.open=n,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))})).catch((()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))}))}open(){this.results.hidden&&(this.combobox.start(),this.results.hidden=!1)}close(){this.results.hidden||(this.combobox.stop(),this.results.hidden=!0)}}class Xt extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const Kt=new WeakMap;function Vt(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=Kt.get(t);n&&n.abort();Kt.set(t,e);const i=()=>Kt.delete(t),o=function(t){return new Promise(((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()}))}(e);return o.then(i,i),o}(t,n)}const zt=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=Vt}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);if(!(e instanceof HTMLInputElement&&n))return;const i="true"===this.getAttribute("data-autoselect");zt.set(this,new jt(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=zt.get(this);t&&(t.destroy(),zt.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=zt.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new Xt("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function Ut(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.textContent);const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const n=document.createRange();return n.selectNodeContents(t),e.addRange(n),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function Zt(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const n=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(t);return e.appendChild(n),Ut(n),e.removeChild(n),Promise.resolve()}function _t(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)Zt(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?Zt(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?Zt(o.href):Ut(o)).then(i)}var o}function Gt(t){const e=t.currentTarget;e instanceof HTMLElement&&_t(e)}function Jt(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),_t(e))}}function Qt(t){t.currentTarget.addEventListener("keydown",Jt)}function te(t){t.currentTarget.removeEventListener("keydown",Jt)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Gt),this.addEventListener("focus",Qt),this.addEventListener("blur",te)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement));function ee(t){t.style.display="inline-block"}function ne(t){t.style.display="none"}const ie=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=ie.get(t);e?(clearTimeout(e),ie.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ne(e),ee(n))}(t),ie.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ee(e),ne(n))}(t),ie.delete(t)}),2e3))}));const oe=["second","minute","hour","day","month","year"];const se=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/;class re{constructor(t=0,e=0,n=0,i=0,o=0,s=0,r=0){this.years=t,this.months=e,this.weeks=n,this.days=i,this.hours=o,this.minutes=s,this.seconds=r}abs(){return new re(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds))}static from(t){var e;if("string"==typeof t){const n=String(t).trim(),i=n.startsWith("-")?-1:1,o=null===(e=n.match(se))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new re(...o):new re}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a}=t;return new re(e,n,i,o,s,r,a)}throw new RangeError("invalid duration")}}function ae(t,e,n){const i=function(t,e){const n=new Date(t);return n.setFullYear(n.getFullYear()+e.years),n.setMonth(n.getMonth()+e.months),n.setDate(n.getDate()+7*e.weeks+e.days),n.setHours(n.getHours()+e.hours),n.setMinutes(n.getMinutes()+e.minutes),n.setSeconds(n.getSeconds()+e.seconds),n}(t,re.from(n).abs());return!i||Math.abs(Number(i)-Number(t))>Math.abs(Number(t)-Number(e))}var le,ce,ue,de,he,fe,me,pe=function(t,e,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(t):i?i.value:e.get(t)},be=function(t,e,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(t,n):o?o.value=n:e.set(t,n),n};const ge=("undefined"!=typeof globalThis?globalThis:window).HTMLElement||null;class we extends Event{constructor(t,e,n,i){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=n,this.newTitle=i}}function ve(t){if(!t.date)return 1/0;if("elapsed"===t.format){const e=t.precision;if("second"===e)return 1e3;if("minute"===e)return 6e4}const e=Math.abs(Date.now()-t.date.getTime());return e<6e4?1e3:e<36e5?6e4:36e5}const Ee=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(t){if(this.elements.has(t))return;this.elements.add(t);const e=t.date;if(e&&e.getTime()){const e=ve(t),n=Date.now()+e;n<this.time&&(clearTimeout(this.timer),this.timer=setTimeout((()=>this.update()),e),this.time=n)}}unobserve(t){this.elements.has(t)&&this.elements.delete(t)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let t=1/0;for(const e of this.elements)t=Math.min(t,ve(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends ge{constructor(){super(...arguments),le.add(this),ce.set(this,!1),ue.set(this,!1),he.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this)}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","datetime","lang","title"]}get second(){const t=this.getAttribute("second");if("numeric"===t||"2-digit"===t)return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if("numeric"===t||"2-digit"===t)return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if("numeric"===t||"2-digit"===t)return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");if("long"===t||"short"===t||"narrow"===t)return t}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=null!==(t=this.getAttribute("day"))&&void 0!==t?t:"numeric";if("numeric"===e||"2-digit"===e)return e}set day(t){this.setAttribute("day",t||"")}get month(){var t;const e=null!==(t=this.getAttribute("month"))&&void 0!==t?t:"short";if("numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e)return e}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");return"numeric"===e||"2-digit"===e?e:this.hasAttribute("year")||(new Date).getUTCFullYear()===(null===(t=this.date)||void 0===t?void 0:t.getUTCFullYear())?void 0:"numeric"}set year(t){this.setAttribute("day",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if("long"===t||"short"===t||"shortOffset"===t||"longOffset"===t||"shortGeneric"===t||"longGeneric"===t)return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return null!==(t=this.getAttribute("prefix"))&&void 0!==t?t:"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,se.test(e))?t:"P30D";var e}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return"past"===t?"past":"future"===t?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return oe.includes(t)?t:"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(null==t?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){Ee.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&be(this,ce,null!==n&&pe(this,le,"m",fe).call(this)!==n,"f"),pe(this,ue,"f")||"title"===t&&pe(this,ce,"f")||be(this,ue,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=pe(this,he,"f").textContent||"",e=this.getAttribute("title")||"";let n=e,i=t;const o=new Date;pe(this,ce,"f")||(n=pe(this,le,"m",fe).call(this)||"",n&&this.setAttribute("title",n)),i=pe(this,le,"m",me).call(this,o)||"",i?pe(this,he,"f").textContent=i:this.shadowRoot===pe(this,he,"f")&&this.textContent&&(pe(this,he,"f").textContent=this.textContent),i===t&&n===e||this.dispatchEvent(new we(t,i,e,n));const s=this.date,r=this.format,a=("auto"===r||"micro"===r)&&s&&ae(o,s,this.threshold);"elapsed"===r||a?Ee.observe(this):Ee.unobserve(this),be(this,ue,!1,"f")}}ce=new WeakMap,ue=new WeakMap,he=new WeakMap,le=new WeakSet,de=function(){var t,e;return null!==(e=null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))&&void 0!==e?e:"default"},fe=function(){const t=this.date;if(t&&"undefined"!=typeof Intl&&Intl.DateTimeFormat)return new Intl.DateTimeFormat(pe(this,le,"a",de),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},me=function(t=new Date){const e=this.date;if(!e)return;const n=this.format;if("elapsed"===n){const t=oe.indexOf(this.precision)||0;return function(t){const e=Math.abs(t.getTime()-(new Date).getTime()),n=Math.floor(e/1e3),i=Math.floor(n/60),o=Math.floor(i/60),s=Math.floor(o/24),r=Math.floor(s/30),a=Math.floor(r/12),l=[];return a&&l.push([a,"year"]),r-12*a&&l.push([r-12*a,"month"]),s-30*r&&l.push([s-30*r,"day"]),o-24*s&&l.push([o-24*s,"hour"]),i-60*o&&l.push([i-60*o,"minute"]),n-60*i&&l.push([n-60*i,"second"]),l}(e).filter((e=>oe.indexOf(e[1])>=t)).map((([t,e])=>`${t}${e[0]}`)).join(" ")||`0${this.precision[0]}`}const i=this.tense,o="micro"===n,s=t.getTime()<e.getTime(),r=ae(t,e,this.threshold),a=pe(this,le,"a",de);if("undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const t=new Intl.RelativeTimeFormat(a,{numeric:"auto"});if("past"===i||"auto"===i&&!s&&r){const[n,i]=o?function(t){const e=(new Date).getTime()-t.getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return i<1?[1,"minute"]:i<60?[i,"minute"]:o<24?[o,"hour"]:s<365?[s,"day"]:[a,"year"]}(e):function(t){const e=(new Date).getTime()-t.getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return e<0||n<10?[0,"second"]:n<45?[-n,"second"]:n<90||i<45?[-i,"minute"]:i<90||o<24?[-o,"hour"]:o<36||s<30?[-s,"day"]:r<18?[-r,"month"]:[-a,"year"]}(e);return o?`${n}${i[0]}`:t.format(n,i)}if("future"===i||"auto"===i&&s&&r){const[n,i]=o?function(t){const e=t.getTime()-(new Date).getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return s>=365?[a,"year"]:o>=24?[s,"day"]:i>=60?[o,"hour"]:i>1?[i,"minute"]:[1,"minute"]}(e):function(t){const e=t.getTime()-(new Date).getTime(),n=Math.round(e/1e3),i=Math.round(n/60),o=Math.round(i/60),s=Math.round(o/24),r=Math.round(s/30),a=Math.round(r/12);return r>=18||r>=12?[a,"year"]:s>=45||s>=30?[r,"month"]:o>=36||o>=24?[s,"day"]:i>=90||i>=45?[o,"hour"]:n>=90||n>=45?[i,"minute"]:n>=10?[n,"second"]:[0,"second"]}(e);return o?`${n}${i[0]}`:t.format(n,i)}}if("undefined"==typeof Intl||!Intl.DateTimeFormat)return;const l=new Intl.DateTimeFormat(a,{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${l.format(e)}`.trim()};const ye="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",RelativeTimeElement),ye.RelativeTimeElement=RelativeTimeElement}catch(t){if(!(ye.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Ae(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Ae(this),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[o,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(o.some((e=>t.code===e))){let t=i+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=i-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Ae(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const i=e.indexOf(n);this.selectTab(i)}))}connectedCallback(){for(const t of Ae(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=Ae(this),n=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const i=e[t],o=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:o}}))){for(const t of e)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of n)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");i.setAttribute("aria-selected","true"),i.setAttribute("tabindex","0"),i.focus(),o.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:o}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));let Te=class PrimerMultiInputElement extends HTMLElement{activateField(t){var e,n;const i=this.findField(t);if(i){for(const t of this.fields)t!==i&&(t.setAttribute("disabled","disabled"),t.setAttribute("hidden","hidden"),null===(e=t.parentElement)||void 0===e||e.setAttribute("hidden","hidden"));i.removeAttribute("disabled"),i.removeAttribute("hidden"),null===(n=i.parentElement)||void 0===n||n.removeAttribute("hidden")}}findField(t){for(const e of this.fields)if(e.getAttribute("data-name")===t)return e;return null}};function Me(t,e=0,{start:n=!1,middle:i=!1,once:o=!1}={}){return function(t,e=0,{start:n=!0,middle:i=!0,once:o=!1}={}){var s,r=0,a=!1,l=function l(...c){if(!a){var u=Date.now()-r;r=Date.now(),n?(n=!1,t(...c),o&&l.cancel()):(i&&u<e||!i)&&(clearTimeout(s),s=setTimeout((function(){r=Date.now(),t(...c),o&&l.cancel()}),i?e-u:e))}};return l.cancel=function(){clearTimeout(s),a=!0},l}(t,e,{start:n,middle:i,once:o})}M([bt],Te.prototype,"fields",void 0),Te=M([gt],Te),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:Te}),window.customElements.define("primer-multi-input",Te));const ke=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=Me(Le.bind(null,this),300),n={check:e,controller:null};ke.set(this,n),t.addEventListener("input",xe),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=ke.get(this);e&&(ke.delete(this),t.removeEventListener("input",xe),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}static get observedAttributes(){return["required"]}get input(){return this.querySelector("input")}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}set csrfField(t){this.setAttribute("csrf-field",t)}}function xe(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const n=e.closest("auto-check");if(!(n instanceof AutoCheckElement))return;const i=n.src,o=n.csrf,s=ke.get(n);if(!i||!o||!s)return;let r="Verifying…";e.dispatchEvent(new CustomEvent("auto-check-start",{bubbles:!0,detail:{setValidity:t=>r=t}})),n.required&&e.setCustomValidity(r)}async function Le(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=ke.get(t);if(!i||!o||!s)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const r=new FormData;r.append(n,o),r.append("value",e.value),e.dispatchEvent(new CustomEvent("auto-check-send",{bubbles:!0,detail:{body:r}})),s.controller?s.controller.abort():t.dispatchEvent(new CustomEvent("loadstart")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};try{const n=await async function(t,e,n){try{const i=await fetch(e,n);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(e){throw"AbortError"!==e.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),e}}(t,i,{credentials:"same-origin",signal:s.controller.signal,method:"POST",body:r});n.ok?function(t,e,n){n&&e.setCustomValidity("");e.dispatchEvent(new CustomEvent("auto-check-success",{bubbles:!0,detail:{response:t.clone()}}))}(n,e,t.required):function(t,e,n){let i="Validation failed";const o=t=>i=t;e.dispatchEvent(new CustomEvent("auto-check-error",{bubbles:!0,detail:{response:t.clone(),setValidity:o}})),n&&e.setCustomValidity(i)}(n,e,t.required),s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0}))}catch(t){"AbortError"!==t.name&&(s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0})))}}var Ce;window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));let Se=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),Ce.set(this,void 0)}connectedCallback(){var t;null===(t=k(this,Ce,"f"))||void 0===t||t.abort();const{signal:e}=x(this,Ce,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(t=>{t.detail.response.text().then((t=>{this.setError(t)}))}),{signal:e})}disconnectedCallback(){var t;null===(t=k(this,Ce,"f"))||void 0===t||t.abort()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.innerText=""}setError(t){this.validationMessageElement.innerText=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};Ce=new WeakMap,M([pt],Se.prototype,"inputElement",void 0),M([pt],Se.prototype,"validationElement",void 0),M([pt],Se.prototype,"validationMessageElement",void 0),Se=M([gt],Se)}();
|
2
|
+
//# sourceMappingURL=primer_view_components.js.map
|