primer_view_components 0.0.68 → 0.0.69

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 537c5d2b6d37e3cfc2493426db201a7ea7268a00b3e5b06536d49956ad25658f
4
- data.tar.gz: a8aa51d217947855498867c2e18e0ad8d34ee5c9dd565170544e3deeec63a25f
3
+ metadata.gz: 1b0f7efb71450b05b7edc09813374ab1e63deb47a5180d4cbfed8fdd57cc692e
4
+ data.tar.gz: 36ace07547cd3e49da274a0ca66f90391933109fdfbd5540b99d337d5788f5c8
5
5
  SHA512:
6
- metadata.gz: e5965f3012b7407029185f7698020c0207d9541dcc8fe78e93fabf207de062eba38358f00c3c270189ee2811ace542f97941e2b6e4f96d77f05c33da23af9098
7
- data.tar.gz: 63b806a174ea5f35c89d2e5568781c010e307680b8bee36bb4de835b77cea5cc82c816bbfdd03d2b0ec283f47b23c8c351c9ef552a691dcd42097964bc88fa88
6
+ metadata.gz: 6c28eee740af6a8135ffe702e44802b312cc0a12d350fe83f04725026ee4cdb4f6b6c0ece0e3069c1124444649096ee02acbe1c443396e9dbea9b534f6959646
7
+ data.tar.gz: b8fadbf159c999e63d1395ffe4bd4973bdb60e3aac76ff96065d221e3528f600d888f666852acd466cc55da5dbdb9663217c3aa74e9da3a93668a5d1f6e5aa10
data/CHANGELOG.md CHANGED
@@ -30,6 +30,48 @@ The category for changes related to documentation, testing and tooling. Also, fo
30
30
 
31
31
  ## main
32
32
 
33
+ ## 0.0.69
34
+
35
+ ### New
36
+
37
+ - Add ability to attach custom CSS classes to items added to `Truncate` components.
38
+
39
+ _Cameron Dutro_
40
+
41
+ - Add `Primer::Alpha::Tooltip` component
42
+
43
+ _Kate Higa_, _Kristján Oddsson_
44
+
45
+ ### Breaking Changes
46
+
47
+ - Module for [script/update-statuses-project.rb](script/update-statuses-project.rb) changed to `GitHub`
48
+
49
+ _Josh Soref_
50
+
51
+ ### Misc
52
+
53
+ - Spelling fixes
54
+
55
+ _Josh Soref_
56
+
57
+ - Bump view_component in Gemfile.lock files
58
+
59
+ _Cameron Dutro_
60
+
61
+ - Remove markdown file mistakenly checked in.
62
+
63
+ _Kate Higa_
64
+
65
+ - Upgrade octicons to >= 17.0.0
66
+
67
+ _Jon Rohan_
68
+
69
+ ### Bug Fixes
70
+
71
+ - Fix missing @primer/components dependency.
72
+
73
+ _Hector Garcia_
74
+
33
75
  ## 0.0.68
34
76
 
35
77
  ### Updates
@@ -43,6 +85,7 @@ The category for changes related to documentation, testing and tooling. Also, fo
43
85
  _Lindsey Wild_
44
86
 
45
87
  - Migrate from Heroku to Azure for the Rails storybook server.
88
+ - Build storybook static assets into Docker image.
46
89
 
47
90
  _Cameron Dutro_
48
91
 
@@ -60,6 +103,10 @@ The category for changes related to documentation, testing and tooling. Also, fo
60
103
 
61
104
  _Cameron Dutro_
62
105
 
106
+ - Fix sequence of content in Subhead.
107
+
108
+ _Hector Garcia_
109
+
63
110
  ### Deprecations
64
111
 
65
112
  - Deprecate `Tooltip` component.
@@ -76,6 +123,10 @@ The category for changes related to documentation, testing and tooling. Also, fo
76
123
 
77
124
  _Lindsey Wild_
78
125
 
126
+ - Fix link in system arguments docs
127
+
128
+ _Lukas Spieß_
129
+
79
130
  ## 0.0.67
80
131
 
81
132
  - Updating octicons to `> 16`
@@ -1280,7 +1331,7 @@ The category for changes related to documentation, testing and tooling. Also, fo
1280
1331
 
1281
1332
  _Simon Taranto_
1282
1333
 
1283
- - Add `silence_deprecations` config to supress deprecation warnings.
1334
+ - Add `silence_deprecations` config to suppress deprecation warnings.
1284
1335
 
1285
1336
  _Manuel Puyol_
1286
1337
 
