primer_view_components 0.0.111 → 0.0.112

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -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 +1 -1
  6. data/app/assets/styles/primer_view_components.css.map +1 -1
  7. data/app/components/primer/alpha/auto_complete.css +1 -0
  8. data/app/components/primer/alpha/auto_complete.css.json +1 -0
  9. data/app/components/primer/alpha/auto_complete.css.map +1 -0
  10. data/app/components/primer/alpha/auto_complete.pcss +118 -0
  11. data/app/components/primer/alpha/banner.css +1 -1
  12. data/app/components/primer/alpha/banner.css.map +1 -1
  13. data/app/components/primer/alpha/banner.pcss +2 -3
  14. data/app/components/primer/alpha/button_marketing.css +1 -0
  15. data/app/components/primer/alpha/button_marketing.css.json +1 -0
  16. data/app/components/primer/alpha/button_marketing.css.map +1 -0
  17. data/app/components/primer/alpha/button_marketing.pcss +175 -0
  18. data/app/components/primer/{dropdown → alpha/dropdown}/menu.d.ts +0 -0
  19. data/app/components/primer/{dropdown → alpha/dropdown}/menu.html.erb +0 -0
  20. data/app/components/primer/{dropdown → alpha/dropdown}/menu.js +0 -0
  21. data/app/components/primer/alpha/dropdown/menu.rb +105 -0
  22. data/app/components/primer/{dropdown → alpha/dropdown}/menu.ts +0 -0
  23. data/app/components/primer/alpha/dropdown.css +1 -0
  24. data/app/components/primer/alpha/dropdown.css.json +1 -0
  25. data/app/components/primer/{dropdown.css.map → alpha/dropdown.css.map} +1 -1
  26. data/app/components/primer/{dropdown.d.ts → alpha/dropdown.d.ts} +0 -0
  27. data/app/components/primer/{dropdown.html.erb → alpha/dropdown.html.erb} +0 -0
  28. data/app/components/primer/{dropdown.js → alpha/dropdown.js} +0 -0
  29. data/app/components/primer/{dropdown.pcss → alpha/dropdown.pcss} +1 -1
  30. data/app/components/primer/alpha/dropdown.rb +154 -0
  31. data/app/components/primer/{dropdown.ts → alpha/dropdown.ts} +0 -0
  32. data/app/components/primer/alpha/tab_nav.css +1 -0
  33. data/app/components/primer/alpha/tab_nav.css.json +1 -0
  34. data/app/components/primer/alpha/tab_nav.css.map +1 -0
  35. data/app/components/primer/alpha/tab_nav.pcss +100 -0
  36. data/app/components/primer/alpha/underline_nav.css +1 -0
  37. data/app/components/primer/alpha/underline_nav.css.json +1 -0
  38. data/app/components/primer/alpha/underline_nav.css.map +1 -0
  39. data/app/components/primer/alpha/underline_nav.pcss +133 -0
  40. data/app/components/primer/beta/border_box.css +1 -0
  41. data/app/components/primer/beta/border_box.css.json +1 -0
  42. data/app/components/primer/beta/border_box.css.map +1 -0
  43. data/app/components/primer/beta/border_box.pcss +284 -0
  44. data/app/components/primer/beta/link.css +1 -0
  45. data/app/components/primer/beta/link.css.json +1 -0
  46. data/app/components/primer/beta/link.css.map +1 -0
  47. data/app/components/primer/beta/link.pcss +60 -0
  48. data/app/components/primer/{popover_component.css → beta/popover.css} +0 -0
  49. data/app/components/primer/beta/popover.css.json +1 -0
  50. data/app/components/primer/beta/popover.css.map +1 -0
  51. data/app/components/primer/{popover_component.html.erb → beta/popover.html.erb} +0 -0
  52. data/app/components/primer/{popover_component.pcss → beta/popover.pcss} +0 -0
  53. data/app/components/primer/beta/popover.rb +127 -0
  54. data/app/components/primer/component.rb +2 -2
  55. data/app/components/primer/dropdown/menu.rb +5 -90
  56. data/app/components/primer/dropdown.rb +2 -145
  57. data/app/components/primer/menu_component.css +1 -0
  58. data/app/components/primer/menu_component.css.json +1 -0
  59. data/app/components/primer/menu_component.css.map +1 -0
  60. data/app/components/primer/menu_component.pcss +119 -0
  61. data/app/components/primer/popover_component.rb +3 -120
  62. data/app/components/primer/primer.d.ts +1 -1
  63. data/app/components/primer/primer.js +1 -1
  64. data/app/components/primer/primer.pcss +10 -3
  65. data/app/components/primer/primer.ts +1 -1
  66. data/lib/primer/deprecations.rb +4 -2
  67. data/lib/primer/view_components/linters/deprecated_components_counter.rb +15 -4
  68. data/lib/primer/view_components/linters/severity_schema.rb +14 -0
  69. data/lib/primer/view_components/version.rb +1 -1
  70. data/lib/tasks/docs.rake +3 -3
  71. data/previews/primer/alpha/button_marketing_preview.rb +36 -0
  72. data/previews/primer/alpha/dropdown_preview.rb +210 -0
  73. data/previews/primer/alpha/tab_nav_preview.rb +55 -0
  74. data/previews/primer/beta/border_box_preview.rb +65 -13
  75. data/previews/primer/beta/link_preview.rb +28 -0
  76. data/previews/primer/beta/popover_preview.rb +79 -0
  77. data/static/arguments.json +40 -40
  78. data/static/audited_at.json +4 -2
  79. data/static/constants.json +56 -50
  80. data/static/statuses.json +8 -6
  81. metadata +54 -23
  82. data/app/components/primer/dropdown.css +0 -1
  83. data/app/components/primer/dropdown.css.json +0 -1
  84. data/app/components/primer/image.rb +0 -7
  85. data/app/components/primer/popover_component.css.json +0 -1
  86. data/app/components/primer/popover_component.css.map +0 -1
  87. data/app/components/primer/progress_bar_component.rb +0 -7
  88. data/previews/primer/dropdown_preview.rb +0 -208
  89. data/previews/primer/popover_component_preview.rb +0 -34
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a06fb9e30713a0d6aaf0df98f41005f774ed5ae5beb9b3b3392a524aeb8de496
4
- data.tar.gz: d376a7094ecff98c9e761a609cfdc41a20e152115b122b9a159a37f4be3877bf
3
+ metadata.gz: 423f4699bf1eb5e1881a3246e904d35fb3664a2e2a7c1c43fb07f14e9b647eda
4
+ data.tar.gz: 501bbe6e9e6009a308800debb1602a599bbd66ec7143a1ae51aabfddcbd55548
5
5
  SHA512:
