primer_view_components 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/app/assets/javascripts/primer_view_components.js +1 -1
  4. data/app/assets/javascripts/primer_view_components.js.map +1 -1
  5. data/app/assets/styles/primer_view_components.css +2 -2
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/action_list/heading.html.erb +1 -1
  8. data/app/components/primer/alpha/action_list/heading.rb +5 -3
  9. data/app/components/primer/alpha/action_list/item.html.erb +9 -0
  10. data/app/components/primer/alpha/action_list/item.rb +31 -10
  11. data/app/components/primer/alpha/action_list.css +1 -1
  12. data/app/components/primer/alpha/action_list.css.json +4 -41
  13. data/app/components/primer/alpha/action_list.css.map +1 -1
  14. data/app/components/primer/alpha/action_list.pcss +19 -20
  15. data/app/components/primer/alpha/action_list.rb +54 -6
  16. data/app/components/primer/alpha/action_menu/action_menu_element.d.ts +22 -0
  17. data/app/components/primer/alpha/action_menu/action_menu_element.js +139 -0
  18. data/app/components/primer/alpha/action_menu/action_menu_element.ts +137 -0
  19. data/app/components/primer/alpha/action_menu/list.rb +81 -0
  20. data/app/components/primer/alpha/action_menu.html.erb +26 -0
  21. data/app/components/primer/alpha/action_menu.rb +322 -0
  22. data/app/components/primer/alpha/auto_complete.css.json +0 -11
  23. data/app/components/primer/alpha/banner.css.json +0 -14
  24. data/app/components/primer/alpha/button_marketing.css.json +0 -10
  25. data/app/components/primer/alpha/dialog.css.json +0 -63
  26. data/app/components/primer/alpha/dialog.rb +6 -2
  27. data/app/components/primer/alpha/dropdown.css.json +0 -21
  28. data/app/components/primer/alpha/layout.css.json +0 -27
  29. data/app/components/primer/alpha/menu.css.json +0 -11
  30. data/app/components/primer/alpha/nav_list/item.rb +5 -0
  31. data/app/components/primer/alpha/overlay.css +1 -1
  32. data/app/components/primer/alpha/overlay.css.json +0 -3
  33. data/app/components/primer/alpha/overlay.css.map +1 -1
  34. data/app/components/primer/alpha/overlay.pcss +1 -0
  35. data/app/components/primer/alpha/overlay.rb +14 -18
  36. data/app/components/primer/alpha/segmented_control.css.json +0 -15
  37. data/app/components/primer/alpha/tab_nav.css.json +0 -10
  38. data/app/components/primer/alpha/text_field.css.json +0 -38
  39. data/app/components/primer/alpha/toggle_switch.css.json +0 -16
  40. data/app/components/primer/alpha/underline_nav.css.json +0 -13
  41. data/app/components/primer/beta/avatar.css.json +0 -14
  42. data/app/components/primer/beta/avatar_stack.css.json +0 -9
  43. data/app/components/primer/beta/blankslate.css.json +0 -12
  44. data/app/components/primer/beta/border_box.css.json +0 -32
  45. data/app/components/primer/beta/border_box.rb +3 -3
  46. data/app/components/primer/beta/breadcrumbs.css.json +0 -4
  47. data/app/components/primer/beta/button.css +1 -1
  48. data/app/components/primer/beta/button.css.json +0 -22
  49. data/app/components/primer/beta/button.css.map +1 -1
  50. data/app/components/primer/beta/button.pcss +3 -3
  51. data/app/components/primer/beta/counter.css.json +0 -6
  52. data/app/components/primer/beta/flash.css.json +0 -15
  53. data/app/components/primer/beta/label.css.json +0 -20
  54. data/app/components/primer/beta/link.css.json +0 -8
  55. data/app/components/primer/beta/popover.css.json +0 -18
  56. data/app/components/primer/beta/progress_bar.css.json +0 -6
  57. data/app/components/primer/beta/state.css.json +0 -10
  58. data/app/components/primer/beta/subhead.css.json +0 -8
  59. data/app/components/primer/beta/timeline_item.css.json +0 -9
  60. data/app/components/primer/beta/truncate.css.json +0 -6
  61. data/app/components/primer/focus_group.d.ts +19 -0
  62. data/app/components/primer/focus_group.js +144 -0
  63. data/app/components/primer/focus_group.ts +137 -0
  64. data/app/components/primer/icon_button.rb +1 -1
  65. data/app/components/primer/primer.d.ts +2 -0
  66. data/app/components/primer/primer.js +2 -0
  67. data/app/components/primer/primer.ts +2 -0
  68. data/app/components/primer/truncate.css.json +0 -7
  69. data/app/lib/primer/css/layout.css.json +0 -263
  70. data/app/lib/primer/css/utilities.css.json +0 -1636
  71. data/lib/primer/static/generate_arguments.rb +55 -0
  72. data/lib/primer/static/generate_audited_at.rb +17 -0
  73. data/lib/primer/static/generate_constants.rb +19 -0
  74. data/lib/primer/static/generate_info_arch.rb +156 -0
  75. data/lib/primer/static/generate_previews.rb +45 -0
  76. data/lib/primer/static/generate_statuses.rb +17 -0
  77. data/lib/primer/static.rb +72 -0
  78. data/lib/primer/view_components/linters/disallow_component_css_counter.rb +43 -4
  79. data/lib/primer/view_components/version.rb +1 -1
  80. data/lib/primer/view_components.rb +0 -48
  81. data/lib/primer/yard/component_manifest.rb +1 -0
  82. data/lib/primer/yard/component_ref.rb +14 -0
  83. data/lib/primer/yard/docs_helper.rb +3 -0
  84. data/lib/primer/yard/info_arch_docs_helper.rb +31 -0
  85. data/lib/primer/yard/legacy_gatsby_backend.rb +3 -35
  86. data/lib/primer/yard/registry.rb +2 -1
  87. data/lib/primer/yard.rb +1 -0
  88. data/lib/tasks/docs.rake +10 -12
  89. data/lib/tasks/static.rake +20 -28
  90. data/previews/primer/alpha/action_list_preview.rb +4 -1
  91. data/previews/primer/alpha/action_menu_preview/align_end.html.erb +6 -0
  92. data/previews/primer/alpha/action_menu_preview/opens_dialog.html.erb +21 -0
  93. data/previews/primer/alpha/action_menu_preview.rb +238 -0
  94. data/previews/primer/alpha/dialog_preview/body_has_scrollbar_overflow.html.erb +2 -2
  95. data/previews/primer/alpha/dialog_preview/custom_header.html.erb +3 -3
  96. data/previews/primer/alpha/dialog_preview/nested_dialog.html.erb +4 -4
  97. data/previews/primer/alpha/dialog_preview/test.html.erb +3 -3
  98. data/previews/primer/alpha/dialog_preview/with_footer.html.erb +3 -3
  99. data/previews/primer/alpha/dialog_preview/with_form.html.erb +1 -1
  100. data/previews/primer/alpha/dialog_preview/with_text_input.html.erb +2 -2
  101. data/previews/primer/alpha/dialog_preview.rb +7 -2
  102. data/previews/primer/beta/auto_complete_item_preview.rb +1 -0
  103. data/static/arguments.json +3078 -1404
  104. data/static/audited_at.json +2 -0
  105. data/static/classes.json +576 -311
  106. data/static/constants.json +42 -2
  107. data/static/info_arch.json +8859 -0
  108. data/static/previews.json +221 -101
  109. data/static/statuses.json +2 -0
  110. metadata +23 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 95202a9f56eb3628d554ce3b16f89042465dd91ad9fb4a08df6ab20b18240a93
4
- data.tar.gz: 70a7b1e0f4fa4955f007f52ffaca6a5eb18338daebe49ed223189cc652a2e50e
3
+ metadata.gz: c8bb5a4a20bf830d8e922bc7ee73b64a8e404e3ad0c93a76a167a8788d57a2e8
4
+ data.tar.gz: 1c12885ef0e6e9ca6b95f7d686f592ce0cf6850c3b2947ff1de8914a551e7bf1
5
5
  SHA512:
6
- metadata.gz: 9edab351da16983c31fee3178b81abcf69347c506dc3bead36bc3529cbc8a3bc8a3b795f18b5de56a7f54741b9ad82aa10fe6e2c35443510a7e9db2fd01c4aed
7
- data.tar.gz: a54dee217b6d46790bc06a58007bd0608042ea1e7d123fb6cd6debd5abb3274b38184d4a5a4318d4f95b7fa43271672e6658837ff473d1199ddc7c274b04fd63
6
+ metadata.gz: b32c39a81de35fc9ac6d42ffec980d0a147103e413d1a1e6515c95181860fb74c5b44b1a552afccf8d67c3ad707fce25b3b41b84dbb040d6e2adba1c4e8d1acf
7
+ data.tar.gz: 595b1bc9fc92c6a03dffaa50a6e2d42539d615f746877de4878d902690ce7f93c8dec4cdb37960c675de1d389035ecf997e8201f6887f123d9e782729cf16602
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1830](https://github.com/primer/view_components/pull/1830) [`d7e4f5d0`](https://github.com/primer/view_components/commit/d7e4f5d0d029a838696a16b0d85f928fe8b9268a) Thanks [@langermank](https://github.com/langermank)! - ActionMenu upstream from Experimental
8
+
9
+ * [#1903](https://github.com/primer/view_components/pull/1903) [`bb627a21`](https://github.com/primer/view_components/commit/bb627a21b0df7a109cbb939dbf8c171a368670bc) Thanks [@joelhawksley](https://github.com/joelhawksley)! - Migrate usage of old Slots API in previews.
10
+
11
+ - [#1900](https://github.com/primer/view_components/pull/1900) [`9cd530ee`](https://github.com/primer/view_components/commit/9cd530eece6284848c4d7f9b0c8f1cd4e71537b0) Thanks [@keithamus](https://github.com/keithamus)! - Add the ability to pass an icon to Dialog `with_show_button`, which will turn it from a Beta::Button to a Beta::IconButton.
12
+
13
+ * [#1932](https://github.com/primer/view_components/pull/1932) [`5602fbbb`](https://github.com/primer/view_components/commit/5602fbbbc5783ba88f075d972c00082109da7e84) Thanks [@joelhawksley](https://github.com/joelhawksley)! - Fix use of removed slots API in docs.
14
+
15
+ - [#1907](https://github.com/primer/view_components/pull/1907) [`c691fbeb`](https://github.com/primer/view_components/commit/c691fbeb6e65f1a4fc420933123a44664a6a4f5d) Thanks [@neall](https://github.com/neall)! - Fix up reserved CSS class linter
16
+
3
17
  ## 0.1.4
4
18
 
5
19
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- !function(){"use strict";var t=new Set,e=new Set,n=["popoverToggleTarget","popoverShowTarget","popoverHideTarget"],i=["button",'input[type="button"]','input[type="submit"]','input[type="image"]','input[type="reset"]'].flatMap((t=>n.map((e=>`${t}[${e}]`)))).join(", "),o=new WeakMap;function*s(n){if(t.has(n))for(const t of e)r(t)===n&&(yield t)}function r(t){return t.popoverToggleTargetElement||t.popoverShowTargetElement||t.popoverHideTargetElement}function a(t){o.has(t)||o.set(t,t.getAttribute("aria-expanded"));const n=r(t);if(n?e.add(t):e.delete(t),n&&"auto"===n.popover)t.setAttribute("aria-expanded",String(n.classList.contains(":open")));else{const e=o.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}function*l(t){if(t instanceof HTMLElement&&t.hasAttribute("popover")&&(yield t),t instanceof Document||t instanceof ShadowRoot||t instanceof HTMLElement)for(const e of t.querySelectorAll("[popover]"))e instanceof HTMLElement&&(yield e)}function*c(t){if((t instanceof HTMLInputElement||t instanceof HTMLButtonElement)&&t.matches(i)&&(yield t),t instanceof Document||t instanceof ShadowRoot||t instanceof HTMLElement)for(const e of t.querySelectorAll(i))(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&(yield e)}var u=new MutationObserver((n=>{n.forEach((n=>{switch(n.type){case"attributes":switch(n.attributeName){case"popover":(e=>{const n=e.target;n instanceof HTMLElement&&(n.hasAttribute("popover")?t.add(n):t.delete(n))})(n);break;default:(t=>{const e=t.target;(e instanceof HTMLButtonElement||e instanceof HTMLInputElement)&&a(e)})(n)}break;case"childList":(n=>{for(const e of n.addedNodes){for(const t of c(e))a(t);for(const n of l(e))t.add(n)}for(const i of n.removedNodes){for(const t of c(i))e.delete(t);for(const e of l(i))t.delete(e)}})(n)}}))})),d=e=>{if(e===document){for(const n of l(e))t.add(n);for(const t of c(e))a(t)}u.observe(e,{attributeFilter:["popover",...n],childList:!0,subtree:!0})};function h(t){const e=Element.prototype.attachShadow;Element.prototype.attachShadow=function(n){const i=e.call(this,n);return t(i),i}}var f=(t,e)=>{const n=e.closest(t);if(n)return n;const i=e.getRootNode();return i!==document&&i instanceof ShadowRoot?f(t,i.host):null},m=(t,e,n=[])=>{const i=f(e,t),o=i?.parentElement||i?.getRootNode()?.host;return i&&o?m(o,e,[i,...n]):n};"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){const e=new WeakSet;function n(t,n){if(!function(t,n){return!("auto"!==t.popover&&"manual"!==t.popover||!t.isConnected||t instanceof HTMLDialogElement&&t.hasAttribute("open")||n&&!e.has(t)||!n&&e.has(t)||document.fullscreenElement===t)}(t,n))throw new DOMException("Cannot show or hide popover on invalid or already visible element","InvalidStateError")}class o extends Event{constructor(t,{currentState:e="",newState:n="",...i}={}){super(t,i),this.currentState=String(e||""),this.newState=String(n||"")}}window.BeforeToggleEvent=window.BeforeToggleEvent||o,Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popover")||"").toLowerCase();return"manual"===t?"manual":""===t||"auto"==t?"auto":null},set(t){this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){n(this,!1);const t=new o("beforetoggle",{cancelable:!0,currentState:"closed",newState:"open"});if(this.dispatchEvent(t)&&(n(this,!1),this.classList.add(":open"),e.add(this),"auto"===this.popover)){(this.hasAttribute("autofocus")?this:this.querySelector("[autofocus]"))?.focus();for(const t of s(this))a(t)}}},hidePopover:{enumerable:!0,configurable:!0,value(){if(n(this,!0),this.dispatchEvent(new o("beforetoggle",{cancelable:!1,currentState:"open",newState:"closed"})),n(this,!0),this.classList.remove(":open"),e.delete(this),"auto"===this.popover)for(const t of s(this))a(t)}}});const r=t=>{const e=new WeakMap,n={set(n){if(null===n)this.removeAttribute(t.toLowerCase()),e.delete(this);else{if(!(n instanceof Element))throw new TypeError(`${t}Element must be an element or null`);this.setAttribute(t.toLowerCase(),""),e.set(this,n)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const n=e.get(this);if(n?.isConnected||e.delete(this),n)return n;const i=this.getRootNode(),o=this.getAttribute(t.toLowerCase());return(i instanceof Document||i instanceof ShadowRoot)&&o&&i.getElementById(o)||null}};Object.defineProperty(HTMLButtonElement.prototype,`${t}Element`,n),Object.defineProperty(HTMLInputElement.prototype,`${t}Element`,n)};r("popoverToggleTarget"),r("popoverShowTarget"),r("popoverHideTarget");const l=(c=n=>{const o=n.target;if(!(o instanceof Element)||o?.shadowRoot)return;const s=o.getRootNode();if(!(s instanceof ShadowRoot||s instanceof Document))return;const r=(t=>{if(!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement))return;let n=null;return t.popoverToggleTargetElement?(n=t.popoverToggleTargetElement,n&&(e.has(n)?n.hidePopover():n.showPopover())):t.popoverShowTargetElement?(n=t.popoverShowTargetElement,n?.showPopover()):t.popoverHideTargetElement&&(n=t.popoverHideTargetElement,n?.hidePopover()),n})(o.closest(i));for(const e of[...t])e.matches('[popover="" i].\\:open, [popover=auto i].\\:open')&&e!==r&&!m(o,"[popover]").includes(e)&&e.hidePopover()},t=>{t.addEventListener("click",c)});var c;d(document),l(document),h(d),h(l)}();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 t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const n=[g(t,"compositionstart",(t=>S(this,t))),g(t,"compositionend",(t=>S(this,t))),g(t,"click",(e=>T(t,e))),g(t,"change",(e=>T(t,e))),g(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=p.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(k(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=E(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=E(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(A&&n.ctrlKey){const e=E(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(A&&n.ctrlKey){const e=E(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&M(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),g(t,"toggle",(()=>w(t,this)),{once:!0}),g(t,"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")}}(t))),this.preload?g(t,"mouseover",(()=>w(t,this)),{once:!0}):b,...v(t)];p.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=p.get(this);if(t){p.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const p=new WeakMap,b={unsubscribe(){}};function g(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function w(t,e){const n=e.getAttribute("src");if(!n)return;const i=p.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>y(t))),o.setAttribute("src",n))}function v(t){let e=!1;return[g(t,"mousedown",(()=>e=!0)),g(t,"keydown",(()=>e=!1)),g(t,"toggle",(()=>{t.hasAttribute("open")&&(y(t)||e||function(t){const e=document.activeElement;if(e&&M(e)&&t.contains(e))return;const n=E(t,!0);n&&n.focus()}(t))}))]}function y(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function E(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 T(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||L(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&L(e,t)}}function L(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")&&k(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function M(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function k(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function S(t,e){const n=p.get(t);n&&(n.isComposing="compositionstart"===e.type)}function C(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 x(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 I(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("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const D={"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"]},H={start:["end","center"],end:["start","center"],center:["end","start"]};function O(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=W(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=D[o];let f=0;if(r){let t=o;for(;f<r.length&&N(t,u,c,n);){const o=r[f++];t=o,u=W(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=H[s];let p=0;if(m){let t=s;for(;p<m.length&&B(t,u,c,n);){const o=m[p++];t=o,u=W(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:R,a=null!==(n=t.align)&&void 0!==n?n:P;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:F,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?$:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:q}}(n))}const R="outside-bottom",P="start",F=4,$=4,q=!1;function W(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 N(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 B(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 j(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?X:Y,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 Y(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 X(t,e=!1){return Y(t,e)&&"-1"!==t.getAttribute("tabindex")}let K=!1;function V(){}try{const t=Object.create({},{signal:{get(){K=!0}}});window.addEventListener("test",V,t),window.removeEventListener("test",V,t)}catch(t){}K||(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)}}(),K=!0);const z=[];let U;function Z(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=j(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&&X(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=j(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=j(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(U){const t=U;U.container.setAttribute("data-focus-trap","suspended"),U.controller.abort(),z.push(t)}c.signal.addEventListener("abort",(()=>{U=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=z.findIndex((e=>e.container===t));n>=0&&z.splice(n,1),function(){const t=z.pop();t&&Z(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),U={container:t,controller:c,initialFocus:e,originalSignal:o};const u=z.findIndex((e=>e.container===t));if(u>=0&&z.splice(u,1),!n)return i}var _,G;const J=(()=>{const t=new Set;let e=null,n=null;function i(){for(const e of t)e.update()}return o=>{window.addEventListener("resize",i),e||(e=new IntersectionObserver((e=>{for(const n of e){const e=n.target;n.isIntersecting?(e.update(),t.add(e)):t.delete(e)}}))),n||(n=new ResizeObserver((()=>{for(const e of t)e.update()}))),n.observe(o.ownerDocument.documentElement),e.observe(o)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),_.set(this,null),G.set(this,void 0)}get align(){const t=this.getAttribute("align");return"center"===t||"end"===t?t:"start"}set align(t){this.setAttribute("align",`${t}`)}get side(){const t=this.getAttribute("side");return"inside-top"===t||"inside-bottom"===t||"inside-left"===t||"inside-right"===t||"inside-center"===t||"outside-top"===t||"outside-left"===t||"outside-right"===t?t:"outside-bottom"}set side(t){this.setAttribute("side",`${t}`)}get anchorOffset(){const t=this.getAttribute("anchor-offset");return"spacious"===t||"8"===t?8:4}set anchorOffset(t){this.setAttribute("anchor-offset",`${t}`)}get anchor(){return this.getAttribute("anchor")||""}set anchor(t){this.setAttribute("anchor",`${t}`)}get anchorElement(){if(x(this,_,"f"))return x(this,_,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){I(this,_,t,"f"),x(this,_,"f")||this.removeAttribute("anchor")}get alignmentOffset(){return Number(this.getAttribute("alignment-offset"))}set alignmentOffset(t){this.setAttribute("alignment-offset",`${t}`)}get allowOutOfBounds(){return this.hasAttribute("allow-out-of-bounds")}set allowOutOfBounds(t){this.toggleAttribute("allow-out-of-bounds",t)}connectedCallback(){this.update(),this.addEventListener("beforetoggle",(()=>this.update())),J(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(x(this,G,"f")),I(this,G,requestAnimationFrame((()=>{const t=this.anchorElement;if(!t)return;const{left:e,top:n,anchorSide:i,anchorAlign:o}=O(this,t,this);this.style.top=`${n}px`,this.style.left=`${e}px`,this.classList.remove("Overlay--anchorAlign-start","Overlay--anchorAlign-center","Overlay--anchorAlign-end","Overlay--anchorSide-insideTop","Overlay--anchorSide-insideBottom","Overlay--anchorSide-insideLeft","Overlay--anchorSide-insideRight","Overlay--anchorSide-insideCenter","Overlay--anchorSide-outsideTop","Overlay--anchorSide-outsideLeft","Overlay--anchorSide-outsideRight"),this.classList.add(`Overlay--anchorAlign-${o}`,`Overlay--anchorSide-${i}`)})),"f"))}}_=new WeakMap,G=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));const Q=new WeakMap,tt=new WeakMap,et=new WeakMap;function nt(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=et.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(tt.has(e)&&t instanceof MouseEvent){const n=tt.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(tt.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=tt.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`,ct(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)tt.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];tt.set(e,{dragStartX:n,dragStartY:i})}}function it(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=ot(e);if(!(n instanceof ImageCropElement))return;const{box:i}=et.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return at(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,Q.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=Q.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=Q.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&&rt(n,s,r,!(t instanceof KeyboardEvent))}function ot(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function st(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=ot(e);if(!(n instanceof ImageCropElement))return;const{box:i}=et.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",it),n.addEventListener("touchmove",it,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),Q.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),it(t)}else n.addEventListener("mousemove",nt),n.addEventListener("touchmove",nt,{passive:!0})}function rt(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=Q.get(t);if(!s)return;const{box:r,image:a}=et.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`,ct(t,{x:l,y:c,width:o,height:o})}function at(t){const{image:e}=et.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);Q.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),rt(t,n,n)}function lt(t){const e=t.currentTarget;e instanceof ImageCropElement&&(tt.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",it),e.removeEventListener("mousemove",nt),e.removeEventListener("touchmove",it),e.removeEventListener("touchmove",nt))}function ct(t,e){const{image:n}=et.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(et.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&&(et.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,at(this)})),this.addEventListener("mouseleave",lt),this.addEventListener("touchend",lt),this.addEventListener("mouseup",lt),e.addEventListener("mousedown",st),e.addEventListener("touchstart",st,{passive:!0}),this.addEventListener("keydown",nt),this.addEventListener("keydown",it),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}=et.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}var ut,dt,ht,ft;function mt(t){document.activeElement!==t&&(null==t||t.focus())}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const pt=[];function bt(t){const e=t.target,n=null==e?void 0:e.closest("button");if(!n)return;let i=null==n?void 0:n.getAttribute("data-show-dialog-id");if(i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const o=pt[pt.length-1];o&&(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(pt.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(pt.pop(),o.close(!0)))}function gt(t){const e=t.target;if(null==e?void 0:e.closest("button"))return;const n=pt[pt.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(pt.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),ut.add(this),dt.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=x(this,ut,"a",ht))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",x(this,dt,"f").signal.aborted&&I(this,dt,new AbortController,"f"),Z(this,void 0,x(this,dt,"f").signal),pt.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=x(this,ut,"a",ht))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",x(this,dt,"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"));mt(t?j(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",bt),document.addEventListener("mousedown",gt),this.addEventListener("keydown",(t=>x(this,ut,"m",ft).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}}dt=new WeakMap,ut=new WeakSet,ht=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},ft=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 wt=new WeakSet;function vt(t){At(t),Et(t)}const yt=new WeakMap;function Et(t=document){if(yt.has(t))return yt.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)Mt(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&At(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,yt.delete(t),n.disconnect()}};return yt.set(t,i),i}function At(t){for(const e of t.querySelectorAll("[data-action]"))Mt(e);t instanceof Element&&t.hasAttribute("data-action")&&Mt(t)}function Tt(t){const e=t.currentTarget;for(const n of Lt(e))if(t.type===n.type){const i=e.closest(n.tag);wt.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&wt.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*Lt(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 Mt(t){for(const e of Lt(t))t.addEventListener(e.type,Tt)}const kt=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),St=(t,e="property")=>{const n=kt(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const Ct="attr",xt=new WeakSet;function It(t,e){if(xt.has(t))return;xt.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=Ot(n,Ct));for(const n of e){const e=t[n],o=St(`${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 Dt=Symbol.for("catalyst");class Ht{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=>St(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...Ot(t.prototype,Ct)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=kt(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),It(t),function(t){wt.add(t),t.shadowRoot&&vt(t.shadowRoot),At(t),Et(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&vt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){It(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function Ot(t,e){if(!Object.prototype.hasOwnProperty.call(t,Dt)){const e=t[Dt],n=t[Dt]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[Dt];return n.has(e)||n.set(e,new Set),n.get(e)}function Rt(t,e){Ot(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 Pt(t,e){Ot(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 Ft(t){new Ht(t)}var $t,qt,Wt,Nt,Bt,jt,Yt,Xt;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 Kt=class NavListElement extends HTMLElement{constructor(){super(...arguments),$t.add(this)}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")||""}selectItemById(t){if(!t)return!1;const e=x(this,$t,"m",Wt).call(this,t);return!!e&&(x(this,$t,"m",jt).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=x(this,$t,"m",Nt).call(this,t);return!!e&&(x(this,$t,"m",jt).call(this,e),!0)}selectItemByCurrentLocation(){const t=x(this,$t,"m",Bt).call(this);return!!t&&(x(this,$t,"m",jt).call(this,t),!0)}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"),t.focus()}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())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let n=e.closest("button");if(!n){const t=e.getAttribute("aria-labelledby");if(!t)return;n=document.getElementById(t)}this.itemIsExpanded(n)&&"Escape"===t.key&&this.collapseItem(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=x(this,$t,"m",qt).call(this,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)}};var Vt,zt;$t=new WeakSet,qt=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},Wt=function(t){var e;for(const n of this.items){if(n.classList.contains("ActionListItem--hasSubItem"))continue;if(((null===(e=n.getAttribute("data-item-id"))||void 0===e?void 0:e.split(" "))||[]).includes(t))return n}return null},Nt=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},Bt=function(){return x(this,$t,"m",Nt).call(this,window.location.pathname)},jt=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&x(this,$t,"m",Yt).call(this,e),t.classList.add("ActionListItem--navActive");const n=x(this,$t,"m",Xt).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},Yt=function(t){t.classList.remove("ActionListItem--navActive");const e=x(this,$t,"m",Xt).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},Xt=function(t){var e;if(!t.classList.contains("ActionListItem--subItem"))return null;const n=null===(e=t.closest("li.ActionListItem--hasSubItem"))||void 0===e?void 0:e.querySelector("button.ActionListContent");return n||null},C([Rt],Kt.prototype,"list",void 0),C([Pt],Kt.prototype,"items",void 0),C([Rt],Kt.prototype,"showMoreItem",void 0),C([Pt],Kt.prototype,"focusMarkers",void 0),Kt=C([Ft],Kt);let Ut=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),Vt.add(this)}connectedCallback(){x(this,Vt,"m",zt).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 Zt(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,zt=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},C([Pt],Ut.prototype,"items",void 0),Ut=C([Ft],Ut),window.customElements.get("segmented-control")||(window.SegmentedControlElement=Ut,window.customElements.define("segmented-control",Ut));let _t=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(){const t=new CustomEvent("toggleSwitchSuccess",{bubbles:!0});this.dispatchEvent(t),this.setFinishedState(!1)}setErrorState(t){const e=new CustomEvent("toggleSwitchError",{bubbles:!0,detail:t});this.dispatchEvent(e),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");let e;try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text());this.setSuccessState(),this.performToggle()}catch(t){t instanceof Error&&this.setErrorState(t.message||"An error occurred, please try again.")}}};var Gt,Jt,Qt,te,ee,ne,ie,oe,se;C([Rt],_t.prototype,"switch",void 0),C([Rt],_t.prototype,"loadingSpinner",void 0),C([Rt],_t.prototype,"errorIcon",void 0),C([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=Zt(s,t,e),Object.defineProperty(n,i,o)}}(300)],_t.prototype,"submitForm",null),_t=C([Ft],_t),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=_t,window.customElements.define("toggle-switch",_t));const re="tooltip-open",ae="sr-only",le=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Gt.add(this),Jt.set(this,void 0),Qt.set(this,"center"),te.set(this,"outside-bottom"),ee.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(ae,t),this.isConnected&&x(this,Gt,"m",ne).call(this)}get hiddenFromView(){return this.classList.contains(ae)}connectedCallback(){var t;if(x(this,Gt,"m",ie).call(this),x(this,Gt,"m",oe).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(this.hiddenFromView=!0,I(this,ee,!0,"f"),!this.control)return;this.setAttribute("role","tooltip"),null===(t=x(this,Jt,"f"))||void 0===t||t.abort(),I(this,Jt,new AbortController,"f");const{signal:e}=x(this,Jt,"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}),x(this,Gt,"m",ne).call(this)}disconnectedCallback(){var t;null===(t=x(this,Jt,"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?x(this,Gt,"m",ie).call(this):"data-direction"===t&&x(this,Gt,"m",oe).call(this))}}Jt=new WeakMap,Qt=new WeakMap,te=new WeakMap,ee=new WeakMap,Gt=new WeakSet,ne=function(){if(this.hiddenFromView)this.classList.remove(re,...le);else{this.classList.add(re);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);x(this,Gt,"m",se).call(this)}},ie=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)}},oe=function(){this.classList.remove(...le);const t=this.direction;"n"===t?(I(this,Qt,"center","f"),I(this,te,"outside-top","f")):"ne"===t?(I(this,Qt,"start","f"),I(this,te,"outside-top","f")):"e"===t?(I(this,Qt,"center","f"),I(this,te,"outside-right","f")):"se"===t?(I(this,Qt,"start","f"),I(this,te,"outside-bottom","f")):"s"===t?(I(this,Qt,"center","f"),I(this,te,"outside-bottom","f")):"sw"===t?(I(this,Qt,"end","f"),I(this,te,"outside-bottom","f")):"w"===t?(I(this,Qt,"center","f"),I(this,te,"outside-left","f")):"nw"===t&&(I(this,Qt,"end","f"),I(this,te,"outside-top","f"))},se=function(){if(!this.control)return;if(!x(this,ee,"f")||this.hiddenFromView)return;this.style.left="0px";const t=O(this,this.control,{side:x(this,te,"f"),align:x(this,Qt,"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 ce=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")}};C([Rt],ce.prototype,"titleText",void 0),ce=C([Ft],ce),window.customElements.get("x-banner")||(window.XBannerElement=ce,window.customElements.define("x-banner",ce));const ue=!!navigator.userAgent.match(/Macintosh/);class de{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(!ue&&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":ue&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":ue&&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",he)}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",he)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(fe)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(fe),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"),me(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 he(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 fe(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function me(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 pe=window.testScreenReaderDelay||100;class be{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new de(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)}),pe)}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 ge extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const we=new WeakMap;function ve(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=we.get(t);n&&n.abort();we.set(t,e);const i=()=>we.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 ye=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=ve}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");ye.set(this,new be(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=ye.get(this);t&&(t.destroy(),ye.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=ye.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 ge("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function Ee(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 Ae(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),Ee(n),e.removeChild(n),Promise.resolve()}function Te(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)Ae(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?Ae(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?Ae(o.href):Ee(o)).then(i)}var o}function Le(t){const e=t.currentTarget;e instanceof HTMLElement&&Te(e)}function Me(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),Te(e))}}function ke(t){t.currentTarget.addEventListener("keydown",Me)}function Se(t){t.currentTarget.removeEventListener("keydown",Me)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Le),this.addEventListener("focus",ke),this.addEventListener("blur",Se)}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 Ce(t){t.style.display="inline-block"}function xe(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&&(xe(e),Ce(n))}(t),Ie.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Ce(e),xe(n))}(t),Ie.delete(t)}),2e3))}));var De,He=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},Oe=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)};const Re="undefined"!=typeof Intl&&Intl.ListFormat||class{formatToParts(t){const e=[];for(const n of t)e.push({type:"element",value:n}),e.push({type:"literal",value:", "});return e.slice(0,-1)}},Pe=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Fe={minimumIntegerDigits:2};class $e{constructor(t,e={}){De.set(this,void 0);let n=String(e.style||"short");"long"!==n&&"short"!==n&&"narrow"!==n&&"digital"!==n&&(n="short");let i="digital"===n?"numeric":n;const o=e.hours||i;i="2-digit"===o?"numeric":o;const s=e.minutes||i;i="2-digit"===s?"numeric":s;const r=e.seconds||i;i="2-digit"===r?"numeric":r;const a=e.milliseconds||i;He(this,De,{locale:t,style:n,years:e.years||"digital"===n?"short":n,yearsDisplay:"always"===e.yearsDisplay?"always":"auto",months:e.months||"digital"===n?"short":n,monthsDisplay:"always"===e.monthsDisplay?"always":"auto",weeks:e.weeks||"digital"===n?"short":n,weeksDisplay:"always"===e.weeksDisplay?"always":"auto",days:e.days||"digital"===n?"short":n,daysDisplay:"always"===e.daysDisplay?"always":"auto",hours:o,hoursDisplay:"always"===e.hoursDisplay||"digital"===n?"always":"auto",minutes:s,minutesDisplay:"always"===e.minutesDisplay||"digital"===n?"always":"auto",seconds:r,secondsDisplay:"always"===e.secondsDisplay||"digital"===n?"always":"auto",milliseconds:a,millisecondsDisplay:"always"===e.millisecondsDisplay?"always":"auto"},"f")}resolvedOptions(){return Oe(this,De,"f")}formatToParts(t){const e=[],n=Oe(this,De,"f"),i=n.style,o=n.locale;for(const[i,s]of Pe){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?Fe:"numeric"===a?{}:{style:"unit",unit:s,unitDisplay:a};e.push(new Intl.NumberFormat(o,l).format(r))}return new Re(o,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}De=new WeakMap;const qe=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,We=["year","month","week","day","hour","minute","second","millisecond"];class Ne{constructor(t=0,e=0,n=0,i=0,o=0,s=0,r=0,a=0){this.years=t,this.months=e,this.weeks=n,this.days=i,this.hours=o,this.minutes=s,this.seconds=r,this.milliseconds=a,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=0===this.sign}abs(){return new Ne(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),Math.abs(this.milliseconds))}static from(t){var e;if("string"==typeof t){const n=String(t).trim(),i=n.startsWith("-")?-1:1,o=null===(e=n.match(qe))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new Ne(...o):new Ne}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a,milliseconds:l}=t;return new Ne(e,n,i,o,s,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(Be(n,Ne.from(t)).getTime()-n),o=Math.abs(Be(n,Ne.from(e)).getTime()-n);return i>o?-1:i<o?1:0}toLocaleString(t,e){return new $e(t,e).format(this)}}function Be(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}function je(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const n=t.sign;let i=Math.abs(t.years),o=Math.abs(t.months),s=Math.abs(t.weeks),r=Math.abs(t.days),a=Math.abs(t.hours),l=Math.abs(t.minutes),c=Math.abs(t.seconds),u=Math.abs(t.milliseconds);u>=900&&(c+=Math.round(u/1e3)),(c||l||a||r||s||o||i)&&(u=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||s||o||i)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||s||o||i)&&(l=0),a>=21&&(r+=Math.round(a/24)),(r||s||o||i)&&(a=0);const d=e.getFullYear();let h=e.getMonth();const f=e.getDate();return(r>=27||i+o&&r)&&(e.setDate(f+r*n),r=0,o+=Math.abs(e.getFullYear()>=d?e.getMonth()-h:e.getMonth()-h-12),h=e.getMonth()),r>=6&&(s+=Math.round(r/7)),(s||o||i)&&(r=0),s>=4&&(o+=Math.round(s/4)),(o||i)&&(s=0),(o>=11||i&&o)&&(e.setMonth(e.getMonth()+o*n),i+=Math.abs(d-e.getFullYear())),i&&(o=0),new Ne(i*n,o*n,s*n,r*n,a*n,l*n,c*n,u*n)}var Ye,Xe,Ke,Ve,ze,Ue,Ze,_e,Ge,Je,Qe,tn=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)},en=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 nn=("undefined"!=typeof globalThis?globalThis:window).HTMLElement||null,on=new Ne,sn=new Ne(0,0,0,0,0,1);class rn 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 an(t){if(!t.date)return 1/0;if("duration"===t.format||"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 ln=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=an(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,an(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends nn{constructor(){super(...arguments),Ye.add(this),Xe.set(this,!1),Ke.set(this,!1),ze.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Qe.set(this,null)}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","datetime","lang","title"]}get onRelativeTimeUpdated(){return tn(this,Qe,"f")}set onRelativeTimeUpdated(t){tn(this,Qe,"f")&&this.removeEventListener("relative-time-updated",tn(this,Qe,"f")),en(this,Qe,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("relative-time-updated",t)}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");return"long"===t||"short"===t||"narrow"===t?t:"datetime"===this.format&&""!==t?this.formatStyle:void 0}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(){const t=this.format;let e=this.getAttribute("month");if(""!==e)return null!=e||(e="datetime"===t?this.formatStyle:"short"),"numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e?e:void 0}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("year",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:"datetime"===this.format?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,qe.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 We.includes(t)?t:"micro"===this.format?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"datetime"===t?"datetime":"relative"===t?"relative":"duration"===t?"duration":"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if("long"===t)return"long";if("short"===t)return"short";if("narrow"===t)return"narrow";const e=this.format;return"elapsed"===e||"micro"===e?"narrow":"datetime"===e?"short":"long"}set formatStyle(t){this.setAttribute("format-style",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(){ln.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&en(this,Xe,null!==n&&(this.date&&tn(this,Ye,"m",Ue).call(this,this.date))!==n,"f"),tn(this,Ke,"f")||"title"===t&&tn(this,Xe,"f")||en(this,Ke,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=tn(this,ze,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void(tn(this,ze,"f").textContent=t);const o=Date.now();tn(this,Xe,"f")||(n=tn(this,Ye,"m",Ue).call(this,i)||"",n&&this.setAttribute("title",n));const s=function(t,e="second",n=Date.now()){const i=t.getTime()-n;if(0===i)return new Ne;const o=Math.sign(i),s=Math.abs(i),r=Math.floor(s/1e3),a=Math.floor(r/60),l=Math.floor(a/60),c=Math.floor(l/24),u=Math.floor(c/30),d=Math.floor(u/12),h=We.indexOf(e)||We.length;return new Ne(h>=0?d*o:0,h>=1?(u-12*d)*o:0,0,h>=3?(c-30*u)*o:0,h>=4?(l-24*c)*o:0,h>=5?(a-60*l)*o:0,h>=6?(r-60*a)*o:0,h>=7?(s-1e3*r)*o:0)}(i,this.precision,o),r=tn(this,Ye,"m",Ze).call(this,s);let a=t;a="duration"===r?tn(this,Ye,"m",_e).call(this,s):"relative"===r?tn(this,Ye,"m",Ge).call(this,s):tn(this,Ye,"m",Je).call(this,i),a?tn(this,ze,"f").textContent=a:this.shadowRoot===tn(this,ze,"f")&&this.textContent&&(tn(this,ze,"f").textContent=this.textContent),a===t&&n===e||this.dispatchEvent(new rn(t,a,e,n)),"relative"===r||"duration"===r?ln.observe(this):ln.unobserve(this),en(this,Ke,!1,"f")}}Xe=new WeakMap,Ke=new WeakMap,ze=new WeakMap,Qe=new WeakMap,Ye=new WeakSet,Ve=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},Ue=function(t){return new Intl.DateTimeFormat(tn(this,Ye,"a",Ve),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},Ze=function(t){const e=this.format;if("datetime"===e)return"datetime";if("duration"===e)return"duration";if("elapsed"===e)return"duration";if("micro"===e)return"duration";if(("auto"===e||"relative"===e)&&"undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const e=this.tense;if("past"===e||"future"===e)return"relative";if(1===Ne.compare(t,this.threshold))return"relative"}return"datetime"},_e=function(t){const e=tn(this,Ye,"a",Ve),n=this.format,i=this.formatStyle,o=this.tense;let s=on;"micro"===n?(t=je(t),s=sn,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=sn)):("past"===o&&-1!==t.sign||"future"===o&&1!==t.sign)&&(t=s);const r=`${this.precision}sDisplay`;return t.blank?s.toLocaleString(e,{style:i,[r]:"always"}):t.abs().toLocaleString(e,{style:i})},Ge=function(t){const e=new Intl.RelativeTimeFormat(tn(this,Ye,"a",Ve),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=on),"past"===n&&-1!==t.sign&&(t=on);const[i,o]=function(t,e){const n=je(t,e);if(n.blank)return[0,"second"];for(const t of We){if("millisecond"===t)continue;const e=n[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===o&&i<10?e.format(0,"second"):e.format(i,o)},Je=function(t){const e=new Intl.DateTimeFormat(tn(this,Ye,"a",Ve),{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} ${e.format(t)}`.trim()};const cn="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",RelativeTimeElement),cn.RelativeTimeElement=RelativeTimeElement}catch(t){if(!(cn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function un(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=un(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=un(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 un(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=un(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 dn=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 hn(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})}C([Pt],dn.prototype,"fields",void 0),dn=C([Ft],dn),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:dn}),window.customElements.define("primer-multi-input",dn));const fn=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=hn(pn.bind(null,this),300),n={check:e,controller:null};fn.set(this,n),t.addEventListener("input",mn),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=fn.get(this);e&&(fn.delete(this),t.removeEventListener("input",mn),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 mn(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=fn.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 pn(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=fn.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 bn;window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));let gn=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),bn.set(this,void 0)}connectedCallback(){var t;null===(t=x(this,bn,"f"))||void 0===t||t.abort();const{signal:e}=I(this,bn,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(async t=>{const e=await t.detail.response.text();this.setError(e)}),{signal:e})}disconnectedCallback(){var t;null===(t=x(this,bn,"f"))||void 0===t||t.abort()}clearContents(){this.inputElement.value="",this.inputElement.focus()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.textContent=""}setError(t){this.validationMessageElement.textContent=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};bn=new WeakMap,C([Rt],gn.prototype,"inputElement",void 0),C([Rt],gn.prototype,"validationElement",void 0),C([Rt],gn.prototype,"validationMessageElement",void 0),gn=C([Ft],gn);let wn=class ToggleSwitchInputElement extends HTMLElement{connectedCallback(){this.addEventListener("toggleSwitchError",(t=>{this.validationMessageElement.innerText=t.detail,this.validationElement.removeAttribute("hidden")})),this.addEventListener("toggleSwitchSuccess",(()=>{this.validationMessageElement.innerText="",this.validationElement.setAttribute("hidden","hidden")}))}};C([Rt],wn.prototype,"validationElement",void 0),C([Rt],wn.prototype,"validationMessageElement",void 0),wn=C([Ft],wn)}();
1
+ !function(){"use strict";var t=class extends Event{constructor(t,{oldState:e="",newState:n="",...i}={}){super(t,i),this.oldState=String(e||""),this.newState=String(n||"")}},e=new WeakMap;function n(n,i,o){e.set(n,setTimeout((()=>{e.has(n)&&n.dispatchEvent(new t("toggle",{cancelable:!1,oldState:i,newState:o}))}),0))}var i=new WeakMap,o=new WeakMap,s=new WeakMap;function r(t){return s.get(t)||"hidden"}var a=new WeakMap;function l(t,e){return("auto"===t.popover||"manual"===t.popover)&&(!!t.isConnected&&((!e||"showing"===r(t))&&(!(!e&&"hidden"!==r(t))&&(!(t instanceof HTMLDialogElement&&t.hasAttribute("open"))&&document.fullscreenElement!==t))))}function c(t){return t?Array.from(o.get(t.ownerDocument)||[]).indexOf(t)+1:0}function u(t){const e=h(t),n=function(t){for(;t;){const e=t.popoverTargetElement;if(e)return e;if((t=t.parentElement||t.getRootNode())instanceof ShadowRoot&&(t=t.host),t instanceof Document)return}}(t);return c(e)>c(n)?e:n}function d(t){return Array.from(o.get(t)||[]).pop()||null}function h(t){for(;t;){if(t instanceof HTMLElement&&"auto"===t.popover&&"showing"===s.get(t))return t;if((t=t.parentElement||t.getRootNode())instanceof ShadowRoot&&(t=t.host),t instanceof Document)return}}function f(t){return!t.hidden&&((!(t instanceof HTMLButtonElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLOptGroupElement||t instanceof HTMLOptionElement||t instanceof HTMLFieldSetElement)||!t.disabled)&&(!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(!(t instanceof HTMLAnchorElement&&""===t.href)&&-1!==t.tabIndex)))}function m(t){(function(t){if(t.shadowRoot&&!0!==t.shadowRoot.delegatesFocus)return null;let e=t;e.shadowRoot&&(e=e.shadowRoot);const n=e.querySelector("[autofocus]");if(n)return n;const i=t.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);let o=i.currentNode;for(;o;){if(f(o))return o;o=i.nextNode()}})(t)?.focus()}var p=new WeakMap;function g(e){if(!l(e,!1))return;const r=e.ownerDocument;if(!e.dispatchEvent(new t("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"})))return;if(!l(e,!1))return;let c=!1;if("auto"===e.popover){const t=e.getAttribute("popover");if(v(function(t){const e=new Map;let n=0;const i=t.ownerDocument;for(const t of o.get(i)||[])e.set(t,n),n+=1;e.set(t,n),n+=1;let s=null;return function(t){const n=h(t);if(null===n)return null;const i=e.get(n);(null===s||e.get(s)<i)&&(s=n)}(t?.parentElement),s}(e)||r,!1,!0),t!==e.getAttribute("popover")||!l(e,!1))return}d(r)||(c=!0),p.delete(e);const u=r.activeElement;e.classList.add(":open"),s.set(e,"showing"),i.has(r)||i.set(r,new Set),i.get(r).add(e),m(e),"auto"===e.popover&&(o.has(r)||o.set(r,new Set),o.get(r).add(e),k(a.get(e),!0)),c&&u&&"auto"===e.popover&&p.set(e,u),n(e,"closed","open")}function b(e,r=!1,c=!1){if(!l(e,!0))return;const u=e.ownerDocument;if("auto"===e.popover&&(v(e,r,c),!l(e,!0)))return;if(k(a.get(e),!1),a.delete(e),c&&(e.dispatchEvent(new t("beforetoggle",{oldState:"open",newState:"closed"})),!l(e,!0)))return;i.get(u)?.delete(e),o.get(u)?.delete(e),e.classList.remove(":open"),s.set(e,"hidden"),c&&n(e,"open","closed");const d=p.get(e);d&&(p.delete(e),r&&d.focus())}function w(t,e=!1,n=!1){let i=d(t);for(;i;)b(i,e,n),i=d(t)}function v(t,e,n){const i=t.ownerDocument||t;if(t instanceof Document)return w(i,e,n);let s=null,a=!1;for(const e of o.get(i)||[])if(e===t)a=!0;else if(a){s=e;break}if(!a)return w(i,e,n);for(;s&&"showing"===r(s)&&o.get(i)?.size;)b(s,e,n)}var y=new WeakMap;function E(t){if(!t.isTrusted)return;const e=t.composedPath()[0];if(!e)return;const n=e.ownerDocument;if(!d(n))return;const i=u(e);if(i&&"pointerdown"===t.type)y.set(n,i);else if("pointerup"===t.type){const t=y.get(n)===i;y.delete(n),t&&v(i||n,!1,!0)}}var A=new WeakMap;function k(t,e=!1){if(!t)return;A.has(t)||A.set(t,t.getAttribute("aria-expanded"));const n=t.popoverTargetElement;if(n&&"auto"===n.popover)t.setAttribute("aria-expanded",String(e));else{const e=A.get(t);e?t.setAttribute("aria-expanded",e):t.removeAttribute("aria-expanded")}}"undefined"!=typeof HTMLElement&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype||function(){window.ToggleEvent=window.ToggleEvent||t,Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;const t=(this.getAttribute("popover")||"").toLowerCase();return""===t||"auto"==t?"auto":"manual"},set(t){this.setAttribute("popover",t)}},showPopover:{enumerable:!0,configurable:!0,value(){g(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){b(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(t){"showing"===s.get(this)&&void 0===t||!1===t?b(this,!0,!0):void 0!==t&&!0!==t||g(this)}}});const e=new WeakMap;function n(t){Object.defineProperties(t.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(t){if(null===t)this.removeAttribute("popovertarget"),e.delete(this);else{if(!(t instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),e.set(this,t)}},get(){if("button"!==this.localName&&"input"!==this.localName)return null;if("input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type)return null;if(this.disabled)return null;if(this.form&&"submit"===this.type)return null;const t=e.get(this);if(t?.isConnected||e.delete(this),t)return t;const n=this.getRootNode(),i=this.getAttribute("popovertarget");return(n instanceof Document||n instanceof ShadowRoot)&&i&&n.getElementById(i)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){const t=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===t||"hide"===t?t:"toggle"},set(t){this.setAttribute("popovertargetaction",t)}}})}n(HTMLButtonElement),n(HTMLInputElement);const i=t=>{if(!t.isTrusted)return;const e=t.composedPath()[0];if(!(e instanceof Element)||e?.shadowRoot)return;const n=e.getRootNode();if(!(n instanceof ShadowRoot||n instanceof Document))return;const i=e.closest("[popovertargetaction],[popovertarget]");i&&function(t){const e=t.popoverTargetElement;if(!e)return;const n=r(e);"show"===t.popoverTargetAction&&"showing"===n||"hide"===t.popoverTargetAction&&"hidden"===n||("showing"===n?b(e,!0,!0):l(e,!1)&&(a.set(e,t),g(e)))}(i)},o=t=>{const e=t.key,n=t.target;!n||"Escape"!==e&&"Esc"!==e||v(n.ownerDocument,!0,!0)};(t=>{t.addEventListener("click",i),t.addEventListener("keydown",o),t.addEventListener("pointerdown",E),t.addEventListener("pointerup",E)})(document)}();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 t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const n=[M(t,"compositionstart",(t=>F(this,t))),M(t,"compositionend",(t=>F(this,t))),M(t,"click",(e=>H(t,e))),M(t,"change",(e=>H(t,e))),M(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=L.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(P(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=I(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=I(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(D&&n.ctrlKey){const e=I(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(D&&n.ctrlKey){const e=I(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&R(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),M(t,"toggle",(()=>x(t,this)),{once:!0}),M(t,"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")}}(t))),this.preload?M(t,"mouseover",(()=>x(t,this)),{once:!0}):T,...C(t)];L.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=L.get(this);if(t){L.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const L=new WeakMap,T={unsubscribe(){}};function M(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function x(t,e){const n=e.getAttribute("src");if(!n)return;const i=L.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>S(t))),o.setAttribute("src",n))}function C(t){let e=!1;return[M(t,"mousedown",(()=>e=!0)),M(t,"keydown",(()=>e=!1)),M(t,"toggle",(()=>{t.hasAttribute("open")&&(S(t)||e||function(t){const e=document.activeElement;if(e&&R(e)&&t.contains(e))return;const n=I(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 I(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 D=navigator.userAgent.match(/Macintosh/);function H(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||O(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&O(e,t)}}function O(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")&&P(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function R(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function P(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function F(t,e){const n=L.get(t);n&&(n.isComposing="compositionstart"===e.type)}function W(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 q(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 $(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("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const N={"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"]},B={start:["end","center"],end:["start","center"],center:["end","start"]};function j(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=U(n,i,o,s,a,l),d=o,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=N[o];let f=0;if(r){let t=o;for(;f<r.length&&G(t,u,c,n);){const o=r[f++];t=o,u=U(n,i,o,s,a,l),u.top-=e.top,u.left-=e.left,d=o}}const m=B[s];let p=0;if(m){let t=s;for(;p<m.length&&Z(t,u,c,n);){const o=m[p++];t=o,u=U(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:Y,a=null!==(n=t.align)&&void 0!==n?n:K;return{side:r,align:a,anchorOffset:null!==(i=t.anchorOffset)&&void 0!==i?i:"inside-center"===r?0:z,alignmentOffset:null!==(o=t.alignmentOffset)&&void 0!==o?o:"center"!==a&&r.startsWith("inside")?X:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:V}}(n))}const Y="outside-bottom",K="start",z=4,X=4,V=!1;function U(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 G(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 Z(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 _(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?Q:J,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 J(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 Q(t,e=!1){return J(t,e)&&"-1"!==t.getAttribute("tabindex")}let tt=!1;function et(){}try{const t=Object.create({},{signal:{get(){tt=!0}}});window.addEventListener("test",et,t),window.removeEventListener("test",et,t)}catch(t){}tt||(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)}}(),tt=!0);const nt=[];let it;function ot(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=_(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&&Q(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=_(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=_(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(it){const t=it;it.container.setAttribute("data-focus-trap","suspended"),it.controller.abort(),nt.push(t)}c.signal.addEventListener("abort",(()=>{it=void 0})),o.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=nt.findIndex((e=>e.container===t));n>=0&&nt.splice(n,1),function(){const t=nt.pop();t&&ot(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{l(t.target)}),{signal:c.signal,capture:!0}),l(document.activeElement),it={container:t,controller:c,initialFocus:e,originalSignal:o};const u=nt.findIndex((e=>e.container===t));if(u>=0&&nt.splice(u,1),!n)return i}var st,rt;const at=(()=>{const t=new Set;let e=null,n=null;function i(){for(const e of t)e.update()}return o=>{window.addEventListener("resize",i),e||(e=new IntersectionObserver((e=>{for(const n of e){const e=n.target;n.isIntersecting?(e.update(),t.add(e)):t.delete(e)}}))),n||(n=new ResizeObserver((()=>{for(const e of t)e.update()}))),n.observe(o.ownerDocument.documentElement),e.observe(o)}})();class AnchoredPositionElement extends HTMLElement{constructor(){super(...arguments),st.set(this,null),rt.set(this,void 0)}get align(){const t=this.getAttribute("align");return"center"===t||"end"===t?t:"start"}set align(t){this.setAttribute("align",`${t}`)}get side(){const t=this.getAttribute("side");return"inside-top"===t||"inside-bottom"===t||"inside-left"===t||"inside-right"===t||"inside-center"===t||"outside-top"===t||"outside-left"===t||"outside-right"===t?t:"outside-bottom"}set side(t){this.setAttribute("side",`${t}`)}get anchorOffset(){const t=this.getAttribute("anchor-offset");return"spacious"===t||"8"===t?8:4}set anchorOffset(t){this.setAttribute("anchor-offset",`${t}`)}get anchor(){return this.getAttribute("anchor")||""}set anchor(t){this.setAttribute("anchor",`${t}`)}get anchorElement(){if(q(this,st,"f"))return q(this,st,"f");const t=this.anchor;return t?this.ownerDocument.getElementById(t):null}set anchorElement(t){$(this,st,t,"f"),q(this,st,"f")||this.removeAttribute("anchor")}get alignmentOffset(){return Number(this.getAttribute("alignment-offset"))}set alignmentOffset(t){this.setAttribute("alignment-offset",`${t}`)}get allowOutOfBounds(){return this.hasAttribute("allow-out-of-bounds")}set allowOutOfBounds(t){this.toggleAttribute("allow-out-of-bounds",t)}connectedCallback(){this.update(),this.addEventListener("beforetoggle",(()=>this.update())),at(this)}attributeChangedCallback(){this.update()}update(){this.isConnected&&(cancelAnimationFrame(q(this,rt,"f")),$(this,rt,requestAnimationFrame((()=>{const t=this.anchorElement;if(!t)return;const{left:e,top:n,anchorSide:i,anchorAlign:o}=j(this,t,this);this.style.top=`${n}px`,this.style.left=`${e}px`,this.classList.remove("Overlay--anchorAlign-start","Overlay--anchorAlign-center","Overlay--anchorAlign-end","Overlay--anchorSide-insideTop","Overlay--anchorSide-insideBottom","Overlay--anchorSide-insideLeft","Overlay--anchorSide-insideRight","Overlay--anchorSide-insideCenter","Overlay--anchorSide-outsideTop","Overlay--anchorSide-outsideLeft","Overlay--anchorSide-outsideRight"),this.classList.add(`Overlay--anchorAlign-${o}`,`Overlay--anchorSide-${i}`)})),"f"))}}var lt,ct,ut;st=new WeakMap,rt=new WeakMap,AnchoredPositionElement.observedAttributes=["align","side","anchor","alignment-offset","allow-out-of-bounds"],customElements.get("anchored-position")||(window.AnchoredPositionElement=AnchoredPositionElement,customElements.define("anchored-position",AnchoredPositionElement));const dt='[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]',ht=(()=>{try{return document.querySelector(":open"),":open"}catch(t){return".\\:open"}})(),ft=t=>{var e;return null===(e=t.textContent)||void 0===e?void 0:e.trim()[0].toLowerCase()},mt=/^\S$/;class FocusGroupElement extends HTMLElement{constructor(){super(...arguments),lt.add(this),ct.set(this,null)}get nowrap(){return this.hasAttribute("nowrap")}set nowrap(t){this.toggleAttribute("nowrap",t)}get direction(){return"horizontal"===this.getAttribute("direction")?"horizontal":"vertical"}set direction(t){this.setAttribute("direction",`${t}`)}get retain(){return this.hasAttribute("retain")}set retain(t){this.toggleAttribute("retain",t)}get mnemonics(){return this.hasAttribute("mnemonics")}connectedCallback(){$(this,ct,new AbortController,"f");const{signal:t}=q(this,ct,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusin",this,{signal:t})}disconnectedCallback(){var t;null===(t=q(this,ct,"f"))||void 0===t||t.abort()}handleEvent(t){const{direction:e,nowrap:n}=this;if("focusin"===t.type){if(this.retain&&t.target instanceof Element&&t.target.matches(dt))for(const e of q(this,lt,"a",ut))e.setAttribute("tabindex",e===t.target?"0":"-1")}else if(t instanceof KeyboardEvent){const i=Array.from(q(this,lt,"a",ut));let o=i.indexOf(t.target);const s=t.key;if("Up"===s||"ArrowUp"===s)"vertical"!==e&&"both"!==e||(o-=o<0?0:1);else if("Down"===s||"ArrowDown"===s)"vertical"!==e&&"both"!==e||(o+=1);else if("Left"===t.key||"ArrowLeft"===t.key)"horizontal"!==e&&"both"!==e||(o-=1);else if("Right"===t.key||"ArrowRight"===t.key)"horizontal"!==e&&"both"!==e||(o+=1);else if("Home"===t.key||"PageUp"===t.key)o=0;else if("End"===t.key||"PageDown"===t.key)o=i.length-1;else{if(!this.mnemonics||!mt.test(s))return;{const e=s.toLowerCase(),r=o>0&&ft(t.target)===e?o:0;o=i.findIndex(((t,n)=>n>r&&ft(t)===e)),o<0&&!n&&(o=i.findIndex((t=>ft(t)===e)))}}n&&o<0&&(o=0),!n&&o>=i.length&&(o=0);const r=i.at(Math.min(o,i.length-1));{let t=r;do{t=t.closest(`[popover]:not(${ht})`),"auto"===(null==t?void 0:t.popover)?t.showPopover():t=(null==t?void 0:t.parentElement)||null}while(t)}null==r||r.focus()}}}ct=new WeakMap,lt=new WeakSet,ut=function(){return this.querySelectorAll(dt)},customElements.get("focus-group")||(window.FocusGroupElement=FocusGroupElement,customElements.define("focus-group",FocusGroupElement));const pt=new WeakMap,gt=new WeakMap,bt=new WeakMap;function wt(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=bt.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(gt.has(e)&&t instanceof MouseEvent){const n=gt.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(gt.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=gt.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`,Tt(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)gt.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];gt.set(e,{dragStartX:n,dragStartY:i})}}function vt(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=yt(e);if(!(n instanceof ImageCropElement))return;const{box:i}=bt.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return kt(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,pt.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=pt.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=pt.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&&At(n,s,r,!(t instanceof KeyboardEvent))}function yt(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function Et(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=yt(e);if(!(n instanceof ImageCropElement))return;const{box:i}=bt.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",vt),n.addEventListener("touchmove",vt,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),pt.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),vt(t)}else n.addEventListener("mousemove",wt),n.addEventListener("touchmove",wt,{passive:!0})}function At(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=pt.get(t);if(!s)return;const{box:r,image:a}=bt.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`,Tt(t,{x:l,y:c,width:o,height:o})}function kt(t){const{image:e}=bt.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);pt.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),At(t,n,n)}function Lt(t){const e=t.currentTarget;e instanceof ImageCropElement&&(gt.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",vt),e.removeEventListener("mousemove",wt),e.removeEventListener("touchmove",vt),e.removeEventListener("touchmove",wt))}function Tt(t,e){const{image:n}=bt.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(bt.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&&(bt.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,kt(this)})),this.addEventListener("mouseleave",Lt),this.addEventListener("touchend",Lt),this.addEventListener("mouseup",Lt),e.addEventListener("mousedown",Et),e.addEventListener("touchstart",Et,{passive:!0}),this.addEventListener("keydown",wt),this.addEventListener("keydown",vt),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}=bt.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}var Mt,xt,Ct,St;function It(t){document.activeElement!==t&&(null==t||t.focus())}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const Dt=[];function Ht(t){const e=t.target,n=null==e?void 0:e.closest("button");if(!n)return;let i=null==n?void 0:n.getAttribute("data-show-dialog-id");if(i){t.stopPropagation();const e=document.getElementById(i);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const o=Dt[Dt.length-1];o&&(i=n.getAttribute("data-close-dialog-id"),i===o.id&&(Dt.pop(),o.close()),i=n.getAttribute("data-submit-dialog-id"),i===o.id&&(Dt.pop(),o.close(!0)))}function Ot(t){const e=t.target;if(null==e?void 0:e.closest("button"))return;const n=Dt[Dt.length-1];if(!n)return;!e.closest(`#${n.getAttribute("id")}`)&&e.ownerDocument.addEventListener("mouseup",(t=>{t.target===e&&(Dt.pop(),n.close())}),{once:!0})}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),Mt.add(this),xt.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=q(this,Mt,"a",Ct))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.paddingRight=window.innerWidth-document.body.clientWidth+"px",document.body.style.overflow="hidden",q(this,xt,"f").signal.aborted&&$(this,xt,new AbortController,"f"),ot(this,void 0,q(this,xt,"f").signal),Dt.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=q(this,Mt,"a",Ct))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.paddingRight="0",document.body.style.overflow="initial",q(this,xt,"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"));It(t?_(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",Ht),document.addEventListener("mousedown",Ot),this.addEventListener("keydown",(t=>q(this,Mt,"m",St).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}}xt=new WeakMap,Mt=new WeakSet,Ct=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},St=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 Rt=new WeakSet;function Pt(t){qt(t),Wt(t)}const Ft=new WeakMap;function Wt(t=document){if(Ft.has(t))return Ft.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)Bt(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&qt(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const i={get closed(){return e},unsubscribe(){e=!0,Ft.delete(t),n.disconnect()}};return Ft.set(t,i),i}function qt(t){for(const e of t.querySelectorAll("[data-action]"))Bt(e);t instanceof Element&&t.hasAttribute("data-action")&&Bt(t)}function $t(t){const e=t.currentTarget;for(const n of Nt(e))if(t.type===n.type){const i=e.closest(n.tag);Rt.has(i)&&"function"==typeof i[n.method]&&i[n.method](t);const o=e.getRootNode();if(o instanceof ShadowRoot&&Rt.has(o.host)&&o.host.matches(n.tag)){const e=o.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*Nt(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 Bt(t){for(const e of Nt(t))t.addEventListener(e.type,$t)}const jt=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),Yt=(t,e="property")=>{const n=jt(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const Kt="attr",zt=new WeakSet;function Xt(t,e){if(zt.has(t))return;zt.add(t);const n=Object.getPrototypeOf(t),i=n?.constructor?.attrPrefix??"data-";e||(e=Gt(n,Kt));for(const n of e){const e=t[n],o=Yt(`${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 Vt=Symbol.for("catalyst");class Ut{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=>Yt(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...Gt(t.prototype,Kt)].map(i).concat(e),set(t){e=t}})}(t),function(t){const e=jt(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),Xt(t),function(t){Rt.add(t),t.shadowRoot&&Pt(t.shadowRoot),qt(t),Wt(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&Pt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,i,o){Xt(t),"data-catalyst"!==e&&o&&o.call(t,e,n,i)}}function Gt(t,e){if(!Object.prototype.hasOwnProperty.call(t,Vt)){const e=t[Vt],n=t[Vt]=new Map;if(e)for(const[t,i]of e)n.set(t,new Set(i))}const n=t[Vt];return n.has(e)||n.set(e,new Set),n.get(e)}function Zt(t,e){Gt(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 _t(t,e){Gt(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 Jt(t){new Ut(t)}var Qt,te,ee,ne,ie,oe,se,re;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 ae=class NavListElement extends HTMLElement{constructor(){super(...arguments),Qt.add(this)}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")||""}selectItemById(t){if(!t)return!1;const e=q(this,Qt,"m",ee).call(this,t);return!!e&&(q(this,Qt,"m",oe).call(this,e),!0)}selectItemByHref(t){if(!t)return!1;const e=q(this,Qt,"m",ne).call(this,t);return!!e&&(q(this,Qt,"m",oe).call(this,e),!0)}selectItemByCurrentLocation(){const t=q(this,Qt,"m",ie).call(this);return!!t&&(q(this,Qt,"m",oe).call(this,t),!0)}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"),t.focus()}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())}handleItemWithSubItemKeydown(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;let n=e.closest("button");if(!n){const t=e.getAttribute("aria-labelledby");if(!t)return;n=document.getElementById(t)}this.itemIsExpanded(n)&&"Escape"===t.key&&this.collapseItem(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=q(this,Qt,"m",te).call(this,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)}};var le,ce;Qt=new WeakSet,te=function(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)},ee=function(t){var e;for(const n of this.items){if(n.classList.contains("ActionListItem--hasSubItem"))continue;if(((null===(e=n.getAttribute("data-item-id"))||void 0===e?void 0:e.split(" "))||[]).includes(t))return n}return null},ne=function(t){const e=this.querySelector(`.ActionListContent[href="${t}"]`);return e?e.closest(".ActionListItem"):null},ie=function(){return q(this,Qt,"m",ne).call(this,window.location.pathname)},oe=function(t){const e=this.querySelector(".ActionListItem--navActive");e&&q(this,Qt,"m",se).call(this,e),t.classList.add("ActionListItem--navActive");const n=q(this,Qt,"m",re).call(this,t);n&&(this.expandItem(n),n.classList.add("ActionListContent--hasActiveSubItem"))},se=function(t){t.classList.remove("ActionListItem--navActive");const e=q(this,Qt,"m",re).call(this,t);e&&(this.collapseItem(e),e.classList.remove("ActionListContent--hasActiveSubItem"))},re=function(t){var e;if(!t.classList.contains("ActionListItem--subItem"))return null;const n=null===(e=t.closest("li.ActionListItem--hasSubItem"))||void 0===e?void 0:e.querySelector("button.ActionListContent");return n||null},W([Zt],ae.prototype,"list",void 0),W([_t],ae.prototype,"items",void 0),W([Zt],ae.prototype,"showMoreItem",void 0),W([_t],ae.prototype,"focusMarkers",void 0),ae=W([Jt],ae);let ue=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),le.add(this)}connectedCallback(){q(this,le,"m",ce).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 de(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})}le=new WeakSet,ce=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},W([_t],ue.prototype,"items",void 0),ue=W([Jt],ue),window.customElements.get("segmented-control")||(window.SegmentedControlElement=ue,window.customElements.define("segmented-control",ue));let he=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(){const t=new CustomEvent("toggleSwitchSuccess",{bubbles:!0});this.dispatchEvent(t),this.setFinishedState(!1)}setErrorState(t){const e=new CustomEvent("toggleSwitchError",{bubbles:!0,detail:t});this.dispatchEvent(e),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");let e;try{e=await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})}catch(t){throw new Error("A network error occurred, please try again.")}if(!e.ok)throw new Error(await e.text());this.setSuccessState(),this.performToggle()}catch(t){t instanceof Error&&this.setErrorState(t.message||"An error occurred, please try again.")}}};var fe,me,pe,ge,be,we,ve,ye,Ee;W([Zt],he.prototype,"switch",void 0),W([Zt],he.prototype,"loadingSpinner",void 0),W([Zt],he.prototype,"errorIcon",void 0),W([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=de(s,t,e),Object.defineProperty(n,i,o)}}(300)],he.prototype,"submitForm",null),he=W([Jt],he),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=he,window.customElements.define("toggle-switch",he));const Ae="tooltip-open",ke="sr-only",Le=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),fe.add(this),me.set(this,void 0),pe.set(this,"center"),ge.set(this,"outside-bottom"),be.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(ke,t),this.isConnected&&q(this,fe,"m",we).call(this)}get hiddenFromView(){return this.classList.contains(ke)}connectedCallback(){var t;if(q(this,fe,"m",ve).call(this),q(this,fe,"m",ye).call(this),!this.shadowRoot){const t=this.attachShadow({mode:"open"});t.appendChild(document.createElement("style")).textContent=this.styles(),t.appendChild(document.createElement("slot"))}if(this.hiddenFromView=!0,$(this,be,!0,"f"),!this.control)return;this.setAttribute("role","tooltip"),null===(t=q(this,me,"f"))||void 0===t||t.abort(),$(this,me,new AbortController,"f");const{signal:e}=q(this,me,"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}),q(this,fe,"m",we).call(this)}disconnectedCallback(){var t;null===(t=q(this,me,"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?q(this,fe,"m",ve).call(this):"data-direction"===t&&q(this,fe,"m",ye).call(this))}}me=new WeakMap,pe=new WeakMap,ge=new WeakMap,be=new WeakMap,fe=new WeakSet,we=function(){if(this.hiddenFromView)this.classList.remove(Ae,...Le);else{this.classList.add(Ae);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);q(this,fe,"m",Ee).call(this)}},ve=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)}},ye=function(){this.classList.remove(...Le);const t=this.direction;"n"===t?($(this,pe,"center","f"),$(this,ge,"outside-top","f")):"ne"===t?($(this,pe,"start","f"),$(this,ge,"outside-top","f")):"e"===t?($(this,pe,"center","f"),$(this,ge,"outside-right","f")):"se"===t?($(this,pe,"start","f"),$(this,ge,"outside-bottom","f")):"s"===t?($(this,pe,"center","f"),$(this,ge,"outside-bottom","f")):"sw"===t?($(this,pe,"end","f"),$(this,ge,"outside-bottom","f")):"w"===t?($(this,pe,"center","f"),$(this,ge,"outside-left","f")):"nw"===t&&($(this,pe,"end","f"),$(this,ge,"outside-top","f"))},Ee=function(){if(!this.control)return;if(!q(this,be,"f")||this.hiddenFromView)return;this.style.left="0px";const t=j(this,this.control,{side:q(this,ge,"f"),align:q(this,pe,"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 Te=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")}};W([Zt],Te.prototype,"titleText",void 0),Te=W([Jt],Te),window.customElements.get("x-banner")||(window.XBannerElement=Te,window.customElements.define("x-banner",Te));const Me=!!navigator.userAgent.match(/Macintosh/);class xe{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(!Me&&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":Me&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":Me&&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",Ce)}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",Ce)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Se)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Se),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"),Ie(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 Ce(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 Se(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Ie(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 De=window.testScreenReaderDelay||100;class He{constructor(t,e,n,i=!1){var o;if(this.container=t,this.input=e,this.results=n,this.combobox=new xe(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)}),De)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty)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 Oe extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const Re=new WeakMap;function Pe(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=Re.get(t);n&&n.abort();Re.set(t,e);const i=()=>Re.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 Fe=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=Pe}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");Fe.set(this,new He(this,e,n,i)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=Fe.get(this);t&&(t.destroy(),Fe.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")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=Fe.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 Oe("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function We(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 qe(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),We(n),e.removeChild(n),Promise.resolve()}function $e(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)qe(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?qe(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?qe(o.href):We(o)).then(i)}var o}function Ne(t){const e=t.currentTarget;e instanceof HTMLElement&&$e(e)}function Be(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),$e(e))}}function je(t){t.currentTarget.addEventListener("keydown",Be)}function Ye(t){t.currentTarget.removeEventListener("keydown",Be)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Ne),this.addEventListener("focus",je),this.addEventListener("blur",Ye)}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 Ke(t){t.style.display="inline-block"}function ze(t){t.style.display="none"}const Xe=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=Xe.get(t);e?(clearTimeout(e),Xe.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(ze(e),Ke(n))}(t),Xe.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Ke(e),ze(n))}(t),Xe.delete(t)}),2e3))}));var Ve,Ue=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},Ge=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)};const Ze="undefined"!=typeof Intl&&Intl.ListFormat||class{formatToParts(t){const e=[];for(const n of t)e.push({type:"element",value:n}),e.push({type:"literal",value:", "});return e.slice(0,-1)}},_e=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],Je={minimumIntegerDigits:2};class Qe{constructor(t,e={}){Ve.set(this,void 0);let n=String(e.style||"short");"long"!==n&&"short"!==n&&"narrow"!==n&&"digital"!==n&&(n="short");let i="digital"===n?"numeric":n;const o=e.hours||i;i="2-digit"===o?"numeric":o;const s=e.minutes||i;i="2-digit"===s?"numeric":s;const r=e.seconds||i;i="2-digit"===r?"numeric":r;const a=e.milliseconds||i;Ue(this,Ve,{locale:t,style:n,years:e.years||"digital"===n?"short":n,yearsDisplay:"always"===e.yearsDisplay?"always":"auto",months:e.months||"digital"===n?"short":n,monthsDisplay:"always"===e.monthsDisplay?"always":"auto",weeks:e.weeks||"digital"===n?"short":n,weeksDisplay:"always"===e.weeksDisplay?"always":"auto",days:e.days||"digital"===n?"short":n,daysDisplay:"always"===e.daysDisplay?"always":"auto",hours:o,hoursDisplay:"always"===e.hoursDisplay||"digital"===n?"always":"auto",minutes:s,minutesDisplay:"always"===e.minutesDisplay||"digital"===n?"always":"auto",seconds:r,secondsDisplay:"always"===e.secondsDisplay||"digital"===n?"always":"auto",milliseconds:a,millisecondsDisplay:"always"===e.millisecondsDisplay?"always":"auto"},"f")}resolvedOptions(){return Ge(this,Ve,"f")}formatToParts(t){const e=[],n=Ge(this,Ve,"f"),i=n.style,o=n.locale;for(const[i,s]of _e){const r=t[i];if("auto"===n[`${i}Display`]&&!r)continue;const a=n[i],l="2-digit"===a?Je:"numeric"===a?{}:{style:"unit",unit:s,unitDisplay:a};e.push(new Intl.NumberFormat(o,l).format(r))}return new Ze(o,{type:"unit",style:"digital"===i?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map((t=>t.value)).join("")}}Ve=new WeakMap;const tn=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,en=["year","month","week","day","hour","minute","second","millisecond"];class nn{constructor(t=0,e=0,n=0,i=0,o=0,s=0,r=0,a=0){this.years=t,this.months=e,this.weeks=n,this.days=i,this.hours=o,this.minutes=s,this.seconds=r,this.milliseconds=a,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=0===this.sign}abs(){return new nn(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),Math.abs(this.milliseconds))}static from(t){var e;if("string"==typeof t){const n=String(t).trim(),i=n.startsWith("-")?-1:1,o=null===(e=n.match(tn))||void 0===e?void 0:e.slice(1).map((t=>(Number(t)||0)*i));return o?new nn(...o):new nn}if("object"==typeof t){const{years:e,months:n,weeks:i,days:o,hours:s,minutes:r,seconds:a,milliseconds:l}=t;return new nn(e,n,i,o,s,r,a,l)}throw new RangeError("invalid duration")}static compare(t,e){const n=Date.now(),i=Math.abs(on(n,nn.from(t)).getTime()-n),o=Math.abs(on(n,nn.from(e)).getTime()-n);return i>o?-1:i<o?1:0}toLocaleString(t,e){return new Qe(t,e).format(this)}}function on(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}function sn(t,{relativeTo:e=Date.now()}={}){if(e=new Date(e),t.blank)return t;const n=t.sign;let i=Math.abs(t.years),o=Math.abs(t.months),s=Math.abs(t.weeks),r=Math.abs(t.days),a=Math.abs(t.hours),l=Math.abs(t.minutes),c=Math.abs(t.seconds),u=Math.abs(t.milliseconds);u>=900&&(c+=Math.round(u/1e3)),(c||l||a||r||s||o||i)&&(u=0),c>=55&&(l+=Math.round(c/60)),(l||a||r||s||o||i)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||r||s||o||i)&&(l=0),r&&a>=12&&(r+=Math.round(a/24)),!r&&a>=21&&(r+=Math.round(a/24)),(r||s||o||i)&&(a=0);const d=e.getFullYear();let h=e.getMonth();const f=e.getDate();return(r>=27||i+o&&r)&&(e.setDate(f+r*n),o+=Math.abs(e.getFullYear()>=d?e.getMonth()-h:e.getMonth()-h-12),o&&(r=0),h=e.getMonth()),r>=6&&(s+=Math.round(r/7)),(s||o||i)&&(r=0),s>=4&&(o+=Math.round(s/4)),(o||i)&&(s=0),(o>=11||i&&o)&&(e.setMonth(e.getMonth()+o*n),i+=Math.abs(d-e.getFullYear())),i&&(o=0),new nn(i*n,o*n,s*n,r*n,a*n,l*n,c*n,u*n)}var rn,an,ln,cn,un,dn,hn,fn,mn,pn,gn,bn=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)},wn=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 vn=("undefined"!=typeof globalThis?globalThis:window).HTMLElement||null,yn=new nn,En=new nn(0,0,0,0,0,1);class An 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 kn(t){if(!t.date)return 1/0;if("duration"===t.format||"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 Ln=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=kn(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,kn(e)),e.update();this.time=Math.min(36e5,t),this.timer=setTimeout((()=>this.update()),this.time),this.time+=Date.now()}};class RelativeTimeElement extends vn{constructor(){super(...arguments),rn.add(this),an.set(this,!1),ln.set(this,!1),un.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),gn.set(this,null)}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","datetime","lang","title"]}get onRelativeTimeUpdated(){return bn(this,gn,"f")}set onRelativeTimeUpdated(t){bn(this,gn,"f")&&this.removeEventListener("relative-time-updated",bn(this,gn,"f")),wn(this,gn,"object"==typeof t||"function"==typeof t?t:null,"f"),"function"==typeof t&&this.addEventListener("relative-time-updated",t)}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");return"long"===t||"short"===t||"narrow"===t?t:"datetime"===this.format&&""!==t?this.formatStyle:void 0}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(){const t=this.format;let e=this.getAttribute("month");if(""!==e)return null!=e||(e="datetime"===t?this.formatStyle:"short"),"numeric"===e||"2-digit"===e||"short"===e||"long"===e||"narrow"===e?e:void 0}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("year",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:"datetime"===this.format?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&(e=t,tn.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 en.includes(t)?t:"micro"===this.format?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return"datetime"===t?"datetime":"relative"===t?"relative":"duration"===t?"duration":"micro"===t?"micro":"elapsed"===t?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if("long"===t)return"long";if("short"===t)return"short";if("narrow"===t)return"narrow";const e=this.format;return"elapsed"===e||"micro"===e?"narrow":"datetime"===e?"short":"long"}set formatStyle(t){this.setAttribute("format-style",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(){Ln.unobserve(this)}attributeChangedCallback(t,e,n){e!==n&&("title"===t&&wn(this,an,null!==n&&(this.date&&bn(this,rn,"m",dn).call(this,this.date))!==n,"f"),bn(this,ln,"f")||"title"===t&&bn(this,an,"f")||wn(this,ln,(async()=>{await Promise.resolve(),this.update()})(),"f"))}update(){const t=bn(this,un,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let n=e;const i=this.date;if("undefined"==typeof Intl||!Intl.DateTimeFormat||!i)return void(bn(this,un,"f").textContent=t);const o=Date.now();bn(this,an,"f")||(n=bn(this,rn,"m",dn).call(this,i)||"",n&&this.setAttribute("title",n));const s=function(t,e="second",n=Date.now()){const i=t.getTime()-n;if(0===i)return new nn;const o=Math.sign(i),s=Math.abs(i),r=Math.floor(s/1e3),a=Math.floor(r/60),l=Math.floor(a/60),c=Math.floor(l/24),u=Math.floor(c/30),d=Math.floor(u/12),h=en.indexOf(e)||en.length;return new nn(h>=0?d*o:0,h>=1?(u-12*d)*o:0,0,h>=3?(c-30*u)*o:0,h>=4?(l-24*c)*o:0,h>=5?(a-60*l)*o:0,h>=6?(r-60*a)*o:0,h>=7?(s-1e3*r)*o:0)}(i,this.precision,o),r=bn(this,rn,"m",hn).call(this,s);let a=t;a="duration"===r?bn(this,rn,"m",fn).call(this,s):"relative"===r?bn(this,rn,"m",mn).call(this,s):bn(this,rn,"m",pn).call(this,i),a?bn(this,un,"f").textContent=a:this.shadowRoot===bn(this,un,"f")&&this.textContent&&(bn(this,un,"f").textContent=this.textContent),a===t&&n===e||this.dispatchEvent(new An(t,a,e,n)),"relative"===r||"duration"===r?Ln.observe(this):Ln.unobserve(this),wn(this,ln,!1,"f")}}an=new WeakMap,ln=new WeakMap,un=new WeakMap,gn=new WeakMap,rn=new WeakSet,cn=function(){var t;return(null===(t=this.closest("[lang]"))||void 0===t?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang")||"default"},dn=function(t){return new Intl.DateTimeFormat(bn(this,rn,"a",cn),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},hn=function(t){const e=this.format;if("datetime"===e)return"datetime";if("duration"===e)return"duration";if("elapsed"===e)return"duration";if("micro"===e)return"duration";if(("auto"===e||"relative"===e)&&"undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const e=this.tense;if("past"===e||"future"===e)return"relative";if(1===nn.compare(t,this.threshold))return"relative"}return"datetime"},fn=function(t){const e=bn(this,rn,"a",cn),n=this.format,i=this.formatStyle,o=this.tense;let s=yn;"micro"===n?(t=sn(t),s=En,("past"===this.tense&&-1!==t.sign||"future"===this.tense&&1!==t.sign)&&(t=En)):("past"===o&&-1!==t.sign||"future"===o&&1!==t.sign)&&(t=s);const r=`${this.precision}sDisplay`;return t.blank?s.toLocaleString(e,{style:i,[r]:"always"}):t.abs().toLocaleString(e,{style:i})},mn=function(t){const e=new Intl.RelativeTimeFormat(bn(this,rn,"a",cn),{numeric:"auto",style:this.formatStyle}),n=this.tense;"future"===n&&1!==t.sign&&(t=yn),"past"===n&&-1!==t.sign&&(t=yn);const[i,o]=function(t,e){const n=sn(t,e);if(n.blank)return[0,"second"];for(const t of en){if("millisecond"===t)continue;const e=n[`${t}s`];if(e)return[e,t]}return[0,"second"]}(t);return"second"===o&&i<10?e.format(0,"second"):e.format(i,o)},pn=function(t){const e=new Intl.DateTimeFormat(bn(this,rn,"a",cn),{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} ${e.format(t)}`.trim()};const Tn="undefined"!=typeof globalThis?globalThis:window;try{customElements.define("relative-time",RelativeTimeElement),Tn.RelativeTimeElement=RelativeTimeElement}catch(t){if(!(Tn.DOMException&&t instanceof DOMException&&"NotSupportedError"===t.name||t instanceof ReferenceError))throw t}function Mn(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=Mn(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=Mn(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 Mn(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=Mn(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 xn=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 Cn(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})}W([_t],xn.prototype,"fields",void 0),xn=W([Jt],xn),window.customElements.get("primer-multi-input")||(Object.assign(window,{PrimerMultiInputElement:xn}),window.customElements.define("primer-multi-input",xn));const Sn=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=Cn(Dn.bind(null,this),300),n={check:e,controller:null};Sn.set(this,n),t.addEventListener("input",In),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=Sn.get(this);e&&(Sn.delete(this),t.removeEventListener("input",In),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 In(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=Sn.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 Dn(t){const e=t.input;if(!e)return;const n=t.csrfField,i=t.src,o=t.csrf,s=Sn.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 Hn;window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));let On=class PrimerTextFieldElement extends HTMLElement{constructor(){super(...arguments),Hn.set(this,void 0)}connectedCallback(){var t;null===(t=q(this,Hn,"f"))||void 0===t||t.abort();const{signal:e}=$(this,Hn,new AbortController,"f");this.inputElement.addEventListener("auto-check-success",(()=>{this.clearError()}),{signal:e}),this.inputElement.addEventListener("auto-check-error",(async t=>{const e=await t.detail.response.text();this.setError(e)}),{signal:e})}disconnectedCallback(){var t;null===(t=q(this,Hn,"f"))||void 0===t||t.abort()}clearContents(){this.inputElement.value="",this.inputElement.focus()}clearError(){this.inputElement.removeAttribute("invalid"),this.validationElement.hidden=!0,this.validationMessageElement.textContent=""}setError(t){this.validationMessageElement.textContent=t,this.validationElement.hidden=!1,this.inputElement.setAttribute("invalid","true")}};Hn=new WeakMap,W([Zt],On.prototype,"inputElement",void 0),W([Zt],On.prototype,"validationElement",void 0),W([Zt],On.prototype,"validationMessageElement",void 0),On=W([Jt],On);let Rn=class ToggleSwitchInputElement extends HTMLElement{connectedCallback(){this.addEventListener("toggleSwitchError",(t=>{this.validationMessageElement.innerText=t.detail,this.validationElement.removeAttribute("hidden")})),this.addEventListener("toggleSwitchSuccess",(()=>{this.validationMessageElement.innerText="",this.validationElement.setAttribute("hidden","hidden")}))}};W([Zt],Rn.prototype,"validationElement",void 0),W([Zt],Rn.prototype,"validationMessageElement",void 0),Rn=W([Jt],Rn);var Pn,Fn,Wn,qn,$n,Nn,Bn,jn,Yn=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)},Kn=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 zn=new WeakMap;let Xn=null;class IncludeFragmentElement extends HTMLElement{static setCSPTrustedTypesPolicy(t){Xn=null===t?t:Promise.resolve(t)}static get observedAttributes(){return["src","loading"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get loading(){return"lazy"===this.getAttribute("loading")?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get data(){return Yn(this,Pn,"m",Nn).call(this)}attributeChangedCallback(t,e){"src"===t?this.isConnected&&"eager"===this.loading&&Yn(this,Pn,"m",qn).call(this):"loading"===t&&this.isConnected&&"eager"!==e&&"eager"===this.loading&&Yn(this,Pn,"m",qn).call(this)}constructor(){super(),Pn.add(this),Fn.set(this,!1),Wn.set(this,new IntersectionObserver((t=>{for(const e of t)if(e.isIntersecting){const{target:t}=e;if(Yn(this,Wn,"f").unobserve(t),!(t instanceof IncludeFragmentElement))return;"lazy"===t.loading&&Yn(this,Pn,"m",qn).call(this)}}),{rootMargin:"0px 0px 256px 0px",threshold:.01}));const t=this.attachShadow({mode:"open"}),e=document.createElement("style");e.textContent=":host {display: block;}",t.append(e,document.createElement("slot"))}connectedCallback(){this.src&&"eager"===this.loading&&Yn(this,Pn,"m",qn).call(this),"lazy"===this.loading&&Yn(this,Wn,"f").observe(this)}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return Yn(this,Pn,"m",Nn).call(this)}fetch(t){return fetch(t)}refetch(){zn.delete(this),Yn(this,Pn,"m",qn).call(this)}}var Vn,Un,Gn,Zn;Fn=new WeakMap,Wn=new WeakMap,Pn=new WeakSet,qn=async function(){if(!Yn(this,Fn,"f")){Kn(this,Fn,!0,"f"),Yn(this,Wn,"f").unobserve(this);try{const t=await Yn(this,Pn,"m",$n).call(this);if(t instanceof Error)throw t;const e=t,n=document.createElement("template");n.innerHTML=e;const i=document.importNode(n.content,!0);if(!this.dispatchEvent(new CustomEvent("include-fragment-replace",{cancelable:!0,detail:{fragment:i}})))return void Kn(this,Fn,!1,"f");this.replaceWith(i),this.dispatchEvent(new CustomEvent("include-fragment-replaced"))}catch(t){this.classList.add("is-error")}finally{Kn(this,Fn,!1,"f")}}},$n=async function(){const t=this.src,e=zn.get(this);if(e&&e.src===t)return e.data;{let e;return e=t?Yn(this,Pn,"m",jn).call(this):Promise.reject(new Error("missing src")),zn.set(this,{src:t,data:e}),e}},Nn=async function(){const t=await Yn(this,Pn,"m",$n).call(this);if(t instanceof Error)throw t;return t.toString()},Bn=async function(t){await new Promise((t=>setTimeout(t,0)));for(const e of t)this.dispatchEvent(new Event(e))},jn=async function(){try{await Yn(this,Pn,"m",Bn).call(this,["loadstart"]);const e=await this.fetch(this.request());if(200!==e.status)throw new Error(`Failed to load resource: the server responded with a status of ${e.status}`);const n=e.headers.get("Content-Type");if(!(t=this.accept,t&&t.split(",").find((t=>t.match(/^\s*\*\/\*/)))||n&&n.includes(this.accept?this.accept:"text/html")))throw new Error(`Failed to load resource: expected ${this.accept||"text/html"} but was ${n}`);const i=await e.text();let o=i;if(Xn){o=(await Xn).createHTML(i,e)}return Yn(this,Pn,"m",Bn).call(this,["load","loadend"]),o}catch(t){throw Yn(this,Pn,"m",Bn).call(this,["error","loadend"]),t}var t},window.customElements.get("include-fragment")||(window.IncludeFragmentElement=IncludeFragmentElement,window.customElements.define("include-fragment",IncludeFragmentElement));const _n=(()=>{try{return document.querySelector(":open"),":open"}catch(t){return".\\:open"}})(),Jn=['[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="none"]'];class ActionMenuElement extends HTMLElement{constructor(){super(...arguments),Vn.add(this),Un.set(this,void 0),Gn.set(this,"")}get selectVariant(){return this.getAttribute("data-select-variant")}set selectVariant(t){t?this.setAttribute("data-select-variant",t):this.removeAttribute("variant")}get dynamicLabelPrefix(){const t=this.getAttribute("data-dynamic-label-prefix");return t?`${t}:`:""}set dynamicLabelPrefix(t){this.setAttribute("data-dynamic-label",t)}get dynamicLabel(){return this.hasAttribute("data-dynamic-label")}set dynamicLabel(t){this.toggleAttribute("data-dynamic-label",t)}get popoverElement(){return this.querySelector("[popover]")}get invokerElement(){var t;const e=null===(t=this.querySelector("[role=menu]"))||void 0===t?void 0:t.id;if(!e)return null;for(const t of this.querySelectorAll("[aria-controls]"))if(t.getAttribute("aria-controls")===e)return t;return null}connectedCallback(){const{signal:t}=$(this,Un,new AbortController,"f");this.addEventListener("keydown",this,{signal:t}),this.addEventListener("click",this,{signal:t}),this.addEventListener("mouseover",this,{signal:t}),this.addEventListener("focusout",this,{signal:t}),q(this,Vn,"m",Zn).call(this)}disconnectedCallback(){q(this,Un,"f").abort()}handleEvent(t){var e,n,i,o;if(null===(e=this.popoverElement)||void 0===e?void 0:e.matches(_n))if("focusout"!==t.type||this.contains(t.relatedTarget)){if(t instanceof KeyboardEvent&&"keydown"===t.type&&!(t.ctrlKey||t.altKey||t.metaKey||t.shiftKey)&&"Enter"===t.key||t instanceof MouseEvent&&"click"===t.type){const e=null===(i=t.target.closest(Jn.join(",")))||void 0===i?void 0:i.closest("li");if(!e)return;const n="true"!==e.getAttribute("aria-checked");if(e.setAttribute("aria-checked",`${n}`),"single"===this.selectVariant){const t=Jn.map((t=>`li[aria-checked] ${t}`)).join(",");for(const n of this.querySelectorAll(t)){const t=n.closest("li");t!==e&&t.setAttribute("aria-checked","false")}q(this,Vn,"m",Zn).call(this)}t.preventDefault(),null===(o=this.popoverElement)||void 0===o||o.hidePopover()}}else null===(n=this.popoverElement)||void 0===n||n.hidePopover()}}Un=new WeakMap,Gn=new WeakMap,Vn=new WeakSet,Zn=function(){if(!this.dynamicLabel)return;const t=this.invokerElement;if(!t)return;const e=Jn.map((t=>`${t}[aria-checked=true]`)).join(","),n=this.querySelector(e);if(n&&this.dynamicLabel){$(this,Gn,q(this,Gn,"f")||t.textContent||"","f");const e=document.createElement("span");e.classList.add("color-fg-muted");const i=document.createElement("span");e.textContent=this.dynamicLabelPrefix,i.textContent=n.textContent||"",t.replaceChildren(e,i)}else t.textContent=q(this,Gn,"f")},window.customElements.get("action-menu")||(window.ActionMenuElement=ActionMenuElement,window.customElements.define("action-menu",ActionMenuElement))}();
2
2
  //# sourceMappingURL=primer_view_components.js.map