@@ -1,2 +1,2 @@
1
- const t=!!navigator.userAgent.match(/Macintosh/);class e{constructor(e,n){this.input=e,this.list=n,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=e=>function(e,n){if(e.shiftKey||e.metaKey||e.altKey)return;if(!t&&e.ctrlKey)return;if(n.isComposing)return;switch(e.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)})(n.input,n.list)&&e.preventDefault();break;case"Escape":n.clearSelection();break;case"ArrowDown":n.navigate(1),e.preventDefault();break;case"ArrowUp":n.navigate(-1),e.preventDefault();break;case"n":t&&e.ctrlKey&&(n.navigate(1),e.preventDefault());break;case"p":t&&e.ctrlKey&&(n.navigate(-1),e.preventDefault());break;default:if(e.ctrlKey)break;n.clearSelection()}}(e,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),e.setAttribute("role","combobox"),e.setAttribute("aria-controls",n.id),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-autocomplete","list"),e.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",n)}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",n)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(i)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(i),s=n.indexOf(e);if(s===n.length-1&&1===t||0===s&&-1===t)return this.clearSelection(),void this.input.focus();let r=1===t?0:n.length-1;if(e&&s>=0){const e=s+t;e>=0&&e<n.length&&(r=e)}const a=n[r];if(a)for(const t of n)a===t?(this.input.setAttribute("aria-activedescendant",a.id),a.setAttribute("aria-selected","true"),o(this.list,a)):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 n(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 i(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function o(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,o=e.offsetTop,s=o+e.clientHeight;return o>=n&&s<=i})(t,e)||(t.scrollTop=e.offsetTop)}class s extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const r=new WeakMap;function a(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=r.get(t);n&&n.abort();r.set(t,e);const i=()=>r.delete(t),o=function(t){return new Promise(((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()}))}(e);return o.then(i,i),o}(t,n)}class c{constructor(t,n,i){this.container=t,this.input=n,this.results=i,this.combobox=new e(n,i),this.results.hidden=!0,this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e=0){let n;return function(...i){clearTimeout(n),n=window.setTimeout((()=>{clearTimeout(n),t(...i)}),e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.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)}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)}onKeydown(t){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.container.value=n}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){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++}`}fetchResults(){const t=this.input.value.trim();if(!t)return void(this.container.open=!1);const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),a(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=!!this.results.querySelector('[role="option"]');this.container.open=e,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)}}const u=new WeakMap;class l extends HTMLElement{constructor(){super()}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);e instanceof HTMLInputElement&&n&&(u.set(this,new c(this,e,n)),n.setAttribute("role","listbox"))}disconnectedCallback(){const t=u.get(this);t&&(t.destroy(),u.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=u.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new s("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function d(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 h(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),d(n),e.removeChild(n),Promise.resolve()}function m(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)h(n).then(i);else if(e){const n="getRootNode"in Element.prototype?t.getRootNode():t.ownerDocument;if(!(n instanceof Document||"ShadowRoot"in window&&n instanceof ShadowRoot))return;const s=n.getElementById(e);s&&(o=s,o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement?h(o.value):o instanceof HTMLAnchorElement&&o.hasAttribute("href")?h(o.href):d(o)).then(i)}var o}function f(t){const e=t.currentTarget;e instanceof HTMLElement&&m(e)}function p(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),m(e))}}function g(t){t.currentTarget.addEventListener("keydown",p)}function b(t){t.currentTarget.removeEventListener("keydown",p)}window.customElements.get("auto-complete")||(window.AutocompleteElement=l,window.customElements.define("auto-complete",l));class w extends HTMLElement{constructor(){super(),this.addEventListener("click",f),this.addEventListener("focus",g),this.addEventListener("blur",b)}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=w,window.customElements.define("clipboard-copy",w));function v(t){t.style.display="inline-block"}function y(t){t.style.display="none"}const E=new WeakMap;document.addEventListener("clipboard-copy",(function({target:t}){if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=E.get(t);e?(clearTimeout(e),E.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(y(e),v(n))}(t),E.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(v(e),y(n))}(t),E.delete(t)}),2e3))}));class A extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]')),i=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]'))));if("ArrowRight"===t.code){let t=i+1;t>=n.length&&(t=0),M(this,t)}else if("ArrowLeft"===t.code){let t=i-1;t<0&&(t=n.length-1),M(this,t)}else"Home"===t.code?(M(this,0),t.preventDefault()):"End"===t.code&&(M(this,n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]'));if(!(t.target instanceof Element))return;const n=t.target.closest('[role="tab"]');if(!n||!n.closest('[role="tablist"]'))return;M(this,e.indexOf(n))}))}connectedCallback(){for(const t of this.querySelectorAll('[role="tablist"] [role="tab"]'))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"))}}function M(t,e){const n=t.querySelectorAll('[role="tablist"] [role="tab"]'),i=t.querySelectorAll('[role="tabpanel"]'),o=n[e],s=i[e];if(!!t.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of n)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)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(),s.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}window.customElements.get("tab-container")||(window.TabContainerElement=A,window.customElements.define("tab-container",A));const x=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],T=["January","February","March","April","May","June","July","August","September","October","November","December"];function L(t){return`0${t}`.slice(-2)}function k(t,e){const n=t.getDay(),i=t.getDate(),o=t.getMonth(),s=t.getFullYear(),r=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let u;switch(e[1]){case"%":return"%";case"a":return x[n].slice(0,3);case"A":return x[n];case"b":return T[o].slice(0,3);case"B":return T[o];case"c":return t.toString();case"d":return L(i);case"e":return String(i);case"H":return L(r);case"I":return L(k(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return L(o+1);case"M":return L(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return L(c);case"w":return String(n);case"y":return L(s%100);case"Y":return String(s);case"Z":return u=t.toString().match(/\((\w+)\)$/),u?u[1]:"";case"z":return u=t.toString().match(/\w([+-]\d\d\d\d) /),u?u[1]:""}return""}))}function S(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 C=null;const H=S({day:"numeric",month:"short"});function D(){if(null!==C)return C;const t=H();if(t){const e=t.format(new Date(0));return C=!!e.match(/^\d/),C}return!1}let q=null;const I=S({day:"numeric",month:"short",year:"numeric"});function $(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const R=new WeakMap;class F 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 i=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?R.delete(this):R.set(this,new Date(t))}const o=this.getFormattedTitle(),s=this.getAttribute("title");"title"===t||!o||s&&s!==i||this.setAttribute("title",o);const r=this.getFormattedDate();r&&(this.textContent=r)}get date(){return R.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=Y();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const Y=S({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),W=new WeakMap;class X extends F{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||W.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 i=D()?"weekday day month year":"weekday month day, year";for(const e in n){const o=n[e][t.getAttribute(e)||""];i=i.replace(e,o||"")}return i=i.replace(/(\s,)|(,\s$)/,""),k(e,i).replace(/\s+/," ").trim()}(this,t)||""} ${function(t,e){const n={},i=t.getAttribute("hour");"numeric"!==i&&"2-digit"!==i||(n.hour=i);const o=t.getAttribute("minute");"numeric"!==o&&"2-digit"!==o||(n.minute=o);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=W.get(t);a||(a=S(n),W.set(t,a));const c=a();if(c)return c.format(e);return k(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=X,window.customElements.define("local-time",X));class K{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),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24);return t>=0&&o<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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return t<0||e<10?O(this.locale,0,"second"):e<45?O(this.locale,-e,"second"):e<90||n<45?O(this.locale,-n,"minute"):n<90||i<24?O(this.locale,-i,"hour"):i<36||o<30?O(this.locale,-o,"day"):s<18?O(this.locale,-s,"month"):O(this.locale,-r,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return n<1?"1m":n<60?`${n}m`:i<24?`${i}h`:o<365?`${o}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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return s>=18||s>=12?O(this.locale,r,"year"):o>=45||o>=30?O(this.locale,s,"month"):i>=36||i>=24?O(this.locale,o,"day"):n>=90||n>=45?O(this.locale,i,"hour"):e>=90||e>=45?O(this.locale,n,"minute"):O(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),i=Math.round(n/60),o=Math.round(i/24),s=Math.round(o/30),r=Math.round(s/12);return o>=365?`${r}y`:i>=24?`${o}d`:n>=60?`${i}h`:n>1?`${n}m`:"1m"}formatDate(){let t=D()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==q)return q;const t=I();if(t){const e=t.format(new Date(0));return q=!!e.match(/\d,/),q}return!0}()?", %Y":" %Y"),k(this.date,t)}formatTime(){const t=U();return t?t.format(this.date):k(this.date,"%l:%M%P")}}function O(t,e,n){const i=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 i?i.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 U=S({hour:"numeric",minute:"2-digit"});class z extends F{getFormattedDate(){const t=this.date;if(t)return new K(t,$(this)).toString()}connectedCallback(){P.push(this),B||(N(),B=window.setInterval(N,6e4)),super.connectedCallback()}disconnectedCallback(){const t=P.indexOf(this);-1!==t&&P.splice(t,1),P.length||B&&(clearInterval(B),B=null)}}const P=[];let B;function N(){let t,e,n;for(e=0,n=P.length;e<n;e++)t=P[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=z,window.customElements.define("relative-time",z));class Z extends z{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new K(e,$(this)).microTimeAgo():new K(e,$(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=Z,window.customElements.define("time-ago",Z));class j extends z{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new K(e,$(this)).microTimeUntil():new K(e,$(this)).timeUntil()}}window.customElements.get("time-until")||(window.TimeUntilElement=j,window.customElements.define("time-until",j));const J=new WeakMap,G=new WeakMap,Q=new WeakMap;function V(t){const e=t.currentTarget;if(!(e instanceof rt))return;const{box:n,image:i}=Q.get(e)||{};if(!n||!i)return;let o=0,s=0;if(t instanceof KeyboardEvent)"ArrowUp"===t.key?s=-1:"ArrowDown"===t.key?s=1:"ArrowLeft"===t.key?o=-1:"ArrowRight"===t.key&&(o=1);else if(G.has(e)&&t instanceof MouseEvent){const n=G.get(e);o=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(G.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=G.get(e);o=n-r,s=i-a}if(0!==o||0!==s){const t=Math.min(Math.max(0,n.offsetLeft+o),i.width-n.offsetWidth),r=Math.min(Math.max(0,n.offsetTop+s),i.height-n.offsetHeight);n.style.left=`${t}px`,n.style.top=`${r}px`,st(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)G.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:i}=t.changedTouches[0];G.set(e,{dragStartX:n,dragStartY:i})}}function _(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=tt(e);if(!(n instanceof rt))return;const{box:i}=Q.get(n)||{};if(!i)return;const o=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return it(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=i.offsetWidth+a,r=i.offsetHeight+a,J.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=J.get(n);if(!e)return;s=t.pageX-e.startX-o.left-window.pageXOffset,r=t.pageY-e.startY-o.top-window.pageYOffset}else if(t instanceof TouchEvent){const e=J.get(n);if(!e)return;s=t.changedTouches[0].pageX-e.startX-o.left-window.pageXOffset,r=t.changedTouches[0].pageY-e.startY-o.top-window.pageYOffset}s&&r&&nt(n,s,r,!(t instanceof KeyboardEvent))}function tt(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function et(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=tt(e);if(!(n instanceof rt))return;const{box:i}=Q.get(n)||{};if(!i)return;const o=t.target;if(o instanceof HTMLElement)if(o.hasAttribute("data-direction")){const e=o.getAttribute("data-direction")||"";n.addEventListener("mousemove",_),n.addEventListener("touchmove",_,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),J.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),_(t)}else n.addEventListener("mousemove",V),n.addEventListener("touchmove",V,{passive:!0})}function nt(t,e,n,i=!0){let o=Math.max(Math.abs(e),Math.abs(n),10);const s=J.get(t);if(!s)return;const{box:r,image:a}=Q.get(t)||{};if(!r||!a)return;o=Math.min(o,n>0?a.height-s.startY:s.startY,e>0?a.width-s.startX:s.startX);const c=i?Math.round(Math.max(0,e>0?s.startX:s.startX-o)):r.offsetLeft,u=i?Math.round(Math.max(0,n>0?s.startY:s.startY-o)):r.offsetTop;r.style.left=`${c}px`,r.style.top=`${u}px`,r.style.width=`${o}px`,r.style.height=`${o}px`,st(t,{x:c,y:u,width:o,height:o})}function it(t){const{image:e}=Q.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);J.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),nt(t,n,n)}function ot(t){const e=t.currentTarget;e instanceof rt&&(G.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",_),e.removeEventListener("mousemove",V),e.removeEventListener("touchmove",_),e.removeEventListener("touchmove",V))}function st(t,e){const{image:n}=Q.get(t)||{};if(!n)return;const i=n.naturalWidth/n.width;for(const n in e){const o=Math.round(e[n]*i);e[n]=o;const s=t.querySelector(`[data-image-crop-input='${n}']`);s instanceof HTMLInputElement&&(s.value=o.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class rt extends HTMLElement{connectedCallback(){if(Q.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&&(Q.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,it(this)})),this.addEventListener("mouseleave",ot),this.addEventListener("touchend",ot),this.addEventListener("mouseup",ot),e.addEventListener("mousedown",et),e.addEventListener("touchstart",et,{passive:!0}),this.addEventListener("keydown",V),this.addEventListener("keydown",_),this.src&&(n.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=Q.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=rt,window.customElements.define("image-crop",rt));class at 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=[lt(t,"compositionstart",(t=>yt(this,t))),lt(t,"compositionend",(t=>yt(this,t))),lt(t,"click",(e=>gt(t,e))),lt(t,"change",(e=>gt(t,e))),lt(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=ct.get(e);if(!i||i.isComposing)return;const o=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(vt(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=ft(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{o&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=ft(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(pt&&n.ctrlKey){const e=ft(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(pt&&n.ctrlKey){const e=ft(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&wt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),lt(t,"toggle",(()=>dt(t,this)),{once:!0}),lt(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?lt(t,"mouseover",(()=>dt(t,this)),{once:!0}):ut,...ht(t)];ct.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=ct.get(this);if(t){ct.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const ct=new WeakMap,ut={unsubscribe(){}};function lt(t,e,n,i=!1){return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function dt(t,e){const n=e.getAttribute("src");if(!n)return;const i=ct.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const o=e.querySelector("include-fragment");o&&!o.hasAttribute("src")&&(o.addEventListener("loadend",(()=>mt(t))),o.setAttribute("src",n))}function ht(t){let e=!1;return[lt(t,"mousedown",(()=>e=!0)),lt(t,"keydown",(()=>e=!1)),lt(t,"toggle",(()=>{t.hasAttribute("open")&&(mt(t)||e||function(t){const e=document.activeElement;if(e&&wt(e)&&t.contains(e))return;const n=ft(t,!0);n&&n.focus()}(t))}))]}function mt(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function ft(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),i=document.activeElement,o=i instanceof HTMLElement?n.indexOf(i):-1,s=e?n[o+1]:n[o-1],r=e?n[0]:n[n.length-1];return s||r}const pt=navigator.userAgent.match(/Macintosh/);function gt(t,e){const n=e.target;if(n instanceof Element&&n.closest("details")===t)if("click"===e.type){const e=n.closest('[role="menuitem"], [role="menuitemradio"]');if(!e)return;const i=e.querySelector("input");if("LABEL"===e.tagName&&n===i)return;"LABEL"===e.tagName&&i&&!i.checked||bt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&bt(e,t)}}function bt(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");if(!n)return;n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(i)n.textContent=i;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=(n===t).toString();e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked.toString()),n.setAttribute("aria-checked",i)}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&vt(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function wt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function vt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function yt(t,e){const n=ct.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=at,window.customElements.define("details-menu",at));
1
+ const t=!!navigator.userAgent.match(/Macintosh/);class e{constructor(e,n){this.input=e,this.list=n,this.isComposing=!1,n.id||(n.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=e=>function(e,n){if(e.shiftKey||e.metaKey||e.altKey)return;if(!t&&e.ctrlKey)return;if(n.isComposing)return;switch(e.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)})(n.input,n.list)&&e.preventDefault();break;case"Escape":n.clearSelection();break;case"ArrowDown":n.navigate(1),e.preventDefault();break;case"ArrowUp":n.navigate(-1),e.preventDefault();break;case"n":t&&e.ctrlKey&&(n.navigate(1),e.preventDefault());break;case"p":t&&e.ctrlKey&&(n.navigate(-1),e.preventDefault());break;default:if(e.ctrlKey)break;n.clearSelection()}}(e,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),e.setAttribute("role","combobox"),e.setAttribute("aria-controls",n.id),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-autocomplete","list"),e.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",n)}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",n)}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(o)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(o),s=n.indexOf(e);if(s===n.length-1&&1===t||0===s&&-1===t)return this.clearSelection(),void this.input.focus();let r=1===t?0:n.length-1;if(e&&s>=0){const e=s+t;e>=0&&e<n.length&&(r=e)}const a=n[r];if(a)for(const t of n)a===t?(this.input.setAttribute("aria-activedescendant",a.id),a.setAttribute("aria-selected","true"),i(this.list,a)):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 n(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 o(t){return!t.hidden&&!(t instanceof HTMLInputElement&&"hidden"===t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function i(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)}class s extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const r=new WeakMap;function a(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=r.get(t);n&&n.abort();r.set(t,e);const o=()=>r.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)}class c{constructor(t,n,o){this.container=t,this.input=n,this.results=o,this.combobox=new e(n,o),this.results.hidden=!0,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.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)}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)}onKeydown(t){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.container.value=n}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){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++}`}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")),a(this.input,n.toString()).then((t=>{this.results.innerHTML=t,this.identifyOptions();const e=!!this.results.querySelector('[role="option"]');this.container.open=e,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)}}const l=new WeakMap;class u extends HTMLElement{constructor(){super()}connectedCallback(){const t=this.getAttribute("for");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);e instanceof HTMLInputElement&&n&&(l.set(this,new c(this,e,n)),n.setAttribute("role","listbox"))}disconnectedCallback(){const t=l.get(this);t&&(t.destroy(),l.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=l.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 s("auto-complete-change",{bubbles:!0,relatedTarget:o.input}))}}}function d(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 h(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),d(n),e.removeChild(n),Promise.resolve()}function f(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function o(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)h(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?h(i.value):i instanceof HTMLAnchorElement&&i.hasAttribute("href")?h(i.href):d(i)).then(o)}var i}function m(t){const e=t.currentTarget;e instanceof HTMLElement&&f(e)}function p(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),f(e))}}function g(t){t.currentTarget.addEventListener("keydown",p)}function b(t){t.currentTarget.removeEventListener("keydown",p)}window.customElements.get("auto-complete")||(window.AutocompleteElement=u,window.customElements.define("auto-complete",u));class w extends HTMLElement{constructor(){super(),this.addEventListener("click",m),this.addEventListener("focus",g),this.addEventListener("blur",b)}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=w,window.customElements.define("clipboard-copy",w));function v(t){t.style.display="inline-block"}function y(t){t.style.display="none"}const E=new WeakMap;document.addEventListener("clipboard-copy",(function({target:t}){if(!(t instanceof HTMLElement))return;if(!t.hasAttribute("data-view-component"))return;const e=E.get(t);e?(clearTimeout(e),E.delete(t)):function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(y(e),v(n))}(t),E.set(t,setTimeout((()=>{!function(t){const[e,n]=t.querySelectorAll(".octicon");e&&n&&(v(e),y(n))}(t),E.delete(t)}),2e3))}));class A extends HTMLElement{constructor(){super(),this.addEventListener("keydown",(t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]')),o=n.indexOf(n.find((t=>t.matches('[aria-selected="true"]'))));if("ArrowRight"===t.code){let t=o+1;t>=n.length&&(t=0),x(this,t)}else if("ArrowLeft"===t.code){let t=o-1;t<0&&(t=n.length-1),x(this,t)}else"Home"===t.code?(x(this,0),t.preventDefault()):"End"===t.code&&(x(this,n.length-1),t.preventDefault())})),this.addEventListener("click",(t=>{const e=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]'));if(!(t.target instanceof Element))return;const n=t.target.closest('[role="tab"]');if(!n||!n.closest('[role="tablist"]'))return;x(this,e.indexOf(n))}))}connectedCallback(){for(const t of this.querySelectorAll('[role="tablist"] [role="tab"]'))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"))}}function x(t,e){const n=t.querySelectorAll('[role="tablist"] [role="tab"]'),o=t.querySelectorAll('[role="tabpanel"]'),i=n[e],s=o[e];if(!!t.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:s}}))){for(const t of n)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of o)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");i.setAttribute("aria-selected","true"),i.setAttribute("tabindex","0"),i.focus(),s.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:s}}))}}window.customElements.get("tab-container")||(window.TabContainerElement=A,window.customElements.define("tab-container",A));const M=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],T=["January","February","March","April","May","June","July","August","September","October","November","December"];function k(t){return`0${t}`.slice(-2)}function L(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 M[n].slice(0,3);case"A":return M[n];case"b":return T[i].slice(0,3);case"B":return T[i];case"c":return t.toString();case"d":return k(o);case"e":return String(o);case"H":return k(r);case"I":return k(L(t,"%l"));case"l":return String(0===r||12===r?12:(r+12)%12);case"m":return k(i+1);case"M":return k(a);case"p":return r>11?"PM":"AM";case"P":return r>11?"pm":"am";case"S":return k(c);case"w":return String(n);case"y":return k(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 S(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 C=null;const H=S({day:"numeric",month:"short"});function D(){if(null!==C)return C;const t=H();if(t){const e=t.format(new Date(0));return C=!!e.match(/^\d/),C}return!1}let $=null;const I=S({day:"numeric",month:"short",year:"numeric"});function R(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const q=new WeakMap;class F 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)?q.delete(this):q.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 q.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=W();if(e)return e.format(t);try{return t.toLocaleString()}catch(e){if(e instanceof RangeError)return t.toString();throw e}}getFormattedDate(){}}const W=S({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),O=new WeakMap;class Y extends F{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||O.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=D()?"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$)/,""),L(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=O.get(t);a||(a=S(n),O.set(t,a));const c=a();if(c)return c.format(e);return L(e,n.second?"%H:%M:%S":"%H:%M")}(this,t)||""}`.trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=Y,window.customElements.define("local-time",Y));class B{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?X(this.locale,0,"second"):e<45?X(this.locale,-e,"second"):e<90||n<45?X(this.locale,-n,"minute"):n<90||o<24?X(this.locale,-o,"hour"):o<36||i<30?X(this.locale,-i,"day"):s<18?X(this.locale,-s,"month"):X(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?X(this.locale,r,"year"):i>=45||i>=30?X(this.locale,s,"month"):o>=36||o>=24?X(this.locale,i,"day"):n>=90||n>=45?X(this.locale,o,"hour"):e>=90||e>=45?X(this.locale,n,"minute"):X(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=D()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==$)return $;const t=I();if(t){const e=t.format(new Date(0));return $=!!e.match(/\d,/),$}return!0}()?", %Y":" %Y"),L(this.date,t)}formatTime(){const t=K();return t?t.format(this.date):L(this.date,"%l:%M%P")}}function X(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 K=S({hour:"numeric",minute:"2-digit"});class U extends F{getFormattedDate(){const t=this.date;if(t)return new B(t,R(this)).toString()}connectedCallback(){P.push(this),z||(N(),z=window.setInterval(N,6e4)),super.connectedCallback()}disconnectedCallback(){const t=P.indexOf(this);-1!==t&&P.splice(t,1),P.length||z&&(clearInterval(z),z=null)}}const P=[];let z;function N(){let t,e,n;for(e=0,n=P.length;e<n;e++)t=P[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=U,window.customElements.define("relative-time",U));class j extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new B(e,R(this)).microTimeAgo():new B(e,R(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=j,window.customElements.define("time-ago",j));class Z extends U{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new B(e,R(this)).microTimeUntil():new B(e,R(this)).timeUntil()}}window.customElements.get("time-until")||(window.TimeUntilElement=Z,window.customElements.define("time-until",Z));const J=new WeakMap,G=new WeakMap,Q=new WeakMap;function V(t){const e=t.currentTarget;if(!(e instanceof rt))return;const{box:n,image:o}=Q.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(G.has(e)&&t instanceof MouseEvent){const n=G.get(e);i=t.pageX-n.dragStartX,s=t.pageY-n.dragStartY}else if(G.has(e)&&t instanceof TouchEvent){const{pageX:n,pageY:o}=t.changedTouches[0],{dragStartX:r,dragStartY:a}=G.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`,st(e,{x:t,y:r,width:n.offsetWidth,height:n.offsetHeight})}if(t instanceof MouseEvent)G.set(e,{dragStartX:t.pageX,dragStartY:t.pageY});else if(t instanceof TouchEvent){const{pageX:n,pageY:o}=t.changedTouches[0];G.set(e,{dragStartX:n,dragStartY:o})}}function _(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=tt(e);if(!(n instanceof rt))return;const{box:o}=Q.get(n)||{};if(!o)return;const i=n.getBoundingClientRect();let s,r,a;if(t instanceof KeyboardEvent){if("Escape"===t.key)return ot(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;s=o.offsetWidth+a,r=o.offsetHeight+a,J.set(n,{startX:o.offsetLeft,startY:o.offsetTop})}else if(t instanceof MouseEvent){const e=J.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=J.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&&nt(n,s,r,!(t instanceof KeyboardEvent))}function tt(t){const e=t.getRootNode();return e instanceof ShadowRoot?e.host:t}function et(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=tt(e);if(!(n instanceof rt))return;const{box:o}=Q.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",_),n.addEventListener("touchmove",_,{passive:!0}),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),J.set(n,{startX:o.offsetLeft+(["se","ne"].indexOf(e)>=0?0:o.offsetWidth),startY:o.offsetTop+(["se","sw"].indexOf(e)>=0?0:o.offsetHeight)}),_(t)}else n.addEventListener("mousemove",V),n.addEventListener("touchmove",V,{passive:!0})}function nt(t,e,n,o=!0){let i=Math.max(Math.abs(e),Math.abs(n),10);const s=J.get(t);if(!s)return;const{box:r,image:a}=Q.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`,st(t,{x:c,y:l,width:i,height:i})}function ot(t){const{image:e}=Q.get(t)||{};if(!e)return;const n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);J.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),nt(t,n,n)}function it(t){const e=t.currentTarget;e instanceof rt&&(G.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",_),e.removeEventListener("mousemove",V),e.removeEventListener("touchmove",_),e.removeEventListener("touchmove",V))}function st(t,e){const{image:n}=Q.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 rt extends HTMLElement{connectedCallback(){if(Q.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&&(Q.set(this,{box:e,image:n}),n.addEventListener("load",(()=>{this.loaded=!0,ot(this)})),this.addEventListener("mouseleave",it),this.addEventListener("touchend",it),this.addEventListener("mouseup",it),e.addEventListener("mousedown",et),e.addEventListener("touchstart",et,{passive:!0}),this.addEventListener("keydown",V),this.addEventListener("keydown",_),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}=Q.get(this)||{};"src"===t&&(this.loaded=!1,o&&(o.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=rt,window.customElements.define("image-crop",rt));class at 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=[ut(t,"compositionstart",(t=>yt(this,t))),ut(t,"compositionend",(t=>yt(this,t))),ut(t,"click",(e=>gt(t,e))),ut(t,"change",(e=>gt(t,e))),ut(t,"keydown",(e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const o=ct.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")&&(vt(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{i&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=mt(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{i&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=mt(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(pt&&n.ctrlKey){const e=mt(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(pt&&n.ctrlKey){const e=mt(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e instanceof HTMLElement&&wt(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e))),ut(t,"toggle",(()=>dt(t,this)),{once:!0}),ut(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?ut(t,"mouseover",(()=>dt(t,this)),{once:!0}):lt,...ht(t)];ct.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=ct.get(this);if(t){ct.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const ct=new WeakMap,lt={unsubscribe(){}};function ut(t,e,n,o=!1){return t.addEventListener(e,n,o),{unsubscribe:()=>{t.removeEventListener(e,n,o)}}}function dt(t,e){const n=e.getAttribute("src");if(!n)return;const o=ct.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",(()=>ft(t))),i.setAttribute("src",n))}function ht(t){let e=!1;return[ut(t,"mousedown",(()=>e=!0)),ut(t,"keydown",(()=>e=!1)),ut(t,"toggle",(()=>{t.hasAttribute("open")&&(ft(t)||e||function(t){const e=document.activeElement;if(e&&wt(e)&&t.contains(e))return;const n=mt(t,!0);n&&n.focus()}(t))}))]}function ft(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("details-menu [autofocus]");return!!e&&(e.focus(),!0)}function mt(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),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 pt=navigator.userAgent.match(/Macintosh/);function gt(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||bt(e,t)}else if("change"===e.type){const e=n.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&bt(e,t)}}function bt(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")&&vt(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function wt(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function vt(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function yt(t,e){const n=ct.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=at,window.customElements.define("details-menu",at));const Et={"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"]};function At(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=St(n,o,i,s,a,c),d=i;if(u.top-=e.top,u.left-=e.left,!r){const r=Et[i];let h=0;if(r){let t=i;for(;h<r.length&&Ct(t,u,l,n);){const i=r[h++];t=i,u=St(n,o,i,s,a,c),u.top-=e.top,u.left-=e.left,d=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&&h<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})}(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:xt,a=null!==(n=t.align)&&void 0!==n?n:Mt;return{side:r,align:a,anchorOffset:null!==(o=t.anchorOffset)&&void 0!==o?o:"inside-center"===r?0:Tt,alignmentOffset:null!==(i=t.alignmentOffset)&&void 0!==i?i:"center"!==a&&r.startsWith("inside")?kt:0,allowOutOfBounds:null!==(s=t.allowOutOfBounds)&&void 0!==s?s:Lt}}(n))}const xt="outside-bottom",Mt="start",Tt=4,kt=4,Lt=!1;function St(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 Ct(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}var Ht,Dt,$t,It,Rt,qt,Ft,Wt=function(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},Ot=function(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)};const Yt=["tooltip-n","tooltip-s","tooltip-e","tooltip-w","tooltip-ne","tooltip-se","tooltip-nw","tooltip-sw"];class Bt extends HTMLElement{constructor(){super(),Ht.add(this),Dt.set(this,void 0),$t.set(this,"center"),It.set(this,"outside-bottom"),Rt.set(this,!1);this.attachShadow({mode:"open"}).innerHTML=`\n <style>\n ${this.styles()}\n </style>\n <slot></slot>\n `}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 }\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-se):before,\n :host(.tooltip-sw):before {\n right: 50%;\n bottom: 100%;\n margin-right: -6px;\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 right: 50%;\n margin-right: -6px;\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 right: auto\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)}connectedCallback(){var t;if(this.hidden=!0,Wt(this,Rt,!0,"f"),this.id||(this.id=`tooltip-${Date.now()}-${(1e4*Math.random()).toFixed(0)}`),!this.control)return;this.setAttribute("role","tooltip"),null===(t=Ot(this,Dt,"f"))||void 0===t||t.abort(),Wt(this,Dt,new AbortController,"f");const{signal:e}=Ot(this,Dt,"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})}disconnectedCallback(){var t;null===(t=Ot(this,Dt,"f"))||void 0===t||t.abort()}handleEvent(t){this.control&&("mouseenter"!==t.type&&"focus"!==t.type||!this.hidden?"blur"===t.type||"mouseleave"===t.type&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hidden=!0:"keydown"!==t.type||"Escape"!==t.key||this.hidden||(this.hidden=!0):this.hidden=!1)}attributeChangedCallback(t){if("id"===t||"data-type"===t){if(!this.id||!this.control)return;if("label"===this.type)this.control.setAttribute("aria-labelledby",this.id);else{let t=this.control.getAttribute("aria-describedby");t=t?`${t} ${this.id}`:this.id,this.control.setAttribute("aria-describedby",t)}}else if("hidden"===t)if(this.hidden)this.classList.remove("tooltip-open",...Yt);else{this.classList.add("tooltip-open");for(const t of this.ownerDocument.querySelectorAll(this.tagName))t!==this&&(t.hidden=!0);Ot(this,Ht,"m",Ft).call(this)}else if("data-direction"===t){this.classList.remove(...Yt);const t=this.direction;"n"===t?(Wt(this,$t,"center","f"),Wt(this,It,"outside-top","f")):"ne"===t?(Wt(this,$t,"start","f"),Wt(this,It,"outside-top","f")):"e"===t?(Wt(this,$t,"center","f"),Wt(this,It,"outside-right","f")):"se"===t?(Wt(this,$t,"start","f"),Wt(this,It,"outside-bottom","f")):"s"===t?(Wt(this,$t,"center","f"),Wt(this,It,"outside-bottom","f")):"sw"===t?(Wt(this,$t,"end","f"),Wt(this,It,"outside-bottom","f")):"w"===t?(Wt(this,$t,"center","f"),Wt(this,It,"outside-left","f")):"nw"===t&&(Wt(this,$t,"end","f"),Wt(this,It,"outside-top","f"))}}}Dt=new WeakMap,$t=new WeakMap,It=new WeakMap,Rt=new WeakMap,Ht=new WeakSet,qt=function(t){if(!this.control)return;const e=this.getBoundingClientRect(),n=this.control.getBoundingClientRect(),o=e.width,i=e.left+o/2,s=n.x+n.width/2;return Math.abs(i-s)<2||"outside-left"===t||"outside-right"===t?"center":e.left===n.left?"start":e.right===n.right?"end":i<s?0===e.left?"start":"end":0===e.right?"end":"start"},Ft=function(){if(!this.control)return;if(!Ot(this,Rt,"f")||this.hidden)return;this.style.left="0px";let t=At(this,this.control,{side:Ot(this,It,"f"),align:Ot(this,$t,"f"),anchorOffset:10}),e=t.anchorSide;this.style.top=`${t.top}px`,this.style.left=`${t.left}px`;let n="s";const o=Ot(this,Ht,"m",qt).call(this,e);o&&(this.style.left="0px",t=At(this,this.control,{side:e,align:o,anchorOffset:10}),e=t.anchorSide,this.style.top=`${t.top}px`,this.style.left=`${t.left}px`,n="outside-left"===e?"w":"outside-right"===e?"e":"outside-top"===e?"center"===o?"n":"start"===o?"ne":"nw":"center"===o?"s":"start"===o?"se":"sw",this.classList.add(`tooltip-${n}`))},Bt.observedAttributes=["data-type","data-direction","id","hidden"],window.customElements.get("tool-tip")||(window.TooltipElement=Bt,window.customElements.define("tool-tip",Bt));
2
2
  //# sourceMappingURL=primer_view_components.js.map