6
- metadata.gz: f9f1e441f3f8f744737f751bcc0f0220e8de6979297d6f88d6a30620246f895e5afdb3b4b1a6c169fdd39facd5651703cb5bcc783b71617696c2dc411eb7a2b8
7
- data.tar.gz: 1eae3b68a1522c41a2080eec6fccf1fadea78fc7f480d9f8c57a667a7a2cb77de764e43b229bb2a7ea92e5942ff2b775fc4239c416ea0499878a509d494bf118
6
+ metadata.gz: 7a962e74c1938b9decffa4c18f5ad5aecaea03901b2a1469e51873a2ccbf9932c498e3a792e64b43984f1e8e631169be5ded292744ad3f45fd4c9e8e5e029e01
7
+ data.tar.gz: bdd7dfb536f2a07d4c12022e91e885b6fb364c614fd0f9de94501c8a06acd9e9839dd6a2312e9a350820b16b6ce053834e0b137560d8858afd0bb673dc78a378
data/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.0.112
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1624](https://github.com/primer/view_components/pull/1624) [`61c8a7d6`](https://github.com/primer/view_components/commit/61c8a7d606f00eaf4e1b4c16f10306282ac034e0) Thanks [@jonrohan](https://github.com/jonrohan)! - Deleting deprecated Primer::Image component
8
+
9
+ * [#1620](https://github.com/primer/view_components/pull/1620) [`4898307e`](https://github.com/primer/view_components/commit/4898307eee7430555ef1e78fdfd1d3204c66823b) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - adding css source for Marketing Button and Link, from Primer CSS
10
+
11
+ - [#1626](https://github.com/primer/view_components/pull/1626) [`be3d92aa`](https://github.com/primer/view_components/commit/be3d92aaf1d6f656cc640a09168075279facfca3) Thanks [@simurai](https://github.com/simurai)! - Move `navigation` styles to PVC
12
+
13
+ * [#1617](https://github.com/primer/view_components/pull/1617) [`9322db97`](https://github.com/primer/view_components/commit/9322db976c7c29374faf7be3d4b4e1d0a12d42cf) Thanks [@simurai](https://github.com/simurai)! - Update `dropdown` hover text color
14
+
15
+ - [#1632](https://github.com/primer/view_components/pull/1632) [`7f1181be`](https://github.com/primer/view_components/commit/7f1181be49960337254db834e9b2b9a5fdb7b0b8) Thanks [@camertron](https://github.com/camertron)! - Improve performance of the deny\_\* methods
16
+
17
+ * [#1625](https://github.com/primer/view_components/pull/1625) [`3af9bf5e`](https://github.com/primer/view_components/commit/3af9bf5e778bb1fe475ed7efda9fc1a5ed36d695) Thanks [@jonrohan](https://github.com/jonrohan)! - Deprecate components and moving to new namespace:
18
+
19
+ - Primer::Dropdown moving to Primer::Alpha::Dropdown
20
+ - Primer::Dropdown::Menu moving to Primer::Alpha::Dropdown::Menu
21
+ - Primer::Dropdown::Menu::Item moving to Primer::Alpha::Dropdown::Menu::Item
22
+
23
+ - [#1618](https://github.com/primer/view_components/pull/1618) [`72f8c3a9`](https://github.com/primer/view_components/commit/72f8c3a989e23135b56e347a0be8e2be4dbb253e) Thanks [@simurai](https://github.com/simurai)! - Move`Box` styles to PVC
24
+
25
+ * [#1629](https://github.com/primer/view_components/pull/1629) [`a7527531`](https://github.com/primer/view_components/commit/a7527531d01d0af4a08d002bb3024bca1828d40a) Thanks [@jonrohan](https://github.com/jonrohan)! - Deprecate Primer::PopoverComponent moving to Primer::Beta::Popover
26
+
27
+ - [#1634](https://github.com/primer/view_components/pull/1634) [`cdc13a18`](https://github.com/primer/view_components/commit/cdc13a18d406e9b0b2dd3bb4ba7b058c72052b84) Thanks [@mxriverlynn](https://github.com/mxriverlynn)! - Adding a custom erblint schema to allow `severity` in linter configuration
28
+
29
+ * [#1609](https://github.com/primer/view_components/pull/1609) [`c4408661`](https://github.com/primer/view_components/commit/c44086611439e93d7214068dd332f37308b7c24f) Thanks [@simurai](https://github.com/simurai)! - Move `autocomplete` styles to PVC
30
+
31
+ - [#1623](https://github.com/primer/view_components/pull/1623) [`7643e514`](https://github.com/primer/view_components/commit/7643e51449abe73a71453c1d2f46a69e8661a963) Thanks [@jonrohan](https://github.com/jonrohan)! - Deleting deprecated Primer::ProgressBarComponent in favor of Primer::Beta::ProgressBar
32
+
3
33
  ## 0.0.111
4
34
 
5
35
  ### Patch Changes
@@ -1,2 +1,2 @@
1
- !function(){"use strict";const t=new WeakMap,e=new WeakMap,n=new WeakMap;function o(t){const o=t.currentTarget;if(!(o instanceof ImageCropElement))return;const{box:i,image:s}=n.get(o)||{};if(!i||!s)return;let r=0,a=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?a=-1:"ArrowDown"===t.key?a=1:"ArrowLeft"===t.key?r=-1:"ArrowRight"===t.key&&(r=1);else if(e.has(o)&&t instanceof MouseEvent){const n=e.get(o);r=t.pageX-n.dragStartX,a=t.pageY-n.dragStartY}else if(e.has(o)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:s,dragStartY:c}=e.get(o);r=n-s,a=i-c}if(0!==r||0!==a){const t=Math.min(Math.max(0,i.offsetLeft+r),s.width-i.offsetWidth),e=Math.min(Math.max(0,i.offsetTop+a),s.height-i.offsetHeight);i.style.left=`${t}px`,i.style.top=`${e}px`,u(o,{x:t,y:e,width:i.offsetWidth,height:i.offsetHeight})}if(t instanceof MouseEvent)e.set(o,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];e.set(o,{dragStartX:n,dragStartY:i})}}function i(e){const o=e.target;if(!(o instanceof HTMLElement))return;const i=s(o);if(!(i instanceof ImageCropElement))return;const{box:r}=n.get(i)||{};if(!r)return;const l=i.getBoundingClientRect();let u,d,h;if(e instanceof KeyboardEvent){if("Escape"===e.key)return c(i);if("-"===e.key&&(h=-10),"="===e.key&&(h=10),!h)return;u=r.offsetWidth+h,d=r.offsetHeight+h,t.set(i,{startX:r.offsetLeft,startY:r.offsetTop})}else if(e instanceof MouseEvent){const n=t.get(i);if(!n)return;u=e.pageX-n.startX-l.left-window.pageXOffset,d=e.pageY-n.startY-l.top-window.pageYOffset}else if(e instanceof TouchEvent){const n=t.get(i);if(!n)return;u=e.changedTouches[0].pageX-n.startX-l.left-window.pageXOffset,d=e.changedTouches[0].pageY-n.startY-l.top-window.pageYOffset}u&&d&&a(i,u,d,!(e instanceof KeyboardEvent))}function s(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function r(e){const r=e.currentTarget;if(!(r instanceof HTMLElement))return;const a=s(r);if(!(a instanceof ImageCropElement))return;const{box:c}=n.get(a)||{};if(!c)return;const l=e.target;if(l instanceof HTMLElement)if(l.hasAttribute("data-direction")){const n=l.getAttribute("data-direction")||"";a.addEventListener("mousemove",i),a.addEventListener("touchmove",i,{passive:!0}),["nw","se"].indexOf(n)>=0&&a.classList.add("nwse"),["ne","sw"].indexOf(n)>=0&&a.classList.add("nesw"),t.set(a,{startX:c.offsetLeft+(["se","ne"].indexOf(n)>=0?0:c.offsetWidth),startY:c.offsetTop+(["se","sw"].indexOf(n)>=0?0:c.offsetHeight)}),i(e)}else a.addEventListener("mousemove",o),a.addEventListener("touchmove",o,{passive:!0})}function a(e,o,i,s=!0){let r=Math.max(Math.abs(o),Math.abs(i),10);const a=t.get(e);if(!a)return;const{box:c,image:l}=n.get(e)||{};if(!c||!l)return;r=Math.min(r,i>0?l.height-a.startY:a.startY,o>0?l.width-a.startX:a.startX);const d=s?Math.round(Math.max(0,o>0?a.startX:a.startX-r)):c.offsetLeft,h=s?Math.round(Math.max(0,i>0?a.startY:a.startY-r)):c.offsetTop;c.style.left=`${d}px`,c.style.top=`${h}px`,c.style.width=`${r}px`,c.style.height=`${r}px`,u(e,{x:d,y:h,width:r,height:r})}function c(e){const{image:o}=n.get(e)||{};if(!o)return;const i=Math.round(o.clientWidth>o.clientHeight?o.clientHeight:o.clientWidth);t.set(e,{startX:(o.clientWidth-i)/2,startY:(o.clientHeight-i)/2}),a(e,i,i)}function l(t){const n=t.currentTarget;n instanceof ImageCropElement&&(e.delete(n),n.classList.remove("nwse","nesw"),n.removeEventListener("mousemove",i),n.removeEventListener("mousemove",o),n.removeEventListener("touchmove",i),n.removeEventListener("touchmove",o))}function u(t,e){const{image:o}=n.get(t)||{};if(!o)return;const i=o.naturalWidth/o.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(n.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 s=t.querySelector("img");s instanceof HTMLImageElement&&(n.set(this,{box:e,image:s}),s.addEventListener("load",(()=>{this.loaded=!0,c(this)})),this.addEventListener("mouseleave",l),this.addEventListener("touchend",l),this.addEventListener("mouseup",l),e.addEventListener("mousedown",r),e.addEventListener("touchstart",r,{passive:!0}),this.addEventListener("keydown",o),this.addEventListener("keydown",i),this.src&&(s.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,o){const{image:i}=n.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=o))}}function d(t,e,n,o){var i,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(s<3?i(r):s>3?i(e,n,r):i(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function h(t,e,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(t):o?o.value:e.get(t)}function m(t,e,n,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(t,n):i?i.value=n:e.set(t,n),n}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const f={"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"]},p={start:["end","center"],end:["start","center"],center:["end","start"]};function b(t,e,n={}){const o=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),i=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,o=n.getBoundingClientRect(),i=getComputedStyle(n),[s,r,a,c]=[i.borderTopWidth,i.borderLeftWidth,i.borderRightWidth,i.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:o.top+s,left:o.left+r,width:o.width-a-r,height:Math.max(o.height-s-c,n===document.body?window.innerHeight:-1/0)}}(o),s=getComputedStyle(o),r=o.getBoundingClientRect(),[a,c]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,o,{side:i,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:c}){const l={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=A(n,o,i,s,a,c),d=i,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=f[i];let m=0;if(r){let t=i;for(;m<r.length&&T(t,u,l,n);){const i=r[m++];t=i,u=A(n,o,i,s,a,c),u.top-=e.top,u.left-=e.left,d=i}}const b=p[s];let g=0;if(b){let t=s;for(;g<b.length&&M(t,u,l,n);){const i=b[g++];t=i,u=A(n,o,d,i,a,c),u.top-=e.top,u.left-=e.left,h=i}}u.top<l.top&&(u.top=l.top),u.left<l.left&&(u.left=l.left),u.left+n.width>t.width+l.left&&(u.left=t.width+l.left-n.width),r&&m<r.length&&u.top+n.height>t.height+l.top&&(u.top=t.height+l.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(i,{top:r.top+a,left:r.left+c},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,o,i,s;const r=null!==(e=t.side)&&void 0!==e?e:g,a=null!==(n=t.align)&&void 0!==n?n:w;return{side:r,align:a,anchorOffset:null!==(o=t.anchorOffset)&&void 0!==o?o:"inside-center"===r?0:v,alignmentOffset:null!==(i=t.alignmentOffset)&&void 0!==i?i:"center"!==a&&r.startsWith("inside")?E:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:y}}(n))}const g="outside-bottom",w="start",v=4,E=4,y=!1;function A(t,e,n,o,i,s){const r=e.left+e.width,a=e.top+e.height;let c=-1,l=-1;return"outside-top"===n?c=e.top-i-t.height:"outside-bottom"===n?c=a+i:"outside-left"===n?l=e.left-i-t.width:"outside-right"===n&&(l=r+i),"outside-top"!==n&&"outside-bottom"!==n||(l="start"===o?e.left+s:"center"===o?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(c="start"===o?e.top+s:"center"===o?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?c=e.top+i:"inside-bottom"===n?c=a-i-t.height:"inside-left"===n?l=e.left+i:"inside-right"===n?l=r-i-t.width:"inside-center"===n&&(l=(r+e.left)/2-t.width/2+i),"inside-top"===n||"inside-bottom"===n?l="start"===o?e.left+s:"center"===o?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(c="start"===o?e.top+s:"center"===o?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:c,left:l}}function T(t,e,n,o){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+o.height>n.height+n.top:e.left<n.left||e.left+o.width>n.width+n.left}function M(t,e,n,o){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+o.width>n.left+n.width||e.left<n.left:void 0}function L(t,e=!1){return function*(t,e={}){var n,o;const i=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(o=e.onlyTabbable)&&void 0!==o&&o?k:x,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,i)&&(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,i)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function x(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,o=t.hidden,i=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||o||i||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),o=0===t.getClientRects().length;if(e||n||o)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function k(t,e=!1){return x(t,e)&&"-1"!==t.getAttribute("tabindex")}let S=!1;function C(){}try{const t=Object.create({},{signal:{get(){S=!0}}});window.addEventListener("test",C,t),window.removeEventListener("test",C,t)}catch(t){}S||(function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,n,o){return"object"==typeof o&&"signal"in o&&o.signal instanceof AbortSignal&&t.call(o.signal,"abort",(()=>{this.removeEventListener(e,n,o)})),t.call(this,e,n,o)}}(),S=!0);const I=[];let D;function H(t,e,n){const o=new AbortController,i=null!=n?n:o.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=L(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function c(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&k(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=L(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=L(t);null==e||e.focus()},t.prepend(s),t.append(r);const l=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(i);if(D){const t=D;D.container.setAttribute("data-focus-trap","suspended"),D.controller.abort(),I.push(t)}l.signal.addEventListener("abort",(()=>{D=void 0})),i.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=I.findIndex((e=>e.container===t));n>=0&&I.splice(n,1),function(){const t=I.pop();t&&H(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{c(t.target)}),{signal:l.signal,capture:!0}),c(document.activeElement),D={container:t,controller:l,initialFocus:e,originalSignal:i};const u=I.findIndex((e=>e.container===t));if(u>=0&&I.splice(u,1),!n)return o}var R,$,F,O;function P(t){document.activeElement!==t&&(null==t||t.focus())}const q=[];function B(t){const e=t.target,n=null==e?void 0:e.closest("button");let o=null==n?void 0:n.getAttribute("data-show-dialog-id");if(n&&o){t.stopPropagation();const e=document.getElementById(o);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const i=q[q.length-1];if(!i)return;const s=!e.closest(`#${i.getAttribute("id")}`);n?(o=n.getAttribute("data-close-dialog-id"),o===i.id&&(q.pop(),i.close()),o=n.getAttribute("data-submit-dialog-id"),o===i.id&&(q.pop(),i.close(!0))):s&&(q.pop(),i.close())}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),R.add(this),$.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,o,i;if(t){if(this.open)return;this.setAttribute("open",""),null===(e=h(this,R,"a",F))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.overflow="hidden",h(this,$,"f").signal.aborted&&m(this,$,new AbortController,"f"),H(this,void 0,h(this,$,"f").signal),q.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=h(this,R,"a",F))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.overflow="initial",h(this,$,"f").abort();const t=(null===(o=this.openButton)||void 0===o?void 0:o.closest("details"))||(null===(i=this.openButton)||void 0===i?void 0:i.closest("action-menu"));P(t?L(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",B),this.addEventListener("keydown",(t=>h(this,R,"m",O).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}}$=new WeakMap,R=new WeakSet,F=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},O=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 W=new WeakSet;function N(t){X(t),U(t)}const Y=new WeakMap;function U(t=document){if(Y.has(t))return Y.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)z(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&X(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const o={get closed(){return e},unsubscribe(){e=!0,Y.delete(t),n.disconnect()}};return Y.set(t,o),o}function X(t){for(const e of t.querySelectorAll("[data-action]"))z(e);t instanceof Element&&t.hasAttribute("data-action")&&z(t)}function j(t){const e=t.currentTarget;for(const n of K(e))if(t.type===n.type){const o=e.closest(n.tag);W.has(o)&&"function"==typeof o[n.method]&&o[n.method](t);const i=e.getRootNode();if(i instanceof ShadowRoot&&W.has(i.host)&&i.host.matches(n.tag)){const e=i.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*K(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 z(t){for(const e of K(t))t.addEventListener(e.type,j)}const V=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),Z=(t,e="property")=>{const n=V(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const _="attr",J=new WeakSet;function G(t,e){if(J.has(t))return;J.add(t);const n=Object.getPrototypeOf(t),o=n?.constructor?.attrPrefix??"data-";e||(e=et(n,_));for(const n of e){const e=t[n],i=Z(`${o}${n}`);let s={configurable:!0,get(){return this.getAttribute(i)||""},set(t){this.setAttribute(i,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(i)||0)},set(t){this.setAttribute(i,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(i)},set(t){this.toggleAttribute(i,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(i)&&s.set.call(t,e)}}const Q=Symbol.for("catalyst");class tt{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const o=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,o)};const i=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,o){e.attributeChangedCallback(this,t,n,o,i)};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-",o=t=>Z(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...et(t.prototype,_)].map(o).concat(e),set(t){e=t}})}(t),function(t){const e=V(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),G(t),function(t){W.add(t),t.shadowRoot&&N(t.shadowRoot),X(t),U(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&N(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,o,i){G(t),"data-catalyst"!==e&&i&&i.call(t,e,n,o)}}function et(t,e){if(!Object.prototype.hasOwnProperty.call(t,Q)){const e=t[Q],n=t[Q]=new Map;if(e)for(const[t,o]of e)n.set(t,new Set(o))}const n=t[Q];return n.has(e)||n.set(e,new Set),n.get(e)}function nt(t,e){et(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 o of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!o.closest(n))return o;for(const o of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(o.closest(n)===t)return o}(this,e)}})}function ot(t,e){et(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),o=[];if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)||o.push(i);for(const i of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)===t&&o.push(i);return o}(this,e)}})}function it(t){new tt(t)}new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},o=()=>e.abort();document.addEventListener("mousedown",o,n),document.addEventListener("touchstart",o,n),document.addEventListener("keydown",o,n),document.addEventListener("pointerdown",o,n)}));let st=class NavListElement extends HTMLElement{connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false")}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0:t.getAttribute("aria-expanded"))}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let o;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;o=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const i=this.parseHTML(document,o);null===(e=null==i?void 0:i.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(i,this.showMoreItem),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}parseHTML(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)}};var rt,at;d([nt],st.prototype,"list",void 0),d([nt],st.prototype,"showMoreItem",void 0),d([ot],st.prototype,"focusMarkers",void 0),st=d([it],st);let ct=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),rt.add(this)}connectedCallback(){h(this,rt,"m",at).call(this)}select(t){var e,n;const o=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=o.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),o.setAttribute("aria-current","true")}};function lt(t,e=0,{start:n=!1,middle:o=!1,once:i=!1}={}){return function(t,e=0,{start:n=!0,middle:o=!0,once:i=!1}={}){let s,r=0,a=!1;function c(...l){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,l),i&&c.cancel()):(o&&u<e||!o)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,l),i&&c.cancel()}),o?e-u:e))}return c.cancel=()=>{clearTimeout(s),a=!0},c}(t,e,{start:n,middle:o,once:i})}rt=new WeakSet,at=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},d([ot],ct.prototype,"items",void 0),ct=d([it],ct),window.customElements.get("segmented-control")||(window.SegmentedControlElement=ct,window.customElements.define("segmented-control",ct));let ut=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.isRemote()?(this.setLoadingState(),this.check()):this.performToggle()}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-checked","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-checked","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-checked")}isOff(){return!this.isOn()}isDisabled(){return"true"===this.switch.getAttribute("aria-disabled")}disable(){this.switch.setAttribute("aria-disabled","true")}enable(){this.switch.setAttribute("aria-disabled","false")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.disable(),this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden")}setSuccessState(){this.setFinishedState(!1)}setErrorState(){this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden"),this.enable()}async check(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"1":"0");try{if(!this.src)throw new Error("invalid src");(await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})).ok?(this.setSuccessState(),this.performToggle()):this.setErrorState()}catch(t){this.setErrorState()}}};var dt,ht,mt,ft,pt,bt,gt;d([nt],ut.prototype,"switch",void 0),d([nt],ut.prototype,"loadingSpinner",void 0),d([nt],ut.prototype,"errorIcon",void 0),d([function(t=0,e={}){return(n,o,i)=>{if(!i||"function"!=typeof i.value)throw new Error("debounce can only decorate functions");const s=i.value;i.value=lt(s,t,e),Object.defineProperty(n,o,i)}}(300)],ut.prototype,"check",null),ut=d([it],ut),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=ut,window.customElements.define("toggle-switch",ut));const wt="tooltip-open",vt="sr-only",Et=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),dt.add(this),ht.set(this,void 0),mt.set(this,"center"),ft.set(this,"outside-bottom"),pt.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(vt,t),this.isConnected&&h(this,dt,"m",bt).call(this)}get hiddenFromView(){return this.classList.contains(vt)}connectedCallback(){var t;if(!this.shadowRoot){this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}if(this.hiddenFromView=!0,m(this,pt,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=h(this,ht,"f"))||void 0===t||t.abort(),m(this,ht,new AbortController,"f");const{signal:e}=h(this,ht,"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}),h(this,dt,"m",bt).call(this)}disconnectedCallback(){var t;null===(t=h(this,ht,"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){if("id"===t||"data-type"===t){if(!this.id||!this.control)return;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)}}else if("data-direction"===t){this.classList.remove(...Et);const t=this.direction;"n"===t?(m(this,mt,"center","f"),m(this,ft,"outside-top","f")):"ne"===t?(m(this,mt,"start","f"),m(this,ft,"outside-top","f")):"e"===t?(m(this,mt,"center","f"),m(this,ft,"outside-right","f")):"se"===t?(m(this,mt,"start","f"),m(this,ft,"outside-bottom","f")):"s"===t?(m(this,mt,"center","f"),m(this,ft,"outside-bottom","f")):"sw"===t?(m(this,mt,"end","f"),m(this,ft,"outside-bottom","f")):"w"===t?(m(this,mt,"center","f"),m(this,ft,"outside-left","f")):"nw"===t&&(m(this,mt,"end","f"),m(this,ft,"outside-top","f"))}}}ht=new WeakMap,mt=new WeakMap,ft=new WeakMap,pt=new WeakMap,dt=new WeakSet,bt=function(){if(this.hiddenFromView)this.classList.remove(wt,...Et);else{this.classList.add(wt);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);h(this,dt,"m",gt).call(this)}},gt=function(){if(!this.control)return;if(!h(this,pt,"f")||this.hiddenFromView)return;this.style.left="0px";const t=b(this,this.control,{side:h(this,ft,"f"),align:h(this,mt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let o="s";o="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-${o}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let yt=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")}};d([nt],yt.prototype,"titleText",void 0),yt=d([it],yt),window.customElements.get("x-banner")||(window.XBannerElement=yt,window.customElements.define("x-banner",yt));const At=!!navigator.userAgent.match(/Macintosh/);class Tt{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(!At&&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":At&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":At&&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",Mt)}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",Mt)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Lt)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Lt),o=n.indexOf(e);if(o===n.length-1&&1===t||0===o&&-1===t)return this.clearSelection(),void this.input.focus();let i=1===t?0:n.length-1;if(e&&o>=0){const e=o+t;e>=0&&e<n.length&&(i=e)}const s=n[i];if(s)for(const t of n)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),xt(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 Mt(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 Lt(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function xt(t,e){(function(t,e){const n=t.scrollTop,o=n+t.clientHeight,i=e.offsetTop,s=i+e.clientHeight;return i>=n&&s<=o})(t,e)||(t.scrollTop=e.offsetTop)}const kt=window.testScreenReaderDelay||100;class St{constructor(t,e,n,o=!1){var i;if(this.container=t,this.input=e,this.results=n,this.combobox=new Tt(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=o,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(...o){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...o)}),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===(i=this.clearButton)||void 0===i||i.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)}),kt)}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),o=new URLSearchParams(n.search.slice(1));o.append("q",t),n.search=o.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,o=e.length,[i]=e,s=null==i?void 0:i.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${o} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${o||"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 Ct extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const It=new WeakMap;function Dt(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=It.get(t);n&&n.abort();It.set(t,e);const o=()=>It.delete(t),i=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 i.then(o,o),i}(t,n)}const Ht=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=Dt}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 o="true"===this.getAttribute("data-autoselect");Ht.set(this,new St(this,e,n,o)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=Ht.get(this);t&&(t.destroy(),Ht.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 o=Ht.get(this);if(o)switch(t){case"open":null===n?o.close():o.open();break;case"value":null!==n&&(o.input.value=n),this.dispatchEvent(new Ct("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}function Rt(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 $t(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),Rt(n),e.removeChild(n),Promise.resolve()}function Ft(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function o(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)$t(n).then(o);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&&(i=s,i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement?$t(i.value):i instanceof HTMLAnchorElement&&i.hasAttribute("href")?$t(i.href):Rt(i)).then(o)}var i}function Ot(t){const e=t.currentTarget;e instanceof HTMLElement&&Ft(e)}function Pt(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),Ft(e))}}function qt(t){t.currentTarget.addEventListener("keydown",Pt)}function Bt(t){t.currentTarget.removeEventListener("keydown",Pt)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Ot),this.addEventListener("focus",qt),this.addEventListener("blur",Bt)}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 Wt(t){t.style.display="inline-block"}function Nt(t){t.style.display="none"}const Yt=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=Yt.get(t);e?(clearTimeout(e),Yt.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Nt(e),Wt(n))}(t),Yt.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Wt(e),Nt(n))}(t),Yt.delete(t)}),2e3))}));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=[jt(t,"compositionstart",(t=>ee(this,t))),jt(t,"compositionend",(t=>ee(this,t))),jt(t,"click",(e=>Jt(t,e))),jt(t,"change",(e=>Jt(t,e))),jt(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const o=Ut.get(e);if(!o||o.isComposing)return;const i=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(te(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{i&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Zt(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{i&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Zt(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(_t&&n.ctrlKey){const e=Zt(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(_t&&n.ctrlKey){const e=Zt(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&Qt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),jt(t,"toggle",(()=>Kt(t,this)),{once:!0}),jt(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?jt(t,"mouseover",(()=>Kt(t,this)),{once:!0}):Xt,...zt(t)];Ut.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Ut.get(this);if(t){Ut.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Ut=new WeakMap,Xt={unsubscribe(){}};function jt(t,e,n,o=!1){return t.addEventListener(e,n,o),{unsubscribe:()=>{t.removeEventListener(e,n,o)}}}function Kt(t,e){const n=e.getAttribute("src");if(!n)return;const o=Ut.get(e);if(!o)return;if(o.loaded)return;o.loaded=!0;const i=e.querySelector("include-fragment");i&&!i.hasAttribute("src")&&(i.addEventListener("loadend",(()=>Vt(t))),i.setAttribute("src",n))}function zt(t){let e=!1;return[jt(t,"mousedown",(()=>e=!0)),jt(t,"keydown",(()=>e=!1)),jt(t,"toggle",(()=>{t.hasAttribute("open")&&(Vt(t)||e||function(t){const e=document.activeElement;if(e&&Qt(e)&&t.contains(e))return;const n=Zt(t,!0);n&&n.focus()}(t))}))]}function Vt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function Zt(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),o=document.activeElement,i=o instanceof HTMLElement?n.indexOf(o):-1,s=e?n[i+1]:n[i-1],r=e?n[0]:n[n.length-1];return s||r}const _t=navigator.userAgent.match(/Macintosh/);function Jt(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 o=e.querySelector("input");if("LABEL"===e.tagName&&n===o)return;"LABEL"===e.tagName&&o&&!o.checked||Gt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&Gt(e,t)}}function Gt(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 o=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(o)n.textContent=o;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 o=(n===t).toString();e instanceof HTMLInputElement&&(o=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",o)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&te(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Qt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function te(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function ee(t,e){const n=Ut.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const ne=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],oe=["January","February","March","April","May","June","July","August","September","October","November","December"];function ie(t){return`0${t}`.slice(-2)}function se(t,e){const n=t.getDay(),o=t.getDate(),i=t.getMonth(),s=t.getFullYear(),r=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let l;switch(e[1]){case"%":return"%";case"a":return ne[n].slice(0,3);case"A":return ne[n];case"b":return oe[i].slice(0,3);case"B":return oe[i];case"c":return t.toString();case"d":return ie(o);case"e":return String(o);case"H":return ie(r);case"I":return ie(se(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return ie(i+1);case"M":return ie(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return ie(c);case"w":return String(n);case"y":return ie(s%100);case"Y":return String(s);case"Z":return l=t.toString().match(/\((\w+)\)$/),l?l[1]:"";case"z":return l=t.toString().match(/\w([+-]\d\d\d\d) /),l?l[1]:""}return""}))}function re(t){let e;return function(){if(e)return e;if("Intl"in window)try{return e=new Intl.DateTimeFormat(void 0,t),e}catch(t){if(!(t instanceof RangeError))throw t}}}let ae=null;const ce=re({day:"numeric",month:"short"});function le(){if(null!==ae)return ae;const t=ce();if(t){const e=t.format(new Date(0));return ae=!!e.match(/^\d/),ae}return!1}let ue=null;const de=re({day:"numeric",month:"short",year:"numeric"});function he(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const me=new WeakMap;class ExtendedTimeElement extends HTMLElement{static get observedAttributes(){return["datetime","day","format","lang","hour","minute","month","second","title","weekday","year","time-zone-name"]}connectedCallback(){const t=this.getFormattedTitle();t&&!this.hasAttribute("title")&&this.setAttribute("title",t);const e=this.getFormattedDate();e&&(this.textContent=e)}attributeChangedCallback(t,e,n){const o=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?me.delete(this):me.set(this,new Date(t))}const i=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!i||s&&s!==o||this.setAttribute("title",i);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return me.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=fe();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const fe=re({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),pe=new WeakMap;class LocalTimeElement extends ExtendedTimeElement{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||pe.delete(this),super.attributeChangedCallback(t,e,n)}getFormattedDate(){const t=this.date;if(!t)return;return`${function(t,e){const n={weekday:{short:"%a",long:"%A"},day:{numeric:"%e","2-digit":"%d"},month:{short:"%b",long:"%B"},year:{numeric:"%Y","2-digit":"%y"}};let o=le()?"weekday day month year":"weekday month day, year";for(const e in n){const i=n[e][t.getAttribute(e)||""];o=o.replace(e,i||"")}return o=o.replace(/(\s,)|(,\s$)/,""),se(e,o).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},o=t.getAttribute("hour");"numeric"!==o&&"2-digit"!==o||(n.hour=o);const i=t.getAttribute("minute");"numeric"!==i&&"2-digit"!==i||(n.minute=i);const s=t.getAttribute("second");"numeric"!==s&&"2-digit"!==s||(n.second=s);const r=t.getAttribute("time-zone-name");"short"!==r&&"long"!==r||(n.timeZoneName=r);if(0===Object.keys(n).length)return;let a=pe.get(t);a||(a=re(n),pe.set(t,a));const c=a();if(c)return c.format(e);return se(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=LocalTimeElement,window.customElements.define("local-time",LocalTimeElement));class be{constructor(t,e){this.date=t,this.locale=e}toString(){const t=this.timeElapsed();if(t)return t;{const t=this.timeAhead();return t||`on ${this.formatDate()}`}}timeElapsed(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24);return t>=0&&i<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24);return t>=0&&i<30?this.timeUntil():null}timeAgo(){const t=(new Date).getTime()-this.date.getTime();return this.timeAgoFromMs(t)}timeAgoFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return t<0||e<10?ge(this.locale,0,"second"):e<45?ge(this.locale,-e,"second"):e<90||n<45?ge(this.locale,-n,"minute"):n<90||o<24?ge(this.locale,-o,"hour"):o<36||i<30?ge(this.locale,-i,"day"):s<18?ge(this.locale,-s,"month"):ge(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:o<24?`${o}h`:i<365?`${i}d`:`${r}y`}timeUntil(){const t=this.date.getTime()-(new Date).getTime();return this.timeUntilFromMs(t)}timeUntilFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return s>=18||s>=12?ge(this.locale,r,"year"):i>=45||i>=30?ge(this.locale,s,"month"):o>=36||o>=24?ge(this.locale,i,"day"):n>=90||n>=45?ge(this.locale,o,"hour"):e>=90||e>=45?ge(this.locale,n,"minute"):ge(this.locale,e>=10?e:0,"second")}microTimeUntil(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return i>=365?`${r}y`:o>=24?`${i}d`:n>=60?`${o}h`:n>1?`${n}m`:"1m"}formatDate(){let t=le()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==ue)return ue;const t=de();if(t){const e=t.format(new Date(0));return ue=!!e.match(/\d,/),ue}return!0}()?", %Y":" %Y"),se(this.date,t)}formatTime(){const t=we();return t?t.format(this.date):se(this.date,"%l:%M%P")}}function ge(t,e,n){const o=function(t,e){if("Intl"in window&&"RelativeTimeFormat"in window.Intl)try{return new Intl.RelativeTimeFormat(t,e)}catch(t){if(!(t instanceof RangeError))throw t}}(t,{numeric:"auto"});return o?o.format(e,n):function(t,e){if(0===t)switch(e){case"year":case"quarter":case"month":case"week":return`this ${e}`;case"day":return"today";case"hour":case"minute":return`in 0 ${e}s`;case"second":return"now"}else if(1===t)switch(e){case"year":case"quarter":case"month":case"week":return`next ${e}`;case"day":return"tomorrow";case"hour":case"minute":case"second":return`in 1 ${e}`}else if(-1===t)switch(e){case"year":case"quarter":case"month":case"week":return`last ${e}`;case"day":return"yesterday";case"hour":case"minute":case"second":return`1 ${e} ago`}else if(t>1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`in ${t} ${e}s`}else if(t<-1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`${-t} ${e}s ago`}throw new RangeError(`Invalid unit argument for format() '${e}'`)}(e,n)}const we=re({hour:"numeric",minute:"2-digit"});class RelativeTimeElement extends ExtendedTimeElement{getFormattedDate(){const t=this.date;if(t)return new be(t,he(this)).toString()}connectedCallback(){ve.push(this),Ee||(ye(),Ee=window.setInterval(ye,6e4)),super.connectedCallback()}disconnectedCallback(){const t=ve.indexOf(this);-1!==t&&ve.splice(t,1),ve.length||Ee&&(clearInterval(Ee),Ee=null)}}const ve=[];let Ee;function ye(){let t,e,n;for(e=0,n=ve.length;e<n;e++)t=ve[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=RelativeTimeElement,window.customElements.define("relative-time",RelativeTimeElement));class TimeAgoElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new be(e,he(this)).microTimeAgo():new be(e,he(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=TimeAgoElement,window.customElements.define("time-ago",TimeAgoElement));class TimeUntilElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new be(e,he(this)).microTimeUntil():new be(e,he(this)).timeUntil()}}function Ae(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}window.customElements.get("time-until")||(window.TimeUntilElement=TimeUntilElement,window.customElements.define("time-until",TimeUntilElement));class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Ae(this),o=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[i,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(i.some((e=>t.code===e))){let t=o+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=o-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Ae(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const o=e.indexOf(n);this.selectTab(o)}))}connectedCallback(){for(const t of Ae(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=Ae(this),n=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const o=e[t],i=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:i}}))){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");o.setAttribute("aria-selected","true"),o.setAttribute("tabindex","0"),o.focus(),i.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:i}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement))}();
1
+ !function(){"use strict";class DetailsMenuElement extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const s=this.parentElement;if(!s)return;const l=s.querySelector("summary");l&&(l.setAttribute("aria-haspopup","menu"),l.hasAttribute("role")||l.setAttribute("role","button"));const m=[n(s,"compositionstart",(t=>h(this,t))),n(s,"compositionend",(t=>h(this,t))),n(s,"click",(t=>c(s,t))),n(s,"change",(t=>c(s,t))),n(s,"keydown",(e=>function(e,n,o){if(!(o instanceof KeyboardEvent))return;if(e.querySelector("details[open]"))return;const i=t.get(n);if(!i||i.isComposing)return;const s=o.target instanceof Element&&"SUMMARY"===o.target.tagName;switch(o.key){case"Escape":e.hasAttribute("open")&&(d(e),o.preventDefault(),o.stopPropagation());break;case"ArrowDown":{s&&!e.hasAttribute("open")&&e.setAttribute("open","");const t=r(e,!0);t&&t.focus(),o.preventDefault()}break;case"ArrowUp":{s&&!e.hasAttribute("open")&&e.setAttribute("open","");const t=r(e,!1);t&&t.focus(),o.preventDefault()}break;case"n":if(a&&o.ctrlKey){const t=r(e,!0);t&&t.focus(),o.preventDefault()}break;case"p":if(a&&o.ctrlKey){const t=r(e,!1);t&&t.focus(),o.preventDefault()}break;case" ":case"Enter":{const t=document.activeElement;t instanceof HTMLElement&&u(t)&&t.closest("details")===e&&(o.preventDefault(),o.stopPropagation(),t.click())}}}(s,this,e))),n(s,"toggle",(()=>o(s,this)),{once:!0}),n(s,"toggle",(()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const n=e.closest("details");n&&n!==t&&!n.contains(t)&&n.removeAttribute("open")}}(s))),this.preload?n(s,"mouseover",(()=>o(s,this)),{once:!0}):e,...i(s)];t.set(this,{subscriptions:m,loaded:!1,isComposing:!1})}disconnectedCallback(){const e=t.get(this);if(e){t.delete(this);for(const t of e.subscriptions)t.unsubscribe()}}}const t=new WeakMap,e={unsubscribe(){}};function n(t,e,n,o=!1){return t.addEventListener(e,n,o),{unsubscribe:()=>{t.removeEventListener(e,n,o)}}}function o(e,n){const o=n.getAttribute("src");if(!o)return;const i=t.get(n);if(!i)return;if(i.loaded)return;i.loaded=!0;const r=n.querySelector("include-fragment");r&&!r.hasAttribute("src")&&(r.addEventListener("loadend",(()=>s(e))),r.setAttribute("src",o))}function i(t){let e=!1;return[n(t,"mousedown",(()=>e=!0)),n(t,"keydown",(()=>e=!1)),n(t,"toggle",(()=>{t.hasAttribute("open")&&(s(t)||e||function(t){const e=document.activeElement;if(e&&u(e)&&t.contains(e))return;const n=r(t,!0);n&&n.focus()}(t))}))]}function s(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function r(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),o=document.activeElement,i=o instanceof HTMLElement?n.indexOf(o):-1,s=e?n[i+1]:n[i-1],r=e?n[0]:n[n.length-1];return s||r}const a=navigator.userAgent.match(/Macintosh/);function c(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 o=e.querySelector("input");if("LABEL"===e.tagName&&n===o)return;"LABEL"===e.tagName&&o&&!o.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 o=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(o)n.textContent=o;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 o=(n===t).toString();e instanceof HTMLInputElement&&(o=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",o)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&d(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function u(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function d(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function h(e,n){const o=t.get(e);o&&(o.isComposing="compositionstart"===n.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));const m=new WeakMap,f=new WeakMap,p=new WeakMap;function b(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:o}=p.get(e)||{};if(!n||!o)return;let i=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?i=-1:"ArrowRight"===t.key&&(i=1);else if(f.has(e)&&t instanceof MouseEvent){const n=f.get(e);i=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(f.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:o}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=f.get(e);i=n-r,s=o-a}if(0!==i||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+i),o.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),o.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,T(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)f.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:o}=t.changedTouches[0];f.set(e,{dragStartX:n,dragStartY:o})}}function g(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=w(e);if(!(n instanceof ImageCropElement))return;const{box:o}=p.get(n)||{};if(!o)return;const i=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return y(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=o.offsetWidth+a,r=o.offsetHeight+a,m.set(n,{startX:o.offsetLeft,startY:o.offsetTop})}else if(t instanceof MouseEvent){const e=m.get(n);if(!e)return;s=t.pageX-e.startX-i.left-window.pageXOffset,r=t.pageY-e.startY-i.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=m.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-i.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-i.top-window.pageYOffset}s&&r&&E(n,s,r,!(t instanceof KeyboardEvent))}function w(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function v(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=w(e);if(!(n instanceof ImageCropElement))return;const{box:o}=p.get(n)||{};if(!o)return;const i=t.target;if(i instanceof HTMLElement)if(i.hasAttribute("data-direction")){const e=i.getAttribute("data-direction")||"";n.addEventListener("mousemove",g),n.addEventListener("touchmove",g,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),m.set(n,{startX:o.offsetLeft+(["se","ne"].indexOf(e)>=0?0:o.offsetWidth),startY:o.offsetTop+(["se","sw"].indexOf(e)>=0?0:o.offsetHeight)}),g(t)}else n.addEventListener("mousemove",b),n.addEventListener("touchmove",b,{passive:!0})}function E(t,e,n,o=!0){let i=Math.max(Math.abs(e),Math.abs(n),10);const s=m.get(t);if(!s)return;const{box:r,image:a}=p.get(t)||{};if(!r||!a)return;i=Math.min(i,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const c=o?Math.round(Math.max(0,e>0?s.startX:s.startX-i)):r.offsetLeft,l=o?Math.round(Math.max(0,n>0?s.startY:s.startY-i)):r.offsetTop;r.style.left=`${c}px`,r.style.top=`${l}px`,r.style.width=`${i}px`,r.style.height=`${i}px`,T(t,{x:c,y:l,width:i,height:i})}function y(t){const{image:e}=p.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);m.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),E(t,n,n)}function A(t){const e=t.currentTarget;e instanceof ImageCropElement&&(f.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",g),e.removeEventListener("mousemove",b),e.removeEventListener("touchmove",g),e.removeEventListener("touchmove",b))}function T(t,e){const{image:n}=p.get(t)||{};if(!n)return;const o=n.naturalWidth/n.width;for(const n in e){const i=Math.round(e[n]*o);e[n]=i;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=i.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(p.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML='\n<style>\n :host { touch-action: none; display: block; }\n :host(.nesw) { cursor: nesw-resize; }\n :host(.nwse) { cursor: nwse-resize; }\n :host(.nesw) .crop-box, :host(.nwse) .crop-box { cursor: inherit; }\n :host([loaded]) .crop-image { display: block; }\n :host([loaded]) ::slotted([data-loading-slot]), .crop-image { display: none; }\n\n .crop-wrapper {\n position: relative;\n font-size: 0;\n }\n .crop-container {\n user-select: none;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n overflow: hidden;\n z-index: 1;\n top: 0;\n width: 100%;\n height: 100%;\n }\n\n :host([rounded]) .crop-box {\n border-radius: 50%;\n box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.3);\n }\n .crop-box {\n position: absolute;\n border: 1px dashed #fff;\n box-sizing: border-box;\n cursor: move;\n }\n\n :host([rounded]) .crop-outline {\n outline: none;\n }\n .crop-outline {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n outline: 4000px solid rgba(0, 0, 0, .3);\n }\n\n .handle { position: absolute; }\n :host([rounded]) .handle::before { border-radius: 50%; }\n .handle:before {\n position: absolute;\n display: block;\n padding: 4px;\n transform: translate(-50%, -50%);\n content: \' \';\n background: #fff;\n border: 1px solid #767676;\n }\n .ne { top: 0; right: 0; cursor: nesw-resize; }\n .nw { top: 0; left: 0; cursor: nwse-resize; }\n .se { bottom: 0; right: 0; cursor: nwse-resize; }\n .sw { bottom: 0; left: 0; cursor: nesw-resize; }\n</style>\n<slot></slot>\n<div class="crop-wrapper">\n <img width="100%" class="crop-image" alt="">\n <div class="crop-container">\n <div data-crop-box class="crop-box">\n <div class="crop-outline"></div>\n <div data-direction="nw" class="handle nw"></div>\n <div data-direction="ne" class="handle ne"></div>\n <div data-direction="sw" class="handle sw"></div>\n <div data-direction="se" class="handle se"></div>\n </div>\n </div>\n</div>\n';const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const n=t.querySelector("img");n instanceof HTMLImageElement&&(p.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,y(this)})),this.addEventListener("mouseleave",A),this.addEventListener("touchend",A),this.addEventListener("mouseup",A),e.addEventListener("mousedown",v),e.addEventListener("touchstart",v,{passive:!0}),this.addEventListener("keydown",b),this.addEventListener("keydown",g),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:o}=p.get(this)||{};"src"===t&&(this.loaded=!1,o&&(o.src=n))}}function M(t,e,n,o){var i,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(s<3?i(r):s>3?i(e,n,r):i(e,n))||r);return s>3&&r&&Object.defineProperty(e,n,r),r}function L(t,e,n,o){if("a"===n&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?o:"a"===n?o.call(t):o?o.value:e.get(t)}function x(t,e,n,o,i){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?i.call(t,n):i?i.value=n:e.set(t,n),n}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const k={"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"]},S={start:["end","center"],end:["start","center"],center:["end","start"]};function C(t,e,n={}){const o=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),i=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,o=n.getBoundingClientRect(),i=getComputedStyle(n),[s,r,a,c]=[i.borderTopWidth,i.borderLeftWidth,i.borderRightWidth,i.borderBottomWidth].map((t=>parseInt(t,10)||0));return{top:o.top+s,left:o.left+r,width:o.width-a-r,height:Math.max(o.height-s-c,n===document.body?window.innerHeight:-1/0)}}(o),s=getComputedStyle(o),r=o.getBoundingClientRect(),[a,c]=[s.borderTopWidth,s.borderLeftWidth].map((t=>parseInt(t,10)||0));return function(t,e,n,o,{side:i,align:s,allowOutOfBounds:r,anchorOffset:a,alignmentOffset:c}){const l={top:t.top-e.top,left:t.left-e.left,width:t.width,height:t.height};let u=F(n,o,i,s,a,c),d=i,h=s;if(u.top-=e.top,u.left-=e.left,!r){const r=k[i];let m=0;if(r){let t=i;for(;m<r.length&&O(t,u,l,n);){const i=r[m++];t=i,u=F(n,o,i,s,a,c),u.top-=e.top,u.left-=e.left,d=i}}const f=S[s];let p=0;if(f){let t=s;for(;p<f.length&&P(t,u,l,n);){const i=f[p++];t=i,u=F(n,o,d,i,a,c),u.top-=e.top,u.left-=e.left,h=i}}u.top<l.top&&(u.top=l.top),u.left<l.left&&(u.left=l.left),u.left+n.width>t.width+l.left&&(u.left=t.width+l.left-n.width),r&&m<r.length&&u.top+n.height>t.height+l.top&&(u.top=t.height+l.top-n.height)}return Object.assign(Object.assign({},u),{anchorSide:d,anchorAlign:h})}(i,{top:r.top+a,left:r.left+c},t.getBoundingClientRect(),e instanceof Element?e.getBoundingClientRect():e,function(t={}){var e,n,o,i,s;const r=null!==(e=t.side)&&void 0!==e?e:I,a=null!==(n=t.align)&&void 0!==n?n:D;return{side:r,align:a,anchorOffset:null!==(o=t.anchorOffset)&&void 0!==o?o:"inside-center"===r?0:H,alignmentOffset:null!==(i=t.alignmentOffset)&&void 0!==i?i:"center"!==a&&r.startsWith("inside")?R:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:$}}(n))}const I="outside-bottom",D="start",H=4,R=4,$=!1;function F(t,e,n,o,i,s){const r=e.left+e.width,a=e.top+e.height;let c=-1,l=-1;return"outside-top"===n?c=e.top-i-t.height:"outside-bottom"===n?c=a+i:"outside-left"===n?l=e.left-i-t.width:"outside-right"===n&&(l=r+i),"outside-top"!==n&&"outside-bottom"!==n||(l="start"===o?e.left+s:"center"===o?e.left-(t.width-e.width)/2+s:r-t.width-s),"outside-left"!==n&&"outside-right"!==n||(c="start"===o?e.top+s:"center"===o?e.top-(t.height-e.height)/2+s:a-t.height-s),"inside-top"===n?c=e.top+i:"inside-bottom"===n?c=a-i-t.height:"inside-left"===n?l=e.left+i:"inside-right"===n?l=r-i-t.width:"inside-center"===n&&(l=(r+e.left)/2-t.width/2+i),"inside-top"===n||"inside-bottom"===n?l="start"===o?e.left+s:"center"===o?e.left-(t.width-e.width)/2+s:r-t.width-s:"inside-left"!==n&&"inside-right"!==n&&"inside-center"!==n||(c="start"===o?e.top+s:"center"===o?e.top-(t.height-e.height)/2+s:a-t.height-s),{top:c,left:l}}function O(t,e,n,o){return"outside-top"===t||"outside-bottom"===t?e.top<n.top||e.top+o.height>n.height+n.top:e.left<n.left||e.left+o.width>n.width+n.left}function P(t,e,n,o){return"end"===t?e.left<n.left:"start"===t||"center"===t?e.left+o.width>n.left+n.width||e.left<n.left:void 0}function q(t,e=!1){return function*(t,e={}){var n,o;const i=null!==(n=e.strict)&&void 0!==n&&n,s=null!==(o=e.onlyTabbable)&&void 0!==o&&o?W:B,r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:t=>t instanceof HTMLElement&&s(t,i)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let a=null;if(!e.reverse&&s(t,i)&&(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,i)&&(yield t)}(t,{reverse:e,strict:!0,onlyTabbable:!0}).next().value}function B(t,e=!1){const n=["BUTTON","INPUT","SELECT","TEXTAREA","OPTGROUP","OPTION","FIELDSET"].includes(t.tagName)&&t.disabled,o=t.hidden,i=t instanceof HTMLInputElement&&"hidden"===t.type,s=t.classList.contains("sentinel");if(n||o||i||s)return!1;if(e){const e=0===t.offsetWidth||0===t.offsetHeight,n=["hidden","collapse"].includes(getComputedStyle(t).visibility),o=0===t.getClientRects().length;if(e||n||o)return!1}return null!=t.getAttribute("tabindex")||!(t instanceof HTMLAnchorElement&&null==t.getAttribute("href"))&&-1!==t.tabIndex}function W(t,e=!1){return B(t,e)&&"-1"!==t.getAttribute("tabindex")}let N=!1;function Y(){}try{const t=Object.create({},{signal:{get(){N=!0}}});window.addEventListener("test",Y,t),window.removeEventListener("test",Y,t)}catch(t){}N||(function(){if("undefined"==typeof window)return;const t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(e,n,o){return"object"==typeof o&&"signal"in o&&o.signal instanceof AbortSignal&&t.call(o.signal,"abort",(()=>{this.removeEventListener(e,n,o)})),t.call(this,e,n,o)}}(),N=!0);const U=[];let X;function j(t,e,n){const o=new AbortController,i=null!=n?n:o.signal;t.setAttribute("data-focus-trap","active");const s=document.createElement("span");s.setAttribute("class","sentinel"),s.setAttribute("tabindex","0"),s.setAttribute("aria-hidden","true"),s.onfocus=()=>{const e=q(t,!0);null==e||e.focus()};const r=document.createElement("span");let a;function c(n){if(n instanceof HTMLElement&&document.contains(t)){if(t.contains(n))return void(a=n);if(a&&W(a)&&t.contains(a))return void a.focus();if(e&&t.contains(e))return void e.focus();{const e=q(t);return void(null==e||e.focus())}}}r.setAttribute("class","sentinel"),r.setAttribute("tabindex","0"),r.setAttribute("aria-hidden","true"),r.onfocus=()=>{const e=q(t);null==e||e.focus()},t.prepend(s),t.append(r);const l=function(t){const e=new AbortController;return t.addEventListener("abort",(()=>{e.abort()})),e}(i);if(X){const t=X;X.container.setAttribute("data-focus-trap","suspended"),X.controller.abort(),U.push(t)}l.signal.addEventListener("abort",(()=>{X=void 0})),i.addEventListener("abort",(()=>{t.removeAttribute("data-focus-trap");const e=t.getElementsByClassName("sentinel");for(;e.length>0;)e[0].remove();const n=U.findIndex((e=>e.container===t));n>=0&&U.splice(n,1),function(){const t=U.pop();t&&j(t.container,t.initialFocus,t.originalSignal)}()})),document.addEventListener("focus",(t=>{c(t.target)}),{signal:l.signal,capture:!0}),c(document.activeElement),X={container:t,controller:l,initialFocus:e,originalSignal:i};const u=U.findIndex((e=>e.container===t));if(u>=0&&U.splice(u,1),!n)return o}var K,z,V,Z;function _(t){document.activeElement!==t&&(null==t||t.focus())}const J=[];function G(t){const e=t.target,n=null==e?void 0:e.closest("button");let o=null==n?void 0:n.getAttribute("data-show-dialog-id");if(n&&o){t.stopPropagation();const e=document.getElementById(o);if(e instanceof ModalDialogElement)return e.openButton=n,void e.show()}const i=J[J.length-1];if(!i)return;const s=!e.closest(`#${i.getAttribute("id")}`);n?(o=n.getAttribute("data-close-dialog-id"),o===i.id&&(J.pop(),i.close()),o=n.getAttribute("data-submit-dialog-id"),o===i.id&&(J.pop(),i.close(!0))):s&&(J.pop(),i.close())}class ModalDialogElement extends HTMLElement{constructor(){super(...arguments),K.add(this),z.set(this,new AbortController)}get open(){return this.hasAttribute("open")}set open(t){var e,n,o,i;if(t){if(this.open)return;this.setAttribute("open",""),null===(e=L(this,K,"a",V))||void 0===e||e.classList.remove("Overlay--hidden"),document.body.style.overflow="hidden",L(this,z,"f").signal.aborted&&x(this,z,new AbortController,"f"),j(this,void 0,L(this,z,"f").signal),J.push(this)}else{if(!this.open)return;this.removeAttribute("open"),null===(n=L(this,K,"a",V))||void 0===n||n.classList.add("Overlay--hidden"),document.body.style.overflow="initial",L(this,z,"f").abort();const t=(null===(o=this.openButton)||void 0===o?void 0:o.closest("details"))||(null===(i=this.openButton)||void 0===i?void 0:i.closest("action-menu"));_(t?q(t):this.openButton),this.openButton=null}}get showButtons(){return document.querySelectorAll(`button[data-show-dialog-id='${this.id}']`)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","dialog"),document.addEventListener("click",G),this.addEventListener("keydown",(t=>L(this,K,"m",Z).call(this,t)))}show(){this.open=!0}close(t=!1){if(!1===this.open)return;const e=new Event(t?"close":"cancel");this.dispatchEvent(e),this.open=!1}}z=new WeakMap,K=new WeakSet,V=function(){var t;return(null===(t=this.parentElement)||void 0===t?void 0:t.hasAttribute("data-modal-dialog-overlay"))?this.parentElement:null},Z=function(t){if(t instanceof KeyboardEvent&&!t.isComposing)switch(t.key){case"Escape":this.open&&(this.close(),t.preventDefault(),t.stopPropagation())}},window.customElements.get("modal-dialog")||(window.ModalDialogElement=ModalDialogElement,window.customElements.define("modal-dialog",ModalDialogElement));const Q=new WeakSet;function tt(t){ot(t),nt(t)}const et=new WeakMap;function nt(t=document){if(et.has(t))return et.get(t);let e=!1;const n=new MutationObserver((t=>{for(const e of t)if("attributes"===e.type&&e.target instanceof Element)rt(e.target);else if("childList"===e.type&&e.addedNodes.length)for(const t of e.addedNodes)t instanceof Element&&ot(t)}));n.observe(t,{childList:!0,subtree:!0,attributeFilter:["data-action"]});const o={get closed(){return e},unsubscribe(){e=!0,et.delete(t),n.disconnect()}};return et.set(t,o),o}function ot(t){for(const e of t.querySelectorAll("[data-action]"))rt(e);t instanceof Element&&t.hasAttribute("data-action")&&rt(t)}function it(t){const e=t.currentTarget;for(const n of st(e))if(t.type===n.type){const o=e.closest(n.tag);Q.has(o)&&"function"==typeof o[n.method]&&o[n.method](t);const i=e.getRootNode();if(i instanceof ShadowRoot&&Q.has(i.host)&&i.host.matches(n.tag)){const e=i.host;"function"==typeof e[n.method]&&e[n.method](t)}}}function*st(t){for(const e of(t.getAttribute("data-action")||"").trim().split(/\s+/)){const t=e.lastIndexOf(":"),n=Math.max(0,e.lastIndexOf("#"))||e.length;yield{type:e.slice(0,t),tag:e.slice(t+1,n),method:e.slice(n+1)||"handleEvent"}||"handleEvent"}}function rt(t){for(const e of st(t))t.addEventListener(e.type,it)}const at=t=>String("symbol"==typeof t?t.description:t).replace(/([A-Z]($|[a-z]))/g,"-$1").replace(/--/g,"-").replace(/^-|-$/,"").toLowerCase(),ct=(t,e="property")=>{const n=at(t);if(!n.includes("-"))throw new DOMException(`${e}: ${String(t)} is not a valid ${e} name`,"SyntaxError");return n};const lt="attr",ut=new WeakSet;function dt(t,e){if(ut.has(t))return;ut.add(t);const n=Object.getPrototypeOf(t),o=n?.constructor?.attrPrefix??"data-";e||(e=ft(n,lt));for(const n of e){const e=t[n],i=ct(`${o}${n}`);let s={configurable:!0,get(){return this.getAttribute(i)||""},set(t){this.setAttribute(i,t||"")}};"number"==typeof e?s={configurable:!0,get(){return Number(this.getAttribute(i)||0)},set(t){this.setAttribute(i,t)}}:"boolean"==typeof e&&(s={configurable:!0,get(){return this.hasAttribute(i)},set(t){this.toggleAttribute(i,t)}}),Object.defineProperty(t,n,s),n in t&&!t.hasAttribute(i)&&s.set.call(t,e)}}const ht=Symbol.for("catalyst");class mt{constructor(t){const e=this,n=t.prototype.connectedCallback;t.prototype.connectedCallback=function(){e.connectedCallback(this,n)};const o=t.prototype.disconnectedCallback;t.prototype.disconnectedCallback=function(){e.disconnectedCallback(this,o)};const i=t.prototype.attributeChangedCallback;t.prototype.attributeChangedCallback=function(t,n,o){e.attributeChangedCallback(this,t,n,o,i)};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-",o=t=>ct(`${n}${t}`);Object.defineProperty(t,"observedAttributes",{configurable:!0,get:()=>[...ft(t.prototype,lt)].map(o).concat(e),set(t){e=t}})}(t),function(t){const e=at(t.name).replace(/-element$/,"");try{window.customElements.define(e,t),window[t.name]=customElements.get(e)}catch(t){if(!(t instanceof DOMException&&"NotSupportedError"===t.name))throw t}}(t)}observedAttributes(t,e){return e}connectedCallback(t,e){t.toggleAttribute("data-catalyst",!0),customElements.upgrade(t),function(t){for(const e of t.querySelectorAll("template[data-shadowroot]"))e.parentElement===t&&t.attachShadow({mode:"closed"===e.getAttribute("data-shadowroot")?"closed":"open"}).append(e.content.cloneNode(!0))}(t),dt(t),function(t){Q.add(t),t.shadowRoot&&tt(t.shadowRoot),ot(t),nt(t.ownerDocument)}(t),e?.call(t),t.shadowRoot&&tt(t.shadowRoot)}disconnectedCallback(t,e){e?.call(t)}attributeChangedCallback(t,e,n,o,i){dt(t),"data-catalyst"!==e&&i&&i.call(t,e,n,o)}}function ft(t,e){if(!Object.prototype.hasOwnProperty.call(t,ht)){const e=t[ht],n=t[ht]=new Map;if(e)for(const[t,o]of e)n.set(t,new Set(o))}const n=t[ht];return n.has(e)||n.set(e,new Set),n.get(e)}function pt(t,e){ft(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 o of t.shadowRoot.querySelectorAll(`[data-target~="${n}.${e}"]`))if(!o.closest(n))return o;for(const o of t.querySelectorAll(`[data-target~="${n}.${e}"]`))if(o.closest(n)===t)return o}(this,e)}})}function bt(t,e){ft(t,"targets").add(e),Object.defineProperty(t,e,{configurable:!0,get(){return function(t,e){const n=t.tagName.toLowerCase(),o=[];if(t.shadowRoot)for(const i of t.shadowRoot.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)||o.push(i);for(const i of t.querySelectorAll(`[data-targets~="${n}.${e}"]`))i.closest(n)===t&&o.push(i);return o}(this,e)}})}function gt(t){new mt(t)}new Promise((t=>{"loading"!==document.readyState?t():document.addEventListener("readystatechange",(()=>t()),{once:!0})})),new Promise((t=>{const e=new AbortController;e.signal.addEventListener("abort",(()=>t()));const n={once:!0,passive:!0,signal:e.signal},o=()=>e.abort();document.addEventListener("mousedown",o,n),document.addEventListener("touchstart",o,n),document.addEventListener("keydown",o,n),document.addEventListener("pointerdown",o,n)}));let wt=class NavListElement extends HTMLElement{connectedCallback(){this.setShowMoreItemState()}get showMoreDisabled(){return this.showMoreItem.hasAttribute("aria-disabled")}set showMoreDisabled(t){t?this.showMoreItem.setAttribute("aria-disabled","true"):this.showMoreItem.removeAttribute("aria-disabled"),this.showMoreItem.classList.toggle("disabled",t)}set currentPage(t){this.showMoreItem.setAttribute("data-current-page",t.toString())}get currentPage(){return parseInt(this.showMoreItem.getAttribute("data-current-page"))||1}get totalPages(){return parseInt(this.showMoreItem.getAttribute("data-total-pages"))||1}get paginationSrc(){return this.showMoreItem.getAttribute("src")||""}expandItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.removeAttribute("data-hidden"),t.setAttribute("aria-expanded","true")}collapseItem(t){var e;null===(e=t.nextElementSibling)||void 0===e||e.setAttribute("data-hidden",""),t.setAttribute("aria-expanded","false")}itemIsExpanded(t){return"A"===(null==t?void 0:t.tagName)||"true"===(null==t?void 0:t.getAttribute("aria-expanded"))}handleItemWithSubItemClick(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("button");n&&(this.itemIsExpanded(n)?this.collapseItem(n):this.expandItem(n),t.stopPropagation())}async showMore(t){var e,n;if(t.preventDefault(),this.showMoreDisabled)return;let o;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;o=await e.text(),this.currentPage===this.totalPages&&(this.showMoreItem.hidden=!0)}catch(t){return this.showMoreDisabled=!1,void this.currentPage--}const i=this.parseHTML(document,o);null===(e=null==i?void 0:i.querySelector("li > a"))||void 0===e||e.setAttribute("data-targets","nav-list.focusMarkers"),this.list.insertBefore(i,this.showMoreItem),null===(n=this.focusMarkers.pop())||void 0===n||n.focus(),this.showMoreDisabled=!1}setShowMoreItemState(){this.showMoreItem&&(this.currentPage<this.totalPages?this.showMoreItem.hidden=!1:this.showMoreItem.hidden=!0)}parseHTML(t,e){const n=t.createElement("template");return n.innerHTML=e,t.importNode(n.content,!0)}};var vt,Et;M([pt],wt.prototype,"list",void 0),M([pt],wt.prototype,"showMoreItem",void 0),M([bt],wt.prototype,"focusMarkers",void 0),wt=M([gt],wt);let yt=class SegmentedControlElement extends HTMLElement{constructor(){super(...arguments),vt.add(this)}connectedCallback(){L(this,vt,"m",Et).call(this)}select(t){var e,n;const o=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=o.closest("li.SegmentedControl-item"))||void 0===n||n.classList.add("SegmentedControl-item--selected"),o.setAttribute("aria-current","true")}};function At(t,e=0,{start:n=!1,middle:o=!1,once:i=!1}={}){return function(t,e=0,{start:n=!0,middle:o=!0,once:i=!1}={}){let s,r=0,a=!1;function c(...l){if(a)return;const u=Date.now()-r;r=Date.now(),n?(n=!1,t.apply(this,l),i&&c.cancel()):(o&&u<e||!o)&&(clearTimeout(s),s=setTimeout((()=>{r=Date.now(),t.apply(this,l),i&&c.cancel()}),o?e-u:e))}return c.cancel=()=>{clearTimeout(s),a=!0},c}(t,e,{start:n,middle:o,once:i})}vt=new WeakSet,Et=function(){for(const t of this.querySelectorAll(".Button-label"))t.setAttribute("data-content",t.textContent||"")},M([bt],yt.prototype,"items",void 0),yt=M([gt],yt),window.customElements.get("segmented-control")||(window.SegmentedControlElement=yt,window.customElements.define("segmented-control",yt));let Tt=class ToggleSwitchElement extends HTMLElement{get src(){const t=this.getAttribute("src");if(!t)return null;const e=this.ownerDocument.createElement("a");return e.href=t,e.href}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||null}get csrfField(){return this.getAttribute("csrf-field")||"authenticity_token"}isRemote(){return null!=this.src}toggle(){this.isRemote()?(this.setLoadingState(),this.check()):this.performToggle()}turnOn(){this.isDisabled()||(this.switch.setAttribute("aria-checked","true"),this.classList.add("ToggleSwitch--checked"))}turnOff(){this.isDisabled()||(this.switch.setAttribute("aria-checked","false"),this.classList.remove("ToggleSwitch--checked"))}isOn(){return"true"===this.switch.getAttribute("aria-checked")}isOff(){return!this.isOn()}isDisabled(){return"true"===this.switch.getAttribute("aria-disabled")}disable(){this.switch.setAttribute("aria-disabled","true")}enable(){this.switch.setAttribute("aria-disabled","false")}performToggle(){this.isOn()?this.turnOff():this.turnOn()}setLoadingState(){this.disable(),this.errorIcon.setAttribute("hidden","hidden"),this.loadingSpinner.removeAttribute("hidden")}setSuccessState(){this.setFinishedState(!1)}setErrorState(){this.setFinishedState(!0)}setFinishedState(t){t&&this.errorIcon.removeAttribute("hidden"),this.loadingSpinner.setAttribute("hidden","hidden"),this.enable()}async check(){const t=new FormData;this.csrf&&t.append(this.csrfField,this.csrf),t.append("value",this.isOn()?"1":"0");try{if(!this.src)throw new Error("invalid src");(await fetch(this.src,{credentials:"same-origin",method:"POST",headers:{"Requested-With":"XMLHttpRequest"},body:t})).ok?(this.setSuccessState(),this.performToggle()):this.setErrorState()}catch(t){this.setErrorState()}}};var Mt,Lt,xt,kt,St,Ct,It;M([pt],Tt.prototype,"switch",void 0),M([pt],Tt.prototype,"loadingSpinner",void 0),M([pt],Tt.prototype,"errorIcon",void 0),M([function(t=0,e={}){return(n,o,i)=>{if(!i||"function"!=typeof i.value)throw new Error("debounce can only decorate functions");const s=i.value;i.value=At(s,t,e),Object.defineProperty(n,o,i)}}(300)],Tt.prototype,"check",null),Tt=M([gt],Tt),window.customElements.get("toggle-switch")||(window.ToggleSwitchElement=Tt,window.customElements.define("toggle-switch",Tt));const Dt="tooltip-open",Ht="sr-only",Rt=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class ToolTipElement extends HTMLElement{constructor(){super(...arguments),Mt.add(this),Lt.set(this,void 0),xt.set(this,"center"),kt.set(this,"outside-bottom"),St.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(Ht,t),this.isConnected&&L(this,Mt,"m",Ct).call(this)}get hiddenFromView(){return this.classList.contains(Ht)}connectedCallback(){var t;if(!this.shadowRoot){this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}if(this.hiddenFromView=!0,x(this,St,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=L(this,Lt,"f"))||void 0===t||t.abort(),x(this,Lt,new AbortController,"f");const{signal:e}=L(this,Lt,"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}),L(this,Mt,"m",Ct).call(this)}disconnectedCallback(){var t;null===(t=L(this,Lt,"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){if("id"===t||"data-type"===t){if(!this.id||!this.control)return;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)}}else if("data-direction"===t){this.classList.remove(...Rt);const t=this.direction;"n"===t?(x(this,xt,"center","f"),x(this,kt,"outside-top","f")):"ne"===t?(x(this,xt,"start","f"),x(this,kt,"outside-top","f")):"e"===t?(x(this,xt,"center","f"),x(this,kt,"outside-right","f")):"se"===t?(x(this,xt,"start","f"),x(this,kt,"outside-bottom","f")):"s"===t?(x(this,xt,"center","f"),x(this,kt,"outside-bottom","f")):"sw"===t?(x(this,xt,"end","f"),x(this,kt,"outside-bottom","f")):"w"===t?(x(this,xt,"center","f"),x(this,kt,"outside-left","f")):"nw"===t&&(x(this,xt,"end","f"),x(this,kt,"outside-top","f"))}}}Lt=new WeakMap,xt=new WeakMap,kt=new WeakMap,St=new WeakMap,Mt=new WeakSet,Ct=function(){if(this.hiddenFromView)this.classList.remove(Dt,...Rt);else{this.classList.add(Dt);for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hiddenFromView=!0);L(this,Mt,"m",It).call(this)}},It=function(){if(!this.control)return;if(!L(this,St,"f")||this.hiddenFromView)return;this.style.left="0px";const t=C(this,this.control,{side:L(this,kt,"f"),align:L(this,xt,"f"),anchorOffset:10}),e=t.anchorSide,n=t.anchorAlign;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let o="s";o="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-${o}`)},ToolTipElement.observedAttributes=["data-type","data-direction","id"],window.customElements.get("tool-tip")||(window.ToolTipElement=ToolTipElement,window.customElements.define("tool-tip",ToolTipElement));let $t=class XBannerElement extends HTMLElement{dismiss(){if(this.shouldReappear())return this.style.setProperty("visibility","hidden"),void setTimeout((()=>{this.style.setProperty("visibility","visible")}),2e3);const t=this.parentElement;t&&t.removeChild(this)}shouldReappear(){return"true"===this.getAttribute("data-reappear")}};M([pt],$t.prototype,"titleText",void 0),$t=M([gt],$t),window.customElements.get("x-banner")||(window.XBannerElement=$t,window.customElements.define("x-banner",$t));const Ft=!!navigator.userAgent.match(/Macintosh/);class Ot{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(!Ft&&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":Ft&&t.ctrlKey&&(e.navigate(1),t.preventDefault());break;case"p":Ft&&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",Pt)}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",Pt)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(qt)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(qt),o=n.indexOf(e);if(o===n.length-1&&1===t||0===o&&-1===t)return this.clearSelection(),void this.input.focus();let i=1===t?0:n.length-1;if(e&&o>=0){const e=o+t;e>=0&&e<n.length&&(i=e)}const s=n[i];if(s)for(const t of n)s===t?(this.input.setAttribute("aria-activedescendant",s.id),s.setAttribute("aria-selected","true"),Bt(this.list,s)):t.setAttribute("aria-selected","false")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.setAttribute("aria-selected","false")}}function Pt(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 qt(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function Bt(t,e){(function(t,e){const n=t.scrollTop,o=n+t.clientHeight,i=e.offsetTop,s=i+e.clientHeight;return i>=n&&s<=o})(t,e)||(t.scrollTop=e.offsetTop)}const Wt=window.testScreenReaderDelay||100;class Nt{constructor(t,e,n,o=!1){var i;if(this.container=t,this.input=e,this.results=n,this.combobox=new Ot(e,n),this.feedback=document.getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=o,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(...o){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...o)}),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===(i=this.clearButton)||void 0===i||i.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)}),Wt)}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),o=new URLSearchParams(n.search.slice(1));o.append("q",t),n.search=o.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,o=e.length,[i]=e,s=null==i?void 0:i.textContent;this.autoselectEnabled&&s?this.updateFeedbackForScreenReaders(`${o} results. ${s} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${o||"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 Yt extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const Ut=new WeakMap;function Xt(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=Ut.get(t);n&&n.abort();Ut.set(t,e);const o=()=>Ut.delete(t),i=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 i.then(o,o),i}(t,n)}const jt=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super(...arguments),this.fetchResult=Xt}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 o="true"===this.getAttribute("data-autoselect");jt.set(this,new Nt(this,e,n,o)),n.setAttribute("role","listbox")}disconnectedCallback(){const t=jt.get(this);t&&(t.destroy(),jt.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 o=jt.get(this);if(o)switch(t){case"open":null===n?o.close():o.open();break;case"value":null!==n&&(o.input.value=n),this.dispatchEvent(new Yt("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}function Kt(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.textContent);const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const n=document.createRange();return n.selectNodeContents(t),e.addRange(n),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function zt(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const n=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(t);return e.appendChild(n),Kt(n),e.removeChild(n),Promise.resolve()}function Vt(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function o(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)zt(n).then(o);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&&(i=s,i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement?zt(i.value):i instanceof HTMLAnchorElement&&i.hasAttribute("href")?zt(i.href):Kt(i)).then(o)}var i}function Zt(t){const e=t.currentTarget;e instanceof HTMLElement&&Vt(e)}function _t(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),Vt(e))}}function Jt(t){t.currentTarget.addEventListener("keydown",_t)}function Gt(t){t.currentTarget.removeEventListener("keydown",_t)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement));class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",Zt),this.addEventListener("focus",Jt),this.addEventListener("blur",Gt)}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 Qt(t){t.style.display="inline-block"}function te(t){t.style.display="none"}const ee=new WeakMap;document.addEventListener("clipboard-copy",(({target:t})=>{if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=ee.get(t);e?(clearTimeout(e),ee.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(te(e),Qt(n))}(t),ee.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(Qt(e),te(n))}(t),ee.delete(t)}),2e3))}));const ne=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],oe=["January","February","March","April","May","June","July","August","September","October","November","December"];function ie(t){return`0${t}`.slice(-2)}function se(t,e){const n=t.getDay(),o=t.getDate(),i=t.getMonth(),s=t.getFullYear(),r=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let l;switch(e[1]){case"%":return"%";case"a":return ne[n].slice(0,3);case"A":return ne[n];case"b":return oe[i].slice(0,3);case"B":return oe[i];case"c":return t.toString();case"d":return ie(o);case"e":return String(o);case"H":return ie(r);case"I":return ie(se(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return ie(i+1);case"M":return ie(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return ie(c);case"w":return String(n);case"y":return ie(s%100);case"Y":return String(s);case"Z":return l=t.toString().match(/\((\w+)\)$/),l?l[1]:"";case"z":return l=t.toString().match(/\w([+-]\d\d\d\d) /),l?l[1]:""}return""}))}function re(t){let e;return function(){if(e)return e;if("Intl"in window)try{return e=new Intl.DateTimeFormat(void 0,t),e}catch(t){if(!(t instanceof RangeError))throw t}}}let ae=null;const ce=re({day:"numeric",month:"short"});function le(){if(null!==ae)return ae;const t=ce();if(t){const e=t.format(new Date(0));return ae=!!e.match(/^\d/),ae}return!1}let ue=null;const de=re({day:"numeric",month:"short",year:"numeric"});function he(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const me=new WeakMap;class ExtendedTimeElement extends HTMLElement{static get observedAttributes(){return["datetime","day","format","lang","hour","minute","month","second","title","weekday","year","time-zone-name"]}connectedCallback(){const t=this.getFormattedTitle();t&&!this.hasAttribute("title")&&this.setAttribute("title",t);const e=this.getFormattedDate();e&&(this.textContent=e)}attributeChangedCallback(t,e,n){const o=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?me.delete(this):me.set(this,new Date(t))}const i=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!i||s&&s!==o||this.setAttribute("title",i);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return me.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=fe();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const fe=re({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),pe=new WeakMap;class LocalTimeElement extends ExtendedTimeElement{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||pe.delete(this),super.attributeChangedCallback(t,e,n)}getFormattedDate(){const t=this.date;if(!t)return;return`${function(t,e){const n={weekday:{short:"%a",long:"%A"},day:{numeric:"%e","2-digit":"%d"},month:{short:"%b",long:"%B"},year:{numeric:"%Y","2-digit":"%y"}};let o=le()?"weekday day month year":"weekday month day, year";for(const e in n){const i=n[e][t.getAttribute(e)||""];o=o.replace(e,i||"")}return o=o.replace(/(\s,)|(,\s$)/,""),se(e,o).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},o=t.getAttribute("hour");"numeric"!==o&&"2-digit"!==o||(n.hour=o);const i=t.getAttribute("minute");"numeric"!==i&&"2-digit"!==i||(n.minute=i);const s=t.getAttribute("second");"numeric"!==s&&"2-digit"!==s||(n.second=s);const r=t.getAttribute("time-zone-name");"short"!==r&&"long"!==r||(n.timeZoneName=r);if(0===Object.keys(n).length)return;let a=pe.get(t);a||(a=re(n),pe.set(t,a));const c=a();if(c)return c.format(e);return se(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=LocalTimeElement,window.customElements.define("local-time",LocalTimeElement));class be{constructor(t,e){this.date=t,this.locale=e}toString(){const t=this.timeElapsed();if(t)return t;{const t=this.timeAhead();return t||`on ${this.formatDate()}`}}timeElapsed(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24);return t>=0&&i<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24);return t>=0&&i<30?this.timeUntil():null}timeAgo(){const t=(new Date).getTime()-this.date.getTime();return this.timeAgoFromMs(t)}timeAgoFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return t<0||e<10?ge(this.locale,0,"second"):e<45?ge(this.locale,-e,"second"):e<90||n<45?ge(this.locale,-n,"minute"):n<90||o<24?ge(this.locale,-o,"hour"):o<36||i<30?ge(this.locale,-i,"day"):s<18?ge(this.locale,-s,"month"):ge(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:o<24?`${o}h`:i<365?`${i}d`:`${r}y`}timeUntil(){const t=this.date.getTime()-(new Date).getTime();return this.timeUntilFromMs(t)}timeUntilFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return s>=18||s>=12?ge(this.locale,r,"year"):i>=45||i>=30?ge(this.locale,s,"month"):o>=36||o>=24?ge(this.locale,i,"day"):n>=90||n>=45?ge(this.locale,o,"hour"):e>=90||e>=45?ge(this.locale,n,"minute"):ge(this.locale,e>=10?e:0,"second")}microTimeUntil(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),o=Math.round(n/60),i=Math.round(o/24),s=Math.round(i/30),r=Math.round(s/12);return i>=365?`${r}y`:o>=24?`${i}d`:n>=60?`${o}h`:n>1?`${n}m`:"1m"}formatDate(){let t=le()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==ue)return ue;const t=de();if(t){const e=t.format(new Date(0));return ue=!!e.match(/\d,/),ue}return!0}()?", %Y":" %Y"),se(this.date,t)}formatTime(){const t=we();return t?t.format(this.date):se(this.date,"%l:%M%P")}}function ge(t,e,n){const o=function(t,e){if("Intl"in window&&"RelativeTimeFormat"in window.Intl)try{return new Intl.RelativeTimeFormat(t,e)}catch(t){if(!(t instanceof RangeError))throw t}}(t,{numeric:"auto"});return o?o.format(e,n):function(t,e){if(0===t)switch(e){case"year":case"quarter":case"month":case"week":return`this ${e}`;case"day":return"today";case"hour":case"minute":return`in 0 ${e}s`;case"second":return"now"}else if(1===t)switch(e){case"year":case"quarter":case"month":case"week":return`next ${e}`;case"day":return"tomorrow";case"hour":case"minute":case"second":return`in 1 ${e}`}else if(-1===t)switch(e){case"year":case"quarter":case"month":case"week":return`last ${e}`;case"day":return"yesterday";case"hour":case"minute":case"second":return`1 ${e} ago`}else if(t>1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`in ${t} ${e}s`}else if(t<-1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return`${-t} ${e}s ago`}throw new RangeError(`Invalid unit argument for format() '${e}'`)}(e,n)}const we=re({hour:"numeric",minute:"2-digit"});class RelativeTimeElement extends ExtendedTimeElement{getFormattedDate(){const t=this.date;if(t)return new be(t,he(this)).toString()}connectedCallback(){ve.push(this),Ee||(ye(),Ee=window.setInterval(ye,6e4)),super.connectedCallback()}disconnectedCallback(){const t=ve.indexOf(this);-1!==t&&ve.splice(t,1),ve.length||Ee&&(clearInterval(Ee),Ee=null)}}const ve=[];let Ee;function ye(){let t,e,n;for(e=0,n=ve.length;e<n;e++)t=ve[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=RelativeTimeElement,window.customElements.define("relative-time",RelativeTimeElement));class TimeAgoElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new be(e,he(this)).microTimeAgo():new be(e,he(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=TimeAgoElement,window.customElements.define("time-ago",TimeAgoElement));class TimeUntilElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new be(e,he(this)).microTimeUntil():new be(e,he(this)).timeUntil()}}function Ae(t){return Array.from(t.querySelectorAll('[role="tablist"] [role="tab"]')).filter((e=>e instanceof HTMLElement&&e.closest(t.tagName)===t))}window.customElements.get("time-until")||(window.TimeUntilElement=TimeUntilElement,window.customElements.define("time-until",TimeUntilElement));class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if(e.closest(this.tagName)!==this)return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Ae(this),o=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]')))),[i,s]="vertical"===e.closest('[role="tablist"]')?.getAttribute("aria-orientation")?[["ArrowDown","ArrowRight"],["ArrowUp","ArrowLeft"]]:[["ArrowRight"],["ArrowLeft"]];if(i.some((e=>t.code===e))){let t=o+1;t>=n.length&&(t=0),this.selectTab(t)}else if(s.some((e=>t.code===e))){let t=o-1;t<0&&(t=n.length-1),this.selectTab(t)}else"Home"===t.code?(this.selectTab(0),t.preventDefault()):"End"===t.code&&(this.selectTab(n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Ae(this);if(!(t.target instanceof Element))return;if(t.target.closest(this.tagName)!==this)return;const n=t.target.closest('[role="tab"]');if(!(n instanceof HTMLElement&&n.closest('[role="tablist"]')))return;const o=e.indexOf(n);this.selectTab(o)}))}connectedCallback(){for(const t of Ae(this))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}selectTab(t){const e=Ae(this),n=Array.from(this.querySelectorAll('[role="tabpanel"]')).filter((t=>t.closest(this.tagName)===this));if(t>e.length-1)throw new RangeError(`Index "${t}" out of bounds`);const o=e[t],i=n[t];if(!!this.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:i}}))){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");o.setAttribute("aria-selected","true"),o.setAttribute("tabindex","0"),o.focus(),i.hidden=!1,this.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:i}}))}}}window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement))}();
2
2
  //# sourceMappingURL=primer_view_components.js